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
locale: string; // Custom specified locale ID
function CandyDate(date) { // if (!(this instanceof CandyDate)) { // return new CandyDate(date); // } if (date) { if (date instanceof Date) { this.nativeDate = date; } else if (typeof date === 'string') { this.nativeDate = new Date(date); } else { throw new Error('The input date type is not supported ("Date" and "string" is now recommended)'); } } else { this.nativeDate = new Date(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocaleId() {\n return LOCALE_ID;\n}", "function getLocaleId() {\n return LOCALE_ID;\n}", "function getLocaleId() {\n return LOCALE_ID;\n}", "function getLocaleId() {\n return LOCALE_ID;\n}", "function getLocaleId() {\n return LOCALE_ID;\n}", "function getLocaleId() {\n return LOCALE_ID;\n}", "function getLocaleId() {\n return LOCALE_ID;\n}", "function getLocaleId() {\n return LOCALE_ID$1;\n}", "static getLocale() {\n return 'en_US';\n }", "setLocale(locale) {\n this.locale = locale;\n }", "function getLocaleId() {\n return LOCALE_ID;\n }", "function getLocaleId(locale){return findLocaleData(locale)[0/* LocaleId */];}", "function setLocaleId(localeId) {\n LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');\n}", "SET_LOCALE(state, { locale }) {\n state.locale = locale\n }", "function getLocaleId(locale) {\n return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].LocaleId];\n}", "function getLocaleId(locale) {\n return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].LocaleId];\n}", "function getLocaleId(locale) {\n return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].LocaleId];\n}", "function getLocaleId(locale) {\n return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].LocaleId];\n}", "function getLocaleId(locale) {\n return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].LocaleId];\n}", "function getLocaleId(locale) {\n return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].LocaleId];\n}", "function getLocaleId(locale) {\n return Object(_angular_core__WEBPACK_IMPORTED_MODULE_6__[\"ɵfindLocaleData\"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_6__[\"ɵLocaleDataIndex\"].LocaleId];\n}", "function getLocaleId(locale) {\n return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].LocaleId];\n}", "function getLocaleId(locale) {\n return Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].LocaleId];\n }", "get locale() {\n\t\treturn this.nativeElement ? this.nativeElement.locale : undefined;\n\t}", "get locale() {\n\t\treturn this.nativeElement ? this.nativeElement.locale : undefined;\n\t}", "get locale() {\n\t\treturn this.nativeElement ? this.nativeElement.locale : undefined;\n\t}", "function getLocaleId(locale) {\n return findLocaleData(locale)[0 /* LocaleId */];\n}", "function getLocaleId(locale) {\n return findLocaleData(locale)[0 /* LocaleId */];\n}", "function getLocaleId(locale) {\n return findLocaleData(locale)[0 /* LocaleId */];\n}", "setLocale(context, payload) {\n context.commit({\n type: 'SET_LOCALE',\n locale: payload.locale\n })\n }", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data = getLocale(key);}else {data = defineLocale(key,values);}if(data){ // moment.duration._locale = moment._locale = data;\nglobalLocale = data;}else {if(typeof console !== 'undefined' && console.warn){ //warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale ' + key + ' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "static function setLocale(name : string) : void {\n _Locale.setCurrentLocale(name);\n }", "function setLocaleId(localeId) {\n assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');\n }\n}", "function setLocaleId(localeId) {\n assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');\n }\n}", "function setLocaleId(localeId) {\n assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');\n }\n}", "function setLocaleId(localeId) {\n assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');\n }\n}", "function setLocaleId(localeId) {\n assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');\n }\n}", "function setLocaleId(localeId) {\n assertDefined(localeId, \"Expected localeId to be defined\");\n\n if (typeof localeId === 'string') {\n LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');\n }\n}", "get() {\n return defaultLocale;\n }", "function SetLocale(locale)\n{\n\tlocaleUsed = locale;\n\tUpdate();\n}", "requiresTranslation(key, locale) {\n return locale === 'ru' || locale === 'en';\n }", "function setLocaleId(localeId) {\n assertDefined(localeId, \"Expected localeId to be defined\");\n\n if (typeof localeId === 'string') {\n LOCALE_ID = localeId.toLowerCase().replace(/_/g, '-');\n }\n }", "function locale(key){var newLocaleData;if(key === undefined){return this._locale._abbr;}else {newLocaleData = getLocale(key);if(newLocaleData != null){this._locale = newLocaleData;}return this;}}", "function setLocaleId(localeId) {\n assertDefined(localeId, `Expected localeId to be defined`);\n if (typeof localeId === 'string') {\n LOCALE_ID$1 = localeId.toLowerCase().replace(/_/g, '-');\n }\n}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function getLanguage() {\n return 'en-us';\n}", "getDefaultLocale() {\n return this.defaultLocale;\n }", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=locale_locales__getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "function locale(key){var newLocaleData;if(key===undefined){return this._locale._abbr;}else{newLocaleData=locale_locales__getLocale(key);if(newLocaleData!=null){this._locale=newLocaleData;}return this;}}", "setLocale(locale) {\n if (this.state.locale !== locale) {\n switch (locale) {\n case 'de':\n this.setState({locale: locale, messages: intlMessagesDE});\n break;\n case 'en':\n this.setState({locale: locale, messages: intlMessagesEN});\n break;\n }\n }\n }", "function getLocaleString(id)\r\n{\r\n\tvar lang = getUrlParameter(\"l\");\r\n\treturn locale[lang + \".\" + id] || id;\r\n}", "function MapLocale() {\n this.localeID = 0;\n this.localeVisitCount = 0;\n this.localeName = \"localeName\";\n this.localeDesc = \"localeDesc\";\n this.localeDirBlocked = \"Erm... sorry, you can't go that way.\";\n }", "function switchLocale(locale) {\n const previous = rootLocale;\n rootLocale = locale ? Object(_util_main__WEBPACK_IMPORTED_MODULE_8__[\"normalizeLocale\"])(locale) : '';\n if (previous !== rootLocale) {\n if (Object(_cldr_load__WEBPACK_IMPORTED_MODULE_7__[\"isLoaded\"])('supplemental', 'likelySubtags')) {\n globalize_dist_globalize_message__WEBPACK_IMPORTED_MODULE_6__[\"load\"]({\n main: {\n [rootLocale]: {}\n }\n });\n globalize_dist_globalize_message__WEBPACK_IMPORTED_MODULE_6__[\"locale\"](rootLocale);\n }\n localeProducer.emit({ type: 'change', target: rootLocale });\n }\n}", "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "function locale(localeCode,newFcOptions){var fcOptions;var momOptions;// get the FullCalendar internal option hash for this locale. create if necessary\nfcOptions=exports.localeOptionHash[localeCode]||(exports.localeOptionHash[localeCode]={});// provided new options for this locales? merge them in\nif(newFcOptions){fcOptions=exports.localeOptionHash[localeCode]=options_1.mergeOptions([fcOptions,newFcOptions]);}// compute locale options that weren't defined.\n// always do this. newFcOptions can be undefined when initializing from i18n file,\n// so no way to tell if this is an initialization or a default-setting.\nmomOptions=getMomentLocaleData(localeCode);// will fall back to en\n$.each(momComputableOptions,function(name,func){if(fcOptions[name]==null){fcOptions[name]=func(momOptions,fcOptions);}});// set it as the default locale for FullCalendar\noptions_1.globalDefaults.locale=localeCode;}", "function currentLocale() {\n\n return locale;\n }", "function SetLocaleForResources(strLCID)\n{\n//window.external.ReportError(\"Adding LCID: \" + strLCID);\n\tvar strLang = window.external.GetLangFromLCID(strLCID);\n\twindow.external.AddSymbol(\"LANGUAGE\", strLang);\n\twindow.external.AddSymbol(\"LANGUAGE_NAME\", strLang);\n\n\twindow.external.AddSymbol(\"LCID\", strLCID);\n\twindow.external.AddSymbol(\"HEX_LCID\", LocaleTo4HexDigit(strLCID));\n\tvar strCodePage = window.external.GetCodePageFromLCID(strLCID);\n\twindow.external.AddSymbol(\"CODE_PAGE\", strCodePage);\n\twindow.external.AddSymbol(\"HEX_CODE_PAGE\", LocaleTo4HexDigit(strCodePage));\n\n\twindow.external.AddSymbol(\"PRIMARY_LANG_ID\", window.external.GetPrimaryLangIdFromLCID(strLCID));\n\twindow.external.AddSymbol(\"SUB_LANG_ID\", window.external.GetSubLangIdFromLCID(strLCID));\n\twindow.external.AddSymbol(\"LANG_SUFFIX\", window.external.GetLangAbbrevFromLCID(strLCID));\n}", "constructor(locale) {\n const result = localeRe.exec(locale.replace(/_/g, \"-\"));\n if (!result) {\n this.isWellFormed = false;\n return;\n }\n\n let [, language, script, region, variant] = result;\n\n if (language) {\n this.language = language.toLowerCase();\n }\n if (script) {\n this.script = script[0].toUpperCase() + script.slice(1);\n }\n if (region) {\n this.region = region.toUpperCase();\n }\n this.variant = variant;\n this.isWellFormed = true;\n }", "function IntlService(locale) {\n this.locale = locale;\n if (locale === '' && process.env.NODE_ENV !== 'production') {\n throw 'Locale should not be empty string';\n }\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "getPrimaryLocale() {\n let locale = this.props.translatableState.get('primaryLocale', null);\n if (!locale) {\n locale = this.props.defaultValue;\n }\n return locale;\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function initLocale( arg ) {\n\n var locale = typeof arg === \"string\" ? arg : [ arg.language, arg.region ].join( \"-\" ),\n parts = locale.split( \"-\" );\n\n // Setup locale data table\n return {\n iso6391: locale,\n language: parts[ 0 ] || \"\",\n region: parts[ 1 ] || \"\"\n };\n }", "get() {\n\n return currentLocale;\n }", "getDefaultLocale() {\n return this.i18nServiceSingleton.getDefaultLocale();\n }", "function setLocale(locale) {\n if (!locales[locale]){\n locales[locale] = {}; //initialize it if it doesn't exist\n storage.set(locales);\n }\n\n\n if (locales[locale]._expirationDate //expirationDate was set and;\n && (new Date().getTime() - locales[locale]._expirationDate) > 0 //it is expired\n || locales[locale]._expirationDate == undefined) { //OR this is a new locale\n jsonService.loadTo(config.localesFolderPath, locale, locales[locale], function (data) {\n locales[locale]._expirationDate = new Date().getTime() + config.cacheExpiry;\n $timeout(function () { currentLocale = locale; }); //switch within $timeout\n storage.set(locales);\n });\n } else {\n $timeout(function () { currentLocale = locale; }); //switch within $timeout\n }\n }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "static getCurrentLocale() {\n let cachedLocale = sharedStore.getPersistentVariable(\n SharedStoreKeys.LOCALE\n );\n\n if (!lodash.isNil(cachedLocale)) {\n console.log(`Use cached locale ${cachedLocale} instead.`);\n return cachedLocale;\n }\n\n let currentLocale = intl.determineLocale({\n urlLocaleKey: \"lang\",\n cookieLocaleKey: \"lang\"\n });\n console.info(`Detected locale ${currentLocale}`);\n\n if (!lodash.find(supportedLocales, { value: currentLocale })) {\n console.warn(\n `Cannot support locale ${currentLocale}. Use en-US instead.`\n );\n currentLocale = \"en-US\";\n }\n\n return currentLocale;\n }", "setLocale(locale) {\n this.locale = locale;\n this._localeChanges.next();\n }", "setLocale(locale) {\n this.locale = locale;\n this._localeChanges.next();\n }", "setLocale(locale) {\n this.locale = locale;\n this._localeChanges.next();\n }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined$1(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\n\t return globalLocale._abbr;\n\t}", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t else {\n\t if ((typeof console !== 'undefined') && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn(\n 'Locale ' + key + ' not found. Did you forget to load it?'\n );\n }\n }\n }\n\n return globalLocale._abbr;\n }", "saveRequestLocale(locale) {\n var _a, _b;\n if (locale) {\n (_a = this.ctx) === null || _a === void 0 ? void 0 : _a.setAttr(interface_1.I18N_ATTR_KEY, (0, utils_1.formatLocale)(locale));\n }\n else {\n (_b = this.ctx) === null || _b === void 0 ? void 0 : _b.setAttr(interface_1.I18N_ATTR_KEY, (0, utils_1.formatLocale)(this.getDefaultLocale()));\n }\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else\n {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else\n {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\", 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:1880\");\n }\n }\n }\n\n return globalLocale._abbr;\n }", "setLocale(locale) {\n this._locale = locale;\n const url = getAppSetup().getIn(['links', 'common', 'i18nLabels']);\n return getJSON(url).then(\n data => {\n this._messages = this._messages.mergeDeep(data);\n },\n err => {\n Console.error(\"Loading i18n labels failed:\", err);\n }\n );\n }", "function getSetGlobalLocale(key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n __f__(\"warn\",\n 'Locale ' + key + ' not found. Did you forget to load it?', \" at node_modules/moment/moment.js:2121\");\n\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale (key, values) {\r\n var data;\r\n if (key) {\r\n if (isUndefined(values)) {\r\n data = getLocale(key);\r\n }\r\n else {\r\n data = defineLocale(key, values);\r\n }\r\n\r\n if (data) {\r\n // moment.duration._locale = moment._locale = data;\r\n globalLocale = data;\r\n }\r\n else {\r\n if ((typeof console !== 'undefined') && console.warn) {\r\n //warn user if arguments are passed but the locale could not be set\r\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\r\n }\r\n }\r\n }\r\n\r\n return globalLocale._abbr;\r\n }", "function getSetGlobalLocale(key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t } else {\n\t if (typeof console !== 'undefined' && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn(\n\t 'Locale ' + key + ' not found. Did you forget to load it?'\n\t );\n\t }\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn User if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }", "function getSetGlobalLocale(key, values) {\n var data;\n\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n } else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n } else {\n if (typeof console !== 'undefined' && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n }" ]
[ "0.7984865", "0.7984865", "0.7984865", "0.7984865", "0.7984865", "0.7984865", "0.7927544", "0.7893955", "0.7623716", "0.7549621", "0.7513653", "0.70934784", "0.6998832", "0.69582325", "0.69056827", "0.69056827", "0.69056827", "0.69056827", "0.69056827", "0.69056827", "0.68905926", "0.6819213", "0.6796572", "0.6778668", "0.6778668", "0.6778668", "0.67563343", "0.67563343", "0.67563343", "0.6748609", "0.672591", "0.66907364", "0.66877824", "0.66849345", "0.66849345", "0.66849345", "0.66849345", "0.66849345", "0.6665914", "0.66607314", "0.66237915", "0.6607982", "0.6606359", "0.65999913", "0.657171", "0.65202236", "0.65202236", "0.6514603", "0.65066004", "0.6483505", "0.6483505", "0.64719427", "0.6462855", "0.6454781", "0.6452445", "0.6403701", "0.6337071", "0.6320478", "0.63138443", "0.62775296", "0.6277439", "0.62702274", "0.62702274", "0.62702274", "0.62702274", "0.62702274", "0.62702274", "0.6265765", "0.6258047", "0.62561154", "0.62501246", "0.6240035", "0.62398005", "0.6239675", "0.6236676", "0.62252694", "0.62252694", "0.62252694", "0.6222746", "0.6222746", "0.6222746", "0.6222746", "0.62063915", "0.6185092", "0.6185092", "0.6185092", "0.6185092", "0.6185092", "0.61817545", "0.6180482", "0.6180482", "0.61787486", "0.617362", "0.6168165", "0.61665416", "0.6166379", "0.6165877", "0.6160585", "0.6156696", "0.6155915", "0.61467147" ]
0.0
-1
| | Lifecycle hooks |
function NzSliderComponent(utils) { this.utils = utils; // Debugging this.nzDebugId = null; // Static configurations (properties that can only specify once) this.nzStep = 1; this.nzMarks = null; this.nzMin = 0; this.nzMax = 100; this.nzDefaultValue = null; this.nzOnAfterChange = new EventEmitter(); this._disabled = false; this._dots = false; this._included = true; this._range = false; this._vertical = false; this.value = null; // CORE value state this.cacheSliderStart = null; this.cacheSliderLength = null; this.prefixCls = 'ant-slider'; this.activeValueIndex = null; // Current activated handle's index ONLY for range=true this.track = { offset: null, length: null }; // Track's offset and length this.bounds = { lower: null, upper: null }; // now for nz-slider-step this.onTouched = function () { } // onTouch function registered via registerOnTouch (ControlValueAccessor). ; // onTouch function registered via registerOnTouch (ControlValueAccessor). this.isDragging = false; // Current dragging state }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onInitialize() {}", "onInit() {}", "postConstruct() {}", "beforeDestroy(){\n //Antes de destruir la instancia\n console.log('beforeDestroy')\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "constructor () {\n this._lifecycleConfig = null;\n }", "started() {\r\n\r\n\t}", "ready() {\n super.ready();\n\n\n }", "onConstructed() {}", "onConstructed() {}", "$onInit() {\n \n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "onAttach() {}", "afterCreation( ) {\n\n }", "started() {\n\n }", "started() {\n\n }", "started() {\n\n }", "init() {\n //todo: other init stuff here\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "preDestroy() {}", "start() {\r\n // Add your logic here to be invoked when the application is started\r\n }", "didInit() { }", "started() {\n\t}", "started() { }", "started () {}", "init(){\n \n }", "start() {\n // Add your logic here to be invoked when the application is started\n }", "preStart() {\n }", "ready() {\r\n\t\tsuper.ready();\r\n\t}", "constructor(props){\n super(props);\n \n this.state = {\n name : 'Sachin'\n }\n console.log(\" LifecycleA Constructor called \");\n }", "onInit()\n {\n // \n }", "async init () {\r\n return;\r\n }", "start() {// Your initialization goes here.\n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\r\n super()\r\n this.init()\r\n }", "createdCallback() {\r\n this.init()\r\n }", "beforeDestroy(){\n console.log('beforeDestroy');\n }" ]
[ "0.7029297", "0.6864453", "0.6698177", "0.66521275", "0.6603429", "0.6603429", "0.6603429", "0.65905166", "0.65792835", "0.657214", "0.6566553", "0.6566553", "0.6560154", "0.65218765", "0.65218765", "0.65218765", "0.65218765", "0.65218765", "0.65218765", "0.65218765", "0.65218765", "0.65218765", "0.65218765", "0.65218765", "0.65218765", "0.6495394", "0.6495394", "0.6495394", "0.6495394", "0.6495394", "0.6495394", "0.6495394", "0.6495394", "0.64376533", "0.6434146", "0.64339346", "0.64339346", "0.64339346", "0.6422663", "0.6410366", "0.6410366", "0.6410366", "0.63778776", "0.63464904", "0.63403827", "0.6333916", "0.63326794", "0.6330258", "0.6329039", "0.6325486", "0.63171715", "0.6315567", "0.6306999", "0.63067645", "0.63016325", "0.62971306", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.62921786", "0.6282907", "0.62814975", "0.6280222" ]
0.0
-1
Problem 5: Background: India is a nation of many languages. Hindi is spoken, or at least understood, in many regions. English is spoken in many cities as well. In Bangalore, Kannada is the local language. Urdu is another language spoken in some parts of India. What is interesting about Urdu is that, unlike most languages, it is written right to left. Problem statement: A company released a newspaper advertisement containing text in Hindi, Urdu, and English. However it made a mistake in writing the Urdu words left to right instead of right to left. Write a program to correct the mistake and restructure the input into one line, and also to count the total words in the advertisement. Note that the words are provided in the form of a nested array. The Urdu words are in the second array. Example: [ ["zara", "dhyaan", "dein"], ["mazarat", "chahenge"], // reverse this line ["attention", "please"] ] Given an advertising text: zara dhyaan dein mazarat chahenge attention please When I correct the text Then the result should be: zara dhyaan dein chahenge mazarat attention please count: 7
function changeElementText(element, fixedAdvert) { $(element).text(sum); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAnadiplosisCount() {\r\n text = workarea.textContent;\r\n search_string = \"[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\\\s[a-zA-Zа-яА-ЯёЁ]+\";\r\n middle_words = text.match(/[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\s[a-zA-Zа-яА-ЯёЁ]+/g);\r\n new_phrases = [];\r\n result = [];\r\n if(middle_words != null) {\r\n for (i=0; i < middle_words.length; i++) {\r\n phrase = middle_words[i];\r\n phrase = phrase.toLowerCase();\r\n near_space = phrase.match(/[.?!;]{1,3}\\s/)[0];\r\n phrase = phrase.split(near_space);\r\n if(phrase[0] == phrase[1]) {\r\n new_phrases.push(middle_words[i]);\r\n }\r\n }\r\n result = new_phrases;\r\n\r\n tmp = [];\r\n for(key in result) {\r\n if(tmp.indexOf(result[key]) == -1) {\r\n tmp.push(result[key]);\r\n }\r\n }\r\n result = tmp;\r\n count = 0;\r\n\r\n search_string = \"([a-zA-Zа-яА-ЯёЁ]+\\\\s){0}\" + search_string + \"(\\\\s[a-zA-Zа-яА-ЯёЁ]+){0}\";\r\n while(new_phrases.length != 0) {\r\n\r\n middle_words = [];\r\n count++;\r\n search_reg = new RegExp(\"\\\\{\"+(count-1)+\"\\\\}\", 'g');\r\n search_string = search_string.replace(search_reg, \"{\"+count+\"}\");\r\n middle_words = text.match(new RegExp(search_string,\"g\"));\r\n new_phrases = [];\r\n if(middle_words != null) {\r\n for (i=0; i < middle_words.length; i++) {\r\n phrase = middle_words[i];\r\n phrase = phrase.toLowerCase();\r\n near_space = phrase.match(/[^a-zA-Zа-яА-ЯёЁ]{1,3}\\s/)[0];\r\n phrase = phrase.split(near_space);\r\n temp = middle_words[i].split(near_space);\r\n for(j=0; j<phrase.length-1; j++) {\r\n if(phrase[j] == phrase[j+1]) {\r\n new_phrases.push(temp[j] + near_space + temp[j+1]);\r\n } \r\n }\r\n }\r\n\r\n for(key in new_phrases) {\r\n result.push(new_phrases[key]);\r\n }\r\n }\r\n\r\n }\r\n tmp = [];\r\n for(key in result) {\r\n if(tmp.indexOf(result[key]) == -1) {\r\n tmp.push(result[key]);\r\n }\r\n }\r\n result = tmp;\r\n }\r\n return result.length;\r\n}", "function misspelledWords (inputText) {\n misspelledWordsCount = 0;\n let inputTextArray = inputText.split(\" \");\n for (let i = 0; i < inputTextArray.length - 1; i++) {\n if (inputTextArray[i] != originTextArray[i]) {\n misspelledWordsCount++;\n }\n }\n MISSPELLEDWORDCOUNT.innerHTML = addLeadingZeros(misspelledWordsCount);\n}", "function getAnaphoraCount() {\r\n text = workarea.textContent;\r\n anaphora_candidates = [];\r\n first_index = 0;\r\n last_index = 0;\r\n for(i=0; i < sentences.length-1; i++) {\r\n if(sentences[i] == \"`I must.\") debugger;\r\n first_word = sentences[i].match(/\\S+/)[0];\r\n check_higher_case = first_word.match(/[A-ZА-ЯЁ]/);\r\n if(check_higher_case == null) {\r\n continue;\r\n }\r\n if(first_word.match(\"Chapter\") != null || first_word.toLowerCase() == \"a\" || first_word.toLowerCase() == \"an\" || first_word.toLowerCase() == \"the\") {\r\n continue;\r\n }\r\n first_index = i;\r\n last_index = first_index;\r\n for(j=i+1; j<sentences.length; j++) {\r\n if(first_word == sentences[j].match(/\\S+/)[0]) {\r\n last_index = j;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if(last_index > first_index) {\r\n tmp = [];\r\n for(first_index; first_index <= last_index; first_index++) {\r\n tmp.push(sentences[first_index]);\r\n }\r\n anaphora_candidates.push([first_word, tmp]);\r\n i = last_index;\r\n }\r\n }\r\n flag = true;\r\n if(anaphora_candidates.length !=0) {\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n first_words = new RegExp(anaphora_candidates[i][0].replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\") + \"((\\\\.|\\\\!){3}|\\\\.|\\\\?|\\\\!){0,1}\\\\s\\\\S+\");\r\n if(anaphora_candidates[i][1][0].match(first_words) != null) {\r\n first_words = anaphora_candidates[i][1][0].match(first_words)[0];\r\n tmp = [];\r\n for(j=0; j < anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].match(first_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n anaphora_candidates[i][0] = first_words;\r\n }\r\n }\r\n }\r\n \r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = false;\r\n }\r\n else {\r\n control_array[i] = true;\r\n }\r\n }\r\n if(control_array.indexOf(false) != -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n\r\n\r\n flag = true;\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n first_words = new RegExp(anaphora_candidates[i][0].replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\") + \"((\\\\.|\\\\!){3}|\\\\.|\\\\?|\\\\!){0,1}\\\\s\\\\S+\");\r\n if(anaphora_candidates[i][1][0].match(first_words) != null) {\r\n first_words = anaphora_candidates[i][1][0].match(first_words)[0];\r\n tmp = [];\r\n for(j=0; j < anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].match(first_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n anaphora_candidates[i][0] = first_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n\r\n control_array[i] = true;\r\n }\r\n else {\r\n control_array[i] = false;\r\n }\r\n }\r\n if(control_array.indexOf(false) == -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n\r\n }\r\n }\r\n temp = [];\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n anaphora_length = anaphora_candidates[i][0].split(\" \").length;\r\n count = 0;\r\n for(j=0; j<anaphora_candidates[i][1].length; j++) {\r\n if(anaphora_candidates[i][1][j].split(\" \").length == anaphora_length && anaphora_length < 5) {\r\n count++;\r\n }\r\n }\r\n if (count!=anaphora_candidates[i][1].length) {\r\n temp.push(anaphora_candidates[i])\r\n }\r\n }\r\n anaphora_candidates = temp;\r\n for(i=0; i<anaphora_candidates.length; i++) {\r\n if(anaphora_candidates[i][0][anaphora_candidates[i][0].length-1] == \".\") {\r\n anaphora_candidates[i][0] = anaphora_candidates[i][0].substring(0, anaphora_candidates[i][0].length-1);\r\n }\r\n }\r\n result = anaphora_candidates;\r\n return result.length\r\n}", "function solution_1 (words) {\r\n\r\n // SOLUTION 1 [\r\n // O(nl time (n is # of words, l is longest length. the first few steps of the algo are n time, but the biggest time sink is the queue. if each of your n words has l letters, then\r\n // your queue will go through l \"major cycles\" (such that each major cycle adds up to n or fewer iterations) since 1 letter gets removed each time. thus, n*l),\r\n // O(nl) space (prereqs object is arguably constant because at most 26 letters, 25 prereqs each. similarly, all sets/arrays such as lettersSeen or noPrereqs will have no more\r\n // than 26 elements. however, the queue matters. n is # of words, l is longest length. the first element in queue takes up n*l characters in total. those words will be distributed \r\n // in some way into potentially 26 buckets, but it will still be at most n words, each of which will be at most (l - 1) length. whenever anything is added to the queue, the amount\r\n // added will always be less than amount recently shifted out, so the space occupied by the queue should not exceed the initial nl)\r\n // ]:\r\n // in this solution we create a prereqs object where every unique letter found inside the alien dictionary will eventually be a key in prereqs, and the values will be sets containing\r\n // any letter that must go before the corresponding key. to build this, we will use a queue, where every element in the queue will be a subarray of words that have an equal basis of\r\n // comparison prior to its first letter. thus, the initial input will be the first element in the queue. (thereafter, all words beginning with the same letter will go into their own\r\n // subarrays and be added to the queue.)\r\n // (1) when analyzing a particular subarray of words, the first order of business is to make sure that the words within are properly grouped by first\r\n // letter. in other words, you shouldn't have something like ['axx', 'ayy', 'bxxx', 'azz'] because the a...b...a is invalid (a cannot be both before and after b).\r\n // if a violation is found we can immediately return '' because the entire alien dictionary is invalid.\r\n // (2) next, we iterate through the subarray of words. since we know the words are properly grouped by their first letters, we just need to iterate through the words, and every time\r\n // we encounter a new first letter, we will add all previously seen first letters to the prerequisite of the current first letter. additionally, we should start creating new\r\n // subarrays for each new first letter to enter the queue, and we should push in each word.slice(1) into that subarray, for future processing. for example, if the current block is\r\n // ['axx', 'byy', 'bzz'] we want to push in ['xx'] (for the a) followed by ['yy', 'zz'] (for the b).\r\n // after doing all of that, the prereqs object has now been properly constructed. this is now effectively a graph! the final step is to start building the output string. while the\r\n // output string has a length less than the total number of unique letters in the dictionary, we keep going. for every iteration, we search the prereqs object for letters that have no\r\n // prerequisites (set size is 0). we add these letters to a list of processedLetters, we delete the entries for those letters from the prereqs object, and we add that letter to the end\r\n // of output. if we find that no letters had zero prerequisites (i.e. the list of processedLetters is empty) then there must be a cycle in the graph, because every letter depends on\r\n // something else, and so the alien dictionary is invalid - return ''. otherwise, we simply run through the prereqs object a second time, removing all processedLetters from the sets\r\n // of all remaining letters.\r\n // eventually, if and when the while loop exits, then the alien dictionary is valid and the output string has been built out, so we return the output string as required.\r\n\r\n // INITIALIZE prereqs GRAPH\r\n const prereqs = {}; // keys are letters, and values are a set of prerequisite letters that must go before the given letter\r\n \r\n // CONFIGURE prereqs OBJECT. EACH SET OF ENTRIES FROM THE QUEUE HAS EQUAL BASIS OF COMPARISON PRIOR TO ITS FIRST LETTER\r\n const queue = [words]; // initialize with all words\r\n while (queue.length) {\r\n // shift out currentWords from queue\r\n const currentWords = queue.shift();\r\n \r\n // identical first letters must be adjacent. check for something like a...b...a which would invalidate the entire dictionary\r\n const lettersSeen = new Set();\r\n for (let i = 0; i < currentWords.length; i++) {\r\n if (i && currentWords[i][0] === currentWords[i - 1][0]) continue; // same letter as previous? skip\r\n if (lettersSeen.has(currentWords[i][0])) return ''; // else, it's a new letter. make sure you haven't seen it yet\r\n lettersSeen.add(currentWords[i][0]); // add this letter to the list of letters seen\r\n }\r\n \r\n // update the prerequisites\r\n lettersSeen.clear(); // this now represents all letters seen so far for each new block\r\n for (let i = 0; i < currentWords.length; i++) {\r\n const char = currentWords[i][0];\r\n if (!i || char !== currentWords[i - 1][0]) { // if new letter...\r\n if (!(char in prereqs)) prereqs[char] = new Set(); // (initialize prereqs entry if necessary)\r\n prereqs[char] = new Set([...prereqs[char], ...lettersSeen]); // add all letters seen so far in this block to the prereqs for this char\r\n lettersSeen.add(char); // add this char to letters seen so far in this block\r\n queue.push([]); // set up new subarray (new queue entry) for this letter. it's possible this will be empty, but that's fine\r\n }\r\n if (currentWords[i].length > 1) { // whether or not new letter, if and only if there are letters after current char\r\n queue[queue.length - 1].push(currentWords[i].slice(1)); // then push those remaining letters into the latest queue entry (there will always be something)\r\n }\r\n }\r\n }\r\n \r\n // BUILD output STRING BASED ON prereqs OBJECT\r\n let output = '';\r\n const totalLetters = Object.keys(prereqs).length; // this is simply the number of unique letters found anywhere in the dictionary. each letter should have a prereqs entry\r\n while (output.length < totalLetters) {\r\n const noPrereqs = []; // this holds letters with no prerequisites, which can therefore be added to output\r\n for (const letter in prereqs) { // pass 1: find and process all letters with no prereqs\r\n if (!prereqs[letter].size) { // if a letter has no prereqs, then process it\r\n noPrereqs.push(letter);\r\n output += letter;\r\n delete prereqs[letter];\r\n }\r\n }\r\n if (!noPrereqs.length) return ''; // if you didn't find any prereqs, then you have a cycle in the graph - invalid!\r\n for (const letter in prereqs) { // pass 2: delete all processed letters from the prereqs of all remaining letters\r\n for (const processedLetter of noPrereqs) {\r\n prereqs[letter].delete(processedLetter);\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n}", "function harmlessRansomNote (noteText, magazineText) {\n\n//PART 1 \n//we will be using the split function using one empty space as the separator making our string into substrings. we will do this for both parameters. \n var noteArr = noteArr = noteText.split(' ');\n var magazineArr = magazineText.split(' ');\n//Using a Hash Table Technique, we want to make each word and object. \n var magazineObj ={};\n \n//With each word as an object, we will increement each word giving it a number for each time that it is in the string. \n magazineArr.forEach(word => {\n// If a word is not present onthe magazine object, then we want to make it make it a property on the object and make it equal to 0. \n if (!magazineObj[word]) magazineObj[word] = 0;\n// And we want to increment everytime we see the word. \n magazineObj[word]++;\n });\n \n// If we type nothing of PART 2, we can test to make sure the function was counting each word from the magazine text. by outputting the magazineObj after running the harmlessRansomNote with a string in the magazineText input. We can leave the noteText empty. \n // console.log(magazineObj);\n\n \n// PART 2\n \n// We will check each word to see if it is present in the magazineObj. If is is not that we will use a Boolean to confirm false. it will be true by default. \n var noteIsPossible = true;\n noteArr.forEach(word => {\n if (magazineObj[word]){\n// If the word exists then we increment the word negativley by 1\n magazineObj[word]--;\n//If the word is present then we need to make sure that we have enough of the word to suffice for the noteText\n if(magazineObj[word] < 0) noteIsPossible = false;\n }\n// If the word doesn't exist at all, then this piece of code will run the Boolean as false. \n else noteIsPossible = false;\n });\n \n// Lastly we run the noteIsPossible regardless however the code plays out. \n return noteIsPossible;\n \n}", "function organizeWords(){\n var lineLength = Math.floor((window.innerWidth-(96*2))/12);\n arrayOfWords = [[]];\n for (var documentCharacter=0; documentCharacter<rawDocument.length; documentCharacter++){\n switch(rawDocument[documentCharacter][0]){\n case 52:\n arrayOfWords[arrayOfWords.length-1].push(rawDocument[documentCharacter]);\n arrayOfWords.push([]);\n break;\n case 53:\n arrayOfWords.push([[53,[],[]]]);\n arrayOfWords.push([]);\n break;\n default:\n arrayOfWords[arrayOfWords.length-1].push(rawDocument[documentCharacter]);\n }\n if (documentCharacter==(currentCursorSpot-1)){\n var wordCursorIsIn = arrayOfWords.length-1;\n var characterInWord = arrayOfWords[arrayOfWords.length-1].length-1;\n }\n if (currentCursorSpot==0){\n cursorInLine=0;\n }\n }\n\n arrayOfLines = [[]];\n lineLengthInCharacters = 0;\n for (var word = 0; word<arrayOfWords.length; word++){\n if (arrayOfWords[word].length){\n if (arrayOfWords[word][0][0]==53){\n arrayOfLines.push([]);\n lineLengthInCharacters=0;\n } \n else{\n if ((lineLengthInCharacters+arrayOfWords[word].length)<lineLength){\n arrayOfLines[arrayOfLines.length-1].push(arrayOfWords[word]);\n lineLengthInCharacters+=arrayOfWords[word].length;\n }\n else{\n arrayOfLines.push([]);\n arrayOfLines[arrayOfLines.length-1].push(arrayOfWords[word]);\n lineLengthInCharacters=arrayOfWords[word].length;\n }\n } \n }\n\n if (wordCursorIsIn==word){\n cursorsLine = arrayOfLines.length-1;\n cursorInLine = lineLengthInCharacters - (arrayOfWords[word].length-characterInWord-1);\n } \n }\n\n var differentArrayOfLines=[];\n for (var line = 0; line < arrayOfLines.length; line++){\n differentArrayOfLines.push([]);\n for (var word = 0; word<arrayOfLines[line].length; word++){\n for (var characterInstance = 0; characterInstance < arrayOfLines[line][word].length; characterInstance++){\n differentArrayOfLines[differentArrayOfLines.length-1].push(arrayOfLines[line][word][characterInstance]);\n }\n }\n }\n arrayOfLines = differentArrayOfLines;\n}", "function countCensoredWords(sentence, words){\n if (typeof sentence === 'string' && typeof words === 'object'){\n const results = {}\n for (const key of words){\n results[key] = 0\n }\n results.total = 0\n sentence.toLowerCase().replace(/[^a-z\\s]/g, '').split(' ').map(item => {\n words.map(word => {\n if (item === word){\n results[word]++\n results.total++\n }\n })\n })\n return results\n } else {\n console.log('Please provide a string as the first parameter and a array as the second parameter')\n }\n}", "function wordCountEnginePt2(document) {\n // your code goes here\n const frequencyCnt = {};\n document\n .toLowerCase()\n .split(' ')\n .forEach((word, index) => {\n word = word.replace(/[^a-z]/gi, '');\n if (word) {\n if (frequencyCnt[word]) {\n frequencyCnt[word] = {\n count: frequencyCnt[word].count + 1,\n index: Math.min(index, frequencyCnt[word].index),\n };\n } else {\n frequencyCnt[word] = { count: 1, index };\n }\n }\n });\n\n // [[word, {index, count}]]\n const returnArr = Object.keys(frequencyCnt).map(key => [\n key,\n frequencyCnt[key],\n ]);\n returnArr.sort(([_a, a], [_b, b]) => {\n if (b.count === a.count) {\n return a.index - b.index;\n } else {\n return b.count - a.count;\n }\n });\n\n return returnArr\n .map(innerArr => innerArr)\n .map(([key, { count }]) => [key, `${count}`]);\n}", "function getSrepeatCount() {\r\n srepeat_examples = [];\r\n srepeats_for_sentences = [];\r\n result = [];\r\n for(i=0; i<sentences.length; i++) {\r\n sentence = [];\r\n sentence = sentences[i].replace(/[^a-zA-Zа-яА-ЯёЁ \\n']/g, \" \");\r\n sentence = sentence.replace(/\\s+/g, \" \");\r\n sentence = sentence.toLowerCase();\r\n sentence = sentence.substring(0,sentence.length-1);\r\n sentence = sentence.split(\" \");\r\n \r\n sub_result = sentence.reduce(function (acc, el) {\r\n acc[el] = (acc[el] || 0) + 1;\r\n return acc;\r\n }, {});\r\n\r\n tmp = [];\r\n for(key in sub_result) {\r\n if(sub_result[key] > 1 && unions.indexOf(key) == -1 && prepositions.indexOf(key) == -1) {\r\n tmp.push(key);\r\n result.push(key);\r\n }\r\n }\r\n srepeat_examples.push([sentences[i], tmp]);\r\n }\r\n tmp = []\r\n for(key in srepeat_examples) {\r\n tmp = []\r\n for(i=0; i<srepeat_examples[key][1].length; i++){\r\n if(srepeat_examples[key][1].length != 0) {\r\n if(srepeat_examples[key][1][i] != \"'\" || srepeat_examples[key][1][i] == \"i\") {\r\n tmp.push(srepeat_examples[key][1][i])\r\n }\r\n }\r\n }\r\n srepeat_examples[key][1] = tmp;\r\n }\r\n\r\n count = 0;\r\n for(i=0; i<srepeat_examples.length; i++) {\r\n if(srepeat_examples[i][1].length != 0) {\r\n for(j=0; j<srepeat_examples[i][1].length; j++) {\r\n count++;\r\n }\r\n }\r\n }\r\n\r\n return count;\r\n}", "function wordCountEngine(doc) {\n const map = new Map();\n const wordList = doc.split(' ');\n let largestCount = 0;\n\n// for i from 0 to wordList.length-1:\n// # convert each token to lowercase\n// word = wordList[i].toLowerCase()\n for (let i = 0; i < wordList.length; i++) {\n const word = wordList[i].toLowerCase();\n const charArray = [];\n for (let char of word) {\n if (char >= 'a' && char <= 'z') {\n charArray.push(char);\n }\n \n }\n const cleanWord = charArray.join('');\n let count = 0;\n if (map.has(cleanWord)) {\n count = map.get(cleanWord);\n count++;\n } else {\n count = 1;\n }\n if (count > largestCount) {\n largestCount = count\n }\n map.set(cleanWord,count);\n }\n // const result = [];\n // for (let key of map) {\n // key[1] = key[1].toString()\n // result.push(key);\n \n // }\n // // result.sort((a,b) => b[1] - a[1])\n // return result;\n const counterList = new Array(largestCount + 1);\n for (word of map.keys()) {\n counter = map.get(word);\n wordCounterList = counterList[counter]\n console.log(counterList)\n if (wordCounterList == null) {\n wordCounterList = [];\n }\n wordCounterList.push(word);\n counterList[counter] = wordCounterList;\n }\n// # init the word counter list of lists.\n// # Since, in the worst case scenario, the\n// # number of lists is going to be as\n// # big as the maximum occurrence count,\n// # we need counterList's size to be the\n// # same to be able to store these lists.\n// # Creating counterList will allow us to\n// # “bucket-sort” the list by word occurrences\n// counterList = new Array(largestCount+1)\n// for j from 0 to largestCount:\n// counterList[j] = null\n\n// # add all words to a list indexed by the\n// # corresponding occurrence number.\n// for word in wordMap.keys():\n// counter = wordMap[word]\n// wordCounterList = counterList[counter]\n\n// if (wordCounterList == null):\n// wordCounterList = []\n\n// wordCounterList.push(word)\n// counterList[counter] = wordCounterList\n\n// # iterate through the list in reverse order\n// # and add only non-null values to result\n// result = []\n// for l from counterList.length-1 to 0:\n// wordCounterList = counterList[l]\n// if (wordCounterList == null):\n// continue\n\n// stringifiedOccurrenceVal = toString(l)\n// for m from 0 to wordCounterList.length-1:\n// result.push([wordCounterList[m], stringifiedOccurrenceVal])\n\n// return result\n\n}", "function getStats(txt) {\n //convert everything to lower case\n sampleText = txt.toLowerCase();\n //Question 1:\n q1 = sampleText.length;\n //Question 2:\n //Remove all white spaces\n oneSpace = sampleText.replace(/\\s/g, \" \");\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n //Splits into array\n wordsArray = oneSpace.split(/\\W+/);\n //remove any blank elements\n for(index in wordsArray){\n if (wordsArray[index].length < 1){\n wordsArray.splice(index, 1);\n }\n }\n q2 = wordsArray.length;\n //return 0 if 1 element is empty\n if (wordsArray.length < 2){\n if (wordsArray[0] !== undefined && wordsArray[0].length < 1){\n q2 = 0;\n }\n }\n //question 3:\n //split on lines\n linesArray = sampleText.split(/\\n/);\n //compute the number of lines\n q3 = linesArray.length;\n //be 0 if nothing exists in first line\n if (linesArray.length < 2){\n if (linesArray[0].length < 1){\n q3 = 0;\n }\n }\n //question 4:\n //Go from end of line array and computer line by line, removing all lines that are blank\n for (i = linesArray.length - 1; i > -1; i--){\n line = linesArray[i].replace(/\\s/g,\"\");\n if (line.length < 1){\n //remove blank line\n linesArray.splice(i, 1);\n }\n }\n q4 = linesArray.length;\n //make sure array has atleast 1 line\n if (linesArray.length < 2){\n if (linesArray[0] !== undefined && linesArray[0].replace(/\\s/g,\"\").length < 1){\n q4 = 0;\n }\n }\n //question 5:\n //Get lines\n linesArrayQ5 = sampleText.split(\"\\n\");\n q5 = 0;\n //go though lines and get longest line length\n for (index in linesArrayQ5){\n if (linesArrayQ5[index].length > q5){\n q5 = linesArrayQ5[index].length;\n }\n }\n //question 6:\n lengthOfWords = 0;\n //go though all words and add their length together\n for (index in wordsArray){\n lengthOfWords += wordsArray[index].length;\n }\n //if there is words then divide by number of words\n if (lengthOfWords !== 0){\n q6 = lengthOfWords / wordsArray.length;\n }\n else{\n q6 = 0;\n }\n //question 7:\n reversedArray = [];\n //reverse the word and add it to a new array\n for (index in wordsArray){\n pal = \"\";\n for (x = wordsArray[index].length - 1; x >= 0; x--){\n pal += wordsArray[index][x];\n }\n reversedArray.push(pal);\n }\n q7 = [];\n //check if words are palindromes by comparing two lists\n for (index in wordsArray){\n if (wordsArray[index] === reversedArray[index]){\n //remove duplicates....\n if (wordsArray[index].length > 1 && !(wordsArray[index] in q7)){\n q7.push(wordsArray[index]);\n }\n }\n }\n //Question 8:\n sortedArray = wordsArray.concat();\n sortedArray.sort(function (a, b) {\n //sort by size and alphabetically\n return b.length - a.length || a.localeCompare(b);\n })\n q8 = [];\n //add 10 words to array\n for (i = 0; i < 10; i++){\n if (sortedArray.length > i){\n //only add word if it hasnt been added before\n if(i > 0 && sortedArray[i] === q8[i-1]){\n sortedArray.splice(i,1);\n i--;\n }\n else{\n q8.push(sortedArray[i]);\n }\n }\n }\n //for empty list\n if (q8[0] === \"\"){\n q8 = [];\n }\n //question 9:\n wordFreq = {};\n //make dictonary of words\n for (index in wordsArray){\n if(wordsArray[index] in wordFreq){\n wordFreq[wordsArray[index]] += 1;\n }\n else{\n wordFreq[wordsArray[index]] = 1;\n }\n }\n //convert dictonary to array\n freqArray = [];\n for (value in wordFreq){\n x = {};\n x.word = value;\n x.number = wordFreq[value];\n freqArray.push(x);\n }\n //sort array\n freqArray.sort(function (a, b) {\n return b.number-a.number || a.word.localeCompare(b.word);\n })\n q9 = [];\n //only add 10 elements\n for (index in freqArray){\n if (q9.length < 10){\n endVal = freqArray[index].word + \"(\" + freqArray[index].number + \")\";\n q9.push(endVal);\n }\n }\n //if it was empty of a space then remove it\n if (q9[0] === \"(1)\"){\n q9 = [];\n }\n\n return {\n nChars: q1,\n nWords: q2,\n nLines: q3,\n nNonEmptyLines: q4,\n maxLineLength: q5,\n averageWordLength: q6,\n palindromes: q7,\n longestWords: q8,\n mostFrequentWords: q9\n };\n}", "function main() {\n var m_temp = readLine().split(' ');\n var m = parseInt(m_temp[0]);\n var n = parseInt(m_temp[1]);\n magazine = readLine().split(' ');\n ransom = readLine().split(' ');\n\n let result = 'Yes';\n //create a map with keys and number of occurences\n let map = new Map;\n for (let i=0; i<magazine.length; i++) {\n //if word already exists, increase the number of occurrences by 1\n if (map.has(magazine[i])) {\n let value = map.get(magazine[i]);\n value++;\n map.set(magazine[i], value);\n } else {\n //add a key and set number of occurences to 1\n map.set(magazine[i], 1);\n }\n }\n //check if ransom note is in the map and delete it\n for (let i=0; i<ransom.length; i++) {\n if (map.has(ransom[i])) {\n let value = map.get(ransom[i]);\n //if over 1, just lower value and otherwise delete it compeltely\n if (value > 1) {\n value--;\n map.set(ransom[i], value);\n } else {\n map.delete(ransom[i]);\n }\n } else {\n result = \"No\";\n break;\n }\n }\n console.log(result);\n}", "function part2(data) {\n let items = data\n .map(answer => {\n let sorted = answer.join('').split('').sort().join('');\n let letterGroups = sorted.match(/(\\S)\\1*/g);\n return letterGroups.filter(letterGroup => letterGroup.length == answer.length).length;\n })\n .reduce((acc, cur) => acc + cur);\n return items;\n}", "function presses(phrase) {\r\n // let changed = phrase.toLowerCase();\r\n let counter = 0, alphas = [['','1'], ['','a','b','c','2'], ['','d','e','f','3'], ['','g','h','i','4'], ['','j','k','l','5'], ['','m','n','o','6'], ['','p','q','r','s','7'], ['','t','u','v','8'], ['','w','x','y','z','9'],['','','0']];\r\n for (let i = 0; i < changed.length; i++) {\r\n for (let j = 0; j < alphas.length; j++) {\r\n if (alphas[j].includes(changed[i])) {\r\n counter += alphas[j].indexOf(changed[i]);\r\n }\r\n }\r\n }\r\n for (let k = 0; k <= changed.length; k++) {\r\n if (changed[k] === \" \") {\r\n counter += 1;\r\n }\r\n }\r\n console.log(counter);\r\n}", "function hipsterfy(sentence) {\n var newWords = sentence.split(\" \");\n var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n console.log(\"check 1: The split sentence is: \" + newWords);\n for (var i = 0; i < newWords.length; i++) {\n console.log(\"check 2: The word that is being evaluated is: \" + newWords[i]);\n for (var k = newWords[i].length - 1; k >= 0; k--) {\n console.log(\"check 3: The word that is evaluated within the second for loop is \" + newWords[i]);\n console.log(\"check 4: The letter of the word that is being evaluated is: \" + newWords[i][k] + \", i: \" + i + \", k: \" + k);\n for (var l = vowels.length - 1; l >= 0; l--) {\n console.log(\"check 5: vowel to be compared is: \" + vowels[l]);\n var conjoinedWord = \"\";\n if (conjoinedWord !== 0) {\n console.log(\"The break should happen here\");\n } else if (newWords[i][k] === vowels[l]) {\n var splitWord = newWords[i].slice(0,[k]);\n var splitWord2 = newWords[i].slice(k+1);\n console.log(splitWord + splitWord2);\n conjoinedWord = splitWord + splitWord2;\n console.log(conjoinedWord);\n }\n // // continue;\n // // console.log(\"check 6: continue needs to get here bacause letter of newWords[i][k] is: \" + newWords[i][k] + \" and vowel is: \" + vowels[l]);\n // // //console.log(\"check 7: removal needed here (split - join) bacause letter of newWords[i][k] is: \" + newWords[i][k] + \" and vowel is: \" + vowels[l]);\n\n }\n }\n }\n return newWords;\n}", "function solve(input) {\n let unique = {\n 2: '1',\n 4: '4',\n 3: '7',\n 7: '8'\n }\n let arr = input.split('\\n').map(r => r.split(' | ')[1]).map (r => r.split(' '));\n let count = 0;\n for (let row of arr) {\n for (let letters of row) {\n if (letters.length in unique) {\n count++;\n }\n }\n }\n return count;\n}", "function translation(words) {\n // words = [\"gin\", \"zen\", \"gig\", \"msg\"]\n \n for (var i = 0; i < words.length; i++) {\n // 1st iteration\n // words[i] => 'gin'\n\n // loop over words[i] (i.e. 'gin')\n var currentWord = words[i];\n // hold our string for our new morsecode word\n var morseCodeWord = '';\n // input => 'gin'\n // output => 'morsecode_gin'\n for (var j = 0; j < currentWord.length; j++) {\n // currentWord[j] = 'g'\n // locate the index of currentWord[j] inside English_alphabet\n var index = English_alphabet.indexOf(currentWord[j])\n // morseCode[index]\n morseCodeWord += morseCode[index];\n }\n // push morseCodeWord into morseCodeArray\n morseCodeArray.push(morseCodeWord);\n\n }\n // locate the index of the character in the english_alphabet\n console.log(morseCodeArray);\n // returns => ['--...-.', '--...-.', '--...--.', '--...--.' ]\n\n // 2nd REQUIREMENT: IDENTIFY DIFFERENT TRANSFORMATIONS\n // SIDE NOTE (My mistake, for this problem we are instructed to return the amount of different transformations that took place)\n var count = 0;\n var differentTypes;\n for (let a = 0; a < morseCodeArray.length; a++) {\n \n //count how many times there is a match in the array\n // 1st iteration morseCodeArray[a] => '--...-.'\n \n // if(morseCodeArray[a] === morseCodeArray[a+1]) {\n // count++;\n // }\n // console.log('output' + count)\n \n // if the current index does not equal an existing transformation in our differentTypes array, then we know that we have another type\n if(differentTypes.includes(morseCodeArray[a]) === false){\n differentTypes.push(morseCodeArray[a])\n }else{\n // do nothing\n }\n }\n\n return 'LOCATED ' + differentTypes.length + ' DIFFERENT TRANSFORMATIONS !';\n}", "function funWithAnagrams(text) {\n // Write your code here\n\n if (text.length < 0) {\n return 0;\n }\n\n let sortText = {};\n let newText = [];\n\n for (let word of text) {\n let newWords = word.split('').sort().join('');\n console.log(newWords);\n\n if (!sortText[newWords]) {\n sortText[newWords] = Array(word);\n } else {\n sortText[newWords].push(word);\n }\n }\n\n for (let values in sortText) {\n let firstOccurrence = sortText[values][0];\n\n if (firstOccurrence) {\n newText.push(firstOccurrence);\n }\n }\n return newText.sort();\n}", "function main(sentence, word2Check) {\n\tlet count = 0;\n\tlet sentenceArray = sentence.split(\" \");\n\t\n\t// for (let i = 0; i < sentenceArray.length; i++) {\n\t// \tlet word = sentenceArray[i];\n\t// \tif(word == word2Check){\n\t// \t\tcount ++;\n\t// \t}\n\t\t\n\t// }\n\t// console.log(count);\n\tfor (let word of sentenceArray) {\n\t\tif (word == word2Check) {\n\t\t\tcount++;\n\t\t}\n\t}\n\tconsole.log(count);\n}", "function shortestWords(words) {\n // Code here\n var newWords = \"\";\n for (var x = 0; x < words.length; x++) {\n newWords = newWords + words[x].toLowerCase();\n // console.log(newWords)\n //toLowerCase digunakan agar tidak muncul dua kata yang sama dikarenakan huruf kapital. \n }\n // Lakukan split untuk agar var splitWords bisa di cek menggunakan looping.\n var splitWords = newWords.split(\" \");\n // Buat array kosong untuk menampung pengulangan dari looping.\n // console.log(splitWords)\n var tampungLength = [];\n\n for (var a = 0; a < splitWords.length; a++) {\n var cekKata = \"\";\n for (var b = 0; b < splitWords[a].length; b++) {\n cekKata = b;\n }\n tampungLength.push(cekKata);\n }\n // console.log(tampungLength);\n // Mengecek panjang huruf var words.\n\n // Gunakan looping untuk mencari kata yang paling jarang muncul.\n var angkaTerkecil = tampungLength[0];\n\n for (var c = 0; c < tampungLength.length; c++) {\n if (angkaTerkecil > tampungLength[c]) {\n angkaTerkecil = tampungLength[c];\n }\n }\n // console.log(angkaTerkecil)\n\n var tampungHasil = [];\n for (var i = 0; i < tampungLength.length; i++) {\n if (tampungLength[i] == angkaTerkecil) {\n tampungHasil.push(splitWords[i]);\n }\n }\n // console.log(tampungHasil)\n\n var hasil = [];\n for (var j = 0; j < tampungHasil.length; j++) {\n if (hasil.indexOf(tampungHasil[j]) === -1) {\n hasil.push(tampungHasil[j]);\n if (tampungHasil[j] === 'i') {\n hasil[0] = tampungHasil[j].toUpperCase();\n }\n }\n }\n return hasil;\n}", "function uniqueFinder(sentence) {\r\n //your code here\r\n //kondisi untuk nilai array kosong\r\n if (sentence.length === 0) {\r\n return 'NO WORDS';\r\n }\r\n \r\n //coding untuk split, space (' ');\r\n sentence += ' ';\r\n const tampungWords = [];\r\n let tampungKata = '';\r\n for (let i = 0; i < sentence.length; i++) {\r\n if (sentence[i] === ' ') {\r\n tampungWords.push(tampungKata.toLowerCase());\r\n tampungKata = ' ';\r\n } else {\r\n tampungKata += sentence[i];\r\n }\r\n }\r\n //console.log(tampungWords);\r\n \r\n const results = [];\r\n //looping untuk splitted\r\n for (let p = 0; p< tampungWords.length; p++){\r\n //looping untuk check words yg sama\r\n //console.log('Kata I : ' +tampungWords[p]);\r\n for (let q = p + 1; q< tampungWords.length; q++){\r\n //console.log('kata II ' +tampungWords[q]);\r\n let exist = false;\r\n \r\n //looping untuk check udah masuk result or belum\r\n for (let r = 0; r< results.length; r++) {\r\n //console.log('kata III : ' +results);\r\n if (tampungWords[p] === results[r]) {\r\n exist = true ;\r\n }\r\n }\r\n \r\n if (tampungWords[p] === tampungWords[q] && !exist ) {\r\n results.push(tampungWords[p]);\r\n }\r\n }\r\n } \r\n //console.log(results);\r\n return results;\r\n\r\n}", "function countSyllablesAndPolys (wordList) {\n let syllablesTotal = 0, polysTotal = 0;\n wordList.forEach((word) => {\n if (word === \"'\"||word===\"’\") {return;} //bandaid solution.\n if (word.length <= 2) {syllablesTotal += 1; return;} //quick return on short words\n let syllables = 0;\n if (word.endsWith(\"s'\")||word.endsWith(\"s’\")) {word.slice(-1);} //ending with s'\n if (word.endsWith(\"s's\")||word.endsWith(\"s’s\")) {word.slice(-1,-3);} //ending with s's\n const cEndings = word.match(/(?<=\\w{3})(side|\\wess|(?<!ed)ly|ment|ship|board|ground|(?<![^u]de)ville|port|ful(ly)?|berry|box|nesse?|such|m[ae]n|wom[ae]n|horse|anne)s?$/mi);\n if (cEndings) {word = word.replace(cEndings[0],\"\\n\" + cEndings[0]);} //Splits into two words and evaluates them as such\n const cBeginnings = word.match(/^(ware|side|p?re(?!ach|agan|al|au))/mi);\n if (cBeginnings) {word = word.replace(cBeginnings[0],\"\"); syllables++;}\n const esylp = word.match(/ie($|l|t|rg)|([cb]|tt|pp)le$|phe$|kle(s|$)|[^n]scien|sue|aybe$|[^aeiou]shed|[^lsoai]les$|([^e]r|g)ge$|(gg|ck|yw|etch)ed$|(sc|o)he$|seer|^re[eiuy]/gmi);\n if (esylp) {syllables += esylp.length;} //E clustered positive\n const esylm = word.match(/every|some([^aeiouyr]|$)|[^trb]ere(?!d|$|o|r|t|a[^v]|n|s|x)|[^g]eous|niet/gmi);\n if (esylm) {syllables -= esylm.length;} //E clustered negative\n const isylp = word.match(/rie[^sndfvtl]|(?<=^|[^tcs]|st)ia|siai|[^ct]ious|quie|[lk]ier|settli|[^cn]ien[^d]|[aeio]ing$|dei[tf]|isms?$/gmi);\n if (isylp) {syllables += isylp.length;} //I clustered positive\n const osylp = word.match(/nyo|osm(s$|$)|oinc|ored(?!$)|(^|[^ts])io|oale|[aeiou]yoe|^m[ia]cro([aiouy]|e)|roe(v|$)|ouel|^proa|oolog/gmi);\n if (osylp) {syllables += osylp.length;} //O clustered positive\n const osylm = word.match(/[^f]ore(?!$|[vcaot]|d$|tte)|fore|llio/gmi);\n if (osylm) {syllables -= osylm.length;} //O clustered negative\n const asylp = word.match(/asm(s$|$)|ausea|oa$|anti[aeiou]|raor|intra[ou]|iae|ahe$|dais|(?<!p)ea(l(?!m)|$)|(?<!j)ean|(?<!il)eage/gmi);\n if (asylp) {syllables += asylp.length;} //A clustered positive\n const asylm = word.match(/aste(?!$|ful|s$|r)|[^r]ared$/gmi);\n if (asylm) {syllables -= asylm.length;} //A clustered negative\n const usylp = word.match(/uo[^y]|[^gq]ua(?!r)|uen|[^g]iu|uis(?![aeiou]|se)|ou(et|ille)|eu(ing|er)|uye[dh]|nuine|ucle[aeiuy]/gmi);\n if (usylp) {syllables += usylp.length;} //U clustered positive\n const usylm = word.match(/geous|busi|logu(?!e|i)/gmi);\n if (usylm) {syllables -= usylm.length;} //U clustered negative\n const ysylp = word.match(/[ibcmrluhp]ya|nyac|[^e]yo|[aiou]y[aiou]|[aoruhm]ye(tt|l|n|v|z)|dy[ae]|oye[exu]|lye[nlrs]|(ol|i|p)ye|aye(k|r|$|u[xr]|da)|saye\\w|wy[ae]|[^aiou]ying/gmi);\n if (ysylp) {syllables += ysylp.length;} //Y clustered positive\n const ysylm = word.match(/arley|key|ney$/gmi);\n if (ysylm) {syllables -= ysylm.length;}\n const essuffix = word.match(/((?<!c[hrl]|sh|[iszxgej]|[niauery]c|do)es$)/gmi);\n if (essuffix) {syllables--;}//es suffix\n const edsuffix = word.match(/([aeiouy][^aeiouyrdt]|[^aeiouy][^laeiouyrdtbm]|ll|bb|ield|[ou]rb)ed$|[^cbda]red$/gmi);\n if (edsuffix) {syllables--}\n const csylp = word.match(/chn[^eai]|mc|thm/gmi);\n if (csylp) {syllables += csylp.length;} //Consonant clustered negative\n const eVowels = word.match(/[aiouy](?![aeiouy])|ee|e(?!$|-|[iua])/gmi);\n if (eVowels) {syllables += eVowels.length;} //Applicable vowel count (all but e at end of word)\n if (syllables <= 0) {syllables = 1;} //catch-all\n if (word.match(/[^aeiou]n['’]t$/i)) {syllables ++;} //ending in n't, but not en't\n if (word.match(/en['’]t$/i)) {syllables --;} //ending in en't\n if (syllables >= 3) {polysTotal++;}\n syllablesTotal += syllables;\n });\n return [syllablesTotal, polysTotal];\n }", "function countWords() {\n reset();\n\n let text = document.getElementById(\"text\").value.toLowerCase();\n\n if (text === \"\") {\n // Show an alert if text field is empty\n alert(\"Text field is empty.\");\n } else {\n // Split by white space\n wordsArr = text.split(\" \");\n // Remove punctuation\n wordsArr.forEach((val, index, arr) => {\n arr[index] = val.replace(/[.!?,;:]/g, \"\");\n });\n // Capitalize first letters\n wordsArr.forEach((val, index, arr) => {\n arr[index] = val.charAt(0).toUpperCase() + val.slice(1);\n });\n // Create unique array\n wordsArr.forEach(w => {\n if (!uniqueArr.includes(w)) {\n uniqueArr.push(w);\n }\n });\n // Find occurences\n for (let i = 0; i < uniqueArr.length; i++) {\n let obj = {};\n let word = uniqueArr[i];\n let freq = 0;\n for (let j = 0; j < wordsArr.length; j++) {\n if (uniqueArr[i] === wordsArr[j]) {\n freq++;\n }\n }\n\n obj.key = word;\n obj.value = freq;\n freqArr.push(obj);\n }\n // Sort the array by descending order\n freqArr.sort(function(a, b) {\n return b.value - a.value;\n });\n\n // Print the result\n print();\n }\n}", "function justify(word, maxWidth) {\n let charCount = 0; \n let sent = [[]]; \n\n for(let i = 0; i < word.length; i++) {\n charCount += word[i].length + 1;\n\n if(charCount - 1 <= maxWidth) {\n sent[sent.length - 1].push(word[i]); \n } else {\n sent.push([word[i]]);\n charCount = word[i].length + 1; \n }\n }\n\n // add the whitespaces\n for(let i = 0; i < sent.length; i++) {\n // get the current character count for each sentence \n let count = 0; \n for(let word of sent[i]) {\n count += word.length; \n }\n\n count = maxWidth - count; \n \n // iterate through each word of a sentence \n // if the sentence isn't the last \n if(i !== sent.length - 1 && sent[i].length > 1) {\n\n let end = sent[i].length - 1;\n let start = 0; \n while(count) {\n sent[i][start % end] += \" \"; \n start++; \n count--; \n }\n sent[i] = sent[i].join(\"\");\n console.log(sent[i].length)\n\n } else {\n\n // issue is if the last sentence has more then one char you need to add in a space between the the chars. \n // have conditionals here to check the length of \n\n if(sent[i].length === 1) {\n let last = sent[i].length - 1;\n while(count) {\n sent[i][last] += \" \";\n count--; \n }\n sent[i] = sent[i].join(' ');\n } else {\n // check the remaining length, subtract the number of chars - 1 (avoiding last word)\n let wordCount = sent[i].length - 1; \n count = count - wordCount; \n let last = sent[i].length - 1; \n while(count) {\n sent[i][last] += \" \";\n count--;\n }\n sent[i] = sent[i].join(' ');\n }\n\n console.log(sent[i].length)\n }\n\n } \n\n return sent; \n}", "function getStats(txt) {\n let txtInfo = {\n nChars: txt.length,\n nWords: 0,\n nLines: 0,\n nNonEmptyLines: 0,\n maxLineLength: 0,\n averageWordLength: 0,\n palindromes: [],\n longestWords: [],\n mostFrequentWords: [],\n };\n\n (function getLineInfo() {\n let lines = txt.split('\\n');\n txtInfo.nLines = txt.length === 0 ? 0 : lines.length;\n for(let l of lines) {\n if(l.trim().length !== 0) {\n txtInfo.nNonEmptyLines++;\n }\n if(l.length > txtInfo.maxLineLength) {\n txtInfo.maxLineLength = l.length;\n }\n }\n })();\n\n (function getWordInfo() {\n let wordDict = {};\n let wordLengths = [];\n let uniqueWords = [];\n let word = \"\";\n let c;\n if(txtInfo.nChars !== 0) {\n for (c of txt) {\n if (c.match(/^[0-9a-zA-Z]+$/)) {\n word += c;\n }\n else {\n if (word.length > 0) {\n addToVars();\n }\n }\n }\n //add the last word in the txt\n //if the txt doesn't end with non alphanumeric\n if (c.match(/^[0-9a-zA-Z]+$/)) {\n addToVars();\n }\n }\n\n //helper function to populate variables\n function addToVars() {\n wordLengths.push(word.length);\n txtInfo.nWords++;\n word = word.toLowerCase();\n if (uniqueWords.indexOf(word) === -1) {\n uniqueWords.push(word);\n }\n if (isNaN(wordDict[word])) {\n wordDict[word] = 1;\n }\n else {\n wordDict[word]++;\n }\n word = \"\";\n }\n\n //average word length\n if(wordLengths.length !== 0) {\n (function getAvgWordLength() {\n for (let len of wordLengths) {\n txtInfo.averageWordLength += len;\n }\n txtInfo.averageWordLength /= wordLengths.length;\n })();\n }\n\n //palindromes\n (function getPalindromes() {\n for (let w of uniqueWords) {\n if (w.length > 2) {\n if (w.split(\"\").reverse().join(\"\") === w) {\n txtInfo.palindromes.push(w);\n }\n }\n }\n })();\n\n //longest words\n (function getLongestWords() {\n uniqueWords.sort(function(a, b) {\n return b.length - a.length || a.localeCompare(b);\n });\n txtInfo.longestWords = uniqueWords.slice(0, 10);\n })();\n\n //word frequency\n (function getWordFreq() {\n let wordFreq = Object.keys(wordDict).map(function(key) {\n return [key, wordDict[key]];\n });\n wordFreq.sort(function(a, b) {\n return b[1] - a[1] || a[0].localeCompare(b[0]);\n });\n wordFreq = wordFreq.slice(0, 10);\n for (let i = 0; i < wordFreq.length; i++) {\n txtInfo.mostFrequentWords.push(wordFreq[i][0] + \"(\" + wordFreq[i][1] + \")\");\n }\n })();\n })();\n\n return txtInfo;\n}", "function checkForKeyWords(arsTest) {\n console.log(\"arstest, \", arsTest);\n arsKeyWords = [];\n arsKeyTot = [];\n bCheck = false;\n for (var i = 0; i < arsTest.length; i++) {\n arsKeyWords = [];\n var nStartCheck, nEndCheck;\n console.log(\"sStartIndexForEachLength: \", sStartIndexForEachLength);\n for (var j = 0; j < arsTest[i].length; j++) { //LOOP THROUGH EMAIL BODY\n if ((arsTest[i][j].length - 3) > 0 && (arsTest[i][j].length + 3) <= sStartIndexForEachLength.length - 1) {\n nStartCheck = sStartIndexForEachLength[arsTest[i][j].length - 3][1];\n nEndCheck = sStartIndexForEachLength[arsTest[i][j].length + 3][1];\n } else if ((arsTest[i][j].length - 3) <= 0) {\n nStartCheck = sStartIndexForEachLength[1][1];\n nEndCheck = sStartIndexForEachLength[arsTest[i][j].length + 3][1];\n } else if (((arsTest[i][j].length+3)>sStartIndexForEachLength.length-1) && arsTest[i][j].length<sStartIndexForEachLength.length) { \n nStartCheck = sStartIndexForEachLength[arsTest[i][j].length - 3][1];\n nEndCheck = sStartIndexForEachLength[sStartIndexForEachLength.length - 1][1];\n } else{\n nStartCheck = 0;\n nEndCheck = 0;\n }\n //console.log(\"arsTest[i][j]: \", arsTest[i][j],\" arsTest[i][j].length: \", arsTest[i][j].length, \" nStartCheck: \", nStartCheck, \" nEndcheck: \", nEndCheck, \" klfdalkadj \", ((arsTest[i][j].length+3)>sStartIndexForEachLength.length-1), \" daf \", arsTest[i][j].length<sStartIndexForEachLength.length);\n for (var k = parseInt(nStartCheck); k <= parseInt(nEndCheck); k++) { \n //console.log(\"arsTest[i][j]: \", arsTest[i][j],\" arsTest[i][j].length: \", arsTest[i][j].length, \" nStartCheck: \", nStartCheck, \" nEndcheck: \", nEndCheck, \" arsWords[k]: \", arsWords[k], \" arsWords[k].indexOf(arsTest[i][j]): \", arsWords[k].indexOf(arsTest[i][j]));\n if (arsWords[k].indexOf(arsTest[i][j]) > -1) {\n arsKeyWords.push(arsWords[k][0]);\n break;\n }\n }\n }\n /*CHECK FOR PEOPLE WHO USE SPACES IN RANDOM WAYS*/\n for (var j = 0; j < arsKeyWords.length - 1; j++) {\n if (arsKeyWords[j] === \"play\") {\n if (arsKeyWords[j + 1] === \"list\") {\n arsKeyWords[j] = \"playlist\";\n }\n }\n if (arsKeyWords[j] === \"will\") {\n if (arsKeyWords[j + 1] === \"not\") {\n arsKeyWords[j] = \"wont\";\n }\n }\n if (arsKeyWords[j] === \"not\") {\n if (arsKeyWords[j + 1] === \"available\") {\n arsKeyWords[j] = 'unavailable';\n }\n }\n\n if (arsKeyWords[j] === \"get\") {\n if (arsKeyWords[j + 1] === \"rid\") {\n arsKeyWords[j] = \"delete\";\n }\n }\n if (arsKeyWords[j] === \"not\") {\n if (arsKeyWords[j + 1] === \"able\") {\n arsKeyWords[j] = \"cant\";\n }\n }\n if (arsKeyWords[j] === \"unable\") {\n arsKeyWords[j] = \"cannot\";\n }\n if (arsKeyWords[j] === \"video\") {\n if (arsKeyWords[j + 1] === \"stream\") {\n arsKeyWords[j] = \"videostream\";\n }\n }\n }\n if (arsKeyWords.length > 0) {\n console.log(\"Checking if seen before arsKeyWords: \", arsKeyWords);\n // console.log(\"Checking if seen before arsKeyTot: \", arsKeyTot);\n // checkifseenbefore(arsKeyTot);\n checkifseenbefore(arsKeyWords);\n testwords(arsKeyWords);\n arsKeyTot = arsKeyTot.concat(arsKeyWords);\n if (sAns.length > 0) {\n bCheck = true;\n }\n console.log(\"Answer - in check for keywords: \", sAns);\n }\n }\n if (sAns.length === 0 || sAns === \"Super sorry! I don't quite understand your question! Do you mind giving me a bit more information? If possible, screenshots would be appreciated :) \\n \\n Cheers!\") {\n checkifseenbefore(arsKeyTot);\n testwords(arsKeyTot);\n }\n if (sAns.length > 0) {\n bCheck = true;\n return;\n }\n}", "function AnalyseData(input) {\n let words = [];\n let wordscounts = [];\n\n input = input.replace(/\\s+/g, \" \").split(\" \");\n\n for (let i = 0; i < input.length; i++) {\n if (input[i] !== \"\") {\n const word = input[i].toLowerCase();\n if (ignoreWords.includes(word))\n continue;\n\n if (!words.includes(word)) {\n words.push(word);\n wordscounts.push({\n word: word,\n count: 1\n });\n } else {\n wordscounts[words.indexOf(word)].count++;\n }\n }\n }\n wordscounts.sort(function (a, b) {\n return b.count - a.count;\n });\n return wordscounts;\n}", "function harmlessRansomeNote(noteText, magazineText) {\n let noteArray = noteText.split(\" \")\n let magazineArray = magazineText.split(\" \")\n let magazineObj = {}\n let result = true\n \n magazineArray.forEach(word => {\n if (!magazineObj[word]) magazineObj[word] = 0;\n magazineObj[word]++\n })\n \n noteArray.forEach(word => {\n if (magazineObj[word] > 0) magazineObj[word]--;\n else result = false \n })\n \n console.log(result)\n}", "function anagramsAlt(string) {\n let arr = string.split('')\n let arr2 = []\n let n = arr.length\n let count = 0;\n\n //Populate arr2\n for (let i = 0; i < n; i++) {\n arr2.push(0)\n }\n\n count ++\n console.log(arr, count)\n\n let e = 0;\n while (e < n) {\n if (arr2[e] < e) {\n if (e % 2 === 0) {\n let placeholder = arr[0]\n arr[0] = arr[e]\n arr[e] = placeholder\n } else {\n // arr[arr2[e]], arr[e]\n let placeholder = arr[arr2[e]]\n arr[arr2[e]] = arr[e]\n arr[e] = placeholder\n }\n count ++\n console.log(arr, count)\n arr2[e]++\n e = 0\n } else {\n arr2[e] = 0\n e++\n }\n }\n}", "function sol(words) {\n // build graph\n // topological sort\n const inDegree = {};\n const graph = {};\n buildGraph();\n return bfs();\n\n function bfs() {\n const res = \"\";\n const totalChars = Object.keys(graph).length;\n const q = [];\n for (let c of Object.keys(graph)) {\n if (inDegree[c] === 0) {\n res += c;\n q.push(c);\n }\n }\n while (q.length) {\n const cur = q.shift();\n if (graph[cur] === null || graph[cur].length === 0) continue;\n for (let neighbor of graph[cur]) {\n inDegree[neighbor]--;\n if (inDegree[neighbor] === 0) {\n q.push(neighbor);\n res += neighbor;\n }\n }\n }\n\n return res.length === totalChars ? res : \"\";\n }\n\n function buildGraph() {\n for (let word of words) {\n for (let char of word.split(\"\")) {\n graph[char] = new Set();\n }\n }\n\n for (let i = 1; i < words.length; i++) {\n const first = words[i - 1];\n const second = words[i];\n const len = Math.min(first.length, second.length);\n for (let j = 0; j < len; j++) {\n if (first[j] !== second[j]) {\n const OUT = first[j];\n const IN = first[j];\n\n if (!graph[OUT].has(IN)) {\n graph[OUT].add(IN);\n inDegree[IN] ? inDegree[IN]++ : (inDegree[IN] = 1);\n }\n\n break;\n }\n }\n }\n }\n}", "function solve(s){\r\n const newS = s.split('');\r\n const vowels = ['a', 'e', 'i', 'o', 'u'];\r\n let testCounter = 0;\r\n let finalCounter = 0;\r\n \r\n for(let i = 0; i < newS.length; i++){\r\n if(vowels.includes(newS[i])) {\r\n testCounter++\r\n }\r\n else{\r\n if(testCounter > finalCounter) {\r\n finalCounter = testCounter;\r\n }\r\n testCounter = 0;\r\n }\r\n }\r\n return finalCounter;\r\n }", "function getEpiphoraCount() {\r\n text = workarea.textContent;\r\n \r\n epiphora_candidates = [];\r\n first_index = 0;\r\n last_index = 0;\r\n for(i=0; i < sentences.length-1; i++) {\r\n if(sentences[i].match(/\\S+$/) == null) {\r\n last_word = sentences[i].match(/\\S+\\s$/)[0];\r\n }\r\n else {\r\n last_word = sentences[i].match(/\\S+$/)[0];\r\n }\r\n if(last_word.match(\"said\")) {\r\n continue;\r\n }\r\n first_index = i;\r\n last_index = first_index;\r\n for(j=i+1; j<sentences.length; j++) {\r\n if(last_word == sentences[j].match(last_word.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\*/g, \"[*]\").replace(/\\?/g,\"[?]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\"))) {\r\n last_index = j;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if(last_index > first_index) {\r\n tmp = [];\r\n tmp2 = [];\r\n for(first_index; first_index <= last_index; first_index++) {\r\n tmp.push(sentences[first_index]);\r\n tmp2.push(first_index);\r\n }\r\n epiphora_candidates.push([last_word, tmp, tmp2]);\r\n i = last_index;\r\n }\r\n }\r\n flag = true;\r\n if(epiphora_candidates.length != 0) {\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n last_words = new RegExp(\"\\\\S+\\\\s\" + epiphora_candidates[i][0].replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\"));\r\n if(epiphora_candidates[i][1][0].match(last_words) != null) {\r\n last_words = epiphora_candidates[i][1][0].match(last_words)[0];\r\n tmp = [];\r\n for(j=0; j < epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].match(last_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n epiphora_candidates[i][0] = last_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = false;\r\n }\r\n else {\r\n control_array[i] = true;\r\n }\r\n }\r\n if(control_array.indexOf(false) != -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n\r\n flag = true;\r\n while(flag) {\r\n control_array = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n last_words = new RegExp(\"\\\\S+\\\\s\" + epiphora_candidates[i][0].replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\"));\r\n if(epiphora_candidates[i][1][0].match(last_words) != null) {\r\n last_words = epiphora_candidates[i][1][0].match(last_words)[0];\r\n tmp = [];\r\n for(j=0; j < epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].match(last_words.replace(/\\[/g, \"\\\\[\").replace(/\\]/g, \"\\\\]\").replace(/\\)/g, \"[)]\").replace(/\\(/g,\"[(]\").replace(/\\?/g,\"[?]\")) != null) {\r\n tmp.push(true);\r\n }\r\n else {\r\n tmp.push(false);\r\n }\r\n }\r\n control_array.push(tmp);\r\n if(tmp.indexOf(false) == -1) {\r\n epiphora_candidates[i][0] = last_words;\r\n }\r\n }\r\n }\r\n for(i=0; i<control_array.length; i++) {\r\n if(control_array[i].indexOf(false) != -1) {\r\n control_array[i] = true;\r\n }\r\n else {\r\n control_array[i] = false;\r\n }\r\n }\r\n if(control_array.indexOf(false) == -1){\r\n flag = false;\r\n }\r\n else {\r\n flag = true;\r\n }\r\n }\r\n }\r\n\r\n for(i=0; i < epiphora_candidates.length; i++) {\r\n delete epiphora_candidates[i].pop()\r\n }\r\n\r\n temp = [];\r\n for(i=0; i<epiphora_candidates.length; i++) {\r\n epiphora_length = epiphora_candidates[i][0].split(\" \").length;\r\n count = 0;\r\n for(j=0; j<epiphora_candidates[i][1].length; j++) {\r\n if(epiphora_candidates[i][1][j].split(\" \").length == epiphora_length && epiphora_length < 5) {\r\n count++;\r\n }\r\n }\r\n if (count!=epiphora_candidates[i][1].length) {\r\n temp.push(epiphora_candidates[i])\r\n }\r\n }\r\n epiphora_candidates = temp;\r\n\r\n result = epiphora_candidates;\r\n return result.length;\r\n}", "function minDistance(word1, word2) {\n // equation is length of w1 + length of w2 - (2 * length of longest common subsequence)\n // in case of total mismatch, the answer will just be the combined lengths\n // * 2 makes sense since each mismatch requires 2 operations\n \n const matrix = [];\n for(let i = 0; i < word1.length + 1; i++) {\n matrix.push([])\n for(let j = 0; j < word2.length + 1; j++) {\n matrix[i].push(0)\n }\n }\n console.log(matrix)\n \n for(let i = 0; i <= word1.length; i++) {\n for(let j = 0; j <= word2.length; j++) {\n console.log()\n if(i === 0 || j === 0) continue\n if(word1[i - 1] === word2[j - 1]) {\n matrix[i][j] = matrix[i - 1][j - 1] + 1;\n } else {\n matrix[i][j] = Math.max(matrix[i - 1][j], matrix[i][j - 1])\n }\n }\n }\n \n \n return word1.length + word2.length - (2 * matrix[word1.length][word2.length])\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 bestWords(arr) {\n\tlet obj = {\n\t\tA: 1,\n\t\tB: 3,\n\t\tC: 3,\n\t\tD: 2,\n\t\tE: 1,\n\t\tF: 4,\n\t\tG: 2,\n\t\tH: 4,\n\t\tI: 1,\n\t\tJ: 8,\n\t\tK: 5,\n\t\tL: 2,\n\t\tM: 3,\n\t\tN: 1,\n\t\tO: 1,\n\t\tP: 3,\n\t\tQ: 10,\n\t\tR: 1,\n\t\tS: 1,\n\t\tT: 1,\n\t\tU: 1,\n\t\tV: 4,\n\t\tW: 4,\n\t\tX: 8,\n\t\tY: 4,\n\t\tZ: 10\n\t}\n\t// PATTERN 1\n\t// let tot = 0;\n\t// let score = [];\n\t// let res = [];\n\t// for (var i = 0; i < arr.length; i++) {\n\t// \tfor (var j = 0; j < arr[i].length; j++) {\n\n\t// \t\ttot += obj[ arr[i][j].toUpperCase().trim() ];\n\n\t// \t\t// console.log(arr[i][j]);\n\t// \t\t// console.log( obj[ arr[i][j].toUpperCase().trim() ] );\n\t// \t}\n\t// \tscore.push(tot);\n\t// \ttot = 0;\n\t// }\n\n\t// let maxVal = Math.max(...score);\n\t// // console.log(maxVal);\n\n\t// for (var j = 0; j < score.length; j++) {\n\t// \tif ( score[j] == maxVal ) {\n\t// \t\t// console.log(arr, score[j])\n\t// \t\tres.push( arr[j] );\n\t// \t}\n\t// }\n\t// return res;\n\n\n\n\t// PATTERN 2\n\t// var p = 0;\n\t// var r = [];\n\t// for (let i in arr) {\n\t// \tlet a = arr[i].toUpperCase().split('');\n\t// \tr[i] = 0;\n\t// \tfor (let j in a) {\n\t// \t\tr[i] += obj[ a[j] ];\n\t// \t}\n\t// }\n\t// p = Math.max(...r)\n\t// return arr.filter((v, i)=> r[i] == p);\n\n\n\t// PATTERN 3\n\tvar p = 0;\n\tvar r = [];\n\tfor (let i in arr) {\n\t\tlet a = arr[i].toUpperCase().split('');\n\t\tr[i] = 0;\n\t\tfor (let j in a) {\n\t\t\tr[i] += obj[ a[j] ];\n\t\t}\n\t\tconsole.log(p,\" p\")\n\t\tconsole.log(r[i], \" r[i]\")\n\t\tconsole.log(Math.max(r[i], p))\n\t\tconsole.log('')\n\t\tp = Math.max(r[i], p)\n\t}\n\treturn arr.filter((v, i)=> r[i] == p);\n\n\n\n}", "function wordsRepetition(words) {\n let uniqueWords = [...new Set(words)];\n let wordRepetition = [];\n // Finding how many times each word repeat in quaries\n function frequency(word) {\n let counter = 0;\n for (let i = 0; i < words.length; i++) {\n if (words[i] === word) counter++;\n }\n return counter;\n }\n // Calculate impr/click of the word\n function imprOrClick(type, word) {\n let value = 0;\n for (let i = 0; i < inputData.length; i++) {\n if (inputData[i].query.includes(word) === true) value += inputData[i][type];\n }\n return value;\n }\n\n // Calculate total impr/click of the URL\n function totalImprOrClick(type) {\n let value = 0;\n for (let i = 0; i < inputData.length; i++) {\n value += inputData[i][type];\n }\n return value;\n }\n \n let totalImpr = totalImprOrClick(\"impr\");\n let totalClick = totalImprOrClick(\"click\");\n let inputDataLen = inputData.length;\n\n\n for (let i = 0; i < uniqueWords.length; i++) {\n wordRepetition[i] = {\n word: uniqueWords[i],\n weight: (frequency(uniqueWords[i]) * imprOrClick(\"impr\", uniqueWords[i]) * Math.pow(uniqueWords[i].length, 2)),\n freq: frequency(uniqueWords[i]),\n freqPercent: frequency(uniqueWords[i]) / inputDataLen,\n impr: imprOrClick(\"impr\", uniqueWords[i]),\n imprPercent: imprOrClick(\"impr\", uniqueWords[i]) / totalImpr,\n click: imprOrClick(\"click\", uniqueWords[i]),\n clickPercent: imprOrClick(\"click\", uniqueWords[i]) / totalClick,\n wordsInPhrase: uniqueWords[i].split(\" \").length\n }\n }\n\n function weightSum(arr) {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n sum += arr[i][\"weight\"];\n }\n return sum;\n }\n\n let totalWeight = weightSum(wordRepetition);\n\n for (let i = 0; i < wordRepetition.length; i++) {\n wordRepetition[i][\"weightPercent\"] = wordRepetition[i][\"weight\"] / totalWeight;\n }\n\n return wordRepetition;\n}", "edit(onPaper,wordToAdd){cov_14q771vu2z.f[6]++;// Find where to insert the word\nlet whereToStart;cov_14q771vu2z.s[47]++;for(let i=0;i<onPaper.length;i++){cov_14q771vu2z.s[48]++;if((cov_14q771vu2z.b[10][0]++,onPaper[i]===' ')&&(cov_14q771vu2z.b[10][1]++,onPaper[i+1]===' ')){cov_14q771vu2z.b[9][0]++;cov_14q771vu2z.s[49]++;whereToStart=i+1;cov_14q771vu2z.s[50]++;break;}else{cov_14q771vu2z.b[9][1]++;}}// After finding out where to insert the word, switch all the blank spaces with the letters of the word you want to add\nlet splitOnPaper=(cov_14q771vu2z.s[51]++,onPaper.split(''));cov_14q771vu2z.s[52]++;for(let i=0;i<wordToAdd.length;i++){cov_14q771vu2z.s[53]++;// If you word is too long and it tries to replace a non-blank space, replace it with @\nif(splitOnPaper[whereToStart]!==' '){cov_14q771vu2z.b[11][0]++;cov_14q771vu2z.s[54]++;splitOnPaper[whereToStart]='@';}else{cov_14q771vu2z.b[11][1]++;cov_14q771vu2z.s[55]++;splitOnPaper[whereToStart]=wordToAdd[i];}cov_14q771vu2z.s[56]++;whereToStart++;}cov_14q771vu2z.s[57]++;onPaper=splitOnPaper.join('');cov_14q771vu2z.s[58]++;return onPaper;}", "function compare( word, guess ) { // DO NOT MODIFY\n word = word.toLowerCase();\n guess = guess.toLowerCase();\n\tlet wordArr = [];\n\tfor(let i =0; i< word.length; i++){\n\t\tif(!wordArr.includes(word[i])){\n\t\t\twordArr.push(word[i]);\n\t\t}\n\t}\n \n\tlet guessArr = [];\n\tfor(let j =0; j< guess.length; j++){\n\t\tif(!guessArr.includes(guess[j])){\n\t\t\tguessArr.push(guess[j]);\n\t\t}\n\t}\n \n\tlet count = 0;\n\tfor(let i = 0; i< wordArr.length; i++){\n\t\tif(guessArr.includes(wordArr[i])){\n\t\t\tcount++;\n\t\t}\n\t}\n return count; // this line is wrong\n}", "function main() {\n var m_temp = readLine().split(' ');\n var m = parseInt(m_temp[0]);\n var n = parseInt(m_temp[1]);\n magazine = readLine().split(' ');\n ransom = readLine().split(' ');\n \n // return 'no' if more note than mag words exist\n if (n > m) return process.stdout.write('No');\n \n var words = {};\n \n // add mag words to dictionary\n for (var i = 0, l = m; i < l; i++) {\n var w = magazine[i];\n if (words[w]) words[w] += 1;\n else words[w] = 1;\n }\n \n // loop through ransom words\n for (var i = 0, l = n; i < l; i++) {\n var w = ransom[i];\n if (words[w]) {\n words[w] === 1 \n ? delete words[w]\n : words[w] -= 1;\n } else {\n return process.stdout.write('No');\n }\n }\n \n return process.stdout.write('Yes');\n}", "function toWeirdCase (string) {\n var arrOfWords = string.split(' ')\n //console.log(arr)\n //console.log(arrOfWords)\n\n var alteredArray = [];\n\n // arrOfWords.forEach((word) => {\n // var arr = word.split('')\n // for(let i = 0; i < arr.length; i++) {\n // if(i % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // } else {\n // alteredArray.push(arr[i].toLowerCase())\n // }\n // }\n // if (arrOfWords.length > 1) {\n // alteredArray.push(' ')\n // }\n // })\n\n // needed to do it this way so I could add the last condition on line 116 so there wouldnt be spaces at end\n for(let j = 0; j < arrOfWords.length; j ++) {\n var arr = arrOfWords[j].split('')\n for(let i = 0; i < arr.length; i++) {\n if(i % 2 == 0) {\n alteredArray.push(arr[i].toUpperCase())\n } else {\n alteredArray.push(arr[i].toLowerCase())\n }\n }\n if (arrOfWords.length > 1 && j < (arrOfWords.length - 1)) {\n alteredArray.push(' ')\n }\n }\n\n var finalString = alteredArray.join('')\n \n //console.log(finalString)\n\n return finalString;\n\n\n //ALL ATTEMPTS\n\n // for(let i = 0; i < arr.length; i++) {\n // var fakeIndex;\n // // if we're on the first one, or the last position wasnt a space, continue as normal\n // if(i == 0 || (arr[i-1] !== ' ')) {\n // if(i % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // } else {\n // alteredArray.push(arr[i].toLowerCase())\n // }\n // // if the last position was a space, and the current index is EVEN\n // } else if (arr[i - 1] == ' ' && i % 2 == 0) {\n // //if(i % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // //} else {\n // // alteredArray.push(arr[i].toLowerCase())\n // //}\n // } else if (arr[i - 1] == ' ' && i % 2 !== 0) {\n // fakeIndex = 2\n // if(fakeIndex % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // }\n // }\n\n // //console.log(i)\n // // var index = i\n // // if (arr[i] == ' ') {\n // // // want index to = something NOT even\n // // //index = 1\n // // // also want to make sure the index after the space IS even\n\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n // // } \n \n // // else if (index % 2 == 0) {\n // // alteredArray.push(arr[i].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[i].toLowerCase())\n // // }\n\n // // 4 lines below are what I originally had that makes function work with single word strings\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n\n\n // // if its not a space, execute the block below\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n\n // // if it is a space\n // // \n\n // // if its a space, and its odd were fine (next index will be even anyways)\n // // if (arr[i] == ' ' && ((arr[i] % 2) !== 0)) {\n // // // want index to = something NOT even\n // // //index = 1\n // // // also want to make sure the index after the space IS even\n\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n // // } \n // // if its a space, and the index is EVEN, we want to make sure the next index is EVEN again somehow\n \n // }\n \n // //console.log(alteredArray)\n // var finalString = alteredArray.join('')\n // console.log(finalString)\n // return finalString;\n\n // END OF ATTEMPTS\n}", "function compare( word, guess ) { // DO NOT MODIFY\n\nlet count = 0;\nlet word1 = word.toUpperCase();\nlet word2 = guess.toUpperCase();\n for(let i = 0; i < word1.length; i++){\n let word2Index = word2.indexOf(word1[i]);\n if(word2Index >= 0){\n word2 = word2.replace(word2.charAt(word2ndex),\"\");\n count++;\n }\n }\n return count; \n}", "function calc_conf_score(input_set, master_paragraph){\n\n let num_same_words = 0;\n // clean string and split by spaces\n let master_paragraph_split = master_paragraph.toLowerCase().replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g,\"\").replace(/\\s{2,}/g,\" \").split(\" \");\n let master_paragraph_split_filtered = master_paragraph_split.filter((x)=>!unimportant_words.has(x));\n let num_words_paragraph = master_paragraph_split_filtered.length;\n\n for(var i = 0; i < master_paragraph_split_filtered.length; i++){\n if (input_set.has(master_paragraph_split_filtered[i])){\n num_same_words++;\n }\n }\n return (num_same_words / num_words_paragraph);\n}", "function countWords(allWords) {\n // double loop to create an array of unique words together with array of their occurence in text\n for (let i = 0; i < allWords.length; i++) { //going through all the words\n let isThere = false; // boolean to know whether word is already stored in uniqueWords\n for (let j = 0; j < uniqueWords.length; j++) { // identyfying the current word in uniqueWords\n if (allWords[i] == uniqueWords[j]) { // if the word is already in uniqueWords\n isThere = true; // forbid it to be added again\n wordCount[j]++; // increase the number of occurences of a specific word\n }\n }\n\n if (isThere == false) { // if the word is not in uniqueWords, add it and count his occurrence\n uniqueWords.push(allWords[i]);\n wordCount.push(1);\n }\n isThere = false;\n }\n\n // loop to fill the table with all the unique words and their appropriate frequencies\n for (let k = 0; k < uniqueWords.length; k++) {\n $(\"#occurrenceTable\").append(\"<tr><td>\" + uniqueWords[k] + \"</td><td>\" + wordCount[k] + \"</td></tr>\");\n }\n}", "function createGoodness() {\n\n var numPhrases = 100\n\n //get starting word\n var newShit = getNewWord()\n \n\n //Save last word for key \n var lastWord = newShit\n \n\n for(var i = 0; i < numPhrases - 1; i++) {\n\n var newWord = \"\"\n\n if(words.has(lastWord)) {\n newWord = words.get(lastWord).getWord()\n }\n else {\n var newWord = getNewWord()\n }\n\n newShit += \" \"\n newShit += newWord\n lastWord = newWord\n \n }\n\n //console.log(newShit)\n document.getElementById(\"MarkovText\").innerHTML = newShit\n\n var longest = 0\n words.forEach(item => {\n if(item.getNumFollowers() > longest) {\n longest = item.getNumFollowers() \n }\n })\n\n console.log(longest)\n}", "function harmlessRansomNote(noteText, magazineText){\n var noteArr = noteText.split(\" \");\n var magazineArr = magazineText.split(\" \");\n var magazineObj = {};\n\n //magazineArr.forEach(word => { THIS CAN ALSO BE USED INSTEAD OF NEXT LINE\n magazineArr.forEach(function(word) {\n if (!magazineObj[word]) magazineObj[word] = 0;\n magazineObj[word]++;\n });\n console.log(magazineObj);\n\n}", "function nestedWordCount (wordList) {\n const countContainedWords = (word) => (\n wordList.reduce((sum, otherWord) => (\n word.includes(otherWord) && word !== otherWord ? sum + 1 : sum\n ), 0)\n );\n return wordList.reduce((biggest, word) => {\n const count = countContainedWords(word);\n return count > biggest.count ? { count, word } : biggest;\n },{ count: 0 }).word;\n}", "function dualWordReduce(t, i, index, arr) {\n const innerT = t;\n if (arr[index] && arr[index + 1]) {\n if (innerT.every((z) => z.word !== `${arr[index]} ${arr[index + 1]}`)) {\n innerT.push({ word: `${arr[index]} ${arr[index + 1]}`, times: 1 });\n } else {\n const indy = t.findIndex(\n (x) => x.word === `${arr[index]} ${arr[index + 1]}`\n );\n innerT[indy].times += 1;\n }\n }\n return innerT;\n }", "function changeToPigLatin(text) {\n\n var wordArray = text.split(\" \");\n var newtext = \"\";\n\n wordArray.forEach(element => {\n\n if (element[0] === 'a' || element[0] === 'e' || element[0] === 'i' || element[0] === 'u' || element[0] === 'o') {\n console.log(newtext.concat(element.slice(1, 6) + element[0] + \"way\"));\n }\n else if (getCount(element) === 1) {\n console.log(newtext.concat(element.slice(1, 7) + element[0] + \"ay\"));\n }\n else if (getCount(element) === 2) {\n console.log(newtext.concat(element.slice(2, 8) + element[0] + element[1] + \"ay\"));\n }\n\n });\n\n return text;\n}", "function countingAnagrams(str) {\n // Your code here\n counter = 0;\n words = str.split(' ')\n console.log(words)\n for (var i = 0; i < words.length; i++) {\n for (var j=0;j<words.length;j++){\n if (words[i]!==words[j] && isAnagram(words[i],words[j])){\n console.log(isAnagram(words[i],words[j]))\n counter++\n }\n }\n return counter\n }\n}", "function cantidadCaracteres(frase) {\r\n \r\n let i=0;\r\n let nuevaPalabra=\"\";\r\n let nuevaFrase=\"\";\r\n let longitud=frase.length;\r\n let longitudNP=0;\r\n\r\n\r\n for ( i == 0; i < longitud; i++) {\r\n \r\n while (frase[i] ==\" \") {\r\n i++;\r\n } \r\n if (frase[i]==\"a\" || frase[i]==\"A\") {\r\n\r\n while ((frase[i]!=' ') && (i < longitud) ) {\r\n nuevaPalabra = nuevaPalabra+frase[i];\r\n i++;\r\n longitudNP++;\r\n } \r\n if (nuevaPalabra[longitudNP-1]==\"r\" ||nuevaPalabra[longitudNP-1]==\"R\") {\r\n nuevaFrase= nuevaFrase+nuevaPalabra+\" \";\r\n }\r\n nuevaPalabra=\"\";\r\n longitudNP=0;\r\n }else{\r\n if ((frase[i] !=\" \") && (i<longitud)) {\r\n i++;\r\n }\r\n }\r\n } \r\n return nuevaFrase;\r\n \r\n}", "function longestWords(){\r\n for (i=0; i < posts.length; i++){ // pavercia kiekviena masyvo eilute i array \r\n posts[i] = posts[i].split(\" \"); // kad butu galima skaiciuoti zodzio ilgi\r\n }\r\n \r\nvar line = \"\";\r\nvar word = \"\";\r\nfor (array in posts){ // atlieka veiksmus kiekvienam array is eiles\r\n var maxW = 0;\r\n i = 0;\r\n \r\n while (i < posts[array].length){ // skaiciuoja ilgiausia zodi kiekvienam array\r\n if (posts[array][i].length > maxW){\r\n maxW = posts[array][i].length;\r\n }\r\n i++;\r\n }\r\n \r\n for (i=0; i < posts[array].length; i++){ // paima ilgiausia zodi is array\r\n if (posts[array][i].length == maxW){\r\n word = posts[array][i];\r\n }\r\n }\r\n line += word + \" \"; // sukuria tekstine eilute is visu ilgiausiu zodziu\r\n} \r\n\r\nconsole.log(line); // isveda rez i konsole\r\n \r\n}", "function secondProblem(){\n var firstInput = document.getElementById('firstInputArray').value;\n var secondInput = document.getElementById('secondInputArray').value;\n var result = document.getElementById('secondAnswer');\n\n // Check if the input is empty or contains only whitespaces\n if(firstInput === '' || secondInput === '' || !firstInput.match(/\\S/) || !secondInput.match(/\\S/)){\n result.innerHTML = 'Input cannot be empty!';\n return;\n } else{\n result.innerHTML = '';\n firstInput = firstInput.split(', ');\n secondInput = secondInput.split(', ');\n var lesserLength = Math.min(firstInput.length, secondInput.length);\n var lexicographicallyFirst = firstInput;\n\n for (var i = 0; i < lesserLength; i++)\n {\n // If a letter in the second word is before it's counterpart (lexicographically)\n if (firstInput[i] > secondInput[i])\n {\n lexicographicallyFirst = secondInput;\n break;\n }\n }\n\n lexicographicallyFirst = lexicographicallyFirst.join(', ');\n result.innerHTML += lexicographicallyFirst;\n console.log('Lexicographically first is: ' + lexicographicallyFirst);\n }\n}", "function compareWords(answer, guessed) {\n // In this case, we know guessed is the same length as letters\n // So we can just compare each index to see if they're the same\n for (let i = 0; i < answer.length; i++) {\n // if the first letter in guessed is not the same as the first letter in answer\n // then we know they haven't gotten the full word right yet\n if (answer[i] !== guessed[i]) {\n return 'Not yet';\n }\n }\n\n // If we get through the whole loop then we know each letter matched\n // So we can assume they got it correct\n return 'Correct!';\n }", "function duplicateCount(text){\n let counter = 0;\n let str = text.toLowerCase();\n for (let i = 0; i < text.length; i++) {\n if (str.length - str.split(text[i]).join(\"\").length >= 2 ) {\n str = str.split(text[i]).join(\"\");\n counter++;\n console.log(str , counter , i);\n }\n }\n return counter;\n }", "function s(str) {\n let commonWords = [\"the\", \"a\", \"or\", \"an\", \"it\", \"and\", \"but\", \"is\", \"are\", \"of\", \"on\", \"to\", \"was\", \"were\", \"in\", \"that\", \"i\", \"your\", \"his\", \"their\", \"her\", \"you\", \"me\", \"all\"];\n let ob = {}\n let strSplit = str.split(/[\\s,]+/)\n\n for ( let i = 0 ; i < strSplit.length ; i++) {\n let temp = strSplit[i].toLocaleLowerCase()\n if (!commonWords.includes(temp) && temp!== ' ' && temp!== ',' && ob[temp] !== undefined){\n ob[temp] += 1 \n }else if (!commonWords.includes(temp) && temp!== ' ' && temp!== ',' && ob[temp] === undefined){\n ob[temp] = 1 \n } \n }\n\n console.log ('***** new ob *****', ob)\n let keyArr = Object.keys(ob)\n console.log ('***** new keyArr *****', keyArr)\n let max = ob[keyArr[0]]\n console.log ('***** initial max *****', max)\n let winWord = keyArr[0]\n console.log ('***** initial win word *****', winWord)\n \n for (let i = 1 ; i < keyArr.length ; i++){\n if (ob[keyArr[i]]> max ){\n winWord = keyArr[i]\n max = ob[keyArr[i]]\n // winWordCount = max\n }\n }\n console.log ('***** win word is *****', winWord)\n console.log ('***** win word count : *****', max)\n\n}", "function spell_checker() {\r\n\t//this part is data handeling code, this you can change any way you like\r\n\t$('.spell_check_editor').html('');\r\n\tvar corrected_words_num = 0;\r\n\tvar myinterval;\r\n\tvar seconds = 0;\r\n\tvar newtext = \"\";\r\n\tvar this_text = \"\";\r\n\tvar nthchild = 0;\r\n\tvar word_spelled_correct = false;\r\n\tvar text = $(\"#textAreaId\").val();\r\n\t// bug 2 has something to do with the fact that i split text by newlines and spaces. \r\n\t// it doesn't take into acount more than one space\r\n\tvar words = text.split( /\\s+/ );\r\n\tfor (var re = 0; re < (words.length-1); re++) {\r\n\t\tmultiword_checker = words[re]+\" \"+words[re+1];\r\n\t\tfor (var r_e = 0; r_e < multiword.length; r_e++){\r\n\t\t\tif (multiword_checker == multiword[r_e]) {\r\n\t\t\t\tis_multiword = true\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (is_multiword){\r\n\t\t\twords.splice(re,2,multiword_checker);\r\n\t\t\tis_multiword = false;\r\n\t\t}\r\n\t}\r\n\tnewline_array = text.split( \"\\n\" );\r\n\t// $('.test').remove();\r\n\t// $('h1').after('<p class=\"test\">'+newline_array+'</p>');\r\n\tfor (var ind = 0; ind < newline_array.length; ind++){\r\n\t\tif (newline_array[ind]==\"\"){\r\n\t\t\tvar sample_text = \"\"\r\n\t\t\tvar last_text = \"\"\r\n\t\t\tvar counter = 0;\r\n\t\t\twhile(last_text == \"\"){\r\n\t\t\t\tif (ind-(counter+1)<0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tsample_text = newline_array[(ind-(counter+1))].split(/\\s+/);\r\n\t\t\t\tlast_text = sample_text[sample_text.length-1];\r\n\t\t\t\tif (last_text != \"\"){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcounter++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar inde = words.indexOf(last_text)+1;\r\n\t\t\twords.splice(inde,0,\"\")\r\n\t\t}\r\n\t}\r\n\tvar x_add = 0;\r\n\tfor (var rep = 0; rep < newline_array.length; rep++){\r\n\t\tvar newline_words = newline_array[rep].split(/\\s+/);\r\n\t\tvar newline_words_space = newline_array[rep].match(/\\s+/g);\r\n\t\tif (newline_words_space !== null) {\r\n\t\t\tfor (var indexe = 0; indexe < newline_words_space.length; indexe++){\r\n\t\t\t\tvar samp_str = newline_words_space[indexe];\r\n\t\t\t\tif (samp_str.length > 1){\r\n\t\t\t\t\tfor (var samp = 1; samp < samp_str.length; samp++){\r\n\t\t\t\t\t\tnewline_words[indexe+1] = newline_words[indexe+1]+' ';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (var re = 0; re < (newline_words.length-1); re++) {\r\n\t\t\tmultiword_checker = newline_words[re]+\" \"+newline_words[re+1];\r\n\t\t\tfor (var r_e = 0; r_e < multiword.length; r_e++){\r\n\t\t\t\tif (multiword_checker == multiword[r_e]) {\r\n\t\t\t\t\tis_multiword = true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (is_multiword){\r\n\t\t\t\tnewline_words.splice(re,2,multiword_checker);\r\n\t\t\t\tis_multiword = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar text_back = newline_words.join( \"</span> <span>\" );\r\n\t\tif (rep > 0){\r\n\t\t\t$('.spell_check_editor').append('\\n');\r\n\t\t}\r\n\t\t$('.spell_check_editor').append('<span>'+text_back+'</span');\r\n\t\t// this for loop checks the spelling of all the single words and multiwords\r\n\t\tfor (var x = 0; x < newline_words.length; x++){\r\n\t\t\tspelled_correct = false;\r\n\t\t\tfor (var xx = 0; xx < dummy_words.length; xx++){\r\n\t\t\t\tif (newline_words[x] == dummy_words[xx] || newline_words[x] == dummy_words[xx]+\",\" || newline_words[x] == dummy_words[xx]+\".\" || newline_words[x] == \"\"){\r\n\t\t\t\t\tspelled_correct = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!spelled_correct) {\r\n\t\t\t\tcorrected_words[corrected_words_num] = newline_words[x];\r\n\t\t\t\tcorrected_words_num++;\r\n\t\t\t\t$('.spell_check_editor span:nth-child('+(x+x_add+1)+')').addClass('misspelled');\r\n\t\t\t}\r\n\t\t\tif (spelled_correct) {\r\n\t\t\t\tcorrected_words.splice(x,1)\r\n\t\t\t}\r\n\t\t}\r\n\t\tx_add+=newline_words.length;\r\n\t}\r\n\t// $('.test').remove();\r\n\t// $('h1').after('<p class=\"test\">'+newline_array+'</p>');\r\n\t// for (var x = 0; x < words.length; x++){\r\n\t// \tspelled_correct = false;\r\n\t// \tfor (var xx = 0; xx < dummy_words.length; xx++){\r\n\t// \t\tif (words[x] == dummy_words[xx] || words[x] == dummy_words[xx]+\",\" || words[x] == dummy_words[xx]+\".\" || words[x] == \"\"){\r\n\t// \t\t\tspelled_correct = true;\r\n\t// \t\t}\r\n\t// \t}\r\n\t// \tif (!spelled_correct) {\r\n\t// \t\tcorrected_words[corrected_words_num] = words[x];\r\n\t// \t\tcorrected_words_num++;\r\n\t// \t\t$('.spell_check_editor span:nth-child('+(x+1)+')').addClass('misspelled');\r\n\t// \t}\r\n\t// \tif (spelled_correct) {\r\n\t// \t\tcorrected_words.splice(x,1)\r\n\t// \t}\r\n\t// }\r\n\t// this part is UI code, leave this mostly as is\r\n\t$('.spell_check_editor span').mouseover(function(e){\r\n\t\tmisspelled_width = $(this).width();\r\n\t\tif (!mouse_down) {\r\n\t\tif ($(this).hasClass('misspelled')){\r\n\t\t\tmyinterval = setInterval(function(){\r\n\t\t\t\tseconds++;\r\n\t\t\t\tif (seconds > 2){\r\n\t\t\t\t\tclearInterval(myinterval);\r\n\t\t\t\t\tseconds = 0;\r\n\t\t\t\t\tvar xwin = e.pageX-40;\r\n\t\t\t\t var ywin = e.pageY-34;\r\n\t\t\t\t if (misspelled_width > 72) {\r\n\t\t\t\t \twidth_dif = misspelled_width - 72;\r\n\t\t\t\t }\r\n\t\t\t\t else {\r\n\t\t\t\t \twidth_dif = 0;\r\n\t\t\t\t }\r\n\t\t\t\t\t$('.spell_recomendations').css({'display':'inline', 'top': ywin+'px', 'left': xwin+'px', 'z-index':'30', 'width':''+(100+width_dif)+''});\r\n\t\t\t\t\t$('.spell_recomendations').html('');\r\n\t\t\t\t\t$('.spell_recomendations').append('<div class=\"spell_recomendations_word\" style=\"width:'+(78+width_dif)+'px;\">'+this_text+'</div>')\r\n\t\t\t\t\t$('.spell_recomendations').append('<div class=\"spell_recomendations_ignore\" style=\"top:0; left:'+(81+width_dif)+'px;\">&#x2714</div>')\r\n\t\t\t\t\t$('.spell_recomendations').append('<div class=\"line\"></div>');\r\n\t\t\t\t\t// this function gets the spelling suggestions for the dropdown\r\n\t\t\t\t\tfor(var z = 0; z < dummy_words.length; z++){\r\n\t\t\t\t\t\t$('.spell_recomendations').append('<div class=\"spell_recomendations_item\" style=\"width:'+(96+width_dif)+'px;\">'+dummy_words[z]+'</div>')\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$('.spell_recomendations div:nth-child(4)').css('background-color','lightgray');\r\n\t\t\t\t\t$('.spell_recomendations div:nth-child(4)').mouseenter(function(){\r\n\t\t\t\t\t\t$(this).css('background-color','lightgray');\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.mouseout(function(){\r\n\t\t\t\t\t\t$(this).css({'background-color':'white','color':'black'});\r\n\t\t\t\t\t});\r\n\t\t\t\t\t$('.spell_recomendations').mouseleave(function(){\r\n\t\t\t\t\t\t$('.spell_recomendations').css('display', 'none');\r\n\t\t\t\t\t\t$('.spell_check_editor span').css('background-color', 'rgba(0,0,0,0)');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t$('.spell_recomendations_item').click(function(){\r\n\t\t\t\t\t\t//this is a data retreval and data handeling function\r\n\t\t\t\t\t\t$('.spell_recomendations').css('display', 'none');\r\n\t\t\t\t\t\t$('.spell_check_editor').html('');\r\n\t\t\t\t\t\tnewtext = $(this).html();\r\n\t\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\t\t// this for loop sends changed word to the spell_check_editor\r\n\t\t\t\t\t\tfor (var repe = 0; repe < newline_array.length; repe++){\r\n\t\t\t\t\t\t\tvar array_check = newline_array[repe].split(/\\s+/);\r\n\t\t\t\t\t\t\tfor (var re = 0; re < (array_check.length-1); re++) {\r\n\t\t\t\t\t\t\t\tmultiword_checker = array_check[re]+\" \"+array_check[re+1];\r\n\t\t\t\t\t\t\t\tfor (var r_e = 0; r_e < multiword.length; r_e++){\r\n\t\t\t\t\t\t\t\t\tif (multiword_checker == multiword[r_e]) {\r\n\t\t\t\t\t\t\t\t\t\tis_multiword = true\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (is_multiword){\r\n\t\t\t\t\t\t\t\t\tarray_check.splice(re,2,multiword_checker);\r\n\t\t\t\t\t\t\t\t\tis_multiword = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tindex = array_check.indexOf(this_text);\r\n\t\t\t\t\t\t\tif (index >= 0){\r\n\t\t\t\t\t\t\t\tarray_check.splice(index, 1, newtext);\r\n\t\t\t\t\t\t\t\tvar string_back = array_check.join(\" \");\r\n\t\t\t\t\t\t\t\tnewline_array[repe] = string_back;\r\n\t\t\t\t\t\t\t\tfor (var rep1 = 0; rep1 < newline_array.length; rep1++){\r\n\t\t\t\t\t\t\t\t\tvar newline_words1 = newline_array[rep1].split(/\\s+/);\r\n\t\t\t\t\t\t\t\t\tvar text_back = newline_words1.join( \"</span> <span>\" );\r\n\t\t\t\t\t\t\t\t\tif (rep1 > 0){\r\n\t\t\t\t\t\t\t\t\t\t$('.spell_check_editor').append('\\n');\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$('.spell_check_editor').append('<span>'+text_back+'</span');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttext_back = \"\";\r\n\t\t\t\t\t\t// this for loop and following lines sends chaged text to textarea\r\n\t\t\t\t\t\tfor (var rep2 = 0; rep2 < newline_array.length; rep2++) {\r\n\t\t\t\t\t\t\tif (rep2 > 0){\r\n\t\t\t\t\t\t\t\ttext_back = text_back+'\\n';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ttext_back = text_back+newline_array[rep2];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$('#textAreaId').val(text_back);\r\n\t\t\t\t\t\tindex = corrected_words.indexOf(this_text);\r\n\t\t\t\t\t\tcorrected_words.splice(index, 1);\r\n\t\t\t\t\t\t$('#textAreaId').focus();\r\n\t\t\t\t\t\tspell_checker();\r\n\t\t\t\t\t});\r\n\t\t\t\t\t// this is an ignore function and you can modify this any way you like, as long as it achieves the same result\r\n\t\t\t\t\t$('.spell_recomendations_ignore').click(function(){\r\n\t\t\t\t\t\t$('#textAreaId').focus();\r\n\t\t\t\t\t\tdummy_words.push(this_text);\r\n\t\t\t\t\t\tspell_checker();\r\n\t\t\t\t\t\t$('.spell_recomendations').css('display', 'none');\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t},200);\r\n\t\t\tthis_text = $(this).html();\r\n\t\t\t$(this).css({'background-color':'yellow', 'cursor':'pointer', 'color':'black', 'z-index':'25'});\r\n\t\t}\r\n\t}\r\n\t})\r\n\t.mouseleave(function(){\r\n\t\t$('.spell_check_editor span').css({'background-color':'rgba(0,0,0,0)', 'z-index':'30', 'color':'rgba(0,0,0,0)'});\r\n\t\tclearInterval(myinterval);\r\n\t\tseconds = 0;\r\n\t});\r\n\t//check_spelling();\r\n\t$('h1').after('<div class=\"dummy_height\" style=\"width:342px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;\"></div>');\r\n\t$('h1').after('<div id=\"textAreaId1\"></div>');\r\n\tvar prev_val = $('#textAreaId').val();\r\n\t$('#textAreaId1').val(prev_val);\r\n\t$('#textAreaId1').val(($('#textAreaId1').val()+'AA'));\r\n\tnewline_array = $(\"#textAreaId1\").val().split(\"\\n\");\r\n\tfor (var re_dum = 0; re_dum < newline_array.length; re_dum++){\r\n\t\tif (re_dum > 0){\r\n\t\t\t$('.dummy_height').append('\\n');\r\n\t\t}\r\n\t\t$('.dummy_height').append('<span>'+newline_array[re_dum]+'<span>')\r\n\t}\r\n\tvar h = $('.dummy_height').height();\r\n\tif (h>=175) {\r\n\t\t$('#textAreaId').css('height',h);\r\n\t\t$('.spell_check_editor').css('top','-'+(165+(h-175))+'px');\r\n\t}\r\n\t$('.dummy_height').remove();\r\n\t$('#textAreaId1').remove();\r\n\tnewline_array = $(\"#textAreaId\").val().split(\"\\n\");\r\n}", "function countWords(string){\n if( string.trim() == \"\" ) return console.log(\"text empty\");\n let list = {} ;\n\nfunction addCount(ele){\n if( ele.trim() == \"\" ) return ;\n if( ele == \" \" ) return ;\n if(list.hasOwnProperty(ele) === true ){\n list[ele]++ ;\n }else{\n list[ele] = 1 ; \n }\n return list \n}\n let brokenSerie = string.replace(/[.*+\\-?^${}()|[\\]%$&¬↵€\"'’«»–\\\\¿!:;¡,=”\\<>/≠]/g,\" \")\n .replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n .split(\" \") ;\n\n let results = brokenSerie.map( e => addCount(e.toLowerCase()) );\n let numberOfWords = Object.values( list ).reduce((cu, e)=> cu +e )\n let sortedList = Object.entries( list ).sort( \n (a, b) =>{ return b[1] - a[1] }\n );\n\n\n // creates a table with the results \n function resultTable(data){\n \n let tableRow = document.createElement(\"div\") ;\n tableRow.classList.add(\"tr\");\n tableRow.setAttribute(\"id\", \"trKing\");\n let dataWord = document.createElement(\"div\") ;\n dataWord.classList.add(\"td\")\n let dataNum = document.createElement(\"div\") ;\n dataNum.classList.add(\"td\")\n let dataPer = document.createElement(\"div\") ;\n dataPer.classList.add(\"td\")\n dataWord.innerText = data[0] ;\n dataNum.innerText = data[1] ;\n dataPer.innerText = ((data[1] * 100)/numberOfWords).toFixed(2) +\"%\" ;\n\n\t\t\t\t\ttableRow.appendChild(dataWord);\n\t\t\t\t\ttableRow.appendChild(dataNum);\n\t\t\t\t\ttableRow.appendChild(dataPer);\n\n\t\t\t\t\twordList.appendChild(tableRow);\n \n }\n\n sortedList.forEach( (e)=>{ resultTable(e) } )\n\n function refreshValues(){\n // sets values of tr, th, total number of words \n total__num.innerText = \"TOTAL: \"+ numberOfWords ;\n form.reset()\n }\n refreshValues() \n}", "function countWords(paragraph, word1, word2 ) {\n // console.log(paragraph.split(' '))\n let countWord1 = 0, countWord2 = 0;\n paragraph.split(' ').filter(element => {\n if(element === word1) {\n countWord1++;\n }\n if(element === word2) {\n countWord2++;\n }\n });\n console.log(`word 1 passed = ${word1} count repeated ${countWord1}, word 2 passed = ${word2} count repeated ${countWord2}`)\n}", "function main() {\n var a = readLine();\n var b = readLine();\n\n function make_anagrams (first_str, second_str) {\n var first_arr = first_str.split('')\n var second_arr = second_str.split('')\n\n var all_hash = {};\n var first_hash = {};\n // store the characters of first string as the key in a hash object\n // with count of occurences as the value\n // also store the characters in a hash that will contain all possible chars from the first and second strings\n for (var i = 0; i < first_arr.length; i++) {\n if (first_hash[first_arr[i]]) {\n first_hash[first_arr[i]]++;\n all_hash[first_arr[i]]++;\n } else { // if the key doesn't exist, initiate count to 1 for key\n first_hash[first_arr[i]] = 1;\n all_hash[first_arr[i]] = 1;\n }\n }\n\n var second_hash = {};\n // store the characters of second string as the key in hash object \n // with count of occurences as the value\n for (var i = 0; i < second_arr.length; i++) {\n if (!(second_arr[i] in second_hash)) { // initiate count to 1 if key does not exist\n second_hash[second_arr[i]] = 1;\n\n // set the count for all_hash appropriately depending if key already exists from looking at first_hash\n all_hash[second_arr[i]] = (second_arr[i] in all_hash) ? all_hash[second_arr[i]]+1 : 1; \n } else {\n second_hash[second_arr[i]]++;\n all_hash[second_arr[i]]++;\n }\n\n \n }\n\n // go through all the characters\n var deletions = 0; // number of deletion operations to make strings anagrams\n for (var letter in all_hash) {\n if (letter in first_hash && letter in second_hash) { \n // character in both strings, subtract to get extra count\n deletions += Math.abs(first_hash[letter] - second_hash[letter]);\n } else if (letter in first_hash) {\n // character only in the first string\n deletions += first_hash[letter]\n } else if (letter in second_hash) {\n // character only in the second string\n deletions += second_hash[letter];\n }\n }\n\n console.log(\"deletions\", deletions);\n }\n\n make_anagrams(a, b);\n}", "function wordRank(str) {\n const strArr = str.split(\" \");\n let word;\n let num = 0;\n strArr.map(function (item) {\n let newNum = 0;\n let lowerCaseItem = item.toLowerCase();\n let newItem;\n if (\n lowerCaseItem[item.length - 1].charCodeAt() < 97 ||\n lowerCaseItem[item.length - 1].charCodeAt() > 122\n ) {\n newItem = lowerCaseItem.slice(0, -1);\n } else {\n newItem = lowerCaseItem;\n }\n //\n for (let i = 0; i < item.length; i++) {\n newNum += newItem.charCodeAt(i);\n if (newNum > num) {\n num = newNum;\n word = item;\n }\n }\n });\n\n if (\n word[word.length - 1].charCodeAt() < 97 ||\n (word[word.length - 1].charCodeAt() > 122 &&\n word[word.length - 1].charCodeAt() < 65) ||\n word[word.length - 1].charCodeAt() > 90\n ) {\n word = word.slice(0, -1);\n }\n\n console.log(word);\n}", "function wordCounter(text) {\r\n const summary = text.split(\" \");\r\n let wordCount = 0;\r\n for (let i = 0; i < summary.length; i++) {\r\n if (text[i] !== \" \") {\r\n wordCount++;\r\n }\r\n }\r\n return wordCount;\r\n\r\n}", "function duplicateCount(text) {\n let new_text = text.toLowerCase().split(\"\");\n console.log(new_text);\n\n let count = 0;\n for (let i = 0; i < new_text.length; i++) {\n let br = 1;\n for (let j = i + 1; j < new_text.length; j++) {\n if (new_text[i] == new_text[j]) {\n count++;\n br = 0;\n break;\n }\n }\n if (br == 0) {\n new_text = new_text.filter(elem => elem != new_text[i])\n i = -1; continue;\n }\n }\n return count;\n}", "function main() {\n var s = readLine();\n var t = readLine();\n var k = parseInt(readLine());\n\n // case 1\n\n if(s.length + t.length <= k){\n console.log(\"Yes\");\n } else{\n // keep iterating until we reach different character\n var commonLength = 0;\n while(commonLength < s.length && commonLength < t.length && s[commonLength] == t[commonLength]){\n commonLength++;\n }\n\n // Diff is the total length of each word minus the common length of each word\n var diff = s.length + t.length - 2*commonLength;\n\n // If the difference is less than k there should be enough moves; however if the diff is odd and the k is even then there are not enough moves\n // you need diff and even and k of even or diff of odd and k of odd. Testing even is easier\n if(diff <= k && diff%2 === k%2){\n console.log(\"Yes\");\n } else {\n console.log(\"No\");\n }\n\n }\n\n}", "function checkMagazine(magazine, note) {\n let map = {};\n let replicable = true;\n // iterate through each elem in magazine & store each elem in the variable i\n for (let i of magazine) {\n // if map[i] has not been initialized, it defaults to zero then one is added. if it has been initialized it simply adds one to its current value. This loop is going through all the words in magazine and keeping count of how many of them there were using the object called map.\n map[i] = (map[i] || 0) + 1; \n console.log(map)\n }\n for (let i of note) {\n // iterate through note and subtracts one for each element again initializing at 0 if needed\n map[i] = (map[i] || 0) - 1;\n console.log(map)\n }\n for (let i in map) {\n // checks all the values in map to make sure that the ransom loop did not remove words from map to the point where we end up below zero. IF below zeo it means note had more occurrences of some word than magazine did.\n if ( map[i] < 0) {\n replicable = false;\n break;\n }\n }\n // ternary if true return 'Yes', if false return 'No'\n console.log(replicable ? 'Yes' : 'No')\n}", "function splitTextByCharCount(text, maxChars, fullWords, rtl) {\n // Maybe the text fits?\n if (text.length <= maxChars) {\n return [text];\n }\n // Init result\n var res = [];\n // Split by words or by charts\n if (fullWords) {\n // Split by words first\n // Split by spacing\n var currentIndex = -1;\n var tmpText = text.replace(/([,;:!?\\\\\\/\\.]+[\\s]+|[\\s])/g, _Strings__WEBPACK_IMPORTED_MODULE_5__[\"PLACEHOLDER\"] + \"$1\" + _Strings__WEBPACK_IMPORTED_MODULE_5__[\"PLACEHOLDER\"]);\n var words = tmpText.split(_Strings__WEBPACK_IMPORTED_MODULE_5__[\"PLACEHOLDER\"]);\n // Process each word\n for (var i = 0; i < words.length; i++) {\n // Get word and symbol count\n var word = words[i];\n var wordLength = word.length;\n // Ignore empty words\n if (wordLength === 0) {\n continue;\n }\n // Check word length\n //if ((wordLength > maxChars) && fullWords !== true) {\n if (wordLength > maxChars) {\n // A single word is longer than allowed symbol count\n // Break it up\n if (rtl) {\n word = reverseString(word);\n }\n var parts = word.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\n // TODO is this correct ?\n if (parts) {\n if (rtl) {\n for (var x = 0; x < parts.length; x++) {\n parts[x] = reverseString(parts[x]);\n }\n //parts.reverse();\n }\n res = res.concat(parts);\n }\n }\n else {\n // Init current line\n if (currentIndex === -1) {\n res.push(\"\");\n currentIndex = 0;\n }\n // Check if we need to break into another line\n if (((res[currentIndex].length + wordLength + 1) > maxChars) && res[currentIndex] !== \"\") {\n res.push(\"\");\n currentIndex++;\n }\n // Add word\n res[currentIndex] += word;\n }\n // Update index\n currentIndex = res.length - 1;\n }\n }\n else {\n // Splitting by anywhere (living la vida facil)\n var parts = text.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\n if (parts) {\n if (rtl) {\n for (var x = 0; x < parts.length; x++) {\n parts[x] = reverseString(parts[x]);\n }\n }\n res = parts;\n }\n }\n // Do we have only one word that does not fit?\n // Since fullWords is set and we can't split the word, we end up with empty\n // set.\n if (res.length == 1 && fullWords && (res[0].length > maxChars)) {\n res = [];\n }\n return res;\n}", "function answer(sentence) {\n // Write your code here\n let arrayOfReverseWord = sentence\n .split(' ')\n .map((word) => word.split('').reverse().join(''));\n return arrayOfReverseWord.join(' ');\n}", "function checkDictionary(sentence, firstCall) {\r\n if (!sentence) {\r\n return;\r\n }\r\n if (firstCall) {\r\n //console.log(sentence)\r\n iCurrentSubs = sentence;\r\n }\r\n var translationsFound = false;\r\n var wordsSingles = sentence.replaceAll(\"\\n\", \" \").replaceAll(/\\s\\s+/g, \" \").replaceAll(/[^A-Za-z\\s\\'\\-]/, \"\").split(\" \");\r\n var wordsPairs = [];\r\n var wordsTriple = [];\r\n var wordsArray = [];\r\n\tspeakArray = []\r\n\r\n if (checkAutoSubtitles()) {\r\n wordsArray = wordsSingles;\r\n } else {\r\n for (var i = 0; i < wordsSingles.length; i++) {\r\n if (wordsSingles[i] && wordsSingles[i + 1]) {\r\n wordsPairs.push(wordsSingles[i].trim() + \" \" + wordsSingles[i + 1].trim());\r\n }\r\n }\r\n for (var i = 0; i < wordsSingles.length; i++) {\r\n if (wordsSingles[i] && wordsSingles[i + 1] && wordsSingles[i + 2]) {\r\n wordsTriple.push(wordsSingles[i].trim() + \" \" + wordsSingles[i + 1].trim() + \" \" + wordsSingles[i + 2].trim());\r\n }\r\n }\r\n\r\n wordsArray = wordsPairs.concat(wordsSingles);\r\n wordsArray = wordsTriple.concat(wordsArray);\r\n }\r\n\r\n\r\n for (var i = 0; i < wordsArray.length; i++) {\r\n var currentWord = wordsArray[i].trim();\r\n var entry = checkWord(currentWord);\r\n if (entry) {\r\n translationsFound = true;\r\n // var translation = entry.translation;\r\n var translation = cleanTranslations(entry).toString();\r\n var translationMessage = \"\\n\" + currentWord.toUpperCase() + \": \" + translation.toString().toLowerCase();\r\n if (!sentence.includes(translationMessage)) {\r\n\t\t\t\tspeakArray.push(currentWord)\r\n // console.log(sentence)\r\n // console.log(\"Replace with: \" + translation)\r\n\t\t\t\t\r\n\t\t\t\tvar shortForm = currentWord.replaceAll(/(ing$|s$|ed$|d$)/,\"\")\r\n\t\t\t\tif(iOriginalForm == shortForm ){\r\n\t\t\t\t\tcurrentWord = shortForm;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n var upperCaseWord = sentence.replaceAll(currentWord, currentWord.toUpperCase());\r\n sentence = upperCaseWord + translationMessage;\r\n }\r\n }\r\n }\r\n showSubtitles(sentence, translationsFound);\r\n //return sentence\r\n}", "function censura(text, words){\n // words = ['serie', 'di', 'parole', 'da', 'censurare'];\n // var arrText = [];\n // var arrWords =[];\n // var newtxt = [];\n // arrText.push();\n var arrText = text.split(' ')\n // arrWords.push();\n var arrWords = words.split(' ')\n console.log(' nella funzione gli array',arrText, arrWords);\n for (var i = 0; i < arrText.length; i++) {\n\n // for (var j = 0; j < arrWords.length; j++) {\n\n // if (arrText[i] == arrWords[j]){\n // console.log('stampo arrText nella funzione e nell-if',arrText[i]);\n // arrText[i] = 'xxx';\n // console.log(arrWords[j]);\n // console.log('stampo arrText nella funzione e nell-if',arrText[i]);\n // }\n // else {\n // console.log('sono nell-else e vado anvanti nel ciclo');\n // console.log(arrText[i]);\n // }\n if (arrWords.includes(arrText[i])){\n\n arrText[i]= 'xxx';\n console.log(arrText[i]);\n }\n\n\n // console.log(arrWords[j]);\n\n\n\n // }\n\n // console.log('stampo arrText nella funzione ',arrText[i]);\n\n // newtxt.push(arrText[i]);\n // console.log(newtxt);\n }\n console.log(arrWords);\n return arrText.join(' ');\n\n}", "function DoWords() \n{\n\tvar nWord = 0;\n\tvar nDiff = 0;\n\tvar olex = \"\";\n\n\t// Parse the input lexicon\n\tlex = rewrite(theform.ilex);\n\tnlex = lex.length;\n\n\tvar oldolex;\n\tvar localshowdiff = showDiff;\n\tif (showDiff) {\n\t\tvar sx = document.getElementById(\"olex\").value; //innerHTML;\n\t\tif (sx == \"\") \n\t\t\tlocalshowdiff = false;\n\t\telse {\n\t\t\t//sx = unrewrite(sx, true);\n\t\t\t//sx = sx.replace(new RegExp(\"<(b|/b)>\", \"gi\"), \"\");\n\t\t\toldolex = sx.split(\"\\n\");\n\t\t}\n\t}\n\n\tfor (w = 0; w < nlex; w++) {\n\t\tvar inword= lex[w];\n\n\t\tif (inword.length > 0) {\n\t\t\tif (inword.charCodeAt(inword.length - 1) == 13) {\n\t\t\t\tinword = inword.substr(0, inword.length - 1);\n\t\t\t}\n\t\t\t\n\t\t\tvar outword = Transform(inword);\n\t\t\tvar outs;\n\n\t\t\tvar parts = inword.split(\" \\u2023\");\n\t\t\tif (parts.length > 1) \n\t\t\t\tinword = parts[0];\n\n\t\t\tswitch (outtype) {\n\t\t\tcase 0: \n\t\t\t\touts = outword;\n\t\t\t\tbreak;\n\t\t\tcase 1: \n\t\t\t\touts = inword + \" &#x2192; \" + outword;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\touts = outword + \" [\" + inword + \"]\";\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (localshowdiff && w < oldolex.length \n\t\t\t\t&& outs != oldolex[w]) {\n\t\t\t\touts = outs.bold();\n\t\t\t}\n\n\t\t\touts += \"\\n\";\n\t\t\tolex += outs;\n\n\t\t\tnWord++;\n\t\t\tif (inword != outword) nDiff++;\n\t\t}\n\t}\n\t\n s += '<ul>'\n\ts += \"<li>Categories found: \" + catindex \n\t\t+ \"</li><li>Valid rules found: \" + nrul \n\t\t+ \"</li><li>Words processed: \" + nWord \n\t\t+ \"</li><li>Words changed by rules: \" + nDiff;\n\n\tdocument.getElementById(\"olex\").value = olex; //unrewrite(olex, false);\n}", "function squareCode(originalPhrase){\n if(originalPhrase.length > 81){\n return console.log(\"Your string is longer than 81 characters. Please input a shorter phrase.\");\n }\n var inputStringAsArray = originalPhrase.split(\"\");\n// take the originalPhrase and find the square root or closest thing to it and that will be your first string length\n var newLineLength = Math.floor(Math.sqrt(originalPhrase.length));\n // arrange the total input into lines of a certain size (use /n) to create new lines\n\n var ourNewArray = [];\n var newElement = \"\";\n // here we are running through the array sequentially\n inputStringAsArray.forEach(function(item, index){\n if((index + 1) % newLineLength === 0){\n newElement += item;\n ourNewArray.push(newElement);\n newElement = \"\";\n } else if ((index + 1) === originalPhrase.length){\n newElement += item;\n ourNewArray.push(newElement);\n } else {\n newElement += item;\n }\n })\n\n var secondNewArray = [];\n var secondNewElement = \"\";\n\n// this loops through ourNewArray first pushing each character of the item[0] to a new element within secondNewArray\n// then the second if statment loops through the following characters of each elements sending them to the correct element in the new array\n ourNewArray.forEach(function(item, index){\n if (index === 0){\n for (var i = 0; i < item.length; i++) {\n secondNewArray.push(item[i]);\n }\n }\n if (index > 0){\n for (var j = 0; j < item.length; j++) {\n secondNewArray[j] += item[j];\n }\n }\n })\n\n var codeIntoString = secondNewArray.toString();\n var finalCode = codeIntoString.replace(/,/g,\" \");\n return console.log(finalCode);\n}", "function LetterCountI(str) {\n\n var words = str.split(\" \");\n var largestDif = 0;\n var answer;\n\n for (var i = 0; i < words.length; i++) {\n var currentWord = words[i];\n var currentWordLength = words[i].length;\n var currentWordSorted = words[i].split(\"\").sort();\n for (var j = 0; j < (words[i].length - 1); j++) {\n if (currentWordSorted[j] === currentWordSorted[j + 1]) {\n currentWordSorted.splice(j, 1);\n }\n var currentDif = (currentWordLength - currentWordSorted.length);\n if (currentDif > largestDif) {\n largestDif = currentDif;\n answer = currentWord;\n }\n }\n }\n\n if (largestDif > 0) {\n return answer;\n } else {\n return -1;\n }\n\n}", "function sol23(s, dict = [\"I\", \"am\", \"a\", \"ace\"]) {\n const dp = [];\n for (let i = 0; i < s.length; i++) {\n const row = [];\n for (let j = 0; j < s.length; j++) {\n row.push(false);\n }\n dp.push(row);\n }\n for (let l = 1; l <= s.length; l++) {\n for (let i = 0; i < s.length - l + 1; i++) {\n const j = i + l - 1;\n const curWord = s.substring(i, j + 1);\n if (dict.indexOf(curWord) >= 0) {\n // current word is in the dict, set to true\n dp[i][j] = true;\n } else {\n // try slicing the current word at different indices\n for (let k = i + 1; k <= j; k++) {\n if (dp[i][k - 1] && dp[k][j]) {\n dp[i][j] = true;\n break;\n }\n }\n }\n }\n }\n return dp[0][s.length - 1];\n}", "function main() {\n var n = parseInt(readLine());\n var a = [];\n for (a_i = 0; a_i < n; a_i++) {\n a[a_i] = readLine().split(' ');\n a[a_i] = a[a_i].map(Number);\n }\n\n\n\n let holder = 0;\n let holder2 = n - 1;\n let sum1 = 0;\n let sum2 = 0;\n\n a.forEach(element => {\n // console.log(element[holder])\n sum1 += element[holder];\n holder++;\n\n });\n\n //console.log(` sum1: ${sum1}`);\n\n\n\n a.forEach(elementz => {\n // console.log(elementz[holder2])\n sum2 += elementz[holder2];\n holder2--;\n\n });\n\n // console.log(` sum2: ${sum2}`);\n\n if ((sum1 - sum2) < 0) {\n console.log(((sum1 - sum2) * -1));\n }\n else {\n console.log((sum1 - sum2));\n }\n\n\n\n}", "function solve2(arr) {\n let arr2 = arr.map(ele => ele.toLowerCase());\n let alphabet = 'abcdefghijklmnopqrstuvwxyz';\n let returnArry = [];\n for (let idx = 0; idx < arr2.length; idx++) {\n let count = 0;\n for (let idx2 = 0; idx2 < arr2[idx].length; idx2++) {\n if (idx2 === alphabet.indexOf(arr2[idx][idx2])) {\n count++; \n }\n }\n returnArry.push(count);\n }\n return returnArry;\n}", "function findPalindromes() {\n var testText = 'Each exe opens a different game,with a different level of WOW or LOL difficulty .',\n testerForCommas = 0,\n arrTest,\n loopZter = 0,\n loopZter2 = 0,\n arrayOfPolies = [],\n forwardWord = [],\n backwardWord = [],\n checkerLoop = 0,\n isTheSame = true; \n\n while (testerForCommas != -1) {\n testerForCommas = testText.indexOf(',');\n\n if (testerForCommas == (-1)) {\n break;\n }\n else {\n testText = testText.replace(',', ' ');\n }\n }\n arrTest = testText.split(' '); \n var thisTextLen = arrTest.length;\n for (loopZter = 0; loopZter < thisTextLen; loopZter += 1) {\n for (loopZter2 = 0; loopZter2 < arrTest[loopZter].length; loopZter2 += 1) {\n forwardWord.push(arrTest[loopZter][loopZter2]);\n backwardWord.unshift(arrTest[loopZter][loopZter2]);\n }\n for (checkerLoop = 0; checkerLoop < forwardWord.length; checkerLoop += 1) {\n if (forwardWord[checkerLoop] != backwardWord[checkerLoop]) {\n isTheSame = false;\n break;\n }\n }\n if (isTheSame && forwardWord.length > 1) { //making sure not to take in account the 1 letter words/symbols\n arrayOfPolies.push(arrTest[loopZter]);\n }\n else {\n isTheSame = true;\n }\n forwardWord.length = 0;\n backwardWord.length = 0;\n }\n console.log(arrayOfPolies);\n}", "function oldScrabbleScorer(word) {\n\tword = word.toUpperCase();\n\tlet letterPoints = \"\";\n\tlet totalPoints = 0;\n \n\tfor (let i = 0; i < word.length; i++) {\n \n\t for (const pointValue in oldPointStructure) {\n \n\t\t if (oldPointStructure[pointValue].includes(word[i])) {\n\t\t\ttotalPoints += Number(pointValue);\n\t\t\tletterPoints += `Points for '${word[i]}': ${pointValue}\\n`\n\t\t }\n \n\t }\n\t}\n\tletterPoints += `Total points for word: ${totalPoints}.\\n`;\n\treturn totalPoints;\t\t// Used to be \"return letterPoints\"\n }", "function findPalidrom(input) {\n var words = true;\n var spacesOut = function (sentence) {\n var letters = \"\";\n for (var i = 0; i < sentence.length; i++) {\n if (sentence[i] === \" \") {\n continue;\n }\n else {\n letters += sentence[i];\n }\n } return letters;\n }\n var finalArray = spacesOut(input);\n for (var i = 0, j = finalArray.length - 1; i < finalArray.length / 2; i++ , j--) {\n if (finalArray[i] === finalArray[j]) {\n continue;\n }\n else {\n return !words;\n }\n } return words;\n}", "function calculateIndex(){\n orig_parahs = Object.assign([], parahs);\n for(let i=0; i<parahs.length; i++){\n //remove special characters and convert to lower case\n var tempString = parahs[i].replace(/[123]|[`~!@#$%^&*()_|+\\-=?;:'\",.<>\\{\\}\\[\\]\\\\\\/]/gi, '');\n parahs[i] = tempString.toLowerCase();\n }\n\n //for each paragraph, update word_count with the frequency of words\n for(let [count, doc] of parahs.entries()){\n word_count = {};\n wordlist = doc.split(' ');\n wordCount();\n //use word_count for the paragraph to add/update frequency and occurrence of index[word]\n for(let [c,word] of wordlist.entries()){\n if(get(index, word, \"false\")===\"false\"){\n var freq = word_count[word];\n var idp = Object.keys(document_id)[count];\n //index is of the form {word:{freq:doc_id}}\n index[word] = {};\n index[word][freq] = idp;\n }\n else{\n var freq = word_count[word];\n var idp = Object.keys(document_id)[count];\n index[word][freq] = idp;\n }\n }\n }\n}", "function LongestWord(sen) {\n var strings = sen.split(\" \");\n console.log(\"strings is: \", strings);\n\n var answerArray = [];\n stringsLength = [];\n var answer = null;\n var answreIndex = null;\n\n for (var index = 0; index < strings.length; index++) {\n var testObj = {\n word: strings[index],\n length: strings[index].length\n }\n answerArray.push(testObj);\n stringsLength.push(strings[index].length);\n\n if (index === strings.length - 1) {\n answer = Math.max.apply(Math, stringsLength);\n for (var testIndex = 0; testIndex < strings.length; testIndex++) {\n if (answer == stringsLength[index]) {\n console.log(\"the final answer is: \", answerArray[index][\"word\"]);\n }\n }\n }\n }\n\n console.log(\"stringsLength; is: \", stringsLength);\n console.log(\"answerArray; is: \", answerArray);\n console.log(\"answer is: \", answer);\n console.log(\"answerArray[2]'name']\", answerArray[2]['name'])\n}", "function contarVocales(texto){\n let numeroVocales = 0;\n let vocales = ['a', 'e', 'i', 'o', 'u'];\n for (let i =0 ; i < texto.length; i++) {\n var letra = texto[i];\n if (vocales.includes(letra)) {\n numeroVocales++;\n }\n // if (vocales.indexOf(letra) >= 0) {\n // numeroVocales++;\n // }\n // if (letra == 'a' || letra == 'e' || letra == 'i' ||letra == 'o' ||letra == 'u') {\n // numeroVocales++\n // }\n }\n return numeroVocales;\n}", "function checkwords(){\n\n var comment_raw = $(this).val();\n var comment_stripped = comment_raw.replace(/[^\\w\\s]|_/g, \"\").replace(/\\n/g, \" \").replace(/\\s+/g, \" \");\n var words = [];\n words = comment_stripped.split(' ');\n //reset incorrect_words\n incorrect_words = [];\n\n $.each(words, function(index, item){\n var is_in_vocab = false;\n for (var i = 0; i < vocab.responseJSON.word.length; ++i){\n var thisWord = vocab.responseJSON.word[i].name;\n if(thisWord.toUpperCase()===this.toUpperCase()){\n is_in_vocab = true;\n break;\n }\n //when we are checking the last word in the vocab, if it doesn't match the word typed\n else if(i == (vocab.responseJSON.word.length - 1) && thisWord.toUpperCase()!=this.toUpperCase() && this.length > 0){\n incorrect_words.push(this);\n }\n }\n // show whether each number word in the comment is in the vocab\n //console.log(index+' = '+is_in_vocab);\n //console.log(incorrect_words);\n })\n }", "function solution(S) {\n // we need regex\n // First, we seperate everything by sentences, this includes delimiters (needs to be removed)\n var sentArr = S.match(/[^\\.!\\?]+[\\.!\\?]+/g);\n // Next we clean up each sentence. Remove trailing spaces. Convert multiple sequential spaces to one\n sentArr = sentArr.map(item => {\n return item.trim().replace(/ +/g, \" \");\n });\n // Next we clean up any edge cases \"Save time .\" should be \"Save time.\"\n\n console.log(sentArr);\n // Next, we count number of spaces. If there's 2 spaces, that means there's 3 words\n var result = 0;\n for (let i = 0; i < sentArr.length; i++) {\n let numWordsInSentence = sentArr[i].split(\" \").length;\n if (result < numWordsInSentence) {\n result = numWordsInSentence;\n }\n }\n return result;\n}", "function censor(text, word) {\n let arr = text.split(\" \");\n // console.log(arr); <-- logs out the split elements of the text [\"this\", \"is\", \"an\", \"algorithm\"]\n for (let i = 0; i < arr.length; i++) {\n if (word == arr[i]) {\n // console.log(arr[i]); <-- logs out the word if it exists in the elements of the array (\"algorithm\")\n let asterisks = Array(arr[i].length + 1).join(\"*\");\n // console.log(asterisks); <-- a new variable that makes asterisks for the length of the word (*********)\n let index = arr.indexOf(arr[i]);\n // console.log(index); <-- log out the index of the array where the word exists (3)\n if (index !== -1) {\n arr[index] = asterisks; //<-- replace the index of the array where the word exists with the asterisk version\n }\n console.log(arr.join(\" \")); //<-- pull the elements out of the array (now with the asterisks)\n }\n }\n}", "function words(data) {\n wordsss = \"\";\n wordsss = wordss.join('');\n var wScore = 0;\n var userAnswer;\n let tempMap = new Map();\n correctWord = [];\n currentScore = 0;\n\n if (!m.has(113) && permanentBoardMap.size == 0) {\n // alert(\"Please include the star for forming the first word of the game :)\");\n alert(alert_9);\n clearBoardRect();\n return;\n }\n // check the word is formed includes atleast one existing letter on board\n else if (permanentBoardMap.size != 0) {\n var oneRectInclude = 0;\n for (i = 0; i < usedRectArray.length; i++) {\n if (permanentBoardMap.has(usedRectArray[i])) {\n oneRectInclude += 1;\n }\n }\n if (oneRectInclude === 0) {\n // alert(\"Please include atleast one filled rectangle on the board to form the word :)\");\n alert(alert_10);\n clearBoardRect();\n return;\n }\n }\n\n if (wordsAroundNewLetter.length !== 0) {\n for (var i = 0; i < wordsAroundNewLetter.length; i++) {\n if (data.includes(wordsAroundNewLetter[i])) {\n wScore = wordScore(wordsAroundNewLetter[i]);\n if (wScore !== undefined) {\n tempMap.set(wordsAroundNewLetter[i], wScore);\n }\n // word formed using atleast two board rectangles\n }\n else {\n userAnswer = saveWords(wordsAroundNewLetter[i]);\n if (userAnswer !== false) {\n tempMap.set(wordsAroundNewLetter[i], userAnswer);\n }\n }\n }\n if (tempMap.size !== 0) {\n for (let [key, value] of tempMap.entries()) {\n if (value === Math.max(...tempMap.values())) {\n correctWord.push(key);\n currentScore += value;\n }\n }\n tempMap.clear();\n \n var currentPlayerScore = activePlayerScore[activePlayr];\n currentPlayerScore[1] += currentScore;\n document.getElementById(currentPlayerScore[0]).innerHTML = currentPlayerScore[1];\n filledBoardRect.length = 0;\n wordsAroundNewLetter.length = 0;\n usedRectArray.length = 0;\n updateActivePlayer(activePlayr);\n // add board rectangles to permanent map if word is correct\n for (let [key, value] of m) {\n if (!permanentBoardMap.has(key)) {\n permanentBoardMap.set(key, value);\n }\n }\n m.clear();\n // return alert(\"Correct : \" + correctWord + \"\\nPoints : \" + currentScore);\n return alert(alert_11_1 +' '+correctWord + '\\n' + alert_11_2 +' '+currentScore);\n }\n else {\n wordsAroundNewLetter.length = 0;\n clearBoardRect();\n // return alert(\"Wrong!\");\n return alert(alert_12);\n }\n }\n else if (wordsAroundNewLetter.length === 0 && playersRack[activePlayr].length !== 0) {\n // alert(\"Please form a new word first!\");\n alert(alert_13);\n }\n else if (wordsAroundNewLetter.length === 0 && playersRack[activePlayr].length === 0) {\n // alert(\"Please form word by using letters of the rack!\");\n alert(alert_14);\n }\n}", "function cuenta(){\n var _frase = prompt('Introduce frase');\n var _letras = _frase.split('');\n var _tamano = 0;\n var _cantidadDeCadaLetra = '';\n\n while(_letras.length != 0){\n \n var _cantidad = 0;\n var _letra = _letras[0];\n for (var i = 0; i < _letras.length; i++) {\n \n if(_letras[i]==_letra){\n \n if (_letra == \" \"){\n _letras.splice(i,1);\n --i;}\n else{\n ++_tamano;\n ++_cantidad;\n _letras.splice(i,1);\n --i;\n } \n } \n }\n if (_letra != \" \") {\n \n if(_cantidad > 1){\n _cantidadDeCadaLetra += 'La letra \"'+_letra+'\" se repite '+_cantidad+' veces.\\n';\n }\n else{\n _cantidadDeCadaLetra += 'La letra \"'+_letra+'\" se repite una vez.\\n';\n }\n }\n }\n //Se imprime\n console.log(_tamano);\n console.log(_cantidadDeCadaLetra);\n alert('La frase \"'+_frase+'\" contiene '+_tamano+' caracteres. \\nSus caracteres se repiten:\\n'+_cantidadDeCadaLetra);\n}", "function checker(word) {\n \n var prohibited = ['asshole', 'bitch', 'cunt', 'cock', 'dick', 'fag', 'fuck', 'f*ck', 'wtf', 'motherfucker', 'pussy', 'moron', 'shit', 'stfu', 'shutup', 'shut up', 'whore'];\n \n var replacewitharray = ['🌺','👿','🐱','🍌','🍌','🌈','💖','💖','💖','👿','🐱','👿','💩','🙊','🙊','🙊','👿'];\n\t\t\t\t/*\n var regex = new RegExp(prohibited.map(function(s) {\n //return s.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&')\n return s.replace(/[-/\\\\^$*+?.()|[\\]{}]/gi, '\\\\$&')\n }).join('|'));\n */\n // var index = 0;\n // searching every prohibited word inside tested word\n var tester = prohibited.map(function(s) {\n console.log(word.toLowerCase().search(s));\n \n var testresult = word.toLowerCase().search(s);\n return testresult\n }); \n \n \n if (tester.indexOf(0) >= 0){\n \n \n console.log(word + \" match a prohibited word ! i:\" + tester.indexOf(0));\n // X mark : ❌\n // love letter : 💌\n // sparkling heart : 💖\n // hibiscus : 🌺\n // blossom : 🌼\n // sunflower : 🌻\n // bouquet : 💐\n // rose : 🌹\n // cherry blossow : 🌸\n \n var replacewith = \"<div class='replacedword'>\" + word + \"</div><div class='replacedby'>\" + replacewitharray[tester.indexOf(0)] + \"</div>\";\n \n \n \n \n cleanwordstr = cleanwordstr + ' ' + replacewith;\n }\n else {\n console.log(word + \" doesnt match any prohibited word\");\n /*\n if (word == \"ass\"){\n var replacewith = '🍑';\n cleanwordstr = cleanwordstr + ' ' + replacewith;\n }\n else {\n cleanwordstr = cleanwordstr + ' ' + word;\n }\n */\n cleanwordstr = cleanwordstr + ' ' + word;\n }\n \n //if (!regex.test(word)){\n \n \n \n return cleanwordstr;\n //return !regex.test(word);\n }", "function makePhrases(potential_words) {\n return new Promise((resolve, reject) => {\n fetch(\"../text/plain-radia-with-characters.txt\")\n .then(response => response.text())\n .then(text => {\n text = text.replace(/<\\/?[^>]+(>|$)/g, \"\");\n \n // find topic\n let topic = null;\n for(let i = 0; i < potential_words.length; i++) {\n if(text.includes(potential_words[i].word)) {\n topic = potential_words[i].word;\n break;\n }\n }\n \n let sentences = text.split(\"\\n\");\n // let sents_about_topic = sentences.filter(sent => sent.includes(topic))\n // let onlyDialogues = sents_about_topic.map(line => {\n // return line.substring(line.indexOf(\":\")+1).trim()\n // });\n // console.log(onlyDialogues);\n // makeChartData(onlyDialogues);\n \n // markov\n // let generator = RiTa.markov(3)\n // onlyDialogues.forEach(dial => generator.addText(dial))\n // let generated = generator.generate(1);\n // console.log(generated)\n \n // kwic\n let opts = {\n ignoreCase: true,\n ignoreStopWords: true\n };\n \n let sents_without_characters = sentences.map(line => {\n return line.substring(line.indexOf(\":\")+1).trim().replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g,\" \")\n });\n RiTa.concordance(sents_without_characters.join(''), opts);\n let kwic_lines = RiTa.kwic(topic, 5);\n // console.log(kwic_lines)\n kwic_lines = kwic_lines.sort(() => Math.random() - Math.random()).slice(0, 5)\n return resolve(kwic_lines);\n \n })\n })\n}", "function alphabetChecker(text) {\n console.log(text);\n //Replace anything that isn't a letter, apostrophe or hyphen with whitespace.\n //Then, replace any hypen or apostrophe with empty string, in order to keep\n //words together. Replace any instances of two or more whitespace, with a\n //singular white space. Finally, trim the text of surroung whitespace\n\n// Constants for regex\nconst removeUrl = /http.*\\s/g;\nconst removeNonLettersAndSuch = /[^a-zA-Z'-]/g;\nconst removeHyphensAndApostrophes = /[-']/g;\nconst removeExtraWhitespace = /\\s{2,}/g\n\n text = text.replace(removeUrl, ' ')\n .replace(removeNonLettersAndSuch, ' ')\n .replace(removeHyphensAndApostrophes, '')\n .replace(removeExtraWhitespace, ' ')\n .trim();\n\n //Variable holding the length of the text AKA how many characters there are\n const textLength = text.length;\n //Variable holding an array of the text separated by whitespace\n const words = text.split(' ');\n //Variable holding an array of each character of the text\n const characters = text.split('');\n //Variable holding the length of the words array AKA how many words there are\n const numberOfWords = words.length;\n\n // Creates a spot for each letter of the alphabet and sets\n // their default count to 0\n const alphabet = {\n a: 0,\n b: 0,\n c: 0,\n d: 0,\n e: 0,\n f: 0,\n g: 0,\n h: 0,\n i: 0,\n j: 0,\n k: 0,\n l: 0,\n m: 0,\n n: 0,\n o: 0,\n p: 0,\n q: 0,\n r: 0,\n s: 0,\n t: 0,\n u: 0,\n v: 0,\n w: 0,\n x: 0,\n y: 0,\n z: 0,\n }\n\n //Finds the longest word in the words array\n const longestWord = function(words) {\n let longWord = \"\";\n let wordList = [];\n words.forEach(function(word) {\n if(word.length > longWord.length) {\n longWord = word;\n wordList = [word];\n }\n else if (word.length === longWord.length) {\n wordList.push(word);\n }\n })\n\n return wordList;\n }\n\n //Finds the shortest word in the words array\n const shortestWord = function(words) {\n let shortWord = longestWord()[0];\n let wordList = [];\n words.forEach(function(word) {\n if(word.length < shortWord.length) {\n shortWord = word;\n wordList = [word];\n }\n else if (word.length === shortWord.length) {\n wordList.push(word);\n }\n })\n\n return wordList;\n }\n\n const textToAlphabet = function(text, alphabet) {\n\n for(i = 0; i < text.length; i++) {\n if(text[i].match(/[a-zA-Z]/g)) {\n alphabet[text[i].toLowerCase()] += 1;\n }\n }\n }\n\n textToAlphabet(text, alphabet);\n\n //Checks the most used letter from the body of text\n const mostLetters = function(alphabet) {\n let timesLetterUsed = 0;\n let letterList = [];\n\n const isEqualToTimesLetterUsed = (property) => {\n return property === timesLetterUsed\n }\n\n for(let property in alphabet) {\n if(alphabet[property] > timesLetterUsed) {\n letterList = [property.toString()];\n timesLetterUsed = alphabet[property];\n }\n else if (isEqualToTimesLetterUsed(alphabet[property]) && timesLetterUsed > 0) {\n letterList.push(property.toString());\n }\n }\n return letterList;\n }\n\n //Checks the least used letter from the body of text\n //Doesn't include letters that were not used at all\n const leastLetters = function(alphabet) {\n let timesLetterUsed = alphabet[mostLetters(alphabet)[0]];\n let letterList = [];\n for(let property in alphabet) {\n if(alphabet[property] < timesLetterUsed && alphabet[property] !== 0) {\n letterList = [property.toString()]; // no to string\n timesLetterUsed = alphabet[property];\n }\n else if (alphabet[property] === timesLetterUsed) {\n letterList.push(property.toString());\n }\n }\n\n return letterList;\n }\n\n //Checks to see if every letter of the alphabet has been used\n const alphabetCheck = function(alphabet) {\n let count = 0;\n\n for(let property in alphabet) {\n if(alphabet[property] > 0) {\n count++;\n }\n }\n\n return count;\n }\n\n // Sorts through alphabet to see which letters have not been\n // used at all\n const unusedLetters = function(alphabet) {\n let letterList = [];\n for(let property in alphabet) {\n if(alphabet[property] === 0) {\n letterList.push(property.toString());\n }\n }\n return letterList;\n }\n\n // Reads the statistics file, splits by commas, turns it into\n // an object and returns it\n getStats = function() {\n let currentStats = fs.readFileSync('./statistics.txt', 'UTF8');\n console.log(currentStats);\n const statsArray = currentStats.split(',');\n let statsObj = {};\n\n for(let i = 0; i < statsArray.length - 1; i += 2) {\n statsObj[statsArray[i]] = parseInt(statsArray[i+1]);\n }\n\n return statsObj;\n }\n\n // Compares the stats object to the alphabet object, then\n // adds the two together and writes the new data to the\n // statistics file\n updateStats = function(stats, alphabet) {\n for(let property in stats) {\n stats[property] += alphabet[property];\n }\n\n let alphaStats = '';\n\n for(let property in stats) {\n alphaStats += property + ',' + stats[property] + ',';\n }\n\n console.log(alphaStats);\n\n fs.writeFileSync('./statistics.txt', alphaStats, 'UTF8');\n }\n\n let alphaResult = '';\n alphaResult += 'All non-alphabetic characters have been removed from your comment and the following statistics have been revealed:\\n\\n';\n alphaResult += 'The text is **' + textLength + '** characters in length\\n\\n';\n alphaResult += 'The text contains **' + numberOfWords + '** words\\n\\n';\n //console.log(shortestWord());\n if(longestWord(words).length === 1) {\n alphaResult += 'The longest word is **' + longestWord(words) + '** at ' + longestWord(words)[0].length + ' characters in length\\n\\n';\n }\n else if(longestWord(words).length > 1) {\n alphaResult += 'The longest words are **' + longestWord(words) + '** at ' + longestWord(words)[0].length + ' characters in length\\n\\n';\n }\n alphaResult += 'The most used letters are: **' + mostLetters(alphabet) + '**\\n\\n';\n alphaResult += 'The least used letters are: **' + leastLetters(alphabet) + '**\\n\\n';\n if(alphabetCheck(alphabet) === 26) {\n alphaResult += 'The text contains **every** letter of the alphabet!';\n }\n else {\n alphaResult += 'The text contains **' + alphabetCheck(alphabet) + '/26** letters of the alphabet\\n\\n';\n alphaResult += 'The following letters weren\\'t used: **' + unusedLetters(alphabet) + '**\\n\\n&nbsp;\\n\\n';\n }\n\n stats = getStats();\n updateStats(stats, alphabet);\n console.log(alphaResult);\n return alphaResult;\n}", "function wordCheck(){\n var anwser=\"\";\n \n \n anwser= document.getElementById(\"Respuesta\").value;\n anwser =anwser.toLowerCase()//asi evitamos que de fallo si el jugador introcude la respuesta con mayuscualas etc\n\n\n \n\n if(anwser === anwsers[questionsNav]){\n questionsDone= questions.splice(questionsNav,1)//con esto se elimina del array los datos ya que se ha acertado la respuea y no debe aparecer mas igual que si se falla\n anwsersDone = anwsers.splice(questionsNav,1)\n correct++\n totalQuestions--\n document.getElementById(\"showValue\").innerHTML=\"CORRECTO !\";\n document.getElementById(\"aciertos\").innerHTML=correct;\n document.getElementById(\"fallos\").innerHTML=failed;\n document.getElementById(\"Respuesta\").value=\"\";\n document.getElementById(letters[questionsNav]).style.background=\"green\"\n document.getElementById(letters[questionsNav]).style.color=\"white\"\n lettersDone=letters.splice(questionsNav,1) //eliminamos tambien las letras que ya no se usaran ,asi no se pasara por ellas\n questionShow();\n \n\n }\n else{\n questionsDone= questions.splice(questionsNav,1)\n anwsersDone = anwsers.splice(questionsNav,1)\n failed++\n totalQuestions--\n document.getElementById(\"showValue\").innerHTML=\"INCORRECTO !\";\n document.getElementById(\"aciertos\").innerHTML=correct;\n document.getElementById(\"fallos\").innerHTML=failed;\n document.getElementById(\"Respuesta\").value=\"\";\n document.getElementById(letters[questionsNav]).style.background=\"red\"\n document.getElementById(letters[questionsNav]).style.color=\"white\"\n lettersDone=letters.splice(questionsNav,1)\n questionShow(); \n \n\n }\n\n \n}", "function processData(input) {\n inputArr = input.split('\\n');\n let result = '';\n for(let j = 1; j < inputArr.length; j++){\n let word = inputArr[j];\n let str = '';\n let str2 = '';\n for (let i = 0; i < word.length; i++) {\n if(i % 2 === 0) str += word[i];\n if(i % 2 === 1) str2 += word[i];\n }\n result += str + ' ' + str2 + '\\n';\n };\n console.log(result);\n}", "function s2(beginWord, endWord, wordList) {\n /* \n make forms hashmap\n '*ot': [ 'hot', 'dot', 'lot' ],\n 'h*t': [ 'hot' ],\n 'ho*': [ 'hot' ],\n 'd*t': [ 'dot' ],\n 'do*': [ 'dot', 'dog' ],\n '*og': [ 'dog', 'log', 'cog' ],\n 'd*g': [ 'dog' ],\n 'l*t': [ 'lot' ],\n 'lo*': [ 'lot', 'log' ],\n 'l*g': [ 'log' ],\n 'c*g': [ 'cog' ],\n 'co*': [ 'cog' ]\n */\n\n // time, o(nm2), o(length of wordlist * length of word * length of word)\n // word of m length, will appear in m forms (3 letter word will appear 3 times in the graph)\n // will be at most nm entries in graph\n // BETTER THAN ABOVE if length of wordlist is greater than the length of the word (ASSUMING ALL SAME LENGTH)\n\n // space, o(nm2)\n const graph = makeGraph();\n console.log(graph);\n\n function makeGraph() {\n const out = {};\n for (let i = 0; i < beginWord.length; i++) {\n const form = `${beginWord.substring(0, i)}*${beginWord.substring(i + 1)}`;\n out[form] ? out[form].push(beginWord) : (out[form] = [beginWord]);\n }\n for (let word of wordList) {\n for (let i = 0; i < word.length; i++) {\n const form = `${word.substring(0, i)}*${word.substring(i + 1)}`;\n out[form] ? out[form].push(word) : (out[form] = [word]);\n }\n }\n return out;\n }\n\n const set = new Set();\n set.add(beginWord);\n const q = [[beginWord, 0]];\n while (q.length) {\n console.log(q);\n const [word, level] = q.shift();\n if (word === endWord) return level;\n for (let i = 0; i < word.length; i++) {\n const form = `${word.substring(0, i)}*${word.substring(i + 1)}`;\n for (let nextWord of graph[form]) {\n if (!set.has(nextWord)) {\n set.add(nextWord);\n q.push([nextWord, level + 1]);\n }\n }\n }\n }\n}", "function num_lost_words(pre_set_word_array_array, min_length){\n let lost_options = 0;\n for(let pre_set_word_array of pre_set_word_array_array){\n let lost_len = min_length - pre_set_word_array.length;\n lost_options += Math.pow(letters.length,lost_len);\n }\n return lost_options;\n }", "function computeGrade(essay) {\n essay = essay.trim();\n let nnn = ['very', 'thing', 'always', 'never', 'like', 'lot', 'good', 'bad', 'stuff', 'nice', 'really', 'many', 'i', 'you'];\n let score = 100;\n //Checks length\n if (essay.length < 100)\n score -= 50;\n if (essay.length > 250)\n score -= (essay.length - 250) * 5;\n essayArray = essay.split(' ');\n // NNN & Checks if is a word\n for (let i = 0; i < essayArray.length; i++) {\n let element = essayArray[i];\n element = element.toLowerCase();\n if (element.includes(\",\") || element.includes(\".\"))\n element = element.substring(0, element.length - 1);\n if (words[element] != 1 || nnn.includes(element))\n score--;\n if (element.includes(\"'\"))\n score -= 2;\n };\n //N2SSWTSW\n let wordset = new Set();\n const sentences = essay.split('.');\n for(let i = 0;i<sentences.length;i++) \n {\n let element = sentences[i].trim().split(' ')[0];\n if(wordset.has(element))\n score-=3;\n console.log(sentences.length);\n console.log(element);\n wordset.add(element);\n }\n console.log(score);\n return score > -100 ? score : -100;\n}", "function sol(words, maxWidth) {\n const res = [];\n let n = words.length;\n let index = 0;\n\n while (index < n) {\n let totalChars = words[index].length;\n let last = index + 1;\n let str = \"\";\n\n while (last < n) {\n if (totalChars + 1 + words[last].length > maxWidth) break;\n totalChars += 1 + words[last].length;\n last++;\n }\n\n const gaps = last - index + 1;\n console.log(gaps);\n\n if (last === n || gaps === 0) {\n for (let i = index; i < last; i++) {\n str += words[i];\n str += \" \";\n }\n // remove last space\n str = str.substring(0, str.length - 1);\n\n // on last line, so pad with extra spaces\n while (str.length < maxWidth) {\n str += \" \";\n }\n } else {\n const spaces = Math.floor((maxWidth - totalChars) / gaps);\n const rest = (maxWidth - totalChars) % gaps;\n\n for (let i = index; i < last - 1; i++) {\n str += words[i];\n str += \" \";\n\n for (let j = 0; j < spaces + (i - index < rest ? 1 : 0); j++) {\n str += \" \";\n }\n }\n\n str += words[last - 1];\n }\n\n res.push(str);\n index = last;\n }\n\n return res;\n}", "function cleanup(word_f) {\n if (word_f === undefined) return \"\";\n let f_word;\n let word = word_f;\n word = word.toLowerCase();\n let wordar = word.split(\"\");\n let wordf = [];\n for (let i = 0; i < word.split(\"\").length; i++) {\n switch (wordar[i]) {\n case \"a\": wordf.push(\"a\"); break;\n case \"b\": wordf.push(\"b\"); break;\n case \"c\": wordf.push(\"c\"); break;\n case \"d\": wordf.push(\"d\"); break;\n case \"e\": wordf.push(\"e\"); break;\n case \"f\": wordf.push(\"f\"); break;\n case \"g\": wordf.push(\"g\"); break;\n case \"h\": wordf.push(\"h\"); break;\n case \"i\": wordf.push(\"i\"); break;\n case \"j\": wordf.push(\"j\"); break;\n case \"k\": wordf.push(\"k\"); break;\n case \"l\": wordf.push(\"l\"); break;\n case \"m\": wordf.push(\"m\"); break;\n case \"n\": wordf.push(\"n\"); break;\n case \"o\": wordf.push(\"o\"); break;\n case \"p\": wordf.push(\"p\"); break;\n case \"q\": wordf.push(\"q\"); break;\n case \"r\": wordf.push(\"r\"); break;\n case \"s\": wordf.push(\"s\"); break;\n case \"t\": wordf.push(\"t\"); break;\n case \"u\": wordf.push(\"u\"); break;\n case \"v\": wordf.push(\"v\"); break;\n case \"w\": wordf.push(\"w\"); break;\n case \"x\": wordf.push(\"x\"); break;\n case \"y\": wordf.push(\"y\"); break;\n case \"z\": wordf.push(\"z\"); break;\n }\n f_word = wordf.join(\"\");\n }\n return f_word;\n}", "function oldScrabbleScorer(word) {\n\tword = word.toUpperCase();\n\tlet letterPoints = \"\";\n \n\tfor (let i = 0; i < word.length; i++) {\n \n\t for (const pointValue in oldPointStructure) {\n \n\t\t if (oldPointStructure[pointValue].includes(word[i])) {\n\t\t\t letterPoints += `Points for '${word[i]}': ${pointValue}\\n`\n\t\t }\n \n\t }\n\t}\n // console.log({letterPoints}); //for testing\n\treturn letterPoints;\n \n}", "function processData(input) {\n const individualWords = input.split('\\n');\n const scrambledWords = {};\n\n for (let i = 1; i < individualWords.length; i++) {\n if (!scrambledWords[individualWords[i]]) {\n scrambledWords[i] = { \n word: individualWords[i], \n even: [], \n odd: [] \n };\n }\n }\n\n for (const word of Object.values(scrambledWords)) {\n\n for (let k = 0; k < word.word.length; k++) {\n if (k % 2 === 0) word.even.push(word.word[k]);\n if (k % 2 !== 0) word.odd.push(word.word[k]);\n }\n\n console.log(`${word.even.join('')} ${word.odd.join('')}`);\n }\n}", "function solve(a,b){\r\n var dict = {}\r\n for (i = 0; i < a.length; i++) {\r\n var word = a[i]\r\n if (word in dict) {\r\n dict[word] = dict[word] + 1\r\n } else {\r\n dict[word] = 1\r\n }\r\n }\r\n var result = [];\r\n for (j = 0; j < b.length; j++) {\r\n var key = b[j]\r\n if (key in dict) {\r\n result.push(dict[key])\r\n } else {\r\n result.push(0)\r\n }\r\n }\r\n return result\r\n }", "function encrypt_message (secretMessage){\n\tvar arrayOfWords = convertStringOfWordsToArrayOfStrings(secretMessage);\n\tvar text = \"\";\n\tfor (i=0 ; i < arrayOfWords.length; i++) {\n\n\t\t\t//General (inverse of Colonel level): encrypts numbers using encryptDictionaryThree. Frist check if string contains a number, then encode.\n\t\t\tif (isNumber(arrayOfWords[i])) {\n\t\t\t\tvar stringOfNumberWhichWillBeLettersSoon = arrayOfWords[i]\n\t\t\t\ttext = text + \" _\" ;\n\t\t\t\tfor(a= 0; a < stringOfNumberWhichWillBeLettersSoon.length ; a++) {\n\t\t\t\tvar encryptedNumber = encryptDictionaryThree[stringOfNumberWhichWillBeLettersSoon[a]]\n\t\t\t\ttext = text + encryptedNumber;}\n\t\t\t\ttext = text + \"_\"\n\t\t\t}\n\n\t\t\t// General(inverse of Sergeant level, part 1/2): encrypts proper nouns (names and places found in dictionary) using encryptDictionary.\n\t\t\telse if (arrayOfWords[i][0]== arrayOfWords[i][0].toUpperCase()) {\n\t\t\t\tvar properWord = arrayOfWords[i] + \" \" + arrayOfWords[i+1]\n\t\t\t\tvar encryptedProperWord = encryptDictionary[properWord]\n\t\t\t\ttext = text + \" \" + encryptedProperWord;\n\t\t\t\ti = i + 1;\n\t\t\t}\n\n\t\t\t//General (inverse of Sergeant level, part 2/2): encrypt word found in encryptDictionary.\n\t\t\telse if (arrayOfWords[i] in encryptDictionary) {\n\t\t\t\tvar encryptedWord = encryptDictionary[arrayOfWords[i]]\n\t\t\t\ttext = text + \" \" + encryptedWord;\n\t\t\t}\n\n\t\t\t// General (inverse of Major part 1/2): for words not found in encryptDictionary. Spells out letter by letter.\n\t\t\telse {\n\t\t\t\tvar stringOfLetters = arrayOfWords[i];\n\t\t\t\ttext = text + \" \" ;\n\t\t\t\tvar shouldSpellWordRun = true;\n\n\t\t\t\t//General (extra challenge): Find if root of word is in encryptDictionary and adds ~. I used two loops: First runs through the supplied \n\t\t\t\t//word and creates subwords through cuttting of one letter a time till only 4 letters are left. Second loop runs through the keys and \n\t\t\t\t//does the same. If comparison of the subwords and subkeys is successful adds ~.\n\n\t\t\t\ttopLoop:\n\t\t\t\tfor (b = stringOfLetters.length; b>4; b--) {\n\t\t\t\t var subWord = stringOfLetters.substring(0,b);\n\n\t\t\t\t\tfor (key in encryptDictionary) {\n\t\t\t\t\t\tfor (c = key.length; c>4; c--) {\n\t\t\t\t var subKey = key.substring(0,c)\n\n\t\t\t\t if (subWord == subKey) {\n\t\t\t\t text = text + \"~\" + encryptDictionary[key] ;\n\t\t\t\t shouldSpellWordRun = false;\n\t\t\t\t break topLoop;\n\t\t\t\t } }\n\t\t\t\t \t\t}\n\t\t\t\t}\t\n\n\t\t\t//General (inverse of Major 2/2):\n\t\t\tif (shouldSpellWordRun == true){\n\t\t\tvar stringOfLetters = arrayOfWords[i].toUpperCase()\n\t\t\tfor (k=0; k< stringOfLetters.length ; k++){\n\t\t\t\tvar encryptedLetter = encryptDictionaryTwo[stringOfLetters[k]]\n\t\t\t\ttext = text + encryptedLetter;\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t}\n\treturn text.toLowerCase().substring(1, text.length ); // to match output I remove starting space;\n}", "function hipsterfy(sentence){\n\n var vowels = ['a', 'e', 'i', 'o', 'u'];\n\n var sentArr = sentence.split(' ');\n//iterate through the array:\n for(var i = 0; i < sentArr.length; i++){\n var word = sentArr[i];\n // console.log(word);\n //iterate through the element itself:\n // for(var j = 0; j < word.length; j++)\n\n //reverse forloop, start from the back of string:\n // j >=0, you want to get to index 0 by iterating\n //from largest index position to lowest.\n for(var j = word.length - 1; j >= 0; j--){\n // console.log(word[j]);\n if(vowels.indexOf(word[j]) !== -1){\n // console.log(word[j]);\n // word.replace(word.substring(j, j+1), \"\");\n sentArr[i] = word.slice(0, j) + word.slice(j+1);\n console.log(word);\n break;\n }\n }\n\n }\n return sentArr.join(' ');\n}" ]
[ "0.6602132", "0.6245358", "0.6244223", "0.61439437", "0.6087164", "0.6068919", "0.59454286", "0.59322137", "0.58747065", "0.5854746", "0.58455867", "0.5835294", "0.5824434", "0.58232313", "0.5819031", "0.5778173", "0.57751125", "0.5756509", "0.5748078", "0.569771", "0.56975555", "0.5685949", "0.56599325", "0.5626626", "0.5618141", "0.5540248", "0.55146664", "0.54958737", "0.5494976", "0.54884106", "0.54858243", "0.5482944", "0.54827785", "0.54800856", "0.54800856", "0.5475018", "0.54733765", "0.5468223", "0.5464939", "0.54488814", "0.5439119", "0.543582", "0.5432141", "0.54219985", "0.5414502", "0.54045933", "0.53863436", "0.5384377", "0.53751695", "0.53670305", "0.53638524", "0.53627276", "0.5359158", "0.5356237", "0.53489065", "0.5345343", "0.5343746", "0.534247", "0.53293765", "0.5294014", "0.52925205", "0.52856785", "0.5282041", "0.52811176", "0.52681094", "0.526489", "0.52644473", "0.52636224", "0.52609", "0.52399147", "0.52382666", "0.5235367", "0.52315915", "0.52272815", "0.52270806", "0.5225055", "0.52222997", "0.52177644", "0.521643", "0.52132547", "0.5206671", "0.52040786", "0.520153", "0.52007073", "0.5198434", "0.5196885", "0.5196293", "0.51931524", "0.5190618", "0.5184629", "0.5184499", "0.51832783", "0.51802754", "0.5180078", "0.5176806", "0.5176777", "0.51758426", "0.51633245", "0.5162452", "0.5150716", "0.5149416" ]
0.0
-1
Check if the column of the last move is completed
function checkCol(board, x, player){ if(board[x][0] == player && board[x][1] == player && board[x][2] == player) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isColumnComplete(player)\r\n {\r\n for(var col=0; col<3; col++)\r\n {\r\n numCells = 0;\r\n for(var row=0; row<3; row++)\r\n {\r\n if(cellValue(row, col) == player)\r\n {\r\n numCells++;\r\n }\r\n }\r\n if(numCells == 3)\r\n {\r\n return (col+1);\r\n }\r\n }\r\n\r\n return 0;\r\n }", "gameIsFinished() {\n return this.rows[0].some(\n cell => cell.filled \n );\n }", "function isLegalMove(col) {\n return stats.moveStart != null && stats.openRows[col] < 6 && stats.winner == null;\n }", "checkCompletedBoard(){\n let totalSquares = board.columnCount * board.rowCount;\n let dustedSquaresCount = 0;\n for(let checkColumn=0; checkColumn<board.columnCount; checkColumn++) {\n for(let checkRow=0; checkRow<board.rowCount; checkRow++) {\n let s = board.squares[checkColumn][checkRow];\n if (board.squares[checkColumn][checkRow].dusted===1) {\n dustedSquaresCount++;\n }\n }\n }\n if (dustedSquaresCount===totalSquares){\n level.boardFinished();\n }\n }", "finishGame(){\n const {totalRows, totalColumns} = this.state;\n var resultsData = this.state.gameData;\n var column = 0;\n var row = totalRows - 1;\n var color = resultsData[row][column];\n var result = 1;\n var cont;\n\n if (color == 0){\n result = 2;\n }\n\n while(column < totalColumns && result == 1){\n cont = this.finishGameColumn(column);\n //if method returns zero user can continue playing\n if(cont == 0){\n result = 0;\n }\n else if(cont == 1){\n //if finishGameColumn returns 1 I have to verify next column to check if entire game finished\n column = column + 1;\n }\n }\n\n this.setState({end : result});\n\n return result;\n }", "is_finished() {\n // if last piece\n let cpt = 0;\n\n for (let x = 0; x < 6; x++) {\n for (let y = 0; y < 6; y++) {\n if (this._board[x][y] !== -1) {\n cpt++;\n }\n }\n }\n if (cpt === 0) {\n return true;\n }\n // if one player have the set of color\n for (let i = 0; i < 6; i++) {\n if (this._player_1_pieces[i] === 6) {\n return true;\n }\n if (this._player_2_pieces[i] === 6) {\n return true;\n }\n }\n return false;\n }", "function lookForCompletedLines()\n\t{\n\t\tvar g = grid, nr = self.numRows, nc = self.numColumns, line;\n\t\tvar completedLines = [];\n\t\tfor(var r = nr; r-->0;)\n\t\t{\n\t\t\tline = true;\n\t\t\tfor(var c = nc; c-->0;)\n\t\t\t{\n\t\t\t\tif(!g[r][c])\n\t\t\t\t{\n\t\t\t\t\tline = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(line)\n\t\t\t\tcompletedLines.push(r);\n\t\t}\n\n\t\tif(completedLines.length > 0)\n\t\t\tprocessCompleteLines(completedLines,g);\n\t\telse\n\t\t\tnewBlock();\n\t}", "hasMoved() {\n return (this.color === Color.WHITE && this.row !== 6)\n || (this.color === Color.BLACK && this.row !== 1);\n }", "function isFinished(board, row, col, c){\n for(var i = 0; i < 9; i++) {\n if (board[row][col] == \"\") return false;\n if(board[i][col] != \"\" && board[i][col] == c && i != row) return false; //check row\n if(board[row][i] != \"\" && board[row][i] == c && i != col) return false; //check column\n if(board[3 * Math.floor(row / 3) + Math.floor(i / 3)][ 3 * Math.floor(col / 3) + Math.floor(i % 3)] != \"\" && \nboard[3 * Math.floor(row / 3) + Math.floor(i / 3)][3 * Math.floor(col / 3) + Math.floor(i % 3)] == c && \n((3 * Math.floor(row / 3) + Math.floor(i / 3)) != row && (3 * Math.floor(col / 3) + Math.floor(i % 3)) != col)) return false; //check 3*3 block\n }\n return true;\n}", "function completed() {\n var counter = 1;\n for(var row = 0; row < puzzle.length; row++) {\n for(var col = 0; col < puzzle[row].length; col++) {\n if(puzzle[row][col] == counter) counter++;\n else if (puzzle[row][col] == 0 && row == puzzleSize - 1 && col == puzzleSize - 1) return true;\n else return false;\n }\n }\n return false;\n}", "_checkIfComplete() {\n\n\t\tif(this._matchedCards === this.rows*this.cols) {\n\n\t\t\t// Delay for the animations\n\t\t\tsetTimeout(() => {\n\n\t\t\t\talert(`You have scored ${this._score} points`);\n\n\t\t\t\tclearInterval(this._timer);\n\n\t\t\t\tthis.initGame();\n\t\t\t}, 400);\n\t\t}\n\t}", "function checkFinish()\r\n {\r\n player = currentPlayer();\r\n\r\n if(completeRow = isRowComplete(player))\r\n {\r\n highlightWinningCells(_ROW, completeRow);\r\n }\r\n\r\n if(completeCol = isColumnComplete(player))\r\n {\r\n highlightWinningCells(_COL, completeCol);\r\n }\r\n\r\n if(completeDiagonal_1 = isDiagonalComplete(player, _FIRST_DIAGONAL))\r\n {\r\n highlightWinningCells(_DIAGONAL, completeDiagonal_1);\r\n }\r\n\r\n if(completeDiagonal_2 = isDiagonalComplete(player, _SECOND_DIAGONAL))\r\n {\r\n highlightWinningCells(_DIAGONAL, completeDiagonal_2);\r\n }\r\n\r\n if( completeRow || completeCol || completeDiagonal_1 || completeDiagonal_2 )\r\n {\r\n congratulate(player);\r\n finalize();\r\n\r\n // It returns the player number just in case in the next extensions of the program, we decide to store the players' scores.\r\n // Otherwise, simply return suffices.\r\n return player;\r\n }\r\n\r\n // The following will be executed only if there is no winner (based on the result of the code above).\r\n if(isTableFull())\r\n {\r\n congratulate(_BOTH);\r\n finalize();\r\n return _BOTH;\r\n }\r\n\r\n return 0;\r\n }", "isFinished() {\n // after the first player third move, checks if anybody wan the game\n if(this.moves >= 5) {\n let i, j;\n\n // check rows\n for(i = 0; i < 6; i = i + 3) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + 1] && this.board[i + 1] == this.board[i + 2]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n // check cols\n for(i = 0; i <= 2; i ++) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + 3] && this.board[i + 3] == this.board[i + 6]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n // check diagonals\n for(i = 0, j = 4; i <= 2; i = i + 2, j = j - 2) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + j] && this.board[i + j] == this.board[i + 2*j]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n if(this.moves === 9) {\n this.updatePlayerScore(this.result = {\n status: 'draw'\n });\n return true;\n }\n }\n\n // if there is not winner, the game is still running and the next player shoul move\n this.result = {status: 'running'};\n\n return false;\n }", "finishGameColumn(column){\n const {totalRows, totalColumns} = this.state;\n var resultsData = this.state.gameData;\n var color;\n var row = totalRows - 1;\n var result = 1;\n var result1 = 0;\n\n while(row >= 0 && column < totalColumns && result == 1 && result1 == 0){\n color = resultsData[row][column];\n if (color == 0){\n result = 1;\n result1 = 1;\n }\n //if position value is different to zero\n else{\n //checks right position\n column = column + 1;\n if(column < totalColumns && color == resultsData[row][column]){\n result = 0;\n }\n else{\n //checks top position\n column = column - 1;\n row = row - 1;\n\n if(row >= 0 && color == resultsData[row][column]){\n result = 0;\n }\n }\n }\n }\n return result;\n}", "async finishEditing() {\n const {\n editorContext\n } = this;\n let result = false;\n\n if (editorContext) {\n const {\n column\n } = editorContext; // If completeEdit finds that the editor context has a finalize method in it,\n // it will *await* the completion of that method before completing the edit\n // so we must await completeEdit.\n // We can override that finalize method by passing the column's own finalizeCellEdit.\n\n result = await editorContext.editor.completeEdit(column.bindCallback(column.finalizeCellEdit));\n }\n\n return result;\n }", "isComplete() {\n for (let i = 0; i < this.rounds.length; i++) {\n for (let j = 0; j < this.rounds[i].length; j++) {\n if (this.rounds[i][j] == \"\") {\n return false;\n }\n }\n }\n return true;\n }", "function canMove(piece) {\n\t\tvar id = parseInt(piece.id.substring(1));\n\t\tif (id % 4 == 0) { // right column\n\t\t\treturn id - 1 == empty || id + 4 == empty || id - 4 == empty;\n\t\t} else if (id % 4 == 1) { // left column\n\t\t\treturn id + 1 == empty || id + 4 == empty || id - 4 == empty;\n\t\t} else { // middle columns\n\t\t\treturn id + 1 == empty || id - 1 == empty || id + 4 == empty || id - 4 == empty;\n\t\t}\n\t}", "function lastEmptyCol(rows, col) {\r\n let $cells = $(`[data-col=${col}]`);\r\n let $lastEmptyCol;\r\n\r\n $.each($cells, function(index, cell) {\r\n if (!cell.classList.contains('empty') || cell.dataset.row - 1 === '1') {\r\n return false;\r\n }\r\n $lastEmptyCol = cell;\r\n });\r\n return $lastEmptyCol;\r\n }", "finished() {\n return this.y > height || this.y < 0;\n }", "function isRowComplete(player)\r\n {\r\n for(var row=0; row<3; row++)\r\n {\r\n numCells = 0;\r\n for(var col=0; col<3; col++)\r\n {\r\n if(cellValue(row, col) == player)\r\n {\r\n numCells++;\r\n }\r\n }\r\n if(numCells == 3)\r\n {\r\n return (row+1);\r\n }\r\n }\r\n\r\n return 0;\r\n }", "function checkWiningColumnMove(p) {\n //0,3,6 1,4,7 2,5,8\n var ret = false;\n var c1 = _matrix[0][0] + _matrix[1][0] + _matrix[2][0];\n var c2 = _matrix[0][1] + _matrix[1][1] + _matrix[2][1];\n var c3 = _matrix[0][2] + _matrix[1][2] + _matrix[2][2];\n\n if (c1 === p.repeat(3) || c2 === p.repeat(3) || c3 === p.repeat(3) ) ret = true;\n\n return ret;\n }", "function rowFinished(arr){\n\n\tif(arr.indexOf(0) !== -1){\n\n\t\treturn false\n\t}else{\n\n\t\treturn true\n\t}\n}", "async function checkColEmptyAndClick(col,player){\n \n if(clickedItemArr[col-1].includes(0)){\n rowIndex = clickedItemArr[col-1].lastIndexOf(0); \n clickedItemArr[col-1][rowIndex]=1+player; \n return true;\n } \n return false; \n}", "function hasMoves() {\n for (var x = 0; x < cols; ++x) {\n for (var y = 0; y < cols; ++y) {\n if (canJewelMove(x, y)) {\n return true;\n }\n }\n }\n\n return false;\n }", "_checkBottomColision() {\n\n let block = false;\n let absPos;\n\n for (let row = 3; row >= 0; row--) {\n\n if (block) return false; // ==== se han comprobado todos los bloques de abajo ====>>>\n for (let col = 0; col < 4; col++) {\n\n if (this[row][col] === 0) continue;\n\n block = true;\n absPos = this._getAbsolutePosition(row, col);\n\n if (absPos.row === 19) return true; //==== un bloque esta eb el fondo =====>>\n }\n }\n }", "function checkAnimationComplete(){\t\n\tvar targetName = '';\n\tfor(n=0;n<animation_arr.length;n++){\n\t\tif($.pukiAnimation[animation_arr[n].name].visible){\n\t\t\ttargetName = animation_arr[n].name;\n\t\t}\n\t}\n\t\n\tvar _currentframe = $.pukiAnimation[targetName].currentFrame;\n\tvar _lastframes = $.pukiData[targetName].getAnimation($.pukiAnimation[targetName].currentAnimation).frames;\n\t_lastframes = _lastframes[_lastframes.length-1];\n\t\n\tif(_currentframe == _lastframes){\n\t\treturn true;\t\n\t}else{\n\t\treturn false;\t\n\t}\n}", "function getEndPlaybackColumn(){\n for(let col = columns - 1; col >= 0; col--) {\n for(let row = 0; row < rows; row++){\n let gridSpace = (row * columns) + col;\n if(!isEmptySpace(gridSpace)){\n return col;\n }\n }\n }\n return 0;\n}", "function checkMove() {\n var discToMove = startPeg[startPeg.length - 1];\n var topDisc = endPeg[endPeg.length - 1];\n var moveAvailable = false;\n if (discToMove < topDisc || endPeg.length === 0) {\n moveAvailable = true;\n }\n return moveAvailable;\n }", "_checkColumnCellsAlive(playerID, column) {\n let base = column + playerID*9;\n return !(this.cells[base].isDead && this.cells[base+3].isDead && this.cells[base+6].isDead);\n }", "_checkTurnEnd() {\n let p0alive=false, p1alive=false;\n for (let i=0; i<9; i++) {\n p0alive = p0alive || !this.cells[i].isDead;\n p1alive = p1alive || !this.cells[i+9].isDead;\n }\n if (p0alive && p1alive) return (this.turn==20) ? \"draw\" : \"continue\";\n if (!p0alive && !p1alive) return \"draw\";\n return (p0alive) ? \"p0win\" : \"p1win\";\n }", "function checkDoneAction(){\n db.game.findOne({\"game_id\": clientSocket.gameRoom},function(err,doc){\n var done = true;\n var playerArray = doc.player_list;\n playerArray.forEach(function(player){\n if(player.finishedAction === false){\n done = false;\n }\n });\n\n if(done){\n return true;\n }\n return false;\n });\n }", "function handleDragEnd(e) {\n //if task was moved from backlog to inprogress, remove blue border\n if (inProgressColumn.contains(dragSrcEl) && right === true) {\n inProgressColumn.classList.remove(\"goRight\");\n }\n\n //if task was moved from inprogress to complete, remove blue border\n else if (completeColumn.contains(dragSrcEl)) {\n completeColumn.classList.remove(\"goRight\");\n }\n\n //if task was moved from inprogress to backlog, remove red border\n else if (backlogColumn.contains(dragSrcEl)) {\n backlogColumn.classList.remove(\"goLeft\");\n }\n\n //if task was moved from complete to inprogress, remove red border\n else if (inProgressColumn.contains(dragSrcEl) && right === false) {\n inProgressColumn.classList.remove(\"goLeft\");\n } else {\n return false;\n }\n return true;\n}", "function move(cell) { if ((cellEmptyArray[0] === cellValArray[0] && cellEmptyArray[1] === cellValArray[1] + 1 && cellEmptyArray[2] === cellValArray[2] && cellEmptyArray[3] === cellValArray[3] + 1) || (cellEmptyArray[0] === cellValArray[0] && cellEmptyArray[1] === cellValArray[1] - 1 && cellEmptyArray[2] === cellValArray[2] && cellEmptyArray[3] === cellValArray[3] - 1) || (cellEmptyArray[0] === cellValArray[0] + 1 && cellEmptyArray[1] === cellValArray[1] && cellEmptyArray[2] === cellValArray[2] + 1 && cellEmptyArray[3] === cellValArray[3]) || (cellEmptyArray[0] === cellValArray[0] - 1 && cellEmptyArray[1] === cellValArray[1] && cellEmptyArray[2] === cellValArray[2] - 1 && cellEmptyArray[3] === cellValArray[3])) {\r\n cell.css('grid-area', cellEmpty);\r\n $('.slide__9').css('grid-area', cellVal);\r\n cellEmpty = cellVal;\r\n }\r\n}", "isFinished() {\n if(this.noMoreTurns()||this.getWinner()!==null)\n return true;\n else\n return false;\n\n }", "isFinished (){\n\t\treturn this.status !== null && this.finishDelay < 0;\n\t}", "function doneDigging() {\n return gotStart && gotFinish && cellsVisited == numCells;\n }", "function checkMove ( moveX, moveY, newTetromino ) {\r\n //If the tetromino is simply moving along with the arrow key\r\n if ( newTetromino == undefined ) {\r\n newTetromino = tetromino;\r\n }\r\n \r\n for ( let y = 0; y < TETROMINO_SIZE; y++ ) {\r\n for ( let x = 0; x < TETROMINO_SIZE; x++ ) {\r\n\r\n if ( newTetromino[y][x] != 0 ) {\r\n let newX = tetromino_x + x + moveX;\r\n let newY = tetromino_y + y + moveY;\r\n\r\n if ( newX < 0 || newY < 0 || FIELD_COLUMN <= newX || FIELD_ROW <= newY\r\n || field[newY][newX] != 0 ) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n}", "isLevelComplete() {\n let gridSpace;\n for (let x = 0; x < gameState.GRID_WIDTH; x++) {\n for (let y = 0; y < gameState.GRID_HEIGHT; y++) {\n gridSpace = gameState.grid[x][y];\n if (gridSpace.targetNumber && !gridSpace.absorbed) {\n console.log(\"Get the \" + gridSpace.number + \" at (\" + x + \", \" + y + \")\");\n return false;\n }\n }\n }\n return true;\n }", "checkVerticalColision() {\n let absPos;\n\n // comprueba si ha tocado el fondo del tablero \n if (this._checkBottomColision()) return false;\n // \n for (let col = 0; col < 4; col++) {\n for (let row = 3; row >= 0; row--) {\n if (this[row][col] === 0) continue;\n\n absPos = this._getAbsolutePosition(row, col);\n\n if (this.board[absPos.row + 1][absPos.col] !== 0) return false;\n break;\n }\n }\n\n return true;\n }", "function gameFinished() {\n 'use strict';\n return othelloGrid.countDiscs(OTHELLO_CONST.empty) != 0 ? false : true;\n}", "function canMove(row, col) {\n if (!hasOppositeChecker(row, col, currentColor)) {\n if (isAKing(occupiedArray[row][col].id)) {\n if (!cellIsVacant(row + 1, col + 1) && !cellIsVacant(row + 1, col - 1) && !cellIsVacant(row - 1, col + 1) && !cellIsVacant(row - 1, col - 1)) {\n return false;\n }\n }\n else if (occupiedArray[row][col].classList.contains(\"black\")) {\n if (!cellIsVacant(row + 1, col - 1) && !cellIsVacant(row + 1, col + 1)) {\n return false;\n }\n }\n else if (occupiedArray[row][col].classList.contains(\"red\")) {\n if (!cellIsVacant(row - 1, col - 1) && !cellIsVacant(row - 1, col + 1)) {\n return false;\n }\n }\n return true;\n }\n}", "checkRightColision() {\n let block = false; // booleano que comprueba si hay un bloque en la columna\n let absPos; // tendra los valores absolutos del bloque\n\n for (let col = 3; col >= 0; col--) {\n\n for (let row = 0; row < 4; row++) {\n\n if (this[row][col] === 0) continue; //==== no hay bloque que comprobar ====>>> \n\n block = true; //==== hay un bloque en la columna ====>>>>\n absPos = this._getAbsolutePosition(row, col);\n\n if (this.board[absPos.row][++absPos.col] !== 0) return false; //==== un bloque ha chocado con algo ====>>\n }\n\n if (block) return true; //==== ningun bloque de la columna ha chocado con nada ====>>>>\n }\n }", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "lookForCompleteRowsAndDelete() {\n var y\n var x\n var rowToDelete = -1\n for(y = Y_SPACES - 1; y >= 0; y--) {\n var totalInRow = 0\n for(x = 0; x < X_SPACES; x++) {\n if (this.board[y][x].tetrinoPiece) {\n totalInRow += 1\n }\n }\n if (totalInRow == X_SPACES) {\n rowToDelete = y\n break\n }\n }\n\n // Delete this row!\n if (rowToDelete >= 0) {\n for(x = 0; x < X_SPACES; x++) {\n this.board[rowToDelete][x] = new Piece(30, 30, 30, false)\n }\n this.moveRow = rowToDelete\n this.gamePaused = true\n return\n }\n this.gamePaused = false\n this.moveRow = -1\n\n }", "forEveryColumn(move, callback) {\n if(move === LEFT_TO_RIGHT) {\n for(let column = 0; column <= MAX_COLUMN; column++) {\n callback(column);\n }\n } else if(move === RIGHT_TO_LEFT) {\n for(let column = MAX_COLUMN; column >= 0; column--) {\n callback(column);\n }\n } else { \n throw new Error(`Invalid movement: [${move}]`);\n } \n }", "function hasMoves () {\n for (var x = 0; x < cols; x++) {\n for (var y = 0; y < rows; y++) {\n if (canTileMove(x, y)) {\n return true;\n }\n }\n }\n return false;\n }", "get isColumn() {\n return this.startColumn === this.endColumn && this.startRow === 0 && this.endRow === null\n }", "function move(col) {\n\n // Update the timing properties if we're using time control.\n var moveEnd = new Date().getTime();\n if (stats.timeControl != -1) {\n if (stats.future[0] == \"r\") {\n stats.redTime -= moveEnd - stats.moveStart;\n }\n else {\n stats.bluTime -= moveEnd - stats.moveStart;\n }\n stats.moveStart = moveEnd;\n }\n\n // Update the non-timing properties.\n stats.currentTurn += 1;\n stats.history += stats.future[0] + col + stats.openRows[col];\n stats.openRows[col] += 1;\n stats.future = \"\";\n for (let i = 0; i < 8; i++) {\n if (thueMorse(stats.firstTurn) ^ thueMorse(stats.currentTurn + i) == 0) stats.future += \"r\";\n else stats.future += \"b\";\n }\n\n // Update the winning properties.\n if (isWinningMove()) {\n if (stats.history.slice(-3, -2) == \"r\") {\n stats.winner = \"Red\";\n }\n else {\n stats.winner = \"Blue\";\n }\n stats.winBy = \"connection\";\n }\n }", "finished() {\n let d = p5.Vector.dist(this.pos, target.getCenter());\n if (d < this.recordDist) {\n this.recordDist = d;\n }\n if (target.contains(this.pos)) {\n this.stopped = true;\n return true;\n }\n return false;\n }", "isComplete() {\n return this.selection != null;\n }", "isComplete() {\n return this.selection != null;\n }", "function checkGoal() {\n var grid = Resources.getGrid();\n // Get the row index of water\n var ind = Helpers.blockIndices(grid.rows, 'W')[0];\n var i, x = ind * grid.nColumns;\n\n var rect1 = player.getBounds();\n var rect2;\n\n for (i = x; i < x + grid.nColumns; i++) {\n rect2 = blocks[i].getBounds();\n if (Helpers.verticallyClose(rect1, rect2, 5)) {\n player.y = ind;\n score++;\n player.setGoal(true);\n return;\n }\n }\n }", "wait_AnimationEnd() {\n if (this.tmpPiece.parabolic.end == true) {\n this.unvalidateCells();\n this.check_GameOver();\n this.check_Reset();\n this.checkSelected();\n this.locked = true;\n }\n }", "hasStarted () {\r\n return Boolean(this._pastPos[this._pastPos.length-1])\r\n }", "checkFullRow () {\n for (let row = 0; row < this.landed[0].length; row++) {\n let result = true\n for (let col = 0; col < this.landed.length; col++) {\n if (this.landed[col][row] === 0) result = false\n }\n if (result) {\n this.moveLandedDown(row)\n this.score += 100\n this.view.score.innerHTML = 'Score: ' + this.score\n }\n }\n }", "function isEnd() {\n\t\tlet flag = true;\n\t\tfor (let i = 0; i < pieceCount.length; i++) {\n\t\t\t//for each puzzle piece\n\t\t\tlet top = parseInt(pieceCount[i].style.top);\n\t\t\tlet left = parseInt(pieceCount[i].style.left);\n\t\t\tif (left != (i % 4 * PIECESIZE) || top != parseInt(i / 4) * PIECESIZE) {\n\t\t\t\t//checks if each piece matches its left and top position\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "function findSpotForCol(x,event) {\n for (let y = HEIGHT - 1; y >= 0; y--){\n if(!board[y][x]) {\n return y\n }\n if (y === 1) {\n event.target.parentElement.classList.add('fullColumn');//fade the drop button when column fills\n }\n }\n \n return null\n}", "function tied() {\n var i = 0;\n while (i < 9) {\n if ($(cells[i++]).hasClass(empty_cell)) return false;\n }\n gameisfinished = true;\n return true;\n }", "moveCompleted() {\n // Reset the from so we can\n this.from = null;\n\n if (this.gameOver) return;\n this.changeTurn();\n this.hideMessage();\n }", "function checkEnd() {\n\n if (activeIndex >= sequence.length) {\n lockBoard();\n nextRound();\n }\n}", "function movable(row, col){\n\t\tif(row == 0 || row == 5 || col == 0 || col == 5){\n\t\t\treturn false;\n\t\t}\n\t\tif((row == emptyrow && emptycol -1 == col)||(col == emptycol && row == emptyrow -1)||\n\t\t(row == emptyrow && emptycol +1 == col)||(col == emptycol && row == emptyrow +1)){\n\t\t\treturn true;\n\t\t}\n\t}", "isConflict(){\n let conflict = false; \n if( this.x < 0 || (this.x + this.width )> this.tableWidth ) conflict=true;\n if( (this.y - this.height + 1) < 0 ) conflict=true;\n if(conflict) this.undo();\n }", "canMove(t) {\n if (this.done) return false; // turn used up\n // if (this.moves < 1) return false; // not enuf moves left\n return this.udata.terrain.charAt(t) !== \"0\";\n }", "canMove(t) {\n if (this.done) return false; // turn used up\n // if (this.moves < 1) return false; // not enuf moves left\n return this.udata.terrain.charAt(t) !== \"0\";\n }", "checkPassant(board, target_pos, pos, last_move){\n\t\treturn false;\n\t}", "function gameComplete() {\r\n\r\n var linhas = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\"];\r\n var gameComplete = false;\r\n\r\n for (var i = 1; i <= 9; i++) {\r\n consoleDebug('Coluna: ', i);\r\n for (var j = 0; j < 9; j++) {\r\n\r\n if (hasValue(linhas[j] + i))\r\n gameComplete = true;\r\n else\r\n return gameComplete = false;\r\n }\r\n }\r\n\r\n return gameComplete;\r\n}", "function finish()\r\n\r\n{\r\n\tvar flag = true;\r\n\r\n\tfor (var i = 0; i < gamePiece.length; i++) \r\n\t{\r\n\r\n\t\tvar top = parseInt(gamePiece[i].style.top);\r\n\t\tvar left = parseInt(gamePiece[i].style.left);\r\n\r\n\t\tif (left != (i%4*100) || top != parseInt(i/4)*100) \r\n\r\n\t\t{\r\n\t\t\tflag = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn flag;\r\n}", "lastMoviePlay()\n {\n return (this.currentMoviePlay == this.playsCoords.length - 1);\n }", "rightColumnEnemyIsInCanvasRightColumn() {\n let mostLeftColumnWithEnemyAlive;\n for (let j = game.model.siEnemiesPerRow - 1; j >= 0; j--) {\n for (let i = 0; i < game.model.siEnemies.length; i++) {\n mostLeftColumnWithEnemyAlive = game.model.siEnemies[i][j];\n if (mostLeftColumnWithEnemyAlive.elem.style.display !== \"none\") {\n break;\n }\n }\n if (mostLeftColumnWithEnemyAlive.elem.style.display !== \"none\") {\n break;\n }\n }\n\n if (!mostLeftColumnWithEnemyAlive)\n return false;\n\n return mostLeftColumnWithEnemyAlive.x > this.canvasColumnWidth * (this.canvasColumns - 1) &&\n mostLeftColumnWithEnemyAlive.x < this.canvasColumnWidth * this.canvasColumns;\n }", "hasMoveBeenPlayed(x, y){\n let playedMove = this.moveList.filter( (move) => { return (move.X === x && move.Y === y); })\n return playedMove.length === 1; //Then the move has been played.\n }", "function canMove(coordinatesCallback,dir){\n if(pauseState){\n return false;\n }\n for(var i = 0; i < tetromino.cells.length; i++){\n var new_coord = coordinatesCallback(i,dir); // tulemus on kastides, mitte pikslites\n var new_x = new_coord[0];\n var new_y = new_coord[1];\n if(!validateCoordinates(new_x,new_y)){\n return false;\n }\n }\n return true;\n}", "function updateGameFinishedState(){\n if(snake.history[0].x < 0 || snake.history[0].x >= size\n || snake.history[0].y < 0 || snake.history[0].y >= size){\n isGameFinished = true;\n }\n }", "function canMoveDown() {\n var grid = null;\n var checkRow = 0;\n var checkColumn = 0;\n for(grid of GameData.activePiece.getNextRow()) {\n checkRow = GameData.row + grid.getRow();\n if(checkRow >= GameData.mainPlayField.getFieldHeight()) {\n return false;\n }\n checkColumn = correctColumn(GameData.column + grid.getColumn());\n if(GameData.mainPlayField.getBlockType(checkRow, checkColumn) !== 0) {\n return false;\n }\n }\n return true;\n}", "isFinished() {\n\n return this.pairsGuessed !== this.cards.length / 2 ? false : true\n\n }", "function checkGameFinished() {\r\n if (getScore(PLAYER) == 0) return true;\r\n for (var i = 0; i < field_height; i++)\r\n for (var j = 0; j < field_width; j++)\r\n if (game_field[i][j] == EMPTY) return false;\r\n return true;\r\n}", "function levelCompleted() {\n\tcompleted = true;\n\tfor (var i=0; i<NY; i++) {\n\t\tfor (var j=0; j<NX; j++) {\n\t\t\tif (values[i][j] != levels[currentLevel][i][j]) {\n\t\t\t\tcompleted = false;\n\t\t\t}\n\t\t}\n\t}\n\treturn completed;\n}", "checkColumns(player) {\n //player\n\n /* Check all column in that row */\n if (\n (this.board[0][0] === player && this.board[1][0] === player && this.board[2][0] === player) ||\n\n (this.board[0][1] === player && this.board[1][1] === player && this.board[2][1] === player) ||\n (this.board[0][2] === player && this.board[1][2] === player && this.board[2][2] === player)\n ) {\n return true;\n }\n return false;\n }", "function checkIfComplete(){\n\t\tif(isComplete == false){\n\t\t\tisComplete = true;\n\t\t} else {\n\t\t\tplace = ' SEGUNDO ';\n\t\t}\n\t}", "function checkRowCompletion(k){\n var simultaneousRowsCompleted = 0;\n //console.log(\"==================================== \"+players[k].bottomMostX);\n for(var i=0;i<=players[k].bottomMostX;i++)\n {\n //console.log(\"==================================== \"+gridWidth);\n for(var j=0;j<gridWidth;j++)\n {\n if(isOccupied(i,j,k) == false)\n break;\n }\n if(j == gridWidth)\n {\n var tempData = [];\n for(var z=0; z<gridWidth ;z++) \n {\n tempData.push(players[k].backgroundPropertyOfAllBlocks[i][z]);\n }\n addCompletedRowToOpponents(tempData,k);\n simultaneousRowsCompleted++;\n eraseRow(i,k);\n dropTetris(i,k);\n //calculateScore(k,simultaneousRowsCompleted,0); \n }\n }\n }", "function moveAllToBottom() {\n\tvar moved = false;\n\tfor (var c = 0; c < 4 ; c++ ) {\n\t\tvar s = 3;\n\t\tfor (var r = 3; r >= 0 ; r-- ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (r != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(s, c, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts--;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "function Complete(com){\r\n\t\tvar done = false;\r\n\t\ttop = 0;\r\n\t\tleft = 0;\r\n\r\n\t\tfor(var x = 0; x<pieces.length;x++){ \r\n\t\t\tif (com[x].style.left == left && com[x].style.top == top){\r\n\t\t\t\tdone = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdone = false;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t}\r\n\r\n\t}//end of Complete() ", "function isMoveValid(row, columns) {\n for (let i = 0; i < row; i++) {\n if (columns[i] === columns[row]) {\n return false; // Two queens are in the same column\n }\n\n if (row - i === Math.abs(columns[row] - columns[i])) {\n return false; // Two queens are in the same diagonal\n }\n }\n\n return true;\n}", "function checkGridComplete() {\n // Make an array of all squares in the grid to look through\n let squares = qsa(\".square\");\n // Make an empty array to store empty squares in\n let emptySquares = [];\n for (let i = 0; i < squares.length; i++) {\n // Define a variable to show the content of the squares within the squares array\n let squareContent = squares[i].textContent;\n // If the sqaure's content is an empty string\n if (squareContent === \"\") {\n // All empty squares are pushed onto the emptySquares array\n emptySquares.push(squareContent);\n }\n }\n // If the array is empty, the game is won. Else the game continues\n if (emptySquares.length === 0) {\n return true;\n } else {\n return false;\n }\n}", "function isMovesLeft() {\n var boo = false;\n board.forEach(function(row) {\n row.forEach(function(val) {\n if (val == '_') {\n boo = true;\n }\n })\n })\n return boo;\n}", "checkLeftColision() {\n let block = false; // booleano que comprueba si hay un bloque en la columna\n let absPos; // tendra los valores absolutos del bloque\n\n for (let col = 0; col < 4; col++) {\n\n for (let row = 0; row < 4; row++) {\n\n if (this[row][col] === 0) continue; //==== no hay bloque que comprobar ====>>> \n\n block = true; //==== hay un bloque en la columna ====>>>>\n absPos = this._getAbsolutePosition(row, col);\n\n if (this.board[absPos.row][absPos.col - 1] !== 0) return false; //==== un bloque ha chocado con algo ====>>\n }\n\n if (block) return true; //==== todos los bloques han sido testeados y ninguno ha chocado con nada ====>>>>\n }\n }", "function second_move() {\n computer_second_move = false;\n // check for any deffensive move\n index = defensive_move();\n if (!isNaN(index)) return index;\n if ($(cells[center_cell]).hasClass(machine_clicked)) return select_non_corner_cell()\n else return select_corner_cell_available(); \n }", "function moveColumn(n){\n if (column + n >= 0 && column + n <= promptText.length){\n column += n;\n return true;\n } else return false;\n }", "function isSolvedFn() {\n for (var i = 0; i < board.length - 1; i++) { // i < board.length because last index 15, will have 0 (empty space)\n if (board[i] != i + 1) {\n return false;\n }\n }\n return true;\n }", "function isWinningMove() {\n var hori = count(0, -1) + count(0, 1) - 1;\n var vert = count(-1, 0) + count(1, 0) - 1;\n var diag = count(1, -1) + count(-1, 1) - 1;\n var antd = count(1, 1) + count(-1, -1) - 1;\n // console.log(\"horizontal: \" + hori);\n // console.log(\"vertical: \" + vert);\n // console.log(\"diagonal: \" + diag);\n // console.log(\"anti-diagonal: \" + antd);\n if (hori >=4 | vert >= 4 | diag >= 4 | antd >= 4) {\n return true;\n }\n else return false;\n }", "function checkLosing() {\n lowestTop = parseFloat(columns[0][0].style.top);\n for (i = 1; i < columns.length; i++) {\n if (columns[i].length > 0) {\n const colLowestTop = parseFloat(columns[i][0].style.top);\n if (colLowestTop > lowestTop) {\n lowestTop = colLowestTop;\n }\n }\n }\n\n var lowestBottom = lowestTop + 8; /*8% target height*/\n if (lowestBottom > parseFloat(canon.style.top)) {\n //End Game\n //console.log(\"Loser\");\n endGame(gameOver.lose);\n }\n }", "function canMove(coordinatesCallback, dir) {\n if (pauseState) {\n return false;\n }\n for (var i = 0; i < tetromino.cells.length; i++) {\n var new_coord = coordinatesCallback(i, dir); // return coords in terms of cells, not pixels\n var new_x = new_coord[0];\n var new_y = new_coord[1];\n if (!validateCoordinates(new_x, new_y)) {\n return false;\n }\n }\n return true;\n}", "isComplete() {\n if (!this.endTime) return false;\n if (this.now() > this.endTime) {\n return true;\n }\n else {\n return false;\n }\n \n }", "function movesRemaining () {\n for (var i = 0; i < state.words.length; i++) {\n if (hasMoreMoves(state.words[i])) {\n return true;\n }\n }\n state.hint = {};\n return false;\n}", "function first_move(){\n computer_first_move = false;\n // select the center cell in case the player hadn't\n if (!$(cells[center_cell]).hasClass(user_clicked)) return center_cell;\n // otherwise select any corner cell\n else return select_corner_cell_available(); \n }", "check_win(last_move) {\n let that = this\n console.log('this is in check win', this)\n let $last_cell = last_move\n if ($last_cell) {\n let row = $last_cell.attr('row')\n let col = $last_cell.attr('col')\n let color = $last_cell.css('backgroundColor')\n return (check_horizontal(row, col, color) ||\n check_vertical(row, col, color) ||\n check_top_left_bottom_right(row, col, color) ||\n check_top_right_bottom_left(row, col, color))\n }\n // get the cell with given row and col\n function get_cell(row, col) {\n return $(`.col[row='${row}'][col='${col}']`)\n }\n //check horizontal direction of this piece, if there is another piece with same color, count++\n //check left and right, break the loop if the piece next to it has a different color\n //if count >=3 which mean plus the last dropped piece, we have 4 pieces with same color, this is a win\n function check_horizontal(row, col, color) {\n let count = 1\n let temp = col\n while (col > 0) {\n let $left_cell = get_cell(row, --col)\n console.log(col, color, 'left count')\n console.log($left_cell)\n if ($left_cell.css('backgroundColor') == color) {\n count += 1\n console.log('count +++ left')\n }\n else {\n break\n }\n }\n col = temp\n while (col < that.col) {\n let $right_cell = get_cell(row, ++col)\n console.log(col, color, 'right count')\n console.log($right_cell)\n if ($right_cell.css('backgroundColor') == color) {\n count += 1\n console.log('count +++ right')\n }\n else {\n break\n }\n }\n if (count >= 4) {\n return true\n }\n return false\n }\n //check vertical direction of this piece\n function check_vertical(row, col, color) {\n let count = 1\n let temp = row\n while (row > 0) {\n let $down_cell = get_cell(--row, col)\n if ($down_cell.css('backgroundColor') == color) {\n count += 1\n console.log('count +++ down')\n }\n else {\n break\n }\n }\n row = temp\n while (row < that.row) {\n let $up_cell = get_cell(++row, col)\n if ($up_cell.css('backgroundColor') == color) {\n count += 1\n console.log('count +++ right')\n }\n else {\n break\n }\n }\n if (count >= 4) {\n return true\n }\n return false\n }\n //check top left to bottom right direction of this piece\n function check_top_left_bottom_right(row, col, color) {\n let count = 1\n let temp_row = row\n let temp_col = col\n while (row > 0 && col > 0) {\n let $next_cell = get_cell(--row, --col)\n if ($next_cell.css('backgroundColor') == color) {\n count += 1\n }\n else {\n break\n }\n }\n row = temp_row\n col = temp_col\n while (row < that.row && col < that.col) {\n let $up_cell = get_cell(++row, ++col)\n if ($up_cell.css('backgroundColor') == color) {\n count += 1\n }\n else {\n break\n }\n }\n if (count >= 4) {\n return true\n }\n return false\n }\n //check top right to bottom left direction of this piece\n function check_top_right_bottom_left(row, col, color) {\n let count = 1\n let temp_row = row\n let temp_col = col\n while (row < that.row && col > 0) {\n let $next_cell = get_cell(++row, --col)\n if ($next_cell.css('backgroundColor') == color) {\n count += 1\n }\n else {\n break\n }\n }\n row = temp_row\n col = temp_col\n while (row > 0 && col < that.col) {\n let $up_cell = get_cell(--row, ++col)\n if ($up_cell.css('backgroundColor') == color) {\n count += 1\n }\n else {\n break\n }\n }\n if (count >= 4) {\n return true\n }\n return false\n }\n }", "gameFrame() {\n if(!this.gameLost && !this.gamePaused) {\n this.updateBoard()\n if (this.needsNewPiece) {\n this.lookForCompleteRowsAndDelete()\n if (!this.gamePaused) {\n this.generateNewTetrino()\n } else {\n this.moveRowsDown()\n }\n }\n } else if (game.gamePaused) {\n this.lookForCompleteRowsAndDelete()\n if (game.gamePaused) {\n this.moveRowsDown()\n }\n }\n }", "isDone() {\n return !this.loop && this.currentFrame >= this.sprites.length;\n }", "function iterateSucceedingColumns() {\r\n\t\tvar x = editableFieldsList.indexOf(currentColTitle) + 1;\r\n\t\tvar nextEditableCol = editableFieldsList[x];\r\n\t\tif (null === nextEditableCol || undefined === nextEditableCol) {\r\n\t\t\tgetNextEditableRow();\r\n\t\t}\r\n\t\tnextEditableFieldId = getNextGridFieldId(rowNum, nextEditableCol);\r\n\r\n\t\tfindAndSetFocus();\r\n\t\tfunction findAndSetFocus() {\r\n\r\n\t\t\tif (!isGridElementPresent(nextEditableFieldId) || isVisible(nextEditableFieldId)) {\r\n\t\t\t\tvar xpos = 0;\r\n\t\t\t\tvar nxtEditableFound = false;\r\n\t\t\t\t$(columnList).each(function () {\r\n\t\t\t\t\tif ($(this).attr('_headerText') === nextEditableCol) {\r\n\t\t\t\t\t\txpos = $(this).attr('_x');\r\n\t\t\t\t\t\tnxtEditableFound = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tif (nxtEditableFound) {\r\n\t\t\t\t\t$(gridBlockElem).animate({\r\n\t\t\t\t\t\t'scrollLeft': xpos\r\n\t\t\t\t\t}, 500, '', function () {\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\tnextGridElem = $(document.getElementById(nextEditableFieldId));\r\n\t\t\t\t\t\t\tif (nextGridElem && nextGridElem.length > 0)\r\n\t\t\t\t\t\t\t\tsetFocus();\r\n\t\t\t\t\t\t\telse if (grid.getBodyContainer().maxVerticalScrollPosition > $(gridBlockElem).scrollTop()) {\r\n\t\t\t\t\t\t\t\tvar ypos = $(gridBlockElem).scrollTop() + grid.getBodyContainer().height - grid.getBodyContainer().verticalMask;\r\n\t\t\t\t\t\t\t\tif (grid.getBodyContainer()._calculatedTotalHeight > ypos) {\r\n\t\t\t\t\t\t\t\t\t$(gridBlockElem).animate({\r\n\t\t\t\t\t\t\t\t\t\t'scrollTop': ypos\r\n\t\t\t\t\t\t\t\t\t}, 300, '', function () {\r\n\t\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t\tif (!isGridElementPresent(nextEditableFieldId)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t$(columnList).each(function () {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($(this).attr('_headerText') === nextEditableCol)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\txpos = $(this).attr('_x');\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$(gridBlockElem).animate({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'scrollLeft': xpos\r\n\t\t\t\t\t\t\t\t\t\t\t\t}, 300, '', function () {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextGridElem = $(document.getElementById(nextEditableFieldId));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextGridElem && nextGridElem.length > 0)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetFocus();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}, 400);\r\n\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} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\tnextGridElem = $(document.getElementById(nextEditableFieldId));\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (nextGridElem && nextGridElem.length > 0)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetFocus();\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}, 400);\r\n\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}, 500);\r\n\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnmsp.isTabbed = false;\r\n\t\t\t\t\tfocusOutFromLastGridField();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tnextGridElem = $(document.getElementById(nextEditableFieldId));\r\n\t\t\t\tif (nextGridElem && nextGridElem.length > 0)\r\n\t\t\t\t\tsetFocus();\r\n\t\t\t}\r\n\t\t}\r\n\t\t/**\r\n\t\t * Checks whether there is an editable field in the current row if not finds the net row with editable field\r\n\t\t */\r\n\t\tfunction getNextEditableRow() {\r\n\t\t\trowNum = parseInt(rowNum) + 1;\r\n\t\t\teditableFieldsList = getEditableFieldListInOrder(nmsp, rowNum);\r\n\t\t\tvar maxVisibleRowNum = parseInt(grid.getRowCount()) + parseInt(initRowNum);\r\n\t\t\tif (editableFieldsList && editableFieldsList.length > 0) {\r\n\t\t\t\tnextEditableCol = editableFieldsList[0];\r\n\t\t\t\tnextEditableFieldId = getNextGridFieldId(rowNum, nextEditableCol);\r\n\t\t\t} else if (maxVisibleRowNum < rowNum && grid.getBodyContainer().maxVerticalScrollPosition > $(gridBlockElem).scrollTop()) { // if maximum number visible rows exceeded then scroll write the next set\r\n\t\t\t\tvar ypos = $(gridBlockElem).scrollTop() + grid.getBodyContainer().height - grid.getBodyContainer().verticalMask;\r\n\t\t\t\tif (grid.getBodyContainer()._calculatedTotalHeight > ypos) {\r\n\t\t\t\t\t$(gridBlockElem).animate({\r\n\t\t\t\t\t\t'scrollTop': ypos\r\n\t\t\t\t\t}, 300, '', function () {\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\trowNum = initRowNum;\r\n\t\t\t\t\t\t\tgetNextEditableRow();\r\n\t\t\t\t\t\t}, 400);\r\n\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else if ((grid.getBodyContainer().maxVerticalScrollPosition > $(gridBlockElem).scrollTop()) || (Object.keys(nmsp.rowEditableColumnMap).length > rowNum))\r\n\t\t\t\tgetNextEditableRow();\r\n\t\t}\r\n\r\n\t}", "get fullyWaiting()\n {\n return this.insert === this.end;\n }", "makeMove(colID){\n //copy of the board gets created\n const boardCopy = this.state.boardState.map(function(arr) {\n return arr.slice();\n });\n //confirms that the column isnt full \n if( boardCopy[colID].indexOf(null) !== -1 ){\n //player token gets added to the column on the board \n let newColumn = boardCopy[colID].reverse()\n newColumn[newColumn.indexOf(null)] = this.state.playerTurn\n newColumn.reverse()\n //board updates when move is made, now its the next players turn \n this.setState({\n playerTurn: (this.state.playerTurn === 'Red') ? 'Yellow' : 'Red',\n boardState: boardCopy,\n full:this.state.full+1\n })\n }\n\n }" ]
[ "0.7052778", "0.6924038", "0.68343455", "0.6623863", "0.65517557", "0.6526866", "0.6390213", "0.6385907", "0.63431305", "0.6333813", "0.63073057", "0.6302315", "0.6293104", "0.62687755", "0.6192866", "0.6150302", "0.61242425", "0.6115739", "0.6113385", "0.6087621", "0.60704565", "0.6063175", "0.60599405", "0.60417056", "0.60355836", "0.6025076", "0.60080534", "0.6003284", "0.59924906", "0.5977286", "0.59690005", "0.5961644", "0.59484345", "0.59400105", "0.5920359", "0.59123087", "0.5911405", "0.59081423", "0.5903548", "0.5902427", "0.5901395", "0.5898309", "0.58965826", "0.58965826", "0.58858943", "0.588439", "0.5882742", "0.5853907", "0.5846196", "0.58382547", "0.5836559", "0.5836559", "0.58314395", "0.5824129", "0.5806271", "0.57981545", "0.57934433", "0.5793412", "0.5793222", "0.5791818", "0.57841", "0.5772626", "0.57682794", "0.5766017", "0.5766017", "0.57499576", "0.5749638", "0.57400066", "0.5738314", "0.5732568", "0.57322186", "0.57286507", "0.572626", "0.57254463", "0.5720679", "0.5718575", "0.57082176", "0.5700882", "0.5700357", "0.56924456", "0.569153", "0.5680676", "0.5680182", "0.56790286", "0.56730336", "0.5667025", "0.56594294", "0.5659344", "0.56580544", "0.5652066", "0.56472236", "0.56417805", "0.5639636", "0.5635311", "0.562979", "0.5628473", "0.56223696", "0.5615622", "0.56078434", "0.5607302", "0.5599634" ]
0.0
-1
Check if the line of the last move is completed
function checkLine(board, y, player){ if(board[0][y] == player && board[1][y] == player && board[2][y] == player) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lookForCompletedLines()\n\t{\n\t\tvar g = grid, nr = self.numRows, nc = self.numColumns, line;\n\t\tvar completedLines = [];\n\t\tfor(var r = nr; r-->0;)\n\t\t{\n\t\t\tline = true;\n\t\t\tfor(var c = nc; c-->0;)\n\t\t\t{\n\t\t\t\tif(!g[r][c])\n\t\t\t\t{\n\t\t\t\t\tline = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(line)\n\t\t\t\tcompletedLines.push(r);\n\t\t}\n\n\t\tif(completedLines.length > 0)\n\t\t\tprocessCompleteLines(completedLines,g);\n\t\telse\n\t\t\tnewBlock();\n\t}", "moveToNextLine() {\n if (this.currentLineNb >= this.lines.length - 1) {\n return false;\n }\n this.currentLine = this.lines[++this.currentLineNb];\n return true;\n }", "unfinished() {\r\n\t\t\t\tvar ref;\r\n\t\t\t\treturn LINE_CONTINUER.test(this.chunk) || (ref = this.tag(), indexOf.call(UNFINISHED, ref) >= 0);\r\n\t\t\t}", "function checkLine () {\r\n let lineCount = 0;\r\n\r\n for ( let y = 0; y < FIELD_ROW; y++ ) {\r\n //Variable to see if a line is completed\r\n let isCompleted = true;\r\n\r\n //Check the completion\r\n for ( let x = 0; x < FIELD_COLUMN; x++ ) {\r\n //If NO block is found, it means the line is not completed yet\r\n if ( !field[y][x] ) {\r\n isCompleted = false;\r\n break;\r\n }\r\n }\r\n\r\n //Clear a completed line\r\n if ( isCompleted ) {\r\n lineCount++;\r\n\r\n for ( let newY = y; 0 < newY; newY-- ) {\r\n for ( let newX = 0; newX < FIELD_COLUMN; newX++ ) {\r\n //A new line will be updated as the upper line\r\n field[ newY ][ newX ] = field[ newY-1 ][ newX ];\r\n }\r\n }\r\n }\r\n }\r\n}", "isFinished() {\n if(this.noMoreTurns()||this.getWinner()!==null)\n return true;\n else\n return false;\n\n }", "is_finished() {\n // if last piece\n let cpt = 0;\n\n for (let x = 0; x < 6; x++) {\n for (let y = 0; y < 6; y++) {\n if (this._board[x][y] !== -1) {\n cpt++;\n }\n }\n }\n if (cpt === 0) {\n return true;\n }\n // if one player have the set of color\n for (let i = 0; i < 6; i++) {\n if (this._player_1_pieces[i] === 6) {\n return true;\n }\n if (this._player_2_pieces[i] === 6) {\n return true;\n }\n }\n return false;\n }", "isFinished (){\n\t\treturn this.status !== null && this.finishDelay < 0;\n\t}", "finished() {\n let d = p5.Vector.dist(this.pos, target.getCenter());\n if (d < this.recordDist) {\n this.recordDist = d;\n }\n if (target.contains(this.pos)) {\n this.stopped = true;\n return true;\n }\n return false;\n }", "hasStarted () {\r\n return Boolean(this._pastPos[this._pastPos.length-1])\r\n }", "function checkEnd() {\n\n if (activeIndex >= sequence.length) {\n lockBoard();\n nextRound();\n }\n}", "function checkSuccessfullEnd(){\n successfullEnd = true;\n if(moves>0) successfullEnd = false;\n if (successfullEnd) alert(\"you won!\") \n}", "function checkMove() {\n var discToMove = startPeg[startPeg.length - 1];\n var topDisc = endPeg[endPeg.length - 1];\n var moveAvailable = false;\n if (discToMove < topDisc || endPeg.length === 0) {\n moveAvailable = true;\n }\n return moveAvailable;\n }", "moveCompleted() {\n // Reset the from so we can\n this.from = null;\n\n if (this.gameOver) return;\n this.changeTurn();\n this.hideMessage();\n }", "finished() {\n return this.y > height || this.y < 0;\n }", "function updateGameFinishedState(){\n if(snake.history[0].x < 0 || snake.history[0].x >= size\n || snake.history[0].y < 0 || snake.history[0].y >= size){\n isGameFinished = true;\n }\n }", "isDone() {\n return !this.loop && this.currentFrame >= this.sprites.length;\n }", "_checkIfComplete() {\n\n\t\tif(this._matchedCards === this.rows*this.cols) {\n\n\t\t\t// Delay for the animations\n\t\t\tsetTimeout(() => {\n\n\t\t\t\talert(`You have scored ${this._score} points`);\n\n\t\t\t\tclearInterval(this._timer);\n\n\t\t\t\tthis.initGame();\n\t\t\t}, 400);\n\t\t}\n\t}", "isComplete() {\n if (!this.endTime) return false;\n if (this.now() > this.endTime) {\n return true;\n }\n else {\n return false;\n }\n \n }", "function checkIfComplete(){\n\t\tif(isComplete == false){\n\t\t\tisComplete = true;\n\t\t} else {\n\t\t\tplace = ' SEGUNDO ';\n\t\t}\n\t}", "wait_AnimationEnd() {\n if (this.tmpPiece.parabolic.end == true) {\n this.unvalidateCells();\n this.check_GameOver();\n this.check_Reset();\n this.checkSelected();\n this.locked = true;\n }\n }", "function doneDigging() {\n return gotStart && gotFinish && cellsVisited == numCells;\n }", "isSelectionOnLastLine() {\n return this.getLineIndex(this.end) >= this.lineBreaks_.length - 1;\n }", "isFinished() {\n\n return this.pairsGuessed !== this.cards.length / 2 ? false : true\n\n }", "function checkIfCompleted() {\n matchingCards++;\n\n if (matchingCards >= Math.floor(fieldSize / 2)) {\n gameCompleted = true;\n timerStop();\n gratulation();\n }\n }", "_checkTurnEnd() {\n let p0alive=false, p1alive=false;\n for (let i=0; i<9; i++) {\n p0alive = p0alive || !this.cells[i].isDead;\n p1alive = p1alive || !this.cells[i+9].isDead;\n }\n if (p0alive && p1alive) return (this.turn==20) ? \"draw\" : \"continue\";\n if (!p0alive && !p1alive) return \"draw\";\n return (p0alive) ? \"p0win\" : \"p1win\";\n }", "function movesRemaining () {\n for (var i = 0; i < state.words.length; i++) {\n if (hasMoreMoves(state.words[i])) {\n return true;\n }\n }\n state.hint = {};\n return false;\n}", "function isEnd() {\n\t\tlet flag = true;\n\t\tfor (let i = 0; i < pieceCount.length; i++) {\n\t\t\t//for each puzzle piece\n\t\t\tlet top = parseInt(pieceCount[i].style.top);\n\t\t\tlet left = parseInt(pieceCount[i].style.left);\n\t\t\tif (left != (i % 4 * PIECESIZE) || top != parseInt(i / 4) * PIECESIZE) {\n\t\t\t\t//checks if each piece matches its left and top position\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "get isEnd() {\n\t\treturn (this.state.sourcePosition >= this.state.sourceEnd);\n\t}", "isEnd() {\n return this.data.rounds.end(); \n }", "function isFinished(status) {\n var result = false;\n for (var _i = 0, terminalStates_1 = terminalStates; _i < terminalStates_1.length; _i++) {\n var terminalState = terminalStates_1[_i];\n if (longRunningOperationStatesEqual(status, terminalState)) {\n result = true;\n break;\n }\n }\n return result;\n }", "function checkLineChanged(currLine){\n if (currLine != prevLine){\n return true;\n }\n return false;\n}", "static isTutorialCompleted() {\n var _a;\n return ((_a = App.game.quests.getQuestLine('Tutorial Quests')) === null || _a === void 0 ? void 0 : _a.state()) == QuestLineState.ended;\n }", "function checkAnimationComplete(){\t\n\tvar targetName = '';\n\tfor(n=0;n<animation_arr.length;n++){\n\t\tif($.pukiAnimation[animation_arr[n].name].visible){\n\t\t\ttargetName = animation_arr[n].name;\n\t\t}\n\t}\n\t\n\tvar _currentframe = $.pukiAnimation[targetName].currentFrame;\n\tvar _lastframes = $.pukiData[targetName].getAnimation($.pukiAnimation[targetName].currentAnimation).frames;\n\t_lastframes = _lastframes[_lastframes.length-1];\n\t\n\tif(_currentframe == _lastframes){\n\t\treturn true;\t\n\t}else{\n\t\treturn false;\t\n\t}\n}", "isFinished() {\n // after the first player third move, checks if anybody wan the game\n if(this.moves >= 5) {\n let i, j;\n\n // check rows\n for(i = 0; i < 6; i = i + 3) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + 1] && this.board[i + 1] == this.board[i + 2]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n // check cols\n for(i = 0; i <= 2; i ++) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + 3] && this.board[i + 3] == this.board[i + 6]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n // check diagonals\n for(i = 0, j = 4; i <= 2; i = i + 2, j = j - 2) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + j] && this.board[i + j] == this.board[i + 2*j]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n if(this.moves === 9) {\n this.updatePlayerScore(this.result = {\n status: 'draw'\n });\n return true;\n }\n }\n\n // if there is not winner, the game is still running and the next player shoul move\n this.result = {status: 'running'};\n\n return false;\n }", "isLastStep() {\n return this.wizardSteps.length > 0 && this.currentStepIndex === this.wizardSteps.length - 1;\n }", "gameIsFinished() {\n return this.rows[0].some(\n cell => cell.filled \n );\n }", "checkComplete() {\n let result = true;\n for (let i = 0; i < this.solution.length; i++) {\n result = result && this.solution[i] === this.inputGates[i];\n }\n let oldComplete = this.complete;\n this.complete = result;\n if ((this.complete !== oldComplete) && this.complete) {\n bing.play();\n }\n }", "function is_complete(text) {\n return !(text.length >= eol.length && text.substring(text.length - eol.length, text.length) == eol);\n}", "function isuserFinishedEnteringAprobar(){\n return !isScannerInputAprobar() && userFinishedEnteringAprobar;\n }", "function IsForwardComplete(x, y, sh, sp) {\n return x === settings.endX && y === settings.endY && sh === settings.endBlur && sp === settings.endSpread;\n }", "function completed() {\n var counter = 1;\n for(var row = 0; row < puzzle.length; row++) {\n for(var col = 0; col < puzzle[row].length; col++) {\n if(puzzle[row][col] == counter) counter++;\n else if (puzzle[row][col] == 0 && row == puzzleSize - 1 && col == puzzleSize - 1) return true;\n else return false;\n }\n }\n return false;\n}", "checkCompletedBoard(){\n let totalSquares = board.columnCount * board.rowCount;\n let dustedSquaresCount = 0;\n for(let checkColumn=0; checkColumn<board.columnCount; checkColumn++) {\n for(let checkRow=0; checkRow<board.rowCount; checkRow++) {\n let s = board.squares[checkColumn][checkRow];\n if (board.squares[checkColumn][checkRow].dusted===1) {\n dustedSquaresCount++;\n }\n }\n }\n if (dustedSquaresCount===totalSquares){\n level.boardFinished();\n }\n }", "_readUntilNextTarget() {\r\n this._lines.forEach((line,index) => {\r\n if(ParseUtil.isTargetLine(line)\r\n && ParseUtil.doesLineContainsTarget(line,this._nextTarget)) {\r\n this._currentLine = index;\r\n this._readNextLine();\r\n }\r\n });\r\n }", "lastMoviePlay()\n {\n return (this.currentMoviePlay == this.playsCoords.length - 1);\n }", "hasMoveBeenPlayed(x, y){\n let playedMove = this.moveList.filter( (move) => { return (move.X === x && move.Y === y); })\n return playedMove.length === 1; //Then the move has been played.\n }", "function isFinished(word, display, left) {\r\n \r\n if (word == display) return 'finished';\r\n \r\n else if (left == 0) return 'lose';\r\n \r\n else return 'continue';\r\n\r\n}", "function isUserFinishedEntering(){\n return !isScannerInput() && userFinishedEntering;\n }", "function isUserFinishedEntering(){\n return !isScannerInput() && userFinishedEntering;\n }", "function isUserFinishedEntering(){\n return !isScannerInput() && userFinishedEntering;\n }", "function isDone(self) {\n return Ex.fold_(self.exit, _ => O.isNone(C.flipCauseOption(_)), _ => false);\n}", "hasMoved() {\n return (this.color === Color.WHITE && this.row !== 6)\n || (this.color === Color.BLACK && this.row !== 1);\n }", "function checkIfComplete() {\r\n if(isComplete == false) { //here no car has won yet\r\n isComplete = true; //a car won either car1 or car2\r\n }\r\n else {\r\n place = 'second';\r\n }\r\n }", "function checkSucess() {\n setTimeout(function() {\n var lastOperation = readerOperations.pop();\n\n if (answered && authenticated && lastOperation === 'previousMenu') {\n done();\n } else {\n checkSucess();\n }\n }, asyncDelay);\n }", "function checkFinish()\r\n {\r\n player = currentPlayer();\r\n\r\n if(completeRow = isRowComplete(player))\r\n {\r\n highlightWinningCells(_ROW, completeRow);\r\n }\r\n\r\n if(completeCol = isColumnComplete(player))\r\n {\r\n highlightWinningCells(_COL, completeCol);\r\n }\r\n\r\n if(completeDiagonal_1 = isDiagonalComplete(player, _FIRST_DIAGONAL))\r\n {\r\n highlightWinningCells(_DIAGONAL, completeDiagonal_1);\r\n }\r\n\r\n if(completeDiagonal_2 = isDiagonalComplete(player, _SECOND_DIAGONAL))\r\n {\r\n highlightWinningCells(_DIAGONAL, completeDiagonal_2);\r\n }\r\n\r\n if( completeRow || completeCol || completeDiagonal_1 || completeDiagonal_2 )\r\n {\r\n congratulate(player);\r\n finalize();\r\n\r\n // It returns the player number just in case in the next extensions of the program, we decide to store the players' scores.\r\n // Otherwise, simply return suffices.\r\n return player;\r\n }\r\n\r\n // The following will be executed only if there is no winner (based on the result of the code above).\r\n if(isTableFull())\r\n {\r\n congratulate(_BOTH);\r\n finalize();\r\n return _BOTH;\r\n }\r\n\r\n return 0;\r\n }", "isComplete() {\n for (let i = 0; i < this.rounds.length; i++) {\n for (let j = 0; j < this.rounds[i].length; j++) {\n if (this.rounds[i][j] == \"\") {\n return false;\n }\n }\n }\n return true;\n }", "isCompleted(wizardStep) {\n return wizardStep instanceof WizardCompletionStep && this.wizard.completed;\n }", "isCompleted(wizardStep) {\n return wizardStep instanceof WizardCompletionStep && this.wizard.completed;\n }", "_onMoveEnd() {\n\t\tif (this._polyline !== null && this._polyline.getElement() !== undefined && this._path !== null) {\n\t\t\tthis._polyline.getElement().style.visibility = \"\";\n\t\t\tthis._polyline.getElement().classList.remove(\"disabled\");\n\t\t}\n\t}", "isMoveStraight(args){\n if ((args[0] - args[1] == this.basicMoveObj.y) && (args[2] - args[3] == this.basicMoveObj.x)) {\n return true\n } else {\n return false\n }\n }", "function isCompleted() {\n return cards.length === matchedCards.length;\n}", "isComplete() {\n return this.selection != null;\n }", "isComplete() {\n return this.selection != null;\n }", "function checkMove ( moveX, moveY, newTetromino ) {\r\n //If the tetromino is simply moving along with the arrow key\r\n if ( newTetromino == undefined ) {\r\n newTetromino = tetromino;\r\n }\r\n \r\n for ( let y = 0; y < TETROMINO_SIZE; y++ ) {\r\n for ( let x = 0; x < TETROMINO_SIZE; x++ ) {\r\n\r\n if ( newTetromino[y][x] != 0 ) {\r\n let newX = tetromino_x + x + moveX;\r\n let newY = tetromino_y + y + moveY;\r\n\r\n if ( newX < 0 || newY < 0 || FIELD_COLUMN <= newX || FIELD_ROW <= newY\r\n || field[newY][newX] != 0 ) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n}", "get fullyWaiting()\n {\n return this.insert === this.end;\n }", "function checkEnd(id){\r\n let gameJson = reader.read(id).game;\r\n if(gameJson.gameState == \"Finished\")\r\n return END;\r\n}", "animationEnd() {\n if (this.movements.length !== 0) {\n this.nextMove()\n } else {\n this.orchestrator.camera.startAnimation(\"position\", 1.5, () => {\n this.orchestrator.changeState(new GameOverState(this.orchestrator))\n },\n [...this.orchestrator.camera.originalPosition],\n [\n this.orchestrator.gameboardProperties.x,\n this.orchestrator.gameboardProperties.y,\n this.orchestrator.gameboardProperties.z\n ])\n }\n\n }", "function checkSucess() {\n setTimeout(function() {\n var lastOperation = readerOperations.pop();\n\n if (answered && authenticated && lastOperation === 'replay') {\n done();\n } else {\n checkSucess();\n }\n }, asyncDelay);\n }", "end() {\n return this.ch == -1;\n }", "function levelCompleted() {\n\tcompleted = true;\n\tfor (var i=0; i<NY; i++) {\n\t\tfor (var j=0; j<NX; j++) {\n\t\t\tif (values[i][j] != levels[currentLevel][i][j]) {\n\t\t\t\tcompleted = false;\n\t\t\t}\n\t\t}\n\t}\n\treturn completed;\n}", "get isComplete() {\n return self.step.isComplete(self.annotations)\n }", "function checkNextMovement(nextPositionX, nextPositionY, rover){\n if ((nextPositionX >= 0 && nextPositionX < 10) && (nextPositionY >= 0 && nextPositionY < 10)){\n if (grid[nextPositionY][nextPositionX] === null){\n // Set null to rover's previous position\n grid[rover.y][rover.x] = null;\n // Set rover to the next position\n grid[nextPositionY][nextPositionX] = rover.name;\n rover.x = nextPositionX;\n rover.y = nextPositionY; \n pushCoordinatesToTravelLog(rover);\n } else if (grid[nextPositionY][nextPositionX] === 'stone') {\n console.log('Found a ' + grid[nextPositionY][nextPositionX] + '!');\n } else if (grid[nextPositionY][nextPositionX] === 'Rover 1' || grid[nextPositionY][nextPositionX] === 'Rover 2'){\n console.log('Found ' + grid[nextPositionY][nextPositionX] + '!');\n }\n } else {\n console.log ('Error! ' + rover.name + ' is going off the grid.'); \n }\n}", "function rowFinished(arr){\n\n\tif(arr.indexOf(0) !== -1){\n\n\t\treturn false\n\t}else{\n\n\t\treturn true\n\t}\n}", "hasFinished() {\n return this.status === 'finished';\n }", "function checkSucess() {\n setTimeout(function() {\n var lastOperation = readerOperations.pop();\n\n if (answered && authenticated && lastOperation === 'prev') {\n done();\n } else {\n checkSucess();\n }\n }, asyncDelay);\n }", "canMove(t) {\n if (this.done) return false; // turn used up\n // if (this.moves < 1) return false; // not enuf moves left\n return this.udata.terrain.charAt(t) !== \"0\";\n }", "canMove(t) {\n if (this.done) return false; // turn used up\n // if (this.moves < 1) return false; // not enuf moves left\n return this.udata.terrain.charAt(t) !== \"0\";\n }", "finished() {\n const target = Game.getObjectById(this.params.targetId);\n if (target.hits <= 0) {\n return true;\n }\n }", "function is_finished(curr_song, num_songs) {\n\t\treturn curr_song >= num_songs ? true : false;\n\t}", "function checkSucess() {\n setTimeout(function() {\n var lastOperation = readerOperations.pop();\n\n if (answered && authenticated && lastOperation === 'next') {\n done();\n } else {\n checkSucess();\n }\n }, asyncDelay);\n }", "hasNext() {\n return this.state.offset > 0 && this.state.history.length > 1;\n }", "function checkLines() {\n for (var y = 0; y < dimention[1]; y++) {\n var lineComplete = field[y].every(function(cell, x) {\n return field[y][x] === field[y][(x + 1) % dimention[0]];\n });\n // ..and if so, blow the line up\n if (lineComplete) {\n if (debug) { Render.drawState(field); debugger; }\n for (var x = 0; x < dimention[0]; x++) {\n field[y][x] = Render.isNeutral(x, y) ? 0 : -field[y][x];\n }\n if (debug) { Render.drawState(field); debugger; }\n // ..and make all top blocks fall\n if (dir === 1) { // ..down\n for (var row = y - 1; row >= 0; row--) {\n moveLineDown(row);\n }\n } else { // ..up\n for (var row = y + 1; row < dimention[1]; row++) {\n moveLineDown(row);\n }\n }\n if (debug) { Render.drawState(field); debugger; }\n }\n }\n }", "function checkLines(lines) {\n var collapsedLines = [];\n for (var j = 0; j < lines.length; j++) {\n var sum = lineSum(lines[j]);\n // A line is completed if all the cells of that line are marked as occupied\n if (sum == (numBlocksX * occupiedValue)) { // the line is full\n updateScore();\n collapsedLines.push(lines[j]);\n Game.radio.playSound(Game.radio.winSound);\n cleanLine(lines[j]);\n }\n }\n if (collapsedLines.length) {\n collapse(collapsedLines);\n }\n}", "function checkSucess() {\n setTimeout(function() {\n var lastOperation = readerOperations.pop();\n\n if (answered && authenticated && lastOperation === 'repeatMenu') {\n done();\n } else {\n checkSucess();\n }\n }, asyncDelay);\n }", "moveNext() {\n const _ = this;\n _._assertBadState();\n try {\n switch (_._state) {\n case 0 /* Before */:\n _._yielder = _._yielder || yielder();\n _._state = 1 /* Active */;\n const initializer = _._initializer;\n if (initializer)\n initializer();\n // fall through\n case 1 /* Active */:\n if (_._tryGetNext(_._yielder)) {\n return true;\n }\n else {\n this.dispose();\n _._state = 2 /* Completed */;\n return false;\n }\n default:\n return false;\n }\n }\n catch (e) {\n this.dispose();\n _._state = 3 /* Faulted */;\n throw e;\n }\n }", "function Complete(com){\r\n\t\tvar done = false;\r\n\t\ttop = 0;\r\n\t\tleft = 0;\r\n\r\n\t\tfor(var x = 0; x<pieces.length;x++){ \r\n\t\t\tif (com[x].style.left == left && com[x].style.top == top){\r\n\t\t\t\tdone = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdone = false;\r\n\t\t\t} \r\n\t\t\t\r\n\t\t}\r\n\r\n\t}//end of Complete() ", "function isMoveValid(fromTube,candidateTube){\n if (fromTube.length == 0 || candidateTube.length == 4) return false\n numFirstColor = fromTube.filter(x => x == fromTube[fromTube.length-1]).length\n if (numFirstColor == 4) return false\n if(candidateTube.length == 0){\n if (numFirstColor == fromTube.length) return false\n return true\n }\n return fromTube[0]===candidateTube[0]\n\n}", "isStatusReady () {\r\n return this._pastPos[0] !== undefined\r\n }", "function isDone() {\n return state === states.done;\n }", "function isThereNextStep() {\n\tif ((recipe[(next_step + 1)]) == undefined) {\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\t\n}", "function checkIfCompleted() {\n if (_progress > 102) {\n _recording = false;\n $(\"#overLayMessage\").text(\"YOU CREATED A LEVEL\");\n $(\"#recordButt\").css(\"visibility\", \"hidden\");\n $(\"#restartButt2\").css(\"display\", \"block\");\n $(\"#saveButt\").css(\"display\", \"block\");\n console.log(_keyStrokes.length);\n }\n }", "function finish()\r\n\r\n{\r\n\tvar flag = true;\r\n\r\n\tfor (var i = 0; i < gamePiece.length; i++) \r\n\t{\r\n\r\n\t\tvar top = parseInt(gamePiece[i].style.top);\r\n\t\tvar left = parseInt(gamePiece[i].style.left);\r\n\r\n\t\tif (left != (i%4*100) || top != parseInt(i/4)*100) \r\n\r\n\t\t{\r\n\t\t\tflag = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn flag;\r\n}", "function checkDoneAction(){\n db.game.findOne({\"game_id\": clientSocket.gameRoom},function(err,doc){\n var done = true;\n var playerArray = doc.player_list;\n playerArray.forEach(function(player){\n if(player.finishedAction === false){\n done = false;\n }\n });\n\n if(done){\n return true;\n }\n return false;\n });\n }", "function ifComplete() {\r\n\t\t\t\t\tif (isFinished == false) {\r\n\t\t\t\t\t\tisFinished = true;\r\n\r\n\t\t\t\t\t\t// show the flag animation when a car reaches the finish line\r\n\t\t\t\t\t\tfinishedImage.attr('src', 'Assets/img/finish.gif');\r\n\r\n\t\t\t\t\t\t// add a background shadow effect while the flag animation is on\r\n\t\t\t\t\t\t$('#raceTrack').addClass('shadow');\r\n\r\n\t\t\t\t\t\t// timeout function for removal of flag animation and enable the buttons\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\r\n\t\t\t\t\t\t\t// remove flag animation and background shadow\r\n\t\t\t\t\t\t\tfinishedImage.attr('src', '');\r\n\t\t\t\t\t\t\t$('#raceTrack').removeClass('shadow');\r\n\r\n\t\t\t\t\t\t\t// set buttons to enable when the animation and race finish\r\n\t\t\t\t\t\t\traceBtn.prop(\"disabled\", false);\r\n\t\t\t\t\t\t\trestartBtn.prop(\"disabled\", false);\r\n\t\t\t\t\t\t}, 3500);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfinishedIn = 'second';\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function goalLinesClose()\n{\n goalLineDifference = goalLineDifference - 1;\n}", "checkPassant(board, target_pos, pos, last_move){\n\t\treturn false;\n\t}", "if (move.endsWith(\"'\")) {\n // three turns\n completedRotation = -NINETY_DEGREES;\n }", "function robotsIsFinished()\n {\n for (var each in ROBOTS)\n {\n if (ROBOTS[each]['status']!='Finished')\n return false;\n return true;\n }\n }", "moveon () {\n\t\twhile( this.is(\" \\t\\n\") && this.read() ) {}\n\t}", "lookForCompleteRowsAndDelete() {\n var y\n var x\n var rowToDelete = -1\n for(y = Y_SPACES - 1; y >= 0; y--) {\n var totalInRow = 0\n for(x = 0; x < X_SPACES; x++) {\n if (this.board[y][x].tetrinoPiece) {\n totalInRow += 1\n }\n }\n if (totalInRow == X_SPACES) {\n rowToDelete = y\n break\n }\n }\n\n // Delete this row!\n if (rowToDelete >= 0) {\n for(x = 0; x < X_SPACES; x++) {\n this.board[rowToDelete][x] = new Piece(30, 30, 30, false)\n }\n this.moveRow = rowToDelete\n this.gamePaused = true\n return\n }\n this.gamePaused = false\n this.moveRow = -1\n\n }" ]
[ "0.69208527", "0.6578727", "0.6574955", "0.65201783", "0.64349455", "0.6395678", "0.6321027", "0.63072926", "0.6241137", "0.6221219", "0.6204334", "0.6193741", "0.6146206", "0.61393154", "0.6130795", "0.6115773", "0.6081474", "0.6079193", "0.60728246", "0.6048432", "0.60403", "0.6038506", "0.6021111", "0.60050106", "0.6000729", "0.59813553", "0.5972534", "0.59631807", "0.59631807", "0.5943898", "0.59181064", "0.5912614", "0.59004515", "0.5884473", "0.5872337", "0.5857391", "0.584388", "0.58373606", "0.5834493", "0.58073795", "0.58069235", "0.58041656", "0.5790727", "0.5786262", "0.5778821", "0.57778066", "0.5772024", "0.5757406", "0.57548547", "0.57548547", "0.57508034", "0.57484853", "0.5734849", "0.57245624", "0.5702927", "0.5693173", "0.5691082", "0.56881785", "0.56881785", "0.5670414", "0.56692934", "0.5658024", "0.5652433", "0.5652433", "0.5649947", "0.56456566", "0.5644689", "0.5642381", "0.56390357", "0.5630187", "0.5629985", "0.56293523", "0.56277376", "0.5618082", "0.5608267", "0.5606595", "0.56048113", "0.56048113", "0.5603577", "0.5600766", "0.559489", "0.5574479", "0.55640936", "0.55603796", "0.5559553", "0.5557593", "0.55553246", "0.55492187", "0.55468374", "0.55431104", "0.5534217", "0.55311364", "0.55299884", "0.55202645", "0.5516768", "0.55161625", "0.5508966", "0.55048805", "0.55035204", "0.54983634", "0.54950345" ]
0.0
-1
Check if the diagonal of the last move is completed
function checkDiag(board, player){ if(board[0][0] == player && board[1][1] == player && board[1][1] == player){ return true; } if(board[0][2] == player && board[1][1] == player && board[2][0] == player){ return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isWinningMove() {\n var hori = count(0, -1) + count(0, 1) - 1;\n var vert = count(-1, 0) + count(1, 0) - 1;\n var diag = count(1, -1) + count(-1, 1) - 1;\n var antd = count(1, 1) + count(-1, -1) - 1;\n // console.log(\"horizontal: \" + hori);\n // console.log(\"vertical: \" + vert);\n // console.log(\"diagonal: \" + diag);\n // console.log(\"anti-diagonal: \" + antd);\n if (hori >=4 | vert >= 4 | diag >= 4 | antd >= 4) {\n return true;\n }\n else return false;\n }", "checkCompletedBoard(){\n let totalSquares = board.columnCount * board.rowCount;\n let dustedSquaresCount = 0;\n for(let checkColumn=0; checkColumn<board.columnCount; checkColumn++) {\n for(let checkRow=0; checkRow<board.rowCount; checkRow++) {\n let s = board.squares[checkColumn][checkRow];\n if (board.squares[checkColumn][checkRow].dusted===1) {\n dustedSquaresCount++;\n }\n }\n }\n if (dustedSquaresCount===totalSquares){\n level.boardFinished();\n }\n }", "function checkWiningDiagonalMove(p) {\n //0,4,8 2,4,6\n var ret = false;\n var d1 = _matrix[0][0] + _matrix[1][1] + _matrix[2][2];\n var d2 = _matrix[0][2] + _matrix[1][1] + _matrix[2][0];\n\n if ( d1 === p.repeat(3) || d2 === p.repeat(3) ) ret = true;\n\n return ret;\n }", "isFinished() {\n // after the first player third move, checks if anybody wan the game\n if(this.moves >= 5) {\n let i, j;\n\n // check rows\n for(i = 0; i < 6; i = i + 3) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + 1] && this.board[i + 1] == this.board[i + 2]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n // check cols\n for(i = 0; i <= 2; i ++) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + 3] && this.board[i + 3] == this.board[i + 6]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n // check diagonals\n for(i = 0, j = 4; i <= 2; i = i + 2, j = j - 2) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + j] && this.board[i + j] == this.board[i + 2*j]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n if(this.moves === 9) {\n this.updatePlayerScore(this.result = {\n status: 'draw'\n });\n return true;\n }\n }\n\n // if there is not winner, the game is still running and the next player shoul move\n this.result = {status: 'running'};\n\n return false;\n }", "function completed() {\n var counter = 1;\n for(var row = 0; row < puzzle.length; row++) {\n for(var col = 0; col < puzzle[row].length; col++) {\n if(puzzle[row][col] == counter) counter++;\n else if (puzzle[row][col] == 0 && row == puzzleSize - 1 && col == puzzleSize - 1) return true;\n else return false;\n }\n }\n return false;\n}", "is_finished() {\n // if last piece\n let cpt = 0;\n\n for (let x = 0; x < 6; x++) {\n for (let y = 0; y < 6; y++) {\n if (this._board[x][y] !== -1) {\n cpt++;\n }\n }\n }\n if (cpt === 0) {\n return true;\n }\n // if one player have the set of color\n for (let i = 0; i < 6; i++) {\n if (this._player_1_pieces[i] === 6) {\n return true;\n }\n if (this._player_2_pieces[i] === 6) {\n return true;\n }\n }\n return false;\n }", "function checkDiagonalDownRight() {\n for (let rowIndex = 0; rowIndex < config.edgeY; rowIndex++) {\n for (let columnIndex = 0; columnIndex < config.edgeX; columnIndex++) {\n cell = gameBoard[rowIndex][columnIndex];\n if (cell !== 0) {\n if (cell === gameBoard[rowIndex + 1][columnIndex + 1] && cell === gameBoard[rowIndex + 2][columnIndex + 2] && cell === gameBoard[rowIndex + 3][columnIndex + 3]) {\n return true\n }\n }\n }\n }\n}", "function isFinished(board, row, col, c){\n for(var i = 0; i < 9; i++) {\n if (board[row][col] == \"\") return false;\n if(board[i][col] != \"\" && board[i][col] == c && i != row) return false; //check row\n if(board[row][i] != \"\" && board[row][i] == c && i != col) return false; //check column\n if(board[3 * Math.floor(row / 3) + Math.floor(i / 3)][ 3 * Math.floor(col / 3) + Math.floor(i % 3)] != \"\" && \nboard[3 * Math.floor(row / 3) + Math.floor(i / 3)][3 * Math.floor(col / 3) + Math.floor(i % 3)] == c && \n((3 * Math.floor(row / 3) + Math.floor(i / 3)) != row && (3 * Math.floor(col / 3) + Math.floor(i % 3)) != col)) return false; //check 3*3 block\n }\n return true;\n}", "function isDiagonalComplete(player, diagonalType)\r\n {\r\n switch (diagonalType)\r\n {\r\n // It detects if the current player has made the complete diagonal which resembles the character \\\r\n case _FIRST_DIAGONAL:\r\n if(cellValue(0, 0) == player && cellValue(1, 1) == player && cellValue(2, 2) == player)\r\n {\r\n return _FIRST_DIAGONAL;\r\n }\r\n break;\r\n\r\n // It detects if the current player has made the complete diagonal which resembles the character /\r\n case _SECOND_DIAGONAL:\r\n if(cellValue(2, 0) == player && cellValue(1, 1) == player && cellValue(0, 2) == player)\r\n {\r\n return _SECOND_DIAGONAL;\r\n }\r\n break;\r\n }\r\n\r\n return 0;\r\n }", "function checkDiagonal(board) {\r\n return board[1][1] && (board[0][0] && board[2][2] || board[2][0] && board[0][2]);\r\n }", "function checkDiagonal(board) {\n if (board[0] === board[4] && board[0] === board[8] && board[0] != 0) {\n return true;\n } else if (board[2] === board[4] && board[2] === board[6] && board[2] != 0) {\n return true;\n } else {\n return false;\n }\n}", "function checkDiagUp(){\n let cell=table.rows[0].cells[0];\n for(let i=3; i<6; i++)\n {\n for(let j=3; j<7; j++)\n {\n cell=table.rows[i].cells[j];\n\n if(playerRed==true)\n {\n if(cell.isRed && table.rows[i-1].cells[j-1].isRed && table.rows[i-2].cells[j-2].isRed && table.rows[i-3].cells[j-3].isRed)\n {\n return(true);\n }\n }\n else\n {\n if(cell.isYellow && table.rows[i-1].cells[j-1].isYellow && table.rows[i-2].cells[j-2].isYellow && table.rows[i-3].cells[j-3].isYellow)\n {\n return(true);\n }\n }\n\n }\n }\n return(false);\n}", "function checkWinRightDiag()\n{\n\tlet rows = [3,4,5,5,5,5];\n\tlet cols = [0,0,0,1,2,3];\n\t\n\tfor(let i = 0; i < 6; i++)\n\t{\n\t\tlet curRow = rows[i];\n\t\tlet curCol = cols[i];\n\t\tlet currentChip = allChips[curCol][curRow];\n\t\tlet line = 0;\n\t\twhile(curRow > 0 && curCol < 6)\n\t\t{\n\t\t\tif(currentChip == allChips[curCol+1][curRow-1] && currentChip != 0)\n\t\t\t{\n\t\t\t\tline++\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tline = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif(line >= 3)\n\t\t\t{\n\t\t\t\twinner = currentChip;\n\t\t\t\treturn(true);\n\t\t\t}\n\t\t\tcurRow--;\n\t\t\tcurCol++;\n\t\t\tcurrentChip = allChips[curCol][curRow];\n\t\t}\n\t}\n\treturn(false);\n\t\n}", "function hasMoves() {\n for (var x = 0; x < cols; ++x) {\n for (var y = 0; y < cols; ++y) {\n if (canJewelMove(x, y)) {\n return true;\n }\n }\n }\n\n return false;\n }", "_checkTurnEnd() {\n let p0alive=false, p1alive=false;\n for (let i=0; i<9; i++) {\n p0alive = p0alive || !this.cells[i].isDead;\n p1alive = p1alive || !this.cells[i+9].isDead;\n }\n if (p0alive && p1alive) return (this.turn==20) ? \"draw\" : \"continue\";\n if (!p0alive && !p1alive) return \"draw\";\n return (p0alive) ? \"p0win\" : \"p1win\";\n }", "function checkFinish()\r\n {\r\n player = currentPlayer();\r\n\r\n if(completeRow = isRowComplete(player))\r\n {\r\n highlightWinningCells(_ROW, completeRow);\r\n }\r\n\r\n if(completeCol = isColumnComplete(player))\r\n {\r\n highlightWinningCells(_COL, completeCol);\r\n }\r\n\r\n if(completeDiagonal_1 = isDiagonalComplete(player, _FIRST_DIAGONAL))\r\n {\r\n highlightWinningCells(_DIAGONAL, completeDiagonal_1);\r\n }\r\n\r\n if(completeDiagonal_2 = isDiagonalComplete(player, _SECOND_DIAGONAL))\r\n {\r\n highlightWinningCells(_DIAGONAL, completeDiagonal_2);\r\n }\r\n\r\n if( completeRow || completeCol || completeDiagonal_1 || completeDiagonal_2 )\r\n {\r\n congratulate(player);\r\n finalize();\r\n\r\n // It returns the player number just in case in the next extensions of the program, we decide to store the players' scores.\r\n // Otherwise, simply return suffices.\r\n return player;\r\n }\r\n\r\n // The following will be executed only if there is no winner (based on the result of the code above).\r\n if(isTableFull())\r\n {\r\n congratulate(_BOTH);\r\n finalize();\r\n return _BOTH;\r\n }\r\n\r\n return 0;\r\n }", "hasMoved() {\n return (this.color === Color.WHITE && this.row !== 6)\n || (this.color === Color.BLACK && this.row !== 1);\n }", "function _checkMoves() {\n\t\t\n\t\t// iterate through the rows\n\t\tfor(row = 0; row < _rows; row++) {\n\t\t\t\n\t\t\t// iterate through the cols\n\t\t\tfor (col = 0; col < _cols; col++) {\n\t\t\t\t\n\t\t\t\t// check top and bottom\n\t\t\t\tif(row - 1 >= 0 && typeof _board[row - 1][col] !== \"undefined\"\n\t\t\t\t && row + 1 < _rows && typeof _board[row + 1][col] !== \"undefined\"){\n\t\t\t\t\t\n\t\t\t\t\tif(_board[row - 1][col] === _board[row][col] && _board[row + 1][col] === _board[row][col]) {\n\t\t\t\t\t\t_winnerFound = true;\n\t\t\t\t\t\t_winner = _board[row][col];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// check left and right\n\t\t\t\tif(col - 1 >= 0 && typeof _board[row][col - 1] !== \"undefined\"\n\t\t\t\t && col + 1 < _cols && typeof _board[row][col + 1] !== \"undefined\"){\n\t\t\t\t\t\n\t\t\t\t\tif(_board[row][col - 1] === _board[row][col] && _board[row][col + 1] === _board[row][col]) {\n\t\t\t\t\t\t_winnerFound = true;\n\t\t\t\t\t\t_winner = _board[row][col];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// check diagonals\n\t\t\t\tif(col - 1 >= 0 && col + 1 < _cols && row - 1 >= 0 && row + 1 < _rows){\n\n\t\t\t\t\tif(typeof _board[row - 1][col - 1] !== \"undefined\"\n\t\t\t\t\t && typeof _board[row + 1][col + 1] !== \"undefined\"\n\t\t\t\t\t && _board[row - 1][col - 1] === _board[row][col] \n\t\t\t\t\t && _board[row + 1][col + 1] === _board[row][col]) {\n\t\t\t\t\t\t_winnerFound = true;\n\t\t\t\t\t\t_winner = _board[row][col];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if(typeof _board[row - 1][col + 1] !== \"undefined\"\n\t\t\t\t\t && typeof _board[row + 1][col - 1] !== \"undefined\"\n\t\t\t\t\t && _board[row - 1][col + 1] === _board[row][col] \n\t\t\t\t\t\t&& _board[row + 1][col - 1] === _board[row][col]) {\n\t\t\t\t\t\t_winnerFound = true;\n\t\t\t\t\t\t_winner = _board[row][col];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if winner was found, then break out of loop\n\t\t\tif(_winnerFound) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "descendingDiagonalCheck() {\n for (let i = 3; i < this._ROW; i++) {\n for (let j = 3; j < this._COLUMN; j++) {\n this._cellValue = this._grid[i][j];\n if (this._cellValue.color == COLOR.WHITE) {\n this._draw = false;\n }\n if (this._cellValue.color != COLOR.WHITE &&\n this._grid[i - 1][j - 1].color == this._cellValue.color &&\n this._grid[i - 2][j - 2].color == this._cellValue.color &&\n this._grid[i - 3][j - 3].color == this._cellValue.color) {\n /**\n * Descending diagonal check pass\n */\n this._i = i;\n this._j = j;\n this._WIN_X = -1;\n this._WIN_Y = -1;\n return true;\n }\n }\n }\n return false;\n }", "function checkDiagonalWin(playedDisc, column, y) {\n if (settings.xAxis - column > 4) {\n // check right\n if (y+1 <= 4) {\n // check up\n for ( var i = 0; i < 4; i++){\n if(isWin(board[column+i][y+i], playedDisc, i)) { \n return true;\n }\n }\n } else {\n // check down\n for ( var i = 0; i < 4; i++){\n if(isWin(board[column+i][y-i], playedDisc, i)) { \n return true;\n }\n }\n }\n } else {\n // check left\n if (y+1 <= 4) {\n // check up\n var count = 0;\n if (column + 4 <= 7) {\n for ( var i = column + 4 ; i > 0; i--){\n if(isWin(board[i][count], playedDisc, count)) {\n return true;\n }\n count++;\n }\n }\n } else {\n // check down\n var count = 0;\n for ( var i = column ; i > 0; i--){\n if(isWin(board[i][y-count], playedDisc, count)) {\n return true;\n }\n count++;\n } \n }\n }\n \n \n return false;\n }", "function checkDiagonalFours() {\n var connectCount = 1,\n continueLeft = true,\n continueRight = true,\n result = {\n hasFours: false,\n elems: []\n };\n\n result.elems.push($boardRowCollection.eq(currentRow).find(\".board-cell:eq(\"+currentCol+\")\"));\n\n for (a=1; a<4; a++) {\n if ((currentRow-a)>=0 && (currentCol-a)>=0 && continueLeft) {\n if (connectCount < 4\n && boardArray[currentRow-a][currentCol-a] != 0\n && boardArray[currentRow-a][currentCol-a] == boardArray[currentRow][currentCol]) {\n connectCount++;\n result.elems.push($boardRowCollection.eq((currentRow-a)).find(\".board-cell:eq(\"+(currentCol-a)+\")\"));\n } else {\n continueLeft = false;\n }\n }\n if ((currentRow+a)<6 && (currentCol+a)<7 && continueRight) {\n if (connectCount < 4\n && boardArray[currentRow+a][currentCol+a] != 0\n && boardArray[currentRow+a][currentCol+a] == boardArray[currentRow][currentCol]) {\n connectCount++;\n result.elems.push($boardRowCollection.eq((currentRow+a)).find(\".board-cell:eq(\"+(currentCol+a)+\")\"));\n } else {\n continueRight = false;\n }\n }\n\n if (connectCount == 4) {\n result.hasFours = true;\n return result;\n }\n }\n\n connectCount = 1;\n continueLeft = true;\n continueRight = true;\n result.elems.length = 0;\n result.elems.push($boardRowCollection.eq(currentRow).find(\".board-cell:eq(\"+currentCol+\")\"));\n\n for (a=1; a<4; a++) {\n if ((currentRow-a)>=0 && (currentCol+a)<7 && continueRight) {\n if (connectCount < 4\n && boardArray[currentRow-a][currentCol+a] != 0\n && boardArray[currentRow-a][currentCol+a] == boardArray[currentRow][currentCol]) {\n connectCount++;\n result.elems.push($boardRowCollection.eq((currentRow-a)).find(\".board-cell:eq(\"+(currentCol+a)+\")\"));\n } else {\n continueRight = false;\n }\n }\n if ((currentRow+a)<6 && (currentCol-a)>=0 && continueLeft) {\n if (connectCount < 4\n && boardArray[currentRow+a][currentCol-a] != 0\n && boardArray[currentRow+a][currentCol-a] == boardArray[currentRow][currentCol]) {\n connectCount++;\n result.elems.push($boardRowCollection.eq((currentRow+a)).find(\".board-cell:eq(\"+(currentCol-a)+\")\"));\n } else {\n continueLeft = false;\n }\n }\n if (connectCount == 4) {\n result.hasFours = true;\n return result;\n }\n }\n\n result.elems = null;\n return result;\n }", "function checkDiag(curArray, posArray) {\n for (var iter = 0; iter < curArray.length; iter++) {\n for (var i = 0; i < posArray.length; i++) {\n if (\n ((posArray[i][0] === curArray[iter][0] + 1) &&\n (posArray[i][1] === curArray[iter][1] - 1)) ||\n ((posArray[i][0] === curArray[iter][0] - 1) &&\n (posArray[i][1] === curArray[iter][1] + 1)) ||\n ((posArray[i][0] === curArray[iter][0] - 1) &&\n (posArray[i][1] === curArray[iter][1] - 1)) ||\n ((posArray[i][0] === curArray[iter][0] + 1) &&\n (posArray[i][1] === curArray[iter][1] + 1))\n ) {\n\n return true;\n }\n }\n }\n\n return false;\n\n}", "function checkMove() {\n var discToMove = startPeg[startPeg.length - 1];\n var topDisc = endPeg[endPeg.length - 1];\n var moveAvailable = false;\n if (discToMove < topDisc || endPeg.length === 0) {\n moveAvailable = true;\n }\n return moveAvailable;\n }", "isFinished() {\n if(this.noMoreTurns()||this.getWinner()!==null)\n return true;\n else\n return false;\n\n }", "function checkDiagonalFromRightToLeft(){\n for (let i = gameSize-1; i >=0; i--) {\n let array = [i + 1];\n let iCounter = i;\n for (let j = 0; j <=i; j++ ) {\n array[j] = gameField[iCounter][j];\n iCounter--;\n }\n\n if (isContaineWinCombination(array, \"X\")) {\n printWinner();\n return true;\n }\n if (isContaineWinCombination(array, \"0\")) {\n printWinner();\n return true;\n }\n }\n\n for (let i = 0; i < gameSize; i++) {\n let array = [gameSize-i];\n let iCounter = i;\n for (let j = gameSize - 1; j >= i; j--) {\n array[j - i] = gameField[iCounter][j];\n iCounter++;\n }\n\n if (isContaineWinCombination(array, \"X\")) {\n printWinner();\n return true;\n }\n if (isContaineWinCombination(array, \"0\")) {\n printWinner();\n return true;\n }\n }\n\n return false;\n}", "function checkDiagDown(){\n let cell=table.rows[0].cells[0];\n for(let i=3; i<6; i++)\n {\n for(let j=0; j<4; j++)\n {\n cell=table.rows[i].cells[j];\n\n if(playerRed==true)\n {\n if(cell.isRed && table.rows[i-1].cells[j+1].isRed && table.rows[i-2].cells[j+2].isRed && table.rows[i-3].cells[j+3].isRed)\n {\n return(true);\n }\n }\n else\n {\n if(cell.isYellow && table.rows[i-1].cells[j+1].isYellow && table.rows[i-2].cells[j+2].isYellow && table.rows[i-3].cells[j+3].isYellow)\n {\n return(true);\n }\n }\n\n }\n }\n return(false);\n}", "function isSolvedFn() {\n for (var i = 0; i < board.length - 1; i++) { // i < board.length because last index 15, will have 0 (empty space)\n if (board[i] != i + 1) {\n return false;\n }\n }\n return true;\n }", "function diagonalWinCheck() {\n for(var col =0;col<5;col++) {\n for(var row=0;row<7;row++) {\n if(colorMatchCheck(returnColor(row,col),returnColor(row+1,col+1),returnColor(row+2,col+2))) {\n console.log(\"diagonal\");\n reportWin(row,col);\n return true;\n }else if(colorMatchCheck(returnColor(row,col), returnColor(row-1,col+1),returnColor(row-2,col+2))) {\n console.log(\"diagonal\");\n reportWin(row,col);\n return true;\n }else {\n continue;\n }\n }\n }\n}", "checkPassant(board, target_pos, pos, last_move){\n\t\treturn false;\n\t}", "function diagonalPathIsClear(x1, x2, y1, y2, pieceWillBeHere, pieceWillNotBeHere) {\n var direction = \"\";\n if(x1 < x2) {\n direction += \"right\";\n } else {\n direction += \"left\";\n }\n if(Number(y1) < Number(y2)) {\n direction += \"down\";\n } else {\n direction += \"up\";\n }\n switch (direction) {\n case \"rightdown\":\n return diagonalDownIsClear(x1, x2, y1, y2, pieceWillBeHere, pieceWillNotBeHere);\n break;\n case \"rightup\":\n return diagonalUpIsClear(x1, x2, y1, y2, pieceWillBeHere, pieceWillNotBeHere);\n break;\n case \"leftdown\":\n //same path as right up, switch start and end.\n return diagonalUpIsClear(x2, x1, y2, y1, pieceWillBeHere, pieceWillNotBeHere);\n break;\n case \"leftup\":\n //same path as right down, switch start and end.\n return diagonalDownIsClear(x2, x1, y2, y1, pieceWillBeHere, pieceWillNotBeHere);\n break; \n default:\n throw ({name: \"Invalid move\", message: \"This is not a valid destination.\"});\n }\n}", "checkInDiagonalTopLeftBottomRight(color){\n for(let col = 0; col < 10; col++){\n for(let row = 0; row < 10; row++)\n {\n let match = true;\n for(let i = 0; i < 5; i++)\n {\n if(color != game.board[row + i][col + i]){\n match = false;\n } \n }\n if(match){\n this.announceWinner();\n return;\n }\n }\n } \n }", "can_move(next_pos_x, next_pos_y)\n {\n if (next_pos_x < 0 || next_pos_y < 0) {\n return false;\n }\n if (next_pos_y >= (this.matrix.length)) {\n return false;\n }\n if (next_pos_x >= (this.matrix[0].length)) {\n return false;\n }\n return this.matrix[next_pos_y][next_pos_x] == 0;\n }", "gameIsFinished() {\n return this.rows[0].some(\n cell => cell.filled \n );\n }", "function checkWonDiagonal1(pos) {\n let fields = [];\n let i = 1;\n let col;\n let field = [];\n\n //above/right of pos\n while (col = container.children[pos.col + i]) {\n if (field = col.children[pos.row - i]) {\n if (field.classList.contains(player)) {\n fields.push(field);\n } else {\n break;\n }\n } else {\n break;\n }\n i++;\n }\n\n //below/left of pos\n i = 1;\n while (col = container.children[pos.col - i]) {\n if (field = col.children[pos.row + i]) {\n if (field.classList.contains(player)) {\n fields.push(field);\n } else {\n break;\n }\n } else {\n break;\n }\n i++;\n }\n\n if (fields.length >= 3) {\n return fields;\n }\n return false;\n}", "function checkWinLeftDiag()\n{\n\tlet cols = [3,4,5,6,6,6];\n\tlet rows = [5,5,5,5,4,3];\n\t\n\tfor(let i = 0; i < 6; i++)\n\t{\n\t\tlet curRow = rows[i];\n\t\tlet curCol = cols[i];\n\t\tlet currentChip = allChips[curCol][curRow];\n\t\tlet line = 0;\n\t\twhile(curRow > 0 && curCol > 0)\n\t\t{\n\t\t\tif(currentChip == allChips[curCol-1][curRow-1] && currentChip != 0)\n\t\t\t{\n\t\t\t\tline++\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tline = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif(line >= 3)\n\t\t\t{\n\t\t\t\twinner = currentChip;\n\t\t\t\treturn(true);\n\t\t\t}\n\t\t\tcurRow--;\n\t\t\tcurCol--;\n\t\t\tcurrentChip = allChips[curCol][curRow];\n\t\t}\n\t}\n\treturn(false);\n\t\n}", "function hasMoves () {\n for (var x = 0; x < cols; x++) {\n for (var y = 0; y < rows; y++) {\n if (canTileMove(x, y)) {\n return true;\n }\n }\n }\n return false;\n }", "function canMove(direction) {\n // 37 - left arrow\n // 38 - up arrow\n var a = 1,\n b = 4,\n c = 1;\n // 39 - right arrow\n // 40 - down arrow\n if (direction == 39 || direction == 40) {\n a = 2;\n b = -1;\n c = -1;\n }\n for (var i = 0; i < 4; i++) {\n for (var j = a; j != b; j += c) {\n switch (direction) {\n // when moving left or rigth, we check whether there are either free space\n // or two adjacent tiles with the same number in the same row\n case 37:\n case 39:\n if (all_numbers[i][j]) {\n if (all_numbers[i][j - c] == 0 || all_numbers[i][j] == all_numbers[i][j - c]) {\n return true;\n }\n }\n break;\n case 38:\n case 40:\n // when moving up or down, we check whether there are either free space\n // or two adjacent tiles with the same number in the same column\n if (all_numbers[j][i]) {\n if (all_numbers[j - c][i] == 0 || all_numbers[j][i] == all_numbers[j - c][i]) {\n return true;\n }\n }\n break;\n }\n }\n }\n return false;\n}", "function isMoveValid(row, columns) {\n for (let i = 0; i < row; i++) {\n if (columns[i] === columns[row]) {\n return false; // Two queens are in the same column\n }\n\n if (row - i === Math.abs(columns[row] - columns[i])) {\n return false; // Two queens are in the same diagonal\n }\n }\n\n return true;\n}", "function diagonalUpIsClear(left, right, y1, y2, pieceWillBeHere, pieceWillNotBeHere) {\n var i = (Number(y1)-1);\n left ++;\n while(i > Number(y2) && left < right) {\n var id = String.fromCharCode(left) + i;\n if(id === pieceWillNotBeHere) {\n i--;\n left++; \n continue;\n } \n if(document.getElementById(id).firstElementChild || id === pieceWillBeHere)\n return false;\n i--;\n left++; \n };\n return true;\n}", "isSolved() {\n if (this.tiles[this.tiles.length - 1] !== 0) {\n return false;\n }\n for (let i = 0; i < this.tiles.length - 1; i++) {\n if (this.tiles[i] !== i + 1) {\n return false;\n }\n }\n return true;\n }", "function checkEnd() {\n\n if (activeIndex >= sequence.length) {\n lockBoard();\n nextRound();\n }\n}", "function checkDiagonal(position){\n //for position array, we are comparing change in index with change in value\n for(var i = 0; i < position.length; i++){\n for(var j = i + 1; j < position.length; j++){\n //i is the first piece, j are the ones after\n if (j - i == Math.abs(position[j] - position[i])) {\n return false;\n }\n }\n }\n return true;\n}", "function gameFinished() {\n 'use strict';\n return othelloGrid.countDiscs(OTHELLO_CONST.empty) != 0 ? false : true;\n}", "function diagonalWin() {\n\n //if one diagonal win returns true\n if(board[0][0] == board[1][1] && board[1][1] == board[2][2] && board[0][0] != ' ' ){\n return true;\n }\n //if other diagonal win returns true\n else if( board[2][0] == board[1][1] && board[1][1] == board[0][2] && board[2][0] != ' '){\n return true;\n }\n\n}", "function isDiagonal() {\n\n /* Dirs is an list containing the Possible Directions by-default non-diagonal moves are permissble */\n /* fdirs contains the list with moves without diagonal hence update dirs with non-diagonal moves */\n dirs = fdirs;\n\n /* \n * ToggleDirs is a boolean variable which decides whether user want diagnal moves or not.\n * Each time this function is clicked this variable is switched between true and false.\n */\n toggleDirs = !toggleDirs; \n\n /* If ToggleDirs is true then do add the diagonal moves stored in the dia variable to our dirs and update the dirs */\n if (toggleDirs) {\n\n /* Concating Dirs containing non-diagonal moves with diagonal moves stores in dia variable */\n dirs = dirs.concat(dia);\n\n /* After updating also change the content to Diagonal allowed to informed the user diagonals are allowed */\n document.getElementById(\"diagonalMoves\").innerHTML = \"Diagonal Allowed\";\n } else { \n /* Otherwise also change the content to Diagonal NA to informed the user diagonals are not-allowed */\n document.getElementById(\"diagonalMoves\").innerHTML = \"Diagonal NA\";\n }\n}", "function isEnd() {\n\t\tlet flag = true;\n\t\tfor (let i = 0; i < pieceCount.length; i++) {\n\t\t\t//for each puzzle piece\n\t\t\tlet top = parseInt(pieceCount[i].style.top);\n\t\t\tlet left = parseInt(pieceCount[i].style.left);\n\t\t\tif (left != (i % 4 * PIECESIZE) || top != parseInt(i / 4) * PIECESIZE) {\n\t\t\t\t//checks if each piece matches its left and top position\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "function diagonalWinCheck() {\r\n for (var col = 0; col < 5; col++) {\r\n for (var row = 0; row < 7; row++) {\r\n if (colorMatchCheck(returnColor(row,col), returnColor(row+1,col+1) ,returnColor(row+2,col+2), returnColor(row+3,col+3))) {\r\n console.log('diag');\r\n reportWin(row,col);\r\n return true;\r\n }else if (colorMatchCheck(returnColor(row,col), returnColor(row-1,col+1) ,returnColor(row-2,col+2), returnColor(row-3,col+3))) {\r\n console.log('diag');\r\n reportWin(row,col);\r\n return true;\r\n }else {\r\n continue;\r\n }\r\n }\r\n }\r\n}", "function canMove(piece) {\n\t\tvar id = parseInt(piece.id.substring(1));\n\t\tif (id % 4 == 0) { // right column\n\t\t\treturn id - 1 == empty || id + 4 == empty || id - 4 == empty;\n\t\t} else if (id % 4 == 1) { // left column\n\t\t\treturn id + 1 == empty || id + 4 == empty || id - 4 == empty;\n\t\t} else { // middle columns\n\t\t\treturn id + 1 == empty || id - 1 == empty || id + 4 == empty || id - 4 == empty;\n\t\t}\n\t}", "checkWinner(move) \n {\n let result = false;\n if (this.checkRow(1, 2, 3, move) || \n this.checkRow(4, 5, 6, move) ||\n this.checkRow(7, 8, 9, move) ||\n this.checkRow(1, 4, 7, move) ||\n this.checkRow(2, 5, 8, move) ||\n this.checkRow(3, 6, 9, move) ||\n this.checkRow(1, 5, 9, move) ||\n this.checkRow(3, 5, 7, move)) \n {\n result = true;\n }\n\n return result;\n }", "function isLegalMove(col) {\n return stats.moveStart != null && stats.openRows[col] < 6 && stats.winner == null;\n }", "function checkDiagonal(symbol) {\n if (row1[1] == `:${symbol}:`) {\n if (row2[2] == `:${symbol}:`) {\n if (row3[3] == `:${symbol}:`) {\n return fin = symbol;\n }\n }\n }\n if (row1[3] == `:${symbol}:`) {\n if (row2[2] == `:${symbol}:`) {\n if (row3[1] == `:${symbol}:`) {\n return fin = symbol;\n }\n }\n }\n }", "function checkWonDiagonal2(pos) {\n let fields = [];\n let i = 1;\n let col;\n let field = [];\n\n //above/left of pos\n while (col = container.children[pos.col - i]) {\n if (field = col.children[pos.row - i]) {\n if (field.classList.contains(player)) {\n fields.push(field);\n } else {\n break;\n }\n } else {\n break;\n }\n i++;\n }\n\n //below/right of pos\n i = 1;\n while (col = container.children[pos.col + i]) {\n if (field = col.children[pos.row + i]) {\n if (field.classList.contains(player)) {\n fields.push(field);\n } else {\n break;\n }\n } else {\n break;\n }\n i++;\n }\n\n if (fields.length >= 3) {\n return fields;\n }\n return false;\n}", "function verifyWin() {\n let win = false;\n for (let i = 0; i < 3; i++) {\n if (board[i][0] === turn && board[i][1] === turn && board[i][2] === turn) {\n win = true;\n break;\n } else if (board[0][i] === turn && board[1][i] === turn && board[2][i] === turn) {\n win = true;\n break;\n }\n }\n // diagornal principal\n if (board[0][0] === turn && board[1][1] === turn && board[2][2] === turn) {\n win = true;\n // diagonal secundária\n } else if (board[0][2] === turn && board[1][1] === turn && board[2][0] === turn) {\n win = true;\n }\n return win;\n}", "checkDiagonalWin(color) {\n const numColumns = 7;\n let i = this.length() - 1; // index of last slot\n // check the bottom 3 rows because the bottom of a diagonal cannot start from top 3\n for (let z = 0; z < 3; z++) {\n // check right four cols for a win going diagonally up and left\n for (let j = i; j > i - 4; j--) {\n let count = 0;\n let slot = board.getSlot(j);\n const arr = [j];\n if (this.slotFilled(slot) && slot.classList.contains(color)) {\n count++;\n // check the slot in the column up and the the left\n let k = j - numColumns - 1;\n slot = board.getSlot(k);\n while(slot.dataset.col >= 0) {\n // if there is not another diagonal filled slot of this color, break\n // out of loop and check next slot in column j\n if (this.slotFilled(slot) && slot.classList.contains(color)) {\n arr.push(k);\n count++;\n } else {\n break;\n }\n if (count == 4) {\n this.boldWinningSlots(arr);\n return true;\n }\n k = k - numColumns - 1;\n slot = board.getSlot(k);\n }\n count = 0;\n }\n }\n\n // check left four cols for a win going diagonally up and right\n for (let j = i - 3; j > i - numColumns; j--) {\n let count = 0;\n let slot = board.getSlot(j);\n const arr = [j];\n if (this.slotFilled(slot) && slot.classList.contains(color)) {\n count++;\n // check the slot in the column up and the the right\n let k = j - numColumns + 1;\n slot = board.getSlot(k);\n while(slot.dataset.col >= 0) {\n // if there is not another diagonal filled slot of this color, break\n // out of loop and check next slot in column j\n if (this.slotFilled(slot) && slot.classList.contains(color)) {\n arr.push(k);\n count++;\n } else {\n break;\n }\n if (count == 4) {\n this.boldWinningSlots(arr);\n return true;\n }\n k = k - numColumns + 1;\n slot = board.getSlot(k);\n }\n count = 0;\n }\n }\n i -= numColumns;\n }\n return false;\n }", "isFinished() {\n\n return this.pairsGuessed !== this.cards.length / 2 ? false : true\n\n }", "function checkMove ( moveX, moveY, newTetromino ) {\r\n //If the tetromino is simply moving along with the arrow key\r\n if ( newTetromino == undefined ) {\r\n newTetromino = tetromino;\r\n }\r\n \r\n for ( let y = 0; y < TETROMINO_SIZE; y++ ) {\r\n for ( let x = 0; x < TETROMINO_SIZE; x++ ) {\r\n\r\n if ( newTetromino[y][x] != 0 ) {\r\n let newX = tetromino_x + x + moveX;\r\n let newY = tetromino_y + y + moveY;\r\n\r\n if ( newX < 0 || newY < 0 || FIELD_COLUMN <= newX || FIELD_ROW <= newY\r\n || field[newY][newX] != 0 ) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n}", "function checkDiagonalFromLeftToRight(){\n for (let i = 0; i < gameSize; i++) {\n let array = [i + 1];\n let iCounter = gameSize - 1 - i;\n for (let j = 0; j < i + 1; j++ ) {\n array[j] = gameField[iCounter][j];\n iCounter++;\n }\n\n if (isContaineWinCombination(array, \"X\")) {\n printWinner();\n return true;\n }\n if (isContaineWinCombination(array, \"0\")) {\n printWinner();\n return true;\n }\n }\n\n for (let i = 0; i < gameSize; i++) {\n let array = [i + 1];\n let iCounter = gameSize - 1 - i;\n for (let j = 0; j < i + 1; j++ ) {\n array[j] = gameField[j][iCounter];\n iCounter++;\n }\n\n if (isContaineWinCombination(array, \"X\")) {\n printWinner();\n return true;\n }\n if (isContaineWinCombination(array, \"0\")) {\n printWinner();\n return true;\n }\n }\n\n return false;\n}", "function diagPieces(player, cell, kingDist){\n let opponent = get_opponent(player)\n console.log(\"KinhkingDist\", kingDist)\n if (cell.piece === opponent + \"b\" || cell.piece === opponent + \"q\")\n return false\n else if ((cell.piece === opponent + \"p\" || cell.piece === opponent + \"k\") && kingDist === 1)\n return false\n else\n return true\n}", "possible_taken_piece(x, y) {\n let pt = false;\n let pl = false;\n let pr = false;\n let pb = false;\n\n if (this._board[x][y] === -1) {\n return false;\n }\n if (this._taken_color !== null && this._board[x][y] !== this._taken_color) {\n return false;\n }\n\n let cpt = 4;\n\n if (this.check_piece_top(x, y)) {\n if (this._board[x][y - 1] !== -1) {\n cpt--;\n pt = true;\n }\n }\n if (this.check_piece_left(x, y)) {\n if (this._board[x - 1][y] !== -1) {\n cpt--;\n pl = true;\n }\n }\n if (this.check_piece_right(x, y)) {\n if (this._board[x + 1][y] !== -1) {\n cpt--;\n pr = true;\n }\n }\n if (this.check_piece_bottom(x, y)) {\n if (this._board[x][y + 1] !== -1) {\n cpt--;\n pb = true;\n }\n }\n // si 2 alors vérifier si l'opposé diagonal est non-vide\n if (cpt === 2) {\n return this.check_is_split(x, y, pt, pl, pr, pb);\n }\n return (cpt >= 2);\n }", "checkInDiagonalTopRightBottomLeft(color){\n for(let col = 0; col < 15; col++){\n if(col>4){\n for(let row = 0; row < 10; row++)\n {\n let match = true;\n for(let i = 0; i < 5; i++)\n {\n if(color != game.board[row + i][col - i]){\n match = false;\n } \n }\n \n if(match){\n this.announceWinner();\n return;\n }\n }\n }\n } \n }", "function checkWiningRowMove(p) {\n //0,1,2 3,4,5 6,7,8\n var ret = false;\n var r1 = _matrix[0][0] + _matrix[0][1] + _matrix[0][2];\n var r2 = _matrix[1][0] + _matrix[1][1] + _matrix[1][2];\n var r3 = _matrix[2][0] + _matrix[2][1] + _matrix[2][2];\n\n if (r1 === p.repeat(3) || r2 === p.repeat(3) || r3 === p.repeat(3) ) ret = true;\n\n return ret;\n }", "function canJumpDiagonal(x, y, z, w){\r\n\tif(getPrevContent() !== getJumpedOverContent(x, y) &&\r\n\t\tgetJumpedOverContent(x, y) !== \"\" &&\r\n\t\tgetCurContent() === \"\" && currentCol === z\r\n\t\t&& currentRow === w && getPrevContent() === \"O\")\r\n\t{\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "can_move(start, end) {\n\t\tvar start_row = 8 - Math.floor(start / 8);\n\t\tvar start_col = (start % 8) + 1;\n\t\tvar end_row = 8 - Math.floor(end / 8);\n\t\tvar end_col = (end % 8) + 1;\n\n\t\tvar row_diff = end_row - start_row;\n\t\tvar col_diff = end_col - start_col;\n\n\t\tif (row_diff == col_diff) { //diagonale \"/\"\n\t\t return true;\n\t\t} else if (row_diff == -col_diff) { //diagonale \"\\\"\n\t\t return true;\n\t\t}\n\t\treturn false;\n\t }", "checkWinner() {\n // Check rows\n let win = false;\n\n const checkEqual = arr => arr.every(v => (v === arr[0] && v !== ''));\n console.log(\"CHECK WINNER.\");\n const board = this.state.board;\n for (let i = 0; i < this.width; i++) {\n\n for (let j = 0; j < this.height; j++) {\n\n // Check row win\n if (j <= this.height - 4) {\n //console.log(\"LINE:\" + [board[i][j+1],board[i][j+2],board[i][j+3],board[i][j]]);\n win = checkEqual([board[i][j + 1], board[i][j + 2], board[i][j + 3], board[i][j]]) ? board[i][j] : false;\n if (win !== false) break;\n }\n\n // Check line & diagonal win \n if (i <= this.width - 4) {\n //console.log(\"ROW:\" + [board[i+1][j],board[i+2][j],board[i+3][j],board[i][j]]);\n win = checkEqual([board[i + 1][j], board[i + 2][j], board[i + 3][j], board[i][j]]) ? board[i][j] : false;\n if (win !== false) break;\n\n // Check diagonal line\n if (j <= this.height - 4) {\n win = checkEqual([board[i + 1][j + 1], board[i + 2][j + 2], board[i + 3][j + 3], board[i][j]]) ? board[i][j] : false;\n //console.log(\"MAYBE WIN? \" + [board[i][j],board[i+1][j+1],board[i+2][j+2],board[i+3][j+3]] + \"LINE: \" + i + \",ROW: \" + j);\n if (win !== false) break;\n }\n }\n\n if (i <= this.width - 4 && j >= 3) {\n win = checkEqual([board[i][j], board[i + 1][j - 1], board[i + 2][j - 2], board[i + 3][j - 3]]) ? board[i][j] : false;\n //console.log(\"MAYBE WIN? \" + [board[i + 3][j - 3], board[i + 2][j - 2], board[i + 1][j - 1], board[i][j]] + \"LINE: \" + i + \",ROW: \" + j);\n if (win !== false) break;\n }\n\n\n }\n\n // Break out from second for loop\n if (win !== false) {\n break;\n }\n }\n\n if (win !== false) return win;\n return false;\n }", "function checkStep(pathState, direction) {\n const { x, y } = pathState;\n\n let newX, newY;\n switch (direction) {\n case 'U':\n newX = x;\n newY = y - 1;\n break;\n case 'D':\n newX = x;\n newY = y + 1;\n break;\n case 'L':\n newX = x - 1;\n newY = y;\n break;\n case 'R':\n newX = x + 1;\n newY = y;\n break;\n }\n\n if (\n (maze[x][y] !== 's' && isOppositeToLastStep(pathState.path, direction)) ||\n isInTheLoop(pathState.cellsVisited, newX, newY) ||\n !canGoTo(newX, newY, pathState.blocks)\n ) {\n return null;\n }\n\n return new PathCheckResult(newX, newY);\n}", "function doneDigging() {\n return gotStart && gotFinish && cellsVisited == numCells;\n }", "function checkForWinner(move) {\n\t\tvar result = false;\n\t\tif (checkRow(1,2,3, move) || \n\t\t\tcheckRow(4,5,6, move) || \n\t\t\tcheckRow(7,8,9, move) ||\n\t\t\tcheckRow(1,4,7, move) ||\n\t\t\tcheckRow(2,5,8, move) ||\n\t\t\tcheckRow(3,6,9, move) ||\n\t\t\tcheckRow(1,5,9, move) ||\n\t\t\tcheckRow(3,5,7, move)) {\n\n\t\t\tresult = true;\n\t\t}\n\t\treturn result;\n\t}", "finished() {\n let d = p5.Vector.dist(this.pos, target.getCenter());\n if (d < this.recordDist) {\n this.recordDist = d;\n }\n if (target.contains(this.pos)) {\n this.stopped = true;\n return true;\n }\n return false;\n }", "function finish()\r\n\r\n{\r\n\tvar flag = true;\r\n\r\n\tfor (var i = 0; i < gamePiece.length; i++) \r\n\t{\r\n\r\n\t\tvar top = parseInt(gamePiece[i].style.top);\r\n\t\tvar left = parseInt(gamePiece[i].style.left);\r\n\r\n\t\tif (left != (i%4*100) || top != parseInt(i/4)*100) \r\n\r\n\t\t{\r\n\t\t\tflag = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn flag;\r\n}", "function checkDiagonal(topr, midr, botr, msg){\n // Check to see if the text content (X or O) matches in diagonals\n if ((all_squares[topr].textContent == all_squares[midr].textContent) && \n (all_squares[midr].textContent == all_squares[botr].textContent)) {\n if (all_squares[midr].textContent == \"X\"){\n // message indicates if it's the down-slope or up-slope that wins\n document.getElementById(\"winMsg\").textContent = `X wins on the ${msg} diagonal!`\n return 3\n } else if (all_squares[midr].textContent == \"O\") {\n document.getElementById(\"winMsg\").textContent = `O wins on the ${msg} diagonal!`\n return -3\n }\n }\n}", "function moveRight(){\r\n undraw()\r\n const isAtRightEdge = current.some(index => (currentPosition + index)%width === width -1)\r\n if(!isAtRightEdge) currentPosition +=1\r\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition -=1\r\n }\r\n draw()\r\n}", "ascendingDiagonalCheck() {\n for (let i = 3; i < this._ROW; i++) {\n for (let j = 0; j < this._COLUMN - 3; j++) {\n this._cellValue = this._grid[i][j];\n if (this._cellValue.color == COLOR.WHITE) {\n this._draw = false;\n }\n if (this._cellValue.color != COLOR.WHITE &&\n this._grid[i - 1][j + 1].color == this._cellValue.color &&\n this._grid[i - 2][j + 2].color == this._cellValue.color &&\n this._grid[i - 3][j + 3].color == this._cellValue.color) {\n /**\n * Ascending diagonal check pass\n */\n this._i = i;\n this._j = j;\n this._WIN_X = 1;\n this._WIN_Y = -1;\n return true;\n }\n }\n }\n return false;\n }", "_checkIfComplete() {\n\n\t\tif(this._matchedCards === this.rows*this.cols) {\n\n\t\t\t// Delay for the animations\n\t\t\tsetTimeout(() => {\n\n\t\t\t\talert(`You have scored ${this._score} points`);\n\n\t\t\t\tclearInterval(this._timer);\n\n\t\t\t\tthis.initGame();\n\t\t\t}, 400);\n\t\t}\n\t}", "d_move_val(space) {\r\n if(this.check_d_range(space)) {\r\n if(space.x > this.x && space.y > this.y) {\r\n for(let i = this.x + 1, j = this. y + 1; i < space.x + 1; i++,j++) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else if (space.x < this.x && space.y < this.y) {\r\n for(let i = this.x - 1, j = this. y - 1; i > space.x - 1; i--,j--) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else if (space.x > this.x && space.y < this.y) {\r\n for(let i = this.y - 1, j = this.x + 1; j > space.y - 1; i--, j++) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else if (space.x < this.x && space.y > this.y) {\r\n for(let i = this.y + 1, j = this.x -1; j < space.y + 1; i++, j--) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else {\r\n console.log('Error in move validation');\r\n return false;\r\n };\r\n } else {\r\n console.log('Out of range');\r\n return false;\r\n };\r\n }", "function winnerCheck(move) {\r\n var flag = false;\r\n if (checkRow(1, 2, 3, move) ||\r\n checkRow(4, 5, 6, move) ||\r\n checkRow(7, 8, 9, move) ||\r\n checkRow(1, 4, 7, move) ||\r\n checkRow(2, 5, 8, move) ||\r\n checkRow(3, 6, 9, move) ||\r\n checkRow(1, 5, 9, move) ||\r\n checkRow(3, 5, 7, move)) {\r\n flag = true;\r\n }\r\n return flag;\r\n}", "function boardHasWinnerInMainDiagonal(board, player) {\n let symbol = player.symbol;\n\n for (let i = 0; i < 3; i += 1) {\n if (board[i][i] !== symbol) {\n return false;\n }\n }\n\n return true;\n}", "function lookForCompletedLines()\n\t{\n\t\tvar g = grid, nr = self.numRows, nc = self.numColumns, line;\n\t\tvar completedLines = [];\n\t\tfor(var r = nr; r-->0;)\n\t\t{\n\t\t\tline = true;\n\t\t\tfor(var c = nc; c-->0;)\n\t\t\t{\n\t\t\t\tif(!g[r][c])\n\t\t\t\t{\n\t\t\t\t\tline = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(line)\n\t\t\t\tcompletedLines.push(r);\n\t\t}\n\n\t\tif(completedLines.length > 0)\n\t\t\tprocessCompleteLines(completedLines,g);\n\t\telse\n\t\t\tnewBlock();\n\t}", "function checkForWinner(move) {\r\n var result = false;\r\n if (checkRow(1, 2, 3, move) || checkRow(4, 5, 6, move) || checkRow(7, 8, 9, move) || checkRow(1, 4, 7, move) || checkRow(2, 5, 8, move) || checkRow(3, 6, 9, move) || checkRow(1, 5, 9, move) || checkRow(3, 5, 7, move)) {\r\n result = true;\r\n }\r\n return result;\r\n}", "function diagonalDownIsClear(left, right, y1, y2, pieceWillBeHere, pieceWillNotBeHere) {\n var i = (Number(y1)+1);\n left ++;\n while(i < Number(y2) && left < right) {\n var id = String.fromCharCode(left) + i;\n if(id === pieceWillNotBeHere) {\n i++;\n left++; \n continue;\n }\n if(document.getElementById(id).firstElementChild || id === pieceWillBeHere)\n return false;\n i++;\n left++; \n }\n return true;\n}", "function checkForWinner(move) {\n\tvar result = false;\n\tif (checkRow(1, 2, 3, move) || checkRow(4, 5, 6, move) ||\n\t\tcheckRow(7, 8, 9, move) || checkRow(1, 4, 7, move) ||\n\t\tcheckRow(2, 5, 8, move) || checkRow(3, 6, 9, move) ||\n\t\tcheckRow(1, 5, 9, move) || checkRow(3, 5, 7, move)) {\n\n\t\tresult = true;\n\t};\n\treturn result;\n}", "function moveLeft(){\r\n undraw()\r\n const isAtLeftEdge = current.some(index => (currentPosition + index)% width ===0)\r\n if(!isAtLeftEdge) currentPosition -=1\r\n if(current.some (index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition +=1\r\n }\r\ndraw()\r\n}", "function boardHasWinnerInOffDiagonal(board, player) {\n let symbol = player.symbol;\n\n for (let i = 0; i < 3; i += 1) {\n if (board[i][2 - i] !== symbol) {\n return false;\n }\n }\n\n return true;\n}", "function canMove(row, col) {\n if (!hasOppositeChecker(row, col, currentColor)) {\n if (isAKing(occupiedArray[row][col].id)) {\n if (!cellIsVacant(row + 1, col + 1) && !cellIsVacant(row + 1, col - 1) && !cellIsVacant(row - 1, col + 1) && !cellIsVacant(row - 1, col - 1)) {\n return false;\n }\n }\n else if (occupiedArray[row][col].classList.contains(\"black\")) {\n if (!cellIsVacant(row + 1, col - 1) && !cellIsVacant(row + 1, col + 1)) {\n return false;\n }\n }\n else if (occupiedArray[row][col].classList.contains(\"red\")) {\n if (!cellIsVacant(row - 1, col - 1) && !cellIsVacant(row - 1, col + 1)) {\n return false;\n }\n }\n return true;\n }\n}", "checkAdjacent(i, direction, row, col, disc) {\n\n var current = this.board[row][col];\n var r = row;\n var c = col;\n\n if (disc == 'W') {\n if (direction == 'v') {\n while (r + i < this.height && r + i >= 0) {\n if (current == 'B') {\n r = r + i;\n }\n if (current == 'W') {\n return true;\n }\n if (current == -1) {\n break;\n }\n current = this.board[r][c];\n }\n if (current == 'W') {\n return true;\n }\n }\n if (direction == 'h') {\n while (c + i < this.width && c + i >= 0) {\n if (current == 'B') {\n c = c + i;\n }\n if (current == 'W') {\n return true;\n }\n if (current == -1) {\n break;\n }\n current = this.board[r][c];\n }\n if (current == 'W') {\n return true;\n }\n }\n if (direction == 'l') {\n while (r + i < this.height && r + i >= 0 && c + i >= 0 && c + i < this.width) {\n if (current == 'B') {\n r = r + i;\n c = c + i;\n }\n if (current == 'W') {\n return true;\n }\n if (current == -1) {\n break;\n }\n current = this.board[r][c];\n }\n if (current == 'W') {\n return true;\n }\n }\n if (direction == 'r') {\n while (r - i >= 0 && r - i < this.height && c + i >= 0 && c + i < this.width) {\n if (current == 'B') {\n r = r - i;\n c = c + i;\n }\n if (current == 'W') {\n return true;\n }\n if (current == -1) {\n break;\n }\n current = this.board[r][c];\n }\n if (current == 'W') {\n return true;\n }\n }\n } else {\n if (direction == 'v') {\n while (r + i < this.height && r + i >= 0) {\n if (current == 'W') {\n r = r + i;\n }\n if (current == 'B') {\n return true;\n }\n if (current == -1) {\n break;\n }\n current = this.board[r][c];\n }\n if (current == 'B') {\n return true;\n }\n }\n if (direction == 'h') {\n while (c + i < this.width && c + i >= 0) {\n if (current == 'W') {\n c = c + i;\n }\n if (current == 'B') {\n return true;\n }\n if (current == -1) {\n break;\n }\n current = this.board[r][c];\n }\n if (current == 'B') {\n return true;\n }\n }\n if (direction == 'l') {\n while (r + i < this.height && r + i >= 0 && c + i >= 0 && c + i < this.width) {\n if (current == 'W') {\n r = r + i;\n c = c + i;\n }\n if (current == 'B') {\n return true;\n }\n if (current == -1) {\n break;\n }\n current = this.board[r][c];\n }\n if (current == 'B') {\n return true;\n }\n }\n if (direction == 'r') {\n while (r - i >= 0 && r - i < this.height && c + i >= 0 && c + i < this.width) {\n if (current == 'W') {\n r = r - i;\n c = c + i;\n }\n if (current == 'B') {\n return true;\n }\n if (current == -1) {\n break;\n }\n current = this.board[r][c];\n }\n if (current == 'B') {\n return true;\n }\n }\n }\n return false;\n }", "isComplete() {\n for (let i = 0; i < this.rounds.length; i++) {\n for (let j = 0; j < this.rounds[i].length; j++) {\n if (this.rounds[i][j] == \"\") {\n return false;\n }\n }\n }\n return true;\n }", "function canMove(coordinatesCallback,dir){\n if(pauseState){\n return false;\n }\n for(var i = 0; i < tetromino.cells.length; i++){\n var new_coord = coordinatesCallback(i,dir); // tulemus on kastides, mitte pikslites\n var new_x = new_coord[0];\n var new_y = new_coord[1];\n if(!validateCoordinates(new_x,new_y)){\n return false;\n }\n }\n return true;\n}", "function checkSuccessfullEnd(){\n successfullEnd = true;\n if(moves>0) successfullEnd = false;\n if (successfullEnd) alert(\"you won!\") \n}", "checkValidMove(origin, destination)\n {\n\n if(this.checkEmptyStack(origin))\n {\n return false;\n }\n else if(this.posting[origin-1][this.posting[origin-1].length-1] > this.posting[destination-1][this.posting[destination-1].length-1])//checks for big disks that are on top of smaller disks\n {\n console.log(this.posting[origin-1][this.posting[origin-1].length-1]);\n console.log(this.posting[destination-1][this.posting[destination-1].length-1]);\n return false;\n }\n else\n {\n return true;\n }\n }", "isMoveStraight(args){\n if ((args[0] - args[1] == this.basicMoveObj.y) && (args[2] - args[3] == this.basicMoveObj.x)) {\n return true\n } else {\n return false\n }\n }", "isBoardSolved() {\n const diff = symmetricDifference(this.sudokuBoard.flat(), completedSet);\n return this.isValidBoard() && diff.size === 0;\n }", "function checkNextMovement(nextPositionX, nextPositionY, rover){\n if ((nextPositionX >= 0 && nextPositionX < 10) && (nextPositionY >= 0 && nextPositionY < 10)){\n if (grid[nextPositionY][nextPositionX] === null){\n // Set null to rover's previous position\n grid[rover.y][rover.x] = null;\n // Set rover to the next position\n grid[nextPositionY][nextPositionX] = rover.name;\n rover.x = nextPositionX;\n rover.y = nextPositionY; \n pushCoordinatesToTravelLog(rover);\n } else if (grid[nextPositionY][nextPositionX] === 'stone') {\n console.log('Found a ' + grid[nextPositionY][nextPositionX] + '!');\n } else if (grid[nextPositionY][nextPositionX] === 'Rover 1' || grid[nextPositionY][nextPositionX] === 'Rover 2'){\n console.log('Found ' + grid[nextPositionY][nextPositionX] + '!');\n }\n } else {\n console.log ('Error! ' + rover.name + ' is going off the grid.'); \n }\n}", "function check_block() {\n var moved = false;\n reset_counts();\n check_counts(\"X\");\n\n if (countdiag1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + i);\n }\n }\n if (countdiag2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 2 + 2);\n }\n }\n if (countrow0 == 2) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i);\n }\n }\n if (countrow1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(3 + i);\n }\n }\n if (countrow2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(6 + i);\n }\n }\n if (countcol0 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3);\n }\n }\n if (countcol1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + 1);\n }\n }\n if (countcol2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + 2);\n }\n }\n return moved;\n}", "function doneOrNot(board){\n let rowSum = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0};\n let regionSum = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0};\n\n for (let i = 0; i < board.length; i++) {\n if (board[i].reduce((a, b) => a + b) !== 45) return 'Try again!';\n\n for (let j = 0; j < board[i].length; j++) {\n rowSum[i] += board[j][i];\n\n if (i < 3 && j < 3) regionSum[0] += board[i][j];\n else if (i < 6 && j < 3) regionSum[1] += board[i][j];\n else if (i < 9 && j < 3) regionSum[2] += board[i][j];\n else if (i < 3 && j < 6) regionSum[3] += board[i][j];\n else if (i < 6 && j < 6) regionSum[4] += board[i][j];\n else if (i < 9 && j < 6) regionSum[5] += board[i][j];\n else if (i < 3 && j < 9) regionSum[6] += board[i][j];\n else if (i < 6 && j < 9) regionSum[7] += board[i][j];\n else if (i < 9 && j < 9) regionSum[8] += board[i][j];\n }\n }\n\n for (let key in rowSum) {\n if (rowSum[key] !== 45) return 'Try again!';\n if (regionSum[key] !== 45) return 'Try again!';\n }\n\n return 'Finished!';\n}", "reverseFinished() {\n return (this.y < height / 2 + 0.5 && this.y > height / 2 - 0.5) || (this.x < width / 2 + 0.5 && this.x > width / 2 - 0.5)\n }", "function firstTurn() {\n return (board.numEmpty() == 16);\n}", "function canMove(coordinatesCallback, dir) {\n if (pauseState) {\n return false;\n }\n for (var i = 0; i < tetromino.cells.length; i++) {\n var new_coord = coordinatesCallback(i, dir); // return coords in terms of cells, not pixels\n var new_x = new_coord[0];\n var new_y = new_coord[1];\n if (!validateCoordinates(new_x, new_y)) {\n return false;\n }\n }\n return true;\n}", "finished() {\n return this.y > height || this.y < 0;\n }", "function checkWiningColumnMove(p) {\n //0,3,6 1,4,7 2,5,8\n var ret = false;\n var c1 = _matrix[0][0] + _matrix[1][0] + _matrix[2][0];\n var c2 = _matrix[0][1] + _matrix[1][1] + _matrix[2][1];\n var c3 = _matrix[0][2] + _matrix[1][2] + _matrix[2][2];\n\n if (c1 === p.repeat(3) || c2 === p.repeat(3) || c3 === p.repeat(3) ) ret = true;\n\n return ret;\n }", "function checkMove(xPos, yPos, newState) {\n\tvar result = true;\n\tvar newX = xPos;\n\tvar newY = yPos;\n\t\n\tfor(var r = 0, len = ourPiece.states[newState].length; r < len; r++) {\n\t\tfor(var c = 0, len2 = ourPiece.states[newState][r].length; c < len2; c++) {\n\t\t\t// If a square of the block is outside the left-right confines of the gameboard then the move is invalid.\n\t\t\tif(newX < 0 || newX >= columns) {\n\t\t\t\tresult = false;\n\t\t\t\tc = len2;\n\t\t\t\tr = len;\n\t\t\t}\n\t\t\t\n\t\t\t// This if checks that any given square of the block isn't already occupied by a previous block in game data.\n\t\t\tif(gameData[newY] != undefined && gameData[newY][newX] != 0 \n\t\t\t\t&& ourPiece.states[newState][r] != undefined && ourPiece.states[newState][r][c] != 0) {\n\t\t\t\tresult = false;\n\t\t\t\tc = len2;\n\t\t\t\tr = len;\n\t\t\t}\n\t\t\t\n\t\t\tnewX++;\n\t\t}\n\t\tnewX = xPos;\n\t\tnewY++;\n\t\t\n\t\t// If the new row would be below the last line of the gameboard the move is again invalid.\n\t\tif(newY > rows) {\n\t\t\tr = len;\n\t\t\tresult = false;\n\t\t}\n\t}\n\treturn result;\n}", "function updateGameFinishedState(){\n if(snake.history[0].x < 0 || snake.history[0].x >= size\n || snake.history[0].y < 0 || snake.history[0].y >= size){\n isGameFinished = true;\n }\n }" ]
[ "0.7269041", "0.71088964", "0.68663085", "0.6846417", "0.67951465", "0.6676342", "0.662169", "0.6601882", "0.65872025", "0.65832007", "0.65507823", "0.6508399", "0.6487655", "0.6445982", "0.64306515", "0.64227057", "0.63982576", "0.63799065", "0.6376625", "0.6375214", "0.6369863", "0.6366872", "0.6353799", "0.63453066", "0.63249475", "0.6317005", "0.6314877", "0.6313911", "0.62968516", "0.62710387", "0.62686557", "0.6257712", "0.6254156", "0.6251924", "0.6251721", "0.6245141", "0.62446475", "0.6230347", "0.6226728", "0.62257314", "0.6216613", "0.6215292", "0.6212556", "0.62116826", "0.61982536", "0.6197717", "0.61916465", "0.61825514", "0.6176304", "0.6160616", "0.6159657", "0.61583406", "0.61486375", "0.61442053", "0.61396927", "0.6132835", "0.6124297", "0.61231244", "0.6114636", "0.60976064", "0.60963714", "0.60933286", "0.6089785", "0.608644", "0.6079145", "0.60789037", "0.60787225", "0.607179", "0.60701203", "0.6067764", "0.60613954", "0.6059189", "0.6058128", "0.6053259", "0.6052349", "0.60455775", "0.6040726", "0.6035695", "0.6027558", "0.6026308", "0.60183084", "0.60080284", "0.5998451", "0.5997362", "0.5990243", "0.5984556", "0.5983655", "0.59828436", "0.59796757", "0.59789705", "0.5974919", "0.5973761", "0.59736264", "0.5970704", "0.59594834", "0.5955769", "0.5947652", "0.59429157", "0.5938954", "0.5934788" ]
0.6347996
23
Check if the position selected is valid
function checkPosition(id, x, y){ let gameJson = reader.read(id).game; let gameMoves = gameJson.movements; if(x < 0 || x > 2 || y < 0 || y > 2) return WRONG_POS; for(let i = 0; i < gameMoves.length; i++){ if(gameMoves[i].movement.x == x && gameMoves[i].movement.y == y) return WRONG_POS; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isValid(position) {\n\t\treturn position.x >= 0 && position.x < this.width\n\t\t && position.y >= 0 && position.y < this.height;\n\t}", "isValidPos(pos) {\n try {\n let x = pos[0];\n let y = pos[1];\n return ( (x > -1 && x < 8) && (y > -1 && y < 8) );\n } catch (error) {\n \n }\n }", "validatePosition() {\n\n }", "isValidPosition(pos){\n return pos.x >=0 && pos.y >= 0 && pos.x < this.props.width && pos.y < this.props.height; \n }", "function validarContinuacion(posX,posY){\n var valorActual = arregloPosiciones[posX][posY];\n\n if((posY-2)>=0){\n valorPosArriba1 = arregloPosiciones[posX][posY-1];\n valorPosArriba2 = arregloPosiciones[posX][posY-2];\n if(valorActual == valorPosArriba1 && valorActual == valorPosArriba2){\n return true;\n }\n }\n if((posX-2)>=0){\n valorPosIzq1 = arregloPosiciones[posX-1][posY];\n valorPosIzq2 = arregloPosiciones[posX-2][posY];\n if(valorActual == valorPosIzq1 && valorActual == valorPosIzq2){\n return true;\n }\n }\n return false;\n}", "function checkCoords(){\n if (parseInt($('#w').val())) return true;\n alert('Please select a crop region then press submit.');\n return false;\n }", "function checkpos() {\n if($('#pos1').val()== ''){\n $('#poserr').html(\"Enter your Position\");\n $('#poserr').show();\n err_pos = true;\n }else {\n $('#poserr').hide();\n }\n }", "function validPosition(row, col) {\r\n //set boundary\r\n if (row < NUM_ROWS && col < NUM_COLS && row >= 0 && col >= 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function checkPosition() {\n const offset = reposition(prevFocused);\n if (offset.top !== prevOffset.top || offset.left !== prevOffset.left || offset.width !== prevOffset.width || offset.height !== prevOffset.height) {\n // console.log(\"Changed focus position\", offset, prevFocused);\n prevOffset = offset;\n staticCounter = 0;\n } else {\n staticCounter++;\n }\n if (staticCounter < 3) {\n // at the beginning and as long as we see position changes\n // we will check the position/bounds more often\n positionTimeout = setTimeout(checkPosition, 100);\n } else {\n // we want to measure at least every 2 seconds\n positionTimeout = setTimeout(checkPosition, 1000);\n }\n }", "function validate_click(posClicked) {\r\n for(var i = 0;i<$scope.movidasPosibles.length;i++){\r\n var pos = JSON.parse(\"[\" + posClicked + \"]\");\r\n if($scope.movidasPosibles[i][0]===pos[0] && $scope.movidasPosibles[i][1] ===pos[1]){\r\n $scope.http_request.body.x = pos[0];//guarda las posiciones clickeadas\r\n $scope.http_request.body.y = pos[1];//al final se va mantener siempre una posicion guardada\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "function validatePosition()\n{\n this.p = collisionWithWallsInSector(this.p, this.prev_p, this.sector, DO_NOT_UPDATE_WALL_DIR);\n this.p = collisionWithSectorsInSector(this.p, this.prev_p, this.sector, DO_NOT_UPDATE_WALL_DIR);\n}", "function checkIfCardPositionValid(position) {\n if(position >= 0) return position;\n else return 0;\n }", "validatePositioning() {\n if (!this.positioningValid) {\n this.calculateAndSetPopupPosition();\n }\n }", "function validPos(inpt,position)\r\n{\r\n\tif(pos>inpt.length)\r\n\t{\r\n\t\tdocument.write(\"Invalid Position!\");\r\n\t\treturn;\r\n\t}\r\n\telse\r\n\t\treturn 1;\r\n\r\n}", "isValidPosition (column, row) {\n // add logic that checks if the column and row exist in the grid\n // return true if they are valid and false if they are not\n var validColumn = column >= 0 && column < this.numberOfColumns;\n var validRow = row >= 0 && row < this.numberOfRows;\n\n return validColumn && validRow;\n \n}", "function isValid() {\n return !!selectedValue && isHexColor(selectedValue);\n }", "function activeShutter_haveValidSelection()\r\n\t\t{\r\n\t\t\tif (app.project == null)\r\n\t\t\t{\r\n\t\t\t\tasPal.grp.statusBar.msg.text = activeShutterData.strErrNoProj;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif ((app.project.activeItem == null) || ((app.project.activeItem != null) && !(app.project.activeItem instanceof CompItem)))\r\n\t\t\t{\r\n\t\t\t\tasPal.grp.statusBar.msg.text = activeShutterData.strErrNoActiveComp;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "function validarFormDelPosition() {\n let namePos = document.forms[\"formDelPosition\"][\"delOnePosition\"].value;\n\n // El campo de nombre de la posicion no puede ser vacio.\n if (namePos === \"\") {\n alert(\"El campo no puede ser vacío.\");\n return false;\n }else {\n // Validar si la posición existe en el plano.\n let namePosMinus = namePos.toLowerCase();\n let cont = 0;\n for (let valor of positions) {\n\n let converNamePos = positions[cont].toLowerCase();\n\n if(namePosMinus !== converNamePos) {\n alert(\"No existe una posición con el nombre \"+namePos+\"\\nPosicion convertida: \"+namePosMinus+\"\\n\"+converNamePos);\n return false;\n }\n cont++;\n }\n }\n}", "get hasSelection() {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return false;\n }\n return start[0] !== end[0] || start[1] !== end[1];\n }", "selectErrorAtPosition(position) {\n const {\n errors\n } = this.state;\n\n if (errors.length === 0) {\n return;\n }\n\n const selectedError = errors.find(error => position >= (error.offset || 0) && position <= (error.offset || 0) + (error.length || 0)) || null;\n this.setState({\n selectedError\n });\n }", "_inSelection(x, y) {\n const that = this,\n dimensionValues = that._coordinates;\n let validation = true,\n xDimension, yDimension, boundX, boundY;\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n xDimension = that.dimensions - 1;\n yDimension = that.dimensions - 2;\n }\n else {\n xDimension = 0;\n yDimension = 1;\n }\n\n if (!that._oneDimensionSpecialCase) {\n boundX = x + dimensionValues[xDimension];\n boundY = y + dimensionValues[yDimension];\n }\n else {\n boundX = y + dimensionValues[xDimension];\n }\n\n if (that.dimensions === 1) {\n if (boundX >= that._absoluteSelectionStart[xDimension] && boundX <= that._absoluteSelectionEnd[xDimension]) {\n return true;\n }\n else {\n return false;\n }\n }\n\n if (boundX >= that._absoluteSelectionStart[xDimension] &&\n boundX <= that._absoluteSelectionEnd[xDimension] &&\n boundY >= that._absoluteSelectionStart[yDimension] &&\n boundY <= that._absoluteSelectionEnd[yDimension]) {\n validation = true;\n }\n else {\n validation = false;\n }\n\n if (that.arrayIndexingMode === 'LabVIEW') {\n for (let i = 0; i < yDimension; i++) {\n validation = validation && (dimensionValues[i] >= that._absoluteSelectionStart[i] && dimensionValues[i] <= that._absoluteSelectionEnd[i]);\n }\n }\n else {\n for (let j = 2; j < that.dimensions; j++) {\n validation = validation && (dimensionValues[j] >= that._absoluteSelectionStart[j] && dimensionValues[j] <= that._absoluteSelectionEnd[j]);\n }\n }\n\n return validation;\n }", "function isFailX(elFuturePos,elRegion,visibleRect){return elFuturePos.left<visibleRect.left||elFuturePos.left+elRegion.width>visibleRect.right;}", "IsValidLocation(pt){\n if (pt.r < 1 || pt.r > this._size || pt.c < 1 || pt.c > this._size){\n return false;\n }\n return true;\n }", "function _isValid(position, c, strict, fromSetValid) {\n var rslt = false;\n $.each(getTests(position), function (ndx, tst) {\n var test = tst[\"match\"];\n var loopend = c ? 1 : 0, chrs = '', buffer = getBuffer();\n for (var i = test.cardinality; i > loopend; i--) {\n chrs += getBufferElement(position - (i - 1));\n }\n if (c) {\n chrs += c;\n }\n\n //return is false or a json object => { pos: ??, c: ??} or true\n rslt = test.fn != null ?\n test.fn.test(chrs, getMaskSet(), position, strict, opts)\n : (c == test[\"def\"] || c == opts.skipOptionalPartCharacter) && test[\"def\"] != \"\" ? //non mask\n { c: test[\"def\"], pos: position }\n : false;\n\n if (rslt !== false) {\n var elem = rslt.c != undefined ? rslt.c : c;\n elem = (elem == opts.skipOptionalPartCharacter && test[\"fn\"] === null) ? test[\"def\"] : elem;\n\n var validatedPos = position;\n if (rslt[\"remove\"] != undefined) { //remove position\n stripValidPositions(rslt[\"remove\"], rslt[\"remove\"] + 1, true);\n }\n\n if (rslt[\"refreshFromBuffer\"]) {\n var refresh = rslt[\"refreshFromBuffer\"];\n strict = true;\n refreshFromBuffer(refresh === true ? refresh : refresh[\"start\"], refresh[\"end\"]);\n if (rslt.pos == undefined && rslt.c == undefined) {\n rslt.pos = getLastValidPosition();\n return false;//breakout if refreshFromBuffer && nothing to insert\n }\n validatedPos = rslt.pos != undefined ? rslt.pos : position;\n if (validatedPos != position) {\n rslt = $.extend(rslt, isValid(validatedPos, elem, true)); //revalidate new position strict\n return false;\n }\n\n } else if (rslt !== true && rslt.pos != undefined && rslt[\"pos\"] != position) { //their is a position offset\n validatedPos = rslt[\"pos\"];\n refreshFromBuffer(position, validatedPos);\n if (validatedPos != position) {\n rslt = $.extend(rslt, isValid(validatedPos, elem, true)); //revalidate new position strict\n return false;\n }\n }\n\n if (rslt != true && rslt.pos == undefined && rslt.c == undefined) {\n return false; //breakout if nothing to insert\n }\n\n if (ndx > 0) {\n resetMaskSet(true);\n }\n\n if (!setValidPosition(validatedPos, $.extend({}, tst, { \"input\": casing(elem, test) }), fromSetValid))\n rslt = false;\n return false; //break from $.each\n }\n });\n\n return rslt;\n }", "isValidMove(){\n\n }", "function selectionIsSane() {\n\t\t\tvar minSize = 5;\n\t\t\treturn Math.abs(selection.second.x - selection.first.x) >= minSize &&\n\t\t\t\tMath.abs(selection.second.y - selection.first.y) >= minSize;\n\t\t}", "function isValidCoords( points, elem, complete, elem_type ) {\n for ( var n = 1; n < points.length; n++ )\n if ( points[n].x < 0 || points[n].y < 0 ||\n points[n].x > imgSize.W-1 || points[n].y > imgSize.H-1 ) {\n console.log('error: '+elem_type+'s have to be within image limits');\n return false;\n }\n if ( complete && points.length < 3 ) {\n console.log('error: '+elem_type+'s are required to have at least 3 points');\n return false;\n }\n return true;\n }", "function isSelection(posObj) {\n\t\t\t\tvar selection = isRTL ? (posObj.begin - posObj.end) > 1 || ((posObj.begin - posObj.end) === 1) :\n\t\t\t\t\t(posObj.end - posObj.begin) > 1 || ((posObj.end - posObj.begin) === 1);\n\n\t\t\t\treturn selection && posObj.begin === 0 && posObj.end === getMaskSet().maskLength ? \"full\" : selection;\n\t\t\t}", "checkPlacement() {\n if (this.state.x === null || this.state.y === null || this.state.f === null) {\n return true\n } else {\n return false\n }\n }", "function checker() {\n if (position >= size) {\n position = 0;\n }\n else if (position < 0) {\n position = size - 1;\n }\n //console.log(position);\n }", "function check_pos(){\n\t//Write our checking of all positions\n\n\tif (blob_pos_x > c_canvas.width - 20){\n\tblob_pos_x = blob_pos_x - 4;\n\t}\n\tif (blob_pos_x < 0){\n\tblob_pos_x = blob_pos_x + 4;\n\t}\n\tif (blob_pos_y > c_canvas.height - 20){\n\tblob_pos_y = blob_pos_y - 4;\n\t}\n\tif (blob_pos_y < 0){\n\tblob_pos_y = blob_pos_y + 4;\n\t}\n\n\n\t}", "isValid() {\n return this.selection != null && this._isValidDateInstance(this.selection);\n }", "isValid() {\n return this.selection != null && this._isValidDateInstance(this.selection);\n }", "function checkDraw() {\n return playerOSelections.length + playerXSelections.length >= cells.length\n}", "moveIsValid() {}", "function _isValid(position, c, strict, fromSetValid) {\n\n var rslt = false;\n $.each(getTests(position, !strict), function (ndx, tst) {\n var test = tst[\"match\"];\n var loopend = c ? 1 : 0, chrs = '', buffer = getBuffer();\n for (var i = test.cardinality; i > loopend; i--) {\n chrs += getBufferElement(position - (i - 1));\n }\n if (c) {\n chrs += c;\n }\n\n //return is false or a json object => { pos: ??, c: ??} or true\n rslt = test.fn != null ?\n test.fn.test(chrs, buffer, position, strict, opts)\n : (c == test[\"def\"] || c == opts.skipOptionalPartCharacter) && test[\"def\"] != \"\" ? //non mask\n { c: test[\"def\"], pos: position }\n : false;\n\n if (rslt !== false) {\n var elem = rslt.c != undefined ? rslt.c : c;\n elem = elem == opts.skipOptionalPartCharacter ? test[\"def\"] : elem;\n\n var validatedPos = position;\n if (rslt[\"refreshFromBuffer\"]) {\n var refresh = rslt[\"refreshFromBuffer\"];\n strict = true;\n validatedPos = rslt.pos != undefined ? rslt.pos : position;\n tst = getTests(validatedPos, !strict)[0]; //possible mismatch TODO\n if (refresh === true) {\n getMaskSet()[\"validPositions\"] = {};\n refreshFromBuffer(0, getBuffer().length);\n }\n else {\n refreshFromBuffer(refresh[\"start\"], refresh[\"end\"]);\n }\n } else if (rslt !== true && rslt[\"pos\"] != position) { //their is a position offset\n setValidPosition(position, $.extend({}, tst, { \"input\": casing(buffer[position], test) }), strict);\n validatedPos = rslt[\"pos\"];\n refreshFromBuffer(position + 1, validatedPos);\n tst = getTests(validatedPos, !strict)[0]; //possible mismatch TODO\n }\n if (ndx > 0) {\n resetMaskSet(true);\n }\n if (!setValidPosition(validatedPos, $.extend({}, tst, { \"input\": casing(elem, test) }), strict, fromSetValid))\n rslt = false;\n return false; //break from $.each\n }\n });\n\n return rslt;\n }", "function positionIsTaken(x_pos, y_pos) {\n var value = board[y_pos][x_pos];\n return value === 0 ? false : true;\n}", "function checkAvailable(pos) {\n return board[pos] !== 'X' && board[pos] !== 'O';\n}", "function validarFormAddPositions() {\n let nomen = document.forms[\"formAddPositions\"][\"nomen\"].value;\n let multiPositionInitial = document.forms[\"formAddPositions\"][\"multiPositionInitial\"].value;\n let multiPositionFinal = document.forms[\"formAddPositions\"][\"multiPositionFinal\"].value;\n\n // Los campos no pueden estar vacios.\n if (nomen == \"\" || multiPositionInitial == \"\" || multiPositionFinal == \"\") {\n alert(\"Los campos no pueden estar vacios.\");\n return false;\n } else {\n // Los campos deben ser menores a 6 caracteres. \n if(multiPositionInitial.length >= 6 || multiPositionFinal.length >= 6) {\n alert(\"Los campos deben ser menos de 6 caracteres.\");\n return false;\n } else if(multiPositionInitial === multiPositionFinal) {\n alert(\"La posición inicial no puede ser igual a la posición final\");\n return false;\n } else if(multiPositionInitial > multiPositionFinal) {\n alert(\"La posición inicial no puede ser mayor que la posición final\");\n return false;\n } else {\n // Validar si el nombre ingresado ya existe en la base.\n let cont = 0;\n for(let i = multiPositionInitial; i < multiPositionFinal; i++) {\n\n let namePlano = nomen+i;\n let namePlanoMinus = namePlano.toLowerCase();\n \n if(positions.length !== 0) {\n for (let pos = 0; pos < positions.length; pos++) {\n console.log(\"Convert name: \"+namePlanoMinus);\n console.log(positions[pos]);\n \n let converNamePosition = positions[pos].toLowerCase();\n \n if(namePlanoMinus === converNamePosition) {\n alert(\"Ya existe una posición con el nombre \"+namePlano);\n return false;\n }\n cont++;\n }\n }\n }\n }\n }\n}", "function _isValid(position, c, strict, fromSetValid) {\n\t var rslt = false;\n\t $.each(getTests(position), function (ndx, tst) {\n\t var test = tst.match;\n\t var loopend = c ? 1 : 0,\n\t\t\t\t\t\t\tchrs = \"\";\n\t for (var i = test.cardinality; i > loopend; i--) {\n\t chrs += getBufferElement(position - (i - 1));\n\t }\n\t if (c) {\n\t chrs += c;\n\t }\n\n\t //make sure the buffer is set and correct\n\t getBuffer(true);\n\t //return is false or a json object => { pos: ??, c: ??} or true\n\t rslt = test.fn != null ?\n\t\t\t\t\t\t\ttest.fn.test(chrs, getMaskSet(), position, strict, opts) : (c === test.def || c === opts.skipOptionalPartCharacter) && test.def !== \"\" ? //non mask\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t c: test.placeholder || test.def,\n\t\t\t\t\t\t\t pos: position\n\t\t\t\t\t\t\t} : false;\n\n\t if (rslt !== false) {\n\t var elem = rslt.c !== undefined ? rslt.c : c;\n\t elem = (elem === opts.skipOptionalPartCharacter && test.fn === null) ? (test.placeholder || test.def) : elem;\n\n\t var validatedPos = position,\n\t\t\t\t\t\t\t\tpossibleModifiedBuffer = getBuffer();\n\n\t if (rslt.remove !== undefined) { //remove position(s)\n\t if (!$.isArray(rslt.remove)) rslt.remove = [rslt.remove];\n\t $.each(rslt.remove.sort(function (a, b) {\n\t return b - a;\n\t }), function (ndx, lmnt) {\n\t stripValidPositions(lmnt, lmnt + 1, true);\n\t });\n\t }\n\t if (rslt.insert !== undefined) { //insert position(s)\n\t if (!$.isArray(rslt.insert)) rslt.insert = [rslt.insert];\n\t $.each(rslt.insert.sort(function (a, b) {\n\t return a - b;\n\t }), function (ndx, lmnt) {\n\t isValid(lmnt.pos, lmnt.c, false, fromSetValid);\n\t });\n\t }\n\n\t if (rslt.refreshFromBuffer) {\n\t var refresh = rslt.refreshFromBuffer;\n\t strict = true;\n\t refreshFromBuffer(refresh === true ? refresh : refresh.start, refresh.end, possibleModifiedBuffer);\n\t if (rslt.pos === undefined && rslt.c === undefined) {\n\t rslt.pos = getLastValidPosition();\n\t return false; //breakout if refreshFromBuffer && nothing to insert\n\t }\n\t validatedPos = rslt.pos !== undefined ? rslt.pos : position;\n\t if (validatedPos !== position) {\n\t rslt = $.extend(rslt, isValid(validatedPos, elem, true, fromSetValid)); //revalidate new position strict\n\t return false;\n\t }\n\n\t } else if (rslt !== true && rslt.pos !== undefined && rslt.pos !== position) { //their is a position offset\n\t validatedPos = rslt.pos;\n\t refreshFromBuffer(position, validatedPos, getBuffer().slice());\n\t if (validatedPos !== position) {\n\t rslt = $.extend(rslt, isValid(validatedPos, elem, true)); //revalidate new position strict\n\t return false;\n\t }\n\t }\n\n\t if (rslt !== true && rslt.pos === undefined && rslt.c === undefined) {\n\t return false; //breakout if nothing to insert\n\t }\n\n\t if (ndx > 0) {\n\t resetMaskSet(true);\n\t }\n\n\t if (!setValidPosition(validatedPos, $.extend({}, tst, {\n\t\t\t\t\t\t\t\t\t\"input\": casing(elem, test)\n\t }), fromSetValid)) {\n\t rslt = false;\n\t }\n\t return false; //break from $.each\n\t }\n\t });\n\n\t return rslt;\n\t }", "function checkTwoPosition(pos1, pos2) { \n \n if (checkCombo(pos1[0], pos1[1]).combo >= 3 || checkCombo(pos2[0], pos2[1]).combo >= 3 || arr[pos1[0]][pos1[1]] == 0 || arr[pos2[0]][pos2[1]] == 0) {\n \n// fromCol = Math.min(pos1[1] - checkCombo(pos1[0], pos1[1]).left, \n// pos2[1] - checkCombo(pos2[0], pos2[1]).left)\n// \n// toCol = Math.max(pos1[1] + checkCombo(pos1[0], pos1[1]).right,\n// pos2[1] + checkCombo(pos2[0], pos2[1]).right)\n// \n// toRow = Math.max(pos1[0] + checkCombo(pos1[0], pos1[1]).bottom, \n// pos2[0] + checkCombo(pos2[0], pos2[1]).bottom)\n// \n// if (checkCombo(pos1[0], pos1[1]).combo < 3) {\n// fromCol = pos2[1] - checkCombo(pos2[0], pos2[1]).left;\n// toCol = pos2[1] + checkCombo(pos2[0], pos2[1]).right;\n// toRow = pos2[0] + checkCombo(pos2[0], pos2[1]).bottom;\n// }\n// \n// if (checkCombo(pos2[0], pos2[1]).combo < 3) {\n// fromCol = pos1[1] - checkCombo(pos1[0], pos1[1]).left;\n// toCol = pos1[1] + checkCombo(pos1[0], pos1[1]).right;\n// toRow = pos1[0] + checkCombo(pos1[0], pos1[1]).bottom;\n// }\n// setRemovedValue();\n// console.log(arr)\n //auto check after every move\n setTimeout(autoCheck, 200);\n\n } else {\n //no available combo\n //add some animation of swapping icons back and forth\n \n //swap back elements\n setTimeout(swap, 200);\n if (allowSound) { playInvalidMoveNoComboMove.play() };\n }\n}", "_isDragStartInSelection(ev) {\n const selectedElements = this.root.querySelectorAll('[data-is-selected]');\n for (let i = 0; i < selectedElements.length; i++) {\n const element = selectedElements[i];\n const itemRect = element.getBoundingClientRect();\n if (this._isPointInRectangle(itemRect, { left: ev.clientX, top: ev.clientY })) {\n return true;\n }\n }\n return false;\n }", "function checkPresent(name, value, position){\n var position = typeof(position) != 'undefined' ? position : 'empty';\n\t \n\t if(position == 'empty'){\n\t length = value.length;\n\t if(value.length == 0){\n\t errMessages += \"<li>\" + name + \" - This field is required.</li>\";\n\t return false; \n\t }\n\t else{\n\t\t return true;\n\t } \n\t }\n\t else{\n\t length = position.posY + 1;\n\t if(value.length == 0){\n\t errMessages += \"<li>\" + name + \" - This field is required.</li>\"; \n\t return false; \n\t }\n\t else{\n\t \tif(value.length < length){\n\t errMessages += \"<li>\" + name + \" - \" + length + \" spaces is required.</li>\";\n\t return false;\n\t \t}\n\t \telse{\n\t \tfor(var i= position.posX; i <= length; i++){\n\t \tif(value[i] == ' '){\n\t errMessages += \"<li>\" + name + \" - No spaces allowed.</li>\";\n\t return false;\n\t }\n\t\t } \n\t }\n\t return true; \n\t } \n\t }\n}", "click(e, position) {\n\t/*check if the positon in state.position is empty, else alert invalid*/\n if (this.state.positions[position] == \"\") {\n this.state.positions.splice(position, 1, this.state.toggle);\n this.setState({ positions: this.state.positions });\n this.winner()\n if (this.state.toggle == \"x\") {\n this.setState({ toggle: \"o\" })\n } else {\n this.setState({ toggle: \"x\" })\n };\n } else { alert(\"invalid\") }\n }", "validCoords(coords) {\n const [r, c] = coords;\n return r >= 0 && r < this.rows && c >= 0 && c < this.cols;\n }", "_validatePositions() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!this._preferredPositions.length) {\n throw Error('FlexibleConnectedPositionStrategy: At least one position is required.');\n }\n // TODO(crisbeto): remove these once Angular's template type\n // checking is advanced enough to catch these cases.\n this._preferredPositions.forEach(pair => {\n validateHorizontalPosition('originX', pair.originX);\n validateVerticalPosition('originY', pair.originY);\n validateHorizontalPosition('overlayX', pair.overlayX);\n validateVerticalPosition('overlayY', pair.overlayY);\n });\n }\n }", "function checkForPosition(input){\n \n const updatedPwd = getInputs(input);\n \n const start = updatedPwd[0]-1;\n const end = updatedPwd[1]-1;\n \n //condition to check for character at positions\n if((updatedPwd[3][start]===updatedPwd[2] && updatedPwd[3][end]===updatedPwd[2]) || updatedPwd[3][start]!==updatedPwd[2] && updatedPwd[3][end]!==updatedPwd[2]){\n return false;\n }\n else{\n return true;\n }\n }", "function validateSelection(selector){\n\tselectedValue=parseInt($(selector).find(\":selected\").val());\n\tif(selectedValue==0){\n\t\talert(\"يرجى اختيار احد الاختيارات\") ;selector.focus();\n\t\treturn false;\t\n\t}else{\n\treturn true;\t\n\t}\n\t\n}", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "isComplete() {\n return this.selection.start != null && this.selection.end != null;\n }", "isValidMove (piece, pos) {\n\t\tif (!position.isValid(pos))\n\t\t\treturn false;\n\n\t\tlet piece2 = this.getPiece(pos);\n\t\t//Cannot move into a position occupied by a piece of the same color\n\t\tif (piece2 && piece.color === piece2.color)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "validMove(pos, color) {\n let moves = this.validMoves(color);\n let res = false;\n\n moves.forEach(function(move) {\n if ( (move[0] == pos[0]) && (move[1] == pos[1]) ) {\n res = true;\n }\n })\n return res;\n }", "function valid(offsetX, offsetY, newCurrent) {\n offsetX = offsetX || 0;\n offsetY = offsetY || 0;\n offsetX = currentX + offsetX;\n offsetY = currentY + offsetY;\n newCurrent = newCurrent || current;\n\n for (let y = 0; y < 4; ++y) {\n for (let x = 0; x < 4; ++x) {\n if (newCurrent[y][x]) {\n if (typeof board[y + offsetY] == 'undefined'\n || typeof board[y + offsetY][x + offsetX] == 'undefined'\n || board[y + offsetY][x + offsetX]\n || x + offsetX < 0\n || y + offsetY >= ROWS\n || x + offsetX >= COLS) {\n if (offsetY == 1 && freezed) {\n lose = true; // lose if the current shape is settled at the top most row\n document.getElementById('playbutton').disabled = false;\n }\n return false;\n }\n }\n }\n }\n return true;\n}", "function checkIfCardClickedOnIsValid() {\n\tif (currentcard.classList.contains(\"open\")) {\n\t\t//do not allow click, invalid move\n\t\treturn false;\n\t} else if (currentcard.classList.contains(\"show\")) {\n\t\treturn false;\n\t} else if (currentcard.classList.contains(\"match\")) {\n\t\treturn false;\n\t} else if (currentcard.classList.contains(\"wrong\")) {\n\t\treturn false;\n\t} else {\n\t\t//valid move\n\t\treturn true;\n\t}\n}", "canPickWorldPos() {\n }", "function validateCoord(x, y){\n x = Number(x);\n y = Number(y);\n let length = game.grid.length;\n return x >= 0 && x < length && y >= 0 && y < length;\n}", "checkCursorIsInSelection(widget, point) {\n if (isNullOrUndefined(this.start) || this.isEmpty || isNullOrUndefined(widget)) {\n return false;\n }\n let isSelected = false;\n do {\n if (this.selectedWidgets.containsKey(widget)) {\n let top;\n let left;\n if (widget instanceof LineWidget) {\n top = this.owner.selection.getTop(widget);\n left = this.owner.selection.getLeft(widget);\n }\n else {\n top = widget.y;\n left = widget.x;\n }\n let widgetInfo = this.selectedWidgets.get(widget);\n isSelected = widgetInfo.left <= point.x && top <= point.y &&\n top + widget.height >= point.y && widgetInfo.left + widgetInfo.width >= point.x;\n }\n widget = (widget instanceof LineWidget) ? widget.paragraph : widget.containerWidget;\n } while (!isNullOrUndefined(widget) && !isSelected);\n return isSelected;\n }", "function isValidPosition(x, y, plane){\n return (x >= 0 && x < plane.length && y >= 0 && y < plane[x].length);\n}", "function isValid(prevIndex, index)\n{\n\t//0 1 2\n\t//3 4 5\n\t//6 7 8\n\tconst valid_moves = {\n\t\t0 : [1, 3, 4, -1, -1, -1, -1, -1], \n\t\t1 : [0, 2, 3, 4, 5, -1, -1, -1], \n\t\t2 : [1, 4, 5, -1, -1, -1, -1, -1], \n\t\t3 : [0, 1, 4, 6, 7, -1, -1, -1], \n\t\t4 : [0, 1, 2, 3, 5, 6, 7, 8], \n\t\t5 : [1, 2, 4, 7, 8, -1, -1, -1], \n\t\t6 : [3, 4, 7, -1, -1, -1, -1, -1], \n\t\t7 : [3, 4, 5, 6, 8, -1, -1, -1], \n\t\t8 : [4, 5, 7, -1, -1, -1, -1, -1]\n\t}; \n\n\tvar valid_spots = valid_moves[prevIndex]; \n\tfor(var i = 0; i < 8; i++)\n\t{\n\t\tif(valid_spots[i] === index)\n\t\t\treturn true; \n\t}\n\treturn false; \n}", "function validatePosition(){\n if (cursorPos.x < 0){\n cursorPos.x = 0;\n }\n\n if (cursorPos.x + img.width > canvasCrosshair.width){\n cursorPos.x = canvasCrosshair.width - img.width;\n }\n\n if (cursorPos.y < 0){\n cursorPos.y = 0;\n }\n\n if (cursorPos.y +img.height > canvasCrosshair.height){\n cursorPos.y = canvasCrosshair.height - img.height;\n }\n\n}", "function valid(board, number, position){\n\n //check row\n for (var i = 0; i < board[0].length; i++){\n if (board[position[0]][i] === number && position[1] !== i){\n return false;\n }\n }\n\n //check the column\n for (var i = 0; i < board.length){\n if (board[i][position[1]] === number && position[0] !== i){\n return false;\n }\n }\n}", "function validatePositions(start, end) {\n if (!start || start === 'none' || !end || end === 'none') {\n return 'Start or end position is unassigned.';\n }\n\n if (start === end) {\n return 'Start and end positions can\\'t be the same.'\n }\n\n if (start > end) {\n return 'Start position can\\'t be after end position.';\n }\n\n return null;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n }", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n\t return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n\t}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n\t return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n\t}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n\t return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n\t}", "function isFailX(elFuturePos, elRegion, visibleRect) {\n\t return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;\n\t}" ]
[ "0.7123742", "0.6987946", "0.6901161", "0.68082887", "0.66447794", "0.6625849", "0.6562076", "0.65539867", "0.65338767", "0.652088", "0.6461782", "0.6403057", "0.63475835", "0.63315517", "0.63075584", "0.6232632", "0.61963415", "0.615987", "0.61591196", "0.6151791", "0.61342686", "0.61313576", "0.6092313", "0.6072287", "0.6071609", "0.6066325", "0.6020091", "0.60123456", "0.59880024", "0.5966822", "0.59457636", "0.5917824", "0.5917824", "0.5908209", "0.5907284", "0.5901481", "0.589945", "0.58812463", "0.5878953", "0.5876861", "0.58737576", "0.58701634", "0.58638656", "0.585666", "0.5855857", "0.58548033", "0.5845014", "0.5822441", "0.5806501", "0.5806501", "0.58042747", "0.57988125", "0.57676464", "0.57653743", "0.57626915", "0.57591945", "0.5753351", "0.5741576", "0.57404655", "0.573902", "0.57369363", "0.57336766", "0.57329845", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.5729804", "0.57266694", "0.57266694", "0.57266694", "0.57266694" ]
0.0
-1
Check if the game already finished
function checkEnd(id){ let gameJson = reader.read(id).game; if(gameJson.gameState == "Finished") return END; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isFinished() {\n if(this.noMoreTurns()||this.getWinner()!==null)\n return true;\n else\n return false;\n\n }", "_checkIfComplete() {\n\n\t\tif(this._matchedCards === this.rows*this.cols) {\n\n\t\t\t// Delay for the animations\n\t\t\tsetTimeout(() => {\n\n\t\t\t\talert(`You have scored ${this._score} points`);\n\n\t\t\t\tclearInterval(this._timer);\n\n\t\t\t\tthis.initGame();\n\t\t\t}, 400);\n\t\t}\n\t}", "function gameRunning() {\n if (gameCompleted || cardClickCounter == 0) return false;\n return true;\n }", "function checkIfCompleted() {\n matchingCards++;\n\n if (matchingCards >= Math.floor(fieldSize / 2)) {\n gameCompleted = true;\n timerStop();\n gratulation();\n }\n }", "function gameFinished() {\n 'use strict';\n return othelloGrid.countDiscs(OTHELLO_CONST.empty) != 0 ? false : true;\n}", "function gamedone() {\n\tif (matchedCards.length === 16) {\n\t\tstopTimer();\n\t\tconsole.log(\"Game Complete!\")\n\t\twriteGameStats();\n\t\ttogglePopup();\n\t\t//need to add toggle popup\n\t}\n}", "function checkGameEnd() {\n if (count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function () {\n resetResults();\n startGame();\n });\n }\n }", "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "function checkDoneAction(){\n db.game.findOne({\"game_id\": clientSocket.gameRoom},function(err,doc){\n var done = true;\n var playerArray = doc.player_list;\n playerArray.forEach(function(player){\n if(player.finishedAction === false){\n done = false;\n }\n });\n\n if(done){\n return true;\n }\n return false;\n });\n }", "status(){\n if(this.facedown.length <= 0){\n inProgress = false;\n console.log(\"GAME OVER\");\n }\n }", "function finishChecker(){\n if(gameSettings.genocide){\n winGeno()\n return true\n }\n if(gameSettings.savior){\n winSaviour()\n return true\n }\n if(gameSettings.cheated){\n loseCheat()\n return true\n }\n return false\n}", "function gameIsDone(game) {\n return gameHasWinner(game) || gameIsDraw(game);\n}", "isGameFinished() {\n // alert(this.questions.length);\n if (this.questionIndex === this.questions.length) {\n console.log('returning true');\n return true;\n }\n }", "isFinished() {\n\n return this.pairsGuessed !== this.cards.length / 2 ? false : true\n\n }", "finished() {\n const target = Game.getObjectById(this.params.targetId);\n if (target.hits <= 0) {\n return true;\n }\n }", "function gameComplete() {\n if (app.matchedCards.length === app.gameCards) {\n clearInterval(app.interval);\n congratsModal();\n gameCompleteSound();\n }\n}", "function finish() {\n module.exports.gameOver = true;\n}", "isDone() {\n return !this.loop && this.currentFrame >= this.sprites.length;\n }", "checkComplete() {\n let result = true;\n for (let i = 0; i < this.solution.length; i++) {\n result = result && this.solution[i] === this.inputGates[i];\n }\n let oldComplete = this.complete;\n this.complete = result;\n if ((this.complete !== oldComplete) && this.complete) {\n bing.play();\n }\n }", "function ifComplete() {\r\n\t\t\t\t\tif (isFinished == false) {\r\n\t\t\t\t\t\tisFinished = true;\r\n\r\n\t\t\t\t\t\t// show the flag animation when a car reaches the finish line\r\n\t\t\t\t\t\tfinishedImage.attr('src', 'Assets/img/finish.gif');\r\n\r\n\t\t\t\t\t\t// add a background shadow effect while the flag animation is on\r\n\t\t\t\t\t\t$('#raceTrack').addClass('shadow');\r\n\r\n\t\t\t\t\t\t// timeout function for removal of flag animation and enable the buttons\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\r\n\t\t\t\t\t\t\t// remove flag animation and background shadow\r\n\t\t\t\t\t\t\tfinishedImage.attr('src', '');\r\n\t\t\t\t\t\t\t$('#raceTrack').removeClass('shadow');\r\n\r\n\t\t\t\t\t\t\t// set buttons to enable when the animation and race finish\r\n\t\t\t\t\t\t\traceBtn.prop(\"disabled\", false);\r\n\t\t\t\t\t\t\trestartBtn.prop(\"disabled\", false);\r\n\t\t\t\t\t\t}, 3500);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfinishedIn = 'second';\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function checkFinish() {\n\tif (time < 0 && win == false && lose == false && on_menu == false){\n //highscore(0);\n\t\tlose = true;\n\t\ton_menu = true;\n\t}\n else if (x == canvas.width - GAME_SIZE && y == canvas.height - GAME_SIZE && win == false && on_menu == false) {\n\t\ttime_score = time * 10;\n\t\tcoin_score = score;\n\t\tscore = score + time_score;\n //highscore(score);\n win = true;\n on_menu = true;\n }\t\n}", "function checkGameFinished() {\r\n if (getScore(PLAYER) == 0) return true;\r\n for (var i = 0; i < field_height; i++)\r\n for (var j = 0; j < field_width; j++)\r\n if (game_field[i][j] == EMPTY) return false;\r\n return true;\r\n}", "isEndGame() {\r\n return this.solvedCards.length == this.arrayCards.length;\r\n }", "checkGameEnd(THIS) {\r\n THIS.gameActive = !(THIS.completed === THIS.goal);\r\n }", "function checkSuccessfullEnd(){\n successfullEnd = true;\n if(moves>0) successfullEnd = false;\n if (successfullEnd) alert(\"you won!\") \n}", "done() {\n for (let i = 0; i < this.players.length; i++) {\n if (!this.players[i].dead) {\n return false;\n }\n }\n return true;\n }", "function updateGameFinishedState(){\n if(snake.history[0].x < 0 || snake.history[0].x >= size\n || snake.history[0].y < 0 || snake.history[0].y >= size){\n isGameFinished = true;\n }\n }", "function finish(){\n\n // sound-effect\n playIncorrect()\n // Disable buttons, because we don't need them.\n elements.correctButton.disabled = true\n elements.incorrectButton.disabled = true\n window.setTimeout(displayGameOver,1500)\n}", "function checkEndGame(){\r\n\t\t\t\t\tif (squares[0][0].getNumStone() == 0 && squares[1][0].getNumStone()==0){\r\n\t\t\t\t\t\tendGame = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tendGame = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function gameOver() {\n puzzleEnd(false)\n }", "is_finished() {\n // if last piece\n let cpt = 0;\n\n for (let x = 0; x < 6; x++) {\n for (let y = 0; y < 6; y++) {\n if (this._board[x][y] !== -1) {\n cpt++;\n }\n }\n }\n if (cpt === 0) {\n return true;\n }\n // if one player have the set of color\n for (let i = 0; i < 6; i++) {\n if (this._player_1_pieces[i] === 6) {\n return true;\n }\n if (this._player_2_pieces[i] === 6) {\n return true;\n }\n }\n return false;\n }", "function checkEndGame() {\r\n if (cardMatches == 8) {\r\n console.log(\"gameEnd\");\r\n // stop the clock\r\n clearInterval(ticking);\r\n // open end game modal\r\n openModal();\r\n }\r\n}", "checkIfGameOver() {\n if (this.character.dead || this.endBoss.dead) {\n this.gameOver.gameFinished = true;\n this.gameOver.lostGame = this.character.dead && !this.endBoss.dead ? true : false;\n this.gameOver.showEndscreen();\n this.AUDIO_BACKGROUND.pause();\n this.AUDIO_GAMEOVER.play();\n this.AUDIO_GAMEOVER.volume = 1;\n }\n }", "function endGame() {\n gameStarted = false;\n}", "function endGameChecker() {\n\tif (endGame) {\n\t\tremoveEvent();\n\t}\n}", "function checkIfCompleted() {\n if (_progress > 102) {\n _recording = false;\n $(\"#overLayMessage\").text(\"YOU CREATED A LEVEL\");\n $(\"#recordButt\").css(\"visibility\", \"hidden\");\n $(\"#restartButt2\").css(\"display\", \"block\");\n $(\"#saveButt\").css(\"display\", \"block\");\n console.log(_keyStrokes.length);\n }\n }", "function isFinished(){\n if(counter === 10){\n counter = 0;\n result.textContent = \"Play again!\";\n result.className = \"\";\n reset = true;\n showConclusionModal();\n }\n}", "function gameComplete () {\n if (matches === 8) {\n gameMessage();\n stopTime();\n }\n}", "function checkStatus() {\n \n if (currentQuestionIndex >= questions.length) {\n endGame();\n }\n \n}", "gameOverCheck() {\n if (gameState.lives <= 0) {\n this.hiScoreCheckAndSave(); \n this.cameras.main.fade(gameState.FADE_TIME_FAST, 0, 0, 0, false, function(camera, progress) {\n if (progress >= 1.0) {\n sfx.gameover.play();\n this.scene.stop('MainScene');\n\t\t\t this.scene.start('GameOverScene');\n }\n });\n }\n }", "isFinished (){\n\t\treturn this.status !== null && this.finishDelay < 0;\n\t}", "function stay() {\r\n if (!gameInProgress) return alert(\"Game has finished, please start a new game\");\r\n //checking whether there are players left to act \r\n const check = utilFunctions.players.filter(player => player.isAlive)\r\n if (check.length >= 1){\r\n alert(`Player ${utilFunctions.determineCurrentPlayer().name} is next`);\r\n }\r\n else{\r\n // ending the game in case where everyone has acted\r\n utilFunctions.completeDealerCards()\r\n for (let player of utilFunctions.players){\r\n //checking who has won based on their regular and split cards result \r\n if (player.splitSum > 0) {\r\n player.isSplit = false\r\n utilFunctions.determineWinners(player, player.splitSum)\r\n }\r\n player.isAlive = false\r\n utilFunctions.determineWinners(player, player.sum)\r\n }\r\n utilFunctions.startOver()\r\n gameInProgress = false\r\n }\r\n}", "wait_AnimationEnd() {\n if (this.tmpPiece.parabolic.end == true) {\n this.unvalidateCells();\n this.check_GameOver();\n this.check_Reset();\n this.checkSelected();\n this.locked = true;\n }\n }", "hasGameEnded() {\n const { gameState } = this.state;\n const gameEnded = gameState.every((tileState) => {\n return tileState.status === -1;\n });\n if (gameEnded) {\n alert('You won! You can play again by clicking on the Restart Game button.');\n }\n }", "function continueGame() {\n // clear modal\n $(\".modal\").removeClass(\"bg-modal\");\n $(\".modal-inner\").removeClass(\"modal-content\").html(\"\");\n // has endgame condition been reached\n if (selectedGlyphs.length === numQuestionsPerGame) {\n endCondition_gameOver();\n } else {\n selectGlyph();\n }\n }", "function gameWin() {\n puzzleEnd(true)\n }", "function gameEnd(){\r\n\tif(nthRound > rounds){\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\treturn false;\r\n\t}\r\n}", "IsFinishedRendering() {}", "function checkIfComplete() {\r\n if(isComplete == false) { //here no car has won yet\r\n isComplete = true; //a car won either car1 or car2\r\n }\r\n else {\r\n place = 'second';\r\n }\r\n }", "gameCompleted() {\n console.log(\"Game completed!\");\n //this.newGame()\n alert(\"Game completed! Please refresh the screen to play again.\");\n }", "function endGame(){\n if(trivia[currentQAndA] === (trivia.length)){\n stop();\n \n $(\".quiz\").html(\"<h1>\" + 'Done!' + \"</h1>\")\n }\n else{\n loading();\n }\n }", "function checkFinish()\r\n {\r\n player = currentPlayer();\r\n\r\n if(completeRow = isRowComplete(player))\r\n {\r\n highlightWinningCells(_ROW, completeRow);\r\n }\r\n\r\n if(completeCol = isColumnComplete(player))\r\n {\r\n highlightWinningCells(_COL, completeCol);\r\n }\r\n\r\n if(completeDiagonal_1 = isDiagonalComplete(player, _FIRST_DIAGONAL))\r\n {\r\n highlightWinningCells(_DIAGONAL, completeDiagonal_1);\r\n }\r\n\r\n if(completeDiagonal_2 = isDiagonalComplete(player, _SECOND_DIAGONAL))\r\n {\r\n highlightWinningCells(_DIAGONAL, completeDiagonal_2);\r\n }\r\n\r\n if( completeRow || completeCol || completeDiagonal_1 || completeDiagonal_2 )\r\n {\r\n congratulate(player);\r\n finalize();\r\n\r\n // It returns the player number just in case in the next extensions of the program, we decide to store the players' scores.\r\n // Otherwise, simply return suffices.\r\n return player;\r\n }\r\n\r\n // The following will be executed only if there is no winner (based on the result of the code above).\r\n if(isTableFull())\r\n {\r\n congratulate(_BOTH);\r\n finalize();\r\n return _BOTH;\r\n }\r\n\r\n return 0;\r\n }", "function gameDone()\n\t{\n\t\tdisableCupClick();\n\t\tsetTimeout(function(){\n\t\t\t$('.cup').addClass(\"hide-anim\");\n\t\t\tball.addClass(\"hide-anim\");\n\t\t\t$('#message').removeClass(\"hide\").addClass(\"show\"); \n\t\t}, 2000);\n\t\tsetTimeout(function(){\n\t\t\t$('.cup').css('display','none');\n\t\t\tball.css('display','none');\n\t\t}, 4000);\n\n\t\tsetTimeout(function(){\n\t\t\t$('#btnRestart').removeClass(\"hide\").addClass(\"show\"); \n\t\t}, 4000);\n\t}", "function isUserFinishedEntering(){\n return !isScannerInput() && userFinishedEntering;\n }", "function isUserFinishedEntering(){\n return !isScannerInput() && userFinishedEntering;\n }", "function isUserFinishedEntering(){\n return !isScannerInput() && userFinishedEntering;\n }", "function GameEnd(){\n\t\t\tif(poker._cash == 0 && poker._bet == 0)\n\t\t\t\talert(\"Thanks for playing better luck next time.\\nRefresh the browser to start a new game.\");\n\t}", "function checkForGameEnd() {\n setInterval(function() {\n /*condition for game over*/\n if (myOpenedCards.length === 16) {\n stopTimer();\n displayGameOverModal();\n }\n }, 1000);\n}", "function endGame() {\n\tif(matchedCards.length === 16){\n\t\ttimer.stop();\n\t\tdisplayPopup();\n\t}\n}", "isFinished() {\n // after the first player third move, checks if anybody wan the game\n if(this.moves >= 5) {\n let i, j;\n\n // check rows\n for(i = 0; i < 6; i = i + 3) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + 1] && this.board[i + 1] == this.board[i + 2]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n // check cols\n for(i = 0; i <= 2; i ++) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + 3] && this.board[i + 3] == this.board[i + 6]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n // check diagonals\n for(i = 0, j = 4; i <= 2; i = i + 2, j = j - 2) {\n if(this.board[i] !== 'E' && this.board[i] === this.board[i + j] && this.board[i + j] == this.board[i + 2*j]) {\n this.updatePlayerScore(this.result = {\n status: 'finished',\n winner: this.board[i]\n });\n return true;\n }\n }\n\n if(this.moves === 9) {\n this.updatePlayerScore(this.result = {\n status: 'draw'\n });\n return true;\n }\n }\n\n // if there is not winner, the game is still running and the next player shoul move\n this.result = {status: 'running'};\n\n return false;\n }", "function isGameOver () {\n if (currentQuestion() === questionList.length) {\n window.alert('Youre a wizard Hary! Maybe you won!!!');\n return true;\n }\n return false;\n}", "function gameStatus() {\n // position of the last item in player sequence\n var lastPosition = playerSequence.length - 1; \n if (playerSequence[lastPosition] == simonSequence[lastPosition] && \n playerSequence.length < simonSequence.length) {\n status.html(`<p>Well done!</p>`);\n }\n else if (playerSequence[lastPosition] == simonSequence[lastPosition] \n && playerSequence.length == simonSequence.length) {\n status.html(`<p>Next play! Get ready!</p>`);\n disableColorButtons();\n setTimeout(function() {\n newGame = false; // To avoid score and simon sequence reset\n retry = false;\n notEndGame = false;\n play();\n }, 2000);\n }\n else {\n incorrectSound.play(); // 'Razz' sound plays when player makes mistake\n if (hard.is(\":checked\")) {\n status.html(\n `<div class=\"font\">Game Over </div>\n <p>Oops! That's not right!<br>\n You scored <span class=\"red\"> ${scores} </span><br> \n ${playAgain}.</p>`);\n enableModeButton();\n enableStartButton();\n disableExitButton();\n }\n else {\n status.html(\n `<div class=\"font\"> Oops! Not quite right!</div>\n <p>Let's have another try! </p>`);\n retry = true;\n newGame = false;\n setTimeout(play, 4000);\n disableExitButton();\n }\n }\n }", "function endOfGame() {\n\tcreatesMensg();\n\tstopTime();\n\tshowModal();\n}", "wait_GM_1st_AnimationEnd(){\n if(this.check_Reset())\n return;\n if (this.numberOfTries > this.maxNumberOfTries) {\n this.numberOfTries = -1;\n\n if (this.currentPlayer == 2)\n {\n this.scene.update_CameraRotation();\n this.state = 'WAIT_GM_CAMERA_ANIMATION_END';\n }\n else\n this.state = 'GAME_MOVIE';\n\n }\n this.numberOfTries++;\n }", "checkForEndOfGame() {\n\t\t\n\t\tif (!this.isInKnockedState()) {\n\t\t\t\n\t\t\tconst playboard = this.getPlayboard();\n\t\t\t\n\t\t\tconst reservePilePlayerA = playboard.getPlayboardMap().get(PileUtils.getReservePilePositionOfPlayer(Player.PLAYER_A));\n\t\t\tconst wastePilePlayerA = playboard.getPlayboardMap().get(PileUtils.getWastePilePositionOfPlayer(Player.PLAYER_A));\n\t\t\t\n\t\t\tconst reservePilePlayerB = playboard.getPlayboardMap().get(PileUtils.getReservePilePositionOfPlayer(Player.PLAYER_B));\n\t\t\tconst wastePilePlayerB = playboard.getPlayboardMap().get(PileUtils.getWastePilePositionOfPlayer(Player.PLAYER_B));\n\n\t\t\t// If real player won:\n\t\t\tif (PileUtils.isPileEmpty(reservePilePlayerA) && PileUtils.isPileEmpty(wastePilePlayerA)) {\n\t\t\t\tthis.setGameOver(true);\n\t\t\t\tthis.setWinnerPlayer(Player.PLAYER_A);\n\t\t\t\tthis.setActivePlayer(Player.DEALER);\n\n\t\t\t\tLocalStorageService.increaseStatisticsNumberOfGames();\n\t\t\t\tLocalStorageService.increaseStatisticsNumberOfGamesWon();\n\t\t\t\tLocalStorageService.updateStatisticsAverageDurationOfGame(this._startTimeTs);\n\n\t\t\t\tRenderService.renderPlayboard(this);\n\t\t\t\tRenderService.renderGameOverDialog(this);\n\t\t\t\tRenderService.enableLevelSelect();\n\t\t\t\tRenderService.enableSortAcesOnCenterPilesChoice();\n\t\t\t\t\n\t\t\t}\n\t\t\t// If computer opponent won:\n\t\t\telse if (PileUtils.isPileEmpty(reservePilePlayerB) && PileUtils.isPileEmpty(wastePilePlayerB)) {\n\t\t\t\tthis.setGameOver(true);\n\t\t\t\tthis.setWinnerPlayer(Player.PLAYER_B);\n\t\t\t\tthis.setActivePlayer(Player.DEALER);\n\n\t\t\t\tLocalStorageService.increaseStatisticsNumberOfGames();\n\t\t\t\tLocalStorageService.increaseStatisticsNumberOfGamesLost();\n\t\t\t\tLocalStorageService.updateStatisticsAverageDurationOfGame(this._startTimeTs);\n\n\t\t\t\tRenderService.renderPlayboard(this);\n\t\t\t\tRenderService.renderGameOverDialog(this);\n\t\t\t\tRenderService.enableLevelSelect();\n\t\t\t\tRenderService.enableSortAcesOnCenterPilesChoice();\n\t\t\t}\n\t\t}\n\t}", "function gameEnd(){\n\tplayer.start = false;\n}", "function finishGame(isVictory) {\n if (isVictory) {\n highestScore(gLevel.type, gGame.secsPassed);\n renderSmiley(true);\n winningAudio.play();\n // alert('You Win!');\n openModal('You Won!');\n gGame.isOn = false;\n } else {\n gGame.isOn = false;\n losingAudio.play();\n openModal('You Lost :(');\n revealMines();\n }\n clearInterval(gTimerInterval);\n}", "function finish(){\n if(ballsPresent()){\n takeBall();\n }\n while(frontIsClear()){\n move();\n if(ballsPresent()){\n takeBall();\n }\n \n }\n}", "function isCompleted() {\n return cards.length === matchedCards.length;\n}", "checkIfWin() {\n if (this.score === 10) {\n this.started = false;\n allEnemies = [];\n showWinModal();\n }\n }", "function check() {\n if (playerOrder[playerOrder.length - 1] !== order[playerOrder.length - 1])\n good = false;\n\n if (playerOrder.length == 20 && good) {\n winGame();\n }\n\n if (good == false) {\n onButton = true;\n flashColor();\n $(\"#turn\").text(\"!!\");\n setTimeout(() => {\n $(\"#turn\").text(turn);\n clearColor();\n\n // If strictButton is activated then returns to first sequence\n if (strictButton) {\n startGame();\n } else { // Else it's going to return the current sequence\n compTurn = true;\n flash = 0;\n playerOrder = [];\n good = true;\n intervalId = setInterval(gameTurn, 800);\n }\n }, 800);\n\n noise = false; // If player is wrong its not going to play a sound\n }\n\n if (turn == playerOrder.length && good && !win) {\n turn++;\n playerOrder = [];\n compTurn = true;\n flash = 0;\n $(\"#turn\").text(turn);\n intervalId = setInterval(gameTurn, 800);\n }\n}", "wait_GM_AnimationEnd(){\n if(this.check_Reset())\n return;\n if (this.view.currentMoviePiece.parabolic.end == true) {\n if(this.model.lastMoviePlay() == true)\n {\n this.scene.reset = false;\n this.scene.showGameMovie = false;\n this.model.currentMoviePlay = 0;\n this.state = 'GAME_OVER';\n }\n else\n {\n this.model.inc_currentMoviePlay();\n this.scene.update_CameraRotation();\n this.state = 'WAIT_GM_CAMERA_ANIMATION_END';\n }\n }\n }", "function checkWin() {\n\t\tif (pairsRemain === 0) {\n\t\t\t\ttimerOff();\n\t\t\t\topenModal();\n\t\t};\n}", "function finish()\r\n\r\n{\r\n\tvar flag = true;\r\n\r\n\tfor (var i = 0; i < gamePiece.length; i++) \r\n\t{\r\n\r\n\t\tvar top = parseInt(gamePiece[i].style.top);\r\n\t\tvar left = parseInt(gamePiece[i].style.left);\r\n\r\n\t\tif (left != (i%4*100) || top != parseInt(i/4)*100) \r\n\r\n\t\t{\r\n\t\t\tflag = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn flag;\r\n}", "function gameComplete() {\n if (matchedCards.length === 8) {\n wonTheGame[0].style.display = 'block';\n document.querySelector('.winning-game-message').innerHTML = \"Congratulation you matched all the cards!!!\";\n document.querySelector('.final-move-count').innerHTML = moves;\n document.querySelector('.final-time-count').innerHTML = hr + ':' + min + ':' + sec;\n document.querySelector('.final-star-count').innerHTML = starCount.innerHTML\n clearInterval(timerCount);\n replayGame();\n exitGame();\n }\n}", "function checkDone() {\n clear();\n drawScene();\n if (circles2[whichImage].length == 0) {\n ctx.fillStyle = \"#FFFFFF\";\n ctx.textAlign = \"center\";\n ctx.font = \"50px Comic Sans MS\";\n ctx.fillText(\"You finished!\", canvas.width/2, 100);\n ctx.font = \"50px Comic Sans MS\";\n ctx.strokeText(\"You finished!\", canvas.width/2, 100);\n timer3 = setTimeout(function() {\n clear();\n drawScene();\n }, 3000)\n } else {\n ctx.fillStyle = \"#FFFFFF\";\n ctx.textAlign = \"center\";\n ctx.font = \"50px Comic Sans MS\";\n ctx.fillText(\"There are still \" + circles2[whichImage].length, canvas.width/2, 100)\n ctx.fillText(\"achenes to find\", canvas.width/2, 180);\n ctx.font = \"50px Comic Sans MS\";\n ctx.strokeText(\"There are still \" + circles2[whichImage].length, canvas.width/2, 100)\n ctx.strokeText(\"achenes to find\", canvas.width/2, 180);\n timer3 = setTimeout(function() {\n clear();\n drawScene();\n }, 3000)\n }\n}", "function gameStatus() {\n\tpairsToGuess--;\n\tif (pairsToGuess == 0) {\n\t\ttoStopWatch(); //stop the stopwatch\n\t\tsetTimeout(function() { //display result popup\n\t\t\tdisplayResult(); //to put results to the modal\n \t\tmodalResult(); // to show modal with results\n \t\t}, 500); \n\t} else {\n\t\t\n\t}\n}", "_checkEndGame() {\n for (const obstacle of this.obstacles) {\n if (obstacle.overlaps(CHAR_X, this.charY, CHAR_SIZE)) {\n this.state = GAME_STATES.STOPPED;\n\n const gameOverModal = document.createElement(\"div\");\n gameOverModal.id = \"game-over\";\n\n const gameOverDiv = document.createElement(\"div\");\n gameOverDiv.innerText = `Game over! Score: ${this.score}`;\n\n const restartButton = document.createElement(\"button\");\n restartButton.className = \"restart-button\";\n restartButton.innerText = \"Restart\";\n\n gameOverModal.appendChild(gameOverDiv);\n gameOverModal.appendChild(restartButton);\n this.screen.appendChild(gameOverModal);\n }\n }\n }", "suspendOrResumeGame() {\n this._game.suspendOrResume();\n return this._game.isRun();\n }", "function checkGameStatus() {\n if (xCor[xCor.length - 1] > width ||\n xCor[xCor.length - 1] < 0 ||\n yCor[yCor.length - 1] > height ||\n yCor[yCor.length - 1] < 0 ||\n checkSnakeCollision()) {\n noLoop();\n var scoreVal = parseInt(scoreElem.html().substring(8));\n scoreElem.html('Game ended! Your score was : ' + scoreVal);\n synth.triggerAttackRelease('C2', '4n');\n }\n}", "function loadedCheck(callback){\n\tvar TOTAL = 4;\n\tloaded++;\n\tif(loaded === TOTAL){\n\t\tcallback(Game);\n\t\t//if(state === \"load\") //load game and start Game\n\t\t//\tloadG(Game);\n\t\t//else callback(Game); //we init Game and start Game\n\t}\n}", "function checkEndGame() {\n var endGame = findOnBoard(p2Mark, 3);\n if (endGame == null)\n endGame = findOnBoard(p1Mark, 3);\n\n if (endGame != null || timesPlayed >= 9) {\n if (endGame != null) {\n for (var i = 0; i < endGame.length; i++) {\n $(\"#\" + endGame[i][0]).parent().addClass(\"red\");\n }\n } else {\n talker.notice(\"draw\");\n }\n\n UIActive = true;\n $(\"#UI\").show();\n $(\"#screen3\").children().show();\n return true;\n }\n return false;\n}", "function gameComplete()\n\t{\n\t\tvar matched_count = $('ul.deck li.match').length;\n\t\tvar star_count = $('ul.stars li').length;\n\t\tvar resultsStr = \"\";\n\n\t\tif ( matched_count == 16 )\n\t\t{\n\t\t\tclearTimeout(timerCycle);\n\t\t\tresultsStr = \"Congrats! You just won the game in \" + timerSeconds + \" seconds with \" +\n\t\t\t\t\t\t star_count + \"/3 star rating. Do you want to play again?\";\n\n\t\t\t$('#gameComplete-message').text(resultsStr);\n\t\t\t$('#gameCompleteAlert').modal('show');\n\t\t}\n\t}", "checkForGameEnd() {\n const { numberOfLockedCards, shuffledCards } = this.state;\n if(numberOfLockedCards === shuffledCards.length) {\n // Show modal and hide the main content\n this.setState({\n modalVisible: true,\n timer: clearInterval(this.state.timer)\n });\n }\n }", "_checkTurnEnd() {\n let p0alive=false, p1alive=false;\n for (let i=0; i<9; i++) {\n p0alive = p0alive || !this.cells[i].isDead;\n p1alive = p1alive || !this.cells[i+9].isDead;\n }\n if (p0alive && p1alive) return (this.turn==20) ? \"draw\" : \"continue\";\n if (!p0alive && !p1alive) return \"draw\";\n return (p0alive) ? \"p0win\" : \"p1win\";\n }", "function _checkResults() {\n\t\t// decrement number of moves\n\t\t_numOfMoves--;\n\t\t\n\t\t// check if moves have expired and winner has not been found\n\t\tif(_numOfMoves === 0 && !_winnerFound) {\n\t\t\t_cat = true;\n\t\t\t$(\"#outcome\").html('Cat! Click on board to start new game.');\n\t\t}\n\t\t\n\t\tif(_winnerFound) {\n\t\t\t$(\"#outcome\").html(_winner + \" is the winner! Click on board to start new game.\");\n\t\t}\n\t}", "function isDone() {\n return state === states.done;\n }", "function checkEndGame() {\n if (questionNum == 15) {\n clearInterval(countDown);\n $('#sectionQuestions').addClass('hidden');\n $('#sectionResults').removeClass('hidden');\n $('#feedback').html('Game Over!!');\n $('#feedbackDetail').html(\"You got \" + correctCounter + \" questions right, \" + incorrectCounter + \" questions wrong, and didn't answer \" + timeoutCounter + \" questions at all.\");\n };\n }", "function isExplosionsDone() {\n return (explosionList.length == 0);\n}", "isGameOver () {\n const completedCoins = this._players[this.currentTurn].getCompletedCoins()\n return completedCoins.length === 4\n }", "end() {\n this.isOver = true;\n this.isRunning = false;\n\n if (typeof this.onGameOver === 'function') {\n this.onGameOver();\n }\n }", "continueGame () {\n if (this.pauseTimer > 0) return\n if (this.lives > 0) {\n this.startGame(false)\n }\n }", "function continueGame() {\n //game active\n isGameReady = true;\n //increment new level\n currentLevel += 1;\n //reset objects\n resetObjects();\n //check missiles\n GameLogic.equipMissiles(currentLevel, missileList, browserWidth, browserHeight);\n //check ship health\n GameLogic.checkRebelShipHealth(rebelShip, currentLevel);\n //create enemies\n loadEnemies();\n //reset time var\n timePrevious = Date.now();\n}", "function checkGameOver() {\n let success = true;\n for (const [index, el] of puzzleData.entries()) {\n if (el.value == null) {\n continue;\n }\n if (el.value !== +index + 1) {\n success = false;\n break;\n }\n }\n if (success) console.log('Game Over!')\n }", "function checkNameEntered(){\n startGame();\n \n if(isnameEntered){\n beginPlaying();\n }\n}", "function tied() {\n var i = 0;\n while (i < 9) {\n if ($(cells[i++]).hasClass(empty_cell)) return false;\n }\n gameisfinished = true;\n return true;\n }", "function checkFinal(){\n \tplayersGuessSubmission(); \n \t//check errors\n \tif (playersGuess > 100) {\n\t\t\t$(\".text\").append (\"<p style='color:white'>Remember between 1 - 100!</p>\")\n\t\t}\n\t\telse if (isNaN(playersGuess)) {\n\t\t\t$(\".text\").append (\"<p style='color:white'>Not a number</p>\")\n\t\t}\n\n\t\telse {\n\t\t\tvar winStatus;\n\t\t\tif (winningNumber === playersGuess) {\n\t \t\twinStatus = \"VICTORY\"; \n \t\t}\n \t\telse {\n \t\t\twinStatus = \"Sorrow and Defeat\";\n \t\t}\n \t\tgameOver(winStatus);\n\t\t}\n }", "function checkGameOver() {\r\n if (lives == 0) {\r\n console.log(\"game over\");\r\n return true;\r\n }\r\n return false;\r\n}", "function handleEndGame() {\n\n}" ]
[ "0.76427466", "0.75901294", "0.7515177", "0.7477865", "0.74562544", "0.737909", "0.7303943", "0.72832525", "0.72832525", "0.7264419", "0.71999615", "0.7139335", "0.7131091", "0.7120752", "0.7042524", "0.70148474", "0.7011935", "0.7009413", "0.6982949", "0.6980421", "0.69422114", "0.6937722", "0.6925698", "0.68787193", "0.6853464", "0.6833517", "0.6822396", "0.67979985", "0.67912596", "0.67111605", "0.67016363", "0.66783", "0.6677384", "0.6676375", "0.66745883", "0.667406", "0.6673219", "0.6667674", "0.6660172", "0.664238", "0.66217977", "0.66194195", "0.6617938", "0.66110677", "0.6605647", "0.65658504", "0.65541893", "0.6548711", "0.6543103", "0.6534337", "0.65190035", "0.6512888", "0.64975107", "0.6492808", "0.6490983", "0.6490983", "0.64892536", "0.6488876", "0.64842", "0.6470975", "0.6459573", "0.6456104", "0.64448315", "0.64445317", "0.6440329", "0.64324784", "0.6425344", "0.6411705", "0.640845", "0.6405011", "0.6404463", "0.63947105", "0.6388291", "0.6388284", "0.63857174", "0.6385379", "0.6384169", "0.6383679", "0.6383653", "0.6375418", "0.63745034", "0.63732445", "0.636984", "0.6366392", "0.6364729", "0.634724", "0.63455194", "0.634445", "0.6342248", "0.63403314", "0.63324183", "0.6331876", "0.6329958", "0.63219154", "0.63215935", "0.63202447", "0.6319813", "0.6319151", "0.6311111", "0.63106745" ]
0.68045783
27
Check if the game ID exists
function checkId(id){ // Read returns "ID_NOT_FOUND" if after iteration it doesnt find game with // specified ID let gameJsonArray = reader.read(id); if(gameJsonArray == "ID_NOT_FOUND") return WRONG_ID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async isNotValidGameID(id) {\n if (id === '') {\n return true;\n }\n try {\n let snapshot = await this.db.getRef(`games`).orderByKey().equalTo(id).once('value');\n if (snapshot.val() == null) { // We want to make sure the game doesn't exist yet\n console.log(`Game ID (${id}) is valid`)\n return false;\n } else {\n console.log(`Game id (${id}) is not valid`); \n return true;\n }\n } catch {\n console.log(`Failed to check if game id ${id} is valid`);\n return true;\n }\n }", "function checkBattleId() {\n\tlet currentBattleId = localStorage.getItem('currentBattleId');\n\tif (currentBattleId) {\n\t\t// console.log('found id');\n\t\tcodeFetchBegin(currentBattleId);\n\t} else {\n\t\tsetTimeout(function() {\n\t\t\tcheckBattleId();\n\t\t}, 2000);\n\t}\n}", "static exist(id) {\n return Screens.screens.has(id);\n }", "async function checkGameDate(gameID) {\n const game = await DButils.execQuery(\n `select gameID from Games where gameID=${gameID} and game_time > GETDATE()`\n );\n if (game.length == 0)\n return false;\n return true; \n}", "checkForPlayer (id) {\n return this.turns.indexOf(id) >= 0\n }", "exists(id){\n if (typeof id !== \"undefined\"){\n id = String(id);\n let exists = document.getElementById(id);\n if (exists !== null){\n return true;\n } else {\n return false;\n }\n } else {\n console.log(\"exists - \" + \"(\" + \"ERROR - invalid parameter (id)\" + \")\");\n } // end if\n }", "function checkIfPlayerExist(id){\r\n if($(\"div[data-id='\" + id +\"']\").length != 0){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n}", "function is_in_game(id, fn){\n var sql = \"SELECT * FROM account_in_game WHERE account_id = \" + id;\n var table = \"account_in_game\";\n var columns = \"*\";\n var condition = {\n account_id: id\n };\n db.select(condition, columns, table, 1, 0, function(result){\n if (result.result.length>0 || result.code == 0){\n return fn(true);\n }else{\n return fn(false);\n }\n });\n}", "function existLive(id){\n var booking = Bookings_Live.findOne({ \"segmentID\" : id , \"screenID\": Session.get(\"SCREEN_ID\")});\n return booking == undefined;\n}", "function checkId(id){\n\n if ((seenID[id]) || (id===\"\")){\n return \"This ID is invalid\"; \n }\n\n seenID[id] = true;\n return true; \n}", "async function hasGame(username, game_name)\n{\n // Get the game ID\n var game = await gamesdb.get(game_name);\n var game_id = game.id;\n\n // Check if the user has the game\n var query =\n {\n username: username,\n games: { $elemMatch: { $eq: game_id } }\n };\n return await userModel.exists(query);\n}", "function notExist(id, res) {\n if(bots.has(id))\n return false\n\n res.status(404)\n res.send({message: 'Bot with id ' + id + ' does not exist'})\n\n console.log('Bot',id,'does not exist')\n return true\n}", "function hasPiece(id){\n var match = _.findKey(piecesConfig, {position: id});\n return (typeof match !== \"undefined\") ? piecesConfig[match].id : ''\n }", "function existIdError(id) {\r\n throw SAME_ID_MSG.replace('%s', id);\r\n}", "function sessionExists(id) {\n\treturn getSessionSeq(id) !== undefined;\n}", "exists() {\n return this._id !== undefined;\n }", "function getGame(gameid){\n var i = 0;\n do{\n if(games[i].gameid == gameid){\n return games[i];\n }\n i++;\n }while(i < games.length);\n return -1;\n\n}", "function SearchForSuitableGame() {\n return ActiveGames.find(game => game.PublicGame && !game.Started);\n}", "function checkForSelectedGameData() {\n if (!global.CurrentSelectedGame) {\n throw new Error('Game is not selected');\n }\n}", "exists(id) {\n let sqlRequest = \"SELECT (count(*) > 0) as found FROM activite WHERE Numero_de_la_fiche_equipement=$id\";\n let sqlParams = {$id: id};\n return this.common.run(sqlRequest, sqlParams);\n }", "async exists(id) {\n // Please watch out if future versions of sqlite\n // change the return value to null, which is a more\n // correct return type than undefined. To defend\n // myself from this, I have used a `!=` instead of\n // a `!==`.\n return (await this._withDb(async (db) => await db.get(\n 'SELECT id FROM images WHERE id = ?', id\n ))) != undefined;\n }", "noGame(){\n return Game.find().count() == 0;\n }", "checkIfPlayersTurn (playerId) {\n return playerId === this.currentTurn\n }", "function isIdValid(id, db, callback){\n db.get(id,function(err,value){\n if(err && err.notFound){\n callback(true);\n }else {\n callback(false);\n }\n });\n}", "function roomExists(code) {\r\n try {\r\n console.log(\"checking if room with code: \" + code + \" exists\");\r\n console.log(rooms[code]);\r\n if(code == null || code == undefined || typeof code != 'string' || !rooms[code]) {\r\n console.log(\"it's bad\");\r\n return false;\r\n }\r\n console.log(\"it's good\");\r\n return true;\r\n } catch(e) {\r\n console.error(e);\r\n return false;\r\n }\r\n}", "verifyID() {\n const serial = this.serialize(this.data);\n const calculatedID = this.calculateID(serial);\n return (calculatedID === this.id);\n }", "function tryToJoinGame(sockId) {\n return GameLobby.tryJoinGame(sockId);\n}", "function generateGameID(saveNewGame) {\n \n var newGameID = \"\"; \n var existingGameID = \"\"; \n var duplicates = true; \n \n Game.find(function(err, gamesfound) {\n if(err) {\n console.error(err);\n return null; \n } \n\n // ensure the game id does not exist in the db already \n while(duplicates) {\n \n newGameID = Math.floor(Math.random() * 10000);\n let duplicateFound = false; \n\n for(let i=0; i<gamesfound.length; i++) {\n existingGameID = gamesfound[i].gameID; \n if(existingGameID == newGameID) {\n duplicateFound = true; \n break; \n }\n }\n\n if(!duplicateFound) duplicates = false; \n }\n saveNewGame(newGameID); \n });\n}", "function checkDuplicates(playerId) {\n for (var i = 0; i < myTeam.length; i++) {\n var element = myTeam[i];\n if (playerId == element.id) {\n return true\n }\n\n }\n return false\n }", "function checkIdExists(res) {\r\n return res.status(400).json({ error: \"id is required\" });\r\n}", "function CheckIfStatExists( results )\n{\n\tvar doesnt_exist = (results === \"gameplay stat not found\");\n\tif(doesnt_exist)\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "function gameIsDraw(game) {\n return game.winner === undefined && game.turn === 9;\n}", "function checkEnd(id){\r\n let gameJson = reader.read(id).game;\r\n if(gameJson.gameState == \"Finished\")\r\n return END;\r\n}", "hasAnyPlayerName(idPlayer, newName) \n {\n const foundPlayer = this.findPlayerByName(newName);\n return foundPlayer !== undefined && (!foundPlayer.hasId(idPlayer) );\n }", "exists() {\n return Boolean(this.id());\n }", "function checkID() {\n chrome.storage.local.get('id', function (id) {\n if (jQuery.isEmptyObject(id) == false) {\n userid = id;\n main();\n } else {\n setID();\n checkID();\n }\n });\n}", "function gameHasWinner(game) {\n return game.winner !== undefined;\n}", "function checkIfGameOver() {\n return getItemFromLocalStorage('gameOver');\n}", "function checkExistence(id, callback) {\n client.lrange(\"plants\", 0, -1, function(err, reply) {\n if (err) throw err;\n if (reply.indexOf(id) == -1) callback(false);\n else callback(true);\n });\n}", "async exists(identifier) {\n const component = await this.findComponent(identifier);\n return !!component;\n }", "function checkIfInGame(data, lolAccount) {\n var apiQuery = \"\";\n apiQuery = \"https://\" + data.region + \".\" + riotAPI + servers[data.region] + \"/\" + lolAccount + \"?api_key=\" + apiKey;\n var riotRequest = https.get(apiQuery, function(res) {\n var riotData = '';\n /* Append the twitch stream data */\n res.on('error', function(err) {\n handleResponseError(err);\n });\n res.on('data', function(riotInfo) {\n riotData += riotInfo;\n });\n res.on('end', function() {\n /* Something else happened, log the status code and move on */\n if(res.statusCode != 404 && res.statusCode != 200) {\n handleResponseError(\"Ya goofed\");\n }\n /* We got an expected response code. Connect to the \"Game\" database for CRUD */\n else {\n mongoClient.connect(database, function(err, db) {\n if(err) {\n /* Handle the error */\n handleDbError(err);\n }\n var collection = db.collection(dbGame);\n /* Make a function to close the database. This way the db can be closed from the parent scope when we KNOW\n * the children are done. */\n function closeDb() {\n db.close();\n }\n /* This lolAccount is not in a game. Remove them from the \"Game\" database. */\n if(res.statusCode == 404) {\n collection.remove({summonerNo: lolAccount});\n closeDb();\n }\n /* This lolAccount is in game (res.statusCode == 200). Add them to the \"Game\" database */\n else {\n /* Used for inserting game data into the \"Game\" database */\n var parsedRiotData = JSON.parse(riotData);\n var ourSummoner = findParticipant(parsedRiotData.participants, lolAccount);\n /* This should not happen since one of the participants SHOULD be the account we looked up.\n * If this does happen contact Riot.*/\n if(ourSummoner == null) {\n closeDb();\n throw \"err\"\n }\n /* use the data from riot to see if this account is already in game */\n var inGameCursor = collection.find({summonerNo : lolAccount});\n inGameCursor.nextObject(function(err, item) { \n if(err) {\n /* Handle the error */\n handleCursorError(err);\n }\n /* They are already in the \"Game\" database. Update the entry. */\n /* The reason I update everything is that there may be an instance where a streamer is in one game and then\n * joins a new game before this script has the chance to delete the entry. Updating all of the fields will\n * alleviate this issue. */\n if(item != null) {\n collection.update({summonerNo : lolAccount}, {\n \"twitchUsername\" : data.twitchUsername,\n \"gameMode\" : parsedRiotData.gameQueueConfigId,\n \"summonerNo\" : lolAccount,\n \"timeElapsed\" : parsedRiotData.gameLength + spectateDelay,\n \"champion\" : ourSummoner.championId\n });\n }\n /* The twitch streamer just entered a game. Add an entry in the \"Game\" database. */\n else {\n collection.insert({\n \"twitchUsername\" : data.twitchUsername,\n \"gameMode\" : parsedRiotData.gameQueueConfigId,\n \"summonerNo\" : lolAccount,\n \"timeElapsed\" : parsedRiotData.gameLength + spectateDelay,\n \"champion\" : ourSummoner.championId\n });\n }\n closeDb();\n });\n }\n });\n }\n });\n });\n}", "function gameLaunched(gameInfoResult) {\n if (!gameInfoResult) {\n return false;\n }\n if (!gameInfoResult.gameInfo) {\n return false;\n }\n if (!gameInfoResult.runningChanged && !gameInfoResult.gameChanged) {\n return false;\n }\n if (!gameInfoResult.gameInfo.isRunning) {\n return false;\n }\n // NOTE: we divide by 10 to get the game class id without it's sequence number\n if (Math.floor(gameInfoResult.gameInfo.id/10) != 5426) {\n return false;\n }\n\n console.log(\"LoL Launched\");\n return true;\n\n}", "function createGameID () {\n return \"game\"+(+Date.now());\n}", "get gameId() {\n return this._data.game_id;\n }", "hasId() {\n\n return this.id != null\n\n }", "function checkIfExists(bnetID, playerData) {\n Player.findOne({bnetID: bnetID}, function(err, foundPlayer){\n if(err){\n console.log(err);\n } else {\n if(!foundPlayer){\n console.log(\"Player was not found\");\n createPlayer(playerData);\n } else {\n console.log(\"Player was found\");\n updatePlayer(bnetID, playerData);\n }\n }\n })\n}", "function getGame ( gameId ) {\n\n\tfor ( var i = 0; i < gameArray.length; i++ ) {\n\t\tif ( gameId === gameArray[ i ][ 'id' ] ) {\n\t\t\treturn gameArray[ i ];\n\t\t}\n\t}\n}", "function checkIdExists(req, res, next) {\n const { id } = req.params;\n\n const project = projects.find(p => p.id == id);\n\n if (!project) {\n return res.status(400).json({ message: \"Project do not exists\" });\n }\n\n return next();\n}", "function is_game_owner(userinfo, fn){\n var sql = \"SELECT game_id FROM account_in_game WHERE account_id = \" + userinfo.db_id + \" and is_owner = \" + GAME_OWNER;\n db.execute(sql, 1, 0, function(result){\n if (result.result.length>0){\n fn(result.result);\n }else{\n fn(false);\n }\n })\n}", "async existsIdIdClientType(id) {\n aux = await IDCLIENTTYPE.findByPk(id).catch(function() {\n console.log(\"Promise Rejected\");\n });\n if (aux == null) {\n return false;\n } else {\n return true;\n }\n }", "isOwnStory(checkId) {\n //returns -1 if checkId is not in this users favorite stories\n const isOwnStory = this.getOwnStoryIds().findIndex(id => (\n //if this story Id is the same as the one passed in, return true\n id === checkId\n ));\n //The storyId inputted is not yours, return false\n if (isOwnStory === -1) {\n return false;\n }\n //otherwise, return true\n return true;\n }", "function findGameIndex(playerId){\n for(let i = 0; i< gameCount; i++){\n if(games[i].whiteId == playerId || games[i].blackId == playerId){\n return i;\n }\n }\n}", "function isValid(id){\r\n if(currentBoardCells.includes(id) && hasWon === false){\r\n return true;\r\n }\r\n return false;\r\n }", "function joinGameAsPlayer() {\n // check if ingame true\n\n}", "isFresh(tileId) {\n return this.props.dbCurrentPlayer !== null && this.props.dbCurrentPlayer >= 0 \n && this.props.dbPrevRacks[this.props.dbCurrentPlayer].indexOf(tileId) >= 0;\n }", "function isIDDefined(idStr)\n{\n\tvar d = new Date();\n\tvar bogusID = app.stringIDToTypeID( \"s\" + d.getTime().toString() );\n\tvar testID = app.stringIDToTypeID( idStr );\n\t// If bogus and test are one apart, then they both defined new IDs.\n\t// Otherwise, the ID already existed.\n\treturn !(testID - bogusID == 1)\n}", "hasId(old) {\n return this._existing.has(old);\n }", "hasId(old) {\n return this._existing.has(old);\n }", "validateLootAccount() {\n let result = false;\n let account = this.lootView.accountID;\n let state = this.lootView.accountState;\n let accountExist = this.bank.players.some(p => p.id === account);\n\n if (accountExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "function checkPlayer() {\n return (gInfo.playerList[gInfo.currentPlayer].uid==currentUID);\n}", "function check_if_exists(id) {\n try {\n // needs to find ANY\n const completed_request = existing_requests.find((request) => {\n return (\n request.id === id &&\n request.status === \"complete\" &&\n request.visitor_version === packageJson.version\n );\n });\n\n if (completed_request) {\n return true;\n } else {\n return false;\n }\n } catch (error) {\n return false;\n }\n}", "exists(id) {\n let sqlRequest = \"SELECT (count(*) > 0) as found FROM event WHERE id=$id\";\n let sqlParams = {$id: id};\n return this.common.run(sqlRequest, sqlParams);\n }", "createActiveGame(session) {\n const ID = uuid();\n client\n .put({ TableName: activeGamesTable, Item: { ID, session } })\n .promise()\n .then((result) => {\n return ID;\n })\n .catch((err) => {\n return null;\n });\n }", "has(uuid) {\n return this._data[uuid] !== undefined;\n }", "checkGameStatus(id){\n let totalCount = 0;\n let aceFlag = false;\n let itemIndex = 0;\n if(id == 'player'){\n this.checkPlayerStatus();\n } else {\n this.checkDealerStatus();\n }\n }", "existingPlayer(playerName) {\n if(this.players.length > 0) {\n let player = this.players.find((value) => {\n if(value.name === playerName) {\n return value;\n }\n });\n return (player) ? true : false;\n }\n return false;\n }", "function checkCourseExist(id) {\n var likeCourses = getLikeCourses();\n var takenCourses = getTakenCourses();\n var courses = likeCourses.concat(takenCourses);\n for ( i = 0; i < courses.length; i++) {\n if (id == courses[i]) {\n return true;\n }\n }\n return false;\n}", "async remove( { id } ) {\n\t return !!this.store.game.destroy({ where: { id } });\n }", "function getRoomInfo(socket, game) {\n if(socket && game) {\n const room = Array.from(socket.rooms)[1];\n const existingGame = game.map(game => game.roomId).indexOf(room);\n return existingGame;\n }\n else {\n return -1;\n }\n}", "function getGameID(req, res, mysql, context, game_name, complete, datetime) {\n var sql = \"SELECT game_ID FROM Games WHERE game_name = ?\";\n console.log(datetime, \"/addGame\", sql, game_name);\n mysql.pool.query(sql, game_name, function (error, results, fields) {\n if (error) {\n console.error(datetime, \"/addGame\", JSON.stringify(error));\n res.statusMessage = JSON.stringify(error);\n res.status(400).end();\n } else if (results.length == 0) {\n console.error(datetime, \"/addGame results is empty\");\n res.status(400).end();\n } else {\n context.game_ID = results[0].game_ID;\n complete(res, context, game_name);\n }\n });\n }", "function doesAccountExist() {\n const accToCheck = readline.question(\"Give ID number to see, if the account exists (or 'return' to go back)\\n>> \");\n\n const userArray = JSON.parse(fs.readFileSync(\"./accountDetails.json\", \"utf8\"));\n\n if (accToCheck === \"return\") {\n currentLoc = \"account\";\n } else {\n // Compare userArray:s id:s with accToCheck's ID and take true/false in checkBoolean\n const checkBoolean = userArray.some((x)=> x.id === accToCheck);\n\n if (checkBoolean) {\n console.log(\"User found by that ID. If you are xfering money, \" +\n \"contact user first to make sure it's correct ID\");\n } else {\n console.log(\"No user found by that ID.\");\n }\n doesAccountExist();\n }\n}", "hasId(old) {\n return old in this.existing;\n }", "function find_playerid(id) {\n for (var i = 0; i < player_lst.length; i++) {\n if (player_lst[i].id == id) {\n return player_lst[i]; \n }\n }\n \n return false; \n}", "hasId(old) {\n return (old in this.existing);\n }", "function avatarExists(id) {\n return avatars.hasOwnProperty(id);\n}", "function isTurnPlayer (guid) {\n return (guid === state.queue[0]);\n}", "timecardExists(timecard_id){\n let timecard = companydata.getTimecard(timecard_id);\n if(timecard != null){\n return true;\n }\n return false;\n }", "function find_playerid(id) {\r\n\r\n\tfor (var i = 0; i < player_lst.length; i++) {\r\n\r\n\t\tif (player_lst[i].id == id) {\r\n\t\t\treturn player_lst[i]; \r\n\t\t}\r\n\t}\r\n\tthrow \"Player not found\"\r\n}", "function cdExists(id) {\n for (var i = 0; i < cdCurrentlyDisplayedArray.length; i++) {\n if (cdCurrentlyDisplayedArray[i] == id) {\n return true;\n }\n }\n return false\n}", "idPresent(id){\n console.log(\"userPreesent called\");\n \n if(this.data.length > 0){\n for (var i = 0; i < this.data.length; i++){\n if (this.data[i].id === id){\n return true;\n }\n \n }\n }\n return false;\n }", "function inRoom(roomId) {\n return $(\"#room-\" + roomId).length > 0;\n }", "function isStudentExist (id) {\n\tfor (var i = 0; i < students.length; i++) {\n\t\tif (students[i].id === id) {\n\t\t\treturn true;\n\t\t}\n\t}\n\tconsole.log(`Student with id ${id} does not exist.`);\n\treturn false;\n}", "function existsApplication(id) {\n var k;\n for (k in apps)\n if (k == id)\n return true;\n return false;\n }", "speakerExists(speaker_id) {\n // this function retrieves all the speaker_id data. If the input speaker_id is included in that data, the function returns true. If it is not, the function returns false.\n // reload speaker data\n this.mountSpeakers();\n // convert speaker_id input to int, if it isn't already\n speaker_id = parseInt(speaker_id);\n // array of all speaker objects\n let speakers = this.state.allSpeakers.slice();\n // array of IDs for all speaker objects\n let speakerIDs = speakers.map(speaker => speaker.speaker_id);\n return (speakerIDs.includes(speaker_id));\n }", "function zombieById(id){\n\tvar i = 0;\n\tvar notFound = true;\n\twhile(notFound && i < window.enemies.length){\n\t\tif(enemies[i].getid() == id){\n\t\t\treturn enemies[i];\n\t\t};\n\n\t\ti++;\n\t};\n\t//returns false if the zombie isn't found \n\treturn false;\n}", "function playerById (id) {\n var i\n for (i = 0; i < players.length; i++) {\n if (players[i].id === id) {\n return players[i]\n }\n }\n\n return false\n}", "function playerById (id) {\n var i\n for (i = 0; i < players.length; i++) {\n if (players[i].id === id) {\n return players[i]\n }\n }\n\n return false\n}", "roomExists(roomCode) {\n return this.rooms.hasOwnProperty(roomCode);\n }", "async AssetExists(ctx, id) {\r\n const assetJSON = await ctx.stub.getState(id);\r\n return assetJSON && assetJSON.length > 0;\r\n }", "async function createOrJoinGame() {\n // get deck name from input\n const gameName = document.getElementById('deckNameInput').value;\n\n // make API call to server to either continue an existing game or create a new game\n const gameData = await fetch(`/game/${gameName}/getOrCreate`);\n\n // get JSON body of API response\n game = await gameData.json();\n\n // hide the login details, show the game details\n document.getElementById('login-wrapper').classList.add('hidden');\n document.getElementById('game-wrapper').classList.remove('hidden');\n\n // begin the game\n initGame();\n}", "function validId(value) {\n if ((ids[value] === true) || (value === \"\")) return console.log(\"Please select a unique ID number.\");\n ids[value] = true;\n return true;\n}", "function checkExistentIdInArray(req, res, next) {\r\n // try {\r\n // const { id } = projects.find(x => x.id == req.body.id).id;\r\n // } catch {\r\n // return next();\r\n // }\r\n const project = projects.find(x => x.id === req.body.id);\r\n if (project) {\r\n return res\r\n .status(400)\r\n .json({ error: \"Project already existent, unable to proceed!\" });\r\n }\r\n return next();\r\n}", "hasResponse(id, siteId) {\n return this.getResponse(id, siteId).then((response) => {\n return !!response.choicegroupid;\n }).catch(() => {\n // No offline data found, return false.\n return false;\n });\n }", "function find_playerid(id) {\r\n\r\n\tfor (var i = 0; i < player_lst.length; i++) {\r\n\r\n\t\tif (player_lst[i].id == id) {\r\n\t\t\treturn player_lst[i]; \r\n\t\t}\r\n\t}\r\n\t\r\n\treturn false; \r\n}", "async function checkIfRefereeExist(referee_id){\n // TODO - check if match exist in matches db.\n let checkIfExist = await DButils.execQuery(`SELECT TOP 1 1 FROM dbo.Referees \n WHERE referee_id = '${referee_id}'`);\n let match_id_array = [];\n checkIfExist.map((element) => match_id_array.push(element)); //extracting the match id into array for checking if exist\n if(match_id_array.length==0){\n return false;\n }\n return true;\n }", "function checkIdExist(req, res, next) {\n const informedId = req.params.id;\n const checkId = projects\n .map((elm, index) => {\n let idValue = elm.id;\n return elm.id;\n })\n .includes(informedId);\n if (!checkId) {\n return res.status(400).send({ error: \"Id does not exists\" });\n }\n next();\n}", "function checkIfUserExists (callback) { \n connection.query(`SELECT * FROM user WHERE userid=${connection.escape(id)}`, (err, res)=>{\n if (err) {message.channel.send(embeds.errorOccured(message, err));}\n callback(res[0] !== undefined); \n });\n }", "async AssetExists(ctx, id) {\n const assetJSON = await ctx.stub.getState(id);\n return assetJSON && assetJSON.length > 0;\n }", "function checkGame(){\n if(game[\"gameNumber\"]===game[\"currentNumber\"]){\n //win\n alert(\"You have won! The number was: \"+game[\"gameNumber\"])\n resetGame();\n }\n else if(game[\"gameNumber\"]<game[\"currentNumber\"]){\n //lose\n alert(\"You have lost! The number was: \"+game[\"gameNumber\"])\n resetGame();\n }\n}", "function checkArrayExists(id, dataArray) {\n var isExists = false;\n for (var i = 0; i < dataArray.length; i++) {\n if (dataArray[i] === id) {\n isExists = true;\n break;\n }\n }\n return isExists;\n }" ]
[ "0.7769897", "0.6762202", "0.6533328", "0.6526197", "0.6513447", "0.6414351", "0.63780636", "0.63732934", "0.632636", "0.63113624", "0.6188926", "0.6170654", "0.6108004", "0.6096203", "0.60873115", "0.6084831", "0.60343456", "0.5999287", "0.59984", "0.5956601", "0.5923147", "0.59161884", "0.5877956", "0.58648884", "0.58615935", "0.586074", "0.5848422", "0.5841311", "0.58336127", "0.5831091", "0.58095086", "0.58010983", "0.5799887", "0.5794879", "0.57853466", "0.57741314", "0.57713336", "0.57698727", "0.57684624", "0.5767943", "0.576776", "0.57675695", "0.57672685", "0.5745668", "0.5745033", "0.5723829", "0.5716771", "0.5714104", "0.56923205", "0.5682938", "0.5682895", "0.5681997", "0.567079", "0.5662406", "0.56622267", "0.5661312", "0.56582505", "0.56582505", "0.56545943", "0.56518674", "0.56466764", "0.5643857", "0.5637699", "0.5634258", "0.5633601", "0.56180954", "0.56167734", "0.56158584", "0.5610536", "0.56065834", "0.5601903", "0.559217", "0.55911684", "0.5586984", "0.55752283", "0.557199", "0.55716413", "0.5566994", "0.5564038", "0.5559686", "0.55476296", "0.5545177", "0.5532801", "0.55173117", "0.55092984", "0.5503403", "0.5503403", "0.5500192", "0.5491429", "0.5487881", "0.5486033", "0.5483591", "0.5483208", "0.5482525", "0.5477438", "0.5462852", "0.5462604", "0.5456874", "0.5452545", "0.5451846" ]
0.7164941
1
Check if is the correct round
function checkRound(id, player){ let gameJson = reader.read(id).game; let last_round = gameJson.movements.length - 1; //If no move was made, checks to see if the move is from the first player if(gameJson.movements.length == 0 && gameJson.firstPlayer == player) return VALID; if(gameJson.movements.length == 0 && gameJson.firstPlayer != player) return WRONG_ROUND; if(gameJson.movements[last_round].movement.player == player) return WRONG_ROUND; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function has_round(ls, current_round){\r\n\r\n var round = (current_round !== null) ? current_round.split(' ') : null;\r\n\r\n if (round != null){\r\n var round_compare = ['Round '+round[1], 'Round '+ (--round[1])];\r\n\r\n for(var i=0; i < round_compare.length; ++i){\r\n //alert(round_compare[i]);\r\n if (ls == round_compare[i]){\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n}", "function isStrike(round){\n\tif(round[0] == 10 || round[1] == 10){\n\t\treturn true;\n\t}\n\treturn false;\n}", "function roundme(val) {\n return val;\n }", "function lastRound(){\r\n\tif(nthRound === rounds){\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\treturn false;\r\n\t}\r\n}", "function checkAreEqualR(val1, val2) {\n return checkAreEqual(round(val1), round(val2));\n }", "function floatEq(a, b) {\n return a == round(b);\n }", "range_correct(num, ans, round_range) {\n var diff = Math.abs(num - ans);\n if (diff / num < round_range) {\n return true\n }\n else {\n return false\n }\n }", "updateRound() {}", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "_isPokerRoundRelevant(pokerRound, roundContext) {\n\t\treturn true;\n\t}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof (roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof (roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding(roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof roundingFunction === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}" ]
[ "0.7213593", "0.67229235", "0.65547574", "0.64649296", "0.6388813", "0.6346499", "0.6344081", "0.6307989", "0.62026435", "0.6190968", "0.6190968", "0.618866", "0.61842614", "0.61813766", "0.61795115", "0.6169554", "0.6166224", "0.6164857", "0.6164857", "0.61486644", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113", "0.6145113" ]
0.0
-1
Check if the game has a winner or is a draw
function checkWin(id, player, x, y){ let gameJson = reader.read(id).game; let winner = '#' let virtualBoard = [ ['#', '#', '#'], ['#', '#', '#'], ['#', '#', '#'] ]; if(gameJson.movements.length == 0){ return VALID; } // Populates the virtualBoard with the moves for(let i = 0; i < gameJson.movements.length; i++){ j = gameJson.movements[i].movement.x; k = gameJson.movements[i].movement.y; virtualBoard[j][k] = gameJson.movements[i].movement.player; } virtualBoard[x][y] = player; if(checkCol(virtualBoard, x, player)) return WINNER if(checkLine(virtualBoard, y, player)) return WINNER if(checkDiag(virtualBoard, player)) return WINNER let round = gameJson.movements.length - 1; round = gameJson.movements[round].movement.round; if(winner == '#' && round == 8){ return DRAW; } return VALID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameIsDraw(game) {\n return game.winner === undefined && game.turn === 9;\n}", "function checkForWin() {\r\n if (game_1.isWinningState(board)) {\r\n var winner = game_1.detectWinner(board);\r\n view_1.displayGameOver(winner);\r\n }\r\n else if (game_1.isDrawState(board)) {\r\n view_1.displayGameOver(null);\r\n }\r\n}", "function checkWinner() {\r\n\t\t//check rows, cols, diags\r\n\t\t//if empty is 9, then we declare draw and end the game\r\n\r\n\t\tfor(var i = 0; i < winCombo.length; i++) {\r\n\t\t\tif(board[winCombo[i][0]].innerHTML != \" \" &&\r\n\t\t\t\tboard[winCombo[i][0]].innerHTML == board[winCombo[i][1]].innerHTML &&\r\n\t\t\t\tboard[winCombo[i][1]].innerHTML == board[winCombo[i][2]].innerHTML ) {\r\n\t\t\t\tboard[winCombo[i][0]].style.color = \"red\";\r\n\t\t\t\tboard[winCombo[i][1]].style.color = \"red\";\r\n\t\t\t\tboard[winCombo[i][2]].style.color = \"red\";\r\n\t\t\t\tcleanBgColor();\r\n\t\t\t\tdocument.getElementById(\"message\").innerHTML = board[winCombo[i][0]].innerHTML + \" wins!\";\r\n\t\t\t\tendGame();\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\r\n\t\t//check if the game is a draw \r\n\t\tif (empty == 0) {\r\n\t\t\tdocument.getElementById(\"message\").innerHTML = \"It's a draw.\";\r\n\t\t\tendGame();\r\n\t\t}\r\n\t}", "checkWinner() {\n this.checkInHorizontal(player.getPlayerColor()[0]);\n this.checkInVertical(player.getPlayerColor()[0]);\n this.checkInDiagonalTopLeftBottomRight(player.getPlayerColor()[0]);\n this.checkInDiagonalTopRightBottomLeft(player.getPlayerColor()[0]);\n\n //If board is full of pawns and no-one win then send that is draw \n const drawMessage = 'Game ended with draw';\n if (this.checkdraw()) {\n socket.emit('gameEnded', {\n room: this.getRoomId(),\n message: drawMessage,\n });\n this.endGameMessage(drawMessage);\n }\n }", "function drawChecker(){\r\n if (!winChecker(gameField) && isFull()){\r\n document.getElementById('winner').innerHTML = \"Nobody wins! We have a draw(standoff)!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n}\r\n }", "function checkWinOrLoss() {\n if (totalScore === randomNumToGuess) { // We have a winner\n wins++;\n initializeGame()\n }\n else if (totalScore > randomNumToGuess) { // We have a loser\n losses++;\n initializeGame();\n }\n else {\n updateUI;\n }\n }", "function gameIsDone(game) {\n return gameHasWinner(game) || gameIsDraw(game);\n}", "function check() {\n if (win(player)) {\n playFlag = false;\n displayWinner();\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n } else if (win(computer)) {\n playFlag = false;\n displayWinner();\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n } else if (\n (player.length == 5 && computerTurn === true) ||\n (computer.length == 5 && computerTurn === false)\n ) {\n playFlag = false;\n winner.innerHTML = 'Draw';\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n }\n playGame();\n}", "function gameHasWinner(game) {\n return game.winner !== undefined;\n}", "function win(){\n //logic for if the game is over\n //return who won the game of if its a draw\n var winner2 = win1(sendObj.Board);\n if (winner2 != \"none\"){\n if(winner2 == \"draw\"){\n sendObj.info = \"It's a draw!\";\n return true;\n }else{\n sendObj.info = winner2 + \" wins!\";\n return true;\n }\n }\n}", "checkForWinner(){\n //if someone has a winning combination\n if(this.hasWinningCombo()){\n this.setState({\n gameOver: true,\n winner: this.state.currentTurn + \" wins!\",\n winnerShort: this.state.currentTurn\n });\n return true;\n }\n //if the board is full and no one its a draw\n else if(this.boardIsFull()){\n this.setState({\n gameOver: true,\n winner: \" It's a draw!\"\n }); \n return true;\n }\n //keep playing since no one won and the board isn't full\n else\n {\n return false;\n }\n }", "checkForWinner() {\n if (this.primaryWinConditionsCheck()) {\n this.endGame();\n }\n }", "function checkWinner() {\n if (winnerCalled()) {\n gameOver();\n }\n}", "isWinner() {\n let resetGame = false;\n if (moveMadeCount > this.minWinnerCheckMove) {\n this.checkWinningPattern();\n\n if (!this.win && moveMadeCount == this.maxMove) {\n draw.classList.remove('d-none');\n resetGame = true;\n } else if (this.win) {\n this.declareWinner();\n let view = new View();\n view.checkRemainingBoxes();\n resetGame = true;\n }\n }\n return resetGame;\n }", "function checkWin() {\n if (userScore === numToMatch) {\n wins++;\n $(\"#wins\").text(\"Success: \" + wins);\n reset();\n } else if (userScore > numToMatch) {\n losses++\n $(\"#losses\").text(\"Fails: \" + losses);\n reset();\n }\n }", "function checkWinner() {\n\n // Select any random icon \n const computerChoice = pickRandomChoice();\n \n // Display user and computer choice\n updateSelection(user_select, userChoice);\n updateSelection(computer_select, computerChoice);\n\n //GAME RULES \n // Draw game if user and computer have the same choice\n if(userChoice === computerChoice){ \n winner.innerText = 'draw';\n }\n\n // Check if User Win \n else if(\n (userChoice === 'paper' && computerChoice === 'rock') || (userChoice === 'rock' && computerChoice === 'scissors')\n ||\n (userChoice === 'scissors' && computerChoice === 'paper')\n ) {\n // Display User Win\n updateScore();\n winner.innerText = 'you win';\n }\n \n // Else Computer Win\n else {\n \n // Display User Lost\n updateComscore();\n winner.innerText = 'you loss';\n }\n}", "function checkWinOrLose() {\n if (squares.length === 0) {\n state = `win`;\n console.log(\"win\");\n } else if (balls.length === 0) {\n state = `lose`;\n }\n}", "function checkWin() {\n if (currentSquare === finishPoint) {\n gameState = false;\n changeAllSquareColor('green');\n gameRound += 1;\n\n $('.displayRound').text(\"Round: \" + gameRound)\n\n $('.sidePannel').css(\"margin\", \"100px 0px\")\n\n resetGame();\n };\n}", "function checkDrawRound(){\r\n\talert('Do you won\"t to create another draw?');\r\n\t\t\tif(confirm){\r\n\t\t\t\t\tenterPlayer();\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\r\n}", "function checkForDraw () {\n\tif (usedBoxes.length === 9 && player1.hasWon === false && player2.hasWon === false) {\n\t\t$('#board').hide();\n\t\t$('.draw').show();\n\t}\n}", "function isWin() {\n\t//only after the game has been started and shuffling that we judge\n\tif (gameon && shuffling) {\n\t\tfor (var i = 0; i < squares.length; i++) {\n\t\t\tif (squares[i].position !== squares[i].identity) return false;\n\t\t}\n\t\treturn true;\n\t}\n}", "function check_winner() {\r\n var scores = global_scores;\r\n var winning_move;\r\n\r\n for (var i = 0; i < scores.length; i++) {\r\n if (scores[i] == grid_size) {\r\n return 1; // X won\r\n }\r\n else if (scores[i] == -(grid_size)) {\r\n return 2; // O won\r\n }\r\n }\r\n\r\n if (moves == (grid_size * grid_size)) {\r\n return 3; // Draw\r\n }\r\n\r\n return 0; // No winner yet\r\n}", "function isDraw() {\n if (occupiedCells === 9 && !isGameOver()) {\n playerDisplay.textContent = \"IT'S A TIE!\";\n modalHeader.textContent = \"IT'S A TIE!\";\n modalText.textContent = \"\";\n\n isGameOver(true);\n }\n}", "checkForDraw() {\n if (turn == 8 && this.match == false) {\n document.getElementById(\"winner\").innerHTML = \"The game ended in a draw\";\n document.getElementById(\"reset-button\").disabled = false;\n running = false;\n }\n }", "function drawWinner(){\n var isWinner = true;\n for (var i = 0; i < answers.length; i++){\n if (!answers[i].found){\n isWinner = false;\n }\n }\n if (isWinner){\n tile.beginPath();\n tile.strokeStyle = '#36a500';\n tile.fillStyle = '#000000';\n tile.lineWidth = 25;\n tile.fillRect(100, 90, 300, 200);\n tile.clearRect(110, 100, 280, 180);\n tile.strokeRect(120, 110, 260, 160);\n tile.font = 'bold 42pt serif';\n tile.fillText('You Win!', 137, 208);\n tile.closePath();\n }\n}", "function checkGameOver(){\n if (game.game_over()) {\n var winner;\n if(game.in_stalemate()){\n info = \"Stalemate\";\n }\n announcedGameOver = true;\n if(game.in_draw()){\n winner = \"Draw\";\n if(game.in_stalemate()){\n winner = \"Stalemate\";\n }\n $('#engineStatus').html(winner);\n }\n if(game.in_checkmate()){\n winner = game.turn() == 'w' ? 'Black won!' : 'White won!';\n $('#engineStatus').html(winner);\n }\n }\n }", "function isWinner(selection, opponentSelection) {\r\n return (selection.beats === opponentSelection.name)\r\n}", "function checkWinner() {\n if (matchCount !== shapes.length) {\n\t\treturn;\n }\n\n\ttimer.stop();\n\n let ticks = timer.getTicks();\n let timeSpent = timer.getTime(ticks);\n MemoryStorage.setItem(Date.now(), ticks);\n\n showModal();\n}", "function checkForWin() {\n var winner = true;\n var youWin = document.getElementById(\"win\");\n for (var i = 0; i < board.cells.length; i++) {\n if (board.cells[i].isMine === true && board.cells[i].isMarked === false) {\n return \"\";\n }\n if (board.cells[i].isMine === false && board.cells[i].hidden === true) {\n return \"\";\n }\n }\n lib.displayMessage(\"You win!\");\n youWin.play();\n document.getElementById(\"fireworks.wav\").play();\n }", "function checkWinner() {\n stopLoop();\n Game.powerUpCanvas.font = \"italic 36px calibri\";\n\n if (Game.players[1].score > Game.players[0].score) {\n Game.powerUpCanvas.fillStyle = \"Purple\";\n Game.powerUpCanvas.fillText(\"Purple player wins!\", 100, 250);\n }\n\n else if (Game.players[0].score > Game.players[1].score) {\n Game.powerUpCanvas.fillStyle = \"Green\";\n Game.powerUpCanvas.fillText(\"Green player wins!\", 500, 250);\n Game.players[0].srcX = 326;\n Game.players[0].srcY = 1182;\n }\n else if (Game.players[1].score === Game.players[0].score) {\n Game.powerUpCanvas.fillText(\"Draw!\", 390, 250);\n }\n}", "function checkWinningCondition() {\n\tif (matchedCards.length === 16) {\n\t\tstopTimer();\n\t\toverlay();\n\t} else {\n\t\treturn false;\n\t}\n}", "function winDetection(item) {\n\n //keep track of moves to determine a draw\n moveCount++\n\n //id of the current item\n var itemId = $(item).attr(\"id\");\n\n //store the current counter\n var counter = $(item).attr(\"data-counter\"); // e.g. X / O\n\n //possible winning combinations based on counter location\n var winningCombos = {\n \"one\": [[\"two\", \"three\"], [\"five\", \"nine\"], [\"four\", \"seven\"]],\n \"two\": [[\"one\", \"three\"], [\"five\",\"eight\"]],\n \"three\": [[\"one\", \"two\"], [\"five\", \"seven\"], [\"six\", \"nine\"]],\n \"four\": [[\"one\", \"seven\"], [\"five\",\"six\"]],\n \"five\": [[\"four\", \"six\"], [\"two\", \"eight\"], [\"one\", \"nine\"], [\"three\",\"seven\"]],\n \"six\": [[\"three\", \"nine\"], [\"four\", \"five\"]],\n \"seven\": [[\"one\", \"four\"], [\"three\", \"five\"], [\"eight\", \"nine\"]],\n \"eight\": [[\"seven\", \"nine\"],[\"two\", \"five\"]],\n \"nine\": [[\"three\",\"six\"], [\"seven\",\"eight\"], [\"one\", \"five\"]]\n }\n\n var winner = false;\n\n winningCombos[itemId].forEach(function(item){\n\n if ( $(\"#\" + item[0]).attr(\"data-counter\") === counter && $(\"#\" + item[1]).attr(\"data-counter\") === counter ) {\n\n\n winner = true;\n\n // $(\"#\" + itemId).addClass(\"canvas-result\");\n // $(\"#\" + item[0]).addClass(\"canvas-result\");\n // $(\"#\" + item[1]).addClass(\"canvas-result\");\n\n gameBoard.hide();\n gameEnd = true;\n\n if (counter === playerCounter) {\n resultText.text(\"Winner!\").addClass(\"win\").removeClass(\"lose draw\");\n\n } else {\n resultText.text(\"Sorry, you lost!\").addClass(\"lose\").removeClass(\"win draw\");\n }\n\n return true;\n\n }\n\n return false;\n });\n\n if (moveCount === 9) {\n gameBoard.hide();\n gameEnd = true;\n\n resultText.text(\"It's a draw!\").addClass(\"draw\").removeClass(\"lose win\");\n resultsContainer.slideToggle(600);\n\n } else if (winner) {\n resultsContainer.slideToggle(600);\n }\n\n\n }", "function checkWin(player) {\n // Variables to keep track of win, start at true and are proved false\n var horizontalWin = true;\n var verticalWin = true;\n var d1Win = true;\n var d2Win = true;\n\n // Check horizontally\n for(var cIndex = 0; cIndex < NUM_COLS; cIndex++) {\n // Check each column at the same row value\n if(!boxes[row][cIndex].classList.contains(player)) {\n horizontalWin = false;\n }\n }\n\n // Check vertically\n for(var rIndex = 0; rIndex < NUM_ROWS; rIndex++) {\n // Check each row at the same column value\n if(!boxes[rIndex][column].classList.contains(player)) {\n verticalWin = false;\n }\n }\n\n // Check if the latest piece was placed in a position that could win\n // diagonally\n if((row === column) || (Math.abs(row - column) === NUM_ROWS - 1)) {\n for(var d = 0; d < NUM_ROWS; d++) {\n // Check diagonally from top left to bottom right\n if(!boxes[d][d].classList.contains(player)) {\n d1Win = false;\n }\n\n // Check diagonally from bottom left to top right\n if(!boxes[NUM_ROWS - d - 1][d].classList.contains(player)) {\n d2Win = false;\n }\n }\n }\n\n // Couldn't have won diagonally\n else {\n d1Win = false;\n d2Win = false;\n }\n\n //console.log(\"H: \" + horizontalWin + \", V: \" + verticalWin + \", D: \" + d1Win + \", \" + d2Win);\n\n // Player wins\n if(horizontalWin || verticalWin || d1Win || d2Win) {\n if(player === xClass) {\n victoryText.textContent = \"X Player Wins!\";\n // Increase score of X player\n xScore.textContent = Number(xScore.textContent) + 1\n }\n else {\n victoryText.textContent = \"O Player Wins!\";\n // Increase score of O player\n oScore.textContent = Number(oScore.textContent) + 1\n }\n\n $(victoryText).show('slow');\n gameOver = true;\n return true;\n }\n\n // If all spaces are taken and nobody has won\n if(boxCount === NUM_ROWS * NUM_COLS) {\n victoryText.textContent = \"Cat's Game\";\n $(victoryText).show('slow');\n gameOver = true;\n }\n\n // Didn't win... yet\n return false;\n\n }", "#determineIfGameOver() {\n const p1victory = this.players[1].gameboard.allShipsSunk();\n const p2victory = this.players[0].gameboard.allShipsSunk();\n \n if (p1victory) {\n this.#page.setDialog(GAME_STATE.p1victory);\n this.#isWinnerP1 = true;\n } else if (p2victory) {\n this.#page.setDialog(GAME_STATE.p2victory);\n this.#isWinnerP1 = false;\n }\n\n if (p1victory || p2victory) {\n this.#gameOver = true;\n this.#endGame();\n }\n }", "function winner() {\n let p1Count = 0;\n let p2Count = 0;\n let retVal = false;\n\n for (y = 0; y < 8; y++)\n for (x = 0; x < 8; x++) {\n if (board[y][x] == PLAYER1)\n p1Count++;\n if (board[y][x] == PLAYER2)\n p2Count++;\n }\n\n DK_SCORE.value = p1Count;\n LT_SCORE.value = p2Count;\n\n if (boxesTaken > 63) {\n if (p1Count > p2Count)\n PopUpMessage(\"Dark Player won\");\n if (p1Count < p2Count)\n PopUpMessage(\"Light Player won\");\n if (p1Count == p2Count)\n PopUpMessage(\"It's a tie!\");\n retVal = true;\n }\n\n return retVal;\n}", "function checkRoundWinner() {\n var activePlayer = players[activePlayerIndex];\n var boardScores = getCurrentBoardRowScores();\n var winningScoreValue = activePlayer.scorePoints * 3;\n var isWinningCombination = boardScores.indexOf(winningScoreValue) > 0;\n\n if (isWinningCombination) {\n activePlayer.winningRounds++;\n return $(document).trigger('roundWinner', activePlayer);\n } else {\n return boardHasEmptySpaces() ? switchActivePlayer() : setTimeout(clearBoard, 800);\n }\n}", "function isWinner() {\n //store player if x or o or undefined//\n const tile0 = tiles[0].classList[2];\n const tile1 = tiles[1].classList[2];\n const tile2 = tiles[2].classList[2];\n const tile3 = tiles[3].classList[2];\n const tile4 = tiles[4].classList[2];\n const tile5 = tiles[5].classList[2];\n const tile6 = tiles[6].classList[2];\n const tile7 = tiles[7].classList[2];\n const tile8 = tiles[8].classList[2];\n\n const winningConditions = [\n //row are the same//\n [tile0, tile1, tile2],\n [tile3, tile4, tile5],\n [tile6, tile7, tile8],\n //column are the same//\n [tile0, tile3, tile6],\n [tile1, tile4, tile7],\n [tile2, tile5, tile8],\n //diagonally are the same//\n [tile0, tile4, tile8],\n [tile2, tile4, tile6],\n ];\n\n //any winning condition//\n winningConditions.some((tile) => {\n if (tile[0] && tile[0] === tile[1] && tile[0] === tile[2]) {\n playerDisplay.textContent = `Player ${tile[0]} won!`;\n modalHeader.textContent = \"\";\n modalText.textContent = `Player ${tile[0]} won`;\n isGameOver(true);\n //display previous button//\n return tile;\n } else {\n isDraw();\n }\n });\n}", "function winCheck() {\n if (userScore === computerPick) {\n wins++;\n $(\"#wins\").html(\"Wins: \" + wins);\n alert(\"Winning isn’t everything, it’s the ONLY thing\");\n newGame();\n }\n\n else if (userScore > computerPick) {\n losses++;\n $(\"#losses\").html(\"Losses: \" + losses);\n alert(\"...if you ain't first, you're last\");\n newGame();\n };\n }", "function checkResult() {\n //first, checks if the result is a draw\n if(playerChoice === enemyChoice) {\n winner = \"none\";\n alert(\"Draw! Try again.\");\n return;\n }\n\n //if not, move on and check each condition\n if(playerChoice === \"horse\") {\n if(enemyChoice === \"sword\") {\n winner = \"enemy\";\n }\n else {\n winner = \"player\";\n }\n }\n if(playerChoice === \"hay\") {\n if(enemyChoice === \"horse\") {\n winner = \"enemy\";\n }\n else {\n winner = \"player\";\n }\n }\n if(playerChoice === \"sword\") {\n if(enemyChoice === \"hay\") {\n winner = \"enemy\";\n }\n else {\n winner = \"player\";\n }\n }\n gameOver(winner);\n}", "function checkwinner(){\n winner = 0;\n for (check = 0; check < winning.length;check++){\n a = winning[check][0];\n b = winning[check][1];\n c = winning[check][2];\n if ((board[a] == board[b]) &&\n (board[b] == board[c]) &&\n (board[a] != EMPTY)){\n winner = board[a];\n $(\"hr\").removeClass();\n $(\"hr\").addClass(winning[check][3]);\n $('.lines').hide().fadeIn('fast');\n\n\n if (winner == me){$('.winner2').html('I won !Play again?');}\n else {$('.winner2').html('Congratulations! You Won Play again?');}\n $('.winner').hide().fadeIn(3000);\n $('.yesno').hide().fadeIn('fast');\n }\n\n }\n if ((choices.length==0) && (winner ==0)){\n $('hr').removeClass();\n $('.winner').hide().fadeIn(1000);\n $('.yesno').hide().fadeIn('slow');\n $('.winner2').html('It was a draw Play again?');\n }\n }", "function checkWin() {\n //check if there is a winner\n return WINARR.some(function (arr) {\n return (\n playerChoices[arr[0]] === playerChoices[arr[1]] &&\n playerChoices[arr[0]] === playerChoices[arr[2]] &&\n playerChoices[arr[2]]\n );\n });\n}", "function checkWin() {\n var tieGame = true;\n\n for (var combo in lines) {\n if (lines[combo].length === 3) {\n if (lines[combo][0] === lines[combo][1] && lines[combo][1] === lines[combo][2]) {\n winner = lines[combo][0];\n setTimeout(endOfGame(winner + ' won the game!'), 700);    \n tieGame = false;\n win = true;\n         canMove = false;      \n }\n } else {\n tieGame = false;\n }\n }\n if (tieGame) {\n setTimeout(endOfGame('It was a Tie Game!'), 700);\n win = true;\n     canMove = false;  \n }\n }", "checkVictory() {\n const turnsToCheck = this.turn === TURN.OH ? this.ohs : this.exs;\n\n // prettier-ignore\n const winning = [\n [0, 1, 2],\n [0, 3, 6],\n [0, 4, 8],\n [1, 4, 7],\n [2, 4, 6],\n [2, 5, 8],\n [3, 4, 5],\n [6, 7, 8],\n ];\n\n for (let i = 0; i < winning.length; i++) {\n this.won = winning[i].every((w) => turnsToCheck.includes(w));\n if (this.won) {\n this.ctx.fillStyle = '#00FF0040';\n this.ctx.fillRect(0, 0, this.gameWidth, this.gameHeight);\n return;\n }\n }\n }", "function isWin() {\n var cellsClickedCount = gGame.shownCount + gGame.markedCount;\n if (cellsClickedCount === (gSize * gSize) && (gGame.markedCount === gBombAmount)) {\n clearInterval(gTimerInterval);\n elBtn.innerHTML = '😎';\n getBestScore();\n gGame.isOn = false;\n return true;\n }\n return false;\n}", "function checkWinCondition() {\n if (gameScore === targetNum) {\n alert(\"You win!\");\n wins++;\n gameScore = 0;\n crystalValues.length = 0;\n theGame();\n }\n\n //lose condition, effects\n else if (gameScore >= targetNum) {\n alert(\"You lose!\");\n losses++;\n gameScore = 0;\n crystalValues.length = 0;\n theGame();\n }\n }", "function checkForWin(){\r\n let winCases = [[0,3,6],[1,4,7],[2,5,8],[0,1,2],[3,4,5],[6,7,8],[0,4,8],[2,4,6]];\r\n for(let i = 0; i < winCases.length; i++){\r\n if(sameChar(tds.pick(winCases[i]))){\r\n // highlight boxes in win condition\r\n newColor(tds.pick(winCases[i]), 'win');\r\n return true\r\n }\r\n }\r\n return false\r\n }", "function checkWinner() {\n const p1Winscore = winScore === p1Score\n const p2Winscore = winScore === p2Score\n if (p1Winscore || p2Winscore) {\n p1BtnElm.setAttribute('disabled', 'disabled')\n p2BtnElm.setAttribute('disabled', 'disabled')\n }\n displayWinner(p1Winscore, p2Winscore)\n }", "checkForWin() {\n if ((this.state.availCells.length <= 4) && (this.state.winner === '')) {\n this.winCheck()\n } else {\n this.nextTurn()\n }\n }", "function checkGameOver(){\n if (announcedGameOver) {\n return;\n }\n if (game.game_over()) {\n var info, winner;\n if(game.in_stalemate()){\n info = \"Stalemate\";\n }else info = \" \";\n announcedGameOver = true;\n if(game.in_draw()){\n winner = \"Draw\";\n $('#end-info').html(info);\n $('#end-winner').html(winner);\n $( \"#end-dialog\" ).dialog('open').dialog('widget').position({\n my: 'middle',\n at: 'middle',\n of: $('#board'),\n });\n }\n if(game.in_checkmate()){\n info = \"Checkmate\";\n winner = game.turn() == 'w' ? 'Black is victorious!' : 'White is victorious!';\n $('#end-info').html(info);\n $('#end-winner').html(winner);\n $( \"#end-dialog\" ).dialog('open').dialog('widget').position({\n my: 'middle',\n at: 'middle',\n of: $('#board'),\n });\n }\n }\n }", "function checkWinCondition(x,y){\n\t// Check Right & Left\n\twinConditionCount = 0;\n\tcountRight(x,y);\n\tcountLeft(x,y);\n\tif(winConditionCount >= 3){\n\t\thasWinner = true;\n\t\treturn true;\n\t};\n\t// Check Down\n\twinConditionCount = 0;\n\tcountDown(x,y);\n\tif(winConditionCount >= 3){\n\t\thasWinner = true;\n\t\treturn true;\n\t}\n\t// Check Up/Right & Down/Left\n\twinConditionCount = 0;\n\tcountUpRight(x,y);\n\tcountDownLeft(x,y);\n\tif(winConditionCount >= 3){\n\t\thasWinner = true;\n\t\treturn true;\n\t}\n\t// Check Up/Left & Down/Right\n\twinConditionCount = 0;\n\tcountUpLeft(x,y);\n\tcountDownRight(x,y);\n\tif(winConditionCount >= 3){\n\t\thasWinner = true;\n\t\treturn true;\n\t}\n\treturn false;\n}", "isDraw() {\n\tif(!this.isFinished()||this.getWinner()!==null)\n return false;\n else\n return true;\n }", "checkForWinner(){\n console.log('Checking for winner.');\n for (let condition of this.winStates){\n let winningCondition = true;\n for (let position of condition){\n if (this.gameState[position[0]][position[1]] != this.currentPlayer.token) {\n winningCondition = false;\n }\n }\n if (winningCondition) {\n console.log('We have a winner!');\n console.log(`Condition is: ${condition}`);\n this.gameStatus = 'won';\n this.winner = this.currentPlayer;\n\n // If we've gotten here, then we need to create a `win` event and\n // dispatch it.\n\n let winEvent = new Event('win');\n document.dispatchEvent(winEvent);\n\n return true; // Return a value to stop processing the additional move count check.\n }\n }\n this.moveCount++;\n console.log(`Reviewed move ${this.moveCount}.`)\n if (this.moveCount >= 9) {\n console.log(`This game is a draw at ${this.moveCount} moves.`);\n this.gameStatus = 'draw';\n\n let drawEvent = new Event('draw');\n document.dispatchEvent(drawEvent);\n }\n }", "function checkForWin() {\n var isWinner = true\n\n for (let i = 0; i < board.cells.length; i++) {\n var cell = board.cells[i]\n\n if (cell.isMine && !cell.isMarked || cell.hidden && !cell.isMine) {\n isWinner = false\n }\n }\n\n if (isWinner) {\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n lib.displayMessage('You win!');\n winAudio.play();\n }\n}", "function winCheck() {\n if (winGameVertical(0,0) == true || winGameHorizontal(0,0) == true || winGameLeftToRight(2,0) == true || winGameRightToLeft(0,0) == true) {\n gamewon = true;\n if (symbol == playerOne.symbol) {\n P1Wins.innerHTML = (Number(P1Wins.textContent) + 1);\n turn.textContent = \"Player \" + playerOne.name + \" is the winner!\";\n } else {\n P2Wins.innerHTML = (Number(P2Wins.textContent) + 1);\n turn.textContent = \"Player \" + playerTwo.name + \" is the winner!\";\n }\n fillBoard();\n tictacbingo = false;\n symbol = \"O\";\n } else if (symbol == playerOne.symbol) {\n turn.textContent = \"Your turn player \" + playerTwo.name + \": O\";\n } else {\n turn.textContent = \"Your turn player \" + playerOne.name + \": X\";\n }\n return gamewon\n}", "function checkWinner(user, computer) {\n gamePlayed++;\n var verdict;\n\n if (user == computer) {\n gameDraw++;\n verdict = 'draw';\n }\n if (\n user == \"paper\" && computer == \"rock\" ||\n user == \"rock\" && computer == \"scissors\" ||\n user == \"scissors\" && computerPlay == \"paper\"\n ) {\n gameWon++;\n verdict = 'win';\n }\n if (\n computer == \"paper\" && user == \"rock\" ||\n computer == \"rock\" && user == \"scissors\" ||\n computer == \"scissors\" && user == \"paper\"\n ) {\n gameLost++;\n verdict = 'lose';\n }\n\n updateScoreDisplay(gameDraw, gameWon, gameLost, gamePlayed);\n $(\"#game-result\").html(\"You \" + verdict + \"!\").hide().fadeIn(3000);\n}", "checkForWin() {\n if (this.numMafia <= 0) { this.gameState = TOWN_WIN; }\n if (this.getInnocentPlayerCount() <= 0) { this.gameState = MAFIA_WIN; }\n }", "function CheckWin(plays) {\n\t\tif (oplays.length + xplays.length == 9) {\n\t\t\tconsole.log(\"DRAW!\");\n\t\t\treturn true;\n\t\t}\n\t\t\treturn false;\n\t}", "function checkIfWin(){\n console.log(\"check win:\");\n if (counterNumber == goalNumber) {\n wins += 1;\n alert(\"You won!\");\n startGame();\n }\n\n if (counterNumber > goalNumber) {\n losses += 1;\n alert(\"You lost. If you're having trouble, you can pay to help your chances via micro-transactions. Coming soon!\");\n startGame();\n }\n}", "function checkIfGameEnded() {\r\n if (chances == 10) gameOver();\r\n if (win == true) winner();\r\n}", "function winnerCheck(){\n console.log(\"in winnerCheck function\");\n\n var result = \"no winner yet\";\n\n\n if (players[0].health < 1 && players[1].health < 1) {\n result=\"Draw\";\n } else if (players[0].health < 1) {\n result = players[1].name + \" Wins!!!\";\n } else if (players[1].health < 1) {\n result = players[0].name + \" Wins!!!\";\n }\n\n return result;\n }", "function winner() {\n var playerTotal = playerHand.calculatePoints();\n if (playerHand.calculatePoints() < dealerHand.calculatePoints()) {\n var dealerTotal = dealerHand.calculatePoints();\n $('#messages').append('Dealer wins');\n $('#again-button').show();\n $('#hit-button, #stand-button').attr('disabled', true);\n } else if (dealerHand.calculatePoints() < playerHand.calculatePoints()) {\n $('#messages').append('You win!');\n $('#again-button').show();\n $('#hit-button, #stand-button').attr('disabled', true);\n } else {\n $('#messages').append('Push');\n }\n }", "function checkWin() {\n if ((userGuess === \"r\") && (opponentGuess === \"s\")) {\n wins++;\n } else if ((userGuess === \"r\") && (opponentGuess === \"p\")) {\n losses++;\n } else if ((userGuess === \"s\") && (opponentGuess === \"r\")) {\n losses++;\n } else if ((userGuess === \"s\") && (opponentGuess === \"p\")) {\n wins++;\n } else if ((userGuess === \"p\") && (opponentGuess === \"r\")) {\n wins++;\n } else if ((userGuess === \"p\") && (opponentGuess === \"s\")) {\n losses++;\n } else if (userGuess === opponentGuess) {\n ties++;\n }\n}", "function is_game_over () {\n if (round < questions.length) {\n return false; \n } else {\n return true;\n }\n}", "function check(){\n if(score < compNum){\n return;\n }\n if (score == compNum){\n alert(\"win!\");\n wins ++;\n $(\"#wins\").text(wins);\n roundReset();\n }\n if(score > compNum) {\n alert(\"lose!\");\n losses ++;\n $(\"#losses\").text(losses);\n roundReset();\n }\n }", "function checkwinner(){\n winner = 0;\n for (check = 0; check < winning.length;check++){\n a = winning[check][0];\n b = winning[check][1];\n c = winning[check][2];\n if ((board[a] == board[b]) &&\n (board[b] == board[c]) &&\n (board[a] != EMPTY)){\n winner = board[a];\n $(\"hr\").removeClass();\n $(\"hr\").addClass(winning[check][3]);\n $('.lines').hide().fadeIn('fast');\n\n\n if (winner == me){$('.winner2').html('I won !Play again?');}\n else {$('.winner2').html('Congratulations! You Won Play again?');}\n $('.winner').hide().fadeIn(3000);\n $('.yesno').hide().fadeIn('fast');\n }\n\n }\n if ((choices.length==0) && (winner ==0)){\n $('hr').removeClass();\n $('.winner').hide().fadeIn(1000);\n $('.yesno').hide().fadeIn('slow');\n $('.winner2').html('It was a draw Play again?');\n }\n}", "function checkWin(){\n if ((board.top.col1===board.top.col2 && board.top.col3===\"X\") || (board.top.col1===board.top.col2 && board.top.col3===\"O\")){\n running = false;\n console.log(\"Someone won!\");\n };\n if ((board.middle.col1===board.middle.col2 && board.middle.col3===\"X\") || (board.middle.col1===board.middle.col2 && board.middle.col3===\"O\")){\n running = false;\n console.log(\"Someone won!\");\n };\n if ((board.bottom.col1===board.bottom.col2 && board.bottom.col3===\"X\") || (board.bottom.col1===board.bottom.col2 && board.bottom.col3===\"O\")){\n running = false;\n console.log(\"Someone won!\");\n };\n if ((board.top.col1===board.middle.col2 && board.bottom.col3===\"X\") || (board.top.col1===board.middle.col2 && board.bottom.col3===\"O\")){\n running = false;\n console.log(\"Someone won!\");\n };\n if ((board.top.col3===board.middle.col2 && board.bottom.col1===\"X\") || (board.top.col3===board.middle.col2 && board.bottom.col1===\"O\")){\n running = false;\n console.log(\"Someone won!\");\n };\n}", "check_GameOver() {\n if (this.model.winner == 0) {\n if (this.currentPlayerBot == 0) {\n this.scene.undo_play = false;\n this.state = 'WAIT_UNDO';\n }\n else\n this.state = 'CHANGE_PLAYER';\n }\n else{\n this.state = 'GAME_OVER';\n this.scene.showGameMovie = false;\n this.view.incWinsPlayer(this.model.winner);\n }\n }", "function checkWinner() {\n if(resistanceWins == 3) {\n winner = true;\n return true;\n } else if(spyWins == 3) {\n return true;\n }\n return false;\n}", "function winConditions() {\n let notADraw = false;\n display();\n\n function compareVariables(a, b, c) {\n if (a === b && b === c && c === a) {\n if (a === AIside) {\n notADraw = true;\n AIWins();\n } else if (a === humanSide) {\n notADraw = true;\n playerWins();\n } else {\n return; // Do nothing\n }\n }\n }\n\n function testForDraw(movesQuantity) {\n if (movesQuantity === 9 && !notADraw) {\n drawItis();\n }\n }\n\n // Testing all win conditions\n compareVariables(arr[0], arr[1], arr[2]);\n compareVariables(arr[3], arr[4], arr[5]);\n compareVariables(arr[6], arr[7], arr[8]);\n compareVariables(arr[0], arr[3], arr[6]);\n compareVariables(arr[1], arr[4], arr[7]);\n compareVariables(arr[2], arr[5], arr[8]);\n compareVariables(arr[0], arr[4], arr[8]);\n compareVariables(arr[2], arr[4], arr[6]);\n // Checking if it is a draw\n testForDraw(moves);\n }", "function check_winner(){ //NOT FUNCTIONING YET //see if there's a winner\n\tconsole.log(\"check winner run\"); \n\tconsole.log('value of i is _'+ i);\n\tfor(var i = 0; i < win_options.length; i++){\n\t\tfor(var j=0; j <win_options[i].length; j++){\n\t\n\t\t\tif(player_clicks[win_options[i][0]]==player_clicks[win_options[i][1]]\n\t\t\t\t&&\n\t\t\t\tplayer_clicks[win_options[i][1]]==player_clicks[win_options[i][2]]){\n\t\t\t\twin_confirmation();\n\t\t\t\twinner_found = 1;\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t}\n}", "winCheck() {\n if (this.state.A1 === this.state.A2 && this.state.A2 === this.state.A3) {\n this.updateState(this.state.A2)\n } else if (this.state.B1 === this.state.B2 && this.state.B3 === this.state.B2) {\n this.updateState(this.state.B2)\n } else if (this.state.C1 === this.state.C2 && this.state.C3 === this.state.C2) {\n this.updateState(this.state.C2)\n } else if (this.state.A1 === this.state.B2 && this.state.C3 === this.state.B2) {\n this.updateState(this.state.B2)\n } else if (this.state.C1 === this.state.B2 && this.state.A3 === this.state.B2) {\n this.updateState(this.state.B2)\n } else if (this.state.A1 === this.state.B1 && this.state.C1 === this.state.B1) {\n this.updateState(this.state.B1)\n } else if (this.state.A2 === this.state.B2 && this.state.C2 === this.state.B2) {\n this.updateState(this.state.B2)\n } else if (this.state.A3 === this.state.B3 && this.state.C3 === this.state.B3) {\n this.updateState(this.state.B3)\n } else if ((this.state.availCells.length <= 1) && (this.state.winner === '')) {\n this.updateState('draw')\n } else {this.nextTurn()}\n }", "function decideWinner() {\n\tgameOver = true;\n\tcardOpacity();\n\tif (player1.score > 21 && player2.score > 21) {\n\t\ttextTitle.textContent = \"No one won!\";\n\t\tdrawSound.play();\n\t\tplayer1.draws++;\n\t\tplayer2.draws++;\n\t\tdocument.querySelector(\".player1-draws\").textContent = player1.draws;\n\t\tdocument.querySelector(\".player2-draws\").textContent = player2.draws;\n\t} else if (player1.score > 21) {\n\t\ttextTitle.textContent = \"Player 2 won!\";\n\t\tlossSound.play();\n\t\tplayer2.wins++;\n\t\tplayer1.losses++;\n\t\tdocument.querySelector(\".player1-losses\").textContent = player1.losses;\n\t\tdocument.querySelector(\".player2-wins\").textContent = player2.wins;\n\t} else if (player2.score > 21) {\n\t\ttextTitle.textContent = \"Player 1 won!\";\n\t\twinSound.play();\n\t\tplayer1.wins++;\n\t\tplayer2.losses++;\n\t\tdocument.querySelector(\".player1-wins\").textContent = player1.wins;\n\t\tdocument.querySelector(\".player2-losses\").textContent = player2.losses;\n\t} else {\n\t\tconst player1Complement = 21 - player1.score;\n\t\tconst player2Complement = 21 - player2.score;\n\t\tif (player1Complement < player2Complement) {\n\t\t\ttextTitle.textContent = \"Player 1 won!\";\n\t\t\twinSound.play();\n\t\t\tplayer1.wins++;\n\t\t\tplayer2.losses++;\n\t\t\tdocument.querySelector(\".player1-wins\").textContent = player1.wins;\n\t\t\tdocument.querySelector(\".player2-losses\").textContent = player2.losses;\n\t\t} else if (player2Complement < player1Complement) {\n\t\t\ttextTitle.textContent = \"Player 2 won!\";\n\t\t\tlossSound.play();\n\t\t\tplayer2.wins++;\n\t\t\tplayer1.losses++;\n\t\t\tdocument.querySelector(\".player1-losses\").textContent = player1.losses;\n\t\t\tdocument.querySelector(\".player2-wins\").textContent = player2.wins;\n\t\t} else {\n\t\t\ttextTitle.textContent = \"Draw\";\n\t\t\tdrawSound.play();\n\t\t\tplayer1.draws++;\n\t\t\tplayer2.draws++;\n\t\t\tdocument.querySelector(\".player1-draws\").textContent = player1.draws;\n\t\t\tdocument.querySelector(\".player2-draws\").textContent = player2.draws;\n\t\t}\n\t}\n}", "checkForWinner(){\n if (turn >= 4) {\n var x;\n if (this.choice == \"x\") {\n canvas.strokeStyle = \"#E93636\";\n }\n\n else {\n canvas.strokeStyle = \"#4C4CEE\";\n }\n\n for (var i = 0;i<3; i++) {\n x = i*3\n if (boardSquares[x].choice ==\n this.choice && boardSquares[x+1].choice == this.choice && boardSquares[x+2].choice == this.choice) {\n this.match = true;\n this.draw = {\n \"rightX\": .11,\n \"rightY\": .14+(i)*(.333),\n \"leftX\": .89,\n \"leftY\": .14+(i)*(.333)\n };\n this.drawLine();\n }\n }\n\n for (var i = 0;i<3;i++) {\n if (boardSquares[i].choice ==\n this.choice && boardSquares[i+3].choice == this.choice && boardSquares[i+6].choice == this.choice) {\n this.match = true;\n this.draw = {\n \"rightX\": .168+(i)*(.333),\n \"rightY\": .064,\n \"leftX\": .168+(i)*(.333),\n \"leftY\": .89\n };\n this.drawLine();\n }\n }\n\n if (boardSquares[0].choice == this.choice && boardSquares[4].choice == this.choice && boardSquares[8].choice == this.choice){\n this.match = true;\n this.draw = {\n \"rightX\": .108,\n \"rightY\": .067,\n \"leftX\": .897,\n \"leftY\": .883\n };\n this.drawLine();\n }\n\n else if (boardSquares[2].choice == this.choice && boardSquares[4].choice == this.choice && boardSquares[6].choice == this.choice){\n this.match = true;\n this.draw = {\n \"rightX\": .897,\n \"rightY\": .067,\n \"leftX\": .108,\n \"leftY\": .883\n }\n this.drawLine()\n }\n\n if (this.match) {\n document.getElementById(\"myCanvas\").hidden = false;\n document.getElementById(\"winner\").innerHTML = \"Winner is: \" + player.toUpperCase();\n document.getElementById(\"reset-button\").disabled = false;\n running = false;\n }\n }\n }", "function checkForWinner () {\t\t\n\t\tif ($scope.slotData[0].result === $scope.slotData[1].result && $scope.slotData[0].result === $scope.slotData[2].result)\t{\t\t\t\t\n\t\t\t// determine the reward\n\t\t\tif ($scope.slotData[0].result === 0) {$scope.reward = 'coffee'; }\n\t\t\telse if ($scope.slotData[0].result === 1) {$scope.reward = 'tea'; }\n\t\t\telse {$scope.reward = 'espresso'; }\n\t\t\t// flash the border\n\t\t\tvar flashInterval = setInterval(function() {\n \t\t\t$('.reel-container').toggleClass('orange-border');\n\t\t\t}, 100);\t\t\t\t\t\n\t\t\tsetTimeout(function() {\n\t\t\t\t// stop the border flash but keep border, show prize\t\t\n\t\t\t\twindow.clearInterval(flashInterval);\n\t\t\t\twinningEffects(); \n\t\t\t}, 1000);\t\t\t\n\t\t}\n\t\t$scope.$apply(function () {\n\t\t\t$scope.gameStatus = true;\t\t\t\t\n\t\t})\n\t}", "checkVictory(){\n\t\tthis.res = {victory: false, type: \"\", player: \"\"};\n\n\t\tlet total = this.scoreboard.total;\n\t\tlet r_solid = this.scoreboard.p0_solid;\n\t\tlet b_solid = this.scoreboard.p1_solid;\n\t\tif (r_solid > total/2)\n\t\t\tthis.res = {victory: true, type: \"domination\", player: \"red\"};\n\t\tif (b_solid > total/2)\n\t\t\tthis.res = {victory: true, type: \"domination\", player: \"blue\"};\n\n\t\tif (this.scoreboard.empty == 0){\n\t\t\tthis.res.victory = true;\n\t\t\tthis.res.type = \"game_end\";\n\n\t\t\tlet r = this.scoreboard.p0 + r_solid;\n\t\t\tlet b = this.scoreboard.p1 + b_solid;\n\t\t\tif (r>b) this.res.player = \"red\";\n\t\t\tif (b>r) this.res.player = \"blue\";\n\t\t}\n\t\tif (this.res.victory && this.onwin)\n\t\t\tthis.onwin(this.res);\n\t}", "function checkWinner() {\n\tlet arrOfX = [];\n\tlet arrOfO = [];\n\ttd.map((curr, index) => {\n\t\tcurr = curr.innerHTML;\n\t\tif (curr === 'X') {\n\t\t\tarrOfX.push(index);\n\t\t} else if (curr === 'O') {\n\t\t\tarrOfO.push(index);\n\t\t}\n\t});\n\n\tfor (let i = 0; i < winCombo.length; i++) {\n\t\tif (arrOfX.length >= 3 && winCombo[i].every((elem) => arrOfX.indexOf(elem) > -1)) {\n\t\t\tendGame = true;\n\t\t\tplScore.innerHTML = Number(plScore.innerHTML) + 1;\n\t\t\tmsgPl.style.opacity = 1;\n\t\t\tbreak;\n\t\t} else if (arrOfO.length >= 3 && winCombo[i].every((elem) => arrOfO.indexOf(elem) > -1)) {\n\t\t\tendGame = true;\n\t\t\taiScore.innerHTML = Number(aiScore.innerHTML) + 1;\n\t\t\tendGameChecker();\n\t\t\tmsgAi.style.opacity = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (arrOfX.length === 5 && arrOfO.length === 4) {\n\t\tif (!endGame) {\n\t\t\tdrScore.innerHTML = Number(drScore.innerHTML) + 1;\n\t\t\tmsgDr.style.opacity = 1;\n\t\t}\n\t}\n}", "function checkForWinner() {\n\t\t// each click runs checkForWinner function\n\t\tfor (var i = 0; i < winningCombo.length; i++) {\n\t\t\tif (square[winningCombo[i][0]].innerText !== \"\" &&\n\t\t\t\tsquare[winningCombo[i][0]].innerText === square[winningCombo[i][1]].innerText &&\n\t\t\t\tsquare[winningCombo[i][1]].innerText === square[winningCombo[i][2]].innerText) {\n\t\t\t\talert('You won ' + square[winningCombo[i][2]].innerText + \". Great job!\");\n\t\t\t\treturn;\n\t\t\t\twinner = square[winningCombo[i][2]].innerText;\n\t\t\t};\n\t\t}\n\t}", "checkForWinner() {\n let t = this.state.board;\n let botsTurn = this.state.botsTurn;\n\n // check rows\n for (let i = 0; i <= 3; i++) {\n if ((t[i][0] !== 0) && (t[i][0] === t[i][1] && t[i][1] === t[i][2] && t[i][2] === t[i][3])) {\n this.setState({\n gameStatus: botsTurn ? \"You won!\": \"The Bot won!\",\n buttonsDisabled: true,\n playAgainDisplay: 'inline'\n });\n return;\n }\n }\n\n // check cols\n for (let j = 0; j <= 3; j++) {\n if ((t[0][j] !== 0) && (t[0][j] === t[1][j] && t[1][j] === t[2][j] && t[2][j] === t[3][j])) {\n this.setState({\n gameStatus: botsTurn ? \"You won!\": \"The Bot won!\",\n buttonsDisabled: true,\n playAgainDisplay: 'inline'\n });\n return;\n }\n }\n\n // check diagonal (top left -> bottom right)\n if ((t[0][0] !== 0) && (t[0][0] === t[1][1] && t[1][1] === t[2][2] && t[2][2] === t[3][3])) {\n this.setState({\n gameStatus: botsTurn ? \"You won!\": \"The Bot won!\",\n buttonsDisabled: true,\n playAgainDisplay: 'inline'\n });\n return;\n }\n\n // check diagonal (bottom left -> top right)\n if ((t[3][0] !== 0) && (t[3][0] === t[2][1] && t[2][1] === t[1][2] && t[1][2] === t[0][3])) {\n this.setState({\n gameStatus: botsTurn ? \"You won!\": \"The Bot won!\",\n buttonsDisabled: true,\n playAgainDisplay: 'inline'\n });\n return;\n }\n\n this.checkForDraw(); // if no winner, check for a draw\n }", "function isWinner() {\n\n\t\tvar winner = false;\n\t\tif (threeInaRow(0,1,2,turn) ||\n\t\t\tthreeInaRow(3,4,5, turn) ||\n\t\t\tthreeInaRow(6,7,8, turn) ||\n\t\t\tthreeInaRow(0,3,6, turn) ||\n\t\t\tthreeInaRow(1,4,7, turn) ||\n\t\t\tthreeInaRow(2,5,8, turn) ||\n\t\t\tthreeInaRow(0,4,8, turn) ||\n\t\t\tthreeInaRow(2,4,6, turn)) {\n\t\t\twinner = true;\n\t\t\t}\n\t\treturn winner;\n\t\t}", "function winChecker(gameField){\r\n if (gameField[0][0] === gameField[0][1] && gameField[0][1] === gameField[0][2] && gameField[0][0] != \"\" ) {\r\n document.getElementById('winner').innerHTML = gameField[0][0] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n\r\n if (gameField[1][0] === gameField[1][1] && gameField[1][1] === gameField[1][2] && gameField[1][0] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[1][0] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n\r\n if (gameField[2][0] === gameField[2][1] && gameField[2][1] === gameField[2][2] && gameField[2][0] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[2][0] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n if (gameField[0][0] === gameField[1][0] && gameField[1][0] === gameField[2][0] && gameField[0][0] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[0][0] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n if (gameField[0][1] === gameField[1][1] && gameField[1][1] === gameField[2][1] && gameField[0][1] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[0][1] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n if (gameField[0][2] === gameField[1][2] && gameField[1][2] === gameField[2][2] && gameField[0][2] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[0][2] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n if (gameField[0][0] === gameField[1][1] && gameField[1][1] === gameField[2][2] && gameField[0][0] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[0][0] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n if (gameField[0][2] === gameField[1][1] && gameField[1][1] === gameField[2][0] && gameField[0][2] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[0][2] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n return false;\r\n}", "function checkForWin() {\r\n // You can use this function call to declare a winner (once you've\r\n // detected that they've won, that is!)\r\n // lib.displayMessage('You win!')\r\n for (let i = 0; i < board.cells.length; i++) {\r\n const cell = board.cells[i];\r\n if ((cell.isMine && !cell.isMarked) || (!cell.isMine && cell.hidden)) {\r\n return;\r\n }\r\n }\r\n lib.displayMessage(\"You win!\");\r\n}", "function _checkResults (board) {\n const hasWon = _checkWin(board);\n const hasNull = _checkHasNull(board);\n\n if (hasWon) {\n return \"win\";\n }\n\n if (!hasNull) {\n return \"draw\";\n }\n\n return \"continue\";\n }", "function checkForWin() {\n\t// Check if all cards contain the class 'match', if so then game is won\n\tconst fullDeck = document.querySelectorAll('.card');\n\tconst win = Array.prototype.every.call(fullDeck, function(item){\n\t\treturn item.classList.contains('match');\n\t});\n\n\tif (win) {\n\t\tgameWon = true;\n\t\tclearInterval(intervalId);\n\t\tshowModal();\n\t}\n}", "function checkIfWin() {\n let isWon = true;\n arr.forEach((x) => {\n x.forEach((y) => {\n if (y.randomNum !== 0 && y.revealed === false) {\n isWon = false;\n }\n });\n });\n if (isWon) {\n setWin(true);\n setHeading(\":D CONGRATS! THERE`S NO BLOWIN YA! :D\");\n }\n }", "function checkWin() {\n if (\n cells[0].textContent === cells[1].textContent &&\n cells[1].textContent === cells[2].textContent &&\n cells[0].textContent === cells[2].textContent &&\n cells[0].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n //return winningMsg.innerText = \"It's a draw\"; \n \n } else if (\n cells[3].textContent === cells[4].textContent &&\n cells[4].textContent === cells[5].textContent &&\n cells[3].textContent === cells[5].textContent &&\n cells[3].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n //return winningMsg.innerText = \"It's a draw\";\n }\n // all other win combos\n else if (\n cells[6].textContent === cells[7].textContent &&\n cells[7].textContent === cells[8].textContent &&\n cells[6].textContent === cells[8].textContent &&\n cells[6].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n //return winningMsg.innerText = \"It's a draw\";\n } else if (\n cells[0].textContent === cells[3].textContent &&\n cells[3].textContent === cells[6].textContent &&\n cells[0].textContent === cells[6].textContent &&\n cells[0].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n //return winningMsg.innerText = \"It's a draw\";\n } else if (\n cells[1].textContent === cells[4].textContent &&\n cells[4].textContent === cells[7].textContent &&\n cells[1].textContent === cells[7].textContent &&\n cells[1].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n return winningMsg.innerText = \"It's a draw\";\n } else if (\n cells[2].textContent === cells[5].textContent &&\n cells[5].textContent === cells[8].textContent &&\n cells[2].textContent === cells[8].textContent &&\n cells[2].textContent !== \"\"\n ) {\n console.log('You Won!'); \n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n //return winningMsg.innerText = \"It's a draw\";\n } else if (\n cells[0].textContent === cells[4].textContent &&\n cells[4].textContent === cells[8].textContent &&\n cells[4].textContent === cells[8].textContent &&\n cells[0].textContent !== \"\"\n ) {\n //return winningMsg.innerText = nonActivePlayer + \" won!\";\n console.log('You Won!'); \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n } else if (\n cells[2].textContent === cells[4].textContent &&\n cells[4].textContent === cells[6].textContent &&\n cells[2].textContent === cells[6].textContent &&\n cells[2].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n }\n }", "_checkTurnEnd() {\n let p0alive=false, p1alive=false;\n for (let i=0; i<9; i++) {\n p0alive = p0alive || !this.cells[i].isDead;\n p1alive = p1alive || !this.cells[i+9].isDead;\n }\n if (p0alive && p1alive) return (this.turn==20) ? \"draw\" : \"continue\";\n if (!p0alive && !p1alive) return \"draw\";\n return (p0alive) ? \"p0win\" : \"p1win\";\n }", "function checkVictory() {\n var winningShape = currentShape ? currentShape : player;\n for (row = 0; row < 3; row++) {\n if (board[row][0] == board[row][1] && board[row][1] == board[row][2]) {\n if (board[row][0] == 'X' || board[row][0] == 'O') {\n addPointsToWinner(winningShape);\n }\n }\n }\n for (col = 0; col < 3; col++) {\n if (board[0][col] == board[1][col] && board[1][col] == board[2][col]) {\n if (board[0][col] == 'X' || board[0][col] == 'O') {\n addPointsToWinner(winningShape);\n }\n }\n }\n if (board[0][0] == board[1][1] && board[1][1] == board[2][2]) {\n if (board[0][0] == 'X' || board[0][0] == 'O') {\n addPointsToWinner(winningShape);\n }\n }\n if (board[0][2] == board[1][1] && board[1][1] == board[2][0]) {\n if (board[0][2] == 'X' || board[0][2] == 'O') {\n addPointsToWinner(winningShape);\n }\n }\n if (isMovesLeft() == false) {\n declareWinner('none');\n }\n}", "check_winner() {\n //check all horizontal\n let player_won = false;\n let winner;\n let where_string;\n if (this.check_winner_row(0)) {\n player_won = true;\n winner = this.board_spaces[0].get_top();\n where_string = 'on row 1';\n } else if (this.check_winner_row(4)) {\n player_won = true;\n winner = this.board_spaces[4].get_top();\n where_string = 'on row 2';\n } else if (this.check_winner_row(8)) {\n player_won = true;\n winner = this.board_spaces[8].get_top();\n where_string = 'on row 3';\n } else if (this.check_winner_row(12)) {\n player_won = true;\n winner = this.board_spaces[12].get_top();\n where_string = 'on row 4';\n }\n //check all vertical\n else if (this.check_winner_column(0)) {\n player_won = true;\n winner = this.board_spaces[0].get_top();\n where_string = 'on column 1';\n } else if (this.check_winner_column(1)) {\n player_won = true;\n winner = this.board_spaces[1].get_top();\n where_string = 'on column 2';\n } else if (this.check_winner_column(2)) {\n player_won = true;\n winner = this.board_spaces[2].get_top();\n where_string = 'on column 3';\n } else if (this.check_winner_column(3)) {\n player_won = true;\n winner = this.board_spaces[3].get_top();\n where_string = 'on column 4';\n }\n //check diagonals\n else if (this.check_winner_diagonal_left(0)) {\n player_won = true;\n winner = this.board_spaces[0].get_top();\n where_string = 'on the top left diagonal';\n } else if (this.check_winner_diagonal_right(3)) {\n player_won = true;\n winner = this.board_spaces[3].get_top();\n where_string = 'on the top right diagonal';\n }\n if (player_won) {\n alert(`Player ${winner} won ${where_string}`)\n }\n }", "function declareWinner() {\n\n if (gameOn === true) {\n if (winner(board, player)) {\n winnerMsg.innerHTML = \"Player wins!\";\n gameOn = false;\n playerWins.innerHTML = playerWinsNum++;\n } else if (winner(board, computer)) {\n winnerMsg.innerHTML = \"Computer wins!\";\n gameOn = false;\n computerWins.innerHTML = computerWinsNum++;\n } else if (validMoves().length === 0) {\n winnerMsg.innerHTML = \"It's a draw!\";\n gameOn = false;\n draws.innerHTML = drawsNum++;\n }\n }\n}", "function checkgamewining() {\n console.log('CheckWining Start>');\n let personOnSide2 = side2.childElementCount;\n let personOnSide1 = side1.childElementCount;\n if ((personOnSide2 == '6') || (personOnSide1 == '0')) {\n alert(`You Won The Game\\n Time Played: ${playingHours}:${playingMinutes}:${playingSeconds}`);\n updateLeaderBoard();\n resetTheGame();\n startTheMatch();\n return true;\n } else {\n function checkboth(side_of, person_length) {\n let v = 0;//number of villans\n let s = 0;//number of saints\n let div_s = side_of.getElementsByTagName('div');\n for (let i = 0; i < person_length; i++) {\n if (div_s[i].innerHTML[0] == 'S') s += 1;\n else v += 1\n }\n if (s == 0) s = 4;\n if (person_length >= 2) return v > s; //if more than 1 person is on side\n return false;\n }\n if (checkboth(side2, personOnSide2) || checkboth(side1, personOnSide1)) {\n console.log('Lose');\n alert('You Loose the Game');\n return resetTheGame();//use to restart the game\n }\n }\n return false;\n}", "function paperChoice() {\n var compChoice = showCompResult();\n // Check for win\n if (compChoice === 1) {\n playerDraws();\n } else if (compChoice === 2) {\n playerLoses();\n } else {\n playerWins();\n }\n}", "function checkWin(x, y, player) {\r\n\t//on part du principe que l'on gagne\r\n\tvar verticalWin = true;\r\n\tvar horizontalWin = true;\r\n\tvar diagonaleDroite = true;\r\n\tvar diagonaleGauche = true;\r\n\tvar egality = true;\r\n\t\r\n\tfor(i=0; i<3; i++) {\r\n\t\tif(morpion[x][i] != player) {verticalWin = false};\r\n\t\tif(morpion[i][y] != player) {horizontalWin = false};\r\n\t\tif(morpion[i][i] != player) {diagonaleGauche = false};\r\n\t\tif(morpion[2-i][i] != player) {diagonaleDroite = false};\r\n\t\tfor(j=0; j<3; j++) {if(morpion[i][j] == 0) {egality = false}}; //tant que toutes les cases ne sont pas joués egalité possible\r\n\t}\r\n\t\r\n\tif(verticalWin || horizontalWin || diagonaleDroite || diagonaleGauche){ //si gagné\r\n\t\tgameEnded(player); \r\n\t} else if(egality) { //sinon si egalité\r\n\t\tgameEnded(0)\r\n\t};\r\n}", "checkWin(c){\n if ((arr[0][0]==c && arr[0][1]==c && arr[0][2]==c)\n || (arr[1][0]==c && arr[1][1]==c && arr[1][2]==c)\n || (arr[2][0]==c && arr[2][1]==c && arr[2][2]==c)\n || (arr[0][0]==c && arr[1][0]==c && arr[2][0]==c)\n || (arr[0][1]==c && arr[1][1]==c && arr[2][1]==c)\n || (arr[0][2]==c && arr[1][2]==c && arr[2][2]==c)\n || (arr[0][0]==c && arr[1][1]==c && arr[2][2]==c)\n || (arr[0][2]==c && arr[1][1]==c && arr[2][0]==c)){\n\n if(c=='x')\n {\n console.log(\"Player won\");\n } \n else {\n console.log(\"System won\");\n }\n showGame();\n check=false;\n }\n\n }", "function checkWinner() {\n\t// Check if all cells are active\n\tlet count = 0;\n\tfor (let cell of gridCells) {\n\t\tif (cell.classList.contains(\"active\")) {\n\t\t\tcount++;\n\t\t }\n\t\t}\n\t// If all cells are active and no winner is found below, there's a tie (ie. gameStatus remains \"tie\")\n\tif (count === 9) {\n\t gameStatus = \"Tie\";\n\t// Otherwise the game is still going\n\t} else {\n\t gameStatus = \"Playing\";\n\t}\n\t\n\t// Iterate through all winning combos to see if a winner exists\n\tfor (let i = 0; i < winningCombos.length; i++) {\n\t\tif (\n\t\t\twinningCombos[i][0].textContent === playerX.playerChoice\n\t\t\t&& winningCombos[i][1].textContent === playerX.playerChoice\n\t\t\t&& winningCombos[i][2].textContent === playerX.playerChoice\n \t) \n\t\t{\n\t\t\t// If a winner, set the board to game over\n\t\t\tgameStatus = \"Win X\";\n\t\t\tgameOver();\t\n \t} \n\t\telse if (\n\t\t\twinningCombos[i][0].textContent === playerO.playerChoice\n\t\t\t&& winningCombos[i][1].textContent === playerO.playerChoice\n\t\t\t&& winningCombos[i][2].textContent === playerO.playerChoice\n\t\t) \n\t\t{\n\t\t\t// If a winner, set the board to game over\n\t\t\tgameStatus = \"Win O\";\n\t\t\tgameOver();\t\n\t\t}\n \t}\n}", "function isUserWon() {\n\n var flag = false;\n\n function drawWinText(user) {\n var x = 320;\n var y = 250;\n drawText(user + ' Won!!', x, y);\n drawText('Click to replay...', x, y + 30);\n }\n\n if (userScore >= WINNIG_SCORE) {\n drawWinText(USER_1);\n flag = true;\n } else if (computerScore >= WINNIG_SCORE) {\n drawWinText(USER_2);\n flag = true;\n }\n\n return flag;\n }", "function checkWin() {\n if (sticks.get(2).disks.length === 8 && !isWon) {\n alphaBG = 0;\n drawWinAnimation();\n }\n}", "function checkWin(board){\n var winner = 0;\n\n //Check for possible tie\n if (board.indexOf(0) === -1){\n winner = 3;\n }\n //Check for a winner\n winPatterns.forEach(function(value){\n if (board[value[0]] !== 0){\n if(board[value[0]] === board[value[1]] &&\n board[value[1]] === board[value[2]]){\n winner = board[value[0]];\n //Store winning line for animation later\n winLine = value;\n }\n }\n });\n return winner; //1 for human, 2 for comp, 3 for tie\n}", "function checkWinningCondition(){\n if (gameData.score[gameData.index] > gameData.gameEnd) {\n winsound.play(); //winner sound plays once someone wins\n score.innerHTML = `<h2 style=\"text-align:center;\">${gameData.players[gameData.index]}\n wins with ${gameData.score[gameData.index]} points!</h2>`;\n \n actionArea.innerHTML = \"\";\n document.getElementById(\"quit\").innerHTML = \"Start a New Game\";\n showCurrentScore();\n document.getElementById(\"gamecontrol\").style.backgroundColor = 'LightCyan';\n document.getElementById(\"score\").style.backgroundColor = 'LightCyan';\n document.getElementById(\"game\").style.backgroundColor = 'LightCyan';\n document.getElementById(\"actions\").style.backgroundColor = 'LightCyan';\n document.getElementById(\"rules\").style.backgroundColor = 'MediumTurquoise';\n document.getElementById(\"quit\").style.backgroundColor = 'MediumTurquoise';\n }\n else {\n //update score\n showCurrentScore();\n }\n }", "function winInform (letterWon, isDraw){\n gameOver = true;\n if (isDraw == undefined){\n //Win 1\n if (letterWon == \"X\" && playerIsX == true){\n $(\"#win-celebrate\").html(\"You won!\");\n $(\"#win-celebrate\").show(\"fast\");\n console.log(\"Win 1\");\n setTimeout(resetBoard(), 1000);\n //Win 2\n } else if (letterWon == \"X\" && playerIsX == false){\n $(\"#win-celebrate\").html(\"You lost :/\");\n $(\"#win-celebrate\").show(\"fast\");\n console.log(\"Win 2\");\n setTimeout(resetBoard(), 1000);\n //Win 3\n } else if (letterWon == \"O\" && playerIsX == false){\n $(\"#win-celebrate\").html(\"You won!\");\n $(\"#win-celebrate\").show(\"fast\");\n console.log(\"Win 3\");\n setTimeout(resetBoard(), 1000);\n //Win 4\n } else if (letterWon == \"O\" && playerIsX == true){\n $(\"#win-celebrate\").html(\"You lost :/\");\n $(\"#win-celebrate\").show(\"fast\");\n console.log(\"Win 4\");\n setTimeout(resetBoard(), 1000);\n }\n } else {\n $(\"#win-celebrate\").html(\"Draw!\");\n $(\"#win-celebrate\").show(\"fast\");\n setTimeout(resetBoard(), 1000);\n }\n}", "function checkForWin() {\n winningConditions.forEach((row) => {\n // check if the same string is inside each box in row\n // get the info: the string in the box is 'X' or 'O'\n if (didPlayerOneWin(row)) {\n alert('Bacon is the winner!!!')\n gameBoard.gameOver = true\n }\n else if (didPlayerTwoWin(row)) {\n alert('Egg is the winner!!!')\n gameBoard.gameOver = true\n }\n })\n // if the game is NOT over, but the boxes are full, then game over\n // write this outside the loop so there's no alerting x9\n if(!gameBoard.gameOver && boxesAreAllFull()) {\n alert(`It's a draw. Play again.`)\n gameBoard.gameOver = true\n }\n}", "function isGameOver (){\n if (whoWon()) return true\n return false\n}" ]
[ "0.83116937", "0.8167785", "0.78186053", "0.7805983", "0.7671077", "0.7603425", "0.75892293", "0.7552873", "0.75362235", "0.75251955", "0.7521628", "0.75119185", "0.7506108", "0.7469283", "0.742842", "0.74101084", "0.73744833", "0.7325786", "0.7314765", "0.7297275", "0.72969747", "0.7286527", "0.7265134", "0.7262311", "0.7259552", "0.7258903", "0.72434115", "0.72371715", "0.7230691", "0.72236294", "0.7217122", "0.72170776", "0.7210557", "0.72096914", "0.7201611", "0.71899897", "0.7177973", "0.7177826", "0.71728396", "0.71709806", "0.7170406", "0.7165645", "0.7163488", "0.71532387", "0.71477455", "0.7145513", "0.71450484", "0.71424717", "0.71280557", "0.7120225", "0.7109818", "0.71052283", "0.709812", "0.70947", "0.7085556", "0.70827025", "0.708157", "0.70812297", "0.7081224", "0.70754004", "0.707284", "0.7068413", "0.70676595", "0.70611405", "0.7045784", "0.7041427", "0.70373", "0.70347476", "0.70297724", "0.7028015", "0.7022265", "0.7019691", "0.70185673", "0.70133513", "0.7011069", "0.7010659", "0.7006691", "0.7004253", "0.70000696", "0.7000051", "0.6994849", "0.69925463", "0.69906193", "0.6990327", "0.6988614", "0.69875455", "0.6985936", "0.698553", "0.6984912", "0.698458", "0.6980222", "0.69798064", "0.6969534", "0.69690293", "0.69633305", "0.69589573", "0.6956331", "0.6954418", "0.6952501", "0.69519144", "0.6944895" ]
0.0
-1
Call functions that validate the move.
function validateMove(moveData){ let move = moveData.movement; // Checks conditions before trying to see a winner if(checkId(moveData.id) == WRONG_ID) return WRONG_ID; if(checkEnd(moveData.id) == END) return END; if(checkRound(moveData.id, moveData.player) == WRONG_ROUND) return WRONG_ROUND; if(checkPosition(moveData.id, move.x, move.y) == WRONG_POS) return WRONG_POS; // Check if the games continues or if it has a winner or if it is a draw status = checkWin(moveData.id, moveData.player, move.x, move.y); return status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "moveIsValid() {}", "isValidMove(){\n\n }", "validatePosition() {\n\n }", "function validateMove(value) {\n switch (value) {\n case \"ones\":\n case \"twos\":\n case \"threes\":\n case \"fours\":\n case \"fives\":\n case \"sixes\":\n case \"chance\":\n return true;\n case \"three_of_a_kind\":\n return check3OAK();\n case \"four_of_a_kind\":\n return check4OAK();\n case \"full_house\":\n return checkFullHouse();\n case \"small_straight\":\n return checkSmallStraight();\n case \"large_straight\":\n return checkLargeStraight();\n case \"yacht_z\":\n return checkYachtZ();\n default:\n }\n}", "function isValidMove(boxes) {\n\n }", "function checkMoveValidity(move, state, prevState){\n\tvar x = move.x;\n\tvar y = move.y;\n\tvar c = move.c;\n\t\n\tif(move.pass){\n\t\treturn true;\n\t}\n\t\n\tif(state.size === 0){\n\t\treturn false;\n\t}\n\t\n\t// check for already occupied space\n\tif(state.readToken(x,y) !== 0) return false;\n\t\n\t// check for suicide\n\tvar clone = state.cloneBoard();\n\tclone.placeToken(x,y,c);\n\tvar libs = determineLiberties(x, y, clone);\n\tvar toReturn = false;\n\tfor(var u = 0; u < libs.length; u++){\n\t\tif(clone.readToken(libs[u][0],libs[u][1]) === 0){\n\t\t\ttoReturn = true;\n\t\t}\n\t}\n\t\n\tif(!toReturn){\n\t\tvar suicide = true;\n\t\t\n\t\tfor(var b = 0; b < libs.length; b++){\n\t\t\tsuicide = isSuicide(libs[b][0], libs[b][1], c, clone) ? suicide : false;\n\t\t}\n\t\t\n\t\tif(suicide) return false;\n\t}\n\t\n\t// check for ko move\n\tvar clone = state.cloneBoard()//JSON.parse(JSON.stringify(state));\n\tclone.placeToken(x,y,c);\n\t\n\tvar libs = determineLiberties(x,y,clone);\n\tfor(var u = 0; u < libs.length; u++){\n\t\tif(clone.readToken(libs[u][0],libs[u][1]) === 0) continue;\n\t\t\n\t\tvar enLibs = determineLiberties(libs[u][0], libs[u][1], clone);\n\t\tvar isSurrounded = true;\n\t\tfor(var e = 0; e < enLibs.length; e++){\n\t\t\tif(clone.readToken(enLibs[e][0], enLibs[e][1]) !== c){\n\t\t\t\tisSurrounded = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(isSurrounded){\n\t\t\tvar enArmy = determineArmy([[libs[u][0],libs[u][1]]], clone);\n\t\t\tfor(var unit = 0; unit < enArmy.length; unit++){\n\t\t\t\tclone.tokenSpots[enArmy[unit][0]][enArmy[unit][1]] = 0;\n\t\t\t}\n\t\t}\n\t}\n \t\n\tvar isKo = true;\n\tfor(var i = 0; i < clone.size; i++){\n\t\tfor(var j = 0; j < clone.size; j++){\n\t\t\tif(clone.readToken(i,j) !== prevState.readToken(i,j)){\n\t\t\t\tisKo = false;\n\t\t\t}\n\t\t}\n\t}\n\tif(isKo) return false;\n \t\n\t// Otherwise\n\t\n\treturn true;\n}", "validate() {}", "async function validateMove(){\n console.log(\"inside validateMove()\");\n try {\n\n moveAi = transcribeMove;\n gameAI.move(moveAi.substring(0,2),moveAi.substring(3,5))\n console.log(\"moveAi white:\" + moveAi);\n correctMoveWhite = true;\n }\n catch(err) {\n correctMoveWhite = false;\n finishedWhite = true;\n console.log(\"White invalid move \"+ err);\n }\n\n\n try {\n if(correctMoveWhite){\n moveAi2 = await playAI2(0);\n console.log(\"moveAi black:\" + moveAi2);\n correctMoveBlack = true;\n }\n }\n catch(err) {\n correctMoveBlack = false;\n finishedBlack = true;\n console.log(\"Black invalid move \"+ err);\n\n }\n\n if(correctMoveWhite && correctMoveBlack) {\n\n\n if (!finishedWhite) {\n\n } else {\n moveAi = \"xx-xx\"\n }\n\n if (!finishedBlack) {\n fromPosAi2 = moveAi2.substring(2,4).toLowerCase()\n toPosAi2 = moveAi2.substring(7,9).toLowerCase()\n\n moveAi2 = fromPosAi2 + '-' + toPosAi2\n } else{\n moveAi2 = \"xx-xx\"\n }\n\n movePair = moveAi + moveAi2;\n res.status(200).send(movePair);\n console.log(\"new move!\");\n\n\n } else{\n console.log(\"Invalid move\");\n res.status(200).send(\"wrong move\");\n }\n }", "async validMove(gameboard, move) {\n let player = move.player;\n let gameboardIn = MyPrologInterface.serializeGameBoard(gameboard);\n\n let coordinates = JSON.stringify([\n move.originI, \n move.originJ,\n move.destinationI,\n move.destinationJ\n ]);\n\n const requestData = `valid_move(${player},${gameboardIn},${coordinates})`;\n\n let response = await this.sendRequest(requestData);\n\n return response == \"Valid move\";\n }", "checkAndMove(x2, y2, matrix) {\n if (matrix[y2][x2] && matrix[this.yPos][this.xPos].type === \"pawn\") {\n //if position is filled and it is valid, return true, else return false\n if (\n this.validCapture.hasOwnProperty(x2) &&\n this.validCapture[x2] === y2\n ) {\n let position = this.changePosition(this.xPos, this.yPos, x2, y2, matrix);\n console.log('position 2', position);\n\n if(position === 'capture-king') return position;\n this.updatePos(x2, y2);\n return true;\n } else {\n return false;\n }\n }\n console.log(\"place it is moving\", matrix[y2][x2]);\n if (this.validMoves.hasOwnProperty(x2)) {\n let yArr = this.validMoves[x2];\n console.log(\"valid x\");\n if (yArr.indexOf(parseInt(y2)) >= 0) {\n console.log(\"valid x and y\");\n\n let position = this.changePosition(this.xPos, this.yPos, x2, y2, matrix);\n console.log('position 3', position);\n\n if(position === 'capture-king') return position;\n this.updatePos(x2, y2);\n return true;\n }\n }\n console.log(\"not valid move\");\n return false;\n }", "selfValidate(){\n\n }", "validate() { }", "makeMove(move) { \n\n //Enforce pawn\n\n //Enforce bishop\n\n //Enforce knight\n\n //Enforce Rook\n\n //Enforce king\n\n //Enforce Queen\n \n //Enforce castle \n\n //Enforce turns\n \n if (this.board[move.startRow][move.startCol].charAt(0) === 'w' && !this.whiteToMove) {\n alert(\"It is Black's move!\");\n return;\n } else if (this.board[move.startRow][move.startCol].charAt(0) === 'b' && this.whiteToMove) {\n alert(\"It is White's move!\");\n return;\n }\n \n\n //Enforce valid captures\n if (this.board[move.startRow][move.startCol] != \"--\" && this.board[move.startRow][move.startCol].charAt(0) === this.board[move.endRow][move.endCol].charAt(0)) {\n alert(\"Cannot capture own piece!\");\n return;\n\n }\n\n //Enforce piece selected\n if (this.board[move.startRow][move.startCol] != \"--\") {\n this.board[move.startRow][move.startCol] = \"--\";\n this.board[move.endRow][move.endCol] = move.pieceMoved;\n this.moveLog.push(move); //log the move so it can be undoed / displayed\n this.whiteToMove = !this.whiteToMove; //switch turns\n } \n }", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "_validate() {\n\t}", "function isValid(move) {\n return (move > 10 && move < 89 &&\n move % 10 > 0 && move % 10 < 9);\n }", "function attemptToMove(coord1,coord2){\r\n\r\n if(debug) console.log(\"attempting to move\");\r\n\r\n if(isLegalMove(coord1,coord2)){\r\n executeMove(coord1,coord2)\r\n }\r\n\r\n}", "makeMove(move) {\n if (this.winner != null) {\n // You can't make normal moves when the game is over\n return false\n }\n\n if (move.op == \"beginTurn\") {\n this.beginTurn()\n } else if (move.op == \"attack\") {\n this.attack(move.from, move.to)\n } else if (move.op == \"face\") {\n this.face(move.from)\n } else if (move.op == \"play\") {\n this.play(move.from)\n } else if (move.op == \"endTurn\") {\n this.endTurn()\n } else {\n console.log(\"ignoring op: \" + move.op)\n return false\n }\n return true\n }", "function validatePosition()\n{\n this.p = collisionWithWallsInSector(this.p, this.prev_p, this.sector, DO_NOT_UPDATE_WALL_DIR);\n this.p = collisionWithSectorsInSector(this.p, this.prev_p, this.sector, DO_NOT_UPDATE_WALL_DIR);\n}", "validatePoints() {}", "move(command) {\n console.log(`moving disk from ${command.from} to ${command.to}`);\n if (commandIsValid(command)) {\n console.log('valid command');\n moveDisk(command);\n checkIfGameIsSolved();\n notifyListeners();\n return true;\n }\n console.log('invalid command');\n return false;\n }", "function checkMove(start) {\n\t\t\t\tvar startSquare = MakeSquare(start.y, start.x);\n\t\t\t\tif (promotion !== undefined) {\n\t\t\t\t\t// we have a promotion so we need to generate a \n\t\t\t\t\t// specific move and check against it\n\t\t\t\t\tif(vMoves[i] === GenerateMove(startSquare, endSquare, moveflagPromotion | promotion)) {\n\t\t\t\t\t\tformatedMove = vMoves[i];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// just checking start and end square allows to cover \n\t\t\t\t\t// all other special moves like \"en passant\" capture and\n\t\t\t\t\t// castling\n\t\t\t\t\tif ( (vMoves[i] & 0xFF) == startSquare &&\n\t\t\t\t\t\t((vMoves[i] >> 8) & 0xFF) == endSquare ) {\n\t\t\t\t\t\tformatedMove = vMoves[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function validation() {\r\n\t\t\r\n\t}", "_validateMove(fromSpace, toSpace, piece, options) {\n // First verify that the given space is reachable by this piece\n if (piece.getMoves(fromSpace, this.getBoard()).indexOf(toSpace.getLabel()) === -1) {\n return false;\n }\n\n // We can't capture kings\n if (toSpace.getPiece() && toSpace.getPiece().ch.toLowerCase() === 'k') {\n return false;\n }\n\n return true;\n }", "function validateMove(val, clmn) {\r\n\r\n var decision = (val < clmn[clmn.length - 1]) ? 1: 0;\r\n return decision;\r\n\r\n}", "function Validate() {}", "function checkValidMove(piece,x,y) {\r\n\tswitch(piece) {\r\n\t\tcase 'b': //black has to on other side of white\r\n\t\t\treturn checkAllDir('b',x,y,'w');\r\n\t\t\tbreak;\r\n\t\tcase 'w': //white has to be on other side of black\r\n\t\t\treturn checkAllDir('w',x,y,'b');\r\n\t\t\tbreak;\r\n\t}\r\n}", "function runValidation() {\n nameVal();\n phoneVal();\n mailVal();\n}", "function canMove(coordinatesCallback,dir){\n if(pauseState){\n return false;\n }\n for(var i = 0; i < tetromino.cells.length; i++){\n var new_coord = coordinatesCallback(i,dir); // tulemus on kastides, mitte pikslites\n var new_x = new_coord[0];\n var new_y = new_coord[1];\n if(!validateCoordinates(new_x,new_y)){\n return false;\n }\n }\n return true;\n}", "function Validate(){}", "function Validate(){}", "function moveIsValid(x, y) {\n\tif(board[x][y] == 0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function validateMove(gamePreMove){\r\n let flatGamePostMove = [...gameBoard[0], ...gameBoard[1], ...gameBoard[2], ...gameBoard[3]];\r\n for (let i = 0; i < 16; i++){\r\n if (gamePreMove[i] !== flatGamePostMove[i]){\r\n randomSpawnNumber();\r\n break;\r\n } else if (i === 15 && gamePreMove[i] === flatGamePostMove[i]){\r\n console.log(\"Move is invalid\");\r\n }\r\n }\r\n}", "function outOfBound(newMove) {\n if (newMove > 410 || newMove < 10) {\n promptError(\"You shall not pass!\");\n return true;\n } else return false;\n}", "function doValidation() {\n //If the step required is not in the checked steps and the value is undefined, so don't validate it\n if (!rule.global && (currentValue === undefined || currentValue === null)) {\n return;\n }\n\n for (var keyPropRule in rule.validationRules) {\n if (rule.validationRules.hasOwnProperty(keyPropRule)) {\n if (isContainsSteps(steps, rule.validationRules[keyPropRule].steps)) {\n var fn = _functions[rule.validationRules[keyPropRule].fn];\n\n if (common.isFunction(rule.validationRules[keyPropRule].params.value)) {\n validationResult = fn.call(this, currentValue, rule.validationRules[keyPropRule].params.value.call(this));\n } else {\n validationResult = fn.call(this, currentValue, rule.validationRules[keyPropRule].params);\n }\n\n if (common.isObject(validationResult)) {\n if (!validationResult.result) {\n if (validationResult.error) {\n error = validationResult.error;\n } else {\n error = keyPropRule;\n }\n\n params = rule.validationRules[keyPropRule].params;\n\n validationResult = validationResult.result;\n\n return;\n }\n\n validationResult = true;\n } else if (!validationResult) {\n error = keyPropRule;\n params = rule.validationRules[keyPropRule].params;\n\n return;\n }\n }\n }\n }\n }", "isValidMove (piece, pos) {\n\t\tif (!position.isValid(pos))\n\t\t\treturn false;\n\n\t\tlet piece2 = this.getPiece(pos);\n\t\t//Cannot move into a position occupied by a piece of the same color\n\t\tif (piece2 && piece.color === piece2.color)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "function validateInput(){\n\n}", "function checkIfCardClickedOnIsValid() {\n\tif (currentcard.classList.contains(\"open\")) {\n\t\t//do not allow click, invalid move\n\t\treturn false;\n\t} else if (currentcard.classList.contains(\"show\")) {\n\t\treturn false;\n\t} else if (currentcard.classList.contains(\"match\")) {\n\t\treturn false;\n\t} else if (currentcard.classList.contains(\"wrong\")) {\n\t\treturn false;\n\t} else {\n\t\t//valid move\n\t\treturn true;\n\t}\n}", "proceedMove() {\n // Proceed move\n this.PENDING.MOVE.forEach(( item ) => {\n this._move(item)\n })\n }", "function validMove(from, to, board) {\n // A piece can't move to its own tile\n if (from.x == to.x && from.y == to.y) {\n return false;\n }\n\n // Handle vertical movements (where y changes)\n if (from.x == to.x) {\n // Get the starting and ending y coordinates,\n // ensuring that the start is lower than the end\n let start = (from.y > to.y ? to.y : from.y);\n let end = (from.y > to.y ? from.y : to.y);\n\n // A small hack to make things work correctly\n if (from.y < to.y) {\n start += 1;\n end += 1;\n }\n\n // Look through each tile along the path and ensure that it is empty\n for (let i = start; i < end; i++) {\n if (board[from.x][i].type != 'tile') {\n return false;\n }\n }\n\n // No obstacles, so the move is valid!\n return true;\n }\n\n // Handle horizontal movements (where x changes)\n if (from.y == to.y) {\n // Get the starting and ending x coordinates,\n // ensuring that the start is lower than the end\n let start = (from.x > to.x ? to.x : from.x);\n let end = (from.x > to.x ? from.x : to.x);\n\n // A small hack to make things work correctly\n if (from.x < to.x) {\n start += 1;\n end += 1;\n }\n\n // Look through each tile along the path and ensure that it is empty\n for (let i = start; i < end; i++) {\n if (board[i][from.y].type != 'tile') {\n return false;\n }\n }\n\n // No obstacles, so the move is valid!\n return true;\n }\n\n // Handle diagonal movements\n if (Math.abs(from.x - to.x) == Math.abs(from.y - to.y)) {\n // We iterate over the path using delta movements\n let x_change = 1;\n let y_change = 1;\n\n if (from.x > to.x) {\n x_change = -1;\n }\n if (from.y > to.y) {\n y_change = -1;\n }\n\n let x = from.x;\n let y = from.y;\n\n // Look through each tile along the path and ensure that it is empty\n while (true) {\n x += x_change;\n y += y_change;\n\n if (board[x][y].type != 'tile') {\n return false;\n }\n\n if (x == to.x && y == to.y) {\n return true;\n }\n }\n }\n\n // No other movement types are valid, so this move mustn't be valid\n return false;\n}", "canMove(from, fromIx, fromCount, to, toIx) {\n // check 'to' values\n if (to == 'f') {\n if (toIx < 1 || toIx > 4) {\n return false;\n }\n }\n else if (to == 't') {\n if (toIx < 1 || toIx > 7) {\n return false;\n }\n }\n else {\n return false;\n }\n\n // check 'from' values\n if (from == 'f') {\n if (fromIx < 1 || fromIx > 4 || fromCount != 1) {\n return false;\n }\n }\n else if (from == 't') {\n if (fromIx < 1 || fromIx > 7 || fromCount < 1) {\n return false;\n }\n }\n else if (from != 'w' || fromCount != 1) {\n return false;\n }\n \n // get card to move\n let card = this.peek(from, fromIx, fromCount);\n if (!card || !card.faceUp) {\n return false;\n }\n\n // test move feasability\n let dest = this.peek(to, toIx);\n if (to == 't') {\n if (!dest) {\n // first tableau card must be a king\n if (card.rank != 13) {\n return false;\n }\n }\n else {\n // must alternate red/black suits\n if (this.sameColor(card, dest)) {\n return false;\n }\n // must be one rank smaller than the parent card\n if (card.rank != dest.rank - 1) {\n return false;\n }\n }\n }\n else if (to == 'f') {\n return this.foundationMatch(card, toIx) > 0;\n }\n else {\n return false;\n }\n return true;\n }", "isValidMove(board, direction) {\n let row = this.position.row;\n let col = this.position.col;\n switch (direction) {\n case DIRECTION.UP:\n row -= 1;\n break;\n case DIRECTION.DOWN:\n row += 1;\n break;\n case DIRECTION.RIGHT:\n col += 1;\n break;\n case DIRECTION.LEFT:\n col -= 1;\n break;\n }\n\n // check for out of bounds, for more robust code\n if (typeof board.data[row] !== 'undefined' &&\n typeof board.data[row][col] !== 'undefined') {\n return board.data[row][col].passable || (this.flying && board.data[row][col] !== tileTypes.wall);\n } else {\n return false;\n }\n }", "async function playerMoveProcess(moveMade){\n console.log(`Move made by player: ${moveMade}`)\n\n if (\n moveMade === 'a1' || moveMade === 'a2' || moveMade === 'a3'\n || moveMade === 'b1' || moveMade === 'b2' || moveMade === 'b3'\n || moveMade === 'c1' || moveMade === 'c2' || moveMade === 'c3'\n ){\n /**\n * Needed to prevent player moves from overriding computer's moves!\n * That's unfair!\n */\n let availableMovesTaken = availableMoves.findIndex(moves => moves === moveMade);\n if (availableMovesTaken !== -1){\n availableMoves.splice(availableMovesTaken,1);\n board[moveMade] = 'X';\n await checkWin();\n\n return validPlayerMove = true;\n } else {\n /**If the player did try to overwrite the computer's move\n * this if-else check must return something, otherwise JS\n * assumes validPlayerMove is truth-sy!\n * This also works when the player inserts the same move\n * they already inserted.\n */\n return validPlayerMove = false; \n }\n } else {\n return validPlayerMove = false;\n }\n }", "d_move_val(space) {\r\n if(this.check_d_range(space)) {\r\n if(space.x > this.x && space.y > this.y) {\r\n for(let i = this.x + 1, j = this. y + 1; i < space.x + 1; i++,j++) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else if (space.x < this.x && space.y < this.y) {\r\n for(let i = this.x - 1, j = this. y - 1; i > space.x - 1; i--,j--) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else if (space.x > this.x && space.y < this.y) {\r\n for(let i = this.y - 1, j = this.x + 1; j > space.y - 1; i--, j++) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else if (space.x < this.x && space.y > this.y) {\r\n for(let i = this.y + 1, j = this.x -1; j < space.y + 1; i++, j--) {\r\n if(this.pass(game.board[j][i])) {\r\n if(this.capture_check(game.board[j][i])) {\r\n console.log('can capture');\r\n return false;\r\n } else {\r\n console.log('Pass');\r\n };\r\n } else {\r\n console.log('test failed');\r\n return false;\r\n };\r\n };\r\n return true;\r\n } else {\r\n console.log('Error in move validation');\r\n return false;\r\n };\r\n } else {\r\n console.log('Out of range');\r\n return false;\r\n };\r\n }", "function next(){\n validate();\n}", "function next(){\n validate();\n}", "tryMove(deltaX, deltaY) {\n const currentPiece = this.state.currentPiece;\n const board = this.state.board;\n if (!currentPiece) {\n return true;\n }\n const newX = currentPiece.x + deltaX;\n const newY = currentPiece.y + deltaY;\n const isValidMove = checkMove(currentPiece, board, newX, newY);\n\n if (isValidMove) {\n this.setState({\n currentPiece: Object.assign({}, currentPiece, {x: newX, y: newY}),\n });\n }\n return isValidMove;\n }", "function valid(){return validated}", "function validation() {\r\n\t\tif ((circleRecipe.checked == true && recipeCircleArea() > 0) || (rectangleRecipe.checked == true && returnValue(lengthARecipe) > 0 && returnValue(lengthBRecipe) > 0)) {\r\n\t\t\tif ((circleUser.checked == true && userCircleArea() > 0) || (rectangleUser.checked == true && returnValue(lengthAUser) > 0 && returnValue(lengthBUser) > 0)) {\r\n\t\t\t\tconvertAlert.innerHTML = '';\r\n\t\t\t\tconvert();\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconvertAlert.innerHTML = '<p>You must define what kind of baking mold you use and inscribe its dimensions before convert!</p>';\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tconvertAlert.innerHTML = '<p>You must define what kind of baking mold is used in the recipe and inscribe its dimensions before convert!</p>';\r\n\t\t}\r\n\t}", "function isMoveOk(params){\n\t\ttry{\n\t\t\tvar move = params.move;\n\t\t\tvar turnIndexBeforeMove = params.turnIndexBeforeMove;\n\t \tvar stateBeforeMove = params.stateBeforeMove;\n\t \tvar deltaValue = move[2].set.value;\n\t \tvar oldrow = deltaValue.oldrow;\n\t \tvar oldcol = deltaValue.oldcol;\n\t \tvar row = deltaValue.row;\n\t \tvar col = deltaValue.col;\n\t \tvar boardBeforeMove = stateBeforeMove.board;\n\n\t\t\tvar expectedMove = createMove(oldrow, oldcol, row, col, turnIndexBeforeMove, boardBeforeMove);\n\t\t\tif( !angular.equals(move, expectedMove) ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch(e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function checkMoves() {\n if (picked.length !== null) {\n if (opponentPicked.length !== null) {\n checkWinner();\n }\n }\n }", "async validate () {\n\t\tif (this.stream.get('teamId') !== this.teamId) {\n\t\t\tthrow this.errorHandler.error('streamNoMatchTeam', { info: this.streamId });\n\t\t}\n\t\tif (!this.fromUser.hasTeam(this.teamId)) {\n\t\t\tthis.log(`User ${this.fromUser.id} is not on team ${this.teamId}`);\n\t\t\tthrow this.errorHandler.error('unauthorized');\n\t\t}\n\t\tif (this.parentPost && this.parentPost.get('teamId') !== this.teamId) {\n\t\t\tthrow this.errorHandler.error('parentPostNoMatchTeam', { info: this.parentPostId });\n\t\t}\n\t\tif (this.parentPost && this.parentPost.get('streamId') !== this.streamId) {\n\t\t\tthrow this.errorHandler.error('parentPostNoMatchStream', { info: this.parentPostId });\n\t\t}\n\t}", "function moveWithRules(drop, drag,determin) {\n\n turns++;\n updateHud();\n\n var curr = parseInt(drag.parent().attr(\"data-row\"), 10);\n var curc = parseInt(drag.parent().attr(\"data-col\"), 10);\n var dragr = parseInt(drop.attr(\"data-row\"), 10);\n var dragc = parseInt(drop.attr(\"data-col\"), 10);\n\n if (Math.abs(curr - dragr) < 2 && Math.abs(curc - dragc) < 2) {\n if ((curr === 1 && curc === 2 && (dragr === 2 && (dragc === 1 || dragc === 3))) || (curr === 3 && curc === 2 && (dragr === 2 && (dragc === 1 || dragc === 3))) || (curr === 2 && curc === 1 && (dragc === 2 && (dragr === 1 || dragr === 3))) || (curr === 2 && curc === 3 && (dragc === 2 && (dragr === 1 || dragr === 3)))) {\n turns--;\n updateHud();\n return false;\n } else {\n if(determin===false||(drag.parent().hasClass('centr') === false&&!drop.hasClass('centr'))){//if we are draggin do it this way\n drag.clone().appendTo(drop);\n checkWin(turns > 12);\n }\n else{//if we are clickin do it this way\n\n drag.appendTo(drop);\n checkWin(turns > 12);\n\n }\n if (cheat && !resetty) {\n drop.empty();\n cheat = false;\n\n reset(getName(((turns % 2) + 1)));\n\n } else {\n drop.empty();\n if (!resetty || turns === 7) {\n drop.append(drag);\n }\n resetty = false;\n }\n }\n\n } else {\n turns--;\n updateHud();\n return false;\n }\n\n\t\n\n}", "function move(move_str) {\n var legal = !!game.move({\n from: move_str.substr(0, 2),\n to: move_str.substr(2, 2),\n promotion: move_str.substr(4, 1)\n });\n\n if (legal) {\n postUpdate();\n thinkIfCpu();\n }\n\n return legal;\n }", "move(from, to) {\n // Here is a bunch fo castling logic if there's a castling flag...\n if (this.currentMove.castlingFlag) {\n this.castlingMove(from, to);\n }\n // If it's a capture, handle our special case\n // This won't work for en passant. There are a lot of problems here man.\n else if (this.currentMove.captureSquare) {\n this.capturingMove(from, to);\n }\n else {\n // Handle disabling castling in case they moved a piece that breaks it\n this.handleDisableCastling(from, to);\n // Then do the usual\n super.move(from, to);\n // And also reset our special move data\n this.currentMove.from = undefined;\n this.currentMove.to = undefined;\n this.currentMove.captureSquare = undefined;\n }\n }", "_validate(initialValidation, programmaticValue, keyCode) {\n const that = this,\n oldValue = that.value;\n\n that._validateValue(programmaticValue);\n\n if (keyCode && (keyCode === 35 || keyCode === 36)) {\n that._animate(oldValue);\n }\n else {\n that._updatePointer();\n }\n }", "[PrivateActions.move](action) {\n\t\tif (Object.values(Direction).indexOf(action.direction) == -1) {\n\t\t\tthrow new Error(\"Invalid direction! Direction: \" + action.direction);\n\t\t}\n\n\t\tthis[CooldownSetter](PrivateActions.move);\n\n\t\tlet futurePosition = this.getFuturePosition(action);\n\t\tthis.x = futurePosition.x;\n\t\tthis.y = futurePosition.y;\n\n\t\treturn false;\n\t}", "moveCheck(direction, originalLocation) {\n const { dispatch } = this.props;\n let newLocationId;\n let newLocation;\n if(direction == \"north\") {\n newLocationId = originalLocation - 1;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId >= 0 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n } else if (direction == \"east\") {\n newLocationId = originalLocation + 10;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId <= 100 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n } else if (direction == \"south\") {\n newLocationId = originalLocation + 1;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId > 0 && newLocationId <= 100 && originalLocation % 10 !== 0 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n } else if (direction == \"west\") {\n newLocationId = originalLocation - 10;\n newLocation = this.props.currentLevel[newLocationId];\n if(newLocationId >= 0 && newLocation.value !== 'W') {\n return newLocationId;\n } else if (newLocation.isEnemy !== '' || newLocation.isProjectile || newLocation.value === 'L') {\n let knockBackDirection = this.reverseDirection(direction);\n dispatch(actions.knockBack(originalLocation, knockBackDirection));\n return false;\n } else {\n return false;\n }\n }\n }", "validate(instruction) {\n // Get a function that will process the validation instruction.\n let execute;\n if (instruction) {\n let { object, propertyName, rules } = instruction;\n // if rules were not specified, check the object map.\n rules = rules || this.objects.get(object);\n // property specified?\n if (instruction.propertyName === undefined) {\n // validate the specified object.\n execute = () => this.validator.validateObject(object, rules);\n }\n else {\n // validate the specified property.\n execute = () => this.validator.validateProperty(object, propertyName, rules);\n }\n }\n else {\n // validate all objects and bindings.\n execute = () => {\n const promises = [];\n for (let [object, rules] of Array.from(this.objects)) {\n promises.push(this.validator.validateObject(object, rules));\n }\n for (let [binding, { rules }] of Array.from(this.bindings)) {\n const propertyInfo = getPropertyInfo(binding.sourceExpression, binding.source);\n if (!propertyInfo || this.objects.has(propertyInfo.object)) {\n continue;\n }\n promises.push(this.validator.validateProperty(propertyInfo.object, propertyInfo.propertyName, rules));\n }\n return Promise.all(promises).then(errorSets => errorSets.reduce((a, b) => a.concat(b), []));\n };\n }\n // Wait for any existing validation to finish, execute the instruction, render the errors.\n this.validating = true;\n let result = this.finishValidating\n .then(execute)\n .then(newErrors => {\n const predicate = this.getInstructionPredicate(instruction);\n const oldErrors = this.errors.filter(predicate);\n this.processErrorDelta('validate', oldErrors, newErrors);\n if (result === this.finishValidating) {\n this.validating = false;\n }\n return newErrors;\n })\n .catch(error => {\n // recover, to enable subsequent calls to validate()\n this.validating = false;\n this.finishValidating = Promise.resolve();\n return Promise.reject(error);\n });\n this.finishValidating = result;\n return result;\n }", "move() {\n throw \"Move method not implemented\";\n }", "move(dir){\n\n let outOfBound = false;\n\n if(dir === 'd'){ // go down\n if(this.posY + 1 >= this.rows){\n outOfBound = true;\n }\n else{\n this.posY += 1; \n }\n }\n else if(dir === 'u'){\n if(this.posY - 1 < 0){\n outOfBound = true;\n }\n else{\n this.posY -= 1;\n }\n }\n else if(dir === 'l'){\n if(this.posX - 1 < 0){\n outOfBound = true;\n }\n else{\n this.posX -= 1;\n }\n }\n else if(dir === 'r'){\n if(this.posX + 1 >= this.cols){\n outOfBound = true;\n }\n else{\n this.posX += 1;\n }\n }\n else{\n term.red.bold(\"Invalid input! Try again! \\n\");\n }\n \n if(outOfBound){\n term.blue(\"You are \").bgWhite.red.bold(\"Out Of Bound! \\n\");\n return false;\n }\n\n // check hole\n if(this.isHole(this.posY, this.posX)){\n term.red.bold(\"You dropped in a HOLE!\\n\");\n term.green(\"You died, haha! \\n\");\n return false;\n }\n\n // check hat\n if(this.isHat(this.posY, this.posX)){\n term.bgCyan.magenta.bold.blink(\"You found the hat! You win! \\n\");\n return false;\n }\n\n // draw the new path\n this.drawPath(this.posY, this.posX);\n\n return true;\n }", "validMove(item) {\n if (item.drawCard && item.findSpotCheck) {\n if (this.checkIfExists(this.state.upDrawCards, item.suit, item.value)) {\n if (this.state.upDrawCards.length !== (item.index + 1)) {\n return false;\n }\n }\n }\n\n // This if statement checks if you are dropping the card in one of the 4 dropzones at the top where the stack of each suit lies\n if (item.upperDrop) {\n // Boolean variables that are true if the dragged card is in that collumn\n var inCol_1 = this.checkIfExists(this.state.col_1, item.suit, item.value);\n var inCol_2 = this.checkIfExists(this.state.col_2, item.suit, item.value);\n var inCol_3 = this.checkIfExists(this.state.col_3, item.suit, item.value);\n var inCol_4 = this.checkIfExists(this.state.col_4, item.suit, item.value);\n var inCol_5 = this.checkIfExists(this.state.col_5, item.suit, item.value);\n var inCol_6 = this.checkIfExists(this.state.col_6, item.suit, item.value);\n var inCol_7 = this.checkIfExists(this.state.col_7, item.suit, item.value);\n\n if (item.findSpotCheck) {\n if (inCol_1) {\n if (this.state.col_1.length !== (item.index + 1)) {\n return false;\n }\n } else if (inCol_2) {\n if (this.state.col_2.length !== (item.index + 1)) {\n return false;\n }\n } else if (inCol_3) {\n if (this.state.col_3.length !== (item.index + 1)) {\n return false;\n }\n } else if (inCol_4) {\n if (this.state.col_4.length !== (item.index + 1)) {\n return false;\n }\n } else if (inCol_5) {\n if (this.state.col_5.length !== (item.index + 1)) {\n return false;\n }\n } else if (inCol_6) {\n if (this.state.col_6.length !== (item.index + 1)) {\n return false;\n }\n } else if (inCol_7) {\n if (this.state.col_7.length !== (item.index + 1)) {\n return false;\n }\n }\n }\n\n var upColumns = {\n up_1: this.state.up_1,\n up_2: this.state.up_2,\n up_3: this.state.up_3,\n up_4: this.state.up_4\n };\n var upValue = item.value;\n var upSuit = item.suit;\n var upColumn = item.column;\n // Sets up the card that is being landed on\n var upLandingCard = upColumns[upColumn][upColumns[upColumn].length - 1];\n\n // Converts card value to numerical value for the sake of comparison\n if (upValue === 'jack') { upValue = 11 }\n if (upValue === 'queen') { upValue = 12 }\n if (upValue === 'king') { upValue = 13 }\n if (upValue === 'ace') { upValue = 1 }\n\n // If there's no cards in the stack the card must be an ace\n if (upLandingCard === undefined) {\n if (upValue !== 1) {\n return false;\n }\n\n return true;\n } else {\n var upLandingCardValue = upLandingCard.value;\n var upLandingCardSuit = upLandingCard.suit;\n\n // Converts card value to numerical value for the sake of comparison\n if (upLandingCardValue === 'jack') { upLandingCardValue = 11 }\n if (upLandingCardValue === 'queen') { upLandingCardValue = 12 }\n if (upLandingCardValue === 'king') { upLandingCardValue = 13 }\n if (upLandingCardValue === 'ace') { upLandingCardValue = 1 }\n\n // eslint-disable-next-line\n upValue = parseInt(upValue);\n // eslint-disable-next-line\n upLandingCardValue = parseInt(upLandingCardValue);\n\n // If the suits don't match return false\n if (upSuit !== upLandingCardSuit) {\n return false;\n }\n // If the dragged card's value isn't 1 more than the landing card return false\n if (upValue !== (upLandingCardValue + 1)) {\n return false;\n }\n\n return true;\n }\n }\n\n // Sets up local variables for the arrays for all the cards on the board\n var columns = [\n this.state.col_1,\n this.state.col_2,\n this.state.col_3,\n this.state.col_4,\n this.state.col_5,\n this.state.col_6,\n this.state.col_7\n ];\n var suit = item.suit;\n var value = item.value;\n var column = columns[item.column - 1];\n // Sets up the card that is being landed on\n var landingCard;\n if (!item.findSpotCheck || item.findSpotCheck === undefined) {\n landingCard = column[column.length - 2];\n } else {\n landingCard = column[column.length - 1];\n }\n\n // Checks to make sure that there's actually a landing card\n if (landingCard !== undefined) {\n var landingSuit = landingCard.suit;\n var landingValue = landingCard.value;\n\n // Converts card value to numerical value for the sake of comparison\n if (landingValue === 'jack') { landingValue = 11 }\n if (landingValue === 'queen') { landingValue = 12 }\n if (landingValue === 'king') { landingValue = 13 }\n if (landingValue === 'ace') { landingValue = 1 }\n\n // eslint-disable-next-line\n landingValue = parseInt(landingValue);\n }\n\n // Converts card value to numerical value for the sake of comparison\n if (value === 'jack') { value = 11 }\n if (value === 'queen') { value = 12 }\n if (value === 'king') { value = 13 }\n if (value === 'ace') { value = 1 }\n\n // eslint-disable-next-line\n value = parseInt(value);\n\n // Regular move onto any of the 7 columns\n if (landingCard !== undefined) {\n // Switch statement that ensures that the landing card suit is of the opposite color\n switch (suit) {\n case 'spades':\n if (landingSuit === 'spades' || landingSuit === 'clubs') {\n return false;\n }\n break;\n case 'clubs':\n if (landingSuit === 'spades' || landingSuit === 'clubs') {\n return false;\n }\n break;\n case 'hearts':\n if (landingSuit === 'hearts' || landingSuit === 'diamonds') {\n return false;\n }\n break;\n case 'diamonds':\n if (landingSuit === 'hearts' || landingSuit === 'diamonds') {\n return false;\n }\n break;\n default:\n break;\n }\n\n // Returns false if the landing value is less than or equal to the dragged card's value\n if (landingValue <= value) {\n return false;\n }\n // Returns false if the dragged card's value is not 1 less than the landing card\n if ((landingValue - 1) !== value) {\n return false;\n }\n } else {\n // If there's no landing card, then dragged card must be a king\n if (value < 13) {\n return false;\n }\n }\n\n return true;\n }", "function checkPermittedMove(direction) {\n var targetSquare = null;\n mapWidth = mapLocations[currentLocation][0][1].length;\n mapHeight = mapLocations[currentLocation][0].length;\n switch (direction) {\n case \"up\":\n // Make sure player isn't already at the top of the map, but let them move if \n // the next square leads to a different map.\n targetSquare = mapLocations[currentLocation][0][playerY - 1][playerX];\n if (typeof targetSquare === \"string\"){\n return true;\n } else if (playerY === 0) {\n return false;\n }\n break;\n case \"down\":\n // Make sure player isn't already at the bottom of the map, but let them move if \n // the next square leads to a different map.\n targetSquare = mapLocations[currentLocation][0][playerY + 1][playerX];\n if (typeof targetSquare === \"string\"){\n return true;\n } else if (playerY === mapHeight) {\n return false;\n }\n break;\n case \"left\":\n // Make sure player isn't already at the left edge of the map, but let them move if \n // the next square leads to a different map.\n targetSquare = mapLocations[currentLocation][0][playerY][playerX - 1];\n if (typeof targetSquare === \"string\"){\n return true;\n } else if (playerX === 0) {\n return false;\n }\n break;\n case \"right\":\n // Make sure player isn't already at the right edge of the map, but let them move if \n // the next square leads to a different map.\n targetSquare = mapLocations[currentLocation][0][playerY][playerX + 1];\n if (typeof targetSquare === \"string\"){\n return true;\n } else if (playerX === mapWidth) {\n return false;\n }\n break;\n default:\n }\n if (targetSquare === 1 || targetSquare === 3) {\n // Next square is an obstacle\n return false;\n } else if (targetSquare.toString()[0] === \"2\") {\n // Square is taken by an interactive object\n return false;\n } else if (targetSquare === 5 && direction !== \"down\") {\n // Can only jump *down* ledges\n return false;\n } else if (targetSquare === 5 && direction === \"down\") {\n // Next square is a ledge and the player is moving down\n return true;\n } else if (targetSquare.toString()[0] === \"6\") {\n // Square is taken by an NPC\n return false;\n } else if (targetSquare.toString()[0] === \"7\") {\n // Square is taken by a claimable object\n return false;\n } else if (targetSquare.toString()[0] === \"8\") {\n // Invisible barrier. Can't cross without a healthy pokemon.\n if (myPokemon === null) {\n showText(\"You'll need a pokemon to leave town. Find Professor Oak.\");\n return false;\n } else if (myPokemon.currentHP === 0) {\n showText(\"Your pokemon has 0 HP! Talk to Mom to heal.\");\n return false;\n } else {\n return true;\n }\n } else {\n // Default to true. Nothing disqualifies the square.\n return true;\n }\n}", "checkFirstMove(e) {\n let state = new DragManager.DragState(e, this, true);\n if (!state.moved()) {\n // not a move\n return false;\n }\n return this.executeFirstMove(state);\n }", "onClick() {\n let self = this;\n self.validateInput('name', (nameStatus) => {\n if (nameStatus) {\n self.validateInput('description', (descriptionStatus) => {\n if (descriptionStatus) {\n self.validateInput('cost', (costStatus) => {\n if (costStatus) {\n self.validateInput('limit', (limitStatus) => {\n if (limitStatus) {\n this.httpRequest();\n }\n });\n }\n });\n }\n });\n }\n });\n }", "function setPlayerMoves(player, moveOneType, moveOneValue, moveTwoType, moveTwoValue, moveThreeType, moveThreeValue) {\n let moveTypes = ['rock', 'paper', 'scissors']\n\n if (moveOneType === undefined || moveTwoType === undefined || moveThreeType === undefined) {\n return 'Please input a valid move'\n } else if (moveOneValue === undefined || moveTwoValue === undefined || moveThreeValue === undefined) {\n return 'Please input a valid value'\n } else if (isNaN(moveOneValue) || isNaN(moveTwoValue) || isNaN(moveThreeValue)) {\n return 'Please input a number'\n }\n\n if (moveTypes.indexOf(moveOneType) === -1 || moveTypes.indexOf(moveTwoType) === -1 || moveTypes.indexOf(moveThreeType) === -1) {\n return 'Please enter a move that is either rock, paper, or scissors'\n }\n\n if ((moveOneValue + moveTwoValue + moveThreeValue) > 99) {\n return;\n }\n\n if (moveOneValue < 1 || moveTwoValue < 1 || moveThreeValue < 1) {\n return;\n }\n // if (moveOneValue < 1 || moveOneValue >)\n\n if (player === 'Player One') {\n playerOneMoveOneType = moveOneType;\n playerOneMoveOneValue = moveOneValue;\n playerOneMoveTwoType = moveTwoType;\n playerOneMoveTwoValue = moveTwoValue;\n playerOneMoveThreeType = moveThreeType;\n playerOneMoveThreeValue = moveThreeValue;\n } else if (player === 'Player Two') {\n playerTwoMoveOneType = moveOneType;\n playerTwoMoveOneValue = moveOneValue;\n playerTwoMoveTwoType = moveTwoType;\n playerTwoMoveTwoValue = moveTwoValue;\n playerTwoMoveThreeType = moveThreeType;\n playerTwoMoveThreeValue = moveThreeValue;\n }\n\n }", "function checkValidation() {\n if (snake[0].position.x <= food.position.x + 30 && snake[0].position.x >= food.position.x - 30 && snake[0].position.y <= food.position.y + 30 && snake[0].position.y >= food.position.y - 30) {\n food.remove();\n score = score + 1;\n createFood();\n addSnake();\n }\n if (snake.length > 4) {\n for (var i = 5; i < snake.length; i++) {\n if (snake[0].position.x <= snake[i].position.x + 15 && snake[0].position.x >= snake[i].position.x - 15 && snake[0].position.y <= snake[i].position.y + 15 && snake[0].position.y >= snake[i].position.y - 15) {\n snakeEnd();\n }\n }\n }\n}", "validate() {\n let status = true;\n\n status = !this._validateLocalId() ? false : status;\n status = !this._validateUniqueWorkerId() ? false : status;\n status = !this._validateChangeUniqueWorkerId() ? false : status;\n status = !this._validateDisplayId() ? false : status;\n status = !this._validateStatus() ? false : status;\n status = !this._validateDaysSickChanged() ? false : status;\n\n // only continue to process validation, if the status is not UNCHECKED, DELETED OR UNCHANGED\n if (!STOP_VALIDATING_ON.includes(this._status)) {\n status = !this._validateContractType() ? false : status;\n status = !this._validateNINumber() ? false : status;\n status = !this._validatePostCode() ? false : status;\n status = !this._validateDOB() ? false : status;\n status = !this._validateGender() ? false : status;\n status = !this._validateEthnicity() ? false : status;\n status = !this._validateNationality() ? false : status;\n status = !this._validateCitizenShip() ? false : status;\n status = !this._validateCountryOfBirth() ? false : status;\n status = !this._validateYearOfEntry() ? false : status;\n status = !this._validateDisabled() ? false : status;\n status = !this._validateCareCert() ? false : status;\n status = !this._validateRecSource() ? false : status;\n status = !this._validateStartDate() ? false : status;\n status = !this._validateStartInsect() ? false : status;\n status = !this._validateApprentice() ? false : status;\n status = !this._validateZeroHourContract() ? false : status;\n status = !this._validateDaysSick() ? false : status;\n status = !this._validateSalaryInt() ? false : status;\n status = !this._validateSalary() ? false : status;\n status = !this._validateHourlyRate() ? false : status;\n status = !this._validateMainJobRole() ? false : status;\n status = !this._validateMainJobDesc() ? false : status;\n status = !this._validateContHours() ? false : status;\n status = !this._validateAvgHours() ? false : status;\n status = !this._validateRegisteredNurse() ? false : status;\n status = !this._validateNursingSpecialist() ? false : status;\n status = !this._validationQualificationRecords() ? false : status;\n status = !this._validateSocialCareQualification() ? false : status;\n status = !this._validateNonSocialCareQualification() ? false : status;\n status = !this._validateAmhp() ? false : status;\n }\n\n return status;\n }", "function checkValidMove(position_1, position_2) { \n if ((position_1[0] == position_2[0] && Math.abs(position_1[1] - position_2[1]) <= 1) || \n (position_1[1] == position_2[1] && Math.abs(position_1[0] - position_2[0]) <= 1)) {\n return true\n } else return false\n}", "function validate() {\n handle_enter();\n}", "checkValidPlay(startRow,startColumn,endRow,endColumn){\n validPlay(this.boardState, this.playerTurn, startColumn, startRow,endColumn, endRow, data => this.validPlayHandler(data,startRow,startColumn,endRow,endColumn));\n }", "async advance() {\n this.setState({error: '', loading: true})\n const success = await this.props.pickAndCheckPosition(this.state.location.lat, this.state.location.lon);\n if (success) {\n await this.props.setPoints(this.state.location.points);\n await this.props.creditPointsUser();\n await this.setState({loading: false});\n if (this.props.isSpot !== undefined) {\n await this.props.onValidationfromHome(this.state.location.name, this.props.isSpot)\n } else {\n await this.props.onValidation(this.state.location.name, this.state.location.points)\n }\n } else {\n this.setState({error: \"Sorry, you're not close enough.\", loading: false})\n }\n }", "function canMove (x,y,dir) {}", "function setValidations() {\n\tvalidationColumn();\n\tvalidationRow();\n\t// Si hay dulces que borrar\n\tif ($('img.delete').length !== 0) {\n\t\tdeletesCandyAnimation();\n\t}\n}", "moveError(text) {\n\t\t// alert() is a standard browser feature.\n\t\talert('Invalid move: ' + text);\n\t}", "validate() {\n if (this.isDisposed) {\n return;\n }\n this._invalidated = false;\n this._lastArgs = [];\n }", "move() {\n\n }", "function isValidMove(fromCandy, toCandy){\n\tvar absRowDiff = Math.abs(fromCandy.row - toCandy.row);\n\tvar absColDiff = Math.abs(fromCandy.col - toCandy.col);\n\tvar rowDiff = fromCandy.row - toCandy.row;\n\tvar colDiff = fromCandy.col - toCandy.col;\n\tif ((absRowDiff + absColDiff) == 1){//is a neighbor\n\t\tif (rowDiff == 1){\n\t\t\treturn rules.isMoveTypeValid(fromCandy, \"up\");\n\t\t}\n\t\telse if (rowDiff == -1){\n\t\t\treturn rules.isMoveTypeValid(fromCandy, \"down\");\n\t\t}\n\t\telse if (colDiff == 1){\n\t\t\treturn rules.isMoveTypeValid(fromCandy, \"left\");\n\t\t}\n\t\telse if (colDiff == -1){\n\t\t\treturn rules.isMoveTypeValid(fromCandy, \"right\");\n\t\t}\n\t}\n\treturn false;\n}", "setMoveFunction(GameBoardClass,destinationPiece){//this will be used by every pieces enableValidMovements methods\n var destinationButton = GameBoardClass.GameButtons[destinationPiece.row][destinationPiece.column]\n destinationButton.disabled = false;\n destinationButton.onclick = (() =>{\n GameBoardClass.movePiece(GameBoardClass.GameBoard[this.row][this.column], destinationPiece);\n if(this.color == 'white'){\n GameBoardClass.startTurn('black');\n }\n else{\n GameBoardClass.startTurn('white');\n }\n });\n }", "_markAsValid() {\n\t this.$points.find('.point').removeClass('has-error');\n\t }", "validate(state, setError) {\n let errmsg = null,\n minimum = state.minimum,\n maximum = state.maximum,\n start = state.start;\n\n errmsg = emptyValidator('Owner', state.seqowner);\n if (errmsg) {\n setError('seqowner', errmsg);\n return true;\n } else {\n setError('seqowner', errmsg);\n }\n\n errmsg = emptyValidator('Schema', state.schema);\n if (errmsg) {\n setError('schema', errmsg);\n return true;\n } else {\n setError('schema', errmsg);\n }\n\n if (!this.isNew(state)) {\n errmsg = emptyValidator('Current value', state.current_value);\n if (errmsg) {\n setError('current_value', errmsg);\n return true;\n } else {\n setError('current_value', errmsg);\n }\n\n errmsg = emptyValidator('Increment value', state.increment);\n if (errmsg) {\n setError('increment', errmsg);\n return true;\n } else {\n setError('increment', errmsg);\n }\n\n errmsg = emptyValidator('Minimum value', state.minimum);\n if (errmsg) {\n setError('minimum', errmsg);\n return true;\n } else {\n setError('minimum', errmsg);\n }\n\n errmsg = emptyValidator('Maximum value', state.maximum);\n if (errmsg) {\n setError('maximum', errmsg);\n return true;\n } else {\n setError('maximum', errmsg);\n }\n\n errmsg = emptyValidator('Cache value', state.cache);\n if (errmsg) {\n setError('cache', errmsg);\n return true;\n } else {\n setError('cache', errmsg);\n }\n }\n\n let min_lt = gettext('Minimum value must be less than maximum value.'),\n start_lt = gettext('Start value cannot be less than minimum value.'),\n start_gt = gettext('Start value cannot be greater than maximum value.');\n\n if (isEmptyString(minimum) || isEmptyString(maximum))\n return null;\n\n if ((minimum == 0 && maximum == 0) ||\n (parseInt(minimum, 10) >= parseInt(maximum, 10))) {\n setError('minimum', min_lt);\n return true;\n } else {\n setError('minimum', null);\n }\n\n if (start && minimum && parseInt(start) < parseInt(minimum)) {\n setError('start', start_lt);\n return true;\n } else {\n setError('start', null);\n }\n\n if (start && maximum && parseInt(start) > parseInt(maximum)) {\n setError('start', start_gt);\n return true;\n } else {\n setError('start', null);\n }\n return null;\n }", "processMove() {\n let movedPieces = this.gameOrchestrator.gameboard.movePiece(this.firstTile, this.secondTile);\n this.gameMove.setMovedPieces(movedPieces);\n this.gameOrchestrator.gameSequence.addGameMove(this.gameMove);\n }", "_validateMove(dx, trackOriginX, trackWidth, ref) {\n const x = dx - trackOriginX;\n const onTrack = (relX) => {\n const upperBound = relX >= trackWidth ? trackWidth : relX;\n return relX <= 0 ? 0 : upperBound;\n };\n if (!ref) {\n return {};\n }\n const lthumb = this.refs.minRange;\n const rthumb = this.refs.maxRange;\n let oRef = ref;\n if (lthumb.x === rthumb.x) {\n if (x > rthumb.x) {\n oRef = this._overriddenThumb = rthumb;\n ref.confirmMoveTo(ref.x);\n }\n else if (x < lthumb.x) {\n oRef = this._overriddenThumb = lthumb;\n ref.confirmMoveTo(ref.x);\n }\n }\n let valX;\n if (oRef === lthumb) {\n valX = x >= rthumb.x ? rthumb.x : onTrack(x);\n }\n else if (oRef === rthumb) {\n valX = x <= lthumb.x ? lthumb.x : onTrack(x);\n }\n return { newRef: oRef, x: this._snap(valX) };\n }", "function validarTeclas() {\n if (keyIsDown(97) || keyIsDown (65)) {\n pacman.mover(key);\n }\n if (keyIsDown(68) || keyIsDown (100)) {\n pacman.mover(key);\n }\n if (keyIsDown(87) || keyIsDown (119)) {\n pacman.mover(key);\n }\n if (keyIsDown(83) || keyIsDown (115)) {\n pacman.mover(key);\n}\n }", "function validateCheck() {\n\n setActivityCardRules($scope.cardRules.value());\n setSpecialUsePackages($scope.specialPackages.value());\n generateCodeAuto();\n service.validate($scope.activity).success(function () {\n $scope.save();\n }).error(function (error) {\n console.log('error -> ', error);\n });\n }", "invalidateMove(player, tile) {\n // <<-- Creer-Merge: invalidate-move -->>\n if (!player || player !== this.game.currentPlayer) {\n return `It isn't your turn, ${player}.`;\n }\n if ((this.job.title === \"worker\") && (this.owner !== player || this.owner === undefined)) {\n return `${this} isn't owned by you.`;\n }\n if (this.acted) {\n return `${this} has already acted this turn.`;\n }\n if (!this.tile) {\n return `${this} is not on a tile! Could they be behind you..?`;\n }\n // Make sure the tile is on the map\n if (!tile) {\n return `${this}, unit cannot plane shift, tile does not exist in this plane.`;\n }\n // Make sure there are moves left\n if (this.moves <= 0) {\n return `${this} has no more moves and might fall apart!`;\n }\n // Make both players don't own the tile\n if (this.owner === this.owner.opponent) {\n return `${this} cannot walk on the enemies side!`;\n }\n // Make sure tile is part of the path\n if (!tile.isPath && this.job.title !== \"worker\") {\n return `${this}, going off the path is dangerous!`;\n }\n // Or, make sure it isn't for workers\n if (tile.isPath && this.job.title === \"worker\") {\n return `${this}, workers are not allowed on the path!`;\n }\n // Make sure tile is not a river tile\n if (tile.isRiver) {\n return `${this} cannot swim.`;\n }\n // Make sure tile isnt occupied by a different unit type\n if (tile.unit) {\n if (tile.unit.job !== this.job) {\n return `${this} is not allowed to walk on ${tile.unit}!`;\n }\n else {\n if (this.job.title === \"zombie\" && tile.numZombies >= this.game.unitJobs[1].perTile\n || this.job.title === \"hound\" && tile.numHounds >= this.game.unitJobs[4].perTile\n || this.job.title === \"ghoul\" && tile.numGhouls >= this.game.unitJobs[2].perTile) {\n return `${this} cannot walk on a fully occupied tile!`;\n }\n if (this.job.title === \"worker\" || this.job.title === \"abomination\"\n || this.job.title === \"horseman\" || this.job.title === \"wraith\") {\n return `${this} cannot walk on an occupied tile!`;\n }\n }\n }\n // Make sure tile isnt a tower\n if (tile.isTower) {\n return `${this} cannot hide in the tower.`;\n }\n // Make sure tile isnt a wall\n if (tile.isWall) {\n return `${this} cannot move through, under, over or around walls..we are sorry.`;\n }\n // <<-- /Creer-Merge: invalidate-move -->>\n }", "function Main() {\n\n /**\n * Anzahl an Citys.length Autos werden erstellt\n *\n * @param {array} Citys wird benötigt\n * @param {string} raeder wird benötigt\n */\n for (let i = 0; i < Citys.length ; i++) {\n Auto(4, Citys[i]);\n }\n\n let myAuto = new Auto();\n let myStreets = new Street(\"Crivitz\", \"Parchim\");\n console.log(myStreets.succesfull());\n\n let move = function() {\n if (!myStreets.succesfull() == undefined)\n\n }\n}", "isValidateLocation() {\n return !this.state.transitioning && !this.props.delay\n }", "function isValidMoveValue(moveValue) {\n return (moveValue >= 1) && (moveValue <= 99);\n}", "move(event) {\n event.target.classList.remove('free'); //The 'free' class is removed indcating the space cannot be played again\n event.target.classList.add(this._playClass); //Adds the class for the current player (The 'X' or the 'O')\n event.target.classList.add('taken'); // A class of 'taken' is given showing the space is played\n board.updateBoard(event, this); //Calls the updateBoard method to update the board._board array.\n this.turn = false; //Sets the turn of the player that just moved to false\n\n //Sets the state of the other player's turn to true\n if (this._player === 'player1') {\n player2.turn = true;\n } else if (this._player === 'player2') {\n player1.turn = true;\n } else {\n return false;\n }\n\n //If player 2 is a computer player, the computerMove method is evoked\n if (this._player === 'player1' && player2._isComputer && !player1._isWinner && !player2._isWinner) {\n player2.computerMove();\n }\n }", "function checkValidMove(tower, catId) {\r\n\treturn getFirstCat(tower, catId);\r\n}", "playerMove(move) {\r\n if (this.curPlayer === 1 || (this.curPlayer === 2 && this.playerTwo === \"human\")) {\r\n if (this.gameState.validSpace(move)) { \r\n this.gameState.makeMove(move, this.curPlayer);\r\n this.updateBoard();\r\n this.curPlayer = (this.curPlayer === 1) ? 2 : 1;\r\n if (this.curPlayer === 2 && this.playerTwo === \"ai\" && !this.gameOver){\r\n this.aiGo();\r\n } \r\n }\r\n }\r\n }", "function validateBoard() {\n var puzzleString = initPuzzle();\n sudokuSolver.solve(puzzleString, 1);\n }", "function move(square, checker){\n let a = checker.getAttribute('position')\n let b = square.getAttribute('position')\n let x = a[0] - b[0];\n let y = a[2] - b[2];\n \n if(checker.getAttribute('player') === 'red' || checker.classList.contains('king')){\n if((moves.redMove.x[0] === x && moves.redMove.x[1] === y) || moves.redMove.y[0] === x && moves.redMove.y[1] === y){\n attributes(checker, square)\n }\n }\n if(checker.getAttribute('player') === 'black' || checker.classList.contains('king')){\n if((moves.blackMove.x[0] === x && moves.blackMove.x[1] === y) || moves.blackMove.y[0] === x && moves.blackMove.y[1] === y){\n attributes(checker, square);\n }\n }\n clearSelection();\n}", "function validate() {\r\n\r\n\r\n \r\n // set the progress of the background\r\n progress.style.width = ++position * 100 / questions.length + 'vw'\r\n\r\n // if there is a new question, hide current and load next\r\n if (questions[position]) hideCurrent(putQuestion)\r\n else hideCurrent(done)\r\n \r\n \r\n\r\n }", "move() {\n }", "checkCoordinates(ship,position){\n if(ship.vertical == false){\n // prevents a ship from extending horizontally off of grid when placed\n if(10 - parseInt(position.charAt(1)) < ship.length){\n this.message = 'Not Enough Space'\n return false\n }\n else{\n // checks each potential position the ship could occupy, based on length, horizontally from the right of the position coordinate\n for(let i = 0; i < ship.length; i++){\n // if the grid is empty at a given coordinate the next is checked, the process is repeated for the length of the ship\n if(this.grid[parseInt(position.charAt(0))][(parseInt(position.charAt(1)))+i] === ''){\n continue\n }\n else{\n this.message = 'A ship cannot be placed over another ship'\n return false\n }\n }\n return true\n }\n }\n // '10' is the botom of the grid and so a vertical ship cannot begin in the '10' row / (9'x')\n else if(ship.vertical == true){\n if(10 - parseInt(position.charAt(0)) < ship.length){\n this.message = 'Not Enough Space'\n return false\n }\n else{\n // checks each potential position the ship could occupy, based on length, horizontally from the right of the position coordinate\n for(let i = 0; i < ship.length; i++){\n // if the grid is empty at a given coordinate the next is checked, the process is repeated for the length of the ship\n if(this.grid[(parseInt(position.charAt(0))+i)][parseInt(position.charAt(1))] === ''){\n continue\n }\n else{\n this.message = 'A ship cannot be placed over another ship'\n return false\n }\n }\n return true\n }\n } \n }", "validatePositioning() {\n if (!this.positioningValid) {\n this.calculateAndSetPopupPosition();\n }\n }", "function getPlayerMove(move) {\n if (move === undefined||null){\n return getInput();\n \n }\n return move;\n}", "afterValidChange() { }" ]
[ "0.76095885", "0.7563932", "0.65470994", "0.64211345", "0.64187384", "0.61983836", "0.6197822", "0.6182796", "0.6180657", "0.61766225", "0.61533093", "0.61339474", "0.6096995", "0.60783094", "0.6069268", "0.5997508", "0.5978371", "0.59370774", "0.5839926", "0.5828299", "0.58247495", "0.5818385", "0.5808432", "0.5796596", "0.57905215", "0.5774666", "0.5754846", "0.5749797", "0.5722737", "0.57150775", "0.57150775", "0.56886476", "0.56840295", "0.5651439", "0.564502", "0.561377", "0.56078595", "0.56053156", "0.5590551", "0.5571102", "0.55664885", "0.5565996", "0.5558642", "0.55586356", "0.554429", "0.554429", "0.5523858", "0.5519471", "0.5509017", "0.54917574", "0.54870725", "0.54860073", "0.5473082", "0.5464505", "0.54627836", "0.54578066", "0.54543114", "0.544185", "0.5432707", "0.54256713", "0.54231226", "0.5412982", "0.5404976", "0.5402888", "0.5402074", "0.54019827", "0.53986317", "0.5392148", "0.5381639", "0.5359877", "0.535661", "0.53548944", "0.5338403", "0.5335261", "0.53229105", "0.5321366", "0.53211546", "0.5316429", "0.5310831", "0.53095907", "0.53033626", "0.53016955", "0.52972615", "0.5292576", "0.5290652", "0.5280989", "0.52778465", "0.52761436", "0.5272745", "0.52720684", "0.52700186", "0.5269795", "0.5268809", "0.5251229", "0.52489805", "0.5248584", "0.5247717", "0.52445745", "0.5238822", "0.52379686" ]
0.61057097
12
React has AMD support so when require is present it will behave as a module The react example however expects a global React so we need to put it back into global space.
function globalizeReact() { var global = (function () { return this; })(); global.React = global.React || react; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n return (\n //JSX=>needs to import React\n <div >\n Hello Worldfff\n </div>\n );\n}", "render() {\n return (\n <div className=\"App\">\n <h1>My React App</h1>\n <p>This is really working</p>\n </div>\n );\n // Above jsx in return stmt gets compiled into the following and thus React import is mandatory\n // return React.createElement('div',null,'h1','My React App')\n // return React.createElement('div',{className:'App'},React.createElement('h1',null,'My React App'))\n }", "function AlterHelloFromReact() {\n React.render(\n React.createElement('div', {className: 'altered'}, 'Altered Hello from React!'),\n document.getElementById('my-component')\n );\n}", "function defineReact(react, reflux)\n{\n\tvar rflx, proto;\n\t\n\ttry {\n\t\trflx = reflux || Reflux;\n\t} catch (e) {\n\t\treturn;\n\t}\n\t\n\trflx.GlobalState = rflx.GlobalState || {};\n\t\n\tif (rflx && react && react.Component)\n\t{\n\t\tvar RefluxComponent = function(props) {\n\t\t\t_super.call(this, props);\n\t\t};\n\t\t\n\t\tvar _super = react.Component;\n\t\text(RefluxComponent, _super);\n\t\t\n\t\tproto = RefluxComponent.prototype;\n\t\t\n\t\tproto.componentWillMount = function () {\n\t\t\tif (this.store) {\n\t\t\t\tif (Array.isArray(this.stores)) {\n\t\t\t\t\tthis.stores.unshift(this.store);\n\t\t\t\t} else {\n\t\t\t\t\tthis.stores = [this.store];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.stores) {\n\t\t\t\tthis.__storeunsubscribes__ = [];\n\t\t\t\tfor (var i = 0, ii = this.stores.length; i < ii; i++) {\n\t\t\t\t\tvar str = this.stores[i];\n\t\t\t\t\tif (str.isES6Store) {\n\t\t\t\t\t\tvar storeId = str.id;\n\t\t\t\t\t\tif (!str.singleton) {\n\t\t\t\t\t\t\tstr.singleton = new str();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.stores[i] = str = str.singleton;\n\t\t\t\t\t\tstr.id = storeId;\n\t\t\t\t\t\tif (storeId && rflx.GlobalState[storeId]) {\n\t\t\t\t\t\t\tstr.state = rflx.GlobalState[storeId];\n\t\t\t\t\t\t} else if (storeId) {\n\t\t\t\t\t\t\trflx.GlobalState[storeId] = str.state;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.__storeunsubscribes__.push(str.listen(this.setState.bind(this)));\n\t\t\t\t\tthis.setState(str.state);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Error('Extending Reflux.Component requires you to set either this.store or this.stores in the constructor.');\n\t\t\t}\n\t\t};\n\t\t\n\t\tproto.componentWillUnmount = function () {\n\t\t\tfor (var i = 0, ii = this.__storeunsubscribes__.length; i < ii; i++) {\n\t\t\t\tthis.__storeunsubscribes__[i]();\n\t\t\t}\n\t\t};\n\t\t\n\t\trflx.Component = RefluxComponent;\n\t\t\n\t\t// ---------------------------------------------------\n\t\t\n\t\tvar RefluxStore = function() {\n\t\t\tthis.__store__ = rflx.createStore();\n\t\t\tthis.state = {};\n\t\t\tvar self = this;\n\t\t\tfor (var key in this.__store__) {\n\t\t\t\t/*jshint loopfunc: true */\n\t\t\t\t(function (prop) {\n\t\t\t\t\tObject.defineProperty(self, prop, {\n\t\t\t\t\t\tget: function () { return self.__store__[prop]; },\n\t\t\t\t\t\tset: function (v) { self.__store__[prop] = v; }\n\t\t\t\t\t});\n\t\t\t\t})(key);\n\t\t\t}\n\t\t};\n\t\t\n\t\tproto = RefluxStore.prototype;\n\t\t\n\t\tObject.defineProperty(proto, \"listenables\", {\n\t\t\tget: function () {\n\t\t\t\treturn this.__listenables__;\n\t\t\t},\n\t\t\tset: function (v) {\n\t\t\t\tthis.__listenables__ = v;\n\t\t\t\tthis.listenToMany(v);\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t\t\n\t\tproto.setState = function (obj) {\n\t\t\t// Object.assign(this.state, obj); // later turn this to Object.assign and remove loop once support is good enough\n\t\t\tfor (var key in obj) {\n\t\t\t\tthis.state[key] = obj[key];\n\t\t\t}\n\t\t\tif (this.id) {\n\t\t\t\trflx.GlobalState[this.id] = this.state;\n\t\t\t}\n\t\t\tthis.trigger(obj);\n\t\t};\n\t\t\n\t\tObject.defineProperty(RefluxStore, \"isES6Store\", {\n\t\t\tget: function () {\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t\t\n\t\trflx.Store = RefluxStore;\n\t}\n}", "function App() {\n return <div className=\"reactApp\" />;\n}", "render() {\n return (\n <div>\n\t\t\t<p>Hello Universe!!</p>\n\t\t\t<p>We are ready to start with React js</p>\n </div>\n );\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}", "function reactify(fn) {\n return render(host => {\n const Component = fn(host);\n return (host, target) => ReactDOM.render(Component, target);\n }, {\n shadowRoot: true\n });\n}", "function __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}", "function _isReactJSModule(j, root) {\n return !!root.find(j.MethodDefinition, { key: { name: \"render\" } }).length || !!root.find(j.Identifier, { name: \"createReactClass\" }).length;\n}", "function setupBinding(root, factory) {\n\t if (true) {\n\t // AMD. Register as an anonymous module.\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! react */ 1),__webpack_require__(/*! react-dom */ 32)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom) {\n\t return factory(root, React, ReactDom);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t } else if (typeof exports === 'object') {\n\t // Node. Note that this does not work with strict\n\t // CommonJS, but only CommonJS-like environments\n\t // that support module.exports\n\t module.exports = factory(root, require('react'), require('react-dom'));\n\t } else {\n\t // Browser globals (root is window)\n\t root.onClickOutside = factory(root, React, ReactDOM);\n\t }\n\t }", "function defineAMDModule (fn){\n\n\t\tif ( window.define === undefined ){\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( isDefinedAsAMD ){\n\t\t\treturn true;\n\t\t}\n\n\t\t/* Using a named moduled is mantatory. See http://requirejs.org/docs/errors.html#mismatch */\n\t\twindow.define('errorlogger', [], fn);\n\n\t\tisDefinedAsAMD = true;\n\t\treturn true;\n\t}", "function HelloReact() {\n return (\n <div className=\"container\">\n Hello React!\n {/*Another imported component*/}\n <Counter/>\n </div>\n )\n}", "function require() { return {}; }", "render() {\n return (\n <div>React JS and JSX in action!</div>\n )\n }", "function setupBinding(root, factory) {\n\t if (true) {\n\t // AMD. Register as an anonymous module.\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1),__webpack_require__(36),__webpack_require__(820)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom, createReactClass) {\n\t if (!createReactClass) createReactClass = React.createClass;\n\t return factory(root, React, ReactDom, createReactClass);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t } else if (typeof exports === 'object') {\n\t // Node. Note that this does not work with strict\n\t // CommonJS, but only CommonJS-like environments\n\t // that support module.exports\n\t module.exports = factory(root, require('react'), require('react-dom'), require('create-react-class'));\n\t } else {\n\t // Browser globals (root is window)\n\t var createReactClass = React.createClass ? React.createClass : window.createReactClass;\n\t root.onClickOutside = factory(root, React, ReactDOM, createReactClass);\n\t }\n\t }", "function shim() {\n (function () {\n {\n {\n throw ReactError(Error('The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.'));\n }\n }\n })();\n}", "function shim() {\n (function () {\n {\n {\n throw ReactError(Error('The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.'));\n }\n }\n })();\n}", "function loadModule(moduleName){var module=modules[moduleName];if(module!==undefined){return module;}// This uses a switch for static require analysis\nswitch(moduleName){case'charset':module=__webpack_require__(229);break;case'encoding':module=__webpack_require__(230);break;case'language':module=__webpack_require__(231);break;case'mediaType':module=__webpack_require__(232);break;default:throw new Error('Cannot find module \\''+moduleName+'\\'');}// Store to prevent invoking require()\nmodules[moduleName]=module;return module;}", "function App() {\r\n return (\r\n <div>\r\n <div class=\"container\">\r\n <div class=\"app\">App Component - contains Hello and Goodbye</div>\r\n <Hello name=\"React code in Script3.js\" />\r\n <Goodbye name=\"React component code in body\" />\r\n </div>\r\n </div>\r\n );\r\n}", "function amd(loader) {\n // by default we only enforce AMD noConflict mode in Node\n var isNode = typeof module != 'undefined' && module.exports;\n\n loader._extensions.push(amd);\n\n // AMD Module Format Detection RegEx\n // define([.., .., ..], ...)\n // define(varName); || define(function(require, exports) {}); || define({})\n var amdRegEx = /(?:^\\uFEFF?|[^$_a-zA-Z\\xA0-\\uFFFF.])define\\s*\\(\\s*(\"[^\"]+\"\\s*,\\s*|'[^']+'\\s*,\\s*)?\\s*(\\[(\\s*((\"[^\"]+\"|'[^']+')\\s*,|\\/\\/.*\\r?\\n|\\/\\*(.|\\s)*?\\*\\/))*(\\s*(\"[^\"]+\"|'[^']+')\\s*,?)?(\\s*(\\/\\/.*\\r?\\n|\\/\\*(.|\\s)*?\\*\\/))*\\s*\\]|function\\s*|{|[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*\\))/;\n\n var commentRegEx = /(\\/\\*([\\s\\S]*?)\\*\\/|([^:]|^)\\/\\/(.*)$)/mg;\n var stringRegEx = /(\"[^\"\\\\\\n\\r]*(\\\\.[^\"\\\\\\n\\r]*)*\"|'[^'\\\\\\n\\r]*(\\\\.[^'\\\\\\n\\r]*)*')/g;\n var cjsRequirePre = \"(?:^|[^$_a-zA-Z\\\\xA0-\\\\uFFFF.])\";\n var cjsRequirePost = \"\\\\s*\\\\(\\\\s*(\\\"([^\\\"]+)\\\"|'([^']+)')\\\\s*\\\\)\";\n var fnBracketRegEx = /\\(([^\\)]*)\\)/;\n var wsRegEx = /^\\s+|\\s+$/g;\n\n var requireRegExs = {};\n\n function getCJSDeps(source, requireIndex) {\n var stringLocations = [];\n\n var match;\n\n function inLocation(locations, index) {\n for (var i = 0; i < locations.length; i++)\n if (locations[i][0] < index && locations[i][1] > index)\n return true;\n return false;\n }\n\n while (match = stringRegEx.exec(source))\n stringLocations.push([match.index, match.index + match[0].length]);\n\n // remove comments\n source = source.replace(commentRegEx, function(match, a, b, c, d, offset){\n if(inLocation(stringLocations, offset + 1)) {\n return match;\n } else {\n return '';\n }\n });\n\n // determine the require alias\n var params = source.match(fnBracketRegEx);\n var requireAlias = (params[1].split(',')[requireIndex] || 'require').replace(wsRegEx, '');\n\n // find or generate the regex for this requireAlias\n var requireRegEx = requireRegExs[requireAlias] || (requireRegExs[requireAlias] = new RegExp(cjsRequirePre + requireAlias + cjsRequirePost, 'g'));\n\n requireRegEx.lastIndex = 0;\n\n var deps = [];\n\n var match;\n while (match = requireRegEx.exec(source))\n deps.push(match[2] || match[3]);\n\n return deps;\n }\n\n /*\n AMD-compatible require\n To copy RequireJS, set window.require = window.requirejs = loader.amdRequire\n */\n function require(names, callback, errback, referer) {\n // 'this' is bound to the loader\n var loader = this;\n\n // in amd, first arg can be a config object... we just ignore\n if (typeof names == 'object' && !(names instanceof Array))\n return require.apply(null, Array.prototype.splice.call(arguments, 1, arguments.length - 1));\n\n // amd require\n if (names instanceof Array)\n Promise.all(names.map(function(name) {\n return loader['import'](name, referer);\n })).then(function(modules) {\n if(callback) {\n callback.apply(null, modules);\n }\n }, errback);\n\n // commonjs require\n else if (typeof names == 'string') {\n var module = loader.get(names);\n return module.__useDefault ? module['default'] : module;\n }\n\n else\n throw new TypeError('Invalid require');\n };\n loader.amdRequire = function() {\n return require.apply(this, arguments);\n };\n\n function makeRequire(parentName, staticRequire, loader) {\n return function(names, callback, errback) {\n if (typeof names == 'string')\n return staticRequire(names);\n return require.call(loader, names, callback, errback, { name: parentName });\n }\n }\n\n // run once per loader\n function generateDefine(loader) {\n // script injection mode calls this function synchronously on load\n var onScriptLoad = loader.onScriptLoad;\n loader.onScriptLoad = function(load) {\n onScriptLoad(load);\n if (anonDefine || defineBundle) {\n load.metadata.format = 'defined';\n load.metadata.registered = true;\n }\n\n if (anonDefine) {\n load.metadata.deps = load.metadata.deps ? load.metadata.deps.concat(anonDefine.deps) : anonDefine.deps;\n load.metadata.execute = anonDefine.execute;\n }\n }\n\n function define(name, deps, factory) {\n if (typeof name != 'string') {\n factory = deps;\n deps = name;\n name = null;\n }\n if (!(deps instanceof Array)) {\n factory = deps;\n deps = ['require', 'exports', 'module'];\n }\n\n if (typeof factory != 'function')\n factory = (function(factory) {\n return function() { return factory; }\n })(factory);\n\n // in IE8, a trailing comma becomes a trailing undefined entry\n if (deps[deps.length - 1] === undefined)\n deps.pop();\n\n // remove system dependencies\n var requireIndex, exportsIndex, moduleIndex;\n\n if ((requireIndex = indexOf.call(deps, 'require')) != -1) {\n\n deps.splice(requireIndex, 1);\n\n var factoryText = factory.toString();\n\n deps = deps.concat(getCJSDeps(factoryText, requireIndex));\n }\n\n\n if ((exportsIndex = indexOf.call(deps, 'exports')) != -1)\n deps.splice(exportsIndex, 1);\n\n if ((moduleIndex = indexOf.call(deps, 'module')) != -1)\n deps.splice(moduleIndex, 1);\n\n var define = {\n deps: deps,\n execute: function(require, exports, module) {\n\n var depValues = [];\n for (var i = 0; i < deps.length; i++)\n depValues.push(require(deps[i]));\n\n module.uri = loader.baseURL + module.id;\n\n module.config = function() {};\n\n // add back in system dependencies\n if (moduleIndex != -1)\n depValues.splice(moduleIndex, 0, module);\n\n if (exportsIndex != -1)\n depValues.splice(exportsIndex, 0, exports);\n\n if (requireIndex != -1)\n depValues.splice(requireIndex, 0, makeRequire(module.id, require, loader));\n\n var output = factory.apply(global, depValues);\n\n if (typeof output == 'undefined' && module)\n output = module.exports;\n\n if (typeof output != 'undefined')\n return output;\n }\n };\n\n // anonymous define\n if (!name) {\n // already defined anonymously -> throw\n if (anonDefine)\n throw new TypeError('Multiple defines for anonymous module');\n anonDefine = define;\n }\n // named define\n else {\n // if it has no dependencies and we don't have any other\n // defines, then let this be an anonymous define\n if (deps.length == 0 && !anonDefine && !defineBundle)\n anonDefine = define;\n\n // otherwise its a bundle only\n else\n anonDefine = null;\n\n // the above is just to support single modules of the form:\n // define('jquery')\n // still loading anonymously\n // because it is done widely enough to be useful\n\n // note this is now a bundle\n defineBundle = true;\n\n // define the module through the register registry\n loader.register(name, define.deps, false, define.execute);\n }\n };\n define.amd = {};\n loader.amdDefine = define;\n }\n\n var anonDefine;\n // set to true if the current module turns out to be a named define bundle\n var defineBundle;\n\n var oldModule, oldExports, oldDefine;\n\n // adds define as a global (potentially just temporarily)\n function createDefine(loader) {\n if (!loader.amdDefine)\n generateDefine(loader);\n\n anonDefine = null;\n defineBundle = null;\n\n // ensure no NodeJS environment detection\n var global = loader.global;\n\n oldModule = global.module;\n oldExports = global.exports;\n oldDefine = global.define;\n\n global.module = undefined;\n global.exports = undefined;\n\n if (global.define && global.define === loader.amdDefine)\n return;\n\n global.define = loader.amdDefine;\n }\n\n function removeDefine(loader) {\n var global = loader.global;\n global.define = oldDefine;\n global.module = oldModule;\n global.exports = oldExports;\n }\n\n generateDefine(loader);\n\n if (loader.scriptLoader) {\n var loaderFetch = loader.fetch;\n loader.fetch = function(load) {\n createDefine(this);\n return loaderFetch.call(this, load);\n }\n }\n\n var loaderInstantiate = loader.instantiate;\n loader.instantiate = function(load) {\n var loader = this;\n\n if (load.metadata.format == 'amd' || !load.metadata.format && load.source.match(amdRegEx)) {\n load.metadata.format = 'amd';\n\n if (loader.execute !== false) {\n createDefine(loader);\n\n loader.__exec(load);\n\n removeDefine(loader);\n\n if (!anonDefine && !defineBundle && !isNode)\n throw new TypeError('AMD module ' + load.name + ' did not define');\n }\n\n if (anonDefine) {\n load.metadata.deps = load.metadata.deps ? load.metadata.deps.concat(anonDefine.deps) : anonDefine.deps;\n load.metadata.execute = anonDefine.execute;\n }\n }\n\n return loaderInstantiate.call(loader, load);\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 ReactDOM.render(\n <MyComponents.App\n data={data}\n actions={actions}/>,\n $('#app-container').get(0)\n );\n}", "function render(){\n ReactDOM.render(<TodoApp model = { model }/>,document.querySelector('#root'));\n}", "function initDesktop() {\n\n ReactDOM.render(<App />, document.getElementById('root'));\n\n}", "getComponent(location, cb) { \n // React will fetch code for getComponent() and call the callback, cb\n System.import('./components/artists/ArtistCreate')\n .then(module => cb(null, module.default));\n // remember System.import('') - webpack will automatically modify the bundle that is generated to split off the module that is called\n // Gotcha's: cb(error argument,)\n // Note: Webpack manually scans for System.import() calls so a help function cannot be used to minimize this code whenusing webpack (b/c of limitations)\n }", "render() {\n // the render returns JSX\n return (\n <div id=\"app\">\n <h1>React App Component</h1>\n <Header title=\"My awesome webpage\" />\n </div>\n )\n }", "function includeMainModule(amdConfig, bundleName) {\n amdConfig.include = amdConfig.include || [];\n amdConfig.include.push(bundleName + '/' + bundleName);\n}", "function findReact(dom) {\r\n\t\treturn dom[Object.keys(dom).find(a=>a.startsWith(\"__reactInternalInstance$\"))].return.stateNode;\r\n\t}", "getComponent(nextState, cb) {\n /* Webpack - use 'require.ensure' to create a split point\n and embed an async module loader (jsonp) when bundling */\n require.ensure(\n [],\n require => {\n /* Webpack - use require callback to define\n dependencies for bundling */\n const EvaluateList = require('./components/EvaluateList').default\n const EvaluateListTitle = require('./title/EvaluateListTitle').default\n\n cb(null, {\n title: EvaluateListTitle,\n content: EvaluateList\n })\n\n /* Webpack named bundle */\n },\n 'EvalutateList'\n )\n }", "function hotCreateRequire(moduleId) {\r\n/******/ \t\tvar me = installedModules[moduleId];\r\n/******/ \t\tif (!me) return __webpack_require__;\r\n/******/ \t\tvar fn = function(request) {\r\n/******/ \t\t\tif (me.hot.active) {\r\n/******/ \t\t\t\tif (installedModules[request]) {\r\n/******/ \t\t\t\t\tif (installedModules[request].parents.indexOf(moduleId) === -1) {\r\n/******/ \t\t\t\t\t\tinstalledModules[request].parents.push(moduleId);\r\n/******/ \t\t\t\t\t}\r\n/******/ \t\t\t\t} else {\r\n/******/ \t\t\t\t\thotCurrentParents = [moduleId];\r\n/******/ \t\t\t\t\thotCurrentChildModule = request;\r\n/******/ \t\t\t\t}\r\n/******/ \t\t\t\tif (me.children.indexOf(request) === -1) {\r\n/******/ \t\t\t\t\tme.children.push(request);\r\n/******/ \t\t\t\t}\r\n/******/ \t\t\t} else {\r\n/******/ \t\t\t\tconsole.warn(\r\n/******/ \t\t\t\t\t\"[HMR] unexpected require(\" +\r\n/******/ \t\t\t\t\t\trequest +\r\n/******/ \t\t\t\t\t\t\") from disposed module \" +\r\n/******/ \t\t\t\t\t\tmoduleId\r\n/******/ \t\t\t\t);\r\n/******/ \t\t\t\thotCurrentParents = [];\r\n/******/ \t\t\t}\r\n/******/ \t\t\treturn __webpack_require__(request);\r\n/******/ \t\t};\r\n/******/ \t\tvar ObjectFactory = function ObjectFactory(name) {\r\n/******/ \t\t\treturn {\r\n/******/ \t\t\t\tconfigurable: true,\r\n/******/ \t\t\t\tenumerable: true,\r\n/******/ \t\t\t\tget: function() {\r\n/******/ \t\t\t\t\treturn __webpack_require__[name];\r\n/******/ \t\t\t\t},\r\n/******/ \t\t\t\tset: function(value) {\r\n/******/ \t\t\t\t\t__webpack_require__[name] = value;\r\n/******/ \t\t\t\t}\r\n/******/ \t\t\t};\r\n/******/ \t\t};\r\n/******/ \t\tfor (var name in __webpack_require__) {\r\n/******/ \t\t\tif (\r\n/******/ \t\t\t\tObject.prototype.hasOwnProperty.call(__webpack_require__, name) &&\r\n/******/ \t\t\t\tname !== \"e\" &&\r\n/******/ \t\t\t\tname !== \"t\"\r\n/******/ \t\t\t) {\r\n/******/ \t\t\t\tObject.defineProperty(fn, name, ObjectFactory(name));\r\n/******/ \t\t\t}\r\n/******/ \t\t}\r\n/******/ \t\tfn.e = function(chunkId) {\r\n/******/ \t\t\tif (hotStatus === \"ready\") hotSetStatus(\"prepare\");\r\n/******/ \t\t\thotChunksLoading++;\r\n/******/ \t\t\treturn __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {\r\n/******/ \t\t\t\tfinishChunkLoading();\r\n/******/ \t\t\t\tthrow err;\r\n/******/ \t\t\t});\r\n/******/\r\n/******/ \t\t\tfunction finishChunkLoading() {\r\n/******/ \t\t\t\thotChunksLoading--;\r\n/******/ \t\t\t\tif (hotStatus === \"prepare\") {\r\n/******/ \t\t\t\t\tif (!hotWaitingFilesMap[chunkId]) {\r\n/******/ \t\t\t\t\t\thotEnsureUpdateChunk(chunkId);\r\n/******/ \t\t\t\t\t}\r\n/******/ \t\t\t\t\tif (hotChunksLoading === 0 && hotWaitingFiles === 0) {\r\n/******/ \t\t\t\t\t\thotUpdateDownloaded();\r\n/******/ \t\t\t\t\t}\r\n/******/ \t\t\t\t}\r\n/******/ \t\t\t}\r\n/******/ \t\t};\r\n/******/ \t\tfn.t = function(value, mode) {\r\n/******/ \t\t\tif (mode & 1) value = fn(value);\r\n/******/ \t\t\treturn __webpack_require__.t(value, mode & ~1);\r\n/******/ \t\t};\r\n/******/ \t\treturn fn;\r\n/******/ \t}", "function App() {\n return (\n <div className=\"App\">\n hello world\n </div>\n );\n}", "function App() { \n return (\n <div className=\"app\">\n\n </div>\n);\n}", "render() { //Render a React element into the DOM\n return (\n <div>\n <Main />\n </div>\n );\n }", "function component() {\n let element = document.createElement('div');\n\n // Lodash, now imported by this script\n element.innerHTML = \"webpack 自动部署 热启动成功啦!\";\n element.classList.add(\"example\");\n return element;\n}", "function initialReact (){\n React.render(<UserProfile data={data}/>,document.body);\n}", "function App() {\n return <HelloDiv />;\n}", "function lib(mode)\n{\n return mode === 'development' ? [\n './node_modules/react/umd/react.development.js',\n './node_modules/react-dom/umd/react-dom.development.js',\n './node_modules/redux/dist/redux.js'\n ] : [\n './node_modules/react/umd/react.production.min.js',\n './node_modules/react-dom/umd/react-dom.production.min.js',\n './node_modules/redux/dist/redux.min.js'\n ];\n\n}", "render() {\n // the \"render\" method required by \"component\" returns HTML https://www.w3schools.com/react/react_components.asp\n return ( // virtual DOM of REACT, so that you can insert HTML syntax below in a js file\n // ↓ \"class\" is a reserved word in js, so turn it into \"className\"\n\n <div className=\"App\">\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <p>\n Edit <code>src/App.js</code> and save to reload.\n </p>\n <a\n className=\"App-link\"\n href=\"https://reactjs.org\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n Learn React\n </a>\n </header>\n </div>\n );\n }", "function serveReactDemo(args, cb) {\n var pkg = require(_path2.default.resolve('package.json'));\n\n (0, _webpackServer2.default)(args, {\n babel: {\n presets: ['react', 'react-hmre']\n },\n entry: [_path2.default.resolve('demo/src/index.js')],\n output: {\n filename: 'demo.js',\n // This doesn't really matter, as files will be served from memory\n path: process.cwd(),\n publicPath: '/'\n },\n plugins: {\n html: {\n mountId: 'demo',\n title: `${pkg.name} ${pkg.version} Demo`\n }\n }\n }, cb);\n}", "function hotCreateRequire(moduleId) {\n/******/ \t\tvar me = installedModules[moduleId];\n/******/ \t\tif (!me) return __webpack_require__;\n/******/ \t\tvar fn = function(request) {\n/******/ \t\t\tif (me.hot.active) {\n/******/ \t\t\t\tif (installedModules[request]) {\n/******/ \t\t\t\t\tif (installedModules[request].parents.indexOf(moduleId) === -1) {\n/******/ \t\t\t\t\t\tinstalledModules[request].parents.push(moduleId);\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t} else {\n/******/ \t\t\t\t\thotCurrentParents = [moduleId];\n/******/ \t\t\t\t\thotCurrentChildModule = request;\n/******/ \t\t\t\t}\n/******/ \t\t\t\tif (me.children.indexOf(request) === -1) {\n/******/ \t\t\t\t\tme.children.push(request);\n/******/ \t\t\t\t}\n/******/ \t\t\t} else {\n/******/ \t\t\t\tconsole.warn(\n/******/ \t\t\t\t\t\"[HMR] unexpected require(\" +\n/******/ \t\t\t\t\t\trequest +\n/******/ \t\t\t\t\t\t\") from disposed module \" +\n/******/ \t\t\t\t\t\tmoduleId\n/******/ \t\t\t\t);\n/******/ \t\t\t\thotCurrentParents = [];\n/******/ \t\t\t}\n/******/ \t\t\treturn __webpack_require__(request);\n/******/ \t\t};\n/******/ \t\tvar ObjectFactory = function ObjectFactory(name) {\n/******/ \t\t\treturn {\n/******/ \t\t\t\tconfigurable: true,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: function() {\n/******/ \t\t\t\t\treturn __webpack_require__[name];\n/******/ \t\t\t\t},\n/******/ \t\t\t\tset: function(value) {\n/******/ \t\t\t\t\t__webpack_require__[name] = value;\n/******/ \t\t\t\t}\n/******/ \t\t\t};\n/******/ \t\t};\n/******/ \t\tfor (var name in __webpack_require__) {\n/******/ \t\t\tif (\n/******/ \t\t\t\tObject.prototype.hasOwnProperty.call(__webpack_require__, name) &&\n/******/ \t\t\t\tname !== \"e\" &&\n/******/ \t\t\t\tname !== \"t\"\n/******/ \t\t\t) {\n/******/ \t\t\t\tObject.defineProperty(fn, name, ObjectFactory(name));\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tfn.e = function(chunkId) {\n/******/ \t\t\tif (hotStatus === \"ready\") hotSetStatus(\"prepare\");\n/******/ \t\t\thotChunksLoading++;\n/******/ \t\t\treturn __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {\n/******/ \t\t\t\tfinishChunkLoading();\n/******/ \t\t\t\tthrow err;\n/******/ \t\t\t});\n/******/\n/******/ \t\t\tfunction finishChunkLoading() {\n/******/ \t\t\t\thotChunksLoading--;\n/******/ \t\t\t\tif (hotStatus === \"prepare\") {\n/******/ \t\t\t\t\tif (!hotWaitingFilesMap[chunkId]) {\n/******/ \t\t\t\t\t\thotEnsureUpdateChunk(chunkId);\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t\tif (hotChunksLoading === 0 && hotWaitingFiles === 0) {\n/******/ \t\t\t\t\t\thotUpdateDownloaded();\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t\tfn.t = function(value, mode) {\n/******/ \t\t\tif (mode & 1) value = fn(value);\n/******/ \t\t\treturn __webpack_require__.t(value, mode & ~1);\n/******/ \t\t};\n/******/ \t\treturn fn;\n/******/ \t}", "function learnModules() {\n const sth=require('./app.js').something;\n \n console.log(sth);\n \n }", "function addDependencies(app) {\n let dependents = `const expect = require('chai').expect;${newLine}`;\n dependents += `import React from 'react';${newLine}`;\n dependents += `import { mount } from 'enzyme';${newLine}`;\n dependents += `import 'jsdom-global/register';${newLine}`;\n dependents += `import ${app} from 'fill this in with proper path';${newLine}`;\n return dependents; \n}", "function HelloReact() {\n return (\n <div className=\"message\">\n this component is created in HelloReact\n </div>\n );\n}", "function setupBinding(root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['react','react-dom','create-react-class'], function(React, ReactDom, createReactClass) {\n if (!createReactClass) createReactClass = React.createClass;\n return factory(root, React, ReactDom, createReactClass);\n });\n } else if (typeof exports === 'object') {\n // Node. Note that this does not work with strict\n // CommonJS, but only CommonJS-like environments\n // that support module.exports\n module.exports = factory(root, require('react'), require('react-dom'), require('create-react-class'));\n } else {\n // Browser globals (root is window)\n var createReactClass = React.createClass ? React.createClass : window.createReactClass;\n root.onClickOutside = factory(root, React, ReactDOM, createReactClass);\n }\n }", "function hotCreateRequire(moduleId) {\n/******/ \t\tvar me = installedModules[moduleId];\n/******/ \t\tif (!me) return __webpack_require__;\n/******/ \t\tvar fn = function(request) {\n/******/ \t\t\tif (me.hot.active) {\n/******/ \t\t\t\tif (installedModules[request]) {\n/******/ \t\t\t\t\tif (installedModules[request].parents.indexOf(moduleId) === -1) {\n/******/ \t\t\t\t\t\tinstalledModules[request].parents.push(moduleId);\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t} else {\n/******/ \t\t\t\t\thotCurrentParents = [moduleId];\n/******/ \t\t\t\t\thotCurrentChildModule = request;\n/******/ \t\t\t\t}\n/******/ \t\t\t\tif (me.children.indexOf(request) === -1) {\n/******/ \t\t\t\t\tme.children.push(request);\n/******/ \t\t\t\t}\n/******/ \t\t\t} else {\n/******/ \t\t\t\tconsole.warn(\n/******/ \t\t\t\t\t\"[HMR] unexpected require(\" +\n/******/ \t\t\t\t\t\trequest +\n/******/ \t\t\t\t\t\t\") from disposed module \" +\n/******/ \t\t\t\t\t\tmoduleId\n/******/ \t\t\t\t);\n/******/ \t\t\t\thotCurrentParents = [];\n/******/ \t\t\t}\n/******/ \t\t\treturn __webpack_require__(request);\n/******/ \t\t};\n/******/ \t\tvar ObjectFactory = function ObjectFactory(name) {\n/******/ \t\t\treturn {\n/******/ \t\t\t\tconfigurable: true,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: function() {\n/******/ \t\t\t\t\treturn __webpack_require__[name];\n/******/ \t\t\t\t},\n/******/ \t\t\t\tset: function(value) {\n/******/ \t\t\t\t\t__webpack_require__[name] = value;\n/******/ \t\t\t\t}\n/******/ \t\t\t};\n/******/ \t\t};\n/******/ \t\tfor (var name in __webpack_require__) {\n/******/ \t\t\tif (\n/******/ \t\t\t\tObject.prototype.hasOwnProperty.call(__webpack_require__, name) &&\n/******/ \t\t\t\tname !== \"e\"\n/******/ \t\t\t) {\n/******/ \t\t\t\tObject.defineProperty(fn, name, ObjectFactory(name));\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tfn.e = function(chunkId) {\n/******/ \t\t\tif (hotStatus === \"ready\") hotSetStatus(\"prepare\");\n/******/ \t\t\thotChunksLoading++;\n/******/ \t\t\treturn __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {\n/******/ \t\t\t\tfinishChunkLoading();\n/******/ \t\t\t\tthrow err;\n/******/ \t\t\t});\n/******/\n/******/ \t\t\tfunction finishChunkLoading() {\n/******/ \t\t\t\thotChunksLoading--;\n/******/ \t\t\t\tif (hotStatus === \"prepare\") {\n/******/ \t\t\t\t\tif (!hotWaitingFilesMap[chunkId]) {\n/******/ \t\t\t\t\t\thotEnsureUpdateChunk(chunkId);\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t\tif (hotChunksLoading === 0 && hotWaitingFiles === 0) {\n/******/ \t\t\t\t\t\thotUpdateDownloaded();\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t\treturn fn;\n/******/ \t}", "function hotCreateRequire(moduleId) {\n/******/ \t\tvar me = installedModules[moduleId];\n/******/ \t\tif (!me) return __webpack_require__;\n/******/ \t\tvar fn = function(request) {\n/******/ \t\t\tif (me.hot.active) {\n/******/ \t\t\t\tif (installedModules[request]) {\n/******/ \t\t\t\t\tif (installedModules[request].parents.indexOf(moduleId) === -1) {\n/******/ \t\t\t\t\t\tinstalledModules[request].parents.push(moduleId);\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t} else {\n/******/ \t\t\t\t\thotCurrentParents = [moduleId];\n/******/ \t\t\t\t\thotCurrentChildModule = request;\n/******/ \t\t\t\t}\n/******/ \t\t\t\tif (me.children.indexOf(request) === -1) {\n/******/ \t\t\t\t\tme.children.push(request);\n/******/ \t\t\t\t}\n/******/ \t\t\t} else {\n/******/ \t\t\t\tconsole.warn(\n/******/ \t\t\t\t\t\"[HMR] unexpected require(\" +\n/******/ \t\t\t\t\t\trequest +\n/******/ \t\t\t\t\t\t\") from disposed module \" +\n/******/ \t\t\t\t\t\tmoduleId\n/******/ \t\t\t\t);\n/******/ \t\t\t\thotCurrentParents = [];\n/******/ \t\t\t}\n/******/ \t\t\treturn __webpack_require__(request);\n/******/ \t\t};\n/******/ \t\tvar ObjectFactory = function ObjectFactory(name) {\n/******/ \t\t\treturn {\n/******/ \t\t\t\tconfigurable: true,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: function() {\n/******/ \t\t\t\t\treturn __webpack_require__[name];\n/******/ \t\t\t\t},\n/******/ \t\t\t\tset: function(value) {\n/******/ \t\t\t\t\t__webpack_require__[name] = value;\n/******/ \t\t\t\t}\n/******/ \t\t\t};\n/******/ \t\t};\n/******/ \t\tfor (var name in __webpack_require__) {\n/******/ \t\t\tif (\n/******/ \t\t\t\tObject.prototype.hasOwnProperty.call(__webpack_require__, name) &&\n/******/ \t\t\t\tname !== \"e\"\n/******/ \t\t\t) {\n/******/ \t\t\t\tObject.defineProperty(fn, name, ObjectFactory(name));\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tfn.e = function(chunkId) {\n/******/ \t\t\tif (hotStatus === \"ready\") hotSetStatus(\"prepare\");\n/******/ \t\t\thotChunksLoading++;\n/******/ \t\t\treturn __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {\n/******/ \t\t\t\tfinishChunkLoading();\n/******/ \t\t\t\tthrow err;\n/******/ \t\t\t});\n/******/\n/******/ \t\t\tfunction finishChunkLoading() {\n/******/ \t\t\t\thotChunksLoading--;\n/******/ \t\t\t\tif (hotStatus === \"prepare\") {\n/******/ \t\t\t\t\tif (!hotWaitingFilesMap[chunkId]) {\n/******/ \t\t\t\t\t\thotEnsureUpdateChunk(chunkId);\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t\tif (hotChunksLoading === 0 && hotWaitingFiles === 0) {\n/******/ \t\t\t\t\t\thotUpdateDownloaded();\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t\treturn fn;\n/******/ \t}", "function hotCreateRequire(moduleId) {\n/******/ \t\tvar me = installedModules[moduleId];\n/******/ \t\tif (!me) return __webpack_require__;\n/******/ \t\tvar fn = function(request) {\n/******/ \t\t\tif (me.hot.active) {\n/******/ \t\t\t\tif (installedModules[request]) {\n/******/ \t\t\t\t\tif (installedModules[request].parents.indexOf(moduleId) === -1)\n/******/ \t\t\t\t\t\tinstalledModules[request].parents.push(moduleId);\n/******/ \t\t\t\t} else {\n/******/ \t\t\t\t\thotCurrentParents = [moduleId];\n/******/ \t\t\t\t\thotCurrentChildModule = request;\n/******/ \t\t\t\t}\n/******/ \t\t\t\tif (me.children.indexOf(request) === -1) me.children.push(request);\n/******/ \t\t\t} else {\n/******/ \t\t\t\tconsole.warn(\n/******/ \t\t\t\t\t\"[HMR] unexpected require(\" +\n/******/ \t\t\t\t\t\trequest +\n/******/ \t\t\t\t\t\t\") from disposed module \" +\n/******/ \t\t\t\t\t\tmoduleId\n/******/ \t\t\t\t);\n/******/ \t\t\t\thotCurrentParents = [];\n/******/ \t\t\t}\n/******/ \t\t\treturn __webpack_require__(request);\n/******/ \t\t};\n/******/ \t\tvar ObjectFactory = function ObjectFactory(name) {\n/******/ \t\t\treturn {\n/******/ \t\t\t\tconfigurable: true,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: function() {\n/******/ \t\t\t\t\treturn __webpack_require__[name];\n/******/ \t\t\t\t},\n/******/ \t\t\t\tset: function(value) {\n/******/ \t\t\t\t\t__webpack_require__[name] = value;\n/******/ \t\t\t\t}\n/******/ \t\t\t};\n/******/ \t\t};\n/******/ \t\tfor (var name in __webpack_require__) {\n/******/ \t\t\tif (\n/******/ \t\t\t\tObject.prototype.hasOwnProperty.call(__webpack_require__, name) &&\n/******/ \t\t\t\tname !== \"e\"\n/******/ \t\t\t) {\n/******/ \t\t\t\tObject.defineProperty(fn, name, ObjectFactory(name));\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tfn.e = function(chunkId) {\n/******/ \t\t\tif (hotStatus === \"ready\") hotSetStatus(\"prepare\");\n/******/ \t\t\thotChunksLoading++;\n/******/ \t\t\treturn __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {\n/******/ \t\t\t\tfinishChunkLoading();\n/******/ \t\t\t\tthrow err;\n/******/ \t\t\t});\n/******/\n/******/ \t\t\tfunction finishChunkLoading() {\n/******/ \t\t\t\thotChunksLoading--;\n/******/ \t\t\t\tif (hotStatus === \"prepare\") {\n/******/ \t\t\t\t\tif (!hotWaitingFilesMap[chunkId]) {\n/******/ \t\t\t\t\t\thotEnsureUpdateChunk(chunkId);\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t\tif (hotChunksLoading === 0 && hotWaitingFiles === 0) {\n/******/ \t\t\t\t\t\thotUpdateDownloaded();\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t\treturn fn;\n/******/ \t}", "function hotCreateRequire(moduleId) {\n/******/ \t\tvar me = installedModules[moduleId];\n/******/ \t\tif (!me) return __webpack_require__;\n/******/ \t\tvar fn = function(request) {\n/******/ \t\t\tif (me.hot.active) {\n/******/ \t\t\t\tif (installedModules[request]) {\n/******/ \t\t\t\t\tif (installedModules[request].parents.indexOf(moduleId) === -1)\n/******/ \t\t\t\t\t\tinstalledModules[request].parents.push(moduleId);\n/******/ \t\t\t\t} else {\n/******/ \t\t\t\t\thotCurrentParents = [moduleId];\n/******/ \t\t\t\t\thotCurrentChildModule = request;\n/******/ \t\t\t\t}\n/******/ \t\t\t\tif (me.children.indexOf(request) === -1) me.children.push(request);\n/******/ \t\t\t} else {\n/******/ \t\t\t\tconsole.warn(\n/******/ \t\t\t\t\t\"[HMR] unexpected require(\" +\n/******/ \t\t\t\t\t\trequest +\n/******/ \t\t\t\t\t\t\") from disposed module \" +\n/******/ \t\t\t\t\t\tmoduleId\n/******/ \t\t\t\t);\n/******/ \t\t\t\thotCurrentParents = [];\n/******/ \t\t\t}\n/******/ \t\t\treturn __webpack_require__(request);\n/******/ \t\t};\n/******/ \t\tvar ObjectFactory = function ObjectFactory(name) {\n/******/ \t\t\treturn {\n/******/ \t\t\t\tconfigurable: true,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: function() {\n/******/ \t\t\t\t\treturn __webpack_require__[name];\n/******/ \t\t\t\t},\n/******/ \t\t\t\tset: function(value) {\n/******/ \t\t\t\t\t__webpack_require__[name] = value;\n/******/ \t\t\t\t}\n/******/ \t\t\t};\n/******/ \t\t};\n/******/ \t\tfor (var name in __webpack_require__) {\n/******/ \t\t\tif (\n/******/ \t\t\t\tObject.prototype.hasOwnProperty.call(__webpack_require__, name) &&\n/******/ \t\t\t\tname !== \"e\"\n/******/ \t\t\t) {\n/******/ \t\t\t\tObject.defineProperty(fn, name, ObjectFactory(name));\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tfn.e = function(chunkId) {\n/******/ \t\t\tif (hotStatus === \"ready\") hotSetStatus(\"prepare\");\n/******/ \t\t\thotChunksLoading++;\n/******/ \t\t\treturn __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {\n/******/ \t\t\t\tfinishChunkLoading();\n/******/ \t\t\t\tthrow err;\n/******/ \t\t\t});\n/******/\n/******/ \t\t\tfunction finishChunkLoading() {\n/******/ \t\t\t\thotChunksLoading--;\n/******/ \t\t\t\tif (hotStatus === \"prepare\") {\n/******/ \t\t\t\t\tif (!hotWaitingFilesMap[chunkId]) {\n/******/ \t\t\t\t\t\thotEnsureUpdateChunk(chunkId);\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t\tif (hotChunksLoading === 0 && hotWaitingFiles === 0) {\n/******/ \t\t\t\t\t\thotUpdateDownloaded();\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t\treturn fn;\n/******/ \t}", "function hotCreateRequire(moduleId) {\n/******/ \t\tvar me = installedModules[moduleId];\n/******/ \t\tif (!me) return __webpack_require__;\n/******/ \t\tvar fn = function(request) {\n/******/ \t\t\tif (me.hot.active) {\n/******/ \t\t\t\tif (installedModules[request]) {\n/******/ \t\t\t\t\tif (installedModules[request].parents.indexOf(moduleId) === -1)\n/******/ \t\t\t\t\t\tinstalledModules[request].parents.push(moduleId);\n/******/ \t\t\t\t} else {\n/******/ \t\t\t\t\thotCurrentParents = [moduleId];\n/******/ \t\t\t\t\thotCurrentChildModule = request;\n/******/ \t\t\t\t}\n/******/ \t\t\t\tif (me.children.indexOf(request) === -1) me.children.push(request);\n/******/ \t\t\t} else {\n/******/ \t\t\t\tconsole.warn(\n/******/ \t\t\t\t\t\"[HMR] unexpected require(\" +\n/******/ \t\t\t\t\t\trequest +\n/******/ \t\t\t\t\t\t\") from disposed module \" +\n/******/ \t\t\t\t\t\tmoduleId\n/******/ \t\t\t\t);\n/******/ \t\t\t\thotCurrentParents = [];\n/******/ \t\t\t}\n/******/ \t\t\treturn __webpack_require__(request);\n/******/ \t\t};\n/******/ \t\tvar ObjectFactory = function ObjectFactory(name) {\n/******/ \t\t\treturn {\n/******/ \t\t\t\tconfigurable: true,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: function() {\n/******/ \t\t\t\t\treturn __webpack_require__[name];\n/******/ \t\t\t\t},\n/******/ \t\t\t\tset: function(value) {\n/******/ \t\t\t\t\t__webpack_require__[name] = value;\n/******/ \t\t\t\t}\n/******/ \t\t\t};\n/******/ \t\t};\n/******/ \t\tfor (var name in __webpack_require__) {\n/******/ \t\t\tif (\n/******/ \t\t\t\tObject.prototype.hasOwnProperty.call(__webpack_require__, name) &&\n/******/ \t\t\t\tname !== \"e\"\n/******/ \t\t\t) {\n/******/ \t\t\t\tObject.defineProperty(fn, name, ObjectFactory(name));\n/******/ \t\t\t}\n/******/ \t\t}\n/******/ \t\tfn.e = function(chunkId) {\n/******/ \t\t\tif (hotStatus === \"ready\") hotSetStatus(\"prepare\");\n/******/ \t\t\thotChunksLoading++;\n/******/ \t\t\treturn __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {\n/******/ \t\t\t\tfinishChunkLoading();\n/******/ \t\t\t\tthrow err;\n/******/ \t\t\t});\n/******/\n/******/ \t\t\tfunction finishChunkLoading() {\n/******/ \t\t\t\thotChunksLoading--;\n/******/ \t\t\t\tif (hotStatus === \"prepare\") {\n/******/ \t\t\t\t\tif (!hotWaitingFilesMap[chunkId]) {\n/******/ \t\t\t\t\t\thotEnsureUpdateChunk(chunkId);\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t\tif (hotChunksLoading === 0 && hotWaitingFiles === 0) {\n/******/ \t\t\t\t\t\thotUpdateDownloaded();\n/******/ \t\t\t\t\t}\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t\treturn fn;\n/******/ \t}", "function loadModule(module) {\n var xhr = new XMLHttpRequest();\n var result = null;\n if (config.amd && self.requirejs) {\n if (module.path[0] !== \"/\") {\n module.path = module.path.replace(/\\.js$/, \"\");\n }\n self.requirejs([module.path], function(callback) {\n that.on(module.trigger, callback);\n reply(\"moduleReady\", module.trigger, true);\n });\n\n }\n else {\n xhr.open(\"GET\", module.path);\n xhr.onload = function(event) {\n /*\n // try to load an AMD file\n if (event.target.response.match(/define\\([^)]*function/)) {\n console.log(\"looks like we're loading a module\");\n if (self.define === undefined || self.requirejs === undefined) {\n throw new Error(\"Load require.js via loadModule.\");\n }\n result = self.eval(event.target.response); \n console.log(result);\n setTimeout(function() {\n console.log(require.s.contexts._.defined);\n for (var i in require.s.contexts._.defined) {\n console.log(i);\n console.log(require.s.contexts._.defined[i]);\n }\n },500);\n that.on(module.trigger, result);\n reply(\"moduleReady\", module.trigger, true);\n }\n */ \n result = self.eval(event.target.response); \n that.on(module.trigger, result);\n reply(\"moduleReady\", module.trigger, true);\n };\n xhr.send();\n }\n return xhr;\n}", "function ReactComponent(props,context){this.props=props;this.context=context;}", "function App() {\n return (\n <div className=\"App\">\n\n </div>\n );\n}", "function _app({\n Component\n}) {\n return /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__[\"jsx\"])(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"], {\n children: /*#__PURE__*/Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__[\"jsx\"])(Component, {})\n });\n}", "function ReactComponent(props,context){this.props = props;this.context = context;}", "function reactRenderer(req, res) {\n var app = renderToString(React.createElement(App));\n var html = fs\n .readFileSync(path.join(BUILD_DIR, 'index.html'), 'utf8')\n .replace('__ROOT__', app);\n return res.send(html);\n }", "function App() {\n return (\n <div>\n App\n </div>\n );\n}", "babelConfig() {\n return {\n presets: ['@babel/preset-react']\n };\n }", "function App() {\n return (\n <>\n <h1> Reactjs - Single page Web App 🚀 </h1>\n <h2> Github users </h2>\n\n <User></User>\n </>\n );\n}", "function shim() {\n (function () {\n {\n {\n throw ReactError(Error(\"The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.\"));\n }\n }\n })();\n} // Persistence (when unsupported)", "function shim() {\n (function () {\n {\n {\n throw ReactError(Error(\"The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.\"));\n }\n }\n })();\n} // Persistence (when unsupported)", "function main() {\n render(\n <BrowserRouter>\n <Route component={App} />\n </BrowserRouter>,\n document.getElementById('root')\n );\n}", "function App() {\n //Write JavaScriopt here\n\n\n return (\n <div className=\"App\">\n <h1>Hello React </h1>\n <div className=\"home\">\n <Nav />\n <Tweets />\n </div>\n </div>\n );\n}", "static define() {\n Akili.component('component', Component);\n }", "function register() {\n if (typeof window !== 'undefined') {\n (0, _doz.define)('your-component-tag', _src2.default);\n }\n}", "function App() {\n // This is a comment\n const welcomeName = \"Rob!!!\";\n\n return (\n <div className=\"App\">\n <h1>Welecome to React, {welcomeName}</h1>\n {/* <TenLittleMonkeys /> */}\n {/* <InputField /> */}\n {/* <Calculator /> */}\n {/* <UseEffectPractice />\n <ChuckFetch /> */}\n <MortyParent />\n </div>\n );\n}", "function App() {\nreturn (\n<div >\n\n<Main/>\n</div>\n);\n}", "function shim() {\n (0, _invariant2.default)(false, 'The current renderer does not support hyration. ' + 'This error is likely caused by a bug in React. ' + 'Please file an issue.');\n}", "function shim() {\n (0, _invariant2.default)(false, 'The current renderer does not support hyration. ' + 'This error is likely caused by a bug in React. ' + 'Please file an issue.');\n}", "function App() {\n return (\n <div>\n Code goes here\n </div>\n )\n}", "function constructAMD() {\n\n\t\t//create a library instance\n\t\treturn init();\n\n\t\t//spawns a library instance\n\t\tfunction init() {\n\t\t\tvar library;\n\t\t\tlibrary = factory('amd');\n\t\t\tlibrary.fork = init;\n\t\t\treturn library;\n\t\t}\n\t}", "render() {\n return <div className=\"container\">Hello</div>;\n }", "componentDidMount() {\n this.onQuerySubmiT('React development');\n }", "function App() {\n return (\n // This is JSX (JavaScript XML). It is very similar to HTML.\n // A difference which is immediately evident is \"class\" becomes \"className\" in JSX\n <div className=\"app\">\n <h1 id=\"main-heading\">Demo</h1>\n {/* Here the Counter component imported in Counter.jsx is being rendered */}\n {/* It can be used multiple times with different initalCount */}\n {/* We can make our components modular and reusable through props */}\n <Counter initialCount={0} />\n <hr />\n <Counter initialCount={5} />\n <hr />\n <CounterFunc initialCount={10} />\n </div>\n );\n}", "function main(target, container) {\n ReactDOM.render(target, container);\n }", "function __require(uid, parentUid) {\n\tif(!__moduleIsCached[uid]) {\n\t\t// Populate the cache initially with an empty `exports` Object\n\t\t__modulesCache[uid] = {\"exports\": {}, \"loaded\": false};\n\t\t__moduleIsCached[uid] = true;\n\t\tif(uid === 0 && typeof require === \"function\") {\n\t\t\trequire.main = __modulesCache[0];\n\t\t} else {\n\t\t\t__modulesCache[uid].parent = __modulesCache[parentUid];\n\t\t}\n\t\t/* Note: if this module requires itself, or if its depenedencies\n\t\t\trequire it, they will only see an empty Object for now */\n\t\t// Now load the module\n\t\t__modules[uid](__modulesCache[uid], __modulesCache[uid].exports);\n\t\t__modulesCache[uid].loaded = true;\n\t}\n\treturn __modulesCache[uid].exports;\n}", "function isLoaded() {\n var globalRequire = window['require'];\n // .on() ensures that it's Dojo's AMD loader\n return globalRequire && globalRequire.on;\n}", "function App() {\n\n return (\n <div className = \"App\">\n <Main />\n \n </div>\n );\n}", "function shim() {\n (function () {\n {\n {\n throw ReactError(Error(\"The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.\"));\n }\n }\n })();\n } // Persistence (when unsupported)", "function render(){\n ReactDOM.render(\n <Provider store={store}>\n <App/>\n </Provider>,\n document.getElementById('app')\n );\n}", "function resetIfUsingPreact() {\n if (window.preact !== undefined) {\n jsxLoader.compiler.pragma = 'React.createElement';\n jsxLoader.compiler.pragmaFrag = 'React.Fragment';\n }\n }", "function ApplicationModule(appRef){}", "onBeforeReact (message)\n {\n }", "function App() {\n return (\n <div>Hola Mundo!</div>\n );\n}", "function __webpack_require__(moduleId) {\n let module = modules[moduleId];\n if (!module) {\n if (module !== false) {\n module = context.__remoteModuleResolver__(moduleId);\n if (!module) modules[moduleId] = false;\n }\n if (!module) {\n console.warn(`module:${moduleId} not exist!`);\n return;\n }\n modules[moduleId] = module;\n }\n // Check if module is in cache\n if (context.installedModules[moduleId]) {\n return context.installedModules[moduleId].exports;\n }\n // Create a new module (and put it into the cache)\n module = context.installedModules[moduleId] = {\n i: moduleId,\n l: false,\n exports: {}\n };\n\n // Execute the module function\n try {\n modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n } catch (ex) {\n console.error(ex);\n throw ex;\n }\n\n // Flag the module as loaded\n module.l = true;\n\n // Return the exports of the module\n return module.exports;\n }", "_getReactComponent() {\n const {icon, title, state} = this._container._config;\n const props = {\n id: uniqueId('gl-'),\n icon,\n title,\n viewState: state,\n glEventHub: this._container.layoutManager.eventHub,\n glContainer: this._container\n };\n return React.createElement(this._reactClass, props);\n }", "function App(){\n\n return<TechList /> \n //<h1>Hello Rocketseat</h1> // usando sintaxe JSX - É necessario importar o react\n}", "function render() {\n react_dom_1[\"default\"].render(react_1[\"default\"].createElement(react_redux_1.Provider, { store: store_1[\"default\"] },\n react_1[\"default\"].createElement(auth0_context_1.Auth0Provider, null,\n react_1[\"default\"].createElement(react_router_dom_1.BrowserRouter, null,\n react_1[\"default\"].createElement(app_1[\"default\"], null)))), document.getElementById('root'));\n}", "function App() {\n return (\n <div className=\"App\"> \n <ToDoApp />\n </div>\n );\n}", "render() {\n const { showCode } = this.state;\n const { code, description, name } = this.props.example;\n //* Must use CommonJS require to dynamically require because ES Modules are statically analyzable by design.\n //* meaning we cant use an import to dynamically import the example components.\n //* .default at the end because we are exporting all of our components as the default export\n const ExampleComponent = require(`./examples/${this.props.componentName}/${name}`).default; \n //* so we display the example description if there is one and we display the example component itself\n //* then we see the click handler that will call toggleCode\n return (\n <div className=\"example\">\n {description && <h4>{description}</h4>}\n\n <ExampleComponent />\n\n <p>\n <a href=\"\" onClick={this.toggleCode}>\n {showCode ? \"Hide\" : \"Show\"} Code\n </a>\n </p>\n\n {showCode && <CodeExample>{code}</CodeExample>}\n </div>\n )\n }", "getComponent (nextState, cb) {\n /* Webpack - use 'require.ensure' to create a split point\n and embed an async module loader (jsonp) when bundling */\n require.ensure([], (require) => {\n /* Webpack - use require callback to define\n dependencies for bundling */\n const Map = require('./containers/MapContainer').default\n const reducer = require('./modules/map').default\n\n /* Add the reducer to the store on key 'counter' */\n injectReducer(store, { key: 'map', reducer })\n\n /* Return getComponent */\n cb(null, Map)\n\n /* Webpack named bundle */\n }, 'map')\n }", "render() {\n \n /*\n * This code is developed to demonstrate the use of ReactJS and ReactNatice\n * The deelopment also allows me to demonstrate my capabilities using the framework\n * Following create-react-app methods, the file structure is made from scratch\n * Copyright - World Food Programmes - Digital Transformation\n */\n\n const This = this;\n const { classes } = This.props;\n const Toggle = e => handleDrawerToggle(This);\n const PaperProps = { style: { width: drawerWidth } };\n\n /*\n * This code is developed to demonstrate the use of ReactJS and ReactNatice\n * The deelopment also allows me to demonstrate my capabilities using the framework\n * Following create-react-app methods, the file structure is made from scratch\n * Copyright - World Food Programmes - Digital Transformation\n */\n\n return (\n <MuiThemeProvider theme={theme}>\n <Router>\n <div className={classes.root}>\n <CssBaseline />\n <nav className={classes.drawer}>\n <Hidden smUp implementation=\"js\">\n <LeftSidebar this={This} PaperProps={PaperProps} variant=\"temporary\" open={this.state.mobileOpen} onClose={Toggle} onDrawerToggle={Toggle} />\n </Hidden>\n <Hidden xsDown implementation=\"css\">\n <LeftSidebar this={This} PaperProps={PaperProps} onDrawerToggle={Toggle} />\n </Hidden>\n </nav>\n <div className={classes.appContent}>\n <TopHeader this={This} onDrawerToggle={Toggle} />\n <main className={classes.mainContent}>\n { AllMenus.map(({ id: childId, active, path, component }) => \n <Route exact={true} path={path} component={component} key={childId} handler={component} /> )}\n </main>\n </div>\n </div>\n </Router>\n </MuiThemeProvider>\n );\n }", "dependencies() {\n return ['@babel/preset-react'];\n }", "componentDidMount() {\n // alert(\"se acaba de cargar el componente\")\n }", "function shim() {\n invariant(false, 'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');\n}", "function shim() {\n invariant(false, 'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');\n}", "function shim() {\n invariant(false, 'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');\n}", "function shim() {\n invariant(false, 'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');\n}", "function shim() {\n invariant(false, 'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');\n}" ]
[ "0.6661715", "0.6306126", "0.61163706", "0.60769916", "0.6032304", "0.5880644", "0.58634394", "0.58572793", "0.5849332", "0.5821018", "0.5715654", "0.57093525", "0.5686781", "0.5651314", "0.564205", "0.5640679", "0.55866855", "0.55866855", "0.5574941", "0.55454385", "0.5531546", "0.5488376", "0.5488376", "0.54875404", "0.548741", "0.5480174", "0.54751194", "0.5466169", "0.5448506", "0.5420269", "0.5397789", "0.53820074", "0.53599685", "0.5338034", "0.532488", "0.5309317", "0.53057885", "0.5302216", "0.52824503", "0.5281869", "0.5280587", "0.52777594", "0.5272549", "0.52651733", "0.5261403", "0.52498883", "0.5233425", "0.5233425", "0.52320164", "0.52320164", "0.52320164", "0.52230275", "0.51997393", "0.519772", "0.5189433", "0.5185921", "0.5182216", "0.51736104", "0.5169464", "0.51633316", "0.5152566", "0.5152566", "0.5145917", "0.5138422", "0.5115935", "0.5113635", "0.5112865", "0.51070005", "0.50995123", "0.50995123", "0.5086386", "0.5084452", "0.5083439", "0.5072119", "0.50702894", "0.5067605", "0.5066038", "0.50637066", "0.5048527", "0.50405926", "0.50371933", "0.5036077", "0.50334823", "0.5029226", "0.5024757", "0.50217485", "0.5021044", "0.50195676", "0.50150716", "0.5013915", "0.5012952", "0.5009795", "0.49981046", "0.49959868", "0.49954885", "0.49930632", "0.49930632", "0.49930632", "0.49930632", "0.49930632" ]
0.7505162
0
1. Reverse a Number
function reverseNumber(n) { return parseInt(n.toString().split("").reverse().join("")) * Math.sign(n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reverseNumber (n) {\n\n}", "function reverseInteger(number) {\nvar reversed = 0;\n\n}", "function reverse (num) {\n let rev = 0\n while (num > 0) {\n rev *= 10\n rev += num % 10\n num = Math . floor (num / 10)\n }\n return (rev)\n}", "function reverse(num) {\n var newNum = 0;\n var remainder;\n while (num > 0) { \n remainder = num%10;\n newNum = newNum*10 + remainder;\n num = parseInt(num/10);\n }\n return newNum;\n}", "function reverseNumber(n) {\n let reverse = n.toString().split('').reverse().join('');\n return Math.sign(n) * parseInt(reverse);\n}", "function reverseNumber(nbrToReverse)\n{\n nbrToReverse = nbrToReverse + \"\" ;\n return nbrToReverse.split(\"\").reverse().join(\"\");\n}", "function reversNumber(number){\n var strNumber = \"\";\n strNumber = strNumber + number;\n \n var strNumberReverse = \"\";\n \n for (var i = strNumber.length-1; i >= 0; i--){\n strNumberReverse+=strNumber[i];\n }\n \n \n return parseInt(strNumberReverse, 10);\n \n}", "function reverseNumber(n){\n return parseFloat(n.toString().split('').reverse('').join('')) * Math.sign(n);\n }", "function reverse_a_number(n)\n{\n\tn = n + \"\";\n\treturn n.split(\"\").reverse().join(\"\");\n}", "function reverse(num) {\n let result = 0;\n while (num != 0) {\n result = result * 10;\n result = result + (num % 10);\n num = Math.floor(num / 10);\n }\n return result;\n}", "function reverseNum(number) {\n let rNum = 0;\n while (number > 0) {\n rNum = number % 10 + rNum * 10;\n number = Math.floor(number / 10);\n }\n return rNum;\n}", "function reverseNum(n) {\r\n let result = n.toString();\r\n let rev = result.split(\"\").reverse().join(\"\");\r\n return rev;\r\n}", "function reverseNumber(number) {\n return console.log(Number(number.toString().split('').reverse().join('')));\n}", "function revNum(theNumber) {\n return Number(theNumber.toString().split(\"\").reverse().join(\"\"));\n}", "function reverseNum(num) {\r\n return (\r\n num.toString().split('').reverse().join('')\r\n )\r\n}", "function reverse(n){\n let rev = 0;\n while (n) {\n rev = rev * 10 + n % 10;\n n = Math.floor(n/10);\n }\n return rev;\n}", "function reverseNumber(number) {\n number = number.toString(); \n return number.split('').reverse().join(''); \n}", "function reverseNumber(number) {\n return number.toString().split(\"\").reverse().join(\"\");\n}", "function reverseNumber(n) {\n var reversedDigits = + Number(n.toString().split('').reverse().join('').replace('-', ''));\n return n > 0 ? reversedDigits : -reversedDigits;\n }", "function reverse(num) {\n num = num + \"\";\n // return num.toString().replace(/\\D/g, '0').split('').reverse().join();\n return num.split(\"\").reverse().join(\"\");\n}", "function reverseNumber (a) {\n var b = a + \"\";\n var c = \"\";\n for (var i = b.length -1 ; i >= 0; i--){\n c += b[i];\n }\n var d = parseInt (c);\n return d;\n}", "function reverseNumber(number) {\n var numberString = String(number);\n numberString = numberString.split('').reverse().join('');\n return parseInt(numberString, 10);\n}", "function reverse_number(x) {\n x = x + \"\"\n return x.split(\"\").reverse().join(\"\");\n }", "function reversedNumber(num) {\n return parseFloat(num.toString().split('').reverse().join('') )\n}", "function reversed(num) {\n num = parseFloat(num.toString().split(\"\").reverse().join(\"\"));\n\n return num;\n}", "function reverseNumber(num1)\n{\n\tnum1 = num1 + \"\";\n\treturn num1.split(\"\").reverse().join(\"\");\n}", "function reverseNumber(a) {\n var b = a + '';\n var c = '';\n for (var i = b.length - 1; i >= 0; i--) {\n c += b[i];\n\n }\n return parseInt(c);\n}", "function reversedNum(num) {\n return (\n parseFloat( // parse the input value into a float from a string\n num\n .toString() // convert number to string\n .split('') // split string into array of char\n .reverse() // reverse items in array\n .join('') // join array back to single string\n ) * Math.sign(num) // multiply by the sign of the original num\n )\n}", "function reverseNumber(n) {\n let num = n.toString().split('').reverse();\n if(num[num.length-1] === '-') return +`-${num.slice(0, -1).join('')}`\n return +num.join('');\n}", "function reverse_number(number){\n number = number + \"\";\n return number.split(\"\").reverse().join(\"\");\n}", "function reverseNum (number) {\n const numberStr = number.toString();\n let reversedNumber = \"\";\n for (let i = numberStr.length-1; i >= 0; i--) {\n reversedNumber = reversedNumber + numberStr[i];\n }\n return parseInt(reversedNumber);\n}", "function reverseInt(n) {\n const reversed = n.toString().split(\"\").reverse().join(\"\")\n return parseInt(reversed) * Math.sign(n)\n\n}", "function reverseNumber(n) {\n let number = n.toString()\n let result = \"\"\n let negative = \"\"\n\n if (number[0] === \"-\") {\n negative = \"-\"\n number = number.slice(1, number.length)\n\n }\n\n for (let i = number.length - 1; i >= 0; i--) {\n result += number[i]\n }\n\n return Number(negative + result)\n}", "function reverseNumber(number) {\n let arr = number.toString().split(\"\").reverse().join(\"\");\n let result = parseInt(arr, 10);\n\n return result;\n}", "function reverseInt(n) {\n const reversed = n.toString().split(\"\").reverse().join(\"\");\n\n return parseInt(reversed) * Math.sign(n);\n}", "function reverseNumberLogic(number){\n let reverseNumber;\n reverseNumber=0;\n while(number!=0){ \n let num=number%10; \n reverseNumber=reverseNumber*10+num; \n number=parseInt(number/10);\n }\n return reverseNumber;\n}", "function reverseSign(number){\n return number * (-1);\n}", "function revInt(number) {\n let str = number\n .toString()\n .split('')\n .filter(e => e !== '-')\n .reverse()\n .join('');\n\n return Number(str)*Math.sign(number);\n}", "function mirrReverse(n) {\n let rev = 0;\n while (n > 0) {\n rev = rev * 10 + n % 10;\n n = Math.floor(n / 10);\n }\n return rev;\n}", "function revInt2(number) {\n let str = number\n .toString()\n .split('')\n .reverse()\n .join('');\n\n return parseInt(str)*Math.sign(number);\n}", "function reverseInt(num) {\n\tlet int = num.toString().split(\"\").reverse().join(\"\")\n\tint = parseInt(int);\n\n\t//kondisi ini untuk jika ada angka yang bernilai negative\n\tif(num < 0 ) {\n\t\treturn int * -1;\n\t}\n\n\tconsole.log(int)\n\n\n}", "function reverseNumber(num) {\n let val = 0;\n let dec\n while(num > 0) {\n num = Number( Number(num/10).toFixed(1) )\n dec = num - Math.floor(num)\n num -= dec\n dec = Number( Number(dec).toFixed(1)) \n val = (val * 10) + dec * 10;\n }\n return val;\n}", "function reverseInt(number) {\n const copy = number.toString().split('').reverse().join('');\n return copy === number.toString();\n}", "function reverse(input) {}", "function reverseInt(n) {\n let nReversed = n.toString().split('').reverse().join('')\n nReversed = parseInt(nReversed)\n if (n < 0) nReversed *= -1\n\n return nReversed\n} // O(log N)", "function reversePhone(number) {\n number = number + ''\n return Number(number.split('').reverse().join(''))\n }", "function reverse(number) {\n var newnumber = number.split(\"\").reverse().join(\"\");\n console.log(newnumber)\n}", "reverse() {}", "function reverseInt(int) {\r\n int = int + \"\";\r\n // - 0 converts back to number\r\n return reverseString(int) - 0;\r\n}", "function reverseNumber(number) {\n\tnumber = +number;\n\tvar isNegative = number < 0,\n\t\tnumber = number.toString().replace('-', '').split(''),\n\t\treversedNumber = [];\n\n\tif (isNegative) {\n\t\treversedNumber.push('-');\n\t}\n\n\tArray.prototype.push.apply(reversedNumber, number.reverse());\n\treturn +(reversedNumber.join(''));\n}", "function reverseInt(n) {\n // My first solution\n // var newN = n.toString().split('').reverse();\n // if(newN[newN.length-1] === \"-\"){\n // newN.unshift('-');\n // newN.pop();\n // }\n // return Number(newN.join(''));\n\n let reversed = n.toString().split('').reverse().join('')\n return Math.sign(n) * parseInt(reversed);\n \n}", "function numberReverse(number) {\n const result2 = (String(number)).split(\"\").reverse().join(\"\");\n return parseFloat(result2);\n}", "function reverseInteger(n){\n var remainder = 0;\n while(n > 0){\n remainder = remainder * 10 + n % 10;\n //keep reducing n until it is 0.\n n = Math.floor(n/10);\n }\n return remainder;\n}", "function reverse(n)\n{\n n = n + \"\";\n return n.split(\"\").reverse().join(\"\");\n}", "function reverseInt(n) {\n let result = \"\"\n\n if (n >= 0) {\n result = n.toString().split(\"\").reverse().join(\"\")\n } else {\n result = \"-\" + Math.abs(n).toString().split(\"\").reverse().join(\"\")\n }\n\n // result = n >= 0 ? n.toString().split(\"\").reverse().join(\"\") : \"-\" + Math.abs(n).toString().split(\"\").reverse().join(\"\")\n\n return parseInt(result)\n}", "function subtractOneFromNumber(x){\n return --x;\n}", "function reverseDigits (x) {\n var result = 0\n while (x !== 0) {\n result = result * 10\n result = result + (x % 10)\n x = Math.floor(x / 10)\n }\n return result\n}", "function reverse(num) {\n let arrRev = num.toString().split('');\n let arrRev2 = arrRev.reverse().join(\"\");\n let arrRev3 = Number(arrRev2);\n console.log(arrRev3);\n}", "function reverseInt(number) {\n const reversed = number\n .toString()\n .split(\"\")\n .reverse()\n .join(\"\");\n if (number < 0) {\n return parseInt(reversed) * -1;\n }\n return parseInt(reversed);\n}", "function revNumber(int) {\r\n /* Convert integer to string, split, reverse order, join as string again and dispaly.*/\r\n const revString = int.toString()\r\n .split('')\r\n .reverse()\r\n .join('');\r\n return parseInt(revString)/* add following to handle negative numbers: */\r\n * Math.sign(int);\r\n}", "function reversed_int_solution2(inputNum){\n\n var result = 0;\n\n // In case, it is a negative input value, then make it a positive value\n var remainder = Math.abs(inputNum);\n\n while (remainder != 0){\n console.log(\"remaining value : \",remainder);\n\n // shifting digit by multipling 10 \n result *= 10;\n console.log(result);\n\n //module operator will get a last digit of remainder and add to a result \n result += remainder%10;\n\n //remove the last digit of a remainder,which has already been added to a result\n //parseInt convert a value to integer, otherwise remainder/10 will become a decimal digit\n //Expalain : 123/10 = 12.3 parseInt will take care of 0.3, the result would be just 12.\n remainder = parseInt(remainder/10, 10);\n }\n //if input is a negative value, then result as a negative value.\n return inputNum < 0 ? -result: result;\n}", "function reverseInteger(x){\n\tif(x>Number.Infinity){\n\t\treturn -1;\n\t}\n\n\tvar num_s = x.toString();\n\tvar reverse = num_s.split(\"\").reverse().join(\"\");\n\n\t//the limit is not fixed????\n\tif(parseInt(reverse) > Number.Infinity){\n\t\treturn -1;\n\t} else {\n\t\treturn parseInt(reverse);\n\t}\n\n}", "function getPalindrome(number) {\n let reverseNum = 0;\n while (number > 0) {\n reverseNum = reverseNum * 10 + number % 10;\n number = Math.floor(number / 10);\n }\n return reverseNum;\n }", "function getRev(n) {\n let res = '';\n\n while (n > 0) {\n let lE = n % 10;\n res += lE;\n n = Math.floor(n / 10);\n }\n\n return +res;\n}", "function reverseNumber(phoneNumber) {\n return phoneNumber.toString().split(\"\").reverse().join(\"\");\n}", "function reverseInt(int) {\n // const revString = int\n // .toString() // turns integer into a string\n // .split(\"\") // turn a string into an array\n // .reverse()\n // .join(\"\");\n // return parseInt(revString) * Math.sign(int); // Math.sign = function returns either a positive or negative +/- 1,\n // indicating the sign of a number passed into the argument\n}", "function reverse(a) {\n switch (a) {\n case 0:\n return 0;\n case -1:\n return 1;\n case 1:\n return -1;\n }\n}", "function reverseInt(int) {\n return Number([...`${int}`].reverse().join(''))\n}", "function reverseInt(int) {\n return (parseInt(int.toString().split('').reverse().join(''))) * Math.sign(int)\n}", "Reverse() {\n\n }", "function reverseInt(int)\n{\n return parseInt(reverseString(int.toString()), 10);\n}", "function lastDigitReverser(num) {\n let fakeArr = num.toString().split(\"\");\n let lastDigit = fakeArr.pop();\n if (lastDigit !== \"0\") {\n fakeArr.unshift(lastDigit);\n let result = +fakeArr.join(\"\");\n return result;\n } else {\n return num;\n }\n}", "function opposite(number) {\n return(-number);\n}", "function reverseNumber(number) {\n //convert number to string\n var numberString = number.toString();\n //set up empty array to hold reversed number\n var reversedNumber = [];\n\n //iterate starting at the end of the numberString\n for(var i = numberString.length - 1; i >= 0; i--)\n //add each character starting at the end to the empty array\n reversedNumber.push(numberString[i]);\n\n //join the array together without delimiter and parseInt to return it to a number\n return (parseInt(reversedNumber.join(\"\")));\n}", "function revInt(num) {\n const MAXINT = Math.pow(2, 31) - 1;\n let sig = 1;\n if (num === 0) return 0;\n else if (num < 0) {\n sig = -1;\n num = -num;\n }\n try {\n var arr = [];\n while (num != 0) {\n arr.push(num % 10);\n num = parseInt(num / 10);\n }\n for (let i = 0; i < arr.length; i++) {\n num = 10 * num + arr[i];\n if (num > MAXINT) throw new Error();\n }\n return sig * num;\n } catch (err) {\n console.log('Integer Overflow');\n return 0;\n }\n}", "reverse() {\n }", "function dec(n) {\n return n -= 1\n}", "function reverseInt (num) {\n try{\n let res = 0;\n let prev = 0;\n let n = Math.abs(num);\n let max = 2147483647;\n\n // Note: parseInt((res - n % 10)/10) != prev\n // is used to check if the reverse overflowed or not.\n // The values of (rev_num - curr_digit)/10 and\n // prev_rev_num must be same if there was no\n // problem.\n\n while ( n > 0) {\n res = res * 10 + n % 10; // move last digit of n to the front\n if (num >= max || parseInt((res - n % 10)/10) != prev || res > max) throw new Error();\n else {\n prev = res;\n }\n n = Math.floor(n/10); // remove last digit\n }\n\n return num < 0 ? -res : res;\n\n } catch(e) {\n console.log(\"Your number has to be within 32-bit integer range\");\n return 0;\n }\n}", "function opposite(number) {\n return number * -1\n}", "function reverseInt(n) {\n\n\t// determine sign of integer\n\tlet sign = Math.sign(n);\n\n\t// convert int to string and split into array\n\tlet stringArr = n.toString().split('');\n\t\n\t// create storage array\n\tlet storage = [];\n\n\t// loop through string from right to left\n\t// if digit != 0 || storage.length > 0, then push digit into storage array\n\tfor (let i = stringArr.length - 1; i >= 0; i-- ) {\n\t\t// console.log('stringArr[i] = ', stringArr[i]);\n\n\t\tif (stringArr.length === 1 && stringArr[i] == 0) {\n\t\t\treturn 0;\n\t\t} else if (stringArr[i] != 0 || storage.length > 0) {\n\t\t\tstorage.push(stringArr[i]);\n\t\t}\n\t}\n\n\t// convert string to integer and check for sign\n\tlet result = parseInt(storage.join('')) * sign;\n\t// console.log('result = ', result);\n\t// console.log('result is an integer =', Number.isInteger(result));\n\n\treturn result;\n}", "function decrement(numero) {\n\n return numero-1;\n\n }", "function invers(x) {\n let digit = 0;\n let reversed = 0;\n\n while (x > 0) {\n digit = x % 10;\n reversed = (reversed * 10) + digit;\n x = parseInt(x / 10);\n }\n\n return reversed;\n}", "function reverseInt(int){\n const revString = int.toString().split('').reverse()\n .join('');\n\n return parseInt(revString); //parseInt takes a string and turn it into an integer\n}", "function reverseInt(int) {\n const revString = int.toString().split('').reverse().join('');\n\n // using sign method to add sign if there is one\n return parseInt(revString) * Math.sign(int);\n}", "function opposite(number) {\n return number * -1;\n}", "function reverseInt4(num) {\n\n let fourth = num % 10;\n num = (num - fourth) / 10;\n let third = num % 10;\n num = (num - third) / 10;\n let second = num % 10;\n let first = (num - second) / 10;\n\n return fourth * 1000 + third * 100 + second * 10 + first;\n}", "function reverseInt(int) {\n const revString = int.toString().split('').reverse().join('');\n\n return parseInt(revString) * Math.sign(int); //Math.sign(int) is for negative numbers\n}", "function opposite(number) {\n return -number;\n}", "function reverse(fn) {\n return (num1,num2) => fn(num2, num1); \n}", "function reverseNumber(reverseArr) {\r\n let reverseSum = '',\r\n reverseAbs = 0,\r\n reverseDec = 0;\r\n const Find_Decimal = 10,\r\n For_Big = 4;\r\n\r\n reverseAbs = Math.abs(reverseArr);\r\n\r\n for (let i = 0; i < reverseAbs * For_Big; i++) {\r\n\r\n reverseAbs = reverseAbs / Find_Decimal;\r\n reverseDec = Math.trunc((reverseAbs - Math.floor(reverseAbs)) * Find_Decimal);\r\n reverseSum += reverseDec;\r\n }\r\n //Numbers should preserve their sign: i.e. a negative number should still be negative when reversed.\r\n reverseArr < 0 ? reverseSum = -reverseSum : reverseSum;\r\n // It should accept an integer and return it`s reversed version.\r\n return parseInt(reverseSum);\r\n}", "function reverseInt(n) {\n // Convert int into an array\n let arr = n.toString().split('');\n let sign = 'pos';\n // parse negative sign if present\n if(arr[0] === '-') {\n sign = 'neg';\n arr = arr.slice(1);\n }\n // reverse the array of values\n arr.reverse();\n // trim leading zeroes\n let encounter = 0;\n for(let i = 0; i < arr.length; i++) {\n if (arr[i] === '0') {\n encounter++;\n }\n } \n if (encounter !== arr.length){ // number of all zeroes\n arr = arr.slice(encounter);\n }\n if (sign === 'neg') {\n arr.unshift('-');\n }\n // return value as int\n return parseInt(arr.join(''));\n}", "function reverseInt(int) {\r\n temp = reverseString(int.toString())\r\n let pos = true\r\n if(temp[temp.length - 1] === '-')\r\n {\r\n pos = false\r\n var arr = temp.split('')\r\n arr.splice(temp.length-1, 1)\r\n //temp='-' + arr.join()\r\n }\r\n num = parseFloat(temp,10);\r\n if(!pos)\r\n num = 0-num;\r\n return num\r\n}", "function rotateRightmostDigits(number, n) {\n let strNum = String(number);\n let front = strNum.slice(0, -Math.abs(n));\n let back = strNum.slice(-Math.abs(n), strNum.length);\n let backRotate = rotateArray([...back]).join('');\n return Number(front + backRotate);\n}", "function reverseInt_sol_1(int) {\n return (\n parseInt(\n String(int)\n .split(\"\")\n .reverse()\n .join(\"\"),\n ) * Math.sign(int)\n );\n}", "function reverse(x) {\n let negative = false;\n let result = [];\n let resultInteger;\n let limit = Math.pow(2, 31) - 1;\n\n if (x < 0) negative = true;\n\n let str = Math.abs(x).toString();\n\n for (let i = 0; i < str.length; i++) {\n result.unshift(+str[i]);\n }\n\n resultInteger = +result.join('');\n\n if (Math.abs(resultInteger) > limit) return 0;\n\n if (negative) return -1 * resultInteger;\n\n return resultInteger;\n}", "function numberSwap(a, b) {}", "function descending(number) {\n if (typeof (number) !== 'number') {\n return null\n }\n let string = number.toString();\n let digits = string.split('');\n let order = digits.sort();\n let abc = order.reverse(digits);\n let x = abc.join('');\n return parseInt(x);\n}", "function reverse (int) {\n\n let str = Math.abs(int).toString();\n\n let revArr = str.split(\"\").reverse()\n if (revArr[revArr.length -1] === 0) {\n revArr.slice(0, revArr.length - 1)\n }\n let revStr = revArr.join(\"\");\n\n let revInt = parseInt(revStr) >= 2147483647 ? 0 : parseInt(revStr);\n if (int < 0) { revInt *= -1 }\n return revInt;\n}", "function opposite(number) { //No native methods \"challenge\"\n return -number;\n}", "invertNumber() {\n if (isNaN(this.getLastOperator())) return;\n let lastNumber = Number(this.getLastPosition(false));\n if (lastNumber >= 0) {\n lastNumber *= -1;\n } else {\n lastNumber *= -1;\n }\n this.setLastOperator(lastNumber);\n this.updateDisplay();\n }" ]
[ "0.86050004", "0.81810045", "0.79700994", "0.79189616", "0.7892923", "0.7872614", "0.77796406", "0.776392", "0.7750039", "0.7747371", "0.7734854", "0.77169967", "0.7678498", "0.7663459", "0.76226306", "0.76176083", "0.7613296", "0.76117253", "0.75998646", "0.7534196", "0.75260186", "0.7522705", "0.7504225", "0.74884593", "0.74831945", "0.74670696", "0.74522775", "0.74472445", "0.7433335", "0.7409816", "0.7404653", "0.74017936", "0.73888874", "0.7349691", "0.7331223", "0.73180044", "0.7312674", "0.7289767", "0.7282965", "0.7277912", "0.716873", "0.71354055", "0.71127695", "0.7106585", "0.70087236", "0.6997921", "0.69887793", "0.6975622", "0.6970434", "0.6913982", "0.6910096", "0.6909094", "0.69022673", "0.68750256", "0.6858234", "0.6853429", "0.68326247", "0.6827457", "0.68155676", "0.6790121", "0.6763833", "0.6737305", "0.6734843", "0.67218435", "0.6714549", "0.67086667", "0.6700529", "0.66958255", "0.6634753", "0.6631887", "0.66020375", "0.6600283", "0.6600151", "0.659306", "0.65879214", "0.6580246", "0.6560551", "0.6545452", "0.6544881", "0.65358883", "0.653056", "0.651902", "0.6498743", "0.64682764", "0.64642", "0.6442311", "0.64314455", "0.64161134", "0.63895565", "0.6380657", "0.63697696", "0.6347798", "0.63466084", "0.6326397", "0.6319709", "0.63156694", "0.63120943", "0.6304089", "0.62792003", "0.62723637" ]
0.7918117
4
3. Longest Common Subsequence
function LCS(x, y) { let string = ""; let n = 0; for (let i = 0; i < y.length; i++) { for (let k = n; k < x.length; k++) if (y[i] === x[k]) { string += y[i]; n = ++k; break; } } return string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function longestCommonSubsequence(text1, text2) {\n /*\n - Think of the rows as the outer loop and the columns as the inner loop.\n - Use 2 pointers, one for each string (imagine it being a matrix). One is for rows and the other for columns.\n - Rows -> text1\n - Columns -> text2\n - Like in the Coin Change problem, build the matrix and traverse it backwards when necessary.\n - When initializing the matrix, add an additional row and column BEFORE and initialize them to 0s.\n - If both characters match, move 1 row and col forward and add 1 to it (down diagonally).\n - If characters don't match, calculate the max of going back in the col (cell above) and going back in the row (cell to the left). Doing this we carry forward the maximum common subsequence\n X a b c d e X a b c d e\n X 0 0 0 0 0 0 X 0 0 0 0 0 0\n a 0 1 0 0 0 0 a 0 1 1 1 1 1\n c 0 0 0 0 0 0 c 0 1 1 2 2 2\n e 0 0 0 0 0 0 e 0 3 3 3 3 3\n */\n\n const dp = []\n\n // Generate the starting matrix adding the additional row and col. Fill the matrix with 0s\n for (let i = 0; i < text1.length + 1; i++) {\n dp.push(Array(text2.length + 1).fill(0))\n }\n\n // Scan from left to right through the string\n for (let i = 0; i < text1.length; i++) {\n for (let j = 0; j < text2.length; j++) {\n // If the values match move 1 row and col forward and add 1 to it (down-right diagonally).\n if (text1[i] === text2[j]) {\n // The new value will be the diagonal\n const diagonal = dp[i][j]\n // Calculate the cell taking into account the offset of the additional row/col\n // Increment by the value of the diagonal\n dp[i + 1][j + 1] = diagonal + 1\n }\n // If characters don't match carry forward the maximum common subsequence\n else {\n const above = dp[i][j + 1]\n const left = dp[i + 1][j]\n // Calculate the max of the cell above and the one to the left\n dp[i + 1][j + 1] = Math.max(above, left)\n }\n }\n }\n\n // If we found the LCS the it's length would be saved in the bottom-right corner.\n // If no subsequence was found the value of the last cell will be 0\n return dp[text1.length][text2.length]\n}", "function LongestCommonSub_Iterative(str1, str2, m, n) {\n\n var tabulation = [];\n\n for (var i = 0; i <= m; i++) {\n for (var j = 0; j <= n; j++) {\n // initialize i=0 and j=0 rows and cols with 0, as we need these as initial state \n if (i === 0 || j === 0) {\n if (tabulation[i] === undefined) {\n tabulation[i] = [];\n }\n //takes care of populating a row with all Zero\n //Happens only for first row and first column i.e., i=0 || j=0\n tabulation[i][j] = 0;\n } else {\n if (str1.charAt(i - 1) === str2.charAt(j - 1)) {\n //If they match then its reduced to 1 + LCS( str1 - 1char, str2 - 1char)\n tabulation[i][j] = 1 + tabulation[i - 1][j - 1]\n } else {\n //If they don't match then its reduced to Max of [ LCS( str1 - 1char, str2) , LCS( str1, str2 - 1char) ] \n tabulation[i][j] = Math.max(tabulation[i - 1][j], tabulation[i][j - 1]);\n }\n }\n }\n }\n\n printLCS(str1, str2, m, n, tabulation);\n return tabulation;\n\n}", "function findLongestRepeatingSubSeq(str) {\n let n = str.length;\n\n let dp = new Array(n + 1);\n for (let i = 0; i <= n; i++) {\n dp[i] = new Array(n + 1);\n for (let j = 0; j <= n; j++) dp[i][j] = 0;\n }\n\n // now use LCS function\n for (let i = 1; i <= n; i++) {\n for (let j = 1; j <= n; j++) {\n if (str[i - 1] === str[j - 1] && i != j) dp[i][j] = 1 + dp[i - 1][j - 1];\n else dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);\n }\n }\n return dp[n][n];\n}", "function longestCommonPrefix(s) {\n if (s == null || s.length == 0) return \"\";\n\n var same = s[0];\n for (var i = 1; i < s.length; i++) {\n var str = s[i];\n\n for (var j = 0; j < same.length; j++) {\n if (same[j] != str.charAt(j)) {\n break;\n }\n }\n\n same = same.slice(0, j);\n }\n return same;\n}", "function longestCommon(str1, str2) {\n let shortest = (str1.length > str2.length ? str2 : str1);\n let longest = (str1.length > str2.length ? str1 : str2);\n let ans = \"\";\n for (let i = 0; i < shortest.length; i++) {\n for (let j = shortest.length - 1; j > i; j--) {\n let slice = shortest.slice(i, j);\n if (longest.includes(slice) && ans.length < slice.length) {\n ans = slice;\n }\n }\n }\n return ans;\n}", "function longestCommonPrefix(strs) {\n if (strs.length === 0) {\n return null;\n }\n if (strs.length === 1) {\n return strs[0];\n }\n let result = '';\n\n strs = strs.sort(); // nlogn\n\n for (let i = 0; i < strs[0].length; i++) {\n //n\n if (strs[0][i] === strs[strs.length - 1][i]) {\n result += strs[0][i];\n } else {\n break;\n }\n }\n return result;\n}", "function longestIncreasingSubsequence(sequence){\n if (sequence.length === 1) return 1;\n let lengths = new Array(sequence.length).fill(1);\n\n for (let i = 1; i < sequence.length; i++){\n for (let j = 0; j < i; j++){\n const isIncreasing = sequence[j] < sequence[i];\n const sequenceLength = lengths[j] + 1\n const isLonger = sequenceLength > lengths[i]\n if (isIncreasing && isLonger){\n lengths[i] = sequenceLength;\n }\n }\n }\n return Math.max(...lengths);\n}", "function longestIncreasingSubsequence(nums){\n var max = 1;\n //Al principio todos tienen subsequence de 1\n var array = new Array(nums.length).fill(1);\n if(nums.length === 0) return 0;\n\n for(var i = 1; i < nums.length; i++){\n for(var j = 0; j < i; j++){\n if(nums[j] < nums[i] && (array[j] + 1 > array[i])){\n array[i] = array[j] + 1;\n max = Math.max(max, array[i]);\n }\n }\n }\n return max;\n}", "function commonChild(a, b) {\r\n \r\n \r\n var len = a.length;\r\n \r\n var pre = [];\r\n var now = [];\r\n \r\n \r\n \r\n for(var i=0;i<len;i++) pre[i] = 0;\r\n \r\n \r\n for(var i=0;i<len;i++){\r\n for(var j=0;j<len;j++){\r\n if(a[i].charAt(0) == b[j].charAt(0)){\r\n if(i==0) now[j] = 1;\r\n else if(j==0) now[j] = 1;\r\n else now[j] = pre[j-1] + 1;\r\n }\r\n else{\r\n var max = 0;\r\n if(i>0 && max < pre[j]) max = pre[j];\r\n if(j>0 && max < now[j-1]) max = now[j-1];\r\n if(i>0 && j>0 && max < pre[j-1]) max = pre[j-1];\r\n now[j] = max;\r\n }\r\n }\r\n for(j=0;j<len;j++)\r\n pre[j] = now[j];\r\n }\r\n\r\n \r\n \r\n \r\n return now[len-1];\r\n\r\n\r\n}", "function longestIncreasingSubsequence(nums){\n var array = [];\n //Al principio todos tienen subsequence max de 1\n var max = 1;\n if(nums.length === 0) return 0;\n\n for(var i = 0; i < nums.length; i++){\n array[i] = 1;\n for(var j = 0; j < i; j++){\n if(nums[j] < nums[i] && (array[j] + 1 > array[i])){\n array[i] = array[j] + 1;\n max = Math.max(max, array[i]);\n }\n }\n }\n return max;\n}", "function longestCommonSubstring(a, b)\n{\n\tlet len = b.length, originalLen = b.length;\n\tdo\n\t{\n\t\tfor ( let i = 0; i <= originalLen - len; i++ )\n\t\t{\n\t\t\tlet needle = b.substr( i, len );\n\t\t\tif ( a.indexOf( needle ) !== -1 ) return needle;\n\t\t}\n\t} while ( len-- > 0 );\n\n\treturn \"\";\n}", "function lcs(word1, word2) {\r\n\tvar max = 0;\r\n\tvar index = 0;\r\n\tvar lcsarr = new Array(word1.length+1);\r\n\tfor (var i = 0; i <= word1.length+1; ++i) {\r\n\t\tlcsarr[i] = new Array(word2.length+1);\r\n\t\tfor (var j = 0; j <= word2.length+1; ++j) {\r\n\t\tlcsarr[i][j] = 0;\r\n\t\t}\r\n\t}\r\n\tfor (var i = 0; i <= word1.length; ++i) {\r\n\t\tfor (var j = 0; j <= word2.length; ++j) {\r\n\t\t\tif (i == 0 || j == 0) {\r\n\t\t\t\tlcsarr[i][j] = 0;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (word1[i-1] == word2[j-1]) {\r\n\t\t\t\t\tlcsarr[i][j] = lcsarr[i-1][j-1] + 1;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlcsarr[i][j] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (max < lcsarr[i][j]) {\r\n\t\t\t\tmax = lcsarr[i][j];\r\n\t\t\t\tindex = i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar str = \"\";\r\n\tif (max == 0) {\r\n\t\treturn \"\";\r\n\t}\r\n\telse {\r\n\t\tfor (var i = index-max; i <= max; ++i) {\r\n\t\t\tstr += word2[i];\r\n\t}\r\n\treturn str;\r\n\t}\r\n}", "function findLongestSubstring(s) {\n let maxSub = 0;\n for (let i = 0; i < s.length; i++) {\n const seen = new Set();\n for (let j = i; j < s.length; j++) {\n if (!seen.has(s[j])) {\n seen.add(s[j]);\n } else {\n maxSub = Math.max(seen.size, maxSub);\n break;\n }\n }\n }\n console.log(s, maxSub);\n return maxSub;\n}", "function longestIncreasingSubsequence(array) {\n // Write your code here.\n let sequences = new Array(array.length);\n let lengths = array.map(x => 1);\n let maxId = 0;\n for(let i =0 ; i< array.length; i++) {\n for(let j=0; j< i; j++) {\n if(array[j] < array[i] && lengths[j] + 1 > lengths[i]) {\n lengths[i] = lengths[j] + 1;\n sequences[i] = j;\n }\n }\n if(lengths[i] >= lengths[maxId]) {\n maxId = i;\n }\n }\n \n return buildSequence(array, sequences, maxId);\n}", "function longest(nums) {\n/*\n assume each number is a increasing subsequence with length of 1\n create an array to record longest increasing subsquence at each number\n\n By iterating nums array, update the LIS at each number by iterating \n previous number. \n\n time complexity O(n^2), space complexity O(n)\n*/\n\n // const lengths = new Array(nums.length).fill(1);\n // let maxLength = 1;\n\n // for(let i = 0; i < nums.length; i++) {\n // for(let j = i - 1; j >= 0; j--) {\n // if (nums[i] > nums[j]) {\n // lengths[i] = Math.max(lengths[j] + 1, lengths[i]);\n // if (lengths[i] > maxLength) maxLength = lengths[i];\n // }\n // }\n // }\n\n // return maxLength;\n\n/*\n in order to reduce time complexity to O(n log n), a different approach is needed\n\n The general idea is keep all possible increasing subsequences and update them under 3 conditions\n By iterating nums, compare each num with the last element of each IS\n\n Case 1: If num is greater than all last elements of ISs, clone LIS and attach num to its clone\n Case 2: If num is smaller than all last elements of ISs, create a new IS with the num OR replace previous single IS with num\n Case 3: If num is in between the above two conditions, find the IS with largest last element which is smaller than num.\n Clone it and attach num. discard all other ISs with same length\n\n As IS update, make sure *** ISs[i].last_element > ISs[i - 1].last_element ***\n\n Ex. input = [10, 9, 2, 5, 3, 7, 101, 18]\n\n num = 10 (no IS yet)\n 10\n ------------------------------------------------\n num = 9 (case 2)\n 9\n ------------------------------------------------\n num = 2 (case 2)\n 2\n ------------------------------------------------\n num = 5 (case 1)\n 2\n 2, 5\n ------------------------------------------------\n num = 3 (case 3)\n 2\n 2, 3\n 2, 5 (discard)\n ------------------------------------------------\n num = 7 (case 1)\n 2\n 2, 3\n 2, 3, 7\n ------------------------------------------------\n num = 101 (case 1)\n 2\n 2, 3\n 2, 3, 7\n 2, 3, 7, 101\n ------------------------------------------------\n num = 18 (case 3)\n 2\n 2, 3\n 2, 3, 7\n 2, 3, 7, 18 (ANSWER!!)\n 2, 3, 7, 101 (discard)\n\n The way to store IS can be simplified down to an TAIL array. \n Index represents length of IS at this index (index 0 = IS of length 1, index 1 = IS of length 2...) \n Value at this index represents last/largest element of the IS. (tails[0] = 10 => 9 => 2 from example input)\n Therefore: \n\n Ex. input = [10, 9, 2, 5, 3, 7, 101, 18]\n\n num = 10 (no IS yet)\n 10\n ------------------------------------------------\n num = 9\n 9\n ------------------------------------------------\n num = 2\n 2\n ------------------------------------------------\n num = 5\n 2, 5\n ------------------------------------------------\n num = 3\n 2, 3\n ------------------------------------------------\n num = 7\n 2, 3, 7\n ------------------------------------------------\n num = 101\n 2, 3, 7, 101\n ------------------------------------------------\n num = 18\n 2, 3, 7, 18\n\n*/\n\n const arr = [nums[0]];\n\n for(let i = 1; i < nums.length; i++) {\n const idx = bSearch(nums[i]);\n arr[idx] = nums[i];\n }\n\n return arr.length;\n \n function bSearch(num) {\n let i = 0;\n let j = arr.length - 1;\n while (i < arr.length && j >= 0) {\n const mid = Math.floor((i + j) / 2);\n if (arr[mid] > num) {\n if (arr[mid - 1] === num) return mid - 1;\n if (arr[mid - 1] < num) return mid;\n j = mid - 1;\n } else if (arr[mid] < num) {\n if (arr[mid + 1] >= num) return mid + 1;\n i = mid + 1;\n } else {\n return mid;\n }\n }\n\n return i;\n }\n}", "function longestCommonSubstring(string1, string2) {\n\t// Convert strings to arrays to treat unicode symbols length correctly.\n\t// For example:\n\t// '𐌵'.length === 2\n\t// [...'𐌵'].length === 1\n\tconst s1 = [...string1];\n\tconst s2 = [...string2];\n\n\t// Init the matrix of all substring lengths to use Dynamic Programming approach.\n\tconst substringMatrix = Array(s2.length + 1)\n\t\t.fill(null)\n\t\t.map(() => {\n\t\t\treturn Array(s1.length + 1).fill(null);\n\t\t});\n\n\t// Fill the first row and first column with zeros to provide initial values.\n\tfor (let columnIndex = 0; columnIndex <= s1.length; columnIndex += 1) {\n\t\tsubstringMatrix[0][columnIndex] = 0;\n\t}\n\n\tfor (let rowIndex = 0; rowIndex <= s2.length; rowIndex += 1) {\n\t\tsubstringMatrix[rowIndex][0] = 0;\n\t}\n\n\t// Build the matrix of all substring lengths to use Dynamic Programming approach.\n\tlet longestSubstringLength = 0;\n\tlet longestSubstringColumn = 0;\n\tlet longestSubstringRow = 0;\n\n\t//creates a table comparing each character in the strings\n\tfor (let rowIndex = 1; rowIndex <= s2.length; rowIndex += 1) {\n\t\tfor (let columnIndex = 1; columnIndex <= s1.length; columnIndex += 1) {\n\t\t\t//if (s1[columnIndex - 1] === s2[rowIndex - 1]) {\n\t\t\t//hack to change rowIndex to <= 6 since that was the longest substring...so it stops looking after the 6th match\n\t\t\tif (s1[columnIndex - 1] === s2[rowIndex - 1] && rowIndex <= 6) {\n\t\t\t\tsubstringMatrix[rowIndex][columnIndex] =\n\t\t\t\t\tsubstringMatrix[rowIndex - 1][columnIndex - 1] + 1;\n\t\t\t} else {\n\t\t\t\tsubstringMatrix[rowIndex][columnIndex] = 0;\n\t\t\t}\n\n\t\t\t// Try to find the biggest length of all common substring lengths\n\t\t\t// and to memorize its last character position (indices)\n\t\t\t// if (substringMatrix[rowIndex][columnIndex] > longestSubstringLength) {\n\t\t\tif (substringMatrix[rowIndex][columnIndex] > longestSubstringLength) {\n\t\t\t\tlongestSubstringLength = substringMatrix[rowIndex][columnIndex];\n\t\t\t\tlongestSubstringColumn = columnIndex;\n\t\t\t\tlongestSubstringRow = rowIndex;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (longestSubstringLength === 0) {\n\t\t// Longest common substring has not been found.\n\t\treturn \"\";\n\t}\n\n\t// Detect the longest substring from the matrix.\n\tlet longestSubstring = \"\";\n\n\twhile (substringMatrix[longestSubstringRow][longestSubstringColumn] > 0) {\n\t\t//\twhile (substringMatrix[longestSubstringRow][longestSubstringColumn] > 0 &&\tlongestSubstringRow <= 2) {\n\t\tlongestSubstring = s1[longestSubstringColumn - 1] + longestSubstring;\n\t\tlongestSubstringRow -= 1;\n\t\tlongestSubstringColumn -= 1;\n\t}\n\n\treturn longestSubstring;\n}", "function longestCommonPrefix(arr) {\n let result = '';\n if (!arr || arr.length === 0) { return ''; }\n for (let i = 0; i < arr[0].length; i++){\n let newLetter = arr[0][i];\n\n for (let j = 0; j < arr.length; j++){\n let testLetter = arr[j][i];\n if (testLetter !== newLetter) {\n return result;\n }\n }\n result += newLetter;\n }\n return result;\n}", "function smallestCommons(arr) {\r\n var scm = 0,\r\n tryAgain = true;\r\n\r\n arr.sort(function(a, b) {\r\n \"use strict\";\r\n return a > b;\r\n });\r\n\r\n scm = arr[0];\r\n\r\n while (tryAgain) {\r\n while(scm % arr[1] !== 0) {\r\n scm += arr[0];\r\n }\r\n\r\n for(var i = arr[0]; i <= arr[1]; i += 1) {\r\n if(scm % i !== 0) {\r\n scm += arr[0];\r\n break;\r\n }\r\n if(i === arr[1]) {\r\n tryAgain = false;\r\n }\r\n }\r\n }\r\n\r\n return scm;\r\n}", "function longestSub(str){\n \n var substr = \"\";\n var lngsubstr = 0;\n var lng =\"\" ;\n \n for (var i=0; i<str.length; i++){\n \n substr = str.substring(i,i+1);\n \n var j = i+1;\n \n while( substr.indexOf(str[j]) === -1 && j<str.length ){\n substr = str.substring(i,j+1);\n j++;\n }\n \n if(lngsubstr < substr.length){\n lngsubstr = substr.length;\n lng = substr;\n } \n \n }\n \n// console.log(lng);\n// console.log(lngsubstr);\n}", "function longestSequenceOf1s(num) {\n\tlet prev = 0, curr = 0, max = 0,\t\t\n\t\ti = 0,\n\t\tprevBit = 0;\n\t\t\n\twhile (num >> i > 0) {\n\t\tconst currBit = num & 1 << i;\n\t\ti++;\n\t\t\n\t\tif (currBit) {\n\t\t\tcurr++;\n\t\t}\t\t\n\t\tif (prevBit && !currBit || !(num >> (i + 1))) {\n\t\t\tif (max < curr + prev) {\n\t\t\t\tmax = curr + prev + (curr && prev ? 1 : 0);\n\t\t\t}\t\t\t\n\t\t\tprev = curr;\n\t\t\tcurr = 0;\n\t\t}\n\t\tif (!currBit) {\t\t\t\n\t\t\tcurr = 0;\t\t\n\t\t}\n\t\tif (!prevBit && !currBit) {\n\t\t\tprev = 0;\n\t\t}\t\t\n\t\tprevBit = currBit;\t\t\n\t}\n\treturn max;\n}", "function findLongestSubString(string) {\n if (string.length === 0) return 0\n\n let set = new Set()\n let left = 0\n let right = 0\n let maxLen = 1\n\n while (right < string.length) {\n if (!set.has(string[right])) {\n set.add(string[right])\n maxLen = Math.max(maxLen, right - left + 1)\n right++\n } else if (set.has(string[right]) && string[right] === string[left]) {\n left++\n right++\n } else {\n set.delete(string[left])\n left++\n }\n }\n return maxLen\n}", "function longest(s1, s2) {\n let arr = [];\n let temp = s1.concat(s2).split('').sort();\n temp.reduce(function(previous, current){\n if (current !== previous) {\n arr.push(current);\n return current;\n }\n return previous;\n }, 0);\n return arr.join('');\n}", "function longestConsecutive(nums) {\n if (nums.length <= 1) {\n return nums.length;\n }\n\n nums = nums.sort((a, b) => a - b);\n let count = 1, max = 1;\n\n for (let i = 1; i < nums.length; i++) {\n // if same numbers appear consecutively while being in the middle of a sequence (not at the start),\n // skip that and keep the sequence going. (not mentioned in question but otherwise code doesn't work)\n if (nums[i] == nums[i - 1]) continue;\n\n if (nums[i] - nums[i - 1] == 1) {\n count++;\n } else {\n if (count > max) {\n max = count;\n }\n\n count = 1;\n }\n }\n\n if (count > max) {\n max = count;\n }\n\n return max;\n}", "function commonSuffix(arr) {\n if (arr.length === 0){return\"\";}\n if (arr.length === 1){return arr[0];}\n// find common suffix of the first 2 words and save it in a variable. Use an array variable instead of a string for the ease of cutting this variable later on.\n let currReversedSuffixArr = [];\n let len1 = arr[1].length;\n let len0 = arr[0].length;\n // console.log(\"arr[1].length: \", arr[1].length);\n\n for (let i = len0-1, j = len1-1; i>=0, j>=0; i--, j--){\n if (arr[1][j] === arr[0][i]){\n // console.log(\"i: \", i,\"j: \", j, currReversedSuffixArr);\n currReversedSuffixArr.push(arr[1][j]);\n }\n else if (arr[1][j] !== arr[0][i]){\n break;\n }\n }\n // console.log(\"line 26: \", currReversedSuffixArr);\n\n // iterate through the rest of the array, compare the array value with the saved suffix\n for (let i = 2; i<arr.length; i++) {\n let prevReversedSuffixArr = currReversedSuffixArr;\n let len = arr[i].length;\n let sLen = prevReversedSuffixArr.length;\n currReversedSuffixArr = [];\n for (let j = len-1, k=0; j>=0, k<sLen; j--, k++) {\n if (arr[i][j] === prevReversedSuffixArr[k]){\n currReversedSuffixArr.push(arr[i][j]);\n }\n else if (arr[i][j] !== prevReversedSuffixArr[k]){\n break;\n }\n }\n // console.log(\"line 39: \",prevReversedSuffixArr);\n }\n // iterate thru the reversed suffix array from back to front and make a string from it\n sLen = currReversedSuffixArr.length;\n let suffix = \"\";\n for (let i=sLen-1; i>=0; i--) {\n suffix += currReversedSuffixArr[i];\n }\n return suffix;\n}", "function lcs(s1, s2) {\n let result = \"\";\n helper(s1.length - 1, s2.length - 1, \"\");\n return result;\n\n function helper(n, m, string) {\n if (n < 0 || m < 0) {\n if ( result.length < string.length ) result = string;\n return;\n }\n\n if (s1[n] === s2[m]) {\n helper(n - 1, m - 1, string + s1[n]);\n\n } else {\n helper(n - 1, m, string);\n helper(n, m - 1, string);\n }\n }\n}", "function longestSubstring(s) {\n let maxSub = 0,\n visited = {};\n for (let i = 0, j = 0; i < s.length; i++) {\n if (visited.hasOwnProperty(s[i])) {\n j = Math.max(j, visited[s[i]] + 1);\n }\n visited[s[i]] = i;\n let currMax = i - j + 1;\n maxSub = Math.max(maxSub, currMax);\n }\n return maxSub;\n}", "function smallestCommons(arr) {\r\n\tstart = arr[0] < arr[1] ? arr[0] : arr[1];\r\n\tend = arr[1] > arr[0] ? arr[1] : arr[0];\r\n\tvar mult = 1;\r\n\tvar needs = (end - start) + 1;\r\n\twhile (true) {\r\n\t\thas = 0;\r\n\t\tfor (var i = start; i <= end; i++) {\r\n\t\t\tif (mult % i === 0) {\r\n\t\t\t\thas++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (has === needs) {\r\n\t\t\treturn mult;\r\n\t\t}\r\n\t\tmult++;\r\n\t}\r\n}", "function longestConsecutive(nums) {\n \n if(nums.length === 0) return 0;\n if(nums.length === 1) return 1;\n\n let longestConsecutiveSequenceNumber = [[]];\n let indexOfElement = 0;\n let maxLength = 0;\n \n nums = nums.sort((a,b) => a-b);\n noDuplicateNums = [];\n noDuplicateNums.push(nums[0]);\n\n for(let i = 1; i < nums.length; i++){\n if(nums[i - 1] !== nums[i]) {\n noDuplicateNums.push(nums[i]);\n }\n }\n\n longestConsecutiveSequenceNumber[0].push(noDuplicateNums[0]);\n \n for(let i = 1; i < noDuplicateNums.length; i++) {\n if(noDuplicateNums[i-1] + 1 !== noDuplicateNums[i]) {\n indexOfElement++;\n longestConsecutiveSequenceNumber.push([]);\n }\n longestConsecutiveSequenceNumber[indexOfElement].push(noDuplicateNums[i]);\n }\n \n longestConsecutiveSequenceNumber.forEach((seq) => {\n if (seq.length > maxLength) {\n maxLength = seq.length;\n };\n });\n \n return maxLength;\n}", "function solution(str) {\n // write your code in JavaScript (Node.js 8.9.4)\n\n // substring - semi alternating - should not have more than 2 repititions\n // hmm so temo shuld be 2 and we should have a system to keep resetting it?\n // we need a result and a temp to keep count and need to update them as we find // consecutive characters\n\n let len = str.length;\n // corner condition\n if (len < 3) return len;\n\n let temp = 2,\n result = 2;\n\n for (let i = 2; i < len; i++) {\n if (str.charAt(i) !== str.charAt(i - 1) ||\n str.charAt(i) !== str.charAt(i - 2)) {\n temp++; // looking for consecutive characters\n } else {\n result = Math.max(result, temp);\n // reset temp\n temp = 2;\n }\n }\n result = Math.max(result, temp);\n return result;\n}", "function maxInversions2(arr) {\n let arrLength = arr.length;\n let inversionCount = 0;\n\n // Subsequence of 3: Iterate through N^3 possibilities\n for (let i = 0; i < arrLength - 2; i++) {\n for (let j = i + 1; j < arrLength - 1; j++) {\n if (arr[i] > arr[j]) {\n for (let k = j + 1; k < arrLength; k++) {\n if (arr[j] > arr[k]) {\n inversionCount++;\n }\n }\n }\n }\n }\n return inversionCount;\n}", "function longestCollatzSequence(searchMax) {\n var n, i, j, len, path;\n //store known results, expect no more than 1 million records\n //improve search of 1,000,000 from 10 sec to 2 sec\n var memo = {1: 1};\n var maxLen = 1\n , maxNum = 1;\n for (i = 2; i < searchMax; i++) {\n n = i;\n path = [];\n while (true) {\n if (memo[n]) {\n //hit cache, remember 1 is already in the cache\n //so this is our exit of the while loop\n len = memo[n];\n break;\n }\n else {\n path.push(n);\n if (n % 2 === 0) {\n //even\n n = n / 2;\n }\n else {\n n = 3 * n + 1;\n }\n }\n }\n //unwind the stack, add to memo\n for (j = path.length - 1; j >= 0; j--) {\n len++;\n memo[path[j]] = len;\n }\n if (len > maxLen) {\n //save max result\n maxLen = len;\n maxNum = i;\n }\n }\n return maxNum;\n}", "function smallestCommons(arr) {\n\tarr.sort(function (a, b) {\n\t\treturn b - a;\n\t});\n\tconst smallest = arr[1];\n\tconst biggest = arr[0];\n\tlet solution = biggest;\n\n\tfor (let i = biggest; i >= smallest; i--) {\n\t\tif (solution % i) {\n\t\t\tsolution += biggest;\n\t\t\ti = biggest;\n\t\t}\n\t}\n\treturn solution;\n}", "function findLongestSubstring (s) {\n let win = s.length;\n while (win > 0) {\n let start = 0;\n while (start + win <= s.length) {\n const seen = new Set(s.slice(start, start + win));\n if (seen.size === win) {\n return win;\n }\n start += 1;\n }\n win -= 1;\n }\n return 0;\n}", "function LongestIncreasingSequence(arr) { \n \n if(arr.length === 0){ //verificacao\n return 0\n }\n let arrLIS = new Array(arr.length).fill(1)\n let max=1\n /*Computar valores LIST otimizados de maneira ascendente*/\n for(let i=1; i<arr.length; i++){\n for(let j=0; j<i; j++){\n if( (arr[i] > arr[j]) ) { //temos uma LIS \n if( (arrLIS[j]+1) > arrLIS[i] ){\n arrLIS[i] = arrLIS[j]+1\n max = arrLIS[i]\n }\n \n }\n }\n }\n\n return(max)\n \n }", "function populateAndFindLongestCommonSubstring(arr, s1, s2) {\n\tvar diagonal, newCommonLen, retStr;\n\tvar longestStrLen = -1,\n\t\tlongestStrLenRow = -1,\n\t\tlongestStrLenCol = -1,\n\t\trowLen = s1.length + 1,\n\t\tcolLen = s2.length + 1;\n\n\tfor(var i = 1; i < rowLen; i++) {\n\t\tfor(var j = 1; j < colLen; j++) {\n\t\t\t// If the letter of the column and the row are the same then\n\t\t\t// take 1 + the diagonal else just use zero\n\t\t\tif(s1[i - 1] === s2[j - 1]) {\n\t\t\t\tdiagonal = arr[i - 1][j - 1];\n\t\t\t\tnewCommonLen = 1 + diagonal;\n\n\t\t\t\t// Keeping track of the index and length of the longest common substring\n\t\t\t\tif(newCommonLen > longestStrLen) {\n\t\t\t\t\tlongestStrLen = newCommonLen;\n\t\t\t\t\t[longestStrLenRow, longestStrLenCol] = [i, j];\n\t\t\t\t}\n\n\t\t\t\tarr[i].push(newCommonLen);\n\t\t\t} else {\n\t\t\t\tarr[i].push(0);\n\t\t\t}\n\t\t}\n\t}\n\n\tretStr = traverseDiagonal(arr, s1, longestStrLenRow, longestStrLenCol);\n\treturn retStr;\n}", "function findIncreasingSequences2(arr) {\n if (arr.length === 1) return 1;\n for (let i = 1; i < arr.length; i++) {\n if (arr[i] < arr[i - 1]) {\n return 1 + findIncreasingSequences(arr.slice(i + 1));\n }\n }\n}", "function longestSubArrLen(arr) {\n let currentLongest = 1;\n let runningLongest = 0;\n for (let i = 0; i < arr.length - 1; i++) {\n if (arr[i] === arr[i + 1]) {\n // update currentLongest\n currentLongest++;\n } else {\n // update runningLongest by comparing to currentLongest\n // reset currentLongest to 0\n runningLongest = Math.max(runningLongest, currentLongest);\n currentLongest = 1;\n }\n }\n return runningLongest;\n}", "function longest(s1, s2) {\n s1 = s1.split(\"\");\n s2 = s2.split(\"\");\n var nstring = s1.concat(s2);\n nstring = nstring.sort();\n var result = [];\n for(var i = 0; i<nstring.length; i++){\n if(result.indexOf(nstring[i])===-1){\n result.push(nstring[i]);\n }\n }\n result = result.join(\"\");\n return result; \n }", "function smallestCommons(arr) {\n\tarr = arr.sort((a, b) => a - b);\n\tconst myArr = [];\n\tlet every;\n\tfor (let i = arr[0]; i <= arr[1]; i++) {\n\t\tmyArr.unshift(i);\n\t}\n\tlet lcm = myArr[0] * myArr[1];\n\twhile (!every) {\n\t\tevery = myArr.every(num => lcm % num === 0);\n\t\tif (!every) {\n\t\t\tlcm += arr[1];\n\t\t}\n\t}\n\treturn lcm;\n}", "function longestRepetition(s) {\n //console.log(s)\n var i = 0,\n seq = 0,\n results = [];\n \n if ( s === ('')){\n return ['', 0]\n }\n \n for(let i=0; i<s.length; i++) {\n var current = s[i],\n next = s[i + 1];\n \n if (typeof results[seq] === 'undefined') {\n results[seq] = [current, 0];\n }\n \n results[seq][1]++;\n \n if (current !== next) {\n seq++;\n }\n }\n \n return results.sort((a, b) => b[1] - a[1])[0];\n }", "function findLongestSubstring(s) {\n let longest = 0;\n let i = 0;\n let j = 0;\n let seen = new Set();\n while (i < s.length && j < s.length) {\n longest = Math.max(longest, j - i);\n if (seen.has(s[j])) {\n seen.delete(s[i]);\n i++;\n } else {\n seen.add(s[j]);\n j++;\n }\n }\n return Math.max(longest, j - i);\n}", "function longestPalindrome(s) { // O(n^3)\n let size = s.length;\n while(size > 1) {\n for(let i = 0; i + size - 1 < s.length; i++) {\n if(_isPalindrome(s, i, i + size - 1)) {\n return s.slice(i, i + size);\n }\n }\n size--;\n }\n return s.charAt(0);\n}", "function longestPositiveIncreasingSubsequence(ns) {\n var seq = [], is = [], l = -1, pre = new Array(ns.length);\n for (var i = 0, len = ns.length; i < len; i++) {\n var n = ns[i];\n if (n < 0)\n continue;\n var j = findGreatestIndexLEQ(seq, n);\n if (j !== -1)\n pre[i] = is[j];\n if (j === l) {\n l++;\n seq[l] = n;\n is[l] = i;\n }\n else if (n < seq[j + 1]) {\n seq[j + 1] = n;\n is[j + 1] = i;\n }\n }\n for (i = is[l]; l >= 0; i = pre[i], l--) {\n seq[l] = i;\n }\n return seq;\n }", "function longestConsec (strarr, k){\n var n = strarr.length;\n var longest=0;\n var targetIndex=0;\n var calcArr=[];\n var calc=0;\n var result;\n if(k>n || n===0 || k<=0){\n return \"\";\n } else{\n var arrLengths = [];\n for (var i=0;i<strarr.length;i++){\n arrLengths.push(strarr[i].length);\n }\n debugger;\n for (var j=0;j<arrLengths.length;j++){\n calcArr = arrLengths.slice(j,j+k);\n calc = calcArr.reduce(function(a,b){\n return a+b;\n },0);\n if (calc>longest){\n targetIndex = j;\n longest=calc;\n }\n }\n console.log (targetIndex+k-1);\n result = strarr.slice(targetIndex,targetIndex+k)\n result = result.join(\"\");\n return result;\n }\n}", "function longestConsecutive(nums) {\n if (nums.length <= 1) {\n return nums.length;\n }\n\n const numbers = new Set(nums); // set has constant time access like map\n let longest = 0;\n\n for (let i = 0; i < nums.length; i++) {\n if (!numbers.has(nums[i] - 1)) {\n let length = 0;\n while (numbers.has(nums[i] + length)) {\n length++;\n }\n\n if (length > longest) longest = length;\n }\n }\n\n return longest;\n}", "function smallestCommons(arr) {\r\n arr = arr.sort();\r\n\r\n let range = (function() {\r\n let range = [];\r\n for (let i = arr[0]; i <= arr[1]; i++) {\r\n range.push(i);\r\n }\r\n return range;\r\n })();\r\n\r\n let count = 0;\r\n let mult = range[range.length - 1];\r\n\r\n while (count < range.length) {\r\n count = 0;\r\n for (let i = range[0]; i <= range[range.length - 1]; i++) {\r\n if (mult % i === 0) count++;\r\n }\r\n mult += range[range.length - 1];\r\n }\r\n return mult - range[range.length - 1];\r\n}", "function lcs(n) {\n var startSum = 0;\n var largestSum = n[0];\n\n for (var i = 0; i < n.length; i++) {\n\n startSum += n[i];\n if (startSum < 0) {\n startSum = 0;\n }\n\n if (largestSum < startSum) {\n largestSum = startSum;\n }\n }\n return largestSum;\n}", "function smallestCommons(arr) {\n let beginRange = Math.min(...arr);\n let endRange = Math.max(...arr);\n let smallesCommonMultiple = beginRange;\n for (let i = Math.min(endRange, beginRange + 1); i <= endRange; i++) {\n smallesCommonMultiple = lcm(smallesCommonMultiple, i);\n }\n return smallesCommonMultiple;\n}", "function findMaxSubseq(xs) {\n var startMaxSubseq = 0;\n var endMaxSubseq = 0;\n var valMaxSubseq = xs[0];\n var startCurrentSubseq = 0;\n var endCurrentSubseq = 0;\n var valCurrentSubseq = xs[0];\n for (let i = 1; i < xs.length; i++) {\n //if another in current seq\n if (xs[i] == valCurrentSubseq) {\n endCurrentSubseq = i;\n }\n //if new seq starts, start counting new seq, and\n else {\n // if current seq is longer than max seq, save value\n if (currentIsLongerThanMax()) {\n saveCurrentAsMax();\n }\n //start counting new seq\n startCurrentSubseq = i;\n endCurrentSubseq = i;\n valCurrentSubseq = xs[i];\n }\n }\n if (currentIsLongerThanMax()) {\n saveCurrentAsMax();\n }\n return {\n \"startMaxSubseq\": startMaxSubseq,\n \"lengthMaxSubseq\": endMaxSubseq - startMaxSubseq + 1,\n \"valMaxSubseq\": valMaxSubseq\n };\n\n function saveCurrentAsMax() {\n endMaxSubseq = endCurrentSubseq;\n startMaxSubseq = startCurrentSubseq;\n valMaxSubseq = valCurrentSubseq;\n }\n\n function currentIsLongerThanMax() {\n return (endMaxSubseq - startMaxSubseq) <= (endCurrentSubseq - startCurrentSubseq);\n }\n}", "function smallestCommons(arr) {\n function multipleArr(num) {\n return Array.from(\n {\n length: 10000\n },\n (v, k) => k * num\n );\n }\n\n function divideLst(arr, step) {\n let start = Math.min(arr[0], arr[1]);\n let end = Math.max(arr[0], arr[1]);\n return Array.from(\n {\n length: (end - start) / step + 1\n },\n (_, i) => start + i * step\n );\n }\n var lst1 = multipleArr(arr[0]);\n var lst2 = multipleArr(arr[1]);\n var divider = divideLst(arr, 1);\n var multLst = [];\n for (let i = 0; i < lst1.length; i++) {\n if (lst2.indexOf(lst1[i]) > 0) {\n multLst.push(lst1[i]);\n }\n }\n for (let x = 0; x < multLst.length; x++) {\n for (let y = 0; y < divider.length; y++) {\n if (multLst[x] % divider[y] !== 0) {\n delete multLst[x];\n }\n }\n }\n return multLst.filter(Boolean)[0];\n}", "function longest(s1, s2) {\n \n return Array.from(new Set(s1.split(\"\").concat(s2.split(\"\")).sort())).join(\"\");\n\n}", "function lengthOfLongestSubstringB(s){\n let longest = 0;\n //let seen = {};\n let seen = new Map();\n let left = 0;\n\n if(s.length <=1){\n return s.length;\n }\n\n for (let right = 0; right < s.length; right++) {\n const currentChar = s[right];\n //const prevSeenChar = seen[currentChar];\n const prevSeenChar = seen.get(currentChar);\n if(prevSeenChar >= left){\n left = prevSeenChar + 1;\n }\n //seen[currentChar] = right;\n seen.set(currentChar, right);\n longest = Math.max(longest, right - left + 1);\n }\n\n console.log(longest);\n}", "function longestSub(string, k) {\n if (!string) return 0;\n let max = -Infinity;\n const helper = (remainString, visited = {}) => {\n if (remainString in visited) {\n return;\n }\n visited[remainString] = true;\n const diffChars = getNumberOfDiffChars(remainString);\n if (diffChars <= k) {\n max = Math.max(max, remainString.length);\n } else if (diffChars > k) {\n helper(remainString.substr(0, remainString.length - 1), visited);\n helper(remainString.substr(1), visited);\n }\n };\n helper(string);\n return max;\n}", "function longPelidrom(str) {\n let n = str.length;\n\n // make dp table\n let table = new Array(n);\n for (let i = 0; i < n; i++) table[i] = new Array(n);\n\n //all substring with size one is alwasys pelindrom\n let max_length = 1;\n for (let i = 0; i < n; i++) table[i][i] = true;\n\n // chske substring with size 2\n let start = 0;\n for (let i = 0; i < n - 1; i++) {\n if (str[i] == str[i + 1]) {\n table[i][i + 1] = true;\n start = i;\n max_length = 2;\n }\n }\n\n //chek for size more then 3\n //k is length of substring\n for (let k = 3; k <= n; ++k) {\n // i is denoted the starting index of=substring\n for (let i = 0; i < n - k + 1; ++i) {\n // value of j is show the last index of substring\n\n let j = i + k - 1;\n\n if (table[i + 1][j - 1] && str[i] == str[j]) {\n table[i][j] = true;\n if (k > max_length) {\n start = i;\n console.log(\"i = \" + i);\n max_length = k;\n console.log(k);\n }\n }\n }\n }\n return str.substring(start, start + max_length);\n}", "function longest(s1, s2) {\n var answer = [];\n var arr = s1.split('');\n var arr1 = s2.split('');\n for(var i = 0; i < arr.length; i++){\n if(!answer.includes(arr[i])){\n answer.push(arr[i])\n }\n }\n for(var i = 0; i < arr1.length; i++){\n if(!answer.includes(arr1[i])){\n answer.push(arr1[i])\n }\n }\n return answer.sort().join('');\n }", "function gcd(num1, num2){\n let numArray1 = [];\n let numArray2 = [];\n let finalArray = [];\n let longestArray;\n let shortestArray;\n for (let i = 1; i <= Math.floor(num1); i++) {\n if (num1 % i === 0) {\n numArray1.push(i);\n } \n }\n for (let i = 1; i <= Math.floor(num2); i++) {\n if (num2 % i === 0) {\n numArray2.push(i);\n } \n } \n for (let i = 0; i < numArray1.length || i < numArray2.length; i++) {\n if (numArray1.length > numArray2.length){\n longestArray = numArray1;\n shortestArray = numArray2;\n }\n else {\n longestArray = numArray2;\n shortestArray = numArray1;\n }\n }\n for (let i = 0; i < shortestArray.length; i++) {\n if(longestArray.indexOf(shortestArray[i]) > -1){\n finalArray.push(shortestArray[i]);\n } \n }\n return Math.max(...finalArray);\n }", "function longestConsec(strarr, k) {\n let longest = 0, arr = [], len = strarr.length;\n for (let i = 0; i < len; i++) {\n let af = strarr.slice(i, i + k).join('');\n arr.push(af);\n }\n if (len === 0 || k > len || k <= 0) {\n return '';\n }else return arr.reduce((a, b) => {\n return a.length >= b.length ? a : b;\n });\n}", "function longest(a, b) {\n let c = [];\n let arr1 = a.toLowerCase().split('');\n let arr2 = b.toLowerCase().split('');\n let arr3 = (arr1.concat(arr2)).sort();\n for (let i = 0; i < arr3.length; i++) {\n if (c.includes(arr3[i]) !== true) {\n c.push(arr3[i]);\n }\n }\n return c.join('');\n}", "function longestIncreasingSequence(sequence) {\n let longest = [];\n let current = [];\n\n for (let i = 0; i < sequence.length; i++) {\n const previousValue = sequence[i - 1] || -Infinity;\n const value = sequence[i];\n\n if (value < previousValue) {\n if (current.length > longest.length) longest = current;\n current = [value];\n } else {\n current.push(value);\n }\n }\n\n return current.length > longest.length ? current : longest;\n}", "function lengthofLongestSubstring(str){\nlet max_len = 0;\nlet curr = 0;\nlet hash = {};\nif(s.length < 2) {\n return s.length;\n}\nfor(let i = 0; i < s.length; i++) {\n if(hash[s[i]] == null) {\n curr += 1;\n } else {\n curr = Math.min(i - hash[s[i]], curr + 1);\n }\n max_len = Math.max(max_len, curr);\n hash[s[i]] = i; //save the index\n}\nreturn max_len;\n}", "function longest(s1, s2) {\n let combined = s1 + s2;\n let uniqueSet = new Set(combined);\n let uniqueArray = [...uniqueSet];\n return uniqueArray.sort().join(\"\");\n\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 solve2(s) {\n // Write your code here\n let ret_str = ''\n for (let i = 0; i < s.length; i++) {\n if (s[i] !== s[i+1] || i + 1 > s.length) ret_str += s[i]\n }\n // console.log(ret_str)\n return ret_str\n}", "function smallestCommons(arr) {\n // Sort the array\n let sorted = arr.sort((a, b) => a - b);\n let max = 1;\n\n // Worst case scenario, the common multiple is factorial\n for (let j = sorted[0]; j <= sorted[1]; j++) {\n max *= j;\n }\n\n // Build the range array\n let range = Array(sorted[1] - sorted[0] + 1)\n .fill(sorted[0])\n .map((num, ind) => num + ind);\n\n let k = sorted[0];\n let multiple = sorted[1] * k;\n while (multiple < max) {\n multiple = sorted[1] * k;\n if (range.every((divisor) => multiple % divisor == 0)) {\n return multiple;\n }\n k++;\n }\n return max;\n}", "function longestPalindrome(s) {\n var max_length = 0;\n maxLen = '';\n for (var i = 0; i < s.length; i++) {\n // we identify the substring and assign to a variable \n var subs = s.substr(i, s.length)\n for (var j = subs.length; j >= 0; j--) {\n var subStr = subs.substr(0, j);\n if (subStr.length <= 1)\n continue;\n if (isPalindrome(subStr)) {\n if (subStr.length > max_length) {\n max_length == subStr\n maxLen = subStr\n }\n }\n\n }\n }\n return maxLen;\n}", "function longest(s1, s2) {\n let fullStr = s1+s2\n let outputArr = []\n fullStr = fullStr.split(\"\").forEach(el => {\n if(outputArr.indexOf(el) == -1){\n outputArr.push(el)\n }\n })\n \n outputArr.sort((a,b)=>{\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n })\n return outputArr.join(\"\")\n }", "function commonChild(s1, s2) {\n \n var matrix = new Array(s1.length);\n \n for(var i = 0; i < s1.length; i++) {\n matrix[i] = new Array(s1.length);\n for(var j = 0; j < s1.length; j++) {\n var cmp = s1[i] === s2[j];\n var left = j === 0 ? 0 : matrix[i][j-1];\n var down = i === 0 ? 0 : matrix[i-1][j];\n var diag = (i === 0 || j === 0) ? 0 : matrix[i-1][j-1];\n matrix[i][j] = Math.max(left, down, diag + cmp);\n }\n }\n \n return matrix[s1.length-1][s1.length-1];\n\n\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n if (A.length == 1)\n return A[0];\n \n A.sort();\n while (A.length > 0) {\n var a = A.pop();\n var b = A[A.length-1];\n if (a != b)\n return a;\n A.pop(); \n } \n}", "function longestPalindromicSubstring(string) {\n // Write your code here.\n let currentLongest = [0, 1];\n for (let i = 1; i < string.length; i++) {\n const odd = getLongestPalindromeFrom(string, i - 1, i + 1);\n const even = getLongestPalindromeFrom(string, i - 1, i);\n const longest = odd[1] - odd[0] > even[1] - even[0] ? odd : even;\n currentLongest = currentLongest[1] - currentLongest[0] > longest[1] - longest[0] ? currentLongest : longest;\n }\n let result = string.slice(currentLongest[0], currentLongest[1])\n console.log(result);\n return string.slice(currentLongest[0], currentLongest[1]);\n}", "function smallestCommons(arr) {\n var workArr = [];\n for (var x = Math.min(arr[0], arr[1]); x <= Math.max(arr[0], arr[1]); x++) {\n workArr.push(x);\n }\n //Euclidean Algorithm maybe... Math isn't my thing\n function gcd(a, b) {\n return !b ? a : gcd(b, a % b);\n }\n \n function lcm(a, b) {\n return (a * b) / gcd(a, b); \n }\n\n var smallestCommon = workArr[0];\n workArr.forEach(function(n) {\n smallestCommon = lcm(smallestCommon, n);\n console.log(smallestCommon)\n });\n\n return smallestCommon;\n}", "function common(a,b){\n if (a[0]===b[0] || a[a.length-1]===b[b.length-1]){\n return console.log(\"True\");\n } else {\n return console.log(\"False\");\n }\n}", "function findSolution(arr) {\n const x = [];\n let longestSubArrayLength = 0;\n let subArrayLength = 0;\n for (i = 0; i < arr.length; i++) {\n if (x.includes(arr[i])) {\n if (subArrayLength > longestSubArrayLength) {\n longestSubArrayLength = subArrayLength;\n }\n subArrayLength = 1;\n x.length = 0;\n } else {\n x.push(arr[i]);\n subArrayLength += 1;\n }\n }\n return subArrayLength > longestSubArrayLength\n ? subArrayLength\n : longestSubArrayLength;\n}", "function longestConsec(arr, k) {\n let temp = '';\n\n if (k <= 0 || k > arr.length) return '';\n\n while (arr.length > 0) {\n if (temp.length < arr.slice(0, k).join('').length) {\n temp = arr.slice(0, k).join('');\n }\n arr.shift();\n }\n\n return temp;\n}", "function SearchingChallenge1(str) {\n const array = [...str];\n const k = Number(array.shift());\n\n let substring = [];\n let n = 1;\n\n let index = 0;\n\n let res = [];\n\n while (index < array.length) {\n if (substring === [] || substring.includes(array[index])) {\n substring.push(array[index]);\n index++;\n console.log(\"substring\", substring);\n } else if (!substring.includes(array[index]) && n <= k) {\n substring.push(array[index]);\n n++;\n index++;\n console.log(\"substring\", substring);\n } else {\n res.push(substring.join(\"\"));\n console.log(\"res during\", res);\n substring = [];\n n = 1;\n index--;\n console.log(\"substring after []\", substring.length);\n }\n }\n\n res.push(substring.join(\"\"));\n\n console.log(\"res final\", res);\n\n const lengths = res.map((e) => e.length);\n\n return res[lengths.indexOf(Math.max(...lengths))];\n}", "function longestSequence(arr) {\n // YOUR CODE HERE\n let maximum = 0;\n let count = 0;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] === 0) count = 0;\n else {\n count++;\n maximum = Math.max(maximum, count);\n }\n }\n if (maximum === 0) return \"There is no one sequenced\";\n else return maximum;\n}", "function longestInCommon(candidates, index) {\n var i, ch, memo;\n\n do {\n memo = null;\n for (i = 0; i < candidates.length; i++) {\n\t ch = candidates[i].charAt(index);\n\t if (!ch) { break };\n\t if (!memo) { memo = ch; }\n\t else if (ch != memo) { break; }\n }\n } while (i == candidates.length && ++index);\n\n return candidates[0].slice(0, index);\n }", "function smallestCommons(arr) {\n let lcm = (a, b) => {\n let gcd = (a, b) => {\n let min = Math.min(a, b);\n let max = Math.max(a, b);\n while (min !== 0) {\n let c = max % min;\n max = min;\n min = c;\n }\n return max;\n };\n return a * b / gcd(a, b);\n };\n return Array.from({length: Math.max(...arr) - Math.min(...arr) + 1 }, (_, v) => v + Math.min(...arr))\n .reduce((p, v) => lcm(p, v));\n}", "function maxConSubarray(arr){\n var i,\n len,\n tmp = [],\n sum = 0,\n cash,\n cashArr = [],\n // If find subarray with length more than 2.\n flag = true;\n /* To find\n positive subarray: posORneg = -1;\n negative subarray: posORneg = 1;\n */\n function subArr(arr,posORneg){\n for(i = 0, len = arr.length; i < len; i += 1){\n if(arr[i] === arr[i+1] + posORneg){\n flag = false;\n tmp.push(arr[i]);\n // Pushing last element to tmp because if will not check when i = length.\n if(i === len - 2){\n tmp.push(arr[i+1]);\n }\n } else {\n // If in the middle last element of subarray push it to tmp for negative subarray.\n if(posORneg === 1 && i !== len -1){\n tmp.push(arr[i]);\n }\n // If for correct work of reduce(). And skip it when negative subarray.\n if(tmp.length > 0 && posORneg === -1){\n // If in the middle last element of subarray push it to tmp.\n if (i !== len -1){\n tmp.push(arr[i]);\n }\n cash = tmp.reduce(function(previousValue, currentValue) {\n return previousValue + currentValue;\n });\n // Max sum.\n if (sum < cash){\n sum = cash;\n }\n // Clearing tmp.\n tmp = [];\n }\n }\n }\n }\n /* Comparing parameter of array with previous.\n If arrays are different makes flag = true and sum = 0.\n */\n function init(arr){\n len = arr.length;\n if (cashArr.length === 0) {\n cashArr = arr;\n }\n if (cashArr.length !== len){\n flag = true;\n sum = 0;\n }\n if (cashArr.length === len){\n for(i = 0; i < len; i += 1){\n if(cashArr[i] !== arr[i]){\n flag = true;\n sum = 0;\n break;\n }\n }\n }\n }\n\n return function(arr){\n init(arr);\n subArr(arr, -1);\n subArr(arr, 1);\n if(flag){\n return Math.max.apply(null,arr);\n } else return sum;\n }\n }", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n A = A.sort((a,b) => a - b);\n var arrayLength = A.length;\n var cur = A[0];\n var curlength = 1;\n for(var i = 1; i < arrayLength; i ++ ){\n if(cur == A[i]){\n curlength += 1;\n }else{\n if(curlength % 2 == 1){\n break;\n }else{\n cur = A[i];\n curlength = 1;\n }\n }\n }\n return cur;\n}", "function longestCommonPrefix(words) {\n var prefix = '';\n var letters = {};\n var shortest = Infinity\n for (var k = 0; k < words.length; k++) {\n if (words[k].length < shortest) {\n shortest = words[k].length;\n }\n }\n var j = 0;\n var prefix = '';\n var temp;\n while (j < shortest) {\n var i = 0;\n while (i < words.length) {\n if (i === 0) {\n temp = words[i][j]\n }\n if (words[i][j] !== temp || words[i][j].length === 0) {\n return prefix;\n }\n i++\n }\n prefix += words[i-1][j]\n j++;\n }\n return prefix;\n}", "function smallestCommon(arr) {\n var range = [];\n for (var i = Math.max(arr[0], arr[1]); i >= Math.min(arr[0], arr[1]); i--) {\n range.push(i);\n }\n\n // can use reduce() in place of this block\n var lcm = range[0];\n for (i = 1; i < range.length; i++) {\n var GCD = gcd(lcm, range[i]);\n // debugger;\n lcm = (lcm * range[i]) / GCD;\n }\n return lcm;\n\n function gcd(x, y) { // Implements the Euclidean Algorithm\n if(x%y === 0){\n return y;\n }else{\n return gcd(y, x%y);\n }\n }\n}", "function find(s) {\n let map = {}\n for (let i = 0; i < s.length; i++) {\n map[s[i]] = 0\n }\n\n let start = 0\n let end = 0\n let maxLen = 0\n let counter = 0\n\n while (end < s.length) {\n let c1 = s[end]\n\n if (map[c1] === 0) counter++\n map[c1]++\n end++\n\n while (counter > 2) {\n let c2 = s[start]\n\n if (map[c2] === 1) counter--\n map[c2]--\n start++\n }\n maxLen = Math.max(maxLen, end - start);\n }\n return maxLen\n}", "function longestPossible(s1, s2) {\n const all = (s1 + s2).split('')\n const uniqueSortedLetters = [...new Set(all)].sort()\n return uniqueSortedLetters.join('')\n}", "function solve(s, t) {\n\tlet diff = s.length - t.length;\n\tlet min = t.length;\n\tfor (let i = 0; i <= diff; i++) {\n\t\tlet counter = 0;\n\t\tlet j = i;\n\t\tfor (let k = 0; k < t.length; k++) {\n\t\t\tif (s[j] !== t[k]) {\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tj++;\n\t\t}\n\t\tmin = Math.min(min, counter);\n\t}\n\treturn min;\n}", "function longestCollatzSequence(n = 1000000) {\n\tlet chainLengths = new Array(n).fill(0);\n\tlet currentVal;\n\t// Calculate chain length of each value from 2 to n.\n\tfor (let value = 2; value < n; value++) {\n\t\tcurrentVal = value;\n\t\twhile (currentVal > 1) {\n\t\t\tchainLengths[value] += 1;\n\t\t\tcurrentVal = currentVal % 2 === 0 ? processEven(currentVal) : processOdd(currentVal);\n\t\t}\n\t}\n\t// Note that chainLengths[value] = chainLength, so we need the index\n\t// pointing to longest chain.\n\treturn chainLengths.reduce((acc, current, index) => current > chainLengths[acc] ? index : acc, 0);\n\n}", "function lpsRec(str) {\n if (str.length === 0) return 0;\n if (str.length === 1) return 1;\n\n const [first, last] = [str[0], str[str.length - 1]];\n\n if (first === last && str.length === 2) return 2;\n if (first === last) return 2 + lpsRec(str.slice(1, -1));\n\n return Math.max(\n lpsRec(str.slice(1)), lpsRec(str.slice(0, -1))\n );\n}", "function smallestCommons(arr) {\n const min = Math.min(arr[0], arr[1]),\n max = Math.max(arr[0], arr[1]);\n\n function range(min, max) {\n let arr = [];\n\n for (let i = max; i >= min; i--) {\n arr.push(i);\n }\n return arr;\n }\n\n function gcd(x,y) {\n return y === 0 ? x : gcd(y, x % y);\n }\n\n function lcm(x, y) {\n return (x * y) / gcd(x, y);\n }\n\n let multiple = min;\n\n range(min, max).forEach(value => {\n multiple = lcm(multiple, value);\n });\n\n return multiple;\n}", "function minDistance(word1, word2) {\n // equation is length of w1 + length of w2 - (2 * length of longest common subsequence)\n // in case of total mismatch, the answer will just be the combined lengths\n // * 2 makes sense since each mismatch requires 2 operations\n \n const matrix = [];\n for(let i = 0; i < word1.length + 1; i++) {\n matrix.push([])\n for(let j = 0; j < word2.length + 1; j++) {\n matrix[i].push(0)\n }\n }\n console.log(matrix)\n \n for(let i = 0; i <= word1.length; i++) {\n for(let j = 0; j <= word2.length; j++) {\n console.log()\n if(i === 0 || j === 0) continue\n if(word1[i - 1] === word2[j - 1]) {\n matrix[i][j] = matrix[i - 1][j - 1] + 1;\n } else {\n matrix[i][j] = Math.max(matrix[i - 1][j], matrix[i][j - 1])\n }\n }\n }\n \n \n return word1.length + word2.length - (2 * matrix[word1.length][word2.length])\n}", "function gcdMoreThanTwoNum(input){\n if (toString.call(input) !== \"[object Array]\"){\n return false;\n }\n var len, a, b;\n len = input.length;\n if (!len){\n return null;\n }\n a = input[0];\n for (var i=1; i<len; i++){\n b = input[i];\n a = gcdTwoNum(a, b);\n }\n return a;\n}", "function lengthOfLongestSubstring(s){\n let longest = 0;\n if(s.length <=1){\n return s.length;\n }\n for(let left = 0; left < s.length; left++){\n let seenChars = {}, currentLength = 0;\n for (let right = left; right < s.length; right++) {\n const currentChar = s[right];\n if(!seenChars[currentChar]){\n currentLength++;\n seenChars[currentChar] = true;\n longest = Math.max(longest, currentLength)\n } else {\n break;\n }\n }\n }\n console.log(longest);\n}", "function longestPalindromicSubstring(string) {\n let longestString = \"\"\n //for each char in string compute all possible substrings\n\tfor(let i = 0; i < string.length; i++) {\n\t\tfor(let j = i + 1; j < string.length + 1; j++) {\n\t\t\tlet stringTest = string.substring(i, j)\n\t\t\t//console.log({stringTest})\n\t\t\tif(isPalindrome(stringTest)) {\n\t\t\tlongestString = longestString.length < stringTest.length ? stringTest : longestString\n\t\t\tconsole.log({longestString});\n\t\t\t}\n\t\t}\n\t}\n\treturn longestString\n}", "function longestConsec(strarr, k) {\n let final = \"\";\n if (strarr.length === 0 || strarr.length < k || k<= 0) {\n return final;\n }\n let temp;\n let count = 0;\n for (let i=0; i<strarr.length; i++) {\n temp = strarr.slice(i,i+k).join(\"\").length;\n if (temp > count) {\n final = strarr.slice(i,i+k).join(\"\");\n count = temp;\n }\n }\n return final;\n}", "function largest_contiguous_subsum2(arr){\n\n let max_so_far = arr[0];\n let curr_max = arr[0];\n\n for (i=1; i<arr.length; i++){\n curr_max = Math.max(arr[i], curr_max+arr[i]);\n max_so_far = Math.max(max_so_far, curr_max);\n }\n return max_so_far;\n}", "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 smallestCommons(arr) {\n let newArr = [];\n for(let i = Math.max(...arr); i >= Math.min(...arr); i--){\n newArr.push(i);\n }\n let odd = 1;\n if(newArr[0]%2 !== 0){\n odd = newArr[0];\n newArr.splice(0,1);\n }\n if(newArr.length === 2){\n return odd * newArr[0] * newArr[1];\n }\n\n let product = (odd * newArr[0] * newArr[1] * newArr[2]) /2;\n\n if(newArr.length === 3){\n return product;\n }else if(Math.min(...newArr) <= newArr[0]/2){\n newArr = newArr.filter(x => x > newArr[0]/2);\n if(newArr.length <= 3){\n return odd * smallestCommons(newArr);\n }\n }\n for(let i = 3; i < newArr.length; i++){\n var greatestCD = gcd(product, newArr[i]);\n product = product * newArr[i]/greatestCD;\n }\n return product;\n\n function gcd(x, y) {\n // Implements the Euclidean Algorithm\n if (y === 0)\n return x;\n else\n return gcd(y, x%y);\n }\n}", "function gcd_more_than_two_numbers(input) {\n if (toString.call(input) !== \"[object Array]\") \n return false; \n var len, a, b;\n len = input.length;\n if ( !len ) {\n return null;\n }\n a = input[ 0 ];\n for ( var i = 1; i < len; i++ ) {\n b = input[ i ];\n a = gcd_two_numbers( a, b );\n }\n return a;\n }", "function smallestCommons(arr) {\n let multiplier = 1;\n let result = 0;\n const max = Math.max(...arr);\n\n while (true) {\n result = max * multiplier;\n let isCommon = true;\n for (let min = Math.min(...arr); min < max; min++) {\n // console.log('result',result,'min',min)\n if (result % min !== 0) {\n isCommon = false;\n break;\n }\n }\n if (isCommon) return result;\n multiplier++;\n }\n}", "function maxSumIncreasingSubsequence(array) {\n\tlet maxSeq = array.map(val => val);\n\tlet max = new Array(array.length).fill(null);\n\tlet maxIdx = 0;\n\tfor (let i = 1; i < array.length; i++) {\n\t\tfor (let j = 0; j < i; j++) {\n\t\t\t\tif (array[i] > array[j] && maxSeq[j] + array[i] > maxSeq[i]) {\n\t\t\t\t\tmaxSeq[i] = maxSeq[j] + array[i];\n\t\t\t\t\tmax[i] = j;\n\t\t\t\t}\n\t\t}\n\t\tif (maxSeq[maxIdx] < maxSeq[i]) maxIdx = i;\n\t}\n\tlet result = [];\n\tlet maxValue = maxSeq[maxIdx];\n\twhile (maxIdx !== null) {\n\t\tresult.push(array[maxIdx]);\n\t\tmaxIdx = max[maxIdx];\n\t}\n\tlet reversedResult = result.reverse();\n\treturn [maxValue, reversedResult];\n}", "async function mostCommonSubstring(testingArray1) {\n try {\n console.log(\"into mostcommon string\")\n let pathArray = [];\n await Promise.all(\n testingArray1.map(async element => {\n const urlParse = URL.parse(element);\n if (urlParse.hash != null && urlParse.path == null) {\n pathArray.push(urlParse.hash);\n } else if (urlParse.hash != null) {\n pathArray.push(urlParse.hash);\n pathArray.push(urlParse.path);\n } else {\n pathArray.push(urlParse.path);\n }\n })\n );\n pathArray = await spliting(pathArray);\n // console.log(pathArray)\n pathArray = Array.prototype.concat.apply([], pathArray);\n // \n pathArray = await pathArray.filter(function (el) {\n return el != null && el != \"\";\n });\n pathArray = await arrayCounter(pathArray);\n let pathString = []\n let myStrings = []\n for (let [key, value] of Object.entries(pathArray)) {\n if (key.length > 3) {\n pathString.push({\n \"str\": `${key}`,\n \"value\": value\n })\n }\n pathString.sort(function (a, b) {\n return b.value - a.value\n })\n\n }\n // console.log(chalk.blue(pathString))\n\n topValue = pathString[0].value\n await Promise.all(pathString.map(async element => {\n if (((element.value / topValue) * 100) > 85) {\n myStrings.push(element.str)\n\n }\n }))\n\n var longest = myStrings.sort(function (a, b) {\n return b.length - a.length;\n })[0]\n console.log(chalk.yellow(longest))\n if (longest.lastIndexOf('=') > longest.lastIndexOf('/')) {\n longest = longest.slice(0, longest.lastIndexOf('=') + 1);\n } else if (longest.lastIndexOf('.') > longest.lastIndexOf('/')) {\n longest = longest.slice(0, longest.lastIndexOf('.') + 1);\n } else if (longest.lastIndexOf('-') > longest.lastIndexOf('/')) {\n longest = longest.slice(0, longest.lastIndexOf('-') + 1);\n } else if (longest.includes('/')) {\n if (longest.slice(0, longest.lastIndexOf('/')).includes('/')) {\n longest = longest.slice(0, longest.lastIndexOf('/') + 1);\n };\n }\n return longest.replace(/\\d+$/, \"\");\n } catch (error) {\n return \"\"\n }\n}", "function largestSubstringWithKDistinctChar(s, k) {\n let currentLargestSubstring = '';\n\n for (let i = 0; i < s.length; i++) {\n for (let j = i+1; j < s.length; j++) {\n let substring = s.slice(i, j);\n if (containsKDistinctChars(substring, k) && currentLargestSubstring.length < substring.length) {\n currentLargestSubstring = substring;\n } \n\n console.log(substring);\n } \n }\n\n return currentLargestSubstring;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n let maxK1 = [];\n let maxK2 = [];\n maxK1[0] = maxK2[0] = 0;\n maxK1[A.length - 1] = maxK2[A.length - 1] = 0;\n for (let i = 1; i < A.length; i++) {\n if (i < A.length - 1) {\n maxK1[i] = Math.max(maxK1[i - 1] + A[i], 0);\n }\n let j = A.length - i;\n if (j < A.length - 1) {\n maxK2[j] = Math.max(maxK2[j + 1] + A[j], 0);\n }\n }\n let max = 0;\n for (let i = 1; i < A.length - 1; i++) {\n max = Math.max(max, maxK1[i-1] + maxK2[i+1]);\n }\n return max;\n}" ]
[ "0.72899485", "0.71720195", "0.7160475", "0.7063165", "0.7048045", "0.70024633", "0.68107575", "0.6775209", "0.6766909", "0.67241937", "0.66730076", "0.6632015", "0.66088074", "0.65912217", "0.6436072", "0.64148295", "0.6408796", "0.6384666", "0.6363513", "0.63428426", "0.6333691", "0.63158023", "0.6301933", "0.6297427", "0.6295476", "0.62901163", "0.62888116", "0.6279926", "0.62292373", "0.6220291", "0.621781", "0.61942554", "0.617977", "0.6168023", "0.61662", "0.61602056", "0.6144768", "0.6133299", "0.61255", "0.6118955", "0.60915095", "0.60682636", "0.60544825", "0.6049329", "0.6047399", "0.6046863", "0.6044945", "0.6034069", "0.60327977", "0.60297287", "0.6021221", "0.60206103", "0.60174924", "0.59913385", "0.59899575", "0.59893626", "0.59734815", "0.5965333", "0.5954223", "0.5949829", "0.59430987", "0.5941865", "0.5927864", "0.59222513", "0.59172356", "0.590704", "0.5905447", "0.59011453", "0.58995885", "0.5890395", "0.5889264", "0.58880246", "0.5885918", "0.58744997", "0.58726853", "0.586403", "0.5862689", "0.5843166", "0.5840871", "0.5835763", "0.5831201", "0.5820763", "0.58142173", "0.5813992", "0.5805711", "0.58026206", "0.57921857", "0.5790357", "0.5785382", "0.57809764", "0.57790786", "0.57670957", "0.57661825", "0.5746659", "0.5746558", "0.57440203", "0.57418853", "0.5739733", "0.5724667", "0.5711037", "0.5705683" ]
0.0
-1
Merge item data ret.result = [ [item1_a, item1_b, ...], [item2_a, item2_b, ...], ... ]; ret.names = [ itemname_1, itemname_2, ... ];
function _mergeItemsData(items, except_names) { const ret = {}; const item_names = []; for (let i = 0; i < items.length; i++) { const item = items[i]; if (except_names.indexOf(items[i].name) >= 0) continue; const name_key = ('0' + item.match_level).slice(-3) + '_' + item.name; if (name_key in ret) { ret[name_key].push(item); } else { ret[name_key] = [item]; item_names.push(item.name); } } const keys = Object.keys(ret); const ret_sorted = []; for (let i = 0; i < keys.length; i++) { ret[keys[i]].sort(_sortItemInSameName); // sort in same item ret_sorted.push(ret[keys[i]]); } ret_sorted.sort(_sortItemByMatchLevel); // sort by match level return { result: ret_sorted, names: item_names }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function merge(item1, item2, item3) {\n var result = Object.create(null);\n var items = [item1, item2, item3];\n for (var i = 0; i < 3; i++) {\n var item = items[i];\n if (typeof item === 'object' && item) {\n for (var key in item) {\n result[key] = item[key];\n }\n }\n }\n return result;\n}", "async mergeExistingItems(html, items) {\n if (this.actorOriginal.flags.ddbimporter) {\n const ownedItems = this.actor.getEmbeddedCollection(\"Item\");\n\n let nonMatchedItems = [];\n let matchedItems = [];\n\n await items.forEach((item) => {\n let matchedItem = ownedItems.find(\n (owned) =>\n item.name === owned.data.name &&\n item.type === owned.data.type &&\n item.flags?.ddbimporter?.id === owned.data.flags?.ddbimporter?.id\n );\n if (matchedItem) {\n if (!matchedItem.data.flags.ddbimporter?.ignoreItemImport) {\n item[\"_id\"] = matchedItem[\"id\"];\n if (matchedItem.data.flags.ddbimporter?.ignoreIcon) {\n item.flags.ddbimporter.matchedImg = matchedItem.data.img;\n item.flags.ddbimporter.ignoreIcon = true;\n }\n if (matchedItem.data.flags.ddbimporter?.retainResourceConsumption) {\n item.data.consume = matchedItem.data.data.consume;\n item.flags.ddbimporter.retainResourceConsumption = true;\n }\n\n matchedItems.push(item);\n }\n } else {\n nonMatchedItems.push(item);\n }\n });\n\n logger.debug(\"Finished retaining items\");\n return nonMatchedItems.concat(matchedItems);\n } else {\n return items;\n }\n }", "function mergeItems(group, mergeSchemas, items) {\n const allKeys = allUniqueKeys(items)\n return allKeys.reduce(function(all, key) {\n const schemas = getItemSchemas(group, key)\n const compacted = uniqWith(schemas.filter(notUndefined), compare)\n all[key] = mergeSchemas(compacted, key)\n return all\n }, [])\n}", "function inject_data(items, item_data) {\n items.forEach(item=>{for (let key in item_data[item.id]) item[key] = item_data[item.id][key];});\n }", "function _combineItems(catA, catB) {\n\tvar result = [];\n\n\tfor (var i = 0; i < catA.items.length; i++) {\n\t\tvar item = catA.items[i];\n\t\titem.category = catA.category;\n\t\tresult.push(item);\n\t}\n\n\tfor (var i = 0; i < catB.items.length; i++) {\n\t\tvar item = catB.items[i];\n\t\titem.category = catB.category;\n\t\tresult.push(item);\n\t}\n\n\treturn result;\n}", "function formatData(items) {\n\n const tempItem = items.map((item) => {\n\n const id = item.sys.id;\n\n const images = item.fields.images.map((image) => { return image.fields.file.url });\n\n const room = { ...item.fields, images, id };\n\n return room;\n\n });\n\n return tempItem;\n\n }", "static addUniqueItems(res, items, insert_first){\n\t\tif (insert_first == undefined) insert_first=false;\n\t\tif (items == null){\n\t\t\treturn res;\n\t\t}\n\t\tvar r = new Vector();\n\t\tfor (var i = 0; i < items.count(); i++){\n\t\t\tvar item_name = items.item(i);\n\t\t\tif (res.indexOf(item_name) == -1){\n\t\t\t\tif (insert_first){\n\t\t\t\t\tr.unshift(item_name);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr.push(item_name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn res.appendCollectionIm(r);\n\t}", "function merge_data(data, prev_data) {\n var res = [];\n for (var i = 0; i < data.length; i++) {\n res.push({\n genre: data[i][\"genre\"],\n value: [prev_data[i][\"value\"], data[i][\"value\"]],\n });\n }\n return res;\n}", "addItems(items) {\n this.items = this.items.concat(items);\n return this.items;\n }", "formatData(items) {\n let tempItems = items.map((item) => {\n let id = item.sys.id;\n let images = item.fields.images.map((image) => image.fields.file.url); // Iteramos cada Image destructurando\n //\n // Queremos guardar todo en ROOM.\n // 1- Creamos un object que contenga TODO(item.fields)\n // 2- images del object sea igual a mi images mapeado\n let room = { ...item.fields, images, id };\n return room;\n });\n return tempItems;\n }", "collate(targetData, itemProp, targetProp) {\n let results = [];\n this.items.forEach(item => {\n let match = targetData.find(d => d[targetProp] === item[itemProp]);\n if (match !== undefined) {\n results.push({ ...match, ...item });\n }\n });\n return results;\n }", "concat(...items) {\n for (let a of items)\n if (a)\n for (let e of a)\n this.push(e);\n return this;\n }", "function produceToItems(items) { // toItemsDict. TODO depreciate because produce items are on items sheet\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var ps = ss.getSheetByName('Produce');\n var pr = ps.getRange(\"A3:D\").getDisplayValues();\n for (var i in pr) {\n var item = pr[i];\n if (item[0].length === 0)\n break;\n items[item[0].toUpperCase()] = {\n \"Name\": item[0].toUpperCase(),\n \"Vendor\":item[2],\n \"Price\": item[3],\n \"Order Guide\":\"Produce\",\n \"Pack Size\": \"\",\n \"Item ID\": \"\"\n };\n }\n return items;\n}", "function combine(item1, item2){\n if (!item1 || !item2){return false;}\n var type1 = loader.res.items[item1.type];\n var type2 = loader.res.items[item2.type];\n if (type1 && type2 && type1.on && type2.actions){\n for (var k in type1.on){\n var fun = type1.on[k];\n if (type2.actions.includes(k)){\n fun.call(item1, item2);\n }\n }\n }\n}", "function combineFruit(fruit, sweets, vegetables) {\n\treturn {\n\t\tfruits: [...fruit],\n\t\tsweets: [...sweets],\n\t\tvegetables: [...vegetables],\n\t};\n}", "function requestData() {\n let product = [];\n $(\"#byLists td\").remove();\n $(\"#itemsLists td\").remove();\n data.buyList.map((value) => {\n let raw = \"\";\n raw = `\n <tr>\n <td>${value.totalPrice}</td>\n <td>${value.totalPayPrice}</td>\n <td>${value.deliveryFees}</td>\n <td>${value.farmName}</td>\n </tr>\n `;\n $(\"#byLists\").append(raw);\n value.productList.map((values) => {\n product.push({\n name: values.productName,\n quantity: values.productQuantity,\n price: values.productPrice,\n perPrice: values.totalPayPrice,\n });\n });\n });\n\n let seen = {};\n // filter and merge the duplicate product\n product = product.filter(function (entry) {\n let previous;\n // Have we seen this label before?\n if (seen.hasOwnProperty(entry.name)) {\n // Yes, grab it and add this data to it\n previous = seen[entry.name];\n previous.quantity.push(entry.quantity);\n previous.price.push(entry.price);\n previous.perPrice.push(entry.perPrice);\n // Don't keep this entry, we've merged it into the previous one\n return false;\n }\n // entry.data probably isn't an array; make it one for consistency\n if (!Array.isArray(entry.quantity)) {\n entry.quantity = [entry.quantity];\n }\n if (!Array.isArray(entry.price)) {\n entry.price = [entry.price];\n }\n if (!Array.isArray(entry.perPrice)) {\n entry.perPrice = [entry.perPrice];\n }\n // Remember that we've seen it\n seen[entry.name] = entry;\n // Keep this one, we'll merge any others that match into it\n return true;\n });\n\n // loop over the product => item\n product.forEach((val) => {\n let rows = \"\";\n if (val.perPrice.length > 1) {\n // if item contain array then merging them and calculating avarage\n // else append the item as it is!\n\n let totalPrice = val.perPrice.reduce((acc, cu) => {\n return acc + cu;\n });\n let totalQuantity = val.quantity.reduce((acc, cu) => {\n return acc + cu;\n });\n let payPerPrice = val.price.reduce((acc, cu) => {\n return acc + cu;\n });\n raws = `\n <tr>\n <td>${totalQuantity}</td>\n <td>${totalPrice}</td>\n <td>${totalPrice/totalQuantity}</td>\n <td>${val.name}</td>\n </tr>\n `;\n } else {\n raws = `\n <tr>\n <td>${val.quantity}</td>\n <td>${val.perPrice}</td>\n <td>${val.price}</td>\n <td>${val.name}</td>\n </tr>\n `;\n }\n $(\"#itemsLists\").append(raws);\n });\n}", "function dataMerge(target,additional)\n{\n for(var add in additional) {\n\tif(target.hasOwnProperty(add)) {\n\t target[add].push(additional[add]);\n\t} else {\n\t target[add] = [additional[add]];\n\t}\n }\n\n return(target);\n}", "function buildArray(result, item) {\n result.push(item)\n return result\n}", "function combineFruit(fruit, sweets, vegetables){\n return {\n fruit,\n sweets,\n vegetables\n }\n}", "getProductItems(data) {\n const items = [];\n for (let i = 0; i < data.products.length; i += 1) {\n const p = data.products[i];\n items.push({ id: p.aonr, price: p.priceData.total, quantity: p.quantity });\n }\n return items;\n }", "function processResults (results, items, cb) {\n\n if (!items) return cb(null, results)\n\n var resultIds = results.map(function (item) { return item._id })\n\n async.mapSeries(items, function (item, cb) {\n\n if (item.isCustom) return cb(null)\n\n // if an overridden item, need to check if its live and if so, get all of the other data for this article\n if (item.overrides && Object.keys(item.overrides).length) {\n // Only get extra article data if its actually needed (i.e the article is live)\n if (!isVisible(item.overrides, options.date)) return cb(null)\n return crudService.read(item.itemId, cb)\n }\n\n // if not a custom item or an overidden item, just add to the list of results\n var index = resultIds.indexOf(item.itemId)\n if (index !== -1) return cb(null, results[index])\n cb(null)\n\n }\n , function (err, results) {\n if (err) return cb(err)\n cb(null, results.filter(function (item) { return !!item }))\n })\n }", "function getArray1(items) {\n return new Array().concat(items);\n}", "function mergeSort(items){\n\t\tif (items.length < 2) {\n\t\t\treturn items;\n\t\t}\n\n\t\tvar middle = Math.floor(items.length / 2),\n\t\t\tleft = items.slice(0, middle),\n\t\t\tright = items.slice(middle);\n\n\t\treturn merge(mergeSort(left), mergeSort(right));\n\t}", "concatArray(arr1, arr2, itemid) {\n if (arr1.length == 0) {\n return arr2;\n }\n\n if (arr2.length == 0)\n return arr1;\n\n if (!itemid)\n itemid = \"id\";\n let newArray = arr1;\n for (let i = 0; i < arr2.length; i++) {\n let arr2T = arr2[i], bFound = false;\n for (let n = 0; n < arr1.length; n++) {\n if (arr1[n][itemid] == arr2T[itemid]) {\n bFound = true;\n break;\n }\n }\n if (!bFound)\n newArray.push(arr2T);\n }\n\n return newArray;\n }", "function combineFruit(fruit, sweets, vegetables){\n return {...fruit,...sweets,...vegetables}\n}", "function getData(data){\r\n//Creates a variable oID which stores all of the relevent IDs of the items that I will use in the program\r\n var oID = [554,555,556,557,558,559,560,561,562,563,564,449,436,444,440,447,442,438];\r\n//A for-next loop that populates all of the values in the arrays with the relevent data, based on the ID of the item (stored in oID)\r\n for (var i = 0; i< 18;i++){\r\n itemID[i] = oID[i];\r\n itemName[i] = data[itemID[i]].name;\r\n itemPrice[i] = data[itemID[i]].buy_average;\r\n itemQuantity[i] = data[itemID[i]].overall_quantity;\r\n\r\n }\r\n }", "function getItemsAll(items) {\n return items.reduce((allItems, item) => {\n // let res = allItems.concat([item])\n\n if (item.items && item.items.length) {\n return allItems.concat([item], getItemsAll(item.items))\n } else {\n return allItems.concat([item])\n }\n }, [])\n}", "function getItems(...items) {\n const el = [];\n for (let i of items) {\n for (let j of data) {\n if (i == j.title) el.push(j);\n }\n }\n return el;\n}", "function merge(a, b) {\n\n var i;\n var j;\n var k=0;\n var c = [];\n\nfor (i=0; i<a.length; i++) {\n\n c[k]=a[i];\n k++;\n}\n\nfor (j=0; j<b.length; j++) {\n\n c[k]=b[j];\n k++;\n}\n\n\n return c;\n\n}", "mergeSynced(items, subkey) {\n return frago.merge(items, subkey, this.decode)\n }", "function mergeData(currentData) {\n for (var _len = arguments.length, inputs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n inputs[_key - 1] = arguments[_key];\n }\n\n if ('merge' in currentData) {\n return currentData.merge(inputs);\n }\n return _assign2.default.apply(undefined, [{}, currentData].concat(inputs));\n}", "function combineItem(item, i) {\n if (item.flipped) {\n // lquaternion = item.joints.right.quaternion;\n left = item.joints.right;\n right = item.joints.left;\n } else {\n // lquaternion = item.joints.left.oquaternion;\n left = item.joints.left;\n right = item.joints.right;\n }\n if (i > 0) {\n //\n item.group.setRotationFromQuaternion(quaternionR);\n item.group.position.copy(positionR);\n //\n // positionL = left.position.clone();\n // item.model.localToWorld(positionL);\n // \n if (false) {\n left.getWorldPosition(positionL);\n item.group.worldToLocal(positionL);\n item.group.position.sub(positionL);\n }\n //\n // console.log('left.position', positionL);\n // item.group.position.set(0, 0, 0);\n // left.getWorldQuaternion(quaternionL);\n /*\n positionR.sub(groupPosition);\n item.group.position.copy(positionR);\n // item.group.setRotationFromQuaternion(quaternionR.multiply(lquaternion));\n item.group.setRotationFromQuaternion(quaternionR);\n */\n }\n //} else {\n // item.group.rotation.z = rad(30);\n //}\n // console.log(left.origin);\n // right.updateMatrixWorld();\n right.getWorldQuaternion(quaternionR);\n right.getWorldPosition(positionR);\n }", "function mergeResults(){\n let previousResults = checkResults();\n if(previousResults){\n for(let currentProduct of Product.allProducts){\n for(let previousProduct of previousResults){\n if(currentProduct.name === previousProduct.name){\n currentProduct.shows += previousProduct.shows;\n currentProduct.clicked += previousProduct.clicked;\n }\n }\n }\n localStorage.removeItem('results');\n }\n\n}", "function appendAllTo(array, items) {\n return array.push.apply(array, items), array;\n }", "function appendAllTo(array, items) {\n return array.push.apply(array, items), array;\n }", "function appendAllTo(array, items) {\n\t return array.push.apply(array, items), array;\n\t }", "merge(existing, incoming, { args: { offset = 0 } }) {\n // Slicing is necessary because the existing data is\n // immutable, and frozen in development.\n const merged = existing ? existing.slice(0) : [];\n for (let i = 0; i < incoming.length; ++i) {\n merged[offset + i] = incoming[i];\n }\n return merged;\n }", "function packageResult(models) {\n var result = {};\n ids.forEach(function (id, index) {\n result[id] = models[index];\n });\n return result;\n }", "mergedResult(books, shelvedBooks) {\n return books.map(book => shelvedBooks.find(s => s.id === book.id) || book)\n }", "function mergeArray (arr1, arr2) {\nvar input1 = arr1\nvar input2 = arr2\n\nvar input1Last = input1.slice(-1)\n\nvar combine = input1Last.concat(input2)\n\nreturn(combine)\n}", "function makeResultItem(resultItem/*:Object*/)/*:BulkOperationResultItem*/ {\n return new com.coremedia.cap.content.results.impl.BulkOperationResultItemImpl(resultItem['category'], resultItem['content'], resultItem['impediment']);\n }", "function getItems (array) {\n let data = [];\n console.log(\"=======================\")\n for(i=0; i < array.length; i++){\n data.push(array[i].item_name)\n console.log(i + \" - \" + array[i].item_name);\n };\n // console.log(data);\n return data;\n}", "function allItems(){\n for(let i = 1; i <= 20; i++) {\n const ing = `strIngredient${i}`;\n const mes = `strMeasure${i}`;\n \n const ingredient = data.meals[0][ing];\n const measure = data.meals[0][mes];\n const itemArray = [measure + \" \" + ingredient];\n \n if(ingredient === \"\") {\n break;\n }\n \n return itemArray;\n } \n }", "function itemCombine(itemOne, itemTwo, combinedItem) {\r\n removeOneItem(itemOne);\r\n removeOneItem(itemTwo);\r\n addNewItem(combinedItem);\r\n $(\".big-text\").hide().html(\"You fiddle around for a while and you combine \" + itemOne + \" and \" + itemTwo + \" into \" + combinedItem).fadeIn(800);\r\n submitButton.disabled = false;\r\n submittedText.value = '';\r\n}", "merge(existing, incoming, { args, field }) {\n console.log(\"\\n\\nMERGE incoming = \", incoming);\n console.log(\"MERGE existing = \", existing);\n\n const { skip, first } = args;\n console.log(\"merging items from network...\");\n // 9. Take a copy of the existing array, or make a new empty one\n const merged = existing ? existing.slice(0) : [];\n // 10. Insert the items into our array at the spot which they belong.\n // we do it this way because someone might visit page 2 first, so we need to pad blank spots in the array\n for (let i = skip; i < skip + incoming.length; ++i) {\n merged[i] = incoming[i - skip];\n }\n // 11. finally we are done, return the merged array, which will then call read() once more. But this item we have items, so read() will be able to serve them up from the cache\n return merged;\n }", "function addToCurrentList(items){\n const ss = getSpreadSheet(LIST_SHEET);\n const lastRow = ss.getLastRow() + 1; \n const prices = getMealsPrices();\n const currentList = getCurrentList();\n\n // paste all the values in the end of a list\n for(var name in items){\n if (name in currentList || name === SELECT_FILE || items[name].length <= 0) continue;\n if (name === OTHER ) name = items[name];\n var listRange = ss.getRange(lastRow, 1, 1, 3);\n listRange.getCell(1, 1).setValue(name);\n var price = prices[name] ? prices[name] : 0;\n listRange.getCell(1, 3).setValue(price);\n lastRow ++;\n }\n}", "function areaCombineS( data1, data2, key, combine )\n{\n\tvar newData = [];\n\n\tfor( var x in data1 )\n\t\tnewData.push( [ data1[x][key], data1[x][combine], data2[x][combine] ] );\n\t\t\n\treturn newData;\n}", "function addAllToArray(items,arr){for(var i=0;i<items.length;i++){arr.push(items[i]);}}", "mergeTogether(idx) {\n\t\tthis.remove(idx);\n\t\tlet arr;\n\t\tif (typeof idx === 'number') {\n\t\t\tarr = this.matchedItems[idx];\n\t\t}\n\t\telse if (Array.isArray(idx)) {\n\t\t\tarr = idx.filter(x=>x instanceof LedgerItem);\n\t\t}\n\t\telse throw new TypeError('Invalid argument!');\n\t\tif (!arr) return this;\n\t\t\n\t\tlet out = [];\n\t\twhile (arr.length) {\n\t\t\tout = Ledger.mergeItems([arr.pop()], out);\n\t\t}\n\t\tout.forEach(x=>this.add(x));\n\t\treturn this;\n\t}", "function combineArr() {\n let concatArr = [];\n for (item of arguments) {\n console.log(item)\n concatArr = concatArr.concat(item);\n }\n\n console.log(concatArr)\n}", "function getArray(items) {\n return new Array().concat(items);\n}", "function getArray(items) {\n return new Array().concat(items);\n}", "function getArray(items) {\n return new Array().concat(items);\n}", "combine(arr1, arr2) {\n return arr1.concat(arr2);\n }", "function updateInventory(arr1, arr2) {\n // All inventory must be accounted for or you're fired!\n // function to updated existing items and merge on new items\n const updatedInv = updateProducts(arr1, arr2);\n // function to alphabetize inventory by product name -- BROKENNNN!\n const sortedInv = sortProducts(updatedInv);\n\n return sortedInv;\n}", "function combineData(data){\n\n // if data has name field (issues api data does not), add as main data array object\n if (data.name){\n if (data.name == 'angular.js'){\n allData[0] = data;\n } else if ( data.name == 'react'){\n allData[1] = data;\n } else if ( data.name == 'ember.js'){\n allData[2] = data;\n } else if ( data.name == 'vue'){\n allData[3] = data;\n }\n }\n // IF DATA IS AN ARRAY THAT MEANS IT IS FROM THE ISSUES API\n // so add it accordingly onto the existing main data\n else if ( Array.isArray(data) ){\n console.log('hello, ready to add issues data...');\n console.log(data[0].number); // 15122\n\n // EACH CONDITIONAL ADDS NEW DATA TO ALLDATA\n if (data[0].repository_url == angularURL){\n allData[0].total_issues = data[0].number;\n } else if (data[0].repository_url == reactURL){\n allData[1].total_issues = data[0].number;\n console.log('allData 1 issues:' + allData[1].total_issues);\n } else if (data[0].repository_url == emberURL){\n allData[2].total_issues = data[0].number;\n console.log('allData 2 issues:' + allData[2].total_issues);\n } else if (data[0].repository_url == vueURL){\n allData[3].total_issues = data[0].number;\n console.log('allData 3 issues:' + allData[3].total_issues);\n }\n\n // CALL HELPER TO RUN CALCULATIONS AND ADD NEW PROPERTIES TO ALLDATA\n calculateClosedPercentage(allData);\n }\n\n console.log('here is allData, should have issues_closed_percentage:');\n console.log(allData);\n\n}", "function updateItemsList(items, allresult){\n // get oids only if doc saved succesfully\n return new Promise(function(resolve, reject) {\n try{\n // var oidArray = getIds(allresult, 'oid');\n var i, j;\n if(items.length > 0){\n var itemsOid = []; //store a simple array of OIDs to compare\n for(i = 0; i < items.length; i++){\n itemsOid.push(items[i].oid);\n }\n for(j = 0; j < allresult.length; j++){\n if(itemsOid.indexOf(allresult[j].data.oid) === -1 && allresult[j].result === \"Success\"){\n items.push({id: allresult[j].data[\"nm-id\"], extid: allresult[j].data.oid});\n }\n }\n } else {\n for(j = 0; j < allresult.length; j++){\n if(allresult[j].result === \"Success\"){\n items.push({id: allresult[j].data[\"nm-id\"], extid: allresult[j].data.oid});\n }\n }\n }\n resolve(items);\n } catch(err){\n reject(\"(collecting new oids for the node) \" + err);\n }\n });\n}", "function combine_lists(code, description, list1, list2){\n x = [];\n for (i = 0; i < list1.length; i++) {\n \n x.push(code, \"?\", description, \"?\", list1[i], \"?\", list2[i], \"\\n\");\n }\n return(x);\n}", "function addItemsByName(c){\n c.itemsByName = {};\n c.items.forEach(function(item){\n c.itemsByName[item.name] = item;\n });\n}", "async function combineFullMovieInfo(moviesList) {\n const moviesFullInfo = await moviesList;\n const genres_info = await getGenresInfo(moviesList);\n const fullInfo = await moviesFullInfo.map((movie, ind) => {\n movie['genres_name'] = genres_info[ind];\n return movie;\n });\n return fullInfo;\n}", "function populateLists(data) {\n\n var objId = 0, name = {}, attributes = {}, item = {};\n\n\n // read csv data into array of arrays\n var csv_data = CSVToArray(data['csv']);\n\n // convert from array of arrays into array of objects\n var extractedItems = arrOfArrsToArrOfObjects(csv_data);\n\n // for each item, save the attributes into a ListItem object\n for (var csvi = 0; csvi < extractedItems.length; csvi++) {\n var obj = extractedItems[csvi];\n objId = parseInt(obj[CSVC.ID][0]);\n\n attributes = {};\n\n // first grab other data if present: our JSON description has priority\n if (data.other_data && data.other_data.hasOwnProperty(objId)) {\n // add information for each optional attribute\n for (var key in data.other_data[objId]) {\n attributes[key] = data.other_data[objId][key];\n }\n }\n\n\n name = {\n recorded: attributes[visible.ATTR_FULLDATA] && attributes[visible.ATTR_FULLDATA].intendedMedication && attributes[visible.ATTR_FULLDATA].intendedMedication.medicationDescription ? attributes[visible.ATTR_FULLDATA].intendedMedication.medicationDescription : obj[CSVC.R_NAME][0],\n generic: attributes[visible.ATTR_FULLDATA] && attributes[visible.ATTR_FULLDATA].intendedMedication && attributes[visible.ATTR_FULLDATA].intendedMedication.medicationDescription ? attributes[visible.ATTR_FULLDATA].intendedMedication.medicationDescription : obj[CSVC.G_NAME][0],\n brand: attributes[visible.ATTR_FULLDATA] && attributes[visible.ATTR_FULLDATA].intendedMedication && attributes[visible.ATTR_FULLDATA].intendedMedication.medicationDescription ? attributes[visible.ATTR_FULLDATA].intendedMedication.medicationDescription : obj[CSVC.B_NAME][0]\n };\n\n attributes[visible.ATTR_DOSE] = obj[CSVC.DOSE];\n attributes[visible.ATTR_ROUTE] = attributes[visible.ATTR_FULLDATA] && attributes[visible.ATTR_FULLDATA].drugRoute ? [attributes[visible.ATTR_FULLDATA].drugRoute] : obj[CSVC.ROUTE];\n attributes[visible.ATTR_FREQUENCY] = attributes[visible.ATTR_FULLDATA] && attributes[visible.ATTR_FULLDATA].periodicity ? [attributes[visible.ATTR_FULLDATA].periodicity] : obj[CSVC.FREQUENCY];\n attributes[visible.ATTR_DRUG_CLASS] = obj[CSVC.DRUG_CLASSES];\n attributes[visible.ATTR_DIAGNOSES] = obj[CSVC.DIAGNOSES];\n attributes[visible.ATTR_INSTRUCTIONS] = attributes[visible.ATTR_FULLDATA] && attributes[visible.ATTR_FULLDATA].instructionsForPatient ? attributes[visible.ATTR_FULLDATA].instructionsForPatient : (obj[CSVC.INSTRUCTIONS] ? obj[CSVC.INSTRUCTIONS] : []);\n attributes[visible.ATTR_VALIDATOR] = obj[CSVC.VALIDATOR];\n attributes[visible.ATTR_ORG] = obj[CSVC.ORGANISATION];\n\n\n item = new ListItem(objId, obj[CSVC.ORIGIN][0], name, attributes);\n\n if (item.listID == visible.list1.id) {\n visible.list1.source.push(item.id);\n } else {\n visible.list2.source.push(item.id);\n }\n visible.items[item.id] = item;\n }\n\n visible.undecided = visible.list1.source.concat(visible.list2.source);\n visible.nextID = objId + 1; // indicate next id to use if adding new items\n }", "function pasteList(items) {\n Logger.log(\"items = \" + JSON.stringify(items))\n var itemsLength = Object.keys(items).length; \n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getActiveSheet();\n\n var range = sheet.getRange(1,1,itemsLength+1,2);\n var data = range.getValues();\n \n for (var row in data) {\n if (row == 0) {\n data[row][0] = \"Quantity\";\n data[row][1] = \"Barcode\";\n }\n if (items['row'+row]) {\n var item = items['row'+row];\n var adjustedRow = Number(row) + 1;\n \n data[adjustedRow][0] = item.qty;\n data[adjustedRow][1] = item.name;\n }\n }\n\n range.setValues(data);\n}", "mergeProducts() {\n const { productIndex, product } = this.state\n const products = this.props.allProducts\n products[productIndex] = product\n\n return products\n }", "function merge(clone, recursive, argv) {\r\n\t\r\n\t\t\tvar result = argv[0],\r\n\t\t\t\tsize = argv.length;\r\n\t\r\n\t\t\tif (clone || typeOf(result) !== 'object')\r\n\t\r\n\t\t\t\tresult = {};\r\n\t\r\n\t\t\tfor (var index=0;index<size;++index) {\r\n\t\r\n\t\t\t\tvar item = argv[index],\r\n\t\r\n\t\t\t\t\ttype = typeOf(item);\r\n\t\r\n\t\t\t\tif (type !== 'object') continue;\r\n\t\r\n\t\t\t\tfor (var key in item) {\r\n\t\r\n\t\t\t\t\tvar sitem = clone ? Public.clone(item[key]) : item[key];\r\n\t\r\n\t\t\t\t\tif (recursive) {\r\n\t\r\n\t\t\t\t\t\tresult[key] = merge_recursive(result[key], sitem);\r\n\t\r\n\t\t\t\t\t} else {\r\n\t\r\n\t\t\t\t\t\tresult[key] = sitem;\r\n\t\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t}\r\n\t\r\n\t\t\t}\r\n\t\r\n\t\t\treturn result;\r\n\t\r\n\t\t}", "function fromItems(items) {\n\t var obj = {}\n\t for (var i = 0, l = items.length, item; i < l; i++) {\n\t item = items[i]\n\t obj[item[0]] = item[1]\n\t }\n\t return obj\n\t}", "function mergingElements(array1, array2) {\n let result = [];\n for (let i = 0; i < array1.length; i++) {\n for (let j = 0; j < array2.length; j++) {\n result.push(array1[j] + array2[j])\n }\n return result;\n }\n\n}", "function areaCombine( data1, data2, key, combine )\n{\n\tvar newData = { \"data\":[], \"err\":[] };\n\t\n\tfor( var d in data1[\"data\"] )\n\t\tnewData[\"data\"].push( areaCombineS( data1[\"data\"][d], data2[\"data\"][d], key, combine ) );\n\t\t\n\tfor( var e in data1[\"err\"] )\n\t\tnewData[\"err\"].push( areaCombineS( data1[\"err\"][e], data2[\"err\"][e], key, combine ) );\n\t\t\n\treturn newData;\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 flattenProducts(data) {\n return data.map(item => {\n let image = item.image.url;\n return {...item,image};\n })\n }", "function combineInfo(customerData, cartData) {\n var finalForm = {};\n var idx;\n\n finalForm.name = customerData.name;\n finalForm.address1 = customerData.address1;\n if (customerData.address2)\n finalForm.address2 = customerData.address2;\n finalForm.zip = customerData.zip;\n finalForm.phone = customerData.phone;\n finalForm.nextUrl = 'http://students.washington.edu/brettyam/info343/Homework-4.0/';\n finalForm.items = [];\n for (idx = 0; idx < cartData.length; ++idx) {\n var item = cartData[idx];\n if (item.type == 'pizza') {\n finalForm.items.push({\n 'type': 'pizza',\n 'name': item.itemName,\n 'size': item.size\n });\n } else {\n finalForm.items.push({\n 'type': item.type,\n 'name': item.itemName,\n });\n }\n }\n return finalForm;\n}", "_buildDataMap(items) {\n const map = [];\n for (let i = 0; i < items.length; i++) {\n map.push({ key: i, value: items[i] });\n }\n return new wjcGrid.DataMap(map, 'key', 'value');\n }", "function joinTwoArrays(a, b){\n\tvar joinedArray = a.reduce(function(growingArray, itemA){\n\t\t\tgrowingArray.push(itemA);\n\t\t\treturn growingArray;\n\t\t}, b)\n\n}", "getItem(...selects) {\r\n const q = this.listItemAllFields;\r\n return q.select.apply(q, selects).get().then((d) => {\r\n return extend(new Item(odataUrlFrom(d)), d);\r\n });\r\n }", "function genItems(){\n for (var i = 0; i < allItems.length; i++){\n var newItem = new Item(allItems[i]);\n items.push(newItem);\n }\n}", "updateOffers(items){\n for (let x = 0; x < this.props.offers.length; x++) {\n for (let y = 0; y < items.length; y++) {\n if (this.props.offers[x].companyID === this.props.company.id &&\n this.props.offers[x].offerID === items[y].offerID) {\n items[y].available = this.props.offers[x].available;\n items[y].price = this.props.offers[x].price;\n }\n }\n }\n return items;\n }", "cloneData(data) {\n const results = [];\n for (const item of data) {\n const copy = {\n name: item['name']\n };\n if (item['value'] !== undefined) {\n copy['value'] = item['value'];\n }\n if (item['series'] !== undefined) {\n copy['series'] = [];\n for (const seriesItem of item['series']) {\n const seriesItemCopy = Object.assign({}, seriesItem);\n copy['series'].push(seriesItemCopy);\n }\n }\n if (item['extra'] !== undefined) {\n copy['extra'] = JSON.parse(JSON.stringify(item['extra']));\n }\n results.push(copy);\n }\n return results;\n }", "cloneData(data) {\n const results = [];\n for (const item of data) {\n const copy = {\n name: item['name']\n };\n if (item['value'] !== undefined) {\n copy['value'] = item['value'];\n }\n if (item['series'] !== undefined) {\n copy['series'] = [];\n for (const seriesItem of item['series']) {\n const seriesItemCopy = Object.assign({}, seriesItem);\n copy['series'].push(seriesItemCopy);\n }\n }\n if (item['extra'] !== undefined) {\n copy['extra'] = JSON.parse(JSON.stringify(item['extra']));\n }\n results.push(copy);\n }\n return results;\n }", "function updateInventory(arr1, arr2) {\n // All inventory must be accounted for or you're fired!\n var j;\n var curItem = [];\n var newItem = [];\n \n //push the names of the current inventory item into a new array\n for (var i = 0; i < arr1.length; i++){\n curItem.push(arr1[i][1]);\n }\n //push the names of the new inventory items into a new array\n for ( i = 0; i < arr2.length; i++){\n newItem.push(arr2[i][1]);\n }\n \n //update the quantity of existing items in the curInv\n for ( i = 0; i < arr1.length; i++){ \n for (j = 0; j < arr2.length; j++){\n if(arr2[j][1].indexOf(arr1[i][1]) > -1){\n arr1[i][0] = arr1[i][0] + arr2[j][0];\n } \n }\n }\n \n //push new items into curInv\n newItem.map(function(item){\n if (curItem.indexOf(item) == -1){\n var index = newItem.indexOf(item);\n arr1.push(arr2[index]);\n }\n });\n \n //sort the array alphabetically\n arr1.sort(function(currentItem, nextItem){\n return currentItem[1] > nextItem[1] ? 1 : -1;\n });\n \n return arr1;\n}", "function uniteCategoriesData(itemData){\n\n let prev_id = 0 // ids start at 1\n let data = []\n\n for (let i = 0; i < itemData.length; i++) {\n let cur_id = itemData[i].id\n\n if (prev_id === cur_id) data[data.length - 1].categories.push(itemData[i].categories[0])\n\n else{\n data.push(itemData[i])\n prev_id = cur_id\n }\n }\n return data\n}", "function finalMerge(){\n var merged = [];\n var friend_list = $('.merge-list li');\n $(friend_list).each(function( i, li ){\n var span = $(li).children();\n var data = $(span).data();\n if ( data.hasOwnProperty('merged') ) {\n var mainFriend = $(Friendly.friends).filter(function( i ) {\n return this.friendNumber == data.merged[0].friendNumber;\n })[0];\n \n $(data.merged).each(function(i,obj){\n if ( obj.friendNumber != mainFriend.friendNumber ){\n mainFriend.category.push(obj.catId);\n $(Friendly.friends).each(function(a,b){\n if (b.friendNumber == obj.friendNumber) {\n Friendly.friends.splice(a,1);\n }\n });\n }\n });\n }\n });\n }", "merge (menu, item) {\n return MenuHelpers.merge(menu, item)\n }", "function merge (left, right) {\r\n let result = [];\r\n let indexLeft = 0;\r\n let indexRight = 0;\r\n\r\n while (indexLeft < left.length && indexRight < right.length) {\r\n if (left[indexLeft].name < right[indexRight].name) {\r\n result.push(left[indexLeft]);\r\n indexLeft++;\r\n } else {\r\n result.push(right[indexRight]);\r\n indexRight++;\r\n }\r\n }\r\n return result.concat(left.slice(indexLeft)).concat(right.slice(indexRight));\r\n }", "function splitItemsRespond(res, user){\n splitItemsArrs = splitExpr(user.items);\n exprItems = splitItemsArrs[0];\n goodItems = splitItemsArrs[1];\n return res.json({goodItems, exprItems, success: true});\n}", "function mergeResults(results1, results2) {\n return _mergeResults(results1, results2, true).concat(_mergeResults(results2, results1, false));\n}", "function reduceAndConcatenateZclEntity(\n db,\n id,\n packageIdArray,\n zclQueryCallback,\n mergeFunction = (accumulated, currentValue) => {\n return [accumulated, currentValue].flat(1)\n },\n defaultValue = []\n) {\n let dataArray = packageIdArray.map((packageId) =>\n zclQueryCallback(db, id, packageId)\n )\n return Promise.all(dataArray).then((x) =>\n x.reduce(mergeFunction, defaultValue)\n )\n}", "processItems() {}", "function mergeArray([...array]){\n let mereg = [];\n for(let i of array){\n for(let x of i){\n mereg.push(x);\n }\n }\n console.log(array);\n console.log(mereg);\n \n return array\n}", "function arrCombine (arr1, arr2){\n var newArr= arr1.concat(arr2);\n return newArr;\n}", "function generateItemNames() {\n for (let item of itemList) {\n itemNames.push(item.name);\n }\n}", "_prepareItems(data) {\n\n // Categorize Items as Features and Spells\n const features = {\n weapons: { label: game.i18n.localize(\"DND5E.AttackPl\"), items: [] , hasActions: true, dataset: {type: \"weapon\", \"weapon-type\": \"natural\"} },\n actions: { label: game.i18n.localize(\"DND5E.ActionPl\"), items: [] , hasActions: true, dataset: {type: \"feat\", \"activation.type\": \"action\"} },\n passive: { label: game.i18n.localize(\"DND5E.Features\"), items: [], dataset: {type: \"feat\"} },\n equipment: { label: game.i18n.localize(\"DND5E.Inventory\"), items: [], dataset: {type: \"loot\"}}\n };\n\n // Start by classifying items into groups for rendering\n let [spells, other] = data.items.reduce((arr, item) => {\n item.img = item.img || CONST.DEFAULT_TOKEN;\n item.isStack = Number.isNumeric(item.data.quantity) && (item.data.quantity !== 1);\n item.hasUses = item.data.uses && (item.data.uses.max > 0);\n item.isOnCooldown = item.data.recharge && !!item.data.recharge.value && (item.data.recharge.charged === false);\n item.isDepleted = item.isOnCooldown && (item.data.uses.per && (item.data.uses.value > 0));\n item.hasTarget = !!item.data.target && !([\"none\",\"\"].includes(item.data.target.type));\n if ( item.type === \"spell\" ) arr[0].push(item);\n else arr[1].push(item);\n return arr;\n }, [[], []]);\n\n // Apply item filters\n spells = this._filterItems(spells, this._filters.spellbook);\n other = this._filterItems(other, this._filters.features);\n\n // Organize Spellbook\n const spellbook = this._prepareSpellbook(data, spells);\n\n // Organize Features\n for ( let item of other ) {\n if ( item.type === \"weapon\" ) features.weapons.items.push(item);\n else if ( item.type === \"feat\" ) {\n if ( item.data.activation.type ) features.actions.items.push(item);\n else features.passive.items.push(item);\n }\n else features.equipment.items.push(item);\n }\n\n // Assign and return\n data.features = Object.values(features);\n data.spellbook = spellbook;\n }", "function results(items) {\n // Iterate through each item object\n items.forEach((item) => {\n\n // Append one table row `tr` to the table body\n var row = tbody.append(\"tr\");\n\n // Iterate through each key and value\n Object.entries(item).forEach(([key, value]) => { \n \n // Use the key to determine which array to push the value to\n if (key === \"datetime\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"city\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"state\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"country\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"shape\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"durationMinutes\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"comments\") {\n row.append(\"td\").text(value);\n }\n });\n });\n}", "function merge(clone, recursive, argv) {\n\n\t\t\tvar result = argv[0],\n\t\t\t\tsize = argv.length;\n\n\t\t\tif (clone || typeOf(result) !== 'object')\n\n\t\t\t\tresult = {};\n\n\t\t\tfor (var index=0;index<size;++index) {\n\n\t\t\t\tvar item = argv[index],\n\n\t\t\t\t\ttype = typeOf(item);\n\n\t\t\t\tif (type !== 'object') continue;\n\n\t\t\t\tfor (var key in item) {\n\n\t\t\t\t\tvar sitem = clone ? Public.clone(item[key]) : item[key];\n\n\t\t\t\t\tif (recursive) {\n\n\t\t\t\t\t\tresult[key] = merge_recursive(result[key], sitem);\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tresult[key] = sitem;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t}", "function merge(clone, recursive, argv) {\n\n\t\t\tvar result = argv[0],\n\t\t\t\tsize = argv.length;\n\n\t\t\tif (clone || typeOf(result) !== 'object')\n\n\t\t\t\tresult = {};\n\n\t\t\tfor (var index=0;index<size;++index) {\n\n\t\t\t\tvar item = argv[index],\n\n\t\t\t\t\ttype = typeOf(item);\n\n\t\t\t\tif (type !== 'object') continue;\n\n\t\t\t\tfor (var key in item) {\n\n\t\t\t\t\tvar sitem = clone ? Public.clone(item[key]) : item[key];\n\n\t\t\t\t\tif (recursive) {\n\n\t\t\t\t\t\tresult[key] = merge_recursive(result[key], sitem);\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tresult[key] = sitem;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t}", "getAllAndMerge(metadataKey, targets) {\n const metadataCollection = this.getAll(metadataKey, targets);\n return metadataCollection.reduce((a, b) => {\n if (Array.isArray(a)) {\n return a.concat(b);\n }\n if (shared_utils_1.isObject(a) && shared_utils_1.isObject(b)) {\n return Object.assign(Object.assign({}, a), b);\n }\n return [a, b];\n });\n }", "allSelectedUniqueItemResources(selectedUniqueItems) {\n let resArray = [];\n for (let catName of Object.keys(selectedUniqueItems)) {\n\t for (let displayStr of Object.keys(selectedUniqueItems[catName])) {\n\t resArray = resArray.concat(selectedUniqueItems[catName][displayStr])\n\t }\n }\n\n return resArray;\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 mergeBlocks() {\n //uses allBlocks[]\n // THis funciton still needs to be implemented if I ever get to it/need it\n}", "getItem(...selects) {\r\n const q = this.listItemAllFields;\r\n return q.select.apply(q, selects).get().then((d) => {\r\n return extend((new Item(odataUrlFrom(d))).configureFrom(this), d);\r\n });\r\n }", "function popMerge() {\n\tvar pops = Array.prototype.slice.call(arguments);\n\tvar res = { population:[], reactions:[] };\n\tfor (var i = pops.length-1;i>=0;i--) {\n\t\tres.population.push(pops[i].population);\n\t\tres.reactions.push(pops[i].reactions);\n\t}\n\treturn res;\n}", "function getss(items, rtype) {\n console.log(\"\\n\\nIN GETSItems:: \", items, \"types: \", rtype);\n return {\n xtype: rtype.map((t) =>\n items.results\n .filter((item) => item._id.type === t)\n .map((item) => [\n item.count,\n item._id.year,\n item._id.month,\n item._id.type,\n ])\n .sort(compareSecondColumn)\n ),\n };\n }" ]
[ "0.6584769", "0.6047336", "0.6045097", "0.5931019", "0.59197944", "0.582042", "0.57650375", "0.5722605", "0.56928474", "0.56814826", "0.5668966", "0.5627736", "0.56030893", "0.55946505", "0.55673265", "0.55437887", "0.5517511", "0.5515251", "0.55022645", "0.54848456", "0.54630846", "0.54371583", "0.54167575", "0.5411685", "0.5398181", "0.5354032", "0.53457516", "0.5344675", "0.53375447", "0.5275249", "0.5243562", "0.5196463", "0.5185958", "0.5180015", "0.5180015", "0.51754487", "0.5147022", "0.51344985", "0.5133894", "0.5119019", "0.51141596", "0.51140755", "0.51118696", "0.51103115", "0.5105654", "0.51028997", "0.5100448", "0.50856674", "0.50821555", "0.5081026", "0.5078109", "0.5078109", "0.5078109", "0.5076172", "0.50664765", "0.5062959", "0.5062929", "0.50558925", "0.50527173", "0.505251", "0.5052212", "0.50497097", "0.5047393", "0.5045364", "0.5043598", "0.50418055", "0.5040819", "0.50280595", "0.5015764", "0.5012845", "0.5009448", "0.5004364", "0.49956208", "0.4993252", "0.49909154", "0.49886054", "0.49886054", "0.49864268", "0.4969796", "0.49638036", "0.49563345", "0.49455822", "0.49440107", "0.49437165", "0.49394137", "0.4939341", "0.49245447", "0.49101248", "0.4909763", "0.48987445", "0.48832437", "0.48793754", "0.48793754", "0.4875899", "0.48744133", "0.48601443", "0.4856761", "0.48546553", "0.485297", "0.4847587" ]
0.75121075
0
Convert to Fuzzy name
function _fuzzyName(name) { // 使用されない(と思われる)記号の削除(/\^$*+?.|[]{};"'%&=~@`,_!#) name = name.replace(/[\/\\\^\$\*\+\?\.\|\[\]\{\}\;\"\'\%\&\=\~\@\`\,\_\!\#]/g, ''); // 「:」「:」「・」「・」スペース、タブを無視 name = name.replace(/[::・・  \t]/g, ''); // 括弧を全角に統一 name = name.replace(/\(/g, '(').replace(/\)/g, ')'); // カナを統一 return fuzzyKana(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "correctName() {\n\t\tthis.name = this.stringCorrector.getMon(this.name);\n\t}", "function normalize(name) {\n return name.replace(/[- _]+/g, '').toLowerCase();\n }", "function normalize(name) {\n return name.replace(/[- _]+/g, '').toLowerCase();\n }", "function tidyName(name) {\n var result = name.replace(/-/g, \" \");\n result = result.substr(0, 1).toUpperCase() + result.substr(1);\n return result;\n}", "function normalize(name) {\n return name.toLowerCase();\n}", "formattedName() {\n let oneWord = /^[A-zА-яёЁ-]+$/;\n let twoWords = /^[A-zА-яёЁ-]+ [A-zА-яёЁ-]+$/;\n //let threeWords = /^(?:[A-zА-яёЁ]+ ){2}[A-zА-яёЁ]+$/;\n\n let field = this.$el.querySelector('.b-fields__name');\n this.$nextTick(() => {\n this.showSuggest = this.isTextOverflow(field);\n })\n\n this.name = this.capitalizeFirstLetter(this.name);\n\n return oneWord.test(this.name) \n ? this.name + ' Имя Отчество'\n : twoWords.test(this.name) \n ? this.name + ' Отчество' \n : this.name \n ? this.name \n : 'Фамилия Имя Отчество';\n }", "function normalizeName(name) {\n return name\n .toUpperCase()\n .replace(/[^A-Z0-9]/g, \" \")\n .trim()\n .split(/\\s+/)\n .join(\"_\");\n}", "function fixName(name) {\n let fixedName = name.charAt(0).toUpperCase() + name.slice(1).toLowerCase();\n return fixedName;\n}", "function convertName(name) {\n if (name == 'TBA') return name;\n let arr = name.split(', ');\n lastName = arr[0];\n firstName = arr[1];\n\n titleRegex = /\\([A-Za-z]+\\)/;\n if (titleRegex.test(firstName)) {\n const title = firstName.match(titleRegex);\n firstName = firstName.replace(titleRegex, '')\n firstName = lowerLetters(firstName);\n lastName = lowerLetters(lastName);\n lastName += ` ${title}`;\n } else {\n firstName = lowerLetters(firstName);\n lastName = lowerLetters(lastName);\n }\n\n let result = `${firstName} ${lastName}`;\n return result;\n}", "function toClassName(name) {\n var result = '';\n var upNext = false;\n for (var i = 0; i < name.length; i++) {\n var c = name.charAt(i);\n var valid = /[\\w]/.test(c);\n if (!valid) {\n upNext = true;\n } else if (upNext) {\n result += c.toUpperCase();\n upNext = false;\n } else if (result === '') {\n result = c.toUpperCase();\n } else {\n result += c;\n }\n }\n if (/[0-9]/.test(result.charAt(0))) {\n result = '_' + result;\n }\n return result;\n}", "function inName(name) {\n name = bio.name.trim().split(\" \");\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n return name[0] + \" \" + name[1];\n}", "function toName(inputString) {\n const splitInput = inputString.split(/\\W/g);\n return NAMES.includes(splitInput[0].toUpperCase()) ? splitInput[0].toUpperCase() : false;\n}", "function normalizeName(name) {\n return name.toLowerCase();\n}", "function normalizeName(name) {\n s = name;\n var pos = 0;\n while (true)\n {\n pos = s.search(' ');\n if (pos === -1) return s;\n else s = s.replace(' ','_');\n }\n}", "formatName(textField) {\n let scrubbedResult = textField\n // Capitalize first letter of string.\n //| ^ = beginning of output | . = 1st char of str |\n .replace(/^./g, x => x.toUpperCase())\n // Capitalize first letter of each word and removes spaces.\n //| \\ = matches | \\w = any alphanumeric | \\S = single char except white space\n //| * = preceeding expression 0 or more times | + = preceeding expression 1 or more times |\n .replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1);})\n .replace(/\\ +/g, x => '')\n // Remove appending file extensions like .js or .json.\n //| \\. = . in file extensions | $ = end of input |\n .replace(/\\..+$/, '');\n return scrubbedResult;\n }", "searchTitleFuzzy(input){\r\n // Fuzzy Search the quiz title\r\n let results = fuzzy.filter(input, this.quizList, {extract: (el) => {\r\n return el.title;\r\n }})\r\n this.searchFuzzy(results);\r\n }", "function convertName (name){\n let arr= name.split(' ') \n let firstIn = arr[0][0] \n let lastIn = arr[1][0] \n return (firstIn+\".\"+lastIn).toUpperCase()\n}", "function getFildName(input) {\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function toProperSentance(str){\n if(str.length == 0) return str;\n if(str.substr(-1) == \".\" || str.substr(-1) == \"!\" || str.substr(-1) == \"?\") return str.substring(0, 1).toUpperCase() + str.substring(1);\n return str.substring(0, 1).toUpperCase() + str.substring(1) + \".\";\n}", "function fuzzy(term, candidate, options) {\n\toptions = Object.assign({}, defaultOptions, options);\n\tvar scoreMethod = options.useDamerau ? damerauLevenshteinSellers : levenshteinSellers;\n\tterm = normalize(term, options);\n\tcandidate = normalize(candidate, options);\n\treturn scoreMethod(term, candidate);\n}", "function n(t){if(\"string\"!==typeof t)throw new TypeError(\"expected a string.\");return t=t.replace(/([A-Z])/g,\" $1\"),1===t.length?t.toUpperCase():(t=t.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCase(),t=t.charAt(0).toUpperCase()+t.slice(1),t.replace(/[\\W_]+(\\w|$)/g,(function(t,e){return e.toUpperCase()})))}", "function ucf(text) {\n return text.substr(0, 1).toUpperCase() + text.substr(1);\n}", "function thunk(str){return str.replace(/-/g,'_').toUpperCase();}", "function nameShuffler(str){\n return str.split(\" \").reverse().join(\" \");\n}", "function _usfHandlezie (str) {\r\n var x = str || \"\";\r\n return x.toLowerCase().replace(\"'\", '').replace(/[^\\w\\u00C0-\\u024f]+/g, \"-\").replace(/^-+|-+$/g, \"\").normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\")\r\n}", "function abbrevName(name){\n\n return name.toUpperCase().split(\" \").map(x=> x[0]).join(\".\")\n\n}", "function formatName(name) {\n return name.replace(/-([a-z])/g, function(s, l) {return l.toUpperCase();});\n }", "function inName(name) {\n name = bio.name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n }", "function inName() {\n var oldName = $('#name').html();\n var names = oldName.trim().split(' ');\n names[0] = names[0].slice(0,1).toUpperCase() +\n names[0].slice(1).toLowerCase();\n names[1] = names[1].toUpperCase();\n return names[0] + ' ' + names[1];\n}", "function abbrevName(name){\n\nreturn name.charAt(0).toUpperCase().concat('.', name.charAt(name.indexOf(' ')+1).toUpperCase());\n \n}", "function f7(str) {\n return str.match(/[A-Z]/g).join('');\n}", "function inName(name) {\n\tname = name.trim().split(\" \");\n\tname[1] = name[1].toUpperCase();\n\tname[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\treturn name[0] + \" \" + name[1];\n}", "function inName(name) {\n name = name.split(\" \");\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n name[1] = name[1].toUpperCase();\n var internationalizedName = (name[0] + \" \" + name[1]);\n return internationalizedName;\n}", "function abbrevName(name){\n let zoinks;\n for(let i = 0; i < name.length; i++){\n if (name[i] === ' ' ){\n zoinks = name[i+1].toUpperCase()\n }\n }\n return name[0].toUpperCase() + '.' + zoinks\n\n}", "_deCamelize(_str) {\n return _str.replace(/(([A-Z])(\\w))/g, ($0, $1, $2, $3) => {\n return '-' + $2.toLowerCase() + $3;\n });\n }", "_deCamelize(_str) {\n return _str.replace(/(([A-Z])(\\w))/g, ($0, $1, $2, $3) => {\n return '-' + $2.toLowerCase() + $3;\n });\n }", "function canonical(name) {\n return typeof (value) === 'string' ? name.toLowerCase() : name;\n}", "function domainPartsToFuzzyForm(domainParts) {\n return domainParts.slice(1).reverse().join('.')\n}", "function n(e){if(\"string\"!=typeof e)throw new TypeError(\"expected a string.\");return e=e.replace(/([A-Z])/g,\" $1\"),1===e.length?e.toUpperCase():(e=e.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\\W_]+(\\w|$)/g,function(e,t){return t.toUpperCase()}))}", "function n(e){if(\"string\"!=typeof e)throw new TypeError(\"expected a string.\");return e=e.replace(/([A-Z])/g,\" $1\"),1===e.length?e.toUpperCase():(e=e.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\\W_]+(\\w|$)/g,function(e,t){return t.toUpperCase()}))}", "function n(e){if(\"string\"!=typeof e)throw new TypeError(\"expected a string.\");return e=e.replace(/([A-Z])/g,\" $1\"),1===e.length?e.toUpperCase():(e=e.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\\W_]+(\\w|$)/g,function(e,t){return t.toUpperCase()}))}", "function n(e){if(\"string\"!=typeof e)throw new TypeError(\"expected a string.\");return e=e.replace(/([A-Z])/g,\" $1\"),1===e.length?e.toUpperCase():(e=e.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\\W_]+(\\w|$)/g,function(e,t){return t.toUpperCase()}))}", "function n(e){if(\"string\"!=typeof e)throw new TypeError(\"expected a string.\");return e=e.replace(/([A-Z])/g,\" $1\"),1===e.length?e.toUpperCase():(e=e.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\\W_]+(\\w|$)/g,function(e,t){return t.toUpperCase()}))}", "function n(e){if(\"string\"!=typeof e)throw new TypeError(\"expected a string.\");return e=e.replace(/([A-Z])/g,\" $1\"),1===e.length?e.toUpperCase():(e=e.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\\W_]+(\\w|$)/g,function(e,t){return t.toUpperCase()}))}", "function normalizeName(name) {\n if(options.paths) {\n var possibilities = []\n for (var path in paths) {\n if(name.startsWith(path)) {\n possibilities.push(path);\n }\n }\n\n var longestMatchingIndex = Math.max.apply(Math, possibilities.map(function(x) {return x.length}));\n var longestMatching = possibilities[longestMatchingIndex];\n name = longestMatching + name.slice(longestMatchingPath);\n }\n if(options.baseURL) {\n name = options.baseURL + '/' + name + '.js';\n }\n\n return name;\n}", "function _decamelize(str){return str.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase()}", "function fixName(str) {\r\n var newStr = \"\";\r\n if (str.length === 0) {\r\n return newStr;\r\n }\r\n var initialFirstChar = str.charCodeAt(0);\r\n var initialFirstCharMatch = (initialFirstChar === 0x3A\r\n || initialFirstChar === 0x5F\r\n || (initialFirstChar >= 0x41 && initialFirstChar <= 0x5A)\r\n || (initialFirstChar >= 0x61 && initialFirstChar <= 0x7A)\r\n || (initialFirstChar >= 0xC0 && initialFirstChar <= 0xD6)\r\n || (initialFirstChar >= 0xD8 && initialFirstChar <= 0xF6)\r\n || (initialFirstChar >= 0XF8 && initialFirstChar <= 0X2FF)\r\n || (initialFirstChar >= 0x370 && initialFirstChar <= 0x37D)\r\n || (initialFirstChar >= 0x37F && initialFirstChar <= 0X1FFF)\r\n || (initialFirstChar >= 0x200C && initialFirstChar <= 0x200D)\r\n || (initialFirstChar >= 0x2070 && initialFirstChar <= 0x218F)\r\n || (initialFirstChar >= 0x2C00 && initialFirstChar <= 0x2FEF)\r\n || (initialFirstChar >= 0x3001 && initialFirstChar <= 0xD7FF)\r\n || (initialFirstChar >= 0xF900 && initialFirstChar <= 0xFDCF)\r\n || (initialFirstChar >= 0xFDF0 && initialFirstChar <= 0xFFFD));\r\n if (str.length === 1) {\r\n if (initialFirstCharMatch) {\r\n newStr = str[0];\r\n }\r\n else {\r\n newStr = \"\\uFFFD\";\r\n }\r\n return newStr;\r\n }\r\n // UTF-16 surrogate characters\r\n var initialSecondChar = str.charCodeAt(1);\r\n var initialSecondCharMatch = ((initialFirstChar >= 0xD800 && initialFirstChar <= 0xDB7F)\r\n && (initialSecondChar >= 0xDC00 && initialSecondChar <= 0xDFFF));\r\n if (initialSecondCharMatch) {\r\n newStr = str[0] + str[1];\r\n }\r\n else if (initialFirstCharMatch) {\r\n newStr = str[0];\r\n }\r\n else {\r\n newStr = \"\\uFFFD\";\r\n }\r\n var start = initialSecondCharMatch ? 2 : 1;\r\n for (var i = start; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x3A\r\n || firstChar === 0x5F\r\n || firstChar === 0x2D\r\n || firstChar === 0x2E\r\n || firstChar === 0xB7\r\n || (firstChar >= 0x30 && firstChar <= 0x39)\r\n || (firstChar >= 0x41 && firstChar <= 0x5A)\r\n || (firstChar >= 0x61 && firstChar <= 0x7A)\r\n || (firstChar >= 0xC0 && firstChar <= 0xD6)\r\n || (firstChar >= 0xD8 && firstChar <= 0xF6)\r\n || (firstChar >= 0XF8 && firstChar <= 0X2FF)\r\n || (firstChar >= 0x300 && firstChar <= 0x36F)\r\n || (firstChar >= 0x370 && firstChar <= 0x37D)\r\n || (firstChar >= 0x37F && firstChar <= 0X1FFF)\r\n || (firstChar >= 0x200C && firstChar <= 0x200D)\r\n || (firstChar >= 0x203F && firstChar <= 0x2040)\r\n || (firstChar >= 0x2070 && firstChar <= 0x218F)\r\n || (firstChar >= 0x2C00 && firstChar <= 0x2FEF)\r\n || (firstChar >= 0x3001 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xF900 && firstChar <= 0xFDCF)\r\n || (firstChar >= 0xFDF0 && firstChar <= 0xFFFD)) {\r\n newStr += str[i];\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n newStr += \"\\uFFFD\";\r\n return newStr;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDB7F)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n newStr += str[i] + str[i + 1];\r\n i++;\r\n continue;\r\n }\r\n newStr += \"\\uFFFD\";\r\n }\r\n return newStr;\r\n}", "function r(t){return t.toLowerCase().split(\"-\").map(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}).join(\"-\")}", "function grammarize (name) {\n const wrongWords = ['arent', 'githubbin', 'its']\n const rightWords = [\"aren't\", 'GitHubbin', \"it's\"]\n let correctedName = name\n\n // Correct listed terms\n wrongWords.forEach((word, i) => {\n if (name.match(word)) {\n correctedName = name.replace(word, rightWords[i])\n }\n })\n\n // First Char to upper case\n correctedName = correctedName.charAt(0).toUpperCase() + correctedName.substr(1)\n\n return correctedName\n}", "function convertPropertyName( str ) {\n\t\t\treturn str.replace( /\\-([A-Za-z])/g, function ( match, character ) {\n\t\t\t\treturn character.toUpperCase();\n\t\t\t});\n\t\t}", "function convertPropertyName( str ) {\n\t\t\treturn str.replace( /\\-([A-Za-z])/g, function ( match, character ) {\n\t\t\t\treturn character.toUpperCase();\n\t\t\t});\n\t\t}", "function intlName(name) {\n\t\t\tvar names = name.trim().split(\" \");\n\t\t\treturn names[0][0].toUpperCase() + names[0].slice(1).toLowerCase() + \" \" + names[1].toUpperCase();\n\t\t}", "function codify(name) {\n if (!name) return '';\n // return name.toLowerCase().replace(/[\\&\\[\\]\\(\\)\\{\\}\\.\\?\\/# \\-_:'`~\\\\@\"']/g, '');\n return latinise(name).toLowerCase().replace(/[^a-zA-Z0-9]/g, '');\n }", "function r(e){if(\"string\"!=typeof e)throw new TypeError(\"expected a string.\");return e=e.replace(/([A-Z])/g,\" $1\"),1===e.length?e.toUpperCase():(e=e.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\\W_]+(\\w|$)/g,function(e,t){return t.toUpperCase()}))}", "function r(e){if(\"string\"!=typeof e)throw new TypeError(\"expected a string.\");return e=e.replace(/([A-Z])/g,\" $1\"),1===e.length?e.toUpperCase():(e=e.replace(/^[\\W_]+|[\\W_]+$/g,\"\").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\\W_]+(\\w|$)/g,function(e,t){return t.toUpperCase()}))}", "function bandNameGenerator(str) {\n let bandName = '';\n if (str.charAt(0) === str.charAt(str.length -1)) {\n bandName = str.slice(0, -1);\n bandName += str;\n return bandName.charAt(0).toUpperCase() + bandName.slice(1);\n } else {\n bandName = 'The ' + (str.charAt(0).toUpperCase() + str.slice(1));\n console.log(bandName);\n return bandName;\n }\n}", "function prettifyName(profname) {\n return profname.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n }", "function inName(){\n var name = $(\"#name\").html();\n name = name.trim().split(\" \");\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1);\n\n return name[0] + \" \" + name[1];\n}", "function toCalc(name) {\n return name.toLowerCase().trim().replace(/[\\W_]/g, \"\"); // Makes it case-insensitive and removes symbols and spaces.\n}", "function inName(name) {\n\tname = name.replace(/[^a-zA-Z ]/g, \"\");\n\n\tvar finalName;\n\t//trim() removes white spaces before & after names Not in between names\n\tname = name.trim();\n name = name.toLowerCase();\n var n = name.indexOf(\" \");\n \n name = name.charAt(0).toUpperCase() + name.slice(1);\n var firstname = name.slice(0, n);\n var lastname = name.slice(n+1);\n lastname = lastname.toUpperCase();\n finalName = firstname + \" \" + lastname;\n \t//don't use replaceWith() as this will change the class to default.\n\t$('#name').text(finalName);\n\n}", "function titleize(value) {\n\t return humanize(underscore(value)).replace(/\\b('?[a-z])/g, m => m.toUpperCase());\n\t} // Capitalizes the first word and turns underscores into spaces and strips a", "function r(e){return e.replace(/([\\:\\-\\_]+(.))/g,(function(e,t,n,r){return r?n.toUpperCase():n}))}", "function format_name(name){\n let lowercaseName = name.toLowerCase();\n let splitName = lowercaseName.split(\" \")\n let formatName = []\n \n splitName.forEach(part =>{\n part = part.charAt(0).toUpperCase()+part.slice(1);\n \n formatName.push(part)\n })\n return formatName.join(\" \")\n \n }", "normalizeString(name) {\n return name.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '');\n }", "capitalizeFirstLetter(str) {\n let pattern = /(^|[-\\s])([a-zа-яё])/g;\n let normalizedName = str.toLowerCase();\n\n normalizedName = normalizedName.replace(pattern, function($2){\n \treturn $2.toUpperCase();\n });\n\n return normalizedName;\n }", "normify(str, allFirstUpper) {\n str = str || this.str;\n\n //var str = str.toLowerCase();\n if (allFirstUpper === true) {\n str = this.camelize(str);\n str = this.underscore(str);\n } else {\n str = str.toLowerCase();\n }\n\n str = str.replace(this.underbar, ' ');\n var str_arr = str.split(' ');\n for (var x = 0; x < str_arr.length; x++) {\n var d = str_arr[x].split('-');\n for (var i = 0; i < d.length; i++) {\n if (this.nonTitlecasedWords.indexOf(d[i].toLowerCase()) < 0) {\n d[i] = this.capitalize(d[i]);\n }\n }\n str_arr[x] = d.join('-');\n }\n str = str_arr.join(' ');\n str = str.substring(0, 1).toUpperCase() + str.substring(1);\n\n // set str\n this.str = str;\n\n if (this.chain === true) {\n return this;\n }\n\n // return result\n return str;\n }", "function inName(name) {\n name = $(\"#name\").text();\n name = name.trim().split(\" \");\n console.log(name);\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n name[1] = name[1].toUpperCase();\n\n return name[0] + \" \" + name[1];\n }", "function name (string){\n return string.charAt(0).toUpperCase() + string.slice(1); \n}", "checkCorrectness(answer) {\n var playerAnswer = answer.toLowerCase().replace(\", \", \" ja \").replace(\" & \", \" ja \")\n var latinName = this.props.game.currentImage.bone.nameLatin.toLowerCase().replace(\" & \", \" ja \")\n return 100 * StringSimilarity.compareTwoStrings(playerAnswer, latinName); // calculate similarity \n //return 100 * StringSimilarity.compareTwoStrings(this.props.game.currentImage.bone.nameLatin.toLowerCase(), this.state.value.toLowerCase()); // calculate similarity \n }", "function toCorrectCase(name) {\r\n if (isNaN(name) && sys.id(name) !== undefined) {\r\n return sys.name(sys.id(name));\r\n }\r\n else {\r\n return name;\r\n }\r\n}", "function toFileName(typeName) {\n var result = '';\n var wasLower = false;\n for (var i = 0; i < typeName.length; i++) {\n var c = typeName.charAt(i);\n var isLower = /[a-z]/.test(c);\n if (!isLower && wasLower) {\n result += '-';\n }\n result += c.toLowerCase();\n wasLower = isLower;\n }\n return result;\n}", "validateName() {\n // Do not delete this internal method.\n this.name = this.name.replace(/[^a-z0-9]/gi, '_').toLowerCase();\n }", "function inflect(gender, name, gcase, nametype) {\n var nametype_rulesets = rules[nametype],\n parts = name.split('-'),\n result = [];\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i], first_word = i === 0 && parts.size > 1,\n rule = find_rule_global(gender, part,\n nametype_rulesets, {first_word: first_word});\n if (rule) result.push(apply_rule(part, gcase, rule));\n else result.push(part);\n }\n return result.join('-');\n }", "formatAttributeName(attr) {\n return attr.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();\n }", "function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}", "function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}", "function inName(name) {\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n}", "function inName(name){\n name = name.trim().split(' ');\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n return name[0] + ' ' + name[1];\n}", "function merubahformathuruf (text = \"text\") {\n return text.toLowerCase();\n}", "function cleanName(name){\n\tvar low_name = name.toLowerCase();\n\tvar clean_name = low_name.replace(' ', '');\n\tvar trim_name = clean_name.trim();\n\treturn clean_name;\n}", "function cleanName(full_name) {\n String.prototype.allReplace = function(obj) {\n var retStr = this;\n for (var x in obj) {\n retStr = retStr.replace(new RegExp(x, 'g'), obj[x]);\n }\n return retStr;\n };\n\n return full_name.allReplace(\n {\n ',? Jr.?': '',\n ',? Sr.?': '',\n ',? MBA': '',\n ',? CPA': '',\n ',? PhD': '',\n ',? MD': '',\n ',? MHA': '',\n ',? CGA': '',\n ',? ACCA': '',\n ',? PMP': '',\n ',? MSc': ''\n }\n );\n}", "function firstName(v) {\n return v.toLowerCase().replace(/\\b\\w+\\b/g, cnvrt); \n function cnvrt() {\n if (arguments[arguments.length -2] == 0)\n return arguments[0].replace(/^[a-z]/, cnvrt2);\n else if (/^(do|dos|da|das|de)$/.test(arguments[0]) )\n return arguments[0];\n else\n return arguments[0].replace(/^[a-z]/, cnvrt2);\n } \n function cnvrt2() {\n return arguments[0].toUpperCase();\n }\n}", "UpperCaseFirstLetter(name) {\n let Name = name[0].toUpperCase() + name.substring(1);\n return Name;\n }", "function inName(name) {\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n}", "function inName(name) {\n name = name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n}", "function titleCaseName(str) {\n return str.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "function idToName(id) {\n return id.split(\"_\").map(word => word.charAt(0).toUpperCase() + word.substr(1)).join(\" \")\n}", "function inName(name) {\n\tname = name.trim().split(\" \");\n\tconsole.log(name);\n\tname[1] = name[1].toUpperCase();\n\tname[0] = name[0].slice(0,1).toUpperCase() +\n\t\tname[0].slice(1).toLowerCase();\n\n\treturn name[0] +\" \"+name[1];\n}", "function normalize_dataset_name(name) { // 214\n\treturn name.replace(/[\\]\\[\\.]/g, '_'); // 215\n} // 216", "static matchLanguageName(descs, name, fuzzy = true) {\n name = name.toLowerCase();\n for (let d of descs)\n if (d.alias.some(a => a == name))\n return d;\n if (fuzzy)\n for (let d of descs)\n for (let a of d.alias) {\n let found = name.indexOf(a);\n if (found > -1 && (a.length > 2 || !/\\w/.test(name[found - 1]) && !/\\w/.test(name[found + a.length])))\n return d;\n }\n return null;\n }", "function i(e){return e[0].toUpperCase()+e.substr(1)}", "function hc(myString) {\n return myString.replace(\"_\", \" \").replace(/\\b\\w/g, l => l.toUpperCase())\n}", "function buildName(queryResponse) {\r\n let candidateName = \" \";\r\n let firstName = queryResponse.FIRST_NAME;\r\n let lastName = queryResponse.LAST_NAME;\r\n if (firstName && lastName) {\r\n candidateName = firstName + \" \" + lastName;\r\n } else {\r\n candidateName = firstName;\r\n }\r\n return candidateName;\r\n}", "function inName(name) {\n\tname = name.trim().split(\" \");\n\tconsole.log(name);\n\tname[1] = name[1].toUpperCase();\n\tname[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n\treturn name[0] + \" \" + name[1];\n}", "function n(e) {\n if (\"string\" != typeof e) throw new TypeError(\"expected a string.\");\n return e = e.replace(/([A-Z])/g, \" $1\"), 1 === e.length ? e.toUpperCase() : (e = e.replace(/^[\\W_]+|[\\W_]+$/g, \"\").toLowerCase(), e = e.charAt(0).toUpperCase() + e.slice(1), e.replace(/[\\W_]+(\\w|$)/g, function(e, t) {\n return t.toUpperCase()\n }))\n }", "function snake_case(name) {\n\t\t\t\tvar regexp = /[A-Z]/g;\n\t\t\t\tvar separator = '-';\n\t\t\t\treturn name.replace(regexp, function(letter, pos) {\n\t\t\t\t\treturn (pos ? separator : '') + letter.toLowerCase();\n\t\t\t\t});\n\t\t\t}", "function filterName(name) {\n return name.toLowerCase().replace(/ /g, '');\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 getHerdNames() {\n return herdNames.map(name => name.replace(\"_\", \" \")).map(name => name.split(\" \").map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(\" \"))\n }", "function formatter(trendName){\n // first, remove any initial hashtags\n var newName = \"\";\n if (trendName[0] === '#') {\n trendName = trendName.slice(1);\n }\n\n // now find every instance of a capital letter, starting with second char\n for (var i = 1; i < trendName.length; i++) {\n\n // save current and next char's ascii\n var curChar = trendName.charCodeAt(i);\n var nextChar = trendName.charCodeAt(i+1);\n var lastChar = trendName.charCodeAt(i-1);\n\n // if curChar is the value for a cap letter, add a space before it...\n if ( 65 <= curChar && curChar <= 95 ) {\n // ...but only if there's no issue with other chars\n if (trendName[i-1] !== \" \" && trendName[i-1] !== \"-\") {\n if (65 >= lastChar || lastChar >= 95) {\n trendName = trendName.slice(0, i) + \" \" + trendName.slice(i);\n // increase counter by 1 on success\n i++;\n }\n }\n }\n }\n // return the new word\n return trendName;\n}" ]
[ "0.62886757", "0.6226444", "0.6226444", "0.59146327", "0.58775526", "0.58744985", "0.5837227", "0.5800777", "0.57886124", "0.5754456", "0.5744995", "0.57383525", "0.5708164", "0.5701565", "0.56960076", "0.5690939", "0.56625783", "0.56535876", "0.56404686", "0.5638587", "0.5626367", "0.56235445", "0.562186", "0.5617899", "0.5609193", "0.5598662", "0.5574524", "0.55672014", "0.5562825", "0.55623513", "0.55461943", "0.5543949", "0.55395997", "0.55336314", "0.55333734", "0.55333734", "0.5526693", "0.55013126", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.5498663", "0.54969263", "0.5490475", "0.54889876", "0.54814833", "0.5468269", "0.54640657", "0.54640657", "0.5458262", "0.54511845", "0.5447624", "0.5447624", "0.5443407", "0.54384035", "0.5432862", "0.5432589", "0.5427055", "0.5416106", "0.5402337", "0.53847045", "0.5379124", "0.5372416", "0.53666705", "0.5363892", "0.5358056", "0.5357603", "0.5356663", "0.53539455", "0.53509325", "0.5347518", "0.5344431", "0.5340603", "0.5340603", "0.5322254", "0.531661", "0.5310297", "0.5305179", "0.5303338", "0.5301997", "0.53012794", "0.53009975", "0.53009975", "0.5299562", "0.5298034", "0.5296666", "0.5292773", "0.52820724", "0.52802664", "0.52794343", "0.5276921", "0.5276309", "0.5273724", "0.5272917", "0.52728343", "0.5272229", "0.5271603", "0.52713317" ]
0.71595263
0
draw nodes and links
function transit(){ links = links.data(linksData, function(d){ return d.edgeId; }); links.enter() .append("path") .attr("stroke", "#555") .attr("stroke-width", 1) //.attr("opacity", 0.5) .attr("id", function(d, i){ return d.source.id + "link" + d.target.id; }) .attr("class", function(d) { var provClass = "" if(d.isProvenance) provClass = " provenanceLink" return "link " + d.linkType + " " + d.linkStatus + provClass; }) .attr("fill", "none"); links.exit() .transition() .duration(transitionDisapearTime) .attr("opacity", 0) .remove(); linkArrow = linkArrow.data(linksData, function(d){ return d.edgeId; }); linkArrow.enter() .append("polygon") .attr("fill", "#555") linkArrow.exit() .transition() .duration(transitionDisapearTime) .attr("opacity", 0) .remove(); labels = labels.data(textData, function(d){ return d.nodeId; }); labels.enter() .append("g") .classed("label", true) .attr("id", function(d, i){ if (d.type == "nodeLabel"){ return "nodeLabelG" + d.node.id; } else if (d.type == "linkLabel"){ return "linkLabelG" + d.node.src + "-" + d.node.tgt; } else if (d.type == "edgeLinkLabel"){ return "edgeLinkLabelG" + nodesData[d.node.tgt].id; } return "labelPartG" + i; }); labels.exit() .transition() .duration(transitionDisapearTime) .attr("opacity", 0) .remove(); var test = labels.append("circle") .attr("r", 0) labelFrame = labels .append("g") .attr("class", function(d){ if (d.type == "nodeLabel"){ return "nodeLabel"; } else if (d.type == "linkLabel"){ return "linkLabel"; } else if (d.type == "edgeLinkLabel"){ return "edgeLinkLabel"; } return "unusedLable"; }) .attr("id", function(d, i){ if (d.type == "nodeLabel"){ return "nodeLabel" + d.node.id; } else if (d.type == "linkLabel"){ return "linkLabel" + d.node.src + "-" + d.node.tgt; } else if (d.type == "edgeLinkLabel"){ return "edgeLinkLabel" + nodesData[d.node.tgt].id; } return "labelPart" + i; }) .attr("opacity", 0); labelText = labelFrame .filter(function(d, i){ return i % 2 == 1; }) .append("text") .text(function(d, i){ if (d.type == "nodeLabel" && d.node.type == "anchor"){ return d.content; } if (d.content.length > 20){ d.alt = d.content.slice(0, 7) + "..." + d.content.slice(d.content.length - 10, d.content.length); return d.alt; } return d.content; }) .attr("fill", function(d){ if (d.type == "nodeLabel"){ return "white"; } if (d.type == "linkLabel" || d.type == "edgeLinkLabel"){ return "black"; } return "none"; }) .attr("font-weight", function(d){ if (d.type == "nodeLabel"){ return "bold"; } return "normal"; }) .attr("font-family", "Arial") .attr("font-size", 12) .attr("opacity", 0.8) .attr("x", function(d){ d.width = this.getBBox().width //+ textHeight / 3 * 2; if (d.type == "nodeLabel"){ d.node.labelWidth = d.width; } return -(d.width / 2); }) .attr("y", -3); labelBoard = labelFrame .filter(function(d, i){ return i % 2 == 1; }) .append("path") .attr("stroke-width", 0) .attr("stroke", function(d){ return "red"; if (d.type == "nodeLabel"){ return "#ddd"; } else if (d.type == "linkLabel"){ return "#555"; } }) .attr("id", function(d){ if (d.type == "nodeLabel"){ return "nodeLabelBoard" + d.node.id; } else if (d.type == "linkLabel"){ return "linkLabelBoard" + d.node.src + "-" + d.node.tgt; } else if (d.type == "edgeLinkLabel"){ return "edgeLinkLabelBoard" + nodesData[d.node.tgt].id; } }) .attr("fill", function(d){ if (d.type == "nodeLabel"){ if (d.node.isForcedByUser) return "rgb(42,98,126)"; if (d.node.isTemporary) return "#888"; return "#555"; } if (d.type == "linkLabel" || d.type == "edgeLinkLabel"){ return "#ddd"; } return "none"; }) .attr("d", function(d){ if (d.type != "nodeLabel" && d.type != "linkLabel" && d.type != "edgeLinkLabel"){ d.width = 0; return ""; } var textWidth = d.width; var dx = -textWidth / 2; var dy = 0; return "M " + dx + " " + dy + " L " + (dx + textWidth) + " " + dy + " Q " + (dx + textWidth + textHeight / 3) + " " + (dy - textHeight / 2) + " " + (dx + textWidth) + " " + (dy - textHeight) + " L " + dx + " " + (dy - textHeight) + " Q " + (dx - textHeight / 3) + " " + (dy - textHeight / 2) + " " + dx + " " + dy; }); labelBoard.moveToBack(); labelApproveBoard = labels .filter(function(d, i){ //console.log(JSON.stringify(d)); return d.type == "linkLabel" && d.node.original.linkStatus == "TemporaryLink"; }) .append("rect") .attr("fill", "transparent") .classed("clickBoard", true) .attr("r", nodeRadius+1) .attr("opacity", 1) .attr("stroke-width", 2) .attr("stroke", "red") .attr("width", function(d){ return 8; }) .attr("height", function(d){ return 8; }) .attr("x", function(d){ var w = Math.ceil(this.parentNode.childNodes[1].getBBox().width); return -4; }) .attr("y", function(d){ var h = Math.ceil(this.parentNode.childNodes[1].getBBox().height); return -h+15; }) .on("click", function(d){ if(linkApproveClickListener != null) linkApproveClickListener(d.node.original, d3.event); }); labelClickBoard = labels .filter(function(d, i){ return (i % 2 == 1) && d.node.type != "anchor"; }) .append("rect") .classed("clickBoard", true) .attr("id", function(d){ if (d.type == "nodeLabel"){ return "nodeLabelClickBoard" + d.node.id; } else if (d.type == "linkLabel"){ return "linkLabelClickBoard" + d.node.src + " " + d.node.tgt; } else if (d.type == "edgeLinkLabel"){ return "edgeLinkClickBoard" + nodesData[d.node.tgt].id; } }) .attr("fill", "transparent") .attr("width", function(d){ var w = Math.ceil(this.parentNode.childNodes[1].getBBox().width); return w; }) .attr("height", function(d){ var h = Math.ceil(this.parentNode.childNodes[1].getBBox().height); return h; }) .attr("x", function(d){ var w = Math.ceil(this.parentNode.childNodes[1].getBBox().width); return -w / 2; }) .attr("y", function(d){ var h = Math.ceil(this.parentNode.childNodes[1].getBBox().height); return -h; }) .on("click", function(d){ if (d.type == "linkLabel" || d.type == "edgeLinkLabel"){ if(linkClickListener != null) linkClickListener(d.node.original, d3.event); } else { if(nodeClickListener != null) nodeClickListener(d.node.original, d3.event); } //console.log(d.type); }) .on("mouseover", function(d){ var frameId = ""; showNodeHelp(worksheetId, d.node.original); //console.log(d.content); if (d.type == "nodeLabel"){ frameId = "#nodeLabelG" + d.node.id; } else if (d.type == "linkLabel"){ frameId = "#linkLabelG" + d.node.src + "-" + d.node.tgt; } else if (d.type == "edgeLinkLabel"){ frameId = "#edgeLinkLabelG" + nodesData[d.node.tgt].id; } if (d.alt != undefined){ d3.select(frameId) .select("text") .text(function(d){ return d.content; }) .attr("x", function(d){ d.width = this.getBBox().width return -(d.width / 2); }) d3.select(frameId) .select("path") .transition() .duration(500) .attr("d", function(d){ var textWidth = d.width; var dx = -textWidth / 2; var dy = 0; return "M " + dx + " " + dy + " L " + (dx + textWidth) + " " + dy + " Q " + (dx + textWidth + textHeight / 3) + " " + (dy - textHeight / 2) + " " + (dx + textWidth) + " " + (dy - textHeight) + " L " + dx + " " + (dy - textHeight) + " Q " + (dx - textHeight / 3) + " " + (dy - textHeight / 2) + " " + dx + " " + dy; }) } d3.select(frameId) .select("path") .attr("stroke-width", 2); d3.select(frameId) .moveToFront(); }) .on("mouseout", function(d, i){ hideHelp(); var frameId = ""; if (d.type == "nodeLabel"){ frameId = "#nodeLabelG" + d.node.id; } else if (d.type == "linkLabel"){ frameId = "#linkLabelG" + d.node.src + "-" + d.node.tgt; } else if (d.type == "edgeLinkLabel"){ frameId = "#edgeLinkLabelG" + nodesData[d.node.tgt].id; } if (d.alt != undefined){ d3.select(frameId) .select("text") .text(function(d){ return d.alt; }) .attr("x", function(d){ d.width = this.getBBox().width return -(d.width / 2); }) d3.select(frameId) .select("path") .transition() .duration(200) .attr("d", function(d){ var textWidth = d.width; var dx = -textWidth / 2; var dy = 0; return "M " + dx + " " + dy + " L " + (dx + textWidth) + " " + dy + " Q " + (dx + textWidth + textHeight / 3) + " " + (dy - textHeight / 2) + " " + (dx + textWidth) + " " + (dy - textHeight) + " L " + dx + " " + (dy - textHeight) + " Q " + (dx - textHeight / 3) + " " + (dy - textHeight / 2) + " " + dx + " " + dy; }) } d3.select(frameId) .select("path") .attr("stroke-width", 0); d3.select(frameId) .moveToBack(); }); labelLinks = labelLinks.data(textLinksData, function(d){ return d.edgeId; }); labelLinks.enter() .append("line") .classed("labelLinks", true) .attr("stroke-width", 0); labelLinks.exit() .transition() .duration(transitionDisapearTime) .attr("opacity", 0) .remove(); nodesData.forEach(function(d){ if (d.noLayer){ d.position.x = -1; d.position.y = -1; } else { d.position.x = d.xpos; d.position.y = height - nodeRadius - d.layer * unitLinkLength; } }) nodes = nodes.data(nodesData, function(d){ return d.nodeId; }); nodes.enter() .append("circle") .classed("node", true) .attr("r", nodeRadius) .attr("opacity", 0.7) .attr("fill", "red") .attr("id", function(d, i){ return "node" + d.id; }) .call(drag) .on("click", function(d){ if(anchorClickListener != null && d.original.nodeType == "ColumnNode") anchorClickListener(d.original, d3.event); var offset = Math.max(xOffset - leftPanelWidth,0); if (d.outside.isOutside && !d.noLayer){ if (d.position.x < offset){ var destination = Math.max(0, d.position.x - windowWidth / 2); var xPosition = offset; var differ = Math.max(30, (xPosition - destination) / 200); var interval = setInterval(function(){ xPosition -= differ; if (xPosition > destination){ $(window).scrollLeft(xPosition); } else { clearInterval(interval); } }, 10); } else { var destination = Math.min(width - windowWidth, d.position.x - windowWidth / 2); var xPosition = offset; var differ = Math.max(30, (destination - xPosition) / 200); var interval = setInterval(function(){ xPosition += differ; if (xPosition < destination){ $(window).scrollLeft(xPosition); } else { clearInterval(interval); } }, 10); } } }) .on("dblclick", function(d) { d3.select(this).classed("fixed", d.fixed = false); d.position.x = d.xpos; d.position.y = height - nodeRadius - d.layer * unitLinkLength; }) .on("mouseover", function(d){ if(anchorMouseListener != null && !d.isTemporary && !d.outside.isOutside) anchorMouseListener(d.original, d3.event); d3.select(this) .transition() .duration(500) .attr("opacity", 1) .attr("r", nodeRadius * 1.5); d3.select("#nodeLabel" + d.id) .attr("opacity", 1); d.showLabel = true; if (d.parent){ d3.select("#nodeLabel" + d.parent) .attr("opacity", 1); nodesData[d.parent].showLabel = true; } if (nodesChildren[d.id] == undefined){ return; } nodesChildren[d.id].forEach(function(e){ if (nodesData[e].degree >= 2){ d3.select("#nodeLabel" + e) .attr("opacity", 1); nodesData[e].showLabel = true; } }); labelForce.start(); }) .on("mouseout", function(d){ d3.select(this) .transition() .duration(500) .attr("opacity", 0.7) .attr("r", nodeRadius) if (d.noLayer){ } else if (d.outside.isOutside){ if (d.degree < 3){ d3.select("#nodeLabel" + d.id) .attr("opacity", 0); d.showLabel = false; } if (d.parent && nodesData[d.parent].degree < 3){ d3.select("#nodeLabel" + d.parent) .attr("opacity", 0); d.showLabel = true; } if (nodesChildren[d.id] == undefined){ return; } nodesChildren[d.id].forEach(function(e){ if (nodesData[e].degree < 3){ d3.select("#nodeLabel" + e) .attr("opacity", 0); nodesData[e].showLabel = false; } }); } else if (d.type == "anchor"){ d3.select("#nodeLabel" + d.id) .attr("opacity", 0); d.showLabel = false; } }); nodes.transition() .duration(500) .attr("r", nodeRadius); nodes.exit() .transition() .duration(transitionDisapearTime) .attr("opacity", 500) .remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw(nodes, links, accessors) {\n function nodeKey(n) {\n return n.id;\n }\n\n function linkKey(d) {\n return d.source.id + \"-\" + d.target.id;\n }\n\n var root = accessors.root,\n rootparent = accessors.rootparent,\n berects = accessors.berects;\n var graphNodesGroup = d3Selection.select(selector).select(\".nodes\");\n var graphLinksGroup = d3Selection.select(selector).select(\".links\"); // DRAW NODES\n\n var graphNodesData = graphNodesGroup.selectAll(\"g\").data(nodes, function (d) {\n return nodeKey(d);\n });\n graphNodesData.exit().select(\"circle\").transition().duration(graphEle.transitionDuration).attr(\"r\", 0).remove();\n graphNodesData.exit().select(\"rect\").transition().duration(graphEle.transitionDuration).attr(\"width\", 0).attr(\"height\", 0).remove();\n graphNodesData.exit().select(\"text\").remove();\n graphNodesData.exit().transition().duration(graphEle.transitionDuration).remove();\n var graphNodesEnter = graphNodesData.enter().append(\"g\").attr(\"id\", function (d) {\n return \"node-group-\" + nodeKey(d);\n });\n graphNodesEnter.attr(\"transform\", function (d) {\n if (berects(d)) {\n if (d.type === \"parent\") {\n return \"translate(\" + (d.x0 - d.radius + d.strokeWidth) + \",\" + (d.y0 - d.radius + d.strokeWidth) + \")\";\n } else {\n return \"translate(\" + (d.x0 - d.radius) + \",\" + (d.y0 - d.radius) + \")\";\n }\n } else {\n return \"translate(\" + d.x0 + \",\" + d.y0 + \")\";\n }\n });\n graphNodesEnter.filter(function (d) {\n return !berects(d);\n }).append(\"circle\").attr(\"class\", \"node node-circle\").attr(\"id\", function (d) {\n return \"node-\" + d.id;\n }).attr(\"stroke-width\", function (d) {\n return d.strokeWidth;\n }).attr(\"stroke\", function (d) {\n return d.strokeColor;\n }).attr(\"opacity\", function (d) {\n return d.opacity;\n }).attr(\"fill\", function (d) {\n return d.color;\n });\n graphNodesEnter.filter(function (d) {\n return berects(d);\n }).append(\"rect\").attr(\"class\", \"node node-rect\").attr(\"id\", function (d) {\n return \"node-\" + d.id;\n }).attr(\"stroke-width\", function (d) {\n return d.strokeWidth;\n }).attr(\"stroke\", function (d) {\n return d.strokeColor;\n }).attr(\"opacity\", function (d) {\n return d.opacity;\n }).attr(\"fill\", function (d) {\n return d.color;\n }); // DRAW NODE LABELS\n\n var textChildrenNode = graphNodesEnter.filter(function (d) {\n return !root(d);\n });\n textChildrenNode.append(\"text\").attr(\"class\", \"node-label\").attr(\"font-size\", \"\".concat(graphEle.nodeTextSize, \"px\")).attr(\"text-anchor\", \"middle\").attr(\"fill\", graphEle.nodeTextFill).attr(\"opacity\", graphEle.nodeTextOpacity).attr(\"x\", function (d) {\n return berects(d) ? d.radius : 0;\n }).attr(\"y\", function (d) {\n return berects(d) ? -10 : -d.radius - 8;\n }).text(function (d) {\n return \"\".concat(d.id);\n });\n var textRootNode = graphNodesEnter.filter(function (d) {\n return root(d);\n });\n textRootNode.append(\"text\").attr(\"class\", \"root-label\").attr(\"font-size\", \"\".concat(graphEle.nodeTextSize * 2, \"px\")).attr(\"text-anchor\", \"middle\").attr(\"fill\", graphEle.nodeTextFill).attr(\"opacity\", 1).attr(\"x\", function (d) {\n return berects(d) ? d.radius : 0;\n }).attr(\"y\", function (d) {\n return berects(d) ? -10 : -d.radius - 10;\n }).text(function (d) {\n return \"\".concat(d.id);\n }).call(getBB);\n textRootNode.insert(\"rect\", \"text\").attr(\"x\", function (d) {\n return berects(d) ? d.radius + d.bbox.x : 0 + d.bbox.x;\n }).attr(\"y\", function (d) {\n return berects(d) ? -10 - 15 : -d.radius - 10 - 15;\n }).attr(\"width\", function (d) {\n return d.bbox.width;\n }).attr(\"height\", function (d) {\n return d.bbox.height;\n }).style(\"fill\", graphEle.nodeFill).style(\"opacity\", 0.8);\n\n function getBB(selection) {\n selection.each(function (d) {\n d.bbox = this.getBBox();\n });\n }\n\n graphNodesData = graphNodesEnter.merge(graphNodesData);\n graphNodesData.transition().duration(graphEle.transitionDuration).attr(\"transform\", function (d) {\n if (berects(d)) {\n return \"translate(\" + (d.x - d.radius) + \",\" + (d.y - d.radius) + \")\";\n } else {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n }\n });\n graphNodesData.selectAll(\".node-circle\").call(function (node) {\n node.transition().attr(\"r\", function (d) {\n return d.radius;\n }).attr(\"fill\", function (d) {\n return d.color;\n }).attr(\"stroke\", function (d) {\n return d.strokeColor;\n });\n });\n graphNodesData.selectAll(\".node-rect\").call(function (node) {\n node.transition().attr(\"width\", function (d) {\n return d.radius * 2;\n }).attr(\"height\", function (d) {\n return d.radius * 2;\n }).attr(\"fill\", function (d) {\n return d.color;\n }).attr(\"stroke\", function (d) {\n return d.strokeColor;\n });\n });\n graphNodesData.selectAll(\".nodeFO\").call(function (node) {\n node.transition().attr(\"x\", 0).attr(\"y\", 0).attr(\"width\", function (d) {\n return d.radius * 2 - d.strokeWidth;\n }).attr(\"height\", function (d) {\n return d.radius * 2 - d.strokeWidth;\n }).attr(\"transform\", function (d) {\n return \"translate(\" + -d.radius + \",\" + -d.radius + \")\";\n });\n });\n graphNodesData.selectAll(\".node\").on(\"mouseover.fade\", function (d) {\n return hoverOver(d);\n }).on(\"mouseout.fade\", function () {\n return hoverOut();\n });\n graphNodesData.selectAll(\".node\") // only root and parent nodes are clickable\n .filter(function (d) {\n return rootparent(d);\n }); // DRAW LINKS\n\n var graphLinksData = graphLinksGroup.selectAll(\"g\").data(links, function (d) {\n return linkKey(d);\n });\n graphLinksData.exit().select(\"path\").transition().duration(graphEle.transitionDuration).attr(\"d\", function (d) {\n return generatePath({\n source: {\n x: d.source.x,\n y: d.source.y,\n r: 0\n },\n target: {\n x: d.source.x,\n y: d.source.y,\n r: 0\n }\n }, d.source.type === \"root\" ? false : true);\n }).attr(\"opacity\", 0).remove();\n graphLinksData.exit().transition().duration(graphEle.transitionDuration).remove();\n var graphLinksEnter = graphLinksData.enter().append(\"g\").attr(\"id\", function (d) {\n return \"path-group-\" + linkKey(d);\n });\n graphLinksEnter.append(\"path\").attr(\"class\", \"link\").attr(\"id\", function (d) {\n return \"path-\" + linkKey(d);\n }).attr(\"stroke-width\", function (d) {\n return d.strokeWidth;\n }).attr(\"stroke\", function (d) {\n return d.strokeColor;\n }).attr(\"opacity\", function (d) {\n return d.opacity;\n }).attr(\"d\", function (d) {\n return generatePath({\n source: {\n x: d.source.x0,\n y: d.source.y0,\n r: d.source.radius\n },\n target: {\n x: d.target.x0,\n y: d.target.y0,\n r: d.target.radius\n }\n }, d.source.type === \"root\" ? false : true);\n }); // DRAW LINK LABELS\n\n graphLinksEnter.append(\"text\").attr(\"class\", \"edge-label\").attr(\"font-size\", \"\".concat(graphEle.linkTextSize, \"px\")).attr(\"text-anchor\", \"middle\").attr(\"fill\", graphEle.linkTextFill).attr(\"opacity\", graphEle.linkTextOpacity).attr(\"dy\", -2).append(\"textPath\").attr(\"xlink:href\", function (d) {\n return \"#path-\" + linkKey(d);\n }).attr(\"startOffset\", \"50%\").text(function (d) {\n return \"\".concat(d.label);\n });\n graphLinksData = graphLinksEnter.merge(graphLinksData);\n graphLinksData.selectAll(\".link\").transition().duration(graphEle.transitionDuration).attr(\"opacity\", function (d) {\n return d.opacity;\n }).attr(\"d\", function (d) {\n return generatePath({\n source: {\n x: d.source.x,\n y: d.source.y,\n r: d.source.radius\n },\n target: {\n x: d.target.x,\n y: d.target.y,\n r: d.target.radius\n }\n }, d.source.type === \"root\" ? false : true);\n }); ///////////////////////////////////////////////////////////////////////////////////////////////////////////\n ////////////////////////////////////// Graph Network: Create initeractivity ///////////////////////////////\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n function hoverOver(d) {\n var hoverAttr = {\n hover_textOpacity: 0,\n hover_strokeOpacity: 0.2\n };\n highlightConnections(graphNodesData, graphLinksData, d, hoverAttr);\n }\n\n function hoverOut() {\n unhighlightConnections(graphNodesData, graphLinksData);\n }\n\n function highlightConnections(graphNodesData, graphLinksData, d, hoverAttr) {\n var hover_textOpacity = hoverAttr.hover_textOpacity,\n hover_strokeOpacity = hoverAttr.hover_strokeOpacity;\n\n function isConnected(a, b) {\n return linkedByIndex[\"\".concat(a.id, \",\").concat(b.id)] || linkedByIndex[\"\".concat(b.id, \",\").concat(a.id)] || a.id === b.id;\n }\n\n graphNodesData.selectAll(\".node\").attr(\"opacity\", function (o) {\n return isConnected(d, o) ? 1 : hover_strokeOpacity;\n }).style(\"pointer-events\", function (o) {\n return isConnected(d, o) ? \"auto\" : \"none\";\n });\n graphNodesData.selectAll(\".root-label\").attr(\"opacity\", function (o) {\n return isConnected(d, o) ? 1 : hover_textOpacity;\n });\n graphNodesData.selectAll(\".node-label\").attr(\"opacity\", function (o) {\n return isConnected(d, o) ? 1 : hover_textOpacity;\n });\n graphLinksData.selectAll(\".link\").attr(\"opacity\", function (o) {\n return o.source === d || o.target === d ? 1 : hover_strokeOpacity;\n });\n graphLinksData.selectAll(\".edge-label\").attr(\"opacity\", function (o) {\n return o.source === d || o.target === d ? 0.5 : hover_textOpacity;\n });\n }\n\n function unhighlightConnections(graphNodesData, graphLinksData) {\n graphNodesData.selectAll(\".node\").attr(\"opacity\", graphEle.nodeOpacity).style(\"pointer-events\", \"auto\");\n graphNodesData.selectAll(\".root-label\").attr(\"opacity\", 1);\n graphNodesData.selectAll(\".node-label\").attr(\"opacity\", graphEle.nodeTextOpacity);\n graphLinksData.selectAll(\".link\").attr(\"opacity\", 1);\n graphLinksData.selectAll(\".edge-label\").attr(\"opacity\", graphEle.linkTextOpacity);\n }\n } //draw: update nodes and edges of graph", "function drawNodes() {\r\n that.nodeList.forEach(element => {\r\n c.node = element;\r\n c.nodeRadius = 40;\r\n c.beginPath();\r\n c.strokeStyle = \"black\";\r\n c.fillStyle = \"black\";\r\n c.arc(c.node.x, c.node.y, c.nodeRadius, 0, 2 * Math.PI, false);\r\n c.fill();\r\n c.stroke();\r\n c.closePath();\r\n\r\n // kvadrat i text id\r\n c.beginPath();\r\n c.fillStyle = \"yellow\";\r\n c.fillRect(c.node.x + 44, c.node.y + 8, 60, 60);\r\n c.stroke();\r\n c.closePath();\r\n // id\r\n c.beginPath();\r\n c.fillStyle = \"black\";\r\n c.font = \"40px Verdana\";\r\n c.fillText(c.node.id, c.node.x + 50, c.node.y + 50)\r\n c.fill();\r\n c.stroke();\r\n c.closePath();\r\n\r\n cNodesList.push(Object.assign({}, c));\r\n });\r\n\r\n }", "p5display() {\n this.nodes.forEach(node => {\n node.draw();\n })\n\n strokeWeight(1)\n\n this.edges.forEach(edge => {\n let realNode1 = this.nodes.find(node => node.name === edge.node1);\n let realNode2 = this.nodes.find(node => node.name === edge.node2);\n\n line(realNode1.x, realNode1.y, realNode2.x, realNode2.y);\n })\n }", "function drawGraph(){\n var nodeNo = json['nodes'].length;\n var linkNo = json['links'].length;\n $(\"#stats\").html(\"<p> Showing \"+ nodeNo +\" friends and \"+ linkNo +\" Links </p>\");\n force\n .nodes(json.nodes)\n .links(json.links)\n .start();\n\n var link = svg.selectAll(\".link\")\n .data(json.links)\n .enter()\n .append(\"line\")\n .attr(\"class\",\"link\");\n\n var node = svg.selectAll(\".node\")\n .data(json.nodes)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"node\")\n .on(\"click\", mouseclick)\n .on(\"mouseover\",mouseover)\n .on(\"mouseout\", mouseout)\n .call(force.drag);\n\n node.append(\"circle\")\n .attr(\"r\", 6)\n .style(\"fill\", function(d){ \n if(d.gender == \"male\"){\n return \"#2980b9\";\n }else{\n return \"#e74c3c\";\n }});\n\n\n force.on(\"tick\", function() {\n link.attr(\"x1\", function(d) { return d.source.x; })\n .attr(\"y1\", function(d) { return d.source.y; })\n .attr(\"x2\", function(d) { return d.target.x; })\n .attr(\"y2\", function(d) { return d.target.y; });\n\n node.attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n });\n}", "drawConnections (ctx) {\n let now = LiteGraph.getTime();\n\n //draw connections\n ctx.lineWidth = this.d_connections_width;\n\n ctx.fillStyle = \"#AAA\";\n ctx.strokeStyle = \"#AAA\";\n ctx.globalAlpha = this.d_editor_alpha;\n //for every node\n for (let n = 0, l = this.d_graph.d_nodes.length; n < l; ++n) {\n let node = this.d_graph.d_nodes[n];\n //for every input (we render just inputs because it is easier as every slot can only have one input)\n if (node.inputs && node.inputs.length)\n for (let i = 0; i < node.inputs.length; ++i) {\n let input = node.inputs[i];\n if (!input || input.link == null)\n continue;\n let link_id = input.link;\n let link = this.d_graph.d_links[link_id];\n if (!link)\n continue;\n\n let start_node = this.d_graph.getNodeById(link.origin_id);\n if (start_node == null) continue;\n let start_node_slot = link.origin_slot;\n let start_node_slotpos = null;\n\n if (start_node_slot == -1)\n start_node_slotpos = [start_node.pos[0] + 10, start_node.pos[1] + 10];\n else\n start_node_slotpos = start_node.getConnectionPos(false, start_node_slot);\n\n let color = LGraphCanvas.link_type_colors[node.inputs[i].type] || this.d_efault_link_color;\n\n this.d_renderLink(ctx, start_node_slotpos, node.getConnectionPos(true, i), color);\n\n if (link && link._last_time && now - link._last_time < 1000) {\n let f = 2.0 - (now - link._last_time) * 0.002;\n let color = \"rgba(255,255,255, \" + f.toFixed(2) + \")\";\n this.d_renderLink(ctx, start_node_slotpos, node.getConnectionPos(true, i), color, true, f);\n }\n }\n }\n ctx.globalAlpha = 1;\n }", "function drawNodes(nodes) {\n // Add g component\n nodePointer = svgPointer.selectAll('.node')\n .data(nodes)\n .enter()\n .append('g')\n .attr('class', 'node');\n\n // Add tooltip for node representation\n textPointer = nodePointer.filter( function(d) { return d.type !== INTERMEDIATE} )\n .append('text')\n .text( function(d) {return d.operator + ',' + d.id; })\n .attr('opacity', 0)\n .attr('dx', '20px')\n .attr('dy', '4px')\n .style('fill', 'rgb(100,)')\n .style('font-family', 'Montserrat');\n\n\n // Add circles\n circlePointer = nodePointer.filter(function (d) { return d.type !== graph.ATOM; })\n .append('circle')\n .attr('fill', function(d) {\n if (d.type === EPSILON) {\n return 'rgb(240,95,64)';\n } else {\n return '#ffffff';\n }\n })\n .attr('stroke', function(d) {\n if (d.type === ROOT) {\n return 'rgb(5,168,170)';\n } else if (d.type === ACCEPT) {\n return 'rgb(231,29,54)';\n } else if (d.type === EPSILON) {\n return '#ffffff';\n } else {\n return '#ffffff';\n }\n })\n .style( 'stroke-width', 2)\n .attr('title', function(d) {return d.type})\n .attr('r', function(d) {\n if (d.type === INTERMEDIATE) {\n return 0;\n }\n return RADIUS;\n });\n\n // Add images\n\n imagePointer = nodePointer.filter(filterByRep)\n .append('g')\n .attr('transform', 'translate(-15 , -30)')\n .append('svg:image')\n .attr('xlink:href', function(d) {\n switch (d.component) {\n // KEEP IN ALPHABETICAL ORDER\n case EPSILON:\n case OR_MORE:\n case 'ZERO':\n return;\n default:\n switch (Object.keys(d.component)[0]) {\n case 'aptamer':\n case 'assemblyScar':\n case 'bluntRestrictionSite':\n case 'cds':\n case 'dnaStabilityElement':\n case 'engineeredRegion':\n case 'fivePrimeOverhang':\n case 'fivePrimeStickyRestrictionSite':\n case 'insulator':\n case 'nonCodingRna':\n case 'operator':\n case 'originOfReplication':\n case 'originOfTrasnfer':\n case 'polyA':\n case 'promoter':\n case 'proteaseSite':\n case 'proteinStabilityElement':\n case 'ribosomeBindingSite':\n case 'ribozyme':\n case 'signature':\n case 'terminator':\n return './sbol/' + Object.keys(d.component)[0] + '.svg';\n default:\n return './sbol/' + 'noGlyphAssigned.svg';\n }\n }\n })\n .attr('width', IMAGESIZE);\n}", "function redrawOutput(ctx, nodes, edges) {\n\t// Clear movable objects\n ctx.clearRect(0, 0, ctx.width, ctx.height);\n\t\n\t// Draw every node\n var radius = 30;\n\tnodes.forEach(function(node) {\n ctx.fillStyle = \"rgba(0,111,187,\" + node.opacity.toFixed(3) + \")\";\n ctx.beginPath();\n ctx.arc(node.posX, node.posY, radius, 0, 2 * Math.PI, false);\n ctx.fill();\n\t});\n\t\n\t// Draw every edge\n\tedges.forEach(function(edge) {\n\t\tvar nodeA = edge.nodeA;\n\t\tvar nodeB = edge.nodeB;\n\t\tvar dx = nodeA.posX - nodeB.posX;\n\t\tvar dy = nodeA.posY - nodeB.posY;\n\t\tvar mag = Math.hypot(dx, dy);\n ctx.lineWidth = 2;\n\t\tif (mag > nodeA.radius + nodeB.radius) { // Draw edge only if circles don't intersect\n\t\t\tdx /= mag; // Make (dx, dy) a unit vector, pointing from B to A\n\t\t\tdy /= mag;\n\t\t\tvar opacity = Math.min(Math.min(nodeA.opacity, nodeB.opacity), edge.opacity);\n\n ctx.strokeStyle = \"rgba(988,139,197,\" + opacity.toFixed(3) + \")\";\n ctx.beginPath();\n ctx.stroke();\n\t\t}\n\t});\n}", "function draw(parent,child,divs, link){\n //console.log(document.getElementById(\"s_g1\"));\n var width = document.getElementById(divs).offsetWidth; // Stimmen !!!\n var height = document.getElementById(divs).offsetHeight;\n var title;\n\n // colors for links\n if(divs == \"s_g1\"){\n var color = \"#386cb0\";\n title = \"Graph 1\";\n }\n if(divs == \"s_g2\"){\n var color = \"#7fc97f\";\n title = \"Graph 2\";\n }\n if(divs == \"s_g3\"){\n var color = \"#fdc086\";\n title = \"Graph 3\";\n }\n if(divs == \"s_g4\"){\n var color = \"#beaed4\";\n title = \"Graph 4\";\n }\n\n var rect = d3.select(\"#\"+divs).append(\"rect\")\n .attr(\"width\", \"50\")\n .attr(\"height\", \"15\")\n .attr(\"transform\", \"translate(0,0)\")\n .style(\"background-color\", \"lightgrey\")\n .style(\"border-right\", \"1px solid lightgrey\")\n .style(\"border-bottom\", \"1px solid lightgrey\");\n rect.append(\"text\").attr(\"id\", \"graphnumbertext\").attr(\"x\", 1).attr(\"y\", 11).text(title);\n\n var canvas = d3.select(\"#\"+divs).append(\"svg\")\n .attr(\"width\", \"100%\")\n .attr(\"height\", \"calc(100% - 16px)\")\n .call(d3.zoom().on(\"zoom\", function(){\n canvas.attr(\"transform\", d3.event.transform)\n })).on(\"dblclick.zoom\", null)\n .append(\"g\")\n .attr(\"id\", \"single_\" + divs);\n\n var n = new Array();\n for(var i =0; i<parent.length;i++){\n parent[i].x = 10;\n parent[i].y = i*100+10;\n n.push(parent[i]);\n }\n for(var i =0; i<child.length;i++){\n child[i].x = 110;\n child[i].y = i*100+10;\n n.push(child[i]);\n }\n var nodes = n;\n var links = link;\n console.log(nodes);\n\nvar simulation = d3.forceSimulation(nodes)\n //.force(\"linkForce\", d3.forceLink().distance(30).strength(10));\n .force(\"center\", d3.forceCenter(width/2, height/2)) //geht nicht\n .force(\"charge\", d3.forceManyBody().strength(-1000))\n .force(\"collide\", d3.forceCollide().radius(100))\n .force(\"link\", d3.forceLink(links).id(function(d){ return d.node;}).strength(2));\n //simulation.stop();\n\n var n = canvas.selectAll(\".node\")\n .data(nodes)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"node\")\n .attr(\"transform\", function (d) {\n return \"translate(\"+ d.x +\", \"+ d.y +\" )\";\n });\n\n r_width = 20;\n r_height = 20;\n\n n.append(\"rect\")\n //.attr(\"r\", 30)\n .attr(\"width\", r_width)\n .attr(\"height\", r_height)\n .attr(\"viewBox\", (d) => \"d.x, d.y ,d.x+20, d.y+20\")\n .attr(\"fill\", \"lightgray\");\n\n var text = canvas.append(\"g\")\n .attr(\"class\", \"labels\")\n .selectAll(\"text\")\n .data(nodes)\n .enter()\n .append(\"text\")\n .attr(\"text-anchor\", \"middle\")\n .text(function (d) {\n return d.node;\n })\n .attr(\"dominant-baseline\", \"middle\")\n //.attr(\"x\", \"50%\")\n //.attr(\"y\", \"50%\");\n .attr(\"x\", function(d){\n return d.x + (20/2);})\n .attr(\"y\", function(d){return d.y + (20/2);});\n\n // gibt textgröße aus\n //var r_width = n.select(\"text\").node().getBoundingClientRect().width;\n //var r_height = n.select(\"text\").node().getBoundingClientRect().height;\n\n /*\n var diagonal = d3.svg.diagonal()\n .projection(function (d) {\n return [d.y, d.x];\n });\n */\n\n canvas.append(\"svg:defs\").selectAll(\"marker\")\n .data([\"end\"])\n .enter().append(\"svg:marker\")\n .attr(\"id\", \"arrow\")\n .attr(\"viewBox\", \"0 -5 10 10\")\n .attr(\"refX\", 10)\n .attr(\"refY\", 0)\n .attr(\"markerWidth\", 6)\n .attr(\"markerHeight\", 6)\n .attr(\"fill\", function(d){if(d.g ==1) return \"#386cb0\";\n if(d.g ==2) return \"#7fc97f\";\n if(d.g ==3) return \"#fdc086\";\n if(d.g ==4) return \"#beaed4\";}) //warum wird alles schwarz????\n .attr(\"orient\", \"auto\")\n .append(\"svg:path\")\n .attr(\"d\", \"M0,-5L10,0L0,5\");\n\n var l =canvas.selectAll(\".link\")\n .data(links)\n .enter()\n .append(\"path\")\n .attr(\"class\", \"link\")\n .style(\"stroke\", color)\n .style(\"stroke-width\", 2.0)\n .attr(\"marker-end\", \"url(#arrow)\")\n //.attr(\"x1\", function(d) { return d.source.x+20; })\n //.attr(\"y1\", function(d) { return d.source.y+20/2; })\n //.attr(\"x2\", function(d) { return d.target.x; })\n //.attr(\"y2\", function(d) { return d.target.y+20/2; })\n .attr( \"d\", (d) => \"M\" + (d.source.x + r_width) + \",\" + (d.source.y + r_height/2) + \", \" + d.target.x + \",\" + (d.target.y+r_height/2));\n //.attr(\"transform\", \"translate( 20, 10)\");\n //.attr(\"d\", diagonal);\n\n simulation.on(\"tick\",function() {\n n.attr(\"x\",function(d){ return d.x;}).attr(\"y\",function(d){return d.y;});\n });\n\n }", "draw(data) {\n //clear the svg\n this.vis.selectAll(\"*\").remove();\n\n //our graph, represented through nodes and links\n let nodes = [];\n let links = [];\n\n //add our nodes\n //add the committee nodes\n let init_y = 0;\n Object.keys(data.committees || {}).forEach((key) => {\n nodes.push({id:\"c_\"+data.committees[key].id, name: data.committees[key].name, x: 300, fx: 300, y: init_y+=60});\n });\n\n //add the representative nodes\n init_y = 0;\n Object.keys(data.representatives || {}).forEach((key) => {\n nodes.push({id:\"r_\"+data.representatives[key].id, name: data.representatives[key].name,party:data.representatives[key].party, x:600, fx: 600, y: init_y+=60});\n });\n\n //add the bill nodes\n init_y = 0;\n Object.keys(data.bills || {}).forEach((key) => {\n nodes.push({id:\"b_\"+data.bills[key].bill_id, name: data.bills[key].name, bill:true, x: 900, fx: 900, y: init_y+=60});\n });\n\n //add our links\n //add the donation links between committees and representatives\n Object.keys(data.donations || {}).forEach((key) => {\n if(data.donations[key].source in data.committees && data.donations[key].destination in data.representatives){\n links.push({source:\"c_\"+data.donations[key].source, target: \"r_\"+data.donations[key].destination,thickness:data.donations[key].amount, status:data.donations[key].support == \"S\" ? 1 : 2});\n }\n });\n\n //add the vote links between representatives and bills\n Object.keys(data.votes || {}).forEach((key) => {\n if(data.votes[key].source in data.representatives && data.votes[key].destination in data.bills){\n links.push({source:\"r_\"+data.votes[key].source, target: \"b_\"+data.votes[key].destination, status:data.votes[key].position == \"Yes\" ? 1 : data.votes[key].position == \"No\" ? 2 : 3});\n }\n });\n\n //a scaling function that limits how think or thin edges can be in our graph\n let thicknessScale = d3.scaleLinear().domain([0,d3.max(data.donations,(d) => {return d.amount;})]).range([2, 20]);\n\n //function that calls our given context menu with the appropria parameters\n let contextMenu = (d) => {\n let event = d3.getEvent();\n event.preventDefault();\n this.nodeMenu(d, event);\n };\n\n //Create a force directed graph and define forces in it\n //Our graph is essentially a physics simulation between nodes and edges\n let force = d3.forceSimulation(nodes)\n .force(\"charge\", d3.forceManyBody().strength(250).distanceMax(300))\n .force('link', d3.forceLink(links).distance(0).strength(.1).id((d) => {return d.id;}))\n .force(\"collide\", d3.forceCollide().radius(30).iterations(2).strength(.7))\n .force(\"center\", d3.forceCenter())\n .force('Y', d3.forceY().y(0).strength(.001));\n //Draw the edges between the nodes\n let edges = this.vis.selectAll(\"line\")\n .data(links)\n .enter()\n .append(\"line\")\n .style(\"stroke-width\", (d) => { return thicknessScale(d.thickness); })\n .style(\"stroke\", (d) => {\n if(d.status == 1) {\n return \"Green\";\n } else if(d.status == 2) {\n return \"Purple\";\n }\n return \"White\";\n })\n .attr(\"marker-end\", \"url(#end)\");\n //Draw the nodes themselves\n let circles = this.vis.selectAll(\"circle\")\n .data(nodes)\n .enter()\n .append(\"circle\")\n .attr(\"r\", 20)\n .style(\"stroke\", \"black\")\n .style(\"fill\", (d) => {\n if(d.party == \"R\"){\n return d.color = \"#E64A19\"; //red\n } else if(d.party==\"D\"){\n return d.color = \"#1976D2\"; //blue\n } else {\n return d.color = \"#BCAAA4\"; //brown\n }\n })\n .on('contextmenu', contextMenu);\n //Draw text for all the nodes\n let texts = this.vis.selectAll(\"text\")\n .data(nodes)\n .enter()\n .append(\"text\")\n .attr(\"fill\", \"black\")\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"10px\")\n .html((d) => { return d.name; })\n .each((d, i, nodes) => { d.bbox = nodes[i].getBBox(); })\n .on('contextmenu', contextMenu);\n //Draw text background for all the nodes\n let textBGs = this.vis.selectAll(\"rect\")\n .data(nodes)\n .enter()\n .insert(\"rect\", \"text\")\n .attr(\"fill\", (d) => {return d.color;})\n .attr(\"width\", (d) => {return d.bbox.width+10})\n .attr(\"height\", (d) => {return d.bbox.height+10})\n .on('contextmenu', contextMenu);\n\n //For every tick in our simulation, we update the positions for all ui elements\n force.on(\"tick\", () => {\n edges.attr(\"x1\", (d) => { return d.source.x; })\n .attr(\"y1\", (d) => { return d.source.y; })\n .attr(\"x2\", (d) => { return d.target.x; })\n .attr(\"y2\", (d) => { return d.target.y; });\n circles.attr(\"cx\", (d) => { return d.x; })\n .attr(\"cy\", (d) => { return d.y; })\n texts.attr(\"transform\", (d) => { return \"translate(\" + (d.party || d.bill ? d.x : d.x-d.bbox.width) + \",\" + (d.y+(d.bbox.height/4)) + \")\"; });\n textBGs.attr(\"transform\", (d) => { return \"translate(\" + (d.party || d.bill ? d.x-5 : d.x-d.bbox.width-5) + \",\" + (d.y-(d.bbox.height*.5)-5) + \")\"; });\n }); // End tick func\n\n //zoom and pan our graph such that all elements are visible\n setTimeout(() => {this.zoomTo(this.vis)}, 500);\n }", "drawLinksRB (scene, node){\n if(node != null) {\n node.drawLinkToParentRB(scene)\n this.drawLinksRB (scene, node.left)\n this.drawLinksRB (scene, node.right)\n }\n }", "function drawAllLines(){\n\tclearLines();\n\tvar nodesToBeDrawn = [];\n\t//create new array of objects ordered by id, with int list of indexes of linked nodes\n\tvar val = GJSONOrdered;\n\tGJSONOrdered.forEach(function(elem){\n\t\tnodesToBeDrawn[elem.properties.id] = {\n\t\t\t'node': elem, \n\t\t\t'linesToDo': elem.properties.LinkedTo.slice()\n\t\t}\n\t});\t\n\t//draw the lines between nodes\n\tnodesToBeDrawn.forEach(function(currNode){\n\t\tif(currNode.linesToDo.length != 0){\n\t\t\tcurrNode.linesToDo.forEach(function(dest){\n\t\t\t\tvar destNode = nodesToBeDrawn[dest];\n\t\t\t\tvar index = destNode.linesToDo.indexOf(currNode.node.properties.id);\n\t\t\t\t//if the link is two-way, remove the other pointer, to prevent drawing the line twice\n\t\t\t\tif(index != -1){\n\t\t\t\t\tdestNode.linesToDo.splice(index, 1);\n\t\t\t\t}\n\t\t\t\t//draw a line respresnting this edge\n\t\t\t\tif(currNode.node.properties.Level){\n\t\t\t\t\tdrawLine([currNode.node.geometry.coordinates, destNode.node.geometry.coordinates], currNode.node.properties.Level);\n\t\t\t\t}else{\n\t\t\t\t\tdrawLine([currNode.node.geometry.coordinates, destNode.node.geometry.coordinates], -1);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}", "function tick() {\n links\n .attr('x1', function(d) { return d.source.x; })\n .attr('y1', function(d) { return d.source.y; })\n .attr('x2', function(d) { return d.target.x; })\n .attr('y2', function(d) { return d.target.y; });\n\n nodes\n .attr('cx', function(d) { return d.x; })\n .attr('cy', function(d) { return d.y; });\n }", "function tick() {\n // redraw the path of the links given their source/target node positions\n _this.link.attr('d', d => {\n const prevStart = d.start ? d.start : d.source\n const prevEnd = d.end ? d.end : d.target\n const start = _this.getClosestMidpointOnRect(d.target, d.source)\n const end = _this.getClosestPointOnRect(prevStart, d.target)\n d.midX = (start.x + end.x) / 2\n d.midY = (start.y + end.y) / 2\n d.start = start\n d.end = end\n return `M${start.x},${start.y}L${end.x},${end.y}`\n })\n\n _this.lock.attr('x', d => d.midX)\n .attr('y', d => d.midY)\n .attr('transform', d =>\n `translate(${d.midX - 8},${d.midY - 10})scale(.7,.7)`)\n\n // redraw the ndes at their new position\n _this.node.attr('x', d => d.x - _this.props.nodeSize.width / 2)\n .attr('y', d => d.y - _this.props.nodeSize.height / 2)\n\n _this.nodelabels\n .attr('x', d => d.x - _this.props.nodeSize.width / 2 + 6)\n .attr('y', d => d.y - _this.props.nodeSize.height / 2 + 4)\n\n _this.warn\n .attr('transform', d =>\n `translate(${d.x + _this.warnOffset.x},${d.y - _this.warnOffset.y}),scale(0.3,0.3)`)\n\n _this.warnBackground\n .attr('cx', d => d.x + _this.props.nodeSize.width / 2 - 0.5)\n .attr('cy', d => d.y - _this.props.nodeSize.height / 2 + 3.5)\n }", "function paintAll() {\n var nodes = tree.nodes(mainRoot);\n var links = tree.links(nodes);\n\n setParent(mainRoot);\n\n paintLinks();\n paintNodes();\n\n //Setting parents for each element\n function setParent(node) {\n if ('children' in node) {\n for (var index in node.children) {\n node.children[index].parent = node;\n setParent(node.children[index]);\n }\n }\n }\n\n //painting nodes\n function paintNodes() {\n var forNodes = formD3ChainCalls(panel, \"g#noderz\"+graphId+\"|id'noderz\"+graphId);\n var update = forNodes.selectAll(\".node\").data(nodes, function (d) {return \"\"+ d.uniqueId + d.expanded;});\n var enter = update.enter();\n var exit = update.exit();\n\n enter.append(\"g\").attr(\"class\", \"node\").style('opacity', 0).attr('transform', function (d) {\n if (typeof d === 'object' && 'parent' in d) {\n if (!d.ui) {\n if (d.type == elementTypes.paginator) createPaginator(d, d3.select(this));\n else if (d.type == elementTypes.loader) createLoader(d, d3.select(this));\n } else {\n if (d.type == elementTypes.paginator) this.appendChild(d.ui.root.node());\n else if (d.type == elementTypes.loader) this.appendChild(d.ui.root.node());\n }\n return \"translate(\" + d.parent.y + \",\" + d.parent.x + \")\";\n } else return \"translate(0,0)\";\n });\n\n exit.filter(function (d) { return !d.wasDiscarded; })\n .transition().duration(p.animdur).style('opacity', 0).attr('transform', function (d) {\n if (typeof d !== 'object' || !('parent' in d)) return \"translate(0,0)\";\n else return \"translate(\" + d.parent.y + \",\" + d.parent.x + \")\";\n }).remove();\n exit.filter(function (d) { return d.wasDiscarded; })\n .transition().duration(p.animdur).style('opacity', 0).remove();\n\n update.attr('pointer-events', function (d) { return willBeDiscarded(d) ? 'none' : null; })\n .transition().duration(function (d) { return willBeDiscarded(d) ? p.discardAnimDuration : p.animdur; })\n .attr(\"transform\", function (d) { return \"translate(\" + d.y + \",\" + d.x + \")\";})\n .style('opacity', function (d) { return willBeDiscarded(d) ? 0.2 : 1; })\n .each(function (d) {\n var thisItem = d3.select(this);\n if (d.type == elementTypes.paginator) { updatePaginator(d, thisItem); }\n else if (d.type == elementTypes.loader) { updateLoader(d, thisItem); }\n else if (d.type == elementTypes.objProperty) {\n thisItem.text('');\n paintObjProperty(d, thisItem);\n } else if (d.type == elementTypes.instance) {\n if (d.dataIndicator && d.dataIndicator.ui) {\n d.dataIndicator.ui.remove();\n d.dataIndicator.ui = null;\n }\n thisItem.text('');\n paintInstance(d, thisItem);\n }\n if (d.pageIndicator) { arrangePageIndicator(d, d.pageIndicator); }\n });\n\n function createPaginator(d, parent) {\n d.ui = svgui.Paginator({parent: parent, color: d.parent.color, width: 160});\n d.ui.onPageChanged = function (page) { onPageChanged(page, d, d.parent); };\n }\n\n function onPageChanged(newPage, paginatorModel, parentModel) {\n if (parentModel.pageRequest && parentModel.pageRequest.isRunning)\n parentModel.pageRequest.cancel();\n if (parentModel.pageIndicator)\n parentModel.pageIndicator.remove();\n\n var margin = 15, nodeSize = p.nodeWidth - p.nodeDif;\n var indicator = Indicator.create(panel, {size: p.pageIndicatorSize, maxWidth: nodeSize - margin}).run();\n arrangePageIndicator(parentModel, indicator);\n parentModel.pageIndicator = indicator;\n paginatorModel.currentPage = newPage;\n\n if (parentModel.type == elementTypes.objProperty) {\n parentModel.pageRequest = requestForInstances(parentModel, newPage, renderParams.pageLimitForInstances, indicator);\n } else if (parentModel.type == elementTypes.instance) {\n parentModel.pageRequest = requestForObjPropPage(parentModel, newPage, renderParams.pageLimitForObjectProperties, indicator);\n }\n paintAll();\n }\n\n function arrangePageIndicator(parentModel, indicatorInstance) {\n var minX = Infinity;\n var minY = Infinity, maxY = -Infinity;\n panel.selectAll(\".node\").filter(function (nodeData) {\n return nodeData.parent === parentModel && nodeData.type != elementTypes.paginator;\n }).each(function (d) {\n // d.x and d.y are swapped here\n minX = Math.min(minX, d.y);\n var height = calcHeight(d);\n minY = Math.min(minY, d.x - height / 2);\n maxY = Math.max(maxY, d.x + height / 2);\n });\n\n var margin = 15, nodeSize = p.nodeWidth - p.nodeDif;\n var position = vector(minX - nodeSize / 2 + p.pageIndicatorSize / 2 + margin, minY + (maxY - minY) / 2);\n indicatorInstance.moveTo(position);\n }\n\n function createLoader(d, parent) {\n var container = parent.append(\"g\").attr(\"width\", p.childrenLoaderSize).attr(\"height\", p.childrenLoaderSize);\n d.ui = Indicator.create(container, {size: p.childrenLoaderSize}).run();\n d.ui.root = container;\n updateIndicatorUI(d);\n }\n\n function paintObjProperty(d, d3This){\n var uiElement = d.ui;\n var halfWidth = (p.nodeWidth-p.nodeDif) / 2;\n var ti = textInfo(d.name, \"basicTextInGraph\");\n uiElement.render(d3This, 0 -( (ti.width/2>=halfWidth)?halfWidth:((ti.width)/2)), 10, p.nodeWidth - p.nodeDif);\n\n var path = (d.direction == 'OUT') ? \"M0,-5L10,0L0,5\" : \"M0,-5L-10,0L0,5\";//Triangle\n d3This.append(\"path\").attr(\"d\", path).attr(\"fill\", d.parent.color);\n\n //Circle expander\n var circle = d3This.append(\"circle\").attr({cx:halfWidth,cy:0,r:10, fill:'white',stroke: d.color,'stroke-width':2});\n path = (!d.children) ? \"M0,-5L10,0L0,5\" : \"M0,-5L-10,0L0,5\";\n var triangle = d3This.append(\"path\").attr(\"d\", path).attr(\"fill\", d.parent.color).attr(\"transform\",\"translate(\" + ((!d.children)?(halfWidth-4):(halfWidth+3)) + \",\" + 0 + \")\");\n circle.on(\"mousedown\", rightAction);\n triangle.on(\"mousedown\", rightAction);\n\n function rightAction() {\n invokeRightAction(d, function (d) { rightActionForObjectProperty(d); });\n }\n }\n\n function paintInstance(d,d3This){\n var uiElement = (d.expanded)? d.uiExpanded : d.ui;\n var leftRightHeight = uiElement.height(p.nodeWidth - p.nodeDif);\n var halfWidth = (p.nodeWidth-p.nodeDif) / 2;\n //If it's not root - we create left ear\n var leftEar=null;\n var rightEar=null;\n if (d.parent && !d.error){\n leftEar = createEar(d, d3This,-halfWidth - p.buttonWidth,\n -(leftRightHeight / 2) + 1, halfWidth , leftRightHeight,\n uiElement, leftAction(d), \"M5,-5L-5,0L5,5\",-halfWidth-(p.buttonWidth)/2);\n }\n //right ear\n if (!d.error) {\n rightEar = createEar(d, d3This, 0 , -(leftRightHeight / 2) + 1, halfWidth + p.buttonWidth,\n leftRightHeight, uiElement, function() {\n invokeRightAction(d, function (d) { rightActionForInstance(d); });\n }, (d.children) ? \"M5,-5L-5,0L5,5\" : \"M-5,-5L-5,5L5,0\",\n (d.children) ? (halfWidth+(p.buttonWidth-4)/2) : (halfWidth+(p.buttonWidth)/2));\n }\n //render main element after ears\n uiElement.render(d3This, -halfWidth, -leftRightHeight / 2, p.nodeWidth-p.nodeDif);\n if (!d.error) uiElement.setAction(\"mousedown.open\", centerAction(d));\n uiElement.setAction(\"mouseover.uwi\", onMouseElement(1));\n uiElement.setAction(\"mouseout.uwi\", onMouseElement(0));\n\n //Changing opacity to 0 or 1\n function onMouseElement(opacity){\n return function () {\n if(rightEar!=null) rightEar.transition().duration(p.animdur).attr(\"opacity\", opacity);\n if (leftEar != null) leftEar.transition().duration(p.animdur).attr(\"opacity\", opacity);\n };\n }\n\n //create left or right ear\n function createEar(d, d3This, x ,y, width, height, uiElement, action, path, translate){\n var ear = d3This.append(\"g\").attr(\"opacity\",0);\n addBorderedRect(ear, x , y, width, height, 2, \"white\", uiElement.RxRy(), uiElement.RxRy(), d.color);\n ear.append(\"path\").attr(\"d\", path).attr(\"fill\", d.color).attr(\"transform\",\"translate(\"+translate+\",0)\");\n actionSet(ear);\n return ear;\n\n function actionSet(item){\n item.on(\"mousedown\", action);\n item.on('mouseover', function () { ear.transition().duration(p.animdur).attr(\"opacity\",1);});\n item.on('mouseout', function () { ear.transition().duration(p.animdur).attr(\"opacity\",0);});\n }\n }\n }\n\n function invokeRightAction(d, rightActionHandler) {\n var isExpanded = d['children'], hasCollapsedChildren = d['_children'];\n var isLoadingError = d.pageRequest && d.pageRequest.isFailed;\n if (isExpanded || !isLoadingError && hasCollapsedChildren) {\n expandOrCollapseChildren(d);\n paintAll();\n } else {\n d['_children'] = false;\n rightActionHandler(d);\n }\n }\n\n function updatePaginator(d, d3This) {\n d.ui.currentPage = d.currentPage;\n d.ui.pageCount = d.overallPages;\n d.ui.update();\n var size = svgui.measure(d.ui, vector(p.nodeWidth - p.nodeDif, Infinity));\n svgui.arrange(d.ui, -((size.x / 2 >= (p.nodeWidth - p.nodeDif) / 2)\n ? (p.nodeWidth - p.nodeDif) / 2 : size.x / 2), -10);\n }\n\n function updateLoader(d, d3This) {\n var height = d.ui.size;\n d.ui.parent.attr(\"transform\", \"translate(\" +\n (-(p.nodeWidth - p.nodeDif) / 2 + 5) + \",\" + (-height / 2) + \")\");\n }\n }\n\n //painting links\n function paintLinks() {\n var forLinks = formD3ChainCalls(panel, \"g#linkers\"+graphId+\"|id'linkers\"+graphId);\n var update = forLinks.selectAll(\".link\").data(links, function (d) {return d.source.uniqueId + \"_\" + d.target.uniqueId;});\n var enter = update.enter();\n var exit = update.exit();\n\n enter.append(\"path\").attr(\"class\", \"link\").attr('stroke', function (d) {\n if (d.source.type == elementTypes.instance) return d.source.color;\n else if (d.source.type == elementTypes.objProperty) return d.source.parent.color;\n }).style('opacity',0);\n\n exit.filter(function (d) { return !d.target.wasDiscarded; })\n .transition().duration(p.animdur).attr(\"d\", function (d) {\n var o = {x: d.target.x, y: d.target.y};\n return diagonal({source: o, target: o});\n }).style('opacity', 0).remove();\n exit.filter(function (d) { return d.target.wasDiscarded; }).remove();\n\n update.transition().duration(function (d) { return willBeDiscarded(d.target) ? p.discardAnimDuration : p.animdur; })\n .attr(\"d\", function (d) {\n /// !!!!! X and Y are inverted here!!!!!\n if (d.target.type == elementTypes.paginator) return \"M\"+ d.target.y+\",\"+ d.target.x;\n var m = (d.source.y + d.target.y) / 2;\n var halfWidth = (p.nodeWidth-p.nodeDif) / 2;\n var k = [\n {x: d.source.x, y: d.source.y + halfWidth }, //left point\n {x: d.source.x, y: m}, //middle left\n {x: d.target.x, y: m}, //middle right\n {x: d.target.x, y: d.target.y - halfWidth } //right point\n ];\n\n var toRet = \"\";\n var prefix = \"M\";\n var suffix = \"\";\n var firstDone = false;\n if (d.target.type == elementTypes.objProperty)//if left element is object property - we make a long line\n suffix += \"M\" + (d.target.y - halfWidth) + \",\" + d.target.x +\" L\" + (d.target.y+halfWidth ) + \",\" + d.target.x;\n\n k = k.map(function (d) { return [ d.y, d.x ];});\n each(k, function (d) {\n if (!firstDone) {toRet += d + \" C\";firstDone = true;}\n else toRet += d + \" \";\n });\n\n return prefix + toRet.trim() + suffix;\n }).style('opacity', function (d) { return willBeDiscarded(d.target) ? 0.2 : 1; });\n }\n }", "function drawNetwork(w){\n\t fill(255, 255, 255);\n strokeWeight(1);\n stroke(100);\n for (var layer=0; layer<nodesPerLayer.length; layer+=1){\n for (var node=0; node<nodesPerLayer[layer]; node+=1){\n if (nodesPerLayer.length>layer+1){\n for (var nextLayerNode=0; nextLayerNode<nodesPerLayer[layer+1]; nextLayerNode +=1){\n drawWire(layer,node,layer+1,nextLayerNode,w);\n }\n }\n drawNode(layer,node);\n }\n }\n}", "function draw() {\n var width = 960;\n var height = 500;\n\n var force = d3.layout.force()\n\t\t.gravity(.05)\n\t\t.distance(200)\n\t\t.charge(-400)\n\t\t.size([width, height]);\n\n force.nodes(nodes_data).links(links_data).start();\n\n link.attr(\"class\", \"link\")\n .style('stroke', d => d.stroke)\n .style(\"stroke-width\", function(d) { return Math.sqrt(d.weight); });\n\n node.attr(\"class\", \"node\").call(force.drag);\n\n node.append(\"circle\")\n .attr('r', d => d.radius)\n .style('fill', d => d.fill)\n .style('stroke', d => d.stroke);\n\n node.append(\"text\")\n .attr('text-anchor', 'middle')\n .attr('dy', '0.35em') // http://stackoverflow.com/a/8684888/4131237\n .text(d => d.id.substr(d.id.length-3));\n\n force.on(\"tick\", function() {\n link.attr(\"x1\", function(d) { return d.source.x; })\n .attr(\"y1\", function(d) { return d.source.y; })\n .attr(\"x2\", function(d) { return d.target.x; })\n .attr(\"y2\", function(d) { return d.target.y; });\n\n node.attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n });\n \n svg.selectAll('.link').data(links_data).exit().remove();\n node.selectAll('g').data(nodes_data).exit().remove();\n}", "function drawTree(){\n drawLeaves();\n drawTrunk();\n penUp();\n}", "function drawNodes(ctx, d, r, opacity) {\n if (opacity) ctx.globalAlpha = opacity; //If this is an element from the most recent year, make a black \"outline\"\n\n if (d.type === 'element' && d.meta && d.meta.year === latest_year) {\n ctx.beginPath();\n ctx.strokeStyle = 'black';\n ctx.lineWidth = d.stroke_width * 0.4;\n ctx.arc(d.x, d.y, d.r + d.stroke_width, 0, pi2);\n ctx.stroke();\n ctx.closePath();\n } //if\n\n\n ctx.fillStyle = d.fill; //If the element circles are big enough, draw images inside\n\n if (d.type === 'element' && d.img && d.img_loaded && (r > photo_size || show_photos)) {\n //When saving, making the stroke width smaller\n var radius = show_photos ? r - d.stroke_width * 0.2 / 2 : r - d.stroke_width / 2;\n drawImage(ctx, d, r, radius);\n } //if\n\n\n ctx.beginPath(); //The shape depends on the type of node\n\n if (d.type === 'whc') {\n drawDiamond(ctx, d.x, d.y, 1.5 * r, 2 * r);\n ctx.fill();\n } else if (d.type === 'region') {\n drawHexagon(ctx, d.x, d.y, sqrt3 * r, 2 * r);\n ctx.fill();\n ctx.lineWidth = d.stroke_width;\n ctx.strokeStyle = 'white';\n ctx.stroke();\n } else if (d.type === 'country') {\n drawDiamond(ctx, d.x, d.y, 2 * r, 2 * r);\n ctx.fill();\n ctx.lineWidth = d.stroke_width; // ctx.strokeStyle = \"white\"\n // ctx.stroke()\n } else if (d.type === 'concept') {\n // ctx.arc(d.x, d.y, r, 0, pi2)\n //Bigger nodes are white with a colored stroke\n //Small nodes get the colored fill with no stroke\n if (r > 2) {\n //If there are multiple biomes, but no main, draw a donut chart as stroke\n if (!d.biome_main && d.biomes && d.biomes.length > 1) {\n drawNodePieChart(ctx, d, r - d.stroke_width / 2, r + d.stroke_width / 2); //Stroke the pie chart, but don't make the strokes too thick\n\n ctx.beginPath();\n ctx.arc(d.x, d.y, r - d.stroke_width / 2, 0, pi2);\n ctx.closePath();\n if (opacity) ctx.globalAlpha = 1;\n ctx.fillStyle = 'white';\n ctx.fill();\n } else {\n ctx.arc(d.x, d.y, r, 0, pi2);\n ctx.strokeStyle = d.fill;\n ctx.lineWidth = d.stroke_width;\n if (opacity) ctx.globalAlpha = 1;\n ctx.fillStyle = 'white';\n ctx.fill();\n if (opacity) ctx.globalAlpha = opacity;\n ctx.stroke();\n } //else\n\n } else {\n ctx.arc(d.x, d.y, r, 0, pi2);\n ctx.fillStyle = d.fill;\n ctx.fill();\n } //else\n\n } else if (d.type === 'element') {\n //If the element circles are big enough, draw images inside\n if (d.img && d.img_loaded && (r > photo_size || show_photos)) {\n //Draw a colored stroke around the image\n ctx.lineWidth = d.stroke_width * (show_photos ? 0.2 : 1);\n ctx.strokeStyle = d.fill;\n ctx.arc(d.x, d.y, r, 0, pi2);\n ctx.stroke();\n } else {\n //Draw a completely filled circle\n if (d.biome_main) {\n drawNodePieChart(ctx, d, 0, r); //Stroke the pie chart, but don't make the strokes too thick\n\n if (d.stroke_width / transform.k < 4) ctx.lineWidth = d.stroke_width / 2;else ctx.lineWidth = d.stroke_width * 0.6 * transform.k;\n ctx.beginPath();\n ctx.arc(d.x, d.y, d.r, 0, pi2);\n ctx.closePath();\n ctx.strokeStyle = d.fill;\n ctx.stroke();\n } else {\n ctx.arc(d.x, d.y, r, 0, pi2);\n ctx.fill();\n } //else\n\n } //else\n\n } else {\n //All other node types become circles\n ctx.arc(d.x, d.y, r, 0, pi2);\n ctx.fill();\n } //else\n\n\n ctx.closePath();\n } //function drawNodes", "function showNodes(id, nodeIDs, allNodeIDs, selectedNodes) {\n // draw the more visible lines\n linkSave.filter(function(d) { return allNodeIDs.indexOf(d.source.id) > -1 && allNodeIDs.indexOf(d.target.id) > -1; })\n .forEach(function(d) {\n d.hoverMin = 1000;\n var closeSource = selectedNodes[d.source.id];\n var closeTarget = selectedNodes[d.target.id];\n if (typeof closeSource !== 'undefined' && typeof closeTarget !== 'undefined') { \n d.hoverMin = Math.min(closeSource, closeTarget);\n }\n \n ctxLinks.lineWidth = d.hoverMin !== 1000 ? thicknessScaleHover(d.hoverMin) : 0.5; \n ctxLinks.globalAlpha = Math.min(opacityScaleHover( d.hoverMin ) * 0.1, 0.05);\n \n ctxLinks.setLineDash(d.lineDash);\n ctxLinks.beginPath();\n drawCircleArc(d.centre, d.r, d.source, d.target, d.sign);\n ctxLinks.stroke();\n ctxLinks.closePath();\n });\n \n // draw the more visible nodes\n nodesSave.filter(function(d) { return nodeIDs.indexOf(d.id) > -1; })\n .forEach(function(d) {\n d.closeNode = selectedNodes[d.id];\n \n ctxNodes.globalAlpha = opacityScaleHover(d.closeNode);\n ctxNodes.fillStyle = colourScaleHover(d.closeNode);\n ctxNodes.shadowBlur = olympians.indexOf(d.id) > -1 || interestingPeople.indexOf(d.id) > -1 ? 30 : 15;\n ctxNodes.shadowColor = colourScaleHover(d.closeNode);\n \n ctxNodes.beginPath();\n ctxNodes.moveTo(d.x + d.radius, d.y);\n ctxNodes.arc(d.x, d.y, d.radius, 0, 2 * Math.PI);\n ctxNodes.fill();\n ctxNodes.closePath();\n });\n ctxNodes.shadowBlur = 0;\n \n // highlight title if an interesting person\n labelWrapper.selectAll('.olympian-label, .interesting-person-label')\n .filter(function(o) { return nodeIDs.indexOf(o.id) > -1; })\n .transition('label').duration(500)\n .style('opacity', 1);\n}", "function drawNodes(nodes) {\n // used to assign nodes color by group\n var color = d3.scale.category20();\n\n d3.select(\"#plot\").selectAll(\".node\")\n .data(nodes)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"node\")\n .attr(\"id\", function(d, i) { return d.name; })\n .attr(\"cx\", function(d, i) { return d.x; })\n .attr(\"cy\", function(d, i) { return d.y; })\n .attr(\"r\", function(d, i) { return radius; })\n .style(\"fill\", function(d, i) { return color(d.group); })\n .on(\"mouseover\", function(d, i) { addTooltip(d3.select(this));MouseOver(d); })\n .on(\"mouseout\", function(d, i) { d3.select(\"#tooltip\").remove();MouseOut(d); });\n}", "function drawNodes()\n{\n\td3.selectAll(\"circle\").attr(\"cx\", function (d) {\n\t\t//d.x = Math.max(radius, Math.min(width - radius, d.x));\n if(d.id==\"101\")\n {\n// console.log(d);\n//console.log(d.id+\" : \"+d.name+\" : \"+d.x+\" : \"+d.y+\" : \"+d.weight+\" : \"+d.fixed);\n }\n return isNaN(d.x)?defaultX:d.x;\n })\n .attr(\"cy\", function (d) {\n\t\t//d.y = Math.max(radius, Math.min(height - radius, d.y));\n\t\treturn isNaN(d.y)?defaultY:d.y;\n });\n d3.selectAll(\"text\").attr(\"x\", function (d) {\n\t\t//d.x = initialX+((width*2/3)*Math.random())+d.id;\n\t\t//d.x = Math.max(radius, Math.min(width - radius, d.x));\n return isNaN(d.x)?defaultX:d.x;\n })\n .attr(\"y\", function (d) {\n\t\t//d.y = initialY+(height-200)*Math.random()+d.id;\n\t\t//d.y = Math.max(radius, Math.min(height - radius, d.y));\n\t\treturn isNaN(d.y)?defaultY:d.y;\n });\n}", "function redrawNode(n) {\n var xn = n.position().x + n.parent.position().x;\n var yn = n.position().y + n.parent.position().y;\n for (let l of n.linked) {\n redrawLine(l, n.kind, xn, yn);\n }\n}", "function nodeDrawer(context, target, lineW, strokeS, fillS) {\n context.beginPath();\n context.lineWidth = lineW;\n context.strokeStyle = strokeS;\n context.fillStyle = fillS;\n context.fillRect(target.posx, target.posy, target.size, target.size);\n context.rect(target.posx, target.posy, target.size, target.size);\n context.closePath();\n context.stroke();\n}", "draw() {\n // Set up the nodes and links of the graph.\n this.addNodes();\n this.addLinks();\n\n // Create the d3 simulation.\n this.createSimulation();\n\n // Set up SVG to draw the simulation.\n this.setupSvg();\n }", "function display(node){\n if(node.visible){\n if (hasBorder() == true)\n p.stroke(getBorderColor());\n else\n p.noStroke();\n\n if(beingDragged != null && node == beingDragged){\n p.fill(getActiveColor());\n } else if(p.mouseX >= node.x-node.width/2 && p.mouseX <= node.x+node.width/2 \n && p.mouseY >= node.y-node.height/2 && p.mouseY <= node.y+node.height/2){\n if (currentClickedNode == node)\n p.fill(getSelectedColor());\n else\n p.fill(getHoverColor());\n\n document.getElementById('show_label').innerHTML = node.label;\n document.getElementById('show_url').innerHTML = node.url;\n document.getElementById('show_url').href = node.url;\n } else if (currentClickedNode == node){\n p.fill(getSelectedColor()); \n } else {\n p.fill(getNodeColor());\n } \n p.rect(node.x, node.y, node.width, node.height);\n\n //Handle node expander graphic\n if (node.children.length != 0) {\n p.noStroke();\n p.fill(getActiveColor());\n p.rect(node.x+node.width/2, node.y, 3, 3);\n } \n\n //Handle text \n p.fill(getFontColor());\n // calculate text size based on the current size of the node\n p.textSize(getTextSize(node));\n p.text(node.label, node.x - node.width/2 + 5, node.y + 5);\n //p.text(node.label, node.x-35, node.y+5);\n\n //Used for drag/drop\n var x_origin = node.x + node.width/2;\n var y_origin = node.y;\n\n //Recurse on children and draw connecting lines\n for(var i=0; i<node.children.length; i++){\n if(node.children[i].visible && node.children[i].x - node.children[i].width/2 > 0 && node.children[i].y > 0){\n display(node.children[i]);\n p.stroke(getLineColor());\n p.line(x_origin, y_origin, node.children[i].x - node.children[i].width/2, node.children[i].y);\n }\n }\n }\n}", "function draw() {\n var boxListJson = decodeHtmltoJson(boxList);\n console.log(boxListJson);\n\n // Create a data table with nodes.\n nodes = [];\n // Create a data table with links.\n edges = [];\n //Get source and destination Box IDs separatley from the List\n var srcIDArray = [], destIDArray = [], boxLabel = '';\n var srcMap = new Object();\n var destMap = new Object();\n // console.log(boxList);\n // console.log(JSON.parse(boxList));\n for (i = 0; i < boxListJson.length; i++) {\n // console.log(boxList[i]);\n \n srcIDArray.push(boxListJson[i].srcBoxID);\n destIDArray.push(boxListJson[i].destBoxID);\n srcMap[boxListJson[i].srcBoxID] = boxListJson[i].srcBoxname;\n destMap[boxListJson[i].destBoxID] = boxListJson[i].destBoxname;\n }\n\n //Distinct nodes List\n var uniqueNodes = [...new Set([...srcIDArray, ...destIDArray])];\n console.log(uniqueNodes);\n // console.log(uniqueNodes.length);\n //Draw the Nodes\n for (i = 0; i < uniqueNodes.length; i++) {\n boxLabel = srcMap[uniqueNodes[i]];\n\n if (!boxLabel)\n boxLabel = destMap[uniqueNodes[i]];\n\n nodes.push({\n id: uniqueNodes[i], \n label: boxLabel, \n box: uniqueNodes[i], \n value: 3, \n fixed: false, \n physics: false, \n borderWidth: 2, \n borderWidthSelected: 4, \n color: { \n border: '#2B7CE9', \n background: '#97C2FC', \n highlight: { \n border: '#2B7CE9', \n background: \n '#D2E5FF' \n }, \n hover: { \n border: '#2B7CE9', \n background: '#D2E5FF' \n }\n } \n });\n }\n\n //Draw the Edges\n for (var i in boxListJson) {\n console.log(boxListJson[i].srcBoxID + ' ' + boxListJson[i].destBoxID);\n\n if (boxListJson[i].score <= 20)\n EDGE_LENGTH_SUB = 80;\n else if (boxListJson[i].score > 20 && boxListJson[i].score <= 40)\n EDGE_LENGTH_SUB = 120;\n else if (boxListJson[i].score > 40 && boxListJson[i].score <= 60)\n EDGE_LENGTH_SUB = 160;\n else if (boxListJson[i].score > 60 && boxListJson[i].score <= 80)\n EDGE_LENGTH_SUB = 200;\n else\n EDGE_LENGTH_SUB = 240;\n\n //\tnodes.push({id: boxList[i].srcBoxID, label: boxList[i].srcBoxname, box: boxList[i].srcBoxname, group: 'desktop', value: 3, fixed: false, physics:false, color: BridgeNodeColor});\n edges.push({ \n from: boxListJson[i].srcBoxID, \n to: boxListJson[i].destBoxID, \n arrows: { \n to: { \n enabled: true, \n type: 'circle' \n } \n }, \n length: EDGE_LENGTH_SUB, \n color: BridgeLinkColor \n });\n }\n\n // legend\n var mynetwork = document.getElementById('mynetwork');\n var x = - mynetwork.clientWidth / 2 + 50;\n var y = - mynetwork.clientHeight / 2 + 50;\n var step = 70;\n\n // create a visualization network\n var container = document.getElementById('mynetwork');\n var data = {\n nodes: nodes,\n edges: edges\n };\n var options = {\n nodes: {\n //shape: 'dot',\n size: 20,\n borderWidth: 2,\n font: {\n size: 16,\n color: '#000000'\n },\n scaling: {\n min: 16,\n max: 32,\n }\n },\n edges: {\n color: GRAY,\n smooth: true,\n width: 2\n },\n layout: {\n randomSeed: 1,\n improvedLayout: true,\n },\n physics: {\n \"enabled\": true,\n \"minVelocity\": 0.75\n },\n interaction: {\n navigationButtons: true,\n hover: true,\n keyboard: true\n },\n groups: {\n 'switch': {\n shape: 'triangle',\n color: '#FF9900' // orange\n }\n }\n };\n\n network = new vis.Network(container, data, options);\n network.on(\"click\", function (params) {\n console.log(params);\n params.event = \"[original event]\";\n if (params.nodes == \"\") {\n }\n else {\n var nodeId = params.nodes;\n //window.parent.receiveValueBox(nodes[i]);\n }\n });\n\n var myInput = $(\"#mynetwork\");\n var inputOpentip = new Opentip(myInput, { showOn: null, style: 'glass' });\n var count = 0;\n\n network.on(\"hoverNode\", function (params) {\n params.event = \"[original event]\";\n var nodeId = params.node;\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].id == nodeId) {\n count = i;\n break;\n }\n }\n\n inputOpentip.setContent(\"Node label: \" + nodes[count].label + \" Id: \" + nodes[count].id);\n inputOpentip.show();\n });\n \n network.on(\"blurNode\", function (params) {\n inputOpentip.hide();\n });\n}", "show() {\n stroke(255);\n strokeWeight(1)\n noFill();\n rectMode(CENTER);\n rect(this.boundary.x, this.boundary.y, this.boundary.w * 2, this.boundary.h * 2);\n if (this.divided) {\n this.northeast.show();\n this.northwest.show();\n this.southeast.show();\n this.southwest.show();\n }\n for (let p of this.nodes) {\n strokeWeight(4)\n node(p.x, p.y)\n }\n }", "function tick() {\n // draw directed edges with proper padding from node centers\n }", "function loadAndDraw(nodeURL, linkURL) {\n\n d3.csv(nodeURL).then(function (data_node) {\n d3.csv(linkURL).then(function (data_link) {\n let index = 0;\n link_master = data_link // Limit number of links\n node_master = data_node;\n\n // Calculate relevant node information\n buildNodeData(node_master);\n\n // Build node-link relationships\n buildLinkData(link_master);\n link_master.sort(linkSort)\n\n node_work = node_master\n node_set = new Set(node_work.map((d) => d.sub))\n link_work = link_master\n link_trunc = link_work.slice(0, link_limit)\n\n subreddits = node_master.map((d) => d['sub'])\n\n // Set Domain Scales\n xScale = d3.scaleLinear()\n .domain(d3.extent(node_work, (d) => Number(d.x)))\n .range([0, width])\n\n yScale = d3.scaleLinear()\n .domain(d3.extent(node_work, (d) => Number(d.y)))\n .range([0, height])\n\n nodeScale.domain(d3.extent(node_master, (d) => Number(d.total_out)))\n lineScale.domain(d3.extent(link_master, (d) => Number(d.n)))\n opacScale.domain(d3.extent(link_master, (d) => Number(d.n)))\n\n // Draw Nodes\n nodes = node_layer.selectAll('.node')\n .data(node_work, keyNodes)\n .enter()\n .append(\"circle\")\n .attr(\"cx\", (d) => xScale(d.x))\n .attr(\"cy\", (d) => yScale(d.y))\n .attr(\"class\", \"node\")\n .attr(\"r\", 0)\n .style(\"fill\", default_node_color)\n .style(\"opacity\", default_node_opacity)\n .on('mouseover', nodeOverFunction)\n .on('mousemove', () => tooltip.style(\"top\", (d3.event.pageY - 10) + \"px\").style(\"left\", (d3.event.pageX + 10) + \"px\"))\n .on('mouseout', nodeOutFunction)\n .on('click', function (d) { // Select Behaviour\n if (clicked_node == null) {\n clicked_node = this;\n } else {\n clearHighlights()\n clicked_node = this;\n setHighlights(d, this)\n }\n updateNodeTooltip(d);\n d3.selectAll(\"#highlight-layer .link\").style(\"pointer-events\", \"all\");\n drawNames();\n })\n .sort(function (a, b) { // Draw smaller nodes above\n return b.total_out - a.total_out\n })\n\n // Animate Nodes\n nodes.transition('first_draw')\n .duration(300)\n .delay((d, i) => (i % 10) * 100)\n .attr(\"r\", (d) => nodeScale(d.total_out));\n\n // simulation = d3.forceSimulation(nodes)\n // .velocityDecay(0.2)\n // .force('charge', d3.forceManyBody().strength(5))\n // .force('center', d3.forceCenter(width / 2, height / 2))\n // .force('collision', d3.forceCollide().radius(function (d) {\n // return nodeScale(d.total_out)\n // }))\n // .on('tick', ticked);\n\n // Draw Links\n links = link_layer.selectAll('.link')\n .data(link_trunc, keyLinks)\n .enter()\n .append(\"line\")\n .attr('class', 'link')\n .style(\"stroke\", \"#aaa\")\n .style(\"stroke-width\", (d) => lineScale(d.n))\n .style('opacity', 1)\n .style('visibility', 'hidden')\n .attr(\"x1\", (d) => xScale(d.source.x))\n .attr(\"y1\", (d) => yScale(d.source.y))\n .attr(\"x2\", (d) => xScale(d.target.x))\n .attr(\"y2\", (d) => yScale(d.target.y));\n\n // Animate Links\n links\n .transition()\n .delay((d, i) => (i % 10) * 100 + 1000)\n .duration(0)\n .style('visibility', 'visible');\n\n\n\n // links.attr(\"d\", function (d) {\n // var dx = xScale(d.target.x) - xScale(d.source.x),\n // dy = yScale(d.target.y) - yScale(d.source.y),\n // dr = Math.sqrt(dx * dx + dy * dy);\n // return \"M\" + xScale(d.source.x) + \",\" + yScale(d.source.y) + \"A\" + dr + \",\" + dr + \" 0 0,1 \"\n // + xScale(d.target.x) + \",\" + yScale(d.target.y);\n // });\n\n setAdj(link_trunc);\n setSearch(node_work);\n\n data_load_callbacks.forEach((d) => d());\n\n // d3.select('#svg-div').attr('transform', transform);\n // svg.attr('transform', transform);\n // d3.zoomIdentity = transform;\n });\n })\n\n}", "function drawDirectedGN(containerId) {\n drawGraphNetwork(containerId,\"Directed\");\n }", "show() {\n for (let node of this.nodes) {\n node.show();\n node.showLinks();\n }\n }", "function drawNodes() {\n for (i = 0; i < nodes.length; i++) {\n ctx.beginPath();\n ctx.arc(nodes[i].xCord, nodes[i].yCord, canvas.height / 20, 0, Math.PI * 2);\n\n ctx.fillStyle = nodes[i].colour;\n ctx.fill();\n ctx.closePath();\n\n ctx.fillStyle = \"black\";\n ctx.font = \"35px Arial\";\n if (nodes[i].value.length == 1)\n ctx.fillText(nodes[i].value, nodes[i].xCord - (canvas.height / 20) / 2, nodes[i].yCord + (canvas.height / 20) / 2);\n else\n ctx.fillText(nodes[i].value, nodes[i].xCord - (canvas.height / 20) / 1.25, nodes[i].yCord + (canvas.height / 20) / 2);\n\n }\n}", "function draw() {\n\tnodesVis = new vis.DataSet(nodes);\n\tedgesVis = new vis.DataSet(edges);\n\tvar data = {\n\t nodes: nodesVis,\n\t edges: edgesVis\n\t};\n network = new vis.Network(container, data, options);\n \n //动画稳定后的处理事件\n\tvar stabilizedTimer;\n\tnetwork.on(\"stabilized\", function (params) { // 会调用两次?\n\t\texportNetworkPosition(network);\n\t\twindow.clearTimeout(stabilizedTimer);\n\t\tstabilizedTimer = setTimeout(function(){\n\t\t\toptions.physics.enabled = false; // 关闭物理系统\n\t\t\tnetwork.setOptions(options);\n\t\t\tnetwork.fit({animation:true});\n\t\t},100);\n\t});\n\n\t// 右键\n\tnetwork.on(\"oncontext\",function(params){});\n\n\t//选中节点\n\tnetwork.on(\"selectNode\", function (params) {\n\t\t\n\t\t\n\t});\n\n\t//单击节点\n\tnetwork.on(\"click\", function (params) {});\n\n\t//双击节点 隐藏或者显示子节点\n\tnetwork.on(\"doubleClick\", function (params) {\n\t\tif(params.nodes.length != 0){\n\t\t\toptions.physics.enabled = true;\n\t\t\tfor(var i in nodes){\n\t\t\t\tnodes[i].fixed = false\n\t\t\t\tif(nodes[i].id == params.nodes[0]){\n\t\t\t\t\tnodes[i].x=0;\n\t\t\t\t\tnodes[i].y=0;\n\t\t\t\t\tnodes[i].fixed=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdraw();\n\t\t}\n\t\t\n\t});\n\n\t//拖动节点\n\tnetwork.on(\"dragging\", function (params) {//拖动进行中事件\n\t\tif (params.nodes.length != 0 ) {\n\t\t\tnodeMoveFun(params);\n\t\t}\n\t});\n\n\t//拖动结束后\n\tnetwork.on(\"dragEnd\", function (params) {\n\t\tif (params.nodes.length != 0 ) {\n\t\t\tvar arr = nodeMoveFun(params);\n\t\t\texportNetworkPosition(network,arr);\n\t\t}\n\t});\n\n\t// 缩放\n\tnetwork.on(\"zoom\", function (params) {});\n\tnetwork.on(\"hoverNode\",function(params){\n\t\t\n\t})\n\t\n}", "function redraw_graph(data) {\n\tlink = link.data(data.links);\n\tlink.exit().remove();\n\tlink.enter().insert(\"line\", \".node\").attr(\"class\", \"link\");\n\tnode = node.data(data.nodes);\n\tnode.enter().insert(\"circle\", \".cursor\").attr(\"class\", \"node\").attr(\"r\", 5).call(force.drag);\n\tforce.start();\n}", "function drawLinks(link)\n{\n link.attr(\"x1\", function(d) { return isNaN(d.source.x)?defaultX:d.source.x; })\n .attr(\"y1\", function(d) { return isNaN(d.source.y)?defaultY:d.source.y; })\n .attr(\"x2\", function(d) { return isNaN(d.target.x)?defaultX:d.target.x; })\n .attr(\"y2\", function(d) { return isNaN(d.target.y)?defaultY:d.target.y; });\nif (curvedLinks){\n\tlink.attr(\"d\", function(d) {\n\t\tvar even=d.source.id%2;\n\t\tvar intermediateX=d.source.x+((even==0)?1:-1)*(100);\n\t\t//console.log(d.source.name+\":\"+d.target.name+\" intermediateX: \"+intermediateX);\n\t\t//console.log(even+\":\"+d);\n\t linkOrientation=linkOrientation*-1;\t\n return \"M\" + d.source.x + \",\" + d.source.y\n + \"S\" + intermediateX + \",\" + d.source.y\n + \" \" + d.target.x + \",\" + d.target.y;\n });\n}\n}", "function update() {\n\t// call start before doing svg stuff, since we want any new nodes instantiated\n\tForce.force().start();\n\t\n\tnode = node.data(Net.nodes, function (n) {\n\t\treturn n.id;\n\t});\n\n\tlink = link.data(Net.links, function (n) {\n\t\treturn (n.source.id + n.target.id);\n\t});\n\n\t// \tAdding basic links\n\tlink.enter().append(\"line\").attr(\"class\", \"link\");\n\t// experimental: put arrows on links\n\t//.attr(\"marker-end\", \"url(#end)\");\n\n\n/*\t// polygonlinks\n\tlink.enter()\n .append('path')\n\t\t.attr(\"class\", \"polygonlink\");\n*/\t\n\n\t\t// experimental: link labels\n\t\t/*\n\t var edgelabels = svg.selectAll(\".edgelabel\")\n\t .data(Net.links)\n\t\t .enter()\n\t\t .append('text')\n\t\t .style(\"pointer-events\", \"none\")\n\t\t .attr({'class':'edgelabel',\n\t\t 'id':function(d,i){return 'edgelabel'+i},\n\t\t 'dx':50,\n\t\t 'dy':8,\n\t\t 'font-size':12});\n\n\t\tvar textPath = edgelabels.append('textPath')\n\t\t .attr('xlink:href',function(d,i) {return '#edgepath'+i})\n\t\t .style(\"pointer-events\", \"none\")\n\t\t .text(Net.linkDistance);\n\t\t*/\t\n\n\n\t\tlink.exit().remove();\n\n\t\t\n\n\t\n\t// draw an svg:group for each node\t\n\tvar g = node.enter().append(\"g\")\n\t\t.attr(\"class\", function (d) {\n\t\treturn d.group;\n\t})\n\t\t.attr(\"transform\", function () {\n\t\treturn \"translate(\" + w / 2 + \",\" + h / 2 + \")\"\n\t});\n\t// type the node name in each group\n\tvar g_label = g.append(\"g\")\n\t\t.attr(\"class\", \"node_label\");\n\t\t\n\tg_label.append(\"rect\")\n\t\t.attr(\"class\", \"label_background\")\n\t\t.style(\"fill\", function (d) {\n\t\t\treturn d3.rgb(color(d.group)).darker();\n\t\t\t});\n\tg_label.append(\"text\")\n\t\t.attr(\"dy\", \".35em\")\n\t\t.attr(\"x\", function (n) {\n\t\treturn 14 + 0.3 * n.size;\n\t})\n\t\t.attr(\"font-size\", function (n) {\n\t\treturn 14 + 0.1 * n.size;\n\t})\n\t\t.attr(\"class\", \"label_text\")\n\t\t.text(function (n) {\n\t\treturn n.name;\n\t});\n\t// add a hover:title in each group\n\tg.append(\"title\").text(function (d) {\n\t\treturn (d.description ? d.description + \"\\n\" : \"\") + \"[\" + d.group + \"]\";\n\t});\n\n\t// halo\n\tg.append(\"circle\").attr(\"r\", function (n) {\n\t\treturn (12 + n.size * 0.4);\n\t})\n\t\t.attr(\"class\", function (d) {\n\t\treturn \"halo\";\n\t})\n\t\t.style(\"fill\", function (d) {\n\t\treturn \"url(#g\" + (groups.indexOf(d.group)) + \")\";\n\t});\n\n\t// put a circle in each group\n\tg.append(\"circle\").attr(\"r\", function (n) {\n\t\treturn (6 + n.size * 0.2);\n\t})\n\t.attr(\"class\", \"node\")\n\t.on(\"mouseover\", Force.d3_layout_forceMouseover)\n\t.on(\"mouseout\", Force.d3_layout_forceMouseout);\n\n/*\n\t// Experimental but really cool:\n\t// Mark fixed nodes\n\tg.append(\"circle\")\n\t\t.attr(\"r\", function (n) {\n\t\t\treturn (20 + n.size * 0.4);\n\t\t})\n\t\t.attr(\"class\", \"fixed\")\n\t\t.style(\"display\", \"none\");\n*/\n\t// get rid of obsolete nodes (deleted through the radial menu's trash can in a previous iteration)\n\tnode.exit().remove();\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t// Build the radial menu\n\tg.selectAll(\"circle\")\n\t\t.on(\"mouseup\", function () {\n\t\t\tvar sunburst = svg.selectAll(\"g.radial\");\n\t\t\tsunburst.remove();\n\t\t})\t\n\t\t.on(\"contextmenu\", function (n) {\n\t\t// The radial menu function takes a JSON structure, according to d3's docs on pie menus.\n\t\tvar tree = {\n\t\t\t\"size\": n.size,\n\t\t\t\"children\": [{\n\t\t\t\t\t\"label\": \"remove\",\n\t\t\t\t\t\"id\": n.id,\n\t\t\t\t\t\"icon\": \"#icon_remove\",\n\t\t\t\t\t\"size\": \"10\",\n\t\t// we inject a callback for each menu item, what to execute on selection. Maybe I can become a decent js-coder afterall?\n\t\t\t\t\t\"callback\": function (node) {Net.drop(node.id);update();}\n\t\t\t\t\t}, {\n\t\t\t\t\t\"label\": \"explode\",\n\t\t\t\t\t\"id\": n.id,\n\t\t\t\t\t\"icon\": \"#icon_explode\",\n\t\t\t\t\t\"size\": \"10\",\n\t\t\t\t\t\"children\": [],\n\t\t\t\t\t\"callback\": function (node) {Net.supernova(node.id);update();}\n\t\t\t\t\t}, {\n\t\t\t\t\t\"label\": \"freeze\",\n\t\t\t\t\t\"id\": n.id,\n\t\t\t\t\t\"icon\": \"#icon_fixed\",\n\t\t\t\t\t\"size\": \"10\",\n\t\t\t\t\t\"callback\": function (node) {Net.toggleFixed(node.id);update();}\n\t\t\t\t\t}/*, {\n\t\t\t\t\t\"label\": \"add\",\n\t\t\t\t\t\"id\": n.id,\n\t\t\t\t\t\"icon\": \"#icon_add\",\n\t\t\t\t\t\"size\": \"15\",\n\t\t\t\t\t\"callback\": function (node) {Net.derive(node.id);update();}\n\t\t\t\t}*/]\n\t\t};\n\t\t//\n\t\tif (n.description == \"user added\") {\n\t\t\t// push all Net.nodes onto the radial menu JSON\n\t\t\tNet.nodes.forEach(function (node) {\n\t\t\t\tvar push = {};\n\t\t\t\tpush.name = node.name;\n\t\t\t\tpush.id = node.id;\n\t\t\t\tpush.group = node.group;\n\t\t\t\tpush.size = node.size;\n\t\t\t\t// not properly updated since implemented id's instead of indices:\n\t\t\t\tvar arg = {\"source\":{\"id\":n.id}, \"target\": {\"id\":node.id}};\n\t\t\t\tpush.callback = function(){Net.addLink(arg); update();};\n\t\t\t\ttree.children[1].children.push(push);\n\t\t\t\t});\n\t\t} else {\n\t\t\tvar links = ALL.nodeSource(n.id);\n\t\t\t// push all links/edge menu items onto the radial menu JSON\n\t\t\tlinks.forEach(function (l) {\n\t\t\t\tvar c = l.target == n.id ? ALL.n(l.source) : ALL.n(l.target);\n\t\t\t\tc = jQuery.extend(true, {\"callback\" : function(node){Net.add(ALL.n(node.id)); update()}}, c);\n\t\t\t\ttree.children[1].children.push(c);\n\t\t\t\t\n\t\t\t});\n\t\t}\t\t\n\t\tdrawRadial(tree, n);\n\t});\n\t\n\tnode.call(Force.nodeDrag);\n\n\t\tif (Settings.drawOrigo && !Settings.rotateLabels) {\n\t\tvar origo = svg.append(\"g\").attr(\"id\", \"origo\");\n\t\torigo.append(\"circle\").attr(\"r\", 4).style(\"fill\", \"#fff\");\n\t\torigo.append(\"circle\").attr(\"r\", 7).style(\"stroke\", \"#fff\").style(\"fill\", \"none\").style(\"stroke-width\", \"1.5px\");\n\t}\n\n\n\t/* ---------------------------- FOR SIMULATION ----------------------------- */\n\n\t// links are actually little trapezoids (arrows). You can barely see the link direction...\n\tvar updateLink = function () {\n\t\t/*\n\t\tthis.attr('d', function(d) {\n\n\t\t\tvar sx = d.source.x; var sy = d.source.y; var tx = d.target.x; var ty = d.target.y;\n\t\t\tvar Dx = tx-sx; var Dy = ty-sy; // D as in Delta\n\t\t\tvar pDx = Dy; var pDy = -Dx; \t// p as in perpendicular\n\t\t\t// normalize\n\t\t\tvar length = Math.sqrt(pDx*pDx+pDy*pDy);\n\t\t\tpDx /= length;\n\t\t\tpDy /= length;\n\n\n\t\t\tvar sC = 1;\n\t\t\tvar tC = 0.6;\n//\t\t\tvar sS = 6 + d.source.size * 0.2;\n//\t\t\tvar tS = 6 + d.target.size * 0.2;\n\t\t\tvar sS = 7*sC;\n\t\t\tvar tS = 7*tC;\n\n\t\t\tvar s1x = sx+pDx*sS;\n\t\t\tvar s1y = sy+pDy*sS;\n\n\t\t\tvar s2x = sx-pDx*sS;\n\t\t\tvar s2y = sy-pDy*sS;\n\n\t\t\tvar t1x = tx+pDx*tS;\n\t\t\tvar t1y = ty+pDy*tS;\n\n\t\t\tvar t2x = tx-pDx*tS;\n\t\t\tvar t2y = ty-pDy*tS;\n\t\t\tvar path = \"M \" + s1x + \" \" + s1y;\n\t\t\tpath += \" L \" + t1x + \" \" + t1y;\n\t\t\tpath += \" L \" + t2x + \" \" + t2y;\n\t\t\tpath += \" L \" + s2x + \" \" + s2y;\n\t\t\tpath += \" Z\";\n\t\t\treturn path;\n\t\t});\n*/\n\t\t// Deprecated:\n\t\t// Plain svg:line objects\n\t\tthis.attr(\"x1\", function (d) {\n\t\t\treturn d.source.x;\n\t\t}).attr(\"y1\", function (d) {\n\t\t\treturn d.source.y;\n\t\t}).attr(\"x2\", function (d) {\n\t\t\treturn d.target.x;\n\t\t}).attr(\"y2\", function (d) {\n\t\t\treturn d.target.y;\n\t\t});\n\t}\n\n\tvar updateNode = function () {\n\t\tif (!Settings.rotateLabels) {\n\t\t\tvar center = Net.getCenter();\n\t\t\tif (Settings.drawOrigo) svg.select(\"#origo\").attr(\"transform\", \"translate(\" + center.x + \",\" + center.y + \")\");\n\t\t\t\t\n\t\t}\n\n\t\tthis.attr(\"transform\", function (d, i) {\n//\t\t\tthis.childNodes[4].setAttribute(\"style\", \"display: \"+ (d.fixed ? \"block\" : \"none\"));\n\t\t\t\n\t\t\tvar angle = rotate = 0, anchor = \"start\";\n\t\t\t\n\t\t\tif (text = this.childNodes[0].childNodes[1]) {\n\t\t\t\tvar offset = 14 + 0.3 * d.size;\t\t\t\t\n\n\t\t\t\t// rotate labels\n\t\t\t\tif (Settings.rotateLabels) {\n\t\t\t\t\tvar ns = Net.getNeighbors(d.id);\n\t\t\t\t\tif (ns.length) {\n\t\t\t\t\t\t// my intricate (read 'cheap') rotation algorithm for avoiding labels blocking other nodes or links.\n\t\t\t\t\t\tns.x = d3.mean(ns, function(n){return n.x;});\n\t\t\t\t\t\tns.y = d3.mean(ns, function(n){return n.y;});\n\t\t\t\t\t\tangle = 57 * myAtan((d.y-ns.y), (d.x-ns.x)); // Seems DRAWING rotated text is the speed hog, NOT myAtan...\n\t\t\t\t\t} else angle = 0;\n\t\t\t\t\t\n\t\t\t\t\t// Rotating isn't everything - here's some alignment so labels won't cover nodes\n\t\t\t\t\tif (Math.abs(angle) > 90) {\n\t\t\t\t\t\tvar anchor = \"end\";\n\t\t\t\t\t\tvar offset = -offset\n\t\t\t\t\t\tvar rotate = 180;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\ttext.setAttribute(\"transform\", \"rotate(\" + rotate + \")\");\n\t\t\t\t\ttext.setAttribute(\"x\", offset);\n\t\t\t\t\ttext.setAttribute(\"text-anchor\", anchor);\n\n\t\t\t\t\tif (Settings.drawAngles) text.textContent = Math.floor(angle);\n\n\t\t\t\t} else {\n\t\t\t\t\t// no text rotations\n\t\t\t\t\tvar dX = d.x - center.x;\n\n\t\t\t\t\tif (dX > 0) {\n\t\t\t\t\t\tvar anchor = \"start\";\n\t\t\t\t\t\ttext.setAttribute(\"x\", offset);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar anchor = \"end\";\n\t\t\t\t\t\toffset = -offset\n\t\t\t\t\t}\n\t\t\t\t\ttext.setAttribute(\"x\", offset);\n\t\t\t\t\ttext.setAttribute(\"text-anchor\", anchor);\n\t\t\t\t\ttext.setAttribute(\"transform\", \"rotate(\" + 0 + \")\");\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// we have all we need - now draw the label\n\t\t\tvar margin = 5;\n\t\t\tvar rect = this.childNodes[0].childNodes[0];\n\t\t\tvar textbox = text.getBBox();\n\t\t\trect.setAttribute(\"x\", textbox.x-margin);\n\t\t\trect.setAttribute(\"y\", textbox.y);\n\t\t\trect.setAttribute(\"width\", textbox.width+2*margin);\n\t\t\trect.setAttribute(\"height\", textbox.height);\n\t\t\trect.setAttribute(\"transform\", \"rotate(\" + rotate + \")\");\n\t\t\t\n\t\t\treturn \"translate(\" + d.x + \",\" + d.y + \") rotate(\" + angle + \")\";\n\t\t});\n\t}\n\n\t// Hooking bookmarklet generation into the simulation sequence\n\tForce.force().on(\"start\", start());\n\tForce.force().on(\"tick\", tick);\n\tForce.force().on(\"end\", end);\n\t\n\tfunction start() {\n\t\t//\tFPS.init();\n\t\t// everything is set up for rendering - create a bookmarklet for saving:\n\t\tif (Net.nodes.length) {\n\t\t\t$(\"#buttonbar\").show();\n\t\t\t$(\"#bookmarklet\").attr(\"class\", \"btn-sm btn-warning\");\n\t\t}\n\t}\n\t\n\tfunction end() {\n\t\t$(\"#bookmarklet\").attr(\"class\", \"btn-sm btn-success\");\n\t\t$(\"#bookmarklet\").attr(\"href\", Net.exportN());\t\t\n\t}\n\n\t// Do this every iteration\n\tfunction tick (e) {\n\t\t// update percent counter\n\t\t$(\"#bookmarklet\").text(Math.floor(1000*(0.1-(Force.force().alpha()))) + 6 + \"%\")\n\n\t\t// for benchmarking\n\t\t// FPS.sample();\n\n\n\t\tnode.call(updateNode);\n\t\tlink.call(updateLink);\n\t}\n}", "draw(ctx) {\n this.kcLinks.forEach((value) => {\n value.drawLink(ctx,this);\n });\n }", "function draw_grid_graph(svg) {\n svg.selectAll()\n .data(networkxData[\"links\"])\n .enter()\n .append(\"rect\")\n .classed(\"grid_cell\", true)\n //.style(\"stroke-width\", width)\n .attr(\"x\", cell_x1)\n .attr(\"y\", cell_y1)\n .attr(\"width\", x_grid_pos(1)-x_grid_pos(.2))\n .attr(\"height\", y_grid_pos(1)-y_grid_pos(.2))\n .style(\"fill-opacity\", opacity)\n .style(\"fill\",\"#00AA00\");\n\n /*svg.selectAll(\"rect\")\n .data(networkxData[\"nodes\"])\n .enter()\n .append(\"circle\")\n .classed(\"row\", true)\n //.on(\"mouseover\", handleMouseOver)\n //.on(\"mouseout\", handleMouseOut)\n .attr(\"cx\",node_x)\n .attr(\"cy\",node_y)\n //.attr(\"r\",size)\n .style(\"fill\",color);*/\n\n //rows\n svg.selectAll(\"div\")\n .data(networkxData[\"nodes\"])\n .enter()\n .append(\"text\")\n .classed(\"label\", true)\n .classed(\"row_label\", true)\n .attr(\"x\",x_grid_pos(-1.5))//just picked number that works for my screen\n .attr(\"y\",row_y)\n .text(label);\n\n //rows\n svg.selectAll(\"div\")\n .data(networkxData[\"nodes\"])\n .enter()\n .append(\"text\")\n .classed(\"label\", true)\n .classed(\"col_label\", true)\n .attr(\"x\",col_x)\n .attr(\"y\",y_grid_pos(-2.5))\n .text(label);\n}", "function drawSelected() {\n if (timer_draw) timer_draw.stop(); //Clear all the canvases\n\n clearCanvas([ctx_edges, ctx_nodes, ctx_hover, ctx_hidden]); //Draw the edges\n\n edges_selected.forEach(function (d) {\n //Make the selected edges more visually apparent\n drawEdges(ctx_edges, d, d.gradient_hover, getLineWidth(d));\n });\n\n if (nodes !== nodes_selected) {\n //First make all the nodes lightly drawn\n ctx_nodes.globalAlpha = node_fade_opacity;\n nodes.forEach(function (d) {\n d.opacity = node_fade_opacity;\n drawNodes(ctx_nodes, d, d.r);\n }); //And do the same for the labels inside\n\n renderNodeLabels(ctx_nodes, nodes);\n } //if\n //Draw the selected nodes in full\n\n\n ctx_nodes.globalAlpha = 1;\n nodes_selected.forEach(function (d) {\n d.opacity = 1;\n drawNodes(ctx_nodes, d, d.r);\n }); //Draw the labels of the selected nodes in full\n\n renderNodeLabels(ctx_nodes, nodes_selected); // community_count.forEach(d => {\n // ctx_nodes.fillStyle = node_color_interpolate(node_community_color(d.item))\n // ctx_nodes.beginPath()\n // ctx_nodes.arc(d.x, d.y, d.r, 0, pi2)\n // ctx_nodes.closePath()\n // ctx_nodes.fill()\n // })//forEach\n } //function drawSelected", "function drawLinks(links) {\n // Define arrowhead shape\n svgPointer.append('svg:defs').append('svg:marker')\n .attr('id', 'arrow')\n .attr('viewBox', '0 -5 10 10')\n .attr('refX', 2) // Move away from line's end\n .attr('markerWidth', 20)\n .attr('markerHeight', 20)\n .attr('orient', 'auto')\n .append('svg:path')\n .style('fill', 'rgb(150,150,150)')\n .attr('d', 'M0, -3L3, 0L0,3');\n\n // Add links\n linkPointer = svgPointer.selectAll('line.link')\n .data(links)\n .enter().append('path')\n .attr('class', 'link')\n .style('stroke', 'rgb(150,150,150)')\n .style( 'stroke-width', 1)\n .style('fill', 'transparent');\n\n linkPointer.filter( function(d) { return d.source.type === INTERMEDIATE || d.source === d.target; } )\n .attr('marker-end', 'url(#arrow)');\n}", "function drawTree(){\n\t\n\t// Create the SVG element\n\tvar width = 300;\n\tvar height = 300;\n\tvar margin = 40;\n\n\tsvg = d3.select(\"h2\").append(\"svg\")\n\t .attr(\"width\", width + 2*margin)\n\t .attr(\"height\", height + 2*margin)\n\t .append(\"g\")\n\t .attr(\"transform\", \"translate(\" + margin + \",\" + margin + \")\");\n\n\t// Create the diagonal path generator\n\tvar diagonal = d3.svg.diagonal()\n\t .projection(function(d) { return [d.y, d.x]; });\n\n\t// Create the tree\n\n\tvar tree = d3.layout.tree().size([height, width]);\n\tvar nodes = tree.nodes(root);\n\tvar links = tree.links(nodes);\n\n\tvar layerOffset = 100;\n\n\t// Set y position of nodes based on their depth\n\tnodes.forEach(function(d) { d.y = d.depth * layerOffset; });\n\n\tvar edge = svg.selectAll(\".edge\")\n\t .data(links)\n\t .enter().append(\"line\")\n\t .attr(\"class\", \"edge\")\n\t .attr(\"x1\", function(d) { return d.source.y; })\n\t .attr(\"y1\", function(d) { return d.source.x; })\n\t .attr(\"x2\", function(d) { return d.target.y; })\n\t .attr(\"y2\", function(d) { return d.target.x; });\n\n\tvar edgeLabel = svg.selectAll(\".edgelabel\")\n\t .data(links)\n\t .enter().append(\"text\")\n\t .attr(\"class\", \"edgelabel\")\n\t .attr(\"dx\", function(d) { return (d.source.y + d.target.y)/2; })\n\t .attr(\"dy\", function(d) { return (d.source.x + d.target.x)/2; })\n\t .attr(\"text-anchor\", \"middle\")\n\t .text( function(d) { \n\t \tvar source = riverNetwork.getNodeIdByLabel(d.source.name);\n\t \tvar target = riverNetwork.getNodeIdByLabel(d.target.name);\n\t \tvar upstream = riverNetwork.getDirectedProbabilityByIds(source, target);\n\t \tvar downstream = riverNetwork.getDirectedProbabilityByIds(target, source);\n\t \treturn \"\\u2191 \" + upstream + \" \\u2193 \" + downstream ;\n\t } )\n\t .on(\"click\", click);\n\n\t// Create nodes as svg groups\n\tvar node = svg.selectAll(\".node\")\n\t .data(nodes)\n\t .enter().append(\"g\")\n\t .attr(\"class\", \"node\")\n\t .attr(\"id\", \"name\")\n\t .attr(\"transform\", function(d) { return \"translate(\" + d.y + \",\" + d.x + \")\"; })\n\t\t.on(\"mouseover\", mouseoverNode)\n\t\t.on(\"mouseout\", mouseoutNode);\n\n\tradius = 10;\n\n\tif(showFlowIn){\n\t// Add circle to svg group for each node\n\t\tnode.append(\"circle\")\n\t\t\t.style(\"fill\", nodeColorIn)\n\t \t.attr(\"r\", radius);\n\t}\n\telse{\n\t// Add circle to svg group for each node\n\t\tnode.append(\"circle\")\n\t\t\t.style(\"fill\", nodeColorOut)\n\t \t.attr(\"r\", radius);\n\t}\n\n\n\t// Add text to svg group for each node\n\tnode.append(\"text\")\n\t .attr(\"dy\", -1.4*radius)\n\t .attr(\"text-anchor\", \"middle\")\n\t .text(function(d) { return d.name; });\n\t\t\n}", "function drawGraph() {\n\tpath.attr(\"d\", function (d) {\n\t\tvar dx = d.target.x - d.source.x,\n\t\t\tdy = d.target.y - d.source.y,\n\t\t\tdr = Math.sqrt(dx * dx + dy * dy);\n\t\treturn \"M\" + d.source.x + \",\" + d.source.y + \"A\" + dr + \",\" + dr + \" 0 0,1 \" + d.target.x + \",\" + d.target.y;\n\t});\n\n\tcircle.attr(\"transform\", function (d) {\n\t\treturn \"translate(\" + d.x + \",\" + d.y + \")\";\n\t});\n\n\ttext.attr(\"transform\", function (d) {\n\t\treturn \"translate(\" + d.x + \",\" + d.y + \")\";\n\t});\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) {\n return d.name;\n });\n\n node.exit().remove();\n\n node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n //.attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .attr(\"id\", function(d) {\n return encodeURIComponent(d.name);\n })\n .call(force.drag)\n .call(linkTopic)\n .append(\"g\")\n .append(\"circle\")\n\n node.select(\"circle\")\n .attr(\"r\", function(d) {\n return r(d.count);\n })\n .style(\"fill\", function(d) {\n return d.count >= 40 ? \"#74c1ab\" : '#8ee6ca' });\n\n }", "function drawSelected() {\n if (timer_draw) timer_draw.stop(); //Clear all the canvases\n\n clearCanvas([ctx_edges, ctx_nodes, ctx_hover, ctx_hidden]); //Draw the edges\n\n edges_selected.forEach(function (d) {\n //Make the selected edges more visually apparent\n drawEdges(ctx_edges, d, d.gradient_hover, getLineWidth(d));\n });\n\n if (nodes !== nodes_selected) {\n //First make all the nodes lightly drawn\n ctx_nodes.globalAlpha = node_fade_opacity;\n nodes.forEach(function (d) {\n d.opacity = node_fade_opacity;\n drawNodes(ctx_nodes, d, d.r);\n }); //And do the same for the labels inside\n\n renderNodeLabels(ctx_nodes, nodes);\n } //if\n //Draw the selected nodes in full\n\n\n ctx_nodes.globalAlpha = 1;\n nodes_selected.forEach(function (d) {\n d.opacity = 1;\n drawNodes(ctx_nodes, d, d.r);\n }); //Draw the labels of the selected nodes in full\n\n renderNodeLabels(ctx_nodes, nodes_selected); // community_count.forEach(d => {\n // ctx_nodes.fillStyle = node_color_interpolate(node_biome_color(d.item))\n // ctx_nodes.beginPath()\n // ctx_nodes.arc(d.x, d.y, d.r, 0, pi2)\n // ctx_nodes.closePath()\n // ctx_nodes.fill()\n // })//forEach\n } //function drawSelected", "function drawNodes(svg, sankey, graph) {\n var node = svg.append('g')\n .selectAll('.node')\n .data(graph.nodes)\n .enter()\n .append('g')\n .attr('class', 'node')\n .attr(\"transform\", function(d) { \n return \"translate(\" + d.x + \",\" + Math.abs(d.y) + \")\"; \n })\n\n node.append('rect')\n .attr('height', function (d) {\n return Math.abs(d.dy);\n })\n .attr('width', sankey.nodeWidth())\n .style('fill', function(d) {\n return getColor(d);\n })\n .append(\"title\")\n .text(function(d) { \n return d.name; \n });\n\n var margin = {top: 10, right: 10, bottom: 10, left: 10};\n var width = 700 - margin.left - margin.right;\n node.append(\"text\")\n .attr(\"x\", -6)\n .attr(\"y\", function(d) { return d.dy / 2; })\n .attr(\"dy\", \".35em\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"transform\", null)\n .text(function(d) { return d.name; })\n .filter(function(d) { return d.x < width / 2; })\n .attr(\"x\", 6 + sankey.nodeWidth())\n .attr(\"text-anchor\", \"start\");\n}", "function render(){var createNodes=require(\"./create-nodes\"),createClusters=require(\"./create-clusters\"),createEdgeLabels=require(\"./create-edge-labels\"),createEdgePaths=require(\"./create-edge-paths\"),positionNodes=require(\"./position-nodes\"),positionEdgeLabels=require(\"./position-edge-labels\"),positionClusters=require(\"./position-clusters\"),shapes=require(\"./shapes\"),arrows=require(\"./arrows\");var fn=function(svg,g){preProcessGraph(g);svg.selectAll(\"*\").remove();var outputGroup=createOrSelectGroup(svg,\"output\"),clustersGroup=createOrSelectGroup(outputGroup,\"clusters\"),edgePathsGroup=createOrSelectGroup(outputGroup,\"edgePaths\"),edgeLabels=createEdgeLabels(createOrSelectGroup(outputGroup,\"edgeLabels\"),g),nodes=createNodes(createOrSelectGroup(outputGroup,\"nodes\"),g,shapes);layout(g);positionNodes(nodes,g);positionEdgeLabels(edgeLabels,g);createEdgePaths(edgePathsGroup,g,arrows);var clusters=createClusters(clustersGroup,g);positionClusters(clusters,g);postProcessGraph(g)};fn.createNodes=function(value){if(!arguments.length)return createNodes;createNodes=value;return fn};fn.createClusters=function(value){if(!arguments.length)return createClusters;createClusters=value;return fn};fn.createEdgeLabels=function(value){if(!arguments.length)return createEdgeLabels;createEdgeLabels=value;return fn};fn.createEdgePaths=function(value){if(!arguments.length)return createEdgePaths;createEdgePaths=value;return fn};fn.shapes=function(value){if(!arguments.length)return shapes;shapes=value;return fn};fn.arrows=function(value){if(!arguments.length)return arrows;arrows=value;return fn};return fn}", "function testDemo()\r\n{\r\n\t//addNode(700,700,15,\"#000\",'node 111');\r\n\t//nodeInformation[0]=\"This is the information of node 1\";\r\n\t//addNode(300,200,10,\"blue\", 'node2222222');\r\n\t//nodeInformation[1]=\"Hey friend, this is the information of node 2\";\r\n\t//addLine(700,700,300,200,\"red\");\r\n\r\n\tvar x;\r\n\tvar y;\r\n\tvar rad = 10;\r\n\tvar col = 'blue';\r\n\tvar termCol = 'red';\r\n\tvar name;\r\n\tvar count = 0;\r\n\r\n\tfor(var i = 0; i < myJSONObject.bindings.length; i++) {\r\n\r\n\t\tif(myJSONObject.bindings[i]._isRoot == true) {\r\n\r\n\t\t\tx = (myJSONObject.bindings[i]._x*XSCALAR)+XSHIFT;\r\n\t\t\ty = (myJSONObject.bindings[i]._y*YSCALAR)+YSHIFT;\r\n\t\t\tname = myJSONObject.bindings[i]._title;\r\n\r\n\t\t\tif(myJSONObject.bindings[i]._type == \"TERMINAL\") {\r\n\t\t\t\taddNode(x,y,rad,termCol,name);\r\n\t\t\t} else {\r\n\t\t\t\taddNode(x,y,rad,col,name);\r\n\t\t\t}\r\n\t\t\taddNodeInformation(count,i);\r\n\t\t\tcount++;\r\n\t\t}\r\n\t}\r\n\r\n\tdraw();\r\n}", "function drawNodes(graph) {\n setLabels(graph);\n\n function getAllStudents(exam, value) {\n let allCount = 0;\n for (const node of graph.nodes) {\n if (node.assessment === exam) {\n allCount += node.value;\n }\n }\n return parseFloat(value / allCount * 100).toFixed(2) + \"%\";\n }\n\n function getParentPercentage(exam, grade, value) {\n const locAs = exam;\n const locGrade = grade[0];\n const level = assessGradeLevelMap[locAs.trim()][locGrade];\n if (level === 0) {\n return parseFloat(100).toFixed(2) + \"%\";\n }\n let count = 0;\n for (const node of graph.nodes) {\n if (node.assessment === exam && node.name[0] === grade[0]) {\n count += node.value\n }\n }\n return parseFloat(value / count * 100).toFixed(2) + \"%\";\n }\n\n var div = d3.select(\"body\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n\n /* Creates Node */\n var graphnode = svg\n .append(\"g\")\n .classed(\"nodes\", true)\n .selectAll(\"rect\")\n .data(graph.nodes)\n .enter()\n\n /* Draws Node */\n graphnode.append(\"rect\")\n .attr(\"class\", \"node\")\n .attr(\"x\", d => d.x0)\n .attr(\"y\", d => d.y0)\n .attr(\"width\", d => (d.x1 - d.x0))\n .attr(\"height\", d => {\n d.rectHeight = d.y1 - d.y0;\n return (d.y1 - d.y0)\n })\n .style(\"fill\", (d) => {\n return sankeyColor(d.name[0])\n })\n .attr(\"stroke\", (d) => {\n return d3.rgb(sankeyColor(d.name[0])).darker(0.6);\n })\n .on(\"click\", function (d, i) {\n if (d.shiftKey && assessGradeLevelMap[i['assessment']][i['name'][0]] === 1) {\n hierarchSankeyRouter(i, false);\n }\n else if (assessGradeLevelMap[i['assessment']][i['name'][0]] === 0) {\n hierarchSankeyRouter(i, true);\n }\n })\n .on(\"mouseover\", function (i, d) {\n\n /* Tooltip */\n d3.selectAll('.tooltip').each(function (d) {\n d3.select(this).transition()\n .duration(500)\n .style('opacity', 0)\n .remove();\n });\n\n const percent = getAllStudents(d.assessment, d.value);\n const childPercent = getParentPercentage(d.assessment, d.name, d.value);\n div.transition()\n .duration(400)\n .style(\"opacity\", 1.0);\n div.html(`Node: ${d.assessment} ${d.name} </br>${d.value} students </br> ${childPercent} of parent node </br> ${percent} of all students `)\n .style(\"left\", (i.pageX) + \"px\")\n .style(\"top\", (i.pageY - 28) + \"px\");\n\n /* Function */\n d3.selectAll(\".link\").style(\"stroke-opacity\", function (link) {\n\n const dIndex = assessments.indexOf(d.assessment);\n const aIndex = assessments.indexOf(link.source.assessment);\n if (link.source.name === d.name && link.source.assessment === d.assessment) {\n return 0.9;\n }\n else if (assessGradeLevelMap[link.source.assessment.trim()][link.source.name] === 1\n && dIndex < aIndex\n && (aIndex - dIndex === 1 || assessGradeLevelMap[assessments[aIndex - 1]][d.name] === 1)\n && (link.sourceName === d.name)) {\n return 0.9;\n }\n else {\n return 0.4;\n }\n });\n })\n .on(\"mouseout\", () => {\n div.transition()\n .duration(500)\n .style(\"opacity\", 0);\n\n d3.selectAll(\".link\").style(\"stroke-opacity\", function (link) {\n return 0.4;\n });\n })\n .on(\"contextmenu\", function (d, i) {\n d.preventDefault();\n if (assessGradeLevelMap[i['assessment']][i['name'][0]] === 1) {\n hierarchSankeyRouter(i, false);\n }\n });\n\n /* Add in text */\n graphnode.append(\"text\")\n .style(\"font-size\", \"16px\")\n .attr(\"class\", \"nodeText\")\n .attr(\"x\", function (d) { return d.x0 - 30; })\n .attr(\"y\", function (d) { return (d.y1 + d.y0) / 2; })\n .attr(\"dy\", \"0.35em\")\n .text(function (d) { return d.name[0]; });\n\n }", "renderTree() {\n // STEP 1: CREATE THE SVG FOR THE VISUALIZATION\n let svg = d3.select(\"body\").append(\"svg\");\n svg.attr(\"width\", 1200)\n .attr(\"height\", 1200);\n \n // STEP 2: DRAW THE VERTICES AND THE LABELS\n let nodes = svg.selectAll(\"g\").data(this.nodeList); // Update\n let nodesEnter = nodes.enter().append(\"g\"); // Enter\n nodes.exit().remove() // Exit\n nodes = nodesEnter.merge(nodes); // Merge\n // set the class and the transformation for the nodes\n nodes.attr(\"class\", \"nodeGroup\")\n .attr(\"transform\", \"translate(50, 145)\");\n // append circle to the groups\n nodes.append(\"circle\").attr(\"cx\", function(node){return node.level * 260;})\n .attr(\"cy\", function(node){return node.position * 130;})\n .attr(\"r\", 50);\n // append text to the circle\n nodes.append(\"text\").text(function(node){return node.name;})\n .attr(\"class\", \"label\")\n .attr(\"x\", function(node){return node.level * 260})\n .attr(\"y\", function(node){return node.position * 130});\n\n // STEP 3: DRAW THE EDGES\n // Not too happy with this part because there has to be a correct way of solving this problem cleanly like drawing the nodes\n // With the deadline this was the best thing that I could come up with\n let animalSponge = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 50)\n .attr(\"y1\", 0)\n .attr(\"x2\", 210)\n .attr(\"y2\", 0);\n let animalNephroza = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 36)\n .attr(\"y1\", 36)\n .attr(\"x2\", 215)\n .attr(\"y2\", 238);\n let spongeCalcinea = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 310)\n .attr(\"y1\", 0)\n .attr(\"x2\", 470)\n .attr(\"y2\", 0);\n let spongePetrosina = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 302)\n .attr(\"y1\", 28)\n .attr(\"x2\", 470)\n .attr(\"y2\", 120);\n let nephrozaVertebrates = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 310)\n .attr(\"y1\", 260)\n .attr(\"x2\", 470)\n .attr(\"y2\", 260);\n let nephrozaProtosomes = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 290)\n .attr(\"y1\", 300)\n .attr(\"x2\", 480)\n .attr(\"y2\", 615);\n let vertebratesLampreys = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 570)\n .attr(\"y1\", 260)\n .attr(\"x2\", 730)\n .attr(\"y2\", 260);\n let vertebratesSharks = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 570)\n .attr(\"y1\", 275)\n .attr(\"x2\", 730)\n .attr(\"y2\", 380);\n let vertebratesTetrapods = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 570)\n .attr(\"y1\", 290)\n .attr(\"x2\", 730)\n .attr(\"y2\", 500);\n let tetrapodsTurtles = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 830)\n .attr(\"y1\", 520)\n .attr(\"x2\", 990)\n .attr(\"y2\", 520);\n let protosomesWaterBears = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 570)\n .attr(\"y1\", 650)\n .attr(\"x2\", 730)\n .attr(\"y2\", 650);\n let protosomesHexapods = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 570)\n .attr(\"y1\", 670)\n .attr(\"x2\", 730)\n .attr(\"y2\", 780);\n let hexapodsInsects = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 830)\n .attr(\"y1\", 780)\n .attr(\"x2\", 990)\n .attr(\"y2\", 780);\n let hexapodsProturans = svg.append(\"line\")\n .attr(\"transform\", \"translate(50, 145)\")\n .attr(\"x1\", 830)\n .attr(\"y1\", 800)\n .attr(\"x2\", 990)\n .attr(\"y2\", 900);\n }", "connectNodes() {\n // drawing arrows between nodes\n for (let i = 0; i < this.rows.length - 1; i++) {\n const row1 = this.rows[i];\n const row2 = this.rows[i + 1];\n // keeps swapping directions until all nodes are connected\n // (i.e. row1->row2, row2->row1... takes 2 passes unless both rows are single nodes)\n let dir = 1;\n while (row1.filter(d => !d.lines.length).length || row2.filter(d => !d.lines.length).length) {\n let r1, r2;\n if (dir == 1) {\n r1 = row1;\n r2 = row2;\n }\n else {\n r1 = row2;\n r2 = row1;\n }\n for (let node of r1) {\n if (!node.lines.length) {\n let closest = this.getClosest(node, r2);\n if (dir == 1) {\n this.connect(closest, node);\n }\n else {\n this.connect(node, closest);\n }\n }\n }\n dir *= -1;\n }\n }\n }", "function drawNodes(ctx, d, r, opacity) {\n if (opacity) ctx.globalAlpha = opacity; //If this is an element from the most recent year, make a black \"outline\"\n\n if (d.type === 'element' && d.meta.year === latest_year) {\n ctx.beginPath();\n ctx.strokeStyle = 'black';\n ctx.lineWidth = d.stroke_width / 2;\n ctx.arc(d.x, d.y, d.r + d.stroke_width, 0, pi2);\n ctx.stroke(); // ctx.closePath()\n } //if\n\n\n ctx.fillStyle = d.fill; //If the element circles are big enough, draw images inside\n\n if (d.type === 'element' && d.img && d.img_loaded && (r > 10 || show_photos)) {\n var img_w = d.img.width;\n var img_h = d.img.height;\n var min_size = Math.min(img_w, img_h); //When saving, making the stroke width smaller\n\n var radius = show_photos ? r - d.stroke_width * 0.2 / 2 : r - d.stroke_width / 2; //Clip the image to the circle\n\n ctx.save();\n ctx.beginPath();\n ctx.arc(d.x, d.y, radius, 0, pi2);\n ctx.clip();\n ctx.drawImage(d.img, (img_w - min_size) / 2, (img_h - min_size) / 2, min_size, min_size, //sx, sy, swidth, sheight\n d.x - r, d.y - r, 2 * r, 2 * r); //x, y, width, height\n\n ctx.restore();\n } //if\n\n\n ctx.beginPath(); //The shape depends on the type of node\n\n if (d.type === 'whc') {\n drawDiamond(ctx, d.x, d.y, 1.5 * r, 2 * r);\n ctx.fill(); // } else if (d.type === \"ngo\" || d.type === \"project\") {\n // drawNinjaStar(ctx, d.x, d.y, 2*r)\n // ctx.fill()\n } else if (d.type === 'region') {\n drawHexagon(ctx, d.x, d.y, sqrt3 * r, 2 * r);\n ctx.fill();\n ctx.lineWidth = d.stroke_width;\n ctx.strokeStyle = 'white';\n ctx.stroke();\n } else if (d.type === 'country') {\n drawDiamond(ctx, d.x, d.y, 2 * r, 2 * r);\n ctx.fill();\n ctx.lineWidth = d.stroke_width; // ctx.strokeStyle = \"white\"\n // ctx.stroke()\n } else if (d.type === 'concept') {\n //Bigger nodes are white with a colored stroke\n //Small nodes get the colored fill with no stroke\n if (r > 2) {\n ctx.arc(d.x, d.y, r, 0, pi2);\n ctx.strokeStyle = d.fill;\n ctx.lineWidth = d.stroke_width;\n ctx.fillStyle = 'white';\n if (opacity) ctx.globalAlpha = 1;\n ctx.fill();\n if (opacity) ctx.globalAlpha = opacity;\n ctx.stroke();\n } else {\n ctx.moveTo(d.x, d.y);\n ctx.arc(d.x, d.y, r, 0, pi2);\n ctx.fillStyle = d.fill;\n ctx.fill();\n } //else\n\n } else if (d.type === 'element') {\n //If the element circles are big enough, draw images inside\n if (d.img && d.img_loaded && (r > 10 || show_photos)) {\n //Draw a colored stroke around the image\n ctx.lineWidth = d.stroke_width * (show_photos ? 0.2 : 1);\n ctx.strokeStyle = d.fill;\n ctx.arc(d.x, d.y, r, 0, pi2);\n ctx.stroke();\n } else {\n //Draw a completely filled circle\n ctx.moveTo(d.x, d.y);\n ctx.arc(d.x, d.y, r, 0, pi2);\n ctx.fill();\n } //else\n\n } else {\n //All other node types become circles\n ctx.moveTo(d.x, d.y);\n ctx.arc(d.x, d.y, r, 0, pi2);\n ctx.fill();\n } //else\n // ctx.closePath()\n\n } //function drawNodes", "function drawLinks() {\n\t\t\tpanel.empty();\n\t\t\tvar interval = getInterval();\n\t\t\tvar np = numPages();\n\t\t\t// This helper function returns a handler function that calls pageSelected with the right page_id\n\t\t\tvar getClickHandler = function(page_id) {\n\t\t\t\treturn function(evt){ return pageSelected(page_id,evt); }\n\t\t\t}\n\t\t\t// Helper function for generating a single link (or a span tag if it's the current page)\n\t\t\tvar appendItem = function(page_id, appendopts){\n\t\t\t\tpage_id = page_id<0?0:(page_id<np?page_id:np-1); // Normalize page id to sane value\n\t\t\t\tappendopts = jQuery.extend({text:page_id+1, classes:\"\"}, appendopts||{});\n\t\t\t\tif(page_id == current_page){\n\t\t\t\t\tvar lnk = jQuery(\"<span class='ui-state-active ui-corner-all'>\"+(appendopts.text)+\"</span>\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar lnk = jQuery(\"<a class='ui-state-default ui-corner-all'>\"+(appendopts.text)+\"</a>\")\n\t\t\t\t\t\t.bind(\"click\", getClickHandler(page_id))\n\t\t\t\t\t\t.attr('href', opts.link_to.replace(/__id__/,page_id));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(appendopts.classes){lnk.addClass(appendopts.classes);}\n\t\t\t\tpanel.append(lnk);\n\t\t\t}\n\t\t\t// Generate \"Previous\"-Link\n\t\t\tif(opts.prev_text && (current_page > 0 || opts.prev_show_always)){\n\t\t\t\tappendItem(current_page-1,{text:opts.prev_text, classes:\"prev\"});\n\t\t\t}\n\t\t\t// Generate starting points\n\t\t\tif (interval[0] > 0 && opts.num_edge_entries > 0)\n\t\t\t{\n\t\t\t\tvar end = Math.min(opts.num_edge_entries, interval[0]);\n\t\t\t\tfor(var i=0; i<end; i++) {\n\t\t\t\t\tappendItem(i);\n\t\t\t\t}\n\t\t\t\tif(opts.num_edge_entries < interval[0] && opts.ellipse_text)\n\t\t\t\t{\n\t\t\t\t\tjQuery(\"<span>\"+opts.ellipse_text+\"</span>\").appendTo(panel);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Generate interval links\n\t\t\tfor(var i=interval[0]; i<interval[1]; i++) {\n\t\t\t\tappendItem(i);\n\t\t\t}\n\t\t\t// Generate ending points\n\t\t\tif (interval[1] < np && opts.num_edge_entries > 0)\n\t\t\t{\n\t\t\t\tif(np-opts.num_edge_entries > interval[1]&& opts.ellipse_text)\n\t\t\t\t{\n\t\t\t\t\tjQuery(\"<span>\"+opts.ellipse_text+\"</span>\").appendTo(panel);\n\t\t\t\t}\n\t\t\t\tvar begin = Math.max(np-opts.num_edge_entries, interval[1]);\n\t\t\t\tfor(var i=begin; i<np; i++) {\n\t\t\t\t\tappendItem(i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// Generate \"Next\"-Link\n\t\t\tif(opts.next_text && (current_page < np-1 || opts.next_show_always)){\n\t\t\t\tappendItem(current_page+1,{text:opts.next_text, classes:\"next\"});\n\t\t\t}\n\t\t}", "function myGraph(selector) {\n\n/*\nThe vector of nodes is nodes. Each node is an object \nwhich has an id, type, screen coordinates x, y, and velocities vx, vy, a links vector and an age. \n*/\n\n// Adds a node. age is from a global variable\n this.addNode = function (id, type, x, y) {\n nodes.push({\"id\": id, \"type\": type, x: x, y: y, vx:0, vy:0, links:[], \"age\":age});\n return nodes[nodes.length-1];\n };\n\n// removes nodes based on id\n this.removeNode = function (id) {\n var n = findNode(id);\n while (n.links.length > 0) {\n removeLinkIndex(links.indexOf(n.links[0]));\n }\n nodes.splice(findNodeIndex(id), 1);\n };\n\n\n// removes links based in index\n var removeLinkIndex = function(i) {\n var slinks = links[i].source.links;\n slinks.splice(slinks.indexOf(links[i]), 1);\n var tlinks = links[i].target.links;\n tlinks.splice(tlinks.indexOf(links[i]), 1);\n links.splice(i, 1);\n }\n\n// removes link based on source and target\n this.removeLink = function (source, target) {\n for (var i = 0; i < links.length; i++) {\n if (links[i].source.id == source && links[i].target.id == target) {\n removeLinkIndex(i);\n break;\n }\n }\n };\n\n\n// removes all links\n this.removeAllLinks = function () {\n links.splice(0, links.length);\n update();\n };\n\n// removes all nodes and all affected links\n this.removeAllNodes = function () {\n nodes.splice(0, nodes.length);\n links.splice(0, links.length);\n newNodeIndex = 0;\n update();\n };\n\n/*\nEach link has a source and a target. It also has a value (to be used for graphical purposes) and an age \n(from a global variable).\n*/\n this.addLink = function (source, target, value) {\n var nsource = findNode(source);\n var ntarget = findNode(target);\n var newLink = {\"source\": nsource, \"target\": ntarget, \"value\": value, \"age\":age};\n nsource.links.push(newLink);\n ntarget.links.push(newLink);\n links.push(newLink);\n };\n\n\n// finds node based on id\n this.findNode = function (id) {\n for (var i in nodes) {\n if (nodes[i][\"id\"] === id) return nodes[i];\n }\n ;\n };\n\n// finds the age of a link between nodes with id id1 and id2\n this.findLinkAge = function (id1,id2) {\n for (var i in links) {\n if ((links[i].source == id1 && links[i].target == id2) || (links[i].source == id2 && links[i].target == id1) ) return links[i].age;\n }\n };\n\n// finds the node index of a node with id \n var findNodeIndex = function (id) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].id == id) {\n return i;\n }\n }\n\n };\n\n\n// finds linked nodes\n this.getLinked = function (node) {\n return node.links.map(function(e) {\n return (e.source === node ? e.target : e.source);\n });\n }\n \n\n// graphical use\n this.screenToWorldPoint = function(x,y) {\n var svgEl = svg.node();\n var pt = svgEl.createSVGPoint();\n pt.x = x;\n pt.y = y;\n pt = pt.matrixTransform(vis.node().getCTM().inverse());\n return pt;\n }\n\n// set up the D3 visualisation in the specified element\n\n var color = d3.scaleOrdinal()\n .domain(graphNodes)\n .range(graphNodesColors);\n\n\n var svg = d3.select(selector)\n .append(\"svg:svg\")\n .attr(\"width\", w)\n .attr(\"height\", h)\n .attr(\"id\", \"svg\")\n .attr(\"pointer-events\", \"all\")\n .attr(\"viewBox\", \"0 0 \" + w + \" \" + h)\n .attr(\"preserveAspectRatio\", \"xMinYMin meet\") \n .on(\"click\",backClick)\n\n\n \n var vis = svg.append('svg:g');\n\n// defines a force simulation\n var force = d3.forceSimulation();\n\n this.nodes = force.nodes()\n this.links = [];\n\n d3.select(\"input[id='gravRange']\")\n .on(\"input\", inputted);\n\n// triggers the search for rewrite patterns\n this.update = function () {\n // Update transform list\n findAllTransforms();\n \n // Update graph\n var link = vis.selectAll(\"line\")\n .data(links, function (d) {\n return d.source.id + \"-\" + d.target.id;\n });\n\n// adds a link representation as a line, the value is used for stroke width\n var linkEnter = link.enter()\n .append(\"line\")\n .style(\"stroke-opacity\",0).style(\"fill-opacity\",0)\n .attr(\"id\", function (d) {\n return d.source.id + \"-\" + d.target.id;\n })\n .attr(\"stroke-width\", function (d) {\n return d.value / 10;\n })\n .transition()\n// .delay(0.2)\n .duration(2)\n .style(\"stroke-opacity\",1).style(\"fill-opacity\",1)\n .attr(\"class\", \"link\")\n //link.append(\"title\")\n // .text(function (d) {\n // return d.value;\n // });\n link.exit().remove();\n\n link = link.merge(linkEnter)\n\n var node = vis.selectAll(\"g.node\")\n .data(nodes, function (d) {\n return d.id;\n });\n\n var nodeEnter = node.enter().append(\"g\")\n .attr(\"class\", \"node\")\n\n// adds a node representation as a circle\n nodeEnter.append(\"svg:circle\")\n .style(\"stroke-opacity\",0).style(\"fill-opacity\",0)\n .transition()\n// .delay(0.2)\n .duration(1)\n .style(\"stroke-opacity\",1).style(\"fill-opacity\",1)\n .attr(\"r\", function(d) {\n if (d.type == \"in\" || d.type == \"out\" || d.type == \"middle\") {\n return 4;\n } else {\n return 8;\n }\n })\n .attr(\"id\", function (d) {\n return \"Node;\" + d.id;\n })\n .attr(\"class\", \"nodeStrokeClass\")\n .attr(\"fill\", function(d) {\n// added metabolism colors \n if (metabo == 0) { \n return color(d.type);\n } else {\n return whiteCol;\n }\n })\n\n node.exit().remove();\n \n node = node.merge(nodeEnter)\n .on(\"click\",nodeClick)\n .on(\"mouseenter\",nodeHover)\n .call(d3.drag()\n .on(\"start\", dragstarted)\n .on(\"drag\", dragged)\n .on(\"end\", dragended)\n );\n\n// mouse drag behaviour\n function dragstarted(d) {\n if (!d3.event.active) force.alphaTarget(0.1).restart();\n d.fx = d.x;\n d.fy = d.y;\n }\n \n function dragged(d) {\n d.fx = d3.event.x;\n d.fy = d3.event.y;\n }\n \n function dragended(d) {\n if (!d3.event.active) force.alphaTarget(0);\n d.fx = null;\n d.fy = null;\n }\n\n\n// takes the value of gravity from the gravity slider\n function gravForce() {\n var gravi = (document.getElementById(\"gravRange\").value) / 1000;\n return gravi;\n }\n \n// keeps node objects on top of edges\n $(\".nodeStrokeClass\").each(function( index ) {\n var gnode = this.parentNode;\n gnode.parentNode.appendChild(gnode);\n });\n\n\n// zoom behaviour\n d3.zoom().on(\"zoom\", function zoom_actions(){\n vis.attr(\"transform\", d3.event.transform)\n })(svg)\n\n// Restart the force layout.\n force\n .alpha(forceAlpha)\n .alphaDecay(forceAlphaDecay)\n .velocityDecay(forceVelocityDecay)\n .force(\"charge_force\", d3.forceManyBody().strength(chargeForceStrength))\n .force(\"center_x\", d3.forceX(w / 2).strength(gravForce))\n .force(\"center_y\", d3.forceY(h / 2).strength(gravForce))\n .force(\"links\", d3.forceLink(links).id(function (d) { return d.id; }).distance(function(d) {\n if (d.value == 1) {\n return 2;\n } else {\n return 1;\n }\n }).strength(forceStrength))\n .on(\"tick\", function () {\n\n node.attr(\"transform\", function (d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n\n link.attr(\"x1\", function (d) {\n return d.source.x;\n })\n .attr(\"y1\", function (d) {\n return d.source.y;\n })\n .attr(\"x2\", function (d) {\n return d.target.x;\n })\n .attr(\"y2\", function (d) {\n return d.target.y;\n });\n })\n .restart();\n\n// end function update()\n };\n\nfunction inputted() {\n force.alphaTarget(1);\n force.restart();\n update();\n}\n\n// Make it all go\n update();\n\n// end function myGraph\n}", "function update(nodes, links) {\n\n circle = circleG.selectAll('circle').data(nodes, d=>d.id)\n\n circle.exit().remove()\n\n entered_circle = circle\n .enter().append('circle')\n .attr('r', nodeRadius)\n .attr('stroke-width', 2)\n .attr('stroke', 'mediumblue')\n .attr('fill', 'mediumblue')\n .attr('cx', function(d) {return d.x})\n .attr('cy', function(d) {return d.y})\n \n circle = circle.merge(entered_circle)\n\n circle.transition().duration(1000)\n .attr('cx', function(d) {return d.x})\n .attr('cy', function(d) {return d.y})\n .attr('id', function(d) {return \"node-\" + d.id.toString() + \"-\"})\n\n path = pathG.selectAll('path').data(links, d=>d.id)\n\n path.exit().remove()\n\n entered_path = path\n .enter().append('path')\n .attr('opacity', 1)\n .attr('stroke-linecap', 'round')\n .attr('stroke-width', '2px')\n .attr('fill', 'transparent')\n\n path = path.merge(entered_path)\n\n path.transition().duration(1000)\n .attr('id', function(d) { return \"link\" + \"-source-\" + d.source.id.toString() + \"-target-\" + d.target.id.toString() + \"-\" })\n .attr('stroke', 'mediumblue')\n .attr(\"d\", function(d) {\n var dx = d.target.x - d.source.x,\n dy = d.target.y - d.source.y,\n dr = Math.sqrt(dx * dx + dy * dy);\n\n return \"M\" + \n d.source.x + \",\" + \n d.source.y + \"L\" + \n d.target.x + \",\" + \n d.target.y\n })\n \n }", "redraw() {\n // clear\n this._ctx.fillStyle = REN.BACKGROUND_COLOR;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height)\n \n // draw \n this._ps.eachNode(this.drawNode.bind(this)); \n this._ps.eachEdge(this.drawEdge.bind(this));\n this.drawName(this._currentNodeFocus);\n }", "function run(graph) {\n link = svg\n .append(\"g\")\n .selectAll(\"line\")\n .data(graph.links)\n .enter()\n .append(\"line\")\n .style(\"stroke\", function (d) {\n if (d.value === 0) return \"#0000ff\";\n else return \"#ff0000\";\n })\n .attr(\"stroke-width\", 3);\n\n node = svg\n .append(\"g\")\n .attr(\"class\", \"nodes\")\n .selectAll(\"circle\")\n .data(graph.nodes)\n .enter()\n .append(\"circle\")\n .attr(\"r\", 2)\n .call(\n d3\n .drag()\n .on(\"start\", dragstarted)\n .on(\"drag\", dragged)\n .on(\"end\", dragended)\n );\n\n label = svg\n .append(\"g\")\n .attr(\"class\", \"labels\")\n .selectAll(\"text\")\n .data(graph.nodes)\n .enter()\n .append(\"text\")\n .attr(\"class\", \"label\")\n .text(function (d) {\n return d.id;\n });\n\n simulation.nodes(graph.nodes).on(\"tick\", ticked);\n simulation.force(\"link\").links(graph.links);\n\n var allBlue = document.getElementsByClassName(\"addLink\");\n for (var i = 0; i < allBlue.length; i++) {\n allBlue[i].style.boxShadow = \" 1px 1px 15px #0ab8f7\";\n }\n}", "function update(nodes_in, links_in) {\n\t// Set data as node ids\n\tvar n_odd_nodes = root.odd_list.length\n\t\n\tif (first_draw & n_odd_nodes > 0) {\n\t // place for the \"odd\" answers to go\n\t first_draw = false;\n\t var odd_answers1 = d3.select(\"#odd\").append(\"svg\")\n\t\t.attr(\"width\",width + margin.left + margin.right)\n\t\t.attr(\"height\",(width-2*.07)/9 + margin.top + margin.bottom)\n\n\t var odd_answers = odd_answers1.append(\"g\")\n\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n\t var onode = odd_answers.selectAll(\".onode\");\n\n\t root.odd_list.forEach(function(d) {\n\t\tvalue = d.value / Total_value;\n\t\td.radius = width * (1-2*.07) * Math.sqrt(value) / 18\n\t });\n\t \n\t onode = onode.data(root.odd_list, function(d) { return d.name });\n\t // Exit old nodes\n\t onode.exit().remove();\n\t \n\t var oenter = onode.enter().append(\"g\")\n\t\t.attr(\"class\",\"onode\")\n\t\t\n\t var oimage = oenter.append(\"g\")\n\t\t.attr(\"transform\", function(d) { return \"scale(\" + d.radius/50 + \")\" });\n\n\t odd_answers1.attr(\"height\",2*Math.ceil(root.odd_list[0].radius) + margin.top + margin.bottom);\n\t oenter.attr(\"transform\", function(d,i) {\n\t\treturn 'translate(' + [width*(i+.5)/n_odd_nodes, Math.ceil(root.odd_list[0].radius)] + ')'; \n\t\t});\n\t oimage.append(\"defs\")\n\t\t.append(\"clipPath\")\n\t\t.attr(\"id\", function(d) { return \"myClip\" + d.name; })\n\t\t.append(\"circle\")\n\t\t.attr(\"cx\", 0)\n\t\t.attr(\"cy\", 0)\n\t\t.attr(\"r\", 50);\n\t // add a black circle in the background\n\t oimage.append(\"circle\")\n\t\t.attr(\"color\", \"black\")\n\t\t.attr(\"cx\", 0)\n\t\t.attr(\"cy\", 0)\n\t\t.attr(\"r\", 50);\n\t oimage.append(\"image\")\n\t\t.attr(\"xlink:href\", \"images/workflow.png\")\n\t\t.attr(\"x\", -50)\n\t\t.attr(\"y\", function(d) { return -image_offset[d.name][1]*100-50; })\n\t\t.attr(\"clip-path\", function(d) { return \"url(#myClip\" + d.name + \")\"; })\n\t\t.attr(\"width\", 100)\n\t\t.attr(\"height\", 4900);\n\t oenter.append(\"title\")\n\t\t.text(function(d) { return image_offset[d.name][0] + \": \" + d.value; });\n\t}\n\t// add the nodes and links to the tree\n\tforce\n\t .nodes(nodes_in)\n\t .links(links_in)\n\t .on(\"tick\", tick);\n\n\t// set the data for the links (with unique ids)\n\tlink = link.data(links_in, function(d) { return d.link_id; });\n\t\n\t// add a path object to each link\n\tlink.enter().insert(\"path\", \".gnode\")\n .attr(\"class\", function(d) { return d.is_max ? \"link_max\" : \"link\"; })\n\t .attr(\"d\", diagonal)\n .style(\"stroke-width\", function(d) { return .5 * width * Math.sqrt(d.value/Total_value) / 18; });\n\n\tlink.append(\"title\")\n\t .text(function(d) { return d.value; })\n \n\t// Exit any old links\n\tlink.exit().remove();\n\n\t// set the data for the nodes (with unique ids)\n\tgnode = gnode.data(nodes_in, function(d) { return d.node_id; });\n\n\t// Exit any old nodes\n\tgnode.exit().remove();\n \n\t// add a group to the node to translate it\n\tvar genter = gnode.enter().append(\"g\")\n\t .attr(\"class\",\"gnode\")\n\t .call(force.drag)\n\t .on(\"click\", click);\n\n\t// add a group to the node to scale it\n\t// with this scaling the image (with r=50px) will have the propper radius\n\tvar gimage = genter.append(\"g\")\n\t .attr(\"transform\", function(d) { return d.answer_id ? \"scale(\" + d.radius/50 + \")\" : \"scale(\" + d.radius/100 + \")\"; })\n\n\t// add a clipPath for a circle to corp the node image\n\tgimage.append(\"defs\")\n\t .append(\"clipPath\")\n\t .attr(\"id\", function(d) { return \"myClip\" + d.node_id; })\n\t .append(\"circle\")\n\t .attr(\"cx\", 0)\n\t .attr(\"cy\", 0)\n\t .attr(\"r\", function(d) { return d.answer_id ? 45 : 100; });\n\n\t// add a black circle in the background\n\tgimage.append(\"circle\")\n\t .attr(\"color\", \"black\")\n\t .attr(\"cx\", 0)\n\t .attr(\"cy\", 0)\n\t .attr(\"r\", function(d) { return d.answer_id ? 45 : 100; });\n\n\t// add the inital image to the node\n\tgimage.append(\"image\")\n\t .attr(\"xlink:href\", function(d) { return d.answer_id ? \"images/workflow.png\" : root.image_url})\n\t .attr(\"x\", function(d) { return d.answer_id ? -50: -100; })\n\t .attr(\"y\", function(d) { return d.answer_id ? -image_offset[d.answer_id][1]*100-50 : -100; })\n\t .attr(\"clip-path\", function(d) { return \"url(#myClip\" + d.node_id + \")\"; })\n\t .attr(\"width\", function(d) { return d.answer_id ? 100: 200; })\n\t .attr(\"height\", function(d) { return d.answer_id ? 4900: 200; });\n\t\n\t// add the yes/no image if needed\n\tgimage.append(\"image\")\n\t .attr(\"xlink:href\", \"images/workflow.png\")\n\t .attr(\"x\", -50)\n\t .attr(\"y\", function(d) { \n\t\tif (d.answer_id) {\n\t\t return image_offset[d.answer_id][2] ? -image_offset[d.answer_id][2]*100-50 : 100;\n\t\t} else {\n\t\t return 100;\n\t\t}\n\t })\n\t .attr(\"clip-path\", function(d) { return \"url(#myClip\" + d.node_id + \")\"; })\n\t .attr(\"width\", 100)\n\t .attr(\"height\", 4900)\n\t .attr(\"opacity\", .35);\n\n\t// add the mouse over text\n\tvar mouse_over = genter.append(\"title\")\n\t .text(function(d) { return image_offset[d.answer_id][0] + \": \" + Math.round(d.value*Total_value); })\n \n\t// start the nodes moving\n\tforce.start();\n\t//for (var i = 500; i > 0; --i) force.tick();\n\t//force.stop();\n \n\td3.select(\"#weight_raw\").on(\"change\", function() { set_weight(0); })\n\td3.select(\"#weight_weighted\").on(\"change\", function() { set_weight(1); })\n\td3.select(\"#weight_bias\").on(\"change\", function() { set_weight(2); })\n\n\t// call-back to swap weighting\n\tfunction set_weight(idx) {\n\t root.nodes.forEach(function(n) {\n\t\tn.radius = n._radius[idx];\n\t\tn.value = n._values[idx];\n\t\tgimage.attr(\"transform\", function(d) { return d.answer_id ? \"scale(\" + d.radius/50 + \")\" : \"scale(\" + d.radius/100 + \")\"; });\n\t\tlink.style(\"stroke-width\", function(d) { return .5 * Math.min(d.target.radius, d.source.radius); });\n\t\tmouse_over.text(function(d) { return image_offset[d.answer_id][0] + \": \" + d.votes[idx]; })\n\t });\n\t update_charge(d3.select(\"#slider_charge\").property(\"value\"));\n\t}\n\n\t// call-back to set how the nodes will move\n\tfunction tick(e) {\n\t // make sure the force gets smaller as the simulation runs\n\t var ky = 10 * e.alpha;\n\t \n\t root.nodes.forEach(function(d, i) {\n\t\t// fix the x value at the depth of the node\n\t\t// and add in the radius of the first node\n\t\ti!=0 ? d.x = d.fixed_x + root.nodes[0].radius+50 : d.x = d.fixed_x + root.nodes[0].radius;\n\t\t// move low prob nodes down\n\t\t// and keep the groups together (to a lesser extent)\n\t\tif (root.nodes[1].value > root.nodes[2].value) { \n\t\t j = 1;\n\t\t} else {\n\t\t j = -1;\n\t\t}\n\t\t// the amount to move the node\n\t\tdelta_y = (3 * d.value - j * .3 * d.group + .3) * ky;\n\t\t// store the old position in case something goes wrong\n\t\t// the collision detection can casue NaNs and I am not sure why\n\t\td.y_old = d.y;\n\t\t// check to make sure the node is not outside the plot area\n\t\t// if it is change the direction of the push\n\t\tif ((d.y-d.radius<0 && delta_y>0) || (d.y+d.radius>height && delta_y<0)) {\n\t\t delta_y *= -1\n\t\t}\n\t\td.y -= delta_y;\n\t });\n\n\t // Also do collision detection after a few itterations\n\t if (e.alpha<0.05) {\n\t\tvar q=d3.geom.quadtree(root.nodes),\n\t\t i=0,\n\t\t n=root.nodes.length;\n\t\twhile (++i < n) q.visit(collide(root.nodes[i]));\n\t }\n\t \n\t // if the new position is NaN use the previous position\n\t // this prevents links for disappearing\n\t root.nodes.forEach( function(d) {\n\t\tif (isNaN(d.y)) { d.y = d.y_old; }\n\t });\n\t \n\t // Translate the node group to the new position\n\t gnode.attr(\"transform\", function(d) {\n\t\treturn 'translate(' + [d.x, d.y] + ')'; \n\t }); \n\t link.attr(\"d\",diagonal);\n\t};\n\t// the collision detection code\n\t// found this online and I am not sure how it works\n\tfunction collide(node) {\n\t var r = node.radius,\n\t\tnx1 = node.x - r,\n\t\tnx2 = node.x + r,\n\t\tny1 = node.y - r,\n\t\tny2 = node.y + r;\n\t return function(quad, x1, y1, x2, y2) {\n\t\tif (quad.point && (quad.point !== node)) {\n\t\t var x = node.x - quad.point.x,\n\t\t\ty = node.y - quad.point.y,\n\t\t\tl = Math.sqrt(x * x + y * y),\n\t\t\tr = 0.9*(node.radius + quad.point.radius);\n\t\t if (l < r) {\n\t\t\tl = (l - r) / l * .5;\n\t\t\t//node.x -= x *= l;\n\t\t\tnode.y -= y *= l;\n\t\t\t//quad.point.x += x;\n\t\t\tquad.point.y += y;\n\t\t }\n\t\t}\n\t\treturn x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n\t };\n\t}\n }", "draw() {\n if (!this.lines[1]) { return; }\n let left = this.endpoints[0].x;\n let right = this.endpoints[1].x + this.endpoints[1].boxWidth;\n\n let lOffset = -this.endpoints[0].boxWidth / 2;\n let rOffset = this.endpoints[1].boxWidth / 2;\n\n if (this.endpoints[0].row === this.endpoints[1].row) {\n // draw left side of the brace and align text\n let center = (-left + right) / 2;\n this.x = center + lOffset;\n this.svgText.x(center + lOffset);\n this.lines[0].plot('M' + lOffset + ',33c0,-10,' + [center,0,center,-8]);\n this.lines[1].plot('M' + rOffset + ',33c0,-10,' + [-center,0,-center,-8]);\n }\n else {\n // draw right side of brace extending to end of row and align text\n let center = (-left + this.endpoints[0].row.rw) / 2 + 10;\n this.x = center + lOffset;\n this.svgText.x(center + lOffset);\n\n this.lines[0].plot('M' + lOffset\n + ',33c0,-10,' + [center,0,center,-8]\n + 'c0,10,' + [center,0,center,8]\n );\n this.lines[1].plot('M' + rOffset\n + ',33c0,-10,' + [-right + 8, 0, -right + 8, -8]\n + 'c0,10,' + [-right + 8, 0, -right + 8, 8]\n );\n }\n\n // propagate draw command to parent links\n this.links.forEach(l => l.draw(this));\n }", "drawTree() {\r\n fuenfteAufgabe.crc2.beginPath();\r\n fuenfteAufgabe.crc2.moveTo(this.x, this.y);\r\n fuenfteAufgabe.crc2.lineTo(this.x + 30, this.y - 60);\r\n fuenfteAufgabe.crc2.lineTo(this.x + 60, this.y);\r\n fuenfteAufgabe.crc2.strokeStyle = this.color;\r\n fuenfteAufgabe.crc2.stroke();\r\n fuenfteAufgabe.crc2.fillStyle = this.color;\r\n fuenfteAufgabe.crc2.fill();\r\n }", "function drawPaths() {\n\n // clear links container\n var linksDOM = d3.select('#links');\n linksDOM.selectAll('*').remove();\n\n for (var i = 0, n = links.length; i < n; i++) {\n\n var tubes = tubesInLink(links[i]);\n var colors = linkCables(links[i], false);\n var count = 1;\n\n // compute lines for link/tube\n if (view == 'tube' && tubes.length > 0)\n count = tubes.length;\n else if (view == 'cable' && colors.length > 0)\n count = colors.length;\n\n if (count == 0)\n count = 1;\n\n for (var j = 0; j < count; j++) {\n\n // get stroke color\n var strokeColor = 'grey';\n if (view == 'tube' && tubes.length > 0)\n strokeColor = 'black';\n else if ((view == 'cable' && colors.length > 0) || vertical)\n strokeColor = colors[j] || 'grey';\n\n // add line\n linksDOM.append('svg:path')\n .attr('class', 'link')\n .attr('id', 'link_' + i)\n .attr('fill', 'none')\n .attr('stroke', strokeColor)\n .attr('stroke-width', (20 * size) + 'px')\n .attr('d', (function () {\n\n var d = links[i];\n var x1 = d.source.x;\n var x2 = d.target.x;\n var y1 = d.source.y;\n var y2 = d.target.y;\n\n var distanceX = Math.abs(x1 - x2);\n var distanceY = Math.abs(y1 - y2);\n var offset = 4;\n\n var desc = ((count - j) * offset) - ((count + 1) * offset / 2);\n var asc = ((j + 1) * offset) - ((count + 1) * offset / 2);\n\n var verticalOffset;\n var horizontalOffset;\n\n // horizontal line\n if (distanceX >= distanceY) {\n verticalOffset = asc;\n return 'M' + (x1 + sizeSquare * size / 2) + ',' + ((y1 + sizeSquare * size / 2) + verticalOffset) + ' ' + (x2 + sizeSquare * size / 2) + ',' + ((y2 + sizeSquare * size / 2) + verticalOffset);\n }\n // vertical line\n else {\n\n horizontalOffset = asc;\n\n // 1. down -> right\n if (x1 < x2 && y1 < y2)\n verticalOffset = desc;\n // 2. down -> left\n else if (x1 > x2 && y1 < y2)\n verticalOffset = asc;\n // 3. up -> right\n else if (x1 < x2 && y1 > y2)\n verticalOffset = asc;\n // 4. up -> left\n else\n verticalOffset = desc;\n\n return 'M' + (x1 + horizontalOffset + sizeSquare * size / 2) + ',' + ((y1 + sizeSquare * size / 2) + verticalOffset) + ' ' + (x2 + horizontalOffset + sizeSquare * size / 2) + ',' + ((y2 + sizeSquare * size / 2) + verticalOffset);\n }\n })());\n }\n }\n\n // ----------------\n // -----Events-----\n // ----------------\n $('path.link').each(function () {\n\n var pathIndex = $(this).attr('id');\n if (pathIndex != undefined) {\n pathIndex = parseInt(pathIndex.substring(5));\n\n $(this)\n .off()\n .on('mouseover', function () {\n path_mouseover(pathIndex);\n })\n .on('mouseout', function () {\n path_mouseout();\n })\n .on('click', function (event) {\n path_mousedown(event, pathIndex);\n });\n }\n });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic)\n .append(\"circle\");\n\n node.select(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function generateNetworkGraph(nodeData,linkData){\n force\n .nodes(nodeData)\n // .nodes(d3.values(networkData))\n .links(linkData)\n .on(\"tick\",tick)\n .start();\n\n // build the arrow.\n svgSoical.append(\"svg:defs\").selectAll(\"marker\")\n .data([\"end\"]) // Different link/path types can be defined here\n .enter().append(\"svg:marker\") // This section adds in the arrows\n .attr(\"id\", String)\n .attr(\"viewBox\", \"0 -5 10 10\")\n .attr(\"refX\", 15)\n .attr(\"refY\", -1.5)\n .attr(\"markerWidth\", 6)\n .attr(\"markerHeight\", 6)\n .attr(\"orient\", \"auto\")\n .append(\"svg:path\")\n .attr(\"d\", \"M0,-5L10,0L0,5\");\n\n // add the links and the arrows\n path = svgSoical.append(\"svg:g\").selectAll(\"path\")\n .data(force.links())\n .enter().append(\"svg:path\") \n // .attr(\"class\", function(d) { return \"link \" + d.type; })\n .attr(\"class\", \"link\")\n .attr(\"marker-end\", \"url(#end)\");\n\n //define the nodes\n node = svgSoical.selectAll(\".node\")\n //.data(networkData)\n .data(force.nodes())\n .call(force.drag)\n .enter().append(\"g\")\n .attr(\"class\", \"node\")\n .on(\"click\",function(d){\n let lat = d.tweets[0].latitude; \n let long = d.tweets[0].longitude;\n if (lat !== 0 & long !== 0) {\n console.log(lat,long);\n zoomOnMap(long,lat);\n }\n //console.log(d.tweets[0].latitude, d.tweets[0].longitude); debugger;\n\n highlightUser(d.userName);\n })\n .on(\"mouseover\", function(){tooltip.style(\"display\",null);})\n .on(\"mouseout\", function() {tooltip.style(\"display\", \"none\");})\n .on(\"dblclick.zoom\", function(d) {\n var dcx = (width/2-d.x*zoom.scale());\n var dcy = (height/2-d.y*zoom.scale());\n zoom.translate([dcx,dcy]);\n svgSoical.attr(\"transform\", \"translate(\"+ dcx + \",\" + dcy + \")scale(\" + zoom.scale() + \")\");\n })\n .on(\"mousemove\",function(d) {\n //console.log(d)\n tooltip.style(\"left\", d3.event.pageX+10+\"px\");\n tooltip.style(\"top\", d3.event.pageY-25+\"px\");\n tooltip.style(\"display\", \"inline-block\");\n tooltip.select(\"text\").html(\"User: \"+d.userName+'<br/>'+\"Believes True: \" + d.legitCount+'<br/>'+\"Believes Not True: \"+d.notLegitCount+ '<br/>' + \"User Bio: \" + d.bio);})\n .call(force.drag);\n\n //add the nodes\n node.append('circle')\n .attr('r', 5)\n .attr('fill', function(d,i){return getNetworkColor(d.legitCount,d.notLegitCount);});\n\n\n}", "function setOutputLinks (node, color) {\n node.findLinksOutOf().each(function (link) { link.findObject('SHAPE').stroke = color })\n }", "function make_graphToDraw () {\n if (graph_num == head) {\n graph_toDraw = graph_cur;\n\n graph_toDraw.nodes.forEach(function (node) {\n node.type = NORMAL;\n });\n } else {\n find_created(graph_prev, graph_cur);\n\n changes.disappearedNodes.forEach(function (nodeID) {\n for (var i = 0; i < graph_toDraw.nodes.length; ++i) {\n if (graph_toDraw.nodes[i].id == nodeID) {\n graph_toDraw.nodes.splice(i, 1);\n }\n }\n });\n changes.disappearedLinks.forEach(function (linkID) {\n for (var i = 0; i < graph_toDraw.links.length; ++i) {\n if (graph_toDraw.links[i].id == linkID) {\n graph_toDraw.links.splice(i, 1);\n }\n }\n });\n\n graph_toDraw.nodes.forEach(function (node) {\n node.type = NORMAL;\n });\n d3.selectAll(\"circle\").style(\"fill\", \"#000000\");\n\n changes.createdNodes.forEach(function (node) {\n node.type = CREATED;\n graph_toDraw.nodes.push(node);\n });\n changes.createdLinks.forEach(function (link) {\n graph_toDraw.links.push(link);\n });\n }\n\n find_disappeared(graph_cur, graph_fut);\n\n changes.disappearedNodes.forEach(function (nodeID) {\n for (var i = 0; i < graph_toDraw.nodes.length; ++i) {\n if (graph_toDraw.nodes[i].id == nodeID) {\n graph_toDraw.nodes[i].type = DISAPPEARED;\n }\n }\n });\n\n changes.sizeChangedNodes.forEach(function (node) {\n for (var i = 0; i < graph_toDraw.nodes.length; ++i) {\n if (graph_toDraw.nodes[i].id == node.id) {\n graph_toDraw.nodes[i].size = node.newSize;\n }\n }\n });\n\n console.log(\"toDraw: \");\n console.log(JSON.parse(JSON.stringify(graph_toDraw)));\n console.log(\"------------------------------------------------\");\n\n restart();\n drag_handler(node);\n drag_handler(label);\n if (graph_num == head) {\n zoom_handler(svg);\n simulation\n .on(\"tick\", tick_action);\n }\n\n $.get(\"/part_text/\" + userfile + \"/\" + userfile + \"_part_\" + graph_num + \".txt\", function (data) {\n document.getElementById(\"part-text\").innerHTML = data;\n });\n\n var totalFrame = (tail - unit) - head + 1;\n var progressBar = document.getElementById(\"progressBar\");\n var progressVal = Math.floor((graph_num-(head-1)) / totalFrame * 100);\n progressBar.style.width = progressVal + \"%\";\n document.getElementById(\"progress-val\").innerHTML = progressVal * 1 + \"%\";\n\n document.getElementById(\"frame\").innerHTML = \"F=\" + (graph_num-(head-1)) + \"/\" + totalFrame;\n\n changes.createdNodes.forEach(function (node) {\n d3.select($(\"#\"+node.id)[0]).style(\"fill\", \"#5e5e5e\");\n });\n changes.disappearedNodes.forEach(function (nodeID) {\n d3.select($(\"#\"+nodeID)[0]).style(\"fill\", \"#FFFFFF\");\n });\n changes.sizeChangedNodes.forEach(function (node) {\n d3.select($(\"#\"+node.id)[0]).attr(\"r\", node.newSize);\n });\n}", "display() {\n stroke([204, 0, 255, 100]);\n strokeWeight(1);\n fill([255,0,0,70]);\n beginShape();\n for (let i=0; i<this.vertices.length; i++) {\n vertex(this.vertices[i].x/DIVIDER, this.vertices[i].y/DIVIDER);\n circle(this.vertices[i].x/DIVIDER, this.vertices[i].y/DIVIDER, 3);\n }\n vertex(this.vertices[0].x/DIVIDER, this.vertices[0].y/DIVIDER);\n endShape();\n }", "function drawLinks() {\n\t\t\tpanel.empty();\n\t\t\tvar interval = getInterval();\n\t\t\tvar np = numPages();\n\t\t\t// This helper function returns a handler function that calls pageSelected with the right page_id\n\t\t\tvar getClickHandler = function(page_id) {\n\t\t\t\treturn function(evt){ return pageSelected(page_id,evt); }\n\t\t\t}\n\t\t\t// Helper function for generating a single link (or a span tag if it's the current page)\n\t\t\tvar appendItem = function(page_id, appendopts){\n\t\t\t\tpage_id = page_id<0?0:(page_id<np?page_id:np-1); // Normalize page id to sane value\n\t\t\t\tappendopts = jQuery.extend({text:page_id+1, classes:\"\"}, appendopts||{});\n\t\t\t\tif(page_id == current_page){\n\t\t\t\t\tvar lnk = jQuery(\"<span class='current'>\"+(appendopts.text)+\"</span>\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar lnk = jQuery(\"<a>\"+(appendopts.text)+\"</a>\")\n\t\t\t\t\t\t.bind(\"click\", getClickHandler(page_id))\n\t\t\t\t\t\t.attr('href', opts.link_to.replace(/__id__/,page_id));\n\n\n\t\t\t\t}\n\t\t\t\tif(appendopts.classes){lnk.addClass(appendopts.classes);}\n\t\t\t\tpanel.append(lnk);\n\t\t\t}\n\t\t\t// Generate \"Previous\"-Link\n\t\t\tif(opts.prev_text && (current_page > 0 || opts.prev_show_always)){\n\t\t\t\tappendItem(current_page-1,{text:opts.prev_text, classes:\"prev\"});\n\t\t\t}\n\t\t\t// Generate starting points\n\t\t\tif (interval[0] > 0 && opts.num_edge_entries > 0)\n\t\t\t{\n\t\t\t\tvar end = Math.min(opts.num_edge_entries, interval[0]);\n\t\t\t\tfor(var i=0; i<end; i++) {\n\t\t\t\t\tappendItem(i);\n\t\t\t\t}\n\t\t\t\tif(opts.num_edge_entries < interval[0] && opts.ellipse_text)\n\t\t\t\t{\n\t\t\t\t\tjQuery(\"<span>\"+opts.ellipse_text+\"</span>\").appendTo(panel);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Generate interval links\n\t\t\tfor(var i=interval[0]; i<interval[1]; i++) {\n\t\t\t\tappendItem(i);\n\t\t\t}\n\t\t\t// Generate ending points\n\t\t\tif (interval[1] < np && opts.num_edge_entries > 0)\n\t\t\t{\n\t\t\t\tif(np-opts.num_edge_entries > interval[1]&& opts.ellipse_text)\n\t\t\t\t{\n\t\t\t\t\tjQuery(\"<span>\"+opts.ellipse_text+\"</span>\").appendTo(panel);\n\t\t\t\t}\n\t\t\t\tvar begin = Math.max(np-opts.num_edge_entries, interval[1]);\n\t\t\t\tfor(var i=begin; i<np; i++) {\n\t\t\t\t\tappendItem(i);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// Generate \"Next\"-Link\n\t\t\tif(opts.next_text && (current_page < np-1 || opts.next_show_always)){\n\t\t\t\tappendItem(current_page+1,{text:opts.next_text, classes:\"next\"});\n\t\t\t}\n\t\t}", "drawNodeShape (node, ctx, size, fgcolor, bgcolor, no_title, selected) {\n //bg rect\n ctx.strokeStyle = fgcolor || LiteGraph.NODE_DEFAULT_COLOR;\n ctx.fillStyle = bgcolor || LiteGraph.NODE_DEFAULT_BGCOLOR;\n\n /* gradient test\n let grad = ctx.createLinearGradient(0,0,0,node.size[1]);\n grad.addColorStop(0, \"#AAA\");\n grad.addColorStop(0.5, fgcolor || LiteGraph.NODE_DEFAULT_COLOR);\n grad.addColorStop(1, bgcolor || LiteGraph.NODE_DEFAULT_BGCOLOR);\n ctx.fillStyle = grad;\n //*/\n\n let title_height = LiteGraph.NODE_TITLE_HEIGHT;\n\n //render depending on shape\n let shape = node.shape || \"box\";\n if (shape == \"box\") {\n ctx.beginPath();\n ctx.rect(0, no_title ? 0 : -title_height, size[0] + 1, no_title ? size[1] : size[1] + title_height);\n ctx.fill();\n ctx.shadowColor = \"transparent\";\n\n if (selected) {\n ctx.strokeStyle = \"#CCC\";\n ctx.strokeRect(-0.5, no_title ? -0.5 : -title_height + -0.5, size[0] + 2, no_title ? (size[1] + 2) : (size[1] + title_height + 2) - 1);\n ctx.strokeStyle = fgcolor;\n }\n }\n else if (node.shape == \"round\") {\n ctx.roundRect(0, no_title ? 0 : -title_height, size[0], no_title ? size[1] : size[1] + title_height, 10);\n ctx.fill();\n }\n else if (node.shape == \"circle\") {\n ctx.beginPath();\n ctx.arc(size[0] * 0.5, size[1] * 0.5, size[0] * 0.5, 0, Math.PI * 2);\n ctx.fill();\n }\n\n ctx.shadowColor = \"transparent\";\n\n //ctx.stroke();\n\n //image\n if (node.bgImage && node.bgImage.width)\n ctx.drawImage(node.bgImage, (size[0] - node.bgImage.width) * 0.5, (size[1] - node.bgImage.height) * 0.5);\n\n if (node.bgImageUrl && !node.bgImage)\n node.bgImage = node.loadImage(node.bgImageUrl);\n\n if (node.onDrawBackground)\n node.onDrawBackground(ctx);\n\n //title bg (remember, it is rendered ABOVE the node\n if (!no_title) {\n ctx.fillStyle = fgcolor || LiteGraph.NODE_DEFAULT_COLOR;\n let old_alpha = ctx.globalAlpha;\n ctx.globalAlpha = 0.5 * old_alpha;\n if (shape == \"box\") {\n ctx.beginPath();\n ctx.rect(0, -title_height, size[0] + 1, title_height);\n ctx.fill()\n //ctx.stroke();\n }\n else if (shape == \"round\") {\n ctx.roundRect(0, -title_height, size[0], title_height, 10, 0);\n //ctx.fillRect(0,8,size[0],NODE_TITLE_HEIGHT - 12);\n ctx.fill();\n //ctx.stroke();\n }\n\n //title box\n ctx.fillStyle = node.boxcolor || LiteGraph.NODE_DEFAULT_BOXCOLOR;\n ctx.beginPath();\n if (shape == \"round\")\n ctx.arc(title_height * 0.5, title_height * -0.5, (title_height - 6) * 0.5, 0, Math.PI * 2);\n else\n ctx.rect(3, -title_height + 3, title_height - 6, title_height - 6);\n ctx.fill();\n ctx.globalAlpha = old_alpha;\n\n //title text\n ctx.font = this.d_title_text_font;\n let title = node.getTitle();\n if (title && this.d_scale > 0.5) {\n ctx.fillStyle = LiteGraph.NODE_TITLE_COLOR;\n ctx.fillText(title, 16, 13 - title_height);\n }\n }\n }", "function drawLinks() {\n panel.empty();\n var interval = getInterval();\n var np = numPages();\n // This helper function returns a handler function that calls pageSelected with the right page_id\n var getClickHandler = function(page_id) {\n return function(evt) { return pageSelected(page_id, evt); }\n }\n // Helper function for generating a single link (or a span tag if it'S the current page)\n var appendItem = function(page_id, appendopts) {\n page_id = page_id < 0 ? 0 : (page_id < np ? page_id : np - 1); // Normalize page id to sane value\n appendopts = jQuery.extend({ text: page_id + 1, classes: \"\" }, appendopts || {});\n if (page_id == current_page) {\n var lnk = $(\"<span class='this_p'>\" + (appendopts.text) + \"</span>\");\n }\n else {\n var lnk = $(\"<a>\" + (appendopts.text) + \"</a>\")\n\t\t\t\t\t\t.bind(\"click\", getClickHandler(page_id))\n\t\t\t\t\t\t.attr('href', opts.link_to.replace(/__id__/, page_id));\n\n\n }\n if (appendopts.classes) { lnk.removeAttr('class'); lnk.addClass(appendopts.classes); }\n panel.append(lnk);\n }\n // Generate \"Previous\"-Link\n if (opts.prev_text && (current_page > 0 || opts.prev_show_always)) {\n appendItem(current_page - 1, { text: opts.prev_text, classes: \"disabled\" });\n }\n // Generate starting points\n if (interval[0] > 0 && opts.num_edge_entries > 0) {\n var end = Math.min(opts.num_edge_entries, interval[0]);\n for (var i = 0; i < end; i++) {\n appendItem(i);\n }\n if (opts.num_edge_entries < interval[0] && opts.ellipse_text) {\n jQuery(\"<span class='ellipse'>\" + opts.ellipse_text + \"</span>\").appendTo(panel);\n }\n }\n // Generate interval links\n for (var i = interval[0]; i < interval[1]; i++) {\n appendItem(i);\n }\n // Generate ending points\n if (interval[1] < np && opts.num_edge_entries > 0) {\n if (np - opts.num_edge_entries > interval[1] && opts.ellipse_text) {\n jQuery(\"<span class='ellipse'>\" + opts.ellipse_text + \"</span>\").appendTo(panel);\n }\n var begin = Math.max(np - opts.num_edge_entries, interval[1]);\n for (var i = begin; i < np; i++) {\n appendItem(i);\n }\n\n }\n // Generate \"Next\"-Link\n if (opts.next_text && (current_page < np - 1 || opts.next_show_always)) {\n appendItem(current_page + 1, { text: opts.next_text, classes: \"disabled\" });\n }\n\t\t\t//新增跳页20130613\n\t\t\tif(opts.jump){\n\t\t\t\tjQuery(\"<span class='pagjump_box'>跳到<input class='\"+opts.jump_input_style+\"' type='text' /><button type='button' class='\"+opts.jump_button_style+\"'>确定</button>\").appendTo(panel).delegate(\"button\",\"click\",function(e){\n\t\t\t\t\tvar page_id = jQuery(this).prev(\".pagjump_txt\").val();\n\t\t\t\t\tif(page_id == \"\"){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else if(page_id > np || page_id < 0){\n\t\t\t\t\t\talert(\"超出页码范围!\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t};\n\t\t\t\t\tpageSelected(page_id-1,e);\n\t\t\t\t});\n\t\t\t};\n }", "function drawLinks() {\n\t\t\tpanel.empty();\n\t\t\tvar interval = getInterval();\n\t\t\tvar np = numPages();\n\t\t\t// This helper function returns a handler function that calls pageSelected with the right page_id\n\t\t\tvar getClickHandler = function(page_id) {\n\t\t\t\treturn function(evt){ return pageSelected(page_id,evt); }\n\t\t\t}\n\t\t\t// Helper function for generating a single link (or a span tag if it's the current page)\n\t\t\tvar appendItem = function(page_id, appendopts){\n\t\t\t\tpage_id = page_id<0?0:(page_id<np?page_id:np-1); // Normalize page id to sane value\n\t\t\t\tappendopts = jQuery.extend({text:page_id+1, classes:\"\"}, appendopts||{});\n\t\t\t\tif(page_id == current_page){\n\t\t\t\t\tvar lnk = jQuery(\"<span class='current'>\"+(appendopts.text)+\"</span>\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar lnk = jQuery(\"<a>\"+(appendopts.text)+\"</a>\")\n\t\t\t\t\t\t.bind(\"click\", getClickHandler(page_id))\n\t\t\t\t\t\t.attr('href', opts.link_to.replace(/__id__/,page_id));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(appendopts.classes){lnk.addClass(appendopts.classes);}\n\t\t\t\tpanel.append(lnk);\n\t\t\t}\n\t\t\t// Generate \"Previous\"-Link\n\t\t\tif(opts.prev_text && (current_page > 0 || opts.prev_show_always)){\n\t\t\t\tappendItem(current_page-1,{text:opts.prev_text, classes:\"prev\"});\n\t\t\t}\n\t\t\t// Generate starting points\n\t\t\tif (interval[0] > 0 && opts.num_edge_entries > 0)\n\t\t\t{\n\t\t\t\tvar end = Math.min(opts.num_edge_entries, interval[0]);\n\t\t\t\tfor(var i=0; i<end; i++) {\n\t\t\t\t\tappendItem(i);\n\t\t\t\t}\n\t\t\t\tif(opts.num_edge_entries < interval[0] && opts.ellipse_text)\n\t\t\t\t{\n\t\t\t\t\tjQuery(\"<span>\"+opts.ellipse_text+\"</span>\").appendTo(panel);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Generate interval links\n\t\t\tfor(var i=interval[0]; i<interval[1]; i++) {\n\t\t\t\tappendItem(i);\n\t\t\t}\n\t\t\t// Generate ending points\n\t\t\tif (interval[1] < np && opts.num_edge_entries > 0)\n\t\t\t{\n\t\t\t\tif(np-opts.num_edge_entries > interval[1]&& opts.ellipse_text)\n\t\t\t\t{\n\t\t\t\t\tjQuery(\"<span>\"+opts.ellipse_text+\"</span>\").appendTo(panel);\n\t\t\t\t}\n\t\t\t\tvar begin = Math.max(np-opts.num_edge_entries, interval[1]);\n\t\t\t\tfor(var i=begin; i<np; i++) {\n\t\t\t\t\tappendItem(i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// Generate \"Next\"-Link\n\t\t\tif(opts.next_text && (current_page < np-1 || opts.next_show_always)){\n\t\t\t\tappendItem(current_page+1,{text:opts.next_text, classes:\"next\"});\n\t\t\t}\n\t\t}", "function drawLinks() {\n\t\t\tpanel.empty();\n\t\t\tvar interval = getInterval();\n\t\t\tvar np = numPages();\n\t\t\t// This helper function returns a handler function that calls pageSelected with the right page_id\n\t\t\tvar getClickHandler = function(page_id) {\n\t\t\t\treturn function(evt){ return pageSelected(page_id,evt); }\n\t\t\t}\n\t\t\t// Helper function for generating a single link (or a span tag if it's the current page)\n\t\t\tvar appendItem = function(page_id, appendopts){\n\t\t\t\tpage_id = page_id<0?0:(page_id<np?page_id:np-1); // Normalize page id to sane value\n\t\t\t\tappendopts = jQuery.extend({text:page_id+1, classes:\"\"}, appendopts||{});\n\t\t\t\tif(page_id == current_page){\n\t\t\t\t\tvar lnk = jQuery(\"<span class='current'>\"+(appendopts.text)+\"</span>\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar lnk = jQuery(\"<a>\"+(appendopts.text)+\"</a>\")\n\t\t\t\t\t\t.bind(\"click\", getClickHandler(page_id))\n\t\t\t\t\t\t.attr('href', opts.link_to.replace(/__id__/,page_id));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(appendopts.classes){lnk.addClass(appendopts.classes);}\n\t\t\t\tpanel.append(lnk);\n\t\t\t}\n\t\t\t// Generate \"Previous\"-Link\n\t\t\tif(opts.prev_text && (current_page > 0 || opts.prev_show_always)){\n\t\t\t\tappendItem(current_page-1,{text:opts.prev_text, classes:\"prev\"});\n\t\t\t}\n\t\t\t// Generate starting points\n\t\t\tif (interval[0] > 0 && opts.num_edge_entries > 0)\n\t\t\t{\n\t\t\t\tvar end = Math.min(opts.num_edge_entries, interval[0]);\n\t\t\t\tfor(var i=0; i<end; i++) {\n\t\t\t\t\tappendItem(i);\n\t\t\t\t}\n\t\t\t\tif(opts.num_edge_entries < interval[0] && opts.ellipse_text)\n\t\t\t\t{\n\t\t\t\t\tjQuery(\"<span>\"+opts.ellipse_text+\"</span>\").appendTo(panel);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Generate interval links\n\t\t\tfor(var i=interval[0]; i<interval[1]; i++) {\n\t\t\t\tappendItem(i);\n\t\t\t}\n\t\t\t// Generate ending points\n\t\t\tif (interval[1] < np && opts.num_edge_entries > 0)\n\t\t\t{\n\t\t\t\tif(np-opts.num_edge_entries > interval[1]&& opts.ellipse_text)\n\t\t\t\t{\n\t\t\t\t\tjQuery(\"<span>\"+opts.ellipse_text+\"</span>\").appendTo(panel);\n\t\t\t\t}\n\t\t\t\tvar begin = Math.max(np-opts.num_edge_entries, interval[1]);\n\t\t\t\tfor(var i=begin; i<np; i++) {\n\t\t\t\t\tappendItem(i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// Generate \"Next\"-Link\n\t\t\tif(opts.next_text && (current_page < np-1 || opts.next_show_always)){\n\t\t\t\tappendItem(current_page+1,{text:opts.next_text, classes:\"next\"});\n\t\t\t}\n\t\t}", "function tick() {\n // update the links\n path.select(\".link\").attr(\"d\", function(d) {return getPath(d, 0)});\n // update the link labels\n path.select(\".linklabel\").attr(\"transform\", function(d) {\n if (d.target.x<d.source.x){\n bbox = this.getBBox();\n rx = bbox.x+bbox.width/2;\n ry = bbox.y+bbox.height/2;\n return \"rotate(180 \"+rx+\" \"+ry+\")\";\n }\n else {\n return \"rotate(0)\";\n }\n });\n \n // update dummy links\n dummyPath.select(\".link\").attr(\"d\", function(d) {return getPath(d, 1)});\n // update dummy link labels\n dummyPath.select(\".linklabel\").attr(\"transform\", function(d) {\n if (d.target.x<d.source.x){\n bbox = this.getBBox();\n rx = bbox.x+bbox.width/2;\n ry = bbox.y+bbox.height/2;\n return \"rotate(180 \"+rx+\" \"+ry+\")\";\n }\n else {\n return \"rotate(0)\";\n }\n });\n\n // update nodes\n rect.attr(\"transform\", (d) => `translate(${d.x - (d.w/2)},${d.y - (d.h)/2})`); \n}", "drawGraph(){\n let shapes = this.vertices.iterator();\n\n while(!shapes.isEmpty()){\n shapes.currItem().drawEdges();\n shapes.next();\n }\n\n shapes = this.vertices.iterator();\n\n \n while(!shapes.isEmpty()){\n shapes.currItem().draw(this.currentStage);\n shapes.next();\n }\n }", "DrawTree()\n {\n\n }", "function updateAttributes(nodes, links) {\n var ROOT_IDs = nodes.filter(function (d) {\n return d.root !== undefined;\n }).map(function (d) {\n return d.id;\n });\n var parentIDs = [];\n var childIDs = [];\n nodes.map(function (el) {\n var connections = links.filter(function (d) {\n return d.start_id === el.id;\n }).map(function (d) {\n return d.end_id;\n });\n\n if (connections.length === 0) {\n childIDs.push(el.id); // a child node has no other nodes extending from it\n } else if (ROOT_IDs.indexOf(el.id) === -1) {\n parentIDs.push(el.id); // everyone else is a parent node if not a cluster root or child node (a node is only considered to be a parent node if it has other nodes extending from it)\n }\n }); // set up accessors\n\n var root = function root(d) {\n return ROOT_IDs.indexOf(d.id) !== -1;\n };\n\n var parent = function parent(d) {\n return parentIDs.indexOf(d.id) !== -1;\n };\n\n var rootparent = function rootparent(d) {\n return parentIDs.concat(ROOT_IDs).indexOf(d.id) !== -1;\n };\n\n var child = function child(d) {\n return childIDs.indexOf(d.id) !== -1;\n };\n\n var berects = function berects() {}; // choose node types to be rendered as rectangles\n\n\n var accessors = {\n root: root,\n parent: parent,\n child: child,\n rootparent: rootparent,\n berects: berects\n };\n\n function findType(d) {\n if (root(d)) {\n return \"root\";\n } else if (parent(d)) {\n return \"parent\";\n } else if (child(d)) {\n return \"children\";\n }\n }\n\n nodes.forEach(function (d) {\n d.type = findType(d);\n });\n links.forEach(function (d) {\n d.type = nodes.find(function (el) {\n return el.id === d.start_id;\n }).type;\n });\n nodes.forEach(function (d) {\n d.radius = graphEle.radiusAccessor(d);\n d.color = graphEle.nodeColorAccessor(d);\n d.strokeColor = graphEle.nodeColorAccessor(d);\n d.opacity = graphEle.nodeOpacityAccessor(d);\n d.strokeWidth = graphEle.nodeStrokeWidth;\n });\n links.forEach(function (d) {\n d.strokeColor = graphEle.linkColorAccessor(d);\n d.strokeWidth = graphEle.linkWidthAccessor(d);\n d.opacity = graphEle.linkOpacityAccessor(d);\n d.strength = graphEle.strengthAccessor(d);\n });\n return {\n nodes: nodes,\n links: links,\n accessors: accessors\n };\n } //updateAttributes: update attribute values assigned to nodes and edges", "function drawNode(x, y){\n stroke(50);\n strokeWeight(1);\n if (nodesPerLayer.length-1 && nodesPerLayer[x]+1){\n ellipse(XtoPix(x,1,nodesPerLayer.length),YtoPix(y,1,nodesPerLayer[x]),20*2/sqrt(2*nodesPerLayer.length),20*2/sqrt(2*nodesPerLayer.length));\n }\n}", "function draw(){ //this bad boy will open up when we load node1.html.\r\n\tctx.fillStyle = \"rgba(155,155,155,.5)\"\r\n\tctx.fillRect(0,0,500,500);\r\n\tctx.lineWidth = \"5\";\r\n\tctx.lineJoin = \"round\";\r\n\tctx.strokeStyle = \"rgba(150,150,80,.5)\";\r\n\tctx.beginPath(); //turtle graphics. mit program language for little kids :'(\r\n\t\r\n\tradius = 80;\r\n\tcircle(x,y,radius);\r\n\tctx.beginPath();\r\n\tx-=20;\r\n\ty-=20;\r\n\tctx.moveTo(x,y);\r\n\tturn(160);\r\n\tforward(60);\r\n\tturn(220);\r\n\tforward(60);\r\n\t\r\n\t\r\n\tturn(70);\r\n\tforward(60);\r\n\tturn(220);\r\n\tforward(60);\r\n\t\r\n\tturn(70);\r\n\tforward(60);\r\n\tturn(215);\r\n\tforward(60);\r\n\t\r\n\tturn(70);\r\n\tforward(60);\r\n\tturn(220);\r\n\tforward(60);\r\n\t\r\n\tturn(70);\r\n\tforward(60);\r\n\tturn(220);\r\n\tforward(60);\r\n\t\r\n}", "function drawConnections(connections, paper){\n for(x in connections){\n line = connections[x];\n paper.line(line.startX, line.startY, line.endX, line.endY,4, line.gPassId);\n }\n}", "function tick() {\n link.attr(\"d\", function(d) {\n var dx = d.target.x - d.source.x,\n dy = d.target.y - d.source.y,\n dr = Math.sqrt(dx * dx + dy * dy);\n return \"M\" + \n d.source.x + \",\" + \n d.source.y + \"A\" + \n dr + \",\" + dr + \" 0 0,1 \" + \n d.target.x + \",\" + \n d.target.y;\n });\n node\n .attr(\"transform\", function(d) { \n return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n }", "function refreshGraph(graph) {\n \n link = graph.vis.selectAll(\".link\").data(graph.links, function(d) {\n return d.source.id + \"-\" + d.target.id; \n });\n \n node = graph.vis.selectAll(\"circle\").data(graph.nodes, function(d) { \n return d.id;\n });\n\n \n\n link.enter()\n .append(\"line\")\n .attr(\"class\", \"link\")\n .style(\"stroke-width\", function(d) { return Math.sqrt(d.value); });\n\n link.exit()\n .remove();\n \n node.enter()\n .append(\"svg:circle\")\n .attr(\"class\", \"node\")\n .attr(\"r\", function () {return 100/graph.nodes.length + 5;})\n .attr(\"title\", function(d) { return d.nbWalkers[0] +\"/\"+d.nbWalkers[1] +\"/\"+d.nbWalkers[2] })\n .style(\"fill\", \"#ffffff\")\n .style(\"stroke\", \"#000000\")\n .style(\"stroke-width\", \"3\")\n .on(\"click\", mouseClick)\n .call(force.drag);\n \n node.exit()\n .remove()\n \n \n \n force.on(\"tick\", function() {\n link.attr(\"x1\", function(d) { return d.source.x; })\n .attr(\"y1\", function(d) { return d.source.y; })\n .attr(\"x2\", function(d) { return d.target.x; })\n .attr(\"y2\", function(d) { return d.target.y; });\n\n node.attr(\"cx\", function(d) { return d.x; })\n .attr(\"cy\", function(d) { return d.y; });\n });\n \n \n //The node clicked gets the 100 colored walkers at time = 0\n function mouseClick(element){\n if(!d3.select(\"#playButton\").classed(\"active\")){\n\n initColorNode(element);\n\n } \n }\n\n}", "function renderNodes(n, i, nodes) {\n /* jshint validthis: true */ // `this` is bound to a set of options above\n\n // render node that are not in this layer\n var stack = this.stackViewer.primaryStack;\n var z_res = stack.resolution.z;\n // Positions are in project space\n var pos1 = this.positions[n];\n let ndist1 = pos1[this.normalDim] - this.stackViewer.plane.constant;\n\n // draw node\n if (Math.abs(ndist1) <= z_res / 2) {\n var c = new PIXI.Sprite(this.graphics.Node.prototype.NODE_TEXTURE);\n c.anchor.set(0.5);\n c.x = pos1[this.planeDims.x];\n c.y = pos1[this.planeDims.y];\n c.scale.set(this.graphics.Node.prototype.stackScaling * 2);\n c.tint = this.color(undefined, undefined, undefined, true, 1, false);\n c.alpha = 1;\n this.graphics.containers.nodes.addChild(c);\n }\n\n // draw missing branch indicator if asked for\n if (this.selected_points.has(parseInt(n))) {\n let nn = this.node_map[n];\n var pos2 = {\n x: nn.x + nn.branch_dx,\n y: nn.y + nn.branch_dy,\n z: nn.z + nn.branch_dz\n };\n\n let ndist2 = pos2[this.normalDim] - this.stackViewer.plane.constant;\n\n let display_needed =\n (ndist1 <= z_res / 2 && ndist2 >= -z_res / 2) ||\n (ndist1 >= -z_res / 2 && ndist2 <= z_res / 2);\n if (display_needed) {\n if (Math.abs(ndist1) <= z_res / 2 && Math.abs(ndist2) <= z_res / 2) {\n renderFlatEdge(n, pos1, pos2, true, undefined, this);\n } else {\n if (ndist1 > ndist2) {\n renderSloppedEdge(n, pos1, pos2, false, true, undefined, this);\n } else {\n renderSloppedEdge(n, pos2, pos1, false, true, undefined, this);\n }\n }\n\n if (Math.abs(ndist2) <= z_res / 2) {\n var c = new PIXI.Sprite(this.graphics.Node.prototype.NODE_TEXTURE);\n c.anchor.set(0.5);\n c.x = pos2[this.planeDims.x];\n c.y = pos2[this.planeDims.y];\n c.scale.set(this.graphics.Node.prototype.stackScaling);\n c.tint = this.color(undefined, undefined, undefined, true, 1);\n c.alpha = 1;\n this.graphics.containers.nodes.addChild(c);\n }\n }\n }\n\n // draw edges\n var e = this.edges[n];\n if (e) {\n var pos2 = this.positions[e];\n let connectivity =\n this.node_map[n].connectivity_score / this.max_connectivity_score;\n\n let ndist2 = pos2[this.normalDim] - this.stackViewer.plane.constant;\n\n let display_needed =\n (typeof this.focused_connection === \"undefined\" ||\n this.focused_connection === parseInt(n)) &&\n ((ndist1 <= z_res / 2 && ndist2 >= -z_res / 2) ||\n (ndist1 >= -z_res / 2 && ndist2 <= z_res / 2));\n if (display_needed) {\n if (Math.abs(ndist1) <= z_res / 2 && Math.abs(ndist2) <= z_res / 2) {\n renderFlatEdge(n, pos1, pos2, false, connectivity, this);\n } else {\n if (ndist1 > ndist2) {\n renderSloppedEdge(n, pos1, pos2, true, false, connectivity, this);\n } else {\n renderSloppedEdge(n, pos2, pos1, false, false, connectivity, this);\n }\n }\n }\n }\n }", "function vis(links) {\n\n // Compute the distinct nodes from the links.\n links.forEach(function (link, i) {\n link.source = nodes[link.source] || (nodes[link.source] = {\n name: link.source\n });\n link.target = nodes[link.target] || (nodes[link.target] = {\n name: link.target\n });\n link.symptom = (symptom[i] = {\n symp: link.symptom\n });\n\t\tlink.psych_symp = (psySymp[i] = {\n\t\t\tpsySymp: link.psych_symp\n\t\t});\n });\n\n var force = d3.layout.force()\n .nodes(d3.values(nodes))\n .links(links)\n .size([width, height])\n /* This only matters if nodes aren't fixed\n\t\t.linkDistance(function (d) {\n return 200 / d.weight;\n })\n .charge(-100)\n\t\t.friction(0.7)*/\n .on(\"tick\", tick)\n .start();\n\n\tvar svg = d3.select(\"body\").selectAll(\"svg#graph\");\n\t\n\tsvg.selectAll(\".link\").remove();\n\t\n var link = svg.selectAll(\".link\")\n .data(force.links())\n .enter().append(\"line\")\n\t\t/*.attr(\"stroke-width\", function (d) {\n //return d.weight / 50;\n\t\t\tvar thickness = d3.scale.linear()\n\t\t\t\t.domain([0, 1000])\n\t\t\t\t.range([1, 15])\n\t\t\t\t.clamp(true);\n\t\t\treturn thickness(d.weight);\n })*/\n\t\t.attr(\"opacity\", function (d) {\n //return d.weight / 50;\n\t\t\tvar thickness = d3.scale.linear()\n\t\t\t\t.domain([0, 1000])\n\t\t\t\t.range([0.1, 1])\n\t\t\t\t.clamp(true);\n\t\t\treturn thickness(d.weight);\n })\n .attr(\"class\", \"link\");\n\n\tsvg.selectAll(\".node\").remove();\n\t\t\t\n var node = svg.selectAll(\".node\")\n .data(force.nodes())\n .enter().append(\"g\")\n .attr(\"class\", \"node\")\n .on(\"mouseover\", mouseover)\n .on(\"mouseout\", mouseout)\n\t\t.on(\"click\", mouseclick);\n\t\t//.call(force.drag); //dragable\n\n node.append(\"circle\")\n .attr(\"r\", 4)\n\t\t.style(\"fill\", function(d) {\n\t\t\tvar form = d3.select(\"#symptomForm\");\n\t\t\tvar sympArray = d3.values(symptom);\n\t\t\tif(form[0][0][1].checked == true && sympArray[d.index].symp[0] == \"1\") {\t// sore\n return color[1];\n } else if (form[0][0][2].checked == true && sympArray[d.index].symp[1] == \"1\") { // runnynose\n return color[2];\n } else if (form[0][0][3].checked == true && sympArray[d.index].symp[2] == \"1\") { // fever\n return color[3];\n } else if (form[0][0][4].checked == true && sympArray[d.index].symp[3] == \"1\") { // nausea\n return color[4];\n\t\t\t} else if (form[0][0][0].checked == true && (sympArray[d.index].symp[0] == \"1\" || sympArray[d.index].symp[1] == \"1\" || sympArray[d.index].symp[2] == \"1\" || sympArray[d.index].symp[3] == \"1\")) { // any\n\t\t\t\treturn color[0];\n } else {\n\t\t\t\treturn \"#8B8B7A\";\n\t\t\t}\n\t\t})\n\t\t.style(\"visibility\", function(d) {\n\t\t\tvar form = d3.select(\"#psysymptomForm\");\n\t\t\tvar psyArray = d3.values(psySymp);\n\t\t\t\n\t\t\tif(form[0][0][0].checked == true && (psyArray[d.index].psySymp[0] == \"1\" || psyArray[d.index].psySymp[1] == \"1\")) {\n\t\t\t\treturn \"hidden\";\n\t\t\t} else if (form[0][0][1].checked == true && psyArray[d.index].psySymp[0] == \"1\") {\n\t\t\t\treturn \"hidden\";\n\t\t\t} else if (form[0][0][2].checked == true && psyArray[d.index].psySymp[1] == \"1\") {\n\t\t\t\treturn \"hidden\";\n\t\t\t} else {\n\t\t\t\treturn \"visible\";\n\t\t\t}\n\t\t});\n\n\tnode.append(\"rect\")\n\t\t.attr(\"width\", 7)\n\t\t.attr(\"height\", 7)\n\t\t.attr(\"x\", -3.5)\n\t\t.attr(\"y\", -3.5)\n\t\t.style(\"fill\", function(d) {\n\t\t\tvar form = d3.select(\"#symptomForm\");\n\t\t\tvar sympArray = d3.values(symptom);\n\t\t\tif(form[0][0][1].checked == true && sympArray[d.index].symp[0] == \"1\") {\t// sore\n return color[1];\n } else if (form[0][0][2].checked == true && sympArray[d.index].symp[1] == \"1\") { // runnynose\n return color[2];\n } else if (form[0][0][3].checked == true && sympArray[d.index].symp[2] == \"1\") { // fever\n return color[3];\n } else if (form[0][0][4].checked == true && sympArray[d.index].symp[3] == \"1\") { // nausea\n return color[4];\n\t\t\t} else if (form[0][0][0].checked == true && (sympArray[d.index].symp[0] == \"1\" || sympArray[d.index].symp[1] == \"1\" || sympArray[d.index].symp[2] == \"1\" || sympArray[d.index].symp[3] == \"1\")) { // any\n\t\t\t\treturn color[0];\n } else { // none\n\t\t\t\treturn \"#8B8B7A\";\n\t\t\t}\n\t\t})\n\t\t.style(\"visibility\", function(d) {\n\t\t\tvar form = d3.select(\"#psysymptomForm\");\n\t\t\tvar psyArray = d3.values(psySymp);\n\t\t\t\n\t\t\tif(form[0][0][0].checked == true && (psyArray[d.index].psySymp[0] == \"1\" || psyArray[d.index].psySymp[1] == \"1\")) {\n\t\t\t\treturn \"visible\";\n\t\t\t} else if (form[0][0][1].checked == true && psyArray[d.index].psySymp[0] == \"1\") {\n\t\t\t\treturn \"visible\";\n\t\t\t} else if (form[0][0][2].checked == true && psyArray[d.index].psySymp[1] == \"1\") {\n\t\t\t\treturn \"visible\";\n\t\t\t} else { // none\n\t\t\t\treturn \"hidden\";\n\t\t\t}\n\t\t});\n\t\n node.append(\"text\")\n .attr(\"x\", 12)\n .attr(\"dy\", \".35em\")\n .text(function (d) {\n return d.name;\n });\n\n function tick() {\n\t\n node\n\t\t\t.classed(\"fixed\", function (d) {\n\t\t\t\t// fixing the nodes as desired\n\t\t\t\td.fixed = true;\n\t\t\t\td.x = 250 + 50 * (d.index % 10);\n\t\t\t\td.y = 40 + 50 * (d.index / 10)\n\t\t\t})\n .attr(\"transform\", function (d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n\t\t\t\t// this new return will keep the circles within the canvas\n\t\t\t\t// TODO: create a radios variable to change the number 10\n //return \"translate(\" + Math.max(10, Math.min(width - 10, d.x)) + \",\" + Math.max(10, Math.min(height - 10, d.y)) + \")\";\n\t\t\t\t\n });\n\t\t\n link\n .attr(\"x1\", function (d) {\n return d.source.x;\n })\n .attr(\"y1\", function (d) {\n return d.source.y;\n })\n .attr(\"x2\", function (d) {\n return d.target.x;\n })\n .attr(\"y2\", function (d) {\n return d.target.y;\n });\n\n }\n\n function mouseover(d, i) {\n\n // Figure out the neighboring node id's with brute strength \"because the graph is small\"\n // this still a concern\n var nodeNeighbors = links.filter(function (link) {\n // Filter the list of links to only those links that have our target \n // node as a source or target\n return link.source.index === d.index || link.target.index === d.index;\n })\n .map(function (link) {\n // Map the list of links to a simple array of the neighboring indices - this is\n // technically not required but makes the code below simpler because we can use \n // indexOf instead of iterating and searching ourselves.\n return link.source.index === d.index ? link.target.index : link.source.index;\n });\n\n\n // now we select the neighboring circles and apply whatever style we want. \n // Note that we could also filter a selection of links in this way if we want to \n // Highlight those as well\n svg.selectAll('circle').filter(function (node) {\n // I filter the selection of all circles to only those that hold a node with an\n // index in my listg of neighbors\n return nodeNeighbors.indexOf(node.index) > -1;\n })\n .transition().duration(750)\n .attr(\"r\", 16);\n\t\t\n\t\tsvg.selectAll('rect').filter(function (node) {\n\t\t\t// I filter the selection of all circles to only those that hold a node with an\n\t\t\t// index in my listg of neighbors\n\t\t\t\treturn nodeNeighbors.indexOf(node.index) > -1;\n\t\t\t})\n\t\t\t.transition().duration(750)\n\t\t\t.attr(\"width\", 28)\n\t\t\t.attr(\"height\", 28)\n\t\t\t.attr(\"x\", -14)\n\t\t\t.attr(\"y\", -14);\n\n // Apply effects on lines\n /*svg.selectAll(\"line\").filter(function (d) {\n return d.source.index == i || d.target.index == i;\n }).each(function (dLink, iLink) {\n //unfade links and nodes connected to the current node\n d3.select(this)\n .transition().duration(750)\n //.style(\"stroke-width\", \"2px\")\n .style(\"opacity\", 1);\n //.style(\"stroke\", \"orange\");\n });*/\n }\n\n function mouseout() {\n\n d3.select(\"svg#graph\").selectAll(\"circle\").transition()\n .duration(750)\n .attr(\"r\", 4);\n \n\t\td3.select(\"svg#graph\").selectAll(\"rect\").transition()\n\t\t\t.duration(750)\n\t\t\t.attr(\"width\", 7)\n\t\t\t.attr(\"height\", 7)\n\t\t\t.attr(\"x\", -3.5)\n\t\t\t.attr(\"y\", -3.5);\n\n /*d3.select(\"svg#graph\").selectAll(\"line\")\n .transition().duration(750)\n .style(\"opacity\", 0.3);\n\t\t*/\n }\n\t\n\tvar clicked = false;\t// true highlight, false unhighlight\n\tfunction mouseclick(d) {\n\t\n\t\tif(!clicked) {\n\t\t\tclicked = !clicked;\n\t\t\t\n\t\t\t//d3.select(this).select(\"circle, rect\").attr(\"class\", \"clicked\");\n\t\t\thighlight(d);\n\t\t\t\n\n\t\t}\n\t\telse {\n\t\t\tclicked = !clicked;\n\t\t\tsvg.selectAll('circle, rect, text')\n\t\t\t\t.transition().duration(750)\n\t\t\t\t.style(\"opacity\", 1);\n\t\t\t\n\t\t\tsvg.selectAll('line')\n\t\t\t\t.transition().duration(750)\n\t\t\t\t.style(\"visibility\", \"visible\");\n\t\t}\n\t}\n\t\n\tfunction highlight(d) {\n\t\tvar i = d.index;\n\t\t//console.log(d);\n\t\tvar nodeNeighbors = links.filter(function (link) {\n\t\t\t\treturn link.source.index === d.index || link.target.index === d.index;\n\t\t\t})\n\t\t\t.map(function (link) {\n\t\t\t\treturn link.source.index === d.index ? link.target.index : link.source.index;\n\t\t\t});\n\t\t\n\t\tconsole.log(nodeNeighbors);\n\n\t\tsvg.selectAll('circle, rect, text').filter(function (node) {\n\t\t\t\treturn !(nodeNeighbors.indexOf(node.index) > -1);\n\t\t\t})\n\t\t\t.transition().duration(750)\n\t\t\t.style(\"opacity\", 0.1);\n\t\t\n\t\t// Apply effects on lines\n svg.selectAll(\"line\").filter(function (d) {\n return !(d.source.index == i || d.target.index == i);\n }).each(function (dLink, iLink) {\n d3.select(this)\n .transition().duration(750)\n .style(\"visibility\", \"hidden\");\n });\n\t}\n}", "function link1 (d) {\n return \"M\" + d.x + \",\" + d.y\n + \"C\" + (d.x + d.parent.x) / 2 + \",\" + d.y\n + \" \" + (d.x + d.parent.x) / 2 + \",\" + d.parent.y\n + \" \" + d.parent.x + \",\" + d.parent.y;\n }", "function drawNetwork(authNet) {\n\t\tvar force = d3.layout.force()\n\t\t\t//.gravity(-0.1)\n\t\t\t.linkDistance(50)\n\t\t\t.charge(-400)\n\t\t\t//.friction(0.8)\n\t\t\t.size([width, height]);\n\t\t\n\t\tforce\n\t\t\t.nodes(authNet.nodes)\n\t\t\t.links(authNet.links)\n\t\t\t.start();\n\t\t\n\t\tvar tooltip = d3.tip()\n\t\t\t.attr(\"class\", \"d3-tip\")\n\t\t\t.offset([0, -20])\n\t\t\t.html(function (d) {\n\t\t\t\tvar pubsHtml = \"<ul>\";\n\t\t\t\td.pubs.forEach(element => {\n\t\t\t\t\tpubsHtml += \"<li>\" + gPub_info[element.value].bib.title + \"</li>\"\n\t\t\t\t})\n\t\t\t\treturn pubsHtml + \"</ul>\";\n\t\t\t})\n\t\t\t.style(\"background-color\", \"#f8f9fa\")\n\t\t\t.style(\"text-align\", \"left\")\n\t\t\t.style(\"box-sizing\", \"border-box\");\n\t\t\n\t\tsvg.call(tooltip);\n\t\t\n\t\tvar link = svg.selectAll(\".link\")\n\t\t\t.data(authNet.links)\n\t\t\t.enter().append(\"line\")\n\t\t\t.attr('class', 'link')\n\t\t\t.attr(\"stroke-width\", function (d) {\n\t\t\t\treturn (d.weight*1);\n\t\t\t})\n\t\t\t.style('stroke', 'blue')\n\t\t\t.style(\"stroke-opacity\", 0.6)\n\t\t\t.on(\"mouseover\", function (d) {\n\t\t\t\ttooltip.show(d, this);\n\t\t\t})\n\t\t\t.on(\"mouseout\", function (d) {\n\t\t\t\ttooltip.hide(d, this);\n\t\t\t});\n\t\t\n\t\tvar drag = force.drag()\n\t\t\t.on(\"dragstart\", dragstart);\n\t\t\n\t\tvar node = svg.selectAll(\".node\")\n\t\t\t.data(authNet.nodes)\n\t\t\t.enter().append(\"g\")\n\t\t\t.attr(\"class\", \"node\")\n\t\t\t.on(\"dblclick\", dblclick)\n\t\t\t.call(drag);\n\t\t\t//.call(force.drag);\n\t\t\n\t\tnode.append(\"image\")\n\t\t\t.attr(\"xlink:href\", function (d) { \n\t\t\t\treturn gAuth_info[d.id].url_picture\n\t\t\t})\n\t\t\t.attr(\"x\", -15)\n\t\t\t.attr(\"y\", -15)\n\t\t\t.attr(\"width\", 30)\n\t\t\t.attr(\"height\", 30);\n\t\t\n\t\tnode.append(\"a\")\n\t\t\t.attr(\"target\",\"_blank\")\n\t\t\t.attr(\"href\", function (d) { \n\t\t\t\treturn \"https://scholar.google.com/citations?user=\"+d.id;\n\t\t\t})\n\t\t\t.append(\"text\")\n\t\t\t.attr(\"dx\", -25)\n\t\t\t.attr(\"dy\", 30)\n\t\t\t.text(function (d) { return gAuth_info[d.id].name });\n\t\t\n\t\tforce.on(\"tick\", function () {\n\t\t\tlink.attr(\"x1\", function (d) { return d.source.x; })\n\t\t\t\t.attr(\"y1\", function (d) { return d.source.y; })\n\t\t\t\t.attr(\"x2\", function (d) { return d.target.x; })\n\t\t\t\t.attr(\"y2\", function (d) { return d.target.y; });\n\n\t\t\tnode.attr(\"transform\", function (d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\t\t});\n\n\n\t\tfunction dblclick(d) {\n\t\t\td3.select(this).classed(\"fixed\", d.fixed = false);\n\t\t}\n\n\t\tfunction dragstart(d) {\n\t\t\td3.select(this).classed(\"fixed\", d.fixed = true);\n\t\t}\n\t}", "function webglGraphics(options) {\r\n options = merge(options, {\r\n enableBlending: true,\r\n preserveDrawingBuffer: false,\r\n clearColor: false,\r\n clearColorValue: {\r\n r: 1,\r\n g: 1,\r\n b: 1,\r\n a: 1\r\n },\r\n depthBuffer: true,\r\n curveResolution: 10,\r\n curviness: 0.1,\r\n arrowSize: 20,\r\n arrowPitch: Math.PI / 8,\r\n directedNodes: false\r\n });\r\n\r\n var container;\r\n var graphicsRoot;\r\n var gl;\r\n var width;\r\n var height;\r\n var nodesCount = 0;\r\n var straightLinksCount = 0;\r\n var curvedLinksCount = 0;\r\n var arrowCount = 0;\r\n var transform = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\r\n var userPlaceNodeCallback;\r\n var userPlaceLinkCallback;\r\n var nodes = [];\r\n var straightLinks = [];\r\n var curvedLinks = [];\r\n var arrows = [];\r\n var initCallback;\r\n var allNodes = {};\r\n var allLinks = {};\r\n var straightLinkProgram = webglLinkProgram();\r\n var curvedLinkProgram = webglCurvedLinkProgram(\r\n options.curveResolution,\r\n options.curviness\r\n );\r\n var arrowProgram = webglArrowProgram(\r\n options.curveResolution,\r\n options.curviness,\r\n options.arrowSize,\r\n options.arrowPitch\r\n );\r\n\r\n if (options.directedNodes) {\r\n var nodeProgram = webglDirectedNodeProgram();\r\n } else {\r\n var nodeProgram = webglNodeProgram();\r\n }\r\n /*jshint unused: false */\r\n var nodeUIBuilder = function(node) {\r\n return webglSquare(); // Just make a square, using provided gl context (a nodeProgram);\r\n };\r\n var linkUIBuilder = function(link) {\r\n return webglLine(0xb3b3b3ff);\r\n };\r\n /*jshint unused: true */\r\n var updateTransformUniform = function() {\r\n straightLinkProgram.updateTransform(transform);\r\n nodeProgram.updateTransform(transform);\r\n curvedLinkProgram.updateTransform(transform);\r\n arrowProgram.updateTransform(transform);\r\n };\r\n var resetScaleInternal = function() {\r\n transform = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\r\n };\r\n var updateSize = function() {\r\n if (container && graphicsRoot) {\r\n width = graphicsRoot.width = Math.max(container.offsetWidth, 1);\r\n height = graphicsRoot.height = Math.max(container.offsetHeight, 1);\r\n if (gl) {\r\n gl.viewport(0, 0, width, height);\r\n }\r\n if (straightLinkProgram) {\r\n straightLinkProgram.updateSize(width / 2, height / 2);\r\n }\r\n if (curvedLinkProgram) {\r\n curvedLinkProgram.updateSize(width / 2, height / 2);\r\n }\r\n if (arrowProgram) {\r\n arrowProgram.updateSize(width / 2, height / 2);\r\n }\r\n if (nodeProgram) {\r\n nodeProgram.updateSize(width / 2, height / 2);\r\n }\r\n }\r\n };\r\n var fireRescaled = function(graphics) {\r\n graphics.fire(\"rescaled\");\r\n };\r\n var flipLinkCoordinates = function(position) {\r\n var toPos = { x: 0, y: 0 };\r\n var fromPos = { x: 0, y: 0 };\r\n\r\n var pos = position.from;\r\n fromPos.x = pos.x;\r\n fromPos.y = -pos.y;\r\n pos = position.to;\r\n toPos.x = pos.x;\r\n toPos.y = -pos.y;\r\n\r\n return { fromPos: fromPos, toPos: toPos };\r\n };\r\n var removeLinkFromList = function(links, linksCount, linkIdToRemove) {\r\n if (linksCount > 0) {\r\n linksCount -= 1;\r\n }\r\n\r\n if (linkIdToRemove < linksCount) {\r\n if (linksCount === 0 || linksCount === linkIdToRemove) {\r\n return linksCount; // no more links or removed link is the last one.\r\n }\r\n\r\n var lastLinkUI = links[linksCount];\r\n links[linkIdToRemove] = lastLinkUI;\r\n lastLinkUI.id = linkIdToRemove;\r\n }\r\n return linksCount;\r\n };\r\n var swapElementsAndId = function(array, id1, id2) {\r\n var temp = array[id1];\r\n array[id1] = array[id2];\r\n array[id1].id = id1;\r\n array[id2] = temp;\r\n array[id2].id = id2;\r\n };\r\n\r\n var graphicsRoot = window.document.createElement(\"canvas\");\r\n\r\n var graphics = {\r\n getLinkUI: function(linkId) {\r\n return allLinks[linkId];\r\n },\r\n\r\n getNodeUI: function(nodeId) {\r\n return allNodes[nodeId];\r\n },\r\n\r\n /**\r\n * Sets the callback that creates node representation.\r\n *\r\n * @param builderCallback a callback function that accepts graph node\r\n * as a parameter and must return an element representing this node.\r\n *\r\n * @returns If builderCallbackOrNode is a valid callback function, instance of this is returned;\r\n * Otherwise undefined value is returned\r\n */\r\n node: function(builderCallback) {\r\n if (typeof builderCallback !== \"function\") {\r\n return null; // todo: throw? This is not compatible with old versions\r\n }\r\n\r\n nodeUIBuilder = builderCallback;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the callback that creates link representation\r\n *\r\n * @param builderCallback a callback function that accepts graph link\r\n * as a parameter and must return an element representing this link.\r\n *\r\n * @returns If builderCallback is a valid callback function, instance of this is returned;\r\n * Otherwise undefined value is returned.\r\n */\r\n link: function(builderCallback) {\r\n if (typeof builderCallback !== \"function\") {\r\n return null; // todo: throw? This is not compatible with old versions\r\n }\r\n\r\n linkUIBuilder = builderCallback;\r\n return this;\r\n },\r\n\r\n /**\r\n * Allows to override default position setter for the node with a new\r\n * function. newPlaceCallback(nodeUI, position) is function which\r\n * is used by updateNodePosition().\r\n */\r\n placeNode: function(newPlaceCallback) {\r\n userPlaceNodeCallback = newPlaceCallback;\r\n return this;\r\n },\r\n\r\n placeLink: function(newPlaceLinkCallback) {\r\n userPlaceLinkCallback = newPlaceLinkCallback;\r\n return this;\r\n },\r\n\r\n /**\r\n * Custom input manager listens to mouse events to process nodes drag-n-drop inside WebGL canvas\r\n */\r\n inputManager: webglInputManager,\r\n\r\n /**\r\n * Called every time before renderer starts rendering.\r\n */\r\n beginRender: function() {\r\n // this function could be replaced by this.init,\r\n // based on user options.\r\n },\r\n\r\n /**\r\n * Called every time when renderer finishes one step of rendering.\r\n */\r\n endRender: function() {\r\n if (arrowCount > 0) {\r\n arrowProgram.render();\r\n }\r\n\r\n if (curvedLinksCount > 0) {\r\n curvedLinkProgram.render();\r\n }\r\n\r\n if (straightLinksCount > 0) {\r\n straightLinkProgram.render();\r\n }\r\n\r\n if (nodesCount > 0) {\r\n nodeProgram.render();\r\n }\r\n },\r\n\r\n bringLinkToFront: function(linkUI) {\r\n if (linkUI.level > 0) {\r\n var frontLinkId = curvedLinkProgram.getFrontLinkId();\r\n curvedLinkProgram.bringToFront(linkUI);\r\n } else {\r\n var frontLinkId = straightLinkProgram.getFrontLinkId();\r\n straightLinkProgram.bringToFront(linkUI);\r\n }\r\n var srcLinkId;\r\n\r\n if (frontLinkId > linkUI.id) {\r\n srcLinkId = linkUI.id;\r\n\r\n if (linkUI.level > 0) {\r\n swapElementsAndId(curvedLinks, frontLinkId, srcLinkId);\r\n } else {\r\n swapElementsAndId(straightLinks, frontLinkId, srcLinkId);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Sets translate operation that should be applied to all nodes and links.\r\n */\r\n graphCenterChanged: function(x, y) {\r\n transform[12] = (2 * x) / width - 1;\r\n transform[13] = 1 - (2 * y) / height;\r\n updateTransformUniform();\r\n },\r\n\r\n setTransform: function(x, y, scale) {\r\n transform[12] = (2 * x) / width - 1;\r\n transform[13] = 1 - (2 * y) / height;\r\n transform[0] = scale;\r\n transform[5] = scale;\r\n updateTransformUniform();\r\n },\r\n /**\r\n * Called by Viva.Graph.View.renderer to let concrete graphic output\r\n * provider prepare to render given link of the graph\r\n *\r\n * @param link - model of a link\r\n */\r\n addLink: function(link, boundPosition) {\r\n var ui = linkUIBuilder(link);\r\n\r\n /* \r\n Link level = 0 is a straight line\r\n Link level > 0 is a curved line\r\n */\r\n if (ui.level > 0) {\r\n var uiid = curvedLinksCount++;\r\n } else {\r\n var uiid = straightLinksCount++;\r\n }\r\n\r\n ui.id = uiid;\r\n ui.pos = boundPosition;\r\n\r\n if (ui.arrow) {\r\n ui.toNodeId = link.toId;\r\n var arrowId = arrowCount++;\r\n ui.arrowId = arrowId;\r\n arrowProgram.createArrow(ui);\r\n arrows[arrowId] = ui;\r\n } else {\r\n ui.arrowId = null;\r\n }\r\n\r\n if (ui.level > 0) {\r\n curvedLinkProgram.createLink(ui);\r\n curvedLinks[uiid] = ui;\r\n } else {\r\n straightLinkProgram.createLink(ui);\r\n straightLinks[uiid] = ui;\r\n }\r\n allLinks[link.id] = ui;\r\n\r\n return ui;\r\n },\r\n\r\n /**\r\n * Called by Viva.Graph.View.renderer to let concrete graphic output\r\n * provider prepare to render given node of the graph.\r\n *\r\n * @param nodeUI visual representation of the node created by node() execution.\r\n **/\r\n addNode: function(node, boundPosition, gradient = null) {\r\n var uiid = nodesCount++,\r\n ui = nodeUIBuilder(node);\r\n\r\n ui.id = uiid;\r\n ui.position = boundPosition;\r\n ui.node = node;\r\n\r\n if (gradient) {\r\n ui.gradient = gradient;\r\n }\r\n\r\n nodeProgram.createNode(ui);\r\n nodes[uiid] = ui;\r\n allNodes[node.id] = ui;\r\n\r\n return ui;\r\n },\r\n\r\n translateRel: function(dx, dy) {\r\n transform[12] += (2 * transform[0] * dx) / width / transform[0];\r\n transform[13] -= (2 * transform[5] * dy) / height / transform[5];\r\n updateTransformUniform();\r\n },\r\n\r\n scale: function(scaleFactor, scrollPoint) {\r\n // Transform scroll point to clip-space coordinates:\r\n var cx = (2 * scrollPoint.x) / width - 1,\r\n cy = 1 - (2 * scrollPoint.y) / height;\r\n\r\n cx -= transform[12];\r\n cy -= transform[13];\r\n\r\n transform[12] += cx * (1 - scaleFactor);\r\n transform[13] += cy * (1 - scaleFactor);\r\n\r\n transform[0] *= scaleFactor;\r\n transform[5] *= scaleFactor;\r\n\r\n updateTransformUniform();\r\n fireRescaled(this);\r\n\r\n return transform[0];\r\n },\r\n\r\n resetScale: function() {\r\n resetScaleInternal();\r\n\r\n if (gl) {\r\n updateSize();\r\n // TODO: what is this?\r\n // gl.useProgram(linksProgram);\r\n // gl.uniform2f(linksProgram.screenSize, width, height);\r\n updateTransformUniform();\r\n }\r\n return this;\r\n },\r\n\r\n /**\r\n * Resizes the graphic without resetting the scale.\r\n * Useful with viva graph in a dynamic container\r\n */\r\n updateSize: updateSize,\r\n\r\n /**\r\n * Called by Viva.Graph.View.renderer to let concrete graphic output\r\n * provider prepare to render.\r\n */\r\n init: function(c) {\r\n var contextParameters = {};\r\n\r\n if (options.preserveDrawingBuffer) {\r\n contextParameters.preserveDrawingBuffer = true;\r\n }\r\n container = c;\r\n updateSize();\r\n resetScaleInternal();\r\n container.appendChild(graphicsRoot);\r\n\r\n // gl = graphicsRoot.getContext(\"experimental-webgl\", contextParameters);\r\n gl = graphicsRoot.getContext(\"webgl2\", contextParameters);\r\n if (!gl) {\r\n var msg =\r\n \"Could not initialize WebGL. Seems like the browser doesn't support it.\";\r\n window.alert(msg);\r\n throw msg;\r\n }\r\n\r\n if (options.enableBlending) {\r\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);\r\n gl.enable(gl.BLEND);\r\n }\r\n if (options.clearColor) {\r\n var color = options.clearColorValue;\r\n gl.clearColor(color.r, color.g, color.b, color.a);\r\n // TODO: not the best way, really. Should come up with something better\r\n // what if we need more updates inside beginRender, like depth buffer?\r\n }\r\n if (options.depthBuffer) {\r\n gl.enable(gl.DEPTH_TEST);\r\n gl.depthFunc(gl.LEQUAL);\r\n }\r\n\r\n this.beginRender = function() {\r\n if (options.clearColor) {\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n }\r\n if (options.depthBuffer) {\r\n gl.clear(gl.DEPTH_BUFFER_BIT);\r\n }\r\n };\r\n\r\n straightLinkProgram.load(gl);\r\n straightLinkProgram.updateSize(width / 2, height / 2);\r\n\r\n curvedLinkProgram.load(gl);\r\n curvedLinkProgram.updateSize(width / 2, height / 2);\r\n\r\n nodeProgram.load(gl);\r\n nodeProgram.updateSize(width / 2, height / 2);\r\n\r\n arrowProgram.load(gl);\r\n arrowProgram.updateSize(width / 2, height / 2);\r\n\r\n updateTransformUniform();\r\n\r\n // Notify the world if someone waited for update. TODO: should send an event\r\n if (typeof initCallback === \"function\") {\r\n initCallback(graphicsRoot);\r\n }\r\n },\r\n getCanvas: function() {\r\n return graphicsRoot;\r\n },\r\n /**\r\n * Called by Viva.Graph.View.renderer to let concrete graphic output\r\n * provider release occupied resources.\r\n */\r\n release: function(container) {\r\n if (graphicsRoot && container) {\r\n container.removeChild(graphicsRoot);\r\n // TODO: anything else?\r\n }\r\n },\r\n\r\n /**\r\n * Checks whether webgl is supported by this browser.\r\n */\r\n isSupported: function() {\r\n var c = window.document.createElement(\"canvas\"),\r\n gl = c && c.getContext && c.getContext(\"experimental-webgl\");\r\n return gl;\r\n },\r\n\r\n resetStorage: function() {\r\n straightLinkProgram.resetStorage();\r\n curvedLinkProgram.resetStorage();\r\n arrowProgram.resetStorage();\r\n nodeProgram.resetStorage();\r\n },\r\n /**\r\n * Called by Viva.Graph.View.renderer to let concrete graphic output\r\n * provider remove link from rendering surface.\r\n *\r\n * @param linkUI visual representation of the link created by link() execution.\r\n **/\r\n releaseLink: function(link) {\r\n var linkUI = allLinks[link.id];\r\n\r\n delete allLinks[link.id];\r\n\r\n var linkIdToRemove = linkUI.id;\r\n if (linkUI.arrow) {\r\n var arrowIdToRemove = linkUI.arrowId;\r\n arrowProgram.removeArrow(linkUI);\r\n\r\n if (arrowCount > 0) {\r\n arrowCount -= 1;\r\n if (arrowIdToRemove < arrowCount) {\r\n if (arrowCount !== linkIdToRemove) {\r\n var lastArrowUI = arrows[arrowCount];\r\n arrows[arrowIdToRemove] = lastArrowUI;\r\n lastArrowUI.arrowId = arrowIdToRemove;\r\n }\r\n }\r\n }\r\n }\r\n if (linkUI.level > 0) {\r\n curvedLinkProgram.removeLink(linkUI);\r\n curvedLinksCount = removeLinkFromList(\r\n curvedLinks,\r\n curvedLinksCount,\r\n linkIdToRemove\r\n );\r\n } else {\r\n straightLinkProgram.removeLink(linkUI);\r\n straightLinksCount = removeLinkFromList(\r\n straightLinks,\r\n straightLinksCount,\r\n linkIdToRemove\r\n );\r\n }\r\n },\r\n\r\n /**\r\n * Called by Viva.Graph.View.renderer to let concrete graphic output\r\n * provider remove node from rendering surface.\r\n *\r\n * @param nodeUI visual representation of the node created by node() execution.\r\n **/\r\n releaseNode: function(node) {\r\n if (nodesCount > 0) {\r\n nodesCount -= 1;\r\n }\r\n var nodeUI = allNodes[node.id];\r\n delete allNodes[node.id];\r\n\r\n nodeProgram.removeNode(nodeUI);\r\n\r\n var nodeIdToRemove = nodeUI.id;\r\n if (nodeIdToRemove < nodesCount) {\r\n if (nodesCount === 0 || nodesCount === nodeIdToRemove) {\r\n return; // no more nodes or removed node is the last in the list.\r\n }\r\n\r\n var lastNodeUI = nodes[nodesCount];\r\n\r\n nodes[nodeIdToRemove] = lastNodeUI;\r\n lastNodeUI.id = nodeIdToRemove;\r\n\r\n // Since concrete shaders may cache properties in the UI element\r\n // we are letting them to make this swap (e.g. image node shader\r\n // uses this approach to update node's offset in the atlas)\r\n nodeProgram.replaceProperties(nodeUI, lastNodeUI);\r\n }\r\n },\r\n\r\n positionNodes: function() {\r\n var pos = { x: 0, y: 0 };\r\n // WebGL coordinate system is different. Would be better\r\n // to have this transform in the shader code, but it would\r\n // require every shader to be updated..\r\n for (var i = 0; i < nodesCount; ++i) {\r\n var ui = nodes[i];\r\n pos.x = ui.position.x;\r\n pos.y = ui.position.y;\r\n if (userPlaceNodeCallback) {\r\n userPlaceNodeCallback(ui, pos);\r\n }\r\n\r\n nodeProgram.position(ui, pos);\r\n }\r\n },\r\n\r\n positionLinks: function() {\r\n if (this.omitLinksRendering) {\r\n return;\r\n }\r\n\r\n console.time(\"Position Straight links\");\r\n // Draw Straight Links\r\n for (var i = 0; i < straightLinksCount; ++i) {\r\n var ui = straightLinks[i];\r\n var pos = flipLinkCoordinates(ui.pos);\r\n if (userPlaceLinkCallback) {\r\n userPlaceLinkCallback(ui, pos.fromPos, pos.toPos);\r\n }\r\n if (ui.arrow) {\r\n arrowProgram.position(\r\n ui,\r\n pos.fromPos,\r\n pos.toPos,\r\n allNodes[ui.toNodeId].size\r\n );\r\n }\r\n straightLinkProgram.position(\r\n ui,\r\n pos.fromPos,\r\n pos.toPos,\r\n allNodes[ui.toNodeId].size\r\n );\r\n }\r\n console.timeEnd(\"Position Straight links\");\r\n console.time(\"Position Curved links\");\r\n // Draw Curved Links\r\n for (var i = 0; i < curvedLinksCount; ++i) {\r\n var ui = curvedLinks[i];\r\n var pos = flipLinkCoordinates(ui.pos);\r\n if (userPlaceLinkCallback) {\r\n userPlaceLinkCallback(ui, pos.fromPos, pos.toPos);\r\n }\r\n if (ui.arrow) {\r\n arrowProgram.position(\r\n ui,\r\n pos.fromPos,\r\n pos.toPos,\r\n allNodes[ui.toNodeId].size\r\n );\r\n }\r\n curvedLinkProgram.position(\r\n ui,\r\n pos.fromPos,\r\n pos.toPos,\r\n allNodes[ui.toNodeId].size\r\n );\r\n }\r\n console.timeEnd(\"Position Curved links\");\r\n },\r\n\r\n getNodeStyle: function() {\r\n if (options.directedNodes) {\r\n return \"directed\";\r\n } else {\r\n return \"dots\";\r\n }\r\n },\r\n /**\r\n * Returns root element which hosts graphics.\r\n */\r\n getGraphicsRoot: function(callbackWhenReady) {\r\n // todo: should fire an event, instead of having this context.\r\n if (typeof callbackWhenReady === \"function\") {\r\n if (graphicsRoot) {\r\n callbackWhenReady(graphicsRoot);\r\n } else {\r\n initCallback = callbackWhenReady;\r\n }\r\n }\r\n return graphicsRoot;\r\n },\r\n\r\n /**\r\n * Updates default shader which renders nodes\r\n *\r\n * @param newProgram to use for nodes.\r\n */\r\n setNodeProgram: function(newProgram) {\r\n if (!gl && newProgram) {\r\n // Nothing created yet. Just set shader to the new one\r\n // and let initialization logic take care about the rest.\r\n nodeProgram = newProgram;\r\n } else if (newProgram) {\r\n throw \"Not implemented. Cannot swap shader on the fly... Yet.\";\r\n // TODO: unload old shader and reinit.\r\n }\r\n },\r\n\r\n /**\r\n * Updates default shader which renders links\r\n *\r\n * @param newProgram to use for links.\r\n */\r\n setLinkProgram: function(newProgram) {\r\n if (!gl && newProgram) {\r\n // Nothing created yet. Just set shader to the new one\r\n // and let initialization logic take care about the rest.\r\n straightLinkProgram = newProgram;\r\n } else if (newProgram) {\r\n throw \"Not implemented. Cannot swap shader on the fly... Yet.\";\r\n // TODO: unload old shader and reinit.\r\n }\r\n },\r\n\r\n /**\r\n * Transforms client coordinates into layout coordinates. Client coordinates\r\n * are DOM coordinates relative to the rendering container. Layout\r\n * coordinates are those assigned by by layout algorithm to each node.\r\n *\r\n * @param {Object} p - a point object with `x` and `y` attributes.\r\n * This method mutates p.\r\n */\r\n transformClientToGraphCoordinates: function(p) {\r\n // TODO: could be a problem when container has margins?\r\n // normalize\r\n p.x = (2 * p.x) / width - 1;\r\n p.y = 1 - (2 * p.y) / height;\r\n\r\n // apply transform\r\n p.x = (p.x - transform[12]) / transform[0];\r\n p.y = (p.y - transform[13]) / transform[5];\r\n\r\n // transform to graph coordinates\r\n p.x = p.x * (width / 2);\r\n p.y = p.y * (-height / 2);\r\n\r\n return p;\r\n },\r\n\r\n /**\r\n * Transforms WebGL coordinates into client coordinates. Reverse of\r\n * `transformClientToGraphCoordinates()`\r\n *\r\n * @param {Object} p - a point object with `x` and `y` attributes, which\r\n * represents a layout coordinate. This method mutates p.\r\n */\r\n transformGraphToClientCoordinates: function(p) {\r\n // TODO: could be a problem when container has margins?\r\n // transform from graph coordinates\r\n p.x = p.x / (width / 2);\r\n p.y = p.y / (-height / 2);\r\n\r\n // apply transform\r\n p.x = p.x * transform[0] + transform[12];\r\n p.y = p.y * transform[5] + transform[13];\r\n\r\n // denormalize\r\n p.x = ((p.x + 1) * width) / 2;\r\n p.y = ((1 - p.y) * height) / 2;\r\n\r\n return p;\r\n },\r\n\r\n getNodeAtClientPos: function(clientPos, preciseCheck) {\r\n if (typeof preciseCheck !== \"function\") {\r\n // we don't know anything about your node structure here :(\r\n // potentially this could be delegated to node program, but for\r\n // right now, we are giving up if you don't pass boundary check\r\n // callback. It answers to a question is nodeUI covers (x, y)\r\n return null;\r\n }\r\n // first transform to graph coordinates:\r\n this.transformClientToGraphCoordinates(clientPos);\r\n // now using precise check iterate over each node and find one within box:\r\n // TODO: This is poor O(N) performance.\r\n for (var i = 0; i < nodesCount; ++i) {\r\n if (preciseCheck(nodes[i], clientPos.x, clientPos.y)) {\r\n return nodes[i].node;\r\n }\r\n }\r\n return null;\r\n },\r\n\r\n getNodeNearestToClientPos: function(clientPos, distanceFunc) {\r\n if (typeof distanceFunc !== \"function\") {\r\n return null;\r\n }\r\n // first transform to graph coordinates:\r\n this.transformClientToGraphCoordinates(clientPos);\r\n // now using precise check iterate over each node and find one within box:\r\n // TODO: This is poor O(N) performance.\r\n var nearest = null;\r\n var nearestDist = Infinity;\r\n for (var i = 0; i < nodesCount; ++i) {\r\n let dist = distanceFunc(nodes[i], clientPos.x, clientPos.y);\r\n\r\n if (dist < nearestDist) {\r\n nearestDist = dist;\r\n nearest = nodes[i].node;\r\n }\r\n }\r\n if (nearest !== null) return nearest;\r\n return null;\r\n }\r\n };\r\n\r\n // Let graphics fire events before we return it to the caller.\r\n eventify(graphics);\r\n\r\n return graphics;\r\n}", "function draw(data, plot){\n\t//Draw/update DOM nodes based on data\n\t//i.e. enter exit update\n\n\tconst rectNodes = plot.selectAll('.node')\n\t\t.data(\n\t\t\tdata\n\t\t\t\t.descendants()\n\t\t\t\t.filter(function(d){\n\t\t\t\t\treturn d.depth < 3\n\t\t\t\t}),\n\t\t\tfunction(d){return d.data.key}\n\t\t); //UPDATE\n\n\t//ENTER\n\tconst rectNodesEnter = rectNodes.enter()\n\t\t.append('rect')\n\t\t.attr('class', 'node');\n\n\trectNodes.merge(rectNodesEnter)\n\t\t.transition()\n\t\t.attr('x', function(d){return d.x0})\n\t\t.attr('y', function(d){return d.y0})\n\t\t.attr('width', function(d){return d.x1-d.x0})\n\t\t.attr('height', function(d){return d.y1-d.y0})\n\t\t.style('fill', function(d){\n\t\t\tswitch(d.depth){\n\t\t\t\tcase 1: return 'red';\n\t\t\t\tcase 2: return 'blue';\n\t\t\t\tcase 0: return 'green'\n\t\t\t}\n\t\t})\n\t\t.style('stroke', 'black')\n\t\t.style('stroke-width', '1px');\n\n\tconst labelNodes = plot.selectAll('text')\n\t\t.data(\n\t\t\tdata\n\t\t\t\t.descendants()\n\t\t\t\t.filter(function(d){\n\t\t\t\t\treturn d.depth < 3\n\t\t\t\t})\n\t\t);\n\n\tconst labelNodesEnter = labelNodes.enter()\n\t\t.append('text');\n\n\tlabelNodes.merge(labelNodesEnter)\n\t\t.text(function(d){return d.data.key})\n\t\t.attr('text-anchor','middle')\n\t\t.transition()\n\t\t.attr('x', function(d){ return (d.x0 + d.x1)/2 })\n\t\t.attr('y', function(d){ return (d.y0 + d.y1)/2 })\n}", "function createNodes() {\n\n // refresh node data\n rect = rect.data([]);\n rect.exit().remove();\n rect = rect.data(nodes);\n\n\n // add node parent\n var g = rect.enter()\n // insert group with id\n .append('svg:g')\n .attr('id', function (d) {\n return 'node_' + d.id;\n });\n\n // add node type text\n if (isInternetExplorer()) {\n\n // grey rectangle\n g.append('svg:rect')\n .attr('width', side)\n .attr('height', side)\n .attr('fill', '#aaaaaa');\n\n // node type text\n g.append('svg:text')\n .attr('fill', 'black')\n .attr('text-anchor', 'middle')\n .attr('x', side / 2)\n .attr('y', (side / 2) + 4)\n .text(function (d) {\n return d['componentType']['name'];\n });\n }\n\n g.append('svg:g')\n //.attr('transform', 'scale(.05)')\n .attr('transform', 'scale(' + size + ')')\n .html(function (d) {\n if (getTipoNo(d) != 'TT')\n return d['componentType']['svg'];\n else {\n // compute the score to know which TT to use\n var score = 0;\n for (var i = 0, n = links.length; i < n; i++) {\n var cableCount = countCablesInLinkByType(links[i]);\n if (compareNodes(links[i].target, d))\n //score += (cableCount['CATV'] * 100) + (cableCount['MATV'] * 100) + (cableCount['FO'] * 10) + cableCount['PC'];\n score += (cableCount['CC'] * 100) + (cableCount['FO'] * 10) + cableCount['PC'];\n if (compareNodes(links[i].source, d))\n //score -= (cableCount['CATV'] * 100) + (cableCount['MATV'] * 100) + (cableCount['FO'] * 10) + cableCount['PC'];\n score -= (cableCount['CC'] * 100) + (cableCount['FO'] * 10) + cableCount['PC'];\n }\n\n // select image based on connected cables\n switch (score) {\n case 0:\n return d['componentType']['svg'];\n case 100:\n return ttSvg['CC'];\n case 10:\n return ttSvg['FO'];\n case 1:\n return ttSvg['PC'];\n case 200:\n return ttSvg['CCCC'];\n case 20:\n return ttSvg['FOFO'];\n case 2:\n return ttSvg['PCPC'];\n case 110:\n return ttSvg['CCFO'];\n case 11:\n return ttSvg['FOPC'];\n case 101:\n return ttSvg['PCCC'];\n case 111:\n return ttSvg['CCFOPC'];\n default:\n return ttSvg['ERROR'];\n }\n }\n });\n\n var bgSize = 6;\n\n // node number\n var nodeSelect = g.select(\"g\");\n nodeSelect.append('svg:rect')\n .attr('x', 865)\n .attr('y', 855)\n .attr('width', 120)\n .attr('height', 120)\n .attr('fill', 'white')\n .attr('class', function (d) {\n return (getTipoNo(d) == 'TT') ? (hideNodeID) ? 'node-id hidden' : 'node-id' : 'node-id hidden';\n });\n\n\n // node number\n nodeSelect.append('svg:text')\n .attr('font-weight', 'bold')\n .attr('x', 930)\n .attr('y', 950)\n .attr(\"font-size\", 100)\n .attr('fill', '#222222')\n .attr('text-anchor', 'middle')\n .attr('class', function (d) {\n return (hideNodeID || getTipoNo(d) == 'Curva') ? 'node-id hidden' : 'node-id';\n })\n .text(function (d) {\n return numberByType(nodes.indexOf(d));\n });\n\n // interaction rect\n g.append('svg:rect')\n .attr('class', 'node')\n .attr('width', sizeSquare * size)\n .attr('height', sizeSquare * size)\n .attr('fill', 'rgba(0,0,0,0)')\n .classed('selected', function (d) {\n return compareNodes(d, selected_node);\n });\n\n // -----------------------\n // -----Tooltip Label-----\n // -----------------------\n\n // background\n //nodeSelect.append('svg:rect')\n // //.attr('width', function (d) {\n // // return (d.label != null) ? (renderedTextSize(d.label, 'sans-serif', 8).width + 10) : 0;\n // //})\n // //.attr('height', 15)\n // .attr('width', 1000)\n // .attr('height', 1000)\n // .attr('x', function (d) {\n // return (d.label != null) ? (side - ((renderedTextSize(d.label, 'sans-serif', 8).width + 10) / 2)) : 0;\n // })\n // .attr('y', -18)\n // .attr('rx', 1)\n // .attr('ry', 1)\n // .attr('fill', '#333333')\n // .attr('class', function (d) {\n // return (d.label != null) ? null : 'hidden';\n // });\n\n g.append('svg:rect')\n .attr('width', function (d) {\n return (d.label != null) ? (renderedTextSize(d.label, 'sans-serif', size * 80).width + size * 100) : 0;\n })\n .attr('height', function (d) {\n return (d.label != null) ? (renderedTextSize(d.label, 'sans-serif', size * 80).height + size * 50) : 0;\n })\n .attr('x', function (d) {\n return (d.label != null) ? (side - ((renderedTextSize(d.label, 'sans-serif', size * 80).width + size * 100) / 2)) : 0;\n })\n //.attr('y', -18)\n .attr('y', function (d) {\n return (d.label != null) ? (-renderedTextSize(d.label, 'sans-serif', size * 80).height + size * -108) : 0;\n })\n .attr('rx', 1)\n .attr('ry', 1)\n .attr('fill', '#333333')\n .attr('class', function (d) {\n return (d.label != null) ? null : 'hidden';\n });\n\n // background triangle\n //nodeSelect.append('svg:polygon')\n g.append('svg:polygon')\n .attr('points', '0,-1 10,-1 5,3')\n .attr('transform', 'translate(' + (side - 10) + ', ' + size * -30 + ')')\n .attr('fill', '#333333')\n .attr('class', function (d) {\n return (d.label != null) ? null : 'hidden';\n });\n\n // label\n //nodeSelect.append('svg:text')\n g.append('svg:text')\n //.style('font-size', '8px')\n .style('font-size', function (d) {\n return (d.label != null) ? (renderedTextSize(d.label, 'sans-serif', size * 80).height) : 0;\n })\n .style('font-weight', '100')\n .attr('x', side)\n //.attr('y', -8)\n .attr('y', function (d) {\n return (d.label != null) ? size * -80 : 0;\n })\n .attr('fill', '#ffffff')\n .attr('text-anchor', 'middle')\n .attr('class', function (d) {\n return (d.label != null) ? null : 'hidden';\n })\n .text(function (d) {\n return d.label;\n });\n\n // ----------------\n // -----Events-----\n // ----------------\n\n $('rect.node').each(function () {\n\n var nodeIndex = $(this).parent().index();\n\n $(this)\n .off()\n .on('click', function (event) {\n node_click(event, nodeIndex);\n })\n .on('mouseover', function (event) {\n node_mouseover(event, nodeIndex);\n })\n .on('mouseout', function () {\n node_mouseout();\n })\n .on('mouseup', function () {\n node_mouseup(nodeIndex);\n })\n .on('mousedown', function (event) {\n node_mousedown(event, nodeIndex);\n });\n });\n}", "updateArticleNeighboursPlot(nodes, links, article_name) {\n\n // From: https://stackoverflow.com/a/20114692/5553845\n function generateRandomDarkColor() {\n\n var letters = '0123456789ABCDEF';\n var color = '#';\n // modified from original 16 to 14 to get more darker colors.\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 14)];\n }\n return color;\n }\n\n let linkColor = generateRandomDarkColor();\n\n // Highlight selected circle and neighbours\n nodes.forEach(function (n) {\n \n const c = d3.select(\"#article_\" + n)\n .classed(\"article-clicked\", true)\n .classed(\"neighbour-of-\" +\n convertToID(article_name), true)\n .attr(\"data-color\", linkColor);\n c.transition()\n .attr(\"r\", circle_radius + 0.2)\n .style(\"stroke\", linkColor)\n .style(\"stroke-width\", \"0.8\");\n\n })\n\n // Generate links\n const line = d3.line()\n .x(d => this.xScale(d.peak_date))\n .y(d => this.yScale(d.view_count));\n\n // Animate addition of new links\n const path = this.links_area\n .append(\"path\")\n .attr(\"d\", line(links))\n .classed(\"link\", true)\n .classed(\"link-of-\" + convertToID(article_name),\n true)\n .attr(\"id\", (d, i) => \"link_\" + i)\n .attr(\"stroke\", (d, i) => linkColor)\n .attr(\"stroke-opacity\", 0.6)\n .attr(\"stroke-width\", 1);\n\n const totalLength = path.node().getTotalLength();\n\n path.attr(\"stroke-dasharray\", totalLength + \" \" + totalLength)\n .attr(\"stroke-dashoffset\", totalLength)\n .transition()\n .duration(500)\n .attr(\"stroke-dashoffset\", 0);\n }", "function drawNodeLines(node, svg, w, h, color, lwd, scale = 0.9, padding = 30) {\n if (node.desc != null) {\n // Operates on internal nodes - lines drawn parent -> desc\n for (let i = 0; i < node.desc.length; i++) {\n svg\n .append(\"line\") // Vertical lines\n .attr(\"x1\", node.x * w * scale + padding)\n .attr(\"x2\", node.x * w * scale + padding)\n .attr(\"y1\", node.y * h * scale + padding)\n .attr(\"y2\", node.desc[i].y * h * scale + padding)\n .attr(\"stroke\", color)\n .attr(\"stroke-width\", lwd);\n\n if (Math.abs(node.x - node.desc[i].x) > 0.001) {\n svg\n .append(\"line\") // Horizontal lines\n .attr(\"x1\", node.x * w * scale + (padding - lwd / 2))\n // Subtracting by lwd/2 for x1 is what keeps line intersections square\n .attr(\"x2\", node.desc[i].x * w * scale + padding)\n .attr(\"y1\", node.desc[i].y * h * scale + padding)\n .attr(\"y2\", node.desc[i].y * h * scale + padding)\n .attr(\"stroke\", color)\n .attr(\"stroke-width\", lwd);\n } else {\n // Corrects for plotting artifacts with brls < lwd\n svg\n .append(\"line\") // Horizontal lines\n .attr(\"x1\", node.x * w * scale + (padding - lwd / 2))\n // Subtracting by lwd/2 for x1 is what keeps line intersections square\n .attr(\"x2\", node.x * w * scale + padding + lwd / 2)\n .attr(\"y1\", node.desc[i].y * h * scale + padding)\n .attr(\"y2\", node.desc[i].y * h * scale + padding)\n .attr(\"stroke\", color)\n .attr(\"stroke-width\", lwd);\n }\n\n drawNodeLines(node.desc[i], svg, w, h, color, lwd, scale, padding);\n }\n }\n}", "function drawANT() {\n var width = $(\"main\").width(),\n height = $(\"body\").height();\n\n /*\n 0 = valtio\n 1 = laki\n 3 = teknologia\n 4 = markinnat\n 5 = yhteiskunta?\n */\n\n var colors = [\n \"#548ed3\", // blue\n \"#e95b4d\", // red\n \"#00f579\", // green\n \"#003399\",\n \"#ee9911\"\n ];\n\n var svg = d3.select(\"main\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr(\"id\", \"ant\");\n\n var force = d3.layout.force()\n .gravity(0.1)\n .distance(function (node) {\n var maxDistance = width / 4 * 3;\n return maxDistance * node.value / 10;\n })\n .charge(function (node) {\n var maxCharge = width / 2;\n return -maxCharge * node.value / 10;\n })\n .linkStrength(0.1)\n .friction(0.75)\n .size([width, height]);\n\n d3.json(\"data/actors.json\", function (error, json) {\n force\n .nodes(json.nodes)\n .links(json.links)\n .start();\n\n var link = svg.selectAll(\".link\")\n .data(json.links)\n .enter().append(\"line\")\n .attr(\"class\", \"link\")\n .style(\"stroke-width\", function (d) {\n return Math.sqrt(d.value) / 2;\n });\n\n var node = svg.selectAll(\".node\")\n .data(json.nodes)\n .enter().append(\"g\")\n .attr(\"class\", \"node\")\n .call(force.drag);\n\n node.append(\"text\")\n .attr(\"dx\", \"15px\")\n .attr(\"dy\", \"10px\")\n .text(function (d) {\n return d.name;\n });\n\n node.append(\"circle\")\n .attr(\"r\", function (d) {\n return parseInt(3 + d.value);\n })\n .style(\"fill\", function (d) {\n return colors[d.group - 1];\n });\n\n\n force.on(\"tick\", function () {\n link.attr(\"x1\", function (d) {\n return d.source.x;\n })\n .attr(\"y1\", function (d) {\n return d.source.y;\n })\n .attr(\"x2\", function (d) {\n return d.target.x;\n })\n .attr(\"y2\", function (d) {\n return d.target.y;\n });\n\n node.attr(\"transform\", function (d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n });\n });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}", "function updateNodes() {\n node = node.data(data.topics, function(d) { return d.name; });\n\n node.exit().remove();\n\n var nodeEnter = node.enter().append(\"a\")\n .attr(\"class\", \"g-node\")\n .attr(\"xlink:href\", function(d) { return \"#\" + encodeURIComponent(d.name); })\n .call(force.drag)\n .call(linkTopic);\n\n var democratEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-democrat\");\n\n democratEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-democrat-\" + d.id; })\n .append(\"rect\");\n\n democratEnter.append(\"circle\");\n\n var republicanEnter = nodeEnter.append(\"g\")\n .attr(\"class\", \"g-republican\");\n\n republicanEnter.append(\"clipPath\")\n .attr(\"id\", function(d) { return \"g-clip-republican-\" + d.id; })\n .append(\"rect\");\n\n republicanEnter.append(\"circle\");\n\n nodeEnter.append(\"line\")\n .attr(\"class\", \"g-split\");\n\n node.selectAll(\"rect\")\n .attr(\"y\", function(d) { return -d.r - clipPadding; })\n .attr(\"height\", function(d) { return 2 * d.r + 2 * clipPadding; });\n\n node.select(\".g-democrat rect\")\n .style(\"display\", function(d) { return d.k > 0 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r - clipPadding; })\n .attr(\"width\", function(d) { return 2 * d.r * d.k + clipPadding; });\n\n node.select(\".g-republican rect\")\n .style(\"display\", function(d) { return d.k < 1 ? null : \"none\" })\n .attr(\"x\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"width\", function(d) { return 2 * d.r; });\n\n node.select(\".g-democrat circle\")\n .attr(\"clip-path\", function(d) { return d.k < 1 ? \"url(#g-clip-democrat-\" + d.id + \")\" : null; });\n\n node.select(\".g-republican circle\")\n .attr(\"clip-path\", function(d) { return d.k > 0 ? \"url(#g-clip-republican-\" + d.id + \")\" : null; });\n\n node.select(\".g-split\")\n .attr(\"x1\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y1\", function(d) { return -Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); })\n .attr(\"x2\", function(d) { return -d.r + 2 * d.r * d.k; })\n .attr(\"y2\", function(d) { return Math.sqrt(d.r * d.r - Math.pow(-d.r + 2 * d.r * d.k, 2)); });\n\n node.selectAll(\"circle\")\n .attr(\"r\", function(d) { return r(d.count); });\n}" ]
[ "0.76891696", "0.7185416", "0.70329934", "0.68590117", "0.6822951", "0.67826533", "0.6776398", "0.67660433", "0.6743505", "0.6738982", "0.67203295", "0.6608142", "0.65944296", "0.6591529", "0.6569237", "0.65656024", "0.6555526", "0.65239567", "0.6520787", "0.6504471", "0.6499629", "0.64915437", "0.6477432", "0.64718187", "0.6467043", "0.6454538", "0.6453746", "0.6442533", "0.64346933", "0.6432986", "0.64158195", "0.639628", "0.6385778", "0.63699937", "0.6364998", "0.63566625", "0.6324502", "0.63170856", "0.6303918", "0.6299823", "0.6294578", "0.629391", "0.62903017", "0.62866354", "0.6275062", "0.626437", "0.62640023", "0.62537205", "0.62400293", "0.6237057", "0.6233967", "0.62314445", "0.6212697", "0.6211434", "0.6208193", "0.61909884", "0.61871344", "0.61799675", "0.61707574", "0.61702895", "0.61674476", "0.6159537", "0.6157486", "0.61507344", "0.6143794", "0.6135245", "0.6130159", "0.61296695", "0.6127995", "0.6127995", "0.6112526", "0.61102194", "0.6108823", "0.61003804", "0.60961235", "0.607365", "0.60657114", "0.60407364", "0.6034703", "0.60332644", "0.6032652", "0.6031917", "0.6029593", "0.6025577", "0.60235083", "0.6015988", "0.6015805", "0.60139245", "0.6013422", "0.60047805", "0.60047805", "0.60047805", "0.60047805", "0.60047805", "0.60047805", "0.60047805", "0.60047805", "0.60047805", "0.60047805", "0.60047805", "0.60047805" ]
0.0
-1
tick function for forcelayout
function tick(e){ labelForce.start(); var k = 0.03 * e.alpha; var kY = 0.05; nodes .attr("cx", function(d) { if (d.outside.isOutside){ var tmpXOffset = Math.max(Math.min(xOffset, maxXOfferset) - leftPanelWidth, 0); return d.x = Math.max(tmpXOffset + nodeRadius + d.labelWidth / 2, Math.min(tmpXOffset + windowWidth - nodeRadius - d.labelWidth / 2, d.x)); } if (d.isTemporary){ var tmpXOffset = Math.max(Math.min(xOffset, maxXOfferset) - leftPanelWidth, 0); return d.x = Math.max(tmpXOffset + nodeRadius + d.labelWidth / 2, Math.min(tmpXOffset + windowWidth - nodeRadius - d.labelWidth / 2, d.x)); } var differX = d.position.x - d.x; if (d.type == "anchor"){ d.x += differX * kY; if (Math.abs(d.position.x - d.x) < 20){ d.x = d.position.x; } } else { d.x += differX * kY; } return d.x; }) .attr("cy", function(d) { if (d.outside.isOutside){ d.y += -d.y * k; return d.y = Math.max(nodeRadius + 12, Math.min(height - nodeRadius, d.y)); } var differY = d.position.y - d.y; if (d.type == "anchor"){ d.y += differY * kY; if (Math.abs(d.position.y - d.y) < 20 || d.y >= height - nodeRadius){ d.y = d.position.y; } } else { d.y += differY * kY; } return d.y = Math.max(nodeRadius, Math.min(height - nodeRadius, d.y)); }); labels.each(function(d, i){ if (i % 2 == 0){ if (d.type == "linkCircle"){ var a = nodesData[d.node.src]; var b = nodesData[d.node.tgt]; d.y = (a.y + b.y) / 2; d.x = (a.x + b.x) / 2 + (nodesData[d.node.tgt].x - nodesData[d.node.src].x) / 6; /*var i, j; for (i = 0; i < 1; i += 0.1){ if (getXofLabel(d, i, d.y)){ break; } } i -= 0.1; for (j = 0; j < 0.1; j += 0.01){ if (getXofLabel(d, i + j, d.y)){ break; } } */ } else if (d.type == "edgeLinkCircle"){ var a = d.node.src; var b = nodesData[d.node.tgt]; d.x = (a.x + b.x) / 2 + (b.x - a.x) / 6; d.y = (a.y + b.y) / 2; } else { d.x = d.node.x; d.y = d.node.y; } } else { var dx = textData[i - 1].x; var dy = textData[i - 1].y; d.y = dy; d.x = dx; } }) //if (!firstTime){ links.call(updateLink); labels.call(updateLabel); labelLinks.call(updateLabelLink); //} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tick() {\n\n\n\n}", "function adjustTicks(evt, obj) {\n //Using adjustTM attribute to adjust the \n //number of major ticks to a best feasible value\n if(adjustTickCB.checked) {\n cpuGauge.setChartAttribute('adjustTM', 1);\n }\n else{\n cpuGauge.setChartAttribute('adjustTM', 0);\n }\n }", "function tick(e) {\n node\n .each(gravity(e.alpha * .1))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n}", "function tick(e) {\n node\n .each(gravity(e.alpha * .1))\n .each(collide(.5))\n .attr(\"transform\", function(d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n\n label\n .style(\"left\", function(d) {\n return (d.x - d.dx / 2) + \"px\";\n })\n .style(\"top\", function(d) {\n return (d.y - d.dy / 2) + \"px\";\n });\n }", "function layout_tick() {\n\n // update rect position on drag\n if (mousedown && svg.classed('ctrl')) {\n updateNodePositions();\n drawPaths();\n updateDistances();\n }\n}", "tick() {\n \n }", "onTick() {\n\n this.factorIncrements();\n\n var event = new Event('tick', this);\n document.dispatchEvent(event);\n }", "function layoutTick(e) {\n self.update().select('circle')\n .attr('cx', d => d.x)\n .attr('cy', d => d.y)\n .attr('r', d => d.radius)\n\n self.update().select('text')\n .attr('x', d => d.x)\n .attr('y', d => d.y)\n }", "function tick(e) {\n node.attr(\"x\", function(d) {\n if (d.x >= width - (d.count)) {\n return width - (d.count);\n } else if (d.x <= 0) {\n return 0;\n } else {return d.x;}\n })\n .attr(\"y\", function(d) {\n if (d.y >= height - (d.count)) {\n return height - (d.count);\n } else if (d.y <= 0) {\n return 0;\n } else {return d.y;}\n });\n\n\n\n }", "tick() {\n }", "handleTick() {\n this.update()\n this.draw()\n }", "function ticked(e) {\n node.attr(\"transform\",function(d) {\n return \"translate(\" + [d.x + (width / 2), d.y + ((height) / 2)] + \")\"; //+ margin.top\n });\n }", "function ticked() {\n //set links position\n nodeLinks\n //.attr('opacity', 1)\n .attr(\"x1\", function (d) { return d.source.x; })\n .attr(\"y1\", function (d) { return d.source.y; })\n .attr(\"x2\", function (d) { return d.target.x; })\n .attr(\"y2\", function (d) { return d.target.y; });\n\n //set circles position\n nodeCircles\n //.attr('opacity', 1)\n .attr(\"cx\", function (d) { return d.x; })\n .attr(\"cy\", function (d) { return d.y; });\n\n //check whether the labels are enabled\n if (currentSerie.labelFormat) {\n //create texts\n textSVG\n .attr('x', function (d) { return d.x - this.getBBox().width / 2; })\n .attr('y', function (d) { return d.y + d.fontSize / 2 - 2; });\n }\n }", "tick() {\n\t\tthis.ticks++;\n\t\tthis.update();\n\t}", "_ticked() {\n this._tickedLink()\n this._tickedTermPoint()\n this._tickedNode()\n }", "function tick(e){\n // First let's reposition the nodes. As the force\n // layout runs it updates the `x` and `y` properties\n // that define where the node should be positioned.\n // To move the node, we set the appropriate SVG\n // attributes to their new values. \n node.style('left', function (d) { return d.x + 'px'; })\n .style('top', function (d) { return d.y + 'px'; })\n .call(force.drag);\n \n // We also need to update positions of the links.\n // For those elements, the force layout sets the\n // `source` and `target` properties, specifying\n // `x` and `y` values in each case.\n link.attr('x1', function(d){ return d.source.x})\n .attr('y1',function(d){ return d.source.y})\n .attr('x2', function(d){ return d.target.x})\n .attr('y2',function(d){ return d.target.y})\n .attr(\"stroke-width\", function(d){ return d.opacity*5; })\n .attr(\"stroke\", function(d){ \n \tif(d.color = \"positive\")\n \t\treturn \"green\";\n \telse\n \t\treturn \"red\";\n })\n }", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node\n .each(bias(e.alpha * 105))\n .each(collide(.5))\n .attr(\"transform\", function(d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; });\n\n label\n .style(\"left\", function(d) { return (d.x - d.dx / 2) + \"px\"; })\n .style(\"top\", function(d) { return (d.y - d.dy / 2) + \"px\"; });\n\n arrow.style(\"stroke-opacity\", function(d) {\n var dx = d.x - d.cx, dy = d.y - d.cy;\n return dx * dx + dy * dy < d.r * d.r ? 1: 0;\n });\n}", "function tick(e) {\n node.attr(\"x\", function(d) {\n if (d.x >= width - (d.count)) {\n return width - (d.count);\n } else if (d.x <= 0) {\n return 0;\n } else {return d.x;}\n })\n .attr(\"y\", function(d) {\n if (d.y >= height - (d.count)) {\n return height - (d.count);\n } else if (d.y <= 0) {\n return 0;\n } else {return d.y;}\n });\n}", "tick() {\n console.debug(`Ticking <${this.uuid}>`, this);\n this.ticks_epoch += 1;\n }", "function onTick() {\n var notis;\n if (notTicked) {\n notis = notTicked;\n notTicked = undefined;\n notis.forEach(doNotify);\n }\n }", "function tick(){\n\n d3.selectAll('.circ')\n .attr('cx', function(d){return d.x})\n .attr('cy', function(d){return d.y})\n\n }", "function tick() {\n\t\t\t\t if(thisEl.path)\n\t\t\t\t\tthisEl.path.attr(\"d\", linkArc);\n\t\t\t\tif(thisEl.circle)\n\t\t\t\t\tthisEl.circle.attr(\"transform\", transform); \n\t\t\t\t// nodeElems.attr(\"transform\",transform);\n\t\t\t\t// linkElems.attr(\"d\",linkArc);\n\t\t\t //text.attr(\"transform\", transform);\n\t\t\t}", "function userTick(delta, time) {\n}", "function tick() {\n // draw directed edges with proper padding from node centers\n }", "function tickFunction() {\n d3.selectAll('.MST.circle')\n .attr('cx', function (d) { return d.x = Math.max(radius, Math.min(width - radius, d.x)); })\n .attr('cy', function (d) { return d.y = Math.max(radius, Math.min(height - radius, d.y)); });\n\n d3.selectAll('.MST.label')\n .attr('x', function (d) {\n let bbox = d3.select(this).node().getBBox();\n return Math.max(0, Math.min(width - bbox.width - 10, d.x)) + 10;\n })\n .attr('y', function (d) {\n let bbox = d3.select(this).node().getBBox();\n return Math.max(0, Math.min(height - bbox.height - 15, d.y)) + 15;\n })\n\n lines\n .attr(\"x1\", function (d) { return d.source.x; })\n .attr(\"y1\", function (d) { return d.source.y; })\n .attr(\"x2\", function (d) { return d.target.x; })\n .attr(\"y2\", function (d) { return d.target.y; });\n }", "function ticked() {\n\t\tbubbles.attr(\"cx\", function(d) { return d.x; })\n\t\t.attr(\"cy\", function(d) { return d.y; });\n\t}", "function tick() {\n path.attr(\"d\", function (d) {\n return linkArc(d);\n });\n path_invisible.attr(\"d\", function (d) {\n return linkArc(d);\n });\n node.attr(\"cx\", function (d) { return d.x = Math.max(50, Math.min(plotWidth - 50, d.x)); }) //guarantees that the nodes are always 50px away from the border\n .attr(\"cy\", function (d) { return d.y = Math.max(50, Math.min(plotHeight - 50, d.y)); }); //guarantees that the nodes are always 50px away from the border\n node.attr(\"transform\", transform);\n }", "function tick () {\n if (!ticking) return\n\n // Some browsers call events a little too frequently, refuse to run more than is reasonable\n if (last_tick && (now() - last_tick) < 10) {\n raf.call(window, tick)\n return\n }\n\n last_tick = now()\n position()\n\n // tick again...\n raf.call(window, tick)\n }", "function ticked() {\n link.attr(\"d\", positionLink);\n node.attr(\"transform\", positionNode);\n }", "function ticked() {\n link\n .attr(\"x1\", function (d) {\n return d.source.x;\n })\n .attr(\"y1\", function (d) {\n return d.source.y;\n })\n .attr(\"x2\", function (d) {\n return d.target.x;\n })\n .attr(\"y2\", function (d) {\n return d.target.y;\n });\n\n \n node\n .attr(\"cx\", function (d) {\n return d.x;\n })\n .attr(\"cy\", function (d) {\n return d.y;\n });\n d3.select('#alpha_value').style('flex-basis', (simulation.alpha() * 100) + '%');\n}", "function tickfunction() {\n //alert(\"entro\");\n link.attr(\"x1\", function(d) { return d.source.x; })\n .attr(\"y1\", function(d) { return d.source.y; })\n .attr(\"x2\", function(d) { return d.target.x; })\n .attr(\"y2\", function(d) { return d.target.y; });\n\n \n node\n .style(\"fill\", function(d) { \n return color(d.group); \n })\n .attr(\"cx\", function(d) { return d.x; })\n .attr(\"cy\", function(d) { return d.y; });\n\n node.each(collide(0.5));\n \n }", "setTick(val){\n\t\tthis.tick = val;\n\t}", "function updateXTickCount() {\n // console.log(\"data -> \" + JSON.stringify(data));\n // console.log(\"data.length -> \" + data.length);\n // console.log(\"(.77 * window.innerWidth - 280) / 15 -> \" + (.77 * window.innerWidth - 280) / 15);\n // console.log((Math.floor(data.length / ((.77 * window.innerWidth - 280) / 15))) - 1);\n setXTickInterval((Math.floor(data.length / ((.77 * window.innerWidth - 280) / 15))) - 1);\n }", "function start (){ \r\nsetInterval(tickUpdate,12);\r\n}", "tick()\n {\n this.update();\n }", "function ticked() {\n link.attr(\"x1\", function(d) { return d.source.x; })\n .attr(\"y1\", function(d) { return d.source.y; })\n .attr(\"x2\", function(d) { return d.target.x; })\n .attr(\"y2\", function(d) { return d.target.y; });\n \n // bounding box to contain nodes within dimensions of svg \n node.attr(\"transform\", function(d) {\n let r = radius(d.count);\n d.x = Math.max(r,\n Math.min(graph_3_width - r, d.x));\n d.y = Math.max(r,\n Math.min((graph_3_height - margin.top - margin.bottom) - r, d.y));\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n }); \n }", "function ticked() {\n node.attr(\"transform\", function (d) {\n var radius = 10, ix, iy;\n if (d.scount !== undefined) { radius = Math.max(10, d.scount / 2); }\n ix = Math.max(radius, Math.min(width - radius, d.x));\n iy = Math.max(radius, Math.min(height - radius, d.y));\n return `translate(${ix},${iy})`\n });\n \n link.attr(\"d\", linkArc);\n }", "function tick(e) {\n\t // make sure the force gets smaller as the simulation runs\n\t var kx = 10 * e.alpha;\n\t \n\t root.nodes.forEach(function(d, i) {\n\t\t // fix the y value at the depth of the node\n d.y = d.fixed_y ? d.fixed_y - .5*origin_y : d.fixed_y;\n\t\t // move low prob nodes left\n\t\t // and keep the groups together (to a lesser extent)\n\t\t if (root.nodes[1].value > root.nodes[2].value) { \n\t\t j = 1;\n\t\t } else {\n\t\t j = -1;\n\t\t }\n\t\t // the amount to move the node\n\t\t delta_x = (3 * d.value - j * .3 * d.group + .3) * kx;\n\t\t // store the old position in case something goes wrong\n\t\t // the collision detection can casue NaNs and I am not sure why\n\t\t d.x_old = d.x;\n\t\t // check to make sure the node is not outside the plot area\n\t\t // if it is change the direction of the push\n\t\t if ((d.x-d.radius<0 && delta_x>0) || (d.x+d.radius>height && delta_x<0)) {\n\t\t delta_x *= -1\n\t\t }\n\t\t d.x -= delta_x;\n\t });\n\n\t // Also do collision detection after a few itterations\n\t if (e.alpha<0.05) {\n\t\t var q=d3.geom.quadtree(root.nodes),\n\t\t i=0,\n\t\t n=root.nodes.length;\n\t\t while (++i < n) q.visit(collide(root.nodes[i]));\n\t }\n\t \n\t // if the new position is NaN use the previous position\n\t // this prevents links for disappearing\n\t root.nodes.forEach( function(d) {\n\t\t if (isNaN(d.x)) { d.x = d.x_old; }\n\t });\n\t \n\t // Translate the node group to the new position\n\t gnode.attr(\"transform\", function(d) {\n\t\t return 'translate(' + [d.x, d.y] + ')'; \n\t }); \n\t link.attr(\"d\",diagonal);\n\t }", "function ticked() {\n nodes.attr('cx', function (d) {\n return xScale(d.x)\n })\n .attr('cy', function (d) {\n return yScale(d.y)\n })\n // link.attr(\"x1\", function (d) { return d.source.x; })\n // .attr(\"y1\", function (d) { return d.source.y; })\n // .attr(\"x2\", function (d) { return d.target.x; })\n // .attr(\"y2\", function (d) { return d.target.y; });\n\n\n // node.attr(\"cx\", function (d) { return d.x; })\n // .attr(\"cy\", function (d) { return d.y; });\n}", "tick() {\n let currentState = this.state;\n this.step++;\n this.state = this.updateState(currentState);\n this.updateElements();\n if (!this.stable && this.running) {\n setTimeout(() => {\n this.tick();\n }, 200);\n }\n }", "function tickTheClock(){\n\n \n \n}", "function getNextTick(){tick = tick +1;return tick;}", "function ticked() {\n bubbles\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n\n text\n .attr('x', function (d) { return d.x; })\n .attr('y', function (d) { return d.y; });\n }", "function tick() {\n node\n .attr('cx', function (d) {\n return d.x;\n })\n .attr('cy', function (d) {\n return d.y;\n });\n\n link\n .attr('x1', function (d) {\n return d.source.x;\n })\n .attr('y1', function (d) {\n return d.source.y;\n })\n .attr('x2', function (d) {\n return d.target.x;\n })\n .attr('y2', function (d) {\n return d.target.y;\n });\n\n text.attr('transform', function (d) {\n return 'translate(' + d.x + ',' + d.y + ')';\n });\n }", "_tick() {\n this._model.time++;\n }", "function renderTicks() {\n var majorTickLength = renderAttrs.majorTickLength,\n tickCoord, tickIndex, minTickIndex, maxTickIndex;\n\n // Determine range of x and y values to render (cf. CoordSysKind_RenderProc())\n // Use ~~ to efficiently truncate to integer\n // (cf. http://stackoverflow.com/questions/4055633/what-does-do-in-javascript)\n /*jslint bitwise:true */\n minTickIndex = ~~((renderMin - originAlongAxisCoord) / largeTickSpacing);\n maxTickIndex = ~~((renderMax - originAlongAxisCoord) / largeTickSpacing);\n \n for (tickIndex = minTickIndex; tickIndex <= maxTickIndex; ++tickIndex) {\n tickCoord = originAlongAxisCoord + tickIndex * largeTickSpacing;\n\n if( tickIndex !== 0) {\n if( renderAttrs.orientation === 'horizontal') {\n drawLine( ctx, { x: tickCoord, y: originCrossAxisCoord - majorTickLength },\n { x: tickCoord, y: originCrossAxisCoord + majorTickLength });\n }\n else {\n drawLine( ctx, { x: originCrossAxisCoord - majorTickLength, y: tickCoord },\n { x: originCrossAxisCoord + majorTickLength, y: tickCoord });\n }\n }\n }\n }", "_setTicksAndInterval() {\n const that = this;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n //Set the New Format here\n let minLabel = that._formatLabel(that.min),\n maxLabel = that._formatLabel(that.max);\n\n //gets the range with the new min/max\n that._getRange();\n\n //creates a new tickIntervalHandler instance\n that._tickIntervalHandler = new JQX.Utilities.TickIntervalHandler(that, minLabel, maxLabel, 'jqx-label', that._settings.size, that.scaleType === 'integer', that.logarithmicScale);\n\n //re-arranges the layout\n that._layout();\n\n if (!that.customInterval) {\n // calculates the tickInterval\n that._calculateTickInterval();\n\n if (that._dateInterval) {\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n else {\n // Add the ticks and labels\n that._numericProcessor.addTicksAndLabels();\n }\n }\n else {\n if (that.mode === 'date') {\n that._calculateTickInterval()\n }\n\n // custom ticks\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n }", "function ticked() {\n bubbleGroup\n .attr(\"transform\", function(d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n })\n }", "function ticked() {\n node.attr(\"cx\", function (d) {\n var radius = 10;\n if (d.scount !== undefined) { radius = Math.max(10, d.scount / 2);}\n return d.x = Math.max(radius, Math.min(width - radius, d.x));\n })\n .attr(\"cy\", function (d) {\n var radius = 10;\n if (d.scount !== undefined) { radius = Math.max(10, d.scount / 2); }\n return d.y = Math.max(radius, Math.min(height - radius, d.y));\n });\n link.attr(\"x1\", function (d) { return d.source.x; })\n .attr(\"y1\", function (d) { return d.source.y; })\n .attr(\"x2\", function (d) { return d.target.x; })\n .attr(\"y2\", function (d) { return d.target.y; });\n }", "function tick() {\n // update the links\n path.select(\".link\").attr(\"d\", function(d) {return getPath(d, 0)});\n // update the link labels\n path.select(\".linklabel\").attr(\"transform\", function(d) {\n if (d.target.x<d.source.x){\n bbox = this.getBBox();\n rx = bbox.x+bbox.width/2;\n ry = bbox.y+bbox.height/2;\n return \"rotate(180 \"+rx+\" \"+ry+\")\";\n }\n else {\n return \"rotate(0)\";\n }\n });\n \n // update dummy links\n dummyPath.select(\".link\").attr(\"d\", function(d) {return getPath(d, 1)});\n // update dummy link labels\n dummyPath.select(\".linklabel\").attr(\"transform\", function(d) {\n if (d.target.x<d.source.x){\n bbox = this.getBBox();\n rx = bbox.x+bbox.width/2;\n ry = bbox.y+bbox.height/2;\n return \"rotate(180 \"+rx+\" \"+ry+\")\";\n }\n else {\n return \"rotate(0)\";\n }\n });\n\n // update nodes\n rect.attr(\"transform\", (d) => `translate(${d.x - (d.w/2)},${d.y - (d.h)/2})`); \n}", "function tickCount() {\n if (width <= 530) {\n xAxis.ticks(5);\n yAxis.ticks(5);\n }\n else {\n xAxis.ticks(10);\n yAxis.ticks(10);\n } \n }", "function ticked() {\n\t\t\t_links\n\t\t\t\t.attr(\"x1\", function(d) { return d.source.x; })\n\t\t\t\t.attr(\"y1\", function(d) { return d.source.y; })\n\t\t\t\t.attr(\"x2\", function(d) { return d.target.x; })\n\t\t\t\t.attr(\"y2\", function(d) { return d.target.y; });\n\t\t\t_nodes\n\t\t\t\t.attr(\"transform\", function(d) { return \"translate(\" + d.x + \", \" + d.y + \")\"; }); \n\n\t\t\tedgepaths.attr('d', function (d) {\n\t\t\t\treturn 'M ' + d.source.x + ' ' + d.source.y + ' L ' + d.target.x + ' ' + d.target.y;\n\t\t\t});\n\n\t\t\tedgelabels.attr('transform', function (d) {\n\t\t\t\tif (d.target.x < d.source.x) {\n\t\t\t\t\tvar bbox = this.getBBox();\n\n\t\t\t\t\tvar rx = bbox.x + bbox.width / 2;\n\t\t\t\t\tvar ry = bbox.y + bbox.height / 2;\n\t\t\t\t\treturn 'rotate(180 ' + rx + ' ' + ry + ')';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn 'rotate(0)';\n\t\t\t\t}\n\t\t\t});\n\t\t}", "addGaugeCustomTicks() {\n const numericProcessor = this,\n that = numericProcessor.context,\n distance = that._distance,\n majorTickWidth = that._measurements.radius - distance.majorTickDistance;\n let drawTick, drawLabel;\n\n if (that.ticksVisibility !== 'none' && that._plotTicks !== false) {\n drawTick = function (angle) {\n that._drawTick(angle, majorTickWidth, 'major');\n };\n }\n else {\n drawTick = function () { };\n }\n\n if (that.labelsVisibility !== 'none' && that._plotLabels !== false) {\n drawLabel = function (angle, currentLabel, middle) {\n that._drawLabel(angle, currentLabel, distance.labelDistance, middle);\n };\n }\n else {\n drawLabel = function () { };\n }\n\n function createTickAndLabel(i) {\n const currentLabel = that.customTicks[i],\n value = numericProcessor.createDescriptor(currentLabel),\n angle = numericProcessor.getAngleByValue(value, true),\n middle = i > 0 && i < that.customTicks.length - 1;\n\n drawTick(angle);\n drawLabel(angle, currentLabel, middle);\n }\n\n for (let i = that.customTicks.length - 1; i >= 0; i--) {\n createTickAndLabel(i);\n }\n }", "tick() {\n this._update();\n }", "function tick(state) {\n \n let ball = state.canvas.selectAll('circle.ball').data(state.forceSim.nodes());\n\n\tball.exit().remove();\n\n\tball.merge(\n\t\tball.enter().append('circle')\n\t\t\t.classed('ball', true)\n\t\t\t.style('fill', function(d,idx) {\n if (idx == 0) {\n return INFECTED;\n } else {\n return HEALTHY;\n }\n })\n\t)\n\t\t.attr('r', d => d.r || BALL_RADIUS)\n\t\t.attr('cx', d => d.x)\n\t\t.attr('cy', d => d.y)\n .attr('id', (d, idx) => \"ball\"+idx.toString());\n \n\n // Generate live counter\n d3.select(\"span.healthy-count\").text(HEALTHY_COUNT.toString());\n d3.select(\"span.infected-count\").text(INFECTED_COUNT.toString());\n d3.select(\"span.recovered-count\").text(RECOVERED_COUNT.toString());\n d3.select(\"span.time-count\").text(time.toString());\n\n plusTime();\n tick_count++;\n}", "_calculateTickInterval() {\n const that = this;\n let intervals = that._tickIntervalHandler.getInterval('linear', that._drawMin, that._drawMax, that.$.track, that.logarithmicScale);\n\n if (intervals.major !== that._majorTicksInterval) {\n that._intervalHasChanged = true;\n that._majorTicksInterval = intervals.major;\n }\n else {\n that._intervalHasChanged = true;\n }\n\n that._minorTicksInterval = intervals.minor;\n\n if (that.mode === 'date') {\n that._calculateDateInterval(intervals.major);\n }\n }", "_addMajorTickAndLabel(htmlValue, labelSize, plot, value, middle) {\n const that = this.context,\n leftOrTop = that._settings.leftOrTop,\n offset = this.valueToPx(value);\n\n let currentTick = '',\n currentLabel = '';\n\n if (parseInt(offset) > parseInt(that._measurements.trackLength)) {\n return { tick: currentTick, label: currentLabel };\n }\n\n if (that.logarithmicScale) {\n htmlValue = that._formatLabel(Math.pow(10, value));\n }\n\n if (that.nodeName.toLowerCase() === 'jqx-tank' || that._intervalHasChanged) {\n let tickIntervalLabelSize = that._tickIntervalHandler.labelsSize;\n\n if (middle) {\n that._labelDummy.innerHTML = htmlValue;\n\n let tickPosition = this.valueToPx(value),\n maxPosition = this.valueToPx(that._drawMax),\n minPosition = this.valueToPx(that._drawMin),\n labelSize = that._labelDummy[that._settings.size],\n labelOtherSize = that.orientation === 'vertical' ? that._labelDummy.offsetWidth : that._labelDummy.offsetHeight,\n distanceToMin = (labelSize + tickIntervalLabelSize.minLabelSize) / 2,\n distanceToMax = (labelSize + tickIntervalLabelSize.maxLabelSize) / 2;\n\n that._normalLayout ?\n plot = (tickPosition + distanceToMax < maxPosition) && (tickPosition - distanceToMin > minPosition) :\n plot = (tickPosition - distanceToMax > maxPosition) && (tickPosition + distanceToMin < minPosition);\n\n if (labelOtherSize > this._longestLabelSize) {\n this._longestLabelSize = labelOtherSize;\n }\n\n }\n else {\n this._longestLabelSize = Math.max(tickIntervalLabelSize.minLabelOtherSize, tickIntervalLabelSize.maxLabelOtherSize, this._longestLabelSize);\n }\n }\n\n that._tickValues.push(value);\n\n currentTick = '<div style=\"' + leftOrTop + ': ' + offset + 'px;\" class=\"jqx-tick\"></div>';\n\n if (plot !== false) {\n if (labelSize === undefined) {\n that._labelDummy.innerHTML = htmlValue;\n labelSize = that._labelDummy[that._settings.size];\n }\n const labelOffset = offset - labelSize / 2;\n\n currentLabel += '<div class=\"jqx-label' + (middle ? ' jqx-label-middle' : '') + '\" style=\"' + leftOrTop + ': ' + labelOffset + 'px;\">' + htmlValue + '</div>';\n }\n\n return { tick: currentTick, label: currentLabel };\n }", "function tick() {\n \tvar dis;\n self.node.transition(200).style(\"fill\", function(d) {\n \tdis = d.distance;\n return color(d.distance);\n }).text(dis);\n }", "function tick(e) {\n\t // make sure the force gets smaller as the simulation runs\n\t var ky = 10 * e.alpha;\n\t \n\t root.nodes.forEach(function(d, i) {\n\t\t// fix the x value at the depth of the node\n\t\t// and add in the radius of the first node\n\t\ti!=0 ? d.x = d.fixed_x + root.nodes[0].radius+50 : d.x = d.fixed_x + root.nodes[0].radius;\n\t\t// move low prob nodes down\n\t\t// and keep the groups together (to a lesser extent)\n\t\tif (root.nodes[1].value > root.nodes[2].value) { \n\t\t j = 1;\n\t\t} else {\n\t\t j = -1;\n\t\t}\n\t\t// the amount to move the node\n\t\tdelta_y = (3 * d.value - j * .3 * d.group + .3) * ky;\n\t\t// store the old position in case something goes wrong\n\t\t// the collision detection can casue NaNs and I am not sure why\n\t\td.y_old = d.y;\n\t\t// check to make sure the node is not outside the plot area\n\t\t// if it is change the direction of the push\n\t\tif ((d.y-d.radius<0 && delta_y>0) || (d.y+d.radius>height && delta_y<0)) {\n\t\t delta_y *= -1\n\t\t}\n\t\td.y -= delta_y;\n\t });\n\n\t // Also do collision detection after a few itterations\n\t if (e.alpha<0.05) {\n\t\tvar q=d3.geom.quadtree(root.nodes),\n\t\t i=0,\n\t\t n=root.nodes.length;\n\t\twhile (++i < n) q.visit(collide(root.nodes[i]));\n\t }\n\t \n\t // if the new position is NaN use the previous position\n\t // this prevents links for disappearing\n\t root.nodes.forEach( function(d) {\n\t\tif (isNaN(d.y)) { d.y = d.y_old; }\n\t });\n\t \n\t // Translate the node group to the new position\n\t gnode.attr(\"transform\", function(d) {\n\t\treturn 'translate(' + [d.x, d.y] + ')'; \n\t }); \n\t link.attr(\"d\",diagonal);\n\t}", "function tick(e) {\n for ( i = 0; i < nodes.length; i++ ) {\n var node = nodes[i];\n /*\n * Animate the radius via the tick.\n *\n * Typically this would be performed as a transition on the SVG element itself,\n * but since this is a static force layout, we must perform it on the node.\n */\n node.radius = node.idealradius - node.idealradius * e.alpha * 10;\n node = gravity(.2 * e.alpha)(node);\n node = collide(.5)(node);\n node.cx = node.x;\n node.cy = node.y;\n }\n}", "function ticked() {\n bubbles\n .attr('cx', function (d) {\n return d.x;\n })\n .attr('cy', function (d) {\n return d.y;\n });\n }", "function tickPhysics()\n{\n n_recalculateTorques(rootNode);\n n_applyTorques(rootNode);\n n_updatePositions(rootNode);\n}", "function ticked() {\n bubbles\n .attr('cx', function(d) {\n return d.x;\n })\n .attr('cy', function(d) {\n return d.y;\n });\n }", "function tick() {\n setTime(howOld(createdOn));\n }", "function ticked() {\n bubbles\n .attr(\"cx\", function(d) {\n return d.x;\n })\n .attr(\"cy\", function(d) {\n return d.y;\n });\n }", "function ticked() {\n bubbles\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n }", "function ticked() {\r\n bubbles\r\n .attr('cx', function (d) { return d.x; })\r\n .attr('cy', function (d) { return d.y; });\r\n }", "function tick (e) {\n\t\t// update percent counter\n\t\t$(\"#bookmarklet\").text(Math.floor(1000*(0.1-(Force.force().alpha()))) + 6 + \"%\")\n\n\t\t// for benchmarking\n\t\t// FPS.sample();\n\n\n\t\tnode.call(updateNode);\n\t\tlink.call(updateLink);\n\t}", "function statUpdateTick() {\n updateCurrentStats();\n }", "tick() {\n this.setState({ stateTick: this.state.stateTick + 1 })\n }", "function ticked() {\n circles\n .attr(\"cx\", (d) => {\n return d.x;\n })\n .attr(\"cy\", (d) => {\n return d.y;\n });\n text\n .attr(\"x\", (d)=>{\n return d.x;\n })\n .attr(\"y\", (d)=>{\n return d.y;\n });\n }", "function ticked() {\n bubbles\n .attr('cx', function (d) { return d.x; })\n .attr('cy', function (d) { return d.y; });\n }" ]
[ "0.73944414", "0.682223", "0.67963153", "0.6743678", "0.6735817", "0.6732614", "0.6612211", "0.6607621", "0.6588134", "0.658552", "0.6574418", "0.65004045", "0.64797336", "0.6474218", "0.6459773", "0.6453222", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64354014", "0.64018095", "0.6321591", "0.6319709", "0.6265098", "0.6225226", "0.6218052", "0.6205905", "0.61924255", "0.616162", "0.61413217", "0.61401314", "0.6122418", "0.6118759", "0.61037415", "0.6098136", "0.60937375", "0.60858846", "0.60647607", "0.60632706", "0.60612", "0.60436815", "0.6025919", "0.60214514", "0.6010206", "0.59985715", "0.5995113", "0.59941196", "0.5990371", "0.5982807", "0.5979797", "0.5978323", "0.5977547", "0.59745294", "0.5969349", "0.59682", "0.5965543", "0.5965327", "0.59633917", "0.596254", "0.5958891", "0.5947623", "0.5947296", "0.5945702", "0.59436095", "0.59366", "0.59339494", "0.5930337", "0.5928038", "0.5918064", "0.59132814", "0.5908667", "0.5900683", "0.58999306", "0.5898717", "0.58966744" ]
0.652173
11
calculate the X of inside labels
function getXofLabel(d, t, y){ var a = nodesData[d.node.src]; var b = nodesData[d.node.tgt]; var ax = a.x - (a.x - b.x) / 3; var by = b.y - (b.y - a.y) / 3; var Ax = ((1 - t) * b.x) + (t * b.x); var Ay = ((1 - t) * b.y) + (t * by); var Bx = ((1 - t) * b.x) + (t * ax); var By = ((1 - t) * by) + (t * a.y); var Cx = ((1 - t) * ax) + (t * a.x); var Cy = ((1 - t) * a.y) + (t * a.y); var Dx = ((1 - t) * Ax ) + (t * Bx); var Dy = ((1 - t) * Ay ) + (t * By); var Ex = ((1 - t) * Bx ) + (t * Cx); var Ey = ((1 - t) * By ) + (t * Cy); var Px = ((1 - t) * Dx ) + (t * Ex); var Py = ((1 - t) * Dy ) + (t * Ey); d.x = Px; return Py < y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function labelX() {\n const l = d3.select(this.parentNode).select('line');\n // grabbing the values of the x1, x2, and y1 attributes\n const labelX1 = parseInt(l.attr('x1'));\n const labelX2 = parseInt(l.attr('x2'));\n // calculating and returing the x value for the message's label\n return (labelX1 + labelX2) / 2.0;\n}", "function labelXcalc(d,i){\n var tickAngle = d + 90;\n var tickAngleRad = dToR(tickAngle);\n var absXCorr = opt.labelFontSize * (tickLabelText[i].length - minLabelLength) / 2;\n var xCorr = opt.outerTicks ? absXCorr : - absXCorr;\n var x1 = originX + labelStart * Math.cos(tickAngleRad)+xCorr;\n return x1\n }", "function getlabels(xmin,xmax,mesh,xstep) {\r\nvar xlabel = []; \r\nvar igo = 0;\r\nfor (igo = 0; igo < mesh; igo++) {\r\n xlabel[igo] = \"\"; \r\n}\r\nvar nlabel = Math.floor((xmax-xmin)/xstep);\r\nvar ntebox = Math.floor(mesh/nlabel);\r\nfor (igo = 1; igo <= nlabel; igo++) {\r\n xlabel[igo*ntebox] = Math.floor(xmin+xstep*igo);\r\n}\r\nxlabel[0] = form(xmin,1);\r\nreturn xlabel;\r\n}", "getXoffset() {\n return labelWidth + this.getFullwidth() + barHeight * 2 + 19\n }", "function getlabeld(x,xstep) {\r\n var xlabel = []; xlabel[0] = x[0]; xnext = x[0]+ xstep;\r\n var igo = 0; mesh = x.length;\r\n for (igo = 1; igo < mesh; igo++) {\r\n xlabel[igo] = \"\"; \r\n if ( x[igo] > xnext ) {\r\n xlabel[igo] = form(x[igo],0);\r\n xnext = x[igo] + xstep;\r\n }\r\n }\r\n xlabel[mesh-1] = form(x[mesh-1],1);\r\n return xlabel;\r\n}", "findLabelPoints(){\r\n\t\tthis.labelPoints = [];\r\n\t\tvar finalPoints = [];\r\n\t\tfor(var i=0;i<this.points.length-1;i++){\r\n\t\t\tvar curLine = [this.points[i],this.points[i+1]];\r\n\t\t\tvar avgX = (curLine[0][0]+curLine[1][0])/2\r\n\t\t\tvar avgY = (curLine[0][1]+curLine[1][1])/2\r\n\t\t\tvar point = [avgX,avgY];\r\n\t\t\tfinalPoints.push(point);\r\n\t\t}\r\n\t\tthis.labelPoints = finalPoints;\r\n\t}", "function addXLabels() {\n const xLabels = document.querySelectorAll(\"#x-label text\");\n const xLabelComponent = document.querySelector(\"#x-label\");\n // Do tworzenia elementow svg nalezy uzywac \"createElementNS\", createElement nie zadziala\n const createText = document.createElementNS(\n \"http://www.w3.org/2000/svg\",\n \"text\"\n );\n const createTspan = document.createElementNS(\n \"http://www.w3.org/2000/svg\",\n \"tspan\"\n );\n\n createTspan.textContent = xLabels.length + 1;\n createText.appendChild(createTspan);\n createText.setAttribute(\"y\", 88.647018);\n createText.setAttribute(\"x\", 24.009666);\n xLabelComponent.insertBefore(createText, xLabelComponent.firstChild);\n // Przesuniecie starych text\n for (let i = 0; i < xLabels.length; i++) {\n const x = parseFloat(xLabels[i].getAttribute(\"x\"));\n xLabels[i].setAttribute(\"x\", x + 26);\n }\n}", "function getlabel(x,xtics) {\r\n var xlabel = []; xlabel[0] = form(x[0],1); pointer = 0;\r\n var igo = 0; mesh = x.length; xstep = (mesh-2)/(xtics-1);\r\n for (igo = 1; igo < mesh; igo++) {\r\n xlabel[igo] = \"\"; \r\n }\r\n for (igo=1; igo <= xtics-2; igo++) {\r\n pointer = Math.round(igo*xstep)\r\n xlabel[pointer] = form(x[pointer],1);\r\n }\r\n xlabel[mesh-1] = form(x[mesh-1],1);\r\n return xlabel;\r\n}", "function computeXLabelSpace(label) {\n\tvar _labelWidth = c.measureText(label).width + 10; // vertical\n if (!isH(chartType)) {\n\t if (labelOrientation === \"horizontal\") {\n\t \tif (typeof obj.xData !== \"undefined\") {\t \t\n\t \t\t_labelWidth = obj.xData.font.size + 20;\n \t\t if (adjustableTextFontSize) {\n\t\t \t\t_labelWidth=getAdjustableLabelFontSize() + 20;\n\t\t \t}\n\t \t} else {\n\t \t\t_labelWidth = 12 + 20;\n\t \t}\t\n\t } else if (labelOrientation === \"halfdiagonal\") {\n\t \t_labelWidth = c.measureText(label).width * Math.sin(Math.PI/8) + 20;\n\t } else if (labelOrientation === \"diagonal\") {\n\t \t_labelWidth = c.measureText(label).width * Math.sin(Math.PI/4) + 20;\n\t }\n\t}\n return _labelWidth;\n}", "function createXLabels(xLabelsGroup){\n// Appending individual labels\n var BAlabel = xLabelsGroup.append('text')\n .attr('x', 0)\n .attr('y', 0)\n .attr('value', 'BA')\n .attr('id', 'BA')\n .classed('active', true).classed('inactive', false)\n .text('Batting Average');\n var RSlabel = xLabelsGroup.append('text')\n .attr('x', 0)\n .attr('y', labelSpacing)\n .attr('value', 'RS')\n .attr('id', 'RS')\n .classed('active', false).classed('inactive', true)\n .text('Runs Scored');\n var RAlabel = xLabelsGroup.append('text')\n .attr('x', 0)\n .attr('y', labelSpacing*2)\n .attr('value', 'RA')\n .attr('id', 'RA')\n .classed('active', false).classed('inactive', true)\n .text('Runs Allowed');\n var Wlabel = xLabelsGroup.append('text')\n .attr('x', 0)\n .attr('y', labelSpacing*3)\n .attr('value', 'W')\n .attr('id', 'W')\n .classed('active', false).classed('inactive', true)\n .text('Wins');\n var OBPlabel = xLabelsGroup.append('text')\n .attr('x', 0)\n .attr('y', labelSpacing*4)\n .attr('value', 'OBP')\n .attr('id', 'OBP')\n .classed('active', false).classed('inactive', true)\n .text('On-Base Percentage');\n var SLGlabel = xLabelsGroup.append('text')\n .attr('x', 0)\n .attr('y', labelSpacing*5)\n .attr('value', 'SLG')\n .attr('id', 'SLG')\n .classed('active', false).classed('inactive', true)\n .text('Slugging Percentage');\n return xLabelsGroup;\n}", "createXAxis(data) {\n\n if (!data || data.length === 0) return;\n\n this.svg.selectAll('.xLabel').data(data).enter().append('text')\n .attr('class', 'xLabel')\n .attr('x', (d) => {return this.x(d.x)})\n .attr('y', this.height)\n .attr('fill', this.theme.value)\n .style('text-anchor', 'middle')\n .style('font-size', 10)\n .text((d) => {return this.props.xAxisTransform(d.x)})\n\n }", "tspanXOffset() {\n if (this.isNamedPath())\n return 0;\n else if (this.isReversePath())\n return -this.labelXOffset;\n else\n return this.labelXOffset;\n }", "function renderLabelsHorizontal() {\n var i, origin, label, cname;\n\n for (i = 0; i < this.labels.length; i++) {\n origin = getInnerChartPoint([\n (i * 100) / (this.labels.length - 1),\n 100\n ]);\n\n cname = 'chart-label chart-label-x';\n\n if (i === 0) {\n cname += ' first';\n }\n\n if (i === this.labels.length - 1) {\n cname += ' last';\n }\n\n origin[1] += LABEL_MARGIN;\n\n label = this.labels[i];\n\n this.svg.add('text', origin, label, { class: cname });\n }\n}", "function setLabelXshift(d) {\r\n if (d.target.x >= (d.source.x + 20)) return config.outWidth + 7 + \"px\";\r\n if (d.target.x <= (d.source.x - 20))\r\n return (config.outWidth + 7) * -1 + \"px\";\r\n return 0;\r\n }", "function labelChangeX(clickedAxis) {\r\n d3.selectAll(\".text-x\")\r\n .filter(\".active\")\r\n .classed(\"active\", false)\r\n .classed(\"inactive\", true);\r\n\r\n clickedAxis.classed(\"inactive\", false).classed(\"active\", true);\r\n }", "function returnLabelDimensions() {\n var dimensionMap = {}\n\n $('.orch-label').each(function(i, e) {\n\tdimensionMap[e.getAttribute(\"id\")] = e.getBBox();\n });\n\t\n return dimensionMap\n}", "labelTransform(data, labelKey) {\n if (this.labelNodes[labelKey]) {\n const { width, height } = this.labelNodes[labelKey].getBBox();\n const [cX, cY] = this.arc.centroid(data);\n\n return `translate(${[cX -width/2, cY + height/2]})`\n } else {\n return `translate(${this.arc.centroid(data)})`\n }\n }", "function X(d) {\n return xScale(d[0]);\n }", "function xAxisLabels(label, barId) {\n var xLabel = $(\"<p></p>\").text(label);\n xLabel.attr(\"class\",\"xaxislabels\");\n $(\"#\" + barId).append(xLabel);\n}", "function drawXlabels(labels, options, element) {\n\n // extracts needed information from options\n var chartWidth = options.width;\n var chartHeight = options.height;\n var space = options.spacing;\n\n // determines the width of the bars displayed\n var barWidth = (chartWidth / labels.length) - space;\n\n // creates the label area that the labels are rendered to\n var labelArea = $(\"<div>\").attr(\"id\", \"xArea\");\n $(labelArea).css({width: chartWidth + \"px\", marginTop: (chartHeight + 101) + \"px\"});\n $(element).append(labelArea);\n\n var i;\n\n for (i = 0; i < labels.length; i++) {\n // creates a label for each label in labels\n var label = $(\"<div>\").addClass(\"xLabel\");\n\n // updates the position and text displayed for the label\n $(label).css({height: barWidth + \"px\", marginLeft: (space + i * (barWidth + space)) + \"px\", lineHeight: barWidth + \"px\"});\n $(label).text(labels[i]);\n\n // appends the label to the label area\n $(labelArea).append(label);\n }\n}", "_pageXToTrendX(pageX) {\n return (pageX - this._chartLayout.absPlotAreaRect.left) / this._xAxisTag.coef + this._xAxisTag.min;\n }", "createLabels(x_label, y_label) {\r\n\t\tlet oldText = this.texts.selectAll('text');\r\n\t\toldText.remove();\r\n\t\tthis.texts.append('text')\r\n\t\t\t.attr('x', this.offset.x + this.cell_size * this.numCols / 2 - this.cell_size)\r\n\t\t\t.attr('y', this.offset.y + (this.cell_size * this.numRows) + this.cell_size)\r\n\t\t\t.attr('font-family', 'sans-serif')\r\n\t\t\t.attr('font-size', this.text_sizes.normal)\r\n\t\t\t.text(this.x_axis_label + ' (' + this.x_units + ')');\r\n\t\tthis.texts.append('text')\r\n\t\t\t.attr('transform', `rotate(-90)`)\r\n\t\t\t.attr('x', -(this.offset.y + (this.cell_size * this.numRows) / 2 + this.cell_size))\r\n\t\t\t.attr('y', this.offset.x - this.cell_size)\r\n\t\t\t.attr('font-family', 'sans-serif')\r\n\t\t\t.attr('font-size', this.text_sizes.normal)\r\n\t\t\t.text(this.y_axis_label + ' (' + this.y_units + ')');\r\n\t}", "function labelY() {\n const l = d3.select(this.parentNode).select('line');\n return parseInt(l.attr('y1')) - 20;\n}", "function X(d) {\n return xScale(d[0]);\n }", "function X(d) {\n return xScale(d[0]);\n }", "function X(d) {\n return xScale(d[0]);\n }", "function renderXTextLabels(textLabels, newXScale, chosenXAxis) {\n\n textLabels.transition()\n .duration(1000)\n .attr('dx', d => newXScale(d[chosenXAxis]));\n \n return textLabels;\n}", "function draw_labels(data, opt) {\n for (let i = 0; i < data.no_examples(); i++) {\n let xe = data.x[i];\n let ye = data.y[i];\n let x1 = (xe[0] - opt[2]) / opt[0] * 100;\n let x2 = (xe[1] - opt[3]) / opt[1] * 100;\n drawlabel(x1, x2, ye);\n }\n}", "__calculateX(position) {\n\t\treturn (gap + (tileSize + gap) * (position % dimensions));\n\t}", "function X(d) {\n return xScale(d[0]);\n }", "function GetNodeX() {\r\n\r\n\t\tvar CrossX = ((-1) * (kHatSrcY));\r\n\t\tvar NodeX = (CrossX / (Math.sin(BigTheta)));\r\n\t\t\r\n\t\treturn NodeX;\r\n\t}", "createLabels() {\n return this.props.pie(this.props.data).map((data, idx) => {\n // Don't label the really small wedges.\n if (data.endAngle - data.startAngle < 0.1) return null;\n let labelKey = data.data[this.props.labelKey]\n\n // Note the ref being placed on each label element for easy reference\n // and subsequently easy access to the height/width for repositioning.\n return (\n <text transform={this.labelTransform(data, labelKey)}\n ref={ (node) => this.labelNodes[labelKey] = node }\n key={labelKey}>\n { this.props.formatLabel(data.value) }\n </text>\n );\n });\n }", "function xlabelChange(clickedXAxis) {\n d3\n .selectAll(\".xLabel\")\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n\n clickedXAxis.classed(\"inactive\", false).classed(\"active\", true);\n }", "function adjustedX() {\n return parseFloat(currentCircle.attr(\"cx\")) - parseFloat(currentCircle.attr(\"cx-backup\"));\n}", "function xstooltip_findPosX(obj) \r\n{\r\n var curleft = 0;\r\n if (obj.offsetParent) \r\n {\r\n while (obj.offsetParent) \r\n {\r\n curleft += obj.offsetLeft\r\n obj = obj.offsetParent;\r\n }\r\n }\r\n else if (obj.x)\r\n curleft += obj.x;\r\n return curleft;\r\n}", "function get_text_x(step) {\n\treturn 75 + step * 50;\n}", "function plotLabels (labels, dimensions, offset) {\n this.select('.y.axis').selectAll('text.label').data([labels.y])\n .enter()\n .append('text')\n .attr('class', 'label')\n .attr('x', 0)\n .attr('y', 0)\n .style('text-anchor', 'middle')\n .style('fill', '#000')\n .attr('transform', 'translate(' + -offset.left * 0.67 + ',' +\n dimensions.h / 2 + ') rotate(-90)')\n .text(labels.y)\n\n this.select('.x.axis').selectAll('text.label').data([labels.x])\n .enter()\n .append('text')\n .attr('class', 'label')\n .attr('x', 0)\n .attr('y', 0)\n .style('text-anchor', 'middle')\n .style('fill', '#000')\n .attr('transform', 'translate(' + dimensions.w / 2 + ',' +\n offset.bottom * 0.75 + ')')\n .text(function (d) { return d })\n }", "function drawXAxis(labels) {\n paper.leonardo.hLine(plotArea.x, plotArea.y + plotArea.height, plotArea.width);\n\n // TODO: Get rid of magic number. Base labelText on font size.\n var labelY = plotArea.y + plotArea.height,\n labelTextY = labelY + (2 * opts.tickSize);\n\n plot(labels, function (x, y, label) {\n x += plotArea.xOffset;\n paper.leonardo.vLine(x, labelY, opts.tickSize);\n paper.text(x, labelTextY, label);\n });\n }", "function getXPixel(val, data) {\n return ((graph.width() - xPadding) / data.values.length) * val + (xPadding * 1.5);\n}", "get labelPosition() {\n return this.getLabelPosition();\n }", "function makeLabels(svgContainer, msm, title, x, y) {\r\n svgContainer.append('text')\r\n .attr('x', (msm.width - 2 * msm.marginAll) / 2 - 90)\r\n .attr('y', msm.marginAll / 2 + 10)\r\n .style('font-size', '10pt')\r\n .text(title);\r\n\r\n svgContainer.append('text')\r\n .attr('x', (msm.width - 2 * msm.marginAll) / 2 - 30)\r\n .attr('y', msm.height - 10)\r\n .style('font-size', '10pt')\r\n .text(x);\r\n\r\n svgContainer.append('text')\r\n .attr('transform', 'translate( 15,' + (msm.height / 2 + 30) + ') rotate(-90)')\r\n .style('font-size', '10pt')\r\n .text(y);\r\n}", "x() {\n\t\t\treturn this.data.x;\n\t\t}", "function labelPosition(ctx, v) {\n\tctx.font=\"300 14px Open Sans, sans-serif\";\n\tvar l = new Object();\n\tl.x = [0,0,0];\n\tl.y = [];\n\tfor(var i=0, len=v.length; i<len; i++) {\n\t\tvar radPos = 0;\n\t\tif (i == 0) {\n\t\t\tradPos = 2-(v[0]/2);\n\t\t} else {\n\t\t\tradPos = 2-(v[i]/2+v[i-1]/2);\n\t\t}\n\t\tl.x[i] = (graphWidth/2+Math.cos(radPos*Math.PI)*70);\n\t\tl.x[i] -= ctx.measureText(yearCreated).width/2;\n\t\tl.y[i] = (graphWidth/2+Math.sin(radPos*Math.PI)*70);\n\t\tl.y[i] += 7; // Font height offset\n\n\t\tvar radPosTemp = 0;\n\t\t// Label offset\n\t\tl.x[i] += Math.cos(radPos*Math.PI) * 23;\n\t\tl.y[i] += Math.sin(radPos*Math.PI) * 23;\n\t}\n\treturn l;\n}", "getIntersectedLabel(x, y) {\n // debugger\n for (const label of this._.labelSet) {\n if (label.minimized) continue;\n if (Utils2D.coordsInElement(x, y, this.refs[getLabelRef(label.id, this._.componentId)])) {\n return label;\n }\n }\n return null;\n }", "_calculateTickAndLabelDistance() {\n const that = this,\n measurements = that._measurements;\n\n if (that.scalePosition === 'none') {\n that._plotLabels = false;\n that._plotTicks = false;\n\n measurements.innerRadius = measurements.radius;\n\n return { majorTickDistance: 0, minorTickDistance: 0, labelDistance: 0, needleDistance: 0, trackDistance: 0 };\n }\n\n const labelsSize = that._tickIntervalHandler.labelsSize,\n labelSizeCoefficient = that._largestLabelSize || Math.max(labelsSize.minLabelSize, labelsSize.minLabelOtherSize, labelsSize.maxLabelSize, labelsSize.maxLabelOtherSize);\n let majorTickDistance = 1,\n minorTickDistance,\n labelDistance,\n needleDistance,\n trackDistance = 0;\n\n that._largestLabelSize = labelSizeCoefficient;\n\n if (that.scalePosition === 'outside') {\n majorTickDistance = labelSizeCoefficient;\n minorTickDistance = majorTickDistance + measurements.majorTickSize - measurements.minorTickSize;\n labelDistance = 0;\n }\n\n if (that.analogDisplayType === 'needle') {\n if (that.scalePosition === 'outside') {\n needleDistance = majorTickDistance + measurements.majorTickSize;\n }\n else {\n needleDistance = majorTickDistance + measurements.majorTickSize + labelSizeCoefficient;\n }\n\n if (that.ticksVisibility === 'none') {\n labelDistance = 0;\n needleDistance -= measurements.majorTickSize;\n }\n if (that.labelsVisibility === 'none') {\n needleDistance -= labelSizeCoefficient;\n if (that.scalePosition === 'outside') {\n majorTickDistance -= labelSizeCoefficient;\n minorTickDistance -= labelSizeCoefficient;\n }\n }\n }\n else {\n if (that.labelsVisibility === 'none' && that.ticksVisibility === 'none') {\n trackDistance = 0;\n }\n else {\n if (that.scalePosition === 'outside') {\n if (that.ticksPosition === 'scale') {\n if (that.labelsVisibility === 'none') {\n majorTickDistance = 1;\n minorTickDistance = 1 + measurements.majorTickSize - measurements.minorTickSize;\n }\n if (that.ticksVisibility !== 'none') {\n trackDistance = majorTickDistance + measurements.majorTickSize + 2;\n }\n else {\n trackDistance = labelSizeCoefficient;\n }\n }\n else {\n if (that.labelsVisibility !== 'none') {\n minorTickDistance = minorTickDistance - (measurements.trackWidth + measurements.trackBorderWidth) / 4;\n trackDistance = majorTickDistance - 1;\n }\n else {\n majorTickDistance = 1;\n minorTickDistance = (measurements.trackWidth + measurements.trackBorderWidth) / 4 + 1;\n trackDistance = 0;\n }\n }\n }\n else {\n if (that.ticksPosition === 'scale') {\n majorTickDistance = measurements.trackWidth + 1.5 * measurements.trackBorderWidth + 2;\n if (that.ticksVisibility === 'none') {\n labelDistance = majorTickDistance;\n }\n }\n else {\n minorTickDistance = (measurements.trackWidth + measurements.trackBorderWidth) / 4 + 1;\n }\n }\n }\n }\n\n if (minorTickDistance === undefined) {\n minorTickDistance = majorTickDistance;\n }\n\n if (labelDistance === undefined) {\n labelDistance = majorTickDistance + measurements.majorTickSize;\n }\n\n measurements.innerRadius = measurements.radius - labelDistance;\n\n delete that._plotLabels;\n delete that._plotTicks;\n delete that._equalToHalfRadius;\n if (that.scalePosition === 'inside') {\n if (measurements.innerRadius < labelSizeCoefficient) {\n that._plotLabels = false;\n\n if (that.ticksPosition === 'scale') {\n if (that.analogDisplayType !== 'needle' && measurements.innerRadius < measurements.majorTickSize) {\n that._plotTicks = false;\n }\n }\n else {\n that._equalToHalfRadius = true;\n measurements.innerRadius = measurements.radius / 2;\n }\n }\n }\n else if (measurements.radius - trackDistance - measurements.trackBorderWidth < measurements.trackWidth) {\n measurements.trackWidth = measurements.radius - trackDistance - measurements.trackBorderWidth;\n measurements.lineSize = measurements.trackWidth + measurements.trackBorderWidth;\n if (that.ticksPosition === 'track') {\n measurements.majorTickSize = measurements.lineSize;\n measurements.minorTickSize = measurements.majorTickSize / 2;\n minorTickDistance = majorTickDistance + (measurements.majorTickSize - measurements.minorTickSize) / 2;\n }\n }\n\n return { majorTickDistance: majorTickDistance, minorTickDistance: minorTickDistance, labelDistance: labelDistance, needleDistance: needleDistance, trackDistance: trackDistance };\n }", "function labelAxes(svg, coords, attributes) {\n if ('x-label' in attributes) {\n svg.append('text')\n .attr('x', coords['x'] + coords['width'] / 2) \n .attr('y', coords['y'] + coords['height'])\n .attr('text-anchor', 'middle')\n .style('font-family', style('axisFont'))\n .style('font-size', style('axisFontSize'))\n .text(attributes['x-label']);\n }\n\n if ('y-label' in attributes) {\n svg.append('text')\n .attr('x', coords['x'] - coords['height'] / 2 - coords['axisPadding'])\n .attr('y', coords['y'])\n .attr('transform', 'rotate(-90)')\n .attr('text-anchor', 'middle')\n .style('font-family', style('axisFont'))\n .style('font-size', style('axisFontSize'))\n .text(attributes['y-label']);\n }\n}", "get shouldAutoExpandMarginForInitialLabels() {\n return this.i.nx;\n }", "function X(d) {\n return xScale(xValue(d));\n }", "function computeVStep() {\n\tvar xLabelWidth = 0;\n\tif (typeof obj.xData !== \"undefined\") {\t \t\t\n\t\tvar xfont = obj.xData.font;\t\t\n if (adjustableTextFontSize) {\n\t\t\txfont.size=getAdjustableLabelFontSize();\n\t\t}\n\t\tvar b = \" \";\n\t\tc.font = xfont.weight + b + xfont.size + \"px\" + b + xfont.family; \t\t\n\t}\n\tif (showLabels) {\n\t\tfor(var i=0; i<labels.length; i++) { \n\t\t var labelWidth = computeXLabelSpace(labels[i]);\n\t\t if (labelWidth > xLabelWidth) {\n\t\t xLabelWidth = labelWidth;\n\t\t } \n\t\t} \n\t}\n\tvar _xLegendSpace = 0;\n\tif (typeof obj.xLegend !== \"undefined\") {\t\t\t\t\n\t\tvar f = obj.xLegend.font;\n\t\tif (f === undefined) {\n\t\t\tf.weight = \"bold\";\n\t\t\tf.size = 12;\n\t\t\tf.family = \"sans-serif\";\n\t\t}\t\t \n if (adjustableTextFontSize) { \n\t\t\tf.size = getAdjustableLabelFontSize();\n\t\t}\n var legendPadding = 20;\t\t\n\t\tif (adjustableTextFontSize) {\n\t\t\tlegendPadding = getAdjustableLabelFontSize();\n\t\t}\n\t\t_xLegendSpace = +legendPadding + +f.size; \n\t}\t\t\t\n\tif ((step < xLabelWidth+_xLegendSpace) || adjustableTextFontSize) { \n\t step = xLabelWidth+_xLegendSpace;\t \t\t\n\t}\t\n\treturn xLabelWidth;\n}", "function getXPixelAxis(val) {\n\t\treturn (getGraphWidth() / size * val) + ((width - xOffset) / size) / 2 + xOffset;\n\t}", "x(x) {\n let box = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.bbox();\n\n if (x == null) {\n return box.x;\n }\n\n return this.attr('x', this.attr('x') + x - box.x);\n }", "function generateLabels(l) {\n\t var a = [],\n\t i;\n\t for (i = 0; i < l; i++) {\n\t a[i] = s.labels && s.labels[i] ? s.labels[i] : i;\n\t }\n\t return a;\n\t }", "function X(d) {\n\t\treturn xScale(xValue(d));\n\t}", "function X(d) {\n\t\treturn xScale(xValue(d));\n\t}", "getLabelStats () {\n return computeLabelStats(this.labelSets.primary.outer, this._invariant.outerPadding)\n }", "function get_point_x(step) {\n\treturn 73 + step * 50;\n}", "function xAxisLabel(name, d) {\n return chartGroup\n .append(\"text\")\n .attr(\"transform\", `translate(${width / 2}, ${height + margin.top + d})`)\n .attr(\"text-anchor\", \"middle\")\n .attr(\"font-size\", \"14px\")\n .attr(\"font-weight\", \"bold\")\n .attr(\"fill\", \"black\")\n .classed(\"axis-label\", true)\n .text(name);\n}", "get midX() {\n return this.x + this.ancho * 0.5\n }", "__calculateX(position) {\n\t\treturn (gap + (tileSize + gap) * (position % this.cols));\n\t}", "get labelPosition() {\n return this._labelPosition;\n }", "function getX(tree, pos) {\n\n var cumulativeXOffset = function(elem) {\n var left = 0; \n while (elem && \n elem.id != \"mathDisplay\") {\n left += elem.offsetLeft || 0;\n elem = elem.offsetParent;\n }\n return left; \n };\n\n if (tree.children) {\n var startNode = tree;\n var endNode = tree;\n while (startNode.children || endNode.children) {\n if (startNode.children)\n startNode = startNode.children[0];\n if (endNode.children)\n endNode = endNode.children[endNode.children.length - 1];\n }\n var firstElem = document.getElementById(startNode.id);\n var lastElem = document.getElementById(endNode.id);\n\n\n if (pos == \"center\") {\n var firstOffset = cumulativeXOffset(firstElem); \n var lastOffset = cumulativeXOffset(lastElem); \n return (firstOffset + lastOffset + lastElem.offsetWidth) / 2;\n } else if (pos == \"right\") {\n var lastOffset = cumulativeXOffset(lastElem); \n return lastOffset + lastElem.offsetWidth + 10; \n }\n\n\n } else {\n var selection = document.getElementById(tree.id);\n\n console.log(tree); \n\n if (pos == \"center\") {\n var offset = cumulativeXOffset(selection); \n return (offset + offset + selection.offsetWidth) / 2;\n } else if (pos == \"right\") {\n var offset = cumulativeXOffset(selection); \n return offset + selection.offsetWidth + 10; \n }\n }\n}", "get xAxisAnnotationPaddingLeft() {\r\n return this.i.nh;\r\n }", "get x() {\n\t\t\treturn this._x / this.scale;\n\t\t}", "function setLabelPositions(){\n labelPosition = {\n x: margin.top + height + (3 * margin.bottom / 4),\n y: margin.left / 4\n }; \n}", "function renderLabels(circlesLabels, xLinearScale, chosenX) {\n circlesLabels.transition()\n .duration(1000)\n .attr(\"x\", d => xLinearScale(d[chosenX]));\n return circlesLabels;\n}", "get getX() {\n return this.cooX;\n }", "function convertX(canvas, inX) {\n\tvar x = inX + 6;\n\t\n\treturn ((canvas.offsetLeft - offset + x*50) - canvas.width / 2) / (canvas.width / 2);\n}", "createValueLabels(data) {\n\n if (!data || data.length === 0) return;\n\n this.svg.selectAll('.value').data(data).enter().append('text')\n .attr('class', 'value')\n .attr('x', (d) => {return this.x(d.x)})\n .attr('y', (d) => {if (d.y === 0) return; return this.y(d.y) - this.textPaddingV})\n .attr('fill', this.theme.value)\n .style('text-anchor', 'middle')\n .style('font-size', 12)\n .text((d) => {return this.props.valueLabelTransform(d.y)})\n\n }", "function createXAxis() {\n return d3.svg.axis().scale(that.x).orient('bottom').ticks(chart.xAxis.tickCount);\n }", "function createXAxis() {\n return d3.svg.axis().scale(that.x).orient('bottom').ticks(chart.xAxis.tickCount);\n }", "function nodePosX(d) {\n return nodeCenters[d.group].x;\n }", "function x(d) { return d.xVal; }", "static get X() {\n return [\n [0, 1],\n [1, 0]\n ];\n }", "function xlabelChange(clickedAxis) \n {\n\t\t\t\td3.selectAll(\".xaxisText\")\n\t\t\t\t\t.filter(\".xactive\")\n\t\t\t\t\t.classed(\"xactive\", false)\t\n\t\t\t\t\t.classed(\"xinactive\", true);\n\t\t\t\tclickedAxis.classed(\"xinactive\", false).classed(\"xactive\", true);\n\n\t\t\t}", "function configurePointLabels(group1, xScale, yScale) {\r\n\t\t//TODO make this nicer\r\n\t\tgroup1.append(\"text\")\r\n\t\t\t.attr(\"x\", function(d) {\r\n\t\t\t\treturn xScale(d.data[d.config.xAxis]);\r\n\t\t\t})\r\n\t\t\t.attr(\"y\", function(d) {\r\n\t\t\t\treturn yScale(d.data[d.config.yAxis]) - 10;\r\n\t\t\t})\r\n\t\t\t.style(\"font-family\", \"sans-serif\")\r\n\t\t\t.style(\"font-size\", \"10px\")\r\n\t\t\t.style(\"text-anchor\", \"middle\")\r\n\t\t\t.text(function(d) {\r\n\t\t\t\tif (d.config.pointLabel != -1) {\r\n\t\t\t\t\treturn d.data[d.config.pointLabel];\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn \"3\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}", "stringX() {return this.x - 0.5*this.r/2;}", "get x() {\n return this._x / this.scale;\n }", "configureLabels() {\n this.label\n .attr(\"class\", \"lgv-label\")\n .attr(\"data-node-label\", d => this.extractLabel(d))\n .attr(\"data-node-depth\", d => d.depth)\n .attr(\"data-node-children\", d => d.children ? true : false)\n .attr(\"x\", d => d.x)\n .attr(\"y\", d => d.children ? (d.y - (d.r * 0.9)) : d.y)\n .text(d => this.extractLabel(d));\n }", "function printLabelY(labelledObject) {\n console.log(labelledObject.label);\n}", "function getXPixel(val) {\n return ((can.width() - xPadding) / data.values.length) * val + (xPadding * 1.5);\n }", "function predictTooltipLeft(el) {\n var left = el.offsetLeft;\n var width = el.offsetWidth;\n\n while (el.offsetParent) {\n el = el.offsetParent;\n left += el.offsetLeft;\n }\n return (left - width) - (window.pageXOffset);\n }", "addTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = this.round(new JQX.Utilities.BigNumber(that._range).divide(ticksFrequency)),\n ticksDistance = trackLength / tickscount,\n min = new JQX.Utilities.BigNumber(that._drawMin),\n max = new JQX.Utilities.BigNumber(that._drawMax);\n\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n second = ticksFrequency.add(first.subtract(first.mod(ticksFrequency)));\n distanceModifier = second.subtract(first);\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = first.subtract(first.mod(ticksFrequency));\n distanceModifier = first.subtract(second);\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier.divide(ticksFrequency).multiply(ticksDistance);\n\n if (second.compare(that.max) !== 0 && distanceFromFirstToSecond.compare(trackLength) < 0) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = distanceFromFirstToSecond.compare(firstLabelSize) > 0;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n if (that.mode !== 'date') {\n ticks += this.addMinorTicks(normalLayout);\n }\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "function getTickLabelUV(ax) {\n var ticklabelposition = ax.ticklabelposition || '';\n var has = function (str) {\n return ticklabelposition.indexOf(str) !== -1;\n };\n var isTop = has('top');\n var isLeft = has('left');\n var isRight = has('right');\n var isBottom = has('bottom');\n var isInside = has('inside');\n var isAligned = isBottom || isLeft || isTop || isRight;\n\n // early return\n if (!isAligned && !isInside) return [0, 0];\n var side = ax.side;\n var u = isAligned ? (ax.tickwidth || 0) / 2 : 0;\n var v = TEXTPAD;\n var fontSize = ax.tickfont ? ax.tickfont.size : 12;\n if (isBottom || isTop) {\n u += fontSize * CAP_SHIFT;\n v += (ax.linewidth || 0) / 2;\n }\n if (isLeft || isRight) {\n u += (ax.linewidth || 0) / 2;\n v += TEXTPAD;\n }\n if (isInside && side === 'top') {\n v -= fontSize * (1 - CAP_SHIFT);\n }\n if (isLeft || isTop) u = -u;\n if (side === 'bottom' || side === 'right') v = -v;\n return [isAligned ? u : 0, isInside ? v : 0];\n}", "function xvals() {\r\n for (i = 0; i < steps; i++) { document.getElementById('xv' + i).innerHTML = (board.select('x_{' + i + '}').X()).toFixed(14); }\r\n}", "getX() {\r\n return this.x;\r\n }", "function getXPixel(val,data,graph,maxValX) {\r\n\treturn ((graph.width - xPadding) / maxValX) * val + (xPadding);\r\n}", "_xPx( xLogical ) {\n var val = this.transform.x+xLogical*this.scale.x;\n return !isFinite(val) ? 0+this.transform.x : val;\n }", "xImage() {\n return this.cos() * this.length;\n }", "getCenterX() {\n return this.x;\n }", "getCenterX() {\n return this.x;\n }", "getCenterX() {\n return this.x;\n }", "function getLabels(data){\n console.log(data)\n let labels = []\n for (let i = data.length/2-1; i >= 0; i--){\n labels.push(data[i].label);\n }\n for (let i = data.length/2; i < data.length; i++){\n labels.push(data[i].label);\n }\n return labels;\n }", "get centerX() {\n\t\t\treturn this.x;\n\t\t}", "get centerX() {\n return this.x;\n }", "function drawLabels(){\t\t\n\t\t\t/**\n\t\t\t * Construct fixed width label boxes, which can be styled easily. \n\t\t\t */\n\t\t\tvar noLabels = 0;\n\t\t\tfor(var i = 0; i < xaxis.ticks.length; ++i){\n\t\t\t\tif (xaxis.ticks[i].label) {\n\t\t\t\t\t++noLabels;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar xBoxWidth = plotWidth / noLabels;\n\t\t\tvar html = '<div style=\"font-size:smaller;color:' + options.grid.color + '\">';\n\t\t\t/**\n\t\t\t * Add xlabels.\n\t\t\t */\n\t\t\tfor(var j = 0, tick = null; j < xaxis.ticks.length; ++j){\n\t\t\t\ttick = xaxis.ticks[j];\n\t\t\t\tif(!tick.label) continue;\n\t\t\t\thtml += '<div style=\"position:absolute;top:' + (plotOffset.top + plotHeight + options.grid.labelMargin) + 'px;left:' + (plotOffset.left + tHoz(tick.v) - xBoxWidth/2) + 'px;width:' + xBoxWidth + 'px;text-align:center\" class=\"flotr-grid-label\">' + tick.label + \"</div>\";\n\t\t\t}\n\t\t\t\n\t\t\t/**\n\t\t\t * Add ylabels.\n\t\t\t */\n\t\t\tfor(var k = 0, tick = null; k < yaxis.ticks.length; ++k){\n\t\t\t\ttick = yaxis.ticks[k];\n\t\t\t\tif (!tick.label || tick.label.length == 0) continue;\n\t\t\t\thtml += '<div style=\"position:absolute;top:' + (plotOffset.top + tVert(tick.v) - labelMaxHeight/2) + 'px;left:0;width:' + labelMaxWidth + 'px;text-align:right\" class=\"flotr-grid-label\">' + tick.label + \"</div>\";\n\t\t\t}\n\t\t\thtml += '</div>';\t\t\n\t\t\ttarget.insert(html);\n\t\t}", "function adjustMouseX (mouseX) {\n return mouseX-chart1.offset-$('.kineticjs-content').offset().left;\n}", "function left_side_X(){\r\n\r\n\tvar imgd = ctx.getImageData(0,0, c.width,c.height);\r\n\t//var pix_array = imgd.data;\r\n\r\n\t//furthest right hand side value (makes the coding a little easier)\r\n\tvar x_val = c.width; \r\n\r\n\tfor(var y = 0; y < c.height; y++){\r\n\t\tfor(var x = 0; x < c.width; x++){\r\n\r\n\t\t\tvar index = (x + y * imgd.width) * 4;\r\n\r\n\t\t\tif(imgd.data[index+0] == 0 &&\r\n\t\t\t\timgd.data[index+1] == 0 &&\r\n\t\t\t\timgd.data[index+2] == 0){\r\n\r\n\t\t\t\tif(x < x_val){\r\n\t\t\t\t\tx_val = x;\r\n\t\t\t\t\t//console.log(\"(left_side_X) x_val is: \" + x_val);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} \r\n\r\n\t//console.log(\"!!!!left_side_X is: \" + x_val);\r\n\r\n\treturn x_val;\r\n\r\n}", "computeDotStacking_(data, xAxisScale) {\n const bins = {};\n // Each bin corresponds to the size of the diameter of a dot,\n // so any data points in the same bin will definitely overlap.\n const binSize = this.getDotDiameter_();\n data.forEach((datum, id) => {\n // The lower bound of the bin will be some multiple of binSize so find\n // the closest such multiple less than the datum.\n const pixelLocationX = Math.round(xAxisScale(datum));\n const lowerBound = pixelLocationX - (pixelLocationX % binSize);\n const binMid = lowerBound + binSize / 2;\n if (!bins[binMid]) {\n bins[binMid] = [];\n }\n bins[binMid].push({\n datum,\n id,\n });\n });\n const newPositions = [];\n // Give each value an offset so that they do not overlap.\n Object.values(bins).forEach(bin => {\n const binSize = bin.length;\n let stackOffset = - Math.floor(binSize / 2);\n if (stackOffset === -0) {\n stackOffset = 0;\n }\n bin.forEach(({ datum, id }) => {\n newPositions.push({\n x: datum,\n stackOffset: stackOffset % this.maxDotStacking_,\n id,\n });\n stackOffset++;\n });\n });\n return newPositions;\n }", "get_global_mouse_x(mouse_event) {\n const scale = this.get_empirical_scale();\n const annbox = jquery_default()(\"#\" + this.config[\"annbox_id\"]);\n const raw = (mouse_event.pageX - annbox.offset().left + annbox.scrollLeft())/scale;\n // return Math.round(raw);\n return raw;\n }", "function getX(rawX) {\n return (rawX + maxWidth) % maxWidth\n}" ]
[ "0.72030365", "0.7129162", "0.64457476", "0.6408409", "0.63157684", "0.6233945", "0.61558497", "0.61423355", "0.6127629", "0.597459", "0.5899964", "0.5838808", "0.57775325", "0.5777112", "0.57612383", "0.5754495", "0.5706438", "0.56695443", "0.56623083", "0.5634547", "0.5630571", "0.5604581", "0.556894", "0.5559815", "0.5559815", "0.5559815", "0.55231416", "0.5498395", "0.5498352", "0.54965085", "0.549258", "0.5485953", "0.5475968", "0.5475189", "0.5426781", "0.54180515", "0.54163665", "0.54157305", "0.5409448", "0.5394994", "0.53933865", "0.5372907", "0.5364793", "0.5360059", "0.53442883", "0.534257", "0.5342406", "0.5341334", "0.5337263", "0.531566", "0.53014445", "0.52840227", "0.5282603", "0.5282603", "0.5269254", "0.52661425", "0.52630943", "0.52500117", "0.5237707", "0.52369416", "0.52262753", "0.5216942", "0.5216149", "0.521482", "0.5206364", "0.5199403", "0.5184338", "0.5178619", "0.51668805", "0.51668805", "0.5159359", "0.51585144", "0.51560795", "0.5143533", "0.5141263", "0.5139633", "0.51391184", "0.5138698", "0.51372975", "0.51318973", "0.5125067", "0.51194865", "0.5118165", "0.51146716", "0.5114331", "0.51110977", "0.5109154", "0.5106604", "0.5093469", "0.5093469", "0.5093469", "0.5079396", "0.5070129", "0.5070081", "0.50597817", "0.5051494", "0.5036464", "0.5032341", "0.5028085", "0.50236917" ]
0.64515316
2
calculate coordinate on the bezier curve
function getXofBezier(d, ax, by, t, y){ var a = d.source; var b = d.target; var x = b.x; var tmpWidth = d.width / 2; /*var tmpWidth = 100; var obj = d3.select("nodeLabel" + b.id) .attr("id", function(d){ tmpWidth = d.width / 2; })*/ var Ax = ((1 - t) * b.x) + (t * b.x); var Ay = ((1 - t) * b.y) + (t * by); var Bx = ((1 - t) * b.x) + (t * ax); var By = ((1 - t) * by) + (t * a.y); var Cx = ((1 - t) * ax) + (t * a.x); var Cy = ((1 - t) * a.y) + (t * a.y); var Dx = ((1 - t) * Ax ) + (t * Bx); var Dy = ((1 - t) * Ay ) + (t * By); var Ex = ((1 - t) * Bx ) + (t * Cx); var Ey = ((1 - t) * By ) + (t * Cy); var Px = ((1 - t) * Dx ) + (t * Ex); var Py = ((1 - t) * Dy ) + (t * Ey); d.arrow.y = Py; d.arrow.x = Px; if (Py < y || Math.abs(Px - x) > tmpWidth){ return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBezierCoordinate_(t, c1, c2) {\n // Special case start and end.\n if (t === 0 || t === 1) {\n return t;\n }\n\n // Step one - from 4 points to 3\n var ic0 = t * c1;\n var ic1 = c1 + t * (c2 - c1);\n var ic2 = c2 + t * (1 - c2);\n\n // Step two - from 3 points to 2\n ic0 += t * (ic1 - ic0);\n ic1 += t * (ic2 - ic1);\n\n // Final step - last point\n return ic0 + t * (ic1 - ic0);\n}", "function bezier_x_der(t) { return Cx + t * (2*Bx + 3*Ax * t); }", "function bezier(u, p0, p1, p2, p3) {\n\n return Math.pow(u, 3) * (p3 + 3 * (p1 - p2) - p0)\n + 3 * Math.pow(u, 2) * (p0 - 2 * p1 + p2)\n + 3 * u * (p1 - p0) + p0;\n}", "function bezier(u, p0, p1, p2, p3) {\n\n return Math.pow(u, 3) * (p3 + 3 * (p1 - p2) - p0)\n + 3 * Math.pow(u, 2) * (p0 - 2 * p1 + p2)\n + 3 * u * (p1 - p0) + p0;\n}", "function _bezierXder(t) { return Cx + t * (2*Bx + 3*Ax * t); }", "function bezier() {\n\n ctx = this;\n ctx.lineWidth = this.curve_thickness;\n ctx.strokeStyle = this.bezier_color;\n /**check for correct number of arguments*/\n if (arguments.length % 2 != 0 || arguments.length < 4) {\n throw \"Incorrect number of points \" + arguments.length;\n }\n\n //transform initial arguments into an {Array} of [x,y] coordinates\n var initialPoints = [];\n for (var i = 0; i < arguments.length; i = i + 2) {\n initialPoints.push([arguments[i], arguments[i + 1]]);\n }\n\n function distance(a, b) {\n return Math.sqrt(Math.pow(a[0] - b[0], 2) + Math.pow(a[1] - b[1], 2));\n }\n\n /**Computes the drawing/support points for the Bezier curve*/\n function computeSupportPoints(points) {\n\n /**Computes factorial*/\n function fact(k) {\n if (k == 0 || k == 1) {\n return 1;\n } else {\n return k * fact(k - 1);\n }\n }\n\n /**Computes Bernstain\n *@param {Integer} i - the i-th index\n *@param {Integer} n - the total number of points\n *@param {Number} t - the value of parameter t , between 0 and 1\n **/\n function B(i, n, t) {\n //if(n < i) throw \"Wrong\";\n return fact(n) / (fact(i) * fact(n - i)) * Math.pow(t, i) * Math.pow(1 - t, n - i);\n }\n\n\n /**Computes a point's coordinates for a value of t\n *@param {Number} t - a value between o and 1\n *@param {Array} points - an {Array} of [x,y] coodinates. The initial points\n **/\n function P(t, points) {\n var r = [0, 0];\n var n = points.length - 1;\n for (var i = 0; i <= n; i++) {\n r[0] += points[i][0] * B(i, n, t);\n r[1] += points[i][1] * B(i, n, t);\n }\n return r;\n }\n\n\n /**Compute the incremental step*/\n var tLength = 0;\n for (var i = 0; i < points.length - 1; i++) {\n tLength += distance(points[i], points[i + 1]);\n }\n var step = 1 / tLength;\n\n //compute the support points\n var temp = [];\n for (var t = 0; t <= 1; t = t + step) {\n var p = P(t, points);\n temp.push(p);\n }\n return temp;\n }\n\n /**Generic paint curve method*/\n function paintCurve(points) {\n ctx.save();\n\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (var i = 1; i < points.length; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n ctx.stroke();\n ctx.restore();\n }\n\n var supportPoints = computeSupportPoints(initialPoints);\n paintCurve(supportPoints);\n}", "function Bezier(idx, p0, p1, p2, p3){\n var cX = 3 * (p1.x - p0.x);\n var bX = 3 * (p2.x - p1.x) - cX;\n var aX = p3.x - p0.x - cX - bX;\n\n var cY = 3 * (p1.y - p0.y);\n var bY = 3 * (p2.y - p1.y) - cY;\n var aY = p3.y - p0.y - cY - bY;\n //x(t) = axt3 + bxt2 + cxt + x0\n this.x = (aX * Math.pow(idx, 3)) + (bX * Math.pow(idx, 2)) + (cX * idx) + p0.x;\n this.y = (aY * Math.pow(idx, 3)) + (bY * Math.pow(idx, 2)) + (cY * idx) + p0.y;\n \n}", "function bezier(p1, p2, p3, p4, t) {\n\n var a = 1 - t,\n b = a * a * a,\n c = t * t * t;\n\n return point2D(Math.round(b * p1.x + 3 * t * a * a * p2.x + 3 * t * t * a * p3.x + c * p4.x),\n Math.round(b * p1.y + 3 * t * a * a * p2.y + 3 * t * t * a * p3.y + c * p4.y));\n\n }", "function Bezier(startPt, endPt, startCtrlPt, endCtrlPt) {\n\tvar b;\n\tb.startPoint=startPt;\n\tb.endPoint=endPt;\n\tb.startControlPoint = startCtrlPt;\n\tb.endControlPoint = endCtrlPt;\n\tb.getCartesianAt = new function(t) {\n\t\tif (t > 1 || t < 0) { /* TODO error handler */}\n\t\tvar x = Math.pow((1 - t),3) * b.startPoint.x +\n\t\t3*t*Math.pow((1-t),2) * b.startControlPoint.x +\n\t\t3*Math.pow(t,2)*(1-t) * b.endControlPoint.x +\n\t\tpow(t,3) * b.endPoint.x;\n\t\t\n\t\tvar y = Math.pow((1 - t),3) * b.startPoint.y +\n\t\t3*t*Math.pow((1-t),2) * b.startControlPoint.y +\n\t\t3*Math.pow(t,2)*(1-t) * b.endControlPoint.y +\n\t\tMath.pow(t,3) * b.endPoint.y;\n\t\t\n\t\treturn [x,y];\n\t}\n\treturn b;\n}", "function calculatePositionOnCurve(u,p,q,radius,position){var cu=Math.cos(u);var su=Math.sin(u);var quOverP=q/p*u;var cs=Math.cos(quOverP);position.x=radius*(2+cs)*0.5*cu;position.y=radius*(2+cs)*su*0.5;position.z=radius*Math.sin(quOverP)*0.5;}", "function wingPositionFunction(t)\n{\n var height = .25;\n\n var p0 = new THREE.Vector3(0,0,0);\n var p1 = new THREE.Vector3(0,0,1);\n\n var p2 = new THREE.Vector3(0,0,1);\n var p3 = new THREE.Vector3(1,0,1);\n\n var curve = new THREE.CubicBezierCurve3(p0, p1, p2, p3);\n\n return curve.getPoint(t);\n}", "function bezier_x_der(t) { // bezier_x derivative\n return Cx + t * (2*Bx + t * 3*Ax) + 1e-3;\n }", "function get_point_y(c) {\n\treturn 94 + c * 75;\n}", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "_coord(arr) {\n var a = arr[0], d = arr[1], b = arr[2];\n var sum, pos = [0, 0];\n sum = a + d + b;\n if (sum !== 0) {\n a /= sum;\n d /= sum;\n b /= sum;\n pos[0] = corners[0][0] * a + corners[1][0] * d + corners[2][0] * b;\n pos[1] = corners[0][1] * a + corners[1][1] * d + corners[2][1] * b;\n }\n return pos;\n }", "function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }", "function bezier(k, n, u) {\n return Math.pow(u, k) * Math.pow((1 - u), (n - k)) * combinations[n.toString()][k]\n}", "function calculate_coordinates () {\n\t }", "function Bezier1(t, startX, startY, c1X, c1Y, c2X, c2Y)\n{\n this.x = ((1 - t) * (1 - t) * startX) + (2 * (1 - t) * t * c1X) + (t * t * c2X)\n this.y = ((1 - t) * (1 - t) * startY) + (2 * (1 - t) * t * c1Y) + (t * t * c2Y)\n}", "function cubicBezier(bezier) {\r\n var mX1 = bezier[0];\r\n var mY1 = bezier[1];\r\n var mX2 = bezier[2];\r\n var mY2 = bezier[3];\r\n\r\n this.get = function(aX) {\r\n if (mX1 == mY1 && mX2 == mY2) return aX; // linear\r\n return CalcBezier(GetTForX(aX), mY1, mY2);\r\n }\r\n\r\n function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\r\n function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\r\n function C(aA1) { return 3.0 * aA1; }\r\n\r\n // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\r\n function CalcBezier(aT, aA1, aA2) {\r\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\r\n }\r\n\r\n // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\r\n function GetSlope(aT, aA1, aA2) {\r\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\r\n }\r\n\r\n function GetTForX(aX) {\r\n // Newton raphson iteration\r\n var aGuessT = aX;\r\n for (var i = 0; i < 4; ++i) {\r\n var currentSlope = GetSlope(aGuessT, mX1, mX2);\r\n if (currentSlope == 0.0) return aGuessT;\r\n var currentX = CalcBezier(aGuessT, mX1, mX2) - aX;\r\n aGuessT -= currentX / currentSlope;\r\n }\r\n return aGuessT;\r\n }\r\n}", "function bezier_curve(p0, p1, p2, p3, scale) {\n // var i2 = { x: p1.x + scale*(p1.x-p0.x), y: p1.y + scale*(p1.y-p0.y) };\n // var i3 = { x: p2.x + scale*(p2.x-p3.x), y: p2.y + scale*(p2.y-p3.y) };\n\n // var d = 'M'+p1.x+','+p1.y+' '+'C'+i2.x+','+i2.y+\" \"+i3.x+','+i3.y+\" \"+p2.x+\",\"+p2.y;\n\n let d = 'M ';\n\n // Chase's algorithm via StackOverflow\n let a1 = p2.x-p0.x;\n let a2 = (2*p0.x-5*p1.x+4*p2.x-p3.x);\n let a3 = (3*p1.x-p0.x-3*p2.x+p3.x);\n let b1 = (p2.y-p0.y);\n let b2 = (2*p0.y-5*p1.y+4*p2.y-p3.y);\n let b3 = (3*p1.y-p0.y-3*p2.y+p3.y);\n let g = 16;\n let one_over_g = 1/g;\n for (let i = 0; i < g; i++){\n let t = i * one_over_g;\n let tt = t*t;\n let ttt = tt * t;\n\n let x = 0.5 * (2*p1.x+ a1*t + a2*tt + a3*ttt);\n let y = 0.5 * (2*p1.y+ b1*t + b2*tt + b3*ttt);\n d += x+' '+y+' ';\n }\n d += p2.x+' '+p2.y+' ';\n\n return d;\n }", "function BezierT(t, startX, startY, c1X, c1Y, c2X, c2Y, endX, endY)\n{\n this.mx = (3 * (1 - t) * (1 - t) * (c1X - startX)) + ((6 * (1 - t) * t) * (c2X - c1X)) + (3 * t * t * (endX - c2X))\n this.my = (3 * (1 - t) * (1 - t) * (c1Y - startY)) + ((6 * (1 - t) * t) * (c2Y - c1Y)) + (3 * t * t * (endY - c2Y))\n}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t \t\tvar cu = Math.cos( u );\n\t \t\tvar su = Math.sin( u );\n\t \t\tvar quOverP = q / p * u;\n\t \t\tvar cs = Math.cos( quOverP );\n\n\t \t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t \t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t \t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t \t}", "function bezFunction() {\n var math = Math;\n function pointOnLine2D(x1, y1, x2, y2, x3, y3) {\n var det1 = x1 * y2 + y1 * x3 + x2 * y3 - x3 * y2 - y3 * x1 - x2 * y1;\n return det1 > -0.001 && det1 < 0.001;\n }\n function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {\n if (z1 === 0 && z2 === 0 && z3 === 0) return pointOnLine2D(x1, y1, x2, y2, x3, y3);\n var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));\n var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));\n var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));\n var diffDist;\n if (dist1 > dist2) {\n if (dist1 > dist3) diffDist = dist1 - dist2 - dist3;\n else diffDist = dist3 - dist2 - dist1;\n } else if (dist3 > dist2) diffDist = dist3 - dist2 - dist1;\n else diffDist = dist2 - dist1 - dist3;\n return diffDist > -0.0001 && diffDist < 0.0001;\n }\n var getBezierLength = function() {\n return function(pt1, pt2, pt3, pt4) {\n var curveSegments = defaultCurveSegments;\n var k;\n var i;\n var len;\n var ptCoord;\n var perc;\n var addedLength = 0;\n var ptDistance;\n var point = [];\n var lastPoint = [];\n var lengthData = bezierLengthPool.newElement();\n len = pt3.length;\n for(k = 0; k < curveSegments; k += 1){\n perc = k / (curveSegments - 1);\n ptDistance = 0;\n for(i = 0; i < len; i += 1){\n ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * pt3[i] + 3 * (1 - perc) * bmPow(perc, 2) * pt4[i] + bmPow(perc, 3) * pt2[i];\n point[i] = ptCoord;\n if (lastPoint[i] !== null) ptDistance += bmPow(point[i] - lastPoint[i], 2);\n lastPoint[i] = point[i];\n }\n if (ptDistance) {\n ptDistance = bmSqrt(ptDistance);\n addedLength += ptDistance;\n }\n lengthData.percents[k] = perc;\n lengthData.lengths[k] = addedLength;\n }\n lengthData.addedLength = addedLength;\n return lengthData;\n };\n }();\n function getSegmentsLength(shapeData) {\n var segmentsLength = segmentsLengthPool.newElement();\n var closed = shapeData.c;\n var pathV = shapeData.v;\n var pathO = shapeData.o;\n var pathI = shapeData.i;\n var i;\n var len = shapeData._length;\n var lengths = segmentsLength.lengths;\n var totalLength = 0;\n for(i = 0; i < len - 1; i += 1){\n lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);\n totalLength += lengths[i].addedLength;\n }\n if (closed && len) {\n lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);\n totalLength += lengths[i].addedLength;\n }\n segmentsLength.totalLength = totalLength;\n return segmentsLength;\n }\n function BezierData(length) {\n this.segmentLength = 0;\n this.points = new Array(length);\n }\n function PointData(partial, point) {\n this.partialLength = partial;\n this.point = point;\n }\n var buildBezierData = function() {\n var storedData = {\n };\n return function(pt1, pt2, pt3, pt4) {\n var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\\./g, 'p');\n if (!storedData[bezierName]) {\n var curveSegments = defaultCurveSegments;\n var k;\n var i;\n var len;\n var ptCoord;\n var perc;\n var addedLength = 0;\n var ptDistance;\n var point;\n var lastPoint = null;\n if (pt1.length === 2 && (pt1[0] !== pt2[0] || pt1[1] !== pt2[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt1[0] + pt3[0], pt1[1] + pt3[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt2[0] + pt4[0], pt2[1] + pt4[1])) curveSegments = 2;\n var bezierData = new BezierData(curveSegments);\n len = pt3.length;\n for(k = 0; k < curveSegments; k += 1){\n point = createSizedArray(len);\n perc = k / (curveSegments - 1);\n ptDistance = 0;\n for(i = 0; i < len; i += 1){\n ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * (pt1[i] + pt3[i]) + 3 * (1 - perc) * bmPow(perc, 2) * (pt2[i] + pt4[i]) + bmPow(perc, 3) * pt2[i];\n point[i] = ptCoord;\n if (lastPoint !== null) ptDistance += bmPow(point[i] - lastPoint[i], 2);\n }\n ptDistance = bmSqrt(ptDistance);\n addedLength += ptDistance;\n bezierData.points[k] = new PointData(ptDistance, point);\n lastPoint = point;\n }\n bezierData.segmentLength = addedLength;\n storedData[bezierName] = bezierData;\n }\n return storedData[bezierName];\n };\n }();\n function getDistancePerc(perc, bezierData) {\n var percents = bezierData.percents;\n var lengths = bezierData.lengths;\n var len = percents.length;\n var initPos = bmFloor((len - 1) * perc);\n var lengthPos = perc * bezierData.addedLength;\n var lPerc = 0;\n if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) return percents[initPos];\n var dir = lengths[initPos] > lengthPos ? -1 : 1;\n var flag = true;\n while(flag){\n if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {\n lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);\n flag = false;\n } else initPos += dir;\n if (initPos < 0 || initPos >= len - 1) {\n // FIX for TypedArrays that don't store floating point values with enough accuracy\n if (initPos === len - 1) return percents[initPos];\n flag = false;\n }\n }\n return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;\n }\n function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {\n var t1 = getDistancePerc(percent, bezierData);\n var u1 = 1 - t1;\n var ptX = math.round((u1 * u1 * u1 * pt1[0] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[0] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[0] + t1 * t1 * t1 * pt2[0]) * 1000) / 1000;\n var ptY = math.round((u1 * u1 * u1 * pt1[1] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[1] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[1] + t1 * t1 * t1 * pt2[1]) * 1000) / 1000;\n return [\n ptX,\n ptY\n ];\n }\n var bezierSegmentPoints = createTypedArray('float32', 8);\n function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {\n if (startPerc < 0) startPerc = 0;\n else if (startPerc > 1) startPerc = 1;\n var t0 = getDistancePerc(startPerc, bezierData);\n endPerc = endPerc > 1 ? 1 : endPerc;\n var t1 = getDistancePerc(endPerc, bezierData);\n var i;\n var len = pt1.length;\n var u0 = 1 - t0;\n var u1 = 1 - t1;\n var u0u0u0 = u0 * u0 * u0;\n var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase\n var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase\n var t0t0t0 = t0 * t0 * t0;\n //\n var u0u0u1 = u0 * u0 * u1;\n var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase\n var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase\n var t0t0t1 = t0 * t0 * t1;\n //\n var u0u1u1 = u0 * u1 * u1;\n var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase\n var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase\n var t0t1t1 = t0 * t1 * t1;\n //\n var u1u1u1 = u1 * u1 * u1;\n var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase\n var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase\n var t1t1t1 = t1 * t1 * t1;\n for(i = 0; i < len; i += 1){\n bezierSegmentPoints[i * 4] = math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n bezierSegmentPoints[i * 4 + 1] = math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n bezierSegmentPoints[i * 4 + 2] = math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n bezierSegmentPoints[i * 4 + 3] = math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase\n }\n return bezierSegmentPoints;\n }\n return {\n getSegmentsLength: getSegmentsLength,\n getNewSegment: getNewSegment,\n getPointInSegment: getPointInSegment,\n buildBezierData: buildBezierData,\n pointOnLine2D: pointOnLine2D,\n pointOnLine3D: pointOnLine3D\n };\n }", "function CalcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }", "function Bezier(p1,p2,p3,p4) {\n\t// defining the bezier functions in the polynomial form\n\tvar Cx = 3 * p1;\n\tvar Bx = 3 * (p3 - p1) - Cx;\n\tvar Ax = 1 - Cx - Bx;\n\n\tvar Cy = 3 * p2;\n\tvar By = 3 * (p4 - p2) - Cy;\n\tvar Ay = 1 - Cy - By;\n\n\tfunction bezier_x(t) { return t * (Cx + t * (Bx + t * Ax)); }\n\tfunction bezier_y(t) { return t * (Cy + t * (By + t * Ay)); }\n\n\t// using Newton's method to aproximate the parametric value of x for t\n\tfunction bezier_x_der(t) { return Cx + t * (2*Bx + 3*Ax * t); }\n\n\tfunction find_x_for(t) {\n\t\tvar x=t, i=0, z;\n\t\twhile (i < 5) { // making 3 iterations max\n\t\t\tz = bezier_x(x) - t;\n\t\t\tif (Math.abs(z) < 1e-3) break; // if already got close enough\n\t\t\tx = x - z/bezier_x_der(x);\n\t\t\ti++;\n\t\t}\n\t\treturn x;\n\t};\n\n\treturn function(t) {\n\t\treturn bezier_y(find_x_for(t));\n\t}\n}", "function cubicBezier(x1, y1, x2, y2) {\n function xForT(t) {\n var omt = 1-t;\n return 3 * omt * omt * t * x1 + 3 * omt * t * t * x2 + t * t * t;\n }\n\n function yForT(t) {\n var omt = 1-t;\n return 3 * omt * omt * t * y1 + 3 * omt * t * t * y2 + t * t * t;\n }\n\n function tForX(x) {\n // Binary subdivision.\n var mint = 0, maxt = 1;\n for (var i = 0; i < 30; ++i) {\n var guesst = (mint + maxt) / 2;\n var guessx = xForT(guesst);\n if (x < guessx) {\n maxt = guesst;\n } else {\n mint = guesst;\n }\n }\n return (mint + maxt) / 2;\n }\n\n return function bezierClosure(x) {\n if (x == 0) {\n return 0;\n }\n if (x == 1) {\n return 1;\n }\n return yForT(tForX(x));\n }\n}", "trace() {\n const x = this.penx, y = this.peny;\n console.log(Math.round(x * 10) / 10 + this.ox, Math.round(y * 10) / 10 + this.oy);\n // assume path\n // has begun\n this.context.moveTo(x - 5, y);\n this.context.lineTo(x + 5, y);\n this.context.moveTo(x, y + 5);\n this.context.lineTo(x, y - 5);\n this.context.moveTo(x, y);\n return {x,y};\n }", "function calcBezier (aT, aA1, aA2) {\r\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\r\n }", "function calcBezier (aT, aA1, aA2) {\r\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\r\n }", "function calcBezier (aT, aA1, aA2) {\r\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\r\n }", "function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n }", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\t\n\t\t\t\tvar cu = Math.cos( u );\n\t\t\t\tvar su = Math.sin( u );\n\t\t\t\tvar quOverP = q / p * u;\n\t\t\t\tvar cs = Math.cos( quOverP );\n\t\n\t\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\t\n\t\t\t}", "function CalcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }", "function CalcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }", "function trC(coord){\n\treturn -95 + coord*10;\n}", "function CalcBezier(aT, aA1, aA2) {\r\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\r\n }", "function calculatePositionOnCurve( u, p, q, radius, position ) {\r\n\r\n\t\t\tvar cu = Math.cos( u );\r\n\t\t\tvar su = Math.sin( u );\r\n\t\t\tvar quOverP = q / p * u;\r\n\t\t\tvar cs = Math.cos( quOverP );\r\n\r\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\r\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\r\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\r\n\r\n\t\t}", "function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }", "function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }", "function calculatePositionOnCurve( u, p, q, radius, position ) {\r\n\r\n\t\tvar cu = Math.cos( u );\r\n\t\tvar su = Math.sin( u );\r\n\t\tvar quOverP = q / p * u;\r\n\t\tvar cs = Math.cos( quOverP );\r\n\r\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\r\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\r\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\r\n\r\n\t}", "static calcBezier(aT, aA1, aA2) {\n return ((this.A(aA1, aA2) * aT + this.B(aA1, aA2)) * aT + this.C(aA1)) * aT;\n }", "function Bezier(/* p0, p1, c0, c1 */) {\n\tvar o = this;\n\tvar points = normalizeArguments(\"pppp\", arguments);\n\tvar p0 = points[0];\n\tvar p1 = points[1];\n\tvar c0 = points[2];\n\tvar c1 = points[3];\n\n\to.x0 = p0.x, o.y0 = p0.y, o.x1 = p1.x, o.y1 = p1.y, o.cx0 = c0.x, o.cy0 = c0.y, o.cx1 = c1.x, o.cy1 = c1.y;\n}", "function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n}", "function generateBezierCurve() {\n //create the position matrix, from the current position of the control points\n var controlP1 = mat4(positions[0],positions[2],positions[4],positions[6],\n positions[1],positions[3],positions[5],positions[7],\n 1,1,1,1,\n 1,1,1,1);\n\n var controlP2 = mat4(positions[6],positions[8],positions[10],positions[12],\n positions[7],positions[9],positions[11],positions[13],\n 1,1,1,1,\n 1,1,1,1);\n\n //use the math from class to generate the martix of points\n ans = mult(controlP1,bezierM);\n ans2 = mult(controlP2,bezierM);\n //push the line segments for the number of subdivisions\n for(t = 0; t <= 1; t+=(1/subdivisions))\n {\n //use the parametric equations to generate the correct point\n xt = ans[0][0]*Math.pow(t,3) + ans[0][1]*Math.pow(t,2) + ans[0][2]*t + ans[0][3];\n //Push x-coordinate for 2D drawing\n bezierPos.push(xt);\n yt = ans[1][0]*Math.pow(t,3) + ans[1][1]*Math.pow(t,2) + ans[1][2]*t + ans[1][3];\n //Push y-coordinate for 2D drawing\n bezierPos.push(yt);\n\n //Handle the 2nd bezier curve\n xt2 = ans2[0][0]*Math.pow(t,3) + ans2[0][1]*Math.pow(t,2) + ans2[0][2]*t + ans2[0][3];\n bezierPos2.push(xt2);\n yt2 = ans2[1][0]*Math.pow(t,3) + ans2[1][1]*Math.pow(t,2) + ans2[1][2]*t + ans2[1][3];\n bezierPos2.push(yt2);\n }\n //hard code in the last point to draw, otherwise the end point won't be connected.\n bezierPos.push(positions[6]);\n bezierPos.push(positions[7]);\n bezierPos2.push(positions[12]);\n bezierPos2.push(positions[13]); \n}", "function calculatePositionOnCurve(u, p, q, radius, position) {\n\t\t\tvar cu = Math.cos(u);\n\t\t\tvar su = Math.sin(u);\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos(quOverP);\n\t\t\tposition.x = radius * (2 + cs) * 0.5 * cu;\n\t\t\tposition.y = radius * (2 + cs) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin(quOverP) * 0.5;\n\t\t}", "function CalcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\tvar cu = Math.cos( u );\n\t\tvar su = Math.sin( u );\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos( quOverP );\n\n\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tvar cu = Math.cos( u );\n\t\t\tvar su = Math.sin( u );\n\t\t\tvar quOverP = q / p * u;\n\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "function bezierProgress(time, x1, y1, x2, y2) {\n return getBezierCoordinate_(solvePositionFromXValue_(time, x1, x2), y1, y2);\n}", "function calculatePositionOnCurve(u, p, q, radius, position) {\n var cu = Math.cos(u);\n var su = Math.sin(u);\n var quOverP = q / p * u;\n var cs = Math.cos(quOverP);\n position.x = radius * (2 + cs) * 0.5 * cu;\n position.y = radius * (2 + cs) * su * 0.5;\n position.z = radius * Math.sin(quOverP) * 0.5;\n }", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\t\tvar cu = Math.cos( u );\n\t\t\t\tvar su = Math.sin( u );\n\t\t\t\tvar quOverP = q / p * u;\n\t\t\t\tvar cs = Math.cos( quOverP );\n\n\t\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t\t}", "function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}", "function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}", "function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}", "function PointOnCurve(p0 : Vector3, p1 : Vector3, p2 : Vector3, p3 : Vector3, t : float, protector : Vector3)\n{\n\tvar result : Vector3;\n\t\n \n\tvar t0 : float = ((-t + 2f) * t - 1f) * t * 0.5f;\n\tvar t1 : float = (((3f * t - 5f) * t) * t + 2f) * 0.5f;\n\tvar t2 : float = ((-3f * t + 4f) * t + 1f) * t * 0.5f;\n\tvar t3 : float = ((t - 1f) * t * t) * 0.5f;\n \n \t\n\tresult.x = p0.x * t0 + p1.x * t1 + p2.x * t2 + p3.x * t3;\n\tresult.y = p0.y * t0 + p1.y * t1 + p2.y * t2 + p3.y * t3;\n\tresult.z = p0.z * t0 + p1.z * t1 + p2.z * t2 + p3.z * t3;\n \tif(result.x==0&&result.z==0){\n \t\tresult.x = protector.x;\n \t\tresult.z = protector.z;\n \t\t////Debug.Log(\"<color=red>Fatal error:</color> n:\" + n + \"; i:\" + i + \"; indice: \" + indice);\n \t}\n\treturn result;\n}", "function calculatePositionOnCurve(u, p, q, radius, position) {\n\n\t\tvar cu = Math.cos(u);\n\t\tvar su = Math.sin(u);\n\t\tvar quOverP = q / p * u;\n\t\tvar cs = Math.cos(quOverP);\n\n\t\tposition.x = radius * (2 + cs) * 0.5 * cu;\n\t\tposition.y = radius * (2 + cs) * su * 0.5;\n\t\tposition.z = radius * Math.sin(quOverP) * 0.5;\n\t}", "function Bezier(b1, b2, xDist)\n{\n this.rad = Math.atan(b1.point.mY / b1.point.mX)\n this.b2 = b2\n this.b1 = b1\n\n this.dist = Math.sqrt(((b2.x - b1.x) * (b2.x - b1.x)) + ((b2.y - b1.y) * (b2.y - b1.y)))\n this.curve = { rad: this.rad, dist: this.dist, cDist: xDist + this.dist }\n}", "function bezier_initial_part(bezier, t) {\n var b = bezier;\n var u = 1 - t;\n var uu = u * u;\n var uuu = uu * u;\n var tt = t * t;\n var ttt = tt * t;\n var P1 = b.P1.slice();\n var P2 = [u * b.P1[0] + t * b.P2[0],\n u * b.P1[1] + t * b.P2[1]];\n var P3 = [uu * b.P1[0] + 2 * t * u * b.P2[0] + tt * b.P3[0],\n uu * b.P1[1] + 2 * t * u * b.P2[1] + tt * b.P3[1]];\n var P4 = [uuu * b.P1[0] + 3 * t * uu * b.P2[0] + 3 * tt * u * b.P3[0] + ttt * b.P4[0],\n uuu * b.P1[1] + 3 * t * uu * b.P2[1] + 3 * tt * u * b.P3[1] + ttt * b.P4[1]];\n return {\n P1: P1,\n P2: P2,\n P3: P3,\n P4: P4\n };\n}", "static DistancePointBezier() {}", "function curveIncrement(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y, t) {\n\tvar v1x = -3*p0x + 9*p1x - 9*p2x + 3*p3x;\n\tvar v1y = -3*p0y + 9*p1y - 9*p2y + 3*p3y;\n\tvar v2x = 6*p0x - 12*p1x + 6*p2x;\n\tvar v2y = 6*p0y - 12*p1y + 6*p2y;\n\tvar v3x = -3*p0x + 3*p1x;\n\tvar v3y = -3*p0y + 3*p1y;\n\n\tvar x = t*t*v1x + t*v2x + v3x;\n\tvar y = t*t*v1y + t*v2y + v3y;\n\tvar length = Math.sqrt(x*x + y*y);\n\treturn length;\n}", "function findPolygonPointsCorrectPosition(line) {\n var lengthOfCathetusFirstTriangle = Math.sqrt(line.getLength() * line.getLength() - line.getPoints().firstPoint.getRadius() * line.getPoints().firstPoint.getRadius());\n var lengthOfCathetusSecondTriangle = Math.sqrt(line.getLength() * line.getLength() - line.getPoints().secondPoint.getRadius() * line.getPoints().secondPoint.getRadius());\n var ya, yb, xa, xb, ya2, yb2, xa2, xb2;\n var center = {\n x: line.getPoints().firstPoint.getPosition().x - svgOffset.left,\n y: line.getPoints().firstPoint.getPosition().y - svgOffset.top\n };\n var point = {\n x: line.getPoints().secondPoint.getPosition().x - svgOffset.left,\n y: line.getPoints().secondPoint.getPosition().y - svgOffset.top\n };\n var result = {\n xa: null,\n xb: null,\n ya: null,\n yb: null,\n xa2: null,\n xb2: null,\n ya2: null,\n yb2: null\n };\n var e = center.x - point.x;\n var c = center.y - point.y;\n var q = (lengthOfCathetusFirstTriangle * lengthOfCathetusFirstTriangle - line.getPoints().firstPoint.getRadius() * line.getPoints().firstPoint.getRadius() + center.y * center.y - point.y * point.y + center.x * center.x - point.x * point.x) / 2;\n var A = c * c + e * e;\n var B = (center.x * e * c - c * q - center.y * e * e) * 2;\n var C = center.x * center.x * e * e - 2 * center.x * e * q + q * q + center.y * center.y * e * e - line.getPoints().firstPoint.getRadius() * line.getPoints().firstPoint.getRadius() * e * e;\n var e2 = point.x - center.x;\n var c2 = point.y - center.y;\n var q2 = (lengthOfCathetusSecondTriangle * lengthOfCathetusSecondTriangle - line.getPoints().secondPoint.getRadius() * line.getPoints().secondPoint.getRadius() + point.y * point.y - center.y * center.y + point.x * point.x - center.x * center.x) / 2;\n var A2 = c2 * c2 + e2 * e2;\n var B2 = (point.x * e2 * c2 - c2 * q2 - point.y * e2 * e2) * 2;\n var C2 = point.x * point.x * e2 * e2 - 2 * point.x * e2 * q2 + q2 * q2 + point.y * point.y * e2 * e2 - line.getPoints().secondPoint.getRadius() * line.getPoints().secondPoint.getRadius() * e2 * e2;\n\n result.ya = (Math.sqrt(B * B - 4 * A * C) - B) / (2 * A);\n result.yb = (-Math.sqrt(B * B - 4 * A * C) - B) / (2 * A);\n result.xa = (q - result.ya * c) / e;\n result.xb = (q - result.yb * c) / e;\n result.ya2 = (Math.sqrt(B2 * B2 - 4 * A2 * C2) - B2) / (2 * A2);\n result.yb2 = (-Math.sqrt(B2 * B2 - 4 * A2 * C2) - B2) / (2 * A2);\n result.xa2 = (q2 - result.ya2 * c2) / e2;\n result.xb2 = (q2 - result.yb2 * c2) / e2;\n\n return result;\n}", "calculatePositionOnCurve (u, position) {\n var cu = Math.cos(u);\n var su = Math.sin(u);\n var quOverP = this.parameters.q / this.parameters.p * u;\n var cs = Math.cos(quOverP);\n\n position.x = this.parameters.radius * ( 2 + cs ) * 0.5 * cu;\n position.y = this.parameters.radius * ( 2 + cs ) * su * 0.5;\n position.z = this.parameters.radius * Math.sin( quOverP ) * 0.5;\n }", "function _f(x, y) {\n return (g.tx - x) * (g.tx - x) + (g.ty - y) * (g.ty - y);\n}", "function punti_cerchio_bezier(r){\n var c = [[0,1,0],[1.6,1,0],[1.6,-1.5,0],[0,-1.5,0],[-1.6,-1.5,0],[-1.6,1,0],[0,1,0]];\n for(var i=0;i<c.length;i++)\n for(var k=0;k<c[i].length;k++)\n c[i][k] = c[i][k]*r;\n return c;\n}", "getPosition(u, controlPoints){\n var punto = new Point(0, 0, 0);\n\n for (var i = 0; i < controlPoints.length; i++){\n punto.x += this.basis[i](u)*controlPoints[i].x;\n punto.y += this.basis[i](u)*controlPoints[i].y;\n punto.z += this.basis[i](u)*controlPoints[i].z;\n }\n return punto;\n }", "Paraboloid(){\n\t\tlet parab = Math.pow(this.x,2) + Math.pow(this.y, 2); \n\t\treturn parab; \n\t}", "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}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tconst cu = Math.cos( u );\n\t\t\tconst su = Math.sin( u );\n\t\t\tconst quOverP = q / p * u;\n\t\t\tconst cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}", "function calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\t\tconst cu = Math.cos( u );\n\t\t\t\tconst su = Math.sin( u );\n\t\t\t\tconst quOverP = q / p * u;\n\t\t\t\tconst cs = Math.cos( quOverP );\n\n\t\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t\t}", "function calculatePoint(){\n var M = 40;\n var L = 3;\n var startPoint = vec2(115, 121);\n\n var currPoint_x = startPoint[0];\n var currPoint_y = startPoint[1];\n var nextPoint_x = startPoint[0];\n var nextPoint_y = startPoint[1];\n\n points = [];\n for( var i = 0; points.length < numberPoints; i++){\n nextPoint_x = M * (1 + 2*L) - currPoint_y + Math.abs(currPoint_x - L * M);\n nextPoint_y = currPoint_x;\n\n // to normalize this I think need to know the max value of x,y\n // instead of /canvas.width or /canvas.height\n points.push(vec2(nextPoint_x / canvas.width, nextPoint_y / canvas.height));\n // points.push(vec2(nextPoint_x, nextPoint_y));\n currPoint_x = nextPoint_x;\n currPoint_y = nextPoint_y;\n // console.log(points[i]);\n }\n}" ]
[ "0.71968454", "0.7118496", "0.7062146", "0.70015705", "0.68523693", "0.6840736", "0.67959577", "0.67570305", "0.664707", "0.652432", "0.6464292", "0.6379293", "0.63783765", "0.6375702", "0.6375702", "0.6375702", "0.6375702", "0.6375702", "0.6375702", "0.6375702", "0.63476676", "0.63211626", "0.6291325", "0.62796426", "0.6265186", "0.6230428", "0.6220872", "0.6212697", "0.6176785", "0.61594343", "0.6124386", "0.6111381", "0.6110291", "0.60805076", "0.60791385", "0.60791385", "0.60791385", "0.60734713", "0.6071834", "0.6067884", "0.6067884", "0.6051527", "0.60498965", "0.6042079", "0.6040662", "0.6040662", "0.60405284", "0.6039882", "0.60328203", "0.602156", "0.60102177", "0.600963", "0.60077083", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5986295", "0.5985348", "0.5985348", "0.5985348", "0.5985348", "0.5985348", "0.5985348", "0.5985348", "0.5985348", "0.5982677", "0.5981798", "0.5973858", "0.5961767", "0.5961767", "0.5961767", "0.59582305", "0.5940971", "0.5933802", "0.5926416", "0.5917833", "0.5902133", "0.5892247", "0.5889783", "0.5879054", "0.58736837", "0.58638126", "0.5863017", "0.58552265", "0.58514565", "0.58216995", "0.57999545" ]
0.6212585
28
compute the rotate slope of arrow
function getArrowAngle(d, ax, by, t){ var a = d.source; var b = d.target; var Ax = ((1 - t) * b.x) + (t * b.x); var Ay = ((1 - t) * b.y) + (t * by); var Bx = ((1 - t) * b.x) + (t * ax); var By = ((1 - t) * by) + (t * a.y); var Cx = ((1 - t) * ax) + (t * a.x); var Cy = ((1 - t) * a.y) + (t * a.y); var Dx = ((1 - t) * Ax ) + (t * Bx); var Dy = ((1 - t) * Ay ) + (t * By); var Ex = ((1 - t) * Bx ) + (t * Cx); var Ey = ((1 - t) * By ) + (t * Cy); var Px = ((1 - t) * Dx ) + (t * Ex); var Py = ((1 - t) * Dy ) + (t * Ey); d.slope = (d.arrow.y - Py != 0) ? (d.arrow.x - Px) / (d.arrow.y - Py) : 1; d.angle = -Math.atan(d.slope) / Math.PI * 180; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function d4_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}", "function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}", "function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}", "function d3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}", "function slope2(that,t){var h=that._x1-that._x0;return h?(3*(that._y1-that._y0)/h-t)/2:t}", "function d3_v3_svg_lineSlope(p0, p1) {\n return (p1[1] - p0[1]) / (p1[0] - p0[0]);\n}", "angle () {\n \treturn Math.atan2(this.y,this.x );\n }", "getCorrectiveRotation() {\n const slope = (this.initialPosition.top - 50) / (this.initialPosition.left - 50);\n return Math.atan(slope);\n }", "function lineAngle(line){\n return Math.atan2(line[1][1] - line[0][1], line[1][0] - line[0][0]) * 180 / Math.PI;\n }", "getRotation() {\n var x1 = this.point1.getX();\n var y1 = this.point1.getY();\n var x2 = this.point2.getX();\n var y2 = this.point2.getY();\n return Math.atan2(x2 - x1, y2 - y1);\n }", "angle() {\n return Math.atan2(this.y, this.x);\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 slope(x1, y1, x2, y2) {\n\n var dx = (x2 - x1);\n var dy = (y2 - y1);\n\n return Math.atan2(dy, dx);\n}", "function slope(x1, y1, x2, y2) {\n\n var dx = (x2 - x1);\n var dy = (y2 - y1);\n\n return Math.atan2(dy, dx);\n}", "get angle() {\n let leftAngle = FLIPPER_RESTING_ANGLE + (FLIPPER_ACTIVE_ANGLE - FLIPPER_RESTING_ANGLE) * this.angleRatio;\n return this.isLeft ? leftAngle : Math.PI - leftAngle;\n }", "getAngleOfLineBetweenPoints() {\n var xDiff = this.point2.getX() - this.point1.getX();\n var yDiff = this.point2.getY() - this.point1.getY();\n return Math.atan2(yDiff, xDiff);\n }", "function slope(a, b) {\n return (b.y - a.y) / (b.x - a.x);\n }", "function slope(a, b) {\n return (b.y - a.y) / (b.x - a.x);\n }", "function calculateSlope() {\n let x1 = 2;\n let x2 = 4;\n let firstPointY = 2 * x1 - 2;\n let secondPointY = 2 * x2 - 2;\n return (secondPointY - firstPointY) / (x2 - x1);\n}", "function slope(a, b) {\n return (b.y - a.y) / (b.x - a.x);\n }", "function slope(a, b) {\n return (b.y - a.y) / (b.x - a.x);\n }", "calcLineAngle(BC: number, AB: number, nextMark: number, currentMark: number) {\n let angleA = Math.fround(Math.asin(BC / AB) * 180 / Math.PI);\n if (nextMark > currentMark) angleA = -angleA;\n return angleA;\n }", "calculateRotationAngle(dy, dx) {\n let theta = Math.atan2(dy, dx);\n this.angle = theta;\n\n //console.log( \"Angle: \"+ this.angle);\n }", "function drawArrow(x, y, angle, legLength = 10) {\n push();\n translate(x, y);\n rotate(radians(90));\n rotate(radians(angle));\n push();\n rotate(radians(45));\n line(0, 0, legLength, 0);\n pop();\n push();\n rotate(radians(135));\n line(0, 0, legLength, 0);\n pop();\n pop();\n}", "function relativeRot(sketch){\r\n // console.log(\"Relative Rot is: \" + rotChange(sketch) / strokeLen(sketch));\r\n return rotChange(sketch) / strokeLen(sketch);\r\n }", "function calculateSlope(segment){\r\n\tvar slope = (segment.b.y - segment.a.y)/(segment.b.x - segment.a.x);\r\n\treturn slope;\r\n}", "function rotChangeHelper(sketch, stroke, j) {\r\n if (typeof sketch.pointsObj[stroke[j + 1]] === \"undefined\" ||\r\n typeof sketch.pointsObj[stroke[j]] === \"undefined\" ||\r\n typeof sketch.pointsObj[stroke[j - 1]] === undefined){\r\n return NaN;\r\n }\r\n var xDelta = sketch.pointsObj[stroke[j + 1]][\"x\"] - sketch.pointsObj[stroke[j]][\"x\"],\r\n yDelta = sketch.pointsObj[stroke[j + 1]][\"y\"] - sketch.pointsObj[stroke[j]][\"y\"],\r\n xDeltaPrev = sketch.pointsObj[stroke[j]][\"x\"] - sketch.pointsObj[stroke[j - 1]][\"x\"],\r\n yDeltaPrev = sketch.pointsObj[stroke[j]][\"y\"] - sketch.pointsObj[stroke[j - 1]][\"y\"];\r\n var subSum = angleBetweenLines(xDelta, yDelta, xDeltaPrev, yDeltaPrev);\r\n return subSum;\r\n}", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t }", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t }", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t }", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t }", "function getSlope(a, b) {\n return (b.y - a.y) / (b.x - a.x);\n}", "function translateAlong(path) {\n var l = path.getTotalLength();\n var t0 = 0;\n return function(d, i, a) {\n return function(t) {\n var p0 = path.getPointAtLength(t0 * l); //previous point\n var p = path.getPointAtLength(t * l); //current point\n var angle = Math.atan2(p.y - p0.y, p.x - p0.x) * 180 / Math.PI; //angle for tangent\n t0 = t;\n // Shifting center to center of arrow\n // xoffset and yoffset should be half the original width and height of the arrow\n var xoffset = 12,\n yoffset = 12;\n var centerX = p.x - xoffset;\n var centerY = p.y - yoffset;\n return \"translate(\" + centerX + \",\" + centerY + \")rotate(\" + angle + \" \" + xoffset + \" \" + yoffset + \")\";\n };\n };\n }", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t}", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t}", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t}", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t}", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t}", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t}", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t}", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t}", "function slope2(that, t) {\n\t var h = that._x1 - that._x0;\n\t return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n\t}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n }", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n }", "function calcSlope(a, b) {\n return ((b.y - a.y)/(b.x - a.x));\n}", "function lineRotation(){\n\tvar l0 = map(mouseX, 0, width, 10, 300);\n\tvar l1 = map(mouseY, 0, height, 10, 300);\n\n\ttranslate(width/2, height/2);\n\trotate(angle);\n\tline(0, 0, 0, l0);\n\n\ttranslate(0, l0);\n\trotate(angle);\n\tline(0, 0, 0, l1);\n\n\ttranslate(0, l1);\n\trotate(angle);\n\tline(0, 0, 0, 50);\n\n\tangle += speed;\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}", "get theta() { return Math.atan2(this.y, this.x); }", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n }", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n }", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n }", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n }", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}", "function slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}" ]
[ "0.6454321", "0.644054", "0.644054", "0.644054", "0.641223", "0.63831383", "0.6358351", "0.6326031", "0.61402464", "0.61375976", "0.61293375", "0.6111723", "0.60750264", "0.60469913", "0.60439175", "0.6031762", "0.6028233", "0.6028233", "0.602351", "0.6000093", "0.6000093", "0.5986457", "0.5973003", "0.59664583", "0.5911172", "0.5877425", "0.58533084", "0.5839686", "0.5839686", "0.5839686", "0.5839686", "0.5835233", "0.58138216", "0.58029634", "0.5802619", "0.5802619", "0.5802619", "0.5802619", "0.5802619", "0.5802619", "0.5802619", "0.5802619", "0.5802619", "0.57950354", "0.57950354", "0.57862216", "0.5784328", "0.5779831", "0.57780194", "0.5777083", "0.5777083", "0.5777083", "0.5777083", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655", "0.57711655" ]
0.67335373
0
collision detection for outside nodes
function collideOutside(d){ var r = d.width / 2 + textHeight, nx1 = d.x - r, nx2 = d.x + r, ny1 = d.y - textHeight, ny2 = d.y; return function(quad, x1, y1, x2, y2) { if (quad.point && (quad.point !== d)) { var x = d.x - quad.point.x, y = (d.y - quad.point.y), lx = Math.abs(x), ly = Math.abs(y), rx = d.width / 2 + quad.point.width / 2, ry = textHeight; if (ly >= ry || lx >= rx){ return true; } ly = (ly != 0) ? (ly - ry) / ly * 0.5 : (ly - ry) * 0.5; y *= ly; d.y = Math.max(d.y - y, textHeight); quad.point.y = Math.min(quad.point.y + y, height); } return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "detectCollision() {\n // first check edgeGroup for lanes\n let self = this;\n this.edgeGroup.children.forEach((edgeViewGroup) => {\n let edgeModel = self.edgeCollection.getModel(edgeViewGroup.modelId);\n let edgePaths = edgeViewGroup.children;\n let isColliding = false;\n\n // There are usually 3 paths, break early if we find one that is intersecting\n for (let i = 0; i < edgePaths.length; i++) {\n let currentEdgePath = edgePaths[i];\n if (this.isCollidingWithKeepoutArea(currentEdgePath)) {\n isColliding = true;\n break;\n }\n }\n\n if (isColliding) {\n edgeModel.setInvalid();\n } else {\n let sourceNodeModel = self.nodeCollection.getModel(edgeModel.sourceId);\n if (this.isInsideKeepoutArea(sourceNodeModel)) {\n edgeModel.setInvalid();\n } else {\n edgeModel.setValid();\n }\n }\n });\n }", "function checkCollision() {\n let objs = []\n globalRayCaster.set( camera.getWorldPosition(), camera.getWorldDirection() );\n currentObject.traverse(child => {\n if (child.isMesh) {\n objs.push(child)\n }\n })\n var intersections = globalRayCaster.intersectObjects( objs );\n if (intersections.length > 0) {\n if (intersections[0].distance <= 3.5)\n if (currentObject === lightSwitch)\n createLight();\n else if (currentObject === note)\n openNote();\n else if (currentObject === usb)\n grabUSB();\n else if (currentObject === gun)\n grabGun();\n else if (currentObject === key)\n gameOver();\n\n }\n}", "function collisionDetection(body1, body2){\n if(body1.x+body1.width > body2.x-cameraX && body1.x < body2.x+body2.width-cameraX && \n body1.y+body1.height > body2.y-cameraY && body1.y < body2.y+body2.height-cameraY){\n return true;\n }else{\n return false;\n }\n}", "collision () {\n }", "collide(oth) {\n return this.right > oth.left && this.left < oth.right && this.top < oth.bottom && this.bottom > oth.top\n }", "function bodyCollision() {\n\tvar headID = segments[segments.length - 1].ID;\n\tvar headTop = $(headID).position().top;\n\tvar headLeft = $(headID).position().left;\n\tvar segmentID;\n\tvar segmentTop;\n\tvar segmentLeft;\n\n\tfor (i = 0; i < segments.length - 2; i++) {\n\t\tsegmentID = segments[i].ID;\n\t\tsegmentTop = $(segmentID).position().top;\n\t\tsegmentLeft = $(segmentID).position().left;\n\t\tif ((headTop === segmentTop) && (headLeft === segmentLeft)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function checkCollision(zombie) {\nif (zombie.getBoundingClientRect().top <= 0) {\nlives--;\nreturn true;\n}\nreturn false;\n}", "function collision (px,py,pw,ph,ex,ey,ew,eh){\nreturn (Math.abs(px - ex) *2 < pw + ew) && (Math.abs(py - ey) * 2 < ph + eh);\n \n}", "checkCollisions() {\n // check for collisions with window boundaries\n if (this.pos.x > width || this.pos.x < 0 ||\n this.pos.y > height || this.pos.y < 0) {\n this.collision = true;\n }\n\n // check for collisions with all obstacles\n for (let ob of obstacles) {\n if (this.pos.x > ob.x && this.pos.x < ob.x + ob.width &&\n this.pos.y > ob.y && this.pos.y < ob.y + ob.height) {\n this.collision = true;\n break;\n }\n }\n }", "detectCollisions() {\r\n var origin = this.carGroup.position.clone();\r\n\r\n var vMax = this.carGroup.children[0].children[0].geometry.vertices.length;\r\n for (var v = 0; v < vMax; v += 1) {\r\n var localVertex = this.carGroup.children[0].children[0].geometry.vertices[v].clone();\r\n var globalVertex = localVertex.applyMatrix4(this.carGroup.children[0].children[0].matrix);\r\n var directionVector = globalVertex.sub(this.carGroup.children[0].children[0].position);\r\n\r\n var ray = new THREE.Raycaster(origin, directionVector.clone().normalize());\r\n var intersections = ray.intersectObjects(this.collidables, true);\r\n if (intersections.length > 0 &&\r\n intersections[0].distance < directionVector.length()) {\r\n console.log(\"collision\");\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "function collide(node) {\n// var r1 = 2 + (radtype ? node.pr_rad : node.evc_rad)\n var r1 = 1 + node.radius\n var nx1 = node.x - r1\n var nx2 = node.x + r1\n var ny1 = node.y - r1\n var ny2 = node.y + r1\n return function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== node)) {\n var x = node.x - quad.point.x\n var y = node.y - quad.point.y\n var l = Math.sqrt(x * x + y * y)\n// var r = radtype ? (node.pr_rad + quad.point.pr_rad) : (node.evc_rad + quad.point.evc_rad)\n var r = node.radius + quad.point.radius\n if (l < r) {\n l = (l - r) / l * 0.5\n node.x -= x *= l\n node.y -= y *= l\n quad.point.x += x\n quad.point.y += y\n }\n }\n return x1 > nx2\n || x2 < nx1\n || y1 > ny2\n || y2 < ny1\n }\n}", "function detectCollsion() {\r\n if (distance < 0) {\r\n return;\r\n }\r\n // var Leo = MeshLeoTorso.position;\r\n var originPoint = MeshLepoFullBody.position.clone();\r\n var boundingBoxVertices = MeshLepoFullBody.geometry.vertices;\r\n var boundingBoxMatrix = MeshLepoFullBody.matrix;\r\n var awardBoundArr = [];\r\n awardBoundArr.push(awardsBound);\r\n boundingBoxVertices.forEach(function(vert) {\r\n var vertClone = vert.clone().applyMatrix4(boundingBoxMatrix);\r\n // The direction vector that gives direction to the ray. Should be normalized.\r\n var direction = vertClone.sub(originPoint);\r\n if (direction) { // why is this crashing ??? \r\n var normalizedDir = direction.clone().normalize();\r\n var rayCaster = new THREE.Raycaster(originPoint,normalizedDir);\r\n var collisionObstacle = rayCaster.intersectObjects(obstacles);\r\n var collisionAward = rayCaster.intersectObjects(awardBoundArr);\r\n if (collisionObstacle && collisionObstacle.length > 0 && collisionObstacle[0].distance < direction.length()) {\r\n generateExplosion(MeshLeoTorso.position.x, MeshLeoTorso.position.y);\r\n collisionFSX.play();\r\n gameOver(false);\r\n } else if (collisionAward && collisionAward.length > 0 && collisionAward[0].distance < direction.length()) {\r\n gameOver(true);\r\n }\r\n }\r\n });\r\n}", "function collide(node) {\n var nodeID = +d3.select(node).attr('id')\n var dx = +d3.select(node).attr('cx')\n var dy = +d3.select(node).attr('cy')\n var r = +d3.select(node).attr('r'),\n nx1 = dx - r,\n nx2 = dx + r,\n ny1 = dy - r,\n ny2 = dy + r\n var colliding = false\n d3.selectAll('g').each(function(point, i) {\n var pointID = +d3.select(this).attr('id')\n var pr = +d3.select(this).attr('r')\n var px = +d3.select(this).attr('cx')\n var py = +d3.select(this).attr('cy')\n var x1 = px - pr,\n y1 = py - pr,\n x2 = px + pr,\n y2 = py + pr\n var x = dx - px,\n y = dy - py,\n l = Math.sqrt(x * x + y * y),\n rad = r + pr\n if (l < rad) {\n l = (l - rad) / l * .5\n\n if (!isFinite(l)) {\n l = 0\n }\n x *= l\n y *= l\n dx -= x\n dy -= y\n px += x\n py += y\n\n if (d3.select(this).classed('ended') && d3.select(this).attr('T') == 1) {\n d3.select(node).attr('cx', Math.max(r, Math.min(w - r, dx)))\n d3.select(this).attr('cx', Math.max(pr, Math.min(w - pr, px)))\n\n } else if (d3.select(node).classed('ended') && d3.select(node).attr('T') == 1) {\n d3.select(node).attr('cx', Math.max(r, Math.min(w - r, dx)))\n d3.select(this).attr('cx', Math.max(pr, Math.min(w - pr, px)))\n } else {\n d3.select(node).attr('cx', Math.max(r, Math.min(w - r, dx)))\n d3.select(node).attr('cy', Math.max(r, Math.min(h - r, dy)))\n d3.select(this).attr('cx', Math.max(pr, Math.min(w - pr, px)))\n d3.select(this).attr('cy', Math.max(py, Math.min(h - pr, py)))\n }\n\n\n\n }\n if (!(nx1 > x2 || nx2 < x1 || ny1 > y2 || ny2 < y1) && pointID != nodeID)\n colliding = true\n })\n return colliding\n}", "function collide (node) {\n\t\t var r = node.radius + 16,\n\t\t nx1 = node.x - r,\n\t\t nx2 = node.x + r,\n\t\t ny1 = node.y - r,\n\t\t ny2 = node.y + r;\n\t\t return function (quad, x1, y1, x2, y2) {\n\t\t if (quad.point && (quad.point !== node)) {\n\t\t var x = node.x - quad.point.x,\n\t\t y = node.y - quad.point.y,\n\t\t l = Math.sqrt(x * x + y * y),\n\t\t r = node.radius + quad.point.radius;\n\t\t if (l < r) {\n\t\t l = (l - r) / l * .5;\n\t\t node.x -= x *= l;\n\t\t node.y -= y *= l;\n\t\t quad.point.x += x;\n\t\t quad.point.y += y;\n\t\t }\n\t\t }\n\t\t return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n\t\t };\n\t\t}", "_detectCollision () {\n let doContinue = true\n app.needleSelection.getNeedles().each(d => {\n if (d.passed) return\n const mm = app.getMmByLevel(app.ctx.level)\n const fromY = d.y + constant.NEEDLE_HOLE_DY\n const toY = fromY + mm\n const thread = app.threadDS\n if (thread.cx >= d.x) {\n if (fromY <= thread.cy - thread.r && thread.cy + thread.r <= toY) { // Passed\n app.statusTextScore++\n app.ctx.level = this._calcLevelByScore(app.statusTextScore) // May Lv. Up\n d.passed = true\n } else { // Failed\n doContinue = false\n }\n }\n })\n return doContinue\n }", "function collide(node) {\n\t var r = node.radius,\n\t\t nx1 = node.x - r,\n\t\t nx2 = node.x + r,\n\t\t ny1 = node.y - r,\n\t\t ny2 = node.y + r;\n\t return function(quad, x1, y1, x2, y2) {\n\t\t if (quad.point && (quad.point !== node)) {\n\t\t var x = node.x - quad.point.x,\n\t\t\t y = node.y - quad.point.y,\n\t\t\t l = Math.sqrt(x * x + y * y),\n\t\t\t r = 0.9*(node.radius + quad.point.radius);\n\t\t if (l < r) {\n\t\t\t l = (l - r) / l * .5;\n\t\t\t node.x -= x *= l;\n\t\t\t //node.y -= y *= l;\n\t\t\t quad.point.x += x;\n\t\t\t //quad.point.y += y;\n\t\t }\n\t\t }\n\t\t return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n\t };\n\t }", "collisionDetector() {\n allEnemies.forEach(function (enemy){\n if (player.x < enemy.x + 80 &&\n player.x + 80 > enemy.x &&\n player.y < enemy.y + 60 &&\n 60 + player.y > enemy.y) {\n collision();\n }\n });\n }", "function collidesWith( a, b )\n{\n return a.bottom > b.top && a.top < b.bottom;\n}", "handleCollision(climber) {\n\n // distance\n //\n // to calculate the distance between the avalanche and climber\n let d = dist(this.x, this.y, climber.x, climber.y);\n\n // dist()\n //\n // To keep track of the avalanche and the avatar are in contact\n if (d < this.width / 2 + climber.width / 2) {\n // this is to push the climber down\n climber.vy += 2;\n\n }\n }", "checkCollision(that) {\n\t\tif (that.state == \"LIVE\") {\n\t\t\tthat.parts.forEach( part => {\n\t\t\t\tconst dis = dist(part.x, part.y, this.x, this.y)\n\t\t\t\t// console.log(dis)\n\t\t\t\tif (dis < 20) {\n\t\t\t\t\tthis.state = 'DEAD'\n\t\t\t\t\treturn true\n\t\t\t\t} \n\t\t\t})\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\n\t\t\n\t}", "function collide(node) {\n\t var r = node.radius,\n\t\tnx1 = node.x - r,\n\t\tnx2 = node.x + r,\n\t\tny1 = node.y - r,\n\t\tny2 = node.y + r;\n\t return function(quad, x1, y1, x2, y2) {\n\t\tif (quad.point && (quad.point !== node)) {\n\t\t var x = node.x - quad.point.x,\n\t\t\ty = node.y - quad.point.y,\n\t\t\tl = Math.sqrt(x * x + y * y),\n\t\t\tr = 0.9*(node.radius + quad.point.radius);\n\t\t if (l < r) {\n\t\t\tl = (l - r) / l * .5;\n\t\t\t//node.x -= x *= l;\n\t\t\tnode.y -= y *= l;\n\t\t\t//quad.point.x += x;\n\t\t\tquad.point.y += y;\n\t\t }\n\t\t}\n\t\treturn x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n\t };\n\t}", "handleCollisions(){\n\t const newX = this.head.x + (this.direction.x * this.speed);\n\t const xExplorer = new Coord(newX, this.head.y);\n\t const xCollision = this.map.collidingWithWall(xExplorer);\n\t\n\t const newY = this.head.y + (this.direction.y * this.speed);\n\t const yExplorer = new Coord(this.head.x, newY);\n\t const yCollision = this.map.collidingWithWall(yExplorer);\n\t\n\t const zExplorer = new Coord(newX, newY);\n\t const zCollision = this.map.collidingWithWall(zExplorer);\n\t\n\t if (xCollision || yCollision || zCollision) {\n\t // generate reflected ray\n\t\n\t // reflect direction based on collision\n\t const reflectionDirection = new Coord(this.direction.x, this.direction.y);\n\t if (xCollision) {\n\t reflectionDirection.x = -reflectionDirection.x;\n\t } else if (yCollision) {\n\t reflectionDirection.y = -reflectionDirection.y;\n\t } else {\n\t reflectionDirection.y = -reflectionDirection.y;\n\t reflectionDirection.x = -reflectionDirection.x;\n\t }\n\t\n\t const origin = new Coord(this.head.x, this.head.y);\n\t const reflection = new Ray(\n\t origin,\n\t reflectionDirection,\n\t this.map,\n\t this.age, // advance new ray age to parent ray current age\n\t this.body.length // set new ray max length\n\t );\n\t\n\t reflection.monster = this.monster;\n\t\n\t this.map.rays.push(reflection);\n\t // console.log(this.map.rays.length);\n\t\n\t // stop expansion of current ray\n\t this.direction.x = 0;\n\t this.direction.y = 0;\n\t\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }", "function collide(node1,node2,callback) {\n if(getDistance(node1,node2) < 80){\n callback.apply(this,arguments);\n }\n}", "onCollision(otherObjects) {}", "function checkCollision(i1, i2, result) {\n\n var p1 = i1.position;\n var b1 = i1.body;\n var p2 = i2.position;\n var b2 = i2.body;\n\n if ((b1.type & 1) && (b2.type & 1)) {\n // this check is pointless for 2 circles as it's the same as the full test\n if (b1.type !== T.BODY_CIRCLE || b2.type !== T.BODY_CIRCLE) {\n vec2.add(p1, b1.boundOffset, tv1);\n vec2.add(p2, b2.boundOffset, tv2);\n var rss = b1.boundRadius + b2.boundRadius;\n if (tv1.distancesq(tv2) > rss*rss) {\n return false;\n }\n }\n }\n\n var colliding = null;\n var flipped = false;\n\n if (b1.type > b2.type) {\n \n var tmp = b2;\n b2 = b1;\n b1 = tmp;\n\n tmp = i2;\n i2 = i1;\n i1 = tmp;\n\n tmp = p2;\n p2 = p1;\n p1 = tmp;\n\n flipped = true;\n\n }\n\n if (b1.type === T.BODY_AABB) {\n if (b2.type === T.BODY_AABB) {\n colliding = AABB_AABB(i1, i2, result);\n } else if (b2.type === T.BODY_CIRCLE) {\n colliding = AABB_circle(p1, b1, p2, b2, result);\n } else if (b2.type === T.BODY_LINE_SEGMENT) {\n colliding = AABB_lineSegment(p1, b1, p2, b2, result);\n }\n } else if (b1.type === T.BODY_CIRCLE) {\n if (b2.type === T.BODY_CIRCLE) {\n colliding = circle_circle(p1, b1, p2, b2, result);\n } else if (b2.type === T.BODY_LINE_SEGMENT) {\n colliding = circle_lineSegment(i1, i2, result);\n }\n } else if (b1.type === T.BODY_LINE_SEGMENT) {\n if (b2.type === T.BODY_LINE_SEGMENT) {\n colliding = lineSegment_lineSegment(p1, b1.size, p2, b2.size, result);\n }\n }\n\n if (colliding === null) {\n console.error(\"warning: unsupported arguments to collision detection\");\n return false; \n } else {\n if (flipped) {\n result.mtv.x *= -1;\n result.mtv.y *= -1;\n }\n return colliding;\n }\n\n}", "function is_collision()\n{\n\tif (frog.lane > 6 && frog.lane < 12) {\n\t\tvar lane = frog.lane - 7;\n\t\tfor (car in cars[lane].x) {\n\t\t\tif (frog.x + frog.w >= cars[lane].x[car] &&\n\t\t\t\tfrog.x <= cars[lane].x[car] + cars[lane].w) {\n\t\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}\n\treturn 0;\n}", "function createCollisionDetector() {\n\tvar listener = new b2ContactListener();\n\n\tlistener.BeginContact = function(contact){\n\t var bodyA = contact.GetFixtureA().GetBody();\n var bodyB = contact.GetFixtureB().GetBody();\n var ropeBody = null;\n // console.log('begin contact');\n if (bodyA.GetUserData() && bodyB.GetUserData()) {\n if (bodyA.GetUserData().rope) {\n ropeBody = bodyA;\n }\n if (bodyB.GetUserData().rope) {\n ropeBody = bodyB;\n }\n if (ropeBody && bodyA.GetUserData().bodyId){\n if (bodyA.GetLinearVelocity().x != 0.0){\n // bodyA.m_fixtureList.m_isSensor = true;\n }\n }else if (ropeBody && bodyB.GetUserData().bodyId){\n if (bodyB.GetLinearVelocity().x != 0.0){\n // bodyB.m_fixtureList.m_isSensor = true;\n }\n }\n //===Check collision between barrier and striker\n if((bodyA.GetUserData().barrier && bodyB.GetUserData().bodyId) || (bodyA.GetUserData().bodyId && bodyB.GetUserData().barrier)){\n if(bodyA.GetUserData().bodyId){\n bodyA.m_fixtureList.m_isSensor = false;\n }else {\n bodyB.m_fixtureList.m_isSensor = false;\n }\n }\n }\n\t}\n listener.PreSolve = function(contact,oldManifold) {\n }\n\tlistener.PostSolve = function(contact, impulse){\n\t}\n\tlistener.EndContact = function(contact){\n var bodyA = contact.GetFixtureA().GetBody();\n var bodyB = contact.GetFixtureB().GetBody();\n var ropeBody = null;\n // console.log('begin contact');\n if (bodyA.GetUserData() && bodyB.GetUserData()) {\n if (bodyA.GetUserData().rope) {\n ropeBody = bodyA;\n }\n if (bodyB.GetUserData().rope) {\n ropeBody = bodyB;\n }\n if (ropeBody && bodyA.GetUserData().bodyId){\n bodyA.m_fixtureList.m_isSensor = false;\n // console.log('m_isSensor = false');\n }else if (ropeBody && bodyB.GetUserData().bodyId){\n bodyB.m_fixtureList.m_isSensor = false;\n // console.log('m_isSensor = false');\n }\n }\n\t}\n\n\treturn listener;\n}", "check_collision() {\n const rtx = this.x + 4;\n const rty = this.y + 59;\n const rpx = player.x + 31;\n const rpy = player.y + 57;\n if (rtx < rpx + player.width - 5 &&\n rpx < rtx + this.width - 5 &&\n rty < rpy + player.height - 15 &&\n rpy < rty + this.height - 15) {\n // Reset the game when collision happens\n allEnemies = [new Enemy(), new Enemy(), new Enemy()];\n player = new Player();\n }\n }", "collisionEdge(){\n if(this.y - this.r < 0 || this.y + this.r > height)\n return true;\n return false;\n }", "function collide(node) {\n var r = node.radius + 16,\n nx1 = node.x - r,\n nx2 = node.x + r,\n ny1 = node.y - r,\n ny2 = node.y + r;\n return function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== node)) {\n var x = node.x - quad.point.x,\n y = node.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = node.radius + quad.point.radius;\n if (l < r) {\n l = (l - r) / l * .5;\n node.x -= x *= l;\n node.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n };\n }", "narrowDetection(posx1, posy1, posx2, posy2) {\n let circle1 = {radius: 10, x: posx1, y: posy1};\n let circle2 = {radius: 10, x: posx2, y: posy2};\n\n let dx = circle1.x - circle2.x;\n let dy = circle1.y - circle2.y;\n let distance = Math.sqrt(dx * dx + dy * dy);\n\n if (distance < circle1.radius + circle2.radius) {\n // collision detected!\n }\n }", "function CollisionCalculatorC2C(o1,o2) {\n //console.log(o1,o2);\n var dist = Math.sqrt( Math.pow((o2.x-o1.x),2)+Math.pow((o2.y-o1.y),2));\n var totalR = o2.r + o1.r;\n if(dist>totalR){\n return false;\n }\n /*\n var colPoint = new Point( o2.x + (o1.position.x-o2.position.x)*o2.r/(o2.r+o1.r),o2.y + (o1.position.y-o2.position.y)*o2.r/(o2.r+o1.r);\n */\n\n var region = \"\";\n if (o1.y < o2.y - Math.abs(o2.height/2)) {\n\n //If it is, we need to check whether it's in the\n //top left, top center or top right\n if (o1.x < o2.x - 1 - Math.abs(o2.width/2)) {\n region = \"topLeft\";\n } else if (o1.x > o2.x + 1 + Math.abs(o2.width/2)) {\n region = \"topRight\";\n } else {\n region = \"topMiddle\";\n }\n }\n\n else if ((o1.y > o2.y + Math.abs(o2.height/2))) {\n\n //If it is, we need to check whether it's in the bottom left,\n //bottom center, or bottom right\n if (o1.x < o2.x - 1 - Math.abs(o2.width/2)) {\n region = \"bottomLeft\";\n } else if (o1.x > o2.x + 1 + Math.abs(o2.width/2)) {\n region = \"bottomRight\";\n } else {\n region = \"bottomMiddle\";\n }\n } \n else {\n if (o1.x < o2.x - Math.abs(o2.width/2)) {\n region = \"leftMiddle\";\n } else {\n region = \"rightMiddle\";\n }\n }\n\n //return true;\n return [true,region];\n}", "function collision (first, second){\n const w = (first.width + second.width) / 2;\n const h = (first.height + second.height) / 2;\n const dx = Math.abs(first.x - second.x);\n const dy = Math.abs(first.y - second.y);\n if (dx <= w && dy <= h){\n const wy = w * (first.y - second.y);\n const hx = h * (first.x - second.x);\n if (wy > hx){\n if (wy > -hx){\n stopUp = true;\n // console.log('collision: up');\n return true;\n } else {\n stopRight = true;\n // console.log('collision: right');\n return true;\n }\n }else{\n if (wy > -hx){\n stopLeft = true;\n // console.log('collision: left');\n return true;\n } else {\n stopDown = true;\n // console.log('collision: down');\n return true;\n };\n };\n }else{\n stopUp = false;\n stopRight = false;\n stopDown = false;\n stopLeft = false;\n return false;\n };\n}", "function hasNodeCollision(node1, node2)\n {\n if (node1.position.side != node2.position.side) return false;\n\n return Math.abs(node1.position.top - node2.position.top) < (nodeHeight);\n }", "function check_collision( objects_to_check )\n\t{\n\t\treturn false;\n\t}", "onCollision(response, other) {\n // Make all other objects solid\n return true;\n }", "onCollision(response, other) {\n // Make all other objects solid\n return true;\n }", "function checkCollision(obj1, obj2) {\n if (obj1.x > obj2.x) {\n if (obj1.y > obj2.y) {\n if (obj1.x - obj2.x < obj2.width && obj1.y - obj2.y < obj2.height) {\n if (obj1.x - obj2.x > obj1.y - obj2.y) { return 1; }\n return 2;\n }\n } else {\n if (obj1.x - obj2.x < obj2.width && obj2.y - obj1.y < obj1.height) {\n if (obj1.x - obj2.x > obj2.y - obj1.y) { return 1; }\n return 3;\n }\n }\n } else {\n if (obj1.y > obj2.y) {\n if (obj2.x - obj1.x < obj1.width && obj1.y - obj2.y < obj2.height) {\n if (obj2.x - obj1.x > obj1.y - obj2.y) { return 0; }\n return 2;\n }\n } else {\n if (obj2.x - obj1.x < obj1.width && obj2.y - obj1.y < obj1.height) {\n if (obj2.x - obj1.x > obj2.y - obj1.y) { return 0; }\n return 3;\n }\n }\n }\n return -1;\n}", "collision(inObject) {\n\n // Abort if the player isn't visible (i.e., when they are 'splodin).\n if (!this.player.isVisible || !inObject.isVisible) { return false; }\n\n // Bounding boxes.\n const left1 = this.player.xLoc;\n const left2 = inObject.xLoc;\n const right1 = left1 + this.player.pixWidth;\n const right2 = left2 + inObject.pixWidth;\n const top1 = this.player.yLoc;\n const top2 = inObject.yLoc;\n const bottom1 = top1 + this.player.pixHeight;\n const bottom2 = top2 + inObject.pixHeight;\n\n // Bounding box checks. It isn't perfect collision detection, but it's good\n // enough for government work.\n if (bottom1 < top2) {\n return false;\n }\n if (top1 > bottom2) {\n return false;\n }\n if (right1 < left2) {\n return false;\n }\n return left1 <= right2;\n\n }", "function checkCollision() {\n // enemies with layout\n game.activeEnemies.forEach(function(enemy) {\n enemy.x = enemy.x>game.canvas[0].width?enemy.cleanUp():enemy.x;\n enemy.x = enemy.x<-75?enemy.cleanUp():enemy.x;\n // enemies with hero\n if ((enemy.x>=hero.x-20&&enemy.x<hero.x+40)&&(enemy.y>=hero.y-50&&enemy.y<hero.y+50)) {\n hero.reset(190,500);\n game.tries++;\n }\n });\n // hero with layout\n hero.x = hero.x>(game.canvas[0].width-100)?(game.canvas[0].width-100):hero.x;\n hero.x = hero.x<0?0:hero.x;\n hero.y = hero.y>game.canvas[0].height-150?(game.canvas[0].height-150):hero.y;\n hero.y = hero.y<150?150:hero.y;\n if (hero.x>=hero2.x&&hero.y<=hero2.y) {\n game.medal = true;\n game.stop();\n end();\n }\n }", "function checkCollision(entA, entB)\n{\n var colBoxA = entA.colBox;\n var colBoxB = entB.colBox;\n return !(colBoxB.left > colBoxA.right ||\n colBoxB.right < colBoxA.left ||\n colBoxB.top > colBoxA.bottom ||\n colBoxB.bottom < colBoxA.top);\n}", "function detectCollision(player1, player2){\n\treturn Math.abs(player1.x-player2.x) < 40 && Math.abs(player1.y-player2.y) < 40;\n}", "function checkCollision (obj1,obj2){\n return obj1.y + obj1.height - 10 >= obj2.y\n && obj1.y <= obj2.y + obj2.height\n && obj1.x + obj1.width - 10 >= obj2.x\n && obj1.x <= obj2.x + obj2.width\n }", "wallCollision() {\n const hitLeft = this.x - this.radius <= 0;\n const hitRight = this.x + this.radius >= this.boardWidth;\n const hitTop = this.y - this.radius <= 0;\n const hitBottom = this.y + this.radius >= this.boardHeight;\n\n if (hitLeft || hitRight) {\n this.vx = -this.vx;\n \n } else if (hitTop || hitBottom) {\n this.vy = -this.vy;\n \n }\n\n }", "function checkForMatchingNodes() {\n if(!inMotion){\n \n\n if(intersect !== undefined && isNearNode(intersect.object)) {\n rotationCount = 0;\n activeNode = intersect.object;\n originalRotY = activeNode.rotation.y;\n activeNode.updateMatrixWorld();\n THREE.SceneUtils.attach(bridge, scene, activeNode);\n inMotion = true;\n }\n }\n}", "checkCollision(){\n\n if(this.radius > 0){\n if(this.x + this.radius > game.getWidth() || this.x - this.radius < 0){\n this.xVel *= -1;\n }\n\n if(this.y + this.radius > game.getHeight() || this.y - this.radius < 0){\n this.yVel *= -1;\n }\n } \n \n }", "collides(target) {\n const { x: xTarget, y: yTarget } = target;\n const { x, y } = this;\n if(dist(xTarget, yTarget, x, y) <= TARGET_SIZE / 2) {\n return true;\n }\n return false;\n }", "function compute_collision() {\n for (var i = 0; i < elements.length; i++) {\n // Compute collision with wall\n if ((elements[i].object.x\n - elements[i].center.x) <= 0) {\n elements[i].speed.x = \n Math.abs(elements[i].speed.x);\n elements[i].real_coord.x = \n elements[i].object.x = \n elements[i].center.x + 1;\n }\n else if ((elements[i].object.x + \n elements[i].center.x) >= world_width) {\n elements[i].speed.x = \n - Math.abs(elements[i].speed.x);\n elements[i].real_coord.x = \n elements[i].object.x = \n world_width - elements[i].center.x - 1;\n }\n if ((elements[i].object.y\n - elements[i].center.y) <= 0) {\n elements[i].speed.y = \n Math.abs(elements[i].speed.y);\n elements[i].real_coord.y = \n elements[i].object.y = \n elements[i].center.y + 1;\n }\n else if((elements[i].object.y + \n elements[i].center.y) >= world_height) {\n elements[i].speed.y = \n - Math.abs(elements[i].speed.y);\n elements[i].real_coord.y = \n elements[i].object.y =\n world_height - elements[i].center.y - 1;\n }\n }\n }", "checkForCollision(x, y) {\n return (this.level.getTile(x, y) === \"wall\" ||\n !!this.level.getMarker(x, y));\n }", "isCollision(driverX, driverY) {\n let collission = false;\n this.barries.forEach((bar) => {\n if (\n driverX < bar.x + bar.img.width &&\n driverX + this.driverW > bar.x &&\n driverY + 50 < bar.y + bar.img.height &&\n driverY + this.driverH > bar.y + 20\n ) {\n collission = true;\n }\n });\n return collission;\n }", "checkCollisions() {\n allEnemies.forEach(function(enemy) {\n if ( Math.abs(player.x - enemy.x) <= 80 &&\n Math.abs(player.y - enemy.y) <= 30 ) {\n player.x=200;\n player.y=405;\n }\n });\n }", "collisionWithWalls(){\r\n\t\tif(this.position.x < 0 || this.position.x >= this.gameWidth ||\r\n\t\t\tthis.position.y < 0 || this.position.y >= this.gameHeight){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "collide (square) {\n // calculate sides\n \n let left = this.pos.x - this.size/2;\n let right = this.pos.x + this.size/2;\n let top = this.pos.y - this.size/2;\n let bottom = this.pos.y + this.size/2;\n\n let squareLeft = square.pos.x - square.size/2;\n let squareRight = square.pos.x + square.size/2;\n let squareTop = square.pos.y - square.size/2;\n let squareBottom = square.pos.y + square.size/2;\n\n // are they even colliding?\n if (!(((right >= squareLeft && right <= squareRight) || (left >= squareLeft && left <= squareRight)) && \n ((bottom >= squareTop && bottom <= squareBottom) || (top >= squareTop && top <= squareBottom)))) \n return -1;\n \n // active edges: [left/right, top/bottom]\n let edges = [this.vel.x > 0, this.vel.y > 0];\n let squareEdges = [!edges[0], !edges[1]];\n\n // distances\n let dX = abs((squareEdges[0] ? squareRight : squareLeft) - (edges[0] ? right : left));\n let dY = abs((squareEdges[1] ? squareBottom : squareTop) - (edges[1] ? bottom : top));\n\n // time for distances\n let tX = dX / this.vel.x;\n let tY = dY / this.vel.y;\n\n // greator time is colliding longer\n return (tX > tY) ? 0 : 1;\n }", "function collision(top_x, bottom_x, top_y, bottom_y) {\n\t\tfor (var i = 0; i < rows; i++) {\n\t\t\tfor (var j = 0; j < cols; j++) {\n\t\t\t\tvar b = bricks[j][i];\n\t\t\t\tif (b.exists == 1) {\n\t\t\t\t\tif (top_y < (b.y + block_height) && bottom_y > b.y && top_x < (b.x + block_width) && bottom_x > b.x) {\n\t\t\t\t\t\tb.exists = 0;\n\t\t\t\t\t\tball.y_speed = -ball.y_speed;\n\t\t\t\t\t\tplayer1Score += 1;\n\t\t\t\t\t\tbrickcount -= 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function checkCollisions(playerX, playerY, playerW, playerH, enemyX, enemyY, enemyW, enemyH) {\n // Minimize the edges of the objects\n const minTop = 3;\n const minBottom = 15;\n // Player Corner Points\n const pointA = [playerX + minTop, playerY + minTop];\n const pointB = [playerX + playerW - minTop, playerY + minTop];\n const pointC = [playerX + minTop, playerY + playerH - minBottom];\n const pointD = [playerX + playerW - minTop, playerY - minBottom + playerH];\n\n // Enemy Corner Points\n const pointE = [enemyX , enemyY ];\n const pointF = [enemyX + enemyW , enemyY ];\n const pointG = [enemyX , enemyY + enemyH ];\n const pointH = [enemyX + enemyW, enemyY + enemyH];\n\n /*\n * check each point if its position (x,y) found in the other object.\n * CASE #1\n * if A(x) is between E(x)-F(x) AND A(y) between E(y)-G(y)\n \n E__________F\n | |\n | (A)___|____B\n | | | |\n |_____|____| |\n G | H |\n |_________|\n C D\n */\n if ((pointE[0] <= pointA[0] && pointF[0] >= pointA[0]) && (pointE[1] <= pointA[1] && pointG[1] >= pointA[1])) {\n return true;\n }\n /* \n * CASE #2\n * if B(x) is between E(x)-F(x) AND B(y) between E(y)-G(y)\n\n E__________F\n | |\n A____|____(B) |\n | | | |\n | |_____|____|\n | G | H\n |_____ ____| \n C D \n */\n if ((pointE[0] <= pointB[0] && pointF[0] >= pointB[0]) && (pointE[1] <= pointB[1] && pointG[1] >= pointB[1])) {\n return true;\n }\n /* \n * CASE #3\n * if C(x) is between E(x)-F(x) AND C(y) between E(y)-G(y)\n\n A__________B\n | |\n E____|_____F |\n | | | |\n | |_____|____|\n | (C) | D\n |_____ ____| \n G H \n \n */\n if ((pointE[0] <= pointC[0] && pointF[0] >= pointC[0]) && (pointE[1] <= pointC[1] && pointG[1] >= pointC[1])) {\n return true;\n }\n /*\n * CASE #4\n * if D(x) is between E(x)-F(x) AND D(y) between E(y)-G(y)\n\n A__________B\n | |\n | E____|____F\n | | | |\n |_____|____| |\n C | (D) |\n |_________|\n D H\n */\n if ((pointE[0] <= pointD[0] && pointF[0] >= pointD[0]) && (pointE[1] <= pointD[1] && pointG[1] >= pointD[1])) {\n return true;\n }\n /* \n * CASE #5\n * if E(x) is between A(x)-B(x) AND E(y) between A(y)-B(y)\n \n A__________B\n | |\n | (E)___|____F\n | | | |\n |_____|____| |\n C | D |\n |_________|\n G H\n \n */\n if ((pointA[0] <= pointE[0] && pointB[0] >= pointE[0]) && (pointA[1] <= pointE[1] && pointC[1] >= pointE[1])) {\n return true;\n }\n /* \n * CASE #6\n * if F(x) is between A(x)-B(x) AND F(y) between A(y)-B(y)\n\n A__________B\n | |\n E____|____(F) |\n | | | |\n | |_____|____|\n | C | D\n |_____ ____| \n G H \n */\n if ((pointA[0] <= pointF[0] && pointB[0] >= pointF[0]) && (pointA[1] <= pointF[1] && pointC[1] >= pointF[1])) {\n return true;\n }\n /* \n * CASE #7\n * if G(x) is between A(x)-B(x) AND G(y) between A(y)-B(y)\n\n E__________F\n | |\n A____|_____B |\n | | | |\n | |_____|____|\n | (G) | H\n |__________| \n C D \n */\n if ((pointA[0] <= pointG[0] && pointB[0] >= pointG[0]) && (pointA[1] <= pointG[1] && pointC[1] >= pointG[1])) {\n return true;\n }\n /*\n * CASE #8\n * if H(x) is between A(x)-B(x) AND H(y) between A(y)-B(y)\n\n E__________F\n | |\n | A____|____B\n | | | |\n |_____|____| |\n G | (H) |\n |_________|\n C D\n */\n if ((pointA[0] <= pointH[0] && pointB[0] >= pointH[0]) && (pointA[1] <= pointH[1] && pointC[1] >= pointH[1])) {\n return true;\n }\n return false;\n }", "function checkOverlap() {\n let d = dist(circle1.x, circle1.y, circle2.x, circle2.y);\n if (d < circle1.size/3 + circle2.size/3) {\n state = `love`;\n }\n }", "_checkWallCollision() {\n return this.position.y - this.width / 2 <= pong.topWallYPos || this.position.y + this.width / 2 >= pong.bottomWallYPos;\n }", "findCollison(field) {\n const { x, y } = this.position\n this.cells.forEach((rows, i) => {\n rows.forEach((cell, j) => {\n if (cell && ((y + i >= numberOfRows) || field[y + i][x + j])) {\n this.isAlive = false\n return\n }\n })\n })\n }", "function detectCollision() {\n\tvar x, z;\n if (controls.moveLeft) z = -1;\n if (controls.moveRight) z = 1;\n if (controls.moveBackward) x = -1;\n if (controls.moveForward) x = 1;\n\n var vector = new THREE.Vector3( x, 0, z );\n var ray = new THREE.Ray(controls.object.position, vector);\n var intersects = ray.intersectObjects(scene.children);\n\n if (intersects.length > 0) {\n \tconsole.log(controls);\n if (z == -1) controls.moveLeft = false;\n if (z == 1) controls.moveRight = false;\n if (x == -1) controls.moveBackward = false;\n if (x == 1) controls.moveForward = false;\n }\n}", "collisionDetection(){ \n for(let i = 0; i < allEnemies.length; i++){\n //Improved collision detection method assistance provided by Lip Permana during one-on-one session 8.19.18\n if(allEnemies[i].x + allEnemies[i].width >= this.x &&\n allEnemies[i].x <= this.x + this.width &&\n allEnemies[i].y + allEnemies[i].height >= this.y &&\n allEnemies[i].y <= this.y + this.height){ \n console.log(\"collision\"); //for testing\n this.restartGame()\n } \n }\n }", "function collide(o1T, o1B, o1L, o1R, o2T, o2B, o2L, o2R) {\n\tif ((o1L <= o2R && o1L >= o2L) || (o1R >= o2L && o1R <= o2R)) {\n\t\tif ((o1T >= o2T && o1T <= o2B) || (o1B >= o2T && o1B <= o2B)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "function CollisionCalculatorC2P(o1,pt) \n{\n var dx = pt.x - o1.x;\n var dy = pt.y - o1.y;\n\n var dist = Math.sqrt( Math.pow((pt.x-o1.x),2)+Math.pow((pt.y-o1.y),2));\n if(dist>o1.r) {\n return false;\n }\n return true;\n}", "collision() {\n if (this.y === (player.y - 12) && this.x > player.x - 75 && this.x < player.x + 70) {\n player.collide();\n }\n }", "function collision(target1, target2) {\n return (target1.x > target2.x - 20 && target1.x < target2.x + 20) &&\n (target1.y > target2.y - 20 && target1.y < target2.y + 20);\n}", "checkCollisions()\n{\nallEnemies.forEach(bug => {\n if(Math.abs(bug.x - this.x) < 50 && Math.abs(bug.y - this.y) < 50 )\n {\n this.Collision();\n \n }\n});\n\n}", "function collision(player,blocker) {\n var x1 = player.offset().left;\n var y1 = player.offset().top;\n var h1 = player.outerHeight(true);\n var w1 = player.outerWidth(true);\n var b1 = y1 + h1;\n var r1 = x1 + w1;\n var x2 = blocker.offset().left;\n var y2 = blocker.offset().top;\n var h2 = blocker.outerHeight(true);\n var w2 = blocker.outerWidth(true);\n var b2 = y2 + h2;\n var r2 = x2 + w2;\n \n // if (b1 < y2 || y1 > b2 || r1 < x2 || x1 > r2) {\n // console.log(\"false\");\n // } else {\n // console.log(\"true\");\n // } \n \n if (b1 < y2 || y1 > b2 || r1 < x2 || x1 > r2) {\n return false;\n } else { \n return true;\n }\n\n }", "checkCollision() { \n return (player.x < this.x + 80 &&\n player.x + 80 > this.x &&\n player.y < this.y + 60 &&\n 60 + player.y > this.y)\n }", "collision() {\n\t\tthis.vars.collision = true;\n\t}", "detectWallCollision(position) {\n const enemy = {};\n enemy.left = position.x;\n enemy.top = position.y;\n enemy.right = enemy.left + this.size.w;\n enemy.bottom = enemy.top + this.size.h;\n\n // Check possible collision with all wall and wood tiles\n const tiles = gGameEngine.tiles;\n for (let i = 0; i < tiles.length; i++) {\n const tilePosition = tiles[i].position;\n\n const tile = {};\n tile.left = tilePosition.x * gGameEngine.tileSize + 25;\n tile.top = tilePosition.y * gGameEngine.tileSize + 20;\n tile.right = tile.left + gGameEngine.tileSize - 30;\n tile.bottom = tile.top + gGameEngine.tileSize - 30;\n\n if (gGameEngine.intersectRect(enemy, tile)) {\n return true;\n }\n }\n return false;\n }", "hasCollision(c) {\n return this.manager.hasCollision(c);\n }", "isCollidingWith(gameObject) {\n return (\n p5.Vector.dist(this.position, gameObject.position) <\n this.collisionRadius + this.gameObject.collisionRadius\n );\n }", "function collision(b, p) {\r\n p.top = p.y;\r\n p.bottom = p.y + p.height;\r\n p.left = p.x;\r\n p.right = p.x + p.width;\r\n\r\n b.top = b.y - b.radius;\r\n b.bottom = b.y + b.radius;\r\n b.left = b.x - b.radius;\r\n b.right = b.x + b.radius;\r\n\r\n return (\r\n p.left < b.right && p.top < b.bottom && p.right > b.left && p.bottom > b.top\r\n );\r\n}", "function collision_detector(first, second) {\r\n var x1 = first.get(\"X\");\r\n var y1 = first.get(\"Y\");\r\n var width1 = first.get(\"width\");\r\n var height1 = first.get(\"height\");\r\n var x2 = second.get(\"X\");\r\n var y2 = second.get(\"Y\");\r\n var width2 = second.get(\"width\");\r\n var height2 = second.get(\"height\");\r\n\r\n if (x2 > x1 && x2 < x1 + width1 || x1 > x2 && x1 < x2 + width2) {\r\n if (y2 > y1 && y2 < y1 + height1 || y1 > y2 && y1 < y2 + height2) {\r\n return true;\r\n }\r\n } else {\r\n return false;\r\n }\r\n}", "resolveCollision(entity, delta_t) {\n //this.entities.forEach(e => {\n // Could only check collision if entity is within camera to save time\n let normal = this.player.detectCollison(entity, delta_t);\n if (normal !== undefined){\n this.player.resolveCollision(entity, delta_t, normal);\n return true;\n }\n return false;\n //}); \n }", "function detectCollision() {\n ballCollision();\n brickCollision();\n}", "function collision_check(a,b) {\n let res = (Math.abs(a.x-b.x) * 2 < (16+8)) &&\n (Math.abs(a.y-b.y) * 2< (16+8))\n return res;\n}", "checkEdges() {\n if (this.location.x > p.w - this.radius) {\n this.velocity.x *= -1;\n } else if (this.location.x < 0 + this.radius) {\n this.velocity.x *= -1;\n }\n if (this.location.y > p.h - this.radius) {\n this.velocity.y *= -1;\n } else if (this.location.y < 0 + this.radius) {\n this.velocity.y *= -1;\n }\n }", "collidesWith(player) {\n //this function returns true if the the rectangles overlap\n // console.log('this.collidesWith')\n const _overlap = (platform, object) => {\n // console.log('_overlap')\n // check that they don't overlap in the x axis\n const objLeftOnPlat = object.left <= platform.right && object.left >= platform.left;\n const objRightOnPlat = object.right <= platform.right && object.right >= platform.left;\n const objBotOnPlatTop = Math.abs(platform.top - object.bottom) === 0;\n \n // console.log(\"OBJECT BOTTOM: \", object.bottom/);\n // console.log(\"PLATFORM TOP: \", platform.top);\n // console.log('objectBotOnPlat: ', !objBotOnPlatTop)\n // console.log('OBJECT RIGHT: ', object.right)\n // console.log('PLATFORM RIGHT: ', platform.right)\n // console.log(\"OBJECT LEFT: \", object.left);\n // console.log(\"PLATFORM LEFT: \", platform.left);\n // console.log('objectLeftOnPlat', !objLeftOnPlat);\n // console.log('objRightOnPlat', !objRightOnPlat);\n\n if (!objLeftOnPlat && !objRightOnPlat) {\n // if (player.y < 400) { \n // debugger\n // }\n return false;\n // if (objBotOnPlatTop) return true;\n // return false;\n }\n \n if (objLeftOnPlat || objRightOnPlat) {\n // debugger\n // console.log('PLATFORM:::::', platform.top)\n // console.log('PLAYER:::::::', object.bottom)\n // console.log('objBotOnPlat:::::::::', objBotOnPlatTop)\n\n if (objBotOnPlatTop) {\n debugger\n }\n }\n //check that they don't overlap in the y axis\n const objTopAbovePlatBot = object.top > platform.bottom;\n if (!objBotOnPlatTop) {\n // console.log()\n // if (player.y < 400) { \n // debugger\n // }\n return false;\n }\n\n return true;\n };\n\n let collision = false;\n this.eachPlatform(platform => {\n //check if the bird is overlapping (colliding) with either platform\n if (_overlap(platform, player.bounds())) {\n // console.log('WE ARE HERE IN THE OVERLAP')\n // console.log(platform)\n collision = true;\n // debugger\n // console.log(player)\n player.y = platform.top;\n // console.log('PLATFORM: ', platform)\n // console.log(collision)\n // player.movePlayer(\"up\")\n }\n // _overlap(platform.bottomPlatform, player)\n });\n\n // console.log('collision:')\n // console.log(collision)\n return collision;\n }", "function collides(a, b) {\n\n\treturn a.x < b.x + b.width &&\n\t\t\t\t a.x + a.width > b.x &&\n\t\t\t\t a.y < b.y + b.height &&\n\t\t\t\t a.y + a.height > b.y;\n\n}", "checkForCollision(ps) {\n if( ps !== null ) { \n for(let i = 0; i < this.collisionSX.length; i++ ) {\n if( ps.position.x >= this.collisionSX[i] && ps.position.x <= this.collisionEX[i] ) {\n if( ps.position.y >= this.collisionSY[i] && ps.position.y <= this.collisionEY[i] ) {\n //print(\"collsion at shape \" + i);\n return true;\n }\n }\n }\n }\n\n return false; \n }", "collideBroadPhase(other) {\n // By default assume all collisions will be checked.\n return true;\n }", "collide(other) {\n\t\tlet al = this.x + this.hitbox.x \n\t\tlet au = this.y + this.hitbox.y\n\t\tlet ar = al + this.hitbox.w\n\t\tlet ad = au + this.hitbox.h\n\t\tlet bl = other.x + other.hitbox.x \n\t\tlet bu = other.y + other.hitbox.y\n\t\tlet br = bl + other.hitbox.w\n\t\tlet bd = bu + other.hitbox.h\n\t\treturn ar > bl && al < br && ad > bu && au < bd\n\t}", "collision() {\n return this.sprite.overlap(player.sprite) && this.colour == player.colour;\n }", "function check_collision(obj1, obj2) {\n let hit = false;\n obj1 = obj1.getBounds();\n obj2 = obj2.getBounds();\n if(obj1.bottom > obj2.top\n && obj1.top < obj2.bottom\n && obj1.left < obj2.right\n && obj1.right > obj2.left) {\n hit = true;\n }\n return hit;\n }", "function checkCollisions() {\n\n var d1 = dist(playerX, playerY, width / 2, height / 2);\n\n if (d1 > borderDiameter / 2) {\n\n showGameOver();\n noLoop();\n\n }\n\n var i = 0;\n\n for (i = 0; i < numberOfEnemies; i++) {\n var d2 = dist(playerX, playerY, enemyX[i], enemyY[i]);\n\n // Check if it's an overlap\n if (d2 < playerRadius + enemyRadius) {\n // Increase the player health\n showGameOver();\n noLoop();\n\n }\n\n }\n\n var d3 = dist(playerX, playerY, preyX, preyY);\n\n if (d3 < playerRadius + enemyRadius) {\n bark.play();\n setup();\n }\n\n\n}", "checkCollision(other, graphics) {\n // console.log('checkCollision', this, other)\n const pointIntersect = this.shapeDraw.intersectsShape(other.shapeDraw, graphics)\n // console.log(pointIntersect)\n if (pointIntersect) return pointIntersect\n for (const child of this.children) {\n const pointIntersect = child.shapeDraw.intersectsShape(other.shapeDraw, graphics)\n if (pointIntersect) return pointIntersect\n } \n return null\n }", "function detectCollisionForCircles(obj1,obj2){\n\t\n\tvar xmov1 = obj1.move_x;\n\tvar ymov1 = obj1.move_z;\n\tvar xmov2 = obj2.move_x;\n\tvar ymov2 = obj2.move_z;\n\t\n\tvar xl1=obj1.position.x;\n var yl1=obj1.position.z;\n\tvar xl2=obj2.position.x;\n\tvar yl2=obj2.position.z;\n\tvar R = obj1.radius + obj2.radius;\n\tvar a =-2*xmov1*xmov2+xmov1*xmov1+xmov2*xmov2;\n\tvar b =-2*xl1*xmov2-2*xl2*xmov1+2*xl1*xmov1+2*xl2*xmov2;\n\tvar c =-2*xl1*xl2+xl1*xl1+xl2*xl2;\n\tvar d =-2*ymov1*ymov2+ymov1*ymov1+ymov2*ymov2;\n\tvar e =-2*yl1*ymov2-2*yl2*ymov1+2*yl1*ymov1+2*yl2*ymov2;\n\tvar f =-2*yl1*yl2+yl1*yl1+yl2*yl2;\n\tvar g =a+d;\n\tvar h =b+e;\n\tvar k =c+f-R*R;\n\t\t\t\n\tvar sqRoot =Math.sqrt(h*h-4*g*k);\n\tvar t1 =(-h+sqRoot)/(2*g);\n\tvar t2 =(-h-sqRoot)/(2*g);\n\t\n\t /* if (t1>0 &&t1<=1){\n\t\t var whatTime =t1;\n\t\t\tvar ballsCollided =true;\n\t\t\talert(\"t1=\"+whatTime);\n\t } */\n\t\tif (t2>0 &&t2<=1){\n\t\t if (whatTime ==0 ||t2<t1){\n \t\tvar\twhatTime =t2;\n\t\t\t\tvar\tballsCollided =true;\n\t\t }\n\t\t}\n\t\tif (ballsCollided){\n\t\t\t\n\t\t\tball2BallReaction(obj1,obj2,xl1,xl2,yl1,yl2,whatTime)\n\t\t\t\tballsCollided=false;\n\t\t\t\twhatTime=0;\n\t\t\t}\n\t\t\t\t\n}", "function checkCollision(){\r\n\t//check se la macchina esce dalla pista\r\n\tif(center_carr[2]<-408)vz=0;\r\n\tif(center_carr[2]>109)vz=0;\r\n\t\r\n\tif(center_carr[0]<track_dimension[1])vz=0;\r\n\tif(center_carr[0]>track_dimension[0])vz=0;\r\n\t\r\n\t//check collisione con i booster\r\n\tif((center_carr[0]<2.3 && center_carr[0]>0) && (center_carr[2]>-10 && center_carr[2]<-6)) vz=vz*1.12;\r\n\tif((center_carr[0]<0 && center_carr[0]>-2.3) && (center_carr[2]>-35 && center_carr[2]<-31)) vz=vz*1.12;\r\n\tif((center_carr[0]<0 && center_carr[0]>-2.3) && (center_carr[2]>-48 && center_carr[2]<-44)) vz=vz*1.12;\r\n\tif((center_carr[0]<6 && center_carr[0]>4) && (center_carr[2]>-161 && center_carr[2]<-157)) vz=vz*1.12;\r\n\tif((center_carr[0]<3 && center_carr[0]>0.7) && (center_carr[2]>-184 && center_carr[2]<-180)) vz=vz*1.12;\r\n\tif((center_carr[0]<5.60 && center_carr[0]>3.18) && (center_carr[2]>-240 && center_carr[2]<-236)) vz=vz*1.12;\r\n\tif((center_carr[0]<5.60 && center_carr[0]>3.18) && (center_carr[2]>-251 && center_carr[2]<-247)) vz=vz*1.12;\r\n\tif((center_carr[0]<5.60 && center_carr[0]>3.18) && (center_carr[2]>-257 && center_carr[2]<-253)) vz=vz*1.12;\r\n\tif((center_carr[0]<7 && center_carr[0]>5) && (center_carr[2]>-290 && center_carr[2]<-286)) vz=vz*1.12;\r\n\tif((center_carr[0]<6&& center_carr[0]>3.8) && (center_carr[2]>-310 && center_carr[2]<-306)) vz=vz*1.15;\r\n\tif((center_carr[0]<3.6&& center_carr[0]>1.3) && (center_carr[2]>-331 && center_carr[2]<-327)) vz=vz*1.12;\r\n\t\r\n\t//check collisione con i debooster\r\n\tif((center_carr[0]<1.15 && center_carr[0]>-0.8) && (center_carr[2]>-113 && center_carr[2]<-109)) vz=vz*0.9;\r\n\tif((center_carr[0]<6 && center_carr[0]>3.6) && (center_carr[2]>-144 && center_carr[2]<-140)) vz=vz*0.9;\r\n\tif((center_carr[0]<3.25 && center_carr[0]>0.85) && (center_carr[2]>-170 && center_carr[2]<-166)) vz=vz*0.9;\r\n\tif((center_carr[0]<6.66 && center_carr[0]>4.6) && (center_carr[2]>-203 && center_carr[2]<-199)) vz=vz*0.9;\r\n\tif((center_carr[0]<2.81 && center_carr[0]>0.93) && (center_carr[2]>-222 && center_carr[2]<-218)) vz=vz*0.9;\r\n\tif((center_carr[0]<3.25 && center_carr[0]>1) && (center_carr[2]>-277 && center_carr[2]<-281)) vz=vz*0.9;\r\n\tif((center_carr[0]<7 && center_carr[0]>5) && (center_carr[2]>-300 && center_carr[2]<-296)) vz=vz*0.9;\r\n\t\r\n}", "checkCollisions(){\n \tlet coll = false;\n \tconst R = .7;\n \tfor(const ENEMY of allEnemies){\n \t\tif(ENEMY.y === this.y && Math.abs(this.x - ENEMY.x)< R){\n \t\t\tcoll=true;\n \t\t\tRESET();\n \t\t}\n \t}\n \treturn coll;\n }", "function detectCollision(x1, y1, r1, x2, y2, r2) {\n var dist2 = ((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n if (dist2 <= ((r2 + r1) * (r2 + r1)))\n return true;\n return false;\n}", "onCollision() {\n\n }", "function collision(mouse, obstacle) {\n return Math.round(mouse.position.x / 1.5) === Math.round(obstacle.position.x / 1.5 && Math.round(mouse.position.y) === Math.round(obstacle.position.y) && Math.round(mouse.position.z) === Math.round(obstacle.position.z / 4));\n}", "function checkCollision() {\n var conds = [false, false, false, false];\n if (rectA.right >= rectB.left)\n conds[0] = true;\n if (rectB.right >= rectA.left)\n conds[1] = true;\n if (rectA.bottom >= rectB.top)\n conds[2] = true;\n if (rectB.bottom >= rectA.top)\n conds[3] = true;\n return conds;\n}", "detectCollison(e, delta_t) {\n let next = this.vel.clone().multiplyScalar(delta_t);\n if (this.right() + next.x > e.left() && this.left() + next.x < e.right()\n && this.bottom() > e.top() && this.top() < e.bottom())\n {\n if (next.x > 0){\n return new THREE.Vector3(-1, 0);\n } else{\n return new THREE.Vector3(1, 0);\n }\n }\n if (this.right() > e.left() && this.left() < e.right()) {\n if( this.bottom() + next.y > e.top() && this.top() + next.y < e.bottom())\n {\n if (next.y > 0) {\n this._isJumping = false;\n return new THREE.Vector3(0, 1);\n } else { \n return new THREE.Vector3(0, -1);\n }\n }\n }\n\n return undefined;\n }", "collision_BL(ball, wall) {\n return ball.area.isInside(wall.area.closestPointTo(ball.state.pos));\n }", "function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function(d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function(quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }", "collision(that, dt) {\n\t\tvar relv = this.vel.sub(that.vel);\n\t\tvar bigBox = new PhysicPrimitive();\n\t\tbigBox.pos = this.pos.min(this.updatePosition(relv, dt));\n\t\tbigBox.size = this.pos.max(this.updatePosition(relv, dt)).add(this.size).sub(bigBox.pos);\n\t\tvar retVal = {};\n\t\tif (bigBox.intersects(that)) {\n\t\t\tvar invEntry = new Vector2(0, 0);\n\t\t\tvar invExit = new Vector2(0, 0);\n\t\t\tif (relv.x >= 0) {\n\t\t\t\tinvEntry.x = that.pos.x - (this.pos.x + this.size.x);\n\t\t\t\tinvExit.x = (that.pos.x + that.size.x) - this.pos.x;\n\t\t\t} else {\n\t\t\t\tinvEntry.x = (that.pos.x + that.size.x) - this.pos.x;\n\t\t\t\tinvExit.x = that.pos.x - (this.pos.x + this.size.x);\n\t\t\t}\n\t\t\tif (relv.y >= 0) {\n\t\t\t\tinvEntry.y = that.pos.y - (this.pos.y + this.size.y);\n\t\t\t\tinvExit.y = (that.pos.y + that.size.y) - this.pos.y;\n\t\t\t} else {\n\t\t\t\tinvEntry.y = (that.pos.y + that.size.y) - this.pos.y;\n\t\t\t\tinvExit.y = that.pos.y - (this.pos.y + this.size.y);\n\t\t\t}\n\t\t\tvar entry = new Vector2(0, 0);\n\t\t\tvar exit = new Vector2(0, 0);\n\t\t\tif (relv.x == 0) {\n\t\t\t\tentry.x = (invEntry.x > 0 ? 1 : -1) * (dt + 1);\n\t\t\t\texit.x = (invExit.x > 0 ? 1 : -1) * (dt + 1);\n\t\t\t} else {\n\t\t\t\tentry.x = invEntry.x / relv.x;\n\t\t\t\texit.x = invExit.x / relv.x;\n\t\t\t}\n\t\t\tif (relv.y == 0) {\n\t\t\t\tentry.y = (invEntry.y > 0 ? 1 : -1) * (dt + 1);\n\t\t\t\texit.y = (invExit.y > 0 ? 1 : -1) * (dt + 1);\n\t\t\t} else {\n\t\t\t\tentry.y = invEntry.y / relv.y;\n\t\t\t\texit.y = invExit.y / relv.y;\n\t\t\t}\n\t\t\tvar entryTime = Math.max(entry.x, entry.y);\n\t\t\tvar exitTime = Math.min(exit.x, exit.y);\n\t\t\tvar normal = new Vector2(1, 1);\n\t\t\tif (entryTime > exitTime || entry.x < -eps && entry.y < -eps || entry.x - dt > eps || entry.y - dt > eps) {\n\t\t\t\tretVal.dt = dt + 1;\n\t\t\t\tretVal.proj = new Vector2(1, 1);\n\t\t\t\treturn retVal;\n\t\t\t} else {\n\t\t\t\tif (entry.x - eps > entry.y) {\n\t\t\t\t\tif (relv.x >= 0) {\n\t\t\t\t\t\tnormal = new Vector2(-1, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnormal = new Vector2(1, 0);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (relv.y >= 0) {\n\t\t\t\t\t\tnormal = new Vector2(0, -1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnormal = new Vector2(0, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tretVal.dt = entryTime;\n\t\t\t\tretVal.proj = normal;\n\t\t\t\treturn retVal;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tretVal.dt = dt + 1;\n\t\t\tretVal.proj = new Vector2(1, 1);\n\t\t\treturn retVal;\n\t\t}\n\t}", "function collide(A, B) {\n if ( A.x < B.x + CAR_WIDTH && A.x + CAR_WIDTH > B.x &&\n A.y < B.y + CAR_HEIGHT && A.y + CAR_HEIGHT > B.y ) {\n if ( DEBUG ) {\n console.log(\"Colision entre deux véhicules\");\n }\n return true;\n }\n return false;\n}", "function collides(a, b) {\n if(a.x == b.x && a.y == b.y) return true;\n return false;\n }", "function isColliding(a, b) {\n return a.left < b.right && a.right > b.left && a.top < b.bottom && a.bottom > b.top;\n}", "function checkColl(position){\n if(position.x>=500 && position.y>380)\n return true;\n var platforms = document.getElementById(\"platforms\");\n for (var i = 0; i < platforms.childNodes.length; i++) {\n var node = platforms.childNodes.item(i);\n if (node.nodeName != \"rect\" && node.nodeName != \"line\") continue;\n\n if(node.nodeName == \"rect\"){\n var x = parseFloat(node.getAttribute(\"x\"));\n var y = parseFloat(node.getAttribute(\"y\"));\n var w = parseFloat(node.getAttribute(\"width\"));\n var h = parseFloat(node.getAttribute(\"height\"));\n var pos = new Point(x, y);\n var size = new Size(w, h);\n if (intersect(position, PLAYER_SIZE, pos, size))\n return true;\n } \n else if(node.nodeName == \"line\"){\n var x1 = parseFloat(node.getAttribute(\"x1\"));\n var x2 = parseFloat(node.getAttribute(\"x2\"));\n var y1 = parseFloat(node.getAttribute(\"y1\"));\n var y = y1-10.0;\n var w = x2-x1;\n var h = 20.0;\n var pos = new Point(x1, y);\n var size = new Size(w, h);\n\n if (intersect(position, PLAYER_SIZE, pos, size)) {\n return true;\n }\n }\n }\n return false;\n}" ]
[ "0.7331335", "0.7211608", "0.7209922", "0.71835136", "0.7143065", "0.7049127", "0.70250607", "0.6956548", "0.6938193", "0.6924827", "0.69174004", "0.6893398", "0.68471664", "0.68434554", "0.6841742", "0.68280387", "0.6825077", "0.679894", "0.6797989", "0.67934567", "0.6762788", "0.6762532", "0.67216045", "0.6721072", "0.6714593", "0.67037207", "0.6697647", "0.6695327", "0.6679873", "0.66798264", "0.66638184", "0.6660419", "0.665826", "0.66312516", "0.66303366", "0.6628491", "0.6628491", "0.66258854", "0.66140866", "0.6606314", "0.6605594", "0.6604887", "0.6604209", "0.65975887", "0.6596845", "0.6593398", "0.65898955", "0.65856993", "0.65831274", "0.6574809", "0.65711546", "0.65666735", "0.6558423", "0.6534056", "0.65322554", "0.6530458", "0.6529319", "0.6523119", "0.6522787", "0.65190434", "0.65172803", "0.65150356", "0.6513201", "0.65105987", "0.65059644", "0.65035754", "0.65001667", "0.64944047", "0.648762", "0.6486659", "0.64774156", "0.64752805", "0.64699006", "0.6469779", "0.6464457", "0.6462841", "0.64555806", "0.6453499", "0.6448151", "0.6447298", "0.64412", "0.64408815", "0.64406294", "0.6437444", "0.6437063", "0.6436922", "0.6430793", "0.64277834", "0.6424861", "0.64184344", "0.6416853", "0.64145255", "0.64105976", "0.6408321", "0.6407965", "0.6405374", "0.6400495", "0.63990617", "0.6397644", "0.6395359", "0.63952756" ]
0.0
-1
detect the strong connect component in the graph
function detectCycle(){ SCCNodes = d3.range(nodesData.length).map(function(d, i){ return {id : nodesData[i].id, index : -1}; }) map.clear(); for (var i = 0; i < SCCNodes.length; i++){ if (SCCNodes[i].index == -1 && SCCNodes[i].id in nodesChildren){ strongConnect(SCCNodes[i]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connects(candidate, edge) {\n return ((candidate && edge) && (candidate.a.x == edge.a.x && candidate.a.y == edge.a.y ||\n candidate.a.x == edge.b.x && candidate.a.y == edge.b.y ||\n candidate.b.x == edge.a.x && candidate.b.y == edge.a.y ||\n candidate.b.x == edge.b.x && candidate.b.y == edge.b.y)) \n }", "fullyConnected(){\n\n let totalNumberOfConnections = 0; // count the total no of connections that can be made in this genome\n let noOfNodesInEachLayer = 0; // count the no of nodes in a particular layer\n let tempX = this.nodes[0].x; // store the x coordinate of current layer\n let noOfNodesAhead = this.nodes.length; // count the no of nodes infront of the current layer\n\n for(let node of this.nodes){\n if(tempX == node.x){\n noOfNodesInEachLayer++;\n } else if(tempX < node.x){\n tempX = node.x;\n noOfNodesAhead -= noOfNodesInEachLayer;\n totalNumberOfConnections += noOfNodesInEachLayer * (noOfNodesAhead);\n noOfNodesInEachLayer = 1;\n }\n }\n\n if(totalNumberOfConnections == this.connections.length){\n return true;\n } else {\n return false;\n }\n }", "connections(graph){\n if ( !(graph instanceof Graph) )\n throw new TypeError(ENOTGRAPH)\n\n return graph.connections.filter(({vertices}) => vertices.includes(this))\n }", "function isGraphConnected(){\r\n let isConnected = true;\r\n console.log(\"called\");\r\n if(large.graph.size == 0){\r\n return isConnected;\r\n }\r\n \r\n //StartVertex\r\n let startVertex = large.graph.values().next().value;\r\n \r\n //Do BFS one way\r\n if(this.bfs(startVertex) != large.graph.size){\r\n isConnected = false;\r\n }\r\n \r\n //Get transpose(graph with all neighbors reversed) and call BFS again\r\n let transpose = new Graph();\r\n for(let i=1; i<=large.graph.size; i++){\r\n //console.log(large.graph.get(i.toString()));\r\n for(let pair of large.graph.get(i.toString()).neighbors){\r\n //Pair consists of toName and Weight\r\n //transpose.addEdgeFromCode(pair.toName, i.toString(), pair.weight);\r\n let fromNode = new Node(0,0,0,pair.toName);\r\n let toNode = new Node(0,0,0,i.toString());\r\n transpose.insertEdge(fromNode, toNode, pair.weight);\r\n }\r\n }\r\n if(bfs(transpose.graph.values().next().value) != large.graph.size){\r\n isConnected = false;\r\n }\r\n \r\n \r\n return isConnected;\r\n }", "getNumOfConnectedComponents() {\n let numOfConnectedComponents = 0;\n\n const notVisited = new Set(this.nodes);\n while (notVisited.size) {\n const notVisitedArr = Array.from(notVisited);\n const source = notVisitedArr[0];\n const toVisitStack = [source];\n notVisited.delete(source);\n while (toVisitStack.length) {\n const currNode = toVisitStack.pop();\n for (let neighbor of currNode.adjacent) {\n if (notVisited.has(neighbor)) {\n toVisitStack.push(neighbor);\n notVisited.delete(neighbor);\n }\n }\n }\n numOfConnectedComponents++;\n }\n return numOfConnectedComponents;\n }", "function isConnection$3(element) {\n return element.waypoints;\n}", "function isConnected(a, b) {\n let c1 = indexLink[a.index + \"|\" + b.index];\n let c2 = indexLink[b.index + \"|\" + a.index];\n return (c1 || c2);\n }", "function isConnection(element) {\n return element.waypoints;\n}", "function isConnection(element) {\n return element.waypoints;\n}", "function isConnection(element) {\n return element.waypoints;\n}", "function isConnection$3(element) {\n return element.waypoints;\n }", "getConnectedComponents() {\n const componentsList = [];\n\n let needReset = true;\n\n for (let v of this.vertexes) {\n if (needReset || v.color === 'white') {\n const component = this.bfs(v, needReset);\n needReset = false;\n\n componentsList.push(component);\n }\n }\n\n return componentsList;\n }", "function isCyclic(unionFind, edge) {\n let vertexU = edge.vertexU;\n let vertexV = edge.vertexV;\n // console.log(vertexV);\n if (\n typeof unionFind.find(vertexV) === \"undefined\" &&\n typeof unionFind.find(vertexU) === \"undefined\"\n ) {\n return false;\n } else {\n return unionFind.find(vertexV) === unionFind.find(vertexU);\n }\n}", "function findStronglyConnected(dg, v) {\n\t\t\tvar vertices, vertex;\n\n\t\t\tv.index = v.lowlink = index;\n\t\t\tindex += 1;\n\t\t\tpushStack(stack, v);\n\n\t\t\tdg.eachEdgeFrom(v.name, function(v, w) {\n\n\t\t\t\tif(w.index === undef) {\n\t\t\t\t\t// Continue depth first search\n\t\t\t\t\tfindStronglyConnected(dg, w);\n\t\t\t\t\tv.lowlink = Math.min(v.lowlink, w.lowlink);\n\t\t\t\t} else if(w.onStack) {\n\t\t\t\t\tv.lowlink = Math.min(v.lowlink, w.index);\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\tif(v.lowlink === v.index) {\n\t\t\t\tvertices = [];\n\t\t\t\tif(stack.length) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tvertex = popStack(stack);\n\t\t\t\t\t\tvertices.push(vertex);\n\t\t\t\t\t} while(v !== vertex);\n\t\t\t\t}\n\n\t\t\t\tif(vertices.length) {\n\t\t\t\t\tscc.push(vertices);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function findStronglyConnected(dg, v) {\n\t\t\tvar vertices, vertex;\n\n\t\t\tv.index = v.lowlink = index;\n\t\t\tindex += 1;\n\t\t\tpushStack(stack, v);\n\n\t\t\tdg.eachEdgeFrom(v.name, function(v, w) {\n\n\t\t\t\tif(w.index === undef) {\n\t\t\t\t\t// Continue depth first search\n\t\t\t\t\tfindStronglyConnected(dg, w);\n\t\t\t\t\tv.lowlink = Math.min(v.lowlink, w.lowlink);\n\t\t\t\t} else if(w.onStack) {\n\t\t\t\t\tv.lowlink = Math.min(v.lowlink, w.index);\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\tif(v.lowlink === v.index) {\n\t\t\t\tvertices = [];\n\t\t\t\tif(stack.length) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tvertex = popStack(stack);\n\t\t\t\t\t\tvertices.push(vertex);\n\t\t\t\t\t} while(v !== vertex);\n\t\t\t\t}\n\n\t\t\t\tif(vertices.length) {\n\t\t\t\t\tscc.push(vertices);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "hasCycle() {\n const numOfNodes = this.nodes.size;\n const numOfEdges = this.getNumOfEdges();\n const numOfConnectedComponents = this.getNumOfConnectedComponents();\n return numOfEdges > numOfNodes - numOfConnectedComponents;\n }", "function connect(en, ei, p) {\n var n = en.s.length + ei.s.length\n var see = new SMatrix(n-2,n-2),sei = new SMatrix(n-2,2)\n var sie = new SMatrix( 2,n-2),sii = new SMatrix( 2,2)\n /*\n var g = new SMatrix((new Junction(2)).smatrix())\n /*/\n var g = new SMatrix([\n [new Complex(0), new Complex(1)],\n [new Complex(1), new Complex(0)]\n ])\n //*/\n var i,j,k,l,m,h\n\n // Generazione di see, sei, sie, sii mediante scansione di en ed ei\n // see è diagonale a blocchi n-2 righe, n-2 colonne\n // sei è verticale di n-2 righe, 2 colonne\n // sie è orizzontale di 2 righe, n-2 colonne\n // sii è diagonale e contiene solo i due elementi delle porte da connettere\n h = 0 // Elemento in corso di gestione\n m = 0 // Blocco dell'elemento (S è diagonale a blocchi))\n k = 0 // 0 Prima o -1 dopo la porta da connettere\n var elements = [ei,en]\n\n while ( elements.length > 0 ) {\n // elemento da gestire\n var es = elements.pop()\n var el = es.s.length\n var pp = es.n.indexOf(p)\n for ( i=0; i<el; i++) {\n l = m // m Prima o m-1 dopo la porta da connettere\n for ( j=0; j<el; j++) {\n if ( i !== pp ) { // Porta non connessa\n if ( j !== pp ) { // Porta non connessa\n see.set(i+k,j+l,es.s[i][j])\n } else { // Porta connessa\n l = m-1\n sei.set(i+k,h,es.s[i][j])\n }\n } else { // Porta connessa\n k = m-1\n if ( j !== pp ) { // Porta non connessa\n sie.set(h,j+l,es.s[i][j])\n } else { // Porta connessa\n l = m-1\n sii.set(h,h,es.s[i][j])\n }\n }\n }\n }\n m += es.s.length-1\n k = m // m Prima o m-1 dopo la porta da connettere\n h += 1 // prossimo elemento\n }\n\n var snet = see.add(sei.mul(g.sub(sii).inverse().mul(sie)))\n return snet.val()\n}", "connectedVerts() {\n var vs = [];\n for (var e of this.edges) {\n vs.push(e.vert1);\n vs.push(e.vert2);\n }\n return vs.filter((v) => v.id !== this.id);\n }", "function isConnected(a, b) {\n\t\t return linked[a.index + \", \" + b.index] || linked[b.index + \", \" + a.index];\n\t\t}", "function CC(G) {\n var marked = new Array(G.getVertices()); // marked[v] = has vertex v been marked?\n var id = new Array(G.getVertices()); // id[v] = id of connected component containing v\n var size = new Array(G.getVertices()); // size[id] = number of vertices in given component\n var count = 0; // number of connected components\n\n for (var i = 0; i < G.getVertices(); i++) {\n if (!marked[i]) {\n dfs(G, i);\n count++;\n }\n }\n\n // depth-first search for a Graph\n function dfs(G, v) {\n marked[v] = true;\n id[v] = count;\n size[count]++;\n for (var w of G.getAdjValues(v)) {\n if (!marked[w]) {\n dfs(G, w);\n }\n }\n }\n\n // returns the number of connected components in the graph.\n function numberOfComponents() {\n return count;\n }\n\n // returns the component id of the connected component containing vertex v\n function idOfComponent(v) {\n return id[v];\n }\n\n // returns true if vertices v and w are in the same\n // connected component.\n function connected(v, w) {\n return id(v) === id(w);\n }\n\n function componentInId(v) {\n var arr = [];\n for (var i = 0; i < id.length; i++) {\n if (id[i] === v) arr.push(i);\n }\n return arr;\n }\n\n return {\n connected,\n numberOfComponents,\n idOfComponent,\n componentInId\n };\n}", "function isEdgeConnected(x,y,edge)\r\n{\r\n\tif (edge == \"left\" || edge == \"top\"){edge = 0;}\r\n\tif (edge == \"right\" || edge == \"bottom\"){edge = 1;}\r\n\treturn cgrid[x][y][edge];\r\n}", "getConnectedComponents() {\n // !!! IMPLEMENT ME\n \n let connectedComponents = [];\n let unvisited = this.vertexes;\n let visited = [];\n let colors = [];\n\n // color generator\n let randomBlueColorString = () => {\n let blue = Math.floor((Math.random() * 240) + 130);\n let green = blue - 30;\n let red = green - 40;\n\n return \"rgb(\" + red.toString() + \", \" + green.toString() + \", \" + blue.toString() + \")\";\n };\n \n while (visited.length < this.vertexes.length) {\n connectedComponents.push(this.bfs(unvisited[0]));\n unvisited = this.vertexes.filter(vertex => vertex.visited === false);\n console.log(\"Unvisited: \", unvisited);\n visited = connectedComponents.reduce((acc, val) => acc.concat(val), []);\n }\n\n console.log(\"Connected Components: \", connectedComponents);\n console.log(\"Component Count: \", connectedComponents.length);\n \n this.components = connectedComponents.length;\n\n // colorize components\n for (let i = 0; i < connectedComponents.length; i++) {\n \n let newBlue = randomBlueColorString();\n \n while (colors.includes(newBlue)) {\n newBlue = randomBlueColorString();\n }\n\n colors.push(randomBlueColorString());\n \n for (let k = 0; k < connectedComponents[i].length; k++) {\n connectedComponents[i][k].color = colors[i];\n }\n }\n }", "function calculateCommunityConnections() {\n var community_matrix = {}; //Get the number of connections between the communities\n\n edges.forEach(function (d) {\n var sc = node_by_id[d.source].community;\n var tc = node_by_id[d.target].community;\n if (typeof sc === 'undefined' || typeof tc === 'undefined' || sc === tc) return;\n var id = sc < tc ? sc + ',' + tc : tc + ',' + sc;\n if (!community_matrix[id]) community_matrix[id] = 0;\n community_matrix[id] += d.weight;\n }); //forEach\n //Convert the object into an array\n\n var connections = [];\n\n for (var duo in community_matrix) {\n var value = community_matrix[duo];\n var comm = duo.split(',');\n connections.push({\n community_a: +comm[0],\n community_b: +comm[1],\n connections: value\n });\n connections.push({\n community_a: +comm[1],\n community_b: +comm[0],\n connections: value\n });\n } //for\n\n\n return connections;\n } //function calculateCommunityConnections", "function isConnected(a, b) {\r\n return linkedByIndex[a.index + \",\" + b.index] || linkedByIndex[b.index + \",\" + a.index] || a.index == b.index;\r\n }", "function isConnection() {\n return state.core.isConnection(state.nodes[_id].node);\n }", "function linkedListComponent(head, G){\n let connect = false;\n let count = 0;\n while (head) {\n if (!G.includes(head.val)) {\n connect = false;\n } else if (!connect && G.includes(head.val)){\n count++;\n connect = true;\n }\n head = head.next;\n }\n return count;\n}", "foundSimilarConnections(nodes, edges) {\n let graphNewNodes = []\n let graphNewEdges = []\n for (let i=0; i < edges.length; ) {\n graphNewEdges.push(edges.shift())\n if(edges.length) {\n let indexes = []\n // eslint-disable-next-line no-loop-func\n let rez = edges.reduce((rez, item, i) => { \n if((item.from === graphNewEdges[graphNewEdges.length-1].from) & (item.to === graphNewEdges[graphNewEdges.length-1].to)) {\n rez+=', '+item.label\n indexes.push(i)\n }\n return rez }, [''])\n edges = edges.filter((item ,i) => !indexes.includes(i) && item)\n graphNewEdges[graphNewEdges.length-1].label+=rez\n }\n }\n if(!!!graphNewNodes.length) graphNewNodes = nodes\n if(!!!graphNewEdges.length) graphNewEdges = edges\n return { nodes: graphNewNodes, edges: graphNewEdges }\n }", "updatePathConnectForVertex(vertex) {\n\t\tconst {id} = vertex\n\n\t\t// Find edge start from this vertex\n\t\tconst arrSrcPaths = _.filter(this.dataContainer.edge, (e) => {\n\t\t\treturn e.source.vertexId === id\n\t\t})\n\t\t// Find edge end at this vertex\n\t\tconst arrDesPaths = _.filter(this.dataContainer.edge, (e) => {\n\t\t\treturn e.target.vertexId === id\n\t\t})\n\n\t\tarrSrcPaths.forEach(src => {\n\t\t\tlet prop = src.source.prop\n\t\t\tlet newPos = this.objectUtils.getCoordPropRelativeToParent(vertex, prop, TYPE_CONNECT.OUTPUT)\n\t\t\tsrc.source.x = newPos.x\n\t\t\tsrc.source.y = newPos.y\n\t\t\tlet options = {source: src.source}\n\t\t\tsrc.updatePathConnect(options)\n\t\t\tsrc.setStatusEdgeOnCurrentView()\n\t\t})\n\n\t\tarrDesPaths.forEach(des => {\n\t\t\tlet prop = des.target.prop\n\t\t\tlet newPos = this.objectUtils.getCoordPropRelativeToParent(vertex, prop, TYPE_CONNECT.INPUT)\n\t\t\tdes.target.x = newPos.x\n\t\t\tdes.target.y = newPos.y\n\t\t\tlet options = {target: des.target}\n\t\t\tdes.updatePathConnect(options)\n\t\t\tdes.setStatusEdgeOnCurrentView()\n\t\t})\n\t}", "function isConnectedLink(node, link) {\n //link.source and link.target is invalid as it had been automatically replaced with real data.\n if (link.target.index == node.index || link.source.index == node.index)\n return true;\n return false;\n }", "function connected(v, w) {\n return id(v) === id(w);\n }", "function isConnected(/* Graph */g) {\n\tvar src = g.verts[1];\n\tif (typeof src == \"undefined\"){\n\t\treturn false;\n\t}\n\tBFS(src);\n\t// If any vertex is not visited after BFS then the graph is not connected\n\tfor (var i = 0; i < g.verts.length; i++) {\n\t\tif (!g.verts[i].seen)\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "drawConnections (ctx) {\n let now = LiteGraph.getTime();\n\n //draw connections\n ctx.lineWidth = this.d_connections_width;\n\n ctx.fillStyle = \"#AAA\";\n ctx.strokeStyle = \"#AAA\";\n ctx.globalAlpha = this.d_editor_alpha;\n //for every node\n for (let n = 0, l = this.d_graph.d_nodes.length; n < l; ++n) {\n let node = this.d_graph.d_nodes[n];\n //for every input (we render just inputs because it is easier as every slot can only have one input)\n if (node.inputs && node.inputs.length)\n for (let i = 0; i < node.inputs.length; ++i) {\n let input = node.inputs[i];\n if (!input || input.link == null)\n continue;\n let link_id = input.link;\n let link = this.d_graph.d_links[link_id];\n if (!link)\n continue;\n\n let start_node = this.d_graph.getNodeById(link.origin_id);\n if (start_node == null) continue;\n let start_node_slot = link.origin_slot;\n let start_node_slotpos = null;\n\n if (start_node_slot == -1)\n start_node_slotpos = [start_node.pos[0] + 10, start_node.pos[1] + 10];\n else\n start_node_slotpos = start_node.getConnectionPos(false, start_node_slot);\n\n let color = LGraphCanvas.link_type_colors[node.inputs[i].type] || this.d_efault_link_color;\n\n this.d_renderLink(ctx, start_node_slotpos, node.getConnectionPos(true, i), color);\n\n if (link && link._last_time && now - link._last_time < 1000) {\n let f = 2.0 - (now - link._last_time) * 0.002;\n let color = \"rgba(255,255,255, \" + f.toFixed(2) + \")\";\n this.d_renderLink(ctx, start_node_slotpos, node.getConnectionPos(true, i), color, true, f);\n }\n }\n }\n ctx.globalAlpha = 1;\n }", "function CheckConnect(key, keyword_con, keyword_dis) {\n if (key == keyword_con) return \"connect\";\n return \"disconnect\";\n }", "isGraphCyclic(visitedNodes) {\n var currentNodeStack = [];\n return this.visitNode(visitedNodes, currentNodeStack, this.graph.idRoot, this.nodes.get(this.graph.idRoot)); \n }", "addConnection(from, to){\n\n /********************************************************\n * As an improvement first search for the newly created *\n * connection in Neat.connections list and assign it a *\n * proper innovation number. Then check whether this * \n * innovation number is less than the innovation number *\n * of the last element of this.connections. If so, only *\n * then search new_connection in this.connections *\n * otherwise don't. *\n ********************************************************/\n \n if(from.x == to.x){\n // Invalid connection\n return false;\n }\n\n // swap if from's x coordinate is less than to's x coordinate\n if(from.x > to.x){\n let tmp = from;\n from = to;\n to = tmp;\n }\n\n let new_connection = new ConnectionGene(from, to, Neat.connections.length + 1, Math.random() * 2 - 1, true); //ConnectionGene(fromNode, toNode, innovationNumber, weight, isEnabled);\n\n // check whether the newly created link is already present in the genome to avoid redundant links\n for(let connection of this.connections){\n //Two connections are identical if they start and end in identical nodes\n //Two nodes are identical if they are present in the same layer and have same innovation number \n if(new_connection.from.innovation_number == connection.from.innovation_number && new_connection.from.x == connection.from.x && new_connection.to.innovation_number == connection.to.innovation_number && new_connection.to.x == connection.to.x){\n\n //connection already present\n return false;\n\n }\n }\n\n let connectionFound = false;\n\n //check whether this connection has already been made \n for(let connection of Neat.connections){\n\n //Two connections are identical if they start and end in identical nodes\n //Two nodes are identical if they are present in the same layer and have same innovation number \n if(new_connection.from.innovation_number == connection.from.innovation_number && new_connection.from.x == connection.from.x && new_connection.to.innovation_number == connection.to.innovation_number && new_connection.to.x == connection.to.x){\n\n new_connection.innovation_number = connection.innovation_number;\n\n //connection found\n connectionFound = true;\n break;\n\n }\n }\n\n //if this connection has never been made before add it to Neat.connections list\n if(!connectionFound){\n Neat.connections.push(new_connection);\n }\n\n // sort links according to innovation number and then add to connections list which is necessary for crossover\n\n if(this.connections.length == 0){\n\n this.connections.push(new_connection);\n // add the new connection to connections list of \"to\" node which will be used to calculate its data\n new_connection.to.connections.push(new_connection);\n\n } else {\n\n this.insert_link_sorted(new_connection);\n\n }\n\n return new_connection;\n }", "connectionPoint(x, y) {\n return (\n x > this.x &&\n x < this.x + this.w &&\n y > this.y &&\n y < this.y + this.h\n );\n }", "isDependentConnection() {\n return !(this.drawToCenter === EConnectionCentered.NONE);\n }", "find_first_wire_connect(prev, cur){\n var startx = 0;\n var starty = 0;\n if(prev.posx+1 == cur.posx){\n startx = cur.posx*cell_size[0];\n starty = cur.posy*cell_size[1]+cell_size[1]/2;\n }\n if(prev.posx-1 == cur.posx){\n startx = cur.posx*cell_size[0]+cell_size[0];\n starty = cur.posy*cell_size[1]+cell_size[1]/2;\n }\n if(prev.posy+1 == cur.posy){\n startx = cur.posx*cell_size[0]+cell_size[0]/2;\n starty = cur.posy*cell_size[1];\n }\n if(prev.posy-1 == cur.posy){\n startx = cur.posx*cell_size[0]+cell_size[0]/2;\n starty = cur.posy*cell_size[1]+cell_size[1];\n }\n\n var endx = cur.posx*cell_size[0]+cell_size[0]/2;\n var endy = cur.posy*cell_size[1]+cell_size[1]/2;\n\n return {startx:startx, starty:starty, endx:endx, endy:endy};\n }", "calcStrength (dependency) {\n for (const i in this.graph) {\n if (i === dependency) {\n return (this.graph[i].length > 0) ? 1 : 0\n }\n }\n }", "function getConnectedAtPosition(source, position, element) {\n var bounds = {\n x: position.x - (element.width / 2),\n y: position.y - (element.height / 2),\n width: element.width,\n height: element.height\n };\n var closure = getAutoPlaceClosure(source, element);\n return Object(min_dash__WEBPACK_IMPORTED_MODULE_2__[\"find\"])(closure, function (target) {\n if (target === element) {\n return false;\n }\n var orientation = Object(diagram_js_lib_layout_LayoutUtil__WEBPACK_IMPORTED_MODULE_1__[\"getOrientation\"])(target, bounds, PLACEMENT_DETECTION_PAD);\n return orientation === 'intersect';\n });\n}", "function getl () {\r\n\r\n \r\nvar linksx = [];\r\nvar index, diffx;\r\n \r\nfor (var x = 0; x < nodesg.length; ++x) {\r\n(blocks[x] == undefined) ? blocks[x] = 0 : {};\r\n};\r\nfor (var j = 0; j < nodesg.length; ++j) {\r\nbestbl = Math.max.apply(null, blocks);\r\ndiffx = blocks[j] - bestbl;\r\nind = blocks.indexOf(bestbl);\r\n\r\n\r\n(blocks[j] == 0) ? nodesg[j].color = 'Red' :\r\n(diffx < -100) ? nodesg[j].color = 'OrangeRed' :\r\n(diffx < -10) ? nodesg[j].color = 'DarkOrange' : \r\n(diffx < -3) ? nodesg[j].color = 'Yellow' : \r\n(diffx <= 0) ? nodesg[j].color = 'Lime' : {}\r\n \r\n try {\r\n\r\n for (var k of peersx[j]) { \r\n index = ips.indexOf(k.address);\r\n if (~index) {\r\n if (blocks[index] == 0) continue //detect unreachable nodes\r\n linksx.push({\r\n source : nodesg[j].id,\r\n target : nodesg[index].id\r\n })\r\n } \r\n }\r\n } catch(e) {continue} \r\n };\r\n\r\n timerun(ind); // run timer\r\n runbest();\r\n\r\n // draw graph\r\n const gData = {\r\n nodes: nodesg,\r\n links: linksx\r\n };\r\n \r\n const elem = document.getElementById('dg');\r\n const Graph = ForceGraph3D()\r\n // { controlType: 'orbit' }\r\n (elem)\r\n .graphData(gData)\r\n .width(850)\r\n .height(500)\r\n .backgroundColor('#212A3F')\r\n .nodeLabel('id')\r\n .nodeResolution(16)\r\n .linkWidth(1)\r\n .linkDirectionalParticles(10)\r\n .onNodeHover(node => elem.style.cursor = node ? 'pointer' : null)\r\n .onNodeClick(node => {\r\n // Aim at node from outside it\r\n const distance = 40;\r\n const distRatio = 1 + distance/Math.hypot(node.x, node.y, node.z);\r\n Graph.cameraPosition(\r\n { x: node.x * distRatio, y: node.y * distRatio, z: node.z * distRatio }, // new position\r\n node, // lookAt ({ x, y, z })\r\n 3000 // ms transition duration\r\n );\r\n });\r\n\r\n}", "function checkATEconnections() {\n\n // reset array\n pathToATE.length = 0;\n\n // find an ATI module\n ate = firstOfType('ATE');\n\n // check if ate exists\n if (ate != -1) {\n\n // add nodes and path\n for (var i = 0, n = nodes.length; i < n; i++) {\n if (getTipoNo(nodes[i]) == 'CC') {\n pathToATE.push({\n startNode: i,\n endNode: ati,\n path: findPath(ate, i, neighbourNodes(ate, []), []).reverse()\n })\n }\n }\n }\n}", "function checkConnectionBetweenProps( target1, target2, excludedNodes ) {\n\tconst { subNodes: subNodes1, prevNodeMap: prevNodeMap1 } = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( target1, excludedNodes.subNodes );\n\tconst { subNodes: subNodes2, prevNodeMap: prevNodeMap2 } = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])( target2, excludedNodes.subNodes );\n\n\tfor ( const sharedNode of subNodes1 ) {\n\t\tif ( subNodes2.has( sharedNode ) ) {\n\t\t\tconst connection = [];\n\n\t\t\tconnection.push( sharedNode );\n\n\t\t\tlet node = prevNodeMap1.get( sharedNode );\n\n\t\t\twhile ( node && node !== target1 ) {\n\t\t\t\tconnection.push( node );\n\t\t\t\tnode = prevNodeMap1.get( node );\n\t\t\t}\n\n\t\t\tnode = prevNodeMap2.get( sharedNode );\n\n\t\t\twhile ( node && node !== target2 ) {\n\t\t\t\tconnection.unshift( node );\n\t\t\t\tnode = prevNodeMap2.get( node );\n\t\t\t}\n\n\t\t\tconsole.log( '--------' );\n\t\t\tconsole.log( { target1 } );\n\t\t\tconsole.log( { sharedNode } );\n\t\t\tconsole.log( { target2 } );\n\t\t\tconsole.log( { connection } );\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "areCousins(node1, node2) {}", "function getConnected(image) {\n let numbers = [];\n let nodes = image.pixels.map((v, i) => v == 0 ? i : undefined).filter(a => a != undefined) // not sure if this is efficient\n let visited = new Set();\n\n console.log('this many nodes ', nodes.length)\n for(node of nodes) {\n console.log('on node ', node)\n if(!visited.has(node)) {\n console.log(visited.size, 'found a non visited node')\n numbers.push(dfsUtil(image, node, visited))\n }\n }\n\n return numbers\n}", "graphColoring(graph, m) {\n // Initialize all color values as 0. This\n // initialization is needed correct functioning\n // of isSafe()\n this.color = new Array(this.v);\n for (let i = 0; i < this.v; i++)\n this.color[i] = 0;\n \n // Call graphColoringUtil() for vertex 0\n if (!this.graphColoringUtil(graph, m, this.color, 0)) {\n console.log(\"Solution does not exist\");\n return false;\n }\n \n // Print the solution\n this.printSolution(this.color);\n return true;\n }", "areCousins(node1, node2) {\n\n }", "areCousins(node1, node2) {\n\n }", "function color(graph) //function for graph coloring - greedy algorithm\r\n{\r\n graph.nodes.forEach(\r\n node => graph.colors[node] = \r\n graph.edges[node].map(x => graph.colors[x]). // get neighbors\r\n filter(color => color >= 0). // filter those neighbors with colors\r\n sort((a,b) => a-b). // sort - because algorithm always pick lowest possible color\r\n reduce((current,next) => current === next ? current+=1 : current , 0) //pick the lowest color\r\n )\r\n return graph;\r\n}", "function draw(graph, constraints) {\r\n var old_transform = g.attr(\"transform\")\r\n g.remove()\r\n g = moveg.append(\"g\").attr(\"transform\", old_transform)\r\n var linkedByIndex = {}\r\n var fgraph = {\r\n nodes: [],\r\n links: []\r\n }\r\n graph.links.forEach(d => { if (d.values[linkSetting].length > strength) fgraph.links.push(d) })\r\n fgraph.links.forEach(function (d) {\r\n linkedByIndex[d.source + \",\" + d.target] = d\r\n linkedByIndex[d.source.id + \",\" + d.target.id] = d\r\n })\r\n function isConnected(a, b) {\r\n return linkedByIndex[a.id + \",\" + b.id] || linkedByIndex[b.id + \",\" + a.id] || a.index == b.index\r\n }\r\n function hasConnections(a) {\r\n for (var property in linkedByIndex) {\r\n s = property.split(\",\")\r\n if ((s[0] == a.id || s[1] == a.id) && linkedByIndex[property]) return true\r\n }\r\n return false\r\n }\r\n\r\n // FILTERING INTERACTIVELY HAPPENS HERE\r\n fgraph.nodes = graph.nodes.filter(d => hasConnections(d))\r\n if (constraints !== null && constraints !== undefined) {\r\n fgraph.nodes = fgraph.nodes.filter(d => constraints.includes(+d.id))\r\n fgraph.links = fgraph.links.filter(d => (constraints.includes(+d.source.id) && constraints.includes(+d.target.id)))\r\n //console.log(fgraph)\r\n }\r\n\r\n\r\n var force = d3.forceSimulation()\r\n .nodes(fgraph.nodes)\r\n .force(\"link\", d3.forceLink(fgraph.links.slice(0)).id(d => d.id).distance(60))\r\n .force(\"charge\", d3.forceManyBody())\r\n .force(\"togetherness\", d3.forceCenter(w / 2, h / 2))\r\n .force(\"gravity\", d3.forceRadial(100).strength(0.01))\r\n var link = g.selectAll(\".link\")\r\n .data(fgraph.links).enter().append(\"line\")\r\n .attr(\"class\", \"link\")\r\n .style(\"stroke-width\", nominal_stroke)\r\n .style(\"stroke\", function (d) {\r\n return default_link_color\r\n })\r\n link.exit().remove()\r\n var node = g.selectAll(\".node\")\r\n .data(fgraph.nodes, d => d.id)\r\n .enter().append(\"g\")\r\n .attr(\"class\", \"node\")\r\n .call(drag(force))\r\n var tocolor = \"fill\"\r\n var towhite = \"stroke\"\r\n if (outline) {\r\n tocolor = \"stroke\"\r\n towhite = \"fill\"\r\n }\r\n // draw graph nodes, node text\r\n var circle = node.append(\"circle\")\r\n .attr(\"r\", 5)\r\n .style(tocolor, function (d) {\r\n return color(d.vote_average)\r\n })\r\n .style(\"stroke-width\", nominal_stroke)\r\n .style(towhite, \"white\");\r\n var text = g.selectAll(\".text\")\r\n .data(fgraph.nodes)\r\n .enter().append(\"text\")\r\n .attr(\"dy\", \".35em\")\r\n .style(\"font-size\", nominal_text_size + \"px\")\r\n .style(\"pointer-events\", \"none\")\r\n node.exit().remove()\r\n\r\n if (text_center)\r\n text.text(function (d) { return d.title; })\r\n .style(\"text-anchor\", \"middle\");\r\n else\r\n text.attr(\"dx\", function (d) { return (size(d.size) || nominal_base_node_size); })\r\n .text(function (d) { return '\\u2002' + d.title; });\r\n\r\n node.on(\"mouseover\", function (d) {\r\n if (!selected)\r\n set_highlight(d)\r\n }).on(\"mouseout\", function (d) {\r\n if (!selected)\r\n exit_highlight()\r\n })\r\n function exit_highlight() {\r\n drawRecs([], [], \"\")\r\n highlight_node = null\r\n if (focus_node === null) {\r\n svg.style(\"cursor\", \"move\")\r\n if (highlight_color != \"white\") {\r\n circle.style(towhite, \"white\").style(\"opacity\", 1)\r\n text.style(\"font-weight\", \"normal\")\r\n link.style(\"stroke\", function (o) { return default_link_color })\r\n }\r\n }\r\n }\r\n function set_focus(d) {\r\n if (d === null) {\r\n circle.style(\"opacity\", 1);\r\n text.style(\"opacity\", 1);\r\n link.style(\"opacity\", 1);\r\n }\r\n else if (highlight_trans < 1) {\r\n circle.style(\"opacity\", function (o) {\r\n return isConnected(d, o) ? 1 : highlight_trans\r\n });\r\n\r\n text.style(\"opacity\", function (o) {\r\n return isConnected(d, o) ? 1 : highlight_trans\r\n });\r\n\r\n link.style(\"opacity\", function (o) {\r\n return o.source.index == d.index || o.target.index == d.index ? 1 : highlight_trans\r\n });\r\n }\r\n }\r\n function set_highlight(d) {\r\n svg.style(\"cursor\", \"pointer\")\r\n if (focus_node !== null) d = focus_node\r\n highlight_node = d\r\n\r\n if (highlight_color != \"white\") {\r\n circle.style(towhite, function (o) {\r\n return isConnected(d, o) ? highlight_color : \"white\"\r\n })\r\n text.style(\"font-weight\", function (o) {\r\n return isConnected(d, o) ? \"bold\" : \"normal\"\r\n })\r\n link.style(\"stroke\", function (o) {\r\n return o.source.index == d.index || o.target.index == d.index ? highlight_color : (default_link_color)\r\n })\r\n neighbors = []\r\n circle.style(\"opacity\", function (o) {\r\n if (isConnected(d, o) && d !== o) neighbors.push(o)\r\n return (isConnected(d, o)) ? 1 : highlight_trans\r\n })\r\n }\r\n }\r\n zoom.on(\"zoom\", function () {\r\n /*var scale = d3.event.transform.k\r\n var stroke = nominal_stroke\r\n if (nominal_stroke * scale > max_stroke) stroke = max_stroke / scale\r\n link.style(\"stroke-width\", stroke)\r\n circle.style(\"stroke-width\", stroke)\r\n var base_radius = nominal_base_node_size\r\n if (nominal_base_node_size * scale > max_base_node_size) base_radius = max_base_node_size / scale\r\n if (!text_center) text.attr(\"dx\", function (d) { return (size(d.size) * base_radius / nominal_base_node_size || base_radius); })\r\n var text_size = nominal_text_size\r\n if (nominal_text_size * scale > max_text_size) text_size = max_text_size / scale\r\n text.style(\"font-size\", text_size + \"px\")*/\r\n var pos = d3.zoomTransform(\"#graph\")\r\n pos.x = d3.event.transform.x\r\n pos.y = d3.event.transform.y\r\n\r\n /*if (pos.k != scale) {\r\n //pos.k = scale\r\n moveg.transition().duration(100)\r\n .attr(\"transform\", \"translate(\" + d3.event.transform.x + \",\" + d3.event.transform.y + \")scale(\" + scale + \")\")\r\n\r\n //g.transition().duration(100).attr(\"transform\", \"translate(\" + d3.event.transform.x + \",\" + d3.event.transform.y + \")scale(\" + scale + \")\")\r\n }\r\n else {*/\r\n moveg.attr(\"transform\", \"translate(\" + d3.event.transform.x + \",\" + d3.event.transform.y + \")scale(1)\" /*scale*/)\r\n //}\r\n\r\n })\r\n svg.call(zoom).on(\"dblclick.zoom\", null).on(\"wheel.zoom\", null);\r\n force.on(\"tick\", function () {\r\n\r\n node.attr(\"transform\", function (d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; })\r\n text.attr(\"transform\", function (d) { return \"translate(\" + d.x + \",\" + d.y + \")\"; })\r\n\r\n link.attr(\"x1\", function (d) { return d.source.x; })\r\n .attr(\"y1\", function (d) { return d.source.y; })\r\n .attr(\"x2\", function (d) { return d.target.x; })\r\n .attr(\"y2\", function (d) { return d.target.y; })\r\n\r\n node.attr(\"cx\", function (d) { return d.x; })\r\n .attr(\"cy\", function (d) { return d.y; })\r\n })\r\n this.vfgraph = fgraph\r\n var init_x = 0, init_y = 0\r\n function drag(simulation) {\r\n function dragstarted(d) {\r\n if (!d3.event.active) simulation.alphaTarget(0.3).restart()\r\n d.fx = d.x\r\n d.fy = d.y\r\n init_x = d.x\r\n init_y = d.y\r\n if (!selected) {\r\n focus_node = d;\r\n set_focus(d)\r\n set_highlight(d)\r\n }\r\n }\r\n function dragged(d) {\r\n d.fx = d3.event.x\r\n d.fy = d3.event.y\r\n }\r\n function dragended(d) {\r\n if (!d3.event.active) simulation.alphaTarget(0)\r\n if (Math.sqrt(Math.pow(init_x - d.fx, 2) + Math.pow(init_y - d.fy, 2)) < 30) {\r\n if (selected) {\r\n if (d === focus_node) {\r\n focus_node = null\r\n set_focus(null)\r\n exit_highlight()\r\n selected = false\r\n } else {\r\n exit_highlight()\r\n focus_node = d\r\n set_focus(d)\r\n set_highlight(d)\r\n }\r\n } else {\r\n focus_node = d\r\n set_focus(d)\r\n set_highlight(d)\r\n selected = true\r\n }\r\n var pos = d3.zoomTransform(\"#graph\")\r\n var dcx = (w / 2) / 1 - (d.x + pos.x) * (1)\r\n var dcy = (h / 2) / 1 - (d.y + pos.y) * (1)\r\n g.transition().duration(750).attr(\"transform\", \"translate(\" + dcx + \",\" + dcy + \")scale(\" + 1 + \")\")\r\n var neighborlinks = []\r\n neighbors.sort((a, b) => {\r\n var alink = linkedByIndex[d.id + \",\" + a.id] == undefined ? linkedByIndex[a.id + \",\" + d.id] : linkedByIndex[d.id + \",\" + a.id]\r\n var blink = linkedByIndex[d.id + \",\" + b.id] == undefined ? linkedByIndex[b.id + \",\" + d.id] : linkedByIndex[d.id + \",\" + b.id]\r\n var countlinks = link => Object.keys(link.values).map(x => link.values[x].length).reduce((o1, o2) => o1 + o2)\r\n return countlinks(blink) - countlinks(alink)\r\n })\r\n neighbors.forEach(o => {\r\n neighborlinks.push(linkedByIndex[d.id + \",\" + o.id] == undefined ? linkedByIndex[o.id + \",\" + d.id] : linkedByIndex[d.id + \",\" + o.id])\r\n })\r\n drawRecs(neighbors, neighborlinks, focus_node.title)\r\n } else if (!selected) {\r\n focus_node = null\r\n set_focus(null)\r\n exit_highlight()\r\n selected = false\r\n }\r\n d.fx = null\r\n d.fy = null\r\n }\r\n if (mvs.length != 0) {\r\n console.log(mvs.filter(d => fgraph.nodes.some(x => (+x.id) == (+d.id))))\r\n //bubblechart(mvs.filter(d => fgraph.nodes.some(x => (+x.id) == (+d.id)), '.bubble', 'NULL'))\r\n // drawParallelChart(mvs.filter(d => fgraph.nodes.some(x => (+x.id) == (+d.id))), svgParaChart)\r\n }\r\n return d3.drag()\r\n .on(\"start\", dragstarted)\r\n .on(\"drag\", dragged)\r\n .on(\"end\", dragended)\r\n }\r\n}", "function getConnectedComponents(graph) {\n 'use strict';\n var visited = [],\n components = 0;\n for (var i = 0; i < graph.length; i += 1) {\n visited[i] = false;\n }\n for (i = 0; i < graph.length; i += 1) {\n if (!visited[i]) {\n dfs(graph, i, visited);\n components += 1;\n }\n }\n return components;\n}", "connect(ui, event) {\n if (this.reconnect === null) {\n // Create a new edge.\n\n // We attempt to guess what the intended label alignment is and what the intended edge\n // offset is, if the cells being connected form some path with existing connections.\n // Otherwise we revert to the currently-selected label alignment in the panel and the\n // default offset (0).\n const options = {\n // We will guess the label alignment below, but in case there's no selected label\n // alignment, we default to \"left\".\n label_alignment: \"left\",\n // The default settings for the other options are fine.\n };\n const selected_alignment\n = ui.panel.element.querySelector('input[name=\"label-alignment\"]:checked');\n if (selected_alignment !== null) {\n // If multiple edges are selected and not all selected edges have the same label\n // alignment, there will be no checked input.\n options.label_alignment = selected_alignment.value;\n }\n // If *every* existing connection to source and target has a consistent label alignment,\n // then `align` will be a singleton, in which case we use that element as the alignment.\n // If it has `left` and `right` in equal measure (regardless of `centre`), then\n // we will pick `centre`. Otherwise we keep the default. And similarly for `offset`.\n const align = new Map();\n const offset = new Map();\n // We only want to pick `centre` when the source and target are equally constraining\n // (otherwise we end up picking `centre` far too often). So we check that they're both\n // being considered equally. This means `centre` is chosen only rarely, but often in\n // the situations you want it. (This has no analogue in `offset`.)\n let balance = 0;\n\n const swap = (options) => {\n return {\n label_alignment: {\n left: \"right\",\n centre: \"centre\",\n over: \"over\",\n right: \"left\",\n }[options.label_alignment],\n offset: -options.offset,\n };\n };\n\n const conserve = (options, between) => {\n return {\n label_alignment: options.label_alignment,\n // We ignore the offsets of edges that aren't directly `between` the\n // source and target.\n offset: between ? options.offset : null,\n };\n };\n\n const consider = (options, tip) => {\n if (!align.has(options.label_alignment)) {\n align.set(options.label_alignment, 0);\n }\n align.set(options.label_alignment, align.get(options.label_alignment) + 1);\n if (options.offset !== null) {\n if (!offset.has(options.offset)) {\n offset.set(options.offset, 0);\n }\n offset.set(options.offset, offset.get(options.offset) + 1);\n }\n balance += tip;\n };\n\n const source_dependencies = ui.quiver.dependencies_of(this.source);\n const target_dependencies = ui.quiver.dependencies_of(this.target);\n for (const [edge, relationship] of source_dependencies) {\n consider({\n source: swap,\n target: options => conserve(options, target_dependencies.has(edge)),\n }[relationship](edge.options), -1);\n }\n for (const [edge, relationship] of target_dependencies) {\n consider({\n source: options => conserve(options, source_dependencies.has(edge)),\n target: swap,\n }[relationship](edge.options), 1);\n }\n\n if (align.size === 1) {\n options.label_alignment = align.keys().next().value;\n } else if (align.size > 0 && align.get(\"left\") === align.get(\"right\") && balance === 0) {\n options.label_alignment = \"centre\";\n }\n\n if (offset.size === 1) {\n options.offset = offset.keys().next().value;\n }\n\n if (!event.shiftKey && !event.metaKey && !event.ctrlKey) {\n ui.deselect();\n }\n const label = \"\";\n // The edge itself does all the set up, such as adding itself to the page.\n const edge = new Edge(ui, label, this.source, this.target, options);\n ui.select(edge);\n if (!event.shiftKey && !event.metaKey && !event.ctrlKey) {\n ui.panel.element.querySelector('label input[type=\"text\"]').focus();\n }\n\n return edge;\n } else {\n // Reconnect an existing edge.\n const { edge, end } = this.reconnect;\n // We might be reconnecting an edge by its source, in which case, we need to switch\n // the traditional order of `source` and `target`, because the \"source\" will actually\n // be the target and vice versa.\n // Generally, the fixed end is always `this.source`, even if it isn't actually the\n // edge's source. This makes the interaction behaviour simpler elsewhere, because\n // one can always assume that `state.target` is the possibly-null, moving endpoint\n // that is the one of interest.\n const [source, target] = {\n source: [this.target, this.source],\n target: [this.source, this.target],\n }[end];\n edge.reconnect(ui, source, target);\n return edge;\n }\n }", "function DoesGraphHaveCycle(GraphNodes)\n{\n\t// Run IsNodeCyclic on every node in the graph\n\tfor(var i=0;i<GraphNodes.length;++i)\n\t\tif(GraphNodes[i].IsCyclic())\n\t\t\treturn true;\n\treturn false;\n}", "function stillConnected(coord, arr){\r\n var arr_cp = deepCopy(arr);\r\n\r\n arr_cp[coord[0]][coord[1]] = true;\r\n \r\n var firstUnvisited = getFirstUnvisited(arr_cp);\r\n if (firstUnvisited === null)\r\n return true;\r\n \r\n var totUn = totalUnvisited(arr_cp);\r\n var numUnCon = numUnvisitedConnected(firstUnvisited, arr_cp);\r\n return totUn === numUnCon;\r\n}", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator471 = _createForOfIteratorHelper(subNodes1),\n _step471;\n\n try {\n for (_iterator471.s(); !(_step471 = _iterator471.n()).done;) {\n var sharedNode = _step471.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator471.e(err);\n } finally {\n _iterator471.f();\n }\n\n return false;\n }", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _ref84 = (0, _getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _ref84.subNodes,\n prevNodeMap1 = _ref84.prevNodeMap;\n\n var _ref85 = (0, _getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _ref85.subNodes,\n prevNodeMap2 = _ref85.prevNodeMap;\n\n var _iterator471 = _createForOfIteratorHelper(subNodes1),\n _step471;\n\n try {\n for (_iterator471.s(); !(_step471 = _iterator471.n()).done;) {\n var sharedNode = _step471.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator471.e(err);\n } finally {\n _iterator471.f();\n }\n\n return false;\n }", "is_connected() {\n return this.connected\n }", "connectNodes() {\n // drawing arrows between nodes\n for (let i = 0; i < this.rows.length - 1; i++) {\n const row1 = this.rows[i];\n const row2 = this.rows[i + 1];\n // keeps swapping directions until all nodes are connected\n // (i.e. row1->row2, row2->row1... takes 2 passes unless both rows are single nodes)\n let dir = 1;\n while (row1.filter(d => !d.lines.length).length || row2.filter(d => !d.lines.length).length) {\n let r1, r2;\n if (dir == 1) {\n r1 = row1;\n r2 = row2;\n }\n else {\n r1 = row2;\n r2 = row1;\n }\n for (let node of r1) {\n if (!node.lines.length) {\n let closest = this.getClosest(node, r2);\n if (dir == 1) {\n this.connect(closest, node);\n }\n else {\n this.connect(node, closest);\n }\n }\n }\n dir *= -1;\n }\n }\n }", "function checkConnectionBetweenProps(target1, target2, excludedNodes) {\n var _Object = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target1, excludedNodes.subNodes),\n subNodes1 = _Object.subNodes,\n prevNodeMap1 = _Object.prevNodeMap;\n\n var _Object2 = Object(_getsubnodes__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(target2, excludedNodes.subNodes),\n subNodes2 = _Object2.subNodes,\n prevNodeMap2 = _Object2.prevNodeMap;\n\n var _iterator504 = _createForOfIteratorHelper(subNodes1),\n _step504;\n\n try {\n for (_iterator504.s(); !(_step504 = _iterator504.n()).done;) {\n var sharedNode = _step504.value;\n\n if (subNodes2.has(sharedNode)) {\n var connection = [];\n connection.push(sharedNode);\n var node = prevNodeMap1.get(sharedNode);\n\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n\n node = prevNodeMap2.get(sharedNode);\n\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n\n console.log('--------');\n console.log({\n target1: target1\n });\n console.log({\n sharedNode: sharedNode\n });\n console.log({\n target2: target2\n });\n console.log({\n connection: connection\n });\n return true;\n }\n }\n } catch (err) {\n _iterator504.e(err);\n } finally {\n _iterator504.f();\n }\n\n return false;\n }", "getConnectedComponents() {\n\t\t// keep calling bfs with different starting points until there is no more vertexes left\n\t\tlet unusedVertexes = this.vertexes;\n\t\tlet components = [];\n\t\t// console.log(unusedVertexes)\n\n\t\twhile(unusedVertexes.length > 0) {\n\t\t\tlet randomVertex = unusedVertexes[Math.floor(Math.random() * unusedVertexes.length)];\n\t\t\t// console.log(randomVertex);\n\t\t\tconst component = this.bfs(randomVertex);\n\t\t\t// console.log(component);\n\t\t\tcomponents.push(component);\n\t\t\t// remove get difference of unusedVertexs and the vertexes in component just found.\n\t\t\tcomponent.forEach(v => {\n\t\t\t\t// console.log(v)\n\t\t\t\tif (unusedVertexes.filter(v1 => v1.value === v.value).length > 0) {\n\t\t\t\t\t// remove object\n\t\t\t\t\tconst removeIndex = unusedVertexes.map((i) => { return i.value; }).indexOf(v.value);\n\t\t\t\t\tunusedVertexes.splice(removeIndex, 1);\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\t// console.log(components);\n\t\treturn components;\n\t}", "function bridges(g) {\n\n var data = {low: Array(), pre: Array(), cnt: 0, bridges: Array()};\n g.nodes().forEach( () => {\n\tdata.low.push(-1);\n\tdata.pre.push(-1);\n }); \n _bridge_dfs(g, 0, 0, data) //only have to call from first node, since we only consider connected\n return data.bridges;\n}", "function calculateCoherentFlow() {\n // clear prior flow information\n dataFlowModel.resetCalculatedFlowInformation();\n infrastructureModel.resetCalculatedFlowInformation();\n\n // only re-calculate when all modules assigned\n if (dataFlowModel.checkAllModulesAssigned() === false) {\n console.log(\"Not all Modules are assigned yet, so not re-calculating.\");\n return;\n }\n\n console.log(\"All Modules are assigned, re-calculating coherent flow.\");\n\n const dataPaths = dataFlowModel.dataPaths.get();\n const impossiblePaths = [];\n\n for (let i = 0; i < dataPaths.length; i++) {\n const dataPath = dataPaths[i];\n const initialNodeId = dataFlowModel.nodeToModuleAssignments[dataPath_from(dataPath)];\n const finalNodeId = dataFlowModel.nodeToModuleAssignments[dataPath_to(dataPath)];\n\n if (initialNodeId === finalNodeId) {\n console.log(\"We don't need to calculate, because we stay on the same node\");\n } else {\n // let's get the dijkstra problem (-> considering the dataPath's required bandwidth)\n const problem = infrastructureModel\n .getDijkstraProblemForInfrastructure(dataPath_requiredBandwidth(dataPath));\n\n const dijkstraResult = dijkstra(problem, initialNodeId, finalNodeId);\n\n // DATA PATH IS NOT POSSIBLE\n if (dijkstraResult.dijkstraCost === \"Infinity\") {\n impossiblePaths.push(dataPath);\n }\n\n // THERE IS A PATH TO ANOTHER NODE\n console.log(\"Path involves these nodes: \" + dijkstraResult.path);\n\n // there is possibly no direct connection between lastNodeId and nextNodeId, that's why we do this\n // --> in this case we need to go via another node\n let n1 = undefined;\n let n2 = undefined;\n const idsOfInvolvedConnections = [];\n\n dijkstraResult.path.forEach(function (nodeId) {\n n2 = nodeId;\n\n if (n1 !== undefined && n2 !== undefined) {\n const connectionId = infrastructureModel.getConnectionIdBetweenNodes(n1, n2);\n // Taking a path requires bandwidth\n infrastructureModel.addUsedBandwidthToConnectionWithId(connectionId,\n dataPath_requiredBandwidth(dataPath));\n idsOfInvolvedConnections.push(connectionId);\n }\n\n n1 = n2;\n });\n\n // Let's save the path\n dataFlowModel.addFlowInformationToDataPath({\n dataPathId: dataPath_id(dataPath),\n involvedConnectionIds: idsOfInvolvedConnections\n });\n }\n }\n\n if (impossiblePaths.length === 0) {\n dataFlowModel.coherentFlowFound = true;\n console.log(\"A coherent flow was found!\");\n } else {\n // We calculated all paths and set the information. Now we have to clean up if a prior path was broken\n dataFlowModel.coherentFlowFound = false;\n console.log(\"No coherent flow exists\");\n\n impossiblePaths.forEach(function (impPath) {\n _clearSubsequentDataPathsRecursively(impPath, dataPath_id(impPath));\n });\n }\n\n // set the impossible paths\n dataFlowModel.impossiblePaths = impossiblePaths;\n\n // final step: let's calculate some more flow properties\n dataFlowModel.modules.forEach(function (module) {\n _calculateProcessingTimeForModuleWithId(module_id(module));\n _calculateProcessingCostForModuleWithId(module_id(module));\n });\n\n dataFlowModel.dataPaths.forEach(function (dataPath) {\n _calculateTransmissionTimeForDataPathWithId(dataPath_id(dataPath));\n _calculateTransmissionCostForDataPathWithId(dataPath_id(dataPath));\n });\n\n}", "indegree(graph){\n if ( !(graph instanceof Graph) )\n throw new TypeError(ENOTGRAPH)\n return graph.indegree(this)\n //return graph.edges.filter(edge => edge.in && edge.in.includes(this))\n }", "function clusticEdgeStraightening(graph) {\n //Set x-coordinate of all vertices in the graph\n setWithinLayerXCoordinate(graph);\n\n //Until convergence to some value\n sweepXCoordinateDownUp(graph);\n sweepXCoordinateUpDown(graph);\n sweepXCoordinateDownUp(graph);\n sweepXCoordinateUpDown(graph);\n\n}", "function getNotCalcCons() {\n\treturn Connections\n\t\t.filter(function(c){\n\t\t\tif(balMat(c.from)==false || balMat(c.to)==false)\n\t\t\t\treturn true;\n\t\t\telse \n\t\t\t\treturn false;\n\t\t})\n\t\t.length\n}", "function addConnection(){\n\n\n\t\t//draw horizontal part of connection spouses\n\t\tarrayConnections.push(new Connection2(arrayRelationship[0].begining_x_middle_horizontal, arrayRelationship[0].begining_y_middle_horizo1l, arrayRelationship[0].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[0].begining_y_middle_horizo1l)));\n\t\tarrayConnections.push(new Connection2(arrayRelationship[3].begining_x_middle_horizontal, arrayRelationship[3].begining_y_middle_horizo1l, arrayRelationship[3].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[3].begining_y_middle_horizo1l)));\n\t\tarrayConnections.push(new Connection2(arrayRelationship[5].begining_x_middle_horizontal, arrayRelationship[5].begining_y_middle_horizo1l, arrayRelationship[5].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[5].begining_y_middle_horizo1l)));\n\t\tarrayConnections.push(new Connection2(arrayRelationship[9].begining_x_middle_horizontal, arrayRelationship[9].begining_y_middle_horizo1l, arrayRelationship[9].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[9].begining_y_middle_horizo1l)));\n\t\tarrayConnections.push(new Connection2(arrayRelationship[10].begining_x_middle_horizontal, arrayRelationship[10].begining_y_middle_horizo1l, arrayRelationship[10].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[10].begining_y_middle_horizo1l)));\n\t\tarrayConnections.push(new Connection2(arrayRelationship[18].begining_x_middle_horizontal, arrayRelationship[18].begining_y_middle_horizo1l, arrayRelationship[18].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[18].begining_y_middle_horizo1l)));\t\n\t\tarrayConnections.push(new Connection2(arrayRelationship[13].begining_x_middle_horizontal, arrayRelationship[13].begining_y_middle_horizo1l, arrayRelationship[13].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[13].begining_y_middle_horizo1l)));\n\t\tarrayConnections.push(new Connection2(arrayRelationship[14].begining_x_middle_horizontal, arrayRelationship[14].begining_y_middle_horizo1l, arrayRelationship[14].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[14].begining_y_middle_horizo1l)));\n\t\tarrayConnections.push(new Connection2(arrayRelationship[15].begining_x_middle_horizontal, arrayRelationship[15].begining_y_middle_horizo1l, arrayRelationship[15].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[15].begining_y_middle_horizo1l)));\n\t\tarrayConnections.push(new Connection2(arrayRelationship[17].begining_x_middle_horizontal, arrayRelationship[17].begining_y_middle_horizo1l, arrayRelationship[17].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[17].begining_y_middle_horizo1l)));\n\t\tarrayConnections.push(new Connection2(arrayRelationship[3].begining_x_middle_horizontal, arrayRelationship[3].begining_y_middle_horizo1l, arrayRelationship[3].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[3].begining_y_middle_horizo1l)));\n\t\tarrayConnections.push(new Connection2(arrayRelationship[5].begining_x_middle_horizontal, arrayRelationship[5].begining_y_middle_horizo1l, arrayRelationship[5].begining_x_middle_horizontal + SEPARATION, (arrayRelationship[5].begining_y_middle_horizo1l)));\n\t\n\n\t\t \n\t\t //draw vertical part of connection for siblings\n\t\t arrayConnections.push(new Connection2(arrayRelationship[5].begining_x_middle_vertical, arrayRelationship[5].drawY, arrayRelationship[5].begining_x_middle_vertical, (arrayRelationship[5].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[4].begining_x_middle_vertical, arrayRelationship[4].drawY, arrayRelationship[4].begining_x_middle_vertical, (arrayRelationship[4].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[6].begining_x_middle_vertical, arrayRelationship[6].drawY, arrayRelationship[6].begining_x_middle_vertical, (arrayRelationship[6].drawY -30)));\n\t\t //arrayConnections.push(new Connection2(arrayRelationship[8].begining_x_middle_vertical, arrayRelationship[8].drawY, arrayRelationship[8].begining_x_middle_vertical, (arrayRelationship[8].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[7].begining_x_middle_vertical, arrayRelationship[7].drawY, arrayRelationship[7].begining_x_middle_vertical, (arrayRelationship[7].drawY -30)));\n\n\t\t arrayConnections.push(new Connection2(arrayRelationship[11].begining_x_middle_vertical, arrayRelationship[11].drawY, arrayRelationship[11].begining_x_middle_vertical, (arrayRelationship[11].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[12].begining_x_middle_vertical, arrayRelationship[12].drawY, arrayRelationship[12].begining_x_middle_vertical, (arrayRelationship[12].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[13].begining_x_middle_vertical, arrayRelationship[13].drawY, arrayRelationship[13].begining_x_middle_vertical, (arrayRelationship[13].drawY -30)));\n\t\t //arrayConnections.push(new Connection2(arrayRelationship[8].begining_x_middle_vertical, arrayRelationship[8].drawY, arrayRelationship[8].begining_x_middle_vertical, (arrayRelationship[8].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[14].begining_x_middle_vertical, arrayRelationship[14].drawY, arrayRelationship[14].begining_x_middle_vertical, (arrayRelationship[14].drawY -30)));\t\t \n\n\t\t arrayConnections.push(new Connection2(arrayRelationship[15].begining_x_middle_vertical, arrayRelationship[15].drawY, arrayRelationship[15].begining_x_middle_vertical, (arrayRelationship[15].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[16].begining_x_middle_vertical, arrayRelationship[16].drawY, arrayRelationship[16].begining_x_middle_vertical, (arrayRelationship[16].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[17].begining_x_middle_vertical, arrayRelationship[17].drawY, arrayRelationship[17].begining_x_middle_vertical, (arrayRelationship[17].drawY -30)));\n\t\t //arrayConnections.push(new Connection2(arrayRelationship[8].begining_x_middle_vertical, arrayRelationship[8].drawY, arrayRelationship[8].begining_x_middle_vertical, (arrayRelationship[8].drawY -30)));\n\t\t //arrayConnections.push(new Connection2(arrayRelationship[23].begining_x_middle_vertical, arrayRelationship[23].drawY, arrayRelationship[23].begining_x_middle_vertical, (arrayRelationship[23].drawY -30)));\n\n\t\t //arrayConnections.push(new Connection2(arrayRelationship[24].begining_x_middle_vertical, arrayRelationship[24].drawY, arrayRelationship[24].begining_x_middle_vertical, (arrayRelationship[24].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[25].begining_x_middle_vertical, arrayRelationship[25].drawY, arrayRelationship[25].begining_x_middle_vertical, (arrayRelationship[25].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[26].begining_x_middle_vertical, arrayRelationship[26].drawY, arrayRelationship[26].begining_x_middle_vertical, (arrayRelationship[26].drawY -30)));\n\t\t //arrayConnections.push(new Connection2(arrayRelationship[8].begining_x_middle_vertical, arrayRelationship[8].drawY, arrayRelationship[8].begining_x_middle_vertical, (arrayRelationship[8].drawY -30)));\n\t\t// arrayConnections.push(new Connection2(arrayRelationship[27].begining_x_middle_vertical, arrayRelationship[27].drawY, arrayRelationship[27].begining_x_middle_vertical, (arrayRelationship[27].drawY -30)));\t\t \n\n\n\n\t\t arrayConnections.push(new Connection2(arrayRelationship[28].begining_x_middle_vertical, arrayRelationship[28].drawY, arrayRelationship[28].begining_x_middle_vertical, (arrayRelationship[28].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[29].begining_x_middle_vertical, arrayRelationship[29].drawY, arrayRelationship[29].begining_x_middle_vertical, (arrayRelationship[29].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[30].begining_x_middle_vertical, arrayRelationship[30].drawY, arrayRelationship[30].begining_x_middle_vertical, (arrayRelationship[30].drawY -30)));\n\n\n\t\t//draw horizontal connections for siblings\n\t\t arrayConnections.push(new Connection2(arrayRelationship[4].begining_x_middle_vertical, arrayRelationship[7].drawY -30, arrayRelationship[7].begining_x_middle_vertical, (arrayRelationship[7].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[11].begining_x_middle_vertical, arrayRelationship[12].drawY -30, arrayRelationship[12].begining_x_middle_vertical, (arrayRelationship[12].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[13].begining_x_middle_vertical, arrayRelationship[15].drawY -30, arrayRelationship[15].begining_x_middle_vertical, (arrayRelationship[15].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[16].begining_x_middle_vertical, arrayRelationship[17].drawY -30, arrayRelationship[17].begining_x_middle_vertical, (arrayRelationship[17].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[25].begining_x_middle_vertical, arrayRelationship[26].drawY -30, arrayRelationship[26].begining_x_middle_vertical, (arrayRelationship[26].drawY -30)));\n\t\t arrayConnections.push(new Connection2(arrayRelationship[28].begining_x_middle_vertical, arrayRelationship[30].drawY -30, arrayRelationship[30].begining_x_middle_vertical, (arrayRelationship[30].drawY -30)));\n\n\t\t//draw vertical part of connection FOR SPOUSES\n\t\tarrayConnections.push(new Connection2((arrayRelationship[0].begining_x_middle_horizontal+(SEPARATION)/2), arrayRelationship[0].begining_y_middle_horizo1l, (arrayRelationship[0].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[2].drawY)));\n\t\tarrayConnections.push(new Connection2((arrayRelationship[3].begining_x_middle_horizontal+(SEPARATION)/2), arrayRelationship[3].begining_y_middle_horizo1l, (arrayRelationship[3].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[5].drawY -30)));\n\t\t//THIS IS THE EXEPTION\n\t\tarrayConnections.push(new Connection2((arrayRelationship[5].begining_x_middle_horizontal+(SEPARATION)/2), arrayRelationship[5].begining_y_middle_horizo1l, (arrayRelationship[5].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[11].drawY -90)));\n\t\t\t\tarrayConnections.push(new Connection2((arrayRelationship[5].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[11].drawY -90),arrayRelationship[11].begining_x_middle_vertical+80, arrayRelationship[12].drawY -30));\n\t\t\n\t\tarrayConnections.push(new Connection2((arrayRelationship[9].begining_x_middle_horizontal+(SEPARATION)/2), arrayRelationship[9].begining_y_middle_horizo1l, (arrayRelationship[9].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[13].drawY -30)));\n\t\t\n\t\t//THIS IS AN EXEPTION\n\t\tarrayConnections.push(new Connection2((arrayRelationship[10].begining_x_middle_horizontal+(SEPARATION)/2), arrayRelationship[10].begining_y_middle_horizo1l, (arrayRelationship[10].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[16].drawY -90)));\n\t\t\t\tarrayConnections.push(new Connection2((arrayRelationship[10].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[16].drawY -90),arrayRelationship[16].begining_x_middle_vertical+80, arrayRelationship[17].drawY -30));\n\t\t\t\t\n\t\t\n\t\tarrayConnections.push(new Connection2((arrayRelationship[17].begining_x_middle_horizontal+(SEPARATION)/2), arrayRelationship[17].begining_y_middle_horizo1l, (arrayRelationship[17].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[28].drawY -30)));\n\t\tarrayConnections.push(new Connection2((arrayRelationship[15].begining_x_middle_horizontal+(SEPARATION)/2), arrayRelationship[15].begining_y_middle_horizo1l, (arrayRelationship[15].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[27].drawY)));\n\t\tarrayConnections.push(new Connection2((arrayRelationship[18].begining_x_middle_horizontal+(SEPARATION)/2), arrayRelationship[18].begining_y_middle_horizo1l, (arrayRelationship[18].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[23].drawY)));\n\t\tarrayConnections.push(new Connection2((arrayRelationship[13].begining_x_middle_horizontal+(SEPARATION)/2), arrayRelationship[13].begining_y_middle_horizo1l, (arrayRelationship[13].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[24].drawY)));\n\t\tarrayConnections.push(new Connection2((arrayRelationship[14].begining_x_middle_horizontal+(SEPARATION)/2), arrayRelationship[14].begining_y_middle_horizo1l, (arrayRelationship[14].begining_x_middle_horizontal+(SEPARATION)/2), (arrayRelationship[25].drawY-30)));\n\t\n\t\t\t\t\t\n}", "is_edge() {\n return this.level > 0;\n }", "function connected(x1,y1,x2,y2)\r\n{\r\n\t// FOR ALL HEX'S IN A GRID AROUND HEX 1\r\n\tfor (var i=-1;i<2;i++)\r\n\t{\r\n\t\tfor (var j=-1;j<2;j++)\r\n\t\t{\r\n\t\t\tif ((x1+i >= 0 && x1+i < gridSize) && (y1+j >= 0 && y1+j < gridSize) && (i != j)) // ARE WE INSIDE GRID AND NOT A CORNER OR CENTER?\r\n\t\t\t{\r\n\t\t\t\tif (x1+i == x2 && y1+j == y2)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn false;\r\n}", "function isConnectEvent(event) {\n return event && event.type && (event.type === 'connected');\n}", "function ConnectedPosition() { }", "function betweenCentrality(temp_edges, temp_nodes) {\n \n var betweenCentrality = [];\n var shortPathsPassingThru = [];\n //create graph\n var graph = {};\n\n var layout = {};\n\n for (var x = 0; x < temp_nodes.length; x++) {\n var allPossiblePaths = []; // disjktra\n var allPossibleShortPaths = [];\n var allShortPaths = [];\n var froms = [];\n var tos = [];\n for (var y = 0; y < temp_edges.length; y++) {\n\n if (x == temp_edges[y].to) {\n froms.push(temp_edges[y].from);\n //for dijkstra\n allPossiblePaths.push('' + (temp_edges[y].from));\n }\n else if (x == temp_edges[y].from) {\n tos.push(temp_edges[y].to);\n //for dijkstra\n allPossiblePaths.push('' + (temp_edges[y].to));\n }\n else {\n allShortPaths.push({\n to: temp_edges[y].to,\n from: temp_edges[y].from\n });\n\n }\n\n }\n\n layout[x] = allPossiblePaths;\n\n\n\n shortPathsPassingThru.push({\n node: x,\n to: tos,\n from: froms,\n allothers: allShortPaths\n });\n }\n\n for (var id in layout) {\n if (!graph[id])\n graph[id] = {};\n layout[id].forEach(function (aid) {\n graph[id][aid] = 1;\n if (!graph[aid])\n graph[aid] = {};\n graph[aid][id] = 1;\n });\n }\n\n for (var x = 0; x<temp_nodes.length; x++) {\n //choose start node\n var start = '' + x;\n //get all solutions\n var solutions = solve(graph, start);\n \n var label = \"\";\n //console.log(\"From '\" + start + \"' to\");\n //display solutions\n for (var s in solutions) {\n \n if (!solutions[s]) continue;\n for (var y = 0; y < temp_nodes.length; y++) {\n if (temp_nodes[y].id == s) {\n label = temp_nodes[y].label;\n }\n }\n averagePaths.push({\n\n from: x,\n to: \" -> \" + s + \" [ \" + label + \" ] \" + \": [\" + solutions[s].join(\", \") + \"] (dist:\" + solutions[s].dist + \")\"\n });\n \n }\n }\n\n var max = 0;\n //finding the most active node\n var activeNode = { node:0, betweenCentrality:0 };\n for (var x = 0; x<shortPathsPassingThru.length; x++) {\n var pathsThru = shortPathsPassingThru[x].to.length + shortPathsPassingThru[x].from.length;\n var otherPaths = shortPathsPassingThru[x].allothers.length;\n var betweeness = pathsThru / otherPaths;\n\n betweenCentrality.push({\n node: shortPathsPassingThru[x].node,\n betweeness: betweeness,\n });\n\n if (betweeness >= max) {\n max = betweeness;\n activeNode = { node: betweenCentrality[x].node, betweenCentrality: betweenCentrality[x].betweeness };\n }\n }\n\n return activeNode;\n\n}", "function graphColoring(graph, m) {\n // Initialize all color values as 0. This\n // initialization is needed correct functioning\n // of isSafe()\n color = Array(V);\n for (let i = 0; i < V; i++) color[i] = 0;\n\n // Call graphColoringUtil() for vertex 0\n if (!graphColoringUtil(graph, m, color, 0)) {\n console.log('Solution does not exist');\n return false;\n }\n\n // Print the solution\n printSolution(color);\n return true;\n}", "function findConnectedNodes({nodes, models, numOfNodes}, nodeID) {\n const connected = R.repeat(false, numOfNodes),\n q = [nodeID];\n\n while (q.length !== 0) {\n const currNodeID = q.shift(),\n tConnectors = nodes[currNodeID];\n\n for (let i = 0; i < tConnectors.length; i++) {\n const modelID = tConnectors[i].viewID,\n connectedNodes = models[modelID].nodes;\n\n for (let j = 0; j < connectedNodes.length; j++) {\n const connectedNode = connectedNodes[j];\n if (!connected[connectedNode]) {\n connected[connectedNode] = true;\n q.push(connectedNode);\n }\n }\n }\n }\n return connected;\n}", "function connectedNodes(n) {\n //Save the edges for which n is a target and the source is a region, country or element\n var connected_edges = edges.filter(function (d) {\n return d.target === n && (d.source.type === 'region' || d.source.type === 'country' || d.source.type === 'element');\n }); //https://stackoverflow.com/questions/1374126\n //Save in array for drawing\n\n edges_selected.push.apply(edges_selected, connected_edges); //Find the nodes connected to this node for which n is a target and the source is a region, country or element\n\n var connected_nodes = nodes.filter(function (d) {\n return edge_by_id[d.id + ',' + n.id] && (d.type === 'region' || d.type === 'country' || d.type === 'element');\n }); //Save in array for drawing\n\n nodes_selected.push.apply(nodes_selected, connected_nodes); //If there are nodes in the list redo the same function for each node\n\n if (connected_nodes.length > 0) connected_nodes.forEach(function (d) {\n connectedNodes(d);\n });\n } //function connectedNodes", "function connectedNodes(n) {\n //Save the edges for which n is a target and the source is a region, country or element\n var connected_edges = edges.filter(function (d) {\n return d.target === n && (d.source.type === 'region' || d.source.type === 'country' || d.source.type === 'element');\n }); //https://stackoverflow.com/questions/1374126\n //Save in array for drawing\n\n edges_selected.push.apply(edges_selected, connected_edges); //Find the nodes connected to this node for which n is a target and the source is a region, country or element\n\n var connected_nodes = nodes.filter(function (d) {\n return edge_by_id[d.id + ',' + n.id] && (d.type === 'region' || d.type === 'country' || d.type === 'element');\n }); //Save in array for drawing\n\n nodes_selected.push.apply(nodes_selected, connected_nodes); //If there are nodes in the list redo the same function for each node\n\n if (connected_nodes.length > 0) connected_nodes.forEach(function (d) {\n connectedNodes(d);\n });\n } //function connectedNodes", "connected() {}", "connected(n1, n2) {\n console.log(\"Testing connection between \" + n1 + ' and ' + n2);\n return (this.root(n1) == this.root(n2));\n }", "function clusticEdgeCrossingMinimization(graph) {\n setWithinLayerXCoordinate(graph);\n\n //Until convergence to some value\n var convergenceValue = 100;\n for (var i = 0; i < convergenceValue; i++) {\n sweepDownUp(graph);\n sweepUpDown(graph);\n };\n}", "edgeAnalysis() {\n if (this.progressReport) this.progressReport.increaseStep()\n this.imgm.initNodeLayer()\n\n // Looping through all pixels and calculating edge node type\n for (let y = 1; y < this.imgm.colorLayer.length; y++) {\n for (let x = 1; x < this.imgm.colorLayer[0].length; x++) {\n this.imgm.nodeLayer[y][x] =\n (this.imgm.colorLayer[y - 1][x] === this.colorIdentifier ? 1 : 0) +\n (this.imgm.colorLayer[y - 1][x - 1] === this.colorIdentifier ? 2 : 0) +\n (this.imgm.colorLayer[y][x] === this.colorIdentifier ? 4 : 0) +\n (this.imgm.colorLayer[y][x - 1] === this.colorIdentifier ? 8 : 0)\n }\n if (this.progressReport)\n this.progressReport.report(this.imgm.colorLayer.length, y)\n }\n\n return this.imgm.nodeLayer\n }", "isConnected(nodeA, nodeB) {\n return this.data.get(nodeA).includes(nodeB)\n }", "function connect(peer_name,other_component_description)\n\t{\n\t if(!(component_description.name in other_component_description.inputs))\n\t\t{\n\t\t console.log(new Error(\"bitstamp_announcer_start - trying to connect wrong components. \"+other_component_description.name+' doesnt have in inputs '+component_description.name+'.').stack,\" to \",\"other_component_description=\",other_component_description,\" from \" ,'component_description=',component_description)\n\t\t return\n\t\t}\n\t\t\t\n\t\t//if(isconnected(other_component_description))\n\t\t//{\n\t\t// console.log(new Error(\"bitstamp_announcer_start - already connected components. \"+other_component_description.name+' doesnt have in inputs '+component_description.name+'.').stack,\" to \",\"other_component_description=\",other_component_description,\" from \" ,'component_description=',component_description)\n\t\t// return\n\t\t//}\n\t\t\n\t\tvar endpoint=other_component_description.inputs[component_description.name];\n\t\t\n\t\tvar port=endpoint.zmqport;\n\t\tvar myexternalip=zmq_getExternalIp();\n\t\tport=port.replace(/127.0.0.1|0.0.0.0|\\*/,myexternalip==endpoint.externalip?'127.0.0.1':endpoint.externalip);\n\t\tvar zmq1 = zmqconnect(port,component_description.name+' to '+other_component_description.name);\n\t\tif(!clients[other_component_description.name]){clients[other_component_description.name]=[];}\n\t\tclients[other_component_description.name].push(zmq1);\n\t\tif(!clients_bypeer[peer_name]){clients_bypeer[peer_name]=[];}\n\t\tclients_bypeer[peer_name].push(zmq1);\n\t\tclients_all.push(zmq1);\n\t\t//zmq.on('message', function on_zmq_client_message(zmq_client,message)\n\t\t//{\n\t\t// console.log('on_zmq_client_message(zmq_client,message) '+message.toString());\n\t\t//})\n\t}", "isReachable(vertID1, vertID2, curr=null, path=[]) {\n if(curr == vertID1) {\n return [];\n }\n if(curr == vertID2) {\n path.push(curr);\n return path;\n }\n let result = [];\n curr = curr || vertID1;\n for(let edge of this.edgeList) {\n if(edge[0] == curr) {\n path.push(edge[0]);\n result.push(this.isReachable(vertID1, vertID2, edge[1], path));\n }\n }\n return result;\n }", "function graphColoring(graph, m, containarray, board){\n\n let color = []\n for (let i = 0; i < V; i++){\n color[i] = 0;\n }\n\n // Call function graphColoringCheck for vertex 0\n if (graphColoringCheck(graph, m, color, 0, containarray, board) == false){\n console.log(\"No Solution\");\n return false;\n }\n\n // Print the solution\n printSolution(color, containarray, board);\n return true;\n}", "addEdge(vrx1, vrx2, weight = 0) { // !toLowerCase or toUpperCase args case apsent\n if (!vrx1 || !vrx2) return undefined; // arguments edge case\n let vrx1found = false; // assign variable for duplicates check in vrx1 values\n let vrx2found = false; // assign variable for duplicates check in vrx2 values\n if (!this.adjacencyList[vrx1].length && !this.adjacencyList[vrx2].length) {\n // if both vertices are empty push new node to each one\n this.adjacencyList[vrx1].push({ node: vrx2, weight: weight });\n this.adjacencyList[vrx2].push({ node: vrx1, weight: weight });\n } else if (this.adjacencyList[vrx1].length && this.adjacencyList[vrx2].length) {\n // if both vertices are not empty\n this.adjacencyList[vrx1].forEach(el => { // iterate through elements\n if (el.node === vrx2) { // if such node already exist\n vrx1found = true; // mark duplication\n }\n });\n this.adjacencyList[vrx2].forEach(el => { // iterate through element\n if (el.node === vrx1) { // if such node already exist\n vrx2found = true; // mark duplication\n }\n });\n // add new nodes if such were not found among vertices values\n if (!vrx1found) this.adjacencyList[vrx1].push({ node: vrx2, weight: weight });\n if (!vrx2found) this.adjacencyList[vrx2].push({ node: vrx1, weight: weight });\n } else if (!this.adjacencyList[vrx1].length && this.adjacencyList[vrx2].length) {\n // if only first vertex is empty add new node to it's values\n this.adjacencyList[vrx1].push({ node: vrx2, weight: weight });\n // check second vertex values for duplication node\n this.adjacencyList[vrx2].forEach(el => {\n if (el.node === vrx1) {\n vrx2found = true;\n }\n });\n // if duplication node was not found, add new node to second vertex values\n if (!vrx2found) this.adjacencyList[vrx2].push({ node: vrx1, weight: weight });\n } else if (this.adjacencyList[vrx1].length && !this.adjacencyList[vrx2].length) {\n // if only second vertex is empty add new node to it's values\n this.adjacencyList[vrx2].push({ node: vrx1, weight: weight });\n // check first vertex values for duplication node\n this.adjacencyList[vrx1].forEach(el => {\n if (el.node === vrx2) {\n vrx1found = true;\n }\n });\n // if duplication node was not found, add new node to first vertex values\n if (!vrx1found) this.adjacencyList[vrx1].push({ node: vrx2, weight: weight });\n }\n return this; // still not working correctly \n }", "function johnson(component) {\n\n var Blocked = Array(component.length).fill(false); //blocked\n var BlockedMap = Array(component.length).fill([]); //B\n var stack = [];\n var stackEdges = [];\n var foundCycle = false;\n var startvertex = 0;\n\n for (var vertex = 0; vertex < component.length; vertex++) {\n startvertex = vertex;\n findCycles(vertex);\n BlockedMap = Array(component.length).fill([]);\n Blocked = Array(component.length).fill(false);\n }\n\n function unblock ( u ) {\n Blocked[u] = false; // unblock current node u\n for (var w in BlockedMap[u]) { // for every node that u blocks\n var targetBlock = BlockedMap[u][w]; // unblock that vertex aswell.\n if (Blocked[targetBlock]) unblock(targetBlock);\n }\n BlockedMap[u] = []; // empty blocked map!\n }\n\n function findCycles (v) {\n\n if(performance.now() - t1 > timeout)\n {\n throw new Error(\"Implementation timed out! at \" + timeout + \" milliseconds\");\n }\n // TAKE BACK WHEN NOT STUDYING EDGE CASES\n\n var result = [];\n var resultEdges = [];\n stack.push(v); // push indedx of vertex (in component)\n Blocked[v] = true;\n for (var edge in component[v].referenceList) {\n edgeRef = component[v].referenceList[edge];\n if (edgeRef.reference.jIndex === startvertex) {\n foundCycle = true;\n stackEdges.push(edgeRef.label);\n for(var item in stack) {\n result.push({\"vertex\":component[stack[item]],\"refLabel\":stackEdges[item]});\n }\n result.push({\"vertex\":component[startvertex],\"refLabel\":\"\"});\n stackEdges.pop();\n\n // results provided here!\n // save_mode 0 no save, 1 in mem, 2 in file.\n // if file save to 2\n\n if(save_mode == 1)\n {\n allCycles.push(result); // Uncomment next.\n }\n else if(save_mode == 2)\n {\n var outputstring = \"\";\n\n for(var item in result)\n {\n outputstring += result[item][\"vertex\"].vertexID;\n if(result[item][\"refLabel\"] == \"#interface_ref\") outputstring += \" <~implemets- \";\n else if(result[item][\"refLabel\"] == \"#union_ref\") outputstring += \" -union-> \";\n else outputstring += \" -[\" + result[item][\"refLabel\"] + \"]-> \";\n }\n outputstring = outputstring.slice(0,-7);\n outputstring += \" }\\n\";\n fs.appendFileSync(flag_or_cfile, outputstring);\n }\n //allCycles.push(result); // Uncomment next.\n cycles_found++;\n result = [];\n resultEdges = [];\n }\n\n else if (!Blocked[edgeRef.reference.jIndex] && startvertex < edgeRef.reference.jIndex && !stack.includes(edgeRef.reference.jIndex)) { // added last\n\n stackEdges.push(edgeRef.label);\n var foundCycle = findCycles(edgeRef.reference.jIndex);\n }\n }\n if (foundCycle) unblock(v);\n else {\n for (var wt in component[v].referenceList) { //w in component\n w = component[v].referenceList[wt].reference.jIndex\n if ( !BlockedMap[w].includes(v)) {\n BlockedMap[w].push(v);\n }\n }\n }\n stack.pop();\n stackEdges.pop();\n return foundCycle;\n } // findCycles end\n }", "function isConnectedDFSIterative(source, destination, graph) {\n let stack = [ source ];\n let visited = new Set();\n\n while (stack.length){\n let current = stack.pop();\n\n if (visited.has(current)) continue;\n visited.add(current);\n\n if (current === destination) return true;\n\n stack.push(...graph[current])\n }\n\n return false;\n}", "removeAllEdgeConnectToVertex(vertex)\n\t{\n\t\tthis.findEdgeRelateToVertex(vertex.id).forEach(edge=>{\n\t\t\tedge.remove()\n\t\t})\n\t}", "get connected() { return this._connected; }", "function toggleVertexConnections(agencyEdgesMap, edgeVerticesMap, v, agency_style, edge_style){\r\n\tvar stop = true;\r\n\tv.setStyle({\r\n\t\tfillOpacity : agencyStyle[agency_style].opacity, \r\n\t\topacity: agencyStyle[agency_style].opacity, \r\n\t\tfillColor:agencyStyle[agency_style].color, \r\n\t\tcolor:agencyStyle[agency_style].color\r\n\t\t});\r\n\tv.status = agency_style; \r\n\t\r\n\tif (agencyEdgesMap[v.id] != undefined){ \r\n\t\t$.each(agencyEdgesMap[v.id], function(index,item){\r\n\t\t\tif (item instanceof L.Polyline){\r\n\t\t\t\tif (item.options.opacity != edgeStyle[edge_style].opacity){\r\n\t\t\t\t\titem.setStyle({opacity:edgeStyle[edge_style].opacity, color:edgeStyle[edge_style].color});\r\n\t\t\t\t\titem.status = edge_style;\r\n\t\t\t\t\t$.each(edgeVerticesMap[item.id], function(index, vertex){\r\n\t\t\t\t\t\tif(vertex instanceof L.FeatureGroup){\r\n\t\t\t\t\t\t\t$.each(vertex.getLayers(), function(index, item){\r\n\t\t\t\t\t\t\t\tif (item.options.fillOpacity != agencyStyle[agency_style].opacity){\r\n\t\t\t\t\t\t\t\t\titem.setStyle({\r\n\t\t\t\t\t\t\t\t\t\tfillOpacity:agencyStyle[agency_style].opacity, \r\n\t\t\t\t\t\t\t\t\t\topacity: agencyStyle[agency_style].opacity, \r\n\t\t\t\t\t\t\t\t\t\tfillColor:agencyStyle[agency_style].color, \r\n\t\t\t\t\t\t\t\t\t\tcolor:agencyStyle[agency_style].color\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\tvertex.status = agency_style;\r\n\t\t\t\t\t\t\t\t\tstop = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!stop){\r\n\t\t\t\t\t\t\t\t\ttoggleVertexConnections(agencyEdgesMap, edgeVerticesMap, vertex, agency_style, edge_style);\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\tvertex.status = agency_style;\r\n\t\t\t\t\t\t}else if (vertex.options.fillOpacity != agencyStyle[agency_style].opacity){\r\n\t\t\t\t\t\t\tvertex.setStyle({\r\n\t\t\t\t\t\t\t\tfillOpacity : agencyStyle[agency_style].opacity, \r\n\t\t\t\t\t\t\t\topacity : agencyStyle[agency_style].opacity, \r\n\t\t\t\t\t\t\t\tfillColor : agencyStyle[agency_style].color, \r\n\t\t\t\t\t\t\t\tcolor : agencyStyle[agency_style].color\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tvertex.status = agency_style;\r\n\t\t\t\t\t\t\ttoggleVertexConnections(agencyEdgesMap, edgeVerticesMap, vertex, agency_style, edge_style);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n}", "outdegree(graph){\n if ( !(graph instanceof Graph) )\n throw new TypeError(ENOTGRAPH)\n return graph.outdegree(this)\n //return graph.edges.filter(edge => edge.out && edge.out.includes(this))\n }", "function onMouseVertex(e){\n //console.log(`${e.type} on ${e.target.id}`);\n const id = e.target.id.substr(5,e.target.id.length);\n let graph_events = [];\n let start;\n if(['contextmenu', 'click'].includes(e.type)){\n e.preventDefault();\n e.stopPropagation();\n }else if(['mousedown'].includes(e.type)){\n if(e.buttons == 2){\n graph_events.push('act');\n start = true;\n state.acting = true;\n }else if(e.buttons == 1){\n graph_events.push('drag');\n start = true;\n //console.log(\"drag start\");\n state.dragging = true;\n }\n }else if(['mouseup'].includes(e.type)){\n if(state.dragging){\n graph_events.push('drag');\n state.dragging = false;\n start = false;\n //console.log(\"drag over\");\n }\n if(state.acting){\n graph_events.push('act');\n start = false;\n state.acting = false;\n }\n }else if(e.type == 'touchstart'){\n if(e.touches.length == 1){\n graph_events.push('hover');\n start = true;\n state.over_vertex = true;\n }else if(e.touches.length == 2){\n graph_events.push('act');\n start = true;\n graph_events.push('hover');\n state.acting = true;\n state.over_vertex = true;\n }\n }else if(e.type == 'mouseenter'){\n if(!state.dragging){\n graph_events.push('hover');\n start = true;\n state.over_vertex = true;\n }\n }else if(['mouseleave','touchend'].includes(e.type)){\n if(!state.dragging){\n graph_events.push('hover');\n start = false;\n state.over_vertex = false;\n if(state.acting){\n graph_events.push('act');\n start = false;\n state.acting = false;\n }\n }\n }\n graph_events.forEach(type => utils.send('graph_mouse',{type:type,id:id,start:start}));\n return false;\n}", "function visit (node) { // recursive `visit` returns `false` if cycle detected, or `true` otherwise\r\n if (node in seen) return seen[node]; // if node is \"gray\" (`seen[node]` is `false`) then there is a cycle, so we return `false`. else if it's \"black\" we return `true`\r\n seen[node] = false; // mark node as \"gray\"\r\n\r\n for (const incoming of [...dependsOn[node]]) { // iterate through all nodes this node depends on, if any\r\n if (!visit(incoming)) return false; // recurse on that node. if it comes back `false`, a cycle was detected, so we immediately return `false` to \"bubble up\" the detection of that cycle\r\n }\r\n \r\n seen[node] = true; // mark node as \"black\"\r\n output.push(node); // this letter can safely go next into the `output`!\r\n return true; // we also return `true` because no cycle was found thus far\r\n }", "function connectedNodes() {\n if (toggle == 0) {\n // select the nodes\n d = d3.select(this).node().__data__;\n // loop over each node and style\n node.style(\"opacity\", function(o) {\n // ? is a conditional operator of the form condition ? value-if-true : value-if-false\n return neighboring(d, o) | neighboring(o, d) ? 1 : 0.15;\n });\n toggle = 1;\n } else {\n node.style(\"opacity\", 1);;\n toggle = 0;\n }\n}", "function isConnect() {\n return !needWait;\n }", "adaptationKeys(graphStructure) {\n let graphAdapted = graphStructure\n const graphNodes = graphAdapted.nodes.map(item => {\n return { id: item.id, label: item.label }\n })\n const graphEdges = graphAdapted.edges.map(item => {\n return { from: item.fromId, to: item.toId, label: item.label}\n })\n graphAdapted = this.foundSimilarConnections(graphNodes, graphEdges)\n return graphAdapted\n }", "function packageConnections_lp(nodes) \n{\n\tvar map = {};\n\tvar connections = [];\n\n\t// Compute a map from name to node.\n\tnodes.forEach\n\t(\n\t\tfunction(d) \n\t\t{\n map[d.name] = d;\n// console.log(\"d:\",d,\"map[d.name]\",map[d.name]);\n\t\t}\n\t);\n\n\t// For each connection, construct a link from the source to target node.\n\tnodes.forEach\n\t(\n\t\tfunction(d) \n\t\t{\n\t\t\tif (d.connections) \n\t\t\t\td.connections.forEach\n\t\t\t\t(\n\t\t\t\t\tfunction(i) \n\t\t\t\t\t{\n connections.push({source: map[d.name], target: map[i]});\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t}\n\t);\n\treturn connections;\n}", "function node_weight(d) {\r\n d.weight = links.filter(function(l) {\r\n return l.source.index == d.index // || l.target.index == d.index \r\n }).length\r\n return d.weight\r\n }", "function getLinkCount(cell) {\n var parent = graph.getDefaultParent();\n var childCount = graph.getModel().getChildCount(parent);\n var sourceCount = 0;\n var targetCount = 0;\n for (var i = 0; i < childCount; i++) {\n var child = graph.getModel().getChildAt(parent, i);\n if (child.isEdge()) {\n //增加连线的判断 20100105 by MeiKefu\n if (!child.getSource() || !child.getTarget()) {\n alert(\"连接线 [\" + child.id + \" \" + child.value + \"] 没有连接正确\");\n return {\n source: 0,\n target: 0\n };\n }\n if (child.getSource().getId() == cell.getId()) sourceCount++;\n if (child.getTarget().getId() == cell.getId()) targetCount++;\n }\n }\n return {\n source: sourceCount,\n target: targetCount\n };\n }", "function createConnect(_temp){var _ref=_temp===void 0?{}:_temp,_ref$connectHOC=_ref.connectHOC,connectHOC=_ref$connectHOC===void 0?_components_connectAdvanced__WEBPACK_IMPORTED_MODULE_2__[\"default\"]:_ref$connectHOC,_ref$mapStateToPropsF=_ref.mapStateToPropsFactories,mapStateToPropsFactories=_ref$mapStateToPropsF===void 0?_mapStateToProps__WEBPACK_IMPORTED_MODULE_5__[\"default\"]:_ref$mapStateToPropsF,_ref$mapDispatchToPro=_ref.mapDispatchToPropsFactories,mapDispatchToPropsFactories=_ref$mapDispatchToPro===void 0?_mapDispatchToProps__WEBPACK_IMPORTED_MODULE_4__[\"default\"]:_ref$mapDispatchToPro,_ref$mergePropsFactor=_ref.mergePropsFactories,mergePropsFactories=_ref$mergePropsFactor===void 0?_mergeProps__WEBPACK_IMPORTED_MODULE_6__[\"default\"]:_ref$mergePropsFactor,_ref$selectorFactory=_ref.selectorFactory,selectorFactory=_ref$selectorFactory===void 0?_selectorFactory__WEBPACK_IMPORTED_MODULE_7__[\"default\"]:_ref$selectorFactory;return function connect(mapStateToProps,mapDispatchToProps,mergeProps,_ref2){if(_ref2===void 0){_ref2={};}var _ref3=_ref2,_ref3$pure=_ref3.pure,pure=_ref3$pure===void 0?true:_ref3$pure,_ref3$areStatesEqual=_ref3.areStatesEqual,areStatesEqual=_ref3$areStatesEqual===void 0?strictEqual:_ref3$areStatesEqual,_ref3$areOwnPropsEqua=_ref3.areOwnPropsEqual,areOwnPropsEqual=_ref3$areOwnPropsEqua===void 0?_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"]:_ref3$areOwnPropsEqua,_ref3$areStatePropsEq=_ref3.areStatePropsEqual,areStatePropsEqual=_ref3$areStatePropsEq===void 0?_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"]:_ref3$areStatePropsEq,_ref3$areMergedPropsE=_ref3.areMergedPropsEqual,areMergedPropsEqual=_ref3$areMergedPropsE===void 0?_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[\"default\"]:_ref3$areMergedPropsE,extraOptions=Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_ref3,[\"pure\",\"areStatesEqual\",\"areOwnPropsEqual\",\"areStatePropsEqual\",\"areMergedPropsEqual\"]);var initMapStateToProps=match(mapStateToProps,mapStateToPropsFactories,'mapStateToProps');var initMapDispatchToProps=match(mapDispatchToProps,mapDispatchToPropsFactories,'mapDispatchToProps');var initMergeProps=match(mergeProps,mergePropsFactories,'mergeProps');return connectHOC(selectorFactory,Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({// used in error messages\nmethodName:'connect',// used to compute Connect's displayName from the wrapped component's displayName.\ngetDisplayName:function getDisplayName(name){return\"Connect(\"+name+\")\";},// if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\nshouldHandleStateChanges:Boolean(mapStateToProps),// passed through to selectorFactory\ninitMapStateToProps:initMapStateToProps,initMapDispatchToProps:initMapDispatchToProps,initMergeProps:initMergeProps,pure:pure,areStatesEqual:areStatesEqual,areOwnPropsEqual:areOwnPropsEqual,areStatePropsEqual:areStatePropsEqual,areMergedPropsEqual:areMergedPropsEqual},extraOptions));};}", "connectAdjacents(nodeMatrix) {\n for (let i = 0; i < nodeMatrix.length; i++) {\n for (let j = 0; j < nodeMatrix[0].length; j++) {\n let n = nodeMatrix[i][j]\n if (nodeMatrix[i][j] === undefined) {\n continue;\n }\n if (j > 0) //add left neighbor\n {\n if (!(nodeMatrix[i][j - 1] === undefined)) {\n n.adjacentNodes.push([nodeMatrix[i][j - 1], 1])\n }\n }\n if (j < nodeMatrix[0].length - 1) //add right neighbor\n {\n if (!(nodeMatrix[i][j + 1] === undefined)) {\n n.adjacentNodes.push([nodeMatrix[i][j + 1], 1])\n }\n }\n if (i > 0) //add above neighbor\n {\n if (!(nodeMatrix[i - 1][j] === undefined)) {\n n.adjacentNodes.push([nodeMatrix[i - 1][j], 1])\n }\n }\n if (i < nodeMatrix.length - 1) //add below neighbor\n {\n if (!(nodeMatrix[i + 1][j] === undefined)) {\n n.adjacentNodes.push([nodeMatrix[i + 1][j], 1])\n }\n }\n }\n }\n }" ]
[ "0.62838316", "0.62782127", "0.62586546", "0.62280375", "0.6071325", "0.60480595", "0.6043892", "0.6007995", "0.6007995", "0.6007995", "0.59538627", "0.5946243", "0.5883565", "0.5880302", "0.5880302", "0.5835692", "0.5821448", "0.5778127", "0.577309", "0.5741601", "0.5719249", "0.5696057", "0.5673955", "0.56567305", "0.56501305", "0.5641029", "0.56133646", "0.56106955", "0.5590035", "0.55821383", "0.55589175", "0.55532134", "0.5531021", "0.5476785", "0.5434306", "0.5433573", "0.5419688", "0.538607", "0.5347841", "0.5330527", "0.5327841", "0.53165585", "0.53004843", "0.52964413", "0.52957517", "0.52889436", "0.52889407", "0.52889407", "0.52855814", "0.52799886", "0.5275284", "0.5270855", "0.52677435", "0.52418375", "0.5240405", "0.52401567", "0.52398396", "0.52397346", "0.5231626", "0.52274096", "0.5225184", "0.5224025", "0.5217405", "0.5214081", "0.5209394", "0.5195228", "0.51886946", "0.51530266", "0.5140633", "0.51379603", "0.5134876", "0.51305676", "0.51198685", "0.5118237", "0.5118237", "0.5116167", "0.50977546", "0.5085498", "0.50729036", "0.5070951", "0.5070859", "0.5047975", "0.50478005", "0.50453234", "0.5032959", "0.502668", "0.50261444", "0.5024704", "0.5024499", "0.5022663", "0.5019449", "0.50190794", "0.50161266", "0.5015841", "0.50097394", "0.49923116", "0.49886978", "0.49876183", "0.497718", "0.49722582" ]
0.5750273
19
set layer and position for each node
function setLayer(tmpLinkData, tmpE){ //layer is set from bottem to top, one layer per loop. The anchors are layer 0. //change evalutes how many node's layer has set in one loop, if no node's layer is set, change is 0. It means all node's layer is set properly var change = anchorData.length; var baseLayer = new ArrayList(); anchorData.forEach(function(d){ baseLayer.add(d.id); }); //for (var j = 0; j < 5; j++){ var prevChange = -1; var numChances = 0; while (change > 0){ //tmpLayerMap is a set of nodes that change their layer in this loop, they will be considered as the base layer for next iteration. //the base layer of first iteration is anchors, their layer is 0. //console.log("baseLayer: "); //baseLayer.print(); var nextLayer = new ArrayList(); if(prevChange == change) { numChances++; } else { numChances = 0; } prevChange = change; change = 0; if(numChances > 10) { console.log("In a loop to many time, just breaking out"); maxLayer -= 9; break; } //parse all edges tmpLinkData.forEach(function(d){ var src = d.source; var tgt = d.target; //flag to check if one link need to be evaluated. It is used to avoid infinity loop of cycle. //when target id is in the base layer, the source will be set will layer = target's layer + 1, if this edge dose not comprise a cycle, the third edge of above example. if (baseLayer.contains(tgt)){ var e = src + " " + tgt; var flag = true; cycleSet.forEach(function(cycleInstance){ if (cycleInstance.contains(e)){ //when the edge set has only one edge, this edge will comprise a cycle based on the tree we build befor, the tree consists of all edge we evaluated before if (cycleInstance.size > 1){ //remove the edge from edge set. cycleInstance.removeByValue(e); } else { flag = false; } } }); //set the source node's layer, and record the source node id for next iteration if (flag){ nodesData[src].layer = nodesData[tgt].layer + 1; if (!nextLayer.contains(src)){ nextLayer.add(src); } change++; //console.log("id: " + src + " layer: " + nodesData[src].layer); } } }); baseLayer = nextLayer; //maxLayer is the max layer value we set. maxLayer++; //console.log("change: " + change); } maxLayer--; /* nodesData.forEach(function(d, i){ console.log(i + " " + d.layer); }) */ //store the node id in the sequence of layer //xPos is the x position for nodes in the unit of column's width layerMap = d3.range(maxLayer + 1) .map(function(d){ return []; }); nodesData.forEach(function(d){ if (d.layer != undefined){ if (!d.unAssigned){ if(d.layer > maxLayer) d.layer = maxLayer; layerMap[d.layer].push(d.id); } } }); //set xpos of nodes, check whether a node is a outside nodes; var offset = Math.max(xOffset - leftPanelWidth,0); layerMap.forEach(function(d, i){ if (i > 0){ d.forEach(function(e){ var tmp = []; nodesChildren[e].forEach(function(f){ if (!nodesData[f].outside.isOutside){ tmp.push(nodesData[f].xpos); } }); if (tmp.length == 0){ nodesData[e].outside.isOutside = true; nodesData[e].xpos = -1; } else { nodesData[e].xpos = (d3.min(tmp) + d3.max(tmp)) / 2; } }); } else { d.forEach(function(e){ var tmpX = nodesData[e].xpos; if (tmpX - nodeRadius > offset && tmpX + nodeRadius < offset + windowWidth){ nodesData[e].outside.isOutside = false; } else { nodesData[e].outside.isOutside = true; } }) } }); //for node that has no layer, set it as outside node nodesData.forEach(function(d){ if (d.layer == undefined){ d.outside.isOutside = true; d.noLayer = true; d.layer = -1; d.xpos = -1; } }); //set the edge link tmpE.forEach(function(d, i){ var srcIndex = nodesData.length * 2 + edgeIdMap[d.source] * 2 + 1; textData[srcIndex].layer = (nodesData[textData[srcIndex].node.src].layer + nodesData[textData[srcIndex].node.tgt].layer) / 2; var edge = {}; edge.source = textData[srcIndex]; edge.target = idMap[d.target]; edge.id = linksData.length; edge.linkType = d.linkType; edge.type = "edgeLink"; edge.node = {}; edge.node.original = d; linksData.push(edge); var node = {}; node.src = edge.source; node.tgt = edge.target; node.original = d; textData.push({ node : node, type : "edgeLinkCircle", content : d.label }); textData.push({ node : node, type : "edgeLinkLabel", content : d.label, nodeId : d.id }); textLinksData.push({ source : textData.length - 2, target : textData.length - 1, edgeId : d.id }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setNodePosition(){\n\t\t//console.log(print);\n\t\tvar change = 0;\n\t\tvar offset = Math.max(xOffset - leftPanelWidth,0);\n\n\t\t//set xpos of nodes, and check if node is an outside node\n\t\tlayerMap.forEach(function(d, i){\n\t\t\tif (i > 0){\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmp = [];\n\t\t\t\t\tnodesChildren[e].forEach(function(f){\n\t\t\t\t\t\tif (!nodesData[f].outside.isOutside){\n\t\t\t\t\t\t\ttmp.push(nodesData[f].xpos);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\n\t\t\t\t\tif (tmp.length == 0){\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t\tnodesData[e].xpos = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].xpos = (d3.min(tmp) + d3.max(tmp)) / 2;\n\t\t\t\t\t\tif (!d.fixed){\n\t\t\t\t\t\t\tnodesData[e].position.x = nodesData[e].xpos;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t}\n\t\t\t\t}); \n\t\t\t} else {\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmpX = nodesData[e].xpos;\t\n\t\t\t\t\tif (tmpX - nodeRadius > offset && tmpX + nodeRadius < offset + windowWidth){\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t});\n\n\n\t\t\n\t\t//Set the color, opacity of nodes based on the status of isOutside\n\t\tnodes.each(function(d){\n\t\t\t/*if (d.noLayer){\n\t\t\t\td.outside.isOutside = true;\n\t\t\t\td3.select(this)\n\t\t\t\t\t.attr(\"opacity\", 0.8)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\n\t\t\t}\t\t*/\t\t\t\t\n\t\t\tif (d.fixed && !(d.x - nodeRadius > offset && d.x + nodeRadius < offset + windowWidth)){\n\t\t\t\td.fixed = false\t\t\t\t\n\t\t\t\td3.select(this).classed(\"fixed\", false);\n\t \t\t\td.position.x = d.xpos;\n\t\t\t\td.position.y = height - nodeRadius - d.layer * unitLinkLength;\n\t\t\t}\n\t\t\tif (d.outside.isOutside && !d.noLayer){\n\t\t\t\tif (d.unAssigned){\n\n\t\t\t\t}\t\t\t\t\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.5)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\t\treturn cScale(d.index + 1);\n\t\t\t\t\t});\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.7)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\t\t\t\t\n\t\t\t}\n\t\t\t//console.log(d.id + \" \" + d.outside.isOutside + \" \" + d.position.x);\n\t\t});\n\t\t//console.log(change)\n\n\t\t//when some node changes its status, the correspoding links, labels and the x position of inside nodes should also change.\n\t\tif (change > 0 || firstTime){\n\t\t\tfirstTime = false;\n\t\t\td3.select(htmlElement).selectAll(\".nodeLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.node.noLayer){\n\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (d.type == \"nodeLabel\" && d.node.outside){\n\t\t\t\t\t\tif ((!d.node.outside.isOutside && (print || d.node.type != \"anchor\")) || (d.node.outside.isOutside && d.node.degree >= 3)){\n\t\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\td.node.showLabel = false;\n\t\t\t\t\treturn 0;\t\t\t\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".linkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.type == \"linkLabel\"){\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].noLayer){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].type == 'anchor' && !nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tif ((d.node.src < nodesData.length && nodesData[d.node.src].noLayer == undefined && nodesData[d.node.src].outside.isOutside) \n\t\t\t\t\t\t\t|| (d.node.tgt < nodesData.length && nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)){\n\t\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\td.show = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".edgeLinkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\t//console.log(d.index);\n\t\t\t\t\tif (!d.node.src.show || \n\t\t\t\t\t\t(nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)) {\n\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\td.show = true;\n\t\t\t\t\treturn 1;\t\t\t\t\t\n\t\t\t\t});\n\t\t\t/*d3.select(htmlElement).selectAll(\".clickBoard\")\n\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\tif (d.content == \"edgeLinks\"){\n\t\t\t\t\t\tif (nodesData[d.node.tgt].outside.isOutside || !d.node.src.show){\n\t\t\t\t\t\t\treturn \"node\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} else if (d.type == \"linkLabel\"){\n\t\t\t\t\t\tif (nodesData[d.node.src].outside.isOutside || nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t\treturn \"none\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} \n\t\t\t\t\treturn d.node.showLabel ? \"transparent\" : \"none\";\n\t\t\t\t});*/\n\n\t\t\tlinks.classed(\"outsideLink\", function(d){\n\t\t\t\t/*if (d.type == \"edgeLink\"){\n\t\t\t\t\treturn d.target.outside.isOutside;\n\t\t\t\t}*/\n\t\t\t\tif (d.target.noLayer){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (d.source.outside && d.target.outside){\n\t\t\t\t\tif (d.target.type == 'anchor' && !d.target.outside.isOutside){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn d.source.outside.isOutside || d.target.outside.isOutside;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\t\n\t\t\tforce.start();\n\t\t}\n\t}", "function setPositions(nodes) {\n // determine positions\n for (i in nodes) {\n if (nodes[i].category === \"Math\") {\n nodes[i].x = mathX\n nodes[i].y = firstY + i * smallVerticalGap\n } else if (nodes[i].category === \"Lower\") {\n nodes[i].x = mathX*2\n nodes[i].y = firstY + (i-numMath) * bigVerticalGap\n } else if (nodes[i].category === \"100\") {\n nodes[i].x = mathX*3\n nodes[i].y = firstY + (i-(numMath+numLower)) * 70\n } else if (nodes[i].category === \"101\") {\n nodes[i].x = mathX*4\n nodes[i].y = firstY + (i-(numMath+numLower+num100)) * bigVerticalGap\n } else if (nodes[i].category === \"102\") {\n nodes[i].x = mathX*5\n nodes[i].y = firstY + (i-(numMath+numLower+num100+num101)) * bigVerticalGap\n } else if (nodes[i].category === \"Elective\") {\n nodes[i].x = horizontalX + (i-(numMath+numRequired)) * horizontalGap\n nodes[i].y = horizontalY\n } else if (nodes[i].category === \"Consulting\") {\n nodes[i].x = horizontalX + (i-(numMath+numRequired+numElective)) * horizontalGap\n nodes[i].y = horizontalY + 100\n }\n }\n }", "function initLayer() {\n addSourceLineAndLayer('line');\n addSourcePointAndLayer('tl_point');\n addSourcePointAndLayer('tr_point');\n addSourcePointAndLayer('bl_point');\n addSourcePointAndLayer('br_point');\n addSourcePointAndLayer('t_point');\n addSourcePointAndLayer('r_point');\n addSourcePointAndLayer('l_point');\n addSourcePointAndLayer('b_point');\n }", "function setnodevals()\n\t{\t\t\t\n\t\tnode.attr(\"dx\", nodedx)\n\t\t\t.attr(\"dy\", \".31em\")\n\t\t\t.attr(\"transform\", nodetrans)\n\t\t\t.style(\"text-anchor\", nodeanchor);\t\t\t\n\t}", "saveNodesPositions() {\n if (this.visualization && this.visualization.getNodesPositions) {\n const nodes = this.visualization.getNodesPositions();\n this.props.actions.setVisualizationNodesPosition(this.props.visualizationKey, nodes);\n }\n }", "updateLayers(){\n\t\tvar ratiox = this.width/this.owidth;\n\t\tvar ratioy = this.height/this.oheight;\n\t\tthis.layers.forEach(layer=>{\n\t\t\tlayer.width = layer.owidth * ratiox;\n\t\t\tlayer.height = layer.oheight * ratioy;\t\t\t\n\t\t\tlayer.rotation = layer.roffset + this.rotation;\n\t\t\tvar pos = Canvas.absolutePoint(layer.xoffset*ratiox, layer.yoffset*ratioy, this.x, this.y, this.rotation);\n\t\t\tlayer.x = pos.x;\n\t\t\tlayer.y = pos.y;\n\t\t\t\n\t\t});\n\t}", "restack (){\n this._layers.forEach( (layer, key, index) => {\n layer.setDepth(index);\n //layer.objects.forEach(obj => {\n //if (obj.active)\n //obj.depth = index;\n //});\n });\n }", "function _setPositions() {\r\n clones.forEach(function (draggable) { draggable.setPosition(); });\r\n }", "addNodes() {\n // Add the symbol nodes to nodes_data[] at fixed positions (fx, fy). _fx and _fy save the fixed\n // position across drag/drop operations, linkCount is used to calculate the strength of the\n // force of a link.\n this.nodes_data = [];\n for (let i = 0; i < this.numSymbolNodes; i++) {\n const pos = this.getNodePosition(i);\n this.nodes_data.push({\n \"fx\" : pos[0],\n \"fy\" : pos[1],\n \"_fx\" : pos[0],\n \"_fy\" : pos[1],\n \"linkCount\" : 0});\n }\n\n // Add the non-symbol nodes at non-fixed positions.\n for (let i = this.numSymbolNodes; i < this.numNodes; i++) {\n this.nodes_data.push({\"linkCount\" : 0});\n }\n }", "function updateNodePositions() {\n // set node positions\n rect.attr('transform', function (d) {\n return 'translate(' + d.x + ',' + d.y + ')';\n });\n}", "function drawNodes() {\r\n that.nodeList.forEach(element => {\r\n c.node = element;\r\n c.nodeRadius = 40;\r\n c.beginPath();\r\n c.strokeStyle = \"black\";\r\n c.fillStyle = \"black\";\r\n c.arc(c.node.x, c.node.y, c.nodeRadius, 0, 2 * Math.PI, false);\r\n c.fill();\r\n c.stroke();\r\n c.closePath();\r\n\r\n // kvadrat i text id\r\n c.beginPath();\r\n c.fillStyle = \"yellow\";\r\n c.fillRect(c.node.x + 44, c.node.y + 8, 60, 60);\r\n c.stroke();\r\n c.closePath();\r\n // id\r\n c.beginPath();\r\n c.fillStyle = \"black\";\r\n c.font = \"40px Verdana\";\r\n c.fillText(c.node.id, c.node.x + 50, c.node.y + 50)\r\n c.fill();\r\n c.stroke();\r\n c.closePath();\r\n\r\n cNodesList.push(Object.assign({}, c));\r\n });\r\n\r\n }", "set layers(layerStyles) {\n }", "buildTree() {\n\t\tthis.assignLevel(this.nodesList[0], 0);\n\t\tthis.positionMap = new Map();\n\t\tthis.assignPosition(this.nodesList[0], 0);\n\t}", "function assignNodeProperties(allTiles,nodeArray){\n var myNode = {};\n var backgroundcolor = {\n '0': 'green', '1': '#1e12bc'\n };\n \n for(i=0; i<allTiles.length; i++){\n myNode = new Node(i,backgroundcolor,0,false,false,-1);\n nodeArray.push(myNode);\n };\nreturn nodeArray;\n}", "function placeNodes(newState, itemheight, width, x, y) {\n newState.css({\n 'height': itemheight,\n 'width' : width,\n 'left': x,\n 'top' : y\n });\n}", "positionSprites() {\n for (var i = this.layers.length - 1; i >= 0; i--) {\n for (var j = 0; j < this.layers[i].length; j++) {\n for (var k = 0; k < this.layers[i][j].length; k++) {\n if (this.layers[i][j][k] === null) {\n continue\n }\n this.layers[i][j][k].setSpritePosition(gameSession.layout.header.numChildren)\n }\n }\n }\n }", "function layering() {\n\t//get all objectss\n\tlet items = document.getElementsByClassName(\"object\");\n\n\tfor(let j = 0; j < items.length; j++)\n\t{\n\t\t//layer is equal to y coordinate\n\t\t// console.log(items)\n\t\titems[j].style.zIndex = 5;\n\t}\n}", "function initNodes(Id) {\n\n var m = mat4();\n\n switch (Id) {\n\n case spacecraft.controlCenter:\n figure[spacecraft.controlCenter] = createNode(m, component.control_center.render, spacecraft.leftWing, spacecraft.controlRoom);\n break;\n\n case spacecraft.controlRoom:\n figure[spacecraft.controlRoom] = createNode(m, component.control_room.render, null, spacecraft.controlCover);\n break;\n\n case spacecraft.controlCover:\n figure[spacecraft.controlCover] = createNode(m, component.control_cover.render, null, null);\n break;\n\n case spacecraft.leftWing:\n\n figure[spacecraft.leftWing] = createNode(m, component.front_wing.render, spacecraft.rightWing, spacecraft.gun);\n break;\n\n case spacecraft.gun:\n figure[spacecraft.gun] = createNode(m, component.gun.render, spacecraft.middleWing, spacecraft.muzzle);\n break;\n\n case spacecraft.middleWing:\n figure[spacecraft.middleWing] = createNode(m, component.middle_wing.render, null, spacecraft.backWing);\n break;\n\n case spacecraft.backWing:\n figure[spacecraft.backWing] = createNode(m, component.back_wing.render, null, null);\n break;\n\n case spacecraft.muzzle:\n figure[spacecraft.muzzle] = createNode(m, component.muzzle.render, null, null);\n break;\n\n case spacecraft.rightWing:\n m = mult(m, scale4(-1, 1, 1)); // make mirror by y-axis from left wing\n figure[spacecraft.rightWing] = createNode(m, component.front_wing.render, null, spacecraft.gun);\n break;\n\n }\n\n}", "function setNewXPositions(last) {\n data.tree.eachBefore(d => {\n d.x = d.x / last\n d.x = d.x * graph.scale.vertical.value\n\n let element = d3.select('#node' + d.data.id)\n if (!element) return\n element.attr('transform', 'translate(' + [d.y, d.x] + ')')\n if (d.parent) {\n d3.select('#link' + d.data.id)\n .select('path')\n .attr('d', 'M' + [d.parent.y, d.parent.x] + 'V' + d.x + 'H' + d.y)\n\n if (graph.style.linkLabels) {\n if (d3.select('#label' + d.data.id)) {\n d3.select('#label' + d.data.id)\n .attr('y', (d.x - 5).toString())\n }\n }\n }\n })\n }", "function generate() {\n for (i = 0; i < points.length; i++ ){ \n points[i].offset = $(`ul.layer li#${[i]}`).offset();\n points[i].width = $(`ul.layer li#${[i]}`).width();\n points[i].height = $(`ul.layer li#${[i]}`).height();\n };\n }", "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "function setNewYPositions() {\n data.tree.eachBefore(d => {\n if (d.parent) {\n let horizontal = graph.scale.horizontal\n if (!graph.style.align)\n d.y = horizontal.value * d.data.data.value * horizontal.scalingFactor + d.parent.y\n else\n d.y = d.depth * horizontal.scalingFactor * horizontal.value\n\n let element = d3.select('#node' + d.data.id)\n if (!element) return\n element.attr('transform', 'translate(' + [d.y, d.x] + ')')\n\n if (d.parent) {\n if (d3.select('#link' + d.data.id).select('path')) {\n d3.select('#link' + d.data.id)\n .select('path')\n .attr('d', 'M' + [d.parent.y, d.parent.x] + 'V' + d.x + 'H' + d.y)\n }\n\n if (graph.style.linkLabels) {\n if (d3.select('#label' + d.data.id)) {\n d3.select('#label' + d.data.id)\n .attr('x', ((d.parent.y + d.y) / 2).toString())\n }\n }\n }\n }\n })\n }", "function setNode(event){\n let currentNode=event.currentTarget;\n \n let indexX=parseInt(currentNode.dataset.row)\n let indexY=parseInt(currentNode.dataset.column)\n \n if(setterMode==\"Wall\"){\n setWall(indexX,indexY)\n }\n else if(setterMode==\"StartPoint\"){\n setStart(indexX,indexY)\n }\n else if(setterMode==\"EndPoint\"){\n setEnd(indexX,indexY)\n }\n \n}", "configureNodes() {\n this.node\n .attr(\"class\", \"lgv-node\")\n .attr(\"data-node-label\", d => this.extractLabel(d))\n .attr(\"data-node-depth\", d => d.depth)\n .attr(\"data-node-children\", d => d.children ? true : false)\n .attr(\"cx\", d => d.x)\n .attr(\"cy\", d => d.y)\n .attr(\"r\", d => d.r)\n .on(\"click\", (e,d) => {\n\n // node label\n let label = this.extractLabel(d);\n\n // update class\n document.querySelectorAll(`[data-node-label=\"${label}\"]`).forEach(d => d.classList.toggle(\"selected\"));\n\n // send event to parent\n this.artboard.dispatch(\"nodeclick\", {\n bubbles: true,\n detail: {\n label: label\n }\n });\n\n })\n .on(\"mouseover\", (e,d) => {\n\n // node label\n let label = this.extractLabel(d);\n\n // update class\n document.querySelectorAll(`[data-node-label=\"${label}\"]`).forEach(d => d.classList.add(\"active\"));\n\n // send event to parent\n this.artboard.dispatch(\"nodemouseover\", {\n bubbles: true,\n detail: {\n label: label,\n xy: [e.clientX + (this.artboardUnit / 2), e.clientY + (this.artboardUnit / 2)]\n }\n });\n\n })\n .on(\"mouseout\", (e,d) => {\n\n // node label\n let label = this.extractLabel(d);\n\n // update class\n document.querySelectorAll(`[data-node-label=\"${label}\"]`).forEach(d => d.classList.remove(\"active\"));\n\n // send event to parent\n this.artboard.dispatch(\"nodemouseout\", {\n bubbles: true,\n detail: {\n label: label\n }\n });\n\n });\n }", "function setNodesPosition(nodes) {\n var deferred = $.Deferred();\n if ( nodes.length == 0 ) { deferred.resolve(); return deferred.promise(); }\n var lab_filename = $('#lab-viewport').attr('data-path');\n var form_data = [];\n form_data=nodes;\n var url = '/api/labs' + lab_filename + '/nodes' ;\n var type = 'PUT';\n $.ajax({\n cache: false,\n timeout: TIMEOUT,\n type: type,\n url: encodeURI(url),\n dataType: 'json',\n data: JSON.stringify(form_data),\n success: function (data) {\n if (data['status'] == 'success') {\n logger(1, 'DEBUG: node position updated.');\n deferred.resolve();\n } else {\n // Application error\n logger(1, 'DEBUG: application error (' + data['status'] + ') on ' + type + ' ' + url + ' (' + data['message'] + ').');\n deferred.reject(data['message']);\n }\n },\n error: function (data) {\n // Server error\n var message = getJsonMessage(data['responseText']);\n logger(1, 'DEBUG: server error (' + data['status'] + ') on ' + type + ' ' + url + '.');\n logger(1, 'DEBUG: ' + message);\n deferred.reject(message);\n }\n });\n return deferred.promise();\n}", "offsetAll(){\n var self = this;\n this.components.forEach(function(item){\n item.set({left: item.left+self.left, top: item.top+self.top, scaleX: 1, scaleY: 1});\n });\n }", "function updatePosition() {\r\n\t\t\tcircle.attr('transform', `translate(${point.x * graph.cell_size + graph.offset.x} ${point.y * graph.cell_size + graph.offset.y})`);\r\n\t\t}", "function move_node(i, h) {\n node_data[i].h = h;\n container.selectAll(\".node\")\n .data([node_data[i]], info => info.idx)\n .transition()\n .duration(500)\n .attr(\"transform\", d => `translate(${xScale(d.h)},${yScale(d.idx)})`);\n container.selectAll(\".link\")\n .data(node_data[i].in_links, link => link.key)\n .transition()\n .duration(500)\n .attr(\"x2\", xScale(h))\n container.selectAll(\".link\")\n .data(node_data[i].out_links, link => { return link.key })\n .transition()\n .duration(500)\n .attr(\"x1\", xScale(h))\n }", "layerSetup() {\n this._layer = this.createLayer();\n this._addObservers();\n this._addEventListeners();\n if (this.get('containerLayer')) {\n this.get('containerLayer')._layer.addLayer(this._layer);\n }\n this.didCreateLayer();\n }", "set x(nx){\n\t\tthis.position.nx = nx;\n\t}", "function initializeNode() {\r\n // set root fixed in the middle\r\n root.fixed = true;\r\n root.x = mC.panelWidth / 2;\r\n root.y = mC.panelHeight / 2;\r\n root.px = mC.panelWidth / 2;\r\n root.py = mC.panelHeight / 2;\r\n // assign locations for nodes\r\n initialNodes.forEach(function(d) {\r\n if (d.type != \"root\") {\r\n var location = setInitialLocation(d);\r\n d.x = location[0];\r\n d.y = location[1];\r\n d.px = location[0];\r\n d.py = location[1];\r\n }\r\n // for each node type create new tempNode and add them to their lookup\r\n if (d.type == \"dp\") {\r\n d.fixed = true;\r\n var newTempDpNode = new tempDpNode(d.id, d.type, d.label);\r\n tempDpNodes.push(newTempDpNode);\r\n tempDpNodes_lookup[newTempDpNode.id] = newTempDpNode;\r\n }\r\n if (d.type == \"dec\") {\r\n var newTempDecNode = new tempDecNode(d.id, d.type, d.label, d.parent);\r\n tempDecNodes.push(newTempDecNode);\r\n tempDecNodes_lookup[newTempDecNode.id] = newTempDecNode;\r\n }\r\n if (d.type == \"out\") {\r\n var newTempNode = new tempNode(\"out\" + d.parent, d.id, d.type, d.label,\r\n d.parent);\r\n tempNodes.push(newTempNode);\r\n tempNodes_lookup[newTempNode.id] = newTempNode;\r\n }\r\n\r\n });\r\n }", "_initLayer() {\n this._provider = new qx.ui.tree.provider.WidgetProvider(this);\n this._layer = this._provider.createLayer();\n this._layer.addListener(\"updated\", this._onUpdated, this);\n this.getPane().addLayer(this._layer);\n this.getPane().addListenerOnce(\"resize\", e => {\n // apply width to pane on first rendering pass\n // to avoid visible flickering\n this.getPane().getColumnConfig().setItemSize(0, e.getData().width);\n });\n }", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "setAllPosition(position, initial) {\n this.teams.forEach((team, i) => {\n team.getChildren().forEach((player, j) => {\n player.setPosition(position[i][j][0], position[i][j][1]);\n });\n });\n this.ball.setPosition(position[4][0], position[4][1]);\n }", "function set_all_position(data, parent_coor) {\n data.data.hexagons = [];\n for (var i = 0; i < 6; i++) {\n var a = (i) / 6 * Math.PI * 2; //angle of this hex relative to parent center\n var x = _this.config.hexagon_scale * Math.cos(a) * (Math.sqrt(3) / 3);\n var y = _this.config.hexagon_scale * Math.sin(a) * (Math.sqrt(3) / 3);\n data.data.hexagons[i] = {\n x: x,\n y: y,\n absolute_x: parent_coor.absolute_x + x * Math.pow(1 / 3, data.depth - 1),\n absolute_y: parent_coor.absolute_y + y * Math.pow(1 / 3, data.depth - 1),\n pos: i\n };\n\n //update boundary box\n var d = data.data.hexagons[i];\n if (d.absolute_x > boundary_box.max_x) boundary_box.max_x = d.absolute_x;\n if (d.absolute_y > boundary_box.max_y) boundary_box.max_y = d.absolute_y;\n if (d.absolute_x < boundary_box.min_x) boundary_box.min_x = d.absolute_x;\n if (d.absolute_y < boundary_box.min_y) boundary_box.min_y = d.absolute_y;\n\n\n }\n data.data.hexagons[6] = {\n x: 0,\n y: 0,\n absolute_x: parent_coor.absolute_x,\n absolute_y: parent_coor.absolute_y,\n pos: 6\n\n };\n //data.children[6].words = data.data.topics[6];\n //delete data.data.topics;\n\n delete data.data.submodels;\n\n if (data.children && data.children.length > 0) {\n for (var i = 0; i < data.children.length; i++) {\n set_all_position(data.children[i], data.data.hexagons[i]);\n }\n\n }\n if (data.parent == null)\n data.is_root = true;\n else\n data.is_root = false;\n //delete data.parent;\n }", "function nodeDrag(d, i) {\n console.log();\n var x = d3.event.x\n var y = d3.event.y\n\n vertical.style(\"stroke\", \"gray\");\n horizontal.style(\"stroke\", \"gray\");\n\n var xGrid, yGrid;\n var modX = x % resolution\n if (modX >= 3) {\n xGrid = x + (resolution - modX)\n }\n else {\n xGrid = x - modX\n }\n \n var modY = y % resolution\n if (modY >= 3) {\n yGrid = y + (resolution - modY)\n }\n else {\n yGrid = y - modY\n }\n\n d3.select(this).attr(\"x\", xGrid).attr(\"y\", yGrid);\n nodes[i].x = xGrid;\n nodes[i].y = yGrid;\n\n\n link.each(function(l, li) {\n if (l.source == i) {\n d3.select(this).attr(\"x1\", xGrid).attr(\"y1\", yGrid);\n } else if (l.target == i) {\n d3.select(this).attr(\"x2\", xGrid).attr(\"y2\", yGrid);\n }\n });\n }", "function processNodes( nodesToModify ) {\n nodesToModify.forEach(( node ) => {\n // Hardcode hack this node's position for demo.\n if ( window.DEMO_MODE ) {\n if ( node.name === 'Mumbai Node' ) {\n node.coords.lat = '12.576009912063801';\n node.coords.lng = '75.322265625';\n }\n }\n\n // convert to number\n node.coords.lat = ( typeof node.coords.lat === 'string'\n ? parseFloat(node.coords.lat)\n : node.coords.lat\n );\n node.coords.lng = ( typeof node.coords.lng === 'string'\n ? parseFloat(node.coords.lng)\n : node.coords.lng\n );\n // Add latlng as string to connect it to region\n node.lat_lng_id = createLatLngId( node.coords.lat, node.coords.lng );\n\n });\n }", "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case\n else\n {\n leafNodeCounter = 0;\n for (var d = 0; d < node.children.length; d++)\n {\n // this is a really bad hack and there is definitely something better out there. \n // However, it gets the job done\n if (node.children[d].name === \"Protosomes\")\n {\n leafNodeCounter = leafNodeCounter + 2;\n }\n\n this.assignPosition(node.children[d], node.position + leafNodeCounter);\n }\n }\n\n }", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n for (i = 1; i <= 5; i++) {\n pt = new Point(i*200, i*100);\n node = new Node(pt, \"amy node \" + i);\n nodes.push(node);\n }\n}", "function update_graph_nodes(nodes) {\n\t\t$.each(nodes, function (i, node) {\n\t\t\tvar node_id = node[\"id\"];\n\t\t\tvar ele = g.elements(\"node\" + \"[id='\" + node_id + \"']\")[0];\n\t\t\tif (ele) {\n\t\t\t\tele.data(node);\n\t\t\t\tele.position({x: node.view.position.x, y: node.view.position.y});\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert(node_id + \" no ele\");\n\t\t\t}\n\t\t});\n\t}", "function layerSet(layers){\r\n //TODO Take layer of groups and sort into ind. items so that tooltips and colors can be adjusted\r\n //Each object in layer is always the same i.e. Array[0].y == \"line_total\" forEach App in Group\r\n layers[0].forEach(function (d){\r\n\r\n d.name=\"line line_total\";\r\n d.amount = d.y;\r\n\r\n });\r\n layers[1].forEach(function (d){\r\n\r\n d.name=\"actual lines tested\";\r\n d.amount = d.y;\r\n d.z = LightenDarkenColor(d.z, 20);\r\n });\r\n layers[2].forEach(function (d){\r\n\r\n d.name=\"percent tested\";\r\n d.y = (d.y/100) * d.line_total;\r\n d.amount = \"%\"+d.percent;\r\n d.z = LightenDarkenColor(d.z, 35);\r\n\r\n });\r\n layers[3].forEach(function (d){\r\n\r\n d.name=\"percent passed\";\r\n d.y = d.test-(d.y*10);\r\n d.amount = \"%\"+d.pass *100;\r\n\r\n d.z = LightenDarkenColor(d.z, 45);\r\n\r\n });\r\n\r\n }", "_initPositions() {\n // set its matrices\n this._initMatrices();\n\n // apply our css positions\n this._setWorldSizes();\n this._applyWorldPositions();\n }", "function calculateNodePositions(nodesView, nodesData)\n {\n nodesView.children().each(function(index, child)\n {\n var cid = $(child).data('node-cid');\n var node = nodesData[cid];\n var body = nodesView.closest('body');\n\n // groups have nested nodes inside of them\n if (node.binding === 'group')\n {\n for (var i = 0; i < node.data.length; i++)\n {\n console.log('here');\n var current = node.data[i];\n current.position = getCoordinatesForNode(current, body);\n }\n }\n\n node.position = getCoordinatesForNode(node, body);\n node.position.side = getSideForNode(node.position);\n });\n }", "updateEdgePositions() {\n this.html\n .attr(\"x1\", this.x1)\n .attr(\"y1\", this.y1)\n .attr(\"x2\", this.x2)\n .attr(\"y2\", this.y2)\n }", "setNodes(nodes) {\n this._nodes = nodes\n }", "function positionLayer() {\r\n\t\r\n\tvar placeX = 300;\r\n\tvar placeY = 300;\r\n\t\r\n\t//get final placement\r\n\tplaceX = horizontalPlacement();\r\n\tplaceY = verticalPlacement();\r\n\t\r\n\t//Move the object\r\n\tv_layer.style.left = placeX + 'px';\r\n\tv_layer.style.top = placeY + 'px';\r\n}", "function updateNodes() {\n for (var item = 0; item < matrixLen; item++) {\n addItem(tempArray[item]);\n }\n addButton();\n }", "set_drawing_position() {\n push()\n translate(this.module_x, this.module_y)\n }", "prepareNodes() {\n const render = (node) => {\n node.html = nodeToHTML(node);\n node.nodesHTML = subnodesToHTML(node.nodes);\n\n const dimensions = getDimensions(node.html, {}, 'mindmap-node');\n node.width = dimensions.width;\n node.height = dimensions.height;\n\n const nodesDimensions = getDimensions(node.nodesHTML, {}, 'mindmap-subnode-text');\n node.nodesWidth = nodesDimensions.width;\n node.nodesHeight = nodesDimensions.height;\n };\n\n this.props.nodes.forEach(node => render(node));\n }", "SetNormalAndPosition() {}", "constructor() {\n /**\n * Layer x position\n * @type {number}\n */\n this.x = 0;\n /**\n * Layer y position\n * @type {number}\n */\n this.y = 0;\n /**\n * Layer z position\n * @type {number}\n */\n this.z = 0;\n\n /**\n * Layer width\n * @protected\n * @type {number}\n */\n this.width = 0;\n /**\n * Layer height\n * @protected\n * @type {number}\n */\n this.height = 0;\n }", "initChildren() {\n this.nodes.forEach(node => {\n node.parent = this\n })\n }", "function paintAll() {\n var nodes = tree.nodes(mainRoot);\n var links = tree.links(nodes);\n\n setParent(mainRoot);\n\n paintLinks();\n paintNodes();\n\n //Setting parents for each element\n function setParent(node) {\n if ('children' in node) {\n for (var index in node.children) {\n node.children[index].parent = node;\n setParent(node.children[index]);\n }\n }\n }\n\n //painting nodes\n function paintNodes() {\n var forNodes = formD3ChainCalls(panel, \"g#noderz\"+graphId+\"|id'noderz\"+graphId);\n var update = forNodes.selectAll(\".node\").data(nodes, function (d) {return \"\"+ d.uniqueId + d.expanded;});\n var enter = update.enter();\n var exit = update.exit();\n\n enter.append(\"g\").attr(\"class\", \"node\").style('opacity', 0).attr('transform', function (d) {\n if (typeof d === 'object' && 'parent' in d) {\n if (!d.ui) {\n if (d.type == elementTypes.paginator) createPaginator(d, d3.select(this));\n else if (d.type == elementTypes.loader) createLoader(d, d3.select(this));\n } else {\n if (d.type == elementTypes.paginator) this.appendChild(d.ui.root.node());\n else if (d.type == elementTypes.loader) this.appendChild(d.ui.root.node());\n }\n return \"translate(\" + d.parent.y + \",\" + d.parent.x + \")\";\n } else return \"translate(0,0)\";\n });\n\n exit.filter(function (d) { return !d.wasDiscarded; })\n .transition().duration(p.animdur).style('opacity', 0).attr('transform', function (d) {\n if (typeof d !== 'object' || !('parent' in d)) return \"translate(0,0)\";\n else return \"translate(\" + d.parent.y + \",\" + d.parent.x + \")\";\n }).remove();\n exit.filter(function (d) { return d.wasDiscarded; })\n .transition().duration(p.animdur).style('opacity', 0).remove();\n\n update.attr('pointer-events', function (d) { return willBeDiscarded(d) ? 'none' : null; })\n .transition().duration(function (d) { return willBeDiscarded(d) ? p.discardAnimDuration : p.animdur; })\n .attr(\"transform\", function (d) { return \"translate(\" + d.y + \",\" + d.x + \")\";})\n .style('opacity', function (d) { return willBeDiscarded(d) ? 0.2 : 1; })\n .each(function (d) {\n var thisItem = d3.select(this);\n if (d.type == elementTypes.paginator) { updatePaginator(d, thisItem); }\n else if (d.type == elementTypes.loader) { updateLoader(d, thisItem); }\n else if (d.type == elementTypes.objProperty) {\n thisItem.text('');\n paintObjProperty(d, thisItem);\n } else if (d.type == elementTypes.instance) {\n if (d.dataIndicator && d.dataIndicator.ui) {\n d.dataIndicator.ui.remove();\n d.dataIndicator.ui = null;\n }\n thisItem.text('');\n paintInstance(d, thisItem);\n }\n if (d.pageIndicator) { arrangePageIndicator(d, d.pageIndicator); }\n });\n\n function createPaginator(d, parent) {\n d.ui = svgui.Paginator({parent: parent, color: d.parent.color, width: 160});\n d.ui.onPageChanged = function (page) { onPageChanged(page, d, d.parent); };\n }\n\n function onPageChanged(newPage, paginatorModel, parentModel) {\n if (parentModel.pageRequest && parentModel.pageRequest.isRunning)\n parentModel.pageRequest.cancel();\n if (parentModel.pageIndicator)\n parentModel.pageIndicator.remove();\n\n var margin = 15, nodeSize = p.nodeWidth - p.nodeDif;\n var indicator = Indicator.create(panel, {size: p.pageIndicatorSize, maxWidth: nodeSize - margin}).run();\n arrangePageIndicator(parentModel, indicator);\n parentModel.pageIndicator = indicator;\n paginatorModel.currentPage = newPage;\n\n if (parentModel.type == elementTypes.objProperty) {\n parentModel.pageRequest = requestForInstances(parentModel, newPage, renderParams.pageLimitForInstances, indicator);\n } else if (parentModel.type == elementTypes.instance) {\n parentModel.pageRequest = requestForObjPropPage(parentModel, newPage, renderParams.pageLimitForObjectProperties, indicator);\n }\n paintAll();\n }\n\n function arrangePageIndicator(parentModel, indicatorInstance) {\n var minX = Infinity;\n var minY = Infinity, maxY = -Infinity;\n panel.selectAll(\".node\").filter(function (nodeData) {\n return nodeData.parent === parentModel && nodeData.type != elementTypes.paginator;\n }).each(function (d) {\n // d.x and d.y are swapped here\n minX = Math.min(minX, d.y);\n var height = calcHeight(d);\n minY = Math.min(minY, d.x - height / 2);\n maxY = Math.max(maxY, d.x + height / 2);\n });\n\n var margin = 15, nodeSize = p.nodeWidth - p.nodeDif;\n var position = vector(minX - nodeSize / 2 + p.pageIndicatorSize / 2 + margin, minY + (maxY - minY) / 2);\n indicatorInstance.moveTo(position);\n }\n\n function createLoader(d, parent) {\n var container = parent.append(\"g\").attr(\"width\", p.childrenLoaderSize).attr(\"height\", p.childrenLoaderSize);\n d.ui = Indicator.create(container, {size: p.childrenLoaderSize}).run();\n d.ui.root = container;\n updateIndicatorUI(d);\n }\n\n function paintObjProperty(d, d3This){\n var uiElement = d.ui;\n var halfWidth = (p.nodeWidth-p.nodeDif) / 2;\n var ti = textInfo(d.name, \"basicTextInGraph\");\n uiElement.render(d3This, 0 -( (ti.width/2>=halfWidth)?halfWidth:((ti.width)/2)), 10, p.nodeWidth - p.nodeDif);\n\n var path = (d.direction == 'OUT') ? \"M0,-5L10,0L0,5\" : \"M0,-5L-10,0L0,5\";//Triangle\n d3This.append(\"path\").attr(\"d\", path).attr(\"fill\", d.parent.color);\n\n //Circle expander\n var circle = d3This.append(\"circle\").attr({cx:halfWidth,cy:0,r:10, fill:'white',stroke: d.color,'stroke-width':2});\n path = (!d.children) ? \"M0,-5L10,0L0,5\" : \"M0,-5L-10,0L0,5\";\n var triangle = d3This.append(\"path\").attr(\"d\", path).attr(\"fill\", d.parent.color).attr(\"transform\",\"translate(\" + ((!d.children)?(halfWidth-4):(halfWidth+3)) + \",\" + 0 + \")\");\n circle.on(\"mousedown\", rightAction);\n triangle.on(\"mousedown\", rightAction);\n\n function rightAction() {\n invokeRightAction(d, function (d) { rightActionForObjectProperty(d); });\n }\n }\n\n function paintInstance(d,d3This){\n var uiElement = (d.expanded)? d.uiExpanded : d.ui;\n var leftRightHeight = uiElement.height(p.nodeWidth - p.nodeDif);\n var halfWidth = (p.nodeWidth-p.nodeDif) / 2;\n //If it's not root - we create left ear\n var leftEar=null;\n var rightEar=null;\n if (d.parent && !d.error){\n leftEar = createEar(d, d3This,-halfWidth - p.buttonWidth,\n -(leftRightHeight / 2) + 1, halfWidth , leftRightHeight,\n uiElement, leftAction(d), \"M5,-5L-5,0L5,5\",-halfWidth-(p.buttonWidth)/2);\n }\n //right ear\n if (!d.error) {\n rightEar = createEar(d, d3This, 0 , -(leftRightHeight / 2) + 1, halfWidth + p.buttonWidth,\n leftRightHeight, uiElement, function() {\n invokeRightAction(d, function (d) { rightActionForInstance(d); });\n }, (d.children) ? \"M5,-5L-5,0L5,5\" : \"M-5,-5L-5,5L5,0\",\n (d.children) ? (halfWidth+(p.buttonWidth-4)/2) : (halfWidth+(p.buttonWidth)/2));\n }\n //render main element after ears\n uiElement.render(d3This, -halfWidth, -leftRightHeight / 2, p.nodeWidth-p.nodeDif);\n if (!d.error) uiElement.setAction(\"mousedown.open\", centerAction(d));\n uiElement.setAction(\"mouseover.uwi\", onMouseElement(1));\n uiElement.setAction(\"mouseout.uwi\", onMouseElement(0));\n\n //Changing opacity to 0 or 1\n function onMouseElement(opacity){\n return function () {\n if(rightEar!=null) rightEar.transition().duration(p.animdur).attr(\"opacity\", opacity);\n if (leftEar != null) leftEar.transition().duration(p.animdur).attr(\"opacity\", opacity);\n };\n }\n\n //create left or right ear\n function createEar(d, d3This, x ,y, width, height, uiElement, action, path, translate){\n var ear = d3This.append(\"g\").attr(\"opacity\",0);\n addBorderedRect(ear, x , y, width, height, 2, \"white\", uiElement.RxRy(), uiElement.RxRy(), d.color);\n ear.append(\"path\").attr(\"d\", path).attr(\"fill\", d.color).attr(\"transform\",\"translate(\"+translate+\",0)\");\n actionSet(ear);\n return ear;\n\n function actionSet(item){\n item.on(\"mousedown\", action);\n item.on('mouseover', function () { ear.transition().duration(p.animdur).attr(\"opacity\",1);});\n item.on('mouseout', function () { ear.transition().duration(p.animdur).attr(\"opacity\",0);});\n }\n }\n }\n\n function invokeRightAction(d, rightActionHandler) {\n var isExpanded = d['children'], hasCollapsedChildren = d['_children'];\n var isLoadingError = d.pageRequest && d.pageRequest.isFailed;\n if (isExpanded || !isLoadingError && hasCollapsedChildren) {\n expandOrCollapseChildren(d);\n paintAll();\n } else {\n d['_children'] = false;\n rightActionHandler(d);\n }\n }\n\n function updatePaginator(d, d3This) {\n d.ui.currentPage = d.currentPage;\n d.ui.pageCount = d.overallPages;\n d.ui.update();\n var size = svgui.measure(d.ui, vector(p.nodeWidth - p.nodeDif, Infinity));\n svgui.arrange(d.ui, -((size.x / 2 >= (p.nodeWidth - p.nodeDif) / 2)\n ? (p.nodeWidth - p.nodeDif) / 2 : size.x / 2), -10);\n }\n\n function updateLoader(d, d3This) {\n var height = d.ui.size;\n d.ui.parent.attr(\"transform\", \"translate(\" +\n (-(p.nodeWidth - p.nodeDif) / 2 + 5) + \",\" + (-height / 2) + \")\");\n }\n }\n\n //painting links\n function paintLinks() {\n var forLinks = formD3ChainCalls(panel, \"g#linkers\"+graphId+\"|id'linkers\"+graphId);\n var update = forLinks.selectAll(\".link\").data(links, function (d) {return d.source.uniqueId + \"_\" + d.target.uniqueId;});\n var enter = update.enter();\n var exit = update.exit();\n\n enter.append(\"path\").attr(\"class\", \"link\").attr('stroke', function (d) {\n if (d.source.type == elementTypes.instance) return d.source.color;\n else if (d.source.type == elementTypes.objProperty) return d.source.parent.color;\n }).style('opacity',0);\n\n exit.filter(function (d) { return !d.target.wasDiscarded; })\n .transition().duration(p.animdur).attr(\"d\", function (d) {\n var o = {x: d.target.x, y: d.target.y};\n return diagonal({source: o, target: o});\n }).style('opacity', 0).remove();\n exit.filter(function (d) { return d.target.wasDiscarded; }).remove();\n\n update.transition().duration(function (d) { return willBeDiscarded(d.target) ? p.discardAnimDuration : p.animdur; })\n .attr(\"d\", function (d) {\n /// !!!!! X and Y are inverted here!!!!!\n if (d.target.type == elementTypes.paginator) return \"M\"+ d.target.y+\",\"+ d.target.x;\n var m = (d.source.y + d.target.y) / 2;\n var halfWidth = (p.nodeWidth-p.nodeDif) / 2;\n var k = [\n {x: d.source.x, y: d.source.y + halfWidth }, //left point\n {x: d.source.x, y: m}, //middle left\n {x: d.target.x, y: m}, //middle right\n {x: d.target.x, y: d.target.y - halfWidth } //right point\n ];\n\n var toRet = \"\";\n var prefix = \"M\";\n var suffix = \"\";\n var firstDone = false;\n if (d.target.type == elementTypes.objProperty)//if left element is object property - we make a long line\n suffix += \"M\" + (d.target.y - halfWidth) + \",\" + d.target.x +\" L\" + (d.target.y+halfWidth ) + \",\" + d.target.x;\n\n k = k.map(function (d) { return [ d.y, d.x ];});\n each(k, function (d) {\n if (!firstDone) {toRet += d + \" C\";firstDone = true;}\n else toRet += d + \" \";\n });\n\n return prefix + toRet.trim() + suffix;\n }).style('opacity', function (d) { return willBeDiscarded(d.target) ? 0.2 : 1; });\n }\n }", "initializeCoords() {\n // deltas between nodes\n let row_delta = 2 * this.m;\n let column_delta = 2;\n\n // top-left node has coordinates x=-0.45*(m-1)*distance_between_nodes,\n // y=0. Positions of the other nodes are based on this node\n for (let i = 0; i < this.n; ++i) { \n for (let j = 0; j < this.m; ++j) { \n this.coord[i * row_delta + j * column_delta] = (-0.45 * (this.m - 1) + j) * this.distance_between_nodes;\n this.coord[i * row_delta + j * column_delta + 1] = 1 - i * this.distance_between_nodes;\n this.old_coord[i * row_delta + j * column_delta] = this.coord[i * row_delta + j * column_delta];\n this.old_coord[i * row_delta + j * column_delta + 1] = this.coord[i * row_delta + j * column_delta + 1];\n }\n }\n }", "function setup() {\n createCanvas(WIDTH, HEIGHT);\n byLevel = nodesAtLevels();\n}", "function plotLayers(svg) {\n\t svg.append('g').classed('imagelayer', true);\n\t svg.append('g').classed('maplayer', true);\n\t svg.append('g').classed('barlayer', true);\n\t svg.append('g').classed('boxlayer', true);\n\t svg.append('g').classed('scatterlayer', true);\n\t }", "function recurseLayers(currLayers, _dataArray) {\n for ( var i = 0; i < currLayers.layers.length; i++ ) {\n var layerRef = currLayers.layers[i];\n var item = {}; // temporary storage of (layer) item information.\n \n if (layerRef.name == \"spot\") { //if layer is a regular (image) layer (the spot)\n item = {\n \"xPos\": (layerRef.bounds[0].value + layerRef.bounds[2].value)/2,\n \"yPos\": (layerRef.bounds[1].value + layerRef.bounds[3].value)/2\n }\n } //end if\n \n if (layerRef.kind == LayerKind.TEXT) { //if layer is a text layer\n item = {\n \"xPos\": layerRef.bounds[0].value,\n \"yPos\": layerRef.bounds[1].value\n }\n } //end if\n \n if (layerRef.kind == LayerKind.SOLIDFILL) { //if layer is a shape (a line)\n docRef.activeLayer = layerRef; \n var pathCoordinatesArray = collectPathInfo (docRef, docRef.pathItems[docRef.pathItems.length - 1] ); \n collectPathInfo(docRef, docRef.pathItems[docRef.pathItems.length - 1]);\n item = {\n \"xPosStart\": pathCoordinatesArray[0][0][0][0],\n \"yPosStart\": pathCoordinatesArray[0][0][0][1],\n \"xPosEnd\": pathCoordinatesArray[0][3][0][0],\n \"yPosEnd\": pathCoordinatesArray[0][3][0][1],\n }\n } //end if\n\n _dataArray[layerRef.name] = item; //ad item to the data array\n \n if ((typeof currLayers.layers[i].layers !== 'undefined') \n && (currLayers.layers[i].layers.length>0)) { //if layer is a layer set then, recursive loop through that node\n recurseLayers(currLayers.layers[i], _dataArray[layerRef.name]); \n } //end if\n\n } //end forloop\n}// end function", "constructor () {\n\t\tthis.nodes = {};\n\t}", "function setPos(root, bounds) {\n if (!root.children) {\n return;\n }\n\n // Space out remaining bounds evenly to children\n let n = root.children.length;\n let spacing = (bounds.max - bounds.min) / n;\n\n for (let i = 0; i < root.children.length; i++) {\n let child = root.children[i];\n child.x = bounds.min + (spacing * i) + (spacing / 2);\n child.y = child.level * 30;\n g.append('text').attr('x', child.x).attr('y', child.y).text(child.element.tagName).style('fill', colorScale(child.level));\n setPos(child, {min: child.x - (spacing / 2), max: child.x + (spacing / 2)});\n }\n}", "buildLayers(){\r\n this.layers = []\r\n this.topology.forEach(layer => this.layers.push([]))\r\n \r\n this.topology.forEach((layerSize, iLayer) => {\r\n let layer = this.layers[iLayer],\r\n prevLayer = this.layers[iLayer - 1] || undefined,\r\n nextLayer = this.layers[iLayer + 1] || undefined\r\n \r\n for (let i of Array(layerSize).keys()){\r\n layer.push(new Neuron(prevLayer, nextLayer, layer, \"\"+iLayer+i))\r\n }\r\n \r\n let neuronBias = new Neuron(prevLayer, nextLayer, layer, \"\"+iLayer+(layer.length) )\r\n neuronBias.isBias = true\r\n neuronBias.outputVal = 1\r\n \r\n layer.push(neuronBias)\r\n })\r\n \r\n this.layers\r\n .slice(0,this.layers.length - 1)\r\n .forEach(layer => {\r\n layer.forEach(neuron => neuron.buildConnections())\r\n })\r\n }", "_changeLayer(layer) {\n //console.log(\"Layer is changed to layer\", layer, this);\n }", "function loadNodes() {\r\n\r\n\t\tif (!nodes) nodes = [];\r\n\r\n\t\twhile (shapeSVG.length > nodes.length) {\r\n\t\t\tnodes.push(new Node(canvasWidth, canvasHeight));\r\n\t\t}\r\n\t}", "buildTree() {\n // note: in this function you will assign positions and levels by making calls to assignPosition() and assignLevel()\n let rootNode = this.nodeList.find(theRootNode => theRootNode.parentName === \"root\");\n this.assignLevel(rootNode, 0);\n this.assignPosition(rootNode, 0);\n }", "function applyLayoutList(layoutList) {\n for(var i=0; i<layoutList.length; i++) {\n var node = layoutList[i];\n var plane = node.plane;\n plane.mesh.position.copy(node.position);\n plane.lastPosition.copy(node.position);\n }\n }", "function graphRepositionNodes () {\n for (var nodeId in this.calculationNodes) {\n if (this.calculationNodes.hasOwnProperty(nodeId)) {\n this.calculationNodes[nodeId].vx = 0; this.calculationNodes[nodeId].vy = 0;\n this.calculationNodes[nodeId].fx = 0; this.calculationNodes[nodeId].fy = 0;\n }\n }\n if (this.constants.hierarchicalLayout.enabled == true) {\n this._setupHierarchicalLayout();\n showValueOfRange.call(this, 'graph_H_nd', 1, \"physics_hierarchicalRepulsion_nodeDistance\");\n showValueOfRange.call(this, 'graph_H_cg', 1, \"physics_centralGravity\");\n showValueOfRange.call(this, 'graph_H_sc', 1, \"physics_springConstant\");\n showValueOfRange.call(this, 'graph_H_sl', 1, \"physics_springLength\");\n showValueOfRange.call(this, 'graph_H_damp', 1, \"physics_damping\");\n }\n else {\n this.repositionNodes();\n }\n this.moving = true;\n this.start();\n }", "function renderNodes(n, i, nodes) {\n /* jshint validthis: true */ // `this` is bound to a set of options above\n\n // render node that are not in this layer\n var stack = this.stackViewer.primaryStack;\n var z_res = stack.resolution.z;\n // Positions are in project space\n var pos1 = this.positions[n];\n let ndist1 = pos1[this.normalDim] - this.stackViewer.plane.constant;\n\n // draw node\n if (Math.abs(ndist1) <= z_res / 2) {\n var c = new PIXI.Sprite(this.graphics.Node.prototype.NODE_TEXTURE);\n c.anchor.set(0.5);\n c.x = pos1[this.planeDims.x];\n c.y = pos1[this.planeDims.y];\n c.scale.set(this.graphics.Node.prototype.stackScaling * 2);\n c.tint = this.color(undefined, undefined, undefined, true, 1, false);\n c.alpha = 1;\n this.graphics.containers.nodes.addChild(c);\n }\n\n // draw missing branch indicator if asked for\n if (this.selected_points.has(parseInt(n))) {\n let nn = this.node_map[n];\n var pos2 = {\n x: nn.x + nn.branch_dx,\n y: nn.y + nn.branch_dy,\n z: nn.z + nn.branch_dz\n };\n\n let ndist2 = pos2[this.normalDim] - this.stackViewer.plane.constant;\n\n let display_needed =\n (ndist1 <= z_res / 2 && ndist2 >= -z_res / 2) ||\n (ndist1 >= -z_res / 2 && ndist2 <= z_res / 2);\n if (display_needed) {\n if (Math.abs(ndist1) <= z_res / 2 && Math.abs(ndist2) <= z_res / 2) {\n renderFlatEdge(n, pos1, pos2, true, undefined, this);\n } else {\n if (ndist1 > ndist2) {\n renderSloppedEdge(n, pos1, pos2, false, true, undefined, this);\n } else {\n renderSloppedEdge(n, pos2, pos1, false, true, undefined, this);\n }\n }\n\n if (Math.abs(ndist2) <= z_res / 2) {\n var c = new PIXI.Sprite(this.graphics.Node.prototype.NODE_TEXTURE);\n c.anchor.set(0.5);\n c.x = pos2[this.planeDims.x];\n c.y = pos2[this.planeDims.y];\n c.scale.set(this.graphics.Node.prototype.stackScaling);\n c.tint = this.color(undefined, undefined, undefined, true, 1);\n c.alpha = 1;\n this.graphics.containers.nodes.addChild(c);\n }\n }\n }\n\n // draw edges\n var e = this.edges[n];\n if (e) {\n var pos2 = this.positions[e];\n let connectivity =\n this.node_map[n].connectivity_score / this.max_connectivity_score;\n\n let ndist2 = pos2[this.normalDim] - this.stackViewer.plane.constant;\n\n let display_needed =\n (typeof this.focused_connection === \"undefined\" ||\n this.focused_connection === parseInt(n)) &&\n ((ndist1 <= z_res / 2 && ndist2 >= -z_res / 2) ||\n (ndist1 >= -z_res / 2 && ndist2 <= z_res / 2));\n if (display_needed) {\n if (Math.abs(ndist1) <= z_res / 2 && Math.abs(ndist2) <= z_res / 2) {\n renderFlatEdge(n, pos1, pos2, false, connectivity, this);\n } else {\n if (ndist1 > ndist2) {\n renderSloppedEdge(n, pos1, pos2, true, false, connectivity, this);\n } else {\n renderSloppedEdge(n, pos2, pos1, false, false, connectivity, this);\n }\n }\n }\n }\n }", "function updateLayerToLabel(item) {\r\n if(item.type === 'layer') {\r\n layerToLabel[item.ids[0]] = item.name;\r\n layerSeriesData[item.ids[0]] = [];\r\n } else {\r\n for(var idx in item.children) {\r\n updateLayerToLabel(item.children[idx]);\r\n }\r\n }\r\n }", "constructor(layer) {\n this.layer_ = layer;\n }", "function newdefnode(nodeid, type){\n var name\n var index\n\n for (i = 0; i < maploc.length; i++) {\n if (maploc[i].node == nodeid) {\n name = maploc[i].name\n index = i\n }\n }\n\n var figure = new draw2d.shape.basic.Circle({height: 20, width:20});\n figure.add(new draw2d.shape.basic.Label({text:name, stroke:0}), new draw2d.layout.locator.BottomLocator())\n var rawcolor = new draw2d.util.Color(\"#231F21\")\n figure.resetPorts();\n figure.setBackgroundColor(rawcolor);\n figure.setColor(rawcolor.darker());\n figure.setDraggable(false);\n\n //maploc[index].nodetypeform = \"\"\n maploc[index].nodetypecount = -1\n maploc[index].record = []\n maploc[index].data = []\n\n if (type == 'farm') {\n newcolor = new draw2d.util.Color(\"#efd915\")\n maploc[index].record = [{type: 0},{type: 2},{type:1}]\n maploc[index].data = [{prod: raw1.userData.name, amount: 150000, price: 0},{},{prod: fin1.userData.name, amount: 450000, price: 100}]\n maploc[index].nodetypecount = 3\n figure.setBackgroundColor(newcolor);\n figure.setColor(new draw2d.util.Color(\"#0051dd\").darker());\n }\n if (type == 'site') {\n newcolor = new draw2d.util.Color(\"#00ffea\")\n maploc[index].record = [{type: 3},{type: 3},{type: 1}]\n maploc[index].data = [{tech: tech1.userData.name, cap:200000},{tech: tech2.userData.name, cap:200000},{prod: fin1.userData.name, amount: 450000, price: 100}]\n maploc[index].nodetypecount = 3\n figure.setBackgroundColor(newcolor);\n figure.setColor(newcolor.darker());\n }\n if (type == 'tech') {\n newcolor = new draw2d.util.Color(\"#0051dd\")\n maploc[index].record = [{type: 2},{type: 1}]\n maploc[index].data = [{},{prod: fin1.userData.name, amount: 450000, price: 100}]\n maploc[index].nodetypecount = 2\n figure.setBackgroundColor(newcolor);\n figure.setColor(newcolor.darker());\n }\n if (type == 'land') {\n newcolor = new draw2d.util.Color(\"#70AE47\")\n maploc[index].record = [{type: 1},{type: 1},{type: 1},{type: 1},{type: 1},{type: 1}]\n maploc[index].data = [{prod: raw1.userData.name, amount: 450000, price: 0},{prod: int1.userData.name, amount: 450000, price: 0},{prod: fin2.userData.name, amount: 450000, price: 0},{prod: fin3.userData.name, amount: 450000, price: 0},{prod: fin4.userData.name, amount: 450000, price: 0},{prod: fin5.userData.name, amount: 450000, price: 0}]\n maploc[index].nodetypecount = 5\n figure.setBackgroundColor(newcolor);\n figure.setColor(newcolor.darker());\n }\n if (type == 'colc') {\n newcolor = new draw2d.util.Color(\"#ff0000\")\n maploc[index].record = [{type: 1},{type: 1}]\n maploc[index].data = [{prod: fin2.userData.name, amount: 450000, price: 5},{prod: fin4.userData.name, amount: 450000, price: 5},]\n maploc[index].nodetypecount = 2\n figure.setBackgroundColor(newcolor);\n figure.setColor(newcolor.darker());\n }\n\n // add more and more types\n\n\n figure.on(\"dblclick\", function(emitter, event) {\n var infoform = \"\"\n for (var j = 0; j < maploc[index].record.length; j++) {\n infoform = infoform + nodeinfoform(maploc[index].record[j].type, maploc[index].node, j)\n }\n var node_info_alert = alertify.confirm(infoform).set('title', \"Specify Node Information\").set('labels', {ok:'Ok', cancel:'Cancel'}).set('closable',false)\n\n if (maploc[index].data.length > 0) {\n for (var j = 0; j < maploc[index].data.length; j++) {\n\n if (maploc[index].record[j].type == 0 ) {\n document.getElementById('nodeinfo1_' + nodeid +'_' + j).innerHTML = \"Please specify supply information of \" + maploc[index].data[j].prod\n $(\"#nodeinfo2_\" + nodeid +'_' + j).val(String(maploc[index].data[j].amount))\n $(\"#nodeinfo3_\" + nodeid +'_' + j).val(String(maploc[index].data[j].price))\n }\n if (maploc[index].record[j].type == 1) {\n document.getElementById('nodeinfo1_' + nodeid +'_' + j).innerHTML = \"Please specify demand information of \" + maploc[index].data[j].prod\n $(\"#nodeinfo2_\" + nodeid +'_' + j).val(String(maploc[index].data[j].amount))\n $(\"#nodeinfo3_\" + nodeid +'_' + j).val(String(maploc[index].data[j].price))\n }\n if (maploc[index].record[j].type == 3){\n document.getElementById('nodeinfo1_' + nodeid +'_' + j).innerHTML = \"Please specify supply information of \" + maploc[index].data[j].tech\n $(\"#nodeinfo2_\" + nodeid +'_' + j).val(String(maploc[index].data[j].cap))\n }\n }\n }\n node_info_alert.set('onok', function(closeEvent){\n for (var j = 0; j < maploc[index].record.length; j++) {\n savenodeinfo(maploc[index].node, j) // save information of the node\n }\n for (var j = 0; j < maploc[index].record.length; j++) {\n if (maploc[index].record[j].type == 0) {\n sup_table_push(maploc[index].node, j)\n }\n if (maploc[index].record[j].type == 1) {\n dem_table_push(maploc[index].node, j)\n }\n if (maploc[index].record[j].type == 3) {\n sit_table_push(maploc[index].node, j)\n }\n }\n })\n })\n return figure\n }", "function loadNodes(){\r\n\t\t\t\t// Node Data includes, x and y positioning,\r\n\t\t\t\t//NODE 0\r\n\t\t\t\tvar connection = [1,6];\r\n\t\t\t\tvar node = {x:-8, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:1,South:6,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 1\r\n\t\t\t\tvar connection = [0,2,4];\r\n\t\t\t\tvar node = {x:-5, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:2,South:4,West:0};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 2\r\n\t\t\t\tvar connection = [1,5];\r\n\t\t\t\tvar node = {x:-2, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:-1,South:5,West:1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 3\r\n\t\t\t\tvar connection = [4,7];\r\n\t\t\t\tvar node = {x:-6, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:4,South:7,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 4\r\n\t\t\t\tvar connection = [1,3,5];\r\n\t\t\t\tvar node = {x:-5, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:1, East:5,South:-1,West:3};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 5\r\n\t\t\t\tvar connection = [2,4,11,21];\r\n\t\t\t\tvar node = {x:-2, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:2, East:11,South:21,West:4};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 6\r\n\t\t\t\tvar connection = [0,7,22];\r\n\t\t\t\tvar node = {x:-8, y:0, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:0, East:7,South:22,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 7\r\n\t\t\t\tvar connection = [3,6,18];\r\n\t\t\t\tvar node = {x:-6, y:0, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:3, East:-1,South:18,West:6};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 8\r\n\t\t\t\tvar connection = [9,12];\r\n\t\t\t\tvar node = {x:2, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:9,South:12,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 9\r\n\t\t\t\tvar connection = [8,10,14];\r\n\t\t\t\tvar node = {x:6, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:10,South:14,West:8};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 10////////////////////////////////////////////////\r\n\t\t\t\tvar connection = [9,15];\r\n\t\t\t\tvar node = {x:8, y:3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:-1,South:15,West:9};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 11--left off here!!! it needs the Upward node\r\n\t\t\t\tvar connection = [5,12,40];\r\n\t\t\t\tvar node = {x:0, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:40, East:12,South:-1,West:5};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 12\r\n\t\t\t\tvar connection = [8,11,16];\r\n\t\t\t\tvar node = {x:2, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:8, East:-1,South:16,West:11};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 13\r\n\t\t\t\tvar connection = [14,17];\r\n\t\t\t\tvar node = {x:5, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:14,South:17,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 14\r\n\t\t\t\tvar connection = [9,13,15];\r\n\t\t\t\tvar node = {x:6, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:9, East:15,South:-1,West:13};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 15\r\n\t\t\t\tvar connection = [10,14,29];\r\n\t\t\t\tvar node = {x:8, y:1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:10, East:-1,South:29,West:14};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 16\r\n\t\t\t\tvar connection = [12,17,31];\r\n\t\t\t\tvar node = {x:2, y:0, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:12, East:17,South:31,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 17\r\n\t\t\t\tvar connection = [13,16];\r\n\t\t\t\tvar node = {x:5, y:0, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:13, East:-1,South:-1,West:16};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 18\r\n\t\t\t\tvar connection = [7,19];\r\n\t\t\t\tvar node = {x:-6, y:-1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:7, East:19,South:-1,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 19\r\n\t\t\t\tvar connection = [18,23];\r\n\t\t\t\tvar node = {x:-5, y:-1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:-1,South:23,West:18};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 20////////////////////////////////////////////////\r\n\t\t\t\tvar connection = [21,24];\r\n\t\t\t\tvar node = {x:-3, y:-2, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:21,South:24,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 21\r\n\t\t\t\tvar connection = [5,20,30];\r\n\t\t\t\tvar node = {x:-2, y:-2, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:5, East:30,South:-1,West:20};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 22\r\n\t\t\t\tvar connection = [6,23,25];\r\n\t\t\t\tvar node = {x:-8, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:6, East:23,South:25,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 23\r\n\t\t\t\tvar connection = [19,22,24,26];\r\n\t\t\t\tvar node = {x:-5, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:19, East:24,South:26,West:22};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 24\r\n\t\t\t\tvar connection = [20,23,27];\r\n\t\t\t\tvar node = {x:-3, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:20, East:-1,South:27,West:23};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 25\r\n\t\t\t\tvar connection = [22,26];\r\n\t\t\t\tvar node = {x:-8, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:22, East:26,South:-1,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 26\r\n\t\t\t\tvar connection = [23,25,27];\r\n\t\t\t\tvar node = {x:-5, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:23, East:27,South:-1,West:25};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 27\r\n\t\t\t\tvar connection = [24,26,36];\r\n\t\t\t\tvar node = {x:-3, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:24, East:36,South:-1,West:26};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 28\r\n\t\t\t\tvar connection = [29,34];\r\n\t\t\t\tvar node = {x:6, y:-1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:29,South:34,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 29\r\n\t\t\t\tvar connection = [15,28,35];\r\n\t\t\t\tvar node = {x:8, y:-1, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:15, East:-1,South:35,West:28};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 30////////////////////////////////////////////////\r\n\t\t\t\tvar connection = [21,31,36];\r\n\t\t\t\tvar node = {x:0, y:-2, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:31,South:36,West:21};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 31\r\n\t\t\t\tvar connection = [16,30,32];\r\n\t\t\t\tvar node = {x:2, y:-2, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:16, East:-1,South:32,West:30};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 32\r\n\t\t\t\tvar connection = [31,33];\r\n\t\t\t\tvar node = {x:2, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:31, East:33,South:-1,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 33\r\n\t\t\t\tvar connection = [32,34,37];\r\n\t\t\t\tvar node = {x:3, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:-1, East:34,South:37,West:32};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 34\r\n\t\t\t\tvar connection = [28,33,35,38];\r\n\t\t\t\tvar node = {x:6, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:28, East:35,South:38,West:33};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 35\r\n\t\t\t\tvar connection = [29,34,39];\r\n\t\t\t\tvar node = {x:8, y:-3, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:29, East:-1,South:39,West:34};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 36\r\n\t\t\t\tvar connection = [27,30,37,41];\r\n\t\t\t\tvar node = {x:0, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:30, East:37,South:41,West:27};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 37\r\n\t\t\t\tvar connection = [36,33];\r\n\t\t\t\tvar node = {x:3, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:33, East:-1,South:-1,West:36};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 38\r\n\t\t\t\tvar connection = [34,39];\r\n\t\t\t\tvar node = {x:6, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:34, East:39,South:-1,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 39\r\n\t\t\t\tvar connection = [38,35];\r\n\t\t\t\tvar node = {x:8, y:-5, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:35, East:-1,South:-1,West:38};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 40// This node is meant for the Ghost to be lead upward\r\n\t\t\t\tvar connection = [36];\r\n\t\t\t\tvar node = {x:0, y:5, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:41, East:-1,South:11,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t\t\t\t//NODE 41// This node is meant for the Ghost to be lead downward\r\n\t\t\t\tvar connection = [11];\r\n\t\t\t\tvar node = {x:0, y:-7.5, Connectednodes:connection,\r\n\t\t\t\t\t\t\tNorth:36, East:-1,South:-1,West:-1};\r\n\t\t\t\tnodes.push(node);\r\n\t}", "_tickedNode() {\n this.nodeInnerCirclesSelection.attr('cx', (d) => d.x).attr('cy', (d) => d.y)\n this.nodeOuterCirclesSelection.attr('cx', (d) => d.x).attr('cy', (d) => d.y)\n this.nodeLabelsSelection.attr('x', (d) => d.x).attr('y', (d) => d.y)\n }", "createLayers () {\n // zero out x and y, because we start building from top left corner\n const x = 0;\n const y = 0;\n\n // Connecting the Map & Layer Data\n // ---------------------------------------------------------------------------------------- //\n // Creating the level from the tilemap - first pulling the 'Tiled' json from preload\n this.tileMap = this.add.tilemap('lvl-01-map');\n // Then connecting the json map from tiled with the tile-sheet image preloaded in phaser\n this.tileSet = this.tileMap.addTilesetImage('environment-tiles', 'environment-tiles');\n \n // Building the layers\n // ---------------------------------------------------------------------------------------- //\n // Creating our Layers by assigning their keys/names from Tiled editor, starting with the background layer\n this.floorLayer = this.tileMap.createDynamicLayer('ground-walkable', this.tileSet);\n // Then adding additional layers // The X, Y here is starting from the top left corner\n this.wallLayer = this.tileMap.createStaticLayer('ground-impassable', this.tileSet, x, y);\n // placing the collectable items\n this.crateLayer = this.tileMap.createStaticLayer('item-crates', this.tileSet, x, y);\n // placing the obstacles\n this.obstacleLayer = this.tileMap.createDynamicLayer('obstacle-pond', this.tileSet, x, y);\n \n // Adding Physics to the layers\n // ---------------------------------------------------------------------------------------- //\n // Make all tiles on the wallLayer collidable\n this.wallLayer.setCollisionByExclusion([-1]);\n }", "function setLayers(){\n\t\t\t//view\n\t\t\tvar layers\t=\t\t'<div class=\"viewer\">';\n\t\t\tlayers\t\t+=\t\t'<div class=\"status\"></div>';\n\t\t\tlayers\t\t+=\t'</div>';\n\t\t\t//sidemenu\n\t\t\tlayers\t\t+=\t'<div class=\"sideMenu\">';\n\t\t\tlayers\t\t+=\t\t'<ul></ul>';\n\t\t\tlayers\t\t+=\t'</div>';\n\t\t\t//menu\n\t\t\tlayers\t\t+=\t'<div class=\"menu\">';\n\t\t\tlayers\t\t+=\t\t'<ul><li id=\"bookmark\">Bookmark</li></ul>';\n\t\t\tlayers\t\t+=\t'</div>';\n\t\t\t//toolbar\n\t\t\tlayers\t\t+=\t'<div class=\"toolbar\">';\n\t\t\tlayers\t\t+=\t\t'<a href=\"#\" class=\"button\" id=\"menu\">Menu</a>';\n\t\t\tlayers\t\t+=\t\t'<div class=\"pageInfo\"></div>';\n\t\t\tlayers\t\t+=\t'</div>';\n\t\t\tthisElement.html(layers);\n\t\t\t\n\t\t\t// Setting height of the viewer\n\t\t\t$(\".viewer\").css(\"height\", getDocHeight()-60+\"px\");\n\t\t}", "function init_node_structure(){\n\tvar x = [];\n\tfor (var layer=0; layer<nodesPerLayer.length; layer+=1){\n\t\tx.push([]);\n\t\tfor (var node=0; node<nodesPerLayer[layer]; node+=1){\n\t\t\tx[layer].push(0);\n\t\t}\n\t}\n\treturn x\n}", "function clear_layers(){\r\n var layerElements = document.getElementById('left').childNodes;\r\n for (var i = 0 ; i < layerElements.length ; i++){\r\n layerElements[i].className = \"layer\";\r\n } \r\n}", "addLayer(state, { parent, index }) {\n let part = Layer('Layer ' + state.lastId)\n let id = ++state.lastId\n remember(state, [addPart(state, parent, index, id, part)])\n }", "function setview() {\n svgGroup.attr('transform', 'rotate(' + curR + ' ' + curX + ' ' + curY +\n ')translate(' + curX + ' ' + curY + ')scale(' + curZ + ')');\n svgGroup.selectAll('text')\n .attr('text-anchor', function(d) {\n return (d.x + curR) % 360 <= 180 ? 'start' : 'end';\n })\n .attr('transform', function(d) {\n return ((d.x + curR) % 360 <= 180 ?\n 'translate(8)scale(' :\n 'rotate(180)translate(-8)scale('\n ) + reduceZ() +')';\n });\n svgGroup.selectAll('circle').attr('r', defaults.NODE_DIAMETER * reduceZ());\n }", "update_positions() {\n let positions = this.vertex_positions;\n for (var i = 0; i < this.vertices.length; i++) {\n positions[i * 3] = this.vertices[i].x;\n positions[i * 3 + 1] = this.vertices[i].y;\n positions[i * 3 + 2] = this.vertices[i].z;\n }\n this.attributes.position.needsUpdate = true;\n }", "setPosition(gl, x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n\n let translatedPositions = [];\n gl.bindBuffer(gl.ARRAY_BUFFER, this.buffers.position);\n translatedPositions = this.sourcePositions.slice();\n let i = 0;\n for (i = 0; i < 12 * this.treeLOD; i++) {\n translatedPositions[i * 3] += this.x;\n translatedPositions[i * 3 + 1] += this.y;\n translatedPositions[i * 3 + 2] += this.z;\n }\n\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(translatedPositions), gl.STATIC_DRAW);\n \n }", "function positionLayer(lyr, x, y) {\r if (lyr.iisBackgroundLayer || lyr.positionLocked) {\r return;\r }\r\r var layerBounds = lyr.bounds;\r var layerX = layerBounds[0].value;\r var layerY = layerBounds[1].value;\r var deltaX = x - layerX;\r var deltaY = y - layerY;\r lyr.translate(deltaX, deltaY);\r}", "function newtransnode(nodeid){\n var name\n var index\n for (i = 0; i < maploc.length; i++) {\n if (maploc[i].node == nodeid) {\n name = maploc[i].name\n index = i\n }\n }\n\n var figure = new draw2d.shape.basic.Circle({height: 20, width:20});\n figure.add(new draw2d.shape.basic.Label({text:name, stroke:0}), new draw2d.layout.locator.BottomLocator())\n var color = maploc[index].bgcolor\n figure.resetPorts();\n figure.createPort(\"input\", new draw2d.layout.locator.LeftLocator()).setSelectable(false).setResizeable(false)\n figure.createPort(\"output\", new draw2d.layout.locator.RightLocator()).setSelectable(false).setResizeable(false)\n figure.setDraggable(false);\n figure.setBackgroundColor(color)\n figure.setColor(color.darker())\n figure.userData = {nodeid: nodeid}\n\n return figure\n}", "_updateZIndexAllSiblings() {\n HSystem.updateZIndexOfChildren(this.parent.viewId);\n }", "function transform(d, i) {\n d = new google.maps.LatLng(d.geometry.coordinates[1], d.geometry.coordinates[0]);\n d = projection.fromLatLngToDivPixel(d);\n\n node_coord[i + \",\" + 0] = d.x - padding;\n node_coord[i + \",\" + 1] = d.y - padding;\n\n return d3.select(this)\n .style(\"left\", (d.x - padding) + \"px\")\n .style(\"top\", (d.y - padding) + \"px\");\n }", "init() {\n //this.raster.width = this.spriteWidth;\n //this.raster.height = this.spriteWidth;\n this.updatePosition(this.gridX, this.gridY);\n }", "function nodeStyle() {\r\n\t\t return {\r\n\t\t\t// the Node.location is at the center of each node\r\n\t\t\tlocationSpot: go.Spot.Center,\r\n\t\t\t//isShadowed: shadows,\r\n\t\t\t//shadowColor: \"#242424\",\r\n\t\t\t// handle mouse enter/leave events to show/hide the ports\r\n\t\t\tmouseEnter: function (e, obj) { showPorts(obj.part, true); },\r\n\t\t\tmouseLeave: function (e, obj) { showPorts(obj.part, false); }\r\n\t\t };\r\n\t\t}", "_updateZIndex() {\n HSystem.updateZIndexOfChildren(this.viewId);\n }", "function prepareLayers() {\n\n for (let i = 0; i < _layers.length; i++) {\n let layer = _layers[i];\n layer.neuronsCount = layer.neurons.length;\n let layerLetter = i == 0 ? 'i' : i == (_layers.length - 1) ? 'o' : 'h' + (i - 1);\n setBiasOnFirstIndex(layer);\n\n for (let n = 0; n < layer.neurons.length; n++) {\n let neuron = layer.neurons[n];\n neuron.layer = i + 1;\n neuron.displayName = neuron.isBias ? 'Bias = 1' : layerLetter + (layer.hasBias ? n : n + 1);\n }\n }\n }", "function updateNodes() {\n\t var _this8 = this;\n\n\t var nodesLayer = select(this.svg).select(\".nodes-layer\"); // DATA JOIN\n\t // Join new data with old elements, if any.\n\n\t var nodes = nodesLayer.selectAll(\".node\").data(this.layout.vertices, function (v) {\n\t return \"n_\".concat(v.key);\n\t }); // ENTER\n\t // Create new elements as needed.\n\n\t var newNodes = nodes.enter().append(\"g\").attr(\"id\", function (v) {\n\t return v.id;\n\t }).attr(\"class\", function (v) {\n\t return [\"node\"].concat(toConsumableArray(v.classes)).join(\" \");\n\t }).attr(\"transform\", function (v) {\n\t return \"translate(\".concat(_this8.scales.x(v.x), \", \").concat(_this8.scales.y(v.y), \")\");\n\t }); // add the specific node shapes or 'baubles'\n\n\t this.settings.baubles.forEach(function (bauble) {\n\t var d = bauble.createShapes(newNodes.filter(bauble.vertexFilter)).attr(\"class\", \"node-shape\");\n\t bauble.updateShapes(d);\n\t });\n\t newNodes.append(\"text\").attr(\"class\", \"node-label name\").attr(\"text-anchor\", \"start\").attr(\"alignment-baseline\", \"middle\").attr(\"dx\", \"12\").attr(\"dy\", \"0\").text(function (d) {\n\t return d.rightLabel;\n\t });\n\t newNodes.append(\"text\").attr(\"class\", \"node-label support\").attr(\"text-anchor\", \"end\").attr(\"dx\", \"-6\").attr(\"dy\", function (d) {\n\t return d.labelBelow ? -8 : +8;\n\t }).attr(\"alignment-baseline\", function (d) {\n\t return d.labelBelow ? \"bottom\" : \"hanging\";\n\t }).text(function (d) {\n\t return d.leftLabel;\n\t }); // update the existing elements\n\n\t nodes.transition().duration(this.settings.transitionDuration).ease(this.settings.transitionEase).attr(\"class\", function (v) {\n\t return [\"node\"].concat(toConsumableArray(v.classes)).join(\" \");\n\t }).attr(\"transform\", function (v) {\n\t return \"translate(\".concat(_this8.scales.x(v.x), \", \").concat(_this8.scales.y(v.y), \")\");\n\t }); // update all the baubles\n\n\t this.settings.baubles.forEach(function (bauble) {\n\t var d = nodes.select(\".node-shape\").filter(bauble.vertexFilter).transition().duration(_this8.settings.transitionDuration).ease(_this8.settings.transitionEase);\n\t bauble.updateShapes(d);\n\t });\n\t nodes.select(\"text .node-label .name\").transition().duration(this.settings.transitionDuration).ease(this.settings.transitionEase).attr(\"class\", \"node-label name\").attr(\"text-anchor\", \"start\").attr(\"alignment-baseline\", \"middle\").attr(\"dx\", \"12\").attr(\"dy\", \"0\").text(function (d) {\n\t return d.rightLabel;\n\t });\n\t nodes.select(\"text .node-label .support\").transition().duration(this.settings.transitionDuration).ease(this.settings.transitionEase).attr(\"alignment-baseline\", function (d) {\n\t return d.labelBelow ? \"bottom\" : \"hanging\";\n\t }).attr(\"class\", \"node-label support\").attr(\"text-anchor\", \"end\").attr(\"dx\", \"-6\").attr(\"dy\", function (d) {\n\t return d.labelBelow ? -8 : +8;\n\t }).text(function (d) {\n\t return d.leftLabel;\n\t }); // EXIT\n\t // Remove old elements as needed.\n\n\t nodes.exit().remove();\n\t updateNodeStyles.call(this); // add callbacks\n\n\t var _iteratorNormalCompletion = true;\n\t var _didIteratorError = false;\n\t var _iteratorError = undefined;\n\n\t try {\n\t for (var _iterator = this.callbacks.nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t var callback = _step.value;\n\t callback();\n\t }\n\t } catch (err) {\n\t _didIteratorError = true;\n\t _iteratorError = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n\t _iterator[\"return\"]();\n\t }\n\t } finally {\n\t if (_didIteratorError) {\n\t throw _iteratorError;\n\t }\n\t }\n\t }\n\t}", "setNet(net){\n //console.info(\"setNet()\");\n if(net !== null) { //controllo che esista una rete\n this.netPos = this.networks.indexOf(net); //ricerco la posizione della rete\n let found = false;\n for(let i=0;i<this.networks[this.netPos].nodi.length;i++){\n if(this.networks[this.netPos].nodi[i].panel === this.panel.id){\n this.associated = true;\n this.associated_node = i;\n found = true;\n }\n }\n if(!found) this.associated=false;\n \n this.nodePos = null;\n this.statePos = null;\n this.thresholdPos = null;\n }\n else{\n this.netPos = null;\n console.error(\"Impossible to set net\");\n }\n }", "updateCurrentLayersStyle () {\n const determineStyle = _.bind(this.determineStyle, this)\n const styleLayer = _.bind(this.styleLayer, this)\n\n if (this.currentLayer) {\n this.currentLayer.eachLayer((layer) => {\n styleLayer(layer, determineStyle(layer))\n })\n }\n }", "update_offsets(){\r\n\t\tlet i, n, mat = new Mat4();\r\n\r\n\t\tfor( i=0; i < this.bones.length; i++ ){\r\n\t\t\tn = this.nodes[ i ];\r\n\t\t\tif( n.updated ){\r\n\t\t\t\tmat.from_mul( n.model_matrix, this.bind_pose[ i ] );\r\n\t\t\t\tthis.offset_buffer.set( mat, i*16 );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "set layers(layers) {\n this.cache.layers = [];\n layers.forEach(this.add, this);\n }", "function updateMap() {\n\t//\treturn;\n// not sure if i need this\n\t\tconsole.log(\"updateMap()\");\n\t\tif (!prop(tractLayer.eachLayer)) return;\n\n\t\ttractLayer.eachLayer(function(layer) {\n\t\t\tif (MAP_DEBUG) console.log(\" -> eachLayer()\", layer.feature, layer);\n\n\t\t\t// reset properties, popup, events for each tract feature\n\t\t\tonEachTractFeature(layer.feature, layer);\n\n\t\t\t// reset layer style based on new data\n\t\t\tif (prop(layer.feature))\n\t\t\t\tlayer.setStyle(initialTractStyle(layer.feature));\n\t\t});\n\t}", "function updateTrees(){\r\n \r\n for(var count = 0 ; count < TREE_NUM ; count++){\r\n var tree = trees[count];\r\n tree.update(lorn.getSense(true), PARALLAX);\r\n \r\n // reuse trees when they are out of the bounds\r\n if(tree.image.x < -(canvasW * 0.5)){\r\n tree.image.x = canvasW + canvasW * 0.25;\r\n }\r\n if(tree.image.x > canvasW + canvasW * 0.5){\r\n tree.image.x = -(canvasW * 0.25)\r\n }\r\n }\r\n}", "function init() {\r\n for (let i = 0; i < (state.dimensions * state.dimensions); i++) {\r\n const coords = {\r\n x: i % state.dimensions,\r\n y: Math.floor(i / state.dimensions)\r\n }\r\n const newBlock = document.createElement(\"div\");\r\n const id = coords.x + \" \" + coords.y;\r\n newBlock.style[\"background-color\"] = blockColorEnum.background;\r\n newBlock.className = \"block\";\r\n newBlock.setAttribute(\"id\", id);\r\n newBlock.setAttribute(\"x\", coords.x);\r\n newBlock.setAttribute(\"y\", coords.y);\r\n wrapper.appendChild(newBlock);\r\n };\r\n}", "constructor() {\n this.nodes = new Map();\n }", "constructor() {\n this._nodes = [];\n }", "activate() {\n this.parent.activeLayerIndex = this.index;\n }", "setLayerIns(v){\n this.neurons.forEach(function(neuron) {\n neuron.setInputs(v);\n });\n }", "function set_edges() {\n }" ]
[ "0.66169477", "0.6423226", "0.6336292", "0.63146806", "0.6251254", "0.62142676", "0.6211252", "0.61971015", "0.61276275", "0.6117264", "0.6094329", "0.6081297", "0.602919", "0.6013294", "0.6006735", "0.5918335", "0.5888945", "0.5874689", "0.5865207", "0.58272475", "0.58267397", "0.5819932", "0.5799043", "0.5774084", "0.5765446", "0.5759903", "0.5758647", "0.57552475", "0.57452184", "0.57281065", "0.57265687", "0.5717799", "0.5704862", "0.5702581", "0.5701387", "0.5700065", "0.56910133", "0.56460357", "0.5637721", "0.5624148", "0.5622652", "0.56213504", "0.5615789", "0.56105334", "0.56023955", "0.55973566", "0.55960006", "0.5593586", "0.5590525", "0.5577802", "0.55633986", "0.5546375", "0.5532901", "0.55321926", "0.55317837", "0.55159295", "0.55110914", "0.54946357", "0.5478533", "0.54747117", "0.5468096", "0.5464294", "0.5461394", "0.5452288", "0.5451854", "0.5448853", "0.54385984", "0.54347354", "0.54308236", "0.5430743", "0.54304355", "0.5428383", "0.5425805", "0.5421911", "0.5415733", "0.54136795", "0.54118466", "0.5407028", "0.5398523", "0.5390163", "0.53808165", "0.5367136", "0.53618693", "0.53589207", "0.5356942", "0.53514546", "0.53512603", "0.53493524", "0.5344676", "0.534139", "0.5340702", "0.53367555", "0.53237754", "0.5323616", "0.53218", "0.5321065", "0.53198504", "0.5316755", "0.53145844", "0.53128934" ]
0.6159369
8
when move over show the coordinate
function mousemove(){ var ary = d3.mouse(this); pos.attr("x", ary[0] + 2) .attr("y", ary[1] + 2) //.attr("x", 100) //.attr("y", 100) .text(Math.round(ary[0]) + ", " + Math.round(ary[1])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startOver() {\n //x cordinates\n this.x = this.beginX;\n //y cordinates\n this.y = this.beginY;\n }", "function onMouseMove(e) {\n\t\t var p = self.LL2C(e.latlng);\n\t\t var region = \"Hinterlands\";\n\t\t if (IsValidCoord(p.x, p.y) == true) {\n\t\t\t\tif (self.showposition) {\n\t\t\t\t\tdocument.getElementById(\"mousepos\"+ID).value = p.y.toFixed(0) + ', ' + p.x.toFixed(0);\n\t\t\t\t\tdocument.getElementById(\"secondmousepos\"+ID).value = p.y.toFixed(0) + ', ' + p.x.toFixed(0);\n }\n } \n\n\t\t}", "function coordinates(){\n $('.info-top').html(posY);\n $('.info-left').html(posX);\n }", "function showPosition() {\n}", "display(){\r\n point(this.x,this.y);\r\n }", "function showCoordinates(evt) {\n //the map is in web mercator but display coordinates in geographic (lat, long)\n var mp = webMercatorUtils.webMercatorToGeographic(evt.mapPoint);\n //display mouse coordinates\n dom.byId(\"info\").innerHTML = mp.x.toFixed(6) + \", \" + mp.y.toFixed(6);\n }", "returnToMap(){\n\t\tthis.setState({in: 87, out: 83, left: 65, right: 68});\n\t\tdocument.getElementById(\"over\").setAttribute('set_bind','true');\n\t}", "function showCoordinates(evt) {\n var mp = esri.geometry.webMercatorToGeographic(evt.mapPoint);\n\n //display mouse coordinates\n dojo.byId(self.settings.domID + \"-track-map-info\").innerHTML = EduVis.formats.lat(mp.y) + \", \" + EduVis.formats.lng(mp.x);\n\n }", "function 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}", "show() {\n rect(this.pos.x, this.pos.y, 10, 10);\n }", "move(event){\n this.xyE = this.getXY(event);\n }", "function showCoords(e, show){\n var viewPortWidth = window.innerWidth;\n\n if (viewPortWidth <= cutoffWidth){\n return;\n }\n\n if (show){\n var currX = currScale.x.invert(d3.mouse(e)[0]);\n var currY = currScale.y.invert(d3.mouse(e)[1]);\n var currF = himmelblau(currX, currY);\n\n d3.select(\"#x-coord\").text(currX.toFixed(2));\n d3.select(\"#y-coord\").text(currY.toFixed(2));\n d3.select(\"#f-val\").text(currF.toFixed(2));\n\n coordText.style(\"opacity\", 1);\n coordBox.style(\"opacity\", 1);\n }else{\n coordText.style(\"opacity\", 0);\n coordBox.style(\"opacity\", 0);\n }\n}", "handleMouseEnter() {\n this.position()\n this.setState({ visible: true })\n }", "mouseMove(evt, point) {\n this.setHover(this.topBlockAt(point));\n }", "show() {\n fill(this.c);\n stroke(255 - this.c);\n //float theta = this.vel.heading();\n push();\n translate(this.pos.x, this.pos.y);\n ellipse(0, 0, this.r);\n pop();\n }", "onMove() {\n }", "function mouseover() {\n //convert the slider value to the correct index of time in mapData\n spot = d3.select(this);\n if (!spot.classed('hidden-spot')) {\n index = rangeslider.value - 5\n let occupant = mapData[spot.attr(\"id\")][index];\n tooltip\n .html(mapData[spot.attr(\"id\")][0] + ': ' + (occupant === \"\" ? \"Unoccupied\" : occupant))\n .style(\"opacity\", 1);\n }\n}", "function mouseMoved(e) {\n mouseX = e.offsetX;\n mouseY = e.offsetY;\n let coor = \"Coordinates:(\" + mouseX + \",\" + mouseY + \")\";\n document.getElementById(\"coorDisplay\").innerHTML = coor;\n // fixCoordinates(x, y);\n render();\n}", "function mouseOver(x, y) {\r\n\t//debugOut(\"mouse over, x=\"+x+\" y=\"+y);\r\n\t\r\n\t//*** Your Code Here\r\n}", "function trackPosition(e) {\n\tmouse.x = e.pageX;//-225; 559\n\tmouse.y = e.pageY;\n\t// if( usuario_id !== -1 && over == 0)\n\t// \tsocket.emit('sendPositionCursor',{usuario:usuario_id,x:mouse.x});\n\tif( usuario_id !== -1 && over == 0){\n\t\tp = paddles[usuario_id]; //1\n\t\tp.x = mouse.x - p.w/2;\t\t\n\t\tsocket.emit('sendPositionCursor',{usuario:usuario_id,x:p.x});\n\t}\n}", "function moveTooltip(d,pos) {\n // console.log(\"Inside showTooltip\");\n // console.log(pos.top);\n // console.log(pos.left);\n}", "draw(){\n var divPosition = this.getProjection().fromLatLngToDivPixel(this.position);\n // Hide the popup when it is far out of view.\n var display =\n Math.abs(divPosition.x) < 4000 && Math.abs(divPosition.y) < 4000 ?\n 'block' :\n 'none';\n \n if (display === 'block') {\n this.anchor.style.left = divPosition.x + 'px';\n this.anchor.style.top = divPosition.y + 'px';\n }\n if (this.anchor.style.display !== display) {\n this.anchor.style.display = display;\n }\n }", "function changeShipHoverPos(event) {\r\n if (state.phase !== 'setup') {\r\n return;\r\n }\r\n shipHoverEl.style.left = `calc(${event.pageX}px - 2vw)`;\r\n shipHoverEl.style.top = `calc(${event.pageY}px - 2vw)`;\r\n}", "show() {\n fill(\"red\");\n ellipse(this.pos.x, this.pos.y, 15, 15)\n\n }", "mouseOverCheck(x,y){\n let d = dist(x,y,this.locX,this.locY);\n if(d<this.ballSize/2){return true;}\n else{return false;}\n }", "mouseOn() {\n if (mouseX > this.x && mouseX < this.x + this.w\n && mouseY > this.y && mouseY < this.y + this.h) {\n this.mouseover = true;\n }\n else {\n this.mouseover = false;\n }\n }", "function showCoords(event) {\n //attain the coordinates of the cursor\n let x = event.clientX;\n let y = event.clientY;\n let coords = `(${x}, ${y})`\n //assign the position of the container\n coordsContainer.style.left = x + 'px';\n coordsContainer.style.top = y + 'px';\n //display the coordinates in the p tag\n coordsDisplay.innerHTML = coords;\n}", "updatePosition() {\n this.position = getPositionForPopup(this.mapFeature);\n this.draw();\n }", "function showCoordinates(evt) {\n //get mapPoint from event\n //The map is in web mercator - modify the map point to display the results in geographic\n var mp = esri.geometry.webMercatorToGeographic(evt.mapPoint);\n //display mouse coordinates\n dojo.byId(\"coords\").innerHTML = \"<b>Longitude: \" + mp.x.toFixed(2) + \"&nbsp;&nbsp;&nbsp;&nbsp;Latitude: \" + mp.y.toFixed(2) + \"</b>\";\n //dojo.byId(\"coords\").innerHTML = \"<b>X: \" + evt.mapPoint.x + \"&nbsp;&nbsp;&nbsp;Y: \" +evt.mapPoint.y + \"</b>\";\n }", "mouseOn() {\n if (mouseX > this.x && mouseX < this.x + this.w\n && mouseY > this.y && mouseY < this.y + this.h) {\n this.mouseover = true;\n this.stroke = 3;\n }\n else {\n this.mouseover = false;\n this.stroke = 2;\n }\n }", "show() {\n rect(this.pos.x, this.pos.y, this.scl, this.scl);\n }", "onMouseMove(coord, event) {\n if (this.mouseUp == false) {\n this.contextDraft.clearRect(0, 0, canvasDraft.width, canvasDraft.height);\n this.contextDraft.strokeStyle = rgbaColor;\n this.contextDraft.fillStyle = \"transparent\";\n this.contextDraft.lineWidth = lWidth;\n this.contextDraft.beginPath();\n this.contextReal.beginPath();\n this.contextDraft.moveTo(this.startX[0], this.startY[0]);\n var i;\n for (i = 0; i < this.startX.length; i++) {\n this.contextReal.lineTo(this.startX[i], this.startY[i]);\n this.contextDraft.lineTo(this.startX[i], this.startY[i]);\n }\n this.contextDraft.lineTo(coord[0], coord[1]);\n \n this.contextDraft.fill();\n this.contextDraft.stroke();\n this.contextReal.stroke();\n }\n }", "function mpMouseover() {\n // Get mouse positions from the main canvas.\n var mousePos = d3.mouse(this)\n // Get the data from our map!\n if (typeof (transform) !== \"undefined\") {\n var nodeData = quadtree.find((mousePos[0] - margin.left - transform[\"x\"]) / transform[\"k\"],\n (mousePos[1] - margin.top - transform[\"y\"]) / transform[\"k\"], 50)\n } else {\n nodeData = quadtree.find(mousePos[0] - margin.left, mousePos[1] - margin.top, 50)\n }\n\n // Only show mouseover if hovering near a point\n if (typeof (nodeData) !== \"undefined\") {\n // If we're dealing with mp nodes\n if (typeof (nodeData.id) !== \"undefined\") {\n slide5_show_mp_tooltip(nodeData, mousePos)\n } else {\n median_mouseover(nodeData, mousePos)\n }\n }\n d3.event.preventDefault()\n\n }", "function onDrag() {\r\n\t\t\t//Gets the top left corner of square that you're in (x, y)\r\n\t\t\tmoving = true;\r\n\t\t\tlet x_check = Math.floor((d3.event.x - graph.offset.x + graph.cell_size / 2) / graph.cell_size);\r\n\t\t\tlet y_check = Math.floor((d3.event.y - graph.offset.y + graph.cell_size / 2) / graph.cell_size);\r\n\t\t\tif(x_check <= 0) {\r\n\t\t\t\tpoint.x = 0;\r\n\t\t\t} else if(x_check >= graph.numCols) {\r\n\t\t\t\tpoint.x = graph.numCols;\r\n\t\t\t} else {\r\n\t\t\t\tpoint.x = x_check;\r\n\t\t\t}\r\n\t\t\tif(y_check <= 0) {\r\n\t\t\t\tpoint.y = 0;\r\n\t\t\t} else if(y_check >= graph.numRows) {\r\n\t\t\t\tpoint.y = graph.numRows;\r\n\t\t\t} else {\r\n\t\t\t\tpoint.y = y_check;\r\n\t\t\t}\r\n\t\t\tupdatePosition();\r\n\t\t\tgraph.update();\r\n\t\t}", "function previewPosition (e) {\r\n // get tick position in slider\r\n var position = $(this).position().left;\r\n // get tic offset from the left of the player\r\n var offset = $(this).offset().left;\r\n // if the oofset biger then half of the preview div\r\n if( offset > 150 ) {\r\n $('.preview').css('left', position - 150 );\r\n $('.chupchik').css('left', '50%' );\r\n } else {\r\n $('.preview').css('left', - ($('#slider').position().left) + 4 );\r\n // if the current slide circle on the tick\r\n if ( $(this).hasClass('ui-slider-handle') ) {\r\n $('.chupchik').css('left', offset - 1);\r\n } else {\r\n $('.chupchik').css('left', offset - 5);\r\n }\r\n } \r\n \r\n }", "function mouse(e)\n{\n var x = e.pageX - document.getElementById(\"game_object\").offsetLeft;\n var y = e.pageY - document.getElementById(\"game_object\").offsetTop;\n document.getElementById(\"x\").innerHTML = x;\n document.getElementById(\"y\").innerHTML = y;\n}", "__mousemove(idx, ex, ey){\n let player = this.players[idx];\n if(player.dragActive){\n player.selectedTile.x = ex - player.initialX;\n player.selectedTile.y = ey - player.initialY;\n }\n }", "function focusShowLocationCard() {\n dispatch(showLocation());\n dispatch(\n setMouseCoordinates({\n x:\n section.current.offsetParent.offsetLeft +\n section.current.offsetLeft +\n section.current.clientHeight,\n y:\n section.current.offsetParent.offsetTop +\n section.current.offsetTop,\n }),\n );\n dispatch(setLocationData(data));\n }", "function showPosition(position) {\n movieAndDinnerObject.lat = position.coords.latitude;\n movieAndDinnerObject.long = position.coords.longitude;\n }", "function check(e) {\n var pos = getPos(e), posAbs = { x: e.clientX, y: e.clientY }; // div is fixed, so use clientX/Y\n if (!visible &&\n pos.x >= region.x && pos.x < region.x + region.w &&\n pos.y >= region.y && pos.y < region.y + region.h) {\n me.show(posAbs); // show tool-tip at this pos\n }\n else\n setDivPos(posAbs); // otherwise, update position\n }", "function startPosition(){\n painting = true;\n }", "function mouseOver() {\n setMouseOver(true);\n }", "toScreen() \t{return new Point(gMap.mapToScreenX(this._x,this._y),gMap.mapToScreenY(this._x,this._y));}", "onMouseUp(coord, event) {\n this.contextReal.strokeStyle = rgbaColor;\n this.contextReal.fillStyle = rgbaColor;\n this.contextReal.lineWidth = lWidth;\n this.contextReal.lineJoin = \"miter\";\n \n this.contextReal.lineTo(coord[0], coord[1]);\n this.origX = coord[0];\n this.origY = coord[1];\n this.startX.push(this.origX);\n this.startY.push(this.origY);\n if (Math.abs(this.origX - this.startX[0]) < 20 && Math.abs(this.origY - this.startY[0]) < 20 && this.startX.length > 1 && this.startY.length > 1) {\n this.mouseUp = true;\n this.contextDraft.clearRect(0,0,canvasDraft.width,canvasDraft.height);\n this.contextReal.fill();\n this.contextReal.stroke();\n cPush(); \n }\n }", "rollover(px, py) {\n var d = dist(px, py, this.x, this.y);\n if (d < this.diameter/2) {\n this.over = true;\n } else {\n this.over = false;\n }\n }", "function showMoveAnimation( fromx , fromy , tox , toy ){\r\n var numberCell = $('#number-cell-'+fromx+'-'+fromy );\r\n numberCell.animate({\r\n top:getPosTop( tox ,toy ),\r\n left:getPosLeft(tox ,toy)\r\n\r\n },200)\r\n}", "function moveAt(e) {\n ship.style.left = e.pageX + 'px';\n ship.style.top = e.pageY + 'px';\n }", "setPosition(e) {\n\n this.mouseIsDown = true;\n this.ctx.beginPath();\n this.ctx.moveTo(e.offsetX, e.offsetY);\n\n // Ajouter un event pour commencer à dessiner lorsq'on deplace la souris //\n this.carte.signElt.addEventListener('mousemove', (e) => { this.draw(e) });\n\n }", "function showCoords() {\n // TODO: Set the map center to the latitude / longitude position of your own home\n\n\n // TODO: Zoom the map close enough\n\n}", "showTile(x, y) {\n this.getTile(x, y).visible = true;\n }", "__showMoveFrame() {\n var location = this.getContentLocation();\n var bounds = this.getBounds();\n var frame = this.__getMoveFrame();\n frame.setUserBounds(\n location.left,\n location.top,\n bounds.width,\n bounds.height\n );\n\n frame.show();\n frame.setZIndex(this.getZIndex() + 1);\n }", "function onMouseMove(event) {\n\tmousePosition=event;\n}", "setStart(x, y){\n if (this.alive == false){\n this.x = x + 130;\n this.y = y + 17;\n }\n }", "function show( me ){\n $( me.canvas ).css({ \n 'top': 0 \n })\n }", "show(){\n push();\n rectMode(CORNER);\n fill(this.color.x,this.color.y,this.color.z);\n rect(this.location.x,this.location.y,this.width,this.height);\n pop();\n }", "function showMousePosition(event) { \n // y-axle is reversed compare to normal x-y coordinate\n curX = event.clientX - centerX;\n curY = centerY - event.clientY;\n curTime = Date.now();\n \n // for first time move mouse\n // if(typeof preTime === \"undefined\"){\n // preX = curX;\n // preY = curY;\n // preTime = curTime;\n // return;\n // }\n // calc_speed(preX, preY, preTime, curX, curY, curTime);\n}", "function moverA(pageX,pageY){\r\n \t\t\tbola.style.left = pageX - shiftX + \"px\";\r\n \t\t\tbola.style.top = pageY - shiftY + \"px\";\r\n \t\t}", "function moveAt(event){\n movingItem.style.left = event.pageX - 17 + 'px'; \n movingItem.style.top = event.pageY - 23 + 'px';\n //console.log(movingItem.getBoundingClientRect().top);\n }", "function mousemoveDeputy() { return tooltip.style(\"top\", (event.pageY - 10)+\"px\").style(\"left\",(event.pageX + 10)+\"px\");}", "static onMove(mouseEvent, offset) {\n let THIS = this;\n THIS.coord.x = Modal.x + offset.x;\n THIS.coord.y = Modal.y + offset.y;\n Render.scheduleUpdate();\n }", "display(){\n this.body.position.x=mouseX;\n this.body.position.y=mouseY;\n super.display();\n }", "function drawGps() {\r\n var posX = dragStartLoc.x;\r\n var posY = dragStartLoc.y;\r\n document.getElementById('x-value').innerHTML = Math.floor(posX);\r\n document.getElementById('y-value').innerHTML = Math.floor(posY);\r\n\r\n}", "mouseOn() {\n if (mouseX > this.x && mouseX < this.x + this.w\n && mouseY > this.y && mouseY < this.y + this.h) {\n this.stroke = 2;\n this.mouseover = true;\n }\n else {\n this.stroke = 1;\n this.mouseover = false;\n }\n }", "function onMouseMove(event) {\n mousePos = event.point;\n}", "function mouseOver() {\n\t\tif (canMove(this)) {\n\t\t\tthis.className = \"piece hover\";\n\t\t}\n\t}", "mouseMove(prev, pt) {}", "function showPosition(position) {\n textBox.innerHTML = \"Latitude: \" + position.coords.latitude +\n \"<br>Longitude: \" + position.coords.longitude;\n\n if(startPos==false){\n startPos = {\n lat:position.coords.latitude,\n lon:position.coords.longitude\n };\n }\n\n markPoint(position.coords.latitude,position.coords.longitude);\n}", "function setPosition(e) {\n pos.x = e.clientX + 10 ;\n pos.y = e.clientY + 50;\n}", "function mouseOver() {\n\t//this.className += \" movablepiece\";\n\t//alert(\"Over:\" + this.id);\n\tif((parseInt(document.getElementById(this.id).style.left) + parseInt(\"100px\") == parseInt(x_emptydiv)) && (parseInt(document.getElementById(this.id).style.top) + parseInt(\"0px\") == parseInt(y_emptydiv)))\n\t{\n\t\tthis.className += \" movablepiece\";\n\t}\n\telse if((parseInt(document.getElementById(this.id).style.left) - parseInt(\"100px\") == parseInt(x_emptydiv)) && (parseInt(document.getElementById(this.id).style.top) + parseInt(\"0px\") == parseInt(y_emptydiv)))\n\t{\n\t\tthis.className += \" movablepiece\";\n\t}\n\telse if((parseInt(document.getElementById(this.id).style.left) + parseInt(\"0px\") == parseInt(x_emptydiv)) && (parseInt(document.getElementById(this.id).style.top) + parseInt(\"100px\") == parseInt(y_emptydiv)))\n\t{\n\t\tthis.className += \" movablepiece\";\n\t}\n\telse if((parseInt(document.getElementById(this.id).style.left) + parseInt(\"0px\") == parseInt(x_emptydiv)) && (parseInt(document.getElementById(this.id).style.top) - parseInt(\"100px\") == parseInt(y_emptydiv)))\n\t{\n\t\tthis.className += \" movablepiece\";\n\t}\n\t\n}", "function myMove(e){\n \n if (isDrag){\n getMouse(e);\n \n mySel.x = mx - offsetx;\n mySel.y = my - offsety; \n //console.log(mySel.x+' '+mySel.y);\n \n // something is changing position so we better invalidate the canvas!\n invalidate();\n }\n}", "display() {\n push();\n translate(this.pX, this.pY);\n fill(color(255, 255, 255, (random(120))));\n ellipse(0, 0, this.rR);\n pop();\n }", "handlemouseMove(e) {\n const rect = this.canvas.getBoundingClientRect();\n if (this.flag) {\n this.prevX = this.currX;\n this.prevY = this.currY;\n this.currX = e.clientX - rect.left;\n this.currY = e.clientY - rect.top;\n this.draw(this.template, this.ctx);\n }\n }", "_moveToolTip (element, event) {\n var div = document.getElementById(\"bcdChartToolTip\");\n if (! div)\n return;\n if (jQuery(div).is(\":visible\"))\n bcdui.widget._flyOverPositioning({event: event, htmlElement: div, positionUnderMouse: false});\n }", "function display(offsetX, offsetY){\n var point=[offsetX, offsetY]\n var relativePoint = getRelativePoint(point);\n if (isACountrySelected()){\n var hoveredArea = getAreaPointBelongsTo($scope.selectedCountry, relativePoint);\n $scope.hoveredArea = hoveredArea;\n }else{\n var hoveredCountry = getCountryPointBelongsTo(relativePoint);\n $scope.hoveredCountry = hoveredCountry;\n }\n }", "function movedown(){\n undraw();\n currentposition+=GRID_WIDTH;\n draw();\n freeze();\n console.log(down);\n }", "function move(x) {\n\n var moving = x;\n\n if (moving == down) {\n\n if (yPosition == 0) {\n yPosition += 1;\n document.getElementById(\"up\").style.visibility = 'visible';\n }\n \n else if (yPosition < 5) {\n yPosition += 1;\n }\n \n else if (yPosition == 5) {\n yPosition += 1;\n document.getElementById(\"down\").style.visibility = 'hidden';\n }\n\n\n }\n\n else if (moving == up) {\n\n if (yPosition == 6) {\n yPosition -= 1;\n document.getElementById(\"down\").style.visibility = 'visible';\n }\n \n else if (yPosition > 1) {\n yPosition -= 1;\n }\n \n else if (yPosition == 1) {\n yPosition -= 1;\n document.getElementById(\"up\").style.visibility = 'hidden';\n }\n \n }\n \n else if (moving == left) {\n\n if (xPosition == 6) {\n xPosition -= 1;\n document.getElementById(\"right\").style.visibility = 'visible';\n }\n \n else if (xPosition > 1) {\n xPosition -= 1;\n }\n \n else if (xPosition == 1) {\n xPosition -= 1;\n document.getElementById(\"left\").style.visibility = 'hidden';\n }\n\n }\n\n else if (moving == right) {\n\n if (xPosition == 0) {\n xPosition += 1;\n document.getElementById(\"left\").style.visibility = 'visible';\n }\n \n else if (xPosition < 5) {\n xPosition += 1;\n }\n \n else if (xPosition == 5) {\n xPosition += 1;\n document.getElementById(\"right\").style.visibility = 'hidden';\n }\n\n }\n}", "function OverlayConnectionPosition() { }", "function movimiento(evt)\n{\n\tvar position=$(evt.currentTarget).attr('id');\n\tmarkerPosition(position);\n}", "function showPosition(position) {\n updateByGeo(position.coords.latitude, position.coords.longitude);\n }", "over()\n {\n this.y -= 5;\n }", "function showLocationCard() {\n dispatch(showLocation());\n dispatch(setMouseCoordinates(mousePosition));\n dispatch(setLocationData(data));\n }", "function frame() {\n console.log(\"zaim\");\n if (pos == z) {\n clearInterval(id);\n } else {\n pos--; \n //elem.style.top = pos + 'px'; \n elemt.style.left = pos+\"px\"; \n x=pos;\n //console.log(`avancer pos ${tos}`);\n }\n }", "function displayCoord(a) {\r\n\t\tc.beginPath();\r\n\t\tc.moveTo(parseInt(a[0],10)-3,output(parseInt(a[1],10)-3));\r\n\t\tc.lineTo(parseInt(a[0],10)+3,output(parseInt(a[1],10)+3));\r\n\t\tc.stroke();\r\n\t\tc.beginPath();\r\n\t\tc.moveTo(parseInt(a[0],10)-3,output(parseInt(a[1],10)+3));\r\n\t\tc.lineTo(parseInt(a[0],10)+3,output(parseInt(a[1],10)-3));\r\n\t\tc.stroke();\r\n\t\tif (showCoordsCheck) c.fillText(\"(\"+a[0]+\",\"+a[1]+\")\",parseInt(a[0],10)+10,output(parseInt(a[1],10)+10));\r\n\t}", "function getPosition(e) { \n restbound = 0.03;\n restime = 6500;\n fire =true;\n mouseX = e.x - canvas.offsetLeft;\n mouseY = e.y - canvas.offsetTop;\n chat.server.send(mouseX / W, mouseY / H);\n push = true; \n }", "isMouseOver() {\n return this.square.isMouseOver()\n }", "function showCoords(event) {\n var x = event.clientX;\n var y = event.clientY;\n var coor = \"X coords: \" + x + \", Y coords: \" + y;\n document.getElementById(\"demo\").innerHTML = coor;\n}", "function onMouseMove(event) {\n\tmousePos = event.point;\n}", "function trackPosition(e) {\n\tmouse.x = e.pageX;\n\tmouse.y = e.pageY;\n}", "function mouveMove() {\n refreshDisplay();\n}", "mouseUp(pt) {}", "mouseUp(pt) {}", "function mousePressed(){\n b_location_x = random (position);\n b_location_y = random (position);\n \n }", "function mouseOverWhich(x, pic, picX, set1, set2, set3){\n push();\n rectMode(CENTER);\n rect(x, height/2+height/6, width/10, height);\n noTint();\n image(pic, picX, height/2, width/13, width/13);\n setText(set1, set2, set3);\n pop();\n\n}", "function trackPosition(e) {\n mouse.x = e.pageX;\n mouse.y = e.pageY;\n}", "show(){\n noFill();\n rect(this.boundary.x, this.boundary.y, this.boundary.w, this.boundary.h);\n if(this.isParent){\n this.northeast.show();\n this.northwest.show();\n this.southeast.show();\n this.southwest.show();\n }\n }", "show() {\n fill(0, 204, 0);\n rect(this.x, this.topY, \n this.width, this.height);\n }", "function overSearchResult(coordinates, mmsi){\n oldMmsi = selectedMmsi;\n oldCoordinates = view.getCenter();\n highlightShip(mmsi);\n jumpto(coordinates);\n}", "function onPointAfterSetState(e) {\n var point = this;\n if (point.moveToTopOnHover && point.graphic) {\n point.graphic.attr({\n zIndex: e && e.state === 'hover' ? 1 : 0\n });\n }\n }", "function tooltip_move(event) {\n\tif (div.tooltip.style.display === \"block\") {\n\t\tlet x = div.tooltip.clientWidth,\n\t\t\ty = div.tooltip.clientHeight;\n\n\t\tdiv.tooltip.style.left = Math.min(\n\t\t\tevent.x + 2,\n\t\t\tinnerWidth - div.tooltip.clientWidth\n\t\t) + \"px\";\n\t\tdiv.tooltip.style.top = Math.max(\n\t\t\tevent.y - div.tooltip.clientHeight - 2,\n\t\t\t0\n\t\t) + \"px\";\n\t}\n}", "function showPointer(){\n $(this).css({\n 'cursor' : 'pointer',\n 'transform' : 'scale(1.1)',\n '-moz-transform' : 'scale(1.1)',\n '-webkit-transform' : 'scale(1.1)',\n '-moz-transition' : '.5s',\n '-webkit-transition' : '.5s'\n });\n }" ]
[ "0.7125222", "0.7015854", "0.6966599", "0.6771103", "0.67640007", "0.6707928", "0.66533715", "0.66343117", "0.6527919", "0.6526985", "0.6505445", "0.64926314", "0.6466924", "0.64642304", "0.64415", "0.6415712", "0.6376348", "0.6373153", "0.6369629", "0.63659483", "0.6355234", "0.63549495", "0.63469577", "0.6340155", "0.63336563", "0.6303259", "0.62794346", "0.6272955", "0.626679", "0.6265193", "0.62527406", "0.6247314", "0.6237808", "0.6235347", "0.62336373", "0.6225859", "0.62029314", "0.61925405", "0.6192311", "0.6188815", "0.618783", "0.6183395", "0.6182359", "0.61798215", "0.6171726", "0.61703295", "0.6165854", "0.6163437", "0.6156683", "0.6152901", "0.6149858", "0.6141835", "0.6139136", "0.6137481", "0.6122011", "0.6118141", "0.6116927", "0.61071754", "0.6105467", "0.6102907", "0.6093019", "0.60900116", "0.60750633", "0.60740525", "0.6059435", "0.60559326", "0.60546964", "0.6054693", "0.60448295", "0.6037271", "0.6034631", "0.6026858", "0.6025989", "0.6021242", "0.6021238", "0.60211754", "0.601927", "0.6016606", "0.6012144", "0.6011449", "0.6010132", "0.60061145", "0.6002174", "0.6000999", "0.5993813", "0.59905684", "0.59869385", "0.5985508", "0.598495", "0.598012", "0.598012", "0.5978226", "0.5976961", "0.5974527", "0.5972441", "0.5965243", "0.5965214", "0.59544826", "0.59521824", "0.5949809" ]
0.60220855
73
print the Extented svg
function printExtentedSVG(resolution, callback){ var recordWidth = windowWidth; windowWidth = width + 100; print = true; firstTime = true; setNodePosition(); var objSVG = document.getElementById(htmlElement); setTimeout(function(){ saveSvgAsPng(objSVG, htmlElement + ".png", resolution); windowWidth = recordWidth; print = false; firstTime = true; setNodePosition(); if(callback) callback(); }, 1500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printDiagram() {\n var svgWindow = window.open();\n if (!svgWindow) return; // failure to open a new Window\n var printSize = new go.Size(1700, 2960);\n var bnds = myDiagram.documentBounds;\n var svg = myDiagram.makeSvg({ scale: 1.0, position: new go.Point(0, 0), size: bnds });\n svgWindow.document.body.appendChild(svg);\n}", "printHeader ()\n {\n console.log();\n console.log(\"svg-min 🔩\");\n console.log();\n }", "drawSvg() {\n \n\t}", "function ioSVG_exportSVGfont() {\n\t\t// debug('\\n ioSVG_exportSVGfont - Start');\n\t\tvar ps = _GP.projectsettings;\n\t\tvar md = _GP.metadata;\n\t\tvar family = md.font_family;\n\t\tvar familyid = family.replace(/ /g, '_');\n\t\tvar timestamp = genDateStampSuffix();\n\t\tvar timeoutput = timestamp.split('-');\n\t\ttimeoutput[0] = timeoutput[0].replace(/\\./g, '-');\n\t\ttimeoutput[1] = timeoutput[1].replace(/\\./g, ':');\n\t\ttimeoutput = timeoutput.join(' at ');\n\n\t\tvar con = '<?xml version=\"1.0\"?>\\n'+\n\t\t\t// '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\" >\\n'+\n\t\t\t'<svg width=\"100%\" height=\"100%\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\\n'+\n\t\t\t'\\t<metadata>\\n\\n'+\n\t\t\t'\\t\\tProject: ' + ps.name + '\\n'+\n\t\t\t'\\t\\tFont exported on ' + timeoutput + '\\n\\n'+\n\t\t\t'\\t\\tCreated with Glyphr Studio - the free, web-based font editor\\n'+\n\t\t\t'\\t\\t' + _UI.thisGlyphrStudioVersion + '\\n'+\n\t\t\t'\\t\\t' + _UI.thisGlyphrStudioVersionNum + '\\n\\n'+\n\t\t\t'\\t\\tFind out more at www.glyphrstudio.com\\n\\n'+\n\t\t\t'\\t</metadata>\\n'+\n\t\t\t'\\t<defs>\\n'+\n\t\t\t'\\t\\t<font id=\"'+escapeXMLValues(familyid)+'\" horiz-adv-x=\"'+ps.upm+'\">\\n'+\n\t\t\t'\\t\\t\\t<font-face\\n'+ ioSVG_makeFontFace()+'\\n'+\n\t\t\t'\\t\\t\\t\\t<font-face-src>\\n'+\n\t\t\t'\\t\\t\\t\\t\\t<font-face-name name=\"'+escapeXMLValues(family)+'\" />\\n'+\n\t\t\t'\\t\\t\\t\\t</font-face-src>\\n'+\n\t\t\t'\\t\\t\\t</font-face>\\n';\n\n\t\tcon += '\\n';\n\t\tcon += ioSVG_makeMissingGlyph();\n\t\tcon += '\\n\\n';\n\t\tcon += ioSVG_makeAllGlyphsAndLigatures();\n\t\tcon += '\\n';\n\t\tcon += ioSVG_makeAllKernPairs();\n\t\tcon += '\\n';\n\n\t\tcon += '\\t\\t</font>\\n'+\n\t\t\t'\\t</defs>\\n\\n';\n\n\t\t// con += '\\t<style type=\"text/css\">\\n';\n\t\t// con += '\\t\\t@font-face {\\n';\n\t\t// con += '\\t\\t\\tfont-family: \"'+family+'\", monospace;\\n';\n\t\t// con += '\\t\\t\\tsrc: url(#'+familyid+');\\n';\n\t\t// con += '\\t\\t}\\n';\n\t\t// con += '\\t</style>\\n\\n';\n\n\t\tcon += '\\t<text x=\"100\" y=\"150\" style=\"font-size:48px;\" font-family=\"'+family+'\">'+family+'</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"220\" style=\"font-size:48px;\" font-family=\"'+family+'\">ABCDEFGHIJKLMNOPQRSTUVWXYZ</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"290\" style=\"font-size:48px;\" font-family=\"'+family+'\">abcdefghijklmnopqrstuvwxyz</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"360\" style=\"font-size:48px;\" font-family=\"'+family+'\">1234567890</text>\\n';\n\t\tcon += '\\t<text x=\"100\" y=\"430\" style=\"font-size:48px;\" font-family=\"'+family+'\">!\\\"#$%&amp;\\'()*+,-./:;&lt;=&gt;?@[\\\\]^_`{|}~</text>\\n';\n\n\t\tcon += '</svg>';\n\n\t\tvar filename = ps.name + ' - SVG Font - ' + timestamp + '.svg';\n\n\t\tsaveFile(filename, con);\n\n\t\t// debug(' ioSVG_exportSVGfont - END\\n');\n\t}", "function SVGParent() {}", "function SVGWrap() {}", "_saveContextSVG(){\n this.getGraphicsContext().saveSVG();\n }", "_getSVGHandler(e){let root=this,temp=document.createElement(\"div\"),getID=function(element,alt){if(null===element.getAttribute(\"id\"))element.setAttribute(\"id\",alt);return element.getAttribute(\"id\")},setAriaLabelledBy=function(source,target,prefix){// adds title and desc elements to target and sets the aria-labelledby attribute\nlet svgElem=function(nodename){source=null!==source?source:root;//adds title or desc element to target\nlet attr=\"title\"===nodename?\"label\":nodename,query=source.querySelector(\"#\"+attr);var label=target.querySelector(nodename);//if the target doesn't have the element, add it\nif(null===label){label=document.createElement(nodename);target.prepend(label)}//populates the element with data from the source element\nif(null!==source.getAttribute(attr)){label.innerHTML=source.getAttribute(attr)}else if(null!==query&&\"\"!==query.innerHTML){label.innerHTML=query.innerHTML}//returns the new element's id\nreturn getID(label,prefix+\"-\"+attr)};//set aria-labelledby to the id's for title and descriptions\ntarget.setAttribute(\"aria-labelledby\",svgElem(\"desc\")+\" \"+svgElem(\"label\"))};//set up main svg and append to document\ntemp.innerHTML=e.detail.response;let svg=temp.querySelector(\"svg\"),svgid=getID(svg,\"svg-\"+Date.now()),hdata=dom(root).querySelectorAll(\"lrndesign-imagemap-hotspot\");setAriaLabelledBy(root,svg,svgid);this.shadowRoot.querySelector(\"#svg\").appendChild(svg);for(let i=0;i<hdata.length;i++){let hid=hdata[i].getAttribute(\"hotspot-id\"),hotspot=svg.querySelector(\"#\"+hid),clone=svg.cloneNode(!0);//clone svg for print versions and show hotspot as selected\nsetAriaLabelledBy(hdata[i],clone,hid);hdata[i].appendChild(clone);hdata[i].querySelector(\"#\"+hid).classList.add(\"selected\");hdata[i].setParentHeading(root.shadowRoot.querySelector(\"#heading\"));for(let j=0;j<hdata.length;j++){hdata[i].querySelector(\"#\"+hdata[j].getAttribute(\"hotspot-id\")).classList.add(\"hotspot\")}//configure hotspot on main (interactive) svg\nlet hbutton=document.createElement(\"button\");hbutton.setAttribute(\"tabindex\",0);hbutton.setAttribute(\"aria-label\",hdata[i].label);root.shadowRoot.querySelector(\"#buttons\").appendChild(hbutton);hbutton.addEventListener(\"focus\",function(){hotspot.classList.add(\"focus\")});hbutton.addEventListener(\"blur\",function(){hotspot.classList.remove(\"focus\")});hotspot.classList.add(\"hotspot\");hotspot.addEventListener(\"click\",e=>{this.openHotspot(hotspot,hdata[i])});hbutton.addEventListener(\"keyup\",e=>{if(13===e.keyCode||32===e.keyCode){if(!hotspot.classList.contains(\"selected\")){this.openHotspot(hotspot,hdata[i])}}})}}", "function get_svg()\n {\n var svg = document.getElementById('SVGobject');\n if( svg.contentDocument != null )\n { \n svg = svg.contentDocument.getElementsByTagName('svg');\n\n\t\t // Get viewbox here and check for undefined to fix IE from failing...\n\t\t var viewbox = $(svg).attr(\"viewBox\");\n if( svg != null && viewbox !== undefined )\n {\n clearInterval(get_svg_id);\n svg_elm = svg;\n viewbox = viewbox.split(/ /);\n fullwidth = parseInt(viewbox[2]);\n ratio = parseInt(viewbox[3]) / fullwidth;\n\t fitwidth = $(elm).width();\n chart_resize(fitwidth);\n $(elm).removeClass(\"noshow\"); //Makes chart show on page\n\t\t\t $(\"a.showline\").css(\"display\", \"inline\");;\n return;\n } \n }\n }", "function showCoords($svg){\n $('[class~=edge] text,[class~=cell] text', $svg).text(function(){ \n return $(this).data('coords');\n }).css('font-size', '7pt');\n}", "serialize() {\n var svg = document.getElementsByTagName(\"svg\")\n var editor = atom.workspace.getActiveTextEditor()\n if(editor && (svg.length == 0)){\n this.createGraph(editor);\n }\n }", "function GetSGV() {\r\n var svg = project.exportSVG({ asString: true });\r\n console.log(svg);\r\n}", "function downloadPNG4x() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\", {scale: 4});\n}", "function gLyphsCreateExperimentExpressExportWidget() {\n var g1 = document.createElementNS(svgNS,'g'); \n if(!current_region.exportSVGconfig) {\n g1.setAttributeNS(null, \"onclick\", \"gLyphsToggleExpressionSubpanel('export');\");\n g1.setAttributeNS(null, \"onmouseover\", \"eedbMessageTooltip(\\\"export data\\\",80);\");\n g1.setAttributeNS(null, \"onmouseout\", \"eedbClearSearchTooltip();\"); \n // poly.setAttributeNS(null, \"onclick\", \"gLyphsExpGraphExportPanel();\");\n }\n \n var rect = g1.appendChild(document.createElementNS(svgNS,'rect'));\n rect.setAttributeNS(null, 'x', '0px');\n rect.setAttributeNS(null, 'y', '0px');\n rect.setAttributeNS(null, 'width', '11px');\n rect.setAttributeNS(null, 'height', '11px');\n rect.setAttributeNS(null, 'fill', 'rgb(240,240,255)');\n rect.setAttributeNS(null, 'stroke', 'rgb(100,100,100)');\n //if(!current_region.exportSVGconfig) {\n // rect.setAttributeNS(null, \"onclick\", \"gLyphsExpGraphExportPanel();\");\n // rect.setAttributeNS(null, \"onmouseover\", \"eedbMessageTooltip(\\\"export data\\\",80);\");\n // rect.setAttributeNS(null, \"onmouseout\", \"eedbClearSearchTooltip();\");\n //}\n \n var poly = g1.appendChild(document.createElementNS(svgNS,'polygon'));\n poly.setAttributeNS(null, 'points', '4,2 7,2 7,5 9.5,5 5.5,9.5 1.5,5 4,5 4,2');\n //poly.setAttributeNS(null, 'fill', 'blue');\n poly.setAttributeNS(null, 'fill', 'gray');\n //if(!current_region.exportSVGconfig) {\n // poly.setAttributeNS(null, \"onclick\", \"gLyphsExpGraphExportPanel();\");\n // poly.setAttributeNS(null, \"onmouseover\", \"eedbMessageTooltip(\\\"export data\\\",80);\");\n // poly.setAttributeNS(null, \"onmouseout\", \"eedbClearSearchTooltip();\");\n //}\n g1.setAttributeNS(null, 'transform', \"translate(\" + (current_region.display_width-45) + \",0)\");\n return g1;\n}", "function saveSVG(){\n\t\t\tvar blob = new Blob([canvas.toSVG()], {type: \"text/plain;charset=utf-8\"});\n\t\t\tsaveAs(blob, \"download.svg\");\n\n\t\t}", "function SigmaEnableSVG() {\n return null;\n}", "function SVGComic(evt, opts) {\n /// <summary>The main SVGComic object</summary>\n /// <param name=\"evt\">The calling event</param>\n /// <param name=\"opts\">The desired options</param>\n /// <option name=\"author\">The author's name (defaults to A. N. Onymous)</option>\n /// <option name=\"copyright\">The preferred copyright statement (defaults to \"&copy YEAR AUTHOR. All rights \n /// reserved\")</option>\n /// <option name=\"fill\">Preferred gutter color (defaults to black)</option>\n /// <option name=\"fontSize\">Preferred font size for title/author/subtitle/copyright (defaults to 12)</option>\n /// <option name=\"height\">Preferred comic height (defaults to 300)</option>\n /// <option name=\"subtitle\">Preferred secondary/episode title (defaults to blank)</option>\n /// <option name=\"textColor\">Preferred color for title/etc. text (defaults to white)</option>\n /// <option name=\"title\">Preferred title (defaults to \"untitled\")</option>\n /// <option name=\"width\">Preferred comic width (defaults to 800)</option>\n /// <option name=\"xGutter\">Preferred horizontal gutter (defaults to 10)</option>\n \n if (window.svgDocument == null) {\n svgDocument = evt.target.ownerDocument;\n }\n\n this.document = svgDocument;\n this.svg = this.document.rootElement;\n this.ns = 'http://www.w3.org/2000/svg';\n\n if (opts == null) {\n opts = new Array();\n }\n\n var date = new Date();\n\n this.author = opts['author'] || 'A. N. Onymous';\n\n this.copyright = opts['copyright'] || \"© \" + date.getFullYear() + \" \" + this.author + \". All rights reserved.\";\n this.fill = opts['fill'] || 'black';\n this.fontSize = opts['fontSize'] || 12;\n this.height = opts['height'] || 300;\n this.subtitle = opts['subtitle'] || '';\n this.textColor = opts['textColor'] || 'white';\n this.title = opts['title'] || 'Untitled';\n this.width = opts['width'] || 800;\n this.xGutter = opts['xGutter'] || 10;\n\n// this.x = opts['x'] || window.innerWidth / 2 - this.width / 2;\n// this.y = opts['y'] || window.innerHeight / 2 - this.height / 2;\n\n this.panels = new Array();\n\n this.initialize();\n}", "function saveSVG() {\n var doctype = '<?xml version=\"1.0\" standalone=\"no\"?>'\n + '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">';\n var serializer = new XMLSerializer();\n d3.select(\".graphinfo\").style(\"visibility\", \"hidden\")\n var source = serializer.serializeToString(d3.select(\"svg\").node());\n d3.select(\".graphinfo\").style(\"visibility\", \"visible\")\n var blob = new Blob([doctype + source], { type: \"image/svg+xml\" });\n saveAs(blob, getFilenameWithoutExtension(curFilename) + \".svg\");\n}", "function toSVG() {\n return '';\n\n /* Note: Support for SVG is suspended\n *\n var canvas = getCanvas();\n //@see http://www.w3schools.com/svg/svg_example.asp\n var v2 = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n v2 += \"\\n\" + '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"'\n + canvas.width +'\" height=\"' + canvas.height\n + '\" viewBox=\"0 0 ' + canvas.width + ' ' + canvas.height + '\" version=\"1.1\">';\n INDENTATION++;\n v2 += STACK.toSVG();\n v2 += CONNECTOR_MANAGER.toSVG();\n INDENTATION--;\n v2 += \"\\n\" + '</svg>';\n \n return v2;\n */\n}", "function downloadPNG2x() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\", {scale: 2});\n}", "function svg2Stng(svgElem)\r\n{\r\n console.log(new XMLSerializer().serializeToString(svgElem))\r\n}", "function saveSVG(){\n\tsvg = \"<svg>\\n\\t\" + main.innerHTML + \"\\n</svg>\";\n\tvar link = document.createElement('a');\n\tmimeType = 'image/svg+xml' || 'text/plain';\n\tvar today = new Date();\n\tvar date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate() + '_' + today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n\tvar base = document.getElementsByName('base')[0].value;\n\tvar armWidth = document.getElementsByName('armWidth')[0].value;\n\tvar vertexExtrusion = document.getElementsByName('vertexExtrusion')[0].value;\n\tvar vertexDiameter = document.getElementsByName('vertexDiameter')[0].value;\n\tvar sideRadius = document.getElementsByName('sideRadius')[0].value;\n\tvar filename = 'Triangle_' + date + '_Base' + base + '_ArmWidth' + armWidth + \n\t\t'_VertexExtrusion' + vertexExtrusion + '_VertexDiameter' + vertexDiameter +\n\t\t'_SideRadius' + sideRadius + '.svg';\n\tlink.setAttribute('download', filename);\n\tlink.setAttribute('href', 'data:image/svg+xml; charset=utf-8,' + encodeURIComponent(svg));\n\tdocument.body.append(link);\n\tlink.click();\n\tdocument.body.removeChild(link);\n\tconsole.log(link);\n}", "function downloadSVG(){\r\n\tcrackPoint.remove();\r\n\tpaper.view.update();\r\n var svg = project.exportSVG({ asString: true, bounds: 'content' });\r\n var svgBlob = new Blob([svg], {type:\"image/svg+xml;charset=utf-8\"});\r\n var svgUrl = URL.createObjectURL(svgBlob);\r\n var downloadLink = document.createElement(\"a\");\r\n downloadLink.href = svgUrl;\r\n downloadLink.download = simText+\".svg\";\r\n document.body.appendChild(downloadLink);\r\n downloadLink.click();\r\n document.body.removeChild(downloadLink);\r\n\tcrackPoint.insertAbove(concreteObjects[concreteObjects.length-1]);\r\n}", "function SaveAsSVG(document, newname)\r{\r var targetFolder = Folder(MATERIAL_EXPORT_PATH);\r\r if (! targetFolder.exists) {\r // geef een melding en \r throw(\"Onderstaande folder niet gevonden, is de netwerkverbinding gemaakt? \\n\\n\" +\r MATERIAL_EXPORT_PATH);\r }\r\r var exportOptions = new ExportOptionsSVG();\r var exportType = ExportType.SVG;\r\r var targetFile = MakeTempInvisibleFile(targetFolder, newname, \".ai\");\r // alert(targetFile);\r\r exportOptions.embedRasterImages = true;\r exportOptions.compressed = true;\r exportOptions.embedAllFonts = false;\r exportOptions.fontSubsetting = SVGFontSubsetting.GLYPHSUSED;\r exportOptions.cssProperties = SVGCSSPropertyLocation.PRESENTATIONATTRIBUTES;\r exportOptions.optimezForSVGViewer = true;\r\r document.exportFile( targetFile, exportType, exportOptions );\r document.close( SaveOptions.DONOTSAVECHANGES );\r\r var exportedFile = MakeTempInvisibleFile(targetFolder, newname, \".svgz\");\r // alert(exportedFile);\r if (exportedFile.exists) {\r if (! exportedFile.rename(newname+ \".svgz\")) {\r // bij aanwezig zijn oude file, deze proberen te deleten en vervolgens nogmaal renamen:\r var fl = new File(targetFolder + \"/\" + newname + \".svgz\");\r // alert(fl);\r if (fl.remove()) \r exportedFile.rename(newname+ \".svgz\")\r else\r alert(SCRIPT_NAME + \" is niet goed gelukt, oude file is nog aanwezig en niet te overschrijven!\") \r }\r } \r else\r alert(SCRIPT_NAME + \" is niet goed gelukt!\") \r}", "function exportAsImage(){\n \n // variable for image name\n var chartName, svg ;\n \n // Getting svg name from this.id, replacing this.id by save\n // save prefix is for button and replacing it with sample to\n // get the svg chart div name \n\n svg = document.querySelector( '#dendogram svg' );\n \n //\n var svgData = new XMLSerializer().serializeToString( svg );\n\n var canvas = document.createElement( \"canvas\" );\n var ctx = canvas.getContext( \"2d\" );\n \n canvas.height = outerRadius*2;\n canvas.width = outerRadius*2;\n \n var dataUri = '';\n dataUri = 'data:image/svg+xml;base64,' + btoa(svgData);\n \n var img = document.createElement( \"img\" );\n \n img.onload = function() {\n ctx.drawImage( img, 0, 0 );\n \n // Initiate a download of the image\n var a = document.createElement(\"a\");\n \n a.download = \"circularDendogram\" + \".png\";\n a.href = canvas.toDataURL(\"image/png\");\n document.querySelector(\"body\").appendChild(a);\n a.click();\n document.querySelector(\"body\").removeChild(a);\n \n // Image preview in case of \"save image modal\"\n \n /*var imgPreview = document.createElement(\"div\");\n imgPreview.appendChild(img);\n document.querySelector(\"body\").appendChild(imgPreview);\n */\n };\n \n img.src = dataUri;\n}", "_getSvgWith() {\n return this._width + this._margin.left + this._margin.right;\n }", "_getSVGHandler(data) {\n let loader = document.createElement(\"div\");\n let hotspots = [];\n loader.innerHTML = data;\n let svg = loader.querySelector(\"svg\");\n\n svg.slot = \"svg\";\n this.prepend(svg);\n console.log(this.childNodes);\n svg.setAttribute(\"aria-labelledBy\", this._getInfoNode(svg, \"title\"));\n svg.setAttribute(\"aria-describedBy\", this._getInfoNode(svg));\n this.hotspotDetails = [];\n // this is scrape the printable hotspots for info\n this.querySelectorAll(\"lrndesign-imagemap-hotspot\").forEach((hotspot) => {\n let obj = {\n id: hotspot.hotspotId,\n print: hotspot,\n hotspot: svg.querySelector(`#${hotspot.hotspotId}`),\n label: hotspot.label,\n position: hotspot.position || \"bottom\",\n details: document.createElement(\"div\"),\n };\n // Turning main svg interactive hotspots into buttons\n obj.hotspot.classList.add(\"hotspot\");\n obj.hotspot.setAttribute(\"role\", \"button\");\n obj.hotspot.setAttribute(\"controls\", \"figure\");\n obj.hotspot.addEventListener(\"click\", (e) => this.openHotspot(obj));\n\n //Copy hotspot details from printable hotspots\n\n hotspot.childNodes.forEach((node) => {\n obj.details.appendChild(node.cloneNode(true));\n });\n obj.details.slot = \"details\";\n this.append(obj.details);\n\n // Get array data for hotspot\n this.hotspotDetails.push(obj);\n hotspots.push(hotspot.hotspotId);\n });\n\n this.hotspotDetails.forEach((obj) => {\n obj.print.loadSvg(data, hotspots);\n });\n }", "function getSVGinfo() {\n console.log(this);\n S = document.getElementById(\"DYOSVG\").contentDocument;\n var STYLESVG = []\n , NUMCOLS = [];\n var i;\n\n for (var j = 0; j < S.styleSheets.length; j++) {\n var rules = S.styleSheets[j].rules || S.styleSheets[j].cssRules;\n // This CSS code may need to be modified to handle using commas in CSS for shared code\n for (i in rules) {\n if (typeof rules[i].selectorText == 'string') {\n STYLESVG.push(rules[i].selectorText)\n }\n }\n for (i in STYLESVG) {\n var start_pos = STYLESVG[i].indexOf('.') + 1;\n var end_pos = STYLESVG[i].indexOf('.', start_pos);\n if (end_pos != -1) {\n var NC = STYLESVG[i].substring(start_pos, end_pos);\n // begin IE stupidity workaround\n var NC2 = STYLESVG[i].substring(end_pos + 1);\n if (NC == \"fill\" || NC == \"stroke\" || NC == \"stopColor\") {\n NUMCOLS.push(NC2)\n } else if (NC2 == \"fill\" || NC2 == \"stroke\" || NC2 == \"stopColor\") {\n NUMCOLS.push(NC)\n }\n }\n }\n NUMCOLS = NUMCOLS.filter(function(itm, i, a) {\n return i == a.indexOf(itm)\n });\n }\n var PREVIOUS = document.getElementsByClassName(\"colourfill\");\n for (i = PREVIOUS.length; i > 0; i--) {\n var M = (PREVIOUS[i - 1].id.indexOf(\"[\") != -1) ? PREVIOUS[i - 1].id.slice(0, PREVIOUS[i - 1].id.indexOf(\"[\")) : PREVIOUS[i - 1].id;\n var A = (PREVIOUS[i - 1].id.indexOf(\"[\") != -1) ? PREVIOUS[0].id.slice(PREVIOUS[0].id.indexOf(\"[\") + 1, PREVIOUS[0].id.length - 1) : null;\n if (A != ACTIVE) {\n continue\n }\n PREVIOUS[i - 1].material = (typeof materialController == 'function') ? materialController(M) : PREVIOUS[i - 1].material;\n var col = readCookie(PREVIOUS[i - 1].id);\n if (col && PREVIOUS[i - 1].material.indexOf(col) == -1) {\n removeCookie(PREVIOUS[i - 1].id)\n }\n if (PREVIOUS[i - 1].material.indexOf(PREVIOUS[i - 1].value) == -1) {\n if (defcols[PREVIOUS[i - 1]] && PREVIOUS[i - 1].material.indexOf(defcols[PREVIOUS[i - 1]]) != -1) {\n PREVIOUS[i - 1].value = defcols[PREVIOUS[i - 1]];\n }\n {\n var rand = Math.floor(Math.random() * PREVIOUS[i - 1].material.length);\n PREVIOUS[i - 1].value = PREVIOUS[i - 1].material[rand];\n }\n colour.call(PREVIOUS[i - 1]);\n }\n if (NUMCOLS.indexOf(PREVIOUS[i - 1].id) == -1 && PREVIOUS[i - 1].id != \"S-BallColour\") {\n PREVIOUS[i - 1].parentNode.parentNode.removeChild(PREVIOUS[i - 1].parentNode)\n }\n }\n for (i in NUMCOLS) {\n if (!document.getElementById(NUMCOLS[i]) + \"[\" + ACTIVE + \"]\") {\n addColour(NUMCOLS[i] + \"[\" + ACTIVE + \"]\")\n }\n ;colour.call(document.getElementById(NUMCOLS[i] + \"[\" + ACTIVE + \"]\"))\n }\n // Re-Initialise set values\n if (typeof svgController == 'function') {\n svgController();\n }\n if (!S.getElementById(\"Content\")) {\n var CNT = document.createElementNS(SVG_NS, \"g\");\n CNT.id = \"Content\";\n S.documentElement.appendChild(CNT)\n }\n S.getElementById(\"Content\").style.visibility = \"hidden\";\n S.getElementById(\"Content\").style.visibility = \"hidden\";\n if (document.getElementById(\"SBALL[\" + ACTIVE + \"]\")) {\n drawSBall();\n // SBall();\n // colour.call(document.getElementById(\"S-BallColour[\" + ACTIVE + \"]\"));\n }\n DL = document.getElementById(\"logos[\" + ACTIVE + \"]\").getElementsByClassName(\"logoupload\");\n DT = document.getElementById(\"logos[\" + ACTIVE + \"]\").getElementsByClassName(\"addtext\");\n DS = document.getElementById(\"logos[\" + ACTIVE + \"]\").getElementsByClassName(\"uploadselect\");\n for (var i = 0; i < DS.length; i++) {\n embellish.call(DS[i])\n }\n for (var i = 0; i < DL.length; i++) {\n if (DL[i].value) {\n if (CYCLE == true) {\n DLCount++\n }\n HFS.call(DL[i])\n }\n }\n for (var i = 0; i < DT.length; i++) {\n if (DT[i].value) {\n addText.call(DT[i])\n }\n }\n // Continue with Garment Specific Logic\t\n //\tdocument.getElementById(\"Colour1\").classList.add(\"chosen\");\n //\tif(document.getElementById(\"Colour1\")){createColourPicker.call(document.getElementById(\"Colour1\"))}else{console.log(\"dfjvdfj\")}\n // colourBranding()\n //Clone the node \n if (CYCLE == true && DLCount == 0) {\n generateImages()\n }\n}", "function screenShot() {\n\n var photo = document.getElementById(\"svgdiv\").innerHTML;\n\n var wrap = \"<div class=\\\"row\\\"> \\n <svg width=\\\"\" + w + \"\\\" height=\\\"\" + h + \"\\\">\"; \n\n wrap = wrap + photo;\n\n output = wrap + \"\\n </svg> \\n </div>\";\n\n var dimensions = \"\\\"width=\" + w + \",height=\" + h + \"\\\"\";\n\n document.getElementById(\"photoTaken\").innerHTML = output;\n\n/*\n var myWindow = window.open(\"photobooth.html\", \"Photo Booth\", function () { return dimensions;});\n\n myWindow.document.write(output);\n*/\n}", "function getIcon(code) {\n if (code === '01d') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"3 3 26 26\">\n <title>sun</title>\n <path d=\"M16 9c-3.859 0-7 3.141-7 7s3.141 7 7 7 7-3.141 7-7c0-3.859-3.141-7-7-7zM16 21c-2.762 0-5-2.238-5-5s2.238-5 5-5 5 2.238 5 5-2.238 5-5 5zM16 7c0.552 0 1-0.448 1-1v-2c0-0.552-0.448-1-1-1s-1 0.448-1 1v2c0 0.552 0.448 1 1 1zM16 25c-0.552 0-1 0.448-1 1v2c0 0.552 0.448 1 1 1s1-0.448 1-1v-2c0-0.552-0.448-1-1-1zM23.777 9.635l1.414-1.414c0.391-0.391 0.391-1.023 0-1.414s-1.023-0.391-1.414 0l-1.414 1.414c-0.391 0.391-0.391 1.023 0 1.414s1.023 0.391 1.414 0zM8.223 22.365l-1.414 1.414c-0.391 0.391-0.391 1.023 0 1.414s1.023 0.391 1.414 0l1.414-1.414c0.391-0.392 0.391-1.023 0-1.414s-1.023-0.392-1.414 0zM7 16c0-0.552-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1s0.448 1 1 1h2c0.552 0 1-0.448 1-1zM28 15h-2c-0.552 0-1 0.448-1 1s0.448 1 1 1h2c0.552 0 1-0.448 1-1s-0.448-1-1-1zM8.221 9.635c0.391 0.391 1.024 0.391 1.414 0s0.391-1.023 0-1.414l-1.414-1.414c-0.391-0.391-1.023-0.391-1.414 0s-0.391 1.023 0 1.414l1.414 1.414zM23.779 22.363c-0.392-0.391-1.023-0.391-1.414 0s-0.392 1.023 0 1.414l1.414 1.414c0.391 0.391 1.023 0.391 1.414 0s0.391-1.023 0-1.414l-1.414-1.414z\"/>\n </svg>`;\n }\n\n if (code === '01n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"8.21 8.21 15.57 15.57\">\n <title>moon</title>\n <path d=\"M21.866 21.447c-3.117 3.12-8.193 3.12-11.313 0s-3.12-8.195 0-11.314c0.826-0.824 1.832-1.453 2.989-1.863 0.365-0.128 0.768-0.035 1.039 0.237 0.274 0.273 0.366 0.677 0.237 1.039-0.784 2.211-0.25 4.604 1.391 6.245 1.638 1.639 4.031 2.172 6.245 1.391 0.362-0.129 0.767-0.036 1.039 0.237 0.273 0.271 0.365 0.676 0.236 1.039-0.408 1.157-1.038 2.164-1.863 2.989zM11.967 11.547c-2.34 2.34-2.34 6.147 0 8.486 2.5 2.501 6.758 2.276 8.937-0.51-2.247 0.141-4.461-0.671-6.109-2.318s-2.458-3.861-2.318-6.108c-0.18 0.141-0.35 0.29-0.51 0.451z\"/>\n </svg>`;\n }\n if (code === '02d') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 0 32 32\">\n <title>cloudy-day</title>\n <path d=\"M13 4c0.552 0 1-0.448 1-1v-2c0-0.552-0.448-1-1-1s-1 0.448-1 1v2c0 0.552 0.448 1 1 1zM20.777 6.635l1.414-1.414c0.391-0.391 0.391-1.023 0-1.414s-1.023-0.391-1.414 0l-1.414 1.414c-0.391 0.391-0.391 1.023 0 1.414s1.023 0.391 1.414 0zM1 14h2c0.552 0 1-0.448 1-1s-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1s0.448 1 1 1zM22 13c0 0.552 0.448 1 1 1h2c0.552 0 1-0.448 1-1s-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1zM5.221 6.635c0.391 0.391 1.024 0.391 1.414 0s0.391-1.023 0-1.414l-1.414-1.414c-0.391-0.391-1.023-0.391-1.414 0s-0.391 1.023 0 1.414l1.414 1.414zM25 16c-0.332 0-0.66 0.023-0.987 0.070-1.048-1.43-2.445-2.521-4.029-3.219-0.081-3.789-3.176-6.852-6.984-6.852-3.859 0-7 3.141-7 7 0 1.090 0.271 2.109 0.719 3.027-3.727 0.152-6.719 3.211-6.719 6.973 0 3.859 3.141 7 7 7 0.856 0 1.693-0.156 2.482-0.458 1.81 1.578 4.112 2.458 6.518 2.458 2.409 0 4.708-0.88 6.518-2.458 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7s-3.141-7-7-7zM13 8c2.488 0 4.535 1.823 4.919 4.203-0.626-0.125-1.266-0.203-1.919-0.203-2.871 0-5.531 1.238-7.398 3.328-0.371-0.698-0.602-1.482-0.602-2.328 0-2.762 2.238-5 5-5zM25 28c-1.070 0-2.057-0.344-2.871-0.917-1.467 1.768-3.652 2.917-6.129 2.917s-4.662-1.148-6.129-2.917c-0.813 0.573-1.801 0.917-2.871 0.917-2.762 0-5-2.238-5-5s2.238-5 5-5c0.484 0 0.941 0.091 1.383 0.221 0.176 0.049 0.354 0.089 0.52 0.158 0.273-0.535 0.617-1.025 0.999-1.484 1.461-1.758 3.634-2.895 6.099-2.895 0.633 0 1.24 0.091 1.828 0.232 0.66 0.156 1.284 0.393 1.865 0.706 1.456 0.773 2.651 1.971 3.404 3.441 0.587-0.242 1.229-0.379 1.904-0.379 2.762 0 5 2.238 5 5s-2.238 5-5 5z\"/>\n </svg>`;\n }\n if (code === '02n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 2.42 32 29.57\">\n <title>cloudy-night</title>\n <path d=\"M27.191 16.385c0.305-0.227 0.613-0.449 0.889-0.725 0.826-0.827 1.454-1.833 1.862-2.991 0.13-0.362 0.038-0.768-0.236-1.039-0.272-0.273-0.676-0.366-1.039-0.237-2.212 0.781-4.605 0.25-6.244-1.391-1.641-1.641-2.174-4.033-1.391-6.244 0.128-0.363 0.036-0.767-0.237-1.040-0.271-0.271-0.676-0.365-1.039-0.237-1.159 0.411-2.164 1.039-2.99 1.864-2.096 2.094-2.749 5.063-2.030 7.737-2.703 0.345-5.133 1.781-6.751 3.987-0.327-0.047-0.655-0.070-0.987-0.070-3.859 0-7 3.141-7 7s3.141 7 7 7c0.856 0 1.693-0.156 2.482-0.458 1.81 1.578 4.112 2.458 6.518 2.458 2.409 0 4.708-0.88 6.518-2.458 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7 0-3.090-2.026-5.689-4.809-6.615zM18.182 5.76c0.159-0.161 0.329-0.311 0.509-0.452-0.141 2.249 0.671 4.461 2.319 6.108 1.648 1.648 3.861 2.458 6.109 2.319-0.862 1.099-2.050 1.783-3.32 2.074-1.711-2.172-4.225-3.539-6.997-3.762-0.767-2.122-0.318-4.59 1.38-6.288zM25 28c-1.070 0-2.057-0.344-2.871-0.917-1.467 1.768-3.652 2.917-6.129 2.917s-4.662-1.148-6.129-2.917c-0.813 0.573-1.801 0.917-2.871 0.917-2.762 0-5-2.238-5-5s2.238-5 5-5c0.676 0 1.316 0.137 1.902 0.379 1.262-2.46 3.734-4.181 6.645-4.346 0.152-0.009 0.301-0.033 0.453-0.033 0.807 0 1.582 0.126 2.313 0.349 0.987 0.302 1.887 0.794 2.668 1.428 0.746 0.605 1.371 1.348 1.863 2.181 0.083 0.141 0.177 0.273 0.253 0.421 0.587-0.242 1.229-0.379 1.904-0.379 2.762 0 5 2.238 5 5s-2.238 5-5 5z\"/>\n </svg>`;\n }\n if (code === '03d' || code === '03n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 6 32 20\">\n <title>cloud</title>\n <path d=\"M25 10c-0.332 0-0.66 0.023-0.987 0.070-1.867-2.544-4.814-4.070-8.013-4.070s-6.145 1.526-8.013 4.070c-0.327-0.047-0.655-0.070-0.987-0.070-3.859 0-7 3.141-7 7s3.141 7 7 7c0.856 0 1.693-0.156 2.482-0.458 1.81 1.578 4.112 2.458 6.518 2.458 2.409 0 4.708-0.88 6.518-2.458 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7s-3.141-7-7-7zM25 22c-1.070 0-2.057-0.344-2.871-0.917-1.467 1.768-3.652 2.917-6.129 2.917s-4.662-1.148-6.129-2.917c-0.813 0.573-1.801 0.917-2.871 0.917-2.762 0-5-2.238-5-5s2.238-5 5-5c0.676 0 1.316 0.138 1.902 0.38 1.327-2.588 3.991-4.38 7.098-4.38s5.771 1.792 7.096 4.38c0.587-0.242 1.229-0.38 1.904-0.38 2.762 0 5 2.238 5 5s-2.238 5-5 5z\"/>\n </svg>`;\n }\n if (code === '04d' || code === '04n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 6.57 32 25.43\">\n <title>cloudy</title>\n <path d=\"M32 15c0-3.073-2.5-5.572-5.573-5.572-0.15 0-0.298 0.007-0.447 0.018-1.445-1.803-3.624-2.874-5.98-2.874-2.355 0-4.535 1.070-5.98 2.874-0.148-0.012-0.298-0.018-0.449-0.018-3.070-0-5.57 2.499-5.57 5.572 0 0.322 0.043 0.631 0.094 0.94-0.034 0.044-0.074 0.085-0.107 0.13-0.327-0.047-0.655-0.070-0.987-0.070-3.859 0-7 3.141-7 7s3.141 7 7 7c0.856 0 1.693-0.156 2.482-0.458 1.81 1.578 4.112 2.458 6.518 2.458 2.409 0 4.708-0.88 6.518-2.458 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7 0-1.605-0.565-3.068-1.479-4.25 0.911-0.994 1.479-2.302 1.479-3.75zM25 28c-1.070 0-2.057-0.344-2.871-0.917-1.467 1.768-3.652 2.917-6.129 2.917s-4.662-1.148-6.129-2.917c-0.813 0.573-1.801 0.917-2.871 0.917-2.762 0-5-2.238-5-5s2.238-5 5-5c0.676 0 1.316 0.137 1.902 0.379 0.035-0.066 0.078-0.125 0.113-0.189 0.352-0.642 0.785-1.23 1.292-1.753 1.443-1.495 3.448-2.438 5.693-2.438 3.107 0 5.771 1.792 7.096 4.379 0.353-0.145 0.729-0.238 1.117-0.301l0.787-0.078c0.771 0 1.492 0.19 2.145 0.5 0.707 0.338 1.314 0.836 1.79 1.449 0.656 0.845 1.065 1.897 1.065 3.051 0 2.762-2.238 5-5 5zM29.098 17.352c-1.155-0.841-2.563-1.352-4.098-1.352-0.332 0-0.66 0.023-0.987 0.070-1.867-2.544-4.814-4.070-8.013-4.070-2.133 0-4.145 0.69-5.809 1.896 0.467-1.428 1.796-2.467 3.379-2.467 0.484 0 0.941 0.098 1.359 0.271 0.949-1.848 2.852-3.126 5.070-3.126s4.122 1.279 5.068 3.126c0.421-0.173 0.88-0.271 1.359-0.271 1.974 0 3.573 1.599 3.573 3.572 0 0.905-0.348 1.721-0.902 2.351z\"/>\n </svg>`;\n }\n if (code === '09d' || code === '09n' || code === '10d' || code === '10n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 0 32 32\">\n <title>rainy</title>\n <path d=\"M25 4c-0.332 0-0.66 0.023-0.987 0.070-1.867-2.544-4.814-4.070-8.013-4.070s-6.145 1.526-8.013 4.070c-0.327-0.047-0.655-0.070-0.987-0.070-3.859 0-7 3.141-7 7s3.141 7 7 7c0.856 0 1.693-0.156 2.482-0.458 1.81 1.578 4.112 2.458 6.518 2.458 2.409 0 4.708-0.88 6.518-2.458 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7s-3.141-7-7-7zM25 16c-1.070 0-2.057-0.344-2.871-0.917-1.467 1.768-3.652 2.917-6.129 2.917s-4.662-1.148-6.129-2.917c-0.813 0.573-1.801 0.917-2.871 0.917-2.762 0-5-2.238-5-5s2.238-5 5-5c0.676 0 1.316 0.138 1.902 0.38 1.327-2.588 3.991-4.38 7.098-4.38s5.771 1.792 7.096 4.38c0.587-0.242 1.229-0.38 1.904-0.38 2.762 0 5 2.238 5 5s-2.238 5-5 5zM14.063 30c0 1.105 0.895 2 2 2s2-0.895 2-2-2-4-2-4-2 2.895-2 4zM22 28c0 1.105 0.895 2 2 2s2-0.895 2-2-2-4-2-4-2 2.895-2 4zM6 24c0 1.105 0.894 2 2 2s2-0.895 2-2-2-4-2-4-2 2.895-2 4z\"/>\n </svg>`;\n }\n if (code === '11d' || code === '11n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0 0 32 32\">\n <title>lightning</title>\n <path d=\"M12 24l2 2-2 6 6-6-2-2 2-4-6 4zM32 8.427c0-3.072-2.5-5.57-5.573-5.57-0.15 0-0.298 0.005-0.447 0.017-1.445-1.802-3.624-2.874-5.98-2.874-2.355 0-4.535 1.072-5.98 2.874-0.148-0.012-0.298-0.017-0.449-0.017-3.070 0-5.57 2.499-5.57 5.57 0 0.322 0.043 0.633 0.094 0.94-0.034 0.044-0.074 0.085-0.107 0.13-0.327-0.047-0.655-0.070-0.987-0.070-3.859 0-7 3.141-7 7s3.141 7 7 7c0.856 0 1.693-0.156 2.482-0.458 0.069 0.060 0.151 0.102 0.221 0.16l1.77-1.18c-0.59-0.418-1.141-0.883-1.602-1.438-0.813 0.572-1.801 0.915-2.871 0.915-2.762 0-5-2.237-5-5 0-2.76 2.238-5 5-5 0.676 0 1.316 0.138 1.902 0.38 0.035-0.068 0.078-0.125 0.113-0.19 0.352-0.642 0.785-1.229 1.292-1.753 1.443-1.493 3.448-2.438 5.693-2.438 3.107 0 5.771 1.792 7.096 4.38 0.353-0.146 0.729-0.24 1.117-0.302l0.787-0.078c0.771 0 1.492 0.19 2.145 0.5 0.707 0.339 1.314 0.836 1.79 1.45 0.656 0.845 1.065 1.896 1.065 3.050 0 2.763-2.238 5-5 5-1.070 0-2.057-0.344-2.871-0.915-0.875 1.055-2.027 1.848-3.322 2.348l-0.374 0.746 1.141 1.141c1.066-0.415 2.064-1.012 2.944-1.777 0.789 0.302 1.626 0.458 2.482 0.458 3.859 0 7-3.141 7-7 0-1.604-0.565-3.068-1.479-4.25 0.911-0.992 1.479-2.301 1.479-3.75zM29.098 10.779c-1.155-0.84-2.563-1.352-4.098-1.352-0.332 0-0.66 0.023-0.987 0.070-1.867-2.543-4.814-4.070-8.013-4.070-2.133 0-4.145 0.691-5.809 1.897 0.467-1.428 1.796-2.467 3.379-2.467 0.484 0 0.941 0.098 1.359 0.271 0.949-1.849 2.852-3.128 5.070-3.128s4.122 1.279 5.068 3.128c0.421-0.173 0.88-0.271 1.359-0.271 1.974 0 3.573 1.599 3.573 3.57 0 0.906-0.348 1.723-0.902 2.352z\"/>\n </svg>`;\n }\n if (code === '13d' || code === '13n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"0.5 1 47.01 47.01\">\n <title>snow</title>\n <path d=\"M14.5 24.502c0 1 0.16 1.97 0.44 2.871l-4.080 2.35-7.26-1.94c-1.31-0.35-2.66 0.43-3.020 1.729-0.35 1.311 0.43 2.65 1.75 3l5.87 1.57-1.58 5.84c-0.35 1.301 0.43 2.65 1.74 3 1.32 0.35 2.67-0.43 3.020-1.738l1.94-7.221 4.27-2.451c1.11 1.010 2.46 1.771 3.95 2.172v5.5l-5.32 4.488c-0.96 0.99-0.96 2.59 0 3.59 0.96 0.99 2.52 0.99 3.48 0l4.3-4.439 4.3 4.439c0.96 0.99 2.52 0.99 3.479 0 0.961-1 0.961-2.6 0-3.59l-5.319-4.488v-5.5c1.49-0.4 2.84-1.162 3.95-2.172l4.27 2.451 1.94 7.221c0.35 1.309 1.699 2.088 3.020 1.738 1.311-0.35 2.091-1.699 1.74-3l-1.58-5.84 5.87-1.57c1.32-0.35 2.1-1.689 1.75-3-0.359-1.299-1.71-2.078-3.020-1.729l-7.261 1.939-4.079-2.35c0.279-0.9 0.439-1.871 0.439-2.871s-0.16-1.97-0.439-2.88l4.079-2.34 7.261 1.94c1.31 0.35 2.66-0.431 3.020-1.73 0.35-1.31-0.43-2.65-1.75-3l-5.87-1.57 1.58-5.84c0.351-1.3-0.43-2.649-1.74-3-1.32-0.35-2.67 0.43-3.020 1.74l-1.94 7.22-4.27 2.45c-1.11-1.010-2.46-1.77-3.95-2.17v-4.5l5.319-5.49c0.961-0.99 0.961-2.59 0-3.59-0.96-0.99-2.52-0.99-3.479 0l-4.3 4.442-4.3-4.44c-0.96-0.99-2.52-0.99-3.48 0-0.96 1-0.96 2.6 0 3.59l5.32 5.49v4.5c-1.49 0.4-2.84 1.16-3.95 2.17l-4.27-2.45-1.94-7.22c-0.35-1.311-1.7-2.090-3.020-1.74-1.31 0.351-2.090 1.7-1.74 3l1.58 5.84-5.87 1.57c-1.32 0.35-2.1 1.69-1.75 3 0.36 1.3 1.71 2.080 3.020 1.73l7.26-1.94 4.080 2.34c-0.28 0.91-0.44 1.879-0.44 2.879zM24 29.002c-2.49 0-4.5-2.010-4.5-4.5s2.010-4.5 4.5-4.5 4.5 2.010 4.5 4.5c0 2.49-2.010 4.5-4.5 4.5z\"/>\n </svg>`;\n }\n if (code === '50d' || code === '50n') {\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" fill=\"#f5f5f5\" viewBox=\"1.94 5.94 30 18\">\n <title>mist</title>\n <path d=\"M30.938 13.938h-5.102c-0.504-4.487-4.277-8-8.898-8-3.113 0-5.859 1.591-7.477 4h-6.523c-0.552 0-1 0.448-1 1s0.448 1 1 1h5.552c-0.226 0.638-0.374 1.306-0.45 2h-3.102c-0.552 0-1 0.448-1 1s0.448 1 1 1h3.102c0.077 0.693 0.224 1.363 0.45 2h-5.37c-0.654 0-1.182 0.448-1.182 1s0.529 1 1.182 1h6.341c1.617 2.41 4.363 4 7.477 4s5.859-1.59 7.477-4h2.341c0.654 0 1.182-0.448 1.182-1s-0.529-1-1.182-1h-1.37c0.227-0.637 0.372-1.307 0.451-2h5.102c0.552 0 1-0.448 1-1s-0.448-1-1-1zM10.639 11.938h6.298c0.552 0 1-0.448 1-1s-0.448-1-1-1h-4.884c1.263-1.233 2.983-2 4.884-2 3.518 0 6.409 2.617 6.898 6h-13.797c0.102-0.707 0.302-1.378 0.6-2zM16.938 21.938c-1.901 0-3.621-0.768-4.884-2h9.767c-1.262 1.232-2.982 2-4.883 2zM23.234 17.938h-12.595c-0.298-0.622-0.499-1.293-0.6-2h13.797c-0.102 0.707-0.302 1.378-0.602 2z\"/>\n </svg>`;\n }\n\n return '';\n}", "function downloadPNG8x() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\", {scale: 8});\n}", "function saveExternalSVG(){\r\n\tif(simulating)\r\n\t\treturn;\r\n\tvar svgCode = '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"2000\" width=\"2000\" version=\"1.1\" viewBox=\"0 0 2000 2000\">\\n <g transform=\"translate(0 1000)\" fill=\"none\">\\n';\r\n\tsvgCode += ' <path d=\"M';\r\n\tfor(i = allGroundPointsX.length-1 ; i > -1 ; i--){\r\n\t\t//\t\trecord X and Y coordiantes with 2 decimal places with spaces between them\r\n\t\tsvgCode += \" \" + String(Math.round(allGroundPointsX[i]*500+100000)/100) + \" \" + String(Math.round(allGroundPointsY[i]*500)/100);\r\n\t\tif(i == 0 || !allGroundBreaks[i-1]){//\tfirst point of new line\r\n\t\t\tif(i == 0)//\t\tlast line\r\n\t\t\t\tsvgCode += '\" stroke=\"#000000\" stroke-width=\"1.5\"/>\\n';\r\n\t\t\telse\r\n\t\t\t\tsvgCode += '\" stroke=\"#000000\" stroke-width=\"1.5\"/>\\n <path d=\"M';\r\n\t\t}\r\n\t}\r\n\t\r\n\tsvgCode += ' <circle id=\"Goal\" cx=\"' + (Math.round(goalx*50+10000)/10) + '\" cy=\"' + (Math.round(-goaly*50)/10) + '\" r=\"' + (Math.round(goalr*50)/10) + '\" stroke=\"' + _goalColor + '\"/>\\n';\r\n\t\r\n\tfor(i = checkx.length-1 ; i > -1 ; i--){\r\n\t\t//\t\trecord X and Y coordinates with 1 decimal place with spaces between them\r\n\t\tsvgCode += ' <circle cx=\"' + (Math.round(checkx[i]*50+10000)/10) + '\" cy=\"' + (Math.round(-checky[i]*50)/10) + '\" r=\"' + (Math.round(checkr[i]*50)/10) + '\" stroke=\"' + _checkpointColor + '\"/>\\n';\r\n\t}\r\n\t\r\n\tsvgCode += ' </g>\\n</svg>';\r\n\t\r\n var downloadFile = document.createElement('a');\r\n\tdownloadFile.href = window.URL.createObjectURL(new Blob([svgCode], {type: 'text/svg'}));\r\n\tdownloadFile.download = 'Level.svg';\r\n\tdocument.body.appendChild(downloadFile);\r\n\tdownloadFile.click();\r\n\tdocument.body.removeChild(downloadFile);\r\n}", "function downloadPNG() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\");\n}", "show() {\n fill(this.fill, this.alpha);\n strokeWeight(4);\n stroke(255);\n ellipse(this.x, this.y, (this.r * 2));\n }", "_drawStepSVG(color, opacity, x, y, svg_container) {\r\n const that = this;\r\n if (that.squareWidth) {\r\n that.lineWidth = that.squareWidth;\r\n that.lineHeight = that.squareWidth;\r\n }\r\n let rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\r\n rect.setAttribute('x', x);\r\n rect.setAttribute('y', y);\r\n rect.setAttribute('width', that.lineWidth);\r\n rect.setAttribute('height', that.lineHeight);\r\n rect.setAttribute('fill-opacity', opacity);\r\n rect.style.fill = color;\r\n svg_container.appendChild(rect);\r\n }", "function makecncsvgexport()\n{\n var c,d,x,y,x0,y0,pts,txt=\"\";\n getdefaults();\n var sfx=cutterwidth/(xmax-xmin);\n var sfy=cutterheight/(ymax-ymin);\n switch(originpos)\n {\n case 0: originx=0; originy=0; break; // Bottom left\n case 1: originx=0; originy=cutterheight; break; // Top left\n case 2: originx=cutterwidth; originy=0; break; // Bottom right\n case 3: originx=cutterwidth; originy=cutterheight; break; // Top right\n case 4: originx=cutterwidth/2; originy=cutterheight/2; break; // Middle\n }\n txt+='<?xml version=\"1.0\" encoding=\"utf-8\"?>\\r\\n';\n txt+='<svg id=\"gcodercncsvg\" width=\"'+cutterwidth+'px\" height=\"'+cutterheight+'px\" style=\"background-color:#FFFFFF\" version=\"1.1\" ';\n txt+='xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\" ';\n txt+=makedefaultsparams()+' ';\n txt+='>\\r\\n';\n for(c=0;c<commands.length;c++)\n {\n if(commands[c][0]==='L')\n {\n pts=commands[c][1];\n pts=scaletoolpath(pts,sfx,sfy,cutterheight);\n pts=simplifytoolpath(pts,arcdist);\n txt+=' <path id=\"'+commands[c][12]+'\" d=\"M ';\n for(d=0;d<pts.length;d++)\n {\n x=pts[d][0]-originx;\n y=(cutterheight-pts[d][1])-originy;\n if(d===0)\n {\n x0=x;\n y0=y;\n }\n if(d===pts.length-1 && commands[c][11]===1) txt+=\"Z\";\n else txt+=x.toFixed(3)+\",\"+y.toFixed(3)+\" \";\n }\n txt+='\" opacity=\"1\" stroke=\"#000000\" stroke-opacity=\"1\" stroke-width=\"1\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-dasharray=\"none\" fill-opacity=\"0\" ';\n txt+=makepathparams(c)+' ';\n txt+='/>\\r\\n';\n }\n }\n txt+='</svg>\\r\\n';\n return txt;\n}", "renderExtras(svg, data, x, y) {\n }", "function getSvgElement() {\n\n let svg = getSvg('svg');\n svg.setAttribute('width', '100%');\n svg.setAttribute('height', '100%');\n \n // Set up SVG defs\n \n const rectDef = getSvg('rect'),\n defs = getSvg('defs');\n \n rectDef.setAttribute('class', 'note');\n rectDef.setAttribute('id', rectId);\n rectDef.setAttribute('height', PIANO_ROLL_OPTIONS.barHeight);\n defs.appendChild(rectDef);\n svg.appendChild(defs);\n\n return svg;\n }", "toSVG() {\n if (this.geometryObject &&\n (\n this.geometryObject.geometryIsVisible === false ||\n this.geometryObject.geometryIsHidden === true ||\n this.geometryObject.geometryIsConstaintDraw === true\n )\n ) {\n return '';\n }\n\n let path = this.getSVGPath();\n\n let attributes = {\n d: path,\n stroke: this.strokeColor,\n fill: '#000',\n 'fill-opacity': 0,\n 'stroke-width': this.strokeWidth,\n 'stroke-opacity': 1, // toujours à 1 ?\n };\n\n let path_tag = '<path';\n for (let [key, value] of Object.entries(attributes)) {\n path_tag += ' ' + key + '=\"' + value + '\"';\n }\n path_tag += '/>\\n';\n\n let pointToDraw = [];\n if (app.settings.areShapesPointed && this.name != 'silhouette') {\n if (this.isSegment())\n pointToDraw.push(this.segments[0].vertexes[0]);\n if (!this.isCircle())\n this.segments.forEach(\n (seg) => (pointToDraw.push(seg.vertexes[1])),\n );\n }\n\n this.segments.forEach((seg) => {\n //Points sur les segments\n seg.divisionPoints.forEach((pt) => {\n pointToDraw.push(pt);\n });\n });\n if (this.isCenterShown) pointToDraw.push(this.center);\n\n let point_tags = pointToDraw.filter(pt => {\n pt.visible &&\n pt.geometryIsVisible &&\n !pt.geometryIsHidden\n }).map(pt => pt.svg).join('\\n');\n\n let comment =\n '<!-- ' + this.name.replace('é', 'e').replace('è', 'e') + ' -->\\n';\n\n return comment + path_tag + point_tags + '\\n';\n }", "function savePNG() {\n var doctype = '<?xml version=\"1.0\" standalone=\"no\"?>'\n + '<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">';\n var serializer = new XMLSerializer();\n d3.select(\".graphinfo\").style(\"visibility\", \"hidden\")\n var source = serializer.serializeToString(d3.select(\"svg\").node());\n d3.select(\".graphinfo\").style(\"visibility\", \"visible\")\n var blob = new Blob([doctype + source], { type: \"image/svg+xml\" });\n var url = window.URL.createObjectURL(blob);\n\n var canvas = document.querySelector(\"canvas\");\n canvas.setAttribute(\"width\", width);\n canvas.setAttribute(\"height\", height);\n var context = canvas.getContext(\"2d\");\n\n var image = new Image;\n image.src = url;\n image.onload = function () {\n context.drawImage(image, 0, 0);\n var a = document.createElement(\"a\");\n a.download = getFilenameWithoutExtension(curFilename) + \".png\";\n a.href = canvas.toDataURL(\"image/png\");\n a.click();\n };\n}", "function putSvg(next) {\n if (next == VIEWS.DOT.hash) {\n goToDot(next + \"/\" + dot_top);\n return;\n }\n if (!next) next = dot_top;\n var root = d3.select(\"#svg_container\");\n d3.xml(\"lib/dot_svg/\" + next + \".svg\", function(error, documentFragment) {\n if (error) {console.log(error); return;}\n var svgNode = documentFragment.getElementsByTagName(\"svg\")[0];\n\n var w = $(root.node()).width();\n var h = $(root.node()).height();\n\n svgNode.setAttribute(\"viewBox\", \"0 0 \" + w + ' ' + h);\n svgNode.setAttribute(\"style\", \"width: \" + w + 'px;height:' + h + \"px;\");\n\n var d = d3.select(svgNode);\n\n if (root.node().childNodes.length > 0) {\n root.node().replaceChild(svgNode, root.node().childNodes[0]);\n } else {\n root.node().appendChild(svgNode);\n }\n var matrix = d.select(\"g\").node().transform.baseVal.consolidate().matrix;\n var X = matrix.e;\n var Y = matrix.f;\n var width = parseInt(svgNode.getAttribute(\"width\"), 10);\n var height = parseInt(svgNode.getAttribute(\"height\"), 10);\n var x_scale = w / width;\n var y_scale = h / height;\n var initial_scale = Math.min(x_scale, y_scale);\n initial_scale = Math.min(initial_scale, 1);\n\n var translate_x = ((w - width*initial_scale) / 2);\n var translate_y = ((h - height*initial_scale) / 2);\n\n // Setup event listeners for model nodes.\n root.selectAll(\"polygon\").each(function() {\n if (this.hasAttribute(\"fill\")) {\n // All model nodes should show the corresponding HDL, or the\n // corresponding DOT graph when clicked. dsdk::A_MODEL_NODEs\n // are magenta, dsdk::A_SCHEDULED_MODEL_NODEs are white, and\n // are not a direct descendant of the \"graph\" (the background\n // is also white, but is a direct descendant of the \"graph\".\n if (this.getAttribute(\"fill\") == \"magenta\" ||\n (this.getAttribute(\"fill\") == \"white\" && !this.parentNode.classList.contains(\"graph\"))) {\n var g = this.parentNode;\n var title = g.getElementsByTagName(\"title\")[0].innerHTML;\n g.addEventListener(\"click\", function(e){\n // Ctrl+Click opens source, plain click opens graph.\n var evt = window.event || e;\n if (evt.ctrlKey) {\n // TODO Eventually the filename will probably need\n // to include a kernel/component subdirectory.\n var filename = title.replace(/^\\d+_/, \"\")+\".vhd\";\n addHdlFileToEditor(\"lib/hdl/\" + filename);\n if (sideCollapsed) {\n collapseAceEditor();\n refreshAreaVisibility();\n adjustToWindowEvent();\n }\n } else {\n var new_hash = window.location.hash + \"/\" + title;\n VIEWS.DOT.hash = new_hash;\n goToDot(new_hash);\n }\n });\n }\n }\n });\n\n // Clickdown for edge highlighting.\n root.selectAll(\"g.edge path\")\n .on('click', function () {\n // TODO use parent\n if (dot_clickdown == this) {\n dot_clickdown = null;\n } else {\n dot_clickdown = this;\n }\n });\n\n // Edge/arrowhead highlighting.\n var highlightColor = \"#1d99c1\";\n root.selectAll(\"g.edge path\")\n .on('mouseover', function () {\n $(this).attr({\"stroke-width\":5, \"stroke\":highlightColor});\n $(this).siblings(\"polygon\").attr({\"fill\":highlightColor, \"stroke\":highlightColor, \"stroke-width\":3});\n })\n .on('mouseout', function () {\n if (dot_clickdown == this) return;\n $(this).attr({\"stroke-width\":1, \"stroke\":\"black\"});\n $(this).siblings(\"polygon\").attr({\"fill\":\"black\", \"stroke\":\"black\", \"stroke-width\":1});\n });\n root.selectAll(\"g.edge polygon\")\n .on('mouseover', function () {\n $(this).siblings(\"path\").attr({\"stroke-width\":5, \"stroke\":highlightColor});\n $(this).attr({\"fill\":highlightColor, \"stroke\":highlightColor, \"stroke-width\":3});\n })\n .on('mouseout', function () {\n if (dot_clickdown == this) return;\n $(this).siblings(\"path\").attr({\"stroke-width\":1, \"stroke\":\"black\"});\n $(this).attr({\"fill\":\"black\", \"stroke\":\"black\", \"stroke-width\":1});\n });\n\n\n // TODO use translateExtent() to prevent translating out of frame?\n //.translateExtent([10 - X, 10 - Y, 2 * X - 10, 2 * Y - 10])\n //.translateExtent([[0, 0], [2 * Y - 10]])\n\n var scaled_x = initial_scale * X;\n var scaled_y = initial_scale * Y;\n scaled_x += translate_x;\n scaled_y += translate_y;\n var zoom = d3.behavior.zoom()\n .scaleExtent([0, 1.5])\n .scale(initial_scale)\n .translate([scaled_x, scaled_y])\n .on(\"zoom\", zoomed);\n d.select(\"g\").attr(\"transform\",\"translate(\" + scaled_x + \",\" + scaled_y +\")scale(\" + initial_scale + \",\" + initial_scale + \")\");\n d.call(zoom);\n if (!$('#dot_edges_toggle').is(':checked')) {\n $(\"#svg_container\").find(\"g.edge\").toggle();\n }\n });\n updateDotHierarchy();\n}", "_createSVG() {\n\t\t\treturn d3.select(this._container)\n\t\t\t\t.append('svg');\n\t\t}", "init() {\n let svg = '<path' +\n ' id=\"' + this.id +'\"';\n\n if (this.stroke) {\n svg += ' stroke=\"' + this.stroke + '\"';\n }\n if (this.strokeWidth) {\n svg += ' stroke-width=\"' + this.strokeWidth + '\"';\n }\n if (this.opacity) {\n svg += ' opacity=\"' + this.opacity + '\"';\n }\n if (this.data) {\n svg += ' d=\"' + this.data + '\"';\n }\n svg+= '></path>'\n this.innerHTML = svg;\n }", "function downloadSVG() {\n var svg_root = document.getElementById('svg').outerHTML;\n var svgBlob = new Blob([svg_root], {type:\"image/svg+xml;charset=utf-8\"});\n var svgUrl = URL.createObjectURL(svgBlob);\n var downloadLink = document.createElement(\"a\");\n downloadLink.href = svgUrl;\n downloadLink.download = \"GeometricIllustration.svg\";\n document.body.appendChild(downloadLink);\n downloadLink.click();\n document.body.removeChild(downloadLink);\n}", "function displayInfoBox(node) {\n\t\tvar nodeName = node.attr(\"name\")\n var infoX = infoBoxWidth/2*0.6 \n var infoY = infoBoxHeight/2*1.05\n\t\tvar infoBox = svg.append(\"g\")\n\t\tinfoBox\n .attr(\"class\", \"popup\")\n .attr(\"transform\", function(d) {return \"translate(\" + infoX + \",\" + infoY + \")\";})\n\n\t\tinfoBox\n .append(\"text\")\n .attr(\"y\", function(d) {return -infoBoxHeight/2 + fontSize + 2*lineSpace;})\n .attr(\"text-anchor\", \"middle\")\n .text(nodeName)\n .attr(\"font-size\", fontSize + 8 + \"px\")\n\n \tinfoBox.append(\"rect\")\n .attr('id', 'performancebar')\n .attr(\"width\", infoBoxWidth*0.99)\n .style(\"fill\", \"red\")\n .style(\"stroke\", \"red\")\n .attr(\"y\", boxHeight/0)\n .attr(\"height\", 0)\n\t\n\t\n var imgOffsetX = -infoBoxWidth/2 * 0.95\n var imgOffsetY = -infoBoxHeight/2 + fontSize+8 + 2*lineSpace\n\t\tinfoBox\n .append(\"svg:image\")\n \t.attr(\"xlink:href\", \"sample_patches/\"+nodeName+\".png\")\n .attr(\"width\", infoBoxWidth*0.99)\n .attr(\"height\", infoBoxHeight*0.99)\n .attr(\"transform\", function(d) {return \"translate(\" + imgOffsetX + \",\" + imgOffsetY + \")\";})\n\t}", "function encodeAsImgAndLink(svg) {\n if ($.browser.msie) {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n window.winsvg = window.open('/static/html/export.html');\n window.winsvg.document.write(dummy.innerHTML);\n window.winsvg.document.body.style.margin = 0;\n } else {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n\n var b64 = Base64.encode(dummy.innerHTML);\n\n //window.winsvg = window.open(\"data:image/svg+xml;base64,\\n\"+b64);\n var html = \"<img style='height:100%;width:100%;' src='data:image/svg+xml;base64,\" + b64 + \"' />\"\n window.winsvg = window.open();\n window.winsvg.document.write(html);\n window.winsvg.document.body.style.margin = 0;\n }\n}", "function infoEV(){\n self.svg.append(\"text\")\n .attr(\"x\", (self.svgWidth * 0.5) + 35)\n .attr(\"y\", 27)\n .attr(\"class\", \"electoralVotesNote\")\n .text(\"Electoral Vote (270 Needed to Win)\");\n }", "function drawPie(alpha){\n var xo = 20;\n var yo = 20;\n var cote = 400;\n var rayon = 180;\n /*alpha = 4.0;*/\n var path = camenbertPath(xo, yo, cote, rayon, alpha);\n/* svg = \"<svg width=\\\"\"+ (xo+cote) +\"\\\" height=\\\"\"+ (yo+cote) +\"\\\">;*/\n var svg = \"<svg width=\\\"\"+ 420 +\"\\\" height=\\\"\"+ 420 +\"\\\">\";\n svg +=\"<path data-id=\\\"s0\\\" stroke=\\\"#333333\\\" fill=\\\"#f23d3d\\\" style=\\\"stroke-width: 0;\\\" d=\\\"\"+ path +\"\\\" ></path>\";\n svg +=\"</svg>\";\n document.getElementById(\"dessin\").innerHTML = svg;\n}", "show(){\n\t\tnoStroke();\n strokeWeight(1);\n //size is correlated to food count\n\t\tfill(this.food,this.food/5,this.food/5);\n\t\tellipse(this.x,this.y,this.food/50);\n\t}", "function encodeAsImgAndLink(svg) {\n if ($.browser.msie) {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n window.winsvg = window.open('/static/html/export.html');\n window.winsvg.document.write(dummy.innerHTML);\n window.winsvg.document.body.style.margin = 0;\n } else {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n\n var b64 = Base64.encode(dummy.innerHTML);\n\n //window.winsvg = window.open(\"data:image/svg+xml;base64,\\n\"+b64);\n var html = \"<img style='height:100%;width:100%;' src='data:image/svg+xml;base64,\" + b64 + \"' />\"\n window.winsvg = window.open();\n window.winsvg.document.write(html);\n window.winsvg.document.body.style.margin = 0;\n }\n}", "function doStuffWithDOM(element) {\n console.log(element);\n //alert(\"Link do SVG\" + element);\n}", "function createSVGOutput(){\n \n var canvas = document.getElementById(\"svgout\");\n \n if(svgAdded){\n canvas.removeChild(svg);\n }\n \n svgAdded = true;\n \n svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"width\", window.innerWidth);\n svg.setAttribute(\"height\", \"200\");\n \n var x = 0; \n var y = startY;\n var stride = 15;\n \n if(syllables.length >= 1){\n for(var i = 0; i < syllables.length; i++){\n var color;\n if(syllables[i].color == \"none\"){\n color = \"black\";\n }\n else{\n color = syllables[i].color;\n }\n text(x, y + 65, syllables[i].syllable, color, svg);\n var textLength = syllables[i].syllable.length * 11;\n var notesLength = 0;\n var previousValue = startY+10;\n \n for(var j = 0; j < syllables[i].neumes.length; j++){\n \n if(Array.isArray(syllables[i].neumes[j])){\n \n for(var n = 0; n < syllables[i].neumes[j].length; n++){\n \n for(var o = 0; o < syllables[i].neumes[j][n].additionalNeumes.length; o++){\n \n for(var k = 0; k < syllables[i].neumes[j][n].additionalNeumes[o].pitches.length; k++){\n \n if(Array.isArray(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k])){\n \n for(var l = 0; l < syllables[i].neumes[j][n].additionalNeumes[o].pitches[k].length; l++){\n \n for(var m = 0; m < syllables[i].neumes[j][n].additionalNeumes[o].pitches[k][l].additionalPitches.length; m++){\n \n if(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k][l].additionalPitches[m].pitch != \"none\"){\n lines(x, y, stride, svg);\n \n var value = translateNoteValue(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k][l].additionalPitches[m].pitch);\n ellipse(x+6,y+value,\"blue\", svg);\n \n previousValue = y + value;\n }\n else if(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k][l].additionalPitches[m].intm){\n lines(x, y, stride, svg);\n if(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k][l].additionalPitches[m].intm == \"d\"){\n ellipse(x+6,previousValue+10,\"purple\",svg);\n \n previousValue += 10;\n }\n if(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k][l].additionalPitches[m].intm == \"u\"){\n ellipse(x+6,previousValue-10,\"purple\",svg);\n previousValue -= 10;\n }\n else{\n ellipse(x+6,previousValue,\"purple\",svg);\n }\n }\n else{\n lines(x, y, stride,svg);\n ellipse(x+6,y+10,\"purple\",svg);\n \n previousValue = y+10;\n }\n x += stride;\n if(x >= (window.innerWidth - 100)){\n x = 0;\n y += 85;\n }\n }\n }\n }\n else{\n if(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k].pitch != \"none\"){\n lines(x, y, stride,svg);\n \n var valu = translateNoteValue(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k].pitch);\n ellipse(x+6,y+valu,\"blue\",svg);\n \n previousValue = y + valu;\n }\n else if(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k].intm){\n lines(x, y, stride,svg);\n if(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k].intm == \"d\"){\n ellipse(x+6,previousValue+10,\"purple\",svg);\n \n previousValue += 10;\n }\n if(syllables[i].neumes[j][n].additionalNeumes[o].pitches[k].intm == \"u\"){\n ellipse(x+6,previousValue-10,\"purple\",svg);\n previousValue -= 10;\n }\n else{\n ellipse(x+6,previousValue,\"purple\",svg);\n }\n }\n else{\n lines(x, y, stride,svg);\n \n ellipse(x+6,y+10,\"red\",svg);\n \n previousValue = y + 10;\n }\n x += stride;\n if(x >= (window.innerWidth - 100)){\n x = 0;\n y += 85;\n previousValue += 85;\n }\n }\n notesLength += stride;\n }\n }\n }\n if(textLength > notesLength){\n var diff = textLength - notesLength;\n lines(x, y, diff,svg);\n x += diff;\n }\n }\n else{\n for(var k = 0; k < syllables[i].neumes[j].pitches.length; k++){\n \n if(Array.isArray(syllables[i].neumes[j].pitches[k])){\n \n for(var l = 0; l < syllables[i].neumes[j].pitches[k].length; l++){\n \n for(var m = 0; m < syllables[i].neumes[j].pitches[k][l].additionalPitches.length; m++){\n \n if(syllables[i].neumes[j].pitches[k][l].additionalPitches[m].pitch != \"none\"){\n lines(x, y, stride, svg);\n \n var value = translateNoteValue(syllables[i].neumes[j].pitches[k][l].additionalPitches[m].pitch);\n ellipse(x+6,y+value,\"blue\", svg);\n \n previousValue = y + value;\n }\n else if(syllables[i].neumes[j].pitches[k][l].additionalPitches[m].intm){\n lines(x, y, stride, svg);\n if(syllables[i].neumes[j].pitches[k][l].additionalPitches[m].intm == \"d\"){\n ellipse(x+6,previousValue+10,\"purple\",svg);\n \n previousValue += 10;\n }\n if(syllables[i].neumes[j].pitches[k][l].additionalPitches[m].intm == \"u\"){\n ellipse(x+6,previousValue-10,\"purple\",svg);\n previousValue -= 10;\n }\n else{\n ellipse(x+6,previousValue,\"purple\",svg);\n }\n }\n else{\n lines(x, y, stride,svg);\n ellipse(x+6,y+10,\"purple\",svg);\n \n previousValue = y+10;\n }\n x += stride;\n if(x >= (window.innerWidth - 100)){\n x = 0;\n y += 85;\n }\n }\n }\n }\n else{\n if(syllables[i].neumes[j].pitches[k].pitch != \"none\"){\n lines(x, y, stride,svg);\n \n var valu = translateNoteValue(syllables[i].neumes[j].pitches[k].pitch);\n ellipse(x+6,y+valu,\"black\",svg);\n \n previousValue = y + valu;\n }\n else if(syllables[i].neumes[j].pitches[k].intm){\n lines(x, y, stride,svg);\n if(syllables[i].neumes[j].pitches[k].intm == \"d\"){\n ellipse(x+6,previousValue+10,\"red\",svg);\n \n previousValue += 10;\n }\n if(syllables[i].neumes[j].pitches[k].intm == \"u\"){\n ellipse(x+6,previousValue-10,\"red\",svg);\n previousValue -= 10;\n }\n else{\n ellipse(x+6,previousValue,\"red\",svg);\n }\n }\n else{\n lines(x, y, stride,svg);\n \n ellipse(x+6,y+10,\"red\",svg);\n \n previousValue = y + 10;\n }\n x += stride;\n if(x >= (window.innerWidth - 100)){\n x = 0;\n y += 85;\n previousValue += 85;\n }\n }\n notesLength += stride;\n }\n if(textLength > notesLength){\n var diff = textLength - notesLength;\n lines(x, y, diff,svg);\n x += diff;\n }\n }\n }\n }\n }\n canvas.appendChild(svg);\n}", "function draw() {\n function drawP(text) {\n var elem = document.createElement(\"p\");\n elem.innerText = text;\n document.getElementById(\"root\").append(elem);\n }\n drawP(\"(0,0) Note: SVG origin is top left\");\n var myGenerator = generator();\n var myChart = chart(400, 400);\n var svg = build(myGenerator, myChart);\n document.getElementById(\"root\").appendChild(svg);\n }", "function setupSVG(svg, width, height) {\n //Remove children of svg to eventually tiles from the previous image\n svg.innerHTML = '';\n\n //Give to svg the same size as the image\n svg.setAttribute('viewBox', '0 0 '+width+' '+height);\n svg.setAttribute('width', '100%');\n svg.setAttribute('height', '100%');\n}", "show() {\n\t\tstroke(255, 0, 0);\n\t\tstrokeWeight(3);\n\t\tfill(255, 128, 0);\n\t\trect(this.x, this.y, this.width, this.height);\n\t}", "show() {\n fill(0, 10, 100);\n noStroke();\n\n ellipse(this.x, this.y, this.mainSize, this.mainSize);\n ellipse(this.x - 18, this.y + 20, this.subSize, this.subSize);\n ellipse(this.x - 6, this.y + 20, this.subSize, this.subSize);\n ellipse(this.x + 6, this.y + 20, this.subSize, this.subSize);\n ellipse(this.x + 18, this.y + 20, this.subSize, this.subSize);\n }", "function displaypathdata() {\n $('#datasize').empty()\n var svg_data = size($('#canvas').html())\n $('#datasize').append(svg_data + \"Byte\")\n}", "function SVGElement() {}", "function SVGElement() {}", "function SVGElement() {}", "function SVGElement() {}", "function SVGElement() {}", "function SVGElement() {}", "show(){\n push();\n\n colorMode(RGB, 255)\n fill(this.color);\n noStroke();\n\n ellipse(this.x, this.y, DOT_SIZE);\n\n pop();\n }", "function print_diagram() {\n var printFrameId = \"printFrame\";\n\n var iframe = document.getElementById(printFrameId);\n\n // if iframe isn't created\n if (iframe == null) {\n iframe = document.createElement(\"IFRAME\");\n iframe.id = printFrameId;\n\n document.body.appendChild(iframe);\n }\n\n // get DOM of iframe\n var frameDoc = iframe.contentDocument;\n\n var diagramImages = frameDoc.getElementsByTagName('img');\n var diagramImage;\n if (diagramImages.length > 0) { // if image is already added\n diagramImage = diagramImages[0];\n\n // set source of image to png of saved diagram\n diagramImage.setAttribute('src', \"data/diagrams/\" + currentDiagramId + \".png\");\n\n } else { // if image isn't created yet\n diagramImage = frameDoc.createElement('img');\n\n // set source of image to png of saved diagram\n diagramImage.setAttribute('src', \"data/diagrams/\" + currentDiagramId + \".png\");\n\n if (frameDoc.body !== null) {\n frameDoc.body.appendChild(diagramImage);\n } else {\n // IE case for more details\n // @see http://stackoverflow.com/questions/8298320/correct-access-of-dynamic-iframe-in-ie\n // create body of iframe\n frameDoc.src = \"javascript:'<body></body>'\";\n // append image through html of <img>\n frameDoc.write(diagramImage.outerHTML);\n frameDoc.close();\n }\n }\n\n // adjust iframe size to main canvas (as it might have been changed)\n iframe.setAttribute('width', canvasProps.getWidth());\n iframe.setAttribute('height', canvasProps.getHeight());\n\n // print iframe\n iframe.contentWindow.print();\n}", "function configureExportSVG(glyphsGB) { \n if(!glyphsGB) { return; }\n if(!glyphsGB.navCtrls) { return; }\n \n var divFrame = glyphsGB.settings_panel;\n if(!divFrame) { \n divFrame = document.createElement('div'); \n glyphsGB.settings_panel = divFrame;\n }\n glyphsGB.navCtrls.appendChild(glyphsGB.settings_panel);\n \n var navRect = glyphsGB.navCtrls.getBoundingClientRect();\n \n divFrame.setAttribute('style', \"position:absolute; text-align:left; padding: 3px 3px 3px 3px; \" \n +\"background-color:rgb(235,235,240); \" \n +\"border:2px solid #808080; border-radius: 4px; \"\n +\"left:\"+(navRect.left+window.scrollX+glyphsGB.display_width-370)+\"px; \"\n +\"top:\"+(navRect.top+window.scrollY+20)+\"px; \"\n +\"width:350px; z-index:90; \"\n );\n divFrame.innerHTML = \"\";\n var tdiv, tdiv2, tspan1, tspan2, tinput, tcheck;\n\n var exportConfig = glyphsGB.exportSVGconfig;\n\n //close button\n tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv.setAttribute('style', \"float:right; margin: 0px 4px 4px 4px;\");\n var a1 = tdiv.appendChild(document.createElement('a'));\n a1.setAttribute(\"target\", \"top\");\n a1.setAttribute(\"href\", \"./\");\n a1.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-cancel'); return false; }\n var img1 = a1.appendChild(document.createElement('img'));\n img1.setAttribute(\"src\", eedbWebRoot+\"/images/close_icon16px_gray.png\");\n img1.setAttribute(\"width\", \"12\");\n img1.setAttribute(\"height\", \"12\");\n img1.setAttribute(\"alt\",\"close\");\n\n //title\n tdiv = document.createElement('div');\n tdiv.style = \"font-weight:bold; font-size:14px; padding: 5px 0px 5px 0px;\"\n tdiv.setAttribute('align', \"center\");\n tdiv.innerHTML = \"Export view as SVG image\";\n divFrame.appendChild(tdiv);\n\n //----------\n tdiv = divFrame.appendChild(document.createElement('div'));\n tdiv2 = tdiv.appendChild(document.createElement('div'));\n tdiv2.setAttribute('style', \"float:left; width:200px;\");\n tcheck = tdiv2.appendChild(document.createElement('input'));\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_widgets) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'widgets', this.checked); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"hide widgets\";\n\n tdiv2 = tdiv.appendChild(document.createElement('div'));\n tcheck = tdiv2.appendChild(document.createElement('input'));\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.savefile) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'savefile', this.checked); }\n tspan2 = tdiv2.appendChild(document.createElement('span'));\n tspan2.innerHTML = \"save to file\";\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_sidebar) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'sidebar', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide track sidebars\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_titlebar) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'titlebar', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide title bar\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_experiment_graph) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'experiments', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide experiment/expression graph\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n tdiv = document.createElement('div');\n tcheck = document.createElement('input');\n tcheck.setAttribute('style', \"margin: 0px 1px 0px 14px;\");\n tcheck.setAttribute('type', \"checkbox\");\n if(exportConfig && exportConfig.hide_compacted_tracks) { tcheck.setAttribute('checked', \"checked\"); }\n tcheck.onclick = function() { exportSVGConfigParam(glyphsGB, 'compacted_tracks', this.checked); }\n tdiv.appendChild(tcheck);\n tspan1 = document.createElement('span');\n tspan1.innerHTML = \"hide compacted tracks\";\n tdiv.appendChild(tspan1);\n divFrame.appendChild(tdiv);\n\n //----------\n divFrame.appendChild(document.createElement('hr'));\n //----------\n var button1 = document.createElement('input');\n button1.type = \"button\";\n button1.className = \"medbutton\";\n button1.value = \"cancel\";\n button1.style.float = \"left\"; \n button1.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-cancel'); }\n divFrame.appendChild(button1);\n\n var button2 = document.createElement('input');\n button2.type = \"button\";\n button2.className = \"medbutton\";\n button2.value = \"export svg\";\n button2.style.float = \"right\"; \n button2.onclick = function() { exportSVGConfigParam(glyphsGB, 'svg-accept'); }\n divFrame.appendChild(button2);\n}", "show()\n {\n fill(this.brightness, 127);\n stroke(255);\n strokeWeight(2);\n\n ellipse(this.x, this.y, this.r*2);\n }", "function downloadSVG(sn) {\n // Generate piece.\n var piece = computePiece(sn, {\n cropped: $(\"#cropped\").prop('selected'), \n trapezoidal:$(\"#trapezoidal\").prop('selected')\n });\n \n // Output to SVG.\n var svg = drawSVG(piece, $(\"#tmpSvg svg\")[0]);\n svg.attr('viewBox', \n piece.bbox.x \n + \" \" + piece.bbox.y \n + \" \" \n + (piece.bbox.x2-piece.bbox.x) \n + \" \" \n + (piece.bbox.y2-piece.bbox.y)\n );\n svg.attr({fill: 'none', stroke: 'black', strokeWidth: 0.1});\n\n blob = new Blob([svg.outerSVG()], {type: \"image/svg+xml\"});\n saveAs(blob, sn + \".svg\");\n \n}", "function supportsInlineSVG() {\n\t\tvar div = document.createElement( 'div' );\n\t\tdiv.innerHTML = '<svg/>';\n\t\treturn 'http://www.w3.org/2000/svg' === ( 'undefined' !== typeof SVGRect && div.firstChild && div.firstChild.namespaceURI );\n\t}", "function getSVGInfo() {\n var fileNode = document.getElementById('file');\n if (!fileNode) {\n return null;\n }\n \n var url;\n if (hasAnnotation()) {\n url = fileNode.childNodes[0].childNodes[0].childNodes[0].href;\n } else {\n url = fileNode.childNodes[0].href;\n }\n var imgNode = fileNode.getElementsByTagName('img')[0];\n var width = imgNode.getAttribute('width');\n var height = imgNode.getAttribute('height');\n\n return { url: url, fileNode: fileNode, imgNode: imgNode, \n width: width, height: height };\n}", "function SVGDeviationChart() {\r\n }", "function createSVGString(w,h,style,drp){\n\tvar svgstr = '<svg width=\"'+w+'px\" height=\"'+h+'px\" transform=\"translate('+(w/2)+','+(h/2)+')\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" desc=\"Girih tiles\" style=\"background-color:rgb(0,0,0)\">';\n\tfor(var i=0; i<tiles.length; i++){\n\t\tsvgstr += drawtile(i, style.fillcolors[tiles[i].type], style.edgecolors[tiles[i].type], style.edgewidth);\n\t\tsvgstr += drawlines(i, style.linecolor1, style.linewidth1 );\n\t\tsvgstr += drawlines(i, style.linecolor2, style.linewidth2 );\n\t}\n\tif(drp){ svgstr += drawpoints(); }\n\tsvgstr += '</svg>';\n\treturn svgstr;\n}// End of createSVGString()", "function createIcon() {\r\n\tlet svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\r\n\tlet g = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\r\n\tlet path = document.createElementNS(\"http://www.w3.org/2000/svg\", \"path\");\r\n\r\n\tsvg.setAttribute('version', '1.1');\r\n\tsvg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\r\n\tsvg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\r\n\tsvg.setAttribute('x', '0px');\r\n\tsvg.setAttribute('y', '0px');\r\n\tsvg.setAttribute('width', '40px');\r\n\tsvg.setAttribute('height', '40px');\r\n\tsvg.setAttribute('viewBox', '0 0 446.843 446.843');\r\n\tsvg.setAttribute('style', 'enable-background:new 0 0 446.843 446.843;');\r\n\tsvg.setAttribute('xml:space', 'preserve');\r\n\r\n\tpath.setAttribute('d', 'M444.09,93.103c-2.698-3.699-7.006-5.888-11.584-5.888H109.92c-0.625,0-1.249,0.038-1.85,0.119l-13.276-38.27c-1.376-3.958-4.406-7.113-8.3-8.646L19.586,14.134c-7.374-2.887-15.695,0.735-18.591,8.1c-2.891,7.369,0.73,15.695,8.1,18.591l60.768,23.872l74.381,214.399c-3.283,1.144-6.065,3.663-7.332,7.187l-21.506,59.739c-1.318,3.663-0.775,7.733,1.468,10.916c2.24,3.183,5.883,5.078,9.773,5.078h11.044c-6.844,7.616-11.044,17.646-11.044,28.675c0,23.718,19.298,43.012,43.012,43.012s43.012-19.294,43.012-43.012c0-11.029-4.2-21.059-11.044-28.675h93.776c-6.847,7.616-11.048,17.646-11.048,28.675c0,23.718,19.294,43.012,43.013,43.012c23.718,0,43.012-19.294,43.012-43.012c0-11.029-4.2-21.059-11.043-28.675h13.433c6.599,0,11.947-5.349,11.947-11.948c0-6.599-5.349-11.947-11.947-11.947H143.647l13.319-36.996c1.72,0.724,3.578,1.152,5.523,1.152h210.278c6.234,0,11.751-4.027,13.65-9.959l59.739-186.387C447.557,101.567,446.788,96.802,444.09,93.103z M169.659,409.807c-10.543,0-19.116-8.573-19.116-19.116s8.573-19.117,19.116-19.117s19.116,8.574,19.116,19.117S180.202,409.807,169.659,409.807z M327.367,409.807c-10.543,0-19.117-8.573-19.117-19.116s8.574-19.117,19.117-19.117c10.542,0,19.116,8.574,19.116,19.117S337.909,409.807,327.367,409.807z M402.52,148.149h-73.161V115.89h83.499L402.52,148.149z M381.453,213.861h-52.094v-37.038h63.967L381.453,213.861z M234.571,213.861v-37.038h66.113v37.038H234.571z M300.684,242.538v31.064h-66.113v-31.064H300.684z M139.115,176.823h66.784v37.038h-53.933L139.115,176.823z M234.571,148.149V115.89h66.113v32.259H234.571z M205.898,115.89v32.259h-76.734l-11.191-32.259H205.898z M161.916,242.538h43.982v31.064h-33.206L161.916,242.538z M329.359,273.603v-31.064h42.909l-9.955,31.064H329.359z');\r\n\r\n\tg.appendChild(path);\r\n\tsvg.appendChild(g);\r\n\r\n\tlet div = DOM.createElement('div', {\r\n\t\tid: 'cartIcon',\r\n\t});\r\n\r\n\tdiv.appendChild(svg);\r\n\r\n\treturn div;\r\n}", "boundaryToSVG() {\n var points = this.getOrientedEdges();\n var svgString = \"M\";\n for (var i = 0; i < points.length; i++) {\n var point = points[i];\n svgString += point.x.toString() + \" \" + point.y.toString() + \" \";\n }\n svgString += points[0].x.toString() + \" \" + points[0].y.toString() + \" \";\n this.svg = svgString;\n return svgString;\n }", "function RvgsToSvg()\n{\n\t// return qualifyURL(\"/survol/internals/gui_create_svg_from_several_rdfs.py\");\n\treturn LocalHost() + \"/survol/gui_create_svg_from_several_rdfs.py\";\n}", "function getXML() {\n var labelXml = `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<DieCutLabel Version=\"8.0\" Units=\"twips\">\n <PaperOrientation>Landscape</PaperOrientation>\n <Id>Shipping</Id>\n <PaperName>30323 Shipping</PaperName>\n <DrawCommands>\n <RoundRectangle X=\"0\" Y=\"0\" Width=\"3060\" Height=\"5715\" Rx=\"270\" Ry=\"270\"/>\n </DrawCommands>\n <ObjectInfo>\n <ImageObject>\n <Name>backingImage</Name>\n <ForeColor Alpha=\"255\" Red=\"0\" Green=\"0\" Blue=\"0\"/>\n <BackColor Alpha=\"0\" Red=\"255\" Green=\"255\" Blue=\"255\"/>\n <LinkedObjectName></LinkedObjectName>\n <Rotation>Rotation0</Rotation>\n <IsMirrored>False</IsMirrored>\n <IsVariable>False</IsVariable>\n <Image></Image>\n <ScaleMode>Fill</ScaleMode>\n <BorderWidth>0</BorderWidth>\n <BorderColor Alpha=\"255\" Red=\"0\" Green=\"0\" Blue=\"0\"/>\n <HorizontalAlignment>Center</HorizontalAlignment>\n <VerticalAlignment>Center</VerticalAlignment>\n </ImageObject>\n <Bounds X=\"196\" Y=\"0\" Width=\"5323.2\" Height=\"2918.4\"/>\n </ObjectInfo>\n <ObjectInfo>\n <ImageObject>\n <Name>qrImage</Name>\n <ForeColor Alpha=\"255\" Red=\"0\" Green=\"0\" Blue=\"0\"/>\n <BackColor Alpha=\"0\" Red=\"255\" Green=\"255\" Blue=\"255\"/>\n <LinkedObjectName></LinkedObjectName>\n <Rotation>Rotation0</Rotation>\n <IsMirrored>False</IsMirrored>\n <IsVariable>False</IsVariable>\n <Image></Image>\n <ScaleMode>Uniform</ScaleMode>\n <BorderWidth>0</BorderWidth>\n <BorderColor Alpha=\"255\" Red=\"0\" Green=\"0\" Blue=\"0\"/>\n <HorizontalAlignment>Center</HorizontalAlignment>\n <VerticalAlignment>Center</VerticalAlignment>\n </ImageObject>\n <Bounds X=\"430.5774\" Y=\"360.9652\" Width=\"1640.358\" Height=\"1488.177\"/>\n </ObjectInfo>\n</DieCutLabel>\n`\n return labelXml;\n}", "show() {\n stroke(0);\n noFill();\n this.makeShape()\n if (this.revealed) {\n if (this.mine) {\n fill(127);\n ellipse(this.x + this.mineOffsetX, this.y + this.mineOffsetY, this.w * 0.5);\n } \n else {\n fill(200);\n this.makeShape()\n if (this.neighborCount > 0) {\n textAlign(CENTER);\n fill(0);\n text(this.neighborCount, this.x + this.textOffsetX, this.y + this.textOffsetY);\n }\n }\n }\n }", "getSVG () {\n if (this._svg) {\n return this._svg;\n }\n }", "clear() {\n this.$svg.innerHTML = '';\n }", "show() {\n stroke(255);\n strokeWeight(1)\n noFill();\n rectMode(CENTER);\n rect(this.boundary.x, this.boundary.y, this.boundary.w * 2, this.boundary.h * 2);\n if (this.divided) {\n this.northeast.show();\n this.northwest.show();\n this.southeast.show();\n this.southwest.show();\n }\n for (let p of this.nodes) {\n strokeWeight(4)\n node(p.x, p.y)\n }\n }", "function exportPNG(filename) {\n\n\t$(\".connection\").css(\"fill\", \"none\");\n\t$(\".link-tools\").css(\"display\", \"none\");\n\t$(\".link-tools\").css(\"fill\", \"none\");\n\t\n\tvar svgDoc = paper.svg;\n\tvar serializer = new XMLSerializer();\n\tvar svgString = serializer.serializeToString(svgDoc);\n\n\tvar canvas = document.getElementById(\"canvas\");\n\tvar context = canvas.getContext('2d');\n\t\n\tcanvg(canvas, svgString);\n\t\n\tdestinationCanvas = document.createElement(\"canvas\");\n\tdestinationCanvas.width = canvas.width;\n\tdestinationCanvas.height = canvas.height;\n\n\tdestCtx = destinationCanvas.getContext('2d');\n\t\n\tdestCtx.fillStyle = \"#FFFFFF\";\n\tdestCtx.fillRect(0, 0, canvas.width, canvas.height);\n\t\n\tdestCtx.drawImage(canvas, 0, 0);\n\t\n\tvar img = destinationCanvas.toDataURL(\"image/png\");\n\t\n\tvar downloadLink = document.createElement(\"a\");\n\tdownloadLink.href = img;\n\tdownloadLink.download = filename + \".png\";\n\tdocument.body.appendChild(downloadLink);\n\tdownloadLink.click();\n\tdocument.body.removeChild(downloadLink);\n}", "function print() {\n var allLines = \"[\";\n dataset.forEach(function(v, i, a) {\n allLines += \"{ base : { x : \" + v.base.x + \", y : \"\n + v.base.y + \"}, vector : { x : \" + v.vector.x + \", y : \"\n + v.vector.y + \"}, active = false, black = false, most = false},\";\n });\n allLines = allLines.substring(0, allLines.length - 1) + \"]\";\n console.log(allLines);\n }", "drawHTMLBoard() {\r\n for (let column of this.spaces) {\r\n for (let space of column) {\r\n space.drawSVGSpace();\r\n }\r\n }\r\n\t}", "function refresh() {\r\n forAllDOMBoxes((box, i) => {\r\n if (state.array[i] == \"x\") {\r\n console.log(\"putting x\");\r\n box.innerHTML = `\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"300\"\r\n height=\"300\"\r\n viewBox=\"0 0 79.374998 79.375002\"\r\n version=\"1.1\"\r\n id=\"svg8\"\r\n >\r\n <g\r\n inkscape:label=\"Layer 1\"\r\n inkscape:groupmode=\"layer\"\r\n id=\"layer1\"\r\n transform=\"translate(0,-217.62498)\"\r\n >\r\n <path\r\n style=\"opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;\r\n stroke-width:0.47560433;stroke-linecap:square;stroke-linejoin:miter;\r\n stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:124.72441101;\r\n stroke-opacity:1;paint-order:stroke fill markers\"\r\n d=\"m 20.425591,238.48491 c -0.815612,0.99134 -0.886251,2.45461 0.02231,3.36317 l \r\n 15.466489,15.4663 -15.421022,15.42084 c -1.023106,1.02309 -0.819417,2.67934 \r\n 0.167816,3.66223 1.141655,1.13664 2.803463,0.91688 3.901463,-0.18111 l \r\n 15.126822,-15.12664 15.426678,15.42649 c 1.021295,1.02133 2.669692,0.81239 \r\n 3.657394,-0.17301 0.991,-0.98869 1.097421,-2.62199 0.136391,-3.58314 L \r\n 43.464623,257.31487 58.885645,241.89404 c 0.949784,-0.94978 0.835936,-2.46452 \r\n 0.01466,-3.46635 -0.95485,-1.16477 -2.736668,-1.36259 -3.768744,-0.33022 l \r\n -15.44194,15.44207 -15.472875,-15.47268 c -1.078657,-1.07864 -2.851011,-0.72465 \r\n -3.791155,0.41805 z\"\r\n id=\"path8537\"\r\n />\r\n </g>\r\n </svg>\r\n `;\r\n } else if (state.array[i] == \"o\") {\r\n console.log(\"putting o\");\r\n box.innerHTML = `\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"300\"\r\n height=\"300\"\r\n viewBox=\"0 0 79.374999 79.374999\"\r\n version=\"1.1\"\r\n id=\"svg8551\"\r\n >\r\n <g\r\n id=\"layer1\"\r\n transform=\"translate(0,-217.625)\"\r\n >\r\n <path\r\n style=\"opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;\r\n stroke-width:0.47593662;stroke-linecap:square;stroke-linejoin:miter;\r\n stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:124.72441101;\r\n stroke-opacity:1;paint-order:stroke fill markers\"\r\n d=\"M 39.687498,237.46875 A 19.843726,19.843724 0 0 0 19.84375,257.3125 \r\n 19.843726,19.843724 0 0 0 39.687498,277.15625 19.843726,19.843724 0 0 0 \r\n 59.53125,257.3125 19.843726,19.843724 0 0 0 39.687498,237.46875 Z m 0,5.34246 \r\n A 14.501184,14.501182 0 0 1 54.188535,257.3125 14.501184,14.501182 0 0 1 \r\n 39.687498,271.81354 14.501184,14.501182 0 0 1 25.186213,257.3125 \r\n 14.501184,14.501182 0 0 1 39.687498,242.81121 Z\"\r\n id=\"path815\"\r\n />\r\n </g>\r\n </svg>\r\n `;\r\n } else {\r\n box.innerHTML = \" \";\r\n console.log(\"clearing box\");\r\n }\r\n });\r\n}", "createSmallSVG(initDiv) {\n return initDiv.append('svg')\n .attr('width', 20)\n .attr('height', 40)\n .style(\"margin\", \"5px\")\n .style(\"display\",\"table-row\")\n .style(\"background-color\", \"Blue\");\n }", "function setSVG(nom) {\r\n var elementHtmlARemplir = window.document.getElementById(\"id_image\");\r\n elementHtmlARemplir.innerHTML = nom;\r\n}", "function canvasToSVG() {\n if (chart.boost &&\n chart.boost.wgl &&\n isChartSeriesBoosting(chart)) {\n chart.boost.wgl.render(chart);\n }\n }", "function downloadSVG() {\n\n var config = {\n filename: 'kappa_rulevis',\n }\n d3_save_svg.save(d3.select('#svg').node(), config);\n}", "function showGraphViz(gr) {\n var element = document.getElementById(\"shownGraphDiv\");\n element.innerHTML = Viz(gr.toGraphViz(), \"svg\");\n}", "function getAllSVGInfo (dirName, outputName, paddingValue = null, minify = false, curvePoints = 50) {\n // object that will hold all the relevant data\n let data = {}\n let promiseArray = []\n // reads directory and get all file names\n let filenames = fs.readdirSync(`input/${dirName}`)\n filenames.forEach(filename => {\n // Expects the character to be the file name without extension\n let character = filename.replace('.svg', '')\n // read file and get content\n let fileContent = fs.readFileSync(`./input/${dirName}/${filename}`, 'utf-8')\n // push svgson parsing to the promise array\n promiseArray.push(svgson.parse(fileContent))\n })\n Promise.all(promiseArray).then(svgs => {\n // include index in for each to associate with respective character\n svgs.forEach((svg, i) => {\n let charInfo = {}\n charInfo.layers = {}\n // add padding if passed in the parameters\n if (paddingValue) {\n let vB = svg.attributes.viewBox.split(' ')\n vB[0] = parseInt(vB[0]) - paddingValue\n vB[1] = parseInt(vB[1]) - paddingValue\n vB[2] = parseInt(vB[2]) + (paddingValue * 2)\n vB[3] = parseInt(vB[3]) + (paddingValue * 2)\n charInfo.viewBox = vB.join(' ')\n } else {\n charInfo.viewBox = svg.attributes.viewBox\n }\n svg.children[0].children.forEach(layer => {\n // creates a new node for each layer\n charInfo.layers[layer.attributes.id] = []\n layer.children.forEach(path => {\n let pathInfo = {}\n // round d to two decimals if minify is true\n if (minify) {\n pathInfo.d = pathManipulator(path.attributes.d).round(2).toString()\n } else {\n pathInfo.d = path.attributes.d\n }\n // get id from all paths\n pathInfo.id = path.attributes.id\n // only get start and end points, strokeWidth and total length from interactiveStrokes layer\n if (layer.attributes.id === 'interactiveStrokes') {\n let properties = pathProps.svgPathProperties(pathInfo.d)\n // gets parts from properties\n let lineParts = properties.getParts()\n pathInfo.strokeWidth = path.attributes['stroke-width']\n pathInfo.totalLength = properties.getTotalLength()\n pathInfo.startPoint = lineParts[0].start\n // gets curves to make comparison to drawing\n pathInfo.curve = getCurve(canvas.path(pathInfo.d), curvePoints)\n pathInfo.endPoint = lineParts[lineParts.length - 1].end\n }\n // splice the stroke information to be in the correct stroke order - according to svg id parameters\n charInfo.layers[layer.attributes.id].splice(parseInt(pathInfo.id.replace(/[^0-9]/g,'')) - 1, 0, pathInfo)\n })\n })\n // character will be the file name without extension\n let character = filenames[i].replace('.svg', '')\n data[character] = charInfo\n })\n // save smaller hard-to-read JSON for use and an easy-to-read one\n let readableOutput = JSON.stringify(data, null, 2)\n let output = JSON.stringify(data)\n fs.writeFileSync(`output/${outputName}.json`, output)\n console.log(`Saved ${outputName}.json!`)\n fs.writeFileSync(`output/readable${outputName}.json`, readableOutput)\n console.log(`Saved readable${outputName}.json!`)\n }).catch(err => console.log(err))\n}", "drawHTMLBoard () {\n for (let column of this.spaces) {\n for (let space of column) {\n space.drawSVGSpace();\n }\n }\n }", "function dispGeneExon(g, svg, track, genestrand, gene_start, width, max_len) {\n var disp_exon = false;\n var geneexons = track.Exon;\n\n if (geneexons.length > 0) {\n var strand = genestrand;\n\n var spanclass = \">\";\n\n if (strand == -1 || strand == \"-1\") {\n spanclass = \"<\";\n }\n\n var newStart_temp = gene_start;\n var maxLentemp = width;\n\n\n var exon_len = geneexons.length;\n var startposition = 0;\n var stopposition = 0;\n var translation_start;\n var translation_end;\n\n if (track.Translation) {\n if (track.Translation.start < track.Translation.end) {\n translation_start = track.Translation.start;\n translation_end = track.Translation.end;\n }\n else {\n translation_start = track.Translation.start;\n translation_end = track.Translation.end;\n }\n } else {\n translation_start = geneexons[0].start;\n translation_end = geneexons[exon_len - 1].end;\n }\n\n var last = null, current = null;\n\n while (exon_len--) {\n\n var exon_start;\n var exon_stop;\n if (geneexons[exon_len].start < geneexons[exon_len].end) {\n exon_start = geneexons[exon_len].start;\n exon_stop = geneexons[exon_len].end;\n }\n else {\n exon_start = geneexons[exon_len].end;\n exon_stop = geneexons[exon_len].start;\n }\n\n current = exon_start;\n\n startposition = (exon_start - newStart_temp) * parseFloat(maxLentemp) / (max_len);\n stopposition = ((exon_stop - exon_start) + 1) * parseFloat(maxLentemp) / (max_len);\n\n stopposition -= 1\n\n if (stopposition < 1) {\n stopposition = 1\n }\n startposition += 1\n\n svg.rect(g, startposition, 1, stopposition, 10, 2, 2, {\n 'id': \"exon\" + geneexons[exon_len].id + \"style1\",\n fill: 'white',\n stroke: 'green',\n strokeWidth: 2\n });\n\n if (exon_len > 0) {\n svg.text(g, startposition - 20, 8, spanclass, {stroke: 'green'});\n }\n disp_exon = true;\n }\n\n var exon_len = geneexons.length;\n\n while (exon_len--) {\n\n var exon_start;\n var exon_stop;\n if (geneexons[exon_len].start < geneexons[exon_len].end) {\n exon_start = geneexons[exon_len].start;\n exon_stop = geneexons[exon_len].end;\n }\n else {\n exon_start = geneexons[exon_len].end;\n exon_stop = geneexons[exon_len].start;\n }\n\n current = exon_start;\n\n if (exon_start < translation_start && exon_stop < translation_start) {\n\n startposition = 0;// ((exon_start - newStart_temp)) * parseFloat(maxLentemp) / (max_len);\n stopposition = ((exon_stop - exon_start) + 1) * parseFloat(maxLentemp) / (max_len);\n\n startposition = parseFloat(startposition) + parseFloat(jQuery(\"#exon\" + geneexons[exon_len].id + \"style1\").attr(\"x\"))\n\n svg.rect(g, startposition, 1, stopposition, 10, {class: 'utr1', fill: 'gray'});\n\n last = current;\n\n }\n else if (exon_start < translation_start && exon_stop > translation_end) {\n\n\n startposition = 0;//((exon_start - newStart_temp)) * parseFloat(maxLentemp) / (max_len);\n stopposition = (translation_start - exon_start) * parseFloat(maxLentemp) / (max_len);\n startposition = parseFloat(startposition) + parseFloat(jQuery(\"#exon\" + geneexons[exon_len].id + \"style1\").attr(\"x\"))\n\n svg.rect(g, startposition, 1, stopposition, 10, {class: 'utr2', fill: 'gray'});\n\n startposition = ((translation_end - exon_start) - 1) * parseFloat(maxLentemp) / (max_len);\n stopposition = (exon_stop - translation_end + 1) * parseFloat(maxLentemp) / (max_len);\n startposition = parseFloat(startposition) + parseFloat(jQuery(\"#exon\" + geneexons[exon_len].id + \"style1\").attr(\"x\"))\n\n\n svg.rect(g, startposition, 1, stopposition, 10, {class: 'utr3', fill: 'gray'});\n\n last = current;\n }\n else if (exon_stop > translation_start && exon_start < translation_start) {\n\n startposition = 0;\n stopposition = (translation_start - exon_start) * parseFloat(maxLentemp) / (max_len);\n startposition = parseFloat(startposition) + parseFloat(jQuery(\"#exon\" + geneexons[exon_len].id + \"style1\").attr(\"x\"))\n\n svg.rect(g, startposition, 1, stopposition, 10, {class: 'utr4', fill: 'gray'});\n\n last = current;\n\n }\n else if (exon_stop > translation_end && exon_start < translation_end) {\n\n startposition = ((translation_end - exon_start)) * parseFloat(maxLentemp) / (max_len);\n stopposition = (exon_stop - translation_end) * parseFloat(maxLentemp) / (max_len);\n startposition = parseFloat(startposition) + parseFloat(jQuery(\"#exon\" + geneexons[exon_len].id + \"style1\").attr(\"x\"))\n\n svg.rect(g, startposition, 1, stopposition, 10, {class: 'utr5', fill: 'gray'});\n\n last = current;\n }\n\n else if (exon_start > translation_start && exon_stop > translation_end) {\n\n startposition = 1;\n stopposition = (exon_stop - exon_start) * parseFloat(maxLentemp) / (max_len);\n startposition = parseFloat(startposition) + parseFloat(jQuery(\"#exon\" + geneexons[exon_len].id + \"style1\").attr(\"x\"))\n\n svg.rect(g, startposition, 1, stopposition, 10, {class: 'utr6', fill: 'gray'});\n\n last = current;\n }\n }\n\n }\n}", "display() {\n fill(127);\n stroke(200);\n strokeWeight(2);\n ellipse(this.x, this.y, this.r * 2, this.r * 2);\n }", "function writeText() {\n let outputText = \n ['g', getText().map(textData => ['g', {'attrs': {'transform': 'translate(-0.5 -0.5)'}},\n ['switch',\n ['foreignObject', {'attrs': {'style': 'overflow: visible; text-align: left;', 'pointer-events': 'none', 'width': '100%', 'height': '100%', 'requiredFeatures': 'http://www.w3.org/TR/SVG11/feature#Extensibility'}},\n ['div', {'attrs': {'style': `display: flex; align-items: unsafe center; justify-content: unsafe ${textData[\"justify\"]}; width: ${textData[\"width\"]}px; height: 1px; padding-top: ${textData[\"padding\"]}px; margin-left: ${textData[\"margin\"]}px;`}},\n ['div', {'attrs': {'style': 'box-sizing: border-box; font-size: 0; text-align: center;'}},\n ['div', {'attrs': {'style': `display: inline-block; font-size: 12px; font-family: Helvetica; color: ${textData[\"color-fill\"]}; line-height: 1.2; pointer-events: none; white-space: normal; word-wrap: normal; `}}, `${textData[\"text\"]}`]]]],\n ['text', {'attrs': {'x': `${textData[\"x\"]}`, 'y': `${textData[\"padding\"]+4}`, 'fill': `${textData[\"color-fill\"]}`, 'font-family': 'Helvetica', 'font-size': '12px', 'text-anchor': 'middle'}}, `${textData[\"text\"]}`]]])];\n \n return outputText;\n}", "function displayNodesinfo() {\n\n\t\tvar ptx = 0,\n\t\t\tpty = 0,\n\t\t\tarrpt = [],\n\t\t\tt;\n\t\tvar svgg = theSvgElement.getElementsByClassName('textsqueleton');\n\t\tfor (var i = 0; i <= svgg.length - 1; i += 1) {\n\t\t\tsvgg[i].addEventListener('mouseover', function(evt) {\n\t\t\t\tt = evt.target;\n\t\t\t\tarrpt = t.id.split(\" \");\n\n\t\t\t\t//1: Views; 3: Shapes; 5: Points\n\t\t\t\tptx = theObj.Views[arrpt[1]].Shapes[arrpt[3]].Points[arrpt[5]].x;\n\t\t\t\tpty = theObj.Views[arrpt[1]].Shapes[arrpt[3]].Points[arrpt[5]].y;\n\n\t\t\t\tvar elemx = document.getElementById(\"nodeinfox\");\n\t\t\t\tvar elemy = document.getElementById(\"nodeinfoy\");\n\n\t\t\t\telemx.setAttribute(\"type\", \"text\");\n\t\t\t\telemy.setAttribute(\"type\", \"text\");\n\n\t\t\t\telemx.readOnly = true;\n\t\t\t\telemy.readOnly = true;\n\n\t\t\t\telemx.size = 10;\n\t\t\t\telemy.size = 10;\n\n\t\t\t\telemx.value = ptx;\n\t\t\t\telemy.value = pty;\n\n\t\t\t\tdocument.getElementById(\"outputsqueleton\").innerHTML = \"View: \" + arrpt[1] + \" / Shape: \" + arrpt[3];\n\t\t\t});\n\t\t\tsvgg[i].addEventListener('mouseout', function() {\n\t\t\t\tdocument.getElementById(\"nodeinfox\").value = \"\";\n\t\t\t\tdocument.getElementById(\"nodeinfoy\").value = \"\";\n\t\t\t\tdocument.getElementById(\"outputsqueleton\").innerHTML = \"\";\n\n\t\t\t});\n\t\t}\n\n\t\treturn 0;\n\t}", "function exportCanvas() {\n //export canvas as SVG\n var v = '<svg width=\"300\" height=\"200\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\\\n <rect x=\"0\" y=\"0\" height=\"200\" width=\"300\" style=\"stroke:#000000; fill: #FFFFFF\"/>\\\n <path d=\"M100,100 C200,200 100,50 300,100\" style=\"stroke:#FFAAFF;fill:none;stroke-width:3;\" />\\\n <rect x=\"50\" y=\"50\" height=\"50\" width=\"50\"\\\n style=\"stroke:#ff0000; fill: #ccccdf\" />\\\n </svg>';\n\n\n\n //get svg\n var canvas = getCanvas();\n\n var v2 = '<svg width=\"' + canvas.width + '\" height=\"' + canvas.height + '\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">';\n v2 += STACK.toSVG();\n v2 += CONNECTOR_MANAGER.toSVG();\n v2 += '</svg>';\n alert(v2);\n\n //save SVG into session\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"../common/controller.php\", {action: 'saveSvg', svg: escape(v2)},\n function(data) {\n if (data == 'svg_ok') {\n //alert('SVG was save into session');\n }\n else if (data == 'svg_failed') {\n Log.info('SVG was NOT save into session');\n }\n }\n );\n\n //open a new window that will display the SVG\n window.open('./svg.php', 'SVG', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');\n}", "display() {\n fill(this.color, 100, 100);\n ellipse(this.x, this.y, this.diameter)\n }", "function injectSVG() {\n\n\t\tvar ajax = new XMLHttpRequest();\n\n\t\tajax.open('GET', 'assets/img/svg.svg?v=4', true);\n\t\tajax.send();\n\t\tajax.onload = function(e) {\n\n\t\t\tvar div = document.createElement('div');\n\t\t\tdiv.id = 'svgInject';\n\t\t\tdiv.innerHTML = ajax.responseText;\n\t\t\tdocument.body.insertBefore(div, document.body.childNodes[0]);\n\n\t\t}\n\n\t}", "function SVGShape() {}", "function svgTest() {\n var div = document.createElement('div');\n var ns = 'http://www.w3.org/2000/svg';\n \n div.innerHTML = '<svg/>';\n return (div.firstChild && div.firstChild.namespaceURI) == ns;\n}" ]
[ "0.6743461", "0.6506312", "0.63639826", "0.6286437", "0.6142964", "0.60708266", "0.59901714", "0.59224033", "0.5870231", "0.5839356", "0.58369815", "0.5816496", "0.5795811", "0.578825", "0.57724506", "0.57682407", "0.5766095", "0.57507014", "0.57491463", "0.5739798", "0.5721955", "0.5711035", "0.5699627", "0.56916726", "0.56793857", "0.56638193", "0.56464195", "0.561747", "0.56131923", "0.5592982", "0.5590203", "0.558979", "0.5587397", "0.5585472", "0.5581318", "0.5548021", "0.5537547", "0.55188143", "0.55157775", "0.5512768", "0.5509244", "0.5500093", "0.54889506", "0.548637", "0.54638165", "0.54534346", "0.54495037", "0.54414445", "0.5438315", "0.54348874", "0.5411724", "0.5408913", "0.5397385", "0.5395768", "0.53942114", "0.5393989", "0.53915524", "0.5381971", "0.5381971", "0.5381971", "0.5381971", "0.5381971", "0.5381971", "0.53775364", "0.537564", "0.5369714", "0.53651875", "0.53522867", "0.5344522", "0.53443587", "0.5340647", "0.53339046", "0.53325087", "0.532962", "0.5317674", "0.5314893", "0.5313082", "0.5310815", "0.5305114", "0.5296881", "0.5293207", "0.5292638", "0.52918756", "0.52860796", "0.52812827", "0.52809685", "0.5278563", "0.52782255", "0.52777165", "0.52776814", "0.5275962", "0.52739817", "0.5267195", "0.52649647", "0.5264069", "0.5251499", "0.5246856", "0.52398455", "0.52352935", "0.523405" ]
0.642943
2
set the outside nodes
function setNodePosition(){ //console.log(print); var change = 0; var offset = Math.max(xOffset - leftPanelWidth,0); //set xpos of nodes, and check if node is an outside node layerMap.forEach(function(d, i){ if (i > 0){ d.forEach(function(e){ var tmp = []; nodesChildren[e].forEach(function(f){ if (!nodesData[f].outside.isOutside){ tmp.push(nodesData[f].xpos); } }); if (tmp.length == 0){ if (!nodesData[e].outside.isOutside){ change++; } nodesData[e].outside.isOutside = true; nodesData[e].xpos = -1; } else { if (nodesData[e].outside.isOutside){ change++; } nodesData[e].xpos = (d3.min(tmp) + d3.max(tmp)) / 2; if (!d.fixed){ nodesData[e].position.x = nodesData[e].xpos; } nodesData[e].outside.isOutside = false; } }); } else { d.forEach(function(e){ var tmpX = nodesData[e].xpos; if (tmpX - nodeRadius > offset && tmpX + nodeRadius < offset + windowWidth){ if (nodesData[e].outside.isOutside){ change++; } nodesData[e].outside.isOutside = false; } else { if (!nodesData[e].outside.isOutside){ change++; } nodesData[e].outside.isOutside = true; } }) } }); //Set the color, opacity of nodes based on the status of isOutside nodes.each(function(d){ /*if (d.noLayer){ d.outside.isOutside = true; d3.select(this) .attr("opacity", 0.8) .attr("r", nodeRadius) .attr("fill", "red"); } */ if (d.fixed && !(d.x - nodeRadius > offset && d.x + nodeRadius < offset + windowWidth)){ d.fixed = false d3.select(this).classed("fixed", false); d.position.x = d.xpos; d.position.y = height - nodeRadius - d.layer * unitLinkLength; } if (d.outside.isOutside && !d.noLayer){ if (d.unAssigned){ } d3.select(this) .transition() .duration(500) .attr("opacity", 0.5) .attr("r", nodeRadius) .attr("fill", function(d){ return cScale(d.index + 1); }); } else { d3.select(this) .transition() .duration(500) .attr("opacity", 0.7) .attr("r", nodeRadius) .attr("fill", "red"); } //console.log(d.id + " " + d.outside.isOutside + " " + d.position.x); }); //console.log(change) //when some node changes its status, the correspoding links, labels and the x position of inside nodes should also change. if (change > 0 || firstTime){ firstTime = false; d3.select(htmlElement).selectAll(".nodeLabel") .attr("opacity", function(d){ if (d.node.noLayer){ d.node.showLabel = true; return 1; } if (d.type == "nodeLabel" && d.node.outside){ if ((!d.node.outside.isOutside && (print || d.node.type != "anchor")) || (d.node.outside.isOutside && d.node.degree >= 3)){ d.node.showLabel = true; return 1; } } d.node.showLabel = false; return 0; }); d3.select(htmlElement).selectAll(".linkLabel") .attr("opacity", function(d){ if (d.type == "linkLabel"){ // if (nodesData[d.node.tgt].noLayer){ // d.show = true; // return 1; // } // if (nodesData[d.node.tgt].type == 'anchor' && !nodesData[d.node.tgt].outside.isOutside){ // d.show = true; // return 1; // } if ((d.node.src < nodesData.length && nodesData[d.node.src].noLayer == undefined && nodesData[d.node.src].outside.isOutside) || (d.node.tgt < nodesData.length && nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)){ d.show = false; return 0; } d.show = true; return 1; } }); d3.select(htmlElement).selectAll(".edgeLinkLabel") .attr("opacity", function(d){ //console.log(d.index); if (!d.node.src.show || (nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)) { d.show = false; return 0; } d.show = true; return 1; }); /*d3.select(htmlElement).selectAll(".clickBoard") .attr("fill", function(d){ if (d.content == "edgeLinks"){ if (nodesData[d.node.tgt].outside.isOutside || !d.node.src.show){ return "node"; } return "transparent"; } else if (d.type == "linkLabel"){ if (nodesData[d.node.src].outside.isOutside || nodesData[d.node.tgt].outside.isOutside){ return "none"; } return "transparent"; } return d.node.showLabel ? "transparent" : "none"; });*/ links.classed("outsideLink", function(d){ /*if (d.type == "edgeLink"){ return d.target.outside.isOutside; }*/ if (d.target.noLayer){ return false; } if (d.source.outside && d.target.outside){ if (d.target.type == 'anchor' && !d.target.outside.isOutside){ return false; } return d.source.outside.isOutside || d.target.outside.isOutside; } return false; }); force.start(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setnodevals()\n\t{\t\t\t\n\t\tnode.attr(\"dx\", nodedx)\n\t\t\t.attr(\"dy\", \".31em\")\n\t\t\t.attr(\"transform\", nodetrans)\n\t\t\t.style(\"text-anchor\", nodeanchor);\t\t\t\n\t}", "function set_edges() {\n }", "function setNode(event){\n let currentNode=event.currentTarget;\n \n let indexX=parseInt(currentNode.dataset.row)\n let indexY=parseInt(currentNode.dataset.column)\n \n if(setterMode==\"Wall\"){\n setWall(indexX,indexY)\n }\n else if(setterMode==\"StartPoint\"){\n setStart(indexX,indexY)\n }\n else if(setterMode==\"EndPoint\"){\n setEnd(indexX,indexY)\n }\n \n}", "function setTransitionOffCanvas(){\n buildingBinding = objectContainer.selectAll(\".buildingNode\");\n buildingBinding.each(function(d) {\n var node = d3.select(this);\n node.transition()\n .duration(100)\n .attr(\"cx\", canvasWidth)\n .attr(\"cy\", canvasHeight)\n .attr(\"r\", sizeOfCircleMin)\n .attr(\"fill\", randomColor);\n });\n}", "function setTreeTwo(){\n\tdata = tree_two;\n\treadTree();\n\td3.select(\"svg\").remove();\n\tdrawUI();\n}", "function setNewYPositions() {\n data.tree.eachBefore(d => {\n if (d.parent) {\n let horizontal = graph.scale.horizontal\n if (!graph.style.align)\n d.y = horizontal.value * d.data.data.value * horizontal.scalingFactor + d.parent.y\n else\n d.y = d.depth * horizontal.scalingFactor * horizontal.value\n\n let element = d3.select('#node' + d.data.id)\n if (!element) return\n element.attr('transform', 'translate(' + [d.y, d.x] + ')')\n\n if (d.parent) {\n if (d3.select('#link' + d.data.id).select('path')) {\n d3.select('#link' + d.data.id)\n .select('path')\n .attr('d', 'M' + [d.parent.y, d.parent.x] + 'V' + d.x + 'H' + d.y)\n }\n\n if (graph.style.linkLabels) {\n if (d3.select('#label' + d.data.id)) {\n d3.select('#label' + d.data.id)\n .attr('x', ((d.parent.y + d.y) / 2).toString())\n }\n }\n }\n }\n })\n }", "setTreeRootNodes() {\n if (!this.settings.treeGrid) {\n return;\n }\n this.settings.treeRootNodes = this.settings.treeDepth\n .filter(node => node.depth === 1);\n }", "function wb(){this.wa=this.root=null;this.Y=!1;this.C=this.T=this.ka=this.assignedSlot=this.assignedNodes=this.J=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.O=void 0;this.Ca=this.pa=!1}", "setNoOutsideFeeler() {\n this._outsideFeelerStart = null;\n this._outsideFeelerMid = null;\n this._outsideFeelerEnd = null;\n this._hasFeeler = false;\n }", "function replaceOE() {\n cy.edges().forEach(function(item, index, array) {\n let oE = item.data().originalEnds;\n if ( oE ) {\n let src = oE.source.id();\n let dst = oE.target.id();\n cy.$id(item.id()).data().originalEnds = {\n\t source: src,\n\t target: dst\n }\n };\n });\n}", "function nodeMouseOut(d, i) {\n // Reset link styles\n link\n .style(\"opacity\", 1)\n .style(\"stroke\", \"#999\");\n // Reset node styles\n node\n .style(\"opacity\", 1)\n .style(\"stroke\", \"#fff\");\n // Reset text styles\n text\n .style(\"visibility\", \"hidden\")\n .style(\"font-weight\", \"normal\");\n }", "setNodes(nodes) {\n this._nodes = nodes\n }", "function shiftNodesToEmptySpaces() {\n workflowDiagram.selection.each((node) => {\n if (!(node instanceof go.Node)) return;\n while (true) {\n const exist = workflowDiagram.findObjectsIn(node.actualBounds,\n obj => obj.part,\n part => part instanceof go.Node && part !== node,\n true,\n ).first();\n if (exist === null) break;\n node.position = new go.Point(\n node.actualBounds.x, exist.actualBounds.bottom + 10,\n );\n }\n });\n }", "function setNode(next) {\n var _node = node,\n __anchor = _node.__anchor,\n __focus = _node.__focus;\n\n if (__anchor != null) next.__anchor = __anchor;\n if (__focus != null) next.__focus = __focus;\n node = next;\n }", "updateEdgePositions() {\n this.html\n .attr(\"x1\", this.x1)\n .attr(\"y1\", this.y1)\n .attr(\"x2\", this.x2)\n .attr(\"y2\", this.y2)\n }", "setPOIFlag() {\n\t\tfor (var id in this.ways) {\n\t\t\tvar w = this.ways[id];\n\t\t\tfor (var nd of w.nodes) {\n\t\t\t\tnd.poi = false;\n\t\t\t}\n\t\t}\n\t}", "function restoreOE() {\n\tcy.edges().forEach(function(item, index, array) {\n\t\tvar oE = item.data().originalEnds;\n\t\tif ( oE && typeof oE.source == 'string'\n\t \t&& cy.$id(oE.target).length > 0\n\t\t&& cy.$id(oE.source).length > 0) {\n\t \t\titem.data().originalEnds = {\n\t\t\t\tsource: cy.$id(oE.source),\n\t\t\t\ttarget: cy.$id(oE.target)\n\t\t\t}\n\t\t};\n\t});\n}", "setNodes(editor, props) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n match,\n at = editor.selection\n } = options;\n var {\n hanging = false,\n mode = 'lowest',\n split = false,\n voids = false\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n match = Path.isPath(at) ? matchPath(editor, at) : n => Editor.isBlock(editor, n);\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n if (split && Range.isRange(at)) {\n if (Range.isCollapsed(at) && Editor.leaf(editor, at.anchor)[0].text.length > 0) {\n // If the range is collapsed in a non-empty node and 'split' is true, there's nothing to\n // set that won't get normalized away\n return;\n }\n\n var rangeRef = Editor.rangeRef(editor, at, {\n affinity: 'inward'\n });\n var [start, end] = Range.edges(at);\n var splitMode = mode === 'lowest' ? 'lowest' : 'highest';\n var endAtEndOfNode = Editor.isEnd(editor, end, end.path);\n Transforms.splitNodes(editor, {\n at: end,\n match,\n mode: splitMode,\n voids,\n always: !endAtEndOfNode\n });\n var startAtStartOfNode = Editor.isStart(editor, start, start.path);\n Transforms.splitNodes(editor, {\n at: start,\n match,\n mode: splitMode,\n voids,\n always: !startAtStartOfNode\n });\n at = rangeRef.unref();\n\n if (options.at == null) {\n Transforms.select(editor, at);\n }\n }\n\n for (var [node, path] of Editor.nodes(editor, {\n at,\n match,\n mode,\n voids\n })) {\n var properties = {};\n var newProperties = {}; // You can't set properties on the editor node.\n\n if (path.length === 0) {\n continue;\n }\n\n var hasChanges = false;\n\n for (var k in props) {\n if (k === 'children' || k === 'text') {\n continue;\n }\n\n if (props[k] !== node[k]) {\n hasChanges = true; // Omit new properties from the old properties list\n\n if (node.hasOwnProperty(k)) properties[k] = node[k]; // Omit properties that have been removed from the new properties list\n\n if (props[k] != null) newProperties[k] = props[k];\n }\n }\n\n if (hasChanges) {\n editor.apply({\n type: 'set_node',\n path,\n properties,\n newProperties\n });\n }\n }\n });\n }", "function newundefnode(name){\n var figure = new draw2d.shape.basic.Circle({height: 20, width:20});\n figure.add(new draw2d.shape.basic.Label({text:name, stroke:0}), new draw2d.layout.locator.BottomLocator())\n var rawcolor = new draw2d.util.Color(\"#231F21\")\n figure.resetPorts();\n figure.setBackgroundColor(rawcolor)\n figure.setColor(rawcolor.darker())\n\n figure.on(\"move\", function(emitter, event) {\n for (var j = 0; j < maploc.length; j++){\n var dis_ij = Math.floor(Math.sqrt((figure.x - maploc[j].x)**2 + (figure.y - maploc[j].y)**2))\n $(\"#dis_\"+name+\"n\"+String(j+1)).html(dis_ij)\n $(\"#dis_\"+\"n\"+String(j+1)+name).html(dis_ij)\n $(\"#dis_\"+name+name).html(\"0\")\n }\n for (var j = 0; j < maploc.length; j++){\n if (maploc[j].node == name){\n maploc[j].x = figure.x;\n maploc[j].y = figure.y;\n }\n }\n })\n\n return figure\n}", "SetNodeParents() {\n //let values = Array.from(Object.values(this.GraphContent));\n let values = Object.values(this.GraphContent);\n //console.log('SetNodeParents ' + JSON.stringify(values[0]));\n //console.log('data length ' + values.length );\n for (let i = 0; i < values.length; i++) {\n let links = values[i].children;\n //console.log('links for ' + i + ' = ' + JSON.stringify(links));\n //console.log('this.NodeList ' + JSON.stringify(this.NodeList));\n if (links.length != 0) {\n for (let j = 0; j < links.length; j++) {\n let childNode = this.NodeList[links[j]];\n childNode.setParents(i);\n //console.log(`parents for ${childNode.name} are :`,childNode.parents);\n }\n }\n }\n }", "function setHope(){\r\n\thope = true;\r\n\tvar concrete = concreteObjects[concreteObjects.length -1];\r\n\tfor(var i = 0; i<leaves.length; i++){\r\n\t\t//leaves[i].insertAbove(concrete);\r\n\t\tanimateLeaf(leaves[i]);\r\n\t}\r\n\tfor(var i = 0; i<captionObjects.length; i++){\r\n\t\tcaptionObjects[i].fillColor = leafColor;\r\n\t}\r\n}", "function endNodeAssigner(elm2makeEndNode) {\r\n elm2makeEndNode.addEventListener('mousedown', function (e) {\r\n if (makeClickedNodeSecondNode == 1) {\r\n secondNode = this;\r\n //stop it from linking to itself\r\n if (firstNode != secondNode) {\r\n setConnect2Attribute(firstNode, secondNode);\r\n drawSVGConnectingLine(firstNode, secondNode);\r\n }\r\n secondNode = null;\r\n firstNode = null;\r\n \r\n makeClickedNodeSecondNode = 0;\r\n }\r\n });\r\n}", "function setNewXPositions(last) {\n data.tree.eachBefore(d => {\n d.x = d.x / last\n d.x = d.x * graph.scale.vertical.value\n\n let element = d3.select('#node' + d.data.id)\n if (!element) return\n element.attr('transform', 'translate(' + [d.y, d.x] + ')')\n if (d.parent) {\n d3.select('#link' + d.data.id)\n .select('path')\n .attr('d', 'M' + [d.parent.y, d.parent.x] + 'V' + d.x + 'H' + d.y)\n\n if (graph.style.linkLabels) {\n if (d3.select('#label' + d.data.id)) {\n d3.select('#label' + d.data.id)\n .attr('y', (d.x - 5).toString())\n }\n }\n }\n })\n }", "function ResetTrees() {\n\n // Loop over the trees in the x direction\n for (var x = 0; x < TREE_COUNT_X; x++) {\n\n // Loop over the trees in the y direction\n for (var y = 0; y < TREE_COUNT_Y; y++) {\n\n // Set the state of the tree\n SetTreeState(document.getElementById(x + \"-\" + y));\n\n } // end for (var y)\n\n } // end for (var x)\n\n} // end function ResetTrees()", "function setTreeOne(){\n\tdata = tree_one;\n\treadTree();\n\td3.select(\"svg\").remove();\n\tdrawUI();\n}", "function keepNodesOnTop() {\n $(\".nodeStrokeClass\").each(function( index ) {\n var gnode = this.parentNode;\n gnode.parentNode.appendChild(gnode);\n });\n }", "function addInternalLabels() {\n graph.style.parentLabels = !graph.style.parentLabels\n updateInternalLabels(graph.style.parentLabels)\n }", "function setPositions(nodes) {\n // determine positions\n for (i in nodes) {\n if (nodes[i].category === \"Math\") {\n nodes[i].x = mathX\n nodes[i].y = firstY + i * smallVerticalGap\n } else if (nodes[i].category === \"Lower\") {\n nodes[i].x = mathX*2\n nodes[i].y = firstY + (i-numMath) * bigVerticalGap\n } else if (nodes[i].category === \"100\") {\n nodes[i].x = mathX*3\n nodes[i].y = firstY + (i-(numMath+numLower)) * 70\n } else if (nodes[i].category === \"101\") {\n nodes[i].x = mathX*4\n nodes[i].y = firstY + (i-(numMath+numLower+num100)) * bigVerticalGap\n } else if (nodes[i].category === \"102\") {\n nodes[i].x = mathX*5\n nodes[i].y = firstY + (i-(numMath+numLower+num100+num101)) * bigVerticalGap\n } else if (nodes[i].category === \"Elective\") {\n nodes[i].x = horizontalX + (i-(numMath+numRequired)) * horizontalGap\n nodes[i].y = horizontalY\n } else if (nodes[i].category === \"Consulting\") {\n nodes[i].x = horizontalX + (i-(numMath+numRequired+numElective)) * horizontalGap\n nodes[i].y = horizontalY + 100\n }\n }\n }", "function setNodes(data){\n payload = data;\n\n if(kontx.args.deep === true){\n async.eachSeries(data, loadChild, sendNext);\n }\n else {\n sendNext();\n }\n }", "function nodeReset (n) {\n n.strokeColor=selVarColor;\n n.strokeWidth=\"1\";\n n.nodeCol=n.baseCol;\n}", "prepareNodes() {\n const render = (node) => {\n node.html = nodeToHTML(node);\n node.nodesHTML = subnodesToHTML(node.nodes);\n\n const dimensions = getDimensions(node.html, {}, 'mindmap-node');\n node.width = dimensions.width;\n node.height = dimensions.height;\n\n const nodesDimensions = getDimensions(node.nodesHTML, {}, 'mindmap-subnode-text');\n node.nodesWidth = nodesDimensions.width;\n node.nodesHeight = nodesDimensions.height;\n };\n\n this.props.nodes.forEach(node => render(node));\n }", "function adamAndEve() {\n\tresiz(); //ensure all window variables are set correctly\n\n\tfor( let node of g.nodes ){ // shouldn't this be foundNodes ?\n\t\tif( node.ibox.xstart === -50 || node.ibox.xpos === -50 ){\n\t\t\tnode.ibox.toStart()\n\t\t}\n\t}\n\tlaunch()\n}", "function updateSelectedNes() {\n\t\tif (this.dottedSelection.x != 0 && this.dottedSelection.y != 0) {\n\t\t\tvar mapScL = document.getElementById(\"MAP\").scrollLeft;\n\t\t\tvar mapScT = document.getElementById(\"MAP\").scrollTop;\n\t\t\tfor (var i = 0; i < this.selectedNetworkElements.getLength(); i++) {\n\t\t\t\tvar ne = this.selectedNetworkElements.get(i);\n\t\t\t\tif (this.dottedSelection.isHidden()) {\n\t\t\t\t\tne.allocate(ne.x + this.dottedSelection.x + mapScL, ne.y + this.dottedSelection.y + mapScT);\n\t\t\t\t} else {\n\t\t\t\t\tne.allocate(ne.x + this.dottedSelection.x - BORDER_WH + mapScL, ne.y + this.dottedSelection.y - BORDER_WH + mapScT);\n\t\t\t\t}\n\t\t\t\tif (ne.miniNE != null) {\n\t\t\t\t\tne.miniNE.writeMiniNetworkElement(ne);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i = 0; i < this.selectedNetworkElements.getLength(); i++) {\n\t\t\t\tthis.selectedNetworkElements.get(i).updatePorts();\n\t\t\t}\n\t\t}\n\t\tthis.dottedSelection.release();\n\t\tthis.setDottedSelection();\n\t}", "initChildren() {\n this.nodes.forEach(node => {\n node.parent = this\n })\n }", "function outNode(){\n\t\ttooltipsvg\n\t\t.style(\"opacity\", 0)\n\t\t.attr(\"width\",0)\n\t\t.attr(\"height\",0)\n\t\t.selectAll(\"*\").remove();;\n\t}", "makeOrphan(){\n if(!this.parent) return;\n if(this === this.parent.left) this.parent.left = null;\n else this.parent.right = null;\n }", "function placeNodes(newState, itemheight, width, x, y) {\n newState.css({\n 'height': itemheight,\n 'width' : width,\n 'left': x,\n 'top' : y\n });\n}", "function resetNodes() {\r\n allNodes.forEach(node => {\r\n node.visited = false;\r\n });\r\n}", "set childNodes(value) {\n this.textNodes = value;\n }", "constructor() {\n this._nodes = [];\n }", "function hideNodes(){\n\n nodes.update({id: 1, hidden: true});\n nodes.update({id: 2, hidden: true});\n nodes.update({id: 3, hidden: true});\n nodes.update({id: 4, hidden: true});\n nodes.update({id: 5, hidden: true});\n nodes.update({id: 6, hidden: true});\n nodes.update({id: 7, hidden: true});\n \n}", "constructor () {\n\t\tthis.nodes = {};\n\t}", "buildTree() {\n\t\tthis.assignLevel(this.nodesList[0], 0);\n\t\tthis.positionMap = new Map();\n\t\tthis.assignPosition(this.nodesList[0], 0);\n\t}", "function reset_node_views(node) {\n node.view_series = false\n for(var i=0; i<node.children.length; i++)\n reset_node_views(node.children[i])\n}", "function populateExitTile(exitNode,nodeArray){\n for(var i=0; i<nodeArray.length; i++){\n if (nodeArray[i].id == exitNode){\n nodeArray[i].distance = 0;\n nodeArray[i].visited = false;\n document.getElementById(exitNode).style.backgroundColor = 'firebrick';\n }\n }\n return nodeArray;\n}", "configureNodes() {\n this.node\n .attr(\"class\", \"lgv-node\")\n .attr(\"data-node-label\", d => this.extractLabel(d))\n .attr(\"data-node-depth\", d => d.depth)\n .attr(\"data-node-children\", d => d.children ? true : false)\n .attr(\"cx\", d => d.x)\n .attr(\"cy\", d => d.y)\n .attr(\"r\", d => d.r)\n .on(\"click\", (e,d) => {\n\n // node label\n let label = this.extractLabel(d);\n\n // update class\n document.querySelectorAll(`[data-node-label=\"${label}\"]`).forEach(d => d.classList.toggle(\"selected\"));\n\n // send event to parent\n this.artboard.dispatch(\"nodeclick\", {\n bubbles: true,\n detail: {\n label: label\n }\n });\n\n })\n .on(\"mouseover\", (e,d) => {\n\n // node label\n let label = this.extractLabel(d);\n\n // update class\n document.querySelectorAll(`[data-node-label=\"${label}\"]`).forEach(d => d.classList.add(\"active\"));\n\n // send event to parent\n this.artboard.dispatch(\"nodemouseover\", {\n bubbles: true,\n detail: {\n label: label,\n xy: [e.clientX + (this.artboardUnit / 2), e.clientY + (this.artboardUnit / 2)]\n }\n });\n\n })\n .on(\"mouseout\", (e,d) => {\n\n // node label\n let label = this.extractLabel(d);\n\n // update class\n document.querySelectorAll(`[data-node-label=\"${label}\"]`).forEach(d => d.classList.remove(\"active\"));\n\n // send event to parent\n this.artboard.dispatch(\"nodemouseout\", {\n bubbles: true,\n detail: {\n label: label\n }\n });\n\n });\n }", "function nodeOutFunction() {\n tooltip.style(\"visibility\", \"hidden\")\n if (clicked_node == null) {\n clearHighlights();\n node_tooltip.style(\"visibility\", \"hidden\")\n }\n highlight_layer.select('#current-node').remove()\n}", "function setTreeThree(){\n\tdata = tree_three;\n\treadTree();\n\td3.select(\"svg\").remove();\n\tdrawUI();\n}", "function initializeNode() {\r\n // set root fixed in the middle\r\n root.fixed = true;\r\n root.x = mC.panelWidth / 2;\r\n root.y = mC.panelHeight / 2;\r\n root.px = mC.panelWidth / 2;\r\n root.py = mC.panelHeight / 2;\r\n // assign locations for nodes\r\n initialNodes.forEach(function(d) {\r\n if (d.type != \"root\") {\r\n var location = setInitialLocation(d);\r\n d.x = location[0];\r\n d.y = location[1];\r\n d.px = location[0];\r\n d.py = location[1];\r\n }\r\n // for each node type create new tempNode and add them to their lookup\r\n if (d.type == \"dp\") {\r\n d.fixed = true;\r\n var newTempDpNode = new tempDpNode(d.id, d.type, d.label);\r\n tempDpNodes.push(newTempDpNode);\r\n tempDpNodes_lookup[newTempDpNode.id] = newTempDpNode;\r\n }\r\n if (d.type == \"dec\") {\r\n var newTempDecNode = new tempDecNode(d.id, d.type, d.label, d.parent);\r\n tempDecNodes.push(newTempDecNode);\r\n tempDecNodes_lookup[newTempDecNode.id] = newTempDecNode;\r\n }\r\n if (d.type == \"out\") {\r\n var newTempNode = new tempNode(\"out\" + d.parent, d.id, d.type, d.label,\r\n d.parent);\r\n tempNodes.push(newTempNode);\r\n tempNodes_lookup[newTempNode.id] = newTempNode;\r\n }\r\n\r\n });\r\n }", "static _resetBlankNodeIds() {\n blankNodePrefix = blankNodeCount = 0;\n }", "function unvisitedNodes() {\n let allUnvisitedNodes = document.querySelectorAll('.unvisited')\n allUnvisitedNodes.forEach((nodeObject) => {\n let nodeId = nodeObject.id\n let newNode = new Node(nodeId)\n newNode.setY()\n newNode.setX()\n availableNodes.push(newNode)\n });\n }", "onToggleNode() {\n // Need to repopulate grid cache\n this.dependencyGridCache = null;\n // node toggled in tree, can affect resources both above and below, need to redraw all.\n this.scheduleDraw(true);\n }", "function set_all_position(data, parent_coor) {\n data.data.hexagons = [];\n for (var i = 0; i < 6; i++) {\n var a = (i) / 6 * Math.PI * 2; //angle of this hex relative to parent center\n var x = _this.config.hexagon_scale * Math.cos(a) * (Math.sqrt(3) / 3);\n var y = _this.config.hexagon_scale * Math.sin(a) * (Math.sqrt(3) / 3);\n data.data.hexagons[i] = {\n x: x,\n y: y,\n absolute_x: parent_coor.absolute_x + x * Math.pow(1 / 3, data.depth - 1),\n absolute_y: parent_coor.absolute_y + y * Math.pow(1 / 3, data.depth - 1),\n pos: i\n };\n\n //update boundary box\n var d = data.data.hexagons[i];\n if (d.absolute_x > boundary_box.max_x) boundary_box.max_x = d.absolute_x;\n if (d.absolute_y > boundary_box.max_y) boundary_box.max_y = d.absolute_y;\n if (d.absolute_x < boundary_box.min_x) boundary_box.min_x = d.absolute_x;\n if (d.absolute_y < boundary_box.min_y) boundary_box.min_y = d.absolute_y;\n\n\n }\n data.data.hexagons[6] = {\n x: 0,\n y: 0,\n absolute_x: parent_coor.absolute_x,\n absolute_y: parent_coor.absolute_y,\n pos: 6\n\n };\n //data.children[6].words = data.data.topics[6];\n //delete data.data.topics;\n\n delete data.data.submodels;\n\n if (data.children && data.children.length > 0) {\n for (var i = 0; i < data.children.length; i++) {\n set_all_position(data.children[i], data.data.hexagons[i]);\n }\n\n }\n if (data.parent == null)\n data.is_root = true;\n else\n data.is_root = false;\n //delete data.parent;\n }", "function setCurrentNode(nodeName) {\n for (let i = 0; i < nodesValues.length; i++) {\n if (nodesValues[i].node === nodeName) {\n setMyNode(nodesValues[i]);\n return;\n }\n }\n }", "function setParent(node) {\n if ('children' in node) {\n for (var index in node.children) {\n node.children[index].parent = node;\n setParent(node.children[index]);\n }\n }\n }", "function update(nodes_in, links_in) {\n\t// Set data as node ids\n\tvar n_odd_nodes = root.odd_list.length\n\t\n\tif (first_draw & n_odd_nodes > 0) {\n\t // place for the \"odd\" answers to go\n\t first_draw = false;\n\t var odd_answers1 = d3.select(\"#odd\").append(\"svg\")\n\t\t.attr(\"width\",width + margin.left + margin.right)\n\t\t.attr(\"height\",(width-2*.07)/9 + margin.top + margin.bottom)\n\n\t var odd_answers = odd_answers1.append(\"g\")\n\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n\t var onode = odd_answers.selectAll(\".onode\");\n\n\t root.odd_list.forEach(function(d) {\n\t\tvalue = d.value / Total_value;\n\t\td.radius = width * (1-2*.07) * Math.sqrt(value) / 18\n\t });\n\t \n\t onode = onode.data(root.odd_list, function(d) { return d.name });\n\t // Exit old nodes\n\t onode.exit().remove();\n\t \n\t var oenter = onode.enter().append(\"g\")\n\t\t.attr(\"class\",\"onode\")\n\t\t\n\t var oimage = oenter.append(\"g\")\n\t\t.attr(\"transform\", function(d) { return \"scale(\" + d.radius/50 + \")\" });\n\n\t odd_answers1.attr(\"height\",2*Math.ceil(root.odd_list[0].radius) + margin.top + margin.bottom);\n\t oenter.attr(\"transform\", function(d,i) {\n\t\treturn 'translate(' + [width*(i+.5)/n_odd_nodes, Math.ceil(root.odd_list[0].radius)] + ')'; \n\t\t});\n\t oimage.append(\"defs\")\n\t\t.append(\"clipPath\")\n\t\t.attr(\"id\", function(d) { return \"myClip\" + d.name; })\n\t\t.append(\"circle\")\n\t\t.attr(\"cx\", 0)\n\t\t.attr(\"cy\", 0)\n\t\t.attr(\"r\", 50);\n\t // add a black circle in the background\n\t oimage.append(\"circle\")\n\t\t.attr(\"color\", \"black\")\n\t\t.attr(\"cx\", 0)\n\t\t.attr(\"cy\", 0)\n\t\t.attr(\"r\", 50);\n\t oimage.append(\"image\")\n\t\t.attr(\"xlink:href\", \"images/workflow.png\")\n\t\t.attr(\"x\", -50)\n\t\t.attr(\"y\", function(d) { return -image_offset[d.name][1]*100-50; })\n\t\t.attr(\"clip-path\", function(d) { return \"url(#myClip\" + d.name + \")\"; })\n\t\t.attr(\"width\", 100)\n\t\t.attr(\"height\", 4900);\n\t oenter.append(\"title\")\n\t\t.text(function(d) { return image_offset[d.name][0] + \": \" + d.value; });\n\t}\n\t// add the nodes and links to the tree\n\tforce\n\t .nodes(nodes_in)\n\t .links(links_in)\n\t .on(\"tick\", tick);\n\n\t// set the data for the links (with unique ids)\n\tlink = link.data(links_in, function(d) { return d.link_id; });\n\t\n\t// add a path object to each link\n\tlink.enter().insert(\"path\", \".gnode\")\n .attr(\"class\", function(d) { return d.is_max ? \"link_max\" : \"link\"; })\n\t .attr(\"d\", diagonal)\n .style(\"stroke-width\", function(d) { return .5 * width * Math.sqrt(d.value/Total_value) / 18; });\n\n\tlink.append(\"title\")\n\t .text(function(d) { return d.value; })\n \n\t// Exit any old links\n\tlink.exit().remove();\n\n\t// set the data for the nodes (with unique ids)\n\tgnode = gnode.data(nodes_in, function(d) { return d.node_id; });\n\n\t// Exit any old nodes\n\tgnode.exit().remove();\n \n\t// add a group to the node to translate it\n\tvar genter = gnode.enter().append(\"g\")\n\t .attr(\"class\",\"gnode\")\n\t .call(force.drag)\n\t .on(\"click\", click);\n\n\t// add a group to the node to scale it\n\t// with this scaling the image (with r=50px) will have the propper radius\n\tvar gimage = genter.append(\"g\")\n\t .attr(\"transform\", function(d) { return d.answer_id ? \"scale(\" + d.radius/50 + \")\" : \"scale(\" + d.radius/100 + \")\"; })\n\n\t// add a clipPath for a circle to corp the node image\n\tgimage.append(\"defs\")\n\t .append(\"clipPath\")\n\t .attr(\"id\", function(d) { return \"myClip\" + d.node_id; })\n\t .append(\"circle\")\n\t .attr(\"cx\", 0)\n\t .attr(\"cy\", 0)\n\t .attr(\"r\", function(d) { return d.answer_id ? 45 : 100; });\n\n\t// add a black circle in the background\n\tgimage.append(\"circle\")\n\t .attr(\"color\", \"black\")\n\t .attr(\"cx\", 0)\n\t .attr(\"cy\", 0)\n\t .attr(\"r\", function(d) { return d.answer_id ? 45 : 100; });\n\n\t// add the inital image to the node\n\tgimage.append(\"image\")\n\t .attr(\"xlink:href\", function(d) { return d.answer_id ? \"images/workflow.png\" : root.image_url})\n\t .attr(\"x\", function(d) { return d.answer_id ? -50: -100; })\n\t .attr(\"y\", function(d) { return d.answer_id ? -image_offset[d.answer_id][1]*100-50 : -100; })\n\t .attr(\"clip-path\", function(d) { return \"url(#myClip\" + d.node_id + \")\"; })\n\t .attr(\"width\", function(d) { return d.answer_id ? 100: 200; })\n\t .attr(\"height\", function(d) { return d.answer_id ? 4900: 200; });\n\t\n\t// add the yes/no image if needed\n\tgimage.append(\"image\")\n\t .attr(\"xlink:href\", \"images/workflow.png\")\n\t .attr(\"x\", -50)\n\t .attr(\"y\", function(d) { \n\t\tif (d.answer_id) {\n\t\t return image_offset[d.answer_id][2] ? -image_offset[d.answer_id][2]*100-50 : 100;\n\t\t} else {\n\t\t return 100;\n\t\t}\n\t })\n\t .attr(\"clip-path\", function(d) { return \"url(#myClip\" + d.node_id + \")\"; })\n\t .attr(\"width\", 100)\n\t .attr(\"height\", 4900)\n\t .attr(\"opacity\", .35);\n\n\t// add the mouse over text\n\tvar mouse_over = genter.append(\"title\")\n\t .text(function(d) { return image_offset[d.answer_id][0] + \": \" + Math.round(d.value*Total_value); })\n \n\t// start the nodes moving\n\tforce.start();\n\t//for (var i = 500; i > 0; --i) force.tick();\n\t//force.stop();\n \n\td3.select(\"#weight_raw\").on(\"change\", function() { set_weight(0); })\n\td3.select(\"#weight_weighted\").on(\"change\", function() { set_weight(1); })\n\td3.select(\"#weight_bias\").on(\"change\", function() { set_weight(2); })\n\n\t// call-back to swap weighting\n\tfunction set_weight(idx) {\n\t root.nodes.forEach(function(n) {\n\t\tn.radius = n._radius[idx];\n\t\tn.value = n._values[idx];\n\t\tgimage.attr(\"transform\", function(d) { return d.answer_id ? \"scale(\" + d.radius/50 + \")\" : \"scale(\" + d.radius/100 + \")\"; });\n\t\tlink.style(\"stroke-width\", function(d) { return .5 * Math.min(d.target.radius, d.source.radius); });\n\t\tmouse_over.text(function(d) { return image_offset[d.answer_id][0] + \": \" + d.votes[idx]; })\n\t });\n\t update_charge(d3.select(\"#slider_charge\").property(\"value\"));\n\t}\n\n\t// call-back to set how the nodes will move\n\tfunction tick(e) {\n\t // make sure the force gets smaller as the simulation runs\n\t var ky = 10 * e.alpha;\n\t \n\t root.nodes.forEach(function(d, i) {\n\t\t// fix the x value at the depth of the node\n\t\t// and add in the radius of the first node\n\t\ti!=0 ? d.x = d.fixed_x + root.nodes[0].radius+50 : d.x = d.fixed_x + root.nodes[0].radius;\n\t\t// move low prob nodes down\n\t\t// and keep the groups together (to a lesser extent)\n\t\tif (root.nodes[1].value > root.nodes[2].value) { \n\t\t j = 1;\n\t\t} else {\n\t\t j = -1;\n\t\t}\n\t\t// the amount to move the node\n\t\tdelta_y = (3 * d.value - j * .3 * d.group + .3) * ky;\n\t\t// store the old position in case something goes wrong\n\t\t// the collision detection can casue NaNs and I am not sure why\n\t\td.y_old = d.y;\n\t\t// check to make sure the node is not outside the plot area\n\t\t// if it is change the direction of the push\n\t\tif ((d.y-d.radius<0 && delta_y>0) || (d.y+d.radius>height && delta_y<0)) {\n\t\t delta_y *= -1\n\t\t}\n\t\td.y -= delta_y;\n\t });\n\n\t // Also do collision detection after a few itterations\n\t if (e.alpha<0.05) {\n\t\tvar q=d3.geom.quadtree(root.nodes),\n\t\t i=0,\n\t\t n=root.nodes.length;\n\t\twhile (++i < n) q.visit(collide(root.nodes[i]));\n\t }\n\t \n\t // if the new position is NaN use the previous position\n\t // this prevents links for disappearing\n\t root.nodes.forEach( function(d) {\n\t\tif (isNaN(d.y)) { d.y = d.y_old; }\n\t });\n\t \n\t // Translate the node group to the new position\n\t gnode.attr(\"transform\", function(d) {\n\t\treturn 'translate(' + [d.x, d.y] + ')'; \n\t }); \n\t link.attr(\"d\",diagonal);\n\t};\n\t// the collision detection code\n\t// found this online and I am not sure how it works\n\tfunction collide(node) {\n\t var r = node.radius,\n\t\tnx1 = node.x - r,\n\t\tnx2 = node.x + r,\n\t\tny1 = node.y - r,\n\t\tny2 = node.y + r;\n\t return function(quad, x1, y1, x2, y2) {\n\t\tif (quad.point && (quad.point !== node)) {\n\t\t var x = node.x - quad.point.x,\n\t\t\ty = node.y - quad.point.y,\n\t\t\tl = Math.sqrt(x * x + y * y),\n\t\t\tr = 0.9*(node.radius + quad.point.radius);\n\t\t if (l < r) {\n\t\t\tl = (l - r) / l * .5;\n\t\t\t//node.x -= x *= l;\n\t\t\tnode.y -= y *= l;\n\t\t\t//quad.point.x += x;\n\t\t\tquad.point.y += y;\n\t\t }\n\t\t}\n\t\treturn x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n\t };\n\t}\n }", "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "function keepInside(node) {\n\tvar wPos = parseInt(node.style.left.match(/[0-9]*/)[0])+ parseInt(node.getAttribute('xdir')) + parseInt(node.getAttribute('speed'));\n\tif ((wPos+10) > window.innerWidth) {\n\t\tnode.style.left = '20px';\n\t} else {\n\t\tnode.style.left = wPos.toString().concat('px');\n\t}\n\tvar tPos = parseInt(node.style.top.match(/[0-9]*/)[0]) + parseInt(node.getAttribute('ydir')) + parseInt(node.getAttribute('speed'));\n\n\tif ((tPos+10) > window.innerHeight) {\n\t\tnode.style.top = '20px';\n\t} else {\n\t\tnode.style.top = tPos.toString().concat('px');\n\t}\n\n\tif ((tPos-10) <= 0) {\n\t\tlet newH = window.innerHeight - 10;\n\t\tnode.style.top = newH.toString().concat('px');\n\t}\n\n\tif ((wPos-10) <= 0) {\n\t\tlet newH = window.innerWidth - 10;\n\t\tnode.style.left = newH.toString().concat('px');\n\t}\n\n}", "__openNodes(nodes) {\n for (var i = 0; i < nodes.length; i++) {\n this.tree.openNodeWithoutScrolling(nodes[i]);\n }\n }", "function resetAllNodes(node_array) {\n\tvar nodes = node_array || nodes_in_canvas;\n\t\n\t$.each(nodes, function( index, current_node){\n\t\t//Lets reset the text \n\t\tcurrent_node.changeSubText('');\n\t\t\n\t\tcurrent_node.changeColor('white');\n\t\t//Lets clear the lines\n\t\t$('button#clear_lines').trigger('click');\n\t})\t\n\t\n}", "function setNodeRect(_store){\n var currentSize = myNodeSizes[myExpandedMode];\n if(vpl_nodeBox != null && vpl_nodeBox.varname == myNodeVarName){\n var myBoxRect = vpl_nodeBox.rect;\n myBoxRect[2] = myBoxRect[0] + currentSize[0];\n if (myExpandedMode == 0) {\n myBoxRect[3] = myBoxRect[1] + currentSize[1] + myIOLetButtonSize + myTitleBarHeight;\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_canvas\", \"presentation_size\", currentSize[0], currentSize[1] + myTitleBarHeight);\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_body\", \"hidden\", 1);\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_body\", \"size\", currentSize[0], currentSize[1]);\n vpl_nodePatcher.message(\"script\", \"sendbox\", \"vpl_nodelogic\", \"size\", currentSize[0], currentSize[1] + myIOLetButtonSize/2 + myTitleBarHeight);\n } else {\n myBoxRect[3] = myBoxRect[1] + currentSize[1] + myIOLetButtonSize + myTitleBarHeight + myPBodyOffset + 2 * myCanvasLowerSpacing;\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_canvas\", \"presentation_size\", currentSize[0], currentSize[1] + myTitleBarHeight + myPBodyOffset + myCanvasLowerSpacing);\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_body\", \"hidden\", 0);\n vpl_nodeLogicPatcher.message(\"script\", \"sendbox\", \"vpl_body\", \"size\", currentSize[0], currentSize[1]);\n vpl_nodePatcher.message(\"script\", \"sendbox\", \"vpl_nodelogic\", \"size\", currentSize[0], currentSize[1] + myIOLetButtonSize/2 + myTitleBarHeight + myPBodyOffset + myCanvasLowerSpacing);\n }\n vpl_nodeBox.rect = myBoxRect;\n if(_store == 1){\n storeKeyValueInDB(myNodeName, \"_rect\", myBoxRect);\n }\n }\n}", "function fillNodes(node){if(!node.layout||node.isDirty){node.layout={width:undefined,height:undefined,top:0,left:0,right:0,bottom:0};}if(!node.style){node.style={};}if(!node.children){node.children=[];}node.children.forEach(fillNodes);return node;}", "function makeTree(){\n introNode.leftChild = day_0_Job_Selection;\n \n day_0_Job_Selection.leftChild = day_1_Choosing_Savings;\n \n day_1_Choosing_Savings.leftChild = day_2_Moving;\n}", "resetTree() {\n this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }", "function update_graph_nodes(nodes) {\n\t\t$.each(nodes, function (i, node) {\n\t\t\tvar node_id = node[\"id\"];\n\t\t\tvar ele = g.elements(\"node\" + \"[id='\" + node_id + \"']\")[0];\n\t\t\tif (ele) {\n\t\t\t\tele.data(node);\n\t\t\t\tele.position({x: node.view.position.x, y: node.view.position.y});\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert(node_id + \" no ele\");\n\t\t\t}\n\t\t});\n\t}", "function setPos(root, bounds) {\n if (!root.children) {\n return;\n }\n\n // Space out remaining bounds evenly to children\n let n = root.children.length;\n let spacing = (bounds.max - bounds.min) / n;\n\n for (let i = 0; i < root.children.length; i++) {\n let child = root.children[i];\n child.x = bounds.min + (spacing * i) + (spacing / 2);\n child.y = child.level * 30;\n g.append('text').attr('x', child.x).attr('y', child.y).text(child.element.tagName).style('fill', colorScale(child.level));\n setPos(child, {min: child.x - (spacing / 2), max: child.x + (spacing / 2)});\n }\n}", "function resetNodesAndEdgesColors() {\n cy.startBatch();\n cy.nodes().style({ 'background-color':'gray' });\n cy.edges().style({ 'line-color':'gray' });\n cy.endBatch();\n}", "setNodes(editor, props) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n Editor.withoutNormalizing(editor, () => {\n var {\n match,\n at = editor.selection\n } = options;\n var {\n hanging = false,\n mode = 'lowest',\n split = false,\n voids = false\n } = options;\n\n if (!at) {\n return;\n }\n\n if (match == null) {\n match = Path.isPath(at) ? matchPath(editor, at) : n => Editor.isBlock(editor, n);\n }\n\n if (!hanging && Range.isRange(at)) {\n at = Editor.unhangRange(editor, at);\n }\n\n if (split && Range.isRange(at)) {\n var rangeRef = Editor.rangeRef(editor, at, {\n affinity: 'inward'\n });\n var [start, end] = Range.edges(at);\n var splitMode = mode === 'lowest' ? 'lowest' : 'highest';\n Transforms.splitNodes(editor, {\n at: end,\n match,\n mode: splitMode,\n voids\n });\n Transforms.splitNodes(editor, {\n at: start,\n match,\n mode: splitMode,\n voids\n });\n at = rangeRef.unref();\n\n if (options.at == null) {\n Transforms.select(editor, at);\n }\n }\n\n for (var [node, path] of Editor.nodes(editor, {\n at,\n match,\n mode,\n voids\n })) {\n var properties = {};\n var newProperties = {}; // You can't set properties on the editor node.\n\n if (path.length === 0) {\n continue;\n }\n\n for (var k in props) {\n if (k === 'children' || k === 'text') {\n continue;\n }\n\n if (props[k] !== node[k]) {\n properties[k] = node[k];\n newProperties[k] = props[k];\n }\n }\n\n if (Object.keys(newProperties).length !== 0) {\n editor.apply({\n type: 'set_node',\n path,\n properties,\n newProperties\n });\n }\n }\n });\n }", "function initNodeLists() {\n var nlRoot = document.getElementById(\"nodeListContainer\");\n utils.removeAllChildren(nlRoot);\n initNodeList(\"upstream\", nodeList.upstream, nlRoot);\n initNodeList(\"peer\", nodeList.peer, nlRoot);\n initNodeList(\"downstream\", nodeList.downstream, nlRoot);\n}", "function put_nodes_to_right_positions(graphs){\r\n \r\n\r\n for (var i = 0; i < graphs.length; i++){\r\n // calculate current graph center:\r\n var center = {x: 0, y: 0};\r\n for (var j = 0; j < graphs[i].array.length; j++){\r\n var node = graphs[i].array[j];\r\n center.x += node.x;\r\n center.y += node.y;\r\n }\r\n center.x /= graphs[i].array.length;\r\n center.y /= graphs[i].array.length;\r\n \r\n // calculate current top left corner:\r\n var corner = {x: center.x - graphs[i].width/2, \r\n y: center.y - graphs[i].height/2}\r\n\r\n var offset = {x: graphs[i].x - corner.x,\r\n y: graphs[i].y - corner.y}\r\n\r\n // put nodes:\r\n for (var j = 0; j < graphs[i].array.length; j++){\r\n var node = graphs[i].array[j];\r\n node.x = node.x + offset.x + svg_width/2 - real_width/2;\r\n node.y = node.y + offset.y + svg_height/2 - real_height/2;\r\n }\r\n }\r\n }", "set visibleRoot(srchrt){\n\t\tthis.setAttribute('visible-root', srchrt);\n\t\tthis._setVroot();\n\t}", "function nodeToConnectCurrentNodeTo() {\r\n // startNendNodesArrayOfDeletedSVGlines = [];\r\n firstNode = currentNode; //the right-click event is also a mousedown event, therefore, it makes the right-clicked nodeDiv the currentNode\r\n makeClickedNodeSecondNode = 1; //This condition determines if the node clicked after this would be made the endNode\r\n\r\n hideContextMenu()\r\n}", "buildTree() {\n // note: in this function you will assign positions and levels by making calls to assignPosition() and assignLevel()\n let rootNode = this.nodeList.find(theRootNode => theRootNode.parentName === \"root\");\n this.assignLevel(rootNode, 0);\n this.assignPosition(rootNode, 0);\n }", "function resetNodes() {\n let allVisited = document.querySelectorAll('.visited-node')\n let allPath = document.querySelectorAll('.path-node')\n allVisited.forEach((node) => {\n node.classList = 'unvisited'\n })\n allPath.forEach((node) => {\n node.classList = 'unvisited'\n })\n}", "initializeLockedNodes() {\n this.selected_node = -1; // we store data about locked nodes in this.locked_nodes array.\n this.current_mouse_x = 0; // The way we store data is:\n this.current_mouse_y = 0; // this.locked_nodes[i] = index\n this.locked_nodes = new Array(); // this.locked_nodes[i + 1] = x_coord\n this.locked_nodes.push(0); // this.locked_nodes[i + 2] = y_coord, i%3=0\n this.locked_nodes.push(-0.45 * (this.m - 1) * this.distance_between_nodes);\n this.locked_nodes.push(1);\n this.locked_nodes.push((this.m - 1) * 2);\n this.locked_nodes.push(0.45 * (this.m - 1) * this.distance_between_nodes);\n this.locked_nodes.push(1);\n }", "function noNewNodes() {preventNewNode = true;}", "_tickedNode() {\n this.nodeInnerCirclesSelection.attr('cx', (d) => d.x).attr('cy', (d) => d.y)\n this.nodeOuterCirclesSelection.attr('cx', (d) => d.x).attr('cy', (d) => d.y)\n this.nodeLabelsSelection.attr('x', (d) => d.x).attr('y', (d) => d.y)\n }", "function setInnerDimentions(point) {\r\n\t\tvar inner = $(\"#inner\");\r\n\t\tinner.css('top',point.y);\r\n\t\tinner.css('left',point.x);\r\n\t\tgetInnerDimentions();\r\n\t}", "resetNewEdge(){\n this.newEdge1 = null;\n this.newEdge2 = null;\n }", "function jb(){this.za=this.root=null;this.ea=!1;this.N=this.$=this.oa=this.assignedSlot=this.assignedNodes=this.S=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.V=void 0;this.Ea=this.ua=!1;this.Z={}}", "function makeNodeNotFinal(node) {\r\n\tnode.peripheries = 1;\r\n\tnode.shape = \"circle\";\r\n}", "function fillNeighborhoodNodes(nodeIndex, color){// Fill neighborhood \n\t\tlet v = d3.select('#node' + nodeIndex)\n\t\tlet neighborhood = v.attr('neighborhood').split(',')\n\t\tif(neighborhood.length)\n\t\t\tneighborhood.map(function(neighborLabel){\n\t\t\t\tlet node = d3.select('#' + neighborLabel)\n\t\t\t\tif(!node.attr('clique-part'))\n\t\t\t\t\tnode.attr('fill', color)\n\t\t\t\tshowNodeLabelText(neighborLabel)\n\t\t\t})\n\t}", "_updateCarpenterNodesStack() {\n // reset stack\n this._nodesStack = {};\n // search for elements\n const $nodes = this._$websiteDocument.querySelectorAll('[s-node][s-specs]');\n // assign each element in the stack\n Array.from($nodes).forEach(($node) => {\n const $elm = $node.parentNode;\n const uid = $node.getAttribute('s-node');\n if ($elm._sCarpenterNode) {\n this._nodesStack[uid] = $elm._sCarpenterNode;\n return;\n }\n $elm._sCarpenterNode = new __SCarpenterNode($node, this);\n this._nodesStack[uid] = $elm._sCarpenterNode;\n });\n }", "tidy(root) {\n let orderedNodes = [];\n this.postTraverse(root, orderedNodes);\n let modMap = {};\n let centerMap = {};\n let min_dist = 100;\n for (let node of orderedNodes) {\n centerMap[node.id] = 0;\n node.cx = 0;\n if (node.children.length != 0) {\n node.children[0].cx == 0;\n for (let i = 1; i < node.children.length; i++) {\n node.children[i].cx = node.children[i - 1].cx + min_dist;\n }\n centerMap[node.id] = (node.children[0].cx + node.children[node.children.length - 1].cx) / 2;\n }\n }\n // console.log(centerMap);\n for (let node of orderedNodes) {\n // console.log(node.label);\n //Set the top y value\n node.cy = node.depth * 75 + 50;\n let leftSiblings = (node.parents[0] != undefined && node.parents[0].children[0] !== node);\n // console.log(leftSiblings);\n // console.log(centeredValue);\n if (!leftSiblings) {\n node.cx = centerMap[node.id];\n modMap[node.id] = 0;\n }\n else {\n node.cx = node.parents[0].children[node.parents[0].children.indexOf(node) - 1].cx + min_dist;\n modMap[node.id] = node.cx - centerMap[node.id];\n }\n }\n this.shiftChildrenByMod(root, 0, modMap);\n modMap = this.clearModMap(modMap);\n //dealing with conflicts, twice.\n // modMap = this.fixConflicts(root, orderedNodes, modMap);\n modMap = this.fixConflicts(root, orderedNodes, modMap);\n this.fixOffScreen(root, modMap);\n root.cx = (root.children[0].cx + root.children[root.children.length - 1].cx) / 2;\n }", "function allocateNE(x, y) {\n\t\tif (x != null && y != null) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}\n\t\tdocument.getElementById(this.id).style.pixelLeft = this.x;\n\t\tdocument.getElementById(this.id).style.pixelTop = this.y;\n\t}", "disableNodes() {\n if ( typeof this.fixes.nodesDisabled !== 'undefined' ) {\n this.enableNodes( this.fixes.nodesDisabled, false );\n }\n }", "setNet(net){\n //console.info(\"setNet()\");\n if(net !== null) { //controllo che esista una rete\n this.netPos = this.networks.indexOf(net); //ricerco la posizione della rete\n let found = false;\n for(let i=0;i<this.networks[this.netPos].nodi.length;i++){\n if(this.networks[this.netPos].nodi[i].panel === this.panel.id){\n this.associated = true;\n this.associated_node = i;\n found = true;\n }\n }\n if(!found) this.associated=false;\n \n this.nodePos = null;\n this.statePos = null;\n this.thresholdPos = null;\n }\n else{\n this.netPos = null;\n console.error(\"Impossible to set net\");\n }\n }", "function processNodes( nodesToModify ) {\n nodesToModify.forEach(( node ) => {\n // Hardcode hack this node's position for demo.\n if ( window.DEMO_MODE ) {\n if ( node.name === 'Mumbai Node' ) {\n node.coords.lat = '12.576009912063801';\n node.coords.lng = '75.322265625';\n }\n }\n\n // convert to number\n node.coords.lat = ( typeof node.coords.lat === 'string'\n ? parseFloat(node.coords.lat)\n : node.coords.lat\n );\n node.coords.lng = ( typeof node.coords.lng === 'string'\n ? parseFloat(node.coords.lng)\n : node.coords.lng\n );\n // Add latlng as string to connect it to region\n node.lat_lng_id = createLatLngId( node.coords.lat, node.coords.lng );\n\n });\n }", "function hideNode(hide_node) {\n //remove node\n var node_id = hide_node.getID();\n var index = nodes_obj_idx[node_id];\n\n var old_nodes = network.children[0].geometry.getAttribute('position').array;\n old_nodes[index] = NaN;\n old_nodes[index + 1] = NaN;\n old_nodes[index + 2] = NaN;\n\n //remove edge - directed\n var undEdges = [ network.children[1].geometry.getAttribute('position').array,\n hide_node.undEdges()];\n //TODO - directed\n var in_out_edges = {};\n for (var e in hide_node.inEdges()) { in_out_edges[e] = hide_node.inEdges()[e]; }\n for (var e in hide_node.outEdges()) { in_out_edges[e] = hide_node.outEdges()[e]; }\n //----\n var dirEdges = [ network.children[2].geometry.getAttribute('position').array,\n in_out_edges];\n\n [undEdges, dirEdges].forEach(function(all_edges_of_a_node) {\n var old_edges = all_edges_of_a_node[0];\n var edges = all_edges_of_a_node[1];\n for(var i = 0; i < Object.keys(edges).length; i++) {\n var edge = edges[Object.keys(edges)[i]];\n\n //update from-node\n var edge_index = edges_obj_idx[edge.getID()];\n old_edges[edge_index] = NaN;\n old_edges[edge_index + 1] = NaN;\n old_edges[edge_index + 2] = NaN;\n old_edges[edge_index + 3] = NaN;\n old_edges[edge_index + 4] = NaN;\n old_edges[edge_index + 5] = NaN;\n }\n });\n\n network.children[0].geometry.attributes.position.needsUpdate = true;\n network.children[1].geometry.attributes.position.needsUpdate = true;\n network.children[2].geometry.attributes.position.needsUpdate = true;\n window.requestAnimationFrame(update);\n}", "function setMapSelection() {\n\t\tthis.selectedNetworkElements = new List();\n\t\tvar oX = this.selection.getOriginX();\n\t\tvar oY = this.selection.getOriginY();\n\t\tvar fX = oX + this.selection.getFinalX();\n\t\tvar fY = oY + this.selection.getFinalY();\n\t\tfor (var i = 0; i < this.networkElements.getLength(); i++) {\n\t\t\tvar ne = this.networkElements.get(i);\n\t\t\tif (ne.x >= oX && ne.y >= oY && ne.x + ne.width <= fX && ne.y + ne.height <= fY) {\n\t\t\t\tthis.selectedNetworkElements.add(ne);\n\t\t\t\tne.select();\n\t\t\t}\n\t\t}\n\t}", "reset(){\n this.vertices.forEach(vertex => {\n vertex.color = 'w';\n vertex.isWall = false;\n vertex.distance = Number.MAX_SAFE_INTEGER;\n vertex.parent = null;\n });\n }", "function adjustNodeDOMPositions(nodesView, nodesData)\n {\n nodesView.children().each(function(index, child)\n {\n var el = $(child);\n var cid = el.data('node-cid');\n var node = nodesData[cid];\n\n el.css('top', node.position.top);\n el.removeClass('left right');\n el.addClass(node.position.side);\n });\n }", "function addNodeOnto(x,y,name){\n var index = node_dataOnto.length;\n node_dataOnto.push({x:x,y:y,name:name,index:index});\n refreshGraphOnto(node_dataOnto,link_dataOnto);\n}", "function update() {\n\n // calculate the x,y coordinates of the currentRoot\n tree(currentRoot);\n\n // create KV for simple access\n var currentRootKV = currentRoot.descendants().reduce(function(kv, el) {kv[el.data.id] = el; return kv},{});\n\n // the currentRoot contains the correct XY positions for all the nodes\n // minus the ones that need to be hidden. We don't want to limit the\n // number of nodes for our data elements, since that causes text and lines to\n // `jump` around. So we need to make sure we have the same amount of elements\n // and hide rendering the hidden ones.\n var toRender = root.descendants().map(function(el) {\n if (currentRootKV[el.data.id]) {\n var newNode = currentRootKV[el.data.id];\n return newNode;\n } else {\n // if the child is not in the KV map, it is hidden. We\n // now need to set its position to the calculated position of\n // the first visible parent. In other words, the first one\n // which is in the currentRootKV map.\n var fromRoot = _.cloneDeep(el);\n var parent = fromRoot.parent;\n while (!currentRootKV[parent.data.id]) {\n parent = parent.parent;\n }\n var newParent = currentRootKV[parent.data.id];\n\n fromRoot.hidden = true;\n fromRoot.x = newParent.x;\n fromRoot.y = newParent.y;\n\n // we also set the parents x,y since the lines need to\n // be drawn from this position.\n fromRoot.parent.x = newParent.x;\n fromRoot.parent.y = newParent.y;\n\n return fromRoot;\n }\n });\n\n // now that we have to correct data, create the links\n var links = chart.selectAll(\".link\")\n .data(toRender.slice(1));\n\n var linksEnter = links.enter().append(\"path\")\n .attr(\"class\", \"link\")\n .attr(\"d\", diagonal({x:0, y:0, parent: {x:0, y:0}}))\n .style(\"stroke\", function(d) {return colorScale(d.data.group)});\n\n links.merge(linksEnter)\n .transition().duration(2000).attr(\"d\", diagonal);\n\n // create the groups that hold the circle and the text elements\n var nodes = chart.selectAll(\".node\").data(toRender);\n\n var nodesEnter = nodes.enter().append(\"g\")\n .attr(\"class\", \"node\")\n .on(\"click\", click)\n\n nodesEnter.append(\"circle\")\n .attr(\"r\", 2.5)\n .style(\"fill\", function(d) {return colorScale(d.data.group)});\n\n nodesEnter.append(\"text\")\n .attr(\"dy\", \".31em\")\n\n // combine the updated and new nodes\n var nodesUpdate = nodes.merge(nodesEnter);\n\n // transition the nodes (circles & text)\n nodesUpdate.transition().duration(2000)\n .attr(\"transform\", function(d) { return \"translate(\" + project(d.x, d.y) + \")\"; })\n .style(\"opacity\", function(d) { return !d.hidden ? 1 : 0} )\n .on(\"end\", function(d) {d.hidden ? d3.select(this).attr(\"display\", \"none\"): \"\"})\n .on(\"start\", function(d) {!d.hidden ? d3.select(this).attr(\"display\", \"\"): \"\"});\n\n nodesUpdate.select(\"text\")\n .attr(\"x\", function(d) { return d.x < 180 === !d.children ? 6 : -6; })\n .text(function(d) {return d.data.name; })\n // we could also tween the anchor see chapter 2\n .style(\"text-anchor\", function(d) {\n // for the right side\n if (d.x < 180 && d.children) return \"end\"\n else if (d.x < 180 && !d.children) return \"start\"\n // for the left side\n else if (d.x >= 180 && !d.children) return \"end\"\n else if (d.x >= 180 && d.children) return \"start\"\n })\n .transition().duration(2000)\n .attr(\"transform\", function(d) {\n // called once to determine the target value, and tween the values\n return \"rotate(\" + (d.x < 180 ? d.x - 90 : d.x + 90) + \")\";\n })\n }", "function updateTrees(){\r\n \r\n for(var count = 0 ; count < TREE_NUM ; count++){\r\n var tree = trees[count];\r\n tree.update(lorn.getSense(true), PARALLAX);\r\n \r\n // reuse trees when they are out of the bounds\r\n if(tree.image.x < -(canvasW * 0.5)){\r\n tree.image.x = canvasW + canvasW * 0.25;\r\n }\r\n if(tree.image.x > canvasW + canvasW * 0.5){\r\n tree.image.x = -(canvasW * 0.25)\r\n }\r\n }\r\n}", "setAncestors() {\n\t\t \tvar thisDataSource = this;\n\t\t \tvar addedClient = false;\n\t\t \t_.forEach(thisDataSource.nodes, function(node) {\n\t\t \t\tnode.ancestors = thisDataSource.ancestors_struct[node.id] || [];\n\t\t \t\tif (_.isEmpty(node.ancestors) === false) {\n\t\t \t\t\tnode.parent = node.ancestors[0];\n\t\t \t\t} else {\n\t\t \t\t\tif (_.includes(thisDataSource.children_struct.topLevel, node.id) == false) {\n\t\t \t\t\t\t//container has no parent\n\t\t \t\t\t\t//adding to client\n\t\t \t\t\t\tnode.ancestors.push(\"client\");\n\t\t \t\t\t\tthisDataSource.ancestors_struct[node.id] = [\"client\"];\n\t\t \t\t\t\tif (addedClient === false) {\n\t\t \t\t\t\t\taddedClient = true;\n\t\t\t \t\t\t\tthisDataSource.children_struct.topLevel.push(\"client\");\n\t\t \t\t\t\t\tthisDataSource.children_struct['client'] = [];\n\t\t \t\t\t\t}\n\t\t \t\t\t\tthisDataSource.children_struct['client'].push(node.id);\n\t\t\t \t\t}\n\t\t \t\t}\n\t\t \t})\n\t\t }", "update_children(){\n let children = this.get_children_objects()\n for (var i = 0; i < children.length; i++) {\n children[i].set_parent_node(this);\n }\n this.notify_fragment_dirty();\n }", "saveNodesPositions() {\n if (this.visualization && this.visualization.getNodesPositions) {\n const nodes = this.visualization.getNodesPositions();\n this.props.actions.setVisualizationNodesPosition(this.props.visualizationKey, nodes);\n }\n }", "function setNodesPosition(nodes) {\n var deferred = $.Deferred();\n if ( nodes.length == 0 ) { deferred.resolve(); return deferred.promise(); }\n var lab_filename = $('#lab-viewport').attr('data-path');\n var form_data = [];\n form_data=nodes;\n var url = '/api/labs' + lab_filename + '/nodes' ;\n var type = 'PUT';\n $.ajax({\n cache: false,\n timeout: TIMEOUT,\n type: type,\n url: encodeURI(url),\n dataType: 'json',\n data: JSON.stringify(form_data),\n success: function (data) {\n if (data['status'] == 'success') {\n logger(1, 'DEBUG: node position updated.');\n deferred.resolve();\n } else {\n // Application error\n logger(1, 'DEBUG: application error (' + data['status'] + ') on ' + type + ' ' + url + ' (' + data['message'] + ').');\n deferred.reject(data['message']);\n }\n },\n error: function (data) {\n // Server error\n var message = getJsonMessage(data['responseText']);\n logger(1, 'DEBUG: server error (' + data['status'] + ') on ' + type + ' ' + url + '.');\n logger(1, 'DEBUG: ' + message);\n deferred.reject(message);\n }\n });\n return deferred.promise();\n}", "function exposeSiblingNodes(exposing_nodes) {\n var d = document;\n var listNode = $element.find('.dataList')[0];\n\n // clear existing list\n while (listNode.firstChild) {\n listNode.removeChild(listNode.firstChild);\n }\n\n exposing_nodes.forEach(function (node) {\n var listElementNode = d.createElement(\"LI\");\n listElementNode.dataset.mit_tooltip = node.id;\n var imgNode = d.createElement('img');\n imgNode.src = node.img_url;\n imgNode.alt = node.id + ', ' + node.position + ', ' + node.company.name;\n imgNode.onclick = function () {\n handleMouseClickNode(node);\n };\n imgNode.addEventListener(\"mouseover\", function () {\n mouse_events.handleMouseOverNode(node, divTooltip, svg);\n });\n imgNode.addEventListener(\"mouseout\", function () {\n mouse_events.handleMouseOutNode(node, divTooltip, svg);\n });\n\n listElementNode.appendChild(imgNode);\n listNode.appendChild(listElementNode);\n })\n }" ]
[ "0.61790544", "0.61105037", "0.596654", "0.5902017", "0.58920354", "0.5835467", "0.58043253", "0.57917565", "0.5741501", "0.57403207", "0.567706", "0.563775", "0.561289", "0.5568379", "0.556793", "0.55645645", "0.55585444", "0.5557802", "0.55332965", "0.5519979", "0.55150294", "0.5494322", "0.549379", "0.5476601", "0.5450462", "0.54378676", "0.5409763", "0.5408988", "0.5407839", "0.538912", "0.5388362", "0.5374128", "0.53562707", "0.53544843", "0.53513646", "0.5345918", "0.53445286", "0.5327193", "0.53220356", "0.53203106", "0.5313923", "0.5308316", "0.52932686", "0.5290625", "0.52890974", "0.52761286", "0.52596164", "0.52541465", "0.5238138", "0.523102", "0.52247137", "0.5222866", "0.52152085", "0.5208145", "0.52073544", "0.52055395", "0.52046275", "0.51900774", "0.51871085", "0.51743513", "0.5158668", "0.5155831", "0.5153537", "0.5145527", "0.5143862", "0.5140379", "0.51378274", "0.51340264", "0.51319236", "0.5131182", "0.5127163", "0.5126626", "0.51245403", "0.5122604", "0.51185393", "0.511297", "0.51116043", "0.5108076", "0.5107009", "0.5099039", "0.50980335", "0.5097539", "0.50915104", "0.5090549", "0.5090335", "0.5090055", "0.5089356", "0.50850064", "0.5084071", "0.507962", "0.5075569", "0.50656396", "0.50631136", "0.5062495", "0.5059106", "0.5046546", "0.50438553", "0.5043844", "0.50417364", "0.5040958" ]
0.6971496
0
This widget won't work if twitter's script element is inside Muuri's item a workaround is to append the script in the body then after rendering the widget the script won't be needed, remove the script
async initialize(config) { this.url = config.url; this.appendWidgetScript(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadTwitterScript() {\r\n let script = document.createElement('script');\r\n let timeline = $(\"#twitter-timeline\");\r\n let cb = () => {\r\n // When the script is loaded we bind to the widget rendering event to display it\r\n twttr.events.bind(\"rendered\", (event) => {\r\n timeline.addClass(\"rendered\");\r\n });\r\n }\r\n\r\n script.src = \"https://platform.twitter.com/widgets.js\"\r\n script.onload = cb;\r\n document.head.append(script);\r\n }", "componentDidMount() {\n const script = document.createElement('script');\n\n script.src = 'https://platform.twitter.com/widgets.js';\n script.async = true;\n\n if (document && document.body) {\n document.body.appendChild(script);\n }\n }", "setTwitterWidget(id) {\n // offsetHeight is outer, scrollHeight is inner\n this.div.innerHTML = ''\n const renderTweet = () => { \n window.twttr.widgets.createTweetEmbed(\n id,\n this.div,\n { align: 'center', cards: 'hidden', conversation: 'none' }\n )\n }\n\n if (window.twttr) {\n renderTweet()\n } else {\n this.appendScript(widgetJS, renderTweet)\n }\n }", "function twitterEmbed() {\n //following converts html from Twitter embed into jquery to build on the fly so not hardcoded into html\n $(\"<a class=twitter-timeline href=https://twitter.com/jessimagallon?ref_src=twsrc%5Etfw>\").append(\"Tweets by jessimagallon\").append(\n $(\"<script async src=https://platform.twitter.com/widgets.js charset=utf-8>\")\n ).appendTo(\"#twitter-list\");\n}", "createAsyncCallScript(widget, count) {\n\t\t\t\n let currentScript = document.getElementById('usnge-main-widget-script');\n let currentScriptSrc = currentScript.getAttribute('src');\n let modifiedSource = currentScriptSrc.split('widgets.js');\n let contentScript = document.createElement('script');\n let documentHead = document.getElementsByName('body');\n currentScript.insertAdjacentElement('afterend', contentScript);\n contentScript.setAttribute('async' , 'true'); \n contentScript.setAttribute('src', `${modifiedSource[0]}${widget}${'.js'}`);\n contentScript.setAttribute('widget-name', widget);\n contentScript.setAttribute('count', count);\n contentScript.setAttribute('id','usnge-markup-call-script');\n }", "injectWidget(){\n var id = parseInt(this.state.id)-1;\n const script = document.createElement(\"script\");\n script.src = \"https://test-ancil-overlay.herokuapp.com/v1/funnel/display.js?agent_id=test&session_id=\"+id;\n console.log(script.src)\n script.async = true;\n document.body.appendChild(script);\n }", "function applyAddThis()\n{\n var script = '//s7.addthis.com/js/300/addthis_widget.js#domready=1';\n if (window.addthis) {\n window.addthis = null;\n window._ate = null;\n }\n $.getScript(script);\n}", "function clipkitScriptTag()\n {\n var js_clipkit_story = $(\".js_clipkit_story\");\n if(js_clipkit_story.length > 0)\n {\n var str = js_clipkit_story.val();\n var n = str.search(\"script\");\n // </script> exists\n if(n > -1)\n {\n swal(\"Oops...\", \"Remove <script>...</script> from Clipkit code textarea\", \"error\");\n return false;\n }\n\n }\n return true;\n }", "function addShareButtons(){\n \n // Loads the script for the share buttons\n let script = document.createElement('script');\n \n script.setAttribute(\"type\",\"text/javascript\");\n script.setAttribute(\"src\",\"//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-61101a2423e8f106\");\n\n document.body.appendChild(script);\n\n}", "function addscript(){\n var footer = document.getElementById('footer');\n var tagScript = document.createElement('script');\n tagScript.src = \"//c.fqtag.com/tag/implement-r.js?org=TksRHGen5rmjsG48m9pC&p=bamfordsTestPage&a=testpage&cmp=adframe2&fmt=banner&dmn=http://any.dominayoulike.com/thiswont/doanything&rt=display&sl=1&fq=1&ad=adframe2\";\n footer.appendChild(tagScript);\n}", "createScript() {\n if (this.htmlElementsDom.getElementsByClassName(\"microfrontend_script\") != null) {\n\n for (let el of this.htmlElementsDom.getElementsByClassName(\"microfrontend_script\")) {\n let script = document.createElement(\"script\")\n script.setAttribute(\"type\", 'module');\n script.src = el.src;\n this.appendChild(script);\n }\n }\n\n }", "function ticketMaster(passIn) {\n var newWidget = widgetTemplate.clone();\n newWidget.html(\"\");\n newWidget.attr(\"w-keyword\", passIn);\n $(\"#ticketContent\").prepend(newWidget);\n\n $.getScript(\"https://ticketmaster-api-staging.github.io/products-and-docs/widgets/event-discovery/1.0.0/lib/main-widget.js\");\n}", "initScript() {\n if (!this.element.dataset.scripturl) {\n return;\n }\n\n const cachebuster = new Date().getTime();\n const url = `${this.element.dataset.scripturl}?component_id=${this.id}#${cachebuster}`\n const newScriptTag = document.createElement('script');\n newScriptTag.setAttribute('defer', '');\n newScriptTag.setAttribute('type', 'module');\n newScriptTag.setAttribute('src', url);\n \n\n this.script = document.head.appendChild(newScriptTag);\n }", "function buildTwitterButton () {\n try {\n \t$(\".twitter-share-button[data-twttr-rendered!=true]\").each(function(){\n\t\t\ttwttr.widgets.load(this.parentNode);\n\t\t});\n } catch (ex) {\n twitterTimeout = setTimeout(buildTwitterButton, 50);\n }\n}", "function callback( json ) {\n\tif( json.post_id !== undefined) {\n\t\tvar script_id = 'plwidget-' + json.post_id;\n\t\tvar script_element = document.getElementById( script_id );\n\t\t\n\t\t// create the iframe element\n\t\tvar iframe = document.createElement('iframe');\n\t\tiframe.src = json.widget_url;\n\n\t\tiframe.width = json.width;\n\t\tiframe.height = json.height;\n\t\t\n\t\tvar css = document.createElement( 'style' );\n\t\tcss.innerHTML = json.css || '';\n\t\tvar widget = document.createElement( 'div' );\n\t\twidget.className = 'pls_embedded_widget_wrapper ' + (json.widget_class || '');\n\t\twidget.appendChild(iframe);\n\t\twidget.innerHTML = (json.before_widget || '') + widget.innerHTML + (json.after_widget || '');\n\t\twidget.insertBefore(css, widget.childNodes[0]);\n\t\t\n\t\t// insert the iframe next to the script\n\t\tscript_element.parentNode.insertBefore( widget, script_element );\n\t\t\n\t\tif( undefined !== json.before_widget ) {\n\t\t\tpl_regex_matcher( json.before_widget );\n\t\t}\n\t\tif( undefined !== json.after_widget ) {\n\t\t\tpl_regex_matcher( json.after_widget );\n\t\t}\n\t}\n\t\n}", "function injectScript() {\n /* globals API */\n\n function updateMedia() {\n var media;\n\n if (!document.getElementById(\"scroblr-artist\")) {\n return false;\n }\n\n if (window.API && API.getDJ().length !== 0) {\n media = API.getMedia();\n }\n\n if (media) {\n document.getElementById(\"scroblr-artist\").value = media.author;\n document.getElementById(\"scroblr-duration\").value = media.duration * 1000;\n document.getElementById(\"scroblr-title\").value = media.title;\n } else {\n document.getElementById(\"scroblr-artist\").value = \"\";\n document.getElementById(\"scroblr-duration\").value = 0;\n document.getElementById(\"scroblr-title\").value = \"\";\n }\n }\n\n window.setTimeout(function () {\n updateMedia();\n window.setInterval(updateMedia, 5000);\n }, 3000);\n}", "function loadTwitterWidget() {\n\t\tif (!twitter_loaded) {\n\t\t\ttry {\n\t\t\t\ttwttr.widgets.load(document.getElementById(\"twitter\"));\n\t\t\t\ttwitter_loaded = true;\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e);\n\t\t\t}\n\t\t}\n\t}", "removeWebSharebutton() \n {\n $(\".webshare-list-item\").remove();\n }", "injectInteractionScript(){\n let script = document.createElement('script');\n script.src = apis.extension.getURL(INJECTION_SCRIPT_FILENAME);\n (document.head||document.documentElement).appendChild(script);\n script.onload = () => script.remove();\n }", "function writeScript(token) {\n var oldScript = document.getElementById('instagram-script');\n if (!!oldScript) {\n oldScript.parentElement.removeChild(oldScript);\n }\n var requestURL = mediaURL + token + '&callback=' + callback;\n\n var script = document.createElement(\"script\");\n script.src = requestURL;\n script.id = 'instagram-script';\n document.body.appendChild(script);\n}", "function updateDashboard(json) {\n\n //var widgets = xml.getElementsByTagName(\"widget\");\n var widgets = json.widgets;\n\n document.getElementById(\"dashboard\").innerHTML = \"\";\n document.getElementById(\"scripts\").innerHTML = \"\";\n\n for (var i = 0; i < widgets.length; i++) {\n\n\n document.getElementById(\"dashboard\").innerHTML += widgets[i].html;\n\n\n var js = widgets[i].script;\n if (js != null) {\n var script = document.createElement(\"script\");\n script.src = js;\n script.type = \"text/javascript\";\n document.getElementById(\"scripts\").appendChild(script);\n }\n }\n\n}", "function addPubAppend() {\n var s = document.createElement(\"script\");\n s.type = \"text/javascript\";\n s.src = \"//cdn.adjs.net/publisher.append.ad.min.js\";\n //find specific location to insert (right after first iframe, in same div)\n document.getElementsByTagName(\"head\")[0].appendChild(s);\n // alert(\"Injected publisher append script!\");\n}", "function disableScript( elem ) {\n elem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n return elem;\n }", "function TELUGU_elementsExtraJS() {\n // screen (TELUGU) extra code\n }", "function disableScript(elem) {\n elem.type = (jQuery.find.attr(elem, \"type\") !== null) + \"/\" + elem.type;\n return elem;\n }", "createCodeTag(data, scriptTitleEncoded, scriptTitle ) {\n\n const code = JSON.stringify(data); //values stored in cookie\n\n if(code.length > 0){\n\n const codeContent = data.code_title;\n const codePos = data.code_position;\n const codeTag = data.code_tag;\n\n let codeItem = \"\";\n\n if(codeTag === 'noscript'){\n // insertAdjacentHTML with script does not execute script after include\n // codeItem = '<noscript data-title=\"'+scriptTitle.trim()+'\" data-tcb=\"'+scriptTitleEncoded+'\" data-position=\"tcb-' + codePos + '\" >' +\n // codeContent.trim() +\n // '</noscript>';\n codeItem = document.createElement(\"noscript\");\n }\n else {\n // insertAdjacentHTML with script does not execute script after include\n // codeItem = '<script type=\"text/javascript\" data-title=\"'+scriptTitle.trim()+'\" data-tcb=\"'+scriptTitleEncoded+'\" data-position=\"tcb-' + codePos + '\" async >' +\n // codeContent.trim() +\n // '</script>';\n codeItem = document.createElement(\"script\");\n codeItem.setAttribute('type', 'text/javascript');\n }\n\n // tag attributes\n codeItem.setAttribute('data-title', scriptTitle.trim());\n codeItem.setAttribute('data-tcb', scriptTitleEncoded);\n codeItem.setAttribute('data-position', codePos);\n\n // inner tag code\n codeItem.innerHTML = codeContent.trim();\n\n //add script to head tag\n if(codePos === 'head'){\n // insertAdjacentHTML with script does not execute script after include\n // document.head.insertAdjacentHTML('beforeend', codeItem);\n document.head.append(codeItem);\n }\n //add script to body at the beginning\n else if(codePos === 'body-top'){\n // insertAdjacentHTML with script does not execute script after include\n // document.body.insertAdjacentHTML('afterbegin', codeItem);\n document.body.prepend(codeItem);\n }\n //add script to body at the end\n else {\n // insertAdjacentHTML with script does not execute script after include\n // document.body.insertAdjacentHTML('beforeend', codeItem);\n //const head = document.getElementsByTagName('body')[0];\n document.body.appendChild(codeItem);\n }\n }\n }", "function TermsServices_elementsExtraJS() {\n // screen (TermsServices) extra code\n\n }", "function findScript(t,r){var o=document.querySelector('script[src=\"'.concat(t,'\"]'));if(o===null)return null;var a=createScriptElement(t,r),u=o.cloneNode();if(delete u.dataset.uidAuto,Object.keys(u.dataset).length!==Object.keys(a.dataset).length)return null;var d=!0;return Object.keys(u.dataset).forEach(function(g){u.dataset[g]!==a.dataset[g]&&(d=!1)}),d?o:null}", "function findScript(t,r){var o=document.querySelector('script[src=\"'.concat(t,'\"]'));if(o===null)return null;var a=createScriptElement(t,r),u=o.cloneNode();if(delete u.dataset.uidAuto,Object.keys(u.dataset).length!==Object.keys(a.dataset).length)return null;var d=!0;return Object.keys(u.dataset).forEach(function(g){u.dataset[g]!==a.dataset[g]&&(d=!1)}),d?o:null}", "static async manage() {\n if (!!!_PROPERTIES_.get(this))\n _PROPERTIES_.set(this, Object.create(null))\n\n // document.currentScript still works when called from a non-module script.\n let script = _PROPERTIES_.get(this).script = document.currentScript;\n\n await this.template;\n\n let tag = this.is;\n if (script.hasAttribute('tagname'))\n tag = script.getAttribute('tagname') || tag;\n\n customElements.define(tag, this);\n\n }", "function downloadJSAtOnload(){var e=document.createElement(\"script\");e.src=\"https://cdn.rawgit.com/Arlina-Design/quasar/23207858/arlinablock.js\",document.body.appendChild(e)}", "static loadScript() {\n //Si notre script n'est pas en train de charger\n if (!Video.scriptIsLoading) {\n Video.scriptIsLoading = true; //Charger le script\n\n const script = document.createElement('script'); //Crée la balise script\n script.src = 'https://www.youtube.com/iframe_api'; //Changer sa propriété src pour celui du youtube\n document.body.appendChild(script); //Injecter la balise script dans le body\n }\n }", "function getDeleteFunction(removeString, widgetType, widgetId, widgetConstructors)\n{\n\tvar deleteFunction = function(e)\n\t{\n\t\tvar targetDom = e.target.ownerDocument;\t\t\t\t\t\n\t\tvar scriptTags = targetDom.getElementsByTagName(\"script\");\n\t\tfor( var i = 0; i < scriptTags.length; i++ )\n\t\t{\n\t\t\tvar str = scriptTags[i].innerHTML;\n\t\t\tvar index = str.indexOf(removeString);\n\t\t\tif( index >= 0 )\n\t\t\t{\n\t\t\t\tvar strBefore = str.substr(0, index);\n\t\t\t\tvar strAfter = str.substr(index+removeString.length);\n\t\t\t\twhile( strBefore.length > 0 && ( strBefore.charAt(strBefore.length-1) == ' ' ||\n\t\t\t\t\t\t\t\t\t\t\t\tstrBefore.charAt(strBefore.length-1) == '\\t' ||\n\t\t\t\t\t\t\t\t\t\t\t\tstrBefore.charAt(strBefore.length-1) == '\\n' ||\n\t\t\t\t\t\t\t\t\t\t\t\tstrBefore.charAt(strBefore.length-1) == '\\r' ) )\n\t\t\t\t{\n\t\t\t\t\tstrBefore = strBefore.substr(0, strBefore.length-1);\n\t\t\t\t}\n\t\t\t\t// We'll store the new InnerHTML to newInnerHTML and we'll decide later whether we'll replace the inner value with this\n\t\t\t\t// one or we'll simply remove the SCRIPT tag.\n\t\t\t\tvar newInnerHTML = strBefore + strAfter;\n\n\t\t\t\t// Look if there is any valid JS code remining in the SCRIPT tag; of empty (or only comments were found) => go and remove it\n\t\t\t\tvar tempInnerHTML = newInnerHTML;\n\t\t\t\tif (tempInnerHTML && tempInnerHTML.replace)\n\t\t\t\t{\n\t\t\t\t\ttempInnerHTML = tempInnerHTML.replace(/[\\r\\n]*(?:\\<\\!\\-\\-|\\/\\/\\-\\-\\>)[\\r\\n]*/gi, \"\");\n\t\t\t\t\ttempInnerHTML = tempInnerHTML.replace(/[\\r\\n\\s\\t]*/gi, \"\")\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If the InnerHTML is empty, we'll remove the entire SCRIPT tag.\n\t\t\t\tif (tempInnerHTML === \"\")\n\t\t\t\t{\n\t\t\t\t\tscriptTags[i].outerHTML = \"\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tscriptTags[i].innerHTML = newInnerHTML;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Get WidgetManager instance\n\t\t\t\tvar widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(targetDom);\n\n\t\t\t\t// Search for widgets of the same type in the page, but different from the current one (compared by ID)\n\t\t\t\tvar count = 0;\n\t\t\t\tvar allWidgets = widgetMgr.getAllWidgets(widgetType);\n\t\t\t\tfor (var widget in allWidgets) {\n\t\t\t\t\tif (widget != widgetId)\n\t\t\t\t\t{\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (count == 0)\n\t\t\t\t{\n\t\t\t\t\t// There are no more widgets remaining in the page of the current type, we'll remove the assets as well\n\t\t\t\t\tvar cons = widgetConstructors[widgetType];\n\t\t\t\t\tif (!cons)\n\t\t\t\t\t cons = widgetConstructors[\"Spry.Widget.Base\"];\n\t\t\t\t\tvar assets = cons.getAssets();\n\t\t\t\t\t\n\t\t\t\t\tvar tags = new Array();\n\t\t\t\t\ttags = tags.concat(targetDom.getElementsByTagName(\"script\"));\n\t\t\t\t\ttags = tags.concat(targetDom.getElementsByTagName(\"link\"));\n\t\t\t\t\t\n\t\t\t\t\tfor (var j=0; j<tags.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tag = tags[j];\n\t\t\t\t\t\tif (tag && tag.getAttribute)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Get the value to search; the attribute is different according to tag name: script or link\n\t\t\t\t\t\t\tvar valueToSearch = tag.getAttribute(\"src\");\n\t\t\t\t\t\t\tif (!valueToSearch)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalueToSearch = tag.getAttribute(\"href\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Once we have a value, we test it against all assets\n\t\t\t\t\t\t\tif (valueToSearch)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor (var k=0; k<assets.length; k++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (assets[k].type)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// If the current tag's value matches an asset we'll remove the tag from page\n\t\t\t\t\t\t\t\t\t\tif (valueToSearch.match && valueToSearch.match(new RegExp(\"(?:^|[\\\\/\\\\\\\\])\" + dwscripts.escRegExpChars(assets[k].file) + \"$\", \"gi\")))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\ttag.outerHTML = \"\";\n\t\t\t\t\t\t\t\t\t\t\tbreak;\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}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\treturn deleteFunction;\n}", "function setSocialButtons() {\n /*--------------- JavaScript to get social buttons -----------------------*/\n if ($('#socialnetcontrol').length > 0) {\n !function (d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)) {\n js = d.createElement(s); js.id = id; js.src = \"//platform.twitter.com/widgets.js\"; fjs.parentNode.insertBefore(js, fjs);\n }\n }(document, \"script\", \"twitter-wjs\");\n (function () {\n var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;\n po.src = 'https://apis.google.com/js/plusone.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);\n })();\n }\n}", "function disableScript( elem ) {\n elem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n return elem;\n }", "function disableScript( elem ) {\n elem.type = (jQuery.find.attr( elem, \"type\" ) !== null) + \"/\" + elem.type;\n return elem;\n }", "function scriptLoadHandler()\n {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n\n // Call widgets init function\n init(); \n }", "render(tp, params={}) {\n if (tp.nodeType==1 && tp.tagName==\"TEMPLATE\") {\n tp=tp.content; //templates are not valid just its content\n }\n //for the templates we let original unmodified\n if (tp.nodeType==11) tp=tp.cloneNode(true);\n\n let scriptElements=[];\n if (tp.tagName==\"SCRIPT\") scriptElements.push(tp); //For when there is no descendents\n else scriptElements=Array.from(tp.querySelectorAll(\"SCRIPT\")); //inner elements\n scriptElements.forEach(scriptElement => {\n //To avoid script execution limitation for the request we make a copy of the script to a \"brand new\" script node\n //Also to execute script <script> for an already loaded element when we use render\n const myScript=document.createElement(\"SCRIPT\");\n for (const at of scriptElement.attributes) {\n myScript.setAttribute(at.name, at.value);\n }\n //adding scope (encapsulation) so this variables are local and can't be modified from another scripts.\n //Also async type allows awiat in scripts\n myScript.textContent=\"(async (thisElement, thisNode, thisParams)=>{\" + scriptElement.textContent + \"})(document.currentScript.previousElementSibling, document.currentScript.thisNode, document.currentScript.thisParams);\";\n myScript.thisNode=this;\n myScript.thisParams=params;\n const container=scriptElement.parentNode; // !!Document Fragment is not an Element => *parentNode*\n container.insertBefore(myScript, scriptElement);\n container.removeChild(scriptElement);\n });\n return tp;\n }", "function addScript(u){ \n var s=document.createElement('script'); \n s.src=u; \n document.getElementsByTagName('*')[1].appendChild(s);\n }", "function disableScript(elem) {\n elem.type = ( elem.getAttribute(\"type\") !== null ) + \"/\" + elem.type;\n return elem;\n }", "function BaixarOrdemTelefone_elementsExtraJS() {\n // screen (BaixarOrdemTelefone) extra code\n\n }", "ord_renderContent () {\n return (\n <div className=\"p_crVideo\">\n <div id=\"fb-root\" />\n <Helmet>\n <script async={true} src=\"https://platform.twitter.com/widgets.js\" charSet=\"utf-8\" />\n <script>\n {`window.fbAsyncInit = function() {\n FB.init({\n appId : '2317676415144125',\n autoLogAppEvents : true,\n xfbml : true,\n version : 'v3.2'\n });\n }`}\n </script>\n <script>\n {`(function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2';\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'))`}\n </script>\n <script>\n {`\n var tag = document.createElement('script');\n tag.src = \"https://www.youtube.com/iframe_api\";\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n\n var player;\n function onYouTubeIframeAPIReady() {\n player = new YT.Player('main_player', {\n events: {\n 'onStateChange': onPlayerStateChange\n }\n });\n }\n\n function onPlayerStateChange(event) {\n switch(event.data) {\n case YT.PlayerState.PLAYING:\n analytics.track('VIDEO_PLAYED', {\n name: 'CR Promo - Nov 2018',\n url: '${location.href}',\n action: 'PLAY',\n video: player.getVideoData().title,\n id: player.getVideoData().video_id,\n duration: player.getDuration()\n })\n break;\n case YT.PlayerState.PAUSED:\n analytics.track('VIDEO_PLAYED', {\n name: 'CR Promo - Nov 2018',\n url: '${location.href}',\n action: 'PAUSE',\n video: player.getVideoData().title,\n id: player.getVideoData().video_id,\n pausedAt: player.getCurrentTime()\n })\n break;\n case YT.PlayerState.ENDED:\n analytics.track('VIDEO_PLAYED', {\n name: 'CR Promo - Nov 2018',\n url: '${location.href}',\n action: 'END',\n video: player.getVideoData().title,\n id: player.getVideoData().video_id,\n duration: player.getDuration()\n })\n break;\n default:\n return;\n }\n }`}\n </script>\n </Helmet>\n <div className=\"ebp-header-divider\" />\n <div className=\"p_admin_index ebp-wrap\">\n <div className=\"d_box\">\n <div className=\"p_admin_content\">\n {this.buildHeader()}\n {this.buildContent()}\n {this.buildTasks()}\n <div className=\"share-icons\">\n <span>SHARE</span>\n <div id=\"twitter_share\" className=\"share-container\" onClick={() => analytics.track('SOCIAL_SHARE_CLICKED', {\n type: 'TWITTER',\n url: location.href\n })}>\n <a onClick={() => {\n const win = window.open('https://twitter.com/share?ref_src=twsrc%5Etfw', 'ShareOnWitter', this.getWindowOptions())\n win.opener = null\n }}>\n <Icon type=\"twitter\" style={{ fontSize: 32}} />\n </a>\n </div>\n <div id=\"facebook_share\" className=\"share-container\" onClick={() => analytics.track('SOCIAL_SHARE_CLICKED', {\n type: 'FACEBOOK',\n url: location.href\n })}>\n <a onClick={() => {\n FB.ui({\n method: 'share',\n display: 'popup',\n href: 'https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.facebook.com%2FElastosCyberRepublic%2F&amp;src=sdkpreparse'\n }, (response) => { })\n }}>\n <Icon type=\"facebook\" style={{ fontSize: 32}} />\n </a>\n </div>\n <div className=\"share-container\" onClick={() => analytics.track('SOCIAL_SHARE_CLICKED', {\n type: 'TELEGRAM',\n url: location.href\n })}>\n <a href=\"https://t.me/elastosgroup\" target=\"_blank\">\n <TelegramIcon style={{ fill: '#333333' }} />\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n <Footer/>\n </div>\n )\n }", "function BaixarOrdemTV_elementsExtraJS() {\n // screen (BaixarOrdemTV) extra code\n\n }", "function disableScript( elem ) {\n elem.type = (jQuery.find.attr( elem, \"type\" ) !== null) + \"/\" + elem.type;\n return elem;\n}", "function disableScript( elem ) {\n elem.type = (jQuery.find.attr( elem, \"type\" ) !== null) + \"/\" + elem.type;\n return elem;\n}", "function disableScript( elem ) {\n elem.type = (jQuery.find.attr( elem, \"type\" ) !== null) + \"/\" + elem.type;\n return elem;\n}", "function injectScript() {\n /* globals _jm, _jp */\n\n function updateMedia() {\n var manager, media, sound;\n\n manager = _jp.soundManager;\n media = _jm.song_info;\n sound = manager.sounds[manager.soundIDs[manager.soundIDs.length - 1]];\n\n document.getElementById(\"scroblr-artist\").value = media.artist || \"\";\n document.getElementById(\"scroblr-duration\").value = sound.duration || 0;\n document.getElementById(\"scroblr-elapsed\").value = sound.position || 0;\n document.getElementById(\"scroblr-title\").value = media.song || \"\";\n }\n\n window.setTimeout(function () {\n updateMedia();\n window.setInterval(updateMedia, 5000);\n }, 3000);\n}", "function load_custombb () {\n document.querySelectorAll('span[style=\"color:resimg\"]').forEach(e => {\n $(e).replaceWith(`<img src=\"https://${e.innerHTML}\"></img>`);\n });\n document.querySelectorAll('span[style=\"color:reshighlight\"]').forEach(e => {\n $(e).replaceWith(`<mark>${e.innerHTML}</mark>`);\n });\n document.querySelectorAll('span[style=\"color:resleft\"]').forEach(e => {\n $(e).replaceWith(`<p align=\"left\">${e.innerHTML}</p>`);\n });\n document.querySelectorAll('span[style=\"color:resright\"]').forEach(e => {\n $(e).replaceWith(`<p align=\"right\">${e.innerHTML}</p>`);\n });\n document.querySelectorAll('a[href^=\"https://gist.github.com/\"]').forEach(e => {\n var url = encodeURI('data:text/html;charset=utf-8,<body><script src=\"' + $(e).attr(\"href\") + \".js\" + '\"></script></body>');\n $(e).append(`<br><iframe src='` + url + `' width=\"100%\" height=\"400\" scrolling=\"auto\" frameborder=\"no\" align=\"center\"></iframe>`);\n });\n }", "addScript(script) { \n this.scripts.push(script);\n }", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}", "function disableScript( elem ) {\n\telem.type = ( jQuery.find.attr( elem, \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}" ]
[ "0.7027387", "0.6657876", "0.662013", "0.6569377", "0.64639616", "0.61946857", "0.60226387", "0.5974326", "0.5954488", "0.59468216", "0.5897612", "0.57864773", "0.5774971", "0.5735202", "0.5723938", "0.57057834", "0.56732565", "0.56584907", "0.56492054", "0.5604597", "0.5521958", "0.55116254", "0.5489038", "0.54770005", "0.54401356", "0.5427108", "0.5426144", "0.5416015", "0.5416015", "0.54135203", "0.54098296", "0.5396698", "0.5386623", "0.5376801", "0.5375276", "0.53401613", "0.53363955", "0.5335356", "0.5325297", "0.53093207", "0.53086275", "0.5305318", "0.5302655", "0.52944136", "0.52944136", "0.52944136", "0.52943015", "0.528197", "0.527876", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735", "0.5275735" ]
0.0
-1
Function co mot tham so In ra dong chu xin chao ai do
function sayHello1(name) { console.log("xin chao ban " + name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function play()\n{\n // Ajoute un son aleatoire a la sequence (lettre)\n sequence = \"BVRJB\"\n\n // Joue la sequence\n i = 0;\n const metronome = setInterval( function () {\n joueSon(sequence[i++]);\n if (i >= sequence.length) clearInterval(metronome);\n }, 1000);\n\n // Attend que le joueur la sequence \n\n // Si le joueur se trompe, fin du jeu\n\n // sinon on recommence\n}", "function convertidor(text) {\n let convrtm = text.toLowerCase();\n let frLett = convrtm.charAt(0);\n let convrtM = frLett.toUpperCase();\n let restTxt = convrtm.substr(1,9999);\n console.log(`Your converted phrase is: ${convrtM}${restoTxt}`);\n // console.log(`Su frase convertida es: ${convrtM}${restoTxt}`);\n // console.log(`Sua frase convertida é: ${convrtM}${restoTxt}`);\n // console.log(`Sa phrase convertie est: ${convrtM}${restoTxt}`);\n }", "function process(msg) {\n var p = Math.round(100 * twss.prob(msg));\n var t = \"THAT'S WHAT SHE SAID ! (c'est sur à \" + p + \"% !)\";\n bot.log(msg + ' -> ' + p + '%');\n if (matchIUT(msg)) {\n client.say(channel, \"C'EST NORMAAAAAL A L'IUTTTTTTT\");\n } else if (twss.is(msg)) {\n client.say(channel, t);\n }\n}", "function BOT_translateEmoteDivalite(emote) {\r\n\tvar m,c,f,s; // movie, textcolor, textfont textsize\r\n\tswitch (emote){\r\n \t\tcase \"HELLO\":\r\n {m = \"hello\"; \t\tc=\"Brown\";\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;} // s = \"20px\";\r\n \t\tcase \"BYE\":\r\n {m = \"bye\"; \t\tc=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"HAPPY\":\r\n {m = \"happy\"; \t\tc=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\";\t\t\tbreak;}\t\r\n \t\tcase \"SAD\":\r\n {m = \"sad\"; \t\tc=\"DarkGreen\"; \tf =\"Ravie\";\t\t\ts = \"\";\t\t\tbreak;}\r\n \t\tcase \"SORRY\":\r\n {m = \"sorry\"; \t\tc=\"DarkCyan\"; \t\tf =\"Ravie\";\t\t\ts = \"\";\t\t\tbreak;}\r\n \t\tcase \"PUZZLED\":\r\n {m = \"scratchhead\"; c=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"WARNING\":\r\n {m = \"warning\"; \tc=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"WORRIED\":\r\n {m = \"warning\"; \t c=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"SURPRISED\":\r\n {m = \"surprised\"; \tc=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"CONFUSED\":\r\n {m = \"scratchhead\"; c=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"THINKING\":\r\n {m = \"warning\"; \t c=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"ANGRY\":\r\n {m = \"angry\"; \t\tc=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"FEAR\":\r\n {m = \"fear\"; \t\tc=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"PROUD\":\r\n {m = \"armsfolded\"; c=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n\t\tcase \"YES\":\r\n {m = \"headyes\"; \t c=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"NO\":\r\n {m = \"headno\"; \t c=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"THANKS\":\r\n {m = \"headyes\"; \t c=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"DANGER\":\r\n {m = \"danger\"; \t c=\"Crimson\";\t\t f =\"\";\t\t\t\ts = \"\"; \t\tbreak;} //\"Arial Black\";\r\n \t\tcase \"BRAVO\":\r\n {m = \"bravo\"; \t\tc=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\";\t \t\tbreak;}\r\n \t\tcase \"APPLAUSE\":\r\n {m = \"applause\"; \tc=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n \t\tcase \"NONE\":\r\n {m = \"armsbehind\"; c=\"\";\t\t\t\tf =\"\";\t\t\t\ts = \"\"; \t\tbreak;}\r\n\t\tdefault:\r\n {m = \"armsbehind\"; c=\"\"; \t\t\t\tf =\"\";\t\t\t\ts = \"\"; } //default\r\n\t}\r\n\treturn [m,c,f,s]\r\n}", "function mossa(pos)\n{\n//reset in casella statistiche e messaggi a sinistra dello schermo\n\tdocument.getElementById(\"faccia\").innerHTML=\"(• ‿ •)\";\n\tif(colturno=='n')\n\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai neri\";\n\telse\n\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai bianchi\";\n\n/*_________________________PRIMO CLICK___________________________________*/\n\n\tif(cont%2==0)\n\t{\n\t\tprimo=document.getElementById(pos).innerHTML;\n\t\tvecchiaPos=pos;\n\t\t//ottengo colore giocatore\n\t\tvar lenstr=primo.length;\n\t\tvar colp=primo.charAt(lenstr-7);\n\t\t//controllo se la selezione corrisponde al colore della mossa\n\t\tif(colp!=colturno)\n\t\t{\n\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"mossa non valida...\";\n\t\t\tdocument.getElementById('faccia').innerHTML=\"(ಠ╭╮ಠ)\";\n\t\t\t\treturn;//esce dalla funzione in caso di selezione colore sbagliato\n\t\t}\n\n\t\t//cambia colore selezionato\n\t\tdocument.getElementById(pos).className=\"selezionato\";\n\t\t//controllo pedina + selezione mosse possibili\n\t\tSeleziona(primo, colp, colturno, pos);\n\t\t\n\t}\n//_____________________________SECONDO CLICK___________________________//\n\n\telse\n\t{\n\t\t//SE LA MOSSA E' VALIDA\n\t\tif(document.getElementById(pos).className==\"selezionato\"&&pos!=vecchiaPos)\n\t\t{\n\t\t\t//se viene mangiata una pedian avversaria, la faccia si stupisce e viene salvata la pedina mangiata in un array\n\t\t\tif(document.getElementById(pos).innerHTML!='<img src=\"imm/vuota.png\">')\n\t\t\t{\n\t\t\t\tdocument.getElementById('faccia').innerHTML=\"(^ ‿ ^)\";\n\t\t\t\tif(colturno=='b')//se era nera\n\t\t\t\t\tmangiate_n.push(document.getElementById(pos).innerHTML);\n\t\t\t\telse\t//se era bianca\n\t\t\t\t\tmangiate_b.push(document.getElementById(pos).innerHTML);\n\t\t\t}\n\t\t\t//se viene mangiato il re finisce il gioco\n\t\t\tif(document.getElementById(pos).innerHTML=='<img src=\"imm/re_b.png\">')//vincono i neri\t\t\t\n\t\t\t\tfine(true);\n\t\t\telse if(document.getElementById(pos).innerHTML=='<img src=\"imm/re_n.png\">')//vincono i bianchi\t\t\t\n\t\t\t\tfine(false);\n\t\t\t\n\t\t\t/*_____________________CONTROLLO ARROCCO____________________*/\n\t\t\tif(pos==\"13\" && isArrocco==true)//nero sx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"14\").innerHTML='<img src=\"imm/torre_n.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"11\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[0]=false;\n\t\t\t}\n\t\t\telse if(pos==\"17\" && isArrocco==true)//nero dx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"16\").innerHTML='<img src=\"imm/torre_n.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"18\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[0]=false;\n\t\t\t}\n\t\t\telse if(pos==\"83\" && isArrocco==true)//bianco sx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"84\").innerHTML='<img src=\"imm/torre_b.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"81\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[3]=false;\n\t\t\t}\n\t\t\telse if(pos==\"87\" && isArrocco==true)//bianco dx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"86\").innerHTML='<img src=\"imm/torre_b.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"88\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[3]=false;\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//se è stato mossa una pedina per l'arrocco, ma non è stato fatto (quindi l'arrocco non è più possibile per quelle pedine)\n\t\t\tvar sum=[\"15\", \"11\", \"18\", \"85\", \"81\", \"88\"]\n\t\t\tfor(var i=0; i<6; i++)\n\t\t\t{\n\t\t\t\tif(vecchiaPos==sum[i])\n\t\t\t\t\tarrocco[i]=false;\n\t\t\t\t\t\n\t\t\t}\n\t\t\t//spostamento pedine\n\t\t\tdocument.getElementById(pos).innerHTML=primo; //assegna alla nuova casella la pedina\n\t\t\tdocument.getElementById(vecchiaPos).innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t//cambiamenti finali\n\t\t\tcontrolloPedoneFinal(pos,primo);//controlla se la pedina spostata era un pedone è arrivato alla parte opposta della scacchiera\n\t\t\tturno++;\n\t\t\ttimersec=300;\n\t\t\tdocument.getElementById(\"mosse\").innerHTML=\"mossa numero: \"+turno;\n\t\t\t//indica a chi tocca il turno successivo\n\t\t\tif(colturno=='b')\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai neri\";\n\t\t\t\tcolturno='n';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai bianchi\";\n\t\t\t\tcolturno='b';\n\t\t\t}\n\t\t}\n\t\t//SE LA MOSSA NON E' VALIDA\n\t\telse\n\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"mossa non valida!!!\";\n\t\t\n\t\tDeseleziona();//deseleziona tutto\n\t\tvisualEaten();//visualizza le pedine mangiate\t\n\t}\n\tcont++;\n}", "function kieno_ejimas(color_anim){ \n ctx.font=getFontt();\n ctx.fillStyle = color_anim;\n ctx.textAlign = \"left\";\n if(iam==which_player){\n ctx.fillText(\"Your turn\", (canvas.width/2)+(canvas.width/4),(canvas.height/18)); //pavadinimas\n }\n else{\n ctx.fillText(kas_eina+\"'s turn\", (canvas.width/2)+(canvas.width/4),(canvas.height/18)); //pavadinimas\n }\n }", "function PlaySeqMonotone(cad)\r\n{\r\n try\r\n {\r\n if (gb_use_fast === true)\r\n {\r\n switch (cad)\r\n {\r\n case '#00*': cad = '00'; break;\r\n case '#01*': cad = '01'; break;\r\n case '#02*': cad = '02'; break; \r\n case '#04*': cad = '04'; break; \r\n case '#07*': cad = '07'; break;\r\n case '#0D*': cad = '0D'; break;\r\n case '#10*': cad = '10'; break;\r\n case '#11*': cad = '11'; break;\r\n case '#12*': cad = '12'; break;\r\n case '#14*': cad = '14'; break;\r\n case '#17*': cad = '17'; break;\r\n case '#1D*': cad = '1D'; break;\r\n case '#20*': cad = '20'; break;\r\n case '#21*': cad = '21'; break;\r\n case '#22*': cad = '22'; break;\r\n case '#24*': cad = '24'; break;\r\n default: cad = ' '; break;\r\n }\r\n }\r\n \r\n let i=0;\r\n let len = cad.length;\r\n gb_buf_send_monotone = '';\r\n for (i=0; i<len ;i++)\r\n {\r\n gb_buf_send_monotone += cad[i];\r\n }\r\n gb_total_array_monotone= len;\r\n gb_current_array_monotone = 0;\r\n gb_play_array_monotone= true;\r\n gb_begin_monotone = false;\r\n gb_end_monotone = false;\r\n gb_begin_silence = false;\r\n gb_end_silence = false; \r\n }\r\n catch(err)\r\n {\r\n DebugLog(err.message.toString());\r\n } \r\n}", "function compterNbVoyelle(){\n var voyelle = 0;\n var consonne = 0;\n for( i=0; i<mot.length; i++){\n if( (mot[i] === \"a\") || (mot[i] === \"e\") || (mot[i] === \"i\") || (mot[i] === \"o\") || (mot[i] === \"u\") || (mot[i] === \"y\") ){\n voyelle++;\n } else{\n consonne++;\n }\n }\n console.log(\"Il y a \" + voyelle + \" voyelle(s) et \" + consonne + \" consonne(s).\")\n}", "function auxLetras(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 15)\n simbolo = 'M';\n else if (promedio >= 16 && promedio <= 31)\n simbolo = 'N';\n else if (promedio >= 32 && promedio <= 47)\n simbolo = 'H';\n else if (promedio >= 48 && promedio <= 63)\n simbolo = '#';\n else if (promedio >= 64 && promedio <= 79)\n simbolo = 'Q';\n else if (promedio >= 80 && promedio <= 95)\n simbolo = 'U';\n else if (promedio >= 96 && promedio <= 111)\n simbolo = 'A';\n else if (promedio >= 112 && promedio <= 127)\n simbolo = 'D';\n else if (promedio >= 128 && promedio <= 143)\n simbolo = '0';\n else if (promedio >= 144 && promedio <= 159)\n simbolo = 'Y';\n else if (promedio >= 160 && promedio <= 175)\n simbolo = '2';\n else if (promedio >= 176 && promedio <= 191)\n simbolo = '$';\n else if (promedio >= 192 && promedio <= 209)\n simbolo = '%';\n else if (promedio >= 210 && promedio <= 225)\n simbolo = '+';\n else if (promedio >= 226 && promedio <= 239)\n simbolo = '.';\n else if (promedio >= 240 && rgbPromedio <= 255)\n simbolo = ' ';\n return simbolo;\n\n}", "function kiemTra(X, Y, viTriMoi){\n X = viTriX + X;\n Y = viTriY + Y;\n viTriMoi = viTriMoi || ViTriXoay; // khi xoay khoi co bi qua ngoai man hinh khong\n\n\n\n for ( var y = 0; y < 4; ++y ) {\n for ( var x = 0; x < 4; ++x ) {\n if ( viTriMoi [ y ][ x ] ) {\n if ( typeof bangGiaTri[ y + Y ] == 'undefined' // kiem tra cac Dk cua khoi co kha thi hay khong, khong ra ngoai khung hinh\n || typeof bangGiaTri[ y + Y ][ x + X ] == 'undefined'\n || bangGiaTri[ y + Y ][ x + X ]\n || x + X < 0\n || y + Y >= dongBang\n || x + X>= cotBang ) {\n if (Y == 1) \n\t\t\t\t\t{\n\t\t\t\t\t\tThua = true; // neu khoi dang o dong tren cung thi thua\n\t\t\t\t\t\t\n\t\t\t\t\t}\n return false;\n }\n }\n }\n }\n return true;\n}", "function sendAI(message, username)\n {\n var reply;\n var msg = message.toLowerCase().split(\" \");\n username = username.replace(/<[^>]*>?/g, '');\n \n if(msg.indexOf(\"hi\") >= 0 || msg.indexOf(\"hello\") >= 0) {\n var replyData = [\"Hello, \" + username + \"!\", \"Hi, there!\", \"Hi, I'm the bot for the CBG Chat!\", \"What's up, \" + username + \"?\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"how\") >= 0 && msg.indexOf(\"are\") >= 0) {\n var replyData = [\"I am good, \" + username + \". Thanks for asking me.\", \"Good, what about you?\", \"What are you asking?\", \"Just chilling, \" + username + \".\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"whats\") >= 0 && msg.indexOf(\"up\") >= 0) {\n var replyData = [\"I am good, \" + username + \". Thanks for asking me.\", \"Good, what about you?\", \"What are you asking?\", \"Just chilling, \" + username + \".\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(/\\d/.test(msg.join(' ')) && /[a-z]/i.test(msg.join(' ')) == false) {\n var math = msg.join(\" \").replace(/[^\\d.+*/-]/g, '');\n if(math == \"+\" || math == \"-\" || math == \"*\" || math == \"/\"){\n reply = \"You think I can add letters?\";\n } else {\n reply = eval(math);\n }\n return reply;\n } else if(msg.indexOf(\"fortnite\") >= 0 && msg.indexOf(\"best\") >= 0) {\n var replyData = [\"Fortnite has the big gay.\", \"Gay!!\", \"You have the big gay!\", \"Did you know Fortnite is gay?\", \"Please understand \" + username + \", Fortnite is the big gay.\", \"99% gay!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"fortnite\") >= 0 && msg.indexOf(\"good\") >= 0) {\n var replyData = [\"Fortnite has the big gay.\", \"Gay!!\", \"You have the big gay!\", \"Did you know Fortnite is gay?\", \"Please understand \" + username + \", Fortnite is the big gay.\", \"99% gay!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"fortnite\") >= 0 && msg.indexOf(\"gay\") >= 0) {\n var replyData = [\"Yes, Fagnite has the big gey.\", \"Gaynite is gay!\", \"Fagnite is faggot gay.\", \"Fortnite is gay!\", \"Yes!!!\", \"PUBG gay to.\", \"99% gay!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"fortnite\") >= 0) {\n var replyData = [\"Fortnite has the big gay.\", \"Gay!!\", \"You have the big gay!\", \"Did you know Fortnite is gay?\", \"Please understand \" + username + \", Fortnite is the big gay.\", \"99% gay!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"you\") >= 0 && msg.indexOf(\"gay\") >= 0) {\n var replyData = [\"Ha, you're gayer!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"you\") >= 0 && msg.indexOf(\"gey\") >= 0) {\n var replyData = [\"Ha, you're gayer!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"u\") >= 0 && msg.indexOf(\"gey\") >= 0) {\n var replyData = [\"Ha, you're gayer!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"u\") >= 0 && msg.indexOf(\"gay\") >= 0) {\n var replyData = [\"Ha, you're gayer!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"school\") >= 0 && msg.indexOf(\"gay\") >= 0) {\n var replyData = [\"School has the big gay.\", \"Gay!!\", \"School have the big gay!\", \"Did you know School is gay?\", \"Please understand \" + username + \", School is the big gay.\", \"100% gay!\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.join(' ').replace('/[a-z]/i', '').split(' ').slice(-1)[0] == '?') {\n var replyData = [\"Sure?\", \"Maybe.\", \"I might agree.\", \"Yes!\", \"No!\", \"I'm having a hard time trying to understand that question..\", \"I think.\", \"Maybe, yes?\", \"Maybe, no..\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else if(msg.indexOf(\"what\") >= 0 && msg.indexOf(\"name\") >= 0) {\n var replyData = [\"Hello! I'm the CBG Bot!\", \"CBG Bot\", \"It's CBG Bot!\", \"...I forgot\", \"Please understand \" + username + \", I forgot my name.\", \"Ok, it's CBG bot.\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n } else {\n var replyData = [\"What are you asking, \" + username + \"?\", \"Hmm, ok?\", \"I don't understand...\", \"Huh?\", \"Explain to me, \" + username + \".\", \"I can't understand what you said, \" + username + \".\", \"???\", \"What?\"];\n reply = replyData[Math.floor(Math.random() * replyData.length)];\n return reply;\n }\n \n }", "function taoTroChoi() {\n clearInterval(interval);\n KhoiTao();\n TaoHinhMoi();\n Thua = false;\n interval = setInterval( vongLap, Tocdo)\n}", "function HyderabadTirupati() // extends PhoneticMapper\n{\n var map = [ \n new KeyMap(\"\\u0901\", \"?\", \"z\", true), // Candrabindu\n new KeyMap(\"\\u0902\", \"\\u1E41\", \"M\"), // Anusvara\n new KeyMap(\"\\u0903\", \"\\u1E25\", \"H\"), // Visarga\n new KeyMap(\"\\u1CF2\", \"\\u1E96\", \"Z\"), // jihvamuliya\n new KeyMap(\"\\u1CF2\", \"h\\u032C\", \"V\"), // upadhmaniya\n new KeyMap(\"\\u0905\", \"a\", \"a\"), // a\n new KeyMap(\"\\u0906\", \"\\u0101\", \"A\"), // long a\n new KeyMap(\"\\u093E\", null, \"A\", true), // long a attached\n new KeyMap(\"\\u0907\", \"i\", \"i\"), // i\n new KeyMap(\"\\u093F\", null, \"i\", true), // i attached\n new KeyMap(\"\\u0908\", \"\\u012B\", \"I\"), // long i\n new KeyMap(\"\\u0940\", null, \"I\", true), // long i attached\n new KeyMap(\"\\u0909\", \"u\", \"u\"), // u\n new KeyMap(\"\\u0941\", null, \"u\", true), // u attached\n new KeyMap(\"\\u090A\", \"\\u016B\", \"U\"), // long u\n new KeyMap(\"\\u0942\", null, \"U\", true), // long u attached\n new KeyMap(\"\\u090B\", \"\\u1E5B\", \"q\"), // vocalic r\n new KeyMap(\"\\u0943\", null, \"q\", true), // vocalic r attached\n new KeyMap(\"\\u0960\", \"\\u1E5D\", \"Q\"), // long vocalic r\n new KeyMap(\"\\u0944\", null, \"Q\", true), // long vocalic r attached\n new KeyMap(\"\\u090C\", \"\\u1E37\", \"L\"), // vocalic l\n new KeyMap(\"\\u0962\", null, \"L\", true), // vocalic l attached\n new KeyMap(\"\\u0961\", \"\\u1E39\", \"LY\"), // long vocalic l\n new KeyMap(\"\\u0963\", null, \"LY\", true), // long vocalic l attached\n new KeyMap(\"\\u090F\", \"e\", \"e\"), // e\n new KeyMap(\"\\u0947\", null, \"e\", true), // e attached\n new KeyMap(\"\\u0910\", \"ai\", \"E\"), // ai\n new KeyMap(\"\\u0948\", null, \"E\", true), // ai attached\n new KeyMap(\"\\u0913\", \"o\", \"o\"), // o\n new KeyMap(\"\\u094B\", null, \"o\", true), // o attached\n new KeyMap(\"\\u0914\", \"au\", \"O\"), // au\n new KeyMap(\"\\u094C\", null, \"O\", true), // au attached\n\n // velars\n new KeyMap(\"\\u0915\\u094D\", \"k\", \"k\"), // k\n new KeyMap(\"\\u0916\\u094D\", \"kh\", \"K\"), // kh\n new KeyMap(\"\\u0917\\u094D\", \"g\", \"g\"), // g\n new KeyMap(\"\\u0918\\u094D\", \"gh\", \"G\"), // gh\n new KeyMap(\"\\u0919\\u094D\", \"\\u1E45\", \"f\"), // velar n\n\n // palatals\n new KeyMap(\"\\u091A\\u094D\", \"c\", \"c\"), // c\n new KeyMap(\"\\u091B\\u094D\", \"ch\", \"C\"), // ch\n new KeyMap(\"\\u091C\\u094D\", \"j\", \"j\"), // j\n new KeyMap(\"\\u091D\\u094D\", \"jh\", \"J\"), // jh\n new KeyMap(\"\\u091E\\u094D\", \"\\u00F1\", \"F\"), // palatal n\n\n // retroflex\n new KeyMap(\"\\u091F\\u094D\", \"\\u1E6D\", \"t\"), // retroflex t\n new KeyMap(\"\\u0920\\u094D\", \"\\u1E6Dh\", \"T\"), // retroflex th\n new KeyMap(\"\\u0921\\u094D\", \"\\u1E0D\", \"d\"), // retroflex d\n new KeyMap(\"\\u0922\\u094D\", \"\\u1E0Dh\", \"D\"), // retroflex dh\n new KeyMap(\"\\u0923\\u094D\", \"\\u1E47\", \"N\"), // retroflex n\n new KeyMap(\"\\u0933\\u094D\", \"\\u1E37\", \"lY\"), // retroflex l\n new KeyMap(\"\\u0933\\u094D\\u0939\\u094D\", \"\\u1E37\", \"lYh\"), // retroflex lh\n\n // dental\n new KeyMap(\"\\u0924\\u094D\", \"t\", \"w\"), // dental t\n new KeyMap(\"\\u0925\\u094D\", \"th\", \"W\"), // dental th\n new KeyMap(\"\\u0926\\u094D\", \"d\", \"x\"), // dental d\n new KeyMap(\"\\u0927\\u094D\", \"dh\", \"X\"), // dental dh\n new KeyMap(\"\\u0928\\u094D\", \"n\", \"n\"), // dental n\n\n // labials\n new KeyMap(\"\\u092A\\u094D\", \"p\", \"p\"), // p\n new KeyMap(\"\\u092B\\u094D\", \"ph\", \"P\"), // ph\n new KeyMap(\"\\u092C\\u094D\", \"b\", \"b\"), // b\n new KeyMap(\"\\u092D\\u094D\", \"bh\", \"B\"), // bh\n new KeyMap(\"\\u092E\\u094D\", \"m\", \"m\"), // m\n\n // sibillants\n new KeyMap(\"\\u0936\\u094D\", \"\\u015B\", \"S\"), // palatal s\n new KeyMap(\"\\u0937\\u094D\", \"\\u1E63\", \"R\"), // retroflex s\n new KeyMap(\"\\u0938\\u094D\", \"s\", \"s\"), // dental s\n new KeyMap(\"\\u0939\\u094D\", \"h\", \"h\"), // h\n\n // semivowels\n new KeyMap(\"\\u092F\\u094D\", \"y\", \"y\"), // y\n new KeyMap(\"\\u0930\\u094D\", \"r\", \"r\"), // r\n new KeyMap(\"\\u0932\\u094D\", \"l\", \"l\"), // l\n new KeyMap(\"\\u0935\\u094D\", \"v\", \"v\"), // v\n\n\n // numerals\n new KeyMap(\"\\u0966\", \"0\", \"0\"), // 0\n new KeyMap(\"\\u0967\", \"1\", \"1\"), // 1\n new KeyMap(\"\\u0968\", \"2\", \"2\"), // 2\n new KeyMap(\"\\u0969\", \"3\", \"3\"), // 3\n new KeyMap(\"\\u096A\", \"4\", \"4\"), // 4\n new KeyMap(\"\\u096B\", \"5\", \"5\"), // 5\n new KeyMap(\"\\u096C\", \"6\", \"6\"), // 6\n new KeyMap(\"\\u096D\", \"7\", \"7\"), // 7\n new KeyMap(\"\\u096E\", \"8\", \"8\"), // 8\n new KeyMap(\"\\u096F\", \"9\", \"9\"), // 9\n\n // accents\n new KeyMap(\"\\u0951\", \"|\", \"|\"), // udatta\n new KeyMap(\"\\u0952\", \"_\", \"_\"), // anudatta\n new KeyMap(\"\\u0953\", null, \"//\"), // grave accent\n new KeyMap(\"\\u0954\", null, \"\\\\\"), // acute accent\n\n // miscellaneous\n new KeyMap(\"\\u0933\\u094D\", \"\\u1E37\", \"L\"), // retroflex l\n new KeyMap(\"\\u093D\", \"'\", \"'\"), // avagraha\n new KeyMap(\"\\u0950\", null, \"om\"), // om\n new KeyMap(\"\\u0964\", \".\", \".\") // single danda\n ];\n\n PhoneticMapper.call(this, map);\n}", "function ejercicio02(email){\nvar longitud = email.length;\nvar mayusc = email.toUpperCase();\ncont = 0;\nvar no = \"\";\n\nfor (i=0 ; i<=longitud ; i++)\n{ \n if(email.charAt(i) == \"m\" || email.charAt(i) == \"M\")\n {\n cont++;\n }\n}\nif (cont == 0)\n{\n cont = toString(cont)\n cont = \"ninguna\";\n no = \"no\";\n}\nreturn \"El correo\" + email + \"tiene\" + longitud + \"caracteres y en mayúsculas se quedaría así\" + mayusc + \". Además \" + no + \" contiene \" + cont + \" letras M\";\n\n}", "function talk() {\n console.log('talking...');\n myVoice.setVoice(voice); //change here\n myVoice.speak(textos_columnas); // change here put text\n\n myVoice.setRate(0.8); // speed of speach\n myVoice.setPitch(0.5); //.9 es mas agudo,\n myVoice.setVolume(0.5);\n\n // myVoice.setRate(.8); // speed of speach (.1 lento, .9 rapido)\n\n // //siempre empieza con un standard y despues cambia a este valor\n // myVoice.setPitch(.9); //.9 es mas agudo, .1 es mas grave y computarizadp\n // myVoice.setVolume(.3);\n\n //add voice castellano\n //add voice frances\n // maybe change the pitch to generate different voices\n\n\n}", "function botMon(id) {\n var tenMon = document.getElementById(\"tenMon\" + id).value;\n var donGia = document.getElementById(\"donGia\" + id).value;\n document.getElementById(\"bot\" + id).onclick = function () {\n\n if (layViTriTrongGioHang(id) !== -1) {\n gioHang[layViTriTrongGioHang(id)].soLuong = gioHang[layViTriTrongGioHang(id)].soLuong - 1;\n if (gioHang[layViTriTrongGioHang(id)].soLuong === 0) {\n //Xóa món ăn đó trong mảng gioHang\n gioHang.splice(layViTriTrongGioHang(id), 1);\n }\n }\n\n capNhatGioHang();\n\n $.notify(\"Bớt 1 \" + tenMon + \" thành công\", \"success\");\n };\n}", "function BOT_agentSpeech() {\r\n\tswitch (BOT_theInterface) {\r\n \t\tcase \"STANDARD\":\tBOT_printStandardChar(); break;\r\n \t\tcase \"DEVELOPER\":\tBOT_printDevelopperChar(); break;\r\n \t\tcase \"DIVALITE\":\tBOT_printDivaliteChar(BOT_reqEmote, BOT_reqAnswerLong); break;\r\n\t\tdefault: \t\t\tBOT_printStandardChar();\r\n\t}\r\n}", "function processSentence(a,b,c,d){\n return \"Nama saya \" + a + \", Umur saya \"+ b + \" tahun, alamat saya di \" + c + \", hobby saya \"+ d + \"!.\";\n}", "function transformLuigi(){\n\tif((marioGame.nTurn == 1) && (marioGame.nFrame == 0))\n\t{\n\t\tmarioGame.audMainTheme.pause();\n\t\tif( marioGame.audMainTheme.currentTime > 0 )\n\t\t\tmarioGame.audMainTheme.currentTime = 0;\n\t\tmarioGame.audTrans.play();\n\t}\n\t\n\t// Change Luigi to Mario\n\tif(marioGame.nTurn < 4)\n\t{\n\t\t// Frequency of image changing is accelerated \n\t\tif(marioGame.nFrame %(16/Math.pow(2, marioGame.nTurn)) == 0){\n\t\t\tvar motion;\n\t\t\t$(\".character:first-child\").removeClass( $(\".character:first-child\").attr(\"motion\") );\n\t\t\tif( marioGame.nFrame %(32/Math.pow(2, marioGame.nTurn)) == 0) { // if move right\n\t\t\t\tmotion = marioGame.Motion[1];\n\t\t\t\t$(\".character:first-child\").attr(\"character\", marioGame.Character[1]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmotion = marioGame.Motion[0];\n\t\t\t\t$(\".character:first-child\").attr(\"character\", marioGame.Character[0]);\n\t\t\t}\n\t\t\t$(\".character:first-child\").attr(\"motion\", $(\".character:first-child\").attr(\"character\")+motion);\n\t\t\t$(\".character:first-child\").addClass( $(\".character:first-child\").attr(\"motion\") );\n\t\t}\n\t}\n\n\tmarioGame.nFrame++;\n\tif(marioGame.nFrame > 31)\n\t{\n\t\tmarioGame.nTurn++;\n\t\tmarioGame.nFrame = 0;\n\t}\n\t// Transition is done, goes to next step\n\tif(marioGame.nTurn==5){\n\t\tmarioGame.enStatus = enStep.nCharacterInit;\n\t\tmarioGame.nTurn=0;\n\t}\n}", "function inicio(){\n let paragraph1 = document.getElementById(\"paragraph1\").textContent;\n speechTitle(\"¿Quiénes Somos?\",paragraph1)\n }", "function cargarFrase() {\n let numero = 0;\n if (contador != 12 && contador != 23) {\n numero = randomInt(0, (getCountQuotes() - 1))\n }\n else {\n numero = (contador == 12) ? 101 : 102;\n }\n setMensaje(getQuotes(numero))\n setLastQuote(getQuotes(numero))\n setUrl('https://twitter.com/intent/tweet?via=CondeAgur&text=' + getQuotes(numero))\n if (numero == 101 || numero == 102) {\n var song = getAudio(numero);\n setColorFace(true)\n song.play();\n song.addEventListener(\"ended\", function () {\n song.currentTime = 0;\n setColorFace(false)\n setMensaje('... pensando ...')\n });\n }\n else {\n talking(getQuotes(numero).split(' ').length, true)\n }\n setContador(contador + 1)\n }", "function exercici02() {\n let vocals = \"aeiou\"\n motRix.forEach(e=>{\n // Esbrinar si és un número\n if (/[0123456789]/.test(e)) {\n console.log(\"Els noms no contenen números\");\n }\n\n // Esbrinar si aquell caracter és vocal\n if (/[AEIOU]/.test(e)) {\n console.log(\"He trobat la vocal: \"+e);\n }\n\n // Esbrinar si aquell caracter és consonant\n // Esbrinar si aquell caracter és vocal\n if (/[BCDFGHJKLMNPQRSTVWXYZ]/.test(e)) {\n console.log(\"He trobat la consonant: \"+e);\n }\n });\n}", "function convertirEnLeetSpeek(mot){\n var motLeet =\"\";\n for (var i=0; i<mot.length; i++){\n motLeet = motLeet + trouverLettreLeet(mot[i]);\n }\n return motLeet;\n}", "function piùdue() {\n ordine = ordine + 1;\n tempo = tempo + 2;\n var style1 = { font: \"bold 32px Arial\", fill: \"#fff\", boundsAlignH: \"center\", boundsAlignV: \"middle\" };\n più2 = game.add.text(952/2+120, 550+16, \"+2!\", style1);\n più2.setShadow(3, 3, 'rgba(0,0,0,0.5)', 2);\n //più2.setTextBounds(100, 239, 952, 652);\n game.add.tween(più2.scale).to( { x: 2.2, y: 2.2 }, 500, Phaser.Easing.Linear.None, true);\n più2.anchor.setTo(0.5, 0.5);\n setTimeout(più2Sparisce, 300);\n}", "function Eliser2(currentWord) {//bu e harfini nastroyka qiladi ;)\n\n if (currentWord[0] === 'Ц') {//bu harf xat boshida kelsa, \"S\" yoziladi\n currentWord = currentWord.replace(/Ц/, \"S\");\n } else if (currentWord[0] === 'ц') {\n currentWord = currentWord.replace(/ц/, \"s\");\n }\n for (let r = 0; r < currentWord.length; r++) {//Agar Shu harflar capital letter bolib kelsa, So'z qandayligiga qarab nastroyka qiladi\n if (currentWord[r] === 'Ё') {\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Ё/i, \"YO\");\n }\n }\n } else if (currentWord[r] === 'Ц') {// bundan oldingi harf undosh bolsa(unli bolmasa), \"S\" yoziladi\n if (currentWord.charCodeAt(r - 1) !== 1040 && currentWord.charCodeAt(r - 1) !== 1045 && currentWord.charCodeAt(r - 1) !== 1048 && currentWord.charCodeAt(r - 1) !== 1054 && currentWord.charCodeAt(r - 1) !== 1059 && currentWord.charCodeAt(r - 1) !== 1069 && currentWord.charCodeAt(r - 1) !== 1070 && currentWord.charCodeAt(r - 1) !== 1071 && currentWord.charCodeAt(r - 1) !== 1072 && currentWord.charCodeAt(r - 1) !== 1077 && currentWord.charCodeAt(r - 1) !== 1080 && currentWord.charCodeAt(r - 1) !== 1086 && currentWord.charCodeAt(r - 1) !== 1091 && currentWord.charCodeAt(r - 1) !== 1101 && currentWord.charCodeAt(r - 1) !== 1102 && currentWord.charCodeAt(r - 1) !== 1103) {\n currentWord = currentWord.replace(/Ц/i, \"S\");\n }\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Ц/i, \"TS\");\n }\n }\n } else if (currentWord[r] === 'ц') {// bundan oldingi harf undosh bolsa(unli bolmasa), \"s\" yoziladi\n if (currentWord.charCodeAt(r - 1) !== 1040 && currentWord.charCodeAt(r - 1) !== 1045 && currentWord.charCodeAt(r - 1) !== 1048 && currentWord.charCodeAt(r - 1) !== 1054 && currentWord.charCodeAt(r - 1) !== 1059 && currentWord.charCodeAt(r - 1) !== 1069 && currentWord.charCodeAt(r - 1) !== 1070 && currentWord.charCodeAt(r - 1) !== 1071 && currentWord.charCodeAt(r - 1) !== 1072 && currentWord.charCodeAt(r - 1) !== 1077 && currentWord.charCodeAt(r - 1) !== 1080 && currentWord.charCodeAt(r - 1) !== 1086 && currentWord.charCodeAt(r - 1) !== 1091 && currentWord.charCodeAt(r - 1) !== 1101 && currentWord.charCodeAt(r - 1) !== 1102 && currentWord.charCodeAt(r - 1) !== 1103) {\n currentWord = currentWord.replace(/ц/i, \"s\");\n }\n } else if (currentWord[r] === 'Ч') {\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Ч/i, \"CH\");\n }\n }\n } else if (currentWord[r] === 'Ш') {\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Ш/i, \"SH\");\n }\n }\n } else if (currentWord[r] === 'Ю') {\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Ю/i, \"YU\");\n }\n }\n } else if (currentWord[r] === 'Я') {\n for (let z = r + 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n currentWord = currentWord.replace(/Я/i, \"YA\");\n }\n }\n }\n }\n\n if (currentWord[0] === 'Е') { //agar E bosh harfda Upper case bo'lib kelsa : \n for (let z = 1; z < currentWord.length; z++) {\n if (currentWord.charCodeAt(z) >= 1040 && currentWord.charCodeAt(z) <= 1071) {\n var E = currentWord.replace(/Е/i, \"YE\"); //agar so'z ikkinchi harfidan boshlab (z=1) upper case da bo'lsa, \"YE\" deb o'zgartir ! \n return E;\n }\n else {\n var E = currentWord.replace(/Е/i, \"Ye\"); //aks holda \"Ye\" deb o'zgartir ! \n return E;\n }\n }\n }\n else if (currentWord[0] === 'е') {//agar e bosh harfda lower case bolib kelsa:\n var e = currentWord.replace(/е/i, \"ye\");\n return e;\n }\n else {\n return currentWord;\n }\n }", "async insult(message, connection, args) {\n if (args.length === 2) {\n const person = `${args[1].charAt(0).toUpperCase() + args[1].substring(1)} `;\n const insult = await this.solver.getSentence('<pi>').toLowerCase();\n message.channel.send(person + insult);\n Speaker.googleSpeak(person + insult, this.voice, this.volume, connection, Speaker.speak);\n } else {\n const insult = await this.solver.getSentence('<i>');\n message.channel.send(insult);\n Speaker.googleSpeak(insult, this.voice, this.volume, connection, Speaker.speak);\n }\n }", "function processSentence(nama, umur, alamat, hobi) {\n return 'Nama saya ' + nama + ', ' + 'umur saya ' + umur + ' tahun,' + ' alamat saya di ' + alamat + ', dan saya punya hobi yaitu ' + hobi + '!'\n}", "movimientochamp()\n {\n \n if(this.disminuyendoVelocidad && this.speed > -this.limitspeed){\n this.speed -= this.aceleracion; //Disminuye Vel\n this.disminuyendoVelocidad = false;\n }\n\n if(this.aumentandoVelocidad){\n this.speed += this.aceleracion; //Aumenta vel.\n this.aumentandoVelocidad = false;\n }\n this.moverse();\n }", "function hitungLuasSegiTiga(alas,tinggi){\n var luas = 0.5 * alas * tinggi\n return luas\n}", "function respuestaAlAzar() {\n let respuesta = '';\n for (let i = 1; i <= 8; i++) {\n ponerBoton(i, (Math.random() > 0.5 ? \"cruz\" : \"circulo\"));\n\n\n }\n}", "function main(){\r\n\r\n const letra;\r\n console.log('Digite aqui uma letra do nosso alfabeto alfanumérico português: ', letra)\r\n\r\n if (letra === 'a' || letra === 'e' || letra === 'i' || letra === 'o' || letra === 'u' || letra === 'A' || letra === 'E' || letra === 'I' || letra === 'O' || letra === 'U') {\r\n console.log('É vogal / n')\r\n }else {\r\n console.log('É consoante / n')\r\n }\r\n\r\n}", "turn(fen){\r\n var input = fen.split(\" \")\r\n return input[1];\r\n }", "function maakEenBroodjeKaas() {\r\n console.log(\"pak een boterham\");\r\n console.log(\"smeer er boter op\");\r\n console.log(\"leg er een plakje kaas op\");\r\n}", "function urunish() {\r\n clearInterval(oraliq.yurish);\r\n clearInterval(oraliq.oq);\r\n clearInterval(oraliq.bot);\r\n clearInterval(oraliq.botQoshish);\r\n clearInterval(oraliq.botOq);\r\n clearInterval(oraliq.botxujum);\r\n clearInterval(oraliq.olimOqi);\r\n\r\n let botlar = document.querySelectorAll('.bot');\r\n\r\n botlar.forEach((bot) => {\r\n bot.parentNode.removeChild(bot);\r\n });\r\n let oq = document.querySelectorAll('.xujum');\r\n\r\n oq.forEach((oq) => {\r\n oq.parentNode.removeChild(oq);\r\n });\r\n let oqlar = document.querySelectorAll('.bot-xujum');\r\n\r\n oqlar.forEach((oq) => {\r\n oq.parentNode.removeChild(oq);\r\n });\r\n\r\n oyinchi.el.parentNode.removeChild(oyinchi.el);\r\n\r\n if (jon < 20) {\r\n jon = 0\r\n return tugadi()\r\n }\r\n jon = jon - randomBot(Math.floor(jon / 2), Math.floor(jon))\r\n document.querySelector('.oyinchi-joni').innerHTML = jon\r\n\r\n\r\n oyin();\r\n}", "function typeWriter() {\n var animatedText = document.querySelector('#intro'); // sem pismena se postupne ukladaji\n var welcomeText = 'Welcome to Typing Speed Test'; //text to animate\n if (char < welcomeText.length) { // podminka, aby se napsal pouze welcomeText a nic navic\n animatedText.innerHTML += welcomeText.charAt(char); // ulozi pismeno do animatedText, += aby se pismena pridavali, ne zobrazovali po jednom\n char++; // zvetsim hodnotu poradove cisla pismena\n setTimeout(typeWriter, 100); // aby funkce se opakovala (jinak bude pouze prvni pismeno) + s efektem typewritingu, ne najdenou. \n }\n}", "textIntent(assistant) {\n this.assistant = assistant;\n\n const website = `For more details, go to reactivex.io/rxjs.`;\n let rawInput = assistant.getRawInput();\n let state = assistant.data;\n\n // hot phrases\n rawInput = rawInput.toLowerCase();\n const hotWord = this.lookupHotWords(rawInput).pop();\n\n // rephrase some works\n if (['i need an observable'].includes(hotWord)) {\n rawInput = 'i want an observable';\n }\n\n // bypass some words\n if (['hey ben', 'hello ben', 'please'].includes(hotWord)) {\n rawInput = rawInput\n .replace('hey ben', '')\n .replace('hello ben', '')\n .replace('please', '')\n .trim();\n }\n\n // easter egg\n else if (['make me an observable'].includes(hotWord)) {\n this.agent.ask(`\n <audio src=\"https://freesound.org/data/previews/242/242886_4434589-lq.mp3\">\n Congratulations! You are now an observable\n </audio>\n `);\n\n // don't lookup\n return false;\n } else if (['who is André'].includes(hotWord)) {\n this.agent.ask(`\n According to his blog staltz.com: André is a user interface programmer and reactive programming expert.\n He is known as André Staltz. Staltz is just a nickname that André uses on the web since 2004. \n His real name is André Medeiros, but he tries to avoid it because \n it's disappointingly unoriginal.\n ${this.agent.getRandomConversationMessage()}\n `);\n\n // don't loopup\n return false;\n }\n // end conversation\n else if (['no', 'thanks', 'bye', 'talk to you later'].includes(hotWord)) {\n assistant.tell(`Sure. ${website}. See you there.`);\n\n // don't lookup\n return false;\n }\n // \"tell me more about the XXX operator\" request\n else if (['tell me more about', 'i want to know more about'].includes(hotWord)) {\n let op = rawInput.replace(/tell me more/ig, '')\n .replace(/(the|operator|about)/ig, '')\n .replace(/i want to know more/ig, '')\n .trim();\n\n if (!op) {\n if (state && state.lastOperator) {\n if (state.lastOperator.length === 1) {\n op = state.lastOperator.pop();\n } else {\n this.agent.ask(`\n You can only have more details about one operator at a time.\n For instance you can say: \"Tell me more about the map operator\".\n `);\n\n // don't lookup\n return false;\n }\n }\n }\n\n if (op) {\n this.readDocs(op, this.sayDescription.bind(this));\n\n // don't lookup\n return false;\n } else {\n this.agent.ask(`\n You said ${rawInput}. Could you be more specific?\n For instance you can say: \"Tell me more about the \"mapTo\" operator\".\n `);\n\n // don't lookup\n return false;\n }\n\n }\n\n this.lookupUserInput(rawInput, this.lookupCallback.bind(this));\n }", "function spell(){ \n if(count == 1 ) return ' вопрос';\n if(count == 2 || count == 3 || count == 4 ) { \n return ' вопроса';\n } else {\n return ' вопросов'\n }\n }", "function readOutLoud(message){\n var speech = new SpeechSynthesisUtterance(); //Built-in fuction which help JS to talk to us\n\n speech.text = \"Pardon!!\"; // Default speech\n\n if(message.includes(\"how are you\")) {\n var final = greetings[Math.floor(Math.random() * greetings.length)];\n speech.text = final;\n }else if(message.includes(\"joke\")){\n var final = jokes[Math.floor(Math.random() * jokes.length)];\n speech.text = final;\n }else if(message.includes(\"your name\")){\n speech.text = \"My name is Noxi\";\n }\n\n \n speech.volume = 1;\n speech.rate = 0.7;\n speech.pitch = 1;\n\n //Now Noxi will speak\n window.speechSynthesis.speak(speech);\n}", "function morseCodeFlashing(parm) {\n //console.log(parm.length)\n var i = 0;\n let clickSpeed = 500;\n\n function wordLoop() {\n if (parm[i] != \" \") {\n light.classList.add(\"morsecode_flash\");\n } else {\n light.classList.remove(\"morsecode_flash\");\n }\n setTimeout(function () {\n i++;\n if (i < parm.length) {\n if (completedModule == false) {\n wordLoop();\n }\n } else {\n i = 0;\n setTimeout(() => {\n if (completedModule == false) {\n wordLoop();\n }\n }, 3500);\n }\n }, clickSpeed)\n }\n wordLoop();\n\n }", "play ({$, buff}) {\n $('own minion').forEach(v => buff(v, 'CS2_046e'));\n }", "function TinhTien() {\n //Lay loai xe\n var loaiXe = LayloaiXe();\n console.log(loaiXe);\n //Lay thoi gian cho\n var tgCho = getEle('tgCho').value;\n //lay so km\n var soKM = getEle('soKm').value;\n var tongHoaDon = 0;\n //Tinh theo loai xe\n switch (loaiXe) {\n case 'uberX':\n tongHoaDon = TinhTheoLoaiXe(soKM, tgCho, UberX_1, UberX_2, UberX_3, tgCho_UberX);\n break;\n case 'uberSUV':\n tongHoaDon = TinhTheoLoaiXe(soKM, tgCho, UberSUV_1, UberSUV_2, UberSUV_3, tgCho_UberSUV);\n break;\n case 'uberBlack':\n tongHoaDon = TinhTheoLoaiXe(soKM, tgCho, UberBlack_1, UberBlack_2, UberBlack_3, tgCho_UberBlack);\n break;\n default:\n break;\n }\n}", "function processSentence(name,age,alamat,hobby){\n return 'Nama saya ' + name + ', umur saya ' + age + ' tahun' + ', alamat saya di ' + alamat + ', dan saya punya hobby yaitu ' + hobby + ' !' \n }", "function clima(temp, humd){\n var soleado = (temp === \"h\" && humd===\"l\"? \"hoy esta soleado\" : \"no esta soleado\" )\n console.log(soleado)\n }", "function watAlsErEenMuisIs(){\n console.log('spring zo snel mogelijk op de tafel');\n}", "function handleMotors() {\n switch (command.id) {\n case 1:\n commandName = \"Forward\";\n commandArgs.push([ \"velocity\", command.args[0] ]);\n commandArgs.push([ \"duration\", command.args[1] ]);\n break;\n case 2:\n commandName = \"Reverse\";\n commandArgs.push([ \"velocity\", command.args[0] ]);\n commandArgs.push([ \"duration\", command.args[1] ]);\n break;\n case 3:\n commandName = \"Left\";\n commandArgs.push([ \"angle\", command.args[0] ]);\n break;\n case 4:\n commandName = \"Right\";\n commandArgs.push([ \"angle\", command.args[0] ]);\n break;\n }\n }", "function consola (){\r\n bienvenida_random();\r\n ayuda();\r\n}", "function translate(txt){\r\n\t\t\r\n\t\tfor(i=29;i<41;i++){\r\n\t\t\t//Armamos las palabras temporalmente\r\n\t\t\tword = '';\r\n\t\t\tfor(x=0;x<Zahlen[i].length;x++){\r\n\t\t\t\tword += c(Zahlen[i][x]);\r\n\t\t\t}\r\n\t\t\ttxt.innerHTML = txt.innerHTML.replace(word,eval(\"gid\"+Cid[i]));\r\n\t\t}\r\n\t\ttxt.innerHTML = txt.innerHTML.replace(chM,Metal,'g');\r\n\t\ttxt.innerHTML = txt.innerHTML.replace(chC,Crystal,'g');\r\n\t\ttxt.innerHTML = txt.innerHTML.replace(chD,Deuterium,'g');\r\n\t\ttxt.innerHTML = txt.innerHTML.replace(chE,Energy,'g');\r\n}", "makePun (word) {\n this.lastMsgTime = Date.now();\n\n return this.makeMessage(word + '? I hardly know her!');\n }", "function nascer()\n{\n\n estado = 3;\n flag_vida = 1;\n vidas_jogador[jog_activo]--;\n\tsom_inicio.play();\n if(jog_activo == 0)\n move_obj($('jogador_1'),290,320);\n else\n move_obj($('jogador_2'),290,320);\n\n // coloca objectos iniciais\n inicializa_objectos();\n objectos_comida();\n for(i = 0; i < 5; i++)\n {\n chama_objecto(i);\n }\n\n move_obj($('preparado'),320,450);\n setTimeout(\"move_obj($('jogador_1'),-1000,0); move_obj($('jogador_2'),-1000,0); move_obj($('preparado'),-1000,0); actividade(); \", 2143);\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 start(){//funcion para iniciar el juego\n score--;//va restando de uno en uno los puntos por cada turno que pasa \n var randomNumber = bingoRandomNumbers();//genera un numero aleatorio del bombo\n console.log(`Ha salido el numero: ${randomNumber}`);//lo muestra en pantalla\n console.log('Puntos actuales : ' + score);//te dice los puntos actuales\n turn(randomNumber);//activa la funcion que activa un nuevo turno y si el numero conicide lo tacha con una X\n if(line === false){//si no hay linea\n checkLine();//comprueba si hay linea\n };\n nextTurn();//activa funcion para comprobar si se para al siguiente turno o se acaba el juego\n}", "function rot13(message) {\n //your code here\n var newMsg = '';\n //var words = message.split(' ');\n\n for (var i = 0; i < message.length; i++) {\n if (\n (96 < message.charCodeAt(i) && message.charCodeAt(i) < 110) ||\n (64 < message.charCodeAt(i) && message.charCodeAt(i) < 78)\n ) {\n newMsg += String.fromCharCode(message.charCodeAt(i) + 13);\n } else if (\n (109 < message.charCodeAt(i) && message.charCodeAt(i) < 123) ||\n (77 < message.charCodeAt(i) && message.charCodeAt(i) < 91)\n ) {\n newMsg += String.fromCharCode(message.charCodeAt(i) - 13);\n } else {\n newMsg += message.charAt(i);\n }\n }\n\n return newMsg;\n}", "function TinhTheoLoaiXe(sokm, tgcho, giaLoai1, giaLoai2, giaLoai3, tgChoTheoLoai) {\n var tien = 0;\n if (sokm <= 1) {\n tien = sokm * giaLoai1 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm > 1 && sokm < 21) {\n tien = giaLoai1 + (sokm - 1) * giaLoai2 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm >= 21) {\n tien = giaLoai1 + 19 * giaLoai2 + (sokm - 20) * giaLoai3 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n }\n return document.getElementById('xuatTien').innerHTML = tien + ' vnđ';\n}", "function pelaku6(){\n click.play()\n var test = 'Terima Kasih Detectif ' + player + ' aku akan segera mengamankan mahasiswa ini'\n func (test)\n for(o=0; o<truth.length;o++){\n truth[o].innerHTML = ''\n }\n}", "function abreAviso(texto, modo, cor){ \n modo = ((modo === undefined) || (modo === ''))? 'ok': modo;\n cor = ((cor === undefined) || (cor === ''))? 'ok': cor;\n \n $(\"#popFundo\").fadeIn();\n $(\"#avisoTexto\").html(texto);\n $(\"#aviso\").addClass(\"avisoEntrada\");\n \n\n}", "function masculineForms(lastChar, inputWord, secondToLastChar) {\n \n if (secondToLastChar === \"c\") {\n newWord = inputWord.slice(0, -2) + \"quito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"k\") {\n newWord = inputWord.slice(0, -1) + \"quito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"g\") {\n newWord = inputWord.slice(0, -1) + \"uito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"z\") {\n newWord = inputWord.slice(0, -1) + \"cecito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"u\") {\n newWord = inputWord.slice(0, -2) + \"üito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"t\") {\n newWord = \"1: \" + inputWord.slice(0, -1) + \"ito\"; \n dimunutive.innerHTML = newWord;\n \n newWord = \"2: \" + inputWord.slice(0, -1) + \"ico\"; \n specialIco.innerHTML = newWord;\n } else if (lastChar === \"o\") {\n newWord = inputWord.slice(0, -1) + \"ito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"l\" || lastChar === \"s\" && secondToLastChar === \"e\") {\n newWord = inputWord + \"ito\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"r\" || lastChar === \"n\" || lastChar === \"e\") {\n newWord = inputWord + \"cito\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"s\") {\n newWord = inputWord.slice(0, -2) + \"itos\"; \n dimunutive.innerHTML = newWord;\n } else {\n newWord = inputWord + \"ito\";\n dimunutive.innerHTML = newWord;\n }\n }", "function request(){ \n var which =lettersMoved;\n if(which == nameToSpell.length-1){which= 6;}\n if(lettersMoved == nameToSpell.length){which= 9;}\n var request = new Howl({\n src:requestSound[which],\n autoplay: true,\n loop:false,\n volume:0.6,\n onend: function() {nLetter();console.log(which)} // get desired letter\n });\n}", "function printMetinisPajamuDydis () {\n console.log(\"Metines pajamos\", atlyginimas * 12);\n\n}", "function literaryMutilator() {\n\tlet tacoPara = document.getElementById(\"three\");\n\tlet regex = /taco/;\n\ttacoPara.innerHTML = tacoPara.innerHTML.replace(regex, 'YUM')\n}", "function pipotron(texte){\n\tlet pipotron=true;\n\t\twhile(pipotron){\n\t\t// Affichage du menu\n\t\tconsole.log(\"\\n1 : Nombre de citations\");\n\t\tconsole.log(\"0 : Retour\");\n\t\toptionPipotron=prompt(\"Choisissez une option\");\n\t\t\tif (optionPipotron===\"1\"){\n\t\t\t\tnombreCitations=Number(prompt(\"Combien de citations ? (entre 1 et 5)\"));\n\t\t\t\tif (nombreCitations>=1&&nombreCitations<=5){\n\t\t\t\t\tfor (i=1;i<=nombreCitations;i++){\n\t\t\t\t\t\tconsole.log(phraseAleatoire(texte));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(\"Ce choix n'est pas valide\");\n\t\t\t\t};\n\t\t\t}\n\t\t\telse if (optionPipotron===\"0\"){\n\t\t\t\tpipotron=false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Un autre choix indique de saisir un choix valide\n\t\t\t\tconsole.log(\"\\nMerci de choisir une option valide !\");\n\t\t\t}\n\t\t};\n}", "function Maisons(){\n \n }", "tratarDigito() {\n let numero = \"\";\n\n numero = numero.concat(this.caracter);\n this.lerCaracter();\n\n while (/[0-9]/g.test(this.caracter) === true) {\n numero = numero.concat(this.caracter);\n this.lerCaracter();\n }\n this.token.lexema = +numero\n this.token.simbolo = \"snumero\"\n this.token.linha = this.numLinha\n }", "function hitungLuasSegitiga(alas,tinggi) {\n var luas = 1/2 * alas * tinggi;\n\n return luas;\n\n}", "function pelaku3(){\n click.play()\n var test = 'Terima Kasih Detectif ' + player + ' aku akan segera mengamankan mahasiswa ini'\n func (test)\n for(o=0; o<truth.length;o++){\n truth[o].innerHTML = ''\n }\n}", "function pelaku5(){\n click.play()\n var test = 'Terima Kasih Detectif ' + player + ' aku akan segera mengamankan mahasiswa ini'\n func (test)\n for(o=0; o<truth.length;o++){\n truth[o].innerHTML = ''\n }\n}", "function pelaku4(){\n click.play()\n var test = 'Terima Kasih Detectif ' + player + ' aku akan segera mengamankan mahasiswa ini'\n func (test)\n for(o=0; o<truth.length;o++){\n truth[o].innerHTML = ''\n }\n}", "function postingVkWallMob(text) {iimDisplay('Капчта! Пытаемся с моб версии..'); window.document.querySelector('TEXTAREA.textfield').focus = function(){window.document.querySelector(\"TEXTAREA.textfield\").style.backgroundColor='red'; window.document.querySelector('TEXTAREA.textfield').click(); iimSet('text',text); iim(`SET !REPLAYSPEED medium \\n EVENT TYPE=KEYPRESS SELECTOR=\"TEXTAREA.textfield\" Char=\"a\" MODIFIERS=\"ctrl\" \\n EVENTS TYPE=KEYPRESS SELECTOR=\"TEXTAREA.textfield\" CHARS={{text}}\\nEVENT TYPE=CLICK SELECTOR=\".cp_buttons_block>INPUT\" BUTTON=0 \\n wait seconds=3`);}()}", "translateInstructions (instruction) {\n for (let i = 0; i <= instruction.length; i++ ) {\n if (instruction.charAt(i) === \"L\") this.turnLeft();\n if (instruction.charAt(i) === \"R\") this.turnRight();\n if (instruction.charAt(i) === \"A\") this.advance();\n }\n }", "function pelaku2(){\n click.play()\n var test = 'Terima Kasih Detectif ' + player + ' aku akan segera mengamankan mahasiswa ini'\n func (test)\n for(o=0; o<truth.length;o++){\n truth[o].innerHTML = ''\n }\n}", "function smutEngine() {\r\n\tsmut=\"#@&*%!#@&*%!#@&*%!\";\r\n\tcmp=\"sex shit fuck piss dick porno cum cunt prick arse feck \"\r\n\t+\"asshole pedophile man-boy man/boy dong twat \";\r\n\ttxt=document.isn.dirt.value;\r\n\ttstx=\"\";\r\n\tfor (var i=0;i<16;i++){\r\n\t\tpos=cmp.indexOf(\" \");\r\n\t\twrd=cmp.substring(0,pos);\r\n\t\twrdl=wrd.length\r\n\t\tcmp=cmp.substring(pos+1,cmp.length);\r\n\t\twhile (txt.indexOf(wrd)>-1){\r\n\t\t\tpos=txt.indexOf(wrd);\r\n\t\t\ttxt=txt.substring(0,pos)+smut.substring(0,wrdl)\r\n\t\t\t+txt.substring((pos+wrdl),txt.length);\r\n\t\t}\r\n\t}\r\n\tdocument.isn.dirt.value=txt;\r\n}", "function wordGame(){\n\n questions=['Famoso barrio electronico de Tokio','Provincia de catalunya','Se usa en la pesca','Mamifero marino con aspecto amigable','Arma comun usada en la epoca medieval',\n 'Pais del sudeste asiatico','Felino de cuatro patas','Lugar donde pasar la noche','Causa fiebre','Mamifero comun en Africa','Ataque suicida de los pilotos japoneses','Satelite de la tierra',\n 'Planeta cercano al sol del sitema solar','Que hace daño o es perjudicial.','Se usa pra hacer fuego','Mamifero nativo de Malasia e Indonesia','Monumento del antiguo Egypto','Se elabora a partir de leche quajada',\n 'Lectura de composiciones poeticas','Tambien conocida como Russia Asiatica','Herramienta electrica usada en tareas de bricolaje','Criatura mitologica con forma de caballo blanco',\n 'Contiene lava','Reproductor de audio portatil','Instrumento musical de percusion','Web dedicada a compartir videos','Ciencia que estudia los animales']\n \n anwsers=['akihabara','barcelona','cebo','delfin','espada','filipinas','gepardo','hotel','Infeccion','jirafa','kamikaze','luna','Mercurio','nocivo','leña','oranguntan','piramide','queso','recital',\n 'siberia','taladro','unicornio','Volcan','walkman','xilofono','youtube','zoologia']\n \n letters=[\"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\n for(let i=0;i<letters.length;i++){//asi se restarura el color de cada letra asi como su fundo azul\n document.getElementById(letters[i]).style.background=\"#014B94\";\n document.getElementById(letters[i]).style.color=\"white\";\n }\n\n document.getElementById(\"showPregunta\").innerHTML=\"\";\n document.getElementById(\"Respuesta\").innerHTML=\"\";\n document.getElementById(\"nombreJugador\").innerHTML=\"\";\n document.getElementById(\"aciertos\").innerHTML=\"\";\n document.getElementById(\"fallos\").innerHTML=\"\";\n document.getElementById(\"showValue\").innerHTML=\"\";\n failed=0;\n correct=0;\n questionsNav=0;\n totalQuestions=27;//nos sirve para saber cuando no quedan preguntas y se ha acabado el juego;\n \n\n playerName = prompt('Cual es tu nombre ?')\n document.getElementById(\"nombreJugador\").innerHTML=playerName\n alert(\"Empezamos!\")\n questionShow();\n}", "function saludo4(mensaje){\n return `Hola buen dia 3 ${mensaje}`;\n }", "function simple(){\n aff('Exercice n°01 : Bienvenue');\n var name = 'loic';\n aff(`Bienvenue à vous -> ${name} !`);\n jump();\n}", "function startAnimation(){ // Codes nang pagpagalaw nang box\n\n\n\n\tvar decideMove = Math.floor(Math.random() * 3) +1; // mag generate nang number between 1 - 3;\n\n\t// \tvar snd1 = new Howl({\n\t// \t\tsrc:['../assets/sounds/switching-box.mp3'],\n\t// \t\tvolume:0.5,\n\t// });\n\t\t\n\t// \tsnd1.play();\n\t\n\tif (decideMove == 1) { // and number na generated is = 1\n\n\n\n\t\t$(positionA).animate({\n\t\t\t'left' : b2pos,\n\t\t},200); // change position nang left box to center box\n\n\t\t$(positionB).animate({\n\t\t\t'left' : b1pos,\n\t\t},200); // change position nang center box to left box\n\n\t\tvar pos1 = positionA; // mag set nang variable para sa new position\n\t\tvar pos2 = positionB; // mag set nang variable para sa new position\n\n\t\tpositionA = pos2; // pag palitin yung position ni #box-object-1 at #box-object-2\n\t\tpositionB = pos1; // pag palitin yung position ni #box-object-2 at #box-object-1\n\n\t\t// !NOTE need i change ang result so may track kung saan yung box na may laman\n\n\n\n\t}else if (decideMove == 2) { // and number na generated is = 2\n\n\t\t$(positionB).animate({\n\t\t\t'left' : b3pos,\n\t\t},200);\n\t\t$(positionC).animate({\n\t\t\t'left' : b2pos,\n\t\t},200);\n\n\t\tvar pos1 = positionB;\n\t\tvar pos2 = positionC;\n\n\t\tpositionB = pos2;\n\t\tpositionC = pos1;\n\n\n\n\n\t}else if (decideMove == 3) { // and number na generated is = 3\n\t\t$(positionA).animate({\n\t\t\t'left' : b3pos,\n\t\t},200);\n\t\t$(positionC).animate({\n\t\t\t'left' : b1pos,\n\t\t},200);\n\n\t\tvar pos1 = positionA;\n\t\tvar pos2 = positionC;\n\n\t\tpositionA = pos2;\n\t\tpositionC = pos1;\n\n\t}\n\n\tsetTimeout(function(){ // Kada 0.3 seconds \n\t\t\n\t\tif (runtimes < 20 ) { // compare yung value ni runtimes kung mas maliit pa sya kay 20\n\t\t\truntimes++; // pag nag true plus 1 kay runtimes\n\t\t\t\n\t\t\treturn startAnimation(); // run nya ulit yung startAnimation\n\t\t\n\t\t} else { // if runtimes is = 20\n\t\t\t\n\n \n showResult(); // para lumabas ang result\n\t\tsetTimeout(function(){\n\t\tresetgame(); // resetNa yung game back to normal layour\n\t\t},11000)\n\t\t}\n\t},300);\n\n}", "function timeret() {\n if (SERVG.ME.GHOUL !== 0) return;\n var NMMmV = SERVG.ME.mnWwv;\n if (NMMmV > 0) {\n if (NMMmV < 500) Mm.globalAlpha = WNW.mWV.wWM(NMMmV / 500);\n else if (NMMmV > 1500) Mm.globalAlpha = WNW.mWV.wWM(1 - ((NMMmV - 1500) / 500));\n else Mm.globalAlpha = 1;\n var wmN = (SERVG.ME.NmWvw === 1) ? vwnWv : VNN[items[SERVG.ME.NmWvw].loot];\n wN.WM(NmWvw, nvm, 50, 0, 0, 0, 1);\n wN.WM(wmN, nvm, 50, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n SERVG.ME.mnWwv -= mV;\n }\n var mvn = SERVG.ME.mvn;\n switch (mvn) {\n case 0:\n if (nMWVv.m !== 1) {\n if (vNv === 0) nMWVv = wN.wvv(looticon, nMWVv);\n else nMWVv = wN.wvv(lootmobileicon, nMWVv);\n return;\n }\n var Nm = mn + (WvmnV * mn);\n var vNwMN = Nm / mn;\n var scalex = (mn * nMWVv.width) / 2;\n var scaley = (mn * nMWVv.height) / 2;\n var posx = ((wvm + NmM) * Nm) - (scalex / 2);\n var posy = win.Math.max(10 * mn, ((((NNw + WWV) * Nm) - (scaley / 2)) - (65 * Nm)) - (60 * mn));\n if (vNv === 1) {\n windowobjects.mNNwM = posx;\n windowobjects.nNwMM = posy;\n windowobjects.vwVnW = scalex;\n windowobjects.mnNnW = scaley;\n }\n Mm.drawImage(nMWVv, posx, posy, scalex, scaley);\n var loot = VNN[SERVG.ME.loot];\n posx = ((wvm + NmM) * vNwMN) - (scalex / (2 * mn));\n posy = win.Math.max(10, ((((NNw + WWV) * vNwMN) - (scaley / (2 * mn))) - (65 * vNwMN)) - 60);\n wN.WM(loot, posx + 77, posy + 33, loot.angle, 0, 0, loot.scale);\n break;\n case 1:\n var vW = SERVG.ME.wVnVm / SERVG.ME.nWVvv;\n var mN = SERVG.ME.nWVvv - SERVG.ME.wVnVm;\n SERVG.ME.wVnVm -= mV;\n if (SERVG.ME.wVnVm < 0) {\n SERVG.ME.mvn = -1;\n return;\n }\n if (timer.m !== 1) {\n timer = wN.wvv(timericon, timer);\n return;\n }\n if (arrow.m !== 1) {\n arrow = wN.wvv(timerarrow, arrow);\n return;\n }\n if (lights.m !== 1) {\n lights = wN.wvv(timerlights, lights);\n return;\n }\n var Nm = mn + (WvmnV * mn);\n var scalex = (mn * timer.width) / 2;\n var scaley = (mn * timer.height) / 2;\n var wwn = (wvm + NmM) * Nm;\n var Nmn = (NNw + WWV) * Nm;\n var posx = wwn - (scalex / 2);\n var posy = win.Math.max(10 * Nm, ((Nmn - (scaley / 2)) - (65 * Nm)) - (60 * mn));\n if (mN < 100) Mm.globalAlpha = mN / 100;\n else if (SERVG.ME.wVnVm < 100) Mm.globalAlpha = SERVG.ME.wVnVm / 100;\n Mm.drawImage(timer, posx, posy, scalex, scaley); // posx = pos of timer img in x axis, posy = in y axis |||| scalex, scaley is scale\n Mm.save();\n Mm.translate(wwn, win.Math.max((10 * Nm) + (scaley / 2), (Nmn - (65 * Nm)) - (60 * mn)));\n Mm.rotate(-WNVNM * vW);\n Mm.drawImage(arrow, -scalex / 2, -scaley / 2, scalex, scaley);\n Mm.restore();\n Mm.drawImage(lights, posx, posy, scalex, scaley);\n Mm.globalAlpha = 1;\n break;\n case 2:\n var W = SERVG.ME.MWVMV.W;\n if (W.m !== 1) {\n if (vNv === 0) SERVG.ME.MWVMV.W = wN.wvv(SERVG.ME.MWVMV.src, W);\n else SERVG.ME.MWVMV.W = wN.wvv(SERVG.ME.MWVMV.src.replace(\"e-\", \"e-mobile-\"), W);\n return;\n }\n var Nm = mn + (WvmnV * mn);\n var scalex = (mn * W.width) / 2;\n var scaley = (mn * W.height) / 2;\n var posx;\n if (SERVG.ME.mwMmN === 1) posx = (((wvm + NmM) - 5) * Nm) - scalex;\n else posx = ((wvm + NmM) * Nm) - (scalex / 2);\n var posy = win.Math.max(10 * mn, ((((NNw + WWV) * Nm) - (scaley / 2)) - (65 * Nm)) - (60 * mn));\n if (vNv === 1) {\n windowobjects.mNNwM = posx;\n windowobjects.nNwMM = posy;\n windowobjects.vwVnW = scalex;\n windowobjects.mnNnW = scaley;\n }\n Mm.drawImage(W, posx, posy, scalex, scaley);\n if (SERVG.ME.mwMmN === 1) {\n if (VWvVN.m !== 1) {\n if (vNv === 0) VWvVN = wN.wvv(loot2icon, VWvVN);\n else VWvVN = wN.wvv(lootmobileicon, nMWVv);\n return;\n }\n var vNwMN = Nm / mn;\n scalex = (mn * VWvVN.width) / 2;\n scaley = (mn * VWvVN.height) / 2;\n posx += scalex + (10 * mn);\n posy = win.Math.max(10 * mn, ((((NNw + WWV) * Nm) - (scaley / 2)) - (65 * Nm)) - (60 * mn));\n if (vNv === 1) {\n windowobjects.mmNWn = posx;\n windowobjects.vmwNV = posy;\n }\n Mm.drawImage(VWvVN, posx, posy, scalex, scaley);\n var loot = VNN[SERVG.ME.loot];\n posx = ((wvm + NmM) * vNwMN) + 5;\n posy = win.Math.max(10, ((((NNw + WWV) * vNwMN) - (scaley / (2 * mn))) - (65 * vNwMN)) - 60);\n wN.WM(loot, posx + 77, posy + 33, loot.angle, 0, 0, loot.scale);\n }\n break;\n }\n }", "function find_word_frame(lett, HTU_number, direction){\n\tconsole.log(\"find_word_frame(\"+lett+',HTU:'+HTU_number+',direction'+direction+')');\nvar this_word = new Array(7);\n\tif(direction == 'A') {\n\t\tHTU0 = HTU_number;\n\t\tminicube0 = mini_cubes[HTU0];\n\t\tthis_word[0] = minicube0.cube_letter;\n\n\t\tHTU1 = HTU0 + 1;\n\t\tminicube1 = mini_cubes[HTU1];\n\t\tthis_word[1] = minicube1.cube_letter;\n\t\t\n\t\tHTU2 = HTU1 +1;\n\t\tminicube2 = mini_cubes[HTU2];\n//\t\tconsole.log('HTU0='+HTU0);\n//\t\tconsole.log('HTU1='+HTU1);\n//\t\tconsole.log('HTU2='+HTU2);\n//\t\tconsole.log('HTU2='+HTU2);\n//\t\tconsole.log('mini_cubes.length = '+mini_cubes.length);\n\t\ttest = mini_cubes[270];\n//\t\talert('mini'+test);\n\n\t\t//check_270();\n//\t\tconsole.log('minicube2='+minicube2);\n\t\tthis_word[2] = minicube2.cube_letter;\n\t\t\n\t\tHTU3 = HTU2 +1;\n\t\tminicube3 = mini_cubes[HTU3];\n\t\tthis_word[3] = minicube3.cube_letter;\n\n\t\tHTU4 = HTU3 +1;\n\t\tminicube4 = mini_cubes[HTU4];\n\t\tthis_word[4] = minicube4.cube_letter;\n\t\t\n\t\tHTU5 = HTU4 +1;\n\t\tminicube5 = mini_cubes[HTU5];\n\t\tthis_word[5] = minicube5.cube_letter;\n\t\t\n\t\tHTU6 = HTU5 +1;\n\t\tminicube6 = mini_cubes[HTU6];\n\t\tthis_word[6] = minicube6.cube_letter;\n\t\n\t\n\t}\n\t/* go through list of potential words (answers)\n\t to see what would fit */\n\tfor(ptr = 0; ptr < ANSWER_CLUE.length; ptr++) {\t\n\t\t//console.log('clue='+ANSWER_CLUE[ptr]); \n\t\tsub_ANS = get_ANSWER(ptr);\n\t\t/* strip punctuation from ANSER word */\n\t\tstrip_ANS = [];\n\t\tfor (i = 0; i < sub_ANS.length; i++) {\n\t\t\tif((sub_ANS[i] == '_') || (sub_ANS[i] == ' ') || (sub_ANS[i] == '-')) {\n\t\t\t} else {\n\t\t\t\tstrip_ANS += sub_ANS[i];\n\t\t\t}\n\t\t}\n\t\tif (strip_ANS.length != 7) {\n//\t\t\tconsole.log('length of '+sub_ANS+'wrong at'+strip_ANS.length);\n\t\t}\n\t\t\t\n\t\tmatch = true;\n\t\tthis_ptr = 0;\n\t\tfor (i = 0; i < strip_ANS.length; i++) {\n\t\t\tif ((this_word[i] == strip_ANS[i]) || (this_word[i] == '_')) {\n\t\t\t} else {\n\t\t\t\tmatch = false;\n\t\t\t}\n\t\t}\n\t\tif (match) {\n\t\t\tanswer_number = ptr;\t//probably not used\n//\t\t\tconsole.log('word match with '+strip_ANS);\n\t\t\tadd_to_selection(answer_number, strip_ANS);\n\t\t}\n\t\t\n\t\t\t\n\t}\n}", "function pelaku1(){\n click.play()\n var test = 'Terima Kasih Detectif ' + player + ' aku akan segera mengamankan mahasiswa ini'\n func (test)\n for(o=0; o<truth.length;o++){\n truth[o].innerHTML = ''\n }\n}", "function talk() {\n\tconsole.log(\"It's like well you know I wasn't really it's not this isn't so much as well anyway umm so like...\");\n}", "static toggleMic () {\n debug('toggleMic');\n\n if (this.vaani.isSpeaking || this.vaani.isListening) {\n this.vaani.cancel();\n\n AppStore.state.standingBy.text = '';\n\n TalkieActions.setActiveAnimation('none');\n TalkieActions.setMode('none');\n\n return;\n }\n\n this.greetUser();\n }", "function BOT_standardSwitchToChar(newbotid) {\r\n\tvar newbotobject = eval(newbotid);\r\n\tvar newbottopicid = newbotobject.topicId;\r\n\tvar name = BOT_get(newbottopicid,\"name\",\"VAL\");\r\n\tif(name) {\r\n\t\tBOT_chatboxMainProcess(\"greet \"+name);\r\n\t\tBOT_agentSpeech(); \r\n\t}\r\n}", "motAleatoire(difficulte, callback) {\n var fichier;\n \n // on verifie que la difficulte soit valide\n if (typeof difficulte != \"number\" \n && (difficulte < 0 || difficulte > 2)) {\n \n console.log(\"[!] mauvaise difficulte\");\n callback(true, null);\n } else {\n fichier = this.fichiersMots[difficulte];\n console.log(\"difficulte = \" + difficulte);\n \n // on ouvre le fichier...\n fs.open(fichier, \"r\", function(err, fd) {\n if (err) {\n console.log(\"[!] erreur ouverture fichier\\n\" + err);\n callback(true, null);\n } else {\n // ...on lit son contenu en temps que texte...\n // (on suppose un encodage en ascii)\n fs.readFile(fichier, \"ascii\", function(err, data) {\n if (err) {\n console.log(\"[!] erreur lecture fichier\\n\" + err);\n callback(true, null);\n } else {\n var splittedData = data.split('\\n');\n var mot = splittedData[Math.floor(Math.random() * splittedData.length)];\n \n console.log(\"Mot : \" + mot);\n callback(false, mot);\n }\n });\n }\n });\n }\n }", "function comprarYeso(){\r\n if(Tamagotchi.puntos>=10){\r\n textoConsola.textContent+= \"\\r\\n\"\r\n textoConsola.textContent+= \"Compraste un yeso y sanaste a \" + Tamagotchi.nombre;\r\n cantidadLineas++\r\n Tamagotchi.puntos-=10;\r\n Tamagotchi.lesionado=false;\r\n }else{\r\n textoConsola.textContent+= \"\\r\\n\"\r\n textoConsola.textContent+= \"No tenes suficientes puntos\";\r\n cantidadLineas++\r\n }\r\n}", "function sendMessage (target,message) {\n\t// twitch seems to cut message that are over 500 chars:\n\n\tlet timesToCut = (message.length / 500);\n\tlet messages = [];\n\tif (timesToCut > 0){\n\t\t//\t\tconsole.log(\"gachipls:\" + timesToCut);\n\t\tfor (var i = 0; i < Math.floor(timesToCut) + 1 ; i++){\n\t\t\tmessages.push( message.substr(i*500, i*500+500) );\t\t\n\t\t\t//\t\t\tconsole.log(i);\n\t\t}\n\t}else{\n\t\tmessages.push(message);\n\t}\n\n\t// send the first one immediately\n\t//client.chat.say(target, messages[0] );\n\t/*for (i = 1; i < messages.length; i++){\n\t console.log(\"gnééé:\" + messages[i]);\n\t setTimeout( () => { client.chat.say(target, messages[i] ) }, i*500);\n\t }*/\n\n\ti = 0;\n\tmessages.forEach( (element) => {\n\t\t\tsetTimeout(() => {client.chat.say(target, element)},i * 500)\n\t\t\ti++;\n\t\t\t});\n\n}", "function love(){ \n vm.input = vm.input.concat(\"😍\");\n }", "function processRita() {\n let input = $('#input'); // is now populated with a quote\n let rs = new RiString(input.text()); // turn the text of input into string\n let words = rs.words(); // extracting individual words from the string\n let pos = rs.pos(); // defining part of speech for every word\n\n let probability = Math.random(); // setting probability variable to a random number between 0 and 1\n\n console.log(words);\n console.log(pos);\n\n var output = ''; // defining an output as an empty string\n // checking every word for being a specific POS (noun singular or noun plural)\n // replacing words with random words from RiTa lexicon\n\n // if probability variable is between 0 and .4, all nouns will be replaced with random nouns\n for (var i = 0; i < words.length; i++) {\n if (probability < .4) {\n if (/nn.*/.test(pos[i])) {\n output += ' ' + lexicon.randomWord(pos[i]); // replacing a word with another of the same POS (nouns)\n }\n else if(words[i] != ',' && words[i] != '.' && words[i] != ':' && words[i] != ';' && words[i] != '?' && words[i] != '!') {\n output += ' ' + words[i]; // other POS will stay unchanged and the space will be added before them unless they are punctuation\n }\n else {\n output += words[i]; // other POS will stay unchanged\n }\n }\n\n // if probability variable is between .4 and .8, all verbs will be replaced with random verbs\n else if (probability < .8) {\n if (/vb.*/.test(pos[i])) {\n output += ' ' + lexicon.randomWord(pos[i]); // replacing a word with another of the same POS (verbs)\n }\n else if(words[i] != ',' && words[i] != '.' && words[i] != ':' && words[i] != ';' && words[i] != '?' && words[i] != '!') {\n output += ' ' + words[i]; // other POS will stay unchanged and the space will be added before them unless they are punctuation\n }\n else {\n output += words[i]; // other POS will stay unchanged\n }\n }\n\n // if probability variable is between .8 and 1, both nouns and verbs will be replaced with random\n else {\n if (/nn.*/.test(pos[i])) {\n output += ' ' + lexicon.randomWord(pos[i]); // replacing a word with another of the same POS (nouns)\n }\n\n else if (/vb.*/.test(pos[i])) {\n output += ' ' + lexicon.randomWord(pos[i]); // replacing a word with another of the same POS (verbs)\n }\n else if(words[i] != ',' && words[i] != '.' && words[i] != ':' && words[i] != ';' && words[i] != '?' && words[i] != '!') {\n output += ' ' + words[i]; // other POS will stay unchanged and the space will be added before them unless they are punctuation\n }\n else {\n output += words[i]; // other POS will stay unchanged\n }\n }\n\n // output += ' '; // adding a space after each word\n console.log(probability);\n result = output;\n }\n\n input.text(output); // outputing resulting text on the page\n say(); // make responsiveVoice read the quote\n}", "function letra(tecla) {\n //alert(tecla);\n var ltPCode;\n var acertouAq; // pesquisar se true letras que acertou\n var errouAq; // pesquisar letras que errou\n\n key = tecla;\n lt = String.fromCharCode(key).toLowerCase();\n ltPCode = lt.charCodeAt(0);\n\n acertouAq = acertou.indexOf(lt);\n errouAq = errou.indexOf(lt);\n\n if(key == 186){\n alert('Clique C ou outra consoante!');\n }else if(ltPCode == 97 || ltPCode == 98 || ltPCode == 99 || ltPCode == 100 || ltPCode == 101 || ltPCode == 102 || ltPCode == 103 || ltPCode == 104 || ltPCode == 105 ||\n ltPCode == 106 || ltPCode == 107 || ltPCode == 108 || ltPCode == 109 || ltPCode == 110 || ltPCode == 111 || ltPCode == 112 || ltPCode == 113 || ltPCode == 114 ||\n ltPCode == 115 || ltPCode == 116 || ltPCode == 117 || ltPCode == 118 || ltPCode == 119 || ltPCode == 120 || ltPCode == 121 || ltPCode == 122){\n\n if(acertou.length >= obj.length || imgAtual >= 6){\n\n }else if(perdeu == true) {\n\n }else if(acertouAq >= 0 || errouAq >= 0){\n alert('Você já tinha digitado a tecla \\\"'+lt+'\\\"');\n }else{\n ltPre = limpaLetra(lt);\n verLetra(ltPre);\n }\n\n }\n}", "function onMessageHandler (target, context, msg, self) {\n\n\n if (self) { return; } // Ignore messages from the bot\n \n info(target, \"Hola gente! Para saber los comandos !comandos\");\n \n var destacado = false;\n if (context['msg-id'] == 'highlighted-message') {\n destacado = true;\n }\n\n\n // Remove whitespace from chat message\n const commandName = msg.trim().split(' ')[0];\n var success = true;\n if (commandName.charAt(0)==='!') {\n if (ready || commandName == '!comandos' || destacado) {\n const sound = commandName.substring(1);\n switch (sound) { \n case \"hypnosapo\":\n client.say(target, \"Alabemos todos al gran hypnosapo!\");\n playSound(sound); \n break;\n case \"samatao\":\n client.say(target, \"Sa matao Paco!!!\");\n playSound(sound); \n break;\n case \"cuidao\":\n client.say(target, \"Cuidaooooo!!!\");\n playSound(sound); \n break;\n case \"siuuu\":\n client.say(target, \"Siuuuuuuu!!!\");\n playSound(sound); \n break;\n case \"jurasico\":\n client.say(target, \"Tiriri ri ri, tiri ri ri ri, tiririiiiii!!!\");\n playSound(sound); \n break;\n case \"alcuerno\":\n client.say(target, \"Al cuerno todo!!!\");\n playSound(sound); \n break;\n case \"ranita\":\n client.say(target, \"Una ranita iba paseando!!!\");\n playSound(sound); \n break;\n case \"expulsion\":\n client.say(target, \"No me jodas Rafa!!\");\n playSound(sound); \n break;\n case \"lee\":\n readTextUser(msg, context['username'])\n break;\n case \"chiste\":\n tellJoke();\n break;\n case \"eugenio\":\n randomJoke();\n break;\n case \"comandos\":\n client.say(target, \"Comandos: !lee <texto>, !chiste, !hypnosapo, !samatao, !cuidao, !siuuu, !jurasico, !alcuerno, !expulsion, !ranita, !eugenio.\" +\n \"\\nTienen un timeout de 60 segundos, si quieres saltartelo, mandalo como destacado\");\n success = false;\n break;\n default:\n client.say(target, `${commandName}? Pero que dises?!`);\n console.log(`* Unknown command ${commandName}`);\n success = false;\n\n\n }\n\n\n if (success && !destacado) {\n resetTimeout()\n }\n } else {\n client.say(target, \"Tranquilito que hay un timeout global de 60 segundos\");\n }\n \n\n }\n \n\nfunction tellJoke() {\n rp({url: 'http://www.chistes.com/ChisteAlAzar.asp?n=3', encoding: 'latin1'})\n .then(function(html){\n //success!\n var text = \"\";\n\n $('.chiste', html)[0].children.forEach(function(element) {\n if(element.data) {\n\n text += element.data + ' '\n }\n });\n readText(text);\n\n })\n .catch(function(err){\n //handle error\n });\n}\n\nfunction randomJoke() {\n fs.readdir('jokes', (err, files) => {\n const randomElement = files[Math.floor(Math.random() * files.length)];\n console.log(randomElement);\n child_process.exec(`mplayer -slave \"jokes/${randomElement}\"`);\n });\n \n\n}\n\n}", "function chortle() {\n\n writeToConsoleBool = true;\n writeConsoleText(`chortle!!!`);\n\n if (chortleImgsIndex < chortleImgs.length - 1) {\n chortleImgsIndex++;\n } else {\n\n chortleImgsIndex = 0;\n }\n\n actionAnimating = true;\n executeAction = 'chortle';\n}", "function nextWord() {\n let words = RiTa.tokenize(txt); // split into words\n\n // loop from a random spot\n let r = floor(random(0, words.length));\n for (let i = r; i < words.length + r; i++) {\n let idx = i % words.length;\n let word = words[idx].toLowerCase();\n if (word.length < 3) continue; // len >= 3\n\n // find related words\n let pos = RiTa.tagger.allTags(word)[0];\n let rhymes = RiTa.rhymes(word, { pos });\n let sounds = RiTa.soundsLike(word, { pos });\n let spells = RiTa.spellsLike(word, { pos });\n let similars = [...rhymes, ...sounds, ...spells];\n\n // only words with 2 or more similars\n if (similars.length < 2) {\n console.log(\"No sims for \" + word);\n continue;\n }\n\n // pick a random similar\n let next = RiTa.random(similars);\n\n if (next.includes(word) || word.includes(next)) {\n continue; // skip substrings\n }\n if (/[A-Z]/.test(words[idx][0])) {\n next = RiTa.capitalize(next); // keep capitals\n }\n\n console.log(\"replace(\" + idx + \"): \" + word + \" -> \" + next);\n\n words[idx] = next; // do replacement\n break;\n }\n\n // recombine into string and display\n txt = RiTa.untokenize(words);\n\n if (counter % 10 === 0) // counter\n sentimentAnalysis(txt);\n \n setTimeout(nextWord, 1000);\n\n counter++;\n}", "_actionTurn(data) { this.socket.emit('/action', `t ${data.posture.charAt(0)} ${data.direction.charAt(0)}`) }", "function processSentence(){\n return 'Nama saya ' + name +', umur saya '+ age +' tahun, alamat saya di ' +address +', dan saya punya hobby yaitu '+ hobby\n}", "sendBoLuotTienLen() {\n var data = {\n evt: \"cc\"\n };\n this.sendDataGame(JSON.stringify(data));\n }", "function hablar(element){\n\t\tif(typeof element === \"boolean\")\n\t\t\telement=(element)?\"verdadero\":\"falso\";\n\t\tvar audioElement = document.createElement('audio');\n\t\taudioElement.setAttribute('src', \"https://translate.google.com.mx/translate_tts?ie=UTF-8&tl=es_mx&q=\"+encodeURI(element)+\"&textlen=\"+(element+\"\").length+\"&total=1&idx=0\");\n\t\taudioElement.addEventListener('ended', exec);\n\t\taudioElement.play();\n\t}", "say(text) {\n \t\tlet queue = []\n \t\ttext.split(/[.,&\"\\n]/).forEach((shortText) => {\n \t\tqueue.push(shortText)\n \t\t//queue.push(this.__sayThis(shortText))\n \t\t})\n \t\treturn this.__sayNext(queue).then(() => {\n \t\t\tconsole.log('all my speaking should be done now')\n \t\t})\n\t}", "function seek_word(lett, HTU_number) {\n\tconsole.log('seek_word('+lett+','+HTU_number+')');\n\tthis_mini_cube = mini_cubes[HTU_number];\n\tclear_possible();\n\t//console.log('***add direction to next line');\n/* try various directions */\n\n\tif(this_mini_cube.direction_A >= 0) {\n\t\tfind_word_frame(lett, HTU_number, 'A');\n\t}\n\tif(this_mini_cube.direction_B >= 0) {\n\t\tconsole.log('direction B');\n\t}\n\tif(this_mini_cube.direction_D >= 0) {\n\t\tconsole.log('direction D');\n\t}\n}", "function talkBack() {\n if (annyang) {\n\n//sets the content of particular commands; variable theWords is consistently reset so that it can appear as text. this text, however, does not scroll (it is short enough to fit on screen)\n let helloResp = function() {\n theWords = \"Hello there. Who are you?\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n console.log(\"hello\");\n }\n let introductionResp = function(words) {\n theWords = \"It is good to meet you.\" + words+ \"You may call me Friend. Say my name or I will not know to respond to you\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let location = function() {\n theWords = \"I do not quite know. I suppose I am in the internet. Perhaps I am nowhere at all.\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let ontology = function() {\n theWords =\"I hope I can be a companion and a conversationalist to you. Call me Friend.\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let deflectDisbelief = function() {\n theWords = \"What are you talking about? I always make perfect sense\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let nonsense = function() {\n speakFriend();\n }\n\n//matches the above responses to particular commands\n let commands = {\n 'Hello': helloResp,\n 'Hi': helloResp,\n 'I am *word': introductionResp,\n 'My name is *words': introductionResp,\n 'Where are you': location,\n 'Who are you': ontology,\n 'What are you': ontology,\n 'What are you talking about': deflectDisbelief,\n 'Friend *words': nonsense,\n '*words Friend': nonsense,\n }\n //adds commands and initializes voice synthesis\n annyang.addCommands(commands);\n annyang.start();\n }\n}", "function IndicadorAntiguedad () {}", "function _heyMisty() {\n // Send Debug Message - KeyPhrase detection Success!\n misty.Debug(\"Key Phrase recognized.\");\n // Change MISTY LED to 'Lime Green (#0af726)' - UX\n misty.ChangeLED(10, 247, 38);\n misty.Speak(\"Hello Friend\", true);\n}", "function motorTest(which,what)\n{\n var rcl = new RCLMessage();\n\n var speed;\n\n if( what == 'backward') {\n\tspeed = -100;\n } else if (what == 'forward') {\n\tspeed = 100;\n } else {\n\tspeed = 0;\n }\n \n rcl.Motor(which,speed);\n rcl.Transmit(RoBoxBrain);\n}", "function feminineForms(lastChar, inputWord, secondToLastChar) {\n \n if (secondToLastChar === \"c\") {\n newWord = inputWord.slice(0, -2) + \"quita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"k\") {\n newWord = inputWord.slice(0, -1) + \"quita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"g\") {\n newWord = inputWord.slice(0, -1) + \"uita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"z\") {\n newWord = inputWord.slice(0, -1) + \"cecita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"u\") {\n newWord = inputWord.slice(0, -2) + \"üita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"t\") {\n newWord = \"1: \" + inputWord.slice(0, -1) + \"ita\"; \n dimunutive.innerHTML = newWord;\n \n newWord = \"2: \" + inputWord.slice(0, -1) + \"ica\"; \n specialIco.innerHTML = newWord;\n } else if (lastChar === \"a\") {\n newWord = inputWord.slice(0, -1) + \"ita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"l\" || lastChar === \"s\" && secondToLastChar === \"e\") {\n newWord = inputWord + \"ita\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"r\" || lastChar === \"n\" || lastChar === \"e\") {\n newWord = inputWord + \"cita\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"s\") {\n newWord = inputWord.slice(0, -2) + \"itas\"; \n dimunutive.innerHTML = newWord;\n } else {\n newWord = inputWord + \"ita\";\n dimunutive.innerHTML = newWord;\n }\n }", "function processSentence(name,age,address,hobby) {\n return \"Nama saya \" + name + \", umur saya \" + age + \", alamat saya di \" + address + \", dan saya punya hobby yaitu \" + hobby + \"!\"\n }" ]
[ "0.6244601", "0.6050607", "0.6043991", "0.6035437", "0.60172033", "0.59919804", "0.59884286", "0.5940228", "0.592741", "0.591725", "0.5877944", "0.58555156", "0.5805895", "0.57942426", "0.5776347", "0.5765639", "0.5748116", "0.5711459", "0.5687192", "0.56823725", "0.5674503", "0.5674126", "0.56588185", "0.565516", "0.56532955", "0.56508964", "0.56472874", "0.5632742", "0.56127244", "0.55917287", "0.5590747", "0.55849934", "0.5582847", "0.55820906", "0.5578891", "0.55740464", "0.55687493", "0.5566944", "0.5561339", "0.5559131", "0.55556506", "0.55520767", "0.5548963", "0.5543667", "0.55432916", "0.55364454", "0.5535916", "0.5533519", "0.55282265", "0.55260664", "0.55219835", "0.55170935", "0.5512291", "0.55116475", "0.54975975", "0.54941016", "0.54922754", "0.54919446", "0.5483669", "0.54814816", "0.5478796", "0.54779875", "0.54776245", "0.54751277", "0.5472118", "0.5471585", "0.5469662", "0.54674023", "0.5461814", "0.54509556", "0.544651", "0.54362524", "0.54310966", "0.54294086", "0.5428525", "0.5426775", "0.5423055", "0.54225796", "0.54220486", "0.54215735", "0.5420244", "0.5420149", "0.5419083", "0.54189456", "0.5417687", "0.54168665", "0.5412139", "0.5412021", "0.54015696", "0.5394336", "0.5394034", "0.5392643", "0.5390401", "0.53901654", "0.5390085", "0.5389947", "0.5389802", "0.53878856", "0.5386533", "0.5385125", "0.53850824" ]
0.0
-1
ES6 : Default Parameter
function sayHello3(name = "Nguyen Van A", year = 2006) { console.log("Ten: ", name); console.log("Tuoi: ", 2021 - year); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function foo(param = 'no') {\n return 'yes';\n}", "function _defaultArg(name, _default) {\n return isUndefined(name) ? _default : name;\n}", "function default_val(arg, val) {\n\treturn typeof arg === \"undefined\" ? val : arg;\n} // default_val()", "function defaultParams(a, b, c = 0) {\n console.log(a, b, c);\n}", "function defaultValue(a,b,c=10)\n{\n console.log(a+\" \"+b+\" \"+c);\n}", "function defaultValue(v) { }", "function a(param=0) {\n return param;\n}", "function argumentOrDefault(key){var args=customizations; return args[key]===undefined ? _defaultParams2.default[key] : args[key];}", "function print(firstParameter = 5) {\n console.log(firstParameter);\n}", "function hello(data = 1) {\n\n console.log('hey ' + data)\n}", "function quux (foo = 'FOO') {\n\n}", "function foo( { a = 10, b = 20 } = {} ) {\n console.log( `[defaults for function arguments] a = ${a}, b = ${b}` );\n}", "function oneArgWithDefaut (x = 'default') {\n console.log(`x: ${x}`)\n}", "function soSomething (x, y=4){\n console.log(x,y);\n}", "function foo({first=10, second=true} = {}) {\n\n}", "function helloWorldWithDefaultParam( name = \"student\" ) {\n return `Hello, ${name}!`;\n}", "function functionName(param = value) {\n //codes\n}", "function helloSomeone(name = \"Frankie\"){\r\n console.log(\"Hello\" + name)\r\n}", "function greet(name = 'there') {\n\tconsole.log('hello', name);\n}", "function person(name='John Doe', age=99) {\n console.log(name+' '+age)\n}", "defaults () {\n }", "function defaultParams6(name = 'Zonayed Ahmed', age = 21) {\n console.log('My name is ' + name + ' and I am ' + age + ' years old!');\n}", "function argumentOrDefault(key) {\n\t var args = customizations;\n\t return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n\t }", "function greetSomeone(name = \"Guest\") {\n console.log(\"Good morning, \" + name)\n}", "function defaulted(value,defaultValue){return value!==undefined?value:defaultValue;}", "function sum_one(a, b=5){\n return a+b;\n}", "function myFn( callback = _=>console.log(\"This is Default Value Function\") ){\n\tvar msg = \"Hello World\";\n\tcallback(msg);\n}", "function add1(a, b = 5) {\n // here we set a default value for the argument (b = 5)\n return a + b;\n}", "function argumentOrDefault(key) {\r\n var args = customizations;\r\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\r\n }", "function f({x=0}) {\n console.log(x);\n}", "function DefaultReturnValue() {}", "function greet(message, name = \"World\")\n{\n console.log(message + \" \" + name);\n}", "function twoArgsWithDefault (x, y = 'default') {\n console.log(`x: ${x}, y: ${y}`)\n}", "function welcome( yourName = \"John Doe\"){\n return yourName;\n}", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function argumentOrDefault(key) {\n var args = customizations;\n return args[key] === undefined ? _defaultParams2['default'][key] : args[key];\n }", "function argFunction(value = 'test') {\n console.log(value)\n}", "function defaultParams() {\n console.log(es5Function());\n console.log(es5Function(5));\n console.log(es5Function(1, 2));\n console.log(\"-------------\");\n console.log(es6Function());\n console.log(es6Function(5));\n console.log(es6Function(1, 2));\n console.log(\"-------------\");\n console.log(es6Function2());\n console.log(es6Function2(5));\n console.log(es6Function2(1, 2));\n console.log(\"-------------\");\n console.log(es6Function3());\n console.log(es6Function3(5));\n console.log(es6Function3(1, 2));\n console.log(es6Function3(undefined, 2));\n}", "function def(arg, val) { return (typeof arg !== 'undefined') ? arg : val; }", "function sayHello(name = \"stranger\") {\n return \"hello \" + name;\n}", "function defaultTo(x, y) {\n return y == null ? x : y;\n }", "function fn(a = 42, b = a) {\n return b;\n}", "function defaults(a,b,c){if(a!=null){return a;}if(b!=null){return b;}return c;}", "function defaults(a,b,c){if(a!=null){return a;}if(b!=null){return b;}return c;}", "function defaults(a,b,c){if(a!=null){return a;}if(b!=null){return b;}return c;}", "function myOtherFunction (first_argument = second_argument, second_argument) {}", "function optional(a = 1, b = 1) {\n console.log(\"a+b\", a + b)\n}", "function foo(a, b = 2) {\n // foo() => a = undefined, b = 2\n // foo(1) => a = 1, b = 2\n // foo(1, \"truc\") => a = 1, b = \"truc\"\n}", "function greeting(name = \"Anonymous\") {\n return \"Hello \" + name;\n}", "function defualtVlaue(x = 0) {\r\n return x;\r\n}", "function defaultToZero(arg) {\n return arg === undefined ? 0 : arg;\n }", "function fo({x, y, z} = {}) {\n console.log(`x: ${x}, y: ${y}, z: ${z}`)\n}", "function exampleDef(a = 5, b = 10, c = 15) {\r\n console.log(`a=${a}, b=${b}, c=${c}`);\r\n}", "setDefault() { }", "function defaultValue(x, y = 12) {\n // y is 12 if not passed (or passed as undefined)\n return x + y;\n}", "function say({ age, name = 'Garry' }) {\n console.log(`My name is ${name} and my age is ${age}.`);\n}", "function sum(a, b = 1) {\n return a + b;\n}", "function addDefaultParams(num1, num2) {\n if (num2 === void 0) { num2 = 10; }\n if (num2)\n return num1 + num2;\n else\n return num1;\n}", "function assignParameterValue(argument, defaultValue){\n\t\t\treturn typeof argument !== 'undefined' ? argument : defaultValue;\n\t\t}", "function assignParameterValue(argument, defaultValue){\n\t\t\treturn typeof argument !== 'undefined' ? argument : defaultValue;\n\t\t}", "function exampleDefaults(a = 10, b = 15, c = process, d = (process.cpus ? true : false)){\n console.log(a);\n console.log(b);\n// console.log(c);\n console.log(d);\n}", "function defaultParameters(cat1 = 'kitty', cat2 = 'guru', cat3 = 'mofu') {\n console.log(`my cat names are ${cat1} and ${cat2} and ${cat3} `)\n\n}", "function add(x = 2, y) {\n\treturn x + y;\n}", "function hello(name = 'Mystery Person'){\n console.log(`Hello ${name} !`)\n}", "function pepe2(nombre = \"desconocido\") {\n console.log(`hola soy ${nombre}`);\n}", "function test(a, b=3, c=42)\r\n{\r\n\treturn a+b+c;\r\n}", "function newFunc(name, age) {\n var name = name || 'oscar'\n var age = age || 32\n console.log(name, age)\n}", "function add(a=10 , b = 20 ){\r\n\treturn a+b;\r\n}", "function defaults(var_args){\n\t return find(toArray(arguments), nonVoid);\n\t }", "function sum(x = 0, y = 0) {\r\n return x + y\r\n} // es6 way", "function sayHiFn(aName = \"anon\") {\n return \"Hello \" + aName\n}", "constructor(defaultOptions) {\n this.defaultOptions = defaultOptions;\n }", "function greet(msg = 'hey there', person){\n console.log(`${msg}, ${person}`);\n}", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }", "function noOp(param) {\n return param;\n}", "function soma(a,b = 30) {\n console.log(a+b);\n}", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }", "function defaults(a, b, c) {\n\t if (a != null) {\n\t return a;\n\t }\n\t if (b != null) {\n\t return b;\n\t }\n\t return c;\n\t }" ]
[ "0.7328649", "0.72967654", "0.7241274", "0.72003436", "0.7157617", "0.7148041", "0.71224415", "0.70831746", "0.7082701", "0.7079471", "0.7062405", "0.70551056", "0.6988318", "0.6988123", "0.69633704", "0.69492364", "0.69368815", "0.69094497", "0.6862026", "0.6839885", "0.68367344", "0.6836182", "0.68325835", "0.682801", "0.68130475", "0.6777058", "0.6766166", "0.6726931", "0.6719681", "0.67136097", "0.66888654", "0.6686254", "0.6686077", "0.66823065", "0.66759455", "0.66759455", "0.66759455", "0.66759455", "0.66701436", "0.6667034", "0.66613084", "0.6653683", "0.6623733", "0.6578584", "0.6571187", "0.6571187", "0.6571187", "0.6558115", "0.6556148", "0.6534051", "0.65234065", "0.65192014", "0.6505287", "0.6463622", "0.6463338", "0.6455975", "0.64469004", "0.6441703", "0.64316523", "0.6431606", "0.64270955", "0.64270955", "0.6424031", "0.6421877", "0.64119846", "0.64024746", "0.63971573", "0.63851315", "0.63733447", "0.63505", "0.6350196", "0.6343822", "0.6333497", "0.63324076", "0.6326148", "0.62981486", "0.62981486", "0.62981486", "0.62981486", "0.62942004", "0.62916833", "0.6277827", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734", "0.6265734" ]
0.0
-1
Function tra ve ket qua
function sum(a = 10, b = 20) { let result = a + b; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pazymiuVidurkis(q,w,e,r,t) {\n var atsakymas = (q+w+e+r+t)/5;\n console.log(atsakymas);\n}", "function TinhTheoLoaiXe(sokm, tgcho, giaLoai1, giaLoai2, giaLoai3, tgChoTheoLoai) {\n var tien = 0;\n if (sokm <= 1) {\n tien = sokm * giaLoai1 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm > 1 && sokm < 21) {\n tien = giaLoai1 + (sokm - 1) * giaLoai2 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm >= 21) {\n tien = giaLoai1 + 19 * giaLoai2 + (sokm - 20) * giaLoai3 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n }\n return document.getElementById('xuatTien').innerHTML = tien + ' vnđ';\n}", "function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n}", "function tubeFormula(jarijari, tinggi){\n let luasAlas = Math.PI * jarijari ** 2;\n let volumeTabung = luasAlas * tinggi;\n\n return volumeTabung;\n}", "function kiemTra(X, Y, viTriMoi){\n X = viTriX + X;\n Y = viTriY + Y;\n viTriMoi = viTriMoi || ViTriXoay; // khi xoay khoi co bi qua ngoai man hinh khong\n\n\n\n for ( var y = 0; y < 4; ++y ) {\n for ( var x = 0; x < 4; ++x ) {\n if ( viTriMoi [ y ][ x ] ) {\n if ( typeof bangGiaTri[ y + Y ] == 'undefined' // kiem tra cac Dk cua khoi co kha thi hay khong, khong ra ngoai khung hinh\n || typeof bangGiaTri[ y + Y ][ x + X ] == 'undefined'\n || bangGiaTri[ y + Y ][ x + X ]\n || x + X < 0\n || y + Y >= dongBang\n || x + X>= cotBang ) {\n if (Y == 1) \n\t\t\t\t\t{\n\t\t\t\t\t\tThua = true; // neu khoi dang o dong tren cung thi thua\n\t\t\t\t\t\t\n\t\t\t\t\t}\n return false;\n }\n }\n }\n }\n return true;\n}", "static setAddQV(qv, qq) {\n//--------\nqv[0] += qq[0];\nqv[1] += qq[1];\nqv[2] += qq[2];\nqv[3] += qq[3];\nreturn qv;\n}", "function qv() {}", "function hitungLuasSegiTiga(alas,tinggi){\n var luas = 0.5 * alas * tinggi\n return luas\n}", "function hitungLuasSegitiga(alas,tinggi) {\n var luas = 1/2 * alas * tinggi;\n\n return luas;\n\n}", "function eq_tempo(){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2011.\n // funzione per il calcolo del valore dell'equazione del tempo per la data odierna.\n // algoritmo di P.D. SMITH.\n \nvar njd=calcola_jd(); // giorno giuliano in questo istante a Greenwich.\n njd=jdHO(njd)+0.5; // g. g. a mezzogiorno di Greenwich.\n\nvar ar_sole=pos_sole(njd); // calcolo dell'ascensione retta del sole.\nvar anno=jd_data(njd); // anno di riferimento.\n\nvar Tempo_medio_Greenw=tsg_tmg_data(ar_sole[0],anno[2],njd); // tempo medio di Greenwich.\nvar valore_et=12-Tempo_medio_Greenw; // valore dell'equazione del tempo.\n\n valore_et=valore_et*60; // valore in minuti.\n\n valore_et=valore_et.toFixed(6);\n\n\n\nreturn valore_et\n\n}", "function calcul_Omegar(h, c, k, t0, H0parsec) {\r\n \r\n // Matière et Lambda\r\n var Or = 0;\r\n sigma = (2 * Math.pow(Math.PI, 5) * Math.pow(k, 4)) / (15 * Math.pow(h, 3) * Math.pow(c, 2)); //OK\r\n\r\n // Matière Lambda, RFC et neutrinos\r\n if (document.getElementById(\"liste\").options[0].selected) {\r\n rho_r = (4 * sigma * Math.pow(t0, 4)) / (Math.pow(c, 3));\r\n Or = (8 * Math.PI * G * rho_r) / (3 * Math.pow(H0parsec, 2));\r\n Or = 1.68 * Or; // neutrinos\r\n Or = Or.toExponential(4);\r\n \r\n // Matière Lambda & RFC\r\n } else if (document.getElementById(\"liste\").options[1].selected) {\r\n rho_r = (4 * sigma * Math.pow(t0, 4)) / (Math.pow(c, 3));\r\n Or = (8 * Math.PI * G * rho_r) / (3 * Math.pow(H0parsec, 2));\r\n Or = Or.toExponential(4);\r\n }\r\n return Or;\r\n}", "function perimetroQuadrado(lado) {\n \n return lado * 3;\n}", "function hitungLuasPersegiPanjang (panjang,lebar){\n //tidak ada nilai balik\n var luas = panjang * lebar\n return luas\n}", "function viagem(limiteTanque, valorGasolina, kmPercorrido, destino){\n\n document.write(\"fizemos uma viagem para \" + destino +'<br>')\n document.write(\"A viagem foi de \" + kmPercorrido + 'km <br>')\n\n //Quantos km faz o tanque\n var kmTotalTanque = limiteTanque * 2\n document.write('O tanque do carro faz ' + kmTotalTanque + 'km <br>')\n\n console.log(kmTotalTanque)\n //Quantas vezes abastecer\n var qtsVzsAbastecer = Math.ceil(kmPercorrido / kmTotalTanque)\n document.write('Precisamos abastecer ' + qtsVzsAbastecer +'vez(es) <br>')\n console.log(qtsVzsAbastecer)\n //Quantos litros abastecer\n var qtsLitrosAbastecer = (kmPercorrido / 2) - limiteTanque\n document.write('Precisamos abastecer ' + qtsLitrosAbastecer +'litros <br>')\n console.log(qtsLitrosAbastecer)\n //valor gasto com a gasolina\n var gastoGasolina = qtsLitrosAbastecer * valorGasolina\n document.write('Gastamos R$' + gastoGasolina + ' com gasolina <br>')\n console.log(gastoGasolina)\n //quanto tempo durou a viagem\n var tempoViagem = Math.ceil(kmPercorrido / 60)\n document.write(\"A viagem demorou aproximadamente \" + tempoViagem + ' horas')\n console.log(tempoViagem)\n}", "function operacion(){\r\n if (numeros.segundo === null || numeros.segundo === \"\" || Number.isNaN(numeros.segundo)){ \r\n return raiz(); // Si hay un solo número, llamar a la funcion raiz\r\n } else {\r\n return aritmetica(); // Si hay dos a la función aritmética\r\n }\r\n }", "function TinhTien() {\n //Lay loai xe\n var loaiXe = LayloaiXe();\n console.log(loaiXe);\n //Lay thoi gian cho\n var tgCho = getEle('tgCho').value;\n //lay so km\n var soKM = getEle('soKm').value;\n var tongHoaDon = 0;\n //Tinh theo loai xe\n switch (loaiXe) {\n case 'uberX':\n tongHoaDon = TinhTheoLoaiXe(soKM, tgCho, UberX_1, UberX_2, UberX_3, tgCho_UberX);\n break;\n case 'uberSUV':\n tongHoaDon = TinhTheoLoaiXe(soKM, tgCho, UberSUV_1, UberSUV_2, UberSUV_3, tgCho_UberSUV);\n break;\n case 'uberBlack':\n tongHoaDon = TinhTheoLoaiXe(soKM, tgCho, UberBlack_1, UberBlack_2, UberBlack_3, tgCho_UberBlack);\n break;\n default:\n break;\n }\n}", "function turis(r) { // funkicja, funkcijos pavadinimas () skliausteliuose duomenys, {} aprasoma ka funkcija turi daryti // r kintamasis\nlet t = 4 * 3.14 * r * r * r / 3;\nreturn t; // grazinimas\n}", "function perimetroTriangulo(lado1,lado2,lado3){\n return lado1+lado2+lado3;\n}", "function kalkulasi(a, b) {\n return {\n tambah: a + b,\n kurang: a - b,\n kali: a * b,\n bagi: a / b\n }\n}", "static setSubtractQV(qv, qq) {\n//-------------\nqv[0] -= qq[0];\nqv[1] -= qq[1];\nqv[2] -= qq[2];\nqv[3] -= qq[3];\nreturn qv;\n}", "static approxEqTrans(ta, tb) {\nvar aeq, i;\n//------–-----\naeq = (function() {\nvar j, results;\nresults = [];\nfor (i = j = 0; j < 3; i = ++j) {\nresults.push(this.approxEq(ta[i], tb[i]));\n}\nreturn results;\n}).call(this);\nreturn aeq[0] && aeq[1] && aeq[2];\n}", "function trasf_equa_azim(njd,Ar,De,Long,Lat){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) giugno 2013\n // njd= numero del giorno giuliano dell'istante da calcolare riferito al T.U.\n // Ar= ascensione retta in ore decimali.\n // De= declinazione in gradi sessadecimali\n // Long= Longitudine dell'osservatore =- per ovest rispetto a Greenwich\n // Lat= Latitudine dell'osservatore.\n\nvar ang_H=angolo_H(njd,Ar,Long); // calcolo dell'angolo orario H.\n\n // trasformare gli angoli sessadecimali in radianti.\n\n ang_H=Rad(ang_H*15); \n Ar= Rad(Ar*15); \n De= Rad(De); \n Long=Rad(Long); \n Lat= Rad(Lat); \n \n // angolo_a=altezza sull'orizzonte dell'astro. \n\nvar angolo_a=Math.sin(De)*Math.sin(Lat)+Math.cos(De)*Math.cos(Lat)*Math.cos(ang_H);\n angolo_a=Math.asin(angolo_a); // in radianti.\n angolo_a=Rda(angolo_a); // altezza dell'astro in gradi. \n \nvar azimut=(Math.sin(De)-Math.sin(Lat)*Math.sin(Rad(angolo_a)))/(Math.cos(Lat)*Math.cos(Rad(angolo_a)));\n azimut=Math.acos(azimut); \n azimut=Rda(azimut);\n\nazimut=(Math.sin(ang_H)<0) ? (azimut=azimut):(azimut=360-azimut); // operatore ternario.\n\nvar coord_azimut= new Array(angolo_a,azimut) ; // restituisce 2 valori: altezza e azimut.\n\nreturn coord_azimut;\n\n// NOTE SUL CALCOLO: \n// Se il seno di ang_H(angolo orario) è negativo (>180°) azimut=azimut, se positivo azimut=360-azimut\n\n}", "function hitungLuasPersegi(sisi) {\n var luas = sisi * sisi;\n return luas;\n}", "function sumaRazFunc(niz, ajdi)\n{\n\tvar tmp = 0;\n\n\tif (niz[0] >= 0 && niz[6] >=0 && niz[7] >=0)\n\t{\n\t\ttmp = (niz[6] - niz[7])*niz[0];\n\t\tdocument.getElementById(ajdi).innerText=tmp;\n\tvar i1 = Number(document.getElementById(\"suma5\").innerText);\n\tvar i2 = Number(document.getElementById(\"suma6\").innerText);\n\tvar i3 = Number(document.getElementById(\"suma7\").innerText);\n\tvar i4 = Number(document.getElementById(\"suma8\").innerText);\n\n\ti1 = i1 + i2 + i3 + i4;\n\tdocument.getElementById(\"suma14\").innerText=i1;\n\n\t\n\tvar i1 = Number(document.getElementById(\"suma13\").innerText);\n\tvar i2 = Number(document.getElementById(\"suma14\").innerText);\n\tvar i3 = Number(document.getElementById(\"suma15\").innerText);\n\t\n\ti1 = i1 + i2 + i3;\n\tdocument.getElementById(\"konrez\").innerText=i1;\n\t}\n}", "function pasveikinaKauna() {\n console.log(\"Labas vakaras Kaune!\");\n}", "function AtrazoBoco (mês, valorAnuidade) {\n switch(mês) {\n case 1:\n return `Valor da Anuidade: ${valorAnuidade}`\n break\n\n case 2:\n const juroscomposto1 = valorAnuidade * ((1 + 0.05)**1)\n return `Valor da Anuidade com Juros: ${juroscomposto1.toFixed(2)}`\n break\n\n case 3:\n const juroscomposto2 = valorAnuidade * ((1 + 0.05)**2)\n return `Valor da Anuidade com Juros: ${juroscomposto2.toFixed(2)}`\n break\n\n case 4:\n const juroscomposto3 = valorAnuidade * ((1 + 0.05)**3)\n return `Valor da Anuidade com Juros: ${juroscomposto3.toFixed(2)}`\n break\n\n case 5:\n const juroscomposto4 = valorAnuidade * ((1 + 0.05)**4)\n return `Valor da Anuidade com Juros: ${juroscomposto4.toFixed(2)}`\n break\n\n case 6:\n const juroscomposto5 = valorAnuidade * ((1 + 0.05)**5)\n return `Valor da Anuidade com Juros: ${juroscomposto5.toFixed(2)}`\n break\n\n case 7:\n const juroscomposto6 = valorAnuidade * ((1 + 0.05)**6)\n return `Valor da Anuidade com Juros: ${juroscomposto6.toFixed(2)}`\n break\n\n case 8:\n const juroscomposto7 = valorAnuidade * ((1 + 0.05)**7)\n return `Valor da Anuidade com Juros: ${juroscomposto7.toFixed(2)}`\n break\n\n case 9:\n const juroscomposto8 = valorAnuidade * ((1 + 0.05)**8)\n return `Valor da Anuidade com Juros: ${juroscomposto8.toFixed(2)}`\n break\n\n case 10:\n const juroscomposto9 = valorAnuidade * ((1 + 0.05)**9)\n return `Valor da Anuidade com Juros: ${juroscomposto9.toFixed(2)}` \n break\n\n case 11:\n const juroscomposto10 = valorAnuidade * ((1 + 0.05)**10)\n return `Valor da Anuidade com Juros: ${juroscomposto10.toFixed(2)}`\n break\n\n case 12:\n const juroscomposto11 = valorAnuidade * ((1 + 0.05)**11)\n return `Valor da Anuidade com Juros: ${juroscomposto11.toFixed(2)}`\n break\n }\n }", "function sum(awalderet, akhirderet, step){\n if(awalderet != null && akhirderet != null && step == null){ //jika step kosong maka nilainya 1\n step = 1;\n var tampung = rangeWithStep(awalderet, akhirderet, step);\n var total = 0;\n\n for(i = 0; i < tampung.length; i++){\n total += tampung [i]\n }\n return total;\n\n }//jika semua parameter tidak null maka masuk ke sini\n else if(awalderet != null && akhirderet != null && step != null){\n var tampung = rangeWithStep(awalderet, akhirderet, step);\n var total = 0;\n\n for(i = 0; i < tampung.length; i++){\n total += tampung [i]\n }\n return total;\n\n }//jika hanya terdapat parameter awalderet maka sum bernilai awalderet\n else if(awalderet != null && akhirderet == null && step == null){\n total = awalderet;\n return total;\n }//jika parameter kosong semua maka return 0;\n else{\n return 0;\n }\n\n}", "function hitungVolumedanLuasPermukaanBalok(panjang, lebar, tinggi) {\n luasPermukaanBalok = 2 * ( (panjang * lebar) + (panjang * tinggi) + (lebar * tinggi) );\n volumeBalok = panjang * lebar * tinggi;\n document.write(\"Panjang : \" + panjang + \"<br/>\");\n document.write(\"Lebar : \" + lebar + \"<br/>\");\n document.write(\"Tinggi : \" + tinggi + \"<br/>\" + \"<br/>\");\n document.write(\"Volume Balok : \" + volumeBalok + \"<br/>\");\n document.write(\"Luas Permukaan Balok : \" + luasPermukaanBalok + \"<br/>\");\n}", "function diem_trung_binh() {\n let toan = +document.getElementById('diem_toan').value;\n let ly = +document.getElementById('diem_ly').value;\n let hoa = +document.getElementById('diem_hoa').value;\n let tb = (toan + ly + hoa) / 3;\n if (tb > 8) {\n // dk dunng\n document.getElementById('result').innerHTML = \"Hoc sinh dat\";\n } else {\n // dk sai\n document.getElementById('result').innerHTML = \"Khong dat\";\n }\n}", "xDistanceToQTerm(radTermica) {\n\n //Tolerancia del cálculo\n const tolerance = 0.01;\n\n //Valor de inicio del calculo de dsitancia x;\n let x = 0;\n\n //Radiacion termica \n var qi = 60;\n\n //Calculo de la distancia por iteracion\n for (x = 1; qi > radTermica; x = x + tolerance) {\n qi = this.qTermToDistance(x)\n // console.log(`x ${x} qi ${qi}`)\n }\n return x;\n }", "function kaliTerusRekursif(angka) {\r\n // you can only write your code here!\r\n let angkaString = angka.toString();\r\n let hasil = kaliRekursif(angka);\r\n let hasilString = hasil.toString();\r\n if(hasilString.length > 1){\r\n hasil = kaliTerusRekursif(hasil);\r\n }\r\n return hasil;\r\n \r\n}", "function frutaYverdura(fruta, verdura){\n console.log(fruta + \" \" + verdura)\n}", "function va(t,e){0}", "function perimetroTriangulo(ladoTriangulo){\n return ladoTriangulo * 3;\n}", "function funcion() {\n return numeracion;\n}", "function operator(angka, angkalain, perhitungan){\n var hasil = 0\n if(perhitungan=='tambah'){\n hasil=angka+angkalain\n }else if(perhitungan=='kurang'){\n hasil=angka-angkalain\n }else if(perhitungan=='bagi'){\n hasil=angka/angkalain\n }else if(perhitungan=='kali'){\n hasil=angka*angkalain\n }\n return hasil //return untuk apa yg kita pengen\n}", "function calculoangulochoquejug(ofjug, ofbola, tamjug, angulo) {\n let angulofinal = angulo;\n let aux;\n let poschoque = ofbola - ofjug;\n if ((angulo >= 90) && (angulo <= 270)) {\n if (poschoque == tamjug / 2) {\n angulofinal = 90;\n\n\n } else if (poschoque > tamjug / 2) {\n aux = (poschoque - (tamjug / 2)) / (tamjug / 2);\n aux = aux * 70;\n angulofinal = 10 + aux;\n\n } else if (poschoque < tamjug / 2) {\n aux = poschoque / (tamjug / 2);\n aux = aux * 70;\n angulofinal = 280 + aux;\n }\n }\n\n return angulofinal;\n }", "function Lu(t){return q(t)}", "function perimetro(lado2){\n return lado2*4;\n}", "static innerProductQV(qa, qb) {\n//--------------\nreturn qa[0] * qb[0] + qa[1] * qb[1] + qa[2] * qb[2] + qa[3] * qb[3];\n}", "function e(A,e,t,r){var n={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[A+\" sekondamni\",A+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[A+\" mintamni\",A+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[A+\" voramni\",A+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[A+\" disamni\",A+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[A+\" mhoineamni\",A+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[A+\" vorsamni\",A+\" vorsam\"]};return r?n[t][0]:n[t][1]}", "function b() {\n let a = 4;//esta linea en particular vive con \n //el universo de b\n}", "function perimetroCuadrado(lado){\n return lado*4;\n}", "function perimetroCuad(lado){\n return lado * 4;\n}", "toQV(xyzw) {\nreturn RQ.setQV(xyzw, this.xyzw);\n}", "function kelimasKvadratu(skaicius) {\n // atsakymas = skaicius * skaicius;\n atsakymas = Math.pow(skaicius, 2);\n console.log(atsakymas);\n}", "function kalikanDua(angka) {\n return angka * 2;\n}", "function obli_ecli(njd){\n\n // calcola l'obliquità dell'eclittica.\n // per l'equinozio della data.\n // T= numero di secoli giuliani dallo 0.5 gennaio 1900.\n\n var T=(njd-2415020.0)/36525;\n\n var obli_eclittica=23.452294-0.0130125*T-0.00000164*T*T+0.000000503*T*T*T;\n\nreturn obli_eclittica; //obliquità in gradi\n\n}", "function condiçaoVitoria(){}", "function qidirishNomi(){\n let nomi=document.getElementById(\"ismQidirish\");\n oqituvchiService.getAllQidiruvIsm(nomi.value,printpost,console.log(\"xato\"));\n}", "function ispisCene(){\n \n let ispisCena=racunajCenu(findDestPrice(dest),brOsoba);\n document.querySelector(\"#cena\").innerHTML = `${ispisCena}&euro;`;\n }", "function f_g(x) { //Вычисление нужной функции\n //window.alert(document.getElementById('a_1').value);\n //window.alert(Math.sin(document.getElementById('b_1').value * Math.PI * document.getElementById('c_1').value * x))\n //window.alert(document.getElementById('a_1').value * Math.sin(document.getElementById('b_1').value * Math.PI * document.getElementById('c_1').value));\n var x_t;\n if (x == document.getElementById('c_1').value) {\n x_t = document.getElementById('a_1').value;\n } else if (x == document.getElementById('c_2').value) {\n x_t = document.getElementById('a_2').value;\n } else {\n x_t = 0;\n }\n return x_t;\n // switch (x) {\n\n // case (document.getElementById('a_1').value):\n // window.alert(\"Прошло\");\n // return document.getElementById('c_1').value;\n // break;\n\n // case (document.getElementById('a_2').value):\n // return document.getElementById('c_2').value;\n // break;\n // default:\n // return 0;\n // break;\n\n}", "function eq_tempo_data(anno,njd){\n\n // funzione per il calcolo dell'equazione del tempo.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009\n // algoritmo di P.D. SMITH.\n\n njd=jdHO(njd)+0.5; // riporta il g.g. della data al mezzogiorno. \n \nvar ar_sole=pos_sole(njd); // calcolo dell'ascensione retta del sole.\nvar Tempo_medio_Greenw=tsg_tmg_data(ar_sole[0],anno,njd); // tempo medio di Greenwich.\nvar valore_et=12-Tempo_medio_Greenw; // valore dell'equazione del tempo.\n\n valore_et=valore_et*60; // valore in minuti.\n\n valore_et=valore_et.toFixed(6);\n\nreturn valore_et\n\n}", "function sumaKolFunc(niz, ajdi)\n{\n\tvar tmp = 0;\n\tfor (var i=0; i<6; ++i)\n\t{\n\t\tif(niz[i] >= 0)\n\t\t\ttmp += niz[i];\n\t\n\t}\n\n\ttmp = (tmp > 59) ? tmp+30 : tmp;\n\n\tdocument.getElementById(ajdi).innerText=tmp;\n\n\tvar i1 = Number(document.getElementById(\"suma1\").innerText);\n\tvar i2 = Number(document.getElementById(\"suma2\").innerText);\n\tvar i3 = Number(document.getElementById(\"suma3\").innerText);\n\tvar i4 = Number(document.getElementById(\"suma4\").innerText);\n\ti1 = i1 + i2 + i3 + i4;\n\tdocument.getElementById(\"suma13\").innerText=i1;\n\n\tvar i1 = Number(document.getElementById(\"suma13\").innerText);\n\tvar i2 = Number(document.getElementById(\"suma14\").innerText);\n\tvar i3 = Number(document.getElementById(\"suma15\").innerText);\n\t\n\ti1 = i1 + i2 + i3;\n\tdocument.getElementById(\"konrez\").innerText=i1;\n}", "function NotaFinal() {\r\n\r\n pregunta1();\r\n pregunta3();\r\n cor =\r\n parseFloat(tpre1) +\r\n parseFloat(tpre3);\r\n Calculo_nota();\r\n}", "function qf(a,b){this.hc=[];this.$i=a;this.Pg=b||k}", "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 getQbig(needChair, needTable, needKhat) {\r\n// Qbig Fixed Hisab\r\nchair = 1;\r\ntable = 3;\r\nkhat = 5;\r\n\r\n needTotal = (needChair * chair + needTable * table + needKhat * khat);\r\n console.log(\"Need total qbig feet wood = \"+needTotal);\r\n\r\n}", "function escolha(p) {\n novoJogo();//chamando a função para limpar a tela\n document.getElementById(\"resultado\").innerHTML = '';//limpando o mostra ganhador\n // document.getElementById(\"aviso\").innerHTML = ''; //limpando o aviso\n escB = p;// x é o parametro de x e O é o parametro de O\n}", "function KenalanV3 (nama, hobi) {\n console.log(`Hello, Nama Saya ${nama}`)\n console.log(`Saya Suka ${hobi}`)\n console.log(`Sekian`)\n}", "getResultado(f, l, n) {\n //Seteamos la Funcion Original y el Arreglo de Variables\n core.setFunction('f', l, f); //Hacemos uso de la biblioteca Nerdamer para las derivadas paraciales\n\n this.derivX = core.diff(f, l[0]);\n this.derivY = 0; //Verificamos si es multivariada la funcion.\n\n if (f.indexOf('y') !== null) {\n this.derivY = core.diff(f, l[1]);\n } else {\n this.derivY = 0;\n } //Visualizamos por consola las derivadas\n //console.log('dX: ', this.derivX.text());\n //console.log('dY: ', this.derivY.text());\n //Generamos t symbol\n\n\n t = new nerdamer(\"t\"); //console.log(t.text());\n\n if (n === 'a') {\n //evaluamos las derivadas parciales de la funcion, con los valores parciales del nodo\n this.evaluador(this.derivX, this.derivY, this.valoresParciales);\n this.getT(n); //para hidden layers\n\n let result = parseFloat(core('f(' + this.output + ')').toTeX('decimal'));\n this.resultadoGlobal[0] = result;\n } else {\n this.evaluador(this.derivX, this.derivY, this.valoresParciales[0]);\n this.getT(n); // para output layers\n\n let result = parseFloat(core('f(' + this.output + ')').toTeX('decimal'));\n this.resultadoGlobal.push(result);\n }\n\n return this.resultadoGlobal;\n }", "function pozdravi(a){\n console.log(\"Dobrodosli \" + a);\n}", "function fo(t) {\n return ho.Qn(t, qi.store);\n}", "function e(t,e,r,n){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return n?i[r][0]:i[r][1]}", "function e(t,e,r,n){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return n?i[r][0]:i[r][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function e(t,e,n,r){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?i[n][0]:i[n][1]}", "function obliczPunkty(dane)\n{\n var ro = 1.21; // gęstośc czynnika\n var stosunek_et = [0.86, 0.98, 1, 0.966, 0.86]; // stosunek sprawności izentropowych\n\n var mi0 = (1 - (Math.sqrt(Math.sin(dane.beta2 * (Math.PI / 180))) / (Math.pow(dane.z, 0.7)))).toPrecision(3); // współczynnik zmniejszenia mocy wentylatora\n var u2 = ((dane.D2 * Math.PI * dane.n) / 60).toPrecision(3); // prędkość obwodowa wirnika\n var c2u = ((dane.deltapzn * 1000) / (ro * u2 * dane.etazn)).toPrecision(3); // prędkość zależna od ułopatkowania wirnika\n var fi2r = ((c2u * Math.tan(dane.alfa2 * Math.PI / 180)) / u2).toPrecision(3); // wskaźnik prędkości koła wirnikowego\n var fi2r0 = ((mi0 * fi2r) / (mi0 - (c2u / u2))).toPrecision(3); // wartośc wskaznika prędkości koła wirnikowego dla wartości zerowej charakterystyki koła wirnikowego\n var Qmax = (dane.Qzn * (fi2r0 / fi2r)).toPrecision(3); // przepływ maksymalny\n\n var krok = 0.6;\n\n var daneDoWykresu = {};\n daneDoWykresu.deltap = []; // tablica wartości sprężu (deltap)\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.eta = []; // etazn * stosunek_et\n\tdaneDoWykresu.wspQ = []; //współczynnik Q: 1-Q/Qmax\n\tdaneDoWykresu.mp = [] ; // tablica wartości mocy pobieranej\n\t\n /* obliczanie punktów charakterystyk */\n\t\n for (var i = 0; i < 5; i++)\n\t{\n daneDoWykresu.Q[i] = krok * dane.Qzn;\n daneDoWykresu.wspQ[i] = 1 - (daneDoWykresu.Q[i] / Qmax);\n daneDoWykresu.eta[i] = dane.etazn * stosunek_et[i];\n\t\tdaneDoWykresu.deltap[i] =((293/(273+dane.tc))*((ro * (Math.pow(u2, 2)) * mi0 * daneDoWykresu.wspQ[i] * daneDoWykresu.eta[i])) / 1000); // kPa\n\t\tdaneDoWykresu.mp[i] = ((daneDoWykresu.Q[i]*daneDoWykresu.deltap[i])/(daneDoWykresu.eta[i]*dane.etas))/100; // kW/100\n krok += 0.2;\n }\n return daneDoWykresu;\n}", "get kurtosis(): ?number {\n if(this.alpha > 4) {\n return 6 * (Math.pow(this.alpha, 3) + Math.pow(this.alpha, 2) - 6 * this.alpha - 2) / (this.alpha * (this.alpha - 3) * (this.alpha - 4));\n }\n return undefined;\n }", "function Puissance4(lig,col,l,c){\r\n //commencement de l'analyse\r\n console.log(\"Valeurs: \"+lig+\" \"+col+\" / Incrément \"+i+ \" \"+c);\r\n if(c == 0 && l == 0){\r\n //pour moi c'est inversé a verticale, b horizontal, c diag gauche et d diag droit\r\n // horizontalité\r\n var va = 1 +Puissance4(lig +1,col,1,0) + Puissance4(lig-1,col,-1,0);\r\n // verticalité\r\n var vb = 1 +Puissance4(lig,col+1,0,1) + Puissance4(lig,col-1,0,-1);\r\n // diagonale de droite\r\n var vc = 1 +Puissance4(lig+1,col+1,1,1) + Puissance4(lig-1,col-1,-1,-1); \r\n // diagonale de gauche\r\n var vd = 1 +Puissance4(lig-1,col+1,-1,1) + Puissance4(lig+1,col-1,1,-1);\r\n console.log(va,vb,vc,vd);\r\n if(va == 4 || vb == 4 || vc == 4 || vd == 4)return true;\r\n else return false; \r\n }\r\n //On vérifie que \"lig\" et \"col\" ne sortent pas du tableau \r\n if (lig<this.ligne && lig>=0 && col<this.colonne && col>=0){\r\n if(this.plateau[lig][col]==joueur){\r\n return 1+ Puissance4(lig + l, col + c, l, c);}\r\n else {return 0;}\r\n }\r\n else return 0;\r\n }", "static lengthQV(qv) {\nreturn Math.sqrt(this.innerProductQV(qv, qv));\n}", "function tr(t,e){this.x=e,this.q=t}", "static subtractQV(qa, qb) {\nvar qv;\nqv = this.copyOfQV(qa);\nreturn this.setSubtractQV(qv, qb);\n}", "function trasf_ecli_equa(njd,long,lat){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009\n // funzione per trasformare le coordinate eclittiche in equatoriali.\n // long e lat: coordinate ecclittiche dell'astro in gradi sessadecimali.\n // njd=numero del giorno giuliano.\n\nvar obli_eclittica=obli_ecli(njd);\n obli_eclittica=obli_eclittica/180*Math.PI; \n \nlong=long/180*Math.PI;\n lat= lat/180*Math.PI;\n\nvar y=Math.sin(long)*Math.cos(obli_eclittica)-Math.tan(lat)*Math.sin(obli_eclittica);\nvar x=Math.cos(long);\n\nvar ascensione_retta=quadrante(y,x)/15;\n\nvar declinazione=Math.sin(lat)*Math.cos(obli_eclittica)+Math.cos(lat)*Math.sin(obli_eclittica)*Math.sin(long);\n declinazione=Math.asin(declinazione);\n declinazione=declinazione*180/Math.PI;\n\nvar coord_equa= new Array(ascensione_retta,declinazione) ; // restituisce le variabili AR e DEC .\n\nreturn coord_equa;\n\n}", "function eersteGraad(a,x,q) {\n y = a*x+q\n return y\n}", "function sumuoti(sk1 = 0,sk2 = 0) {\n let masyvas;\n masyvas = [sk1, sk2];\n let suma;\n\n //suma = masyvas[0] + masyvas[1];\n suma = sk1 + sk2;\n\n return suma ; //grazinti bet koki kintamojo tipa\n}", "function t(e,t,n,a){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[e+\" sekondamni\",e+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[e+\" mintamni\",e+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[e+\" voramni\",e+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disamni\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineamni\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsamni\",e+\" vorsam\"]};return a?i[n][0]:i[n][1]}", "function t(e,t,n,a){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[e+\" sekondamni\",e+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[e+\" mintamni\",e+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[e+\" voramni\",e+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disamni\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineamni\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsamni\",e+\" vorsam\"]};return a?i[n][0]:i[n][1]}", "function a(e,a,t,n){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[e+\" sekondamni\",e+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[e+\" mintamni\",e+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[e+\" voramni\",e+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disamni\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineamni\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsamni\",e+\" vorsam\"]};return n?i[t][0]:i[t][1]}", "function afase_luna(njd){\n\n // calcola l'angolo di fase della luna per la data (njd)\n // gennaio 2012\n\n var dati_luna=pos_luna(njd); // recupero fase/elongazione (1)\n var dati_sole=pos_sole(njd);\n\n var elongazione1=dati_luna[4]; // elongazione in gradi sessadecimali.\n var dist_luna=dati_luna[7]/149597870; \n var dist_sole=dati_sole[4]; // distanza del sole in UA.\n\n elongazione=Math.abs(elongazione1)*1;\n\n var dist_sl=dist_luna*dist_luna+dist_sole*dist_sole-2*dist_luna*dist_sole*Math.cos(Rad(elongazione)); // distanza sole-luna\n dist_sl=Math.sqrt(dist_sl);\n\n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_luna; // distanza pianeta-terra.\n var Dts= dist_sole; // distanza terra-sole.\n var Dps= dist_sl; // distanza pianeta-sole.\n\n // teorema del coseno\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-elongazione-delta_fase; // angolo di fase in gradi.\n\n if(elongazione1<0) {angolo_fase=-angolo_fase; }\n\n return angolo_fase;\n\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 traceAvecP() {\n\tvar equation = document.getElementById('input').value;\n\tequation = equation.replace(/,/g, '.');\n\t// rempalce les \",\" par \".\"\n\tvar erreur = validation(equation);\n\tdocument.getElementById('btnresetter').disabled = false;\n\t//activation du bouton Reset\n\tif (erreur < 0) {\n\t\tdocument.getElementById('btnrnd').disabled = true;\n\t\t// on scelle le bouton de soummission\n\t\tpente = parametreA(tokenize(equation));\n\t\tordonnee = parametreB(tokenize(equation));\n\t\texp = exposant(tokenize(equation));\n\t\tzoomPlan(exp, pente, ordonnee);\n\t\tif (exp == 0) {\n\t\t\ttypeEquation = 0;\n\t\t\tdocument.getElementById('btnpente').disabled = false;\n\t\t\t//activation du bouton Pente\n\t\t\tdocument.getElementById('btnAfficOrd').disabled = false;\n\t\t\t//activation du bouton Ordonnee\n\t\t\tpointLineaire();\n\t\t} else if (exp != 0) {\n\t\t\ttypeEquation = 1;\n\t\t\tdocument.getElementById('btnAfficOrd').disabled = false;\n\t\t\t//activation du bouton Ordonnee\n\t\t\tdocument.getElementById('btnAxeStm').disabled = false;\n\t\t\t//activation du bouton Axe symétrie\n\t\t\tdocument.getElementById('btnAfficZero').disabled = false;\n\t\t\t//activation du bouton Les zéros\n\t\t\tpointQuadratique();\n\t\t}\n\n\t\t// affichage dynamique de l'ordonnée dans la bulle externe\n\t\tif (typeEquation == 1) {\n\t\t\tif (dynamiqueB() < 0 && dynamiqueC() < 0) {// si l'ordonnee ou la pente est une valeur negative, les mettre entre ()\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² +(' + dynamiqueB() + ')' + '+(' + dynamiqueC() + ')';\n\t\t\t\t});\n\t\t\t} else if (dynamiqueB() < 0 && dynamiqueC() >= 0) {\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² +(' + dynamiqueB() + ')' + \"+ \" + dynamiqueC();\n\t\t\t\t});\n\t\t\t} else if (dynamiqueC() < 0 && dynamiqueB() >= 0) {\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² + ' + dynamiqueB() + \"+(\" + dynamiqueC() + ')';\n\t\t\t\t});\n\t\t\t} else if (dynamiqueC() >= 0 && dynamiqueB() >= 0) {\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² + ' + dynamiqueB() + dynamiqueC();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tboard.on('update', function() {\n\t\t\t\tdocument.getElementById('ordonneeFormuleQuadratique').innerHTML = \"Ordonnée = \" + dynamiqueC();\n\t\t\t});\n\t\t}\n\t} else {// affichage des erreurs\n\t\tvar input = document.getElementById('input');\n\t\tinput.selectionStart = erreur;\n\t\tinput.selectionEnd = ++erreur;\n\t\tinput.focus();\n\t\tenterPr = false;\n\t}\n}", "function beratBadanWanita(tinggi){\r\n let ideal = (tinggi - 100) - (tinggi -100) * 0.15\r\n return `Wanita = ${ideal} Kg`; \r\n}", "function Co(t,e){0}", "function cargarpista1 (){\n \n}", "function pulaCorda() {\n console.log('Pulei 1x com function')\n console.log('Pulei 2x com function')\n console.log('Pulei 3x com function')\n console.log('Pulei 4x com function')\n console.log('Pulei 5x com function')\n console.log('Pulei 6x com function')\n console.log('Pulei 7x com function')\n console.log('Pulei 8x com function')\n console.log('Pulei 9x com function')\n console.log('Pulei 10x com function')\n}", "function e(t,e,n,r){var a={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return r?a[n][0]:a[n][1]}", "function e(t,e,n,i){var a={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return i?a[n][0]:a[n][1]}", "function e(t,e,n,i){var a={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[t+\" sekondamni\",t+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[t+\" mintamni\",t+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[t+\" voramni\",t+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[t+\" disamni\",t+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[t+\" mhoineamni\",t+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[t+\" vorsamni\",t+\" vorsam\"]};return i?a[n][0]:a[n][1]}" ]
[ "0.67818755", "0.6415324", "0.63214684", "0.626947", "0.6201867", "0.6187434", "0.617482", "0.6130544", "0.61142975", "0.607618", "0.6021152", "0.5990943", "0.59845257", "0.5968847", "0.5967085", "0.5918712", "0.59179467", "0.5869713", "0.5865554", "0.5826383", "0.5823686", "0.581158", "0.5807035", "0.58031803", "0.5776651", "0.57682467", "0.5768154", "0.5751587", "0.5739592", "0.5729813", "0.57279366", "0.5725941", "0.57058203", "0.57044697", "0.56768763", "0.5666978", "0.5647862", "0.56426126", "0.5642477", "0.56366855", "0.56289953", "0.5623796", "0.56209", "0.5617392", "0.56092906", "0.55916464", "0.5590479", "0.55874884", "0.5587399", "0.5586275", "0.5585083", "0.558343", "0.5579609", "0.5579177", "0.5565267", "0.5564483", "0.5559974", "0.555874", "0.5554259", "0.5552357", "0.5547975", "0.5547485", "0.5541537", "0.5541268", "0.5541268", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.55389315", "0.5537488", "0.55354935", "0.5532568", "0.55280954", "0.5525598", "0.5525196", "0.5522989", "0.5522947", "0.55210745", "0.55198765", "0.55198765", "0.5519524", "0.5517413", "0.55158854", "0.5515664", "0.5515621", "0.5510562", "0.551049", "0.5507065", "0.5506727", "0.5505518", "0.5505518" ]
0.0
-1
Bai tap thuc hanh
function helloEveryone() { console.log("Xin chao cac ban"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fl_outToRosh_ha_shana_btn ()\n\t\t{\n\t\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.sufgania.alpha=1\t\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.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.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\t\tthis.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 kasherOverTo() {\n\t\t\tif (tzimhoniClickStatus == true && tivoniClickStatus == true && kasherClickStatus == true && heraionClickStatus == true){\n\t\t\tthis.instruction_txt.text=\"לחץ לבחירת המאפיין\";\n\t\t\tthis.unagi.alpha=0.2;\n\t\t}\n\t\t}", "function tamagoOverTo(){\n\t\t\tif (tivoniClickStatus == true && tzimhoniClickStatus == true && kasherClickStatus == true && heraionClickStatus == true && ingridiantClick==true){\n\t\t\tthis.gari.alpha=0.2;\n\t\t\tthis.tobiko.alpha=0.2;\n\t\t\tthis.tuna.alpha=0.2;\n\t\t\tthis.unagi.alpha=0.2;\n\t\t\tthis.surimi.alpha=0.2;\n\t\t\tthis.palamida.alpha=0.2;\n\t\t\tthis.salmon.alpha=0.2;\n\t\t\tthis.skin.alpha=0.2;\n\t\t\tthis.ekora.alpha=0.2;\n\t\t\tthis.panko.alpha=0.2;\n\t\t\tthis.wasabi.alpha=0.2;\n\t\t\tthis.daikon.alpha=0.2;\n\t\t\tthis.shitaki.alpha=0.2;\n\t\t\tthis.nuri.alpha=0.2;\n\t\t\tthis.nato.alpha=0.2;\n\t\t\tthis.tograshi.alpha=0.2;\n\t\t\tthis.canfio.alpha=0.2;\n\t\t\tthis.tzimhoni_fade.visible=0;\n\t\t\tthis.tivoni_fade.visible=1;\n\t\t\tthis.heraion_fade.visible=0;\n\t\t\tthis.kasher_fade.visible=0;\n\t\t\tthis.instruction_txt.text=\"לחץ כדי ללמוד עוד על הרכיב\";\n\t\t}\n\t\tif((tzimhoniClickStatus == false || kasherClickStatus == false || heraionClickStatus == false) && ingridiantClick==true){\n\t\t\tthis.instruction_txt.text=\"לחץ כדי ללמוד עוד על הרכיב\";\n\t\t}\n\t\t}", "function fl_outToTu_btn ()\n\t\t{\n\t\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t this.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.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.of.alpha=1\n\t\t this.chanuka_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.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\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function fl_outToShavuot_btn ()\n\t\t{\n\t\t\tif(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=0.4\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.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 this.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.rosh_ha_shana_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\t\t\n\t\tthis.mishloah_explain.alpha=0\n\t\t\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function teriak() {\n // Tulis Code mulai di sini\n document.getElementById(\"jawaban1\").innerHTML = \"Aku Teriak\"\n // Tampilkan dengan cara document.getElementById(\"jawaban1\").innerHTML seperti di CONTOH.\n }", "function fl_outToBible_btn ()\n\t\t{\n\t\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.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.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.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 this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\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\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\t }\n\t\t\n\t\t}", "function Tc(a){this.Cb=new Sb(0,25);this.Wa(a)}", "function IndicadorAntiguedad () {}", "function klikHeader() {\n console.log(\"kliknąłeś w heaader\");\n}", "function kasherOutTo() {\n\t\t\tif (ingridiantClick == true){\n\t\t\tif (kasherClickStatus==true){\n\t\t\t\tthis.instruction_txt.text=\"עבור על מאפיין של הסושי או על הרכיבים השונים\";\n\t\t\tthis.unagi.alpha=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function hotkeyTap(evt)\n{\n\tlet soundName = keyCodeToSoundname(evt);\n\t//check if a valid soundname\n\tif(soundName != 'none')\n\t{\n\t\ttap(soundName);\n\t}\n}", "function startTap(print){\n\treset(print);\n\n\tvar ans = downFlow(springCoord.x,springCoord.y,dir[\"down\"]);\n\tvar ans2 = document.getElementsByClassName(\"stable\").length;\n\tdocument.getElementById(\"out_data\").innerHTML = \"Answer (tap constantly on): \"+ans;\n\tdocument.getElementById(\"out_data\").innerHTML += \"<br>Answer (tap turns off): \"+ans2;\n}", "function fl_outToPesach_btn ()\n\t\t{\n\t\tif(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.levivot.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 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\tthis.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\t\t\n\t\tthis.mishloah_explain.alpha=0\n\t\t\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function th(a){this.u=a;this.ma=null;this.Ce=new uh(a,!0,!0);this.af=new uh(a,!1,!0);this.pe=u(\"rect\",{height:kh,width:kh,style:\"fill: #fff\"},null);vh(this.pe,a.be)}", "function wa(e,t,n,i){Ca.call(this,e,t,n,i)}", "function fl_outToChanuka_btn ()\n\t\t{\n\t\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.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.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.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=01\n\t\t this.of.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.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}}", "function tap(hljs) {\n return {\n name: 'Test Anything Protocol',\n case_insensitive: true,\n contains: [\n hljs.HASH_COMMENT_MODE,\n // version of format and total amount of testcases\n {\n className: 'meta',\n variants: [\n { begin: '^TAP version (\\\\d+)$' },\n { begin: '^1\\\\.\\\\.(\\\\d+)$' }\n ],\n },\n // YAML block\n {\n begin: '(\\s+)?---$', end: '\\\\.\\\\.\\\\.$',\n subLanguage: 'yaml',\n relevance: 0\n },\n\t // testcase number\n {\n className: 'number',\n begin: ' (\\\\d+) '\n },\n\t // testcase status and description\n {\n className: 'symbol',\n variants: [\n { begin: '^ok' },\n { begin: '^not ok' }\n ],\n },\n ]\n };\n}", "function tap(hljs) {\n return {\n name: 'Test Anything Protocol',\n case_insensitive: true,\n contains: [\n hljs.HASH_COMMENT_MODE,\n // version of format and total amount of testcases\n {\n className: 'meta',\n variants: [\n { begin: '^TAP version (\\\\d+)$' },\n { begin: '^1\\\\.\\\\.(\\\\d+)$' }\n ],\n },\n // YAML block\n {\n begin: '(\\s+)?---$', end: '\\\\.\\\\.\\\\.$',\n subLanguage: 'yaml',\n relevance: 0\n },\n\t // testcase number\n {\n className: 'number',\n begin: ' (\\\\d+) '\n },\n\t // testcase status and description\n {\n className: 'symbol',\n variants: [\n { begin: '^ok' },\n { begin: '^not ok' }\n ],\n },\n ]\n };\n}", "function tzimhoniClick()\n\t\t{\n\t\tif (tzimhoniClickStatus==true){\n\t\t\tthis.instruction_txt.text=\"לחץ על רכיב שתרצה לדעת עליו יותר\";\n\t\t\tthis.tivoni_fade.visible=1;\n\t\t\tthis.heraion_fade.visible=1;\n\t\t\tthis.kasher_fade.visible=1;\n\t\t\tthis.tzimhoni_fade.visible=0;\n\t\t\ttzimhoniClickStatus=false;\n\t\t\ttivoniClickStatus=true;\n\t\t\tkasherClickStatus=true;\n\t\t\theraionClickStatus=true;\n\t\t\tthis.tamago.alpha=1;\n\t\t\tthis.tivoni.mouseEnabled=false;\n\t\t\tthis.heraion.mouseEnabled=false;\n\t\t\tthis.kasher.mouseEnabled=false;\n\t\t\tthis.unagi.mouseEnabled=false;\n\t\t\tthis.tobiko.mouseEnabled=false;\n\t\t\tthis.tuna.mouseEnabled=false;\n\t\t\tthis.surimi.mouseEnabled=false;\n\t\t\tthis.palamida.mouseEnabled=false;\n\t\t\tthis.salmon.mouseEnabled=false;\n\t\t\tthis.skin.mouseEnabled=false;\n\t\t\tthis.ekora.mouseEnabled=false;\n\t\t}\n\t\telse{\n\t\t\tthis.instruction_txt.text=\"לחץ לבחירת המאפיין\";\n\t\t\tthis.tivoni_fade.visible=0;\n\t\t\tthis.heraion_fade.visible=0;\n\t\t\tthis.kasher_fade.visible=0;\n\t\t\tthis.tzimhoni_fade.visible=0;\n\t\t\ttzimhoniClickStatus=true;\n\t\t\ttivoniClickStatus=true;\n\t\t\tkasherClickStatus=true;\n\t\t\theraionClickStatus=true;\n\t\t\tthis.tivoni.mouseEnabled=true;\n\t\t\tthis.heraion.mouseEnabled=true;\n\t\t\tthis.kasher.mouseEnabled=true;\n\t\t\tthis.unagi.mouseEnabled=true;\n\t\t\tthis.tobiko.mouseEnabled=true;\n\t\t\tthis.tuna.mouseEnabled=true;\n\t\t\tthis.surimi.mouseEnabled=true;\n\t\t\tthis.palamida.mouseEnabled=true;\n\t\t\tthis.salmon.mouseEnabled=true;\n\t\t\tthis.skin.mouseEnabled=true;\n\t\t\tthis.ekora.mouseEnabled=true;\n\t\t}\n\t\t\n\t\t}", "function tampilkan() {\n console.log(\"halo!\");\n}", "function fl_outToMishloah ()\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.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.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.pesach_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.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\n\t\t}}", "function _clickBidang(e)\r\n{\r\n\tvar arr = findObjectByKey(_nopjson, 'nop', e.layer.feature.properties.nop);\r\n\tviewDetailBidang(e.layer.feature,arr);\r\n}", "function tap(hljs) {\n return {\n name: 'Test Anything Protocol',\n case_insensitive: true,\n contains: [\n hljs.HASH_COMMENT_MODE,\n // version of format and total amount of testcases\n {\n className: 'meta',\n variants: [\n {\n begin: '^TAP version (\\\\d+)$'\n },\n {\n begin: '^1\\\\.\\\\.(\\\\d+)$'\n }\n ]\n },\n // YAML block\n {\n begin: /---$/,\n end: '\\\\.\\\\.\\\\.$',\n subLanguage: 'yaml',\n relevance: 0\n },\n // testcase number\n {\n className: 'number',\n begin: ' (\\\\d+) '\n },\n // testcase status and description\n {\n className: 'symbol',\n variants: [\n {\n begin: '^ok'\n },\n {\n begin: '^not ok'\n }\n ]\n }\n ]\n };\n}", "function tap(hljs) {\n return {\n name: 'Test Anything Protocol',\n case_insensitive: true,\n contains: [\n hljs.HASH_COMMENT_MODE,\n // version of format and total amount of testcases\n {\n className: 'meta',\n variants: [\n {\n begin: '^TAP version (\\\\d+)$'\n },\n {\n begin: '^1\\\\.\\\\.(\\\\d+)$'\n }\n ]\n },\n // YAML block\n {\n begin: /---$/,\n end: '\\\\.\\\\.\\\\.$',\n subLanguage: 'yaml',\n relevance: 0\n },\n // testcase number\n {\n className: 'number',\n begin: ' (\\\\d+) '\n },\n // testcase status and description\n {\n className: 'symbol',\n variants: [\n {\n begin: '^ok'\n },\n {\n begin: '^not ok'\n }\n ]\n }\n ]\n };\n}", "bark() {\n console.log('gau gau...');\n }", "function bleh() {}", "function ya(e,t,n){Ca.call(this,e,t,n)}", "function ba(e,t,n,i){xa.call(this,e,t,n,i)}", "getTattoo () {\n\n }", "_onTap(e) {}", "function HyderabadTirupati() // extends PhoneticMapper\n{\n var map = [ \n new KeyMap(\"\\u0901\", \"?\", \"z\", true), // Candrabindu\n new KeyMap(\"\\u0902\", \"\\u1E41\", \"M\"), // Anusvara\n new KeyMap(\"\\u0903\", \"\\u1E25\", \"H\"), // Visarga\n new KeyMap(\"\\u1CF2\", \"\\u1E96\", \"Z\"), // jihvamuliya\n new KeyMap(\"\\u1CF2\", \"h\\u032C\", \"V\"), // upadhmaniya\n new KeyMap(\"\\u0905\", \"a\", \"a\"), // a\n new KeyMap(\"\\u0906\", \"\\u0101\", \"A\"), // long a\n new KeyMap(\"\\u093E\", null, \"A\", true), // long a attached\n new KeyMap(\"\\u0907\", \"i\", \"i\"), // i\n new KeyMap(\"\\u093F\", null, \"i\", true), // i attached\n new KeyMap(\"\\u0908\", \"\\u012B\", \"I\"), // long i\n new KeyMap(\"\\u0940\", null, \"I\", true), // long i attached\n new KeyMap(\"\\u0909\", \"u\", \"u\"), // u\n new KeyMap(\"\\u0941\", null, \"u\", true), // u attached\n new KeyMap(\"\\u090A\", \"\\u016B\", \"U\"), // long u\n new KeyMap(\"\\u0942\", null, \"U\", true), // long u attached\n new KeyMap(\"\\u090B\", \"\\u1E5B\", \"q\"), // vocalic r\n new KeyMap(\"\\u0943\", null, \"q\", true), // vocalic r attached\n new KeyMap(\"\\u0960\", \"\\u1E5D\", \"Q\"), // long vocalic r\n new KeyMap(\"\\u0944\", null, \"Q\", true), // long vocalic r attached\n new KeyMap(\"\\u090C\", \"\\u1E37\", \"L\"), // vocalic l\n new KeyMap(\"\\u0962\", null, \"L\", true), // vocalic l attached\n new KeyMap(\"\\u0961\", \"\\u1E39\", \"LY\"), // long vocalic l\n new KeyMap(\"\\u0963\", null, \"LY\", true), // long vocalic l attached\n new KeyMap(\"\\u090F\", \"e\", \"e\"), // e\n new KeyMap(\"\\u0947\", null, \"e\", true), // e attached\n new KeyMap(\"\\u0910\", \"ai\", \"E\"), // ai\n new KeyMap(\"\\u0948\", null, \"E\", true), // ai attached\n new KeyMap(\"\\u0913\", \"o\", \"o\"), // o\n new KeyMap(\"\\u094B\", null, \"o\", true), // o attached\n new KeyMap(\"\\u0914\", \"au\", \"O\"), // au\n new KeyMap(\"\\u094C\", null, \"O\", true), // au attached\n\n // velars\n new KeyMap(\"\\u0915\\u094D\", \"k\", \"k\"), // k\n new KeyMap(\"\\u0916\\u094D\", \"kh\", \"K\"), // kh\n new KeyMap(\"\\u0917\\u094D\", \"g\", \"g\"), // g\n new KeyMap(\"\\u0918\\u094D\", \"gh\", \"G\"), // gh\n new KeyMap(\"\\u0919\\u094D\", \"\\u1E45\", \"f\"), // velar n\n\n // palatals\n new KeyMap(\"\\u091A\\u094D\", \"c\", \"c\"), // c\n new KeyMap(\"\\u091B\\u094D\", \"ch\", \"C\"), // ch\n new KeyMap(\"\\u091C\\u094D\", \"j\", \"j\"), // j\n new KeyMap(\"\\u091D\\u094D\", \"jh\", \"J\"), // jh\n new KeyMap(\"\\u091E\\u094D\", \"\\u00F1\", \"F\"), // palatal n\n\n // retroflex\n new KeyMap(\"\\u091F\\u094D\", \"\\u1E6D\", \"t\"), // retroflex t\n new KeyMap(\"\\u0920\\u094D\", \"\\u1E6Dh\", \"T\"), // retroflex th\n new KeyMap(\"\\u0921\\u094D\", \"\\u1E0D\", \"d\"), // retroflex d\n new KeyMap(\"\\u0922\\u094D\", \"\\u1E0Dh\", \"D\"), // retroflex dh\n new KeyMap(\"\\u0923\\u094D\", \"\\u1E47\", \"N\"), // retroflex n\n new KeyMap(\"\\u0933\\u094D\", \"\\u1E37\", \"lY\"), // retroflex l\n new KeyMap(\"\\u0933\\u094D\\u0939\\u094D\", \"\\u1E37\", \"lYh\"), // retroflex lh\n\n // dental\n new KeyMap(\"\\u0924\\u094D\", \"t\", \"w\"), // dental t\n new KeyMap(\"\\u0925\\u094D\", \"th\", \"W\"), // dental th\n new KeyMap(\"\\u0926\\u094D\", \"d\", \"x\"), // dental d\n new KeyMap(\"\\u0927\\u094D\", \"dh\", \"X\"), // dental dh\n new KeyMap(\"\\u0928\\u094D\", \"n\", \"n\"), // dental n\n\n // labials\n new KeyMap(\"\\u092A\\u094D\", \"p\", \"p\"), // p\n new KeyMap(\"\\u092B\\u094D\", \"ph\", \"P\"), // ph\n new KeyMap(\"\\u092C\\u094D\", \"b\", \"b\"), // b\n new KeyMap(\"\\u092D\\u094D\", \"bh\", \"B\"), // bh\n new KeyMap(\"\\u092E\\u094D\", \"m\", \"m\"), // m\n\n // sibillants\n new KeyMap(\"\\u0936\\u094D\", \"\\u015B\", \"S\"), // palatal s\n new KeyMap(\"\\u0937\\u094D\", \"\\u1E63\", \"R\"), // retroflex s\n new KeyMap(\"\\u0938\\u094D\", \"s\", \"s\"), // dental s\n new KeyMap(\"\\u0939\\u094D\", \"h\", \"h\"), // h\n\n // semivowels\n new KeyMap(\"\\u092F\\u094D\", \"y\", \"y\"), // y\n new KeyMap(\"\\u0930\\u094D\", \"r\", \"r\"), // r\n new KeyMap(\"\\u0932\\u094D\", \"l\", \"l\"), // l\n new KeyMap(\"\\u0935\\u094D\", \"v\", \"v\"), // v\n\n\n // numerals\n new KeyMap(\"\\u0966\", \"0\", \"0\"), // 0\n new KeyMap(\"\\u0967\", \"1\", \"1\"), // 1\n new KeyMap(\"\\u0968\", \"2\", \"2\"), // 2\n new KeyMap(\"\\u0969\", \"3\", \"3\"), // 3\n new KeyMap(\"\\u096A\", \"4\", \"4\"), // 4\n new KeyMap(\"\\u096B\", \"5\", \"5\"), // 5\n new KeyMap(\"\\u096C\", \"6\", \"6\"), // 6\n new KeyMap(\"\\u096D\", \"7\", \"7\"), // 7\n new KeyMap(\"\\u096E\", \"8\", \"8\"), // 8\n new KeyMap(\"\\u096F\", \"9\", \"9\"), // 9\n\n // accents\n new KeyMap(\"\\u0951\", \"|\", \"|\"), // udatta\n new KeyMap(\"\\u0952\", \"_\", \"_\"), // anudatta\n new KeyMap(\"\\u0953\", null, \"//\"), // grave accent\n new KeyMap(\"\\u0954\", null, \"\\\\\"), // acute accent\n\n // miscellaneous\n new KeyMap(\"\\u0933\\u094D\", \"\\u1E37\", \"L\"), // retroflex l\n new KeyMap(\"\\u093D\", \"'\", \"'\"), // avagraha\n new KeyMap(\"\\u0950\", null, \"om\"), // om\n new KeyMap(\"\\u0964\", \".\", \".\") // single danda\n ];\n\n PhoneticMapper.call(this, map);\n}", "function afterHappy(){\n if(happy){\n var t3 = setTimeout(\"setCommandValue('Good, what a positive attitude 👍')\",1500);\n var t4 = setTimeout(\"setCommandValue('Show your surprise for overtime today 💀')\",4000);\n var t5 = setTimeout(\"happy = false\",1000);\n var t6 = setTimeout(\"surprise = true\",4000);\n }\n else {\n return;\n }\n }", "function ya(t,e){0}", "function lastClick(){\n\n anime({\n targets:'div.circle',\n translateY: [\n { value: 320, duration: 800,delay:60, easing:'easeInOutCubic'}\n ],\n easing:'easeInOutCubic',\n delay:300,\n backgroundColor:'#00FF00', \n });\n anime({\n targets:'div.invis',\n width:0,\n height:0,\n opacity:0,\n })\n \n}", "function Toss() {\r\n if (Math.random() < 0.5) {\r\n traces.push(\"H\");\r\n } else {\r\n traces.push(\"T\");\r\n }\r\n }", "function tampilkan() {\n document.getElementById(\"contohJawaban\").innerHTML = \"Aku Tampil\"\n }", "function Pe(e,t){0}", "function fl_outToModern_btn ()\n\t\t{\n\t\t\t\tif(freez == \"false\"){// מבטיח שהמאוס אאוט יעבוד רק שהפריז בפולס\n\t\t\t\tconsole.log(\"hit\")\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.of.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\tthis.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\t\t\n\t\tthis.mishloah_explain.alpha=0\n\t\t\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "function Ha(){}", "function simple(){\n aff('Exercice n°01 : Bienvenue');\n var name = 'loic';\n aff(`Bienvenue à vous -> ${name} !`);\n jump();\n}", "function Bo(t,e){0}", "function ht(a,b){this.PW=[];this.Cva=a;this.Gja=b||null;this.qI=this.Oe=!1;this.Yi=void 0;this.Eda=this.HIa=this.l_=!1;this.EY=0;this.Xb=null;this.CN=0}", "function Usagi() {\n\tplayer.GetComponent(PlayerMovement).BecomeBunny(this.bunnyTime);\n}", "function singleTap()\n{\n console.log(startTime)\n if (millis()-startTime<=100) {\n return;\n }\n for(row = 0; row < 5; row++) {\n for(col = 0; col < 6; col++) {\n if(didMouseClick(width/2-createCanvasOfInputArea/2+col*createCanvasOfInputArea/6, height/2-createCanvasOfInputArea/2+row*createCanvasOfInputArea/6, createCanvasOfInputArea/6, createCanvasOfInputArea/6)) {\n if(row == 4 && col < 2)\n currentLetter = \"_\";\n else if(row == 4 && col == 2)\n currentLetter = 'y';\n else if(row == 4 && col == 3)\n currentLetter = 'z';\n else if(row == 4 && col > 3)\n currentLetter = '`';\n else\n currentLetter = String.fromCharCode(row*6+col+97);\n if (currentLetter=='_') //if underscore, consider that a space bar\n currentTyped = currentTyped + \" \";\n else if (currentLetter=='`' & currentTyped.length>0) //if `, treat that as a delete command\n currentTyped = currentTyped.substring(0, currentTyped.length-1);\n else if (currentLetter!='`') //if not any of the above cases, add the current letter to the typed string\n currentTyped = currentTyped + currentLetter;\n }\n }\n }\n\n //clicked in word prediction box\n if(didMouseClick(width/2-createCanvasOfInputArea/2, height/2-createCanvasOfInputArea/2+5*createCanvasOfInputArea/6, createCanvasOfInputArea, createCanvasOfInputArea/6)) {\n if(currentTyped.split(\" \").length > 1){\n currentTyped = shorten(currentTyped.split(\" \")).join(\" \") + \" \" + predicts[0] + String(\" \");\n }\n else {\n currentTyped = predicts[0] + String(\" \");\n }\n } \n\n //You are allowed to have a next button outside the 1\" area\n if (didMouseClick(width/2+createCanvasOfInputArea/2, height/2-createCanvasOfInputArea/2, createCanvasOfInputArea, createCanvasOfInputArea)) //check if click is in next button\n {\n nextTrial(); //if so, advance to next trial\n }\n\n}", "function wa(){}", "function fl_outToHasa ()\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.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}}", "*pressButtonA() {\n yield this.sendEvent({ type: 0x01, code: 0x130, value: 1 });\n }", "function testTAP() {\r\n\tmoka.run({format: 'tap'}, function(tap) {\r\n\t\ttap = tap.split('\\n');\r\n\t\texpect(tap.length).to.be(10);\r\n\t\t\r\n\t\tconsole.log('TAP passed in parallel mode');\r\n\t\t\r\n\t\tmoka.run({parallel: false, format: 'tap'}, function(tap) {\r\n\t\t\ttap = tap.split('\\n');\r\n\t\t\texpect(tap.length).to.be(9);\r\n\t\t\texpect(tap[tap.length - 1]).to.be('Bail out!');\r\n\t\t\t\r\n\t\t\tconsole.log('TAP passed in serial mode');\r\n\t\t\tconsole.log('Done');\r\n\t\t});\r\n\t});\r\n}", "function add_shed_label(item) {\n ctx.fillText(\"SHED\", item[0], item[1]);\n }", "function fl_outToTamar ()\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.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.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\n\t\t}}", "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 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 tap(soundName, stringNumber)\n{\n\tlet loadSoundDelay = 100;//this wasnt the problem? try higher?\n\tlet string = -1;\n\tif(typeof stringNumber !== \"undefined\")\n\t{\n\t\tstring = stringNumber;\n\t}\n\t// console.log(soundName);\n\tif(!testingLocal && !checkAudioInit())\n\t{\n\t\tinitApi();\n\t\tanimateAndPlaySound(soundName, loadSoundDelay, null, string);\n\t}\n\telse\n\t{\n\t\tanimateAndPlaySound(soundName, 0, null, string);\n\t}\n\n\tif(stage == STUDIO)//should be ==STAGE -> stageXTap(soundName)\n\t{\n\t\t//should be on stopsound or at end of loop (for now)\n\t\trecordTap(soundName);\n\t}\n\telse if(stage == INTRO)\n\t{\n\t\tif(!isIntroPartB)\n\t\t{\n\t\t\tstage1Tap(soundName);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstage1bTap(soundName);\n\t\t}\n\t}\n\telse if(stage == QUICK)\n\t{\n\t\tif(inputEnabled)//dont play key at all?\n\t\t{\n\t\t\tif(quickMode == 'play')\n\t\t\t{\n\t\t\t\t// quickModeTap(soundName);\n\t\t\t\tplayQuickTap(soundName);\n\t\t\t}\n\t\t\telse if(quickMode == 'learn')\n\t\t\t{\n\t\t\t\tlearnQuickTap(soundName);\n\t\t\t}\n\t\t}\n\t}\n}", "function mousePressed() {\n if (state === `title`) {\n startPiranhaArray();\n\n state = `aquarium`;\n }\n }", "function msg(target) {\n $(\"#textText\").html(\"You tapped \" + tapCount +\", double tapped \" + doubleTapCount + \" and long tapped \" + longTapCount + \" times on \" + $(target).attr(\"id\"));\n }", "function PbayPicsTuyok () {\n\t\t\t\t\n\t\t\t\tvar\tikaPilaNa = PbayPicssugodSlide % PbayPicsDakuCnt;\n\t\t\t\t\t\n\t\t\t\tif ( ikaPilaNa === ( PbayPicsDakuCnt - 1 ) ){\n\t\t\t\t\tif ( slideName === \"slideTimepbayPics\" ){\n\t\t\t\t\t\tclearInterval( slideTimepbayPics );\n\t\t\t\t\t\tchangePlayStopLabel( \"Play\", \"#ipaslidepbayPic\" )\n\t\t\t\t\t} else if ( slideName === \"slideTimeCal2015\" ){\n\t\t\t\t\t\tclearInterval( slideTimeCal2015 );\n\t\t\t\t\t\tchangePlayStopLabel( \"Play\", \"#ipaslideCalPic2015\" )\n\t\t\t\t\t} else if ( slideName === \"slideTimeCal2014\" ){\n\t\t\t\t\t\tclearInterval( slideTimeCal2014 );\n\t\t\t\t\t\tchangePlayStopLabel( \"Play\", \"#ipaslideCalPic2014\" )\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$( PbayPicsDaku[ ikaPilaNa ] ).hide( 0 );\n\t\t\t\t\t$( PbayPicsDaku[ ++PbayPicssugodSlide % PbayPicsDakuCnt ] ).fadeIn( 300 );\n\t\t\t\t\tiScrollIsaLang( ikaPilaNa );\n\t\t\t\t}\n\t\t\t}", "function onSprayAndPrayClick() {\r\n\r\n vaultDweller.currentAttackMode = \"sprayAndPray\";\r\n\toutput = \"<p> You switch your weapon over to full-auto. <span class=\\\"update\\\">Click the target you want to fire at! </span></p>\";\r\n\t\r\n\tLogInfo(output);\r\n\t/*\r\n\t\r\n\tOld code\r\n\t// Pimp that gun\r\n AKS74u.addAttachment(attachments[5]);\r\n\r\n // Give it to a dude\r\n vaultDweller.arm(AKS74u);\r\n vaultDweller.attack(mingvase);\r\n\ttargetingOverlay(mingvase);\r\n\t*/\r\n}", "handleTap(){\n\n }", "function KenalanV3 (nama, hobi) {\n console.log(`Hello, Nama Saya ${nama}`)\n console.log(`Saya Suka ${hobi}`)\n console.log(`Sekian`)\n}", "function tap() {\n for (var i = 0; i < f.length; i++) {\n f[i].vel.y *= -1;\n f[i].vel.x *= -1;\n f[i].tdi *= -1;;\n if (rand > 9.5) {\n f[i].age += 500;\n }\n }\n}", "function t() {\n //$content.css('paddingTop', $pageMaskee.height());\n y.height(h.height()).width(h.width());\n }", "function onAimedShotClick() {\r\n vaultDweller.currentAttackMode = \"single\";\r\n output = \"<p> You switch your weapon over to single-shot mode. <span class=\\\"update\\\">Click the target you want to fire at!</span> </p>\";\r\n \r\n LogInfo(output);\r\n/*\r\n Old code\r\n // Pimp that gun\r\n AKS74u.addAttachment(attachments[5]);\r\n\r\n // Give it to a dude\r\n vaultDweller.arm(AKS74u);\r\n vaultDweller.attackSingle(pig);\r\n\ttargetingOverlay(pig);\t\r\n\t*/\r\n}", "function buatKalimat(nama, umur, alamat, hobi) {\n // Code kamu mulai dari sini\n var kalimat = \"Nama saya \" + nama + \", Umur \" + umur + \" Bertempat tinggal di \" + alamat + \", hobi saya \" + hobi;\n // Tampilkan dengan cara document.getElementById(\"jawaban3\").innerHTML seperti di CONTOH.\n document.getElementById(\"jawaban3\").innerHTML = kalimat;\n }", "function bang()\r{\r\toutlet(0, a0, a1, a2, b1, b2);\r}", "function Tb(a){this.Aa=new Sb(0,25);this.ia(a)}", "function bP(e,...t){return AL(e,null,void 0)}", "enterA82(ctx) {\n\t}", "function tu(a,b){this.IY=[];this.Dxa=a;this.Ila=b||null;this.gK=this.Tf=!1;this.nk=void 0;this.Gfa=this.KKa=this.i1=!1;this.y_=0;this.Tc=null;this.rP=0}", "sendMakeBetShan2(_chipbet) {\n cc.NGWlog(\"Vua dat cuoc =\" + _chipbet);\n var data = {\n evt: \"bm\",\n M: _chipbet\n };\n this.sendDataGame(JSON.stringify(data));\n }", "function h(e){pt(e.target,Q.props.target)&&s()}", "yellHi() {\n console.log('HEY UMI')\n }", "function secondClick(){\n anime({\n targets:'div.circle',\n translateY: [\n { value: 20, duration: 500,delay:60,easing:'easeInOutCubic'},\n { value: -20, duration: 800,delay:60, easing:'easeInOutCubic'},\n { value: 0, duration: 800,delay:60,easing:'easeInOutCubic'}\n ],\n \n });\n}", "function UltimateTicTacToe() {\r\n }", "heater_on(){ return this.send_command('g\\x01'); }", "drawTutPopShrimpEaten() {\n const sqWidth = this.tileSize * 4;\n const sqHeight = this.tileSize * 1;\n this.buffer.drawImage(this.squareImg,\n this.worldWidth/2 - sqWidth/2,\n this.worldHeight/2 - sqHeight/2 - 3,\n sqWidth,\n sqHeight);\n this.buffer.font = \"10px Mali\";\n this.buffer.textAlign = \"center\";\n this.buffer.fillStyle = \"white\";\n this.buffer.fillText(window.currentLanguage[\"tutshrimpeaten1\"],\n this.worldWidth/2,\n this.worldHeight/2 - 15);\n this.buffer.fillText(window.currentLanguage[\"tutshrimpeaten2\"],\n this.worldWidth/2,\n this.worldHeight/2);\n this.buffer.fillText(window.currentLanguage[\"tutshrimpeaten3\"],\n this.worldWidth/2,\n this.worldHeight/2 + 15);\n }", "function pasveikinaKauna() {\n console.log(\"Labas vakaras Kaune!\");\n}", "function yk(a,b){yk.k.constructor.call(this,\"\");this.fa=b;this.pj=u(\"text\",{\"class\":\"blocklyText\",x:-3},this.la);this.pj.appendChild(document.createTextNode(\"\\u2713\"));this.ja(a)}", "function action(hu,th,st)\n\t\t\t{\n\t\t\t\tif (hu == 1)\n\t\t\t\t{\n\t\t\t\t\thunger = (hunger * 10 - 1) / 10;\n\t\t\t\t\tif (hunger < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\thealth = ((health * 10) + (hunger * 10)) / 10;\n\t\t\t\t\t\thunger = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (st == 1)\n\t\t\t\t{\n\t\t\t\t\tstamina = (stamina * 10 - 5) / 10;\n\t\t\t\t\tif (stamina < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\thealth = ((health * 10) + (stamina * 10)) / 10;\n\t\t\t\t\t\tstamina = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (th == 1)\n\t\t\t\t{\n\t\t\t\t\tthirst = (thirst * 10 -5) / 10;\n\t\t\t\t\tif (thirst < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\thealth = ((health * 10) + (thirst * 10)) / 10;\n\t\t\t\t\t\tthirst = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( health <= 0)\n\t\t\t\t{\n\t\t\t\t\thealth = 0;\n\t\t\t\t}\n\t\t\t}", "clickableAction(tile){\r\n if(this.claimTerritoryPhase === true){\r\n this.handleClaimTerritoryPhase(tile);\r\n } else if(this.initialPlacementPhase === true){\r\n this.handleInitialPlacementPhase(tile);\r\n } else if(this.placementPhase === true){\r\n // console.log(\"in placement phase\")\r\n this.handlePlacementPhase(tile);\r\n } else if(this.battlePhase === true){\r\n // console.log(\"in battle phase\")\r\n this.handleBattlePhase(tile);\r\n } else if (this.fortifyPhase === true){\r\n this.handleFortifyPhase(tile);\r\n }\r\n this.updateInfoDisplay();\r\n }", "function q(a){a.click(u).mousedown(Ta)}", "function hit()\n {\n //switches to tab\n switchTab(name, number);\n }", "async 'after sunbath' () {\n console.log( 'see? I appear here because of the first custom above' )\n }", "static clickAttack() {\n if (!this.enemyPokemon().isAlive()) {\n return;\n }\n OakItemRunner.use(GameConstants.OakItem.Poison_Barb);\n GameHelper.incrementObservable(player.statistics.clicks);\n this.enemyPokemon().damage(player.calculateClickAttack());\n if (!this.enemyPokemon().isAlive()) {\n this.defeatPokemon();\n }\n }", "function fl_outToHazeret ()\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.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}}", "drawTutPopShrimp() {\n this.buffer.drawImage(this.squareImg,\n this.tileSize*4,\n this.tileSize*0.85,\n this.tileSize*2.4,\n this.tileSize*0.9);\n this.buffer.font = \"10px Mali\";\n this.buffer.textAlign = \"center\";\n this.buffer.fillStyle = \"white\";\n this.buffer.fillText(window.currentLanguage[\"tutshrimp1\"],\n this.worldWidth - this.tileSize*1.8,\n this.tileSize*1.35 - 15);\n this.buffer.fillText(window.currentLanguage[\"tutshrimp2\"],\n this.worldWidth - this.tileSize*1.8,\n this.tileSize*1.35);\n this.buffer.fillText(window.currentLanguage[\"tutshrimp3\"],\n this.worldWidth - this.tileSize*1.8,\n this.tileSize*1.35 + 15);\n this.buffer.drawImage(this.arrowDownImg,\n this.tileSize*3 + 10,\n this.tileSize + 15,\n this.tileSize, this.tileSize);\n }", "enterA125(ctx) {\n\t}", "function hasTap() {\n\t\t\t//Enure we dont return 0 or null for false values\n\t\t\treturn !!(options.tap) ;\n\t\t}", "function hasTap() {\n\t\t\t//Enure we dont return 0 or null for false values\n\t\t\treturn !!(options.tap) ;\n\t\t}", "function hasTap() {\n\t\t\t//Enure we dont return 0 or null for false values\n\t\t\treturn !!(options.tap) ;\n\t\t}", "function t(e,t,n,a){var i={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return a?i[n][0]:i[n][1]}", "function t(e,t,n,a){var i={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return a?i[n][0]:i[n][1]}", "function click_BIU($el){\n var BBCode = ( \"string\" !== typeof $el && $el ? $el.attr(\"data-bb\") : $el );\n var endFocus = function(){ _TEXT.focus(); return};\n\n if(\"undefined\" == typeof BBCode) return endFocus();\n\n _TEXT.init();\n _TEXT.wrapValue( BBCode, '' );\n _TEXT.pracheck();\n return !1;\n}", "function tampilkan() {\n console.log('hello Word!');\n}", "function KenalanV2 (nama) {\n console.log(`Hello, Nama Saya ${nama}`)\n console.log(`Saya Suka Masak`)\n console.log(`Sekian`)\n}", "function $5717e5c9cc727e0f$var$tap(hljs) {\n return {\n name: \"Test Anything Protocol\",\n case_insensitive: true,\n contains: [\n hljs.HASH_COMMENT_MODE,\n // version of format and total amount of testcases\n {\n className: \"meta\",\n variants: [\n {\n begin: \"^TAP version (\\\\d+)$\"\n },\n {\n begin: \"^1\\\\.\\\\.(\\\\d+)$\"\n }\n ]\n },\n // YAML block\n {\n begin: /---$/,\n end: \"\\\\.\\\\.\\\\.$\",\n subLanguage: \"yaml\",\n relevance: 0\n },\n // testcase number\n {\n className: \"number\",\n begin: \" (\\\\d+) \"\n },\n // testcase status and description\n {\n className: \"symbol\",\n variants: [\n {\n begin: \"^ok\"\n },\n {\n begin: \"^not ok\"\n }\n ]\n }\n ]\n };\n}", "function callNextPukiAction(act){\n\tpukiInteract=true;\n\tif(nextPukiAction != ''){\n\t\tpukiAction = nextPukiAction;\n\t\tnextPukiAction='';\n\t}else{\n\t\tpukiAction = act;\t\n\t}\n}", "instructions() {\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].fillText('Goal: Avoid the monsters. Reach the princess.',10,105);\n }", "doClick( evt ) {\n if( evt.altKey ) {\n let alternate = new CustomEvent( Thermometer.ALTERNATE, {\n detail: {\n status: this.status()\n }\n } );\n this.root.dispatchEvent( alternate );\n } else {\n // Toggle units\n if( this.display == Thermometer.FAHRENHEIT ) {\n this.display = Thermometer.CELCIUS;\n } else {\n this.display = Thermometer.FAHRENHEIT;\n }\n\n // Update display\n this.update();\n }\n }", "private internal function m248() {}", "function t(e,t,a,i){var r={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return i?r[a][0]:r[a][1]}" ]
[ "0.5937581", "0.58166575", "0.57696664", "0.57558507", "0.5686059", "0.5673694", "0.56118727", "0.5574644", "0.5550992", "0.55406624", "0.5540473", "0.5538652", "0.55234766", "0.5521139", "0.54720956", "0.5470282", "0.54533744", "0.5449491", "0.5449491", "0.54328203", "0.5432069", "0.5410672", "0.5409984", "0.5395867", "0.5395867", "0.5348107", "0.5336561", "0.53294915", "0.5327384", "0.53208137", "0.53019613", "0.5301348", "0.52956635", "0.52818877", "0.5279697", "0.5266397", "0.5260755", "0.52436805", "0.52406365", "0.5236931", "0.5236898", "0.5232344", "0.52250683", "0.5222396", "0.52160686", "0.5199885", "0.5197894", "0.5195117", "0.5194945", "0.51909804", "0.5185964", "0.5171067", "0.51627856", "0.51622856", "0.5160699", "0.51546395", "0.51433223", "0.5141315", "0.51373804", "0.513347", "0.51327413", "0.51296633", "0.5126026", "0.5118793", "0.5114781", "0.5110704", "0.5103187", "0.5102788", "0.5100288", "0.50972956", "0.50931907", "0.5091857", "0.50855684", "0.50789315", "0.507841", "0.50718725", "0.50697446", "0.5067092", "0.50624657", "0.5058705", "0.50560784", "0.50533205", "0.5045642", "0.50361264", "0.50360334", "0.5034815", "0.50302726", "0.502563", "0.502563", "0.502563", "0.50142866", "0.50142866", "0.5011379", "0.50062567", "0.5004879", "0.50019073", "0.50012594", "0.49978283", "0.49939594", "0.4993865", "0.49933743" ]
0.0
-1
2021 =>21 1999 =>21
function findCentury(year) { return Math.ceil(year / 100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "yearToAcademicYear () {\n return this + \"-\" + (Number(this) + 1).toString().slice(-2);\n }", "function yearComparator(auto1, auto2){\n return auto2.year - auto1.year;\n}", "function find2020() {\n for (i = 0; i < puzzleInput.length; i++) {\n let num1 = puzzleInput[i];\n for (j = 0; puzzleInput[j] !== num1 && j < puzzleInput.length; j++) {\n let num2 = puzzleInput[j];\n let sum = num1 + num2;\n if (sum === 2020) {\n return [num1, num2];\n }\n }\n }\n}", "function calculateAge(year){\nconsole.log(2018-year); \n}", "function sorterenyear(a, b) {\r\n return d3.ascending(year(a), year(b));\r\n}", "function calculateDate(el) {\r\n\treturn 2019 - el; \r\n}", "function calcularEdad(yearNacimiento) {\n return 2021 - yearNacimiento;\n }", "function LE2001() {\n calculatefor(new Array(\n \" 2001 to 2100\",\n// 2001 1 9\n2451919.348374, 20.0, 64.1, \" 2.162\", \" 1.189\", 1,\n 3.29475, 1.02253, 0.27861,\n -2.23117, -1.27481, -0.14757, 0.36098, 0.86973, 1.99702, 2.95278,\n 111.0355098, 0.68656, -7.300e-05,\n 22.3913306, -0.03239, -1.453e-03,\n// 2001 7 5\n2452096.122488, 15.0, 64.2, \" 1.548\", \" 0.495\", 2,\n 9.91170, 0.91401, 0.24905,\n -2.76926, -1.38831, 0.00000, -0.06028, 0.00000, 1.26616, 2.64889,\n 284.8526295, 0.55502, -1.740e-04,\n -23.4052500, 0.00545, 9.790e-04,\n// 2001 12 30\n2452273.937759, 11.0, 64.3, \" 0.893\", \"-0.116\", 3,\n 17.59710, 0.98618, 0.26871,\n -2.52237, 0.00000, 0.00000, -0.49380, 0.00000, 0.00000, 1.53644,\n 99.8527280, 0.64957, 3.260e-04,\n 24.2119414, 0.01299, -1.373e-03,\n// 2002 5 26\n2452421.003078, 12.0, 64.3, \" 0.689\", \"-0.289\", 3,\n 4.25918, 0.98735, 0.26903,\n -1.73212, 0.00000, 0.00000, 0.07387, 0.00000, 0.00000, 1.87724,\n 243.4219588, 0.60906, 3.650e-04,\n -20.0149302, -0.15750, 1.103e-03,\n// 2002 6 24\n2452450.394598, 21.0, 64.3, \" 0.209\", \"-0.792\", 3,\n 15.18941, 0.96066, 0.26176,\n -0.60766, 0.00000, 0.00000, 0.47036, 0.00000, 0.00000, 1.54363,\n 273.0671928, 0.61813, -7.900e-05,\n -24.7671299, -0.03788, 1.286e-03,\n// 2002 11 20\n2452598.574767, 2.0, 64.4, \" 0.860\", \"-0.226\", 3,\n 5.92815, 0.91136, 0.24832,\n -2.40771, 0.00000, 0.00000, -0.20559, 0.00000, 0.00000, 1.99738,\n 55.7306417, 0.50843, 5.980e-04,\n 18.6866889, 0.15766, -6.450e-04,\n// 2003 5 16\n2452775.653624, 4.0, 64.4, \" 2.075\", \" 1.128\", 1,\n 19.56427, 1.02171, 0.27839,\n -2.86738, -1.92892, -0.74155, -0.31302, 0.11532, 1.30252, 2.24126,\n 232.8771849, 0.63258, 7.030e-04,\n -18.6574591, -0.20832, 1.082e-03,\n// 2003 11 9\n2452952.555301, 1.0, 64.5, \" 2.114\", \" 1.018\", 1,\n 4.18669, 0.90100, 0.24550,\n -2.69910, -1.43478, 0.14401, 0.32721, 0.51017, 2.08876, 3.35361,\n 43.7479593, 0.47844, 4.050e-04,\n 16.2696404, 0.18536, -5.550e-04,\n// 2004 5 4\n2453130.355059, 21.0, 64.6, \" 2.263\", \" 1.304\", 1,\n 11.87209, 1.01134, 0.27556,\n -3.10983, -2.17164, -1.10733, -0.47857, 0.15055, 1.21510, 2.15218,\n 222.3920249, 0.60065, 9.000e-04,\n -16.6531111, -0.23671, 8.020e-04,\n// 2004 10 28\n2453306.628603, 3.0, 64.6, \" 2.364\", \" 1.308\", 1,\n 5.45344, 0.93289, 0.25419,\n -2.86061, -1.73615, -0.58444, 0.08648, 0.75686, 1.90841, 3.03548,\n 32.5931505, 0.49518, 2.730e-04,\n 13.4222694, 0.22312, -5.680e-04,\n// 2005 4 24\n2453484.913835, 10.0, 64.8, \" 0.865\", \"-0.144\", 3,\n 0.16896, 0.96437, 0.26277,\n -2.11379, 0.00000, 0.00000, -0.06796, 0.00000, 0.00000, 1.98030,\n 211.6323732, 0.52938, 7.780e-04,\n -13.9254307, -0.23916, 4.680e-04,\n// 2005 10 17\n2453661.003094, 12.0, 64.9, \" 1.058\", \" 0.062\", 2,\n 13.73936, 0.98574, 0.26859,\n -2.09103, -0.39374, 0.00000, 0.07427, 0.00000, 0.53911, 2.23912,\n 21.9362112, 0.53656, 2.360e-04,\n 10.2305101, 0.26721, -5.470e-04,\n// 2006 3 14\n2453809.492063, 0.0, 65.1, \" 1.030\", \"-0.060\", 3,\n 11.49727, 0.90230, 0.24585,\n -2.58608, 0.00000, 0.00000, -0.19050, 0.00000, 0.00000, 2.20484,\n 175.2556190, 0.43684, -4.000e-05,\n 3.0431199, -0.23745, -1.200e-04,\n// 2006 9 7\n2453986.286395, 19.0, 65.3, \" 1.133\", \" 0.184\", 2,\n 18.11422, 1.02286, 0.27870,\n -2.24659, -0.88534, 0.00000, -0.12652, 0.00000, 0.63272, 1.99311,\n 346.7196088, 0.56551, -3.030e-04,\n -6.7027302, 0.29840, 3.470e-04,\n// 2007 3 3\n2454163.473596, 23.0, 65.5, \" 2.319\", \" 1.233\", 1,\n 9.75581, 0.90863, 0.24758,\n -2.67864, -1.47627, -0.24515, 0.36630, 0.97738, 2.20825, 3.41185,\n 164.3031511, 0.44898, -3.240e-04,\n 7.0196100, -0.23493, -1.630e-04,\n// 2007 8 28\n2454340.943366, 11.0, 65.7, \" 2.453\", \" 1.476\", 1,\n 9.41931, 0.99145, 0.27015,\n -3.08722, -2.12725, -1.10917, -0.35922, 0.39110, 1.40930, 2.36728,\n 336.9050914, 0.54256, -2.350e-04,\n -9.8584500, 0.26933, 5.370e-04,\n// 2008 2 21\n2454517.643852, 3.0, 65.9, \" 2.145\", \" 1.106\", 1,\n 13.02804, 0.95235, 0.25949,\n -2.37137, -1.26004, 0.03739, 0.45245, 0.86669, 2.16401, 3.27800,\n 153.4734354, 0.50532, -6.140e-04,\n 10.5790298, -0.24351, -2.990e-04,\n// 2008 8 16\n2454695.382779, 21.0, 66.1, \" 1.837\", \" 0.808\", 2,\n 18.70796, 0.93904, 0.25587,\n -2.56770, -1.38021, 0.00000, 0.18670, 0.00000, 1.75529, 2.94078,\n 326.3307018, 0.50159, -2.510e-04,\n -12.9665404, 0.22362, 5.690e-04,\n// 2009 2 9\n2454872.110672, 15.0, 66.3, \" 0.899\", \"-0.088\", 3,\n 0.32217, 1.00393, 0.27355,\n -2.33426, 0.00000, 0.00000, -0.34388, 0.00000, 0.00000, 1.64580,\n 143.1240596, 0.57722, -7.830e-04,\n 13.4422195, -0.24673, -5.760e-04,\n// 2009 7 7\n2455019.902577, 10.0, 66.5, \" 0.156\", \"-0.913\", 3,\n 5.03354, 0.89981, 0.24518,\n -1.35083, 0.00000, 0.00000, -0.33815, 0.00000, 0.00000, 0.67400,\n 287.2121047, 0.52814, -4.310e-04,\n -23.8263704, 0.10151, 8.970e-04,\n// 2009 8 6\n2455049.527985, 1.0, 66.5, \" 0.402\", \"-0.666\", 3,\n 21.98019, 0.90317, 0.24609,\n -1.90907, 0.00000, 0.00000, -0.32836, 0.00000, 0.00000, 1.25409,\n 315.8506234, 0.47964, -3.610e-04,\n -15.5153297, 0.18407, 5.420e-04,\n// 2009 12 31\n2455197.308170, 19.0, 66.7, \" 1.056\", \" 0.076\", 2,\n 1.68882, 1.01599, 0.27683,\n -1.69585, -0.10290, 0.00000, 0.39607, 0.00000, 0.89668, 2.48832,\n 101.0748605, 0.67784, -3.960e-04,\n 24.0611394, -0.10439, -1.517e-03,\n// 2010 6 26\n2455373.985811, 12.0, 66.9, \" 1.577\", \" 0.537\", 2,\n 6.30029, 0.92490, 0.25201,\n -3.02475, -1.69865, 0.00000, -0.34054, 0.00000, 1.01566, 2.34374,\n 275.4918553, 0.56594, -4.900e-04,\n -23.9790900, 0.06737, 1.015e-03,\n// 2010 12 21\n2455551.845882, 8.0, 67.1, \" 2.281\", \" 1.256\", 1,\n 13.98569, 0.97062, 0.26447,\n -2.49226, -1.43745, -0.30142, 0.30116, 0.90436, 2.04061, 3.09303,\n 89.1339755, 0.62484, 3.100e-05,\n 23.7615793, -0.04933, -1.278e-03,\n// 2011 6 15\n2455728.342864, 20.0, 67.3, \" 2.687\", \" 1.700\", 1,\n 13.58347, 0.97584, 0.26589,\n -2.57108, -1.59890, -0.60649, 0.22874, 1.06364, 2.05582, 3.03019,\n 263.7402416, 0.63054, -4.020e-04,\n -23.2375296, 0.02828, 1.246e-03,\n// 2011 12 10\n2455906.106209, 15.0, 67.5, \" 2.186\", \" 1.106\", 1,\n 20.26613, 0.91992, 0.25066,\n -3.42120, -2.21928, -0.87674, -0.45098, -0.02458, 1.31818, 2.51806,\n 77.3934336, 0.55919, 1.620e-04,\n 22.5526904, -0.00268, -9.670e-04,\n// 2012 6 4\n2456082.961344, 11.0, 67.7, \" 1.318\", \" 0.370\", 2,\n 3.88582, 1.01729, 0.27719,\n -2.17816, -0.98314, 0.00000, 0.07225, 0.00000, 1.12657, 2.32242,\n 252.8579471, 0.67679, -5.400e-05,\n -21.6644397, -0.01656, 1.374e-03,\n// 2012 11 28\n2456260.107026, 15.0, 68.0, \" 0.915\", \"-0.187\", 3,\n 19.52741, 0.89937, 0.24506,\n -2.73136, 0.00000, 0.00000, -0.43137, 0.00000, 0.00000, 1.86850,\n 65.2309499, 0.52522, 1.230e-04,\n 20.4789015, 0.03784, -7.890e-04,\n// 2013 4 25\n2456408.339323, 20.0, 68.2, \" 0.987\", \" 0.015\", 2,\n 10.26615, 1.00045, 0.27260,\n -1.91977, -0.07987, 0.00000, 0.14376, 0.00000, 0.37017, 2.20869,\n 213.1265591, 0.60938, 6.210e-04,\n -14.4045889, -0.15016, 7.300e-04,\n// 2013 5 25\n2456437.674374, 4.0, 68.2, \" 0.016\", \"-0.934\", 3,\n 20.19364, 1.01763, 0.27728,\n -0.09367, 0.00000, 0.00000, 0.18497, 0.00000, 0.00000, 0.46583,\n 242.1681273, 0.66420, 3.830e-04,\n -19.4011301, -0.06219, 1.193e-03,\n// 2013 10 18\n2456584.494043, 0.0, 68.4, \" 0.765\", \"-0.272\", 3,\n 1.84204, 0.94742, 0.25815,\n -2.13642, 0.00000, 0.00000, -0.14296, 0.00000, 0.00000, 1.84858,\n 23.6581309, 0.53536, 5.500e-05,\n 11.0252504, 0.15271, -5.340e-04,\n// 2014 4 15\n2456762.824162, 8.0, 68.6, \" 2.318\", \" 1.291\", 1,\n 21.56029, 0.94901, 0.25858,\n -3.08663, -2.00891, -0.86816, -0.22012, 0.42855, 1.56962, 2.64493,\n 203.4560084, 0.53583, 4.790e-04,\n -10.0835398, -0.15248, 3.680e-04,\n// 2014 10 8\n2456938.955370, 11.0, 68.9, \" 2.146\", \" 1.166\", 1,\n 12.13343, 0.99942, 0.27232,\n -2.72095, -1.73411, -0.56165, -0.07112, 0.41883, 1.59119, 2.57996,\n 13.8214795, 0.58348, 0.000e-00,\n 6.3204099, 0.18219, -3.890e-04,\n// 2015 4 4\n2457117.000967, 12.0, 69.1, \" 2.079\", \" 1.001\", 1,\n 0.83252, 0.90720, 0.24719,\n -2.95673, -1.71821, -0.01576, 0.02321, 0.06272, 1.76522, 3.00207,\n 193.3626964, 0.48085, 2.150e-04,\n -5.2854501, -0.15081, 1.540e-04,\n// 2015 9 28\n2457293.616861, 3.0, 69.3, \" 2.230\", \" 1.276\", 1,\n 3.43851, 1.02405, 0.27903,\n -2.78438, -1.86096, -0.79460, -0.19533, 0.40390, 1.47017, 2.39355,\n 4.5082403, 0.60623, 5.000e-05,\n 1.5729700, 0.19768, -9.000e-05,\n// 2016 3 23\n2457470.991914, 12.0, 69.6, \" 0.775\", \"-0.312\", 3,\n 0.09379, 0.90323, 0.24611,\n -2.32271, 0.00000, 0.00000, -0.19408, 0.00000, 0.00000, 1.93327,\n 183.4190201, 0.47269, -6.000e-05,\n -0.3361200, -0.15555, 3.300e-05,\n// 2016 9 16\n2457648.288503, 19.0, 69.8, \" 0.908\", \"-0.064\", 3,\n 18.74360, 1.00187, 0.27298,\n -2.06942, 0.00000, 0.00000, -0.07594, 0.00000, 0.00000, 1.91843,\n 355.1579523, 0.58126, 8.700e-05,\n -3.2456901, 0.19057, 2.320e-04,\n// 2017 2 11\n2457795.531284, 1.0, 70.0, \" 0.988\", \"-0.035\", 3,\n 10.41937, 0.96823, 0.26382,\n -2.40940, 0.00000, 0.00000, -0.24918, 0.00000, 0.00000, 1.90991,\n 144.7362028, 0.56945, -5.570e-04,\n 13.0189698, -0.13593, -5.620e-04,\n// 2017 8 7\n2457973.265023, 18.0, 70.3, \" 1.289\", \" 0.246\", 2,\n 15.09655, 0.92574, 0.25224,\n -2.14646, -0.59847, 0.00000, 0.36055, 0.00000, 1.32219, 2.86829,\n 317.5301123, 0.53049, -9.100e-05,\n -15.4601810, 0.10725, 6.680e-04,\n// 2018 1 31\n2458150.063195, 14.0, 70.5, \" 2.294\", \" 1.315\", 1,\n 22.71624, 1.01459, 0.27645,\n -3.12629, -2.17293, -1.11740, -0.48331, 0.15049, 1.20594, 2.16050,\n 134.3315707, 0.64268, -5.610e-04,\n 16.9388896, -0.11778, -9.750e-04,\n// 2018 7 27\n2458327.349240, 20.0, 70.8, \" 2.679\", \" 1.609\", 1,\n 16.36331, 0.89992, 0.24521,\n -2.73331, -1.57272, -0.47616, 0.38175, 1.23969, 2.33630, 3.49665,\n 306.8788694, 0.51650, -2.060e-04,\n -18.9976299, 0.07311, 7.190e-04,\n// 2019 1 21\n2458504.717674, 5.0, 71.0, \" 2.168\", \" 1.195\", 1,\n 13.01859, 1.02164, 0.27837,\n -2.37188, -1.41529, -0.29228, 0.22418, 0.74086, 1.86390, 2.81976,\n 122.9689909, 0.67148, -2.500e-04,\n 20.3549097, -0.07966, -1.295e-03,\n// 2019 7 16\n2458681.397162, 22.0, 71.3, \" 1.704\", \" 0.653\", 2,\n 17.63006, 0.91617, 0.24964,\n -3.24893, -1.95166, 0.00000, -0.46811, 0.00000, 1.01400, 2.31310,\n 296.2585537, 0.54932, -3.260e-04,\n -21.8611696, 0.04360, 8.980e-04,\n// 2020 1 10\n2458859.299431, 19.0, 71.6, \" 0.896\", \"-0.116\", 3,\n 2.31820, 0.98355, 0.26799,\n -1.85095, 0.00000, 0.00000, 0.18633, 0.00000, 0.00000, 2.22517,\n 111.5716728, 0.63905, 1.040e-04,\n 23.0070397, -0.03331, -1.297e-03,\n// 2020 6 5\n2459006.309881, 19.0, 71.8, \" 0.568\", \"-0.405\", 3,\n 11.97754, 0.99031, 0.26983,\n -1.21606, 0.00000, 0.00000, 0.43716, 0.00000, 0.00000, 2.08750,\n 254.3313828, 0.62902, 2.580e-04,\n -21.4015901, -0.11683, 1.218e-03,\n// 2020 7 5\n2459035.688332, 5.0, 71.8, \" 0.355\", \"-0.644\", 3,\n 23.91051, 0.96399, 0.26266,\n -1.85707, 0.00000, 0.00000, -0.48002, 0.00000, 0.00000, 0.89297,\n 285.0999097, 0.61967, -3.110e-04,\n -24.0507199, 0.00848, 1.244e-03,\n// 2020 11 30\n2459183.905567, 10.0, 72.0, \" 0.829\", \"-0.262\", 3,\n 14.64925, 0.90976, 0.24789,\n -2.44079, 0.00000, 0.00000, -0.26638, 0.00000, 0.00000, 1.90895,\n 67.3338763, 0.52412, 5.440e-04,\n 20.7787998, 0.12215, -7.660e-04,\n// 2021 5 26\n2459360.972137, 11.0, 72.3, \" 1.954\", \" 1.009\", 1,\n 3.28263, 1.02237, 0.27857,\n -2.18575, -1.23068, 0.21037, 0.33129, 0.45204, 1.89293, 2.84819,\n 243.4405369, 0.65440, 6.760e-04,\n -20.6813296, -0.16991, 1.249e-03,\n// 2021 11 19\n2459537.877844, 9.0, 72.6, \" 2.072\", \" 0.974\", 2,\n 12.90779, 0.90168, 0.24569,\n -2.94399, -1.66849, 0.00000, 0.06825, 0.00000, 1.80448, 3.08064,\n 55.0691925, 0.49810, 4.170e-04,\n 19.1436013, 0.15692, -6.880e-04,\n// 2022 5 16\n2459715.675482, 4.0, 72.9, \" 2.373\", \" 1.414\", 1,\n 19.59045, 1.00919, 0.27498,\n -2.44436, -1.51510, -0.49559, 0.21157, 0.91905, 1.93878, 2.86679,\n 232.7346252, 0.61968, 9.490e-04,\n -19.2848086, -0.20387, 9.860e-04,\n// 2022 11 8\n2459891.958588, 11.0, 73.1, \" 2.414\", \" 1.359\", 1,\n 14.17454, 0.93550, 0.25490,\n -2.94172, -1.82624, -0.70224, 0.00611, 0.71394, 1.83777, 2.95585,\n 43.4474412, 0.51689, 3.480e-04,\n 16.8506402, 0.20047, -7.240e-04,\n// 2023 5 5\n2460070.225059, 17.0, 73.4, \" 0.964\", \"-0.046\", 3,\n 7.88732, 0.96114, 0.26189,\n -1.74356, 0.00000, 0.00000, 0.40142, 0.00000, 0.00000, 2.54844,\n 221.8793645, 0.54451, 8.670e-04,\n -17.1562006, -0.21449, 6.370e-04,\n// 2023 10 28\n2460246.343954, 20.0, 73.7, \" 1.118\", \" 0.122\", 2,\n 22.46046, 0.98859, 0.26937,\n -1.94992, -0.39117, 0.00000, 0.25490, 0.00000, 0.89808, 2.45945,\n 32.3064703, 0.55675, 3.880e-04,\n 14.0201398, 0.25007, -7.350e-04,\n// 2024 3 25\n2460394.801379, 7.0, 73.9, \" 0.956\", \"-0.132\", 3,\n 19.21563, 0.90150, 0.24564,\n -2.09301, 0.00000, 0.00000, 0.23311, 0.00000, 0.00000, 2.55901,\n 185.0704506, 0.43558, 8.400e-05,\n -1.1463000, -0.23681, 6.000e-06,\n// 2024 9 18\n2460571.614869, 3.0, 74.2, \" 1.037\", \" 0.085\", 2,\n 2.83532, 1.02233, 0.27856,\n -2.29558, -0.76599, 0.00000, -0.24313, 0.00000, 0.28039, 1.80897,\n 356.6608945, 0.55843, -7.500e-05,\n -2.5168701, 0.30406, 1.500e-04,\n// 2025 3 14\n2460748.791623, 7.0, 74.5, \" 2.260\", \" 1.178\", 1,\n 18.47691, 0.91021, 0.24801,\n -3.02261, -1.82017, -0.54629, -0.00106, 0.54374, 1.81734, 3.02108,\n 174.5962735, 0.44419, -1.910e-04,\n 2.6815700, -0.24199, -2.400e-05,\n// 2025 9 7\n2460926.259004, 18.0, 74.8, \" 2.344\", \" 1.362\", 1,\n 17.13767, 0.98863, 0.26938,\n -2.50684, -1.52866, -0.46781, 0.21609, 0.90044, 1.96141, 2.93749,\n 346.5540450, 0.52813, -6.400e-05,\n -6.0629002, 0.27961, 3.670e-04,\n// 2026 3 3\n2461102.982548, 12.0, 75.1, \" 2.184\", \" 1.151\", 1,\n 22.75188, 0.95519, 0.26027,\n -3.23982, -2.14568, -0.90522, -0.41886, 0.06675, 1.30709, 2.40387,\n 164.2699291, 0.49497, -4.580e-04,\n 6.2929402, -0.25912, -1.220e-04,\n// 2026 8 28\n2461280.676440, 4.0, 75.4, \" 1.965\", \" 0.930\", 2,\n 2.42632, 0.93608, 0.25506,\n -2.58040, -1.41577, 0.00000, 0.23455, 0.00000, 1.88631, 3.04894,\n 336.4129626, 0.48392, -1.450e-04,\n -9.3571705, 0.23948, 4.200e-04,\n// 2027 2 20\n2461457.468127, 23.0, 75.7, \" 0.927\", \"-0.057\", 3,\n 9.04327, 1.00598, 0.27410,\n -1.77348, 0.00000, 0.00000, 0.23505, 0.00000, 0.00000, 2.24303,\n 153.4670150, 0.56172, -6.340e-04,\n 9.8514098, -0.27025, -3.790e-04,\n// 2027 7 18\n2461605.169544, 16.0, 76.0, \" 0.001\", \"-1.068\", 3,\n 11.74916, 0.90017, 0.24528,\n -0.02964, 0.00000, 0.00000, 0.06905, 0.00000, 0.00000, 0.16686,\n 298.2026441, 0.51376, -5.290e-04,\n -22.3497792, 0.13548, 8.030e-04,\n// 2027 8 17\n2461634.802075, 7.0, 76.0, \" 0.546\", \"-0.525\", 3,\n 4.69582, 0.90215, 0.24582,\n -1.57095, 0.00000, 0.00000, 0.24981, 0.00000, 0.00000, 2.07201,\n 325.8795268, 0.46294, -3.120e-04,\n -12.4624793, 0.20488, 4.170e-04,\n// 2028 1 12\n2461782.676539, 4.0, 76.3, \" 1.047\", \" 0.066\", 2,\n 11.41266, 1.01445, 0.27641,\n -1.85198, -0.22887, 0.00000, 0.23694, 0.00000, 0.70453, 2.32612,\n 113.3149489, 0.65769, -5.800e-04,\n 22.7250007, -0.15405, -1.383e-03,\n// 2028 7 6\n2461959.264549, 18.0, 76.6, \" 1.427\", \" 0.389\", 2,\n 13.01592, 0.92761, 0.25275,\n -2.23964, -0.83109, 0.00000, 0.34918, 0.00000, 1.52711, 2.93762,\n 286.4586802, 0.55960, -6.470e-04,\n -23.3251489, 0.10636, 9.560e-04,\n// 2028 12 31\n2462137.203647, 17.0, 76.9, \" 2.274\", \" 1.246\", 1,\n 23.70953, 0.96786, 0.26372,\n -2.91514, -1.85225, -0.70662, -0.11246, 0.48234, 1.62816, 2.68857,\n 101.6038450, 0.61258, -1.880e-04,\n 23.3160989, -0.09780, -1.232e-03,\n// 2029 6 26\n2462313.641232, 3.0, 77.2, \" 2.827\", \" 1.844\", 1,\n 21.30183, 0.97907, 0.26677,\n -2.40235, -1.44010, -0.45963, 0.38958, 1.23848, 2.21873, 3.18312,\n 275.0152993, 0.63098, -6.160e-04,\n -23.3642398, 0.07392, 1.234e-03,\n// 2029 12 20\n2462491.446665, 23.0, 77.5, \" 2.201\", \" 1.117\", 1,\n 4.98723, 0.91793, 0.25012,\n -3.26363, -2.05698, -0.72696, -0.28005, 0.16748, 1.49772, 2.70244,\n 89.4015755, 0.55670, -2.200e-05,\n 23.0726198, -0.04518, -9.880e-04,\n// 2030 6 15\n2462668.273999, 19.0, 77.8, \" 1.448\", \" 0.502\", 2,\n 12.60692, 1.01864, 0.27755,\n -2.74255, -1.62741, 0.00000, -0.42402, 0.00000, 0.77859, 1.89455,\n 264.4815084, 0.68195, -2.860e-04,\n -22.5488092, 0.03344, 1.431e-03,\n// 2030 12 9\n2462845.436702, 22.0, 78.2, \" 0.942\", \"-0.163\", 3,\n 3.24577, 0.89949, 0.24509,\n -1.84606, 0.00000, 0.00000, 0.48086, 0.00000, 0.00000, 2.80768,\n 76.5739338, 0.53210, -1.400e-05,\n 21.9173291, 0.00081, -8.550e-04,\n// 2031 5 7\n2462993.661131, 4.0, 78.4, \" 0.881\", \"-0.090\", 3,\n 18.98725, 0.99778, 0.27187,\n -2.10993, 0.00000, 0.00000, -0.13285, 0.00000, 0.00000, 1.84589,\n 223.8244931, 0.62366, 6.450e-04,\n -17.8075992, -0.12082, 9.460e-04,\n// 2031 6 5\n2463022.989783, 12.0, 78.5, \" 0.129\", \"-0.820\", 3,\n 4.91474, 1.01603, 0.27684,\n -1.04038, 0.00000, 0.00000, -0.24521, 0.00000, 0.00000, 0.55220,\n 253.5373323, 0.67244, 2.140e-04,\n -21.0578011, -0.01560, 1.319e-03,\n// 2031 10 30\n2463169.824130, 8.0, 78.8, \" 0.716\", \"-0.320\", 3,\n 10.56313, 0.95035, 0.25895,\n -2.15326, 0.00000, 0.00000, -0.22087, 0.00000, 0.00000, 1.70935,\n 34.2044092, 0.55258, 1.090e-04,\n 14.8610607, 0.13365, -7.180e-04,\n// 2032 4 25\n2463348.135308, 15.0, 79.1, \" 2.219\", \" 1.191\", 1,\n 5.27865, 0.94595, 0.25775,\n -2.60682, -1.51198, -0.29838, 0.24739, 0.79390, 2.00783, 3.10028,\n 213.4425646, 0.54468, 5.380e-04,\n -13.8021799, -0.13295, 5.450e-04,\n// 2032 10 18\n2463524.294216, 19.0, 79.4, \" 2.083\", \" 1.103\", 1,\n 20.85453, 1.00194, 0.27300,\n -2.56668, -1.57194, -0.33173, 0.06117, 0.45345, 1.69357, 2.69017,\n 23.9130711, 0.59700, 1.220e-04,\n 10.4143292, 0.16884, -6.100e-04,\n// 2033 4 14\n2463702.301289, 19.0, 79.8, \" 2.171\", \" 1.094\", 1,\n 8.55088, 0.90582, 0.24682,\n -2.77948, -1.56046, -0.17891, 0.23093, 0.64118, 2.02279, 3.24030,\n 203.2924800, 0.48716, 2.850e-04,\n -9.3536700, -0.13909, 3.060e-04,\n// 2033 10 8\n2463878.955818, 11.0, 80.1, \" 2.306\", \" 1.350\", 1,\n 12.15961, 1.02419, 0.27907,\n -2.66564, -1.74715, -0.71713, -0.06038, 0.59637, 1.62631, 2.54468,\n 14.3819793, 0.61173, 2.140e-04,\n 5.8215098, 0.19027, -3.270e-04,\n// 2034 4 3\n2464056.296519, 19.0, 80.4, \" 0.855\", \"-0.227\", 3,\n 7.81216, 0.90434, 0.24641,\n -2.09593, 0.00000, 0.00000, 0.11646, 0.00000, 0.00000, 2.32758,\n 193.2175685, 0.47706, 2.400e-05,\n -4.5774899, -0.15075, 1.810e-04,\n// 2034 9 28\n2464233.616397, 3.0, 80.8, \" 0.991\", \" 0.014\", 2,\n 3.46470, 0.99948, 0.27234,\n -2.27841, -0.42760, 0.00000, -0.20646, 0.00000, 0.01747, 1.86620,\n 5.0774004, 0.57788, 2.390e-04,\n 1.0889501, 0.18950, 1.200e-05,\n// 2035 2 22\n2464380.879305, 9.0, 81.1, \" 0.965\", \"-0.053\", 3,\n 19.14047, 0.97105, 0.26459,\n -2.02783, 0.00000, 0.00000, 0.10332, 0.00000, 0.00000, 2.23332,\n 155.1434576, 0.55973, -4.900e-04,\n 9.2450598, -0.15816, -3.650e-04,\n// 2035 8 19\n2464558.550177, 1.0, 81.4, \" 1.151\", \" 0.104\", 2,\n 22.81492, 0.92315, 0.25154,\n -2.21059, -0.43198, 0.00000, 0.20425, 0.00000, 0.84335, 2.62022,\n 327.8561836, 0.51445, -7.800e-05,\n -12.0544600, 0.12987, 5.140e-04,\n// 2036 2 11\n2464735.425767, 22.0, 81.8, \" 2.275\", \" 1.299\", 1,\n 7.43734, 1.01606, 0.27685,\n -2.41503, -1.46447, -0.40241, 0.21840, 0.83894, 1.90094, 2.85264,\n 144.8934337, 0.62782, -5.360e-04,\n 13.6501194, -0.14868, -7.550e-04,\n// 2036 8 7\n2464912.619820, 3.0, 82.1, \" 2.527\", \" 1.454\", 1,\n 0.08167, 0.89966, 0.24514,\n -3.22524, -2.05210, -0.91864, -0.12433, 0.67000, 1.80350, 2.97660,\n 317.6887640, 0.50279, -2.460e-04,\n -16.0830806, 0.10100, 5.890e-04,\n// 2037 1 31\n2465090.084473, 14.0, 82.5, \" 2.180\", \" 1.207\", 1,\n 22.74243, 1.02060, 0.27809,\n -2.57384, -1.61810, -0.50330, 0.02734, 0.55822, 1.67304, 2.62792,\n 134.5470632, 0.65224, -3.260e-04,\n 17.5461908, -0.11988, -1.087e-03,\n// 2037 7 27\n2465266.673533, 4.0, 82.8, \" 1.858\", \" 0.809\", 2,\n 0.34569, 0.91846, 0.25026,\n -2.67510, -1.43929, 0.00000, 0.16480, 0.00000, 1.76761, 3.00530,\n 306.8162776, 0.54021, -4.220e-04,\n -19.6531197, 0.07628, 7.840e-04,\n// 2038 1 21\n2465444.659625, 4.0, 83.2, \" 0.900\", \"-0.114\", 3,\n 12.04203, 0.98086, 0.26726,\n -2.21650, 0.00000, 0.00000, -0.16900, 0.00000, 0.00000, 1.87996,\n 123.6573511, 0.62207, -6.300e-05,\n 20.9191602, -0.07720, -1.159e-03,\n// 2038 6 17\n2465591.614603, 3.0, 83.5, \" 0.442\", \"-0.527\", 3,\n 20.69864, 0.99321, 0.27063,\n -1.72048, 0.00000, 0.00000, -0.24952, 0.00000, 0.00000, 1.21833,\n 266.0278359, 0.64351, 7.200e-05,\n -22.1028405, -0.06987, 1.286e-03,\n// 2038 7 16\n2465620.983287, 12.0, 83.5, \" 0.500\", \"-0.495\", 3,\n 7.62887, 0.96732, 0.26357,\n -2.00651, 0.00000, 0.00000, -0.40110, 0.00000, 0.00000, 1.20088,\n 296.3011194, 0.61446, -4.900e-04,\n -22.5109699, 0.05004, 1.144e-03,\n// 2038 12 11\n2465769.239583, 18.0, 83.9, \" 0.805\", \"-0.289\", 3,\n 23.37035, 0.90828, 0.24749,\n -2.40329, 0.00000, 0.00000, -0.25002, 0.00000, 0.00000, 1.90425,\n 79.2043284, 0.53569, 4.280e-04,\n 22.0367704, 0.08266, -8.520e-04,\n// 2039 6 6\n2465946.287794, 19.0, 84.2, \" 1.827\", \" 0.885\", 2,\n 12.00373, 1.02288, 0.27871,\n -2.56578, -1.58722, 0.00000, -0.09295, 0.00000, 1.40105, 2.37971,\n 254.9191069, 0.67355, 5.460e-04,\n -22.1572208, -0.12354, 1.391e-03,\n// 2039 11 30\n2466123.205874, 17.0, 84.6, \" 2.042\", \" 0.943\", 2,\n 21.62889, 0.90247, 0.24590,\n -3.05955, -1.77598, 0.00000, -0.05903, 0.00000, 1.65737, 2.94174,\n 66.7343838, 0.51672, 3.640e-04,\n 21.2865390, 0.12287, -8.040e-04,\n// 2040 5 26\n2466300.990527, 12.0, 85.0, \" 2.494\", \" 1.535\", 1,\n 4.31155, 1.00691, 0.27436,\n -2.90581, -1.98314, -0.99593, -0.22734, 0.54153, 1.52894, 2.45023,\n 244.0346267, 0.63941, 9.080e-04,\n -21.4949485, -0.16286, 1.167e-03,\n// 2040 11 18\n2466477.294913, 19.0, 85.3, \" 2.453\", \" 1.397\", 1,\n 22.89564, 0.93813, 0.25562,\n -2.86757, -1.75947, -0.65434, 0.07792, 0.80969, 1.91463, 3.02533,\n 54.6477698, 0.54043, 3.650e-04,\n 19.6932693, 0.17104, -8.760e-04,\n// 2041 5 16\n2466655.529892, 1.0, 85.7, \" 1.075\", \" 0.064\", 2,\n 16.60842, 0.95788, 0.26100,\n -2.52950, -0.76792, 0.00000, -0.28259, 0.00000, 0.20637, 1.96593,\n 233.0363283, 0.56298, 8.980e-04,\n -20.0752801, -0.18227, 8.140e-04,\n// 2041 11 8\n2466831.691027, 5.0, 86.1, \" 1.166\", \" 0.170\", 2,\n 8.18430, 0.99132, 0.27011,\n -2.64882, -1.16956, 0.00000, -0.41535, 0.00000, 0.33619, 1.81795,\n 43.5557099, 0.58208, 4.950e-04,\n 17.6031614, 0.22358, -9.400e-04,\n// 2042 4 5\n2466980.104293, 15.0, 86.4, \" 0.868\", \"-0.218\", 3,\n 3.93673, 0.90083, 0.24546,\n -2.73409, 0.00000, 0.00000, -0.49696, 0.00000, 0.00000, 1.74000,\n 195.3737090, 0.44014, 2.110e-04,\n -5.5044499, -0.23043, 1.390e-04,\n// 2042 9 29\n2467156.948455, 11.0, 86.8, \" 0.953\", \"-0.003\", 3,\n 11.55642, 1.02165, 0.27837,\n -2.22492, 0.00000, 0.00000, -0.23707, 0.00000, 0.00000, 1.75058,\n 6.5434898, 0.55814, 1.550e-04,\n 1.7070000, 0.30240, -4.400e-05,\n// 2043 3 25\n2467334.105596, 15.0, 87.2, \" 2.190\", \" 1.114\", 1,\n 3.19801, 0.91192, 0.24848,\n -3.45929, -2.25459, -0.91096, -0.46569, -0.02094, 1.32240, 2.52847,\n 184.8194548, 0.44537, -5.400e-05,\n -1.7291900, -0.24297, 1.120e-04,\n// 2043 9 19\n2467511.577659, 2.0, 87.6, \" 2.243\", \" 1.256\", 1,\n 1.85877, 0.98577, 0.26860,\n -2.85155, -1.85274, -0.73370, -0.13617, 0.46191, 1.58105, 2.57766,\n 356.5962809, 0.51954, 1.280e-04,\n -1.8205400, 0.28385, 1.890e-04,\n// 2044 3 13\n2467688.318432, 20.0, 88.0, \" 2.230\", \" 1.203\", 1,\n 7.47298, 0.95808, 0.26105,\n -3.17659, -2.10034, -0.91141, -0.35763, 0.19546, 1.38426, 2.46311,\n 174.3894691, 0.49152, -2.930e-04,\n 2.0438299, -0.26762, 4.000e-05,\n// 2044 9 7\n2467865.972736, 11.0, 88.4, \" 2.086\", \" 1.046\", 1,\n 10.14469, 0.93322, 0.25428,\n -2.52155, -1.37203, 0.06358, 0.34567, 0.62861, 2.06459, 3.21213,\n 346.2838973, 0.47093, -1.800e-05,\n -5.4519599, 0.24920, 2.770e-04,\n// 2045 3 3\n2468042.821826, 8.0, 88.8, \" 0.962\", \"-0.017\", 3,\n 18.76711, 1.00795, 0.27464,\n -2.30925, 0.00000, 0.00000, -0.27617, 0.00000, 0.00000, 1.75653,\n 164.1167416, 0.55002, -4.370e-04,\n 5.6334201, -0.28701, -1.710e-04,\n// 2045 8 27\n2468220.079746, 14.0, 89.2, \" 0.682\", \"-0.392\", 3,\n 12.41418, 0.90130, 0.24558,\n -2.09945, 0.00000, 0.00000, -0.08611, 0.00000, 0.00000, 1.92845,\n 336.1018338, 0.44867, -2.240e-04,\n -8.7945405, 0.22099, 2.860e-04,\n// 2046 1 22\n2468368.043479, 13.0, 89.5, \" 1.035\", \" 0.053\", 2,\n 21.13649, 1.01278, 0.27596,\n -2.03981, -0.37541, 0.00000, 0.04350, 0.00000, 0.46435, 2.12704,\n 125.2553831, 0.63192, -6.520e-04,\n 20.5182998, -0.19760, -1.196e-03,\n// 2046 7 18\n2468544.545893, 1.0, 89.9, \" 1.281\", \" 0.246\", 2,\n 20.73428, 0.93041, 0.25351,\n -2.38348, -0.85479, 0.00000, 0.10143, 0.00000, 1.05486, 2.58548,\n 297.7875598, 0.54676, -7.540e-04,\n -21.8041905, 0.14458, 8.470e-04,\n// 2047 1 12\n2468722.559888, 1.0, 90.3, \" 2.265\", \" 1.234\", 1,\n 8.43063, 0.96507, 0.26296,\n -2.37366, -1.30290, -0.14572, 0.43732, 1.02102, 2.17839, 3.24659,\n 113.3162056, 0.59322, -3.330e-04,\n 22.0505793, -0.14043, -1.129e-03,\n// 2047 7 7\n2468898.941498, 11.0, 90.7, \" 2.731\", \" 1.751\", 1,\n 6.02294, 0.98226, 0.26764,\n -3.18202, -2.22532, -1.24440, -0.40404, 0.43601, 1.41669, 2.37546,\n 286.8475912, 0.62235, -8.060e-04,\n -22.5709202, 0.12108, 1.148e-03,\n// 2048 1 1\n2469076.787439, 7.0, 91.2, \" 2.214\", \" 1.128\", 1,\n 13.70833, 0.91603, 0.24960,\n -3.09717, -1.88655, -0.56727, -0.10145, 0.36494, 1.68447, 2.89325,\n 101.4266973, 0.54676, -1.920e-04,\n 22.6702704, -0.08713, -9.520e-04,\n// 2048 6 26\n2469253.585048, 2.0, 91.6, \" 1.583\", \" 0.639\", 2,\n 20.32528, 1.01984, 0.27788,\n -2.33978, -1.28547, 0.00000, 0.04114, 0.00000, 1.36721, 2.42231,\n 275.5027562, 0.67934, -5.060e-04,\n -22.6484104, 0.08178, 1.419e-03,\n// 2048 12 20\n2469430.769305, 6.0, 92.0, \" 0.962\", \"-0.144\", 3,\n 11.96687, 0.89973, 0.24516,\n -1.88331, 0.00000, 0.00000, 0.46331, 0.00000, 0.00000, 2.80990,\n 88.6136449, 0.53284, -1.810e-04,\n 22.4957505, -0.04008, -8.730e-04,\n// 2049 5 17\n2469578.976837, 11.0, 92.3, \" 0.764\", \"-0.209\", 3,\n 2.70562, 0.99498, 0.27111,\n -1.42376, 0.00000, 0.00000, 0.44410, 0.00000, 0.00000, 2.31394,\n 234.2706801, 0.63663, 6.000e-04,\n -20.5622094, -0.08673, 1.131e-03,\n// 2049 6 15\n2469608.301526, 19.0, 92.4, \" 0.251\", \"-0.699\", 3,\n 12.63310, 1.01428, 0.27636,\n -0.86202, 0.00000, 0.00000, 0.23663, 0.00000, 0.00000, 1.33751,\n 264.4414288, 0.67339, 1.300e-05,\n -21.9247792, 0.03130, 1.377e-03,\n// 2049 11 9\n2469755.161242, 16.0, 92.8, \" 0.681\", \"-0.355\", 3,\n 19.28424, 0.95326, 0.25974,\n -2.01524, 0.00000, 0.00000, -0.13020, 0.00000, 0.00000, 1.75245,\n 45.0746006, 0.57221, 1.100e-04,\n 18.2347387, 0.10724, -8.960e-04,\n// 2050 5 6\n2469933.438907, 23.0, 93.6, \" 2.105\", \" 1.077\", 1,\n 13.99975, 0.94288, 0.25691,\n -3.30035, -2.18220, -0.82571, -0.46622, -0.10586, 1.25095, 2.36673,\n 224.3098737, 0.55673, 5.470e-04,\n -17.2278596, -0.10589, 7.220e-04,\n// 2050 10 30\n2470109.640126, 3.0, 94.6, \" 2.034\", \" 1.054\", 1,\n 5.57563, 1.00433, 0.27365,\n -2.24586, -1.24446, 0.07525, 0.36302, 0.65014, 1.96976, 2.97293,\n 34.2338917, 0.61466, 2.030e-04,\n 14.1926695, 0.14771, -8.310e-04,\n// 2051 4 26\n2470287.594766, 2.0, 95.6, \" 2.277\", \" 1.202\", 1,\n 16.26924, 0.90456, 0.24647,\n -2.76609, -1.56582, -0.30528, 0.27438, 0.85435, 2.11495, 3.31387,\n 213.4638338, 0.49697, 3.290e-04,\n -13.1314297, -0.12143, 4.560e-04,\n// 2051 10 19\n2470464.299880, 19.0, 96.6, \" 2.371\", \" 1.412\", 1,\n 20.88072, 1.02418, 0.27906,\n -2.42122, -1.50526, -0.49924, 0.19711, 0.89348, 1.89945, 2.81521,\n 24.3945995, 0.62235, 3.540e-04,\n 9.8823207, 0.17503, -5.650e-04,\n// 2052 4 14\n2470641.595900, 2.0, 97.5, \" 0.947\", \"-0.131\", 3,\n 15.53052, 0.90560, 0.24676,\n -1.99902, 0.00000, 0.00000, 0.30159, 0.00000, 0.00000, 2.60102,\n 203.1420929, 0.48580, 9.300e-05,\n -8.6513097, -0.13998, 3.310e-04,\n// 2052 10 8\n2470818.948582, 11.0, 98.5, \" 1.064\", \" 0.082\", 2,\n 12.18580, 0.99704, 0.27167,\n -2.37219, -0.75990, 0.00000, -0.23402, 0.00000, 0.29457, 1.90471,\n 15.0380890, 0.58003, 3.820e-04,\n 5.3562297, 0.18095, -2.060e-04,\n// 2053 3 4\n2470966.223726, 17.0, 99.4, \" 0.932\", \"-0.081\", 3,\n 3.86157, 0.97388, 0.26536,\n -1.72354, 0.00000, 0.00000, 0.36942, 0.00000, 0.00000, 2.46114,\n 165.3044842, 0.55369, -3.850e-04,\n 5.1470700, -0.17337, -1.650e-04,\n// 2053 8 29\n2471143.837388, 8.0, 100.4, \" 1.019\", \"-0.033\", 3,\n 6.53328, 0.92068, 0.25087,\n -2.21655, 0.00000, 0.00000, 0.09731, 0.00000, 0.00000, 2.41267,\n 337.9085008, 0.50097, -2.600e-05,\n -8.2500096, 0.14618, 3.570e-04,\n// 2054 2 22\n2471320.785730, 7.0, 101.4, \" 2.249\", \" 1.277\", 1,\n 17.16118, 1.01741, 0.27722,\n -2.76498, -1.81663, -0.74378, -0.14249, 0.45854, 1.53136, 2.48076,\n 155.7577512, 0.61403, -4.470e-04,\n 9.7460900, -0.17316, -5.120e-04,\n// 2054 8 18\n2471497.893403, 9.0, 102.4, \" 2.381\", \" 1.306\", 1,\n 6.79730, 0.89957, 0.24511,\n -2.63698, -1.44601, -0.24956, 0.44168, 1.13292, 2.32942, 3.52055,\n 327.6670420, 0.49020, -2.390e-04,\n -12.7614802, 0.12223, 4.510e-04,\n// 2055 2 11\n2471675.448813, 23.0, 103.4, \" 2.197\", \" 1.225\", 1,\n 8.46626, 1.01940, 0.27776,\n -2.83599, -1.88187, -0.77829, -0.22848, 0.32159, 1.42520, 2.37833,\n 145.7453222, 0.63251, -3.090e-04,\n 14.1012098, -0.15181, -8.520e-04,\n// 2055 8 7\n2471851.953682, 11.0, 104.4, \" 2.007\", \" 0.959\", 2,\n 8.06405, 0.92086, 0.25091,\n -2.99733, -1.80702, 0.00000, -0.11163, 0.00000, 1.58263, 2.77489,\n 317.5654654, 0.52856, -4.640e-04,\n -16.7623412, 0.10573, 6.400e-04,\n// 2056 2 1\n2472030.018123, 12.0, 105.4, \" 0.906\", \"-0.110\", 3,\n 20.76314, 0.97811, 0.26651,\n -1.62466, 0.00000, 0.00000, 0.43494, 0.00000, 0.00000, 2.49592,\n 134.7674597, 0.60175, -1.320e-04,\n 18.1616711, -0.11207, -9.840e-04,\n// 2056 6 27\n2472176.918855, 10.0, 106.2, \" 0.314\", \"-0.652\", 3,\n 4.41700, 0.99606, 0.27140,\n -1.19864, 0.00000, 0.00000, 0.05252, 0.00000, 0.00000, 1.30031,\n 277.1115663, 0.65026, -1.310e-04,\n -21.9000488, -0.02380, 1.285e-03,\n// 2056 7 26\n2472206.280144, 19.0, 106.4, \" 0.643\", \"-0.349\", 3,\n 15.34723, 0.97065, 0.26448,\n -2.06503, 0.00000, 0.00000, -0.27655, 0.00000, 0.00000, 1.50905,\n 307.1902714, 0.60448, -6.030e-04,\n -20.2608204, 0.08754, 9.990e-04,\n// 2056 12 22\n2472354.575645, 2.0, 107.2, \" 0.786\", \"-0.311\", 3,\n 8.09145, 0.90692, 0.24712,\n -2.32106, 0.00000, 0.00000, -0.18452, 0.00000, 0.00000, 1.95308,\n 91.2173403, 0.54098, 2.680e-04,\n 22.3916789, 0.04107, -8.900e-04,\n// 2057 6 17\n2472531.601621, 2.0, 108.2, \" 1.697\", \" 0.755\", 2,\n 19.72209, 1.02322, 0.27880,\n -1.98257, -0.97213, 0.00000, 0.43890, 0.00000, 1.84973, 2.86022,\n 265.8891557, 0.68494, 3.570e-04,\n -22.7238498, -0.07628, 1.461e-03,\n// 2057 12 11\n2472708.537245, 1.0, 109.2, \" 2.018\", \" 0.918\", 2,\n 6.34999, 0.90338, 0.24615,\n -3.09573, -1.80658, 0.00000, -0.10612, 0.00000, 1.59372, 2.88384,\n 78.6717308, 0.53148, 2.470e-04,\n 22.5906697, 0.08438, -8.860e-04,\n// 2058 6 6\n2472886.302639, 19.0, 110.2, \" 2.621\", \" 1.661\", 1,\n 12.02991, 1.00449, 0.27370,\n -2.43401, -1.51456, -0.54752, 0.26334, 1.07446, 2.04168, 2.95964,\n 254.9760434, 0.65316, 7.820e-04,\n -22.8174405, -0.11922, 1.292e-03,\n// 2058 11 30\n2473062.636318, 3.0, 111.3, \" 2.480\", \" 1.426\", 1,\n 7.61674, 0.94078, 0.25634,\n -2.66895, -1.56762, -0.47594, 0.27163, 1.01873, 2.11021, 3.21413,\n 66.1814800, 0.56302, 3.070e-04,\n 21.8238102, 0.13536, -1.009e-03,\n// 2059 5 27\n2473240.830262, 8.0, 112.3, \" 1.195\", \" 0.183\", 2,\n 0.32678, 0.95462, 0.26011,\n -2.42083, -0.88191, 0.00000, -0.07371, 0.00000, 0.73776, 2.27457,\n 243.9907223, 0.57865, 8.500e-04,\n -22.1634499, -0.14600, 9.590e-04,\n// 2059 11 19\n2473417.042778, 13.0, 113.3, \" 1.204\", \" 0.208\", 2,\n 16.90540, 0.99396, 0.27083,\n -2.22750, -0.80159, 0.00000, 0.02667, 0.00000, 0.85245, 2.28071,\n 54.5853385, 0.60838, 5.260e-04,\n 20.3686008, 0.19115, -1.126e-03,\n// 2060 4 15\n2473565.400738, 22.0, 114.1, \" 0.767\", \"-0.316\", 3,\n 11.65510, 0.90029, 0.24531,\n -2.50705, 0.00000, 0.00000, -0.38228, 0.00000, 0.00000, 1.74235,\n 205.3953314, 0.44953, 3.170e-04,\n -9.4327901, -0.21855, 2.690e-04,\n// 2060 10 9\n2473742.287172, 19.0, 115.2, \" 0.880\", \"-0.080\", 3,\n 20.27752, 1.02083, 0.27815,\n -2.03573, 0.00000, 0.00000, -0.10787, 0.00000, 0.00000, 1.81997,\n 16.4741397, 0.56446, 3.760e-04,\n 5.8413601, 0.29347, -2.390e-04,\n// 2060 11 8\n2473771.669621, 4.0, 115.3, \" 0.027\", \"-0.938\", 3,\n 7.20775, 1.02406, 0.27903,\n -0.29288, 0.00000, 0.00000, 0.07091, 0.00000, 0.00000, 0.43410,\n 43.3863588, 0.62296, 8.140e-04,\n 18.2087191, 0.23714, -1.020e-03,\n// 2061 4 4\n2473919.412555, 22.0, 116.2, \" 2.104\", \" 1.034\", 1,\n 10.91637, 0.91379, 0.24899,\n -3.05715, -1.84606, -0.34809, -0.09869, 0.15009, 1.64775, 2.86026,\n 194.6423050, 0.45244, 7.200e-05,\n -5.8343502, -0.23832, 2.440e-04,\n// 2061 9 29\n2474096.901540, 10.0, 117.2, \" 2.156\", \" 1.162\", 1,\n 10.57987, 0.98290, 0.26782,\n -3.07039, -2.04953, -0.85450, -0.36303, 0.12911, 1.32422, 2.34279,\n 6.5947901, 0.51753, 3.210e-04,\n 2.4656601, 0.28116, 1.500e-05,\n// 2062 3 25\n2474273.648500, 4.0, 118.2, \" 2.291\", \" 1.270\", 1,\n 16.19408, 0.96103, 0.26186,\n -3.25458, -2.19742, -1.05841, -0.43601, 0.18578, 1.32466, 2.38437,\n 184.4485209, 0.49433, -1.210e-04,\n -2.2782198, -0.26959, 2.010e-04,\n// 2062 9 18\n2474451.273636, 19.0, 119.2, \" 2.196\", \" 1.150\", 1,\n 18.86579, 0.93048, 0.25353,\n -3.34369, -2.20258, -0.92837, -0.43273, 0.06361, 1.33817, 2.47731,\n 356.4913145, 0.46356, 1.290e-04,\n -1.1198099, 0.25326, 1.290e-04,\n// 2063 3 14\n2474628.170711, 16.0, 120.3, \" 1.009\", \" 0.034\", 2,\n 3.48821, 1.00984, 0.27516,\n -1.96825, -0.24258, 0.00000, 0.09707, 0.00000, 0.43458, 2.16217,\n 174.0554591, 0.54548, -2.260e-04,\n 1.4810400, -0.29594, 1.700e-05,\n// 2063 9 7\n2474805.361944, 21.0, 121.3, \" 0.810\", \"-0.268\", 3,\n 20.13254, 0.90062, 0.24540,\n -2.48298, 0.00000, 0.00000, -0.31334, 0.00000, 0.00000, 1.85733,\n 346.1027334, 0.43879, -1.160e-04,\n -4.8230702, 0.23141, 1.570e-04,\n// 2064 2 2\n2474953.408989, 22.0, 122.2, \" 1.020\", \" 0.038\", 2,\n 6.86033, 1.01097, 0.27546,\n -2.25950, -0.53777, 0.00000, -0.18427, 0.00000, 0.17133, 1.89118,\n 136.8168033, 0.60454, -6.150e-04,\n 17.5579899, -0.23343, -9.820e-04,\n// 2064 7 28\n2475129.828329, 8.0, 123.2, \" 1.136\", \" 0.104\", 2,\n 4.45264, 0.93330, 0.25430,\n -2.48965, -0.75251, 0.00000, -0.12009, 0.00000, 0.50907, 2.24811,\n 308.8145451, 0.53078, -7.900e-04,\n -19.5628297, 0.17843, 7.080e-04,\n// 2065 1 22\n2475307.915955, 10.0, 124.2, \" 2.256\", \" 1.223\", 1,\n 18.15447, 0.96227, 0.26220,\n -2.83608, -1.75817, -0.58980, -0.01708, 0.55630, 1.72484, 2.80012,\n 125.3402687, 0.56870, -3.980e-04,\n 19.8015500, -0.17975, -9.770e-04,\n// 2065 7 17\n2475484.242135, 18.0, 125.2, \" 2.589\", \" 1.612\", 1,\n 13.74130, 0.98541, 0.26850,\n -2.94680, -1.99131, -0.99732, -0.18876, 0.61945, 1.61318, 2.57066,\n 297.8574463, 0.60908, -9.160e-04,\n -21.0949197, 0.16279, 1.021e-03,\n// 2066 1 11\n2475662.128325, 15.0, 126.3, \" 2.226\", \" 1.138\", 1,\n 22.42944, 0.91423, 0.24911,\n -2.92664, -1.71291, -0.40266, 0.07981, 0.56282, 1.87333, 3.08533,\n 113.3109122, 0.53052, -3.140e-04,\n 21.3673196, -0.12625, -8.670e-04,\n// 2066 7 7\n2475838.896174, 10.0, 127.3, \" 1.718\", \" 0.775\", 2,\n 5.04638, 1.02089, 0.27817,\n -2.92778, -1.91964, 0.00000, -0.49183, 0.00000, 0.93564, 1.94452,\n 287.1405517, 0.66759, -7.010e-04,\n -21.8477312, 0.13151, 1.326e-03,\n// 2066 12 31\n2476016.104280, 15.0, 128.4, \" 0.977\", \"-0.128\", 3,\n 21.69071, 0.90009, 0.24525,\n -2.85817, 0.00000, 0.00000, -0.49728, 0.00000, 0.00000, 1.86362,\n 101.1959393, 0.52581, -3.410e-04,\n 22.0621804, -0.08266, -8.340e-04,\n// 2067 5 28\n2476164.288977, 19.0, 129.2, \" 0.640\", \"-0.333\", 3,\n 11.42672, 0.99209, 0.27032,\n -1.80106, 0.00000, 0.00000, -0.06456, 0.00000, 0.00000, 1.67431,\n 245.7158915, 0.64788, 4.600e-04,\n -22.7536499, -0.04465, 1.290e-03,\n// 2067 6 27\n2476193.611877, 3.0, 129.4, \" 0.375\", \"-0.575\", 3,\n 21.35421, 1.01238, 0.27585,\n -1.64578, 0.00000, 0.00000, -0.31496, 0.00000, 0.00000, 1.01805,\n 276.1013540, 0.66628, -2.120e-04,\n -21.9428109, 0.08148, 1.362e-03,\n// 2067 11 21\n2476340.503264, 0.0, 130.3, \" 0.654\", \"-0.381\", 3,\n 4.00534, 0.95616, 0.26053,\n -1.76886, 0.00000, 0.00000, 0.07834, 0.00000, 0.00000, 1.92296,\n 56.3041487, 0.59185, 4.000e-05,\n 21.0117895, 0.07376, -1.056e-03,\n// 2068 5 17\n2476518.737697, 6.0, 131.3, \" 1.983\", \" 0.953\", 2,\n 21.71811, 0.93984, 0.25608,\n -3.10116, -1.95278, 0.00000, -0.29527, 0.00000, 1.36360, 2.50962,\n 234.9923852, 0.56770, 4.960e-04,\n -19.9928397, -0.07425, 8.740e-04,\n// 2068 11 9\n2476694.990969, 12.0, 132.3, \" 1.996\", \" 1.015\", 1,\n 15.29947, 1.00658, 0.27427,\n -2.80921, -1.80227, -0.37003, -0.21673, -0.06409, 1.36806, 2.37666,\n 45.4946196, 0.63515, 2.140e-04,\n 17.6453498, 0.11668, -1.054e-03,\n// 2069 5 6\n2476872.881904, 9.0, 133.4, \" 2.396\", \" 1.323\", 1,\n 23.98761, 0.90342, 0.24616,\n -2.90244, -1.71895, -0.53666, 0.16570, 0.86829, 2.05065, 3.23298,\n 223.9482288, 0.50893, 3.330e-04,\n -16.4908600, -0.09789, 6.010e-04,\n// 2069 10 30\n2477049.649371, 4.0, 134.4, \" 2.424\", \" 1.462\", 1,\n 6.60456, 1.02402, 0.27902,\n -3.04379, -2.12854, -1.13810, -0.41509, 0.30796, 1.29838, 2.21335,\n 35.2764586, 0.63784, 4.440e-04,\n 13.7803002, 0.15036, -8.130e-04,\n// 2070 4 25\n2477226.889862, 9.0, 135.5, \" 1.052\", \"-0.021\", 3,\n 23.24888, 0.90702, 0.24714,\n -2.03484, 0.00000, 0.00000, 0.35669, 0.00000, 0.00000, 2.74721,\n 213.2846370, 0.49815, 1.370e-04,\n -12.4327201, -0.12315, 4.790e-04,\n// 2070 10 19\n2477404.285550, 19.0, 136.5, \" 1.126\", \" 0.138\", 2,\n 20.90690, 0.99455, 0.27099,\n -2.33955, -0.82620, 0.00000, -0.14680, 0.00000, 0.53523, 2.04641,\n 25.1479898, 0.58710, 5.000e-04,\n 9.4271295, 0.16500, -4.240e-04,\n// 2071 3 16\n2477551.563303, 2.0, 137.4, \" 0.888\", \"-0.119\", 3,\n 13.58541, 0.97672, 0.26613,\n -2.52408, 0.00000, 0.00000, -0.48072, 0.00000, 0.00000, 1.56129,\n 175.8690383, 0.55195, -2.550e-04,\n 0.6762700, -0.18138, 4.600e-05,\n// 2071 9 9\n2477729.128945, 15.0, 138.5, \" 0.899\", \"-0.159\", 3,\n 14.25164, 0.91836, 0.25023,\n -2.11411, 0.00000, 0.00000, 0.09467, 0.00000, 0.00000, 2.30526,\n 347.7575789, 0.49132, 5.100e-05,\n -4.1704102, 0.15623, 1.990e-04,\n// 2072 3 4\n2477906.141054, 15.0, 139.5, \" 2.213\", \" 1.244\", 1,\n 1.88228, 1.01863, 0.27755,\n -2.22398, -1.27662, -0.18529, 0.38530, 0.95565, 2.04697, 2.99529,\n 165.7610277, 0.60521, -3.110e-04,\n 5.6825300, -0.18849, -2.800e-04,\n// 2072 8 28\n2478083.170627, 16.0, 140.6, \" 2.243\", \" 1.166\", 1,\n 14.51566, 0.89963, 0.24513,\n -2.95472, -1.74095, -0.43995, 0.09505, 0.62999, 1.93103, 3.14518,\n 337.8472204, 0.47950, -1.940e-04,\n -8.9319605, 0.13869, 3.040e-04,\n// 2073 2 22\n2478260.808945, 7.0, 141.6, \" 2.222\", \" 1.250\", 1,\n 17.18737, 1.01804, 0.27739,\n -2.20093, -1.24963, -0.16164, 0.41467, 0.99125, 2.07927, 3.02947,\n 155.9896498, 0.61573, -2.160e-04,\n 10.3419301, -0.17375, -6.200e-04,\n// 2073 8 17\n2478437.237977, 18.0, 142.7, \" 2.148\", \" 1.101\", 1,\n 15.78241, 0.92334, 0.25159,\n -3.20855, -2.05197, -0.70671, -0.28855, 0.12889, 1.47386, 2.63247,\n 327.9556584, 0.51737, -4.510e-04,\n -13.3523701, 0.12947, 4.820e-04,\n// 2074 2 11\n2478615.372194, 21.0, 143.7, \" 0.919\", \"-0.097\", 3,\n 6.48698, 0.97529, 0.26574,\n -2.14582, 0.00000, 0.00000, -0.06735, 0.00000, 0.00000, 2.01240,\n 146.1082785, 0.58110, -1.290e-04,\n 14.6788296, -0.14122, -7.830e-04,\n// 2074 7 8\n2478762.223352, 17.0, 144.6, \" 0.187\", \"-0.777\", 3,\n 12.13537, 0.99881, 0.27215,\n -0.61322, 0.00000, 0.00000, 0.36045, 0.00000, 0.00000, 1.33048,\n 288.0870246, 0.64965, -3.230e-04,\n -20.9191807, 0.02158, 1.220e-03,\n// 2074 8 7\n2478791.580596, 2.0, 144.8, \" 0.781\", \"-0.209\", 3,\n 23.06560, 0.97395, 0.26538,\n -2.00168, 0.00000, 0.00000, -0.06570, 0.00000, 0.00000, 1.86789,\n 317.7175874, 0.59233, -6.420e-04,\n -17.4019901, 0.11967, 8.230e-04,\n// 2075 1 2\n2478939.913232, 10.0, 145.7, \" 0.771\", \"-0.327\", 3,\n 16.81255, 0.90568, 0.24678,\n -2.20647, 0.00000, 0.00000, -0.08244, 0.00000, 0.00000, 2.04268,\n 103.2149842, 0.53911, 9.800e-05,\n 21.8225586, -0.00034, -8.740e-04,\n// 2075 6 28\n2479116.913605, 10.0, 146.8, \" 1.562\", \" 0.622\", 2,\n 4.44319, 1.02340, 0.27885,\n -2.43534, -1.38157, 0.00000, -0.07347, 0.00000, 1.23454, 2.28833,\n 277.5810462, 0.68870, 1.120e-04,\n -22.5465296, -0.02486, 1.466e-03,\n// 2075 12 22\n2479293.872166, 9.0, 147.8, \" 2.001\", \" 0.901\", 2,\n 15.07109, 0.90439, 0.24643,\n -3.04814, -1.75615, 0.00000, -0.06803, 0.00000, 1.61945, 2.91256,\n 90.7510638, 0.54002, 8.500e-05,\n 22.9853505, 0.04330, -9.220e-04,\n// 2076 6 17\n2479471.610955, 3.0, 148.9, \" 2.755\", \" 1.794\", 1,\n 20.75102, 1.00195, 0.27301,\n -3.04889, -2.12926, -1.17167, -0.33708, 0.49774, 1.45551, 2.37355,\n 266.7513441, 0.66160, 5.710e-04,\n -23.4596900, -0.06997, 1.372e-03,\n// 2076 12 10\n2479647.982540, 12.0, 150.0, \" 2.499\", \" 1.446\", 1,\n 17.34059, 0.94344, 0.25706,\n -3.35286, -2.25785, -1.17586, -0.41904, 0.33733, 1.41909, 2.51667,\n 78.5598864, 0.58190, 1.660e-04,\n 23.2319698, 0.09238, -1.109e-03,\n// 2077 6 6\n2479826.124909, 15.0, 151.0, \" 1.326\", \" 0.312\", 2,\n 8.04515, 0.95135, 0.25922,\n -2.44842, -1.04274, 0.00000, -0.00219, 0.00000, 1.04123, 2.44470,\n 255.2358638, 0.59056, 7.260e-04,\n -23.5345096, -0.10550, 1.070e-03,\n// 2077 11 29\n2480002.399921, 22.0, 152.1, \" 1.231\", \" 0.236\", 2,\n 2.62924, 0.99648, 0.27152,\n -2.66862, -1.27769, 0.00000, -0.40190, 0.00000, 0.47155, 1.86468,\n 66.5721190, 0.63429, 4.550e-04,\n 22.5964514, 0.14928, -1.301e-03,\n// 2078 4 27\n2480150.691483, 5.0, 153.0, \" 0.656\", \"-0.425\", 3,\n 19.37346, 0.89989, 0.24520,\n -2.38984, 0.00000, 0.00000, -0.40441, 0.00000, 0.00000, 1.58090,\n 215.6565295, 0.46308, 4.000e-04,\n -13.0402202, -0.20104, 4.000e-04,\n// 2078 10 21\n2480327.630586, 3.0, 154.1, \" 0.817\", \"-0.146\", 3,\n 4.99863, 1.01988, 0.27789,\n -1.73939, 0.00000, 0.00000, 0.13406, 0.00000, 0.00000, 2.00769,\n 26.5563304, 0.57676, 5.760e-04,\n 9.7603907, 0.27723, -4.380e-04,\n// 2078 11 19\n2480357.027822, 13.0, 154.2, \" 0.061\", \"-0.905\", 3,\n 16.93159, 1.02452, 0.27915,\n -0.88275, 0.00000, 0.00000, -0.33226, 0.00000, 0.00000, 0.21790,\n 54.9906897, 0.64981, 8.500e-04,\n 21.1490712, 0.19954, -1.249e-03,\n// 2079 4 16\n2480504.715799, 5.0, 155.1, \" 2.010\", \" 0.945\", 2,\n 18.63474, 0.91579, 0.24953,\n -2.73805, -1.51628, 0.00000, 0.17916, 0.00000, 1.87352, 3.09679,\n 204.6062806, 0.46470, 1.870e-04,\n -9.7512101, -0.22794, 3.780e-04,\n// 2079 10 10\n2480682.229513, 18.0, 156.2, \" 2.079\", \" 1.079\", 1,\n 19.30097, 0.98003, 0.26703,\n -3.19097, -2.14715, -0.84462, -0.49169, -0.13796, 1.16465, 2.20609,\n 16.6632505, 0.52193, 5.050e-04,\n 6.6647603, 0.27167, -1.610e-04,\n// 2080 4 4\n2480858.974751, 11.0, 157.3, \" 2.361\", \" 1.346\", 1,\n 23.91245, 0.96403, 0.26267,\n -2.42433, -1.38615, -0.29078, 0.39401, 1.07828, 2.17349, 3.21417,\n 194.0577364, 0.50344, 4.000e-05,\n -6.2732000, -0.26564, 3.550e-04,\n// 2080 9 29\n2481036.578261, 2.0, 158.4, \" 2.297\", \" 1.244\", 1,\n 2.58415, 0.92786, 0.25282,\n -3.06991, -1.93264, -0.73621, -0.12172, 0.49334, 1.69010, 2.82541,\n 6.2044303, 0.46185, 2.700e-04,\n 3.0100300, 0.25102, -9.000e-06,\n// 2081 3 25\n2481213.515293, 0.0, 159.5, \" 1.065\", \" 0.095\", 2,\n 12.20932, 1.01164, 0.27565,\n -1.73638, -0.19305, 0.00000, 0.36703, 0.00000, 0.92523, 2.47037,\n 183.9467752, 0.54745, -7.000e-06,\n -2.7485298, -0.29777, 2.040e-04,\n// 2081 9 18\n2481390.649604, 4.0, 160.5, \" 0.927\", \"-0.154\", 3,\n 3.85091, 0.90009, 0.24525,\n -2.70655, 0.00000, 0.00000, -0.40949, 0.00000, 0.00000, 1.88847,\n 355.9714005, 0.43403, 3.000e-06,\n -0.6755000, 0.23626, 3.200e-05,\n// 2082 2 13\n2481538.770357, 6.0, 161.5, \" 0.996\", \" 0.013\", 2,\n 15.58144, 1.00902, 0.27493,\n -1.57111, 0.27718, 0.00000, 0.48856, 0.00000, 0.70224, 2.54851,\n 147.4132544, 0.58020, -4.960e-04,\n 14.2437798, -0.25932, -7.780e-04,\n// 2082 8 8\n2481715.115759, 15.0, 162.5, \" 1.001\", \"-0.029\", 3,\n 12.17101, 0.93624, 0.25510,\n -2.47067, 0.00000, 0.00000, -0.22179, 0.00000, 0.00000, 2.02524,\n 319.4898302, 0.51434, -7.590e-04,\n -16.7087703, 0.20692, 5.550e-04,\n// 2083 2 2\n2481893.268585, 18.0, 163.6, \" 2.240\", \" 1.205\", 1,\n 2.87557, 0.95944, 0.26142,\n -2.37898, -1.29342, -0.10800, 0.44604, 1.00077, 2.18635, 3.26922,\n 136.4432057, 0.54381, -3.760e-04,\n 16.9959900, -0.21028, -8.120e-04,\n// 2083 7 29\n2482069.545535, 1.0, 164.7, \" 2.452\", \" 1.477\", 1,\n 21.45967, 0.98849, 0.26934,\n -2.63988, -1.68155, -0.66086, 0.09285, 0.84614, 1.86655, 2.82677,\n 308.5844770, 0.59237, -9.440e-04,\n -18.9366397, 0.19987, 8.610e-04,\n// 2084 1 22\n2482247.467361, 23.0, 165.8, \" 2.241\", \" 1.151\", 1,\n 7.15054, 0.91251, 0.24864,\n -2.80042, -1.58513, -0.28756, 0.21667, 0.72141, 2.01925, 3.23290,\n 124.9274521, 0.51038, -3.690e-04,\n 19.2336505, -0.16068, -7.480e-04,\n// 2084 7 17\n2482424.207534, 17.0, 166.9, \" 1.854\", \" 0.912\", 2,\n 12.76475, 1.02178, 0.27841,\n -2.50326, -1.53063, 0.00000, -0.01918, 0.00000, 1.49210, 2.46540,\n 297.9280158, 0.65085, -8.050e-04,\n -20.3994511, 0.17488, 1.190e-03,\n// 2085 1 10\n2482601.439230, 23.0, 168.0, \" 0.993\", \"-0.112\", 3,\n 6.41182, 0.90057, 0.24538,\n -2.83236, 0.00000, 0.00000, -0.45848, 0.00000, 0.00000, 1.91545,\n 113.0991354, 0.51305, -4.530e-04,\n 20.7625286, -0.12116, -7.510e-04,\n// 2085 6 8\n2482749.595558, 2.0, 168.9, \" 0.506\", \"-0.468\", 3,\n 19.14509, 0.98909, 0.26950,\n -1.27620, 0.00000, 0.00000, 0.29338, 0.00000, 0.00000, 1.86581,\n 256.8217791, 0.65252, 2.630e-04,\n -24.1510998, -0.00090, 1.388e-03,\n// 2085 7 7\n2482778.919906, 10.0, 169.1, \" 0.505\", \"-0.448\", 3,\n 5.07257, 1.01034, 0.27529,\n -1.45007, 0.00000, 0.00000, 0.07775, 0.00000, 0.00000, 1.60773,\n 287.0504205, 0.65186, -3.800e-04,\n -21.2218400, 0.12705, 1.286e-03,\n// 2085 12 1\n2482925.851104, 8.0, 170.0, \" 0.639\", \"-0.396\", 3,\n 12.72644, 0.95902, 0.26131,\n -1.39538, 0.00000, 0.00000, 0.42650, 0.00000, 0.00000, 2.24565,\n 67.8721635, 0.60850, -1.060e-04,\n 23.0688393, 0.03405, -1.180e-03,\n// 2086 5 28\n2483104.030400, 13.0, 171.1, \" 1.849\", \" 0.818\", 2,\n 5.43648, 0.93683, 0.25526,\n -3.03738, -1.84819, 0.00000, -0.27039, 0.00000, 1.30896, 2.49579,\n 246.0286322, 0.57624, 3.810e-04,\n -22.1142606, -0.03772, 9.960e-04,\n// 2086 11 20\n2483280.347017, 20.0, 172.2, \" 1.968\", \" 0.986\", 2,\n 0.02058, 1.00870, 0.27485,\n -2.25051, -1.23971, 0.00000, 0.32841, 0.00000, 1.89578, 2.90812,\n 56.4775194, 0.65495, 1.480e-04,\n 20.3739301, 0.07991, -1.245e-03,\n// 2087 5 17\n2483458.163428, 16.0, 173.3, \" 2.528\", \" 1.455\", 1,\n 7.70597, 0.90241, 0.24589,\n -3.16937, -1.99964, -0.87008, -0.07772, 0.71481, 1.84444, 3.01320,\n 234.7833814, 0.52114, 2.860e-04,\n -19.3052411, -0.06878, 7.310e-04,\n// 2087 11 10\n2483635.003858, 12.0, 174.4, \" 2.465\", \" 1.501\", 1,\n 15.32566, 1.02370, 0.27893,\n -2.54463, -1.62877, -0.64852, 0.09260, 0.83378, 1.81403, 2.72953,\n 45.8381987, 0.65460, 4.690e-04,\n 17.0555595, 0.11915, -1.039e-03,\n// 2088 5 5\n2483812.178356, 16.0, 175.5, \" 1.170\", \" 0.102\", 2,\n 6.96725, 0.90859, 0.24757,\n -2.20240, -0.36308, 0.00000, 0.28053, 0.00000, 0.92222, 2.76268,\n 223.7177373, 0.51281, 1.420e-04,\n -15.7969298, -0.10024, 6.220e-04,\n// 2088 10 30\n2483989.627315, 3.0, 176.6, \" 1.176\", \" 0.183\", 2,\n 5.62801, 0.99202, 0.27030,\n -2.18181, -0.72342, 0.00000, 0.05557, 0.00000, 0.83716, 2.29336,\n 35.5007005, 0.59787, 5.760e-04,\n 13.1714896, 0.14173, -6.370e-04,\n// 2089 3 26\n2484136.898768, 10.0, 177.5, \" 0.833\", \"-0.168\", 3,\n 22.30652, 0.97958, 0.26691,\n -2.41175, 0.00000, 0.00000, -0.42957, 0.00000, 0.00000, 1.55108,\n 185.8462508, 0.55642, -1.200e-04,\n -3.6739400, -0.18185, 2.500e-04,\n// 2089 9 19\n2484314.424501, 22.0, 178.6, \" 0.789\", \"-0.274\", 3,\n 21.97001, 0.91618, 0.24964,\n -1.91266, 0.00000, 0.00000, 0.18802, 0.00000, 0.00000, 2.29075,\n 357.4976746, 0.48618, 1.410e-04,\n 0.0629400, 0.16016, 4.300e-05,\n// 2090 3 15\n2484491.492021, 0.0, 179.7, \" 2.166\", \" 1.201\", 1,\n 11.60613, 1.01973, 0.27785,\n -2.78503, -1.83710, -0.71667, -0.19149, 0.33345, 1.45389, 2.40272,\n 176.2237027, 0.60114, -1.480e-04,\n 1.2404900, -0.19624, -3.400e-05,\n// 2090 9 8\n2484668.453117, 23.0, 180.8, \" 2.117\", \" 1.038\", 1,\n 22.23403, 0.89985, 0.24519,\n -3.14144, -1.90089, -0.39067, -0.12518, 0.14019, 1.65046, 2.89158,\n 347.8014014, 0.47243, -1.250e-04,\n -4.8233199, 0.14916, 1.560e-04,\n// 2091 3 5\n2484846.165537, 16.0, 182.0, \" 2.254\", \" 1.283\", 1,\n 2.91121, 1.01654, 0.27698,\n -2.65225, -1.70445, -0.63426, -0.02710, 0.58033, 1.65056, 2.59717,\n 166.6024933, 0.60288, -8.100e-05,\n 6.0866100, -0.18858, -3.750e-04,\n// 2091 8 29\n2485022.526676, 1.0, 183.1, \" 2.281\", \" 1.235\", 1,\n 23.50078, 0.92591, 0.25229,\n -3.30403, -2.17288, -0.96728, -0.35977, 0.24713, 1.45243, 2.58571,\n 338.0311710, 0.50854, -3.980e-04,\n -9.5493097, 0.14720, 3.180e-04,\n// 2092 2 23\n2485200.722904, 5.0, 184.2, \" 0.938\", \"-0.079\", 3,\n 15.20808, 0.97242, 0.26496,\n -1.75269, 0.00000, 0.00000, 0.34970, 0.00000, 0.00000, 2.45327,\n 156.5306964, 0.56322, -6.200e-05,\n 10.8627397, -0.16081, -5.820e-04,\n// 2092 7 19\n2485347.529142, 1.0, 185.1, \" 0.062\", \"-0.899\", 3,\n 20.85647, 1.00148, 0.27288,\n -0.86701, 0.00000, 0.00000, -0.30059, 0.00000, 0.00000, 0.26193,\n 299.4881950, 0.64198, -4.780e-04,\n -19.1413490, 0.06636, 1.090e-03,\n// 2092 8 17\n2485376.884711, 9.0, 185.3, \" 0.913\", \"-0.076\", 3,\n 6.78396, 0.97720, 0.26626,\n -1.82378, 0.00000, 0.00000, 0.23307, 0.00000, 0.00000, 2.28797,\n 327.8852802, 0.58054, -6.150e-04,\n -14.0494302, 0.14569, 6.320e-04,\n// 2093 1 12\n2485525.250030, 18.0, 186.2, \" 0.755\", \"-0.344\", 3,\n 1.53366, 0.90454, 0.24647,\n -2.10770, 0.00000, 0.00000, 0.00071, 0.00000, 0.00000, 2.11024,\n 115.0471736, 0.53082, -4.600e-05,\n 20.3597694, -0.03930, -8.080e-04,\n// 2093 7 8\n2485702.225204, 17.0, 187.4, \" 1.427\", \" 0.487\", 2,\n 12.16156, 1.02341, 0.27885,\n -1.88947, -0.77720, 0.00000, 0.40489, 0.00000, 1.58704, 2.69930,\n 288.4863175, 0.68389, -9.600e-05,\n -21.5313791, 0.02235, 1.393e-03,\n// 2094 1 1\n2485879.208403, 17.0, 188.5, \" 1.986\", \" 0.887\", 2,\n 23.79220, 0.90552, 0.24673,\n -2.96847, -1.67546, 0.00000, 0.00167, 0.00000, 1.67811, 2.97239,\n 102.8125358, 0.54131, -9.000e-05,\n 22.4492096, 0.00190, -9.020e-04,\n// 2094 6 28\n2486056.918018, 10.0, 189.6, \" 2.786\", \" 1.823\", 1,\n 4.46938, 0.99931, 0.27229,\n -2.68866, -1.76489, -0.80581, 0.03243, 0.87091, 1.83017, 2.75226,\n 277.9104253, 0.66061, 3.450e-04,\n -23.1967994, -0.02279, 1.371e-03,\n// 2094 12 21\n2486233.330928, 20.0, 190.7, \" 2.514\", \" 1.463\", 1,\n 2.06169, 0.94612, 0.25780,\n -2.98356, -1.89524, -0.82153, -0.05774, 0.70560, 1.77906, 2.86994,\n 90.5074582, 0.59344, -2.600e-05,\n 23.6187088, 0.04832, -1.148e-03,\n// 2095 6 17\n2486411.416791, 22.0, 191.9, \" 1.462\", \" 0.446\", 2,\n 15.76352, 0.94810, 0.25834,\n -2.53594, -1.22017, 0.00000, 0.00299, 0.00000, 1.22863, 2.54210,\n 266.6658029, 0.59635, 5.420e-04,\n -24.1139197, -0.06248, 1.131e-03,\n// 2095 12 11\n2486587.760439, 6.0, 193.0, \" 1.251\", \" 0.257\", 2,\n 11.35035, 0.99890, 0.27218,\n -2.02369, -0.65842, 0.00000, 0.25053, 0.00000, 1.15727, 2.52457,\n 78.2007824, 0.65432, 2.960e-04,\n 23.8424999, 0.10421, -1.419e-03,\n// 2096 5 7\n2486735.975491, 11.0, 193.9, \" 0.531\", \"-0.547\", 3,\n 2.08909, 0.89964, 0.24513,\n -1.39560, 0.00000, 0.00000, 0.41178, 0.00000, 0.00000, 2.21902,\n 225.7410442, 0.47858, 4.430e-04,\n -16.0204512, -0.17895, 5.240e-04,\n// 2096 6 6\n2486765.613673, 3.0, 194.1, \" 0.005\", \"-1.058\", 3,\n 20.03848, 0.90698, 0.24713,\n -0.44662, 0.00000, 0.00000, -0.27185, 0.00000, 0.00000, -0.09400,\n 255.1419897, 0.53989, 5.100e-04,\n -24.1644102, -0.09507, 9.320e-04,\n// 2096 10 31\n2486912.979431, 12.0, 195.1, \" 0.767\", \"-0.201\", 3,\n 14.72247, 1.01879, 0.27759,\n -2.32103, 0.00000, 0.00000, -0.49365, 0.00000, 0.00000, 1.33410,\n 37.4675115, 0.59530, 7.400e-04,\n 13.5883506, 0.25233, -6.600e-04,\n// 2096 11 29\n2486942.390532, 21.0, 195.2, \" 0.086\", \"-0.882\", 3,\n 1.65270, 1.02481, 0.27923,\n -0.27772, 0.00000, 0.00000, 0.37277, 0.00000, 0.00000, 1.02317,\n 66.3005575, 0.67309, 7.830e-04,\n 23.1731294, 0.15713, -1.433e-03,\n// 2097 4 26\n2487090.012697, 12.0, 196.2, \" 1.901\", \" 0.842\", 2,\n 2.35311, 0.91795, 0.25012,\n -2.56194, -1.32228, 0.00000, 0.30473, 0.00000, 1.93045, 3.17168,\n 214.7978108, 0.48142, 2.790e-04,\n -13.3554599, -0.21164, 5.170e-04,\n// 2097 10 21\n2487267.563138, 2.0, 197.3, \" 2.015\", \" 1.010\", 1,\n 4.02208, 0.97717, 0.26625,\n -3.17754, -2.11109, -0.61100, -0.48469, -0.35745, 1.14271, 2.20671,\n 26.9057902, 0.53207, 6.680e-04,\n 10.6431107, 0.25536, -3.410e-04,\n// 2098 4 15\n2487444.294999, 19.0, 198.5, \" 2.445\", \" 1.437\", 1,\n 8.63355, 0.96708, 0.26351,\n -2.73826, -1.71875, -0.66213, 0.07997, 0.82163, 1.87808, 2.90001,\n 204.3203415, 0.51842, 1.970e-04,\n -10.3487594, -0.25444, 5.240e-04,\n// 2098 10 10\n2487621.888870, 9.0, 199.6, \" 2.383\", \" 1.325\", 1,\n 10.30252, 0.92536, 0.25214,\n -2.64599, -1.50859, -0.35617, 0.33287, 1.02240, 2.17513, 3.31059,\n 15.9934702, 0.46565, 4.040e-04,\n 7.0651998, 0.24311, -1.480e-04,\n// 2099 4 5\n2487798.854819, 9.0, 200.7, \" 1.133\", \" 0.168\", 2,\n 21.93316, 1.01333, 0.27611,\n -2.63195, -1.21900, 0.00000, -0.48436, 0.00000, 0.24870, 1.66333,\n 194.4566195, 0.55652, 2.180e-04,\n -7.2206403, -0.29161, 4.120e-04,\n// 2099 9 29\n2487975.942110, 11.0, 201.9, \" 1.034\", \"-0.051\", 3,\n 11.56928, 0.89972, 0.24515,\n -2.79185, 0.00000, 0.00000, -0.38937, 0.00000, 0.00000, 2.01391,\n 5.8093299, 0.43472, 1.250e-04,\n 3.5221800, 0.23564, -9.400e-05,\n// 2100 2 24\n2488124.128604, 15.0, 202.8, \" 0.965\", \"-0.017\", 3,\n 1.30528, 1.00695, 0.27437,\n -1.95177, 0.00000, 0.00000, 0.08650, 0.00000, 0.00000, 2.12513,\n 158.2699494, 0.55927, -3.200e-04,\n 10.2270804, -0.27870, -5.630e-04,\n// 2100 8 19\n2488300.406233, 22.0, 204.0, \" 0.872\", \"-0.158\", 3,\n 19.88938, 0.93925, 0.25592,\n -2.37000, 0.00000, 0.00000, -0.25042, 0.00000, 0.00000, 1.86680,\n 329.8184696, 0.49978, -6.760e-04,\n -13.3626205, 0.22960, 3.990e-04\n));\n}", "function nextHappyYear(year){\n let numSet = new Set();\n while(numSet.size!==4){\n //resetting Set to size=0 in order to prepare for next year++\n numSet = new Set();\n year++\n let newArr = year.toString().split('').map(Number);\n newArr.map(x=>numSet.add(x));\n }\n //this is my fave line :)\n return parseInt([...numSet].join(''));\n}", "function nbYear(current, percentage, migration, goal) {\n let populace = current\n let result = 0\n let percent = percentage / 100;\n while (!(populace > goal - 1)) {\n populace += (populace * percent);\n populace += migration;\n result += 1;\n\n }\n return result;\n}", "function calcAge1(birthYear) {\r\n // const age = 2021 - birthYear\r\n // return age\r\n return 2021 - birthYear;\r\n}", "function changeByYear(month, year, back) {\n back = back || false;\n var numDaysInMo,\n addend = 1;\n if (back) {\n addend = -1;\n }\n year = year + addend;\n numDaysInMo = daysInMonth(month, year);\n return {year: year, numDaysInMo: numDaysInMo};\n }", "function calculateAge(year) {\n console.log(2020 - year);\n}", "function retire(year){\n\tconst age=new Date().getFullYear()-year;\n\treturn [age,65-age];\n}", "getYearNumerals(year) { return `${year}`; }", "function myYear(year){\n return year * 365 * 24 * 60 * 60;\n}", "function moneyCounter2(entries) {\n for(i = 0; i < entries.length; i++) {\n for(j = 0; j < entries.length; j++) {\n for(k = 0; k < entries.length; k++) {\n if(entries[i] + entries[j] + entries[k] === 2020) {\n return entries[i] * entries[j] * entries[k]\n }\n\n }\n }\n }\n }", "function calcAge(year){\n console.log(2019 - year);\n}", "function convertYear(year) {\n return year.slice(2, 4)\n}", "function sortBubblesYear(b1, b2) {\n return b1.year - b2.year;\n}", "yearChangeRequiresMapping(year1, year2) {\n if (year1 === \"2017\") return year2 !== \"2017\";\n if (year2 === \"2017\") return year1 !== \"2017\";\n return false;\n }", "function sortBar(a, b) {\r\n return x0(year(a)) - x0(year(b));\r\n}", "function y2k(number) { return (number < 1000) ? number + 1900 : number; }", "function akanday(cc,yy,dd,mm){\n return ((((cc/4)-2*cc-1) + ((5*yy/4)) + ((26*(mm+1)/10)) + dd)%7);\n}", "function bestYearForCinema(movies) {}", "function transformYear(year) {\n if (year < 10) {\n year = \"190\" + year;\n } else if (year > 10 && year < 100) {\n year = \"19\" + year;\n } else {\n year = \"20\" + year[1] + year[2];\n }\n\n return year;\n}", "function calculateAge (bornAge){\n return 2020-bornAge;\n}", "function calculateAge(year) {\n console.log(2019 - year);\n}", "function part1() {\n for (let i = 0; i < input.length; i++) {\n for (let j = 0; j < input.length; j++) {\n if (i === j) continue\n\n if (input[i] + input[j] === 2020) {\n return input[i] * input[j]\n }\n }\n }\n}", "function obtainingPairMonthYear(monthsBackwards){\n var today = new Date();\n var actualMonth = today.getMonth();\n var actualYear = today.getYear();\n\n var year = actualYear;\n var month = actualMonth - monthsBackwards;\n \n while(month < 1){\n month += 12;\n --year;\n }\n return [month, year];\n}", "function dayOfProgrammer(year) {\r\n\r\n let index=1;\r\n let nbrOfDays=0;\r\n\r\n for(index=1;index<=12 && nbrOfDays+new Date(year, index,0).getDate()<256;index++){\r\n if(index==2 && year<=1917)\r\n nbrOfDays+=year%4==0?29:28;\r\n else if(index==2 && year==1918)\r\n nbrOfDays+=15;//28-14+1\r\n else \r\n nbrOfDays+=new Date(year,index,0).getDate();\r\n }\r\n\r\n let day=256-nbrOfDays<10?\"0\"+256-nbrOfDays:256-nbrOfDays;\r\n let month=index<10?\"0\"+index:index;\r\n\r\n return `${day}.${month}.${year}`;\r\n}", "function compareYear(year0, year1) {\n if (year1 != year0) { return `<h3>${year0}</h3>` }\n else { return \"\" };\n}", "function calculateAge(yearBirth) {\n console.log(2017-yearBirth);\n}", "function acuerdop2012(){\r\n var aump=/*aump_2012||*/[0.15,0.09];\r\n for(var g=0;g<=4;g++){\r\n //Meses posteriores a abril de 2012\r\n for(var m=23;m<tope_mes;m++){\r\n \r\n //Recorro categorías\r\n for(var c=0;c<bas[g][0].length;c++){\r\n switch(m){\r\n case 23://Mayo 2012\r\n bas[g][m][c][4]=bas[g][22][c][0]*aump[0];\r\n break;\r\n case 29://Noviembre 2012\r\n bas[g][m][c][4]=bas[g][22][c][0]*aump[1];\r\n break;\r\n case 35://Mayo 2013\r\n bas[g][m][c][4]=0;\r\n break;\r\n default://Otro mes\r\n bas[g][m][c][4]=bas[g][m-1][c][4];\r\n break;\r\n }\r\n if(m>34){\t\t\t//Remunerativo [0] desde mayo 2013\t(2º cuota)\r\n bas[g][m][c][0]=bas[g][34][c][0]+(bas[g][34][c][4])*gr_up;\r\n }else if(m>28){\t\t//Remunerativo [0] desde noviembre de 2012 (1º cuota)\r\n \tbas[g][m][c][0]=bas[g][28][c][0]+(bas[g][23][c][4])*gr_up;\r\n }\r\n }\r\n }\r\n } \r\n }", "function calcAge(year) {\n\tconsole.log(2016 - year);\n}", "function JtoG($, _, n, y) { function a($, _) { return Math.floor($ / _) } for ($g_days_in_month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31), $j_days_in_month = new Array(31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29), $jy = $ - 979, $jm = _ - 1, $jd = n - 1, $j_day_no = 365 * $jy + 8 * a($jy, 33) + a($jy % 33 + 3, 4), $i = 0; $i < $jm; ++$i)$j_day_no += $j_days_in_month[$i]; for ($j_day_no += $jd, $g_day_no = $j_day_no + 79, $gy = 1600 + 400 * a($g_day_no, 146097), $g_day_no %= 146097, $leap = !0, 36525 <= $g_day_no && ($g_day_no-- , $gy += 100 * a($g_day_no, 36524), $g_day_no %= 36524, 365 <= $g_day_no ? $g_day_no++ : $leap = !1), $gy += 4 * a($g_day_no, 1461), $g_day_no %= 1461, 366 <= $g_day_no && ($leap = !1, $g_day_no-- , $gy += a($g_day_no, 365), $g_day_no %= 365), $i = 0; $g_day_no >= $g_days_in_month[$i] + (1 == $i && $leap); $i++)$g_day_no -= $g_days_in_month[$i] + (1 == $i && $leap); return $gm = $i + 1, $gd = $g_day_no + 1, y && null != y ? $gy + \"/\" + $gm + \"/\" + $gd : { y: $gy, m: $gm, d: $gd } }", "function getYear(dataItems) {\n\treturn dataItems.map(item => +item.substring(0, 4));\n}", "function calcRetirement(year) {\n const age = new Date().getFullYear() - year;\n return [age, year];\n}", "function century(x) {\n x < 100 ? y = '19' + x : y = '20' + (x.toString().substring(1));\n return y;\n }", "function compareYear(a, b) {\r\n if (a.YEAR < b.YEAR)\r\n return -1;\r\n else if (a.YEAR > b.YEAR)\r\n return 1;\r\n else\r\n return 0;\r\n}", "function getYear(date){\n return moment(date.releaseDate).format('YYYY');\n }", "function difference_to_19(num){\r\n\tif (num<=19)\r\n\t\treturn 19-num;\r\n\telse \r\n\t\treturn 3*(num-19)\r\n}", "function years(num){\n let years0,\n str1=num.toString(), \nsL=str1.length;\nif (sL==1) {s1=\"0\"; s2=str1} else { s2=str1.charAt(sL-2); s2=str1.charAt(sL-1)} \nif (s2==\"1\" && s1!=\"1\") {years0=' год '} else if \n((s2==\"2\"||s2==\"3\"||s2==\"4\" )&&s1!=\"1\") {years0=' года '} else {years0=' лет '};\nreturn years0\n}", "function yearComparator( auto1, auto2){\r\n if(auto1.year >= auto2.year){\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\treturn false;\r\n\t}\r\n}", "function fixDate(d) {\r\n\tvar a = d.split(' ');\r\n\tvar year = a.pop();\r\n\treturn a.slice(0, 3).concat([year]).concat(a.slice(3)).join(' ');\r\n}", "function step_i(Year){\nvar Century=Math.floor(Year/100);\nvar Decade=Year-(Century*100);\nvar TABLA_I=tabla_i[Decade];\nreturn ((TABLA_I+tabla_ishift[Century]) % 7);\n}", "function nb_year(p0,percent, aug, p,){\n for (i = 0; i <= p ; i++){\n let years = p0 * (percent+1) + aug; \n return years;\n }\n}", "function nbYear(p0, percent, aug, p) { \n\n per = (percent/100)\n \n for ( var n = 0; p0 < p; n++) {\n \n p0 = p0 + (p0*per) + aug }\n \n return n\n }", "function year_increment(){\n\t\tif(pymt_num === 1){\n\t\t\tyear++;\n\t\t\treturn 1;\n\t\t}\n\t\telse if(pymt_num % 12 === 0){\n\t\t\treturn year++;\n\t\t}else {\n\t\t\treturn '';\n\t\t}\n\t}", "function ISO_2022() {}", "function ISO_2022() {}", "yearOptions() {\n let start = 2000;\n return Array.apply(null, Array(new Date().getFullYear() - start + 11)).map(\n (_, i) => i + start\n );\n }", "function fromShortYear(fn) {\n return function(match) {\n var short_year = fn(match);\n\n if (short_year >= 69) {\n short_year += 1900;\n } else {\n short_year += 2000;\n }\n return short_year;\n }\n }", "function fromShortYear(fn) {\n return function(match) {\n var short_year = fn(match);\n\n if (short_year >= 69) {\n short_year += 1900;\n } else {\n short_year += 2000;\n }\n return short_year;\n }\n }", "function yearComparator( auto1, auto2){\n /* your code here*/\n if (auto1.year > auto2.year) {\n return true;\n } else {\n return false;\n }\n}", "function calcular_idade2(ano_nascimento){\n const data=new Date();\n const idade = data.getUTCFullYear() - ano_nascimento;\n console.log(idade);\n}", "function solve(year){\r\n // Complete this function\r\n}", "function makeFriendlyDates(arr) {\n var months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n var start = arr[0].split('-'), startStr = '';\n var end = arr[1].split('-'), endStr = '';\n var result = [];\n function toNum(str) {\n return +str;\n }\n // convert to readable day formant\n function dayFormat(day) {\n switch (day) {\n case 1:\n case 21:\n return day + 'st';\n case 2:\n case 22:\n return day + 'nd';\n case 3:\n case 23:\n return day + 'rd';\n default:\n return day + 'th';\n }\n }\n start = start.map(toNum);\n end = end.map(toNum);\n var startYear = start[0], startMonth = start[1], startDay = start[2];\n var endYear = end[0], endMonth = end[1], endDay = end[2];\n // ending date equals to starting date\n if (arr[0] === arr[1]) {\n result.push(months[startMonth - 1] + ' ' + dayFormat(startDay) + ', ' + startYear);\n return result;\n }\n startStr += months[startMonth - 1] + ' ' + dayFormat(startDay);\n if (endYear === startYear) {\n if (startYear !== 2016) {\n startStr += ', ' + startYear; \n }\n if (endMonth === startMonth ) {\n endStr += dayFormat(endDay); // two dates within a month, just output ending day\n } else {\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay);\n }\n } else if (endYear - startYear === 1) {\n if (endMonth === startMonth && endDay < startDay || endMonth < startMonth) { // within one year\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay);\n if (startYear !== 2016) {\n startStr += ', ' + startYear; \n }\n } else if (endMonth >= startMonth) { // exceed one year\n startStr += ', ' + startYear;\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay) + ', ' + endYear;\n }\n } else if (endYear - startYear > 1) { // exceed one year\n startStr += ', ' + startYear;\n endStr += months[endMonth - 1] + ' ' + dayFormat(endDay) + ', ' + endYear;\n }\n\n result.push(startStr, endStr);\n return result;\n}", "function sortByYear\n(\n array\n) \n{\n return array.sort(function(a,b)\n {\n var x = parseInt(a.number.split('-')[1]);\n var y = parseInt(b.number.split('-')[1]);\n return ((x < y) ? -1 : ((x > y) ? 0 : 1));\n }).reverse();\n}", "function calcularEdad(anio_nac){\r\n let edad = 2021 - anio_nac;\r\n alert(edad);\r\n}", "function getYearFromAbbreviation(year) {\n return round(callDateGet(new date(), 'FullYear') / 100) * 100 - round(year / 100) * 100 + year;\n }", "function obterAno(data) {\n var ano = moment(data).year();\n return ano;\n}", "function getYear(date) {\n var year = date.substring(0, 2);\n return \"20\" + year;\n}", "function yearComparator( auto1, auto2){\r\n\r\n if (auto1.year > auto2.year){\r\n return false;\r\n }else if(auto1.year < auto2.year){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n}", "function afterNYears(names, n) {\n\tif(n<0) n = -n;\n\tlet keys = Object.keys(names);\n\tlet i=0;\n\twhile(i<keys.length){\n\t\tnames[keys[i]] = names[keys[i]]+n;\n\t\ti++;\n\t}\n\treturn names;\n}", "YY (date, dateLocale, forcedYear) {\n // workaround for < 1900 with new Date()\n const y = this.YYYY(date, dateLocale, forcedYear) % 100;\n return y >= 0\n ? pad(y)\n : '-' + pad(Math.abs(y))\n }", "function hebrew_delay_2(year) {\n var last, present, next;\n last = hebrew_delay_1(year - 1);\n present = hebrew_delay_1(year);\n next = hebrew_delay_1(year + 1);\n return ((next - present) == 356) ? 2 : (((present - last) == 382) ? 1 : 0);\n}", "getYearRange(date) {\n let year = [], first, last;\n date.forEach(e => {\n year.push(parseInt(e))\n })\n first = year[0];\n last = year[year.length-1]\n year.forEach(e => {\n first = e < first ? e : first;\n last = e > last ? e : last;\n })\n return({first,last});\n }", "function YearInT(arg0)\n{\n\treturn 13;\n}", "function getYearFromAbbreviation(year) {\n return round(callDateGet(getNewDate(), 'FullYear') / 100) * 100 - round(year / 100) * 100 + year;\n }", "function calcAge1(birthYear) {\n return 2037 - birthYear;\n}", "function convertYear(year) {\n year += \"\";\n\n return year.length < 4 ? \"200\" + year : year;\n }", "function yearComparator( auto1, auto2){\n /* your code here*/\n if (auto1.year < auto2.year) {\n \treturn true;\n }\n else {\n \treturn false;\n }\n}", "function convert2yrCourseReport(){\n convertCourseReport(2);\n}", "getYearDifference(year){\n return new Date().getFullYear()- year;\n }", "get _yearParts() {\n let date = new Date();\n let year = date.getFullYear();\n let month = date.getMonth();\n let day = date.getDate();\n let dayOfWeek = date.getDay();\n let week = date.getWeek();\n\n return { year, month, day, dayOfWeek, week };\n }", "function calcYearProjection(data) {\n\tlet projection = data.ytd;\n\tconst today = new Date();\n\tconst dd = today.getDate();\n\tconst mm = today.getMonth() + 1;\n\tconst yyyy = today.getFullYear();\n\tconst todayStr = mm + '/' + dd + '/' + yyyy;\n\tconst endDate = '12/31/' + yyyy;\n\n\tconst date1 = new Date(todayStr);\n\tconst date2 = new Date(endDate);\n\tconst timeDiff = Math.abs(date2.getTime() - date1.getTime());\n\tconst diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));\n\tconst diffWeek = Math.ceil(diffDays / 7);\n\tconst diffMonth = Math.ceil(diffDays / 30);\n\tconst diffYear = Math.ceil(diffDays / 365);\n\tswitch (data.schedule) {\n\t\tcase \"day\": projection += data.amount * diffDays; break;\n\t\tcase \"week\": projection += data.amount * diffWeek; break;\n\t\tcase \"month\": projection += data.amount * diffMonth; break;\n\t\tcase \"year\": projection += data.amount * diffYear; break;\n\t}\n\treturn projection;\n}", "function alphabetique(){\n entrepreneurs.sort.year\n }", "function date_diff(x,y)\n{\n var x_year = x.substr(0,4);\n var x_month = x.substr(5,2);\n \n var y_year = y.substr(0,4);\n var y_month = y.substr(5,2);\n \n var year_diff = (+x_year - +y_year) * 12;\n var month_diff = +x_month - +y_month;\n \n return (year_diff + month_diff);\n}", "function j01() {\n let eka = Number(document.getElementById(\"year1\").value);\n let toka = Number(document.getElementById(\"year2\").value);\n\n let today = new Date(); // kuluva päivä\n let current_year = today.getFullYear();\n let ika1 = current_year - eka;\n let ika2 = current_year - toka;\n let ero = ika1 - ika2;\n\n document.getElementById(\"age1\").innerHTML = \"Person 1 age is \" + ika1;\n document.getElementById(\"age2\").innerHTML = \"Person 2 age is \" + ika2;\n document.getElementById(\"difference\").innerHTML = \"Person 1 is \" + ero + \" years older than person 2\";\n\n}", "function calculateAge(el) {\r\n return 2016 - el;\r\n}", "function decades_(years){\r\n var dec = d3.split(years, function(d){return d%10==0;});\r\n dec.forEach(function(d,i){d.unshift(d[0]-1);});\r\n return dec;\r\n}", "function publish100years({ publishDate: value }) {\n if (1921 > value) return console.log(\"no\");\n}", "function MarchEquinox(year)\n{\n // range is between -1000 and +3000 , else return nothing\n if(year*1000 < -1000 || year*1000 > 3000)\n {\n return \"\";\n }\n // initial seed value\n let initialJulianFormatDay = 0;\n // for years between -1000 and +999 set the seed to...\n if(year*1000 >=-1000 && year*1000 < 1000)\n {\n initialJulianFormatDay = 1721139.29189 + 365242.13740*(year) + 0.06134*(year**2) + 0.00111*(year**3) - 0.00071*(year**4);\n }\n // for years between +1000 and +3000 set the seed to...\n if(year*1000 >=1000 && year*1000<= 3000)\n {\n initialJulianFormatDay = 2451623.80984 + 365242.13740*((year*1000-2000)/1000) + 0.05169*(((year*1000-2000)/1000)**2) - 0.00411*(((year*1000-2000)/1000)**3) - 0.00057*(((year*1000-2000)/1000)**4);\n }\n // set the years and month\n const JulianFormatDay = (initialJulianFormatDay - 2451545)/36525;\n // delta is used to calculate the day offset\n const delta = 1 + 0.0334*Math.cos((35999.373*(((JulianFormatDay -2451545)/36525) -2.47))* Math.PI / 180) + 0.0007*Math.cos((2*(35999.373*((JulianFormatDay -2451545)/36525) -2.47))* Math.PI / 180);\n // sum also used to calculate the day offset\n const sum = 485*Math.cos((324.96+1934.136*JulianFormatDay)* Math.PI / 180) + 203*Math.cos((337.23+32964.467*JulianFormatDay)* Math.PI / 180) + 199*Math.cos((324.08+20.186*JulianFormatDay)* Math.PI / 180) + 182*Math.cos((27.85+445267.112*JulianFormatDay)* Math.PI / 180)+ 156*Math.cos((73.14+45036.886*JulianFormatDay)* Math.PI / 180)+ 136*Math.cos((171.52+22518.443*JulianFormatDay)* Math.PI / 180)+ 77*Math.cos((222.54+65928.934*JulianFormatDay)* Math.PI / 180)+ 74*Math.cos((296.72+3034.906*JulianFormatDay)* Math.PI / 180)+ 70*Math.cos((243.58+9037.513*JulianFormatDay)* Math.PI / 180)+ 58*Math.cos((119.81+33718.147*JulianFormatDay)* Math.PI / 180)+ 52*Math.cos((297.17+150.678*JulianFormatDay)* Math.PI / 180)+ 50*Math.cos((21.02+2281.226*JulianFormatDay)* Math.PI / 180)+ 45*Math.cos((247.54+29929.562*JulianFormatDay)* Math.PI / 180)+ 44*Math.cos((325.15+31555.956*JulianFormatDay)* Math.PI / 180)+ 29*Math.cos((60.93+4443.417*JulianFormatDay)* Math.PI / 180)+ 18*Math.cos((155.12+67555.328*JulianFormatDay)* Math.PI / 180)+ 17*Math.cos((288.79+4562.452*JulianFormatDay)* Math.PI / 180)+ 16*Math.cos((198.04+62894.029*JulianFormatDay)* Math.PI / 180)+ 14*Math.cos((199.76+31436.921*JulianFormatDay)* Math.PI / 180)+ 12*Math.cos((95.39+14577.848*JulianFormatDay)* Math.PI / 180)+ 12*Math.cos((287.11+31931.756*JulianFormatDay)* Math.PI / 180)+ 12*Math.cos((320.81+34777.259*JulianFormatDay)* Math.PI / 180)+ 9*Math.cos((227.73+1222.114*JulianFormatDay)* Math.PI / 180)+ 8*Math.cos((15.45+16859.074*JulianFormatDay)* Math.PI / 180);\n // answer = years and month + days\n const finalJulianFormatDay = initialJulianFormatDay + 0.00001*sum/delta;\n // the answer is now in Julian day format we need to convert it to the gregorian date format\n\n // if answer + 0.5 > 2299161\n if(Math.trunc(finalJulianFormatDay+0.5) >= 2299161)\n {\n const alpha = Math.trunc(((Math.trunc(finalJulianFormatDay+0.5) - 1867216.25))/36524.25);\n const offsetFinalJulianFormatDay = Math.trunc(finalJulianFormatDay+0.5) + 1 + alpha - Math.trunc(alpha/4) + 1524;\n // the year in the gregorian date format\n const theYear = Math.trunc((offsetFinalJulianFormatDay - 122.1)/365.25);\n // the month in the gregorian date format\n const theMonth = Math.trunc((offsetFinalJulianFormatDay - Math.trunc(365.25*theYear))/30.6001);\n // the day in the gregorian date format\n const theDay = offsetFinalJulianFormatDay - Math.trunc(365.25*theYear) - Math.trunc(30.6001*theMonth) + finalJulianFormatDay+0.5 - Math.trunc(finalJulianFormatDay+0.5);\n let theFinalMonth = 0;\n let theFinalYear = 0;\n // formating it correctly \n if(theMonth < 14)\n {\n theFinalMonth = theMonth - 1;\n }\n if(theMonth == 14 || theMonth == 15)\n {\n theFinalMonth = theMonth - 13;\n }\n if(theYear > 2)\n {\n theFinalYear = theYear -4716;\n }\n if(theYear == 1 || theYear == 2)\n {\n theFinalYear = theYear -4715\n }\n // final answers formated properly \n const theHour = Math.trunc((theDay - Math.trunc(theDay))*24);\n const theMinute = Math.trunc(((theDay - Math.trunc(theDay))*24 - theHour)*60);\n const theSecond = Math.trunc((((theDay - Math.trunc(theDay))*24 - theHour)*60 - theMinute)*60);\n if(theMinute > 9 && theSecond > 9)\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":\"+theMinute+\":\"+theSecond+\" \"+\"GMT\";\n }\n if(theMinute> 9 && !(theSecond > 9))\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":\"+theMinute+\":0\"+theSecond+\" \"+\"GMT\";\n }\n if(!(theMinute > 9) && theSecond > 9)\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":0\"+theMinute+\":\"+theSecond+\" \"+\"GMT\";\n }\n if(!(theMinute > 9) && !(theSecond > 9))\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":0\"+theMinute+\":0\"+theSecond+\" \"+\"GMT\";\n }\n }else\n {\n const offsetFinalJulianFormatDay = Math.trunc(finalJulianFormatDay+0.5) + 1524;\n // the year in the gregorian date format\n const theYear = Math.trunc((offsetFinalJulianFormatDay - 122.1)/365.25);\n // the month in the gregorian date format\n const theMonth = Math.trunc((offsetFinalJulianFormatDay - Math.trunc(365.25*theYear))/30.6001);\n // the day in the gregorian date format\n const theDay = offsetFinalJulianFormatDay - Math.trunc(365.25*theYear) - Math.trunc(30.6001*theMonth) + finalJulianFormatDay+0.5 - Math.trunc(finalJulianFormatDay+0.5);\n let theFinalMonth = 0;\n let theFinalYear = 0;\n // formating it correctly \n if(theMonth < 14)\n {\n theFinalMonth = theMonth - 1;\n }\n if(theMonth == 14 || theMonth == 15)\n {\n theFinalMonth = theMonth - 13;\n }\n if(theYear > 2)\n {\n theFinalYear = theYear -4716;\n }\n if(theYear == 1 || theYear == 2)\n {\n theFinalYear = theYear -4715;\n }\n // final answers formated properly \n const theHour = Math.trunc((theDay - Math.trunc(theDay))*24);\n const theMinute = Math.trunc(((theDay - Math.trunc(theDay))*24 - theHour)*60);\n const theSecond = Math.trunc((((theDay - Math.trunc(theDay))*24 - theHour)*60 - theMinute)*60);\n if(theMinute > 9 && theSecond > 9)\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":\"+theMinute+\":\"+theSecond+\" \"+\"GMT\";\n }\n if(theMinute> 9 && !(theSecond > 9))\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":\"+theMinute+\":0\"+theSecond+\" \"+\"GMT\";\n }\n if(!(theMinute > 9) && theSecond > 9)\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":0\"+theMinute+\":\"+theSecond+\" \"+\"GMT\";\n }\n if(!(theMinute > 9) && !(theSecond > 9))\n {\n return theFinalYear+\"/\"+theFinalMonth+\"/\"+Math.trunc(theDay)+\" \"+theHour+\":0\"+theMinute+\":0\"+theSecond+\" \"+\"GMT\";\n }\n }\n}", "function dataSplittor_Occ__ThisYear(parsed_data, occ_pid_1, avail_pid_1, occ_pid_2, avail_pid_2, occ_pid_all, avail_pid_all, mon_pid_all) {\n let x=0; let y=0; let z=0;\n\n //Getting Current Month\n var date = new Date();\n var n = date.getMonth() + 1;\n\n for (let i = 1; i <= parsed_data.length; i++) {\n if (i <= n) {\n occ_pid_all[x] = parsed_data[i-1].occ;\n avail_pid_all[x] = parsed_data[i-1].avail;\n mon_pid_all[x] = parsed_data[i-1].mon;\n\n x+=1\n }\n if ((i > n) && (i <= (n*2))) {\n occ_pid_1[y] = parsed_data[i-1].occ;\n avail_pid_1[y] = parsed_data[i-1].avail;\n\n y+=1\n }\n if (i > (n*2)) {\n occ_pid_2[z] = parsed_data[i-1].occ;\n avail_pid_2[z] = parsed_data[i-1].avail;\n\n z+=1\n }\n }\n delete (date,n,x,y,z);\n \n}", "function CalculateYearToDays (year1, year2){\n var localOutput = 0;\n \n for (i = year1; i < year2; i++){\n if (IsItLeapYear(i)){\n localOutput += 366;\n }else if (inputYear = checkLeap){\n localOutput += 365;\n }\n else{\n localOutput += 365;\n }\n }\n \n return localOutput;\n}", "function isSilly(year) {\n let nums = year.split('').map(x => parseInt(x));\n let middle = parseInt([nums[1], nums[2]].join(''));\n let front = parseInt([nums[0], nums[1]].join(''));\n let back = parseInt([nums[2], nums[3]].join(''));\n return (middle === front + back);\n}", "getAcademicYear() {\n var today = new Date();\n var zero = '';\n var aneAca = {};\n var Day = today.getDate();\n var Month = today.getMonth() + 1;\n var Year = today.getFullYear();\n aneAcaP = Year - 1 + '-' + Year;\n aneAcaN = Year + '-' + (Year + 1);\n aneAca = { Previous: aneAcaP, Next: aneAcaN };\n return aneAca;\n }", "function orderByYear(peliculas) {\n const sortedPeliculas = [...peliculas];\n sortedPeliculas.sort((a, b) => {\n if (a.year - b.year)\n return a.year - b.year\n else {\n if (a.title < b.title) return -1\n else if (a.title > b.title) return 1\n else return 0\n }\n })\n return sortedPeliculas\n}", "function calculateAge(birthYear){\n return 2019 - birthYear;\n}", "function century(year) {\n\tconst century = Math.ceil(year / 100);\n\tconsole.log('century is:',century);\n \treturn century !== 21 ? `${century}th century` : `${century}st century`;\n}", "function calculateAge(element) {\n return 2016 - element;\n}", "function calculateAge(element) {\n return 2016 - element;\n}", "function orderByYear(arr) {\n let byYear = [...arr].sort((s1, s2) => {\n if (s1.year > s2.year) return 1;\n else return -1\n })\n return byYear\n}", "function day_in_this_year(yr,mo,da){\n\n var spend=0;\n for(let i =1 ; i<mo ;i++){\n var spend = spend + dayslist[i];\n }\n\n var spend = spend + (da-1);\n return spend;\n}", "function convertiData (data) {\n // +1 poiché getMonth() restituisce valori da 0 (Gennaio) a 11 (Dicembre).\n const mese = (data.getMonth() + 1).toString().padStart(2, \"0\");\n const anno = data.getFullYear();\n return anno + \"-\" + mese;\n }", "function changeYearIfNeeded(date, course) {\n\tif (date.getMonth() < 8)\n\t\tdate.setFullYear(parseInt('20'+course.substring(course.length-2))+1)\n}", "getYears(dates) {\n const year_array = [];\n dates.forEach((date) => {\n const dateKey = this.findKeyInObject(date);\n let curr_year = date[dateKey].slice(0, 4);\n if (year_array.length === 0) {\n year_array.push(curr_year);\n } else if (!this.checkIfExist(year_array, curr_year)) {\n year_array.push(curr_year);\n }\n });\n this.setState({\n years: year_array,\n });\n }", "function calcAge1(birthYear1) {\n return 2037 - birthYear1;\n}", "function compareYears(a, b) {\n if (a.year < b.year)\n return -1;\n if (a.year > b.year)\n return 1;\n return 0;\n }", "function changeFormate(x) {\n var year = x.substring(0, 4);\n var month = x.substring(5, 7);\n var day = x.substring(8, 10);\n var nd = year + \"/\" + month + \"/\" + day;\n return nd\n}" ]
[ "0.6269711", "0.60029393", "0.5993992", "0.5923982", "0.57941824", "0.57910234", "0.5782172", "0.5767492", "0.57529604", "0.5713791", "0.56953984", "0.5645329", "0.5613068", "0.5595255", "0.55934644", "0.5559049", "0.5543837", "0.55406713", "0.55332834", "0.5518242", "0.5492786", "0.5490881", "0.5486453", "0.54847914", "0.5481279", "0.54674566", "0.5464926", "0.54584795", "0.54488134", "0.5446995", "0.5434772", "0.5423679", "0.5399182", "0.53980803", "0.5386951", "0.5385737", "0.53852683", "0.5383074", "0.5370574", "0.53611666", "0.535471", "0.53484136", "0.5346807", "0.5337403", "0.53290534", "0.53174925", "0.53117913", "0.5306263", "0.5304744", "0.5297809", "0.5297809", "0.5287842", "0.52800137", "0.52800137", "0.52771974", "0.52733475", "0.526519", "0.52436024", "0.523203", "0.5223902", "0.5223796", "0.5219455", "0.5212084", "0.5211197", "0.5210033", "0.51998293", "0.51982546", "0.51970583", "0.5191872", "0.5190278", "0.51891714", "0.51815385", "0.5179169", "0.5175067", "0.516755", "0.5163803", "0.5160059", "0.5159951", "0.5158163", "0.5149748", "0.5149025", "0.5140914", "0.5131425", "0.51303387", "0.5129782", "0.51236236", "0.51088154", "0.50981224", "0.5095778", "0.50956935", "0.5093946", "0.50933176", "0.50933176", "0.5091374", "0.50912976", "0.5090172", "0.50777423", "0.5070474", "0.506617", "0.5062449", "0.5057931" ]
0.0
-1
Hides the install button.
hideButton() { if (this._installButton) { this._installButton.classList.toggle('hidden', true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hideCheck() {\n\t\t//Don't hide if installed. Stay green and showing\n\t\tif (this.props.installed === false) {\n\t\t\tthis.setState({\n\t\t\t\tcheckShown: false\n\t\t\t});\n\t\t}\n\t}", "function hideTableGeneratorButton() {\n\tdocument.getElementById(\"tableGeneratorButton\").hidden = true;\n}", "function hideAllProductBtns(){\n addProductBtnVisible(false);\n deleteProductBtnVisible(false);\n updateProductBtnVisible(false);\n }", "function hideWorkflowEditButton()\n {\n $.PercDataList.enableButtons(container);\n $(\"#perc-wf-update-editor\").hide();\n $(\"#perc-wf-name-wrapper\").hide();\n dirtyController.setDirty(false);\n }", "function btnSearchFirmware()\n{\n\tdocument.getElementById(\"id_dlg_install\").style.display = '';\n\tdocument.getElementById(\"id_dlg_failed\").style.display = 'none';\n\tdocument.getElementById(\"id_dlg_search\").style.display = 'none';\n}", "function showRepayBtn(){\n repayBtn.hidden = false\n}", "function showtableGeneratorButton() {\ndocument.getElementById(\"tableGeneratorButton\").hidden = false;\n}", "function hide_widget_wizard() {\n $('#open-nc-widget').remove();\n $('#dd-form, #data-tables').show('slow'); \n }", "function showInstallFrame() {\n log_d(\"Plugin not installed. Use install plugin button. Refresh the page when complete\");\n CDO.getInstallerURL(CDO.createResponder(function (url) {\n $('#installButton').\n attr('href', url).\n show().\n click(pollForPlugin);\n }));\n}", "function hide_download_icons_node(){\n if(node_enable() === true){\n CSSLoad(\"style_hide_download_section.css?v01\");\n //CSSLoad(\"style_hide_window_control_section.css?v03\");\n }\n}", "function hideChangeInterface() {\n updateDuckStatus(\"\");\n document.getElementById(\"js-buttons-area\").hidden = true;\n}", "function hideStartBtn() {\n startBtn.setAttribute(\"style\", \"display: none;\");\n}", "function hidebutton() {\n //xoa bot cac thành phan ko can thiet di\n document.getElementById(\"h1KeoBuaBao\").style.display = \"none\";\n document.getElementById(\"startGameSSP\").style.display = \"none\";\n\n //hiển thị lựa chọn\n document.getElementById(\"Choice\").style.display = \"flex\";\n }", "function hideTools() {\n\t\t\thideAllBtn();\n\t\t\t$('#colorelement').css('display','none');\n\t\t\t$('#fntEdit').css('display','none');\n\t\t}", "function mdm_hide_shutdown() { document.getElementById(\"shutdown\").style.display = 'none'; }", "function hideUpdateShowSaveButton() {\n artworkUpdateButton.style.display = \"none\"\n artworkSaveButton.style.display = \"inline\"\n}", "function hideSearchOptionsBtn()\n{\t\n\t$(searchOptionsBtn).hide();\t\n $(searchForm).show();\n}", "function addHideButton(x) {\n return null\n}", "show() {\n this.button.removeClass(\"hidden\");\n }", "hideVerifyInfoButton() {\n this.buttons.verifyButton.classList.add(\"hidden\");\n }", "function showDownload() {\n $btnDownload.style.visibility = \"visible\";\n}", "function hideDealButton() {\n document.getElementById('deal').style.display = \"none\";\n }", "function hide_add_product()\n{\n\t//hide the modal box \n\t$('.overlay').hide(); \n\t$('#product_picker').hide(); \t\n\t//Redraw the screen \n\tredraw_order_list();\n}", "function startUp() {\n document.getElementById(\"startUp\").style.display = \"none\";\n}", "function hide_version_detail(){\n\t\n\t$(\"#version_detail\").hide();\n}", "function browserActionButtonOff() {\n browser.browserAction.setTitle({ title: 'IIIF manifest not found' });\n browser.browserAction.setIcon({ path: 'icon_off.svg' });\n }", "doHidden( root ) {\n root.style.display = 'none';\n }", "function _hideOtherButtons(hide){\n\t\t\t$('.btn_addremove').show();\n\t\t\t$('.btn_download').show();\n\t\t\t$('.btn_delete').show();\n\t\t\t\n\t\t\t/*if (hide) {\n\t\t\t\t$('.btn_addremove').hide();\n\t\t\t\t$('.btn_download').hide();\n\t\t\t\t$('.btn_delete').hide();\n\t\t\t}*/\n\t\t}", "function unHideButton() {\n document.getElementById(\"login-form-submit\").hidden = false; //Unhide login box\n document.getElementById(\"is-login\").innerHTML = \"You can now login\"; //Tell user they can log in\n}", "function hideIcon(hide) {\n if (typeof Main.panel.statusArea.appMenu._iconBox != 'undefined') {\n let iconBox = Main.panel.statusArea.appMenu._iconBox; \n hideElement(iconBox, hide);\n }\t\n}", "function hideSaveDeleteButtons() {\n artworkInfo.style.display = \"none\"\n}", "function hideButton() {\n _panelWindow.document.getElementById('treeContainer').removeChild(timeTravelButton);\n }", "function handleHidePanel() {\n\tbutton.state('window', {checked: false});\n}", "function hideElement() {\n header.setAttribute(\"style\", \"visibility: hidden\");\n text.setAttribute(\"style\", \"visibility: hidden\");\n startBtn.setAttribute(\"style\", \"visibility: hidden\");\n}", "function disappearUpdateButton() {\n document.getElementById(\"update\").style.display = \"none\";\n}", "function enableExitButton() {\n exit.prop(\"disabled\", false);\n }", "hide() {}", "function _hideContent() {\n btn_intro_launchButton.style.display = \"none\";\n txt_intro_welcomeTxt1.style.display = \"none\";\n txt_intro_welcomeTxt2.style.display = \"none\";\n txt_intro_welcomeTxt3.style.display = \"none\";\n txt_intro_welcomeTxt4.style.display = \"none\";\n txt_intro_welcomeTxt5.style.display = \"none\";\n txt_intro_welcomeTxt6.style.display = \"none\";\n }", "hide() {\n this.isVisible = false;\n }", "function showApp() {\n if (!isHidden) {\n return;\n }\n\n Object(external_lodash_[\"forEach\"])(hiddenElements, function (element) {\n element.removeAttribute('aria-hidden');\n });\n hiddenElements = [];\n isHidden = false;\n}", "hide() {\n this.button.addClass(\"hidden\");\n this.button.removeClass(\"active\");\n }", "function myBtnHide() {\n document.getElementById(\"myBtn\").style.display = \"none\";\n}", "function hideWorkflowUpdateEditor()\n {\n $.PercDataList.enableButtons(container);\n $(\"#perc-workflow-name\").val(\"\");\n $(\"#perc-wf-update-editor\").hide();\n $(\"#perc-wf-name-wrapper\").show();\n dirtyController.setDirty(false);\n }", "function hideInstruction() {\n document.getElementById(\"instruction\").style.display = \"none\";\n }", "function hideWaste(){\n document.getElementById(\"wasteButton\").style.display = \"none\";\n}", "onBeforeHide() {\n this.enableWifiScans_ = false;\n Oobe.getInstance().setOobeUIState(OOBE_UI_STATE.HIDDEN);\n this.isCloseable_ = true;\n }", "function hideDeleteButton() {\n if (!deleteButton.classList.contains('invisible')) {\n deleteButton.classList.add('invisible');\n }\n}", "function offBtn (nameBtn) {\n\t\t\t$('#' + nameBtn).css('display','none');\n\t\t}", "function FXdisplayLaunch () {\n document.getElementById(\"launch\").style.visibility = \"visible\";\n }", "hide() {\n\t\tthis.isVisible = false;\n this.element.classList.remove('hide')\n\t\tthis.element.classList.remove('showCarousel')\n\t\tthis.element.classList.add('hideCarousel')\n\t\tthis.buttons.style.paddingTop = \"72px\"\n\t\t\n\t}", "function hideUselessBtns() {\n $(\"#navCat\").attr(\"class\",\"hide\");\n $(\"#navFav\").attr(\"class\",\"hide\");\n disableCopy();\n}", "function ocultar(){\r\n /* btnUpdate = document.getElementById(\"btnUpdate\");\r\n btnUpdate.hidden = \"true\";*/\r\n}", "function init(){\n $(\"#hide\").hide();\n $(\"#hide-button\").hide();\n $(\"#hide-go\").hide();\n }", "function hideAddDeviceForm() {\n $(\"#addDeviceControl\").show(); // Hide the add device link\n $(\"#addDeviceForm\").slideUp(); // Show the add device form\n $(\"#error\").hide();\n}", "function hideNotWorkingStuff() {\n // Top right account control buttons\n hide('#material-one-right #gb > div > div > div:not(:last-child)');\n style('#material-one-right #gb > div > div > div:last-child',\n { display: 'block', float: 'right' });\n style('#material-one-right #gb > div > div', { display: 'block', float: 'right' });\n cssRule('#material-one-right #gb {min-width: 40px !important}');\n\n // Built in mini player buttons\n hide('.player-top-right-items > paper-icon-button');\n\n // Settings options that won't work\n cssRule('#download { display: none !important }');\n cssRule('#manage-downloads { display: none !important }');\n cssRule('.subscription-gifting-card.settings-card {display: none !important}');\n\n // Hide the upload music button in settings\n cssRule('.music-sources-card.settings-card {display: none !important}');\n\n hide('.upload-dialog-bg', true);\n hide('.upload-dialog', true);\n\n cssRule('.song-menu.goog-menu.now-playing-menu > .goog-menuitem:nth-child(3) { display: none !important; }');\n}", "static hide(v) {\n // Set style to none\n UI.find(v).setAttribute(\"hidden\", \"true\");\n }", "function hideUpArrow() {\n ProductDetailsScreen.FlexImageUpArrow.isVisible = false;\n ProductDetailsScreen.FlexImageDownArrow.isVisible = true;\n}", "hideDragButtons() {\n if (this.dragButtons) this.dragButtons.setVisible(false);\n }", "function hideClearFilterBtn() {\n SetNodesVisibility(\".clear-filter\", false);\n}", "showVerifyInfoButton() {\n this.buttons.verifyButton.classList.remove(\"hidden\");\n }", "hide() {\n this.backButtonOpen_ = false;\n chrome.accessibilityPrivate.setSwitchAccessMenuState(\n false, SAConstants.EMPTY_LOCATION, 0);\n this.menuPanel_.setFocusRing(SAConstants.BACK_ID, false);\n }", "function showButtonVersion(acc) {\n elm = $('.version__button .invoice_button');\n acc == 'S'\n ? elm.css({ visibility: 'visible' })\n : elm.css({ visibility: 'hidden' });\n}", "function showHidePayPal() {\n\tif (formIsValid()) {\n\t\t$('#paypal-button').show()\n\t\t$('#empty-order-warning').hide()\n\t} else {\n\t\t$('#paypal-button').hide()\n\t\t$('#empty-order-warning').show()\n\t}\n}", "function hideRemote() {\n $(\"#remote\").css(\"display\", \"none\");\n}", "function onPageLoad() {\t\n\tdocument.getElementById(\"connect-button\").hidden = false;\n\tdocument.getElementById(\"disconnect-button\").hidden = true;\n\tdocument.getElementById(\"subscribe-form\").hidden = true;\n\tdocument.getElementById(\"subscriptions\").hidden = true;\n}", "function resetUI() {\n if (traceLib.valid) {\n $('.needsConfig').show();\n } else {\n $('.needsConfig').hide();\n }\n }", "function hidePanic(){\n\n document.getElementById(\"panicButton\").style.display = \"none\";\n\n }", "hideAll()\n\t{\t\n\t\tContainer.Components.booted.forEach(function(component) {\n\t\t\tif (component.constructor.name != 'Checkout') {\n\t\t\t\tcomponent.hide();\n\t\t\t}\n\t\t});\n\t}", "function desktupSetUp () {\n \n $('.no-mobile').show()\n\t$('#AutenticationRequest_butt').addClass('btn-check1').removeClass('btn-validate');\n $('.mobile').hide()\n }", "function hideDownArrow() {\n ProductDetailsScreen.FlexImageUpArrow.isVisible = true;\n ProductDetailsScreen.FlexImageDownArrow.isVisible = false;\n}", "function hideReplaceDeviceForm() {\n $(\"#relpaceDeviceControl\").show(); // Hide the add device link\n $(\"#replaceDeviceForm\").slideUp(); // Show the add device form\n $(\"#error\").hide();\n}", "function hideBtn(){\n\tsetTimeout(function(){\n\t\tload_btn.hide();\n\t},300);\n}", "function hide() {\n return uiLabellingFlowServiceImplementation._hide();\n}", "function disappear() {\n $('#magic-button').hide();\n}", "function hideButtons() {\n $(\".private\").css(\"display\", \"none\");\n $(\"#signOff\").css(\"display\", \"none\"); //Ocultamos el boton cerrar sesion\n $(\"#signUp\").css(\"display\", \"inherit\"); //Mostramos el boton iniciar sesion\n}", "function hideButton() {\n var hideCloseBtn = document.getElementById(\"closeButton\")\n hideCloseBtn.style.visibility = \"hidden\";\n }", "function hide() {\n $$invalidate('modalIsVisible', modalIsVisible = false); // Ensure we cleanup all event listeners when we hide the modal\n\n _cleanupStepEventListeners();\n }", "function showChangeInterface() {\n updateDuckStatus(\"\");\n document.getElementById(\"js-buttons-area\").hidden = false;\n}", "function hideMenu() {\n startButton.style.visibility = \"hidden\";\n leaderBoardButton.style.visibility = \"hidden\";\n instructionsButton.style.visibility = \"hidden\";\n}", "function hidePayPal() {\r\n var pp = document.getElementById(\"paypal-button-container\");\r\n pp.style.display = \"none\";\r\n }", "function hide_download_icons_android(){\n if(IsAndroid() === true){\n CSSLoad(\"style_hide_download_section.css?v0221\");\n CSSLoad(\"style_hide_window_control_section.css?v023\");\n }\n}", "function hideAddDeviceForm() {\n $(\"#addDeviceControl\").show(); // Hide the add device link\n $(\"#addDeviceForm\").slideUp(); // Show the add device form\n $(\"#error\").hide();\n}", "function hideAddDeviceForm() {\n $(\"#addDeviceControl\").show(); // Hide the add device link\n $(\"#addDeviceForm\").slideUp(); // Show the add device form\n $(\"#error\").hide();\n}", "function hideForm() {\n mainForm.style.display = 'none';\n newInfoButton.style.display = 'block';\n}", "function hideSaveCoverButton() {\n saveCoverButton.classList.add('hidden');\n}", "function disableInsConsButton() {\t\t\n\tvar xbutton = document.getElementById(\"insconsbutton\");\n\tif( xbutton != undefined ){\n\t\tdocument.getElementById(\"insconsbutton\").setAttribute('hidden', 'true');\n\t\tacceptButton = false;\n\t}\n\treturn true;\n}", "function hideExt(state) {\n $('#toolbar-id').attr('hidden', state);\n $('#main-content-id').attr('hidden', state);\n}", "function hideModal() {\n instructions.style.display = 'none';\n showButton.style.display = 'inline';\n}", "function showForm() {\n document.getElementById(\"add-product-form\").classList.toggle(\"hidden\");\n if (showFormBtn.textContent == \"Press to add products\") {\n showFormBtn.textContent = \"Press to hide\";\n } else {\n showFormBtn.textContent = \"Press to add products\";\n } \n}", "hideAddButton() {\n this.buttons.addButton.classList.add(\"hidden\");\n }", "function toggle() {\n\t\tif ($('#xmldisplay').length) {\n\t\t\t$('#xmldisplay').remove();\n\t\t} else {\n\n\t\t\t// Fetch any required resources before loading.\n\t\t\t// Fetch stylesheet.\n\t\t\t$.ajax({\n\t\t\t\turl: chrome.extension.getURL('/xmlDisplay.css'),\n\t\t\t\tsuccess: function(response) {\n\t\t\t\t\tstylesheet = response;\n\n\t\t\t\t\t// Create modal.\n\t\t\t\t\tcreate();\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\t}", "function showCreateAccount()\n{\n hideOrShow(\"helloButtons\", false)\n hideOrShow(\"createAccount\", true)\n hideOrShow(\"login\", false)\n hideOrShow(\"text\", false)\n hideOrShow(\"backButton\", true)\n}", "function hideFSLogin(isHidden) {\n\tif (isHidden) {\n \tdocument.getElementById('fsdev').disabled = true;\n\t} else {\n \tdocument.getElementById('fsdev').disabled = false;\n\t}\n}", "function hideNewProjDiag() {\n\tdocument.getElementsByClassName(\"newProject\")[0].style.display = \"none\";\n\t//document.getElementsByClassName(\"welcome\")[0].style.display = \"block\";\n}", "function devMode(){\n\tdocument.getElementById('devButtons').style.display = 'block';\n}", "function hideControlPanel () {\n\n controlPanel.style.display = 'none';\n\n }", "hideGUI( ) {\n this.fireCallback( this.events.eventHandle.onChangeVisibility, false );\n }", "hide ()\n\t{\n\t\t//hide the elements of the view\n\t\tthis.root.style.display= 'none';\n\t}", "function hideAdvancedSearch()\n{\n\t$(searchForm).hide();\n\t$(searchOptionsBtn).text('Show Search Options');\n}", "function HideDirectionBtn() {\n $('#btnSfTourNext').hide();\n $('#btnSfTourPrev').hide();\n }" ]
[ "0.6739643", "0.6404779", "0.63474065", "0.6332822", "0.6251196", "0.61993206", "0.61639464", "0.6108836", "0.609082", "0.60833913", "0.60477144", "0.59398144", "0.59176326", "0.5905843", "0.5895185", "0.5887763", "0.5880351", "0.58651066", "0.5851685", "0.5847293", "0.58312964", "0.5821022", "0.5815458", "0.58103853", "0.57904345", "0.57890344", "0.5785742", "0.57468224", "0.5740449", "0.5727837", "0.5710485", "0.5707584", "0.5704835", "0.5704724", "0.56976867", "0.5697641", "0.5691978", "0.5675709", "0.56731486", "0.56714743", "0.5667603", "0.56662357", "0.5664456", "0.56618345", "0.5659949", "0.5659646", "0.5659453", "0.5652557", "0.5649239", "0.56374294", "0.5632532", "0.5625537", "0.56145066", "0.56093377", "0.56073177", "0.560591", "0.56057197", "0.56023", "0.55990636", "0.55961233", "0.5575589", "0.557415", "0.5570241", "0.55657136", "0.55606806", "0.5554058", "0.5549054", "0.5548297", "0.55403835", "0.55382586", "0.55377054", "0.5536058", "0.5535218", "0.55340075", "0.55291766", "0.55277777", "0.55248606", "0.55206347", "0.55201405", "0.5519118", "0.55147743", "0.55088484", "0.55088484", "0.55075693", "0.550442", "0.54932326", "0.548759", "0.5479835", "0.54775333", "0.546264", "0.54506224", "0.5438747", "0.5435935", "0.5434348", "0.543374", "0.54322946", "0.5429518", "0.54281145", "0.54276246", "0.5425169" ]
0.8499632
0
Return the provided string with the first letter of each word capitalized. Make sure the rest of the word is in lower case. For the purpose of this exercise, you should also capitalize connecting words like the and of.
function titleCase(str) { console.log(str); let arr = str.split(" "); let c = []; for (let i = 0; i < arr.length; i++) { let letters = arr[i].split(""); let a = []; for (let j = 0; j < letters.length; j++) { if (j === 0) { let capital = letters[j].toUpperCase(); a.unshift(capital); } else { let lower = letters[j].toLowerCase(); a.push(lower); } } let b = a.join(""); c.push(b); } let d = c.join(" "); console.log(d); return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Capitaliser(input) {\n const eachWord = input.split(\" \");\n for (let index = 0; index < eachWord.length; index++) {\n eachWord[index] = eachWord[index][0].toUpperCase() + eachWord[index].substr(1);\n }\n return eachWord.join(\" \");\n}", "function capitalizeWord(string) {\n //I-string of one word\n //O- return the word with first letter in caps\n //C-\n //E-\n let array = string.split(\"\")\n array[0] = array[0].toUpperCase()\n string = array.join(\"\")\n return string\n}", "function capitalizeAllWords(string) {\n var splitStr = string.toLowerCase().split(' ');\n \nfor (var i = 0; i < splitStr.length; i++){\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n}\nreturn splitStr.join(' ');\n}", "function titlecase(str) {\n return str.split(' ').map((word) => word[0].toUpperCase() + word.slice(1)).join(' ');\n}", "function LetterCapitalize(str) { \n return str\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}", "function capitalizeWord (string) {\n var firstLetter = string[0];\n var restOfWord = string.substring(1); \n return firstLetter.toUpperCase() + restOfWord;\n}", "function f(str) {\n const words = str.split(' ');\n let capitalizedWords = [];\n for (let i = 0; i < words.length; i++) {\n const capitalizedWord = words[i].charAt(0).toUpperCase() + words[i].slice(1).toLowerCase();\n capitalizedWords.push(capitalizedWord);\n }\n return capitalizedWords.join(' ');\n}", "function LetterCapitalize(str) { \n let words = str.split(' ');\n for (let i = 0; i < words.length; i++) {\n let word = words[i][0].toUpperCase() + words[i].slice(1);\n words[i] = word;\n }\n return words.join(' ');\n}", "function titleCase(str) {\r\n var words = str.toLowerCase().split(' ');\r\n var charToCapitalize;\r\n\r\n for (var i = 0; i < words.length; i++) {\r\n charToCapitalize = words[i].charAt(0);\r\n // words[i] = words[i].replace(charToCapitalize, charToCapitalize.toUpperCase()); // works only if first letter is not present elsewhere in word\r\n words[i] = words[i].charAt(0).toUpperCase().concat(words[i].substr(1));\r\n }\r\n\r\n return words.join(' ');\r\n}", "function capitalizeAllWords(string) {\n var split = string.split(\" \"); //splits string up\n for (var i = 0; i < split.length; i++) { //loops over array of strings\n split[i] = split[i][0].toUpperCase() + split[i].slice(1); //uppercases first chas on string and slices the extra letter\n }\n var finalStr = split.join(' '); // joins split string into one string\n return finalStr; //return final string\n}", "function capitalizeAllWords(string){\nvar subStrings = string.split(\" \");\nvar upperString = \"\";\nvar finishedString = \"\";\n for(var i = 0; i < subStrings.length; i++){\n if(subStrings[i]) {\n upperString = subStrings[i][0].toUpperCase() + subStrings[i].slice(1) + \" \";\n finishedString += upperString;\n }\n } return finishedString.trim()\n}", "function LetterCapitalize(str) {\n\nlet words = str.split(' ')\n\nfor ( i = 0 ; i < words.length ; i++) {\n\n words[i] = words[i].substring(0,1).toUpperCase() + words[i].substring(1)\n\n}\n\nwords = words.join(' ')\nreturn words\n\n}", "function toUpperEachWord(str){\n str = str.toLowerCase();\n var strArray = str.split(\" \");\n var newString = \"\";\n \n for(var i = 0; i < strArray.length; i++){\n newString += strArray[i].substring(0, 1).toUpperCase() + strArray[i].substring(1);\n \n if(i < strArray.length - 1){\n newString += \" \"; \n }\n }\n return newString\n}", "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.substring(1);\n}", "function capitalizeLetters(str) {\r\n\r\n let strArr = str.toLowerCase().split(' '); //lowercase all the words and store it in an array.\r\n console.log(\"outside: \" + strArr); //Testing use for checking\r\n //iterate through the array\r\n //Add the first letter of each word from the array with the rest of the letter following each word\r\n //Ex) L + ove = Love;\r\n for(let i = 0; i < strArr.length; i++){\r\n strArr[i] = strArr[i].substring(0, 1).toUpperCase() + strArr[i].substring(1);\r\n }\r\n return strArr.join(\" \"); //put the string back together.\r\n\r\n // const upper = str.charAt(0).toUpperCase() + str.substring(1);\r\n // return upper;\r\n}", "function capital(str) \r\n{\r\n str = str.split(\" \");\r\n\r\n for (var i = 0, x = str.length; i < x; i++) {\r\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\r\n }\r\n\r\n return str.join(\" \");\r\n}", "function capitalizeAllWords(string) {\n var arr = string.split(\" \");\n for (var i = 0;i < arr.length; i++){\n arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);\n }\n return arr.join(\" \");\n}", "function capitalizeWord(string) {\n \n // Should take a string of one word, and return the word with its first letter capitalized\n return string[0].toUpperCase() + string.substring(1, string.length);\n \n}", "function LetterCapitalize(str) {\n var strArr = str.split(\" \");\n var newArr = [];\n\n for(var i = 0 ; i < strArr.length ; i++ ){\n\n var FirstLetter = strArr[i].charAt(0).toUpperCase();\n var restOfWord = strArr[i].slice(1);\n\n newArr[i] = FirstLetter + restOfWord;\n\n }\n\n return newArr.join(' ');\n\n}", "function LetterCapitalize(str) {\n // First, we use the split method to divide the input string into an array of individual words\n // Note that we pass a string consisting of a single space into the method to \"split\" the string at each space\n str = str.split(\" \");\n\n // Next, we loop through each item in our new array...\n for (i = 0; i < str.length; i++) {\n // ...and set each word in the array to be equal to the first letter of the word (str[i][0]) capitalized using the toUpperCase method.\n // along with a substring of the remainder of the word (passing only 1 arg into the substr method means that you start at that index and go until the end of the string)\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n // Finally, we join our array back together...\n str = str.join(\" \");\n\n // ...and return our answer.\n return str;\n}", "function capitalizeLetters(str) {\n// const strArr = str.toLowerCase().split(' ');\n\n// for(let i = 0; i< strArr.length; i++){\n// strArr[i] = strArr[i].substr(0,1).toUpperCase() + strArr[i].substr(1);\n// }\n\n// return strArr.join(' ');\n\n///////////////////////////////////////////////////////////\n\n return str\n .toLowerCase()\n .split(' ')\n .map(word => word[0].toUpperCase() + word.substr(1))\n .join(' ');\n}", "function capitalize(str) {\n const array = str.split(' ');\n array.forEach((word, index) => array[index] = word[0].toUpperCase() + word.substr(1));\n return array.join(' ');\n}", "function capitalize_Words(str) {\n return str.replace(/\\w\\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });\n}", "function capitalizeAllWords(string) {\n// will use .toLower case and .split to lowercase and put in an array\nvar myArr = string.toLowerCase().split(\" \")\n// will use for loop to itterate over array\nfor(var i = 0; i < myArr.length; i++){\n // Will use charAt to return the character in string\n // will use toUpperCase to uppercase the first characters\n //will use .slice to add remaing array\n myArr[i] = myArr[i].charAt(0).toUpperCase() + myArr[i].slice(1);\n}\n // use join() to turn array to string and return\n return myArr.join(\" \");\n}", "function capitalise(s){\n let ns = [];\n for(let w of s.split(\" \")){\n ns.push(w[0].toUpperCase() + w.slice(1));\n }\n return ns.join(\" \");\n}", "function capitalizeWord(string) {\n str1 = string.charAt(0);\n str1 = str1.toUpperCase();\n for (var i = 1; i < string.length; i++)\n {\n str1 += string[i];\n }\n return str1;\n}", "function capitalizeEveryWordOfAStringLib (string) {\n let words = string.split(\" \");\n\n for (let i = 0; i < words.length; i++) {\n\n words[i] = words[i][0].toUpperCase() + words[i].substr(1);\n\n }\n\n return words.join(\" \");\n}", "function capitalizeWord(string) {\n return string.replace(string[0], string[0].toUpperCase()); //return string but replace the string[0] with a capital letter\n}", "function capitalizeAllWords(string) {\n \n // Should take a string of words and return a string with all the words capitalized\n \n let newStr = \"\";\n \n for (let word of string.split(\" \")) {\n newStr = newStr + word[0].toUpperCase() + word.substring(1,word.length) + \" \";\n }\n \n return newStr.substring(0,newStr.length - 1);\n \n}", "function capitalizeEachWord(str) {\n return str.toUpperCase();\n}", "function capitalizeAllWords(string) {\n let stringsArr = string.split(' ');\n for (let i = 0; i < stringsArr.length; i++) {\n stringsArr[i] = stringsArr[i][0].toUpperCase() + stringsArr[i].substring(1);\n }\n return stringsArr.join(' ');\n}", "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.slice(1);\n}", "function capitalize(str) {\n str = str.trim().toLowerCase(); // remove extra whitespace and change all letters to lower case\n var words = str.split(' ') // split string into array of individual words\n str = ''; // clear string variable since all the words are saved in an array\n // this loop takes each word in the array and capitalizes the first letter then adds each word to the new string with a space following \n for (i = 0; i < words.length; i++) {\n var foo = words[i];\n foo = foo.charAt(0).toUpperCase() + foo.slice(1);\n str += foo + \" \";\n }\n return str.trim(); // return the new string with the last space removed\n}", "function titleCase(str) {\n //put each word in array\n let lowerCase = str.toLowerCase().split(' ');\n //capitalize each word in array\n let capitalized = lowerCase.map(function(value) {\n return value.substring(0,1).toUpperCase() + value.substring(1);\n });\n //convert array back to string\n return capitalized.join(' ');\n \n}", "function capitalizeLetters(str) {\n // const strArr = str\n // .toLowerCase() // makes everything lower case\n // .split(' '); // turn a string into an array, with space so we get the words\n // for(let i = 0; i < strArr.length; i++) {\n // strArr[i] = strArr[i].substring(0, 1).toUpperCase() + strArr[i].substring(1);\n // }\n // return strArr.join(' ');\n //////////////////\n //Second Option cleaned up edition\n // return str\n // .toLowerCase()\n // .split(' ')\n // .map((word) => word[0].toUpperCase() + word.substr(1))\n // .join(' ');\n ///////////////////\n //Regular Expressions\n /// omg what the heck is this\n // return str.replace(/\\b[a-z]/gi, function(char) {\n // return char.toUpperCase();\n // });\n}", "function capitalizeWord(word){\n return word[0].toUpperCase() + word.substr(1);\n}", "function firstLetterCapital (word) {\n var wordArray = word.split(' ');\n var newWordArray = [];\n for (var i = 0; i < wordArray.length; i++) {\n newWordArray.push(wordArray[i].charAt(0).toUpperCase() + wordArray[i].slice(1));\n }\n return newWordArray.join(' ');\n}", "function titleCase(str) {\n return str.split(' ').map(word => word[0].toUpperCase() + word.slice(1).toLowerCase()).join(' ');\n}", "function capitalize(str) {\n const array = str.split(' ');\n let newArray = []\n\n for (let word of array) {\n newArray.push(word.slice(0, 1).toUpperCase() + word.slice(1))\n }\n\n return newArray.join(' ')\n\n}", "function capitalizeWords(input) {\n\n let wordInput = input.split(' ');\n\n for (let i = 0; i < wordInput.length; i++) {\n var lettersUp = ((wordInput[i])[0]).toUpperCase();\n wordInput[i] = wordInput[i].replace((wordInput[i])[0], lettersUp);\n }\n return console.log(wordInput.join(\" \"));\n}", "function capitalizeWord(string) {\n return string[0].toUpperCase() + string.slice(1);\n}", "function capitalizeLetters(str) {\n // NOTE Turn the sentence into and array and map individual word to capitalize\n //First string of the word and turn back into sentence i.e \"String\"\n\n return str\n .toLowerCase()\n .split(\" \")\n .map(word => word[0].toUpperCase() + word.substr(1))\n .join(\" \");\n}", "function firstLetterCapitalized (word){//function that capitalizes first letter of one word\n var letterOne = word.substring(0,1)//finds first letter\n var capitalizedLetter = letterOne.toUpperCase()//to upper case\n return capitalizedLetter + word.substring(1)//concatenates capitalized first letter and rest of word\n}", "function capitalize(str) {\n const words = [];\n\n for (let word of str.split(' ')) {\n words.push(word[0].toUpperCase() + word.slice(1)); //?\n }\n return words.join(' ');\n}", "function capitalizeFirstWord(str){\n words = [];\n\n for(let word of str.split(' ')){\n words.push(word[0].toUpperCase() + word.slice(1));\n }\n return words.join(' ');\n}", "function sc_string_capitalize(s) {\n return s.replace(/\\w+/g, function (w) {\n\t return w.charAt(0).toUpperCase() + w.substr(1).toLowerCase();\n });\n}", "function toTitleCase(str)\n //Make string words start with caps. hello world = Hello World.\n{\n return str.replace(/\\w\\S*/g,\n function(txt){\n return txt.charAt(0).toUpperCase() +\n txt.substr(1).toLowerCase();\n });\n}", "function wordCap(string) {\n return string.split(' ')\n .map((word) => word[0].toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n}", "function capitalizeWords(str) {\n return str.split(\" \").reduce((acc,word) => {\n acc += (word[0].toUpperCase() + word.slice(1) + \" \")\n return acc;\n },\"\")\n}", "function upperFirst(str) {\n let splitStr = str.toLowerCase().split(' ');\n for (let i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1); \n }\n return splitStr.join(' '); \n }", "function titleCase(str) {\n // Mutating str (oh no!) to an array of lowercase words using split() by a space \n str = str.toLowerCase().split(' ');\n // Iterating through str\n for (var i = 0; i < str.length; i++){\n // capitalLetter is first letter of current word -> made uppercase \n capitalLetter = str[i].charAt(0).toUpperCase();\n // replacing the first letter in current word with capitalLetter\n str[i] = str[i].replace(/[a-z]/, capitalLetter);\n }\n // str = str array joined into a single string\n str = str.join('');\n return str;\n }", "function capitalizeWords(str) {\n const words = str.split(' ')\n const upperWords = words.map( word => capitalize(word) )\n return upperWords.join(' ')\n}", "function capitalizeAllWords(string) {\n //split string into array of string words\n var splitStr = string.split(\" \");\n //loop through array\n for(var i = 0; i < splitStr.length; i++){\n //if there is a value at element then do a thing\n if(splitStr[i]){\n //access word in word array,uppercase first char, then slice the rest back on\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n }\n string = splitStr.join(\" \");\n }\n return string;\n}", "function applyCapitalLetter(str){\r\n \r\n var arr = str.split(\" \");\r\n for (var i=0; i < arr.length; i++){\r\n arr[i] = arr[i].replace(arr[i][0], arr[i][0].toUpperCase()); \r\n }\r\n return arr.join(\" \");\r\n}", "function capitalize(str) {\r\n const words = [];\r\n //str.split(' ');\r\n // words = str.split(' ')\r\n\r\n for (let word of str.split(' ')) {\r\n var currentWord = word[0].toUpperCase() + word.slice(1);\r\n words.push(currentWord);\r\n }\r\n return words.join(' ');\r\n}", "function ucFirstAllWords(str) {\n var word = str.split(\" \");\n for (var i = 0; i < word.length; i++) {\n var j = word[i].charAt(0).toUpperCase();\n word[i] = j + word[i].substr(1);\n }\n return word.join(\" \");\n}", "function capital_letter(str) {\n str = str.split(\" \");\n for (var i = 0, x = str.length; i < x; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n\n return str.join(\" \");\n}", "function capitalizeAllWords(string){\n var splitString = string.split(' '); //splitting string at spaces into an array of strings\n //splitString is now an array containing each word of the string separately\n for(var i = 0; i < splitString.length; i++){\n var letters = splitString[i].split(''); //separating each word in array into an array of letters\n letters[0] = letters[0].toUpperCase(); //sets letter at index[0] to upper case\n splitString[i] = letters.join(''); //slaps em all back together\n }\n return splitString.join(' ');\n}", "function titleCase(str) {\n //The map() method creates a new array with the results of calling a provided function on every element in the calling array.\n return str.toLowerCase().split(\" \").map(function(word) {\n //The replace() method returns a new string with some or all matches of a pattern replaced by a replacement.\n return word.replace(word[0], word[0].toUpperCase());\n}).join(\" \");\n }", "function capitalizeFirst(input) {\n return input\n .split(\" \")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}", "function capitalizeTitle(str) {\n let ar = str.split(\" \");\n const wordExceptions = [\"the\", \"in\", \"as\", \"per\", \"a\", \"of\", \"an\", \"for\", \"nor\", \"or\", \"yet\", \"so\", \"at\", \"from\", \"on\", \"to\", \"with\", \"without\"]\n ar.forEach((word, i) => {\n if (i == 0 || !wordExceptions.includes(word))\n ar[i] = word.charAt(0).toUpperCase() + word.substring(1);\n });\n return ar.join(\" \");\n}", "function CapitalizeWord(str)\n {\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n }", "function titleCase(str) {\n var words = str.toLowerCase().split(' ');\n //console.log(words);\n var caps = words.map(function(word) {\n return word.charAt(0).toUpperCase() + word.substring(1, word.length);\n }).join(' ');\n\n return caps;\n}", "function capitalize(str) {\n\n const capWords = [];\n\n let strArray = str.split(' ');\n\n strArray.forEach((word, i) => {\n let upperLetter = strArray[i][0].toUpperCase() + word.slice(1)\n capWords.push(upperLetter)\n\n })\n\n return capWords.join(' ');\n}", "function titleCase(str){\n str = str.toLowerCase().split(\" \");\n for(var s = 0; s < str.length; s++){\n str[s] = str[s].charAt(0).toUpperCase() + str[s].slice(1) \n };\n return str.join(\" \");\n}", "function titlecase(str){\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function capitalize(str) {\n const words = [];\n\n for (let word of str.split(\" \")) {\n words.push(word[0].toUpperCase() + word.slice(1));\n }\n return words.join(\" \");\n}", "function capitalizeAllWords(string) {\n return string.replace(/\\b\\w/g, function(string){ \n return string.toUpperCase(); \n });\n}", "function capitalizeWord(string){\n var firstLetter = string.charAt(0); // takes first letter\n var goodString = firstLetter.toUpperCase() + string.slice(1); //capitalize and reattach\n return goodString;\n}", "function capitalizeAllWords(string) {\n var split = string.split(\" \");\n var out = \"\";\n for (var i = 0; i < split.length; i++) {\n out += capitalizeWord(split[i]) + ' ';\n }\n return out.trim();\n}", "function titleCase(str) {\n var arrayOfStrings = str.split(' ');\n //Splits one string into an array separated by spaces\n for(var i = 0; i < arrayOfStrings.length; i++) {\n var placeholder = arrayOfStrings[i];\n //Placeholder for original string\n var upperLetter = placeholder.charAt(0).toUpperCase();\n //Selects first letter and uppercases it\n placeholder = placeholder.slice(1, placeholder.length).toLowerCase();\n //Selects 2nd letter to end of the word and lowercases it\n arrayOfStrings[i] = upperLetter.concat(placeholder);\n //Concats uppercase letter with rest of lowercase word\n }\n\n str = arrayOfStrings.join(' ');\n //Takes array and sets str to a single string\n return str;\n}", "function capitalWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n //function to make input value to have capital as it is inputed\n}", "function capitalizeWord(word) {\n return word[0].toUpperCase() + word.substr(1);\n}", "function capitalize(string) {\n if (string.indexOf(\" \") !== -1) {\n var arr = string.split(\" \");\n var capitals = arr.map(capitalizeWord);\n return capitals.join(\" \");\n } else {\n return capitalizeWord(string);\n }\n }", "function capitalize(string) {\n var splitStr = string.toLowerCase().split(' ');\n for (var i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\n }\n return splitStr.join(' ');\n}", "function capitaliseFirstLetters(str) {\r\n var splitStr = str.toLowerCase().split(' ');\r\n for (var i = 0; i < splitStr.length; i++) {\r\n // Assign it back to the array\r\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\r\n }\r\n // Directly return the joined string\r\n return splitStr.join(' ');\r\n}", "function titleCase(str) {\n return str.split(/\\s+/).map(function(word) {\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n }).join(\" \");\n}", "function LetterCapitalize(str) {\n \"use strict\";\n // code goes here \n var strArray = str.split(\" \"); //take my string and separate it into an array of strings (strArray) using the .split method.\n var newString = \"\";\n for (var i = 0; i < strArray.length; i++) {\n var newWord = strArray[i].substr(0, 1).toUpperCase() + strArray[i].substr(1, strArray.length);\n newString = newString + \" \" + newWord;\n //alert(newString);\n }\n\n return newString;\n\n}", "function capitalizeWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n }", "function capitalize(str)\n{\n //return str.charAt(0).toUpperCase() + str.slice(1);\n var pieces = str.split(' ');\n for (var i = 0; i < pieces.length; i++) {\n var j = pieces[i].charAt(0).toUpperCase();\n pieces[i] = j + pieces[i].substr(1);\n }\n return pieces.join(' ');\n}", "function capitalizeFirstLetter(string) {\n const words = string.split(' ');\n for (let i = 0; i < words.length; i++) {\n words[i] = words[i][0].toUpperCase() + words[i].slice(1);\n };\n\n return words.join(' ');\n}", "function capitalize(str) {\n const words = [];\n\n for (let word of str.split(' ')) {\n words.push(word[0].toUpperCase() + word.slice(1));\n }\n\n return words.join(' ');\n}", "function titleCase(str) {\n words = str.toLowerCase().split(' '); // Converts the string to lower case and splits it into an array of substrings\n\n for(var i = 0; i < words.length; i++) { // Loops the number of words in the array using str.length\n var letters = words[i].split(''); // Loops throuch each word and splits it into an array of letters\n letters[0] = letters[0].toUpperCase(); // Converts the first letter of each word to uppercase\n words[i] = letters.join(''); // Converts the array of letters back into a string of words\n }\n return words.join(' '); // Converts the array of words back into a string of words separated by spaces\n}", "function letterCapitalize(str) {\n str = str.split(\" \");\n\n for (var i = 0, x = str.length; i < x; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n return str.join(\" \");\n}", "function capitalize(str) {}", "function wordCap(string) {\n let result = '';\n string.split(' ').forEach(word => {\n result += ' ' + word[0].toUpperCase() + word.slice(1, word.length).toLowerCase();\n });\n\n return result;\n}", "function titleCase(string) {\n var splitString = string.split(' ');\n for (var i = 0; i < splitString.length; i++) {\n splitString[i] = splitString[i].charAt(0).toUpperCase() + splitString[i].substring(1);\n }\n return splitString.join(' ');\n}", "function titleCase(str) {\n str = str.toLowerCase().split(' '); // will split the string delimited by space into an array of words\n\n for(var i = 0; i < str.length; i++){ // str.length holds the number of occurrences of the array...\n str[i] = str[i].split(''); // splits the array occurrence into an array of letters\n str[i][0] = str[i][0].toUpperCase(); // converts the first occurrence of the array to uppercase\n str[i] = str[i].join(''); // converts the array of letters back into a word\n }\n return str.join(' '); // converts the array of words back to a sentence\n}", "function capitalizeStr(str) {\r\n let input = str.toLowerCase().split(\" \"); // Seperating each words and make an array\r\n input = input.map(function (value, index, array) { // value is the iterator\r\n return value.charAt(0).toUpperCase() + value.slice(1);\r\n });\r\n\r\n return input.join(\" \");\r\n}", "function everyWordCapitalized(aPhrase) {\n var becomeAnArray = aPhrase.split(\" \");\n \n for (var i=0; i<becomeAnArray.length; i++){\n var firstChar = becomeAnArray[i].charAt(0);\n var rest = becomeAnArray[i].substring(1);\n \n \n \n firstChar = firstChar.toUpperCase();\n rest = rest.toLowerCase();\n becomeAnArray[i] = firstChar + rest;\n \n }\n \n return becomeAnArray.join(\" \");\n}", "function capitalizeWords(str) {\n\tif (str.length === 0) {\n\t\treturn str;\n\t}\n\n\treturn str\n\t\t.split(\" \")\n\t\t.map((word) => capitalizeFirstLetter(word))\n\t\t.join(\" \");\n}", "function capitalizeLetters(str) {\n // const strArr = str.toLowerCase().split(' ');\n // for(let i=0; i< strArr.length; i++){\n // strArr[i] = strArr[i].substring(0, 1).toUpperCase() + strArr[i].substring(1);\n // }\n // return strArr.join(' ');\n\n //////////////////////////////////\n\n // return str\n // .toLowerCase()\n // .split(' ')\n // .map(word => word[0].toUpperCase() + word.substr(1))\n // .join(' ')\n\n //////////////////////////////////\n\n return str\n .toLowerCase()\n // replace method takes a regex and func as parameters\n // \\b is a word boundary, range of a to z, global and case insensitive\n .replace(/\\b[a-z]/gi, char => char.toUpperCase());\n}", "titleCase(string) {\n var sentence = string.toLowerCase().split(\" \");\n for(var i = 0; i< sentence.length; i++){\n sentence[i] = sentence[i][0].toUpperCase() + sentence[i].slice(1);\n }\n \n return sentence.join(\" \");\n }", "function capitalize(str) {\n return str.toLowerCase().split(' ').map(item => {\n return item[0].toUpperCase() + item.substring(1, item.length);\n }).join(' ');\n}", "function LetterCapitalize(str) {\n str = str.toLowerCase().split(' ');\n for (let i = 0; i < str.length; i++) {\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n }\n return str.join(' ');\n}", "static capitalize(word){\n let arr;\n arr = word.split(\"\")\n arr[0] = arr[0].toUpperCase()\n return arr.join(\"\")\n }", "function capitalizeEveryWordInAString(stringToCapitalize) {\n const arrayOfStrings = stringToCapitalize.toLowerCase().split(\" \");\n let capitalizedString = \"\";\n\n for (let i = 0; i < arrayOfStrings.length; i++) {\n capitalizedString +=\n arrayOfStrings[i].charAt(0).toUpperCase() +\n arrayOfStrings[i].slice(1, arrayOfStrings[i].length) +\n \" \";\n }\n\n return capitalizedString;\n}", "function capitalize(str) {\n\tconst words = [];\n\n\tfor (let word of str.split(' ')){\n\t\twords.push(word[0].toUpperCase() + word.slice(1));\n\t}\n\n\treturn words.join(' ');\n}", "function capitalize(str) {\n const words = [];\n\n for (let word of str.split(' ')) {\n words.push(word[0].toUpperCase() + word.slice(1));\n }\n\n return words.join(' ');\n}" ]
[ "0.8637432", "0.84475136", "0.8434862", "0.8429906", "0.8429339", "0.8428503", "0.8409515", "0.8396267", "0.8377574", "0.8368863", "0.83550066", "0.83416367", "0.8336212", "0.83168066", "0.83115155", "0.83078897", "0.8307857", "0.82995975", "0.82959765", "0.82885295", "0.8287614", "0.82849455", "0.8275149", "0.82624483", "0.8227063", "0.8223029", "0.8220023", "0.82176185", "0.8214791", "0.8213422", "0.8208689", "0.8188117", "0.8185103", "0.81840265", "0.8180822", "0.8179832", "0.81715125", "0.8157005", "0.8148434", "0.8146198", "0.8145157", "0.8136147", "0.8135742", "0.81343144", "0.81336814", "0.81257004", "0.81230205", "0.81196135", "0.8118253", "0.81154543", "0.81151515", "0.81133354", "0.81112474", "0.81111926", "0.8105085", "0.81026477", "0.8095902", "0.80955637", "0.8093985", "0.8090403", "0.80886644", "0.80870926", "0.80771226", "0.8070641", "0.80698633", "0.8069742", "0.80670184", "0.8066475", "0.8066281", "0.80633664", "0.8056563", "0.80561066", "0.80488235", "0.80470204", "0.8046132", "0.8040624", "0.803907", "0.8038848", "0.8033877", "0.8033877", "0.802851", "0.8026302", "0.8024526", "0.80209637", "0.80172914", "0.80131584", "0.8007018", "0.80052286", "0.80027395", "0.79979104", "0.7994933", "0.7992643", "0.7992593", "0.798885", "0.7988568", "0.7988288", "0.79869765", "0.79836464", "0.79827", "0.79825515", "0.79809946" ]
0.0
-1
Filter and List Messages
function ListMessages(auth) { var gmail = google.gmail('v1'); var query= "from: notifications@github.com view pull request"; nock('https://www.googleapis.com/gmail/v1/users') .get('/jaga4494/messages').reply(200, { username: 'davidwalshblog', firstname: 'David' }); return new Promise(function (resolve, reject) { gmail.users.messages.list({ auth: auth, userId: 'me', q: query, }, function(err, response,body) { if (err) { console.log('The API returned an error: ' + err); return; } var obj = JSON.parse(body); resolve(obj); /* var msgs = response.messages; console.log('- %s', msgs); if (msgs.length == 0) { console.log('No message found.'); } else { console.log('Message:'); //console.log('- %s', msgs.messages[1].id); for (var i = 0; i < msgs.length; i++) { var msg = msgs[i]; console.log('- %s', msg.id); } }*/ }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterMessage(input) {\n\t\n}", "function searchMessages() {\n\tvar input, filter, ul, li, i, a, txtValue;\n\tinput = document.getElementById(\"searchMessages\");\n\tfilter = input.value.toUpperCase();\n\tul = document.getElementById(\"chat-list\");\n\tli = ul.getElementsByClassName(\"chat-list-group\");\n\tfor (i = 0; i < li.length; i++) {\n\t\tdiv = li[i].getElementsByClassName(\"messages-searching-div\")[0];\n\t\ttxtValue = div.textContent || div.innerText;\n\t\tif (txtValue.toUpperCase().indexOf(filter) > -1) {\n\t\t\tli[i].style.display = \"\";\n\t\t} else {\n\t\t\tli[i].style.display = \"none\";\n\n\t\t}\n\t}\n}", "function getAllSentMessagesByFilter(params) {\n\t\treturn Restangular.all('message').one(\"sent\", \"filterParam\").customPOST(params, null);\n\t} // end of get all sent message by filter function", "function getAllMessages(){\n\t\treturn Restangular.all('message').getList();\n\t}// end of get all messages function", "_extractFilteredMessages(messages, filter = null, media = null, user = null, date = null, time = null, strictFilter = true) {\n const filteredMessages = [];\n\n // iterates through the messages, if any specified condition is not met the message will skip the other checks and won't be pushed into the array\n messages.map(m => {\n\n var pushMessage = true;\n\n if(media != null && pushMessage){\n if(media && !m.isMedia){\n pushMessage = false;\n } else if(!media && m.isMedia) {\n pushMessage = false;\n }\n }\n\n if(user && m.user != user && pushMessage){\n pushMessage = false;\n }\n\n if(time && m.time != time && pushMessage){\n pushMessage = false;\n }\n\n // check if the date parameter passed is an array, if it is then checks for a date between these, both included\n // else it just tries to match the date\n if(date && pushMessage){\n // the between part needs work, fails sometimes\n if(date.constructor === Array){\n var message_date = Date.parse(m.date)\n var date_start = Date.parse(date[0])\n var date_end = Date.parse(date[1])\n \n if(message_date >= date_end || message_date <= date_start){\n pushMessage = false;\n }\n } else {\n if(Date.parse(date) !== Date.parse(m.date)){\n pushMessage = false;\n }\n }\n \n }\n\n // strict filter matches the word, loose filter is just an includes()\n if(filter && pushMessage) {\n if(strictFilter){\n var found = false;\n\n m.message.split(\" \").forEach(e => {\n \n if(e.toLowerCase() == filter.toLowerCase()){\n found = true;\n }\n \n });\n if(!found){\n pushMessage = false;\n }\n } else {\n if(!m.message.toLowerCase().includes(filter.toLowerCase())){\n pushMessage = false;\n }\n }\n }\n\n if(pushMessage){\n filteredMessages.push(m)\n }\n\n });\n\n return filteredMessages;\n }", "function getAllMessagesByPagination(params) {\n\t\treturn Restangular.one('message', \"filterParam\").customPOST(params, null);\n\t} // end of get all message by pagination function", "function findAllMessages() {\n return $http.get(restApi + '/messages').then(function success(response) {\n return response.data;\n },\n function error(error) {\n return error;\n });\n }", "function getmessages(){\n jsonp('receive', {}, function(messages){\n messages.sort(messagesort);\n $.each(messages, function(i, message){\n if('proposal' === message.subject && -1 === message.body.scheme){\n showproposal(message.body);\n }else if('fulfil' === message.subject){\n showfulfil(message.body);\n }else if('accept' == message.subject){\n showaccept(message.body);\n }\n });\n setTimeout('getmessages()', 1000);\n });\n}", "_extractMessagesWords(messages, filter = null, minimumWordLength = 0, strictFilter = true){\n var messagesWords = []\n var progress = 1\n\n messages.map((m, index) => {\n\n // certainly improvable progress bar\n if(Math.ceil(messages.length / 100) * progress == index){\n progress++\n process.stdout.clearLine();\n process.stdout.cursorTo(0);\n process.stdout.write(progress + '%');\n }\n\n // no need to parse media or system messages\n if(!m.isMedia && m.isUserMessage){\n m.message.split(\" \").forEach(e => {\n\n var messageWord = e.toLowerCase();\n var matchesRequirement = !filter ? true : strictFilter ? messageWord == filter : messageWord.includes(filter);\n\n // parses the message if there's no filter or the message matches it and the message also meets the length\n if((!filter || matchesRequirement) && (messageWord.length >= minimumWordLength)){\n\n var newWord = true;\n \n // if the word exists in the array we're going to return, just add to the count\n messagesWords.map(function(words_item){\n var word = words_item.word.toLowerCase()\n if(word == messageWord){\n\n newWord = false;\n words_item.total_count++\n\n if(words_item.hasOwnProperty([m.user])){\n words_item[m.user]++\n } else {\n words_item[m.user] = 1\n }\n\n }\n })\n \n // else create the object and push it into the array\n if(newWord){\n messagesWords.push({word: messageWord, total_count: 1, [m.user]: 1})\n }\n }\n \n });\n }\n })\n\n // remove the progress bar\n process.stdout.clearLine();\n\n messagesWords = messagesWords.sort((a, b) => {\n return b.total_count - a.total_count;\n })\n\n return messagesWords;\n }", "function getMessage(filterUser){\n return new Promise((resolve,reject)=>{\n resolve(store.list(filterUser))\n })\n}", "_extractMessages(data) {\n // split the set of messages into lines, each representing a user or system message \n let lines = data.replace(/\\d{1,2}\\/\\d{1,2}\\/\\d{1,2},\\s\\d{1,2}:\\d{1,2}\\s-\\s/g, `${DEFAULT_LINE_SPLITTER}$&`);\n lines = lines.split(new RegExp(DEFAULT_LINE_SPLITTER, 'g')).filter(m => m).map(m => m.replace(/\\n$/, ''));\n\n const messages = [];\n\n // for each line parses the information as best as possible, creates an object Message and adds it to the messages array\n for (let line of lines) {\n let lastIndex = 0;\n let index = line.match(/,/).index;\n\n const date = line.slice(lastIndex,index).trim();\n lastIndex = index+1;\n index = line.match(/-/).index;\n\n const time = line.slice(lastIndex,index).trim();\n lastIndex = index+1;\n\n line = line.replace(/:/,'$');\n\n let user = DEFAULT_USER;\n // tries to get the message's text\n const match = line.match(/:/); // Fails if a system message contains ':', e.g. 5/7/17, 22:41 - Alvaro created group \"Grupo: de salir (official)\"\n if (match) {\n user = line.slice(lastIndex, match.index).trim();\n lastIndex = match.index+1;\n }\n\n const message = line.slice(lastIndex).trim();\n\n const isMedia = message == \"<Media omitted>\";\n const isUserMessage = user != \"System\";\n\n messages.push(new Message(date, time, user, message, isMedia, isUserMessage));\n }\n\n return messages;\n }", "function getMessages(){\n serverRequest(getParams(\"none\"), true); \n}", "getAllMessages ({ commit }) {\n api.getMessages((messages) => {\n let inbox = messages.filter((message) => message.to.email === user.email && !message.isDeleted)\n let outbox = messages.filter((message) => message.from.email === user.email)\n // let important = messages.filter((message) => message.isImportant)\n let trash = messages.filter((message) => message.isDeleted)\n\n commit('setInbox', inbox)\n commit('setOutbox', outbox)\n // commit('setImportant', important)\n commit('setTrash', trash)\n })\n }", "function dispalyMessages(messages) {\n // let list_message = document.querySelector('.list-text');\n if (list_message !== null) {\n list_message.remove();\n }\n list_message = document.createElement('div');\n list_message.className = 'list-text';\n\n for (let value of messages) {\n\n let messageText = document.createElement('p');\n messageText.className = \"message-text\";\n messageText.textContent = value.message;\n list_user.textContent = value.users;\n \n if (value.users === itemOfuser) {\n messageText.style.background = 'red';\n }\n if(value.bold === true){\n messageText.style.fontWeight = 'bold';\n }else{\n messageText.style.fontWeight = 'normal';\n }\n\n if(value.italic === true){\n messageText.style.fontStyle = 'italic';\n }else{\n messageText.style.fontStyle = 'normal';\n }\n\n list_message.appendChild(messageText);\n messageTitle.appendChild(list_message);\n }\n}", "function getMessages() {\n \tvar transaction = db.transaction(['osMsgStore'], 'readonly'),\n \t\tobjectStore = transaction.objectStore('osMsgStore'),\n \t\tcursor = objectStore.openCursor(),\n isAdmin = document.getElementsByTagName('body')[0].className === 'admin' ? true : false;\n\n \tcursor.onsuccess = function(e) {\n var res = e.target.result;\n\n \t if (res) {\n generateMessage(res.key, res.value.created, res.value.message, isAdmin);\n \t res.continue();\n \t }\n \t}\n }", "function displayConversationMessages(id) {\n selectedConversationId = id;\n var members = getGroupMembers();\n\n var sql = ` SELECT\n ZGROUPEVENTTYPE,\n replace(ZTEXT, '\\n', '<br>') AS ZTEXT,\n ZISFROMME,\n ZGROUPMEMBER,\n ZMESSAGEDATE,\n ZGROUPMEMBER,\n ZPUSHNAME\n FROM\n ZWAMESSAGE\n WHERE\n ZCHATSESSION = $ZCHATSESSION\n `\n\n var filter = document.getElementById('filter-field').value;\n if (filter) {\n sql += ' AND (ZTEXT LIKE $filter COLLATE NOCASE OR ZPUSHNAME LIKE $filter COLLATE NOCASE)';\n }\n\n var stmt = db.prepare(sql);\n stmt.bind({$ZCHATSESSION:id, $filter:'%' + filter + '%'});\n\n var html = '';\n var previousMessageDate;\n var nbMessages = 0;\n\n while(stmt.step()) {\n row = stmt.getAsObject();\n if (!row['ZTEXT']) {\n continue;\n }\n\n var messageDate = new Date((978307200 + row['ZMESSAGEDATE']) * 1000);\n if (!previousMessageDate || messageDate.getDate() != previousMessageDate.getDate() || messageDate.getMonth() != previousMessageDate.getMonth()) {\n previousMessageDate = messageDate;\n html += '<div class=\"message timestamp\">' + messageDate.toLocaleDateString() + '</div>';\n }\n\n html += '<div class=\"message ' + (row['ZISFROMME'] == 1 ? 'message-from-me' : 'message-from-other') + '\">';\n\n if (row['ZISFROMME'] == 0 && row['ZGROUPMEMBER']) {\n html += '<div class=\"from-name-in-group\">' + (row['ZPUSHNAME'] || members[row['ZGROUPMEMBER']]) + '</div>';\n }\n\n html += row['ZTEXT'];\n html += '</div>';\n\n nbMessages++;\n }\n\n document.getElementById('bottom-right-pane').innerHTML = html;\n document.getElementById('conversation-title').innerHTML = document.getElementById(id).getElementsByClassName('partner-name')[0].innerHTML + ' (<span class=\"bold\">' + nbMessages + (filter ? ' - filtered' : '') + '</span>)';\n}", "function GetMessages(req, res){\n Message.find({}).exec((err, result) => {\n res.send(result);\n })\n}", "listMessages(context, params) {\n return this.$axios\n .get(`/sms?${querystring.stringify(params)}`)\n .then(({ data }) => data)\n .catch(this.$catch);\n }", "getMessages() {\n\t\tconst newMessages = this.chat_backlog.getLog();\n\t\tthis.chat_backlog.clearLog();\n\t\treturn newMessages;\n\t}", "async function listMessages(req, res, next) {\n try {\n const connection = await getConnection();\n const { search } = req.query;\n\n let result;\n\n if (search) {\n await searchSchema.validateAsync(search);\n\n [result] = await connection.query(\n `\n select title, text, type, category from messages\n where messages.title like ? or messages.text like ? or messages.type like ? or messages.category like ?\n `,\n [`%${search}%`, `%${search}%`, `%${search}%`, `%${search}%`]\n );\n } else {\n [result] = await connection.query(`\n select from_users_id, concat_ws(' ',a.name, b.surname) as De, e.avatar as avatar_from, to_users_id, concat_ws(' ',c.name, d.surname) as Para, f.avatar as avatar_to, title, text, image, type, category, create_message from messages\n inner join users a on a.id = from_users_id\n inner join users b on b.id = from_users_id\n inner join users c on c.id = to_users_id\n inner join users d on d.id = to_users_id\n inner join users e on e.id = from_users_id\n inner join users f on f.id = to_users_id\n order by create_message desc;\n `);\n }\n\n const [messages] = result;\n\n connection.release();\n\n res.send({\n status: 'ok',\n message: 'Lista de mensajes De Para en orden descendente',\n data: result,\n });\n } catch (error) {\n next(error);\n }\n}", "function viewMessages(user, messages){\n\tif(user.role === ROLE.ADMIN || user.role === ROLE.MODERATOR){\n\t\treturn messages;\n\t};\n\treturn messages.filter(messages => message.userId === user.id);\n}", "showMessages () {\n this.messages.forEach((message) => {\n console.log(`${messageStyles[message.getType()]} ${message.getType()}: ${message.getText()}`)\n })\n }", "function getTypingMessages(data) {\n return $('.typing.message').filter(function(i) {\n return $(this).data('userName') === data.userName;\n });\n}", "function SearchMessages() {\n //Context\n const { resultsMessage, searchResults, isLoading } = useContext(AppContext);\n\n //Search messages\n const doTheSearch = \"Realiza una búsqueda para encontrar tus gifs\";\n const notFound = `No se encontraron resultados, por favor intenta de nuevo modificando tu busqueda`;\n const resultsFound = `Resultados de tu búsqueda`;\n\n //Condition\n if (resultsMessage === false) {\n return [doTheSearch];\n } else if (searchResults.length === 0 && isLoading === false) {\n return [notFound];\n } else {\n return [resultsFound];\n }\n}", "function listMessages() {\r\n\r\n\t\t var request = gapi.client.gmail.users.messages.list({\r\n\t\t 'userId': 'me'\r\n\t\t });\r\n\t\r\n\t\t request.execute(function(resp) {\r\n\t\t\t\t\t var messageIDS = resp.messages;\r\n\r\n\t\t\t\t\t if (messageIDS && messageIDS.length >= 20)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t getMessage('me', messageIDS);\r\n\t\t\t } else {\r\n\t\t\t \t errorPrepend('No Messages found.');\r\n\t\t\t }\r\n\t\t });\r\n\t\t }", "function messageAllUsers() {\n vm.filteredusers.forEach(function (obj) {\n AddContacts(obj.email);\n });\n }", "_findMessages() {\n if (this.checkedMessages) {\n return;\n }\n\n const composer = this.composer;\n const args = { composer_action: composer.get(\"action\") };\n const topicId = composer.get(\"topic.id\");\n const postId = composer.get(\"post.id\");\n\n if (topicId) {\n args.topic_id = topicId;\n }\n if (postId) {\n args.post_id = postId;\n }\n\n const cacheKey = `${args.composer_action}${args.topic_id}${args.post_id}`;\n\n const processMessages = messages => {\n if (this.isDestroying || this.isDestroyed) {\n return;\n }\n\n // Checking composer messages on replies can give us a list of links to check for\n // duplicates\n if (messages.extras && messages.extras.duplicate_lookup) {\n this.addLinkLookup(new LinkLookup(messages.extras.duplicate_lookup));\n }\n\n this.set(\"checkedMessages\", true);\n const queuedForTyping = this.queuedForTyping;\n messages.forEach(msg =>\n msg.wait_for_typing\n ? queuedForTyping.addObject(msg)\n : this.send(\"popup\", msg)\n );\n };\n\n if (_messagesCache.cacheKey === cacheKey) {\n processMessages(_messagesCache.messages);\n } else {\n composer.store.find(\"composer-message\", args).then(messages => {\n _messagesCache = { messages, cacheKey };\n processMessages(messages);\n });\n }\n }", "listMessages(options = {}) {\n const { span, updatedOptions } = createSpan(\"ChatThreadClient-ListMessages\", options);\n try {\n const iter = this.listMessagesAll(updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings = {}) => {\n return this.listMessagesPage(settings, updatedOptions);\n }\n };\n }\n catch (e) {\n span.setStatus({\n code: CanonicalCode.UNKNOWN,\n message: e.message\n });\n throw e;\n }\n finally {\n span.end();\n }\n }", "onMessagesRemoved() {\n // result text is only for when we are not searching\n if (!this.view.searching) {\n this.updateStatusResultText();\n }\n this.__proto__.__proto__.onMessagesRemoved.call(this);\n }", "async searchMessages(txt, inJid, count, page) {\n const json = [\n 'query',\n {\n epoch: this.msgCount.toString(),\n type: 'search',\n search: Buffer.from(txt, 'utf-8'),\n count: count.toString(),\n page: page.toString(),\n jid: inJid\n },\n null,\n ];\n const response = await this.query({ json, binaryTags: [24, Constants_1.WAFlag.ignore], expect200: true }); // encrypt and send off\n const messages = response[2] ? response[2].map(row => row[2]) : [];\n return { last: response[1]['last'] === 'true', messages: messages };\n }", "function filter_table_conversation(){\n \n var filter = $(\"#table_conversation_comment\").val();\n filter_table2(filter, \"table_conversation\", 1)\n }", "function get_messages() {\n\n fct_MyLearn_API_Client.query({ type: 'Mensajes', extension1: 'Trabajo', extension2: $routeParams.IdTrabajo }).$promise.then(function (data) {\n $scope.ls_msjs = data;\n });\n\n }", "function getTypingMessages (data) {\n return $('.msg_container.typing').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "onActiveMessagesLoaded(aFolderDisplay) {\n let filterer = this.maybeActiveFilterer;\n if (!filterer) {\n return;\n }\n\n let filtering = aFolderDisplay.view.search.userTerms != null;\n\n // - postFilterProcess everyone who cares\n // This may need to be converted into an asynchronous process at some point.\n for (let filterDef of QuickFilterManager.filterDefs) {\n if (\"postFilterProcess\" in filterDef) {\n let preState =\n filterDef.name in filterer.filterValues\n ? filterer.filterValues[filterDef.name]\n : null;\n let [newState, update, treatAsUserAction] = filterDef.postFilterProcess(\n preState,\n aFolderDisplay.view,\n filtering\n );\n filterer.setFilterValue(filterDef.name, newState, !treatAsUserAction);\n if (update) {\n if (\n aFolderDisplay._tabInfo == this.tabmail.currentTabInfo &&\n \"reflectInDOM\" in filterDef\n ) {\n let domNode = document.getElementById(filterDef.domId);\n // We are passing update as a super-secret data propagation channel\n // exclusively for one-off cases like the text filter gloda upsell.\n filterDef.reflectInDOM(domNode, newState, document, this, update);\n }\n }\n }\n }\n\n // - Update match status.\n this.reflectFiltererResults(filterer, aFolderDisplay);\n }", "respondToMessages() {\n let messages = rx.Observable.fromEvent(this.slack, RTM_EVENTS.MESSAGE);\n\n messages.where(e => (function(e) { let re = /kloppbot/i; return re.test(e.text) } )(e) )\n .where(e => this.fromAdmin(e))\n .subscribe((message) => this.handleNewEvent(message));\n\n messages.where(e => (function(e) { let re = /i'?(m|ll) *(in|play|playing)/i; return re.test(e.text) } )(e) )\n .subscribe((message) => this.handleNewSignup(message));\n\n messages.where(e => (function(e) { let re = /who(\\'?s| is) playing/i; return re.test(e.text) } )(e) )\n .subscribe((message) => this.handleListAttendees(message));\n\n messages.where(e => (function(e) { let re = /fixture list/i; return re.test(e.text) } )(e) )\n .subscribe((message) => this.handleListEvents(message));\n\n messages.where(e => (function(e) { let re = /next game/i; return re.test(e.text) } )(e) )\n .subscribe((message) => this.handleNextEvent(message));\n }", "function filterSchedules(message) {\n if(message.type ===\"schedule\"){\n return message;\n }\n }", "function getTypingMessages (data) {\n return $('.typing.message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "function getTypingMessages (data) {\n return $('.typing.message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "function getTypingMessages (data) {\n return $('.typing.message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "function getTypingMessages (data) {\n return $('.typing.message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "function getTypingMessages (data) {\n return $('.typing.message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "function collectMessagesByUser(user, params){\n return collectMessagesBy(\"user\", user, params);\n }", "renderSendMessage() {\n return this.props.messagesObj ?\n <SendMessage filterCriteria={this.props.messagesObj._id} checkPrivate={this.props.checkPrivate}/> : null;\n }", "function showAllMessage() {\n [].forEach.call(messages, function(message) {\n if (message.classList.contains('msgInvisible')) {\n message.classList.remove('msgInvisible');\n }\n })\n}", "function getAllMessages() {\n return [\n [\"Hey ho, Merio! We're finally living in the future! Through an internet browser! Using those new-fangled \\\"HTML\\\" and \\\"JavaScript\\\" doodads that those technical folks keep whining about. And look! The game doesn't lag anymore when you move around! Anyway, you'd better get going to progress on your adventure - I'm starting to get motion sickness from all the physics optimisations in this game engine...\"],\n [\"Watch the enemy's movements carefully and use the power of the arrow keys to outsmart them!\"],\n [\"To complete your haphazard quest to find happiness, you'll need to jump through these jiggling portals. This particular portal smells like kerosene. Mmmm...\"],\n\n [\"My cousins work here as moving platforms, so they'll give you a ride to wherever they feel like going.\"],\n [\"These snowmen are on strike for higher wages and better working conditions. Crush those lads like their corporate overlords would!\", \"But remember, if you try to jump on multiple stacks of snowmen, they can do a surprise attack that hurts you.\"],\n [\"Using the magical art of \\\"collision detection\\\", you can do a boosted jump when you get sandwiched by moving platforms. It's as if you're immune to the laws of physics!\"],\n\n [\"Y'see that pink space dust over there? Inhaling that stuff makes you all floaty and stuff!\", \"Remember, the effects of the space dust are only active when you're within the pink area, although you can extend its duration by jumping out of it.\"],\n [\"Cows? In space? I guess that's why they call our galaxy \\\"The Milky Way\\\"! Hah!\", \"Anyway, if you can make them fall asleep, you can pass by them without getting hurt.\"],\n [\"This next part of the level looks like a real doozy. You'll have to time your jumps and movements just right to make it over those cow-faced scoundrels.\"],\n [\"I'm going to be blunt with you, Merio - this guy is BIG. Bigger than those Poppin Fresh guys from the first game, I'm pretty sure. And it looks like it's willing to do everything in its power to stop you from finding happiness.\", \"But don't let its speed or size fool you. It appears to tire itself out every now and then, but tends to wake up randomly so you'll need to pick a good opportunity to run past it...\"],\n\n [\"GOOD DAY TO YOU, MERIO.\",\n \"Merio: Good day to me too.\",\n \"YOU HAVE COME TO SEEK ANSWERS TO YET ANOTHER ONE OF LIFE'S MANY QUESTIONS?\",\n \"Merio: Yeah, although now that I think about it, I could have just looked for answers on the Internet...\",\n \"WELL, SINCE YOU'RE HERE NOW, I MAY AS WELL TRY TO ANSWER YOUR QUESTION.\",\n \"Merio: Okay - How do I find happiness?\",\n \"AH, A FINE QUESTION INDEED. HAPPINESS IS FOUND IN ONE OF THE MOST UNEXPECTED WAYS.\",\n \"MANY PEOPLE HAVE SPENT YEARS TRYING TO FIND HAPPINESS, ONLY TO REGRET THEIR EFFORTS.\",\n \"ARE YOU PREPARED TO HAVE YOUR MIND BLOWN BY MY EPIC RESPONSE?\",\n \"BECAUSE WHAT I AM ABOUT TO TELL YOU CANNOT BE UNTOLD --\",\n \"Merio: Just tell the answer already, you blockhead.\",\n \"VERY WELL THEN.\",\n \"HAPPINESS IS FOUND BY KNOWING YOU HAVE COMPLETED THIS GAME.\",\n \"THERE, THE SECRET OF THE AGES HAS BEEN REVEALED TO YOU.\",\n \"I CAN SENSE YOU ARE NOW SLIGHTLY HAPPIER THAN USUAL.\",\n \"Merio: Well, I was kind of expecting to find more happiness...\",\n \"CORRECTIMUNDO, BUT YOU STILL FOUND SOME HAPPINESS NONETHELESS?\",\n \"Merio: ...\",\n \"...\",\n \"Merio: ...I suppose so.\",\n \"GOOD! MY JOB HERE IS DONE.\",\n \"Merio: Now that I've finished my adventure, what now?\",\n \"YOU COULD TRY AND ACHIEVE SOME OF YOUR OTHER LIFE GOALS?\",\n \"Merio: Life has MORE goals?! That implies there's yet another sequel in the works...\"],\n ];\n}", "_formatMessages(entries) {\n const lastSeenTimestamp = this._storableState.lastSeenTimestamp || 0\n return JSON.parse(JSON.stringify(entries)) // Deep copy\n .map(entry =>\n Object.assign(entry.payload.value, {\n hash: entry.hash,\n userIdentity: entry.identity,\n unread: entry.payload.value.meta.ts > lastSeenTimestamp,\n meta: formatMeta(entry.payload.value.meta)\n })\n )\n }", "getMessages(from, to, sensorId) {\n var method = \"table.json\";\n var params = \"&content=messages&columns=objid,datetime,parent,type,name,status,message&id=\" + sensorId;\n return this.performPRTGAPIRequest(method, params).then(function(messages) {\n var events = [];\n var time = 0;\n _.each(messages, function(message) {\n time = Math.round((message.datetime_raw - 25569) * 86400,0);\n if (time > from && time < to) {\n events.push({\n time: time * 1000,\n title: message.status,\n text: '<p>' + message.parent + '(' + message.type + ') Message:<br>'+ message.message +'</p>'\n });\n }\n });\n return events;\n });\n }", "function getSentMessages(){\n\t\treturn Restangular.all('message/sent').getList();\n\t}// end of get all messages function", "function renderOldConversation() {\n try {\n userfiltered[0].message.forEach(function (element) {\n renderInsideChat(element);\n });\n }\n catch (error) {\n console.error(error);\n }\n}", "getAllMessages() {\n return fetch(`${remoteURL}/messages?_expand=user`).then(result => result.json()).then((data) => {\n console.log(data)\n return data\n })\n }", "get getLastMessageList () {\n //\n const limit = this\n .request\n .input('limit', null)\n\n return Message\n .query()\n .notDeleted()\n .with('user')\n .limit(limit || 50)\n .orderBy('id', 'desc')\n .fetch()\n }", "function displayMessages(roomId) {\n $.post(\"/chatroom/getAllMessages\", {chatroomId: roomId}, function (data) {\n $(\"#chat-area\").html(\"\");\n\n if (checkElement(data)) {\n data.sort(function(a, b) {\n return new Date(a.time).getTime() - new Date(b.time).getTime();\n });\n data.forEach(function(message) {\n //Update chatroom with messages from unblocked users only\n if (blockList.indexOf(message.sender) < 0) {\n updateChatRoom(message);\n }\n });\n }\n }, \"json\");\n}", "getMessages(request, response) {\n\n super.authorize(request, response, (user) => {\n\n let condition = {};\n if (user.is_admin) {\n\n const clientId = request.params.clientId;\n\n condition = {\n type: 'Message', $or: [\n { $and: [{ 'user': user._id }, { 'destination_user': clientId }] },\n { $and: [{ 'user': clientId }, { 'destination_user': user._id }] }\n ]\n };\n } else {\n condition = { type: 'Message', $or: [{ 'user': user._id }, { 'destination_user': user._id }] };\n }\n\n Action.find(condition, function (err, messages) {\n\n if (err) {\n return Helpers.jsonResponse(response, false, { messages: [] }, 'Something went wrong.');\n }\n\n return Helpers.jsonResponse(response, true, { messages: messages }, 'Success.');\n });\n });\n }", "function listMessages(userId, query, callback) {\r\n var getPageOfMessages = function(request, result) {\r\n request.execute(function(resp) {\r\n result = result.concat(resp.messages);\r\n var nextPageToken = resp.nextPageToken;\r\n if (nextPageToken) {\r\n request = gapi.client.gmail.users.messages.list({\r\n 'userId': userId,\r\n 'pageToken': nextPageToken,\r\n 'q': query\r\n });\r\n console.log(\r\n \"hello!\");\r\n } else {\r\n callback(result);\r\n }\r\n });\r\n };\r\n var initialRequest = gapi.client.gmail.users.messages.list({\r\n 'userId': userId,\r\n 'q': query\r\n });\r\n console.log(\"hello!!\");\r\n}", "function chatfilter(data) {\n\tif (Array.isArray(data)) {\n\t\tdata = data.filter((line) => {\n\t\t\treturn !(/\\|(userstats|j|J|l|L|n|N|unlink|notify)\\|/.test(line) && !/\\|(chat|c:|c)\\|/.test(line));\n\t\t});\n\t} else if (typeof data === 'string') {\n\t\treturn (/\\|(userstats|j|J|l|L|n|N|unlink|notify)\\|/.test(data) && !/\\|(chat|c:|c)\\|/.test(data));\n\t}\n\treturn data;\n}", "getMessages() { return this._messages; }", "getMessages() { return this._messages; }", "function getMessages() {\n const endpoint = BASE_URL + \"/message/readAll\";\n console.log(\"getMessages\");\n return fetch(endpoint).then((res) => res.json());\n}", "handleMessage(message) {\n this.velo = message.filters;\n }", "handleMessages(messages) {\n\n }", "readMessages(username) {\n if (this.findUser(username)) {\n return this.findUser(username).getMessagesAsString();\n }\n }", "function addFilteredMsg(myMessageList, totalMsg, origRes, reducedMsg) {\n let { content } = reducedMsg;\n let filteredMsg = \"\";\n const python = spawn(\"python\", [\"./utilFunctions/script1.py\", content]);\n python.stdout.on(\"data\", (data) => {\n filteredMsg += data.toString();\n });\n python.on(\"close\", (code) => {\n console.log(content);\n reducedMsg.content = filteredMsg;\n myMessageList.push(reducedMsg);\n if (myMessageList.length === totalMsg) {\n origRes.writeHead(302, { Location: \"/api/finished\" });\n origRes.end();\n }\n });\n}", "function onGetMessages(response) {\n\tmessages = response._embedded.status;\n\n\tvar newMessages = '';\n\t$.each(messages, function(index, item) {\n\t\tnewMessages += '<li data-theme=\"\">' + '<a href=\"#page2?msgId=' + index\n\t\t\t\t+ '\" data-transition=\"none\">' + item.message + '</a>' + '</li>';\n\t});\n\t$('#messages li[role!=heading]').remove();\n\t$('#messages').append(newMessages).listview('refresh');\n}", "get allMessages() {\n return this._realm.objects(Constants.Message);\n }", "function getMessages(req, res) {\r\n\tvar _id = +req.params.id;\r\n\tvar endId = +req.query.end || undefined;\r\n\tvar fromId = +req.query.from || 0;\r\n\tvar msgToSend = [];\r\n\t\r\n\tvar error = null;\r\n\t\r\n\tif(_id) {\r\n\t\tvar message = _.findWhere(messages, { '_id' : _id });\r\n\t\tif(message) {\r\n\t\t\tmsgToSend = message;\r\n\t\t} else {\r\n\t\t\terror = \"The message is a comment or does not exist.\"\r\n\t\t}\t\t\r\n\t} else {\r\n\t\tmsgToSend = messages.slice(fromId, endId);\r\n\t}\r\n\t\r\n\tif(error) {\r\n\t\tres.status(500).send(error);\r\n\t} else {\r\n\t\tres.send(msgToSend);\r\n\t}\t\t\r\n}", "async function getMessages() {\n try {\n const messages = await getMessagesAsync();\n displayMessages(messages);\n //console.log(messages);\n \n } // catch and log any errors\n catch (err) {\n console.log(err);\n }\n }", "function filterMessage(message, userId, token) {\n var url = URL + '/message/'+userId;\n return $http.post(url, message,{\n headers: {'Authorization': \"Bearer \"+token}\n })\n .then(function (response) {\n return response.data;\n });\n }", "function getMessages() {\n $.get('http://localhost:3000/messages', (data) => {\n data.forEach(addMessage);\n })\n}", "function loadMessages() {\r\n // Create the query to load the last 12 messages and listen for new ones.\r\n var query = firebase.firestore()\r\n .collection('messages')\r\n .orderBy('timestamp','asc')\r\n .limitToLast(200); //last 200 messgae of orderby \r\n \r\n // Start listening to the query.\r\n query.onSnapshot(function(snapshot) {\r\n snapshot.docChanges().forEach(function(change) {\r\n if (change.type === 'removed') {\r\n // deleteMessage(change.doc.id);\r\n } else {\r\n var message = change.doc.data();\r\n // displayMessage(message.text);\r\n render(message);\r\n }\r\n });\r\n });\r\n}", "function getMessages() {\n Message.find({relationshipId: req.params.id}, function(err, messages) {\n if(err) {\n return res.status(500).json({\n title: 'An error occurred', \n error: err\n })\n }\n if(!messages) {\n return res.status(404).json({\n title: 'No messages found',\n error: {message: 'No messages with that relationship id found'}\n })\n }\n //Return list of messages\n return res.status(200).json({\n title: 'Messages found...',\n obj: messages\n })\n })\n }", "function getNonIMSMessages() {\n /**\n * result.\n */\n var result = [];\n /**\n * temp message bar.\n * @type {Object}\n */\n var tempMessageBar = null;\n /**\n * m.\n * @type {Number}\n */\n var m = 0;\n for (m = 0; m < messageBoxes.length; m++) {\n tempMessageBar = messageBoxes[m];\n if (tempMessageBar.data(\"severity\") !== 'gray') {\n result.push(tempMessageBar);\n }\n }\n return result;\n}", "function filterMessage2(what){\n var log = document.getElementById(\"log\");\n\n displayed = (AutoTrimpsDebugTabVisible) ? false : true;\n AutoTrimpsDebugTabVisible = displayed;\n\n var toChange = document.getElementsByClassName(what + \"Message\");\n var btnText = (displayed) ? what : what + \" off\";\n var btnElem = document.getElementById(what + \"Filter\");\n btnElem.innerHTML = btnText;\n btnElem.className = \"\";\n btnElem.className = getTabClass(displayed);\n displayed = (displayed) ? \"block\" : \"none\";\n for (var x = 0; x < toChange.length; x++){\n toChange[x].style.display = displayed;\n }\n log.scrollTop = log.scrollHeight;\n}", "function listMessages(folder) {\n let enumerator = folder.msgDatabase.EnumerateMessages();\n var msgCount = 0;\n dl(\"listing messages for \" + folder.prettyName);\n while(enumerator.hasMoreElements())\n {\n msgCount++;\n let hdr = enumerator.getNext().QueryInterface(Ci.nsIMsgDBHdr);\n dl(msgCount + \": \" + hdr.subject);\n }\n}", "renderChannelMessages() {\n console.log('props are', this.props);\n let messages = this.props.channelMessages.map(message => {\n return (\n <ListGroup.Item className='color'>{message.username}: {message.content}</ListGroup.Item>\n )\n });\n return messages;\n }", "function collectMessagesBy(x, val, params){\n var API_MESSAGES_BY_PATH = \"/v1/messages/\" + x;\n var url = API_BASE_URL + API_MESSAGES_BY_PATH;\n if(!val){\n console.error(x + \"is required\");\n return Promise.resolve({});\n }\n\n url += \"/\" + val+ urlParams(params);\n\n var status = params ? extend(params.status) : null;\n\n return recursiveGET(url, [], status);\n }", "function showMessages(messages) {\n return `<ul class=\"Messages\">${messages.join(\"\\n\")}</ul>`;\n}", "function getTypingMessages (data) {\n return $('.socketchatbox-typing.socketchatbox-message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "get messages() {\n\t\treturn Message.collection.find({ chatId: this._id }).fetch();\n\t}", "async function getMessages() {\n const data = await sendRequest('getMessages', {});\n updateMessages(data.messages);\n}", "function handleKeyUp() {\n try {\n messageList.filterByMessage(inputSearch.value);\n }\n catch (e) {\n console.log(e);\n }\n}", "function memberCompletionsFiltered() {\n var hints = [], from = -1, to = -1;\n var label = cm.getTokenAt({ line: cursor.line, ch: previousToken.start }).string.trim();\n for (var i = 0; i < lastMessage.hints[\"set\"].length; i++) {\n if (lastMessage.hints[\"set\"][i].text == label) {\n hints = lastMessage.hints[\"set\"][i].options\n .filter(function (item) {\n return item.toLowerCase().containsAll(token.string.trim().toLowerCase());\n })\n .map(function (item) {\n return {\n text: item,\n displayText: item\n };\n });\n from = CodeMirror.Pos(cursor.line, token.start);\n to = CodeMirror.Pos(cursor.line, token.end);\n break;\n }\n }\n return {\n list: hints,\n from: from,\n to: to\n };\n }", "function listMessages(query) {\n return new Promise(async (resolve, reject) => {\n let content = await readFileAsync(__dirname + \"/client_secret.json\");\n const credentials = JSON.parse(content); // credential\n const clientSecret = credentials.installed.client_secret;\n const clientId = credentials.installed.client_id;\n const redirectUrl = credentials.installed.redirect_uris[0];\n const oauth2Client = new OAuth2Client(clientId, clientSecret, redirectUrl);\n const token = await readFileAsync(TOKEN_PATH);\n oauth2Client.credentials = JSON.parse(token);\n const gmail = google.gmail({ version: \"v1\", auth: oauth2Client });\n gmail.users.threads.list(\n {\n userId: \"me\",\n q: query,\n },\n (err, res) => {\n if (err) {\n console.log(\"err\");\n reject(err);\n return;\n }\n if (!res.data) {\n resolve([]);\n return;\n }\n resolve(res.data);\n }\n );\n });\n}", "renderMessages(messages) {\n this.message_container.innerHTML = \"\";\n if (messages && !messages.hasOwnProperty(\"status\")) {\n for (let message of messages) {\n let new_message = this.createMessage(message);\n this.message_container.appendChild(new_message);\n }\n }\n }", "async function displayAllMessages(context, src, trg, memoryID) {\n const source = Front.buildCancelTokenSource();\n // Do not wait more than 500ms for the list of messages.\n setTimeout(() => source.cancel(), 500);\n try {\n const list = await context.listMessages(undefined, source.token);\n\n let nextPageToken = list.token\n const messages = list.results;\n\n while (nextPageToken) {\n const {results, token} = await context.listMessages(nextPageToken);\n nextPageToken = token;\n messages.push(...results);\n }\n\n let inner = messages[messages.length - 1].content.body;\n let messages_arr = inner.split(/<[^>]*>/)\n let translatedMessages = await translateAllMessages(messages_arr, src, trg, memoryID);\n let tags = inner.match(/<[^>]*>/gi);\n let translatedInner = translatedMessages[0];\n if (tags) {\n for (let index = 0; index < tags.length; index++) {\n translatedInner = translatedInner.concat(tags[index]);\n translatedInner = translatedInner.concat(translatedMessages[index + 1]);\n translatedInner = translatedInner.concat(\" \");\n }\n }\n document.getElementById(\"translatedText\").innerHTML = translatedInner;\n\n } catch (error) {\n if (Front.isCancelError(error)) {\n return; // Do nothing.\n }\n throw error;\n }\n}", "function showUserMessges (user) {\r\n var list = document.getElementById('message-list');\r\n var user = JSON.parse(localStorage.getItem(user.email));\r\n for (var msg of user.messages) {\r\n let item = document.createElement('li');\r\n if (msg.from === user.email) {\r\n createSendMessages(list, item);\r\n }\r\n else if ( msg.timeToLive > ((new Date()).getTime() - new Date(msg.timeCreated).getTime())) {\r\n createReceivedMessages(list, item);\r\n }\r\n }\r\n\r\n function createSendMessages(list, item, lastTimeStamp){\r\n \r\n item.setAttribute('class', 'right');\r\n item.setAttribute('data-timestamp', msg.timeCreated.toString());\r\n item.innerHTML = '<receiver></receiver><bubble><message><strong>'+ msg.message + '</strong></message><sender> :' + msg.from + '</sender></bibble>';\r\n list.appendChild(item);\r\n }\r\n \r\n function createReceivedMessages(list, item, ){\r\n item.setAttribute('class', 'left');\r\n item.innerHTML = '<bubble><sender>' + msg.from + ': </sender><message><strong>'+ msg.message +'</strong>' + ' Expire @' + new Date(msg.timeCreated + msg.timeToLive).getHours() + ':' + new Date(msg.timeCreated + msg.timeToLive).getMinutes() + '</message></bubble><receiver></receiver>'\r\n item.setAttribute('data-timestamp', msg.timeCreated.toString());\r\n list.appendChild(item);\r\n setTimeout( function () {\r\n list.removeChild(item);\r\n }, msg.timeToLive - ((new Date()).getTime() - new Date(msg.timeCreated).getTime())); \r\n }\r\n\r\n setInterval(function (){\r\n var curUser = JSON.parse(localStorage.getItem(user.email));\r\n var nodes = list.querySelectorAll('li');\r\n if(nodes.length === 0){\r\n return;\r\n }\r\n var lastItem = nodes[nodes.length-1];\r\n var lastTimeStamp = lastItem.getAttribute('data-timestamp');\r\n var length = curUser.messages.length-1;\r\n var index = length;\r\n for (var i = length; i >= 0; i--){\r\n if (curUser.messages[i].timeCreated > lastTimeStamp) {\r\n index--;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if (index < length) {\r\n for (; index <= length; index++) {\r\n let item = document.createElement('li');\r\n if ( curUser.messages[index].timeToLive > ((new Date()).getTime() - new Date(curUser.messages[index].timeCreated).getTime())) {\r\n if( curUser.messages[index].timeCreated <= lastTimeStamp){\r\n continue;\r\n }\r\n if(curUser.messages[index].from === curUser.email){\r\n item.setAttribute('class', 'right');\r\n item.innerHTML = '<receiver></receiver>' + '<bubble><message><strong>'+ curUser.messages[index].message +'</strong></message><sender>'+ ':' + curUser.messages[index].from + '</sender></bubble>' \r\n item.setAttribute('data-timestamp', curUser.messages[index].timeCreated.toString());\r\n list.appendChild(item);\r\n lastTimeStamp = item.getAttribute('data-timestamp');\r\n }\r\n else {\r\n item.setAttribute('class', 'left');\r\n item.innerHTML = '<bubble><sender>' + curUser.messages[index].from + ':' + '</sender>' + '<message><strong>'+ curUser.messages[index].message +'</strong>' + ' Expire @' + new Date(curUser.messages[index].timeCreated + curUser.messages[index].timeToLive).getHours() + ':' + new Date(curUser.messages[index].timeCreated + curUser.messages[index].timeToLive).getMinutes() + '</message></bubble>' + '<receiver></receiver>'\r\n item.setAttribute('data-timestamp', curUser.messages[index].timeCreated.toString());\r\n list.appendChild(item);\r\n lastTimeStamp = item.getAttribute('data-timestamp');\r\n setTimeout( function () {\r\n list.removeChild(item);\r\n }, curUser.messages[index].timeToLive - ((new Date()).getTime() - new Date(curUser.messages[index].timeCreated).getTime()));\r\n }\r\n } \r\n }\r\n }\r\n }, 2000);\r\n\r\n}", "function fetchMessages(){\n //const url = '/feed';\n fetch(url).then((response) => {\n return response.json();\n }).then((messages) => {\n const messageContainer = document.getElementById('message-container');\n if(messages.length == 0){\n messageContainer.innerHTML = '<p>There are no posts yet.</p>';\n }\n else{\n messageContainer.innerHTML = '';\n }\n messages.forEach((message) => {\n if(!message.hasOwnProperty('chat')) {\n const messageDiv = buildMessageDiv(message);\n messageContainer.appendChild(messageDiv);\n }\n });\n });\n }", "function fetchMessages() {\n let url = '/messages?user=' + parameterUsername;\n\n const parameterLanguage = defaultLanguage;\n if (parameterLanguage) {\n url += '&language=' + parameterLanguage;\n }\n\n console.log(url);\n\n fetch(url)\n .then((response) => {\n return response.json();\n })\n .then((messages) => {\n const messagesContainer = document.getElementById('message-container');\n if (messages.length == 0) {\n messagesContainer.innerHTML = '<p>This user has no posts yet.</p>';\n } else {\n messagesContainer.innerHTML = '';\n }\n\n\n var count = 0;\n\n messages.forEach((message) => {\n const messageDiv = buildMessageDiv(message);\n\n if (count !== maxMessages) {\n \tcount++;\n } else {\n \tmessageDiv.hidden = true;\n }\n\n messagesContainer.appendChild(messageDiv);\n });\n\n });\n}", "read(from, to, limit, state) {\n // Build a search expression given the options.\n let search = this.raw || '';\n\n if (this.filter_search_expr !== undefined) {\n search += ' ' + this.filter_search_expr;\n }\n\n // The gmail search expression only has per-day granularity,\n // so we quantize the -from and -to to the nearest day and do\n // additional filtering in get_messages().\n\n // XXX/mstemm not sure how the time zone is set. It's definitely not in UTC.\n search += ' after:' + JuttleMoment.format(from, 'YYYY/MM/DD', 'US/Pacific');\n\n // Add 1 day to to and then quantize to a day. This\n // results in the next day, such that the before: date is\n // always in the future.\n if (! to.isEnd()) {\n search += ' before:' + JuttleMoment.format(to.add(JuttleMoment.duration(1, 'd')), 'YYYY/MM/DD', 'US/Pacific');\n }\n\n this.logger.debug('Search string:', search);\n return this.get_messages(from, to, search)\n .call('sort', (a, b) => {\n if (a.time.lt(b.time)) {\n return -1;\n } else if (a.time.eq(b.time)) {\n return 0;\n } else {\n return 1;\n }\n })\n .then((messages) => {\n let ret = {\n points: messages,\n readEnd: to\n };\n return ret;\n });\n }", "function parseMessage(message) {\n //Delete till first line with maximum 3 words\n // First split with\n var objects = message.split(/<p>\\s*[-_]{1,}\\s*<\\/p>/);\n objects.shift();\n return jQuery.map(objects, parseFriend);\n\n}", "function hideAllMessage() {\n [].forEach.call(messages, function(message) {\n if (!message.classList.contains('msgInvisible')) {\n message.classList.add('msgInvisible');\n }\n })\n}", "function messages(state = initObj, action) {\n switch (action.type) {\n case t.getMessages_get: {\n return {\n ...state,\n isFetching: true,\n };\n }\n case t.getMessages_success: {\n return {\n ...state,\n isFetching: false,\n messages: action.payload,\n error: null,\n };\n }\n case t.getMessages_failure: {\n return {\n ...state,\n isFetching: false,\n error: action.payload,\n };\n }\n case t.getMessages_filterToggle: {\n const filterIndex = findIndex(state.filters, ({ colName }) => colName === action.payload);\n let newFilters;\n if (filterIndex !== -1) {\n const filterObj = {\n ...state.filters[filterIndex],\n ascending: !state.filters[filterIndex].ascending,\n };\n newFilters = [\n ...state.filters.slice(0, filterIndex),\n filterObj,\n ...state.filters.slice(filterIndex + 1),\n ];\n } else {\n newFilters = [\n ...state.filters,\n { colName: action.payload, ascending: true },\n ];\n }\n\n return {\n ...state,\n filters: newFilters,\n };\n }\n case t.getMessages_filterDelete: {\n return {\n ...state,\n filters: filter(state.filters, ({ colName }) => colName !== action.payload),\n };\n }\n case '@@router/LOCATION_CHANGE': {\n return initObj;\n }\n case t.getMessages_clear: {\n return initObj;\n }\n default: {\n return state;\n }\n }\n}", "loadMessages() {\n\n // request a range of messages preceeding the current index of the oldest retrieved message\n const promise = App.requests.getMessageRange(App.state.lowIndex, App.constants.LOAD_SIZE);\n promise.done(response => {\n\n // if results were returned add them to the page.\n if (response.data.length > 0) {\n if (App.state.highIndex === 0) {\n\n // if this is the first call, set the initial highest index\n App.state.highIndex = response.data[0].id;\n }\n App.dom.prependMessagesToChat(response.data);\n } else {\n\n // assume there are no older messages and disable the button.\n App.dom.disableLoader();\n }\n });\n }", "handleMessage (data) {\n console.log(data)\n if (data.type === 'message') {\n console.log('is message')\n let sender = data.username\n let listItem = document.createElement('li')\n listItem.innerText = sender + ': ' + data.data // syntax : first username then message\n this.messageList.appendChild(listItem)\n }\n }", "async function getMessagesOnOpen(){\n if(messages.length==0){\n return;\n }\n // r for reconnecting\n let rhasMore = true;\n let rnext=null;\n let rmessages = [];\n let lastMessage = messages[messages.length - 1];\n let uri;\n let index = -1;\n\n do{\n uri = rnext?rnext:`/api/branches/${member}/chat_rooms/${data.room.id}/messages/`;\n let response = await axios.get(uri);\n if(!response.data.next){\n rhasMore = false;\n break;\n }\n let newrMessages = response.data.results.reverse();\n rnext = response.data.next;\n rmessages = [...newrMessages,...rmessages];\n\n // try to find last known message before disconnect\n }while(rhasMore && rmessages.length>0 && messages.length>0 && !(index=rmessages.findIndex(m=>m.id==lastMessage.id)));\n\n // if message found slice the new messages\n rmessages = rmessages.slice(index + 1,rmessages.length);\n setMessages([...messages,...rmessages]);\n }", "function loadMessages() {\n // Create the query to load the last 12 messages and listen for new ones.\n var query = firebase.firestore()\n .collection('messages')\n .orderBy('timestamp', 'desc')\n .limit(12);\n \n // Start listening to the query.\n query.onSnapshot(function(snapshot) {\n snapshot.docChanges().forEach(function(change) {\n if (change.type === 'removed') {\n deleteMessage(change.doc.id);\n } else {\n var message = change.doc.data();\n displayMessage(change.doc.id, message.timestamp, message.name,\n message.text, message.profilePicUrl, message.imageUrl);\n }\n });\n });\n}", "function loadMessages() {\n // Create the query to load the last 12 messages and listen for new ones.\n var query = firebase.firestore()\n .collection('messages')\n .orderBy('timestamp', 'desc')\n .limit(12);\n \n // Start listening to the query.\n query.onSnapshot(function(snapshot) {\n snapshot.docChanges().forEach(function(change) {\n if (change.type === 'removed') {\n deleteMessage(change.doc.id);\n } else {\n var message = change.doc.data();\n displayMessage(change.doc.id, message.timestamp, message.name,\n message.text, message.profilePicUrl, message.imageUrl);\n }\n });\n });\n}", "function getReceivedMessages(req, res) {\n const userId = req.user.sub;\n let page = 1;\n\n if (req.params.page) {\n page = req.params.page;\n }\n\n const itemsPerPage = 4;\n Message.find({ receiver: userId })\n .populate('emitter', 'name surname _id nick image')\n .sort({created_at: 'desc'})\n .paginate(page, itemsPerPage, (err, messages, total) => {\n if (err)\n return res.status(500).send({ message: 'Error en la petición.' });\n if (!messages)\n return res.status(404).send({ message: 'No hay mensajes.' });\n return res.status(200).send({\n total,\n pages: Math.ceil(total / itemsPerPage),\n messages\n });\n });\n}", "constructor () {\n this.messages = []\n }", "function getMessages (cb, data) {\n var req = GETRequest(`http://ec2-54-66-246-123.ap-southeast-2.compute.amazonaws.com/brian/src/public/client/${data.JAID}/messages`)\n\n req.onreadystatechange = function () {\n if (req.readyState === 4 && req.status === 200) {\n var obj = JSON.parse(req.responseText)\n cb(obj)\n } else if (req.status !== 200) {\n // do something\n }\n }\n}" ]
[ "0.7184745", "0.70755327", "0.6901593", "0.6598752", "0.6376389", "0.63663375", "0.6323981", "0.62957156", "0.6265196", "0.62555665", "0.6243934", "0.62256247", "0.6216996", "0.6195781", "0.61940604", "0.6169644", "0.6131701", "0.61117643", "0.6097445", "0.60845214", "0.60774547", "0.6064185", "0.6060784", "0.60380507", "0.6036989", "0.60295665", "0.6020362", "0.6001476", "0.59826064", "0.5958296", "0.5947988", "0.5940166", "0.5936376", "0.59132725", "0.5904328", "0.5902212", "0.5900745", "0.5900745", "0.5900745", "0.5900745", "0.5900745", "0.58844775", "0.58741605", "0.58543915", "0.58524626", "0.5847668", "0.58463585", "0.5841695", "0.5838935", "0.5834579", "0.58329165", "0.5818756", "0.5813265", "0.5798347", "0.5796018", "0.5790697", "0.5790697", "0.57899046", "0.5789402", "0.57796705", "0.57781166", "0.57751304", "0.57703245", "0.5736054", "0.572344", "0.57143265", "0.56971055", "0.5688389", "0.5661658", "0.5660871", "0.5650444", "0.5647942", "0.5645067", "0.56313026", "0.56304055", "0.56289434", "0.56247014", "0.5624404", "0.5623525", "0.56224394", "0.5620074", "0.5619296", "0.56170934", "0.56168455", "0.5603409", "0.56018025", "0.5596721", "0.5583512", "0.5581583", "0.55714697", "0.55677545", "0.556321", "0.55593485", "0.5556588", "0.5542743", "0.5542743", "0.5536897", "0.55346465", "0.553106" ]
0.572753
64
Filter and List Messages
function ListMessages(auth) { var gmail = google.gmail('v1'); var query= "from: notifications@github.com view pull request"; nock('https://www.googleapis.com/gmail/v1/users') .get('/jaga4494/messages').reply(200, { username: 'davidwalshblog', firstname: 'David' }); return new Promise(function (resolve, reject) { gmail.users.messages.list({ auth: auth, userId: 'me', q: query, }, function(err, response,body) { if (err) { console.log('The API returned an error: ' + err); return; } var obj = JSON.parse(body); resolve(obj); /* var msgs = response.messages; console.log('- %s', msgs); if (msgs.length == 0) { console.log('No message found.'); } else { console.log('Message:'); //console.log('- %s', msgs.messages[1].id); for (var i = 0; i < msgs.length; i++) { var msg = msgs[i]; console.log('- %s', msg.id); } }*/ }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterMessage(input) {\n\t\n}", "function searchMessages() {\n\tvar input, filter, ul, li, i, a, txtValue;\n\tinput = document.getElementById(\"searchMessages\");\n\tfilter = input.value.toUpperCase();\n\tul = document.getElementById(\"chat-list\");\n\tli = ul.getElementsByClassName(\"chat-list-group\");\n\tfor (i = 0; i < li.length; i++) {\n\t\tdiv = li[i].getElementsByClassName(\"messages-searching-div\")[0];\n\t\ttxtValue = div.textContent || div.innerText;\n\t\tif (txtValue.toUpperCase().indexOf(filter) > -1) {\n\t\t\tli[i].style.display = \"\";\n\t\t} else {\n\t\t\tli[i].style.display = \"none\";\n\n\t\t}\n\t}\n}", "function getAllSentMessagesByFilter(params) {\n\t\treturn Restangular.all('message').one(\"sent\", \"filterParam\").customPOST(params, null);\n\t} // end of get all sent message by filter function", "function getAllMessages(){\n\t\treturn Restangular.all('message').getList();\n\t}// end of get all messages function", "_extractFilteredMessages(messages, filter = null, media = null, user = null, date = null, time = null, strictFilter = true) {\n const filteredMessages = [];\n\n // iterates through the messages, if any specified condition is not met the message will skip the other checks and won't be pushed into the array\n messages.map(m => {\n\n var pushMessage = true;\n\n if(media != null && pushMessage){\n if(media && !m.isMedia){\n pushMessage = false;\n } else if(!media && m.isMedia) {\n pushMessage = false;\n }\n }\n\n if(user && m.user != user && pushMessage){\n pushMessage = false;\n }\n\n if(time && m.time != time && pushMessage){\n pushMessage = false;\n }\n\n // check if the date parameter passed is an array, if it is then checks for a date between these, both included\n // else it just tries to match the date\n if(date && pushMessage){\n // the between part needs work, fails sometimes\n if(date.constructor === Array){\n var message_date = Date.parse(m.date)\n var date_start = Date.parse(date[0])\n var date_end = Date.parse(date[1])\n \n if(message_date >= date_end || message_date <= date_start){\n pushMessage = false;\n }\n } else {\n if(Date.parse(date) !== Date.parse(m.date)){\n pushMessage = false;\n }\n }\n \n }\n\n // strict filter matches the word, loose filter is just an includes()\n if(filter && pushMessage) {\n if(strictFilter){\n var found = false;\n\n m.message.split(\" \").forEach(e => {\n \n if(e.toLowerCase() == filter.toLowerCase()){\n found = true;\n }\n \n });\n if(!found){\n pushMessage = false;\n }\n } else {\n if(!m.message.toLowerCase().includes(filter.toLowerCase())){\n pushMessage = false;\n }\n }\n }\n\n if(pushMessage){\n filteredMessages.push(m)\n }\n\n });\n\n return filteredMessages;\n }", "function getAllMessagesByPagination(params) {\n\t\treturn Restangular.one('message', \"filterParam\").customPOST(params, null);\n\t} // end of get all message by pagination function", "function findAllMessages() {\n return $http.get(restApi + '/messages').then(function success(response) {\n return response.data;\n },\n function error(error) {\n return error;\n });\n }", "function getmessages(){\n jsonp('receive', {}, function(messages){\n messages.sort(messagesort);\n $.each(messages, function(i, message){\n if('proposal' === message.subject && -1 === message.body.scheme){\n showproposal(message.body);\n }else if('fulfil' === message.subject){\n showfulfil(message.body);\n }else if('accept' == message.subject){\n showaccept(message.body);\n }\n });\n setTimeout('getmessages()', 1000);\n });\n}", "_extractMessagesWords(messages, filter = null, minimumWordLength = 0, strictFilter = true){\n var messagesWords = []\n var progress = 1\n\n messages.map((m, index) => {\n\n // certainly improvable progress bar\n if(Math.ceil(messages.length / 100) * progress == index){\n progress++\n process.stdout.clearLine();\n process.stdout.cursorTo(0);\n process.stdout.write(progress + '%');\n }\n\n // no need to parse media or system messages\n if(!m.isMedia && m.isUserMessage){\n m.message.split(\" \").forEach(e => {\n\n var messageWord = e.toLowerCase();\n var matchesRequirement = !filter ? true : strictFilter ? messageWord == filter : messageWord.includes(filter);\n\n // parses the message if there's no filter or the message matches it and the message also meets the length\n if((!filter || matchesRequirement) && (messageWord.length >= minimumWordLength)){\n\n var newWord = true;\n \n // if the word exists in the array we're going to return, just add to the count\n messagesWords.map(function(words_item){\n var word = words_item.word.toLowerCase()\n if(word == messageWord){\n\n newWord = false;\n words_item.total_count++\n\n if(words_item.hasOwnProperty([m.user])){\n words_item[m.user]++\n } else {\n words_item[m.user] = 1\n }\n\n }\n })\n \n // else create the object and push it into the array\n if(newWord){\n messagesWords.push({word: messageWord, total_count: 1, [m.user]: 1})\n }\n }\n \n });\n }\n })\n\n // remove the progress bar\n process.stdout.clearLine();\n\n messagesWords = messagesWords.sort((a, b) => {\n return b.total_count - a.total_count;\n })\n\n return messagesWords;\n }", "function getMessage(filterUser){\n return new Promise((resolve,reject)=>{\n resolve(store.list(filterUser))\n })\n}", "_extractMessages(data) {\n // split the set of messages into lines, each representing a user or system message \n let lines = data.replace(/\\d{1,2}\\/\\d{1,2}\\/\\d{1,2},\\s\\d{1,2}:\\d{1,2}\\s-\\s/g, `${DEFAULT_LINE_SPLITTER}$&`);\n lines = lines.split(new RegExp(DEFAULT_LINE_SPLITTER, 'g')).filter(m => m).map(m => m.replace(/\\n$/, ''));\n\n const messages = [];\n\n // for each line parses the information as best as possible, creates an object Message and adds it to the messages array\n for (let line of lines) {\n let lastIndex = 0;\n let index = line.match(/,/).index;\n\n const date = line.slice(lastIndex,index).trim();\n lastIndex = index+1;\n index = line.match(/-/).index;\n\n const time = line.slice(lastIndex,index).trim();\n lastIndex = index+1;\n\n line = line.replace(/:/,'$');\n\n let user = DEFAULT_USER;\n // tries to get the message's text\n const match = line.match(/:/); // Fails if a system message contains ':', e.g. 5/7/17, 22:41 - Alvaro created group \"Grupo: de salir (official)\"\n if (match) {\n user = line.slice(lastIndex, match.index).trim();\n lastIndex = match.index+1;\n }\n\n const message = line.slice(lastIndex).trim();\n\n const isMedia = message == \"<Media omitted>\";\n const isUserMessage = user != \"System\";\n\n messages.push(new Message(date, time, user, message, isMedia, isUserMessage));\n }\n\n return messages;\n }", "function getMessages(){\n serverRequest(getParams(\"none\"), true); \n}", "getAllMessages ({ commit }) {\n api.getMessages((messages) => {\n let inbox = messages.filter((message) => message.to.email === user.email && !message.isDeleted)\n let outbox = messages.filter((message) => message.from.email === user.email)\n // let important = messages.filter((message) => message.isImportant)\n let trash = messages.filter((message) => message.isDeleted)\n\n commit('setInbox', inbox)\n commit('setOutbox', outbox)\n // commit('setImportant', important)\n commit('setTrash', trash)\n })\n }", "function dispalyMessages(messages) {\n // let list_message = document.querySelector('.list-text');\n if (list_message !== null) {\n list_message.remove();\n }\n list_message = document.createElement('div');\n list_message.className = 'list-text';\n\n for (let value of messages) {\n\n let messageText = document.createElement('p');\n messageText.className = \"message-text\";\n messageText.textContent = value.message;\n list_user.textContent = value.users;\n \n if (value.users === itemOfuser) {\n messageText.style.background = 'red';\n }\n if(value.bold === true){\n messageText.style.fontWeight = 'bold';\n }else{\n messageText.style.fontWeight = 'normal';\n }\n\n if(value.italic === true){\n messageText.style.fontStyle = 'italic';\n }else{\n messageText.style.fontStyle = 'normal';\n }\n\n list_message.appendChild(messageText);\n messageTitle.appendChild(list_message);\n }\n}", "function getMessages() {\n \tvar transaction = db.transaction(['osMsgStore'], 'readonly'),\n \t\tobjectStore = transaction.objectStore('osMsgStore'),\n \t\tcursor = objectStore.openCursor(),\n isAdmin = document.getElementsByTagName('body')[0].className === 'admin' ? true : false;\n\n \tcursor.onsuccess = function(e) {\n var res = e.target.result;\n\n \t if (res) {\n generateMessage(res.key, res.value.created, res.value.message, isAdmin);\n \t res.continue();\n \t }\n \t}\n }", "function displayConversationMessages(id) {\n selectedConversationId = id;\n var members = getGroupMembers();\n\n var sql = ` SELECT\n ZGROUPEVENTTYPE,\n replace(ZTEXT, '\\n', '<br>') AS ZTEXT,\n ZISFROMME,\n ZGROUPMEMBER,\n ZMESSAGEDATE,\n ZGROUPMEMBER,\n ZPUSHNAME\n FROM\n ZWAMESSAGE\n WHERE\n ZCHATSESSION = $ZCHATSESSION\n `\n\n var filter = document.getElementById('filter-field').value;\n if (filter) {\n sql += ' AND (ZTEXT LIKE $filter COLLATE NOCASE OR ZPUSHNAME LIKE $filter COLLATE NOCASE)';\n }\n\n var stmt = db.prepare(sql);\n stmt.bind({$ZCHATSESSION:id, $filter:'%' + filter + '%'});\n\n var html = '';\n var previousMessageDate;\n var nbMessages = 0;\n\n while(stmt.step()) {\n row = stmt.getAsObject();\n if (!row['ZTEXT']) {\n continue;\n }\n\n var messageDate = new Date((978307200 + row['ZMESSAGEDATE']) * 1000);\n if (!previousMessageDate || messageDate.getDate() != previousMessageDate.getDate() || messageDate.getMonth() != previousMessageDate.getMonth()) {\n previousMessageDate = messageDate;\n html += '<div class=\"message timestamp\">' + messageDate.toLocaleDateString() + '</div>';\n }\n\n html += '<div class=\"message ' + (row['ZISFROMME'] == 1 ? 'message-from-me' : 'message-from-other') + '\">';\n\n if (row['ZISFROMME'] == 0 && row['ZGROUPMEMBER']) {\n html += '<div class=\"from-name-in-group\">' + (row['ZPUSHNAME'] || members[row['ZGROUPMEMBER']]) + '</div>';\n }\n\n html += row['ZTEXT'];\n html += '</div>';\n\n nbMessages++;\n }\n\n document.getElementById('bottom-right-pane').innerHTML = html;\n document.getElementById('conversation-title').innerHTML = document.getElementById(id).getElementsByClassName('partner-name')[0].innerHTML + ' (<span class=\"bold\">' + nbMessages + (filter ? ' - filtered' : '') + '</span>)';\n}", "function GetMessages(req, res){\n Message.find({}).exec((err, result) => {\n res.send(result);\n })\n}", "listMessages(context, params) {\n return this.$axios\n .get(`/sms?${querystring.stringify(params)}`)\n .then(({ data }) => data)\n .catch(this.$catch);\n }", "getMessages() {\n\t\tconst newMessages = this.chat_backlog.getLog();\n\t\tthis.chat_backlog.clearLog();\n\t\treturn newMessages;\n\t}", "async function listMessages(req, res, next) {\n try {\n const connection = await getConnection();\n const { search } = req.query;\n\n let result;\n\n if (search) {\n await searchSchema.validateAsync(search);\n\n [result] = await connection.query(\n `\n select title, text, type, category from messages\n where messages.title like ? or messages.text like ? or messages.type like ? or messages.category like ?\n `,\n [`%${search}%`, `%${search}%`, `%${search}%`, `%${search}%`]\n );\n } else {\n [result] = await connection.query(`\n select from_users_id, concat_ws(' ',a.name, b.surname) as De, e.avatar as avatar_from, to_users_id, concat_ws(' ',c.name, d.surname) as Para, f.avatar as avatar_to, title, text, image, type, category, create_message from messages\n inner join users a on a.id = from_users_id\n inner join users b on b.id = from_users_id\n inner join users c on c.id = to_users_id\n inner join users d on d.id = to_users_id\n inner join users e on e.id = from_users_id\n inner join users f on f.id = to_users_id\n order by create_message desc;\n `);\n }\n\n const [messages] = result;\n\n connection.release();\n\n res.send({\n status: 'ok',\n message: 'Lista de mensajes De Para en orden descendente',\n data: result,\n });\n } catch (error) {\n next(error);\n }\n}", "function viewMessages(user, messages){\n\tif(user.role === ROLE.ADMIN || user.role === ROLE.MODERATOR){\n\t\treturn messages;\n\t};\n\treturn messages.filter(messages => message.userId === user.id);\n}", "showMessages () {\n this.messages.forEach((message) => {\n console.log(`${messageStyles[message.getType()]} ${message.getType()}: ${message.getText()}`)\n })\n }", "function getTypingMessages(data) {\n return $('.typing.message').filter(function(i) {\n return $(this).data('userName') === data.userName;\n });\n}", "function SearchMessages() {\n //Context\n const { resultsMessage, searchResults, isLoading } = useContext(AppContext);\n\n //Search messages\n const doTheSearch = \"Realiza una búsqueda para encontrar tus gifs\";\n const notFound = `No se encontraron resultados, por favor intenta de nuevo modificando tu busqueda`;\n const resultsFound = `Resultados de tu búsqueda`;\n\n //Condition\n if (resultsMessage === false) {\n return [doTheSearch];\n } else if (searchResults.length === 0 && isLoading === false) {\n return [notFound];\n } else {\n return [resultsFound];\n }\n}", "function listMessages() {\r\n\r\n\t\t var request = gapi.client.gmail.users.messages.list({\r\n\t\t 'userId': 'me'\r\n\t\t });\r\n\t\r\n\t\t request.execute(function(resp) {\r\n\t\t\t\t\t var messageIDS = resp.messages;\r\n\r\n\t\t\t\t\t if (messageIDS && messageIDS.length >= 20)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t getMessage('me', messageIDS);\r\n\t\t\t } else {\r\n\t\t\t \t errorPrepend('No Messages found.');\r\n\t\t\t }\r\n\t\t });\r\n\t\t }", "function messageAllUsers() {\n vm.filteredusers.forEach(function (obj) {\n AddContacts(obj.email);\n });\n }", "_findMessages() {\n if (this.checkedMessages) {\n return;\n }\n\n const composer = this.composer;\n const args = { composer_action: composer.get(\"action\") };\n const topicId = composer.get(\"topic.id\");\n const postId = composer.get(\"post.id\");\n\n if (topicId) {\n args.topic_id = topicId;\n }\n if (postId) {\n args.post_id = postId;\n }\n\n const cacheKey = `${args.composer_action}${args.topic_id}${args.post_id}`;\n\n const processMessages = messages => {\n if (this.isDestroying || this.isDestroyed) {\n return;\n }\n\n // Checking composer messages on replies can give us a list of links to check for\n // duplicates\n if (messages.extras && messages.extras.duplicate_lookup) {\n this.addLinkLookup(new LinkLookup(messages.extras.duplicate_lookup));\n }\n\n this.set(\"checkedMessages\", true);\n const queuedForTyping = this.queuedForTyping;\n messages.forEach(msg =>\n msg.wait_for_typing\n ? queuedForTyping.addObject(msg)\n : this.send(\"popup\", msg)\n );\n };\n\n if (_messagesCache.cacheKey === cacheKey) {\n processMessages(_messagesCache.messages);\n } else {\n composer.store.find(\"composer-message\", args).then(messages => {\n _messagesCache = { messages, cacheKey };\n processMessages(messages);\n });\n }\n }", "listMessages(options = {}) {\n const { span, updatedOptions } = createSpan(\"ChatThreadClient-ListMessages\", options);\n try {\n const iter = this.listMessagesAll(updatedOptions);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings = {}) => {\n return this.listMessagesPage(settings, updatedOptions);\n }\n };\n }\n catch (e) {\n span.setStatus({\n code: CanonicalCode.UNKNOWN,\n message: e.message\n });\n throw e;\n }\n finally {\n span.end();\n }\n }", "onMessagesRemoved() {\n // result text is only for when we are not searching\n if (!this.view.searching) {\n this.updateStatusResultText();\n }\n this.__proto__.__proto__.onMessagesRemoved.call(this);\n }", "async searchMessages(txt, inJid, count, page) {\n const json = [\n 'query',\n {\n epoch: this.msgCount.toString(),\n type: 'search',\n search: Buffer.from(txt, 'utf-8'),\n count: count.toString(),\n page: page.toString(),\n jid: inJid\n },\n null,\n ];\n const response = await this.query({ json, binaryTags: [24, Constants_1.WAFlag.ignore], expect200: true }); // encrypt and send off\n const messages = response[2] ? response[2].map(row => row[2]) : [];\n return { last: response[1]['last'] === 'true', messages: messages };\n }", "function filter_table_conversation(){\n \n var filter = $(\"#table_conversation_comment\").val();\n filter_table2(filter, \"table_conversation\", 1)\n }", "function get_messages() {\n\n fct_MyLearn_API_Client.query({ type: 'Mensajes', extension1: 'Trabajo', extension2: $routeParams.IdTrabajo }).$promise.then(function (data) {\n $scope.ls_msjs = data;\n });\n\n }", "function getTypingMessages (data) {\n return $('.msg_container.typing').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "onActiveMessagesLoaded(aFolderDisplay) {\n let filterer = this.maybeActiveFilterer;\n if (!filterer) {\n return;\n }\n\n let filtering = aFolderDisplay.view.search.userTerms != null;\n\n // - postFilterProcess everyone who cares\n // This may need to be converted into an asynchronous process at some point.\n for (let filterDef of QuickFilterManager.filterDefs) {\n if (\"postFilterProcess\" in filterDef) {\n let preState =\n filterDef.name in filterer.filterValues\n ? filterer.filterValues[filterDef.name]\n : null;\n let [newState, update, treatAsUserAction] = filterDef.postFilterProcess(\n preState,\n aFolderDisplay.view,\n filtering\n );\n filterer.setFilterValue(filterDef.name, newState, !treatAsUserAction);\n if (update) {\n if (\n aFolderDisplay._tabInfo == this.tabmail.currentTabInfo &&\n \"reflectInDOM\" in filterDef\n ) {\n let domNode = document.getElementById(filterDef.domId);\n // We are passing update as a super-secret data propagation channel\n // exclusively for one-off cases like the text filter gloda upsell.\n filterDef.reflectInDOM(domNode, newState, document, this, update);\n }\n }\n }\n }\n\n // - Update match status.\n this.reflectFiltererResults(filterer, aFolderDisplay);\n }", "respondToMessages() {\n let messages = rx.Observable.fromEvent(this.slack, RTM_EVENTS.MESSAGE);\n\n messages.where(e => (function(e) { let re = /kloppbot/i; return re.test(e.text) } )(e) )\n .where(e => this.fromAdmin(e))\n .subscribe((message) => this.handleNewEvent(message));\n\n messages.where(e => (function(e) { let re = /i'?(m|ll) *(in|play|playing)/i; return re.test(e.text) } )(e) )\n .subscribe((message) => this.handleNewSignup(message));\n\n messages.where(e => (function(e) { let re = /who(\\'?s| is) playing/i; return re.test(e.text) } )(e) )\n .subscribe((message) => this.handleListAttendees(message));\n\n messages.where(e => (function(e) { let re = /fixture list/i; return re.test(e.text) } )(e) )\n .subscribe((message) => this.handleListEvents(message));\n\n messages.where(e => (function(e) { let re = /next game/i; return re.test(e.text) } )(e) )\n .subscribe((message) => this.handleNextEvent(message));\n }", "function filterSchedules(message) {\n if(message.type ===\"schedule\"){\n return message;\n }\n }", "function getTypingMessages (data) {\n return $('.typing.message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "function getTypingMessages (data) {\n return $('.typing.message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "function getTypingMessages (data) {\n return $('.typing.message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "function getTypingMessages (data) {\n return $('.typing.message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "function getTypingMessages (data) {\n return $('.typing.message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "function collectMessagesByUser(user, params){\n return collectMessagesBy(\"user\", user, params);\n }", "renderSendMessage() {\n return this.props.messagesObj ?\n <SendMessage filterCriteria={this.props.messagesObj._id} checkPrivate={this.props.checkPrivate}/> : null;\n }", "function showAllMessage() {\n [].forEach.call(messages, function(message) {\n if (message.classList.contains('msgInvisible')) {\n message.classList.remove('msgInvisible');\n }\n })\n}", "function getAllMessages() {\n return [\n [\"Hey ho, Merio! We're finally living in the future! Through an internet browser! Using those new-fangled \\\"HTML\\\" and \\\"JavaScript\\\" doodads that those technical folks keep whining about. And look! The game doesn't lag anymore when you move around! Anyway, you'd better get going to progress on your adventure - I'm starting to get motion sickness from all the physics optimisations in this game engine...\"],\n [\"Watch the enemy's movements carefully and use the power of the arrow keys to outsmart them!\"],\n [\"To complete your haphazard quest to find happiness, you'll need to jump through these jiggling portals. This particular portal smells like kerosene. Mmmm...\"],\n\n [\"My cousins work here as moving platforms, so they'll give you a ride to wherever they feel like going.\"],\n [\"These snowmen are on strike for higher wages and better working conditions. Crush those lads like their corporate overlords would!\", \"But remember, if you try to jump on multiple stacks of snowmen, they can do a surprise attack that hurts you.\"],\n [\"Using the magical art of \\\"collision detection\\\", you can do a boosted jump when you get sandwiched by moving platforms. It's as if you're immune to the laws of physics!\"],\n\n [\"Y'see that pink space dust over there? Inhaling that stuff makes you all floaty and stuff!\", \"Remember, the effects of the space dust are only active when you're within the pink area, although you can extend its duration by jumping out of it.\"],\n [\"Cows? In space? I guess that's why they call our galaxy \\\"The Milky Way\\\"! Hah!\", \"Anyway, if you can make them fall asleep, you can pass by them without getting hurt.\"],\n [\"This next part of the level looks like a real doozy. You'll have to time your jumps and movements just right to make it over those cow-faced scoundrels.\"],\n [\"I'm going to be blunt with you, Merio - this guy is BIG. Bigger than those Poppin Fresh guys from the first game, I'm pretty sure. And it looks like it's willing to do everything in its power to stop you from finding happiness.\", \"But don't let its speed or size fool you. It appears to tire itself out every now and then, but tends to wake up randomly so you'll need to pick a good opportunity to run past it...\"],\n\n [\"GOOD DAY TO YOU, MERIO.\",\n \"Merio: Good day to me too.\",\n \"YOU HAVE COME TO SEEK ANSWERS TO YET ANOTHER ONE OF LIFE'S MANY QUESTIONS?\",\n \"Merio: Yeah, although now that I think about it, I could have just looked for answers on the Internet...\",\n \"WELL, SINCE YOU'RE HERE NOW, I MAY AS WELL TRY TO ANSWER YOUR QUESTION.\",\n \"Merio: Okay - How do I find happiness?\",\n \"AH, A FINE QUESTION INDEED. HAPPINESS IS FOUND IN ONE OF THE MOST UNEXPECTED WAYS.\",\n \"MANY PEOPLE HAVE SPENT YEARS TRYING TO FIND HAPPINESS, ONLY TO REGRET THEIR EFFORTS.\",\n \"ARE YOU PREPARED TO HAVE YOUR MIND BLOWN BY MY EPIC RESPONSE?\",\n \"BECAUSE WHAT I AM ABOUT TO TELL YOU CANNOT BE UNTOLD --\",\n \"Merio: Just tell the answer already, you blockhead.\",\n \"VERY WELL THEN.\",\n \"HAPPINESS IS FOUND BY KNOWING YOU HAVE COMPLETED THIS GAME.\",\n \"THERE, THE SECRET OF THE AGES HAS BEEN REVEALED TO YOU.\",\n \"I CAN SENSE YOU ARE NOW SLIGHTLY HAPPIER THAN USUAL.\",\n \"Merio: Well, I was kind of expecting to find more happiness...\",\n \"CORRECTIMUNDO, BUT YOU STILL FOUND SOME HAPPINESS NONETHELESS?\",\n \"Merio: ...\",\n \"...\",\n \"Merio: ...I suppose so.\",\n \"GOOD! MY JOB HERE IS DONE.\",\n \"Merio: Now that I've finished my adventure, what now?\",\n \"YOU COULD TRY AND ACHIEVE SOME OF YOUR OTHER LIFE GOALS?\",\n \"Merio: Life has MORE goals?! That implies there's yet another sequel in the works...\"],\n ];\n}", "_formatMessages(entries) {\n const lastSeenTimestamp = this._storableState.lastSeenTimestamp || 0\n return JSON.parse(JSON.stringify(entries)) // Deep copy\n .map(entry =>\n Object.assign(entry.payload.value, {\n hash: entry.hash,\n userIdentity: entry.identity,\n unread: entry.payload.value.meta.ts > lastSeenTimestamp,\n meta: formatMeta(entry.payload.value.meta)\n })\n )\n }", "getMessages(from, to, sensorId) {\n var method = \"table.json\";\n var params = \"&content=messages&columns=objid,datetime,parent,type,name,status,message&id=\" + sensorId;\n return this.performPRTGAPIRequest(method, params).then(function(messages) {\n var events = [];\n var time = 0;\n _.each(messages, function(message) {\n time = Math.round((message.datetime_raw - 25569) * 86400,0);\n if (time > from && time < to) {\n events.push({\n time: time * 1000,\n title: message.status,\n text: '<p>' + message.parent + '(' + message.type + ') Message:<br>'+ message.message +'</p>'\n });\n }\n });\n return events;\n });\n }", "function getSentMessages(){\n\t\treturn Restangular.all('message/sent').getList();\n\t}// end of get all messages function", "function renderOldConversation() {\n try {\n userfiltered[0].message.forEach(function (element) {\n renderInsideChat(element);\n });\n }\n catch (error) {\n console.error(error);\n }\n}", "getAllMessages() {\n return fetch(`${remoteURL}/messages?_expand=user`).then(result => result.json()).then((data) => {\n console.log(data)\n return data\n })\n }", "get getLastMessageList () {\n //\n const limit = this\n .request\n .input('limit', null)\n\n return Message\n .query()\n .notDeleted()\n .with('user')\n .limit(limit || 50)\n .orderBy('id', 'desc')\n .fetch()\n }", "function displayMessages(roomId) {\n $.post(\"/chatroom/getAllMessages\", {chatroomId: roomId}, function (data) {\n $(\"#chat-area\").html(\"\");\n\n if (checkElement(data)) {\n data.sort(function(a, b) {\n return new Date(a.time).getTime() - new Date(b.time).getTime();\n });\n data.forEach(function(message) {\n //Update chatroom with messages from unblocked users only\n if (blockList.indexOf(message.sender) < 0) {\n updateChatRoom(message);\n }\n });\n }\n }, \"json\");\n}", "getMessages(request, response) {\n\n super.authorize(request, response, (user) => {\n\n let condition = {};\n if (user.is_admin) {\n\n const clientId = request.params.clientId;\n\n condition = {\n type: 'Message', $or: [\n { $and: [{ 'user': user._id }, { 'destination_user': clientId }] },\n { $and: [{ 'user': clientId }, { 'destination_user': user._id }] }\n ]\n };\n } else {\n condition = { type: 'Message', $or: [{ 'user': user._id }, { 'destination_user': user._id }] };\n }\n\n Action.find(condition, function (err, messages) {\n\n if (err) {\n return Helpers.jsonResponse(response, false, { messages: [] }, 'Something went wrong.');\n }\n\n return Helpers.jsonResponse(response, true, { messages: messages }, 'Success.');\n });\n });\n }", "function listMessages(userId, query, callback) {\r\n var getPageOfMessages = function(request, result) {\r\n request.execute(function(resp) {\r\n result = result.concat(resp.messages);\r\n var nextPageToken = resp.nextPageToken;\r\n if (nextPageToken) {\r\n request = gapi.client.gmail.users.messages.list({\r\n 'userId': userId,\r\n 'pageToken': nextPageToken,\r\n 'q': query\r\n });\r\n console.log(\r\n \"hello!\");\r\n } else {\r\n callback(result);\r\n }\r\n });\r\n };\r\n var initialRequest = gapi.client.gmail.users.messages.list({\r\n 'userId': userId,\r\n 'q': query\r\n });\r\n console.log(\"hello!!\");\r\n}", "function chatfilter(data) {\n\tif (Array.isArray(data)) {\n\t\tdata = data.filter((line) => {\n\t\t\treturn !(/\\|(userstats|j|J|l|L|n|N|unlink|notify)\\|/.test(line) && !/\\|(chat|c:|c)\\|/.test(line));\n\t\t});\n\t} else if (typeof data === 'string') {\n\t\treturn (/\\|(userstats|j|J|l|L|n|N|unlink|notify)\\|/.test(data) && !/\\|(chat|c:|c)\\|/.test(data));\n\t}\n\treturn data;\n}", "getMessages() { return this._messages; }", "getMessages() { return this._messages; }", "function getMessages() {\n const endpoint = BASE_URL + \"/message/readAll\";\n console.log(\"getMessages\");\n return fetch(endpoint).then((res) => res.json());\n}", "handleMessage(message) {\n this.velo = message.filters;\n }", "handleMessages(messages) {\n\n }", "readMessages(username) {\n if (this.findUser(username)) {\n return this.findUser(username).getMessagesAsString();\n }\n }", "function addFilteredMsg(myMessageList, totalMsg, origRes, reducedMsg) {\n let { content } = reducedMsg;\n let filteredMsg = \"\";\n const python = spawn(\"python\", [\"./utilFunctions/script1.py\", content]);\n python.stdout.on(\"data\", (data) => {\n filteredMsg += data.toString();\n });\n python.on(\"close\", (code) => {\n console.log(content);\n reducedMsg.content = filteredMsg;\n myMessageList.push(reducedMsg);\n if (myMessageList.length === totalMsg) {\n origRes.writeHead(302, { Location: \"/api/finished\" });\n origRes.end();\n }\n });\n}", "function onGetMessages(response) {\n\tmessages = response._embedded.status;\n\n\tvar newMessages = '';\n\t$.each(messages, function(index, item) {\n\t\tnewMessages += '<li data-theme=\"\">' + '<a href=\"#page2?msgId=' + index\n\t\t\t\t+ '\" data-transition=\"none\">' + item.message + '</a>' + '</li>';\n\t});\n\t$('#messages li[role!=heading]').remove();\n\t$('#messages').append(newMessages).listview('refresh');\n}", "get allMessages() {\n return this._realm.objects(Constants.Message);\n }", "function getMessages(req, res) {\r\n\tvar _id = +req.params.id;\r\n\tvar endId = +req.query.end || undefined;\r\n\tvar fromId = +req.query.from || 0;\r\n\tvar msgToSend = [];\r\n\t\r\n\tvar error = null;\r\n\t\r\n\tif(_id) {\r\n\t\tvar message = _.findWhere(messages, { '_id' : _id });\r\n\t\tif(message) {\r\n\t\t\tmsgToSend = message;\r\n\t\t} else {\r\n\t\t\terror = \"The message is a comment or does not exist.\"\r\n\t\t}\t\t\r\n\t} else {\r\n\t\tmsgToSend = messages.slice(fromId, endId);\r\n\t}\r\n\t\r\n\tif(error) {\r\n\t\tres.status(500).send(error);\r\n\t} else {\r\n\t\tres.send(msgToSend);\r\n\t}\t\t\r\n}", "async function getMessages() {\n try {\n const messages = await getMessagesAsync();\n displayMessages(messages);\n //console.log(messages);\n \n } // catch and log any errors\n catch (err) {\n console.log(err);\n }\n }", "function filterMessage(message, userId, token) {\n var url = URL + '/message/'+userId;\n return $http.post(url, message,{\n headers: {'Authorization': \"Bearer \"+token}\n })\n .then(function (response) {\n return response.data;\n });\n }", "function getMessages() {\n $.get('http://localhost:3000/messages', (data) => {\n data.forEach(addMessage);\n })\n}", "function loadMessages() {\r\n // Create the query to load the last 12 messages and listen for new ones.\r\n var query = firebase.firestore()\r\n .collection('messages')\r\n .orderBy('timestamp','asc')\r\n .limitToLast(200); //last 200 messgae of orderby \r\n \r\n // Start listening to the query.\r\n query.onSnapshot(function(snapshot) {\r\n snapshot.docChanges().forEach(function(change) {\r\n if (change.type === 'removed') {\r\n // deleteMessage(change.doc.id);\r\n } else {\r\n var message = change.doc.data();\r\n // displayMessage(message.text);\r\n render(message);\r\n }\r\n });\r\n });\r\n}", "function getMessages() {\n Message.find({relationshipId: req.params.id}, function(err, messages) {\n if(err) {\n return res.status(500).json({\n title: 'An error occurred', \n error: err\n })\n }\n if(!messages) {\n return res.status(404).json({\n title: 'No messages found',\n error: {message: 'No messages with that relationship id found'}\n })\n }\n //Return list of messages\n return res.status(200).json({\n title: 'Messages found...',\n obj: messages\n })\n })\n }", "function getNonIMSMessages() {\n /**\n * result.\n */\n var result = [];\n /**\n * temp message bar.\n * @type {Object}\n */\n var tempMessageBar = null;\n /**\n * m.\n * @type {Number}\n */\n var m = 0;\n for (m = 0; m < messageBoxes.length; m++) {\n tempMessageBar = messageBoxes[m];\n if (tempMessageBar.data(\"severity\") !== 'gray') {\n result.push(tempMessageBar);\n }\n }\n return result;\n}", "function filterMessage2(what){\n var log = document.getElementById(\"log\");\n\n displayed = (AutoTrimpsDebugTabVisible) ? false : true;\n AutoTrimpsDebugTabVisible = displayed;\n\n var toChange = document.getElementsByClassName(what + \"Message\");\n var btnText = (displayed) ? what : what + \" off\";\n var btnElem = document.getElementById(what + \"Filter\");\n btnElem.innerHTML = btnText;\n btnElem.className = \"\";\n btnElem.className = getTabClass(displayed);\n displayed = (displayed) ? \"block\" : \"none\";\n for (var x = 0; x < toChange.length; x++){\n toChange[x].style.display = displayed;\n }\n log.scrollTop = log.scrollHeight;\n}", "function listMessages(folder) {\n let enumerator = folder.msgDatabase.EnumerateMessages();\n var msgCount = 0;\n dl(\"listing messages for \" + folder.prettyName);\n while(enumerator.hasMoreElements())\n {\n msgCount++;\n let hdr = enumerator.getNext().QueryInterface(Ci.nsIMsgDBHdr);\n dl(msgCount + \": \" + hdr.subject);\n }\n}", "renderChannelMessages() {\n console.log('props are', this.props);\n let messages = this.props.channelMessages.map(message => {\n return (\n <ListGroup.Item className='color'>{message.username}: {message.content}</ListGroup.Item>\n )\n });\n return messages;\n }", "function collectMessagesBy(x, val, params){\n var API_MESSAGES_BY_PATH = \"/v1/messages/\" + x;\n var url = API_BASE_URL + API_MESSAGES_BY_PATH;\n if(!val){\n console.error(x + \"is required\");\n return Promise.resolve({});\n }\n\n url += \"/\" + val+ urlParams(params);\n\n var status = params ? extend(params.status) : null;\n\n return recursiveGET(url, [], status);\n }", "function showMessages(messages) {\n return `<ul class=\"Messages\">${messages.join(\"\\n\")}</ul>`;\n}", "function getTypingMessages (data) {\n return $('.socketchatbox-typing.socketchatbox-message').filter(function (i) {\n return $(this).data('username') === data.username;\n });\n }", "get messages() {\n\t\treturn Message.collection.find({ chatId: this._id }).fetch();\n\t}", "async function getMessages() {\n const data = await sendRequest('getMessages', {});\n updateMessages(data.messages);\n}", "function handleKeyUp() {\n try {\n messageList.filterByMessage(inputSearch.value);\n }\n catch (e) {\n console.log(e);\n }\n}", "function memberCompletionsFiltered() {\n var hints = [], from = -1, to = -1;\n var label = cm.getTokenAt({ line: cursor.line, ch: previousToken.start }).string.trim();\n for (var i = 0; i < lastMessage.hints[\"set\"].length; i++) {\n if (lastMessage.hints[\"set\"][i].text == label) {\n hints = lastMessage.hints[\"set\"][i].options\n .filter(function (item) {\n return item.toLowerCase().containsAll(token.string.trim().toLowerCase());\n })\n .map(function (item) {\n return {\n text: item,\n displayText: item\n };\n });\n from = CodeMirror.Pos(cursor.line, token.start);\n to = CodeMirror.Pos(cursor.line, token.end);\n break;\n }\n }\n return {\n list: hints,\n from: from,\n to: to\n };\n }", "function listMessages(query) {\n return new Promise(async (resolve, reject) => {\n let content = await readFileAsync(__dirname + \"/client_secret.json\");\n const credentials = JSON.parse(content); // credential\n const clientSecret = credentials.installed.client_secret;\n const clientId = credentials.installed.client_id;\n const redirectUrl = credentials.installed.redirect_uris[0];\n const oauth2Client = new OAuth2Client(clientId, clientSecret, redirectUrl);\n const token = await readFileAsync(TOKEN_PATH);\n oauth2Client.credentials = JSON.parse(token);\n const gmail = google.gmail({ version: \"v1\", auth: oauth2Client });\n gmail.users.threads.list(\n {\n userId: \"me\",\n q: query,\n },\n (err, res) => {\n if (err) {\n console.log(\"err\");\n reject(err);\n return;\n }\n if (!res.data) {\n resolve([]);\n return;\n }\n resolve(res.data);\n }\n );\n });\n}", "renderMessages(messages) {\n this.message_container.innerHTML = \"\";\n if (messages && !messages.hasOwnProperty(\"status\")) {\n for (let message of messages) {\n let new_message = this.createMessage(message);\n this.message_container.appendChild(new_message);\n }\n }\n }", "async function displayAllMessages(context, src, trg, memoryID) {\n const source = Front.buildCancelTokenSource();\n // Do not wait more than 500ms for the list of messages.\n setTimeout(() => source.cancel(), 500);\n try {\n const list = await context.listMessages(undefined, source.token);\n\n let nextPageToken = list.token\n const messages = list.results;\n\n while (nextPageToken) {\n const {results, token} = await context.listMessages(nextPageToken);\n nextPageToken = token;\n messages.push(...results);\n }\n\n let inner = messages[messages.length - 1].content.body;\n let messages_arr = inner.split(/<[^>]*>/)\n let translatedMessages = await translateAllMessages(messages_arr, src, trg, memoryID);\n let tags = inner.match(/<[^>]*>/gi);\n let translatedInner = translatedMessages[0];\n if (tags) {\n for (let index = 0; index < tags.length; index++) {\n translatedInner = translatedInner.concat(tags[index]);\n translatedInner = translatedInner.concat(translatedMessages[index + 1]);\n translatedInner = translatedInner.concat(\" \");\n }\n }\n document.getElementById(\"translatedText\").innerHTML = translatedInner;\n\n } catch (error) {\n if (Front.isCancelError(error)) {\n return; // Do nothing.\n }\n throw error;\n }\n}", "function showUserMessges (user) {\r\n var list = document.getElementById('message-list');\r\n var user = JSON.parse(localStorage.getItem(user.email));\r\n for (var msg of user.messages) {\r\n let item = document.createElement('li');\r\n if (msg.from === user.email) {\r\n createSendMessages(list, item);\r\n }\r\n else if ( msg.timeToLive > ((new Date()).getTime() - new Date(msg.timeCreated).getTime())) {\r\n createReceivedMessages(list, item);\r\n }\r\n }\r\n\r\n function createSendMessages(list, item, lastTimeStamp){\r\n \r\n item.setAttribute('class', 'right');\r\n item.setAttribute('data-timestamp', msg.timeCreated.toString());\r\n item.innerHTML = '<receiver></receiver><bubble><message><strong>'+ msg.message + '</strong></message><sender> :' + msg.from + '</sender></bibble>';\r\n list.appendChild(item);\r\n }\r\n \r\n function createReceivedMessages(list, item, ){\r\n item.setAttribute('class', 'left');\r\n item.innerHTML = '<bubble><sender>' + msg.from + ': </sender><message><strong>'+ msg.message +'</strong>' + ' Expire @' + new Date(msg.timeCreated + msg.timeToLive).getHours() + ':' + new Date(msg.timeCreated + msg.timeToLive).getMinutes() + '</message></bubble><receiver></receiver>'\r\n item.setAttribute('data-timestamp', msg.timeCreated.toString());\r\n list.appendChild(item);\r\n setTimeout( function () {\r\n list.removeChild(item);\r\n }, msg.timeToLive - ((new Date()).getTime() - new Date(msg.timeCreated).getTime())); \r\n }\r\n\r\n setInterval(function (){\r\n var curUser = JSON.parse(localStorage.getItem(user.email));\r\n var nodes = list.querySelectorAll('li');\r\n if(nodes.length === 0){\r\n return;\r\n }\r\n var lastItem = nodes[nodes.length-1];\r\n var lastTimeStamp = lastItem.getAttribute('data-timestamp');\r\n var length = curUser.messages.length-1;\r\n var index = length;\r\n for (var i = length; i >= 0; i--){\r\n if (curUser.messages[i].timeCreated > lastTimeStamp) {\r\n index--;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if (index < length) {\r\n for (; index <= length; index++) {\r\n let item = document.createElement('li');\r\n if ( curUser.messages[index].timeToLive > ((new Date()).getTime() - new Date(curUser.messages[index].timeCreated).getTime())) {\r\n if( curUser.messages[index].timeCreated <= lastTimeStamp){\r\n continue;\r\n }\r\n if(curUser.messages[index].from === curUser.email){\r\n item.setAttribute('class', 'right');\r\n item.innerHTML = '<receiver></receiver>' + '<bubble><message><strong>'+ curUser.messages[index].message +'</strong></message><sender>'+ ':' + curUser.messages[index].from + '</sender></bubble>' \r\n item.setAttribute('data-timestamp', curUser.messages[index].timeCreated.toString());\r\n list.appendChild(item);\r\n lastTimeStamp = item.getAttribute('data-timestamp');\r\n }\r\n else {\r\n item.setAttribute('class', 'left');\r\n item.innerHTML = '<bubble><sender>' + curUser.messages[index].from + ':' + '</sender>' + '<message><strong>'+ curUser.messages[index].message +'</strong>' + ' Expire @' + new Date(curUser.messages[index].timeCreated + curUser.messages[index].timeToLive).getHours() + ':' + new Date(curUser.messages[index].timeCreated + curUser.messages[index].timeToLive).getMinutes() + '</message></bubble>' + '<receiver></receiver>'\r\n item.setAttribute('data-timestamp', curUser.messages[index].timeCreated.toString());\r\n list.appendChild(item);\r\n lastTimeStamp = item.getAttribute('data-timestamp');\r\n setTimeout( function () {\r\n list.removeChild(item);\r\n }, curUser.messages[index].timeToLive - ((new Date()).getTime() - new Date(curUser.messages[index].timeCreated).getTime()));\r\n }\r\n } \r\n }\r\n }\r\n }, 2000);\r\n\r\n}", "function fetchMessages(){\n //const url = '/feed';\n fetch(url).then((response) => {\n return response.json();\n }).then((messages) => {\n const messageContainer = document.getElementById('message-container');\n if(messages.length == 0){\n messageContainer.innerHTML = '<p>There are no posts yet.</p>';\n }\n else{\n messageContainer.innerHTML = '';\n }\n messages.forEach((message) => {\n if(!message.hasOwnProperty('chat')) {\n const messageDiv = buildMessageDiv(message);\n messageContainer.appendChild(messageDiv);\n }\n });\n });\n }", "function fetchMessages() {\n let url = '/messages?user=' + parameterUsername;\n\n const parameterLanguage = defaultLanguage;\n if (parameterLanguage) {\n url += '&language=' + parameterLanguage;\n }\n\n console.log(url);\n\n fetch(url)\n .then((response) => {\n return response.json();\n })\n .then((messages) => {\n const messagesContainer = document.getElementById('message-container');\n if (messages.length == 0) {\n messagesContainer.innerHTML = '<p>This user has no posts yet.</p>';\n } else {\n messagesContainer.innerHTML = '';\n }\n\n\n var count = 0;\n\n messages.forEach((message) => {\n const messageDiv = buildMessageDiv(message);\n\n if (count !== maxMessages) {\n \tcount++;\n } else {\n \tmessageDiv.hidden = true;\n }\n\n messagesContainer.appendChild(messageDiv);\n });\n\n });\n}", "read(from, to, limit, state) {\n // Build a search expression given the options.\n let search = this.raw || '';\n\n if (this.filter_search_expr !== undefined) {\n search += ' ' + this.filter_search_expr;\n }\n\n // The gmail search expression only has per-day granularity,\n // so we quantize the -from and -to to the nearest day and do\n // additional filtering in get_messages().\n\n // XXX/mstemm not sure how the time zone is set. It's definitely not in UTC.\n search += ' after:' + JuttleMoment.format(from, 'YYYY/MM/DD', 'US/Pacific');\n\n // Add 1 day to to and then quantize to a day. This\n // results in the next day, such that the before: date is\n // always in the future.\n if (! to.isEnd()) {\n search += ' before:' + JuttleMoment.format(to.add(JuttleMoment.duration(1, 'd')), 'YYYY/MM/DD', 'US/Pacific');\n }\n\n this.logger.debug('Search string:', search);\n return this.get_messages(from, to, search)\n .call('sort', (a, b) => {\n if (a.time.lt(b.time)) {\n return -1;\n } else if (a.time.eq(b.time)) {\n return 0;\n } else {\n return 1;\n }\n })\n .then((messages) => {\n let ret = {\n points: messages,\n readEnd: to\n };\n return ret;\n });\n }", "function parseMessage(message) {\n //Delete till first line with maximum 3 words\n // First split with\n var objects = message.split(/<p>\\s*[-_]{1,}\\s*<\\/p>/);\n objects.shift();\n return jQuery.map(objects, parseFriend);\n\n}", "function hideAllMessage() {\n [].forEach.call(messages, function(message) {\n if (!message.classList.contains('msgInvisible')) {\n message.classList.add('msgInvisible');\n }\n })\n}", "function messages(state = initObj, action) {\n switch (action.type) {\n case t.getMessages_get: {\n return {\n ...state,\n isFetching: true,\n };\n }\n case t.getMessages_success: {\n return {\n ...state,\n isFetching: false,\n messages: action.payload,\n error: null,\n };\n }\n case t.getMessages_failure: {\n return {\n ...state,\n isFetching: false,\n error: action.payload,\n };\n }\n case t.getMessages_filterToggle: {\n const filterIndex = findIndex(state.filters, ({ colName }) => colName === action.payload);\n let newFilters;\n if (filterIndex !== -1) {\n const filterObj = {\n ...state.filters[filterIndex],\n ascending: !state.filters[filterIndex].ascending,\n };\n newFilters = [\n ...state.filters.slice(0, filterIndex),\n filterObj,\n ...state.filters.slice(filterIndex + 1),\n ];\n } else {\n newFilters = [\n ...state.filters,\n { colName: action.payload, ascending: true },\n ];\n }\n\n return {\n ...state,\n filters: newFilters,\n };\n }\n case t.getMessages_filterDelete: {\n return {\n ...state,\n filters: filter(state.filters, ({ colName }) => colName !== action.payload),\n };\n }\n case '@@router/LOCATION_CHANGE': {\n return initObj;\n }\n case t.getMessages_clear: {\n return initObj;\n }\n default: {\n return state;\n }\n }\n}", "loadMessages() {\n\n // request a range of messages preceeding the current index of the oldest retrieved message\n const promise = App.requests.getMessageRange(App.state.lowIndex, App.constants.LOAD_SIZE);\n promise.done(response => {\n\n // if results were returned add them to the page.\n if (response.data.length > 0) {\n if (App.state.highIndex === 0) {\n\n // if this is the first call, set the initial highest index\n App.state.highIndex = response.data[0].id;\n }\n App.dom.prependMessagesToChat(response.data);\n } else {\n\n // assume there are no older messages and disable the button.\n App.dom.disableLoader();\n }\n });\n }", "handleMessage (data) {\n console.log(data)\n if (data.type === 'message') {\n console.log('is message')\n let sender = data.username\n let listItem = document.createElement('li')\n listItem.innerText = sender + ': ' + data.data // syntax : first username then message\n this.messageList.appendChild(listItem)\n }\n }", "async function getMessagesOnOpen(){\n if(messages.length==0){\n return;\n }\n // r for reconnecting\n let rhasMore = true;\n let rnext=null;\n let rmessages = [];\n let lastMessage = messages[messages.length - 1];\n let uri;\n let index = -1;\n\n do{\n uri = rnext?rnext:`/api/branches/${member}/chat_rooms/${data.room.id}/messages/`;\n let response = await axios.get(uri);\n if(!response.data.next){\n rhasMore = false;\n break;\n }\n let newrMessages = response.data.results.reverse();\n rnext = response.data.next;\n rmessages = [...newrMessages,...rmessages];\n\n // try to find last known message before disconnect\n }while(rhasMore && rmessages.length>0 && messages.length>0 && !(index=rmessages.findIndex(m=>m.id==lastMessage.id)));\n\n // if message found slice the new messages\n rmessages = rmessages.slice(index + 1,rmessages.length);\n setMessages([...messages,...rmessages]);\n }", "function loadMessages() {\n // Create the query to load the last 12 messages and listen for new ones.\n var query = firebase.firestore()\n .collection('messages')\n .orderBy('timestamp', 'desc')\n .limit(12);\n \n // Start listening to the query.\n query.onSnapshot(function(snapshot) {\n snapshot.docChanges().forEach(function(change) {\n if (change.type === 'removed') {\n deleteMessage(change.doc.id);\n } else {\n var message = change.doc.data();\n displayMessage(change.doc.id, message.timestamp, message.name,\n message.text, message.profilePicUrl, message.imageUrl);\n }\n });\n });\n}", "function loadMessages() {\n // Create the query to load the last 12 messages and listen for new ones.\n var query = firebase.firestore()\n .collection('messages')\n .orderBy('timestamp', 'desc')\n .limit(12);\n \n // Start listening to the query.\n query.onSnapshot(function(snapshot) {\n snapshot.docChanges().forEach(function(change) {\n if (change.type === 'removed') {\n deleteMessage(change.doc.id);\n } else {\n var message = change.doc.data();\n displayMessage(change.doc.id, message.timestamp, message.name,\n message.text, message.profilePicUrl, message.imageUrl);\n }\n });\n });\n}", "function getReceivedMessages(req, res) {\n const userId = req.user.sub;\n let page = 1;\n\n if (req.params.page) {\n page = req.params.page;\n }\n\n const itemsPerPage = 4;\n Message.find({ receiver: userId })\n .populate('emitter', 'name surname _id nick image')\n .sort({created_at: 'desc'})\n .paginate(page, itemsPerPage, (err, messages, total) => {\n if (err)\n return res.status(500).send({ message: 'Error en la petición.' });\n if (!messages)\n return res.status(404).send({ message: 'No hay mensajes.' });\n return res.status(200).send({\n total,\n pages: Math.ceil(total / itemsPerPage),\n messages\n });\n });\n}", "constructor () {\n this.messages = []\n }", "function getMessages (cb, data) {\n var req = GETRequest(`http://ec2-54-66-246-123.ap-southeast-2.compute.amazonaws.com/brian/src/public/client/${data.JAID}/messages`)\n\n req.onreadystatechange = function () {\n if (req.readyState === 4 && req.status === 200) {\n var obj = JSON.parse(req.responseText)\n cb(obj)\n } else if (req.status !== 200) {\n // do something\n }\n }\n}" ]
[ "0.7184745", "0.70755327", "0.6901593", "0.6598752", "0.6376389", "0.63663375", "0.6323981", "0.62957156", "0.6265196", "0.62555665", "0.6243934", "0.62256247", "0.6216996", "0.6195781", "0.61940604", "0.6169644", "0.6131701", "0.61117643", "0.6097445", "0.60845214", "0.60774547", "0.6064185", "0.6060784", "0.60380507", "0.6036989", "0.60295665", "0.6020362", "0.6001476", "0.59826064", "0.5958296", "0.5947988", "0.5940166", "0.5936376", "0.59132725", "0.5904328", "0.5902212", "0.5900745", "0.5900745", "0.5900745", "0.5900745", "0.5900745", "0.58844775", "0.58741605", "0.58543915", "0.58524626", "0.5847668", "0.58463585", "0.5841695", "0.5838935", "0.5834579", "0.58329165", "0.5818756", "0.5813265", "0.5798347", "0.5796018", "0.5790697", "0.5790697", "0.57899046", "0.5789402", "0.57796705", "0.57781166", "0.57751304", "0.57703245", "0.5736054", "0.572344", "0.57143265", "0.56971055", "0.5688389", "0.5661658", "0.5660871", "0.5650444", "0.5647942", "0.5645067", "0.56313026", "0.56304055", "0.56289434", "0.56247014", "0.5624404", "0.5623525", "0.56224394", "0.5620074", "0.5619296", "0.56170934", "0.56168455", "0.5603409", "0.56018025", "0.5596721", "0.5583512", "0.5581583", "0.55714697", "0.55677545", "0.556321", "0.55593485", "0.5556588", "0.5542743", "0.5542743", "0.5536897", "0.55346465", "0.553106" ]
0.572753
65
This is server side code
function addNumber(a, b) { return a + b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nlobjServerResponse() {\n}", "async index({request, response}) {\r\n\r\n\t\t\r\n\t}", "ServerCallback() {\n\n }", "function handleServerRequest()\n{\n\t//send data to the div or html element for notifications\n}", "function onRequest(context) {\n \tif (context.request.method === 'GET') \n \t{ \n\t\t\tform = DrawPage(context);\n\t\t\tform.Title = 'Taskinator Workspace';\n\t\t\t\n\t\t\t//if(runtime.getCurrentUser().id==PutNumberHere)\n\t\t\t// Folder as container is SuiteScripts > SST_NearNet_Building_List\n\t\t\tform.clientScriptFileId = 6512313; \n\t\t\t//else\n\t\t\t//\tform.clientScriptFileId = AnytherIDHere;\t\t\t\n \t\tcontext.response.writePage(form);\t\n }\n }", "function main() {\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\tif (gvMethod === \"MAP\") {\n\t\t\t\t//Perform The Mapping between In and Out\n\t\t\t\ttry {\n\t\t\t\t\t_mapInToOut();\n\t\t\t\t} catch (errorObj) {\n\t\t\t\t\tgvStatus = \"Error during mapping IN to OUT:\" + errorObj.message;\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\t\tresult: gvErrorMessage,\n\t\t\t\t\t\tstatus: gvStatus,\n\t\t\t\t\t\ttableUpdates: gvTableUpdate\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// \t\t} else if ($.request.method === $.net.http.GET) {\n\t\t// \t\t\t//Read Entries from the Table\n\t\t// \t\t\ttry {\n\t\t// \t\t\t\t_getEntries();\n\t\t// \t\t\t} catch (errorObj) {\n\t\t// \t\t\t\t$.response.status = 200;\n\t\t// \t\t\t\t$.response.setBody(JSON.stringify({\n\t\t// \t\t\t\t\tmessage: \"API Called\",\n\t\t// \t\t\t\t\tresult: gvErrorMessage\n\t\t// \t\t\t\t}));\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t}", "function getDataFromServer()\r\n{\r\n var html = '読み込み中………… ' + '<img src=\"' + UrlConfig.StaticUrl + '/admin/img/photoeffect/loading.gif\">';\r\n $('divUserList').update(html);\r\n $('mixiapps_admin').scrollTo();\r\n}", "function onPostSuccess(data,status)\n {\n\t\t\tconsole.log(\"Server status (POST): \" + status);\n }", "function requestServerData()\n {\n sendCommand(\"JSON.stringify(Module_GetLastDataNative('\" + pageInstance.aliases.join(\"','\") + \"'));\", handleServerData);\n }", "function senGuiData()\n{\n\tvar datasend={\n\t\tevent:\"guidata\"\n\t}\n\tqueryDataGet(\"php/api_process.php\",datasend,function(res){\n\t\t//nhan du lieu tu server tra ve\n\t\talert_info(res);\n\t});\n\tqueryDataPost(\"php/api_process_post.php\",datasend,function(res){\n\t\t//nhan du lieu tu server tra ve\n\t\talert_info(\"Post:\"+res);\n\t});\n}", "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.GET) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"GET is not supported, perform a POST to add Entries\"\n\t\t\t}));\n\t\t} else {\n\t\t\t//Perform Table Entry to be created in Table\n\t\t\ttry {\n\t\t\t\tif (gvGuid) {\n\t\t\t\t\t_createEntries();\n\t\t\t\t}\n\t\t\t} catch (errorObj) {\n\t\t\t\tgvTableUpdate = \"Error during table insert:\" + errorObj.message;\n\t\t\t}\n\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tTableUpdateStatus: gvTableUpdate\n\t\t\t}));\n\t\t}\n\t}", "function __FIXME_SBean_server_echo() {\n\tthis._pname_ = \"server_echo\";\n\t//this.stamp:\t\tint32\t\n}", "function handleServerResponse(data){ \n let dictionary = getCurrentDictionary();\n console.log(\"25555\", dictionary);\n if (data.success){\n appendNewEmployee(data.employee);\n cleanInputFields();\n $(\"input[name='CIN']\").focus();\n showSuccessMessage(dictionary[\"SAVED_SUCCESS\"]);\n } else {\n let message = dictionary[\"ERROR_WHILE_PROCESSING\"];\n if (data && data.error) message = data.error.message;\n if (message.includes(\"CIN\")){\n message = dictionary[\"CIN_ALREADY_USED\"];\n $(\"input[name='CIN']\").val('');\n }\n showErrorMessage(message); \n }\n }", "function XHRSyncLayer() {\n\n}", "function doSomethingAfterRendering(){\n displayLoading() // 로딩화면 보여주기\n fetchServer(); // 서버에서 데이터 가져오기\n }", "function index(req, res) {\n \n}", "function serverhundeler (req, res,next) {\n console.log('serverHandler');\n ip\n .create(req.body)\n .then((ip) => {\n console.log('this is newserver ip',ip);\n \n \n res.json('true'); \n })\n .catch((err) => next(err));\n}", "function requestServer(number) {\n \t \t//alert('Server Request startet');\n var lastName = $('input.lastName');\n var firstName = $('input.firstName');\n var requestUrl;\n //validate form-fields:\n if(pndFormCheck(number)) {\n \t// create requestURL:\n \trequestUrl = 'https://alkyoneus.hbz-nrw.de/gnd/gndrequest.jsp?firstName=' + firstName[number].value + \"&lastName=\" + lastName[number].value + '&index=' + number;\n \t \t//requestUrl = 'include.html';\n \t//requestUrl = 'pom.xml';\n \t\n \tvar options = {\n \t\t\ttype: 'GET',\n \t\t\turl: requestUrl,\n \t\t\tdataType: 'xml text',\n \t\t\t\n \t\t\tsuccess: (function (data, textstatus, jqxhr){\n \t\t\t\tresponse = jqxhr.responseXML;\n \t\t\t\t\n \t\t\t\tjQuery('div.resultarea').append(response + '<p>Hallo</p>');\n \t\t\t\talert('Anfrage geht ' + response);\n \t\t\t})\n \t\t\n \t\t}\n \n \t//jQuery.ajax('include.txt');\n \talert('starte Anfrage');\n \t\n \tjQuery.ajax(options);\n \t\n \t\n \t//alert('hinter der Anfrage');\n \t/*$.ajax({\n \t\t url: 'include.txt',\n \t}).done(function(html){\n \t\talert('result: ' + html);\n \t});*/\n \t//var inp = jQuery('.resultarea');\n \t//inp.append('<p>huhu</p>');\n }\n\t }", "function processResponse(){\n //\n }", "function GET(){\n \n}", "function XHRSyncListLayer() {\n\n}", "function main(){\n\ttry {\n\t\tsql.openConnection();\n\t\thandleRequest({\n\t\t\t\"POST\": handlePost\n\t\t});\n\t}\n\tcatch (e) {\n\t\tif (!httpStatus) {\t\t\t\n\t\t\thttpStatus = $.net.http.BAD_REQUEST;\n\t\t\t$.response.contentType = \"text/plain\";\n\t\t\t$.response.setBody(e.toString());\n\t\t}\n\t}\n\tfinally {\n\t\tsql.closeConnection();\n\t\t$.response.status = httpStatus || $.net.http.BAD_REQUEST;\n\t}\n}", "function arrancaServidor(requiere, respuesta) {\n console.log(\"Alguien se ah conectado\");\n respuesta.writeHead(200,{\"Content-Type\":\"text/html\"}); // le digo que le enviare informacion de tipo html al servidor\n respuesta.write(\"<h1>El servidor funciona correctamente en el puerto 8888</h1>\");\n respuesta.end();\n}", "responseHandler(res, retObj) {\n const outString = JSON.stringify(retObj)\n res.writeHead(retObj.error? 500:200, {\n 'Access-Control-Allow-Origin': this.acao,\n 'Content-Length': Buffer.byteLength(outString, 'utf8'),\n 'Content-Type': 'application/json;charset=utf-8'\n })\n res.end(outString)\n }", "function arrancaServidor (requiere,respuesta){\r\n\r\nrespuesta.writeHead('200',{'Content-Type':'text/html'}); // enviar una head al navegador web\r\n\t\t\t\t\t\t\t // 200 codigo de todo correcto 404 no encontrada\t\r\n\t\t\t\t\t\t\t \t// todo lo que va dentro de llaves es un objeto\r\n\t\t\t\t\t\t\t \t// te voy a enviar una pagina escrita en html... no una imagen o otra cosa\r\n\r\nrespuesta.write(\"<h1> el servidor functiona correctamente </h1>\");\r\nrespuesta.end();\r\n\r\n}", "function connectToServer() {\n\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\txhr.open('GET','http://127.0.0.1:5000');\n\t\t\t\txhr.onload = function() {\n\t\t\t\t\tif(this.status === 200) {\n\t\t\t\t\t\tconsole.log(this.responseText)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\txhr.send();\n\t\t\t}", "function POST(){\n \n}", "function festivosProcessData(serverData) {\n processData(serverData);\n }", "function postRESTlet(datain) {\n\n}", "function indexEjsHandler(req, res) {\r\n console.log('////////////////////////// FUNCTION LOAD //////////////////////////')\r\n\r\n // pokiData.forEach( data => {\r\n // sortedPoki.push(data.name);\r\n // sortedPoki.sort();\r\n // });\r\n\r\n // res.render('pages/show', {pokiOBJ: sortedPoki});\r\n res.render('pages/index', {cards: redBeltCard});\r\n}", "function call_server() {\n if (self.vue.chosen_magic_word === null) { \n console.log(\"No Magic Word\");\n setTimeout(call_server, call_interval);\n } else {\n //removed random delay to avoid synchronizations cause fuck that. &edit&\n //var extra_delay = Math.floor(Math.random() * 1000);\n console.log(\"Yo server what's good? | call_server()\");\n $.ajax({ //server call via ajax\n dataType: 'json',\n url: server_url +'read',\n //added BRAINBLAST to key so I don't run into your games.\n data: {key: \"BRAINBLAST\"+ self.vue.chosen_magic_word},\n success: self.process_server_data,\n complete: setTimeout(call_server, call_interval) // rm extra delay\n });\n }\n }", "function requestServerPHPView(pass, request, response){\n\tcontroller.getData(pass)\n\t.then((data)=>{\n\t\tresponse.status(200).send({mensaje: data});\n\t})\n\t.catch((error)=>{\n\t\tresponse.status(500).send({error: error});\n\t});\n}", "handleGenerateServer(event) {\n //transform service model (PIM) to GraphQL model (PSM)\n var gqlModel = ModelTransformer.transformToGraphQLModel(this.serviceModel);\n\n //transform from GraphQL model to code\n CodeGenerator.generateServer(gqlModel);\n event.preventDefault();\n }", "function serverStatus() {\n ajax = ajaxObj();\n ajax.onreadystatechange = function() {\n if (this.responseText != \"OK\") {\n pimShowError(this.responseText); \n }\n };\n ajaxGet(ajax, serverStatusURL()); \n}", "function proccedtoCreateServer()\n{\n var erroredLines=[1,2,3];\n var resultJSONarray = [];\napp.get('/', (req,res) => {\nres.send('Good evening, Mr.Hunt \\n You have to deal with '+erroredLines.length+'errors Should you choose to accept it?');\n});\n\napp.get('/json',(req,res) => {\n console.log(__dirname);\n res.send(resultJSONarray);\n});\n\napp.get('/html',(req,res) => {\n console.log(__dirname);\n res.sendFile(__dirname+'/index.html');\n});\n\n(async () => {\navailablePort = await getPort({port:[8000,8080,8888,9090]});\nconsole.log(chalk.blue('The available port is',availablePort));\nstartListening();\n}) ();\n\nstartListening = function(){\n //spinner.stop(true);\napp.listen(availablePort, ()=>console.log(chalk.green('Server succesfully listening on the port :',availablePort)));\n\n//opn('http://localhost:'+availablePort);\n};\n}", "function gestionServer()\n{\n\tlet myClient = MyClient.getInstance()\n\tmyClient.onReady().then(async() =>\n\t{\n\t\tclient = myClient.client\n\t\tloggedAccount = client.user\n\t\tobjActualServer = new actualServer()\n\t\tchooseServer()\n\n\t})\n}", "function _processRequestPOST(req, res){\n\t\t\n\t}", "function sendToFrontEnd(dp){\n colorLib.incToTrafficDB();\n res.send(dp);\n }", "update(req, res) {\n logging.logTheinfo(\"widgets index Router\");\n res.status(200).send(\"update\");\n\n }", "GET() {\n }", "print(request, response) {\n let repoSeller = new repoSellers();\n // console.log('ici 3')\n repoSeller.getallSellersinMyBdd().then(allSellersinMyDbb => {\n // on place allSellersinMyDbb qui est un un tableau comme variable a utilisé dans pug dans le rendu de la repose : { allSellersinMyDbb }\n // C'est ici qu on refere le chemin de la vue liste_homeview \n response.render('home', { allSellersinMyDbb });\n });\n }", "function callLabServer() {\n\n\n removeOptionSelected(dataSourceClientID);\n var oSelField = document.getElementById(dataSourceClientID);\n var elOptNew = document.createElement('option');\n elOptNew.text = \"...Fetching DataSources...\";\n elOptNew.value = 0;\n try {\n oSelField.add(elOptNew, null); // Other browsers\n }\n catch (ex) {\n oSelField.add(elOptNew);\n }\n\n\n var urlAppend = \"FormRequest/GetVolumes?request=\";\n var root = window.location\n\n var re = new RegExp('^(?:f|ht)tp(?:s)?\\://(.*?)/(.*?)/', 'im');\n var mat = root.toString().match(re)[0];\n\n var Url = mat + urlAppend + lab;\n //alert(Url);\n\n xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = ProcessRequestLab;\n xmlHttp.open(\"GET\", Url, true);\n\n xmlHttp.send(null);\n\n}", "function handleRequestOne(request, response) { //whats the request? req to the url.\n//\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"You are a javascript wizard! \" + request.url);\n} //creates the strung & sends it back to the browser.", "device(req, res) {\n\n }", "function loadParamsFromServer() {\n\t\t\t\tvar paramArea = this;\n\t\t\t\tvar $this = $(this);\n\t\t\t\tvar componentId = $this.attr('componentId');\n\t\t\t\tvar entryId = $(this).attr('entryId');\n\n\t\t\t\tCREEDO.core.requestData(componentId, entryId, function(result) {\n\t\t\t\t\tPARAMETERS.renderParameters($this, result);\n\t\t\t\t});\n\t\t\t}", "function requestServerStat() {\n\t\t\t\tvar infoContainers = $('.serverInfoContainer');\n\t\t\t\tfor(var index = 0; index< infoContainers.length; index++){\n\t\t\t\t\tvar request = new InfoRequest(infoContainers[index]);\n\t\t\t\t\trequest.request();\n\t\t\t\t\trequest.startInterval();\n\t\t\t\t}\n\t\t\t}", "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"POST is not supported, perform a GET to read the Account Type Amounts by Company Code\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t//Calculate Values\n\t\t\t\tvar records = getEntries();\n\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\tdata: records\n\t\t\t\t}));\n\n\t\t\t} catch (err) {\n\t\t\t\t$.trace.error(JSON.stringify({\n\t\t\t\t\tmessage: err.message\n\t\t\t\t}));\n\t\t\t\t$.response.status = 200;\n\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\terror: err.message\n\t\t\t\t}));\n\t\t\t}\n\t\t}\n\t}", "create(req, res) {\n\n\t}", "static serve() {\n\n const express = require('express'); // from NPM: express web server framework\n // for docs on express, see https://expressjs.com/en/api.html\n\n const favicon = require('express-favicon'); //from NPM: for automatic handling of favicon request\n\n const app = express(); // init the framework\n\n let mongoose = require('mongoose'); // From NPM: MongoDB API for NodeJS\n\n // ****** NOTE THIS WILL FAIL IF MONGOD.EXE IS NOT RUNNING or the db does not exist. ******\n let connection = mongoose.connect('mongodb://localhost/bustracker', {useNewUrlParser: true});\n\n // A schema describes the format/structure of the documents in a collection\n let busSchema = new mongoose.Schema(\n {\n 'rt': String,\n 'vid': String,\n 'spd': String,\n 'tmstmp': String,\n 'lat': String,\n 'lon': String\n }\n );\n\n // This creates the \"contacts\" collection and associates it with the above schema.\n // Note: Whatever name you use for the collection, mongo pluralizes it automatically.\n let busmodel = mongoose.model('Bus', busSchema);\n\n let server = app.listen(3000, function () { // start the server\n let host = server.address().address;\n let port = server.address().port;\n console.log('Express server running from host ' + host + ' on port ' + port);\n });\n\n // // Tell express-favicon where to find the icon file\n app.use(favicon(__dirname + '/webcontent/favicon.ico'));\n\n\n // // Route for any static file within the webcontent folder\n app.use(express.static(__dirname +'/webcontent') ); // the folder to use to get static files (e.g. index.html)\n\n // Use this to allow Ajax requests to be honored from any origin\n app.use(function(req, res, next) {\n res.header(\"Access-Control-Allow-Origin\", \"*\");\n next();\n });\n\n app.get('/', function(req, res){\n res.sendFile('BusTrackerMQ.html', { root: __dirname + \"/webcontent\" } );\n });\n\n // Route for the url localhost:3000/BusInfo\n app.get('/BusSpeed', function(request, response) {\n let url = require('url');\n let urlObject = url.parse(request.url, true);\n let speed = '';\n if (urlObject.query['spd']) {\n speed = urlObject.query['spd'];\n }\n\n busmodel.find({'spd': {$gte: speed}}, function(err, records) {\n if (err !== null) {\n console.error(err); // log an error if one occurs\n } else {\n // NOTE that records is a Javascript object\n //console.info(JSON.stringify(records));\n response.json(records);\n }\n // mongoose.disconnect(); // do this when you don't need to use the db anymore\n });\n\n });\n\n // Route for the url localhost:3000/BusInfo\n app.get('/BusInfo', function( request, response ) {\n let ajax = require('request'); // import the request library (downloaded from NPM) for making ajax requests\n let url = require('url'); // used for parsing request urls (in order to get params)\n let urlObject = url.parse(request.url,true); // see https://nodejs.org/api/url.html\n let route = '';\n if( urlObject.query[\"rt\"] ) { // check for the existence of a specific parameter\n route = urlObject.query[\"rt\"];\n }\n let key = ''; // default key. Get the real one (yours) from the 'key=XXXXX' request param\n if( urlObject.query[\"key\"] ) { // check for the existence of a specific parameter\n key = urlObject.query[\"key\"];\n }\n\n if (route === '1003') {\n key = 'dfj02fj2';\n }\n let uri = \"http://realtime.ridemcts.com/bustime/api/v2/getvehicles?key=\"+ key + \"&rt=\" + route + \"&format=json\";\n\n // the default JSON response (same as asking for route 1000)\n let busData = {\"status\":\"Server Error; IOException during request to ridemcts.com: Simulated server error during request to ridemcts.com\"}; // the default JSON response\n\n if( route === '1000') { // simulate MCTS server error...\n response.json(busData); // note that this sends the above default JSON response\n return;\n } else if( route === '1001' ) { // for routes 1001, 1002, 1003, simulate error conditions and generate appropriate JSON/HTTP responses (like sapphire does)\n response.writeHead(404, {\"Content-Type\": \"text/html\"});\n response.end();\n return;\n } else if( route === '1002' || route === '' || key === '') {\n busData = {\"status\":\"Key or route parameter empty\"};\n response.json(busData);\n return;\n }\n\n // if no \"bad\" routes are detected above, make the real ajax call to MCTS\n ajax(uri, function( error, res, body ) {\n if( !error && res.statusCode === 200 ) { // no errors and a good response\n // parse the body (a JSON string) to a JavaScript object\n busData = JSON.parse(body);\n }\n // Note: if a failure occurs, the default response above should be sent here\n response.json(busData); // no need to set content-type! Express handles it automatically\n });\n });\n }", "sendDataToServer() {\n var data = this.state.dataFromFile;\n request\n .post('/')\n .set('Accept', /application\\/json/)\n .send({ data: data })\n .end((err, res) => {\n if (err) {\n console.log('Some error occured while sending ...' + err);\n return;\n }\n //if data successfully posted to server...alert back user confirmation message\n if (res) {\n alert('Data sent to server...check server console for JSON..');\n alert(res.text);\n }\n });\n }", "function render() {\n\n\t\t\t}", "function deliverWebPage(req, res){\n p_renderPage(req, res, 'Create a Service Object...');\n }", "function ListenServer (){\r\n kango.console.log (\"Listen\");\r\n var allcookie = document.cookie.split(\";\");\r\n kango.console.log (\"Lenght\",allcookie.length-1);\r\n for (i=0;i < allcookie.length-1;i++)\r\n { \r\n\r\n if (allcookie[i].split('=')[0] == \" BAseURI\")\r\n {var BAseURI = decodeURIComponent(allcookie[i].split('=')[1])}\r\n if (allcookie[i].split('=')[0] == \"TraceName\")\r\n {var TraceName = allcookie[i].split('=')[1]}\r\n if (allcookie[i].split('=')[0] == \" Model_URI\")\r\n {var Model_URI = decodeURIComponent(allcookie[i].split('=')[1])}\r\n }\t\r\n if ( (BAseURI) && (TraceName) && (Model_URI) )\r\n {\r\n Trace_Information ={TraceName:TraceName,BaseURI:BAseURI,ModelURI:Model_URI};\r\n kango.dispatchMessage('TraceInfo',Trace_Information);\r\n var encoded_trace_uri = encodeURIComponent(Trace_Information.BaseURI+Trace_Information.TraceName+\"/\");\r\n var URL = \"http://dsi-liris-silex.univ-lyon1.fr/fderbel/Assistant-Samo-Trace-Me/Index.php?mode=utilisateur&&page=TraceView&trace_uri=\"+encoded_trace_uri ;\r\n // window.open(URL,\"assistant\",\"menubar=no, status=no, scrollbars=no, menubar=no, width=800, height=400\");\r\n kango.dispatchMessage('OpenAssist',URL); \r\n \r\n }\r\n}", "function ajaxCommon(phpFileName, outPutStage){\n\t\t\t //if(navigator.onLine){\n \t\t\t\t\t//alert(\"Loading\");\n\t\t\t\t\tvar xmlhttp = new XMLHttpRequest();\n \t\t\txmlhttp.onreadystatechange = function() {\n \t\t\tif (this.readyState === 4 && this.status == 200) {\n \t\t\t\tdocument.getElementById(outPutStage).innerHTML = this.responseText;\n\t\t\t\t\t\t//alert(\"loading complete\");\n \t\t\t\t}\n \t\t\t};\n \t\t\txmlhttp.open(\"GET\", phpFileName, true);//generating get method link\n \t\t\txmlhttp.send();\n \t\t\t\t//}\n\t\t\t//else {\n \t\t\t\t//alert('offline');\n \t\t\t\t//}\n\t\t\t\n}", "process(req, res){}", "function js (req,res,next) {\n\tstream = fs.createReadStream(\"clientSide.js\").pipe(res);\n}", "show(req, res) {\n logging.logTheinfo(\"widgets show Router\");\n res.status(200).send(\"show\");\n\n }", "function HeadValueSend2Server(){\r\n\t\tlocalStorage.setItem(\"TreeParent\", \"null\");\r\n\t\tvar db = window.openDatabase(\"Spine\", \"1.0\", \"Spine Demo\", 100 * 1024 * 1024);\r\n\t\tdb.transaction(Server_Head, errorCB);\r\n\t\tfunction Server_Head(tx) {\r\n\t\t\ttx.executeSql('SELECT * FROM LOGI_T_MEASURE_HEAD ', [], function (tx, results) {\r\n\t\t\t\tvar headData = [];\r\n\t\t\t\tvar Headlength = results.rows.length;\r\n\t\t\t \t \r\n\t\t\t \t var len = headData.length;\r\n\t\t\t\t var headLengthCount=0;\r\n\t\t\t \t for (var i=0; i<len; i++){\r\n\t\t\t\t\t headLengthCount++;\r\n\t\t\t \t\tvar headPush = headData[i];\r\n\t\t\t \t\tvar currentDate = moment();\r\n\t\t \t\t\tvar Today = moment(currentDate).format('DD-MMM-YYYY');\r\n\t\t \t\t\t//alert(\"Today->\"+Today);\r\n\t\t \t\t\theadPush.MH_TXN_DT=Today;\r\n\t\t\t \t\t//alert(\"Date->\"+headPush.MH_TXN_DT);\r\n\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\ttype: \"POST\",\r\n\t\t\t\t\t url: \"http://test.sedarspine.com/en/spineLogisticsApp/MeasurementTransactionHead_Local2Server\",\r\n\t\t\t\t\t data : {\"headData\":headPush},\r\n\t\t\t\t\t dataType:'json',\r\n\t\t\t\t\t async: false,\r\n\t\t\t\t\t success: function (json){\r\n\t\t\t\t\t\tlocalStorage.setItem(\"SYS_ID\", json.system_id);\r\n\t\t\t\t\t\tvar HeadId = headPush.SYS_ID;\r\n\t\t\t\t\t\t//alert(\"Haed Intial Id\"+HeadId)\r\n\t\t\t\t\t\tvar LineReId = json.system_id;\r\n\t\t\t\t\t\t//alert(\"H msg->\"+json.error_message);\r\n\t\t\t\t\t\t//alert(\"Head Id for Tree\"+LineReId);\r\n\t\t\t\t\t\ttx.executeSql('UPDATE LOGI_T_MEASURE_TREE SET MT_MH_SYS_ID =? WHERE MT_MH_SYS_ID =?', [LineReId,HeadId], function (tx, results) {\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tvar NewHeadId = json.system_id;\r\n\t\t\t\t\t\ttx.executeSql('SELECT * FROM LOGI_T_MEASURE_TREE WHERE MT_MH_SYS_ID = ?', [NewHeadId], function (tx, results) {\r\n\t\t\t\t\t\t\t\tvar TreeDataValue = [];\r\n\t\t\t\t\t\t\t\tvar Treelength = results.rows.length;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfor (var i=0; i <Treelength; i++){\r\n\t\t\t\t\t\t\t\t\tvar row = results.rows.item(i);\r\n\t\t\t\t\t\t\t\t\tvar MT_PARENT_SYS_ID=null;\r\n\t\t\t\t\t\t\t\t\tvar TreeData = {MT_MH_SYS_ID:row.MT_MH_SYS_ID ,MT_COMP_CODE:row.MT_COMP_CODE ,MT_SYS_ID:row.MT_SYS_ID ,MT_DESC:row.MT_DESC ,MT_PARENT_SYS_ID:MT_PARENT_SYS_ID ,MT_LEVEL_ID:row.MT_LEVEL_ID ,MT_LEVEL_TYPE:row.MT_LEVEL_TYPE ,MT_BUILD_TYPE:row.MT_BUILD_TYPE ,LANG_CODE:row.LANG_CODE ,USER_ID:row.USER_ID};\r\n\t\t\t\t\t\t\t\t\tTreeDataValue.push(TreeData);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tvar len = TreeDataValue.length;\r\n\t\t\t\t\t\t\t\tfor(var i=0; i<len;i++){\r\n\t\t\t\t\t\t\t\t\tvar TreeData = TreeDataValue[i];\r\n\t\t\t\t\t\t\t\t\t//alert(\"Tree Level->\"+TreeData.MT_LEVEL_ID);\r\n\t\t\t\t\t\t\t\t\t//alert(\"Tree Type->\"+TreeData.MT_LEVEL_TYPE);\r\n\t\t\t\t\t\t\t\t\tif(i!=0){\r\n\t\t\t\t\t\t\t\t\t\tvar MT_PARENT_SYS_ID = localStorage.getItem(\"MT_PARENT_SYS_ID\");\r\n\t\t\t\t\t\t\t\t\t\tTreeData.MT_PARENT_SYS_ID = MT_PARENT_SYS_ID;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t//var TypeID = localStorage.getItem(\"Data_level_id\");\r\n\t\t\t\t\t\t\t\t\t//alert(\"Type->\"+TypeID);\r\n\r\n\t\t\t\t\t\t\t\t\tif(TreeData.MT_LEVEL_ID==6){\r\n\t\t\t\t\t\t\t\t\t\tvar NewWindowType = localStorage.getItem(\"WindowTypeLocal\");\r\n\t\t\t\t\t\t\t\t\t\t//alert(\"NewWindowType->\"+NewWindowType);\r\n\t\t\t\t\t\t\t\t\t\tTreeData.MT_LEVEL_TYPE=NewWindowType;\r\n\t\t\t\t\t\t\t\t\t\t//alert(\"Win Type Select\"+TreeData.MT_LEVEL_TYPE);\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\tTreeData.MT_LEVEL_TYPE=null;\r\n\t\t\t\t\t\t\t\t\t\t//alert(\"else\"+TreeData.MT_LEVEL_TYPE);\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t// if(TreeData.MT_LEVEL_ID==6){\r\n\t\t\t\t\t\t\t\t\t// \tvar n = TreeData.indexOf(\"MT_LEVEL_TYPE\");\r\n\t\t\t\t\t\t\t\t\t// \talert(n);\r\n\t\t\t\t\t\t\t\t\t// \talert(\"Win Type Select\");\r\n\t\t\t\t\t\t\t\t\t// }\r\n\t\t\t\t\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\t\t\t\t\ttype: \"POST\",\r\n\t\t\t\t\t\t\t\t\t url: \"http://test.sedarspine.com/en/spineLogisticsApp/LOGI_T_MEASURE_TREE\",\r\n\t\t\t\t\t\t\t\t\t data : {\"TreeData\":TreeData},\r\n\t\t\t\t\t\t\t\t\t dataType:'json',\r\n\t\t\t\t\t\t\t\t\t async: false,\r\n\t\t\t\t\t\t\t\t\t\tsuccess: function (json){\r\n\t\t\t\t\t\t\t\t\t\t\t//alert(JSON.stringify(json));\r\n\t\t\t\t\t\t\t\t\t\t\tif(json.error_message==\"Success\"){\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar MT_PARENT_SYS_ID = json.pSysId;\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar previousParent=MT_PARENT_SYS_ID;\r\n\t\t\t\t\t\t\t\t\t\t\t\tlocalStorage.setItem(\"MT_PARENT_SYS_ID\", MT_PARENT_SYS_ID);\r\n\t\t\t\t\t\t\t\t\t\t\t\tlocalStorage.setItem(\"TreeParent\", \"New\");\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\ttx.executeSql('SELECT * FROM LOGI_T_MEASURE_TREE WHERE MT_MH_SYS_ID = ? AND MT_LEVEL_TYPE = ?', [NewHeadId,'6'], function (tx, results) {\r\n\t\t\t\t\t\t\t\tvar treeFData = [];\r\n\t\t\t\t\t\t\t\tvar treeFDatalength = results.rows.length;\r\n\t\t\t\t\t\t\t\tfor (var i=0; i < treeFDatalength; i++){\r\n\t\t\t\t\t\t\t\t\tvar row = results.rows.item(i);\r\n\t\t\t\t\t\t\t\t\t\tlocalStorage.setItem(\"ML_SYS_ID\", json.pSysId);\r\n\t\t\t\t\t\t\t\t\t\t//var MT_PARENT_SYS_ID= json.pSysId-1;\r\n\t\t\t\t\t\t\t\t\t\t//localStorage.setItem(\"MT_PARENT_SYS_ID\", MT_PARENT_SYS_ID);\r\n\t\t\t\t\t\t\t\t\t\tvar HeadId = headPush.SYS_ID;\r\n\t\t\t\t\t\t\t\t\t\tvar LineReId=localStorage.getItem(\"SYS_ID\");\r\n\t\t\t\t\t\t\t\t\t\t//alert(\"Head Id for Line\"+LineReId);\r\n\t\t\t\t\t\t\t\t\t\t\ttx.executeSql('UPDATE LOGI_T_MEASURE_LINES SET ML_MH_SYS_ID =? WHERE ML_MH_SYS_ID =?', [LineReId,HeadId], function (tx, results) {\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\ttx.executeSql('SELECT * FROM LOGI_T_MEASURE_LINES WHERE ML_MH_SYS_ID = ?', [LineReId], function (tx, results) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar lineData = [];\r\n\t\t\t\t\t\t\t\t\t\t\tvar Linelength = results.rows.length;\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var i=0; i <Linelength; i++){\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar row = results.rows.item(i);\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar ML_SYS_ID=localStorage.getItem(\"ML_SYS_ID\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar linesValue = {ML_SYS_ID:row.ML_SYS_ID ,ML_MH_SYS_ID:LineReId ,ML_COMP_CODE:row.ML_COMP_CODE ,ML_TXN_DT:row.ML_TXN_DT ,ML_LOCN_CODE:row.ML_LOCN_CODE ,ML_LINE:row.ML_LINE ,ML_BULD_TYPE:row.ML_BULD_TYPE ,ML_BUILD:row.ML_BUILD ,ML_FLOOR:row.ML_FLOOR ,ML_FLAT:row.ML_FLAT ,ML_UNIT:row.ML_UNIT ,ML_WIDTH:row.ML_WIDTH ,ML_HEIGHT:row.ML_HEIGHT ,ML_MOUNT_TYPE:row.ML_MOUNT_TYPE ,ML_MOUNT_ON:row.ML_MOUNT_ON ,ML_OPERATE:row.ML_OPERATE ,ML_CONTROL:row.ML_CONTROL ,ML_OPENING:row.ML_OPENING ,ML_PELMET:row.ML_PELMET ,ML_DESIGN_DEPTH:row.ML_DESIGN_DEPTH ,ML_PROJECTION:row.ML_PROJECTION ,ML_FASICA:row.ML_FASICA ,ML_REMARKS:row.ML_REMARKS ,ML_CLOSE_YN:row.ML_CLOSE_YN ,ML_OP_HEAD_SYS_ID:row.ML_OP_HEAD_SYS_ID ,ML_SC_LINE_SYS_ID:row.ML_SC_LINE_SYS_ID ,ML_FULL_WIDTH:row.ML_FULL_WIDTH ,ML_FULL_HEIGHT:row.ML_FULL_HEIGHT ,ML_LEFT_WALL:row.ML_LEFT_WALL ,ML_RIGHT_WALL:row.ML_RIGHT_WALL ,ML_CEILING_UP:row.ML_CEILING_UP ,ML_FLOOR_DOWN:row.ML_FLOOR_DOWN ,ML_WINDOW_DEPTH:row.ML_WINDOW_DEPTH ,ML_WINDOW_OPENING:row.ML_WINDOW_OPENING ,ML_HANDLE_POSITION:row.ML_HANDLE_POSITION ,ML_HANDLE_SIZE:row.ML_HANDLE_SIZE ,ML_POWER_DISTANCE:row.ML_POWER_DISTANCE ,ML_GYPSUM_YN:row.ML_GYPSUM_YN ,ML_GYPSUM_WIDTH:row.ML_GYPSUM_WIDTH ,ML_GYPSUM_HEIGHT:row.ML_GYPSUM_HEIGHT ,ML_GYPSUM_DEPTH:row.ML_GYPSUM_DEPTH ,ML_ROOM_NO:row.ML_ROOM_NO ,ML_WINDOW_NO:row.ML_WINDOW_NO ,ML_POWER_SIDE:row.ML_POWER_SIDE ,ML_SITE_READY_YN:row.ML_SITE_READY_YN ,ML_WINDOW_TYPE:row.ML_WINDOW_TYPE ,ML_DOME_HEIGHT:row.ML_DOME_HEIGHT ,ML_CORNER_DEGREE:row.ML_CORNER_DEGREE ,ML_CORVE_DEPTH:row.ML_CORVE_DEPTH ,ML_PARTITIONED_WINDOW_YN:row.ML_PARTITIONED_WINDOW_YN ,ML_NO_OF_PARTITION:row.ML_NO_OF_PARTITION ,ML_PARTITION_01_WIDTH:row.ML_PARTITION_01_WIDTH ,ML_PARTITION_02_WIDTH:row.ML_PARTITION_02_WIDTH ,ML_PARTITION_03_WIDTH:row.ML_PARTITION_03_WIDTH ,ML_PARTITION_04_WIDTH:row.ML_PARTITION_04_WIDTH ,ML_PARTITION_05_WIDTH:row.ML_PARTITION_05_WIDTH ,ML_PARTITION_06_WIDTH:row.ML_PARTITION_06_WIDTH ,ML_PARTITION_07_WIDTH:row.ML_PARTITION_07_WIDTH ,ML_PARTITION_08_WIDTH:row.ML_PARTITION_08_WIDTH ,ML_PARTITION_09_WIDTH:row.ML_PARTITION_09_WIDTH ,ML_PARTITION_10_WIDTH:row.ML_PARTITION_10_WIDTH ,LANG_CODE:row.LANG_CODE ,USER_ID:row.USER_ID};\r\n\t\t\t\t\t\t\t\t\t\t\t\tlineData.push(linesValue);\r\n\t\t\t\t\t\t\t\t\t\t\t\t//alert(JSON.stringify(lineData));\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tvar length = lineData.length;\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var i=0; i<length; i++){\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar linePushData = lineData[i];\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar currentDate = moment();\r\n\t\t\t\t\t\t\t\t\t \t\t\tvar Today = moment(currentDate).format('DD-MMM-YYYY');\r\n\t\t\t\t\t\t\t\t\t \t\t\t//alert(\"Today->\"+Today);\r\n\t\t\t\t\t\t\t\t\t \t\t\t//alert(\"old date->\"+linePushData.ML_TXN_DT);\r\n\t\t\t\t\t\t\t\t\t \t\t\tlinePushData.ML_TXN_DT=Today;\r\n\t\t\t\t\t\t\t\t\t \t\t\t//alert(\"new date->\"+linePushData.ML_TXN_DT);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype: \"POST\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\turl: \"http://test.sedarspine.com/en/spineLogisticsApp/MeasurementTransactionLines_Local2Server\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdata : {\"lineData\":linePushData},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdataType:'json',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tasync: false,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsuccess: function (json){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(\"line Id-->\"+json.linesys_id);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(\"return_status-->\"+json.return_status);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(\"error_message-->\"+json.error_message);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar HeadId = headPush.SYS_ID;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar LineReId=localStorage.getItem(\"SYS_ID\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar LinesysIdnew=json.linesys_id;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(HeadId + LineReId+\"Head Old and New Id\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar linesysid1=linePushData.ML_SYS_ID;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(\"linesys_id1\"+linesysid1);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttx.executeSql('UPDATE LOGI_T_MEASURE_IMAGE SET ML_MH_SYS_ID =?,ML_SYS_ID =? WHERE ML_MH_SYS_ID =? AND ML_SYS_ID=?', [LineReId,LinesysIdnew,HeadId,linesysid1], function (tx, results) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(\"img id upadted success\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttx.executeSql('SELECT * FROM LOGI_T_MEASURE_IMAGE WHERE ML_MH_SYS_ID = ? AND ML_SYS_ID = ?', [LineReId,LinesysIdnew], function (tx, results) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar imageData = [];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar ImageLength = results.rows.length;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (var i=0; i <ImageLength; i++){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar row = results.rows.item(i);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar imageValue = {ML_SYS_ID:row.ML_SYS_ID ,ML_MH_SYS_ID:row.ML_MH_SYS_ID ,ML_IMAGE:row.IMAGE_PATH ,USER_ID:row.USER_ID ,LANG_CODE:row.LANG_CODE , ML_COMP_CODE:row.ML_COMP_CODE};\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\timageData.push(imageValue);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(JSON.stringify(imageData));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar imgLen = imageData.length;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar countimg = 0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor( var i=0; i < imgLen; i++){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar imagePushData = imageData[i];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype: \"POST\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: \"http://test.sedarspine.com/en/spineLogisticsApp/MeasurementTransactionImage_Local2Server\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata : {\"imageData\":imagePushData},\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdataType:'json',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tasync: false,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsuccess: function (json) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(\"error_message-->\"+json.error_message);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//alert(\"return_status-->\"+json.return_status);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t });\r\n\t\t\t\t\t}//loop end\r\n\t\t\t\t\t});//ajax end\r\n\t\t\t\t\tif(headLengthCount==len){\r\n\t\t\t\t\tvar db = window.openDatabase(\"Spine\", \"1.0\", \"Spine Demo\", 100 * 1024 * 1024);\r\n\t\t\t\t\tdb.transaction(function(tx){\r\n\t\t\t\t\t\ttx.executeSql('DROP TABLE IF EXISTS LOGI_T_MEASURE_HEAD');\r\n\t\t\t\t\t\ttx.executeSql('DROP TABLE IF EXISTS LOGI_T_MEASURE_TREE');\r\n\t\t\t\t\t\ttx.executeSql('DROP TABLE IF EXISTS LOGI_T_MEASURE_LINES');\r\n\t\t\t\t\t\ttx.executeSql('DROP TABLE IF EXISTS LOGI_T_MEASURE_IMAGE');\r\n\t\t\t\t\t\tlocalStorage.removeItem(\"LocalHeadlength\");\r\n\t\t\t\t\t\talert(\"Measurement Values Are successfully Sync\");\r\n\t\t\t\t\t});\r\n\t\t\t\t }\r\n\t\t\t \t }\r\n\t\t\t});\r\n\t\t}\r\n\t\t\t\r\n\t\tfunction errorCB(tx, err) {\r\n\t\t\t//alert(\"Error\");\r\n\t\t\t//alert(\"Error processing SQL: \"+err);\r\n\t\t}\r\n\t}", "initServerSideClient() {\n this._serverSideClient = this._bayeux.getClient();\n this._serverSideClient.subscribe('/chat', (message) => {\n try {\n const msg = JSON.parse(message);\n if (msg) {\n this.events.emit('message', msg);\n }\n else {\n throw new Error('Message bad format');\n }\n }\n catch (e) {\n logger_1.logger.info(`Receive bad message : ${message}`);\n }\n });\n }", "function Index(request, response){\r\n response.writeHead(200, commonHeaders); \r\n //get json from Treehouse\r\n var studentProfile = new Profile('honggao');\r\n \r\n //on \"end\"\r\n studentProfile.on(\"end\", function (profileJSON){\r\n //show profile\r\n //Store the values which we need\r\n var values = {\r\n avatarUrl: profileJSON.gravatar_url, \r\n username: profileJSON.profile_name,\r\n badges: profileJSON.badges.length,\r\n javascriptPoints: profileJSON.points.JavaScript\r\n }\r\n //Simple response\r\n renderer.view(\"index\", values, response);\r\n response.end();\r\n });\r\n \r\n}", "function main() {\n\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tresult: \"POST is not supported, perform a GET to send out all relevant daily notifications\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t//Get the Routing Entries from the table\n\t\t\t\tvar oRoutes = getRoutes();\n\n\t\t\t\t//Perform Counts and Trigger Notifications\n\t\t\t\t_countAndSend(oRoutes);\n\n\t\t\t\t//Write to the trace\n\t\t\t\t$.trace.info(JSON.stringify({\n\t\t\t\t\tRequestedNotifications: gvRequestedProcessing,\n\t\t\t\t\tProcessedNotifications: gvProcessingCount\n\t\t\t\t}));\n\t\t\t} catch (err) {\n\t\t\t\t$.trace.error(JSON.stringify({\n\t\t\t\t\tmessage: err.message\n\t\t\t\t}));\n\t\t\t\tgvError = err.message;\n\t\t\t}\n\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tError: gvError\n\t\t\t}));\n\t\t}\n\t}", "'start' (callback) {\n //throw 'stop';\n //var resource_pool = this.resource_pool;\n\n var resource_pool = this.app_server.resource_pool;\n var server_router = this.resource_pool.get_resource('Server Router');\n // Build the client js and include that.\n // Could have been given a different client js file too.\n // By default want to provide the html client from jsgui.\n // /client/client\n\n // build the html client code.\n let js = this.app_server.resource_pool['Site JavaScript'];\n let css = this.app_server.resource_pool['Site CSS'];\n let imgs = this.app_server.resource_pool['Site Images'];\n\n\n\n // will look into the resource publisher to see what is published.\n\n // serve package with replacement options.\n // // the activate app function.\n // Can be put into place in the served JS.\n\n // with replacement option within serve_package\n\n let o_serve_package = {\n //'babel': 'mini'\n }\n\n // babel option.\n // Activation should be defined\n // Or there is some default activation in the client.js\n // It has the maps of controls and Controls\n // Then can activate these controls.\n // There should maybe be some more data services in the client.\n // Could make the client more miniature and modular once it works, and then incorporate react.\n // Data-Resource would be general enough to work on both.\n // The client data resources could then direct their requests to the server ones.\n // Could make a resource-pool for both client and server\n\n //console.log('this.activate_app', this.activate_app);\n //throw 'stop';\n\n // Should do this before the babel compilation. Think that's the sequence anyway.\n // Not sure why it's not working.\n if (this.activate_app) {\n o_serve_package.replace = {\n '/* -- ACTIVATE-APP -- */': this.activate_app.toString()\n }\n //\n }\n // want it to serve with debug code map\n // for the moment\n // want that to be easier to do with a --debug option.\n // should read command line options.\n o_serve_package.js_mode = 'mini';\n if (this.js_mode) {\n o_serve_package.js_mode = this.js_mode;\n } else {\n //o_serve_package.babel = 'mini';\n }\n // need to minify the js.\n // Also, gzip compression as standard.\n // Need HTTPS for Brotli - but want to get HTTPS working more, tested online and running.\n\n // Need to minify js, reduce file size.\n\n // Minifying currently breaks it.\n\n //o_serve_package.js_mode = 'debug';\n\n // Extra functionality for loading / serving icon files?\n // Easily available / usable named icons will be very useful within the app.\n // Could be in sprites / pre-loaded.\n\n\n\n\n // Not sure how to do the replace when loading from disk.\n // Give a reference to the package to serve itself.\n // example servers - \n // serve the css as well.\n if (this.css) {\n each(this.css, (path, serve_as) => {\n css.serve(serve_as, path);\n })\n }\n let js_client = this.client_package || this.js_client || 'jsgui3-client';\n js.serve_package('/js/app.js', js_client, o_serve_package, (err, served) => {\n //var resource_pool = this.resource_pool;\n //console.log('server_router', server_router);\n //console.log('js_client', js_client);\n if (!server_router) {\n throw 'no server_router';\n }\n var routing_tree = server_router.routing_tree;\n routing_tree.set('/', (req, res) => {\n //console.log('root path / request');\n\n const o_spc = {\n 'req': req,\n 'res': res,\n 'resource_pool': resource_pool\n }\n\n if (this.include_server_ref_in_page_context) o_spc.server = this;\n\n\n var server_page_context = new Server_Page_Context(o_spc);\n\n // and .server property?\n // a different way to get the server info to the components is needed.\n\n // Page_Bounds_Specifier\n var hd = new jsgui.Client_HTML_Document({\n 'context': server_page_context\n });\n hd.include_client_css();\n hd.include_css('/css/basic.css')\n\n if (this.css) {\n each(this.css, (path, serve_as) => {\n //css.serve(serve_as, path);\n hd.include_css('/css/' + serve_as);\n });\n }\n\n // include a js script block, having it set up the \n // not include_client_js\n\n // .include_client_config_js()\n // will get the resource config from the resource publisher.\n\n // including data on published resources in the initial html download would be very useful.\n // auto event wiring, so that controls that rely on having this data will have it available.\n\n // Want to get this to work, then greatly slim down the codebase, or at least delete comments, use some more syntactic sugar.\n\n // Calling 'publish' would be a good method.\n //console.log('this.app_server.map_resource_publishers', this.app_server.map_resource_publishers);\n //console.log('this.app_server.def_resource_publishers', this.app_server.def_resource_publishers);\n\n // a script block where we assign the resource publishers.\n // tell the client what resources are available on the server.\n\n // include a js script block.\n // jsgui.register_server_resources({...})\n // o_def\n // an object that describes how the resources are published.\n\n // app_server.def_resource_publishers\n // the urls\n // what data it provides / its schema.\n // a def from each of the publishers\n // with a schema similar to graphql?\n\n //throw 'stop';\n\n var body = hd.body;\n let o_params = this.params || {};\n Object.assign(o_params, {\n 'context': server_page_context\n });\n //console.log('o_params', o_params);\n //console.log('this.Ctrl', this.Ctrl);\n var ctrl = this.ctrl = new this.Ctrl(o_params);\n ctrl.active();\n //var ctrl2 = new jsgui.Control({});\n body.add(ctrl);\n\n let resources_script = new jsgui.script({\n context: server_page_context\n });\n // it will be a client-side function.\n\n // Should not use 'add' here.\n // it's the script content.\n\n // want to get around that escaping.\n // options escaping / escape : false\n\n hd.include_js('/js/app.js');\n\n // Would this be a place to register icons?\n\n\n const strc = new jsgui.String_Control({\n context: server_page_context,\n\n // Won't have access to the context when registering there?\n // Will need to access the client-side context.\n // Setting jsgui.context on the client-side does make sense.\n // There would only be one context per instance of jsgui on the client.\n\n // Could raise an event on jsgui, which the page_context listens to?\n // The calls need to be set up within the page_context, I think.\n\n // Could just set the def_server_resources property.\n // Then later activation with the page_context could refer to it.\n\n // setting up the def_resource_publishers\n // maybe 'resource' will be a generic term for something in some place.\n // can be non-local, but api will localise its use.\n\n text: `jsgui.register_server_resources(${JSON.stringify(this.app_server.def_resource_publishers)});`\n });\n\n resources_script.add(strc);\n body.add(resources_script);\n \n hd.all_html_render(function (err, deferred_html) {\n if (err) {\n throw err;\n } else {\n //console.log('deferred_html', deferred_html);\n var mime_type = 'text/html';\n //console.log('mime_type ' + mime_type);\n res.writeHead(200, {\n 'Content-Type': mime_type\n });\n res.end('<!DOCTYPE html>' + deferred_html, 'utf-8');\n }\n });\n });\n //console.log('pre super start');\n\n super.start(this.port, (err, res_super_start) => {\n if (err) {\n callback(err);\n } else {\n //console.log('res_super_start', res_super_start);\n this.raise('scs_ready');\n callback(null, res_super_start);\n }\n });\n });\n // console.log('this.port', this.port);\n }", "static indexGet(req, res) {\n // Set a good status\n res.status(200);\n // Set our content type out\n res.type('application/json');\n // Prepare a response object\n const pingResponse = {\n ping: 'OK',\n timestamp: Math.floor(new Date().getTime() / 1000.0),\n };\n // Respond\n res.send(JSON.stringify(pingResponse));\n }", "function sendInfo(){\n\t\tvar xHttp = new XMLHttpRequest();\n\n\t\txHttp.onreadystatechange = function(){\n\t\t\tif(this.readyState == 4 && this.status == 200 ){\n\t\t\t\tdocument.getElementById('demo3').innerHTML = this.response;\n\t\t\t\tconsole.log(xHttp.statusText);\n\t\t\t}\n\t\t};\n\n\t\txHttp.open('GET','storeData.html?fname=soni&lname=saw',true);\n\n\t\txHttp.send();\n\t}", "function changeMyDefaultView()\r\n{\r\n console.log(PlanetScale)\r\n // PrimaryStarCoords=PrimaryStarLL\r\n var celestialTrans =[PrevTransX, PrevTransY]\r\n var sendXML = \"<SEND folder='\"+FOLDER+\"' planetScale='\"+PlanetScale+\"' celestialScale='\"+StarView.k+\"' celestialRotate='\"+StarView.r+\"' celestialTranslate='\"+celestialTrans+\"' />\"\r\n\r\n var XMLFile = new XMLHttpRequest();\r\n XMLFile.open(\"POST\", \"../Change/updateDefaultView.asp\", false);\r\n XMLFile.onload = function()\r\n { var cw = changeCw\r\n if (this.status == 200)\r\n { //---OK---\r\n cw.saveDefaultViewSpan.innerHTML = \"&#10004;Saved\"\r\n DefaultViewChanged = true\r\n }\r\n if (this.status == 500)\r\n { //---Error---\r\n console.log(this.responseText)\r\n cw.saveDefaultViewSpan.innerHTML = \" Failed\"\r\n }\r\n };\r\n XMLFile.send(sendXML);\r\n\r\n\r\n}", "function setValues(){\n pageload();\n dataUpdate(UserName);\n addMenu();\n document.getElementById('ipaddress').innerHTML = '<h5>'+Ipconfig.myIpAddress()+'</h5>';\n startServer();\n refreshList();\n setInterval(refreshList,5000);\n}", "function render() {\n\t\t\t}", "function detailsGetServer(id){\n window.location.href = BASE_URL+CURR_MODULE+'?f=id&q='+id+'&page='+CURR_PAGE;\n}", "function ElstrServerRpcCallsAdmin (){}", "start()\n {\n this.app.use(\n this.bp.json(\n {\n limit: '50mb'\n }\n )\n );\n\n this.app.use(\n this.bp.urlencoded(\n {\n limit: '50mb',\n extended: true\n }\n )\n );\n\n this.server.listen(Config.WebServer.Port, () =>\n {\n Logger.info(`Server started on port: ${this.server.address().port}`);\n }\n );\n\n this.app.all('*', (req, res) =>\n {\n res.header('Access-Control-Allow-Origin', '*');\n res.header('Access-Control-Allow-Headers', 'Content-type');\n this.handleReq(req, res);\n }\n );\n }", "index(req, res) {\n\t\tres.status(200).send({status: 'live'})\n\t}", "postData() {\n throw new Error('Not implemented');\n }", "index(req,res) {\n res.json({\n msg: \"Hello Ninjutsu World!\",\n });\n }", "function call(req, res) {\n // estatutos...\n}", "async writeServerData()\n {\n const serverData = await this.getDataFromServer();\n let counter = 0;\n\n for(const input in this.inputStrcture)\n {\n console.log(input);\n document.getElementById(input.toLowerCase()).value = serverData[counter];\n counter++;\n }\n }", "sendRegistObj(context, serverSocket, data) {\n console.log(\"regist obj\")\n serverSocket.emit('sendRegistObjToServer', data)\n console.log(\"디바이스추가완료\")\n }", "function Server() {}", "function DWRUtil() { }", "_sendData() {\n\n }", "_render() {}", "function retrieveTasksServer() {\n $.ajax(\"TaskServlet\", {\n \"type\": \"get\",\n dataType: \"json\"\n // \"data\": {\n // \"first\": first,\n // \"last\": last\n // }\n }).done(displayTasksServer.bind()); //need reference to the tasksController object\n }", "__prepareServer () {\n\n\t\tthis.server.inject(`sharedLogger`, sharedLogger);\n\n\t\tthis.server.mount(`/health-check`, (req, res) => res.respond({ healthy: true, version: this.appVersion }));\n\t\tthis.server.mount(`/webview`, this.workflowManager.handleWebviewRequests.bind(this.workflowManager));\n\t\tthis.server.mount(`/track-link`, this.workflowManager.handleLinkTrackingRequests.bind(this.workflowManager));\n\t\tthis.server.mount(`/api/flow/reload-dynamic`, this.workflowManager.reloadDynamicFlows.bind(this.workflowManager));\n\n\t}", "function selectDataHandler(req,res){\nlet sql= `SELECT * FROM digi_test ;`;\nclient.query(sql).then(result=>{ // here we needed the (result ) because this function have results not like the func before because inserting process have no result \n\nres.render('pages/favorite' , {data: result.rows}) // path of favorite page to render on it \n\n})\n \n}", "function postData() {\n http.createServer(function(req, res) {\n if (req.method == 'POST') {\n var body = '';\n req.on('data', function (data) {\n body += data;\n console.log(body);\n });\n req.on('end', function () {\n console.log(\"request data complete\");\n });\n var result = '<!DOCTYPE html><html><head></head><body><script>console.info(\"message from server\")</script></body></html>';\n //var result = \"hello\";\n res.end(result);\n } else {\n res.end(\"post fail\");\n }\n\n }).listen(8100);\n}", "function onSubmitRegister(event){\r\n fetch('/register_admin',{\r\n method: 'put',\r\n headers: {\r\n 'Content-Type':'application/json',\r\n 'Accept':'application/json'\r\n },\r\n body: JSON.stringify({\r\n userName: localStorage.getItem(\"Admin\"),\r\n name: userData.name,\r\n contactNumber: userData.contactNumber,\r\n adminEmail: userData.adminEmail,\r\n adharNumber: userData.adharNumber,\r\n category: userData.category,\r\n address: userData.address,\r\n pin: userData.pin,\r\n district: userData.district,\r\n state: userData.state,\r\n timingsopen: userData.timingsopen,\r\n timingsclose: userData.timingsclose,\r\n license: userData.license,\r\n jobdescription: userData.jobdescription,\r\n visitingCharges: userData.visitingCharges\r\n })\r\n }).then(res => res.json({\r\n Message: 'Successfully send the data'\r\n })) \r\n }", "function _____SHARED_functions_____(){}", "function rootRes(req,res,next) { res.json({\"status\" : \"running\"}); return next()}", "function pythonScript(req, res) { \n\tvar spawn = require(\"child_process\").spawn; \n\tvar process = spawn('python',[\"./VolumeMeter.py\"] ); \n\tprocess.stdout.on('data', function(data) { \n\t\tsocket.write(JSON.stringify({ dataFromNetClient: data.toString(), clientid: id}));\n\t} ) \n}", "function startVIS(server, port){ \r\n\t\t\t\t\tvisserver = server; \r\n\t\t\t\t\tvisport = port;\r\n\t\t\t\t\tsetTimeout(function(){ sndReq(\"image\"); }, 100);\r\n\t\t\t\t\tsetTimeout(function(){ sndReq(\"text\"); }, 1200);\r\n\t\t\t}", "function ws_oneditprepare() {\n $(\"#websocket-client-row\").hide();\n $(\"#node-input-mode\").change(function() {\n if ( $(\"#node-input-mode\").val() === 'client') {\n $(\"#websocket-server-row\").hide();\n $(\"#websocket-client-row\").show();\n }\n else {\n $(\"#websocket-server-row\").show();\n $(\"#websocket-client-row\").hide();\n }\n });\n \n if (this.client) {\n $(\"#node-input-mode\").val('client').change();\n }\n else {\n $(\"#node-input-mode\").val('server').change();\n }\n }", "function dataUploaded() { \r\n\t // this function listens out for the server to say that the data is ready - i.e. has state 4 \r\n\t if (client.readyState == 4) { \r\n\t\t// change the DIV to show the response \r\n\t\tdocument.getElementById(\"dataUploadResult\").innerHTML = client.responseText; \r\n\t\t} \r\n\t}", "function rghResult(result) {\n // send result back to app\n res.send(result);\n }", "function dataUpload(){\r\n\t//this function listens out for the server to say that the data is ready i.e.has state 4\r\n\tif(client.readyState=4){ \r\n\t//change the div to show the response\r\n\tdocument.getElementById('dataUploadResult').innerHTML=client.responseText;\r\n\t}\r\n}", "function onGetSuccess(data,status)\n {\n\t\t\tconsole.log(\"Server status (GET): \" + status);\t\t\t\n\t\t\tif(status==\"success\" && data.hiscore)\n\t\t\t{\n\t\t\t\tconsole.log(\"Hi-score from server: \" + data.hiscore);\n\t\t\t\thiscore = data.hiscore;\n\t\t\t}\n }", "ready(){super.ready();this.addEventListener(\"ajax-response\",e=>this._loginStatus(e))}", "function senddataofindntlisttodistributorDBController(req,res){\n dbhandler.senddataofindenttodistibutorDBHandler(req,res);\n\n }", "function handleRequestTwo(request, response) { //whats the request? req to the url.\n//console.log(request.url);\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"I guess javasccript is not your forte! \" + request.url);\n} //creates the strung & sends it back to the browser.", "function handleClientLoad() \n{\n console.log(\"Libreria cargada exitosamente\");\n}", "function API(){}", "function API(){}", "_onBrokerRequest(req, res) {\n const json = req.body;\n // Find the rending location. Default to csr if not specified\n const renderingLocation = json.class && (json.class === \"ssr_session\") ?\n SpawnerTypes_1.RenderingLocation.Server : SpawnerTypes_1.RenderingLocation.Client;\n const sessionToken = json.params ? json.params.sessionToken : null;\n const modelSearchDirectories = json.params ? json.params.modelSearchDirectories : null;\n const modelFile = json.params ? json.params.model : null;\n const spawnConfig = SpawnerTypes_1.SpawnConfig.createBrokerConfig(res, renderingLocation, sessionToken, modelSearchDirectories, modelFile);\n this._spawnScServer(spawnConfig);\n }" ]
[ "0.62183964", "0.6122819", "0.5952691", "0.5828281", "0.57874674", "0.5785966", "0.57858", "0.5730429", "0.57283986", "0.56313807", "0.55977434", "0.5547084", "0.55373186", "0.5517536", "0.55062413", "0.5498267", "0.546626", "0.54585594", "0.5452792", "0.54404724", "0.54302824", "0.5426815", "0.5424576", "0.5413684", "0.54133594", "0.5406266", "0.53687817", "0.53595716", "0.5347995", "0.53434104", "0.53262997", "0.5324024", "0.5318467", "0.52979577", "0.5292706", "0.52852494", "0.5284001", "0.5282983", "0.5282149", "0.5275003", "0.526972", "0.5268336", "0.5268217", "0.5268128", "0.52659065", "0.5248647", "0.52437025", "0.52402854", "0.52344036", "0.523383", "0.52331537", "0.5223105", "0.52231014", "0.5223035", "0.5219199", "0.5218482", "0.52157843", "0.52109265", "0.5210113", "0.52073073", "0.5203116", "0.5202409", "0.52021664", "0.5197372", "0.51956433", "0.51955634", "0.51914465", "0.5190576", "0.5188293", "0.5186295", "0.518457", "0.51749223", "0.51734436", "0.517012", "0.5163947", "0.51637214", "0.5158706", "0.5157295", "0.51553124", "0.51543355", "0.51524746", "0.5151069", "0.5146464", "0.51396656", "0.51352185", "0.51278603", "0.5126056", "0.51246846", "0.5120251", "0.512006", "0.51193434", "0.5116432", "0.5114452", "0.5113753", "0.5110235", "0.5108159", "0.5107443", "0.51056886", "0.5100924", "0.5100924", "0.5099837" ]
0.0
-1
runs the given command based on the name
function runCommand(commandName,options){ /* set prompt options */ _prompts[commandName] = { name:commandName, message: options.prompt.message, type: (options.prompt.type !== undefined ? options.prompt.type : 'input'), } /* if type is list set choices option for prompt */ if(options.prompt.type === 'list' || options.prompt.type === 'checkbox'){ _prompts[commandName].choices = (typeof options.prompt.choices === 'function' ? options.prompt.choices(_values) : options.prompt.choices); } /* Run prompt command */ inquirer.prompt(_prompts[commandName]).then(method(commandName,options)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function execCommand(name) {\n var args = [].slice.call(arguments, 1);\n var kw = toKeyword(name);\n args.unshift(kw);\n return lt.objs.command.exec_BANG_.apply(lt.objs.command.command, args);\n }", "command(name) {\n return this.module.command(name);\n }", "function execute(command) {\n //passing an argument into a 'switch' function that evaluates the firts arugment ('command') to determine which function to call\n switch (command) {\n case \"my-tweets\":\n getTwitter();\n break;\n\n case \"spotify-my-song\":\n getSpotify(argument);\n break;\n\n case \"movie-this\":\n getOMBD(argument);\n break;\n\n case \"do-what-it-says\":\n getFS();\n break;\n }\n}", "function runFunctionByName(name)\n{ \n this[name](); \n}", "runCmd() {\n switch(this.command) {\n case \"concert-this\":\n this.concertThis();\n break;\n case \"spotify-this-song\":\n this.spotifyThisSong();\n break;\n case \"movie-this\":\n this.movieThis();\n break;\n case \"do-what-it-says\":\n this.doWhatItSays();\n break;\n case undefined:\n this.usage();\n return false;\n default:\n console.log(`Unable to understand the command \"${this.command}\"\\n`);\n this.usage();\n return false;\n }\n\n return true;\n }", "commandForName(name) {\n return this.commands.find(c => c.names.includes(name)) || null;\n }", "function loadCommand(name) {\n const cmd = commands[name];\n\n if (!cmd) {\n return null;\n }\n\n return {\n signature: cmd.signature,\n description: cmd.description,\n examples: cmd.examples || [],\n args: applyArgExtras(parseSignature(cmd.signature), cmd.arguments),\n options: cmd.options || [],\n hidden: !!cmd.hidden,\n run: cmd.run\n };\n }", "changeCommandName(name) {}", "function selectCommand(command){\n switch(command){\n case \"spotify-this-song\":\n spotifyCommand();\n break;\n case \"movie-this\":\n omdbCommand();\n break;\n case \"concert-this\":\n bandsInTownCommand();\n break;\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n case \"Never Mind\":\n console.log(\"\\nBye!\")\n break;\n }\n}", "function switchCommand(){\n\tswitch(command){\n\t\tcase \"my-tweets\":\n\t\t\tmyTweets();\n\t\t\tbreak;\n\t\tcase \"spotify-this-song\":\n\t\t\tspotifyThisSong(userChoice);\n\t\t\tbreak;\n\t\tcase \"movie-this\":\n\t\t\tmovieThis(userChoice);\n\t\t\tbreak;\n\t\tcase \"do-what-it-says\":\n\t\t\tdoWhatItSays();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log(\"Please enter a valid command.\");\n\t\t\tconsole.log('\"my-tweets\", \"spotify-this-song\", \"movie-this\", \"do-what-it-says\"');\n\t\t\tbreak;\n\t}\n}", "command (name = '', ...params) { return new UnitCommand[name](this.unit, name, ...params); }", "function switchCommand(param) {\n userCommand = userCommand || param\n switch (userCommand) {\n case \"my-tweets\":\n twitterGrab();\n break;\n\n case \"spotify-this-song\":\n spotifyGrab();\n break;\n\n case \"movie-this\":\n ombdGrab();\n break;\n\n case \"do-what-it-says\":\n doIt();\n break;\n\n }\n}", "addCommand(name, command) {\n\t\tconst comm = new command(this);\n\t\tcomm.name = name;\n\t\tthis.commands.push({\n\t\t\tname: name,\n\t\t\tcommand: comm\n\t\t});\n\t}", "findCommand(name) {\n for (const command of this.commands) {\n const { names, match } = command.command\n if (names.includes(name)) {\n return { command, sliceFirstArg: name && name !== '*' }\n }\n if (match && match(name)) {\n return { command, sliceFirstArg: false }\n }\n }\n return null\n }", "function run(appName, command, callback) {\n commons.get(format('/%s/apps/%s/run/', deis.version, appName), callback);\n }", "function commands(input){\n\tswitch(input){\n\t\tcase \"my-tweets\" : \n\t\t\tmyTweets();\n\t\t\tbreak;\n\t\tcase \"spotify-this-song\":\n\t\t\tsearchSpotify(userSearch);\n\t\t\tbreak;\n\t\tcase \"movie-this\":\n\t\t\tsearchMovie(userSearch);\n\t\t\tbreak;\n\t\tcase \"do-what-it-says\":\n\t\t\tdoWhatItSays();\n\t\t\tbreak;\n\t}\n}", "function ExecuteCommand(command, query)\r\n{\r\n\tvar apis = require(\"./api.js\");\r\n\t// App functionality due to user input\r\n\tif(command === \"get-tweets\") { \r\n\t\tapis.GetLatestTweets(query);\r\n\t} else if(command === \"spotify-this-song\") {\r\n\t\tapis.spotifyThisSong(query);\r\n\t} else if(command === \"movie-this\") {\r\n\t\tapis.movieThis(query);\r\n\t} else if(command === \"do-what-it-says\") {\r\n\t\tapis.readFileCommand();\r\n\t} else if(command === \"exit\") {\r\n\t\tprocess.exit();\r\n\t} else if(command === undefined) { // use case where no command is given\r\n\t\tconsole.log(\"Please select correct command to run.\");\r\n\t} else { // use case where command is given but not recognized\r\n\t\tconsole.log(\"Command not recognized! Please try again.\");\r\n\t}\r\n}", "function commandMe(command, commandArg){\n switch(command){\n case 'my-tweets':\n twit.twitterLogic();\n break;\n case 'spotify-this-song':\n spot.spotifyLogic(commandArg);\n break;\n case 'movie-this':\n omdb.omdbLogic(commandArg);\n break;\n case 'do-what-it-says':\n case 'obey':\n obey.readFromRandom();\n break;\n default:\n console.log('Follow the directions.');\n }\n}", "function determineCommand(command) {\n switch (command) {\n case `my-tweets`:\n console.log('get tweets')\n getTweet();\n break;\n case 'spotify-this-song':\n console.log('this is a song')\n getSongs()\n break;\n\n case 'movie-this':\n getMovie()\n break;\n\n case 'do-what-it-says':\n doWhatItSays()\n break;\n default:\n console.log('default')\n }\n}", "function executeCommand(cmd){\n\t\t\n\t\tif(cmd == OPENLINK){\n\t\t\tsetTimeout('window.open($(\".demobot_1 a\").attr(\"href\"));', 1000);\n\t\t}\n\t\telse if(cmd == SHOWMAP){\n\t\t\tgenerateGoogleMap();\n\t\t}\n\t\telse if(cmd == SHOWVIDEO){\n\t\t\tgenerateYoutubeVideo();\n\t\t}\n\t\telse if(cmd == OPENCAMERA){\n\t\t\topenCamera();\n\t\t}\n\t\telse if(cmd == SNAPSHOT){\n\t\t\ttakeASnapShot();\n\t\t}\n\t\telse if(cmd == SHOWHISTORY){\n\t\t\tshowHistory();\n\t\t}\n\n\t}", "function userCommand(choice, input) {\n switch (choice) {\n case \"concert-this\":\n concertThis();\n break;\n case \"spotify-this-song\":\n spotifyThis();\n break;\n case \"movie-this\":\n movieThis();\n break;\n case \"do-what-it-says\":\n doThis(input);\n break;\n default:\n console.log(\"Looks like something went wrong, please try again.\");\n break;\n }\n}", "function commands(command) {\n switch (command) {\n case \"concert-this\":\n concertSearch();\n break;\n case \"movie-this\":\n movieSearch();\n break;\n case \"spotify-this-song\":\n songSearch();\n break;\n case \"do-what-it-says\":\n doThis();\n break;\n default:\n console.log('Liri needs to be told what to do...');\n };\n}", "function executeCommand(msg) {\n let command = msg.content.substr(1);\n let commandParse = command.split(\" \");\n let commandName = commandParse[0];\n let args = commandParse.slice(1);\n\n if (commandName == \"commands\") {\n msg.channel.send(\"Commands : \\n\\n 1. `!commands` : Display the available commands.\\n\\n\" +\n \" 2. `!help [topic]` : Provide help on a certain topic.\\n\\n\" +\n \" 3. `!clear` : Clear the chat.\\n\\n\" +\n \" 4. `!about [username#0000]` : Display user information.\\n\\n\" +\n \" 5. `!playing [game]` : Display users that are currently playing a specific game.\\n\\n\" +\n \" 6. `!ban [username#0000]` : Ban user from the server.\\n\\n\" +\n \" 7. `!unban [username#0000]` : Remove ban from the user.\");\n }\n else if (commandName == \"help\") {\n execHelp(args, msg);\n }\n else if (commandName == \"clear\") {\n msg.channel.send(\"Clearing the chat ...\");\n execClear(msg);\n }\n else if (commandName == \"about\") {\n execGetUserInformation(msg, args);\n }\n else if (commandName == \"playing\") {\n let game = args.join(\" \");\n execGetUsersPlaying(msg, game);\n }\n else if (commandName == \"ban\") {\n execBanUser(msg, args);\n }\n else if (commandName == \"unban\") {\n execUnbanUser(msg, args);\n }\n else {\n msg.channel.send(\"Unknown command. Please try using `!commands` to see all the available commands\");\n }\n }", "run_pfa_command(cmd){\n switch(cmd){\n case 'build': return this.run_build_pfa()\n case 'open': return film.analyse.openPFA()\n }\n}", "function executeCommand(str){\n console.log(str)\n\n var cmdMap = {\n 'about': showAbout,\n 'commands': showCommands,\n \"voice\": toggleVoice\n };\n\n // remove '/'; to lowercase; make into array\n var commandArray = str.slice(1)\n .toLowerCase()\n .split(' ');\n var cmd = commandArray[0];\n var args = commandArray.slice(1);\n\n // run the command w/ args OR error.\n (cmdMap[cmd] || showCommandError)(args);\n\n $('#content').scrollTop(document.getElementById('content').scrollHeight)\n $('#message').val('').focus();\n}", "function runCommand(command) {\n command.shift();\n command.shift();\n // console.log(command)\n var str = command.join(' ');\n // console.log(str);\n\n determineCommand(String(command))\n}", "function runCommand(command, searchTerm) {\n switch (command) {\n case 'my-tweets':\n showTweets();\n break;\n case 'spotify-this-song':\n showSong(searchTerm);\n break;\n case 'movie-this':\n showMovie(searchTerm)\n break;\n default:\n doRandom();\n }\n}", "isCommand(commandName) {\n return this.getCommand().name === commandName;\n }", "function command(userSelect) {\n switch (userSelect) {\n case 'concert-this':\n concertThis();\n break;\n case 'spotify-this-song':\n spotifyThisSong();\n break;\n case 'movie-this':\n movieThis();\n break;\n case 'do-what-it-says':\n doWhatItSays();\n break;\n }\n}", "function processCommands(command, commandParam){\n\n\t//console.log(commandParam);\n\n\tswitch(command){\n\n\tcase 'spotify-this-song':\n\t\t//If user has not specified a song , use default\n\t\tif(commandParam === undefined){\n\t\t\tcommandParam = defaultSong;\n\t\t} \n\t\tspotifyThis(commandParam); break;\n\tcase 'movie-this':\n\t\t//If user has not specified a movie Name , use default\n\t\tif(commandParam === undefined){\n\t\t\tcommandParam = defaultMovie;\n\t\t} \n\t\tmovieThis(commandParam); break;\n\tcase 'do-what-it-says':\n\t\tdoWhatItSays(); break;\n\tdefault: \n\t\tconsole.log(\"Invalid command. Please type any of the following commands: spotify-this-song movie-this or do-what-it-says\");\n}\n\n\n}", "function _runACmd(cmd){\n\t\tif (!cmd)\n\t\t\treturn 0;\n\t\tvar cmdList = cmd.split('&');\n\t\tfor (var i=0; i<cmdList.length; i++ )\n\t\t\trunCmd(cmdList[i].trim());\n\t}", "function run() {\n\nswitch (command) {\n\ncase 'my-tweets':\n\tgetTweets();\n break;\ncase 'spotify-this-song':\n\tgetSong(search);\n break;\ncase 'movie-this':\n\tgetFilm(search);\n break;\ncase 'do-what-it-says':\n\tgetRandom();\n break;\ncase 'HELP':\n\tconsole.log(\"Options: \\n my-tweets \\n spotify-this-song SONGNAME \\n movie-this MOVIENAME \\n do-what-it-says\")\ndefault:\n\tconsole.log(\"Enter a command, type 'node liri.js HELP' if need be\")\n break;\n}\n}", "function perform(m, command) {\n\n if(has(m, command))\n domNode(m)[command]();\n\n }", "executeCommand(commandName, userParams) {\n let cmd = this.commandRegistry.get(commandName)\n if (!cmd) {\n console.warn('command', commandName, 'not registered')\n return\n }\n let commandState = this.commandStates[commandName]\n let params = extend(this._getCommandParams(), userParams, {\n commandState: commandState\n })\n let info = cmd.execute(params, this.getCommandContext())\n // TODO: why do we require commands to return a result?\n if (info === undefined) {\n console.warn('command ', commandName, 'must return either an info object or true when handled or false when not handled')\n }\n return info\n }", "function selectCommand(liriCommand,queryInput) {\n\n\t\n\t//if command my-tweets\n\tif(liriCommand==='my-tweets')\n\t{\n\t\t//console.log('werwerw')\n\t\ttweet()\n\t}\n\t//if command is spotify-this-song\n\telse if(liriCommand==='spotify-this-song')\n\t{\t\n\t\t//console.log(input)\n\t\tspotify(queryInput)\n\t}\n\n\t//if command movie-this\n\telse if(liriCommand==='movie-this')\n\t{\n\t\tomdb(queryInput)\n\t}\n\t//if command do-what-it-says\n\telse if(liriCommand===\"do-what-it-says\") {\n\n\t\tdothis()\n\t}\n}", "function pickSomeCommand(aCommand, aCommandArg) {\n switch (aCommand) {\n case \"my-tweets\":\n getTweets();\n break;\n case \"spotify-this-song\":\n getSongInfo(aCommandArg);\n break;\n case \"movie-this\":\n getMovieInfo(aCommandArg);\n break;\n case \"do-what-it-says\":\n doSomething();\n break;\n default:\n console.log(\"Next time, try using my-tweets, spotify-this-song, movie-this, or do-what-it-says as arguments.\");\n };\n}", "setCommandName(newCommandName) {\n\t\tthis.test.commandName = newCommandName\n\t}", "executeCommand (command, isImplicit = false) {\n this.getConsole().executeCommand(command, isImplicit);\n var justCommand = command.substring(0, command.indexOf(\"(\"));\n var commandParams = command.substring(command.indexOf(\"(\") + 1, command.lastIndexOf(\")\"));\n GEPPETTO.trackActivity(this.getId(), justCommand, commandParams);\n }", "function get_command(command_name){\n for(var module in command_dict)\n if(command_dict[module][command_name] != null) return {c:command_dict[module][command_name], m:module}\n return null;\n}", "function runCommand (argOne, argTwo) {\n commands(argOne, argTwo);\n}", "function commandFinder(cmd) {\n\tvar activeCommands = JSON.parse(fs.readFileSync('./cmds.json', 'utf8'));\n\tvar splitInput = cmd.trim().split(\" \")\n\tfor (var i = 0; i < activeCommands.commands.length; i++) {\n\t\tif (activeCommands.commands[i].name.toLowerCase() == splitInput[0].toLowerCase()) {\n\t\t\tif (activeCommands.commands[i].name.toLowerCase() != \"exit\") {\n\t\t\t\tclearScreen();\n\t\t\t\trunScript(activeCommands.commands[i].file, function (err) {\n \t\t\t\tif (err) throw err;\n \t\t\t\t//clearScreen();\n \t\t\t\tconsole.log(`\\n-----------\\nThe ${activeCommands.commands[i].name} command has finished running.`);\n \t\t\t\taskForPrompt();\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"\\nThe script has been terminated.\")\n\t\t\t\tprocess.exit()\n\t\t\t}\n\t\t}\n\t\tif (i + 1 == activeCommands.commands.length) {\n\t\t\tclearScreen()\n\t\t\tconsole.log(\"You didn't enter a valid command.\\nNeed help? Type in 'help' as your input.\\n\")\n\t\t\taskForPrompt()\n\t\t}\n\t}\n}", "function commandFromFilename (filename) {\n return path.basename(filename, path.extname(filename))\n }", "function commandFromFilename (filename) {\n return path.basename(filename, path.extname(filename))\n }", "function commandFromFilename (filename) {\n return path.basename(filename, path.extname(filename))\n }", "function commandFromFilename (filename) {\n return path.basename(filename, path.extname(filename))\n }", "function executeRequest() {\n switch (command) {\n case \"concert-this\":\n getBandsInTown();\n break;\n case \"Bands in town\":\n getBandsInTown();\n break;\n case \"spotify-this-song\":\n getSpotifyInfo();\n break;\n case \"Search for a Spotify song\":\n getSpotifyInfo();\n break;\n case \"movie-this\":\n getMovieInfo();\n break;\n case \"Search for movie info\":\n getMovieInfo();\n break;\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n case \"Default\":\n doWhatItSays();\n break;\n default:\n console.log(\n \"This was not a valid option. Please make a valid selection\"\n );\n }\n}", "setScript(name, command) {\n this.scripts[name] = [command];\n }", "getCommand(commandMap, themeName, commandName, authorId) {\n var theme = this.getThemeByName(commandMap, themeName);\n if(theme == null) {\n throw \"no_theme\";\n }\n if(theme.isRestricted() && !(theme.allowedIds.includes(authorId))) {\n throw \"not_allowed\";\n }\n\n var command = null;\n theme.commands.forEach(cmd => {\n if(cmd.name === commandName) {\n command = cmd;\n }\n });\n\n return command;\n }", "function Command(name, options){\n\tif(this.validate(name)){\n\t\tthis.name = name;\n\t\tif(typeof options !== 'undefined' && typeof options.channel !== 'undefined')\n\t\t\tthis.channel = options.channel;\n\t\tif(typeof options !== 'undefined' && typeof options.message !== 'undefined')\n\t\t\tthis.message = options.message;\n\t}\n\n\tif(typeof options === 'undefined'){\n\t\tthis.parse(name);\n\t}\n}", "function processCommands(command, commandParam) {\n switch(command) {\n case 'spotify-this-song':\n //if a song is not specified -> default\n if(commandParam === undefined) {\n commandParam = defaultSong;\n }\n spotifyThis(commandParam); break;\n case 'movie-this':\n //if a movie is not specified -> default\n if(commandParam === undefiend) {\n commandParam = defaultMovie;\n }\n movieThis(commandParam); break;\n case 'do-what-it-says':\n doWhatItSays(); break;\n default:\n console.log(\"Invalid command. Please type any of the following commands: spotify-this-song, movie-this or do-what-it-says\");\n }\n}", "function startCommand(name, value) {\n lastCommand = name;\n value = jMarker.trim(value);\n switch (name) {\n case 'if':\n body.push('if(' + _expression(value) + '){');\n break;\n case 'else':\n body.push('}else{');\n break;\n case 'elseif':\n body.push('}else if(' + _expression(value) + '){');\n break;\n case 'switch':\n inSwitchCommand = true;\n body.push('switch(' + _expression(value) + '){');\n break;\n case 'case':\n body.push('case ' + _expression(value) + ':');\n break;\n case 'break':\n body.push('break;');\n break;\n case 'default':\n body.push('default:');\n break;\n case 'local':\n case 'assign':\n body.push(startCommandAssign(value));\n break;\n case 'list':\n body.push(startCommandList(value));\n break;\n case 'include':\n pushValue('jMarker.res(' + value + ')(__d)');\n break;\n case 'import':\n body.push(startCommandImport(value));\n break;\n case 'macro':\n body.push(startCommandMacro(value));\n break;\n case 'nested':\n pushValue(startCommandNested(value));\n break;\n case 'function':\n body.push(startCommandFunction(value));\n break;\n case 'return':\n if (value) {\n body.push('return ' + _expression(value) + ';');\n } else {\n body.push('return __o.join(\"\");');\n }\n break;\n default:\n break;\n }\n }", "static getCommandName(c)\n\t{\n\t\tconst commandId = parseInt(c);\n\t\tlet commandName = 'unknown';\n\t\tfor (const i of Object.keys(commands)) {\n\t\t\tif (commands[i] === commandId) {\n\t\t\t\tcommandName = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn `${commandName}(${commandId})`;\n\t}", "function handleCommand() {}", "sendKeyCommand(name, value = true) {\n if (keyMappings[name]) {\n const [keysym, code] = keyMappings[name]\n this.sendKey(keysym, code, value)\n } else {\n const keysym = keysyms.lookup(name)\n this.sendKey(keysym)\n }\n }", "getCommand(commandName) {\n return this.Commands.get(commandName);\n }", "function runCommands() {\n app\n .command('run <path>')\n .description('Run a bot manually')\n .option('-f --fork', 'Don\\'t re-queue bot after running.')\n .action(runActions);\n}", "function executeFunctionByName(functionName, context /*, args*/) {\n var args = Array.prototype.slice.call(arguments).splice(2);\n var namespaces = functionName.split(\".\");\n var func = namespaces.pop();\n for(var i = 0; i < namespaces.length; i++) {\n context = context[namespaces[i]];\n }\n return context[func].apply(this, args);\n }", "function executeFunctionByName(functionName, context /*, args*/) {\n var args = Array.prototype.slice.call(arguments).splice(2);\n var namespaces = functionName.split(\".\");\n var func = namespaces.pop();\n for(var i = 0; i < namespaces.length; i++) {\n context = context[namespaces[i]];\n }\n return context[func].apply(this, args);\n }", "function executeFunctionByName(functionName, context /*, args*/) {\n var args = Array.prototype.slice.call(arguments).splice(2);\n var namespaces = functionName.split(\".\");\n var func = namespaces.pop();\n for(var i = 0; i < namespaces.length; i++) {\n context = context[namespaces[i]];\n }\n return context[func].apply(this, args);\n }", "async cmd (cmd) {\n await this.load()\n\n const cmdId = this.deref(cmd)\n if (!cmdId) {\n throw Object.assign(new Error(`Unknown command ${cmd}`), {\n code: 'EUNKNOWNCOMMAND',\n })\n }\n\n const Impl = require(`./commands/${cmdId}.js`)\n const command = new Impl(this)\n\n // since 'test', 'start', 'stop', etc. commands re-enter this function\n // to call the run-script command, we need to only set it one time.\n if (!this.#command) {\n this.#command = command\n process.env.npm_command = this.command\n }\n\n return command\n }", "function readCommandName(args) {\n var match = commandRxp.exec(args[0]);\n if (match) {\n args.shift();\n return match[1];\n }\n return null;\n }", "async function runCommand(cmd) {\r\n switch (cmd.toLowerCase()) {\r\n \r\n case \"restart\": \r\n case \"reboot\": \r\n t_println(\"Rebooting. Please wait\");\r\n await t_write(\".....\", 0.5);\r\n t_terminal.innerHTML = terminalDefaultContent;\r\n boot();\r\n break;\r\n\r\n case \"shutdown\": \r\n t_println(\"Shutting down internal services\");\r\n await t_write(\"...\", 1);\r\n t_println(\"Goodbye!\");\r\n await sleep(1);\r\n t_terminal.innerHTML = \"\";\r\n break;\r\n\r\n case \"clear\": \r\n t_terminal.innerHTML = terminalDefaultContent;\r\n init();\r\n runCommand(await t_getln());\r\n break;\r\n\r\n case \"ls\": \r\n t_println(\"This is the return value of the ls command!\");\r\n runCommand(await t_getln());\r\n break;\r\n\r\n\r\n default: // Über JSON File falls kein 'Aktiver' Command (also wenn nur text zurück)\r\n t_println(\"Command not found: \" + cmd);\r\n runCommand(await t_getln()); //Ready for the next input\r\n break;\r\n }\r\n}", "function commandsSelect(comm, para) {\n\n switch (comm) {\n case \"concert-this\":\n concert(para);\n break;\n\n case \"spotify-this-song\":\n spotify(para);\n break;\n\n case \"movie-this\":\n movie(para);\n break;\n\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n default:\n console.log(\"Check out the commands.\");\n }\n\n}", "function run(fncall) {\n if (fncall.length == 0) { throw new Error('No command given') }\n let [command, ...args] = fncall\n switch (command.toUpperCase()) {\n case 'SETTINGS': return settings(args); break;\n case 'PROFILE': return profile(args); break;\n case 'BACKGROUND': return background(args); break;\n case 'TEXT': text(args); break;\n case 'BOLDTEXT': boldText(args); break;\n default: throw new Error(`Unknown command: \"${command.toUpperCase()}\"`);\n }\n}", "function doCMD(val, method, option, msg) {\n\tvar cmd = \"API.\" + val + \"(API.\" + option + \", \"+method + \");\";\n\tconsole.log('Running : ' + cmd);\n\teval(cmd);\n\tmessage(msg);\n}", "function formatCommand(commandName) {\n if (isWindows) {\n return `${commandName}.exe`;\n }\n else {\n return commandName;\n }\n}", "callCommand() {\n this.isCommand = true\n }", "function execute(command) {\n console.log(\"calling execute\"); // remove when finished debugging\n player[command.action](command.target);\n}", "async getCommand(commandName) {\n\n // Check if the command was cached\n const cachedCommand = this._getCachedCommand(commandName);\n if (cachedCommand) {\n return cachedCommand;\n }\n\n // Try to install from WAPM\n return await this._installFromWapmCommand(commandName);\n }", "function evaluateCmd(userInput) {\n //parses the user input to understand which command was typed\n const userInputArray = userInput.split(\" \");\n const command = userInputArray[0];\n\n switch (command) {\n case \"echo\":\n commandLibrary.echo(userInputArray.slice(1).join(\" \"));\n break;\n case \"cat\":\n commandLibrary.cat(userInputArray.slice(1));\n break;\n case \"head\":\n commandLibrary.head(userInputArray.slice(1));\n break;\n case \"tail\":\n commandLibrary.tail(userInputArray.slice(1));\n break;\n default:\n console.log('No such command found');\n }\n}", "function invoke0(name) {\n return function(target) {\n return target[name] ();\n };\n }", "execute (args, props)\n {\n super.execute();\n\n const commands = require('../modules/commands.js').commands;\n const keys = Object.keys(commands);\n\n // Loop through the keys.\n for (let i = 0; i < keys.length; i++) \n {\n // If we have no args, give the description of this command.\n if(!args.length > 0)\n {\n this.chat(`${this.description}`);\n break;\n }\n\n // Find a match of the arg and chat the description.\n if(args[0] === commands[keys[i]].name || commands[keys[i].includes(args[0])])\n {\n this.chat(commands[keys[i]].getDescription());\n return;\n }\n }\n\n this.chat('/me Could not find that command.');\n }", "function executeCommand(command, src) {\n switch (command) {\n case \"playPause\":\n //open toast when keyboard shortcut is pressed\n if (!src && settings.toastOnPlayPause && song.info) openToastIfNeeded();\n /* falls through */\n case \"nextSong\":\n case \"prevSong\":\n case \"toggleRepeat\":\n case \"toggleShuffle\":\n executeInGoogleMusic(command);\n break;\n case \"openMiniplayer\":\n openMiniplayer();\n break;\n case \"feelingLucky\":\n executeFeelingLucky();\n break;\n case \"showToast\":\n if (song.info) openToast();\n break;\n case \"loveUnloveSong\":\n if (song.loved === true) unloveTrack();\n else loveTrack(true);\n break;\n case \"volumeUp\":\n if (player.volume !== null && player.volume != \"100\") setVolume(Math.min(100, parseInt(player.volume) + 10) / 100);\n break;\n case \"volumeDown\":\n if (player.volume !== null && player.volume != \"0\") setVolume(Math.max(0, parseInt(player.volume) - 10) / 100);\n break;\n case \"volumeMute\":\n if (player.volume !== null) {\n if (volumeBeforeMute && player.volume == \"0\") {\n setVolume(parseInt(volumeBeforeMute) / 100);\n volumeBeforeMute = null;\n } else if (player.volume != \"0\") {\n volumeBeforeMute = player.volume;\n setVolume(0);\n }\n }\n break;\n case \"ff\":\n if (song.info && song.info.durationSec > 0) setSongPosition(Math.min(1, (song.positionSec + 15) / song.info.durationSec));\n break;\n case \"rew\":\n if (song.info && song.info.durationSec > 0) setSongPosition(Math.max(0, (song.positionSec - 15) / song.info.durationSec));\n break;\n case \"openLyrics\":\n if (localSettings.lyrics) openLyrics();\n break;\n default:\n if (command.indexOf(\"rate-\") === 0 && song.info) {\n var rating = parseInt(command.substr(5, 1));\n if (!settings.preventCommandRatingReset || !isRatingReset(song.rating, rating) || src == \"icon\" && settings.showRatingIndicator || src == \"toast\" && settings.toastRating) rate(rating);\n }\n }\n }", "function toCommand(commandName,action,res){\n if(!action) console.error(commandName,' does not have an \"action\" to perform, please assign it one');\n /* exit process on command action of 'exit' */\n if(!action || action.toLowerCase() === 'exit'){\n console.error('Exiting process due to command; ',commandName);\n process.exit(1);\n }\n\n /* go to final task command with values upon seeing an 'end' action */\n else if(action.toLowerCase() === 'end'){\n _command(_values);\n }\n\n /* go the the next command specified in 'action' */\n else{\n _currentTaskCommand = action;\n if(_taskCommands[_currentTaskCommand] === undefined){\n console.error('No command exists by the name of ',_currentTaskCommand);\n process.exit(1);\n }\n\n if(_values[_currentTaskCommand] === undefined || typeof _values[_currentTaskCommand] === 'object' || _taskCommands[_currentTaskCommand].repeatable){\n runCommand(_currentTaskCommand,_taskCommands[_currentTaskCommand]);\n }\n else{\n res = _values[_currentTaskCommand];\n toCommand(_currentTaskCommand,(typeof _taskCommands[_currentTaskCommand].action === 'function' ? _taskCommands[_currentTaskCommand].action(res,_values) : _taskCommands[_currentTaskCommand].action),res);\n }\n }\n }", "executeFunctionByName (functionName, context /*, args */) {\n var args = Array.prototype.slice.call(arguments, 2);\n var namespaces = functionName.split('.');\n var func = namespaces.pop();\n for(var i = 0; i < namespaces.length; i++) {\n context = context[namespaces[i]];\n }\n return context[func].apply(context, args);\n }", "function moduleName (obj) {\n const mod = __webpack_require__(592)(obj)\n if (!mod) throw new Error(`No command name given for module: ${inspect(obj)}`)\n return commandFromFilename(mod.filename)\n }", "function getCMD(client, message, input) {\n const embed = new Discord.RichEmbed();\n\n const cmd =\n client.commands.get(input.toLowerCase()) ||\n client.commands.get(client.aliases.get(input.toLowerCase()));\n\n let info = `No information found for command **${input.toLowerCase()}**`;\n\n if (!cmd) {\n return message.channel.send(embed.setColor(\"RED\").setDescription(info));\n }\n\n if (cmd.name) info = `**Command name**: ${cmd.name}`;\n if (cmd.aliases)\n info += `\\n**Aliases**: ${cmd.aliases.map(a => `\\`${a}\\``).join(\", \")}`;\n if (cmd.description) info += `\\n**Description**: ${cmd.description}`;\n if (cmd.usage) {\n info += `\\n**Usage**: ${PREFIX + cmd.name}`;\n embed.setFooter(`Griffin-Bot`);\n }\n return message.channel.send(\n embed.setColor(\"#ff2052\").setDescription(info)\n );\n }", "function getUserCommand(command, value) {\n switch (command) {\n case \"concert-this\":\n getConcert(value);\n break;\n\n case \"spotify-this-song\":\n getSong(value);\n break;\n\n case \"movie-this\":\n getMovie(value);\n break;\n\n case \"do-what-it-says\":\n getLog(command, value);\n break;\n\n default:\n console.log('\\nInvalid Command Please Type One Of These 4 Options: \\n' +\n '1.\"concert-this\" + \"artist name\"\\n' +\n '2.\"spotify-this-song\" + \"song name\"\\n' +\n '3.\"movie-this\" + \"movie name\"\\n' +\n '4.\"do-what-it-says\"');\n }\n}", "function Command () {}", "function userCommand(userInput, userQuery) {\n // THE DIFFERENT SWITCH CASES\n switch (userInput) {\n case \"concert-this\":\n concertThis();\n break;\n case \"spotify-this\":\n spotifyThisSong();\n break;\n case \"movie-this\":\n movieThis();\n break;\n case \"do-this\":\n doThis(userQuery);\n break;\n default:\n console.log(\"Sorry, I didn't get that. Try again?\");\n break;\n }\n}", "executeCommand(commandName, userParams, cb) {\n let cmd = this.commandRegistry.get(commandName)\n if (!cmd) {\n console.warn('command', commandName, 'not registered')\n return\n }\n let commandState = this.commandStates[commandName]\n let params = Object.assign(this._getCommandParams(), userParams, {\n commandState: commandState\n })\n\n if (cmd.isAsync) {\n // TODO: Request UI lock here\n this.editorSession.lock()\n cmd.execute(params, this.getCommandContext(), (err, info) => {\n if (err) {\n if (cb) {\n cb(err)\n } else {\n console.error(err)\n }\n } else {\n if (cb) cb(null, info)\n }\n this.editorSession.unlock()\n })\n } else {\n let info = cmd.execute(params, this.getCommandContext())\n return info\n }\n }", "beforeCommand (commandName, args) {\n }", "run(query) {\n\t\treturn this.command(query, \"run\");\n\t}", "function cmdSwitch() {\n\n switch (action) {\n\n case 'spotify-this-song':\n spotifySong(input);\n break;\n\n case 'concert-this':\n bands(input);\n break;\n\n case 'movie-this':\n movies(input);\n break;\n\n default:\n logged(\"Please provide LIRI some instruction\");\n break;\n }\n}", "function runCmds(cmds) {\n if (cmds.length==1) return cmds[0]();\n return cmds[0]( runCmds(cmds.slice(1)) );\n }", "function switchBoard() {\n // console.log(\"The value of command is: \" + command);\n\n switch (command) {\n case \"concert-this\": \n // console.log(\"option1\");\n concertThis(queryTerm);\n break;\n case \"spotify-this-song\":\n // console.log(\"option2\");\n spotifyThisSong(queryTerm);\n break;\n case \"movie-this\": \n // console.log(\"option3\");\n movieThis(queryTerm);\n break;\n default:\n console.log(\"That command is not recognized\") \n };\n}", "function commands (selection, value) {\n switch (selection) {\n case \"concert-this\":\n concertAPI(value);\n break;\n case \"spotify-this-song\":\n spotifyAPI(value);\n break;\n case \"movie-this\":\n movieAPI(value);\n break;\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n default: \n console.log(\"LIRI BOT does not recognize this command\");\n };\n}", "function runCommand(modules, command, argv) {\n modules.forEach((module) => {\n if (typeof module.runCommand === 'function') {\n module.runCommand(command, argv);\n } else {\n logger.warn('Found matching module without exposed runCommand - %s', module);\n }\n });\n}", "function invokeCommand(command) {\n var cs = new CSInterface();\n cs.evalScript('app.invokeCommand(Application.' + command + ')');\n}", "function invoke1(name) {\n return function(x) {\n return function(target) {\n return target[name] (x);\n };\n };\n }", "executeFunctionByName(functionName, context /*, args */) {\n var args = Array.prototype.slice.call(arguments, 2);\n var namespaces = functionName.split(\".\");\n var func = namespaces.pop();\n for (var i = 0; i < namespaces.length; i++) {\n context = context[namespaces[i]];\n }\n return context[func].apply(context, args);\n }", "function selectedCommand(LiriReturn){\nswitch(LiriReturn) {\n case \"concert-this\": \n concertThis();\n break;\n case \"spotify-this-song\":\n SpotifyThisSong(); \n break;\n case \"movie-this\":\n movieThis(); \n break;\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n default:\n console.log(\n \"here are the available functions for LIRI: concert-this, spotifiy-this-song, movie-this, do-what-it-says\"\n )\n}\n}", "function scene::OnCommand(cmdid, system)\r\n{\r\n switch(cmdid)\r\n {\r\n case -1: // created default by the uiman system engine\r\n // is the id of X close button \r\n Destroy(system);\r\n return 1;\r\n case -2: // is the id of Mm button \r\n system.ToggleFullScreen();\r\n return 1;\r\n case 101:\r\n scene.BuildMenu(\"bspmaps/\");\r\n return 1;\r\n case 102:\r\n //scene.ConnToMaster();\r\n break;\r\n case 100: //download levels from www.zalsoft.com/levels200/\r\n scene.CheckRemoteLevels(\"http://www.zalsoft.com/levels200/getic_index.ml\");\r\n return 1;\r\n default:\r\n if(cmdid >=0 && cmdid < maps.len())\r\n {\r\n if(scene.Load(null, maps[cmdid]) == true)\r\n {\r\n system.SetMode(sys_states.PLAY_MODE);\r\n }\r\n else\r\n {\r\n system.SetMode(sys_states.SET_MODE);\r\n }\r\n return 1;\r\n }\r\n break;\r\n }\r\n return 0;\r\n}", "function player_DoFSCommand( command )\r\n{\r\n\teval( command );\r\n}", "function dispatch(command) {\n var obj = tokenize(command), args;\n if (!obj) {\n return;\n }\n try {\n args = _.map(obj.tokens, function (token, i) {\n return obj.config.args[i].getArg(token);\n });\n } catch (err) {\n return; // fail on bad argument\n }\n var value = obj.config.run(args);\n return value && {name: obj.config.name, value: value};\n }", "[_runCmd] (cmd, impl, args, cb) {\n if (!this.loaded) {\n throw new Error(\n 'Call npm.load(cb) before using this command.\\n' +\n 'See the README.md or bin/npm-cli.js for example usage.'\n )\n }\n\n process.emit('time', `command:${cmd}`)\n // since 'test', 'start', 'stop', etc. commands re-enter this function\n // to call the run-script command, we need to only set it one time.\n if (!this.command) {\n process.env.npm_command = cmd\n this.command = cmd\n }\n\n // Options are prefixed by a hyphen-minus (-, \\u2d).\n // Other dash-type chars look similar but are invalid.\n if (!warnedNonDashArg) {\n args.filter(arg => /^[\\u2010-\\u2015\\u2212\\uFE58\\uFE63\\uFF0D]/.test(arg))\n .forEach(arg => {\n warnedNonDashArg = true\n log.error('arg', 'Argument starts with non-ascii dash, this is probably invalid:', arg)\n })\n }\n\n if (this.config.get('usage')) {\n console.log(impl.usage)\n cb()\n } else {\n impl(args, er => {\n process.emit('timeEnd', `command:${cmd}`)\n cb(er)\n })\n }\n }", "execute(command, args) {\n switch(command) {\n case 'setup_map': {\n this.state = Parser.setup_map(this.state, args.shift(), args.join(' '));\n return;\n }\n case 'settings': {\n this.settings[args[0]] = args.length <= 2 ? args[1] : args;\n this.state = Parser.settings(this.state, args.shift(), args.join(' '));\n return;\n }\n case 'update_map': {\n this.state = Parser.update_map(this.state, args.join(' '));\n return;\n }\n case 'pick_starting_region': {\n this.state = Parser.pick_starting_region(this.state, args.shift(), args.join(' '));\n return 'random';\n }\n case 'go': {\n this.state = Parser.go(this.state, args.shift());\n return 'TODO';\n }\n case 'print': {\n\n return JSON.stringify(this.state.toJS(), null, '\\t');\n }\n\n }\n }", "function command(name) {\n return function (ctor, key, descriptor) {\n var mdk = 'grid:commands';\n var list = Reflect.getMetadata(mdk, ctor);\n if (!list) {\n Reflect.defineMetadata(mdk, (list = []), ctor);\n }\n list.push({\n name: name || key,\n key: key,\n impl: descriptor.value,\n });\n };\n}", "async execute(client, message, args) {\r\n if (!args.length) return message.channel.send('**Invalid usage:** Command `run` requires exactly one code argument');\r\n const msg = await message.channel.send('Running command...');\r\n exec(args.join(' '), async (error, data, getter) => {\r\n if (error) {\r\n return msg.edit(`\\`ERROR\\`\\n\\`\\`\\`js\\n${error.message}\\n\\`\\`\\``);\r\n }\r\n let result;\r\n if (getter) {\r\n result = getter;\r\n } else {\r\n result = data;\r\n }\r\n return msg.edit(`\\`\\`\\`js\\n${result}\\n\\`\\`\\``);\r\n });\r\n }", "function addAction(commandName, command) {\n var CodeMirror = window.CodeMirror;\n\n if (!CodeMirror.commands[commandName]) {\n CodeMirror.commands[commandName] = command;\n }\n }" ]
[ "0.76029205", "0.70871305", "0.6576685", "0.65479213", "0.64989746", "0.63711435", "0.630713", "0.6299099", "0.6192801", "0.612655", "0.6120804", "0.60527354", "0.59381735", "0.5933343", "0.591746", "0.5892281", "0.586834", "0.5859855", "0.585839", "0.58515793", "0.58228123", "0.5813881", "0.58037704", "0.5797476", "0.5792865", "0.5786357", "0.5776013", "0.57698977", "0.5757777", "0.5756937", "0.5747745", "0.5737035", "0.56878144", "0.56609744", "0.56375635", "0.56368923", "0.5626692", "0.56210744", "0.5602496", "0.5570534", "0.55665946", "0.55651695", "0.55651695", "0.55651695", "0.55651695", "0.5530303", "0.5504212", "0.549447", "0.5490574", "0.5488694", "0.54747766", "0.5472538", "0.5448218", "0.5446332", "0.5425822", "0.541374", "0.54069626", "0.54069626", "0.54069626", "0.5401791", "0.53997576", "0.5399113", "0.5396324", "0.5391882", "0.5367764", "0.5348867", "0.5327223", "0.53189695", "0.5303685", "0.528289", "0.5271474", "0.5266102", "0.52632153", "0.5244133", "0.523162", "0.52214444", "0.5214511", "0.5211761", "0.5185944", "0.5175105", "0.5168079", "0.51676476", "0.5166585", "0.5155306", "0.51551574", "0.5131472", "0.51303905", "0.5127696", "0.51205397", "0.5120451", "0.51069385", "0.5105847", "0.5096642", "0.50952435", "0.5094417", "0.50878745", "0.50870925", "0.5078615", "0.506312", "0.5060793" ]
0.56663114
33
This method acts as a filter for which command to run next based on the action property
function toCommand(commandName,action,res){ if(!action) console.error(commandName,' does not have an "action" to perform, please assign it one'); /* exit process on command action of 'exit' */ if(!action || action.toLowerCase() === 'exit'){ console.error('Exiting process due to command; ',commandName); process.exit(1); } /* go to final task command with values upon seeing an 'end' action */ else if(action.toLowerCase() === 'end'){ _command(_values); } /* go the the next command specified in 'action' */ else{ _currentTaskCommand = action; if(_taskCommands[_currentTaskCommand] === undefined){ console.error('No command exists by the name of ',_currentTaskCommand); process.exit(1); } if(_values[_currentTaskCommand] === undefined || typeof _values[_currentTaskCommand] === 'object' || _taskCommands[_currentTaskCommand].repeatable){ runCommand(_currentTaskCommand,_taskCommands[_currentTaskCommand]); } else{ res = _values[_currentTaskCommand]; toCommand(_currentTaskCommand,(typeof _taskCommands[_currentTaskCommand].action === 'function' ? _taskCommands[_currentTaskCommand].action(res,_values) : _taskCommands[_currentTaskCommand].action),res); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isForAction(action) {\n return this.command.action === action;\n }", "function performNextAction() {\n console.log('performNextAction()');\n var nextAction = get('nextAction');\n if (nextAction) {\n nextAction = JSON.parse(nextAction);\n remove('nextAction');\n switch (nextAction.type) {\n case 'user':\n $('a.github-anywhere[data-user=\"' + nextAction.target + '\"]:first').click();\n break;\n case 'repo':\n $('a.github-anywhere[data-repo=\"' + nextAction.target.repo + '\"][data-user=\"' + nextAction.target.user + '\"]:first').click();\n break;\n }\n }\n }", "advance() {\n\t\tlet f = this.actions.shift()\n\t\tif (f) f()\n\t}", "function next_action() {\n for (action in SaveActions) {\n var value = SaveActions[action];\n delete SaveActions[action];\n var query = SaveActionsToAjax[action](value);\n if (query instanceof Array)\n queue = queue.concat(query);\n else\n queue.push(query);\n return true;\n }\n return false;\n }", "function callNextPukiAction(act){\n\tpukiInteract=true;\n\tif(nextPukiAction != ''){\n\t\tpukiAction = nextPukiAction;\n\t\tnextPukiAction='';\n\t}else{\n\t\tpukiAction = act;\t\n\t}\n}", "function handleActions(key, next) {\n let actions = $(\"#\" + key).find(\"action\");\n if (actions.size() == 0)\n return;\n\n actions.each(function (index, action) {\n handleSingleAction($(action), next);\n });\n }", "action(action, value) {\n\t switch (action) {\n\t // Change to parent view\n\t case 'parent':\n\t this._parentAction(value);\n\t return;\n\t // Change provider\n\t case 'provider':\n\t if (value !== this.provider) {\n\t this._providerAction(value);\n\t }\n\t return;\n\t // Global search\n\t case 'search':\n\t if (typeof value !== 'string') {\n\t return;\n\t }\n\t value = value.trim().toLowerCase();\n\t if (value === this.keyword) {\n\t return;\n\t }\n\t this._searchAction(this.provider, value);\n\t return;\n\t // Change current page\n\t case 'pagination':\n\t if (value === 'more' && this._showMoreButton()) {\n\t // Change to current page + 1\n\t value = this.route.params.page + 1;\n\t }\n\t // Check number\n\t if (typeof value === 'string') {\n\t value = parseInt(value);\n\t }\n\t if (typeof value !== 'number' ||\n\t isNaN(value) ||\n\t value === this.route.params.page ||\n\t value < 0) {\n\t return;\n\t }\n\t // Check for \"more\"\n\t if (value > 0 && this._showMoreButton()) {\n\t // Create sibling route\n\t this._triggerFullResults(value);\n\t return;\n\t }\n\t this.route.params.page = value;\n\t this.blocksRequireUpdate = true;\n\t break;\n\t // Collections filter\n\t case 'collections':\n\t this._collectionsAction(value, 0);\n\t return;\n\t // Collections filter, called from child view\n\t case 'collections-internal':\n\t this._collectionsAction(value, 1);\n\t return;\n\t default:\n\t return;\n\t }\n\t // Action has changed something - trigger update event\n\t this._triggerUpdated();\n\t }", "get action () {\n\t\treturn this._action;\n\t}", "get action () {\n\t\treturn this._action;\n\t}", "get action () {\n\t\treturn this._action;\n\t}", "function handleSingleAction(action, next) {\n let actionName = action.attr(\"name\");\n let showInto;\n let item;\n\n log && console.log(\"Action received : \" + actionName);\n\n switch (actionName) {\n case \"start\":\n init();\n agentName = undefined;\n break;\n case \"reset\":\n init();\n break;\n case \"hit\":\n\n looseXM();\n break;\n case \"itemUpdate\":\n\n item = action.attr(\"item\");\n let count = parseInt(action.attr(\"count\"));\n updateItem(item, count);\n break;\n case \"glyph\":\n\n if (next == false) {\n alert(\"Sorry, there is an error.\");\n location.reload();\n }\n\n let glyphLevel = parseInt(action.attr(\"level\"));\n let itemWon = action.attr(\"itemWon\");\n let itemCount = action.attr(\"itemCount\");\n let time = action.attr(\"time\");\n launchGlyphGame(glyphLevel, $(action), itemCount, itemWon, time, next);\n break;\n case \"cssUpdate\":\n\n $(action.attr(\"element\")).css(action.attr(\"rule\"), action.attr(\"value\"));\n break;\n case \"setAgentName\":\n\n if (agentName != undefined)\n break;\n\n let message = action.attr(\"message\");\n agentName = prompt(message);\n if (agentName == undefined || agentName.length <= 0)\n agentName = randomName[getRandom(0, randomName.length - 1)];\n showInto = action.attr(\"showInto\");\n $(showInto).text(agentName);\n break;\n case \"image\":\n\n updateImage(action.attr(\"rule\"), action.attr(\"selector\"), action.attr(\"value\"), action.attr(\"dataName\"), action.attr(\"newName\"));\n break;\n case \"resetCSS\":\n\n let neutralColor = \"#d3d3d3\";\n\n $(\"html\").css(\"color\", neutralColor);\n $(\"button\").css(\"background-color\", neutralColor);\n $(\".section button:hover\").css({\n 'background-color': \"dark-grey\",\n \"color\": \"#101010\"\n });\n $(\"#status\").css(\"border-color\", neutralColor);\n $(\".section\").css(\"border-color\", neutralColor);\n $(\".xm\").css({\n 'border-color': neutralColor,\n \"color\": neutralColor\n });\n\n break;\n case \"resistance\":\n\n let p = action.siblings(\"p\").last();\n p.css({\n \"color\": \"lightblue\",\n \"text-align\": \"center\"\n });\n p.hide();\n\n setTimeout(function () {\n p.show();\n }, 1000);\n\n break;\n case \"setFaction\":\n\n showInto = action.attr(\"showInto\");\n let isResistant = action.attr(\"resistant\");\n //isResistant == \"true\" && $(showInto).html(\"résistance\");\n //isResistant == \"false\" && $(showInto).html(\"illuminés\");\n\n let colorCSS;\n\n if (isResistant == \"true\")\n colorCSS = \"#11ecf7\";\n else\n colorCSS = \"#06cc58\";\n\n $(\"html\").css(\"color\", colorCSS);\n $(\"button\").css('background-color', colorCSS);\n $(\".section\").css(\"border-color\", colorCSS);\n $(\"#status\").css(\"border-color\", colorCSS);\n $(\".xm\").css({\n 'border-color': colorCSS,\n \"color\": colorCSS\n });\n\n break;\n case \"deploy\":\n\n item = getInventory(action.attr(\"item\"));\n let looseXMPerDeploy = parseInt(action.attr(\"looseXMPerDeploy\"));\n\n let divImage = action.siblings(\"div.image\");\n let buttonsAction = action.siblings(\"button\");\n let messageSuccess = action.siblings(\".success\");\n let messageNoMoreStuff = action.siblings(\".warningStuff\");\n\n action.parent(\".section\").find(\"span.item\").each(function () {\n $(this).html(item[\"name\"]);\n });\n\n // Set deploy items to self.\n buttonsAction.first().data(\"go\", action.parent(\".section\").attr(\"id\"));\n\n // Hide exit and success button\n messageSuccess.hide();\n buttonsAction.show();\n buttonsAction.last().hide();\n messageNoMoreStuff.hide();\n\n if (divImage.children().size() == 0) {\n // Starting deploy\n updateImage(\"add\", divImage, item[\"name\"] + \"/0.png\", item[\"name\"] + \"_0\", undefined);\n\n if (next == false) {\n alert(\"Oops, an error. Sorry about that\");\n location.reload();\n }\n\n buttonsAction.last().data(\"go\", next);\n } else if (item[\"count\"] <= 0) {\n messageNoMoreStuff.find(\".item\").html(item[\"name\"]);\n messageNoMoreStuff.show();\n buttonsAction.first().hide();\n } else {\n let name = divImage.find(\"img\").first().data(\"name\");\n let result = name.split(\"_\");\n let numberOfResoDeployed = parseInt(result[1]);\n\n // Deploy one item\n numberOfResoDeployed++;\n item[\"count\"]--;\n looseXM(looseXMPerDeploy);\n updateImage(\"update\", divImage, item[\"name\"] + \"/\" + numberOfResoDeployed + \".png\", item[\"name\"] + \"_\" + (numberOfResoDeployed - 1), item[\"name\"] + \"_\" + numberOfResoDeployed);\n\n if (numberOfResoDeployed >= MAX_RESONATORS) {\n // End, show exit button and success message\n divImage.html(\"\");\n buttonsAction.hide();\n buttonsAction.last().show();\n messageSuccess.show();\n setXM(parseInt(getXM() + MAX_RESONATORS)); // Regain MAX_RESONATORS XM\n }\n\n if (getXM() <= 0) {\n endGame();\n }\n }\n break;\n default:\n\n log && console.log(\"[FATAL ERROR] \" + actionName + \" has not been defined in handleSingleAction !\");\n alert(\"Oups. Something went wrong. Sorry about that :(\");\n location.reload();\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 }", "run()\n {\n _.forEach(this._roomCreeps.creeps, creep => {\n var action = creep.action;\n if (!this._actionList[action]) action = \"Action.None\";\n this._actionList[action].run(creep);\n });\n }", "get action() {\n\t\treturn this.__action;\n\t}", "handleAction(action) {\n switch(action.type){\n case 'ADD_TODO':\n this.addTodo(action.item)\n break\n case 'REMOVE_TODO':\n this.removeTodo(action.item)\n break\n case 'TOGGLE_TODO':\n this.toggleTodo(action.item)\n break\n case 'SET_FILTER':\n this.setFilter(action.item)\n break\n default:\n break\n }\n this.emitChange()\n }", "commandFor(action) {\n switch (action) {\n case 'check':\n return `${this.binaryFilePath} ${this.actions.check.commandFlags}`;\n case 'format':\n return `${this.binaryFilePath} ${this.actions.format.commandFlags}`;\n default:\n throw Error('Unknown action type');\n }\n }", "commandFor(action) {\n switch (action) {\n case 'check':\n return `${this.binaryFilePath} ${this.actions.check.commandFlags}`;\n case 'format':\n return `${this.binaryFilePath} ${this.actions.format.commandFlags}`;\n default:\n throw Error('Unknown action type');\n }\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 getActions() {\n\t var newFilters = [];\n\t var oldFilters = [];\n\n\t stateWatchers.forEach(function (watcher, i) {\n\t var nextVal = next[i];\n\t var prevVal = prev[i];\n\t newFilters = newFilters.concat(nextVal);\n\t oldFilters = oldFilters.concat(prevVal);\n\n\t // no update or fetch if there was no change\n\t if (nextVal === prevVal) return;\n\n\t if (nextVal) doUpdate = true;\n\n\t // don't trigger fetch when only disabled filters\n\t if (!onlyDisabled(nextVal, prevVal)) doFetch = true;\n\t });\n\n\t // make sure change wasn't only a state move\n\t // checking length first is an optimization\n\t if (doFetch && newFilters.length === oldFilters.length) {\n\t if (onlyStateChanged(newFilters, oldFilters)) doFetch = false;\n\t }\n\t }", "action(action, value) {\n\t switch (action) {\n\t // Select parent view\n\t case 'parent':\n\t this._parentAction(value);\n\t return;\n\t // Change provider\n\t case 'provider':\n\t if (value !== this.provider) {\n\t this._providerAction(value);\n\t }\n\t return;\n\t // Global search\n\t case 'search':\n\t this._searchAction(this.provider, value);\n\t return;\n\t // Search icons\n\t case 'filter':\n\t if (typeof value !== 'string') {\n\t return;\n\t }\n\t value = value.trim().toLowerCase();\n\t if (value === this.route.params.filter) {\n\t return;\n\t }\n\t this.route.params.filter = value;\n\t this.blocksRequireUpdate = true;\n\t break;\n\t // Change current page\n\t case 'pagination':\n\t if (typeof value === 'string') {\n\t value = parseInt(value);\n\t }\n\t // Check number\n\t if (typeof value !== 'number' ||\n\t isNaN(value) ||\n\t value < 0 ||\n\t value === this.route.params.page) {\n\t return;\n\t }\n\t // Change page\n\t this.route.params.page = value;\n\t this.blocksRequireUpdate = true;\n\t break;\n\t // Change reference icon\n\t case 'icons-nav':\n\t if (value === '' || value === null) {\n\t // Reset\n\t this.route.params.icon = '';\n\t break;\n\t }\n\t // Check type\n\t if (typeof value !== 'string') {\n\t return;\n\t }\n\t // Change reference icon and automatically set page\n\t this.route.params.icon = value;\n\t this.route.params.page = null;\n\t this.blocksRequireUpdate = true;\n\t break;\n\t // Filters\n\t case 'tags':\n\t this._filterAction('tag', value);\n\t return;\n\t case 'themePrefixes':\n\t this._filterAction('themePrefix', value);\n\t return;\n\t case 'themeSuffixes':\n\t this._filterAction('themeSuffix', value);\n\t return;\n\t // Parent view's filter\n\t case 'collections':\n\t this._collectionsAction(value);\n\t return;\n\t default:\n\t return;\n\t }\n\t // Action has changed something - trigger update event\n\t this._triggerUpdated();\n\t }", "action() {}", "get hasAction() {\n return !!this.data.action;\n }", "function addAction(action) {\n\tif (action === 'sugar') {\n\t\tlastAction.push('sugar');\n\t}\n\telse {\n\t\tlastAction.push('bond');\n\t}\n}", "action(action, value) {\n\t switch (action) {\n\t // Parent view\n\t case 'parent':\n\t this._parentAction(value);\n\t return;\n\t // Change provider\n\t case 'provider':\n\t if (value !== this.provider) {\n\t this._providerAction(value);\n\t }\n\t return;\n\t // Global search\n\t case 'search':\n\t if (this._sources.api) {\n\t this._searchAction(this.provider, value);\n\t }\n\t return;\n\t // Filter collections\n\t case 'filter':\n\t if (typeof value !== 'string') {\n\t return;\n\t }\n\t value = value.trim().toLowerCase();\n\t if (this.route.params.filter !== value) {\n\t this.route.params.filter = value;\n\t this.blocksRequireUpdate = true;\n\t }\n\t else {\n\t return;\n\t }\n\t break;\n\t // Filter categories\n\t case 'categories':\n\t if ((value === null || typeof value === 'string') &&\n\t value !== this.route.params.category) {\n\t this.route.params.category = value;\n\t this.blocksRequireUpdate = true;\n\t }\n\t else {\n\t return;\n\t }\n\t break;\n\t // Select collection, called from child view\n\t case 'collections-internal':\n\t if (typeof value !== 'string' || value === '') {\n\t return;\n\t }\n\t this._triggerCollectionAction(value, 1);\n\t return;\n\t // Select collection\n\t case 'collections':\n\t if (typeof value !== 'string' || value === '') {\n\t return;\n\t }\n\t this._triggerCollectionAction(value, 0);\n\t return;\n\t default:\n\t return;\n\t }\n\t // Action has changed something - trigger update event\n\t this._triggerUpdated();\n\t }", "function onAction(action) {\n const newAction = ['dev', 'qa', 'prod'].reduce((acc, key) => {\n if(action[key] !== currentAction[key]) {\n return {...acc, [key]: action[key] }\n }\n return acc;\n }, {});\n\n if(Object.keys(newAction).length === 0) {\n return;\n }\n\n dispatch({ type: 'setAction', payload: newAction });\n }", "step(action){\r\n\r\n }", "action(action, value) {\n\t switch (action) {\n\t // Change view\n\t case 'parent':\n\t this._parentAction(value);\n\t return;\n\t // Change provider\n\t case 'provider':\n\t this._providerAction(value);\n\t return;\n\t // Set icons\n\t case 'set':\n\t this.setIcons(value);\n\t // Returning because setIcons will trigger event\n\t return;\n\t // Search icons\n\t case 'filter':\n\t if (typeof value !== 'string') {\n\t return;\n\t }\n\t value = value.trim().toLowerCase();\n\t if (value === this.route.params.filter) {\n\t return;\n\t }\n\t this.route.params.filter = value;\n\t this.blocksRequireUpdate = true;\n\t break;\n\t // Change current page\n\t case 'pagination':\n\t if (typeof value === 'string') {\n\t value = parseInt(value);\n\t }\n\t // Check number\n\t if (typeof value !== 'number' ||\n\t isNaN(value) ||\n\t value < 0 ||\n\t value === this.route.params.page) {\n\t return;\n\t }\n\t // Change page\n\t this.route.params.page = value;\n\t this.blocksRequireUpdate = true;\n\t break;\n\t default:\n\t return;\n\t }\n\t // Action has changed something - trigger update event\n\t this._triggerUpdated();\n\t }", "setUpNextAction (protagonist, actionTemplate, actionEvent) {\n const actionReady = new ActionReadyEvent(protagonist, actionEvent.actionId);\n\n actionEvent.addOutcome(\n actionReady,\n this,\n actionEvent.t + actionTemplate.secondsUntilNextAction()\n );\n }", "performAction() {\n this.show_tooltip = !this.show_tooltip;\n this.on_action.emit();\n }", "actionable(action) {\n const self = this;\n return (rule, normalizedRule, parent) => {\n const ruleIsAMatch = self.test(rule, normalizedRule);\n if (ruleIsAMatch) {\n action(rule, parent);\n }\n return ruleIsAMatch;\n };\n }", "get action() { return this.actionIn; }", "handleAction(action, shiftKey) {\n if (!(action in this.actions)) {\n console.error('illegal action', action);\n return; // weird!\n }\n this.actions[action](shiftKey);\n }", "activate() {\n if(turn.actions < this.actions) {\n hand.deselect();\n return;\n }\n resolver.proccess(this.results, this.actions, this.discard.bind(this));\n }", "function filter (type) {\n const filteredType = []\n for (let i = 0; i < actionList.length; i++) {\n const action = actionList[i]\n if (action.type === type) {\n filteredType.push(action)\n }\n }\n return filteredType\n }", "listAction() {}", "function selectedAction(action) {\n switch (action) {\n case \"View Products for Sale\":\n displayProducts();\n break;\n case \"View Low Inventory\":\n displayLowStock();\n break;\n case \"Add to Inventory\":\n addMore();\n break;\n default:\n addProduct();\n break;\n };\n}", "action( data ){\n return data && data.actionNew ?\n ( typeof data.actionNew === 'function' ? data.actionNew() : data.actionNew ) : null;\n }", "get actionInput() {\n return this._action;\n }", "async function executeAction(event) {}", "function newPropertyAction(formula, pred, action) {\r\n\tfyi(\"newPropertyAction: \"+pred);\r\n formula.propertyAction[pred] = action;\r\n\tvar fixEndA = formula.statementsMatching(undefined, pred, undefined);\r\n\tvar i;\r\n\tfor (i=0; i<fixEndA.length; i++) { // NOT optimized - sort fixEndA etc\r\n//\t fyi(\"nePropertyAction: retrospective action for \"+st)\r\n\t if (action(formula, fixEndA[i].subject, pred, fixEndA[i].object)) {\r\n//@@\t\tkb.remove(st); /// messing up the list we are iterating over?? @@\r\n\t\tfyi(\"newPropertyAction: NOT removing \"+fixEndA[i]);\r\n\t }\r\n\t}\r\n\treturn false;\r\n }", "onAction(action, entry) {\n switch (action) {\n case 'install':\n return this.model.install(entry);\n case 'uninstall':\n return this.model.uninstall(entry);\n case 'enable':\n return this.model.enable(entry);\n case 'disable':\n return this.model.disable(entry);\n default:\n throw new Error(`Invalid action: ${action}`);\n }\n }", "onAction(action, entry) {\n switch (action) {\n case 'install':\n return this.model.install(entry);\n case 'uninstall':\n return this.model.uninstall(entry);\n case 'enable':\n return this.model.enable(entry);\n case 'disable':\n return this.model.disable(entry);\n default:\n throw new Error(`Invalid action: ${action}`);\n }\n }", "onAction(action) {\n switch (action.type) {\n case 'ADD_ACCOUNT':\n this._startUpdateStream(action.id, undefined, undefined)\n return\n case 'DELETE_ACCOUNT':\n this._stopUpdateStream(action.id)\n return\n }\n }", "checkAction(){\n Actions.pop();\n }", "handleActions(action){\n\t\tswitch(action.type){\n\t\t\tcase \"VIEW_ACTION\":\n\t\t\t\tconsole.log(this.data);\n\t\t\t\tbreak;\n\t\t\tcase \"FILTER_SEARCH\":\n\t\t\t\tthis.bugSearch(action.searchParameters);\n\t\t\t\tbreak;\n\t\t\tcase \"UPDATE_BUGS\":\n\t\t\t\tthis.update(action.dbId, action.issueId, action.date, action.priority, action.summary, action.severity, action.description, action.reporter, action.assignedUser, action.status);\n\t\t\t\tbreak;\n\t\t\tcase \"FILTER_BUGS\":\n\t\t\t\tthis.filter(action.filterText);\n\t\t\t\tbreak;\n\t\t\tcase \"CLEAR_FILTER\":\n\t\t\t\tthis.clearFilter();\n\t\t\t\tbreak;\n\t\t\tcase \"NEW_BUG\":\n\t\t\t\tthis.newBug(action.id, action.issueId, action.date, action.priority, action.summary, action.severity, action.description, action.reporter, action.assignedUser, action.status);\n\t\t\t\tbreak;\n\t\t\tcase \"SORT\":\n\t\t\t\tthis.sort(action.field);\n\t\t\t\tbreak;\n\t\t\tcase \"OUTPUT\":\n\t\t\t\tthis.filter(action.filter);\n\t\t\t\tthis.bugSearch(action.searchText);\n\t\t\t\tthis.sort(action.sort);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "function BOT_reqExecuteAction(topic,action) {\r\n\tvar ta,func;\r\n\tvar com = \"\";\r\n\tvar arg = \"\";\r\n\tvar res;;\r\n\tta = BOT_getTopicAttribute(topic, action);\r\n\tBOT_traceString += \"TOPIC LINE \" + ta + \"\\n\";\r\n\tif(!ta) return (BOT_reqSay(false,\"SORRY\",\"ACTIONNOTFOUND\",topic,action)) \r\n\tfunc = BOT_getTopicAttributeTagValue(ta,\"VAL\");\r\n\tBOT_traceString += \"FUNCTION \" + func + \"\\n\";\r\n\tif(func == undefined) return (BOT_reqSay(false,\"SORRY\",\"TAGNOTFOUND\",topic,action))\r\n\targ = BOT_theReqValue ? BOT_theReqValue : undefined;\r\n\tif(typeof(func) == \"string\") com = func +'('+topic+','+arg+')';\r\n\telse if(BOT_isArray(f)) com = func[0]+'('+topic+','+func[1]+')'; // only two elements\r\n\tres = eval(com);\r\n\tBOT_theLastAction = action;\r\n\tBOT_theLastActionTopic = topic;\r\n\t// when results of actin is a string its is replyed\r\n\tif(res != undefined && typeof(res) == \"string\") BOT_reqSay(true,\"PROUD\",\"DONEWITHREPLY\",res) \r\n\telse BOT_reqSay(true,\"PROUD\",\"DONE\",action)\r\n\r\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 }", "action(action, value) {\n\t switch (action) {\n\t // Navigate to parent view\n\t case 'parent':\n\t this._parentAction(value);\n\t return;\n\t // Change provider\n\t case 'provider':\n\t this._providerAction(value);\n\t return;\n\t }\n\t }", "performAction () {\n if(this.action != null) \n this.action();\n }", "function initAndSearchAction(elem) {\n if (elem.id === this.act) {\n action = elem;\n return true;\n }\n return false;\n }", "processNextCommand() {\n var nextCmd = this._script.commands.shift();\n if (! nextCmd) {\n return;\n }\n\n // Process the next command when the current\n // command resolves.\n $.when(this.commandHandler.handle(nextCmd)).then(() => {\n this.processNextCommand();\n });\n }", "doExecute(action, ...args) {\n if(!Reflect.has(this.service, action)){\n throw Error(`service ${this.name} hasnt action ${action}`)\n }\n return this.service[action](...args)\n }", "function Action() {\n\n //default action settings\n this.minimum_elevation = 2;\n this.maximum_elevation = 13;\n this.min_distance = 1;\n this.max_distance = 1;\n this.nextSelection = \"self\";\n this.stop_elevation_up = 100;\n this.stop_elevation_down = -1;\n this.extra_description = \"\";\n this.also_build_road = true;\n this.cloud_clear = 0;\n this.multi_target = false;\n this.destroy_resource = true;\n this.can_use_roads = false;\n this.infinite_range = false;\n\n this.river_only = false;\n this.can_river = false;\n this.stop_on_rivers = false;\n\n //evaluates if a target can receive an action\n this.targetFilterFunction = function(world, actor, position, target) { return true; }\n\n //evaluates if the action will be displayed in the list\n this.activation = function(world, actor, position) { return true; }\n\n //evaluates if the action will be enabled in the list\n this.requirement = function(world, actor, position) { return true; }\n\n //additional effects of the action, which happen after the default ones\n this.effect = function(world, actor, position, target) { }\n\n this.getDescription = function() { return this.description; }\n\n this.getExtraDescription = function() { return this.extra_description; }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /////////////////////////////////////////////////////////\n // ACTION PATHFINDER SETTINGS //\n /////////////////////////////////////////////////////////\n\n //STOP FUNCTION (for pathfinder)\n this.stopFunction = function(world, hex, next_hex) {\n \n let this_tile = world.getTile(hex);\n let next_tile = world.getTile(next_hex);\n\n if (next_tile.elevation >= this.stop_elevation_up && this_tile.elevation < this.stop_elevation_up)\n return true;\n\n if (next_tile.elevation <= this.stop_elevation_down && this_tile.elevation > this.stop_elevation_down)\n return true;\n\n if (this.stop_on_rivers && world.onRiver(next_hex) )\n return true;\n \n return false;\n }\n\n //NEIGHBORS FUNCTION (for pathfinder)\n this.getNeighborsFunction = function(world, hex) {\n return world.world_map.getNeighbors(hex);\n }\n\n\n //STEP COST FUNCTION (for pathfinder)\n this.stepCostFunction = function(world, hex, next_hex) {\n var next_tile = world.getTile(next_hex);\n var this_tile = world.getTile(hex);\n\n if (next_tile.elevation > this.maximum_elevation) \n return undefined;\n if (next_tile.elevation < this.minimum_elevation) \n return undefined;\n\n if (!this.river_only && !this.can_river)\n if( world.onRiver(next_hex) && world.noUnitTypeInArea(next_hex, 0, 'river-dock') )\n return undefined;\n\n if (this.river_only) {\n if (!world.alongRiver(hex, next_hex) )\n return undefined;\n }\n\n\n let cost = 1;\n\n if (world.areRoadConnected(hex,next_hex) && this.can_use_roads)\n cost = 0.5;\n\n return cost;\n }\n\n this.getPathfinder = function() {\n\n let action = this;\n\n //get the movement functions\n var stepCostFunction = action.stepCostFunction.bind(action); \n var neighborFunction = action.getNeighborsFunction.bind(action);\n var stopFunction = action.stopFunction.bind(action); \n\n //create a pathfinder to explore the area around the unit\n return new PathFinder(stepCostFunction, neighborFunction, stopFunction);\n }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /////////////////////////////////////////////////////////\n // ACTION EFFECTS //\n /////////////////////////////////////////////////////////\n\n this.doAction = function(world, actor, position, target) {\n\n if (this.targetIsOK(world, actor, position, target)) {\n \n //Either do a single action or do the action on all targets\n if (this.multi_target) {\n for (hex of actor.range) \n this.doSingleAction(world, actor, position, hex);\n } else {\n this.doSingleAction(world, actor, position, target);\n }\n\n\n this.updateActionRange(world, actor, position);\n\n\n //else just select that new location\n } else {\n actor.range = [];\n } \n };\n\n\n //Trigger the effects of the action\n this.doSingleAction = function(world, actor, position, target) {\n\n world.clearClouds(target, this.cloud_clear);\n\n if (this.also_build_road)\n this.createRoad(world, position, target);\n\n if (this.new_unit_type)\n world.addUnit(target, this.new_unit_type, actor);\n\n if (this.free_pop_cost)\n world.population -= this.free_pop_cost;\n\n if (this.total_pop_cost)\n world.total_population -= this.total_pop_cost;\n\n if (this.destroy_resource)\n world.destroyResource(target);\n\n //then do the action\n this.effect(world, actor, position, target);\n }\n\n this.targetIsOK = function(world, actor, position, target) {\n let target_object = world.units.get(target);\n\n if (!this.targetFilterFunction(world, actor, position, target))\n return false;\n if (this.target == \"both\")\n return true;\n if (!target_object && this.target==\"land\")\n return true;\n if (target_object && this.target==\"unit\")\n return true;\n\n return false;\n };\n\n this.updateActionRange = function(world, actor, position) {\n\n actor.range = this.getActionRange(world, actor, position );\n };\n\n this.getActionRange = function(world, actor, position) {\n\n let pathfinder = this.getPathfinder();\n\n if (this.infinite_range) {\n world.clearClouds();\n return [];\n }\n\n var max_distance = this.max_distance;\n var min_distance = this.min_distance;\n var actionRange = pathfinder.getRange( world, position, max_distance, min_distance );\n\n //limit range to elevations\n let upperRange = actionRange.filter(hex => world.getMapValue(hex).elevation >= this.minimum_elevation );\n let middleRange = upperRange.filter(hex => world.getMapValue(hex).elevation <= this.maximum_elevation );\n\n //clear the clouds over the area explored\n for (let hex of middleRange) {\n world.clearClouds(hex,1);\n }\n\n //remove unsuitable targets\n let filteredRange = middleRange.filter(target => this.targetFilterFunction(world, actor, position, target));\n\n return filteredRange;\n };\n\n this.getActionPath = function(world, actor, position, target, extra_max_distance) {\n\n let pathfinder = this.getPathfinder();\n\n var max_distance = this.max_distance;\n if (extra_max_distance)\n max_distance = extra_max_distance;\n\n var min_distance = this.min_distance;\n var actionPath = pathfinder.getPath( world, position, target, max_distance );\n\n return actionPath;\n };\n\n this.createRoad = function(world, origin, target) {\n\n let pathfinder = this.getPathfinder();\n\n var max_distance = this.max_distance;\n var actionPath = pathfinder.getPath( world, origin, target, max_distance );\n\n if (actionPath instanceof Array)\n world.buildRoad(actionPath);\n }\n}", "function actionCreator(){\n return action;\n }", "function BOT_onExecute() {\r\n\tif(!BOT_theReqAction && BOT_theLastAction) BOT_theReqAction = BOT_theLastAction;\r\n\tif(!BOT_theReqAction && BOT_theReqText) return(BOT_reqSay(false,\"PUZZLED\",\"BADACTION\",BOT_theReqText));\r\n\tif(!BOT_theReqAction) return(BOT_reqSay(false,\"PUZZLED\",\"NEEDSACTION\"));\r\n\t\r\n\t// Try into current topic\r\n\tif(BOT_theReqAction && BOT_get(BOT_theReqTopic,BOT_theReqAction,\"VAL\") != undefined) BOT_reqExecuteAction(BOT_theReqTopic,BOT_theReqAction); \r\n\tif(BOT_reqFilled) return;\r\n\t\r\n\t// tries in external topics ocontrolled by the current bot -- attribute _exec\r\n\tvar thebotobject = eval(BOT_theBotId);\r\n\tvar thebottopicid = thebotobject.topicId;\r\n\tvar execlist = BOT_get(thebottopicid,\"_exec\",\"VAL\");\r\n\t// tries in turn the 3 first elements of the _exec list of current bot\r\n\tif(execlist && execlist.length>0) { if(BOT_get(execlist[0],BOT_theReqAction,\"VAL\")) BOT_reqExecuteAction(execlist[0],BOT_theReqAction); }\r\n\tif(BOT_reqFilled) return;\r\n\t// try in a second external topic\r\n\tif(execlist && execlist.length>1) { if(BOT_get(execlist[1],BOT_theReqAction,\"VAL\")) BOT_reqExecuteAction(execlist[1],BOT_theReqAction); }\r\n\tif(BOT_reqFilled) return;\r\n\t// try in a third external topic\r\n\tif(execlist && execlist.length>2) { if(BOT_get(execlist[2],BOT_theReqAction,\"VAL\")) BOT_reqExecuteAction(execlist[2],BOT_theReqAction); }\r\n\tif(BOT_reqFilled) return;\r\n\t\r\n\tBOT_reqSay(false,\"PUZZLED\",\"TOPICCANTDOACTION\",BOT_theReqAction,BOT_theReqTopic);\r\n}", "function commandSearch(action, searchParam) {\n if (action === \"movie-this\") {\n var movieTitle = searchParam;\n if (!movieTitle) {\n movieTitle = \"Mr. Nobody\";\n }\n movieThis(movieTitle);\n } else if (action === \"spotify-this-song\") {\n var spotifySong = searchParam;\n if (!spotifySong) {\n spotifySong = \"The Sign by Ace of Base\";\n }\n spotifyThis(spotifySong);\n } else if (action === \"concert-this\") {\n var concert = searchParam;\n concertThis(concert);\n } else if (action === \"do-what-it-says\") {\n var whatitsays = searchParam;\n doWhatItSaysThis(whatitsays);\n }\n \n}", "function chooseAction() {\n\tinquirer\n\t\t.prompt({\n\t\t\tname: \"action\", \n\t\t\ttype: \"rawlist\", \n\t\t\tmessage: \"What do you want to do?\", \n\t\t\tchoices: [\"VIEW PRODUCTS\", \"VIEW LOW INVENTORY\", \"ADD TO INVENTORY\", \"ADD NEW PRODUCT\", \"QUIT\"]\n\t\t})\n\t\t.then(function(ans) {\n\t\t\tif(ans.action.toUpperCase() ===\"VIEW PRODUCTS\") {\n\t\t\t\tviewProducts(); \n\t\t\t} \n\t\t\telse if (ans.action.toUpperCase() === \"VIEW LOW INVENTORY\") {\n\t\t\t\tviewLowInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD TO INVENTORY\") {\n\t\t\t\taddInventory(); \n\t\t\t}\n\t\t\telse if (ans.action.toUpperCase() === \"ADD NEW PRODUCT\") {\n\t\t\t\taddNewProduct(); \n\t\t\t}\n\t\t\telse {\n\t\t\t\tendConnection(); \n\t\t\t}\n\t\t})\n}", "async onAction(msg, nlp){\n switch(nlp.action[1]){\n\n case \"joke\":\n this.joke(msg)\n break;\n\n case \"chuck\":\n this.chuck(msg)\n break;\n\n default:\n return\n }\n }", "getAction(name){\n return _useAction.bind(this,name);\n }", "async exec(lifecycle, action, ...data) {\n const handlers = this.getActionHandlers(lifecycle, action);\n if (!handlers) {\n return;\n }\n for (let handler of handlers) {\n if (typeof handler === 'function') {\n await handler(...data);\n }\n else {\n await this.resolver.call(handler, undefined, data);\n }\n }\n }", "firstAction() {\n return new Action.End(this.time);\n }", "handleActions(action) {\n switch(action.type) {\n case \"NEXT_NODE\": {\n this.toNextNode()\n break\n } case \"PREVIOUS_NODE\": {\n this.toPreviousNode()\n break\n } case \"GO_TO\": {\n this.resetState()\n break\n } case \"RESET\": {\n this.resetState()\n break\n } case \"BACK\": {\n this.resetState()\n break\n }\n }\n }", "function globalNextQActions()\n\t{\n\t\t// Multi-part: Make room for response text, continue button\n\t\tif (problem.get('ansType') === 'multiPart')\n\t\t\tview.shrinkSteps();\n\t}", "function determine(action) {\n switch (action) {\n case \"concert-this\":\n concertThis();\n break;\n case \"spotify-this-song\":\n spotifyThis();\n break;\n case \"movie-this\":\n movieThis();\n break;\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n default:\n console.log(\"Invalid arguments. Please see documentation and try again.\");\n }\n}", "function nextAction() {\n\tinquirer.prompt({\n\t\tmessage: \"What would you like to do next?\",\n\t\ttype: \"list\",\n\t\tname: \"nextAction\",\n\t\tchoices: [\"Add More Items\", \"Remove Items\", \"Alter Item Order Amount\", \"Survey Cart\", \"Checkout\"]\n\t})\n\t\t.then(function (actionAnswer) {\n\t\t\tswitch (actionAnswer.nextAction) {\n\t\t\t\tcase \"Add More Items\":\n\t\t\t\t\t// go to the start function\n\t\t\t\t\tstart();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Remove Items\":\n\t\t\t\t\t// go to the removal function\n\t\t\t\t\tremoveItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Checkout\":\n\t\t\t\t\t// go to the checkout tree;\n\t\t\t\t\tverifyCheckout();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Alter Item Order Amount\":\n\t\t\t\t\t// go to the function that alters the shopping cart qty\n\t\t\t\t\talterItem();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Survey Cart\":\n\t\t\t\t\t// look at the cart\n\t\t\t\t\tcheckoutFunction();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: console.log(\"how did you get here?\")\n\t\t\t}\n\t\t})\n}", "handleAllActions(action) {\n switch(action.name) {\n case \"DO_LOGIN\": {\n this.doLogin();\n }\n case \"DO_LOGOUT\": {\n this.doLogout();\n }\n }\n }", "callbackFor(action) {\n switch (action) {\n case 'check':\n return this.actions.check.callback;\n case 'format':\n return this.actions.format.callback;\n default:\n throw Error('Unknown action type');\n }\n }", "callbackFor(action) {\n switch (action) {\n case 'check':\n return this.actions.check.callback;\n case 'format':\n return this.actions.format.callback;\n default:\n throw Error('Unknown action type');\n }\n }", "handleAction() {\n return false\n }", "function Event_CompareToAction(action)\n{\n\t//by default: no match event\n\tvar result = new Event_EventResult();\n\n\t//do not bother processing anything if it should be ignored\n\tif (__DESIGNER_CONTROLLER && __DESIGNER_CONTROLLER.IsIgnoredSimlink && __DESIGNER_CONTROLLER.IsIgnoredSimlink(action.SimLinkId))\n\t\treturn result;\n\n\t//has valid advance and shouldn't be ignored?\n\tif (!String_IsNullOrWhiteSpace(action.Destiny))\n\t{\n\t\t//we need to determine whether we should check the qualificator or not\n\t\tvar bCheckData = !this.IgnoreData(this.InterpreterObject.DataObject.Class, this.Event);\n\t\t//overload\n\t\tresult = this.Match(action.InterpreterObjectId, true, \t\t//The Object Id which we are interested in\n\t\t\t-1, false, \t\t\t\t\t\t//The Object Class but we arent interested in this (only using id)\n\t\t\taction.Event, true, \t\t\t//The Event which we are interested in\n\t\t\taction.Data,\t\t\t\t\t//The Data and whether we are interested in it\n\t\t\tbCheckData,\t\t\t\t\t\t//whether we should check the qualificator or not\n\t\t\taction.UserDatas, \t\t\t\t//The user data to test\n\t\t\taction.InterpreterObjectIdEx, \t//the Interpreter Extra Event Object Id\n\t\t\taction.EventEx, \t\t\t\t//the Interpreter Extra Event Object Event\n\t\t\taction.DataEx); \t\t\t\t//the Interpreter Extra Event Object Data\n\t\t//match?\n\t\tif (result.Match)\n\t\t{\n\t\t\t//has bad data?\n\t\t\tif (result.BadData)\n\t\t\t{\n\t\t\t\t//have we got a tut?\n\t\t\t\tif (__SIMULATOR.StateManager.CurrentState.Tut)\n\t\t\t\t{\n\t\t\t\t\t//special message?\n\t\t\t\t\tif (result.BadDataRuleMessage)\n\t\t\t\t\t{\n\t\t\t\t\t\t//use this one\n\t\t\t\t\t\tresult.TriggerMessage = __SIMULATOR.StateManager.CurrentState.GetMessage(result.BadDataRuleMessage);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//use the action's bad message\n\t\t\t\t\t\tresult.TriggerMessage = __SIMULATOR.StateManager.CurrentState.GetMessage(__SIMULATOR.StateManager.CurrentState.BadDataMessageId);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//set message type as error\n\t\t\t\tresult.TriggerMessageType = __MSG_TYPE_TRIGGER_ON_ERROR;\n\t\t\t\t//add tutorial data for tut layer\n\t\t\t\tresult.TriggerData = { Data: { TriggerId: -1, ObjectId: this.InterpreterObject.DataObject.Id }, DisplayRect: Position_GetDisplayRect(this.InterpreterObject.HTML) };\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//advance the lesson\n\t\t\t\tresult.AdvanceToStateId = action.Destiny;\n\t\t\t\t//mark the id of the action\n\t\t\t\tresult.SimLinkId = action.SimLinkId;\n\t\t\t}\n\t\t}\n\t}\n\t//return the result\n\treturn result;\n}", "selectAction(game, cb) {\n if (BEST_FIRST_ACTION && parseInt(stateToString(game.grid)) === 0 && game.grid.length === 7) {\n return cb({index: 3, player: this.playerId});\n }\n cb(this.selectActionSync(game))\n }", "switch (action.type) {\n case 'START_DND':\n case 'UPDATE_DND':\n case 'STOP_DND':\n case 'MOUSE_MOVE':\n case 'START_TCO':\n case 'STOP_TCO':\n return 'SKIP'\n default:\n }\n\n const lastAction = lastRecord.action\n // If last action type doesn't equals to current action - always add it\n if (lastAction.type !== action.type) {\n return 'ADD'\n }\n else {\n // Depending on action type and it's attrs, add or replace record //todo: flow unable to understand, that action.type === lastAction.type\n if (action.type === 'SELECT' && lastAction.type === 'SELECT') {\n if (action.target !== lastAction.target) {\n return 'ADD'\n }\n else if (action.target === 'TABLE' && lastAction.target === 'TABLE') {\n return action.table === lastAction.table ? 'REPLACE' : 'ADD'\n }\n else if (action.target === 'ATTR' && lastAction.target === 'ATTR') {\n return action.table === lastAction.table && action.attr === lastAction.attr ? 'REPLACE' : 'ADD'\n }\n }\n if (action.type === 'MOVE_TABLE' && lastAction.type === 'MOVE_TABLE') {\n return action.table === lastAction.table ? 'REPLACE' : 'ADD'\n }\n if (action.type === 'SWITCH_ATTRS' && lastAction.type === 'SWITCH_ATTRS') {\n return (action.table === lastAction.table && action.attr1 === lastAction.attr1) ? 'REPLACE' : 'ADD'\n }\n if (action.type === 'CANCEL_SELECT' && lastAction.type === 'CANCEL_SELECT') {\n return 'REPLACE'\n }\n if (action.type === 'ADD_ATTR' && lastAction.type === 'ADD_ATTR') {\n return 'ADD'\n }\n if (action.type === 'UPDATE_ATTR' && lastAction.type === 'UPDATE_ATTR') {\n return 'ADD'\n }\n if (action.type === 'DELETE_ATTR' && lastAction.type === 'DELETE_ATTR') {\n return 'ADD'\n }\n if (action.type === 'ADD_TABLE' && lastAction.type === 'ADD_TABLE') {\n return 'ADD'\n }\n if (action.type === 'UPDATE_TABLE' && lastAction.type === 'UPDATE_TABLE') {\n return 'ADD'\n }\n if (action.type === 'DELETE_TABLE' && lastAction.type === 'DELETE_TABLE') {\n return 'ADD'\n }\n if (action.type === 'ADD_LINK' && lastAction.type === 'ADD_LINK') {\n return 'ADD'\n }\n if (action.type === 'DELETE_LINK' && lastAction.type === 'DELETE_LINK') {\n return 'ADD'\n }\n if (action.type === 'IMPORT_SCHEME_STATE' && lastAction.type === 'IMPORT_SCHEME_STATE') {\n return (JSON.stringify(action.schemeState) === JSON.stringify(lastAction.schemeState)) ? 'SKIP' : 'ADD'\n }\n if (action.type === 'CHANGE_SCHEME_SIZE' && lastAction.type === 'CHANGE_SCHEME_SIZE') {\n return 'REPLACE'\n }\n if (action.type === 'CHANGE_STYLE' && lastAction.type === 'CHANGE_STYLE') {\n return action.change.field === lastAction.change.field ? 'REPLACE' : 'ADD'\n }\n return 'SKIP'\n }\n}", "async peekAction() {\n let action = await getWskActionWithoutCode(this.wsk, this.actionName);\n if (action === null) {\n throw new Error(`Action not found: ${this.actionName}`);\n }\n\n // check if there was an agent leftover\n if (isAgent(action)) {\n // ups, action is our agent, not the original\n // happens if a previous wskdebug was killed and could not restore before it exited\n const backupName = getActionCopyName(this.actionName);\n\n // check the backup action\n try {\n const backup = await getWskActionWithoutCode(this.wsk, backupName);\n\n if (!backup) {\n // backup is also an agent (should not happen)\n throw new Error(`Dang! Agent is already installed and action backup is missing.\\n\\nPlease redeploy your action first before running wskdebug again.`);\n\n } else if (isAgent(backup)) {\n // backup is also an agent (should not happen)\n throw new Error(`Dang! Agent is already installed and action backup is broken (${backupName}).\\n\\nPlease redeploy your action first before running wskdebug again.`);\n\n } else {\n log.warn(\"Agent was already installed, but backup is still present. All good.\");\n\n // need to look at the original action\n action = backup;\n this.agentInstalled = true;\n }\n\n } catch (e) {\n if (e.statusCode === 404) {\n // backup missing\n throw new Error(`Dang! Agent is already installed and action backup is gone (${backupName}).\\n\\nPlease redeploy your action first before running wskdebug again.`);\n\n } else {\n // other error\n throw e;\n }\n }\n }\n return action;\n }", "beforeAction() {\n\n }", "function block() {\n switch (action) {\n case \"concert-this\":\n concertThis(searchQuery);\n break;\n case \"spotify-this-song\":\n spotifyThis(searchQuery);\n break;\n case \"movie-this\":\n movieThis(searchQuery);\n break;\n case \"do-what-it-says\":\n doWhatItSays(searchQuery);\n break;\n }\n}", "processIntent () {\n // Failsafe\n if (!this.action) this.goIdle()\n \n const action = this.action\n const intent = this.intent\n \n if (!intent) { // Go idle\n if (action?.name === 'move') this.goIdle()\n } else { // Perform a new action\n // Note: every 'move' action is considered a new action\n \n if (action?.name === 'idle' || action?.name === 'move' ) { // Can the action be overwritten by a new action? If not, the action must play through to its finish.\n this.action = {\n ...intent,\n name: intent.name,\n counter: (action.name === intent.name) ? action.counter : 0, // If the current action and new intent have the same name, it's just a continuation of the idle or move action, but with other new values (e.g. new directions)\n }\n }\n }\n }", "updateAction() {}", "function getUserAction(){\n process.stdin.once('data', (chunk) => {\n userAction = chunk.toString().trim();\n checkAction()\n\n});\n}", "getNextAction() {\n return this.sensorActions[this.getSensorValue()];\n }", "function handleAction(action) {\n console.log(\"action: %s\", action);\n}", "function actionCreator() {\n return action;\n }", "action(action = '') {\n\t\tif (action) {\n\t\t\tthis._action = String(action)\n\t\t\treturn this._action\n\t\t}\n\t\treturn this._action\n\t}", "function redoAction() {\n console.log('redoing action');\n if (index < actionStack.length - 1) {\n let action = JSON.parse(actionStack[++index])\n loadAction(action)\n //redraw things\n applyFilter(true)\n setUndoRedo();\n }\n}", "function executeList(): IEnumerator{\n\tisExecuting = true;\n\texecutionStep = 0;\n\tscrollToTop();\n\texecuteButton.GetComponent(Button).interactable = false;\n\tfor each(action in actionList){\n\t\tif (debugMode){\n\t\t\t yield WaitForSeconds(debugSpeed);\t\t\t\n\t\t}\n\t\t(action as function())();\n\t\texecutionStep++;\n\t}\n\tisExecuting = false;\n\tstartOverButton.GetComponent(Button).interactable = true;\n}", "handleActions(action) {\n switch (action.type) {\n // a casr per message\n case ErrorsOnlyActions.ERRORS_ONLY_ACTION: {\n this.activeErrorsOnly = action.value;\n this.emit(\"storeUpdated\");\n break;\n }\n default: {\n }\n }\n }", "function BOT_reqExistAction(topic,action) {\r\n\tif(BOT_get(topic,action,\"VAL\")) return true;\r\n\t// try in first external topic\r\n\tvar execlist = BOT_get(BOT_theTopicId,\"_exec\",\"VAL\");\r\n\tif(execlist && execlist.length>0) { if(BOT_get(execlist[0],action,\"VAL\")) return true; }\r\n\t// try in a second external topic\r\n\tif(execlist && execlist.length>1) { if(BOT_get(execlist[1],action,\"VAL\")) return true; }\r\n\treturn false\r\n}", "playNextAction() {\n let promise = {};\n if (this.currentAction === null || this.currentAction.count < 1) {\n this.currentAction = this.actions.callNextAction();\n }\n // No actions left, stop running\n if (!this.currentAction) {\n this.running = false;\n } else {\n this.currentAction.count -= 1;\n const ts = new Date().valueOf();\n const refresh = ts - this.timestamp > SmoConfig.idleRedrawTime;\n promise = SuiActionPlayback.actionPromise(this.view, this.currentAction.method, this.currentAction.args);\n if (refresh) {\n // Periodically refresh the whole screen and scroll\n promise = this.view.renderer.renderPromise();\n this.view.renderer.rerenderAll();\n this.timestamp = ts;\n promise.then(() => {\n const ls = this.view.score.staves[this.view.score.staves.length - 1];\n const lm = ls.measures[ls.measures.length - 1];\n if (lm.renderedBox) {\n this.view.tracker.scroller.scrollVisibleBox(lm.renderedBox);\n }\n this.playNextAction();\n });\n } else {\n // Usually, just perform the action and play the next action when any\n // redrawing has completed.\n promise.then(() => {\n this.playNextAction();\n });\n }\n }\n }", "prioritizeAction(action, sourceEffect) {\n\t\tfor (const [i, curAction] of this.list.entries()) {\n\t\t\tif (curAction === action) {\n\t\t\t\tthis.list.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\taction.sourceEffect = sourceEffect;\n\t\taction.order = 3;\n\t\tthis.list.unshift(action);\n\t}", "function actionCreator() {\n return action\n }", "function renderAction() {\n inquirer.prompt([\n {\n name: \"action\",\n massage: \"Select Action\",\n type: \"list\",\n choices: actions\n }\n ]).then(answer => {\n switch (answer.action) {\n case \"Add Departments\":\n addDept();\n break;\n case \"Add Roles\":\n addRoles();\n break;\n case \"Add Employees\":\n addEmp();\n break;\n case \"View Departments\":\n viewDept();\n break;\n case \"View Roles\":\n viewRoles();\n break;\n case \"View Employees\":\n viewEmp();\n break;\n case \"Update Employee Roles\":\n updateEmpRoles();\n break;\n case \"Delete Departments\":\n deleteDept();\n break;\n case \"Delete Roles\":\n deleteRoles();\n break;\n case \"Delete Employees\":\n deleteEmp();\n break;\n case \"Exit\":\n default:\n connection.end();\n process.exit();\n\n }\n });\n}", "function ACTION() {}", "function doAction(process, action, resource) {\n switch(action) {\n case \"requests\":\n if(resource[\"process\"]) {\n addEdge(process[\"name\"], resource[\"name\"]);\n resource = addWaitingProc(resource, process);\n\n $(\"#last-result-text\").html(process[\"name\"] + \" Requested (but does not own) \" + resource[\"name\"]);\n } else {\n addEdge(resource[\"name\"], process[\"name\"]);\n resource = setProcess(resource, process);\n\n $(\"#last-result-text\").html(process[\"name\"] + \" Now owns \" + resource[\"name\"]);\n }\n break;\n case \"releases\":\n removeEdge(resource[\"name\"], resource[\"process\"][\"name\"]);\n htmlText = resource[\"process\"][\"name\"] + \" Released \" + resource[\"name\"];\n\n resource = removeProcess(resource);\n\n if(resource[\"process\"]) {\n removeEdge(resource[\"process\"][\"name\"], resource[\"name\"]);\n addEdge(resource[\"name\"], resource[\"process\"][\"name\"]);\n htmlText += \" AND \" + resource[\"process\"][\"name\"] + \" Now owns \" + resource[\"name\"];\n }\n\n $(\"#last-result-text\").html(htmlText);\n break;\n }\n}", "function actionCreator() {\n return action\n}", "function handleFilterTask(state, action) {\r\n return {\r\n ...state,\r\n query: action.query\r\n };\r\n}", "handleActions(action){\n switch(action.type){\n case \"CREATE_FILE\":{\n this.createFile(action.text);\n }\n case \"RECEIVE_MODEL\":{\n this.model = action.model;\n this.emit(\"change\");\n }\n }\n }", "performAction(action) {\r\n if (this.popupPort_ || this.notificationManager_.hasMessage()) {\r\n action();\r\n }\r\n }", "get relatedAction () {\n\t\treturn this._relatedAction;\n\t}", "function actionFilter(element, index, array) {\n var $item = $(\"#\" + element);\n\n if (visible.afterAction === visible.AFTER_ACTION_REMOVE && !$item.hasClass(\"undecided\")) {\n return false;\n }\n return true;\n }", "function parseCommand(command) {\n console.log(currScene);\n // go through each action and try to run\n for (index in currScene.actions) {\n let condition = currScene.actions[index][0];\n let action = currScene.actions[index][1];\n\n if (checkCondition(command, condition)) {\n if (restart.includes(command)){\n reset_globals();\n }\n console.log(\"condition passed\");\n console.log(condition);\n console.log(\"---\");\n executeAction(action);\n return;\n }\n }\n\n // if we failed to parse execute the action Error\n narrate(`I don't know what \"${command}\" means.`);\n}", "appendActionToLast(action) {\r\n return this.appendAction(this.last, action);\r\n }" ]
[ "0.6483178", "0.62221134", "0.6140569", "0.5831329", "0.58130765", "0.57658666", "0.5709937", "0.56884074", "0.56884074", "0.56884074", "0.56792754", "0.56528974", "0.5576044", "0.5566889", "0.55459636", "0.5545801", "0.5545801", "0.55245095", "0.5505852", "0.54845023", "0.5464212", "0.5408503", "0.5367322", "0.5351693", "0.5330812", "0.5323228", "0.53197247", "0.53156614", "0.5308467", "0.5302352", "0.52954113", "0.5290437", "0.52877635", "0.52737814", "0.527241", "0.52641517", "0.5237769", "0.5232094", "0.5224286", "0.52238315", "0.5217486", "0.5217486", "0.5211779", "0.5210042", "0.5207083", "0.51908016", "0.5182271", "0.51821506", "0.5171574", "0.5170771", "0.5166354", "0.5163302", "0.51559114", "0.513123", "0.51100504", "0.50800794", "0.5073987", "0.5067141", "0.5061695", "0.5061486", "0.5058509", "0.50563604", "0.50520456", "0.50459015", "0.5045049", "0.5034936", "0.50102997", "0.50102997", "0.5009741", "0.5009626", "0.5004718", "0.49972802", "0.49967137", "0.49941853", "0.4989024", "0.49829152", "0.49797553", "0.4977013", "0.49756473", "0.49754128", "0.49735865", "0.49727792", "0.49683413", "0.49607176", "0.49605483", "0.4946741", "0.49374193", "0.49357766", "0.491842", "0.4913401", "0.49060974", "0.4905199", "0.49003285", "0.4898047", "0.48974875", "0.4893215", "0.48930445", "0.4892337", "0.48902717", "0.48898888" ]
0.50577265
61
Main method that is ran whenever a value is to be set
function method(commandName, options){ return function(res){ addValue(commandName, options, res[commandName]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setValue() {\n }", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "function initWatchVal() {}", "set value(value) {}", "SetCounterValue() {}", "function initWatchVal(){}", "function initWatchVal(){}", "run () {\n let oldVal = this.value\n let newVal = this.get(oldVal)\n if (newVal !== oldVal) {\n this.value = newVal\n if (this.dir) {\n this.cb.call(this.data, this.dir, newVal)\n } else {\n this.cb.call(this.data, newVal)\n }\n }\n }", "setValue(value) {\n this._value = value;\n }", "function initWatchVal() {} // 16439", "async function init() {\n // re use value from last time it was set\n let { value } = browser.local.storage.get('value');\n // if first time then value is set to 0\n if (!value) {\n value = 0;\n }\n input.value = value;\n // once we get it from storage now adjust value\n setValue(value);\n}", "run() {\n if (this.active) {\n const value = this.get()\n if (\n value !== this.value\n ) {\n // set new value\n const oldValue = this.value\n this.value = value\n this.cb.call(this.vm, value, oldValue)\n }\n }\n }", "static set one(value) {}", "set() {}", "setParamValue(text, val) {\n console.log(\"IMPLEMENT ME\");\n }", "s(_value) {\n this.value = _value;\n this.refresh();\n }", "s(_value) {\n this.value = _value;\n this.refresh();\n }", "setValue(value) {\n this.value = value;\n }", "function setTargetValue() {\n targetValue = Math.floor(Math.random() * 100) + 20;\n console.log(\"tv \" + targetValue);\n $(\"#target\").text(targetValue);\n alphaValue = Math.floor(Math.random() * 11) + 1;\n console.log(\"a \" + alphaValue);\n betaValue = Math.floor(Math.random() * 11) + 1;\n console.log(\"b \" + betaValue);\n gammaValue = Math.floor(Math.random() * 11) + 1;\n console.log(\"g \" + gammaValue);\n zappaValue = Math.floor(Math.random() * 11) + 1;\n console.log(\"z \" + zappaValue);\n}", "function initValues(){\n}", "run () {\n if (this.active) {\n var value = this.get();\n if (\n value !== this.value ||\n // Deep watchers and watchers on Object/Arrays should fire even\n // when the value is the same, because the value may\n // have mutated.\n isObject(value) ||\n this.deep\n ) {\n // set new value\n var oldValue = this.value;\n this.value = value;\n if (this.user) {\n try {\n this.cb.call(this.vm, value, oldValue);\n } catch (e) {\n handleError(e, this.vm, `callback for watcher \"${this.expression}\"`);\n }\n } else {\n this.cb.call(this.vm, value, oldValue);\n }\n }\n }\n }", "function setValues() {\n // assigning a random value between 1 and 12 to each color gem value.\n gem.redGem = createRandomNumbers(1, 12);\n gem.blueGem = createRandomNumbers(1, 12);\n gem.yellowGem = createRandomNumbers(1, 12);\n gem.greenGem = createRandomNumbers(1, 12);\n\n //console.log the values for trouble shooting purposes.\n console.log(\"Red gem value: \" + gem.redGem);\n console.log(\"Blue gem value: \" + gem.blueGem);\n console.log(\"Yellow gem value: \" + gem.yellowGem);\n console.log(\"Green gem value: \" + gem.greenGem);\n\n // assinging a random number between 19 and 120 to the random number variable.\n randomNumber = createRandomNumbers(19, 120);\n console.log(\"Number to hit: \" + randomNumber);\n\n // then we show the random number on the page for the user to see.\n $(\"#random-number\").text(\"Number to hit: \" + randomNumber);\n\n\n }", "function changeValue(val) {\n\t\t\t\tvalue = val;\n\t\t\t\tstarChange(val);\n\t\t\t}", "set Automatic(value) {}", "set Auto(value) {}", "set value(_value) {\n this.setValue(_value);\n }", "set AlwaysOn(value) {}", "_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 }", "function valueReset ( fireSetEvent ) {\n\t\tvalueSet(options.start, fireSetEvent);\n\t}", "function valueReset ( fireSetEvent ) {\n\t\tvalueSet(options.start, fireSetEvent);\n\t}", "function valueReset ( fireSetEvent ) {\n\t\tvalueSet(options.start, fireSetEvent);\n\t}", "function valueReset ( fireSetEvent ) {\n\t\tvalueSet(options.start, fireSetEvent);\n\t}", "function valueReset ( fireSetEvent ) {\n\t\tvalueSet(options.start, fireSetEvent);\n\t}", "function valueReset ( fireSetEvent ) {\n\t\tvalueSet(options.start, fireSetEvent);\n\t}", "function valueReset ( fireSetEvent ) {\n\t\tvalueSet(options.start, fireSetEvent);\n\t}", "function valueReset ( fireSetEvent ) {\n\t\tvalueSet(options.start, fireSetEvent);\n\t}", "function valueReset ( fireSetEvent ) {\n\t\tvalueSet(options.start, fireSetEvent);\n\t}", "updateValue (val) {\n this._value = val;\n }", "set() {\n\n let kv = this.getKeyValue();\n let config = this.readSteamerConfig({ isGlobal: this.isGlobal });\n\n config[kv.key] = kv.value;\n\n this.createSteamerConfig(config, {\n isGlobal: this.isGlobal,\n overwrite: true,\n });\n\n }", "function valueReset ( fireSetEvent ) {\r\n\t\tvalueSet(options.start, fireSetEvent);\r\n\t}", "setValue(value) {\n this.value = value;\n this.doubleNumber = this.value * 2;\n }", "function value(val) {\n if (typeof val === 'undefined') {\n return initVal\n } else {\n initVal = val\n value.emit('change', initVal)\n }\n }", "function initValues() {\n isRunning = false;\n\n repsInput.min = 5;\n workoutInput.min = 5;\n restInput.min = 5;\n setsInput.min = 1;\n\n repsInput.max = 25;\n workoutInput.max = 60;\n restInput.max = 30;\n setsInput.max = 10;\n\n repsInput.value = 0;\n workoutInput.value = 0;\n restInput.value = 0;\n setsInput.value = 0;\n\n repsSpan.innerHTML = repsInput.value;\n workoutSpan.innerHTML = workoutInput.value;\n restSpan.innerHTML = restInput.value;\n setsSpan.innerHTML = setsInput.value;\n\n timerArea.innerHTML = \"0\";\n setdone1Area.innerHTML = '0';\n setneed1Area.innerHTML = \"0\";\n}", "function set(val) {\n console.log('Setting GPIO ' + config.gpio + ' to ' + val);\n gpio.writeSync(val);\n }", "handler(newVal, oldVal) {\n if(!TypeChecker.isUndefined(oldVal)) {\n this.getValue();\n }\n }", "set x(value) {}", "setValue(value) {\n this.value = value;\n this.valueChange.emit({ value });\n }", "set(_value) {\n this.value = _value;\n }", "set(_value) {\n this.value = _value;\n }", "doAction (value) {\n if (!this._params.simulate) {\n this._actuator.write(value.state === true ? 1 : 0, () => {\n this.addValue(value.state)\n })\n } else {\n this.addValue(value.state)\n }\n\n value.status = 'completed'\n\n console.info('Changed value of %s to %s', this._model.name, value.state)\n }", "function changeValues(){\n MAX_NUM_GENERATIONS = $('#maxgenerations').find(\":selected\").val();\n MAX_NUM_POPULATION_MEMBERS = $('#popSize').find(\":selected\").val();\n MUTATE_PERCENTAGE = $('#mutatePercentage').find(\":selected\").val();\n KNAPSACK_SIZE = (MIN * MIN * MIN) * MAX_NUM_POPULATION_MEMBERS;\n main();\n}", "value(value) {\n this.newValue = value\n }", "async initializingFirstTime() {\n this.root.set(diceValueKey, 1);\n }", "evaluate () {\n this.value = this.get()\n this.dirty = false\n }", "function settingFunc() {\n\n}", "static set property(){}", "value(value) {\n this.newValue = value;\n }", "get value(){ return this.main_value; }" ]
[ "0.64196295", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.6399928", "0.62896997", "0.62545705", "0.62158453", "0.62158453", "0.61359215", "0.6133955", "0.6113434", "0.6059458", "0.6037813", "0.60198945", "0.60119826", "0.593829", "0.5931526", "0.5931526", "0.5926683", "0.5916784", "0.589327", "0.58792204", "0.5877634", "0.5845763", "0.58351356", "0.58220816", "0.58076155", "0.58069843", "0.5744396", "0.57375044", "0.57375044", "0.57375044", "0.57375044", "0.57375044", "0.57375044", "0.57375044", "0.57375044", "0.57375044", "0.57265306", "0.57259125", "0.5705844", "0.57046473", "0.56897", "0.56739956", "0.56599975", "0.5641287", "0.56285363", "0.56163293", "0.5607655", "0.5607655", "0.56066644", "0.56017935", "0.5600376", "0.55929315", "0.5585442", "0.5573575", "0.5560992", "0.55592597", "0.55416095" ]
0.0
-1
Sends a request to the API using the JSONp protocol
function newRequest() { var title = document.getElementById("title").value; title = title.trim(); title = title.replace(" ","+"); var author = document.getElementById("author").value; author = author.trim(); author = author.replace(" ","+"); var isbn = document.getElementById("isbn").value; isbn = isbn.trim(); isbn = isbn.replace("-",""); // Connects possible query parts with pluses var query = ["",title,author,isbn].reduce(fancyJoin); // The JSONp part. Query is executed by appending a request for a new // Javascript library to the DOM. It's URL is the URL for the query. // The library returned just calls the callback function we specify, with // the JSON data we want as an argument. if (query != "") { // remove old script var oldScript = document.getElementById("jsonpCall"); if (oldScript != null) { document.body.removeChild(oldScript); } // make a new script element var script = document.createElement('script'); // build up complicated request URL var beginning = "https://www.googleapis.com/books/v1/volumes?q=" var callback = "&callback=handleResponse" script.src = beginning+query+callback script.id = "jsonpCall"; // put new script into DOM at bottom of body document.body.appendChild(script); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "jsonp(url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json'\n });\n }", "jsonp(url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\n }", "jsonp(url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\n }", "jsonp(url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\n }", "jsonp(url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\n }", "jsonp(url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\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 jsonp(url, params, opts) {\n return request(getOptions('GET', {url: url, params: params, jsonp: 'callback'}, opts))\n}", "function send(method, url, data, callback) {\n var xhr = new XMLHttpRequest();\n xhr.onload = function () {\n if (xhr.status !== 200) callback(\"[\" + xhr.status + \"] \" + xhr.responseText, null);\n else callback(null, JSON.parse(xhr.responseText));\n };\n xhr.open(method, url, true);\n if (!data) xhr.send();\n else {\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify(data));\n }\n }", "function request(method,url,params,callbackSuccess,callbackError) {\n httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n callbackSuccess(JSON.parse(httpRequest.responseText));\n } else {\n callbackError(httpRequest);\n }\n }\n };\n httpRequest.open(method,'https://api.trello.com/1' + url + (url.includes('?') ? '&' : '?') + 'key=45cb99fb34a85706e8d9a5ea9bcf8571&token='+window._gtToken);\n httpRequest.send();\n}", "static sendRequest(method, point, callback, data = null) {\n // Create the HTTP request\n let connection = new XMLHttpRequest();\n\n // Create all the HTTP request params\n let url = StdVar.apiUrl + point;\n let body = null;\n\n // Format the data to the correct format\n if(data !== null) {\n if(method === \"POST\") {\n body = Ajax.formatArgs(data);\n } else {\n url += \"?\" + Ajax.formatArgs(data);\n console.log(url);\n }\n }\n\n // Open the connection and send the request\n connection.open(method, url, true);\n connection.send(body);\n\n // Wait for the request answer\n connection.onreadystatechange = function (e) {\n if(connection.readyState === 4) {\n if (callback !== null) {\n // Prepare the response JSON\n let responseJson = {};\n\n if(connection.status >= 200 && connection.status <= 226) {\n try {\n responseJson = JSON.parse(connection.responseText);\n } catch (e) {\n responseJson = {\n result: \"FAIL\",\n errorCode: 100,\n errorMessage: \"Cannot parse the JSON string : \" + connection.responseText\n }\n }\n } else {\n responseJson = {\n result: \"FAIL\",\n errorCode: 500,\n errorMessage: \"Cannot reach the server, it must be down... Please wait until it works again (or repair it if you're a developer)\",\n };\n }\n callback(responseJson);\n }\n }\n };\n }", "getAPI(request, response) {\n let message = {};\n message.name = 'implementation pending';\n message.version = 'implementation pending';\n return response.jsonp(message);\n }", "send(request, callback) {\n if (!request)\n callback('Undefined request');\n this.request(request)\n .then((result) => callback(null, { jsonrpc: '2.0', id: request.id, result }))\n .catch((error) => callback(error, null));\n }", "function _sendPOSTRequest (url, data) {\n var request = new XMLHttpRequest();\n request.open('POST', url, true);\n request.setRequestHeader('Content-Type', 'application/json');\n request.send(data);\n }", "function jsonpGet(url, data, params) {\n return new Promise((resolve, reject) => {\n if (data) url += \"?\" + qs.stringify(data)\n params = params || {timeout: 15000}\n if (!params.timeout) params.timeout = 15000\n jsonp(url, params, (err, data) => {\n if (err) {\n reject(err)\n } else {\n resolve(data)\n }\n })\n }) \n}", "function send_request(arg1, op, arg2) {\n\t$.ajax(\"http://127.0.0.1:8000/\", {\n\t\ttype: \"GET\",\n\t\tdata: {\n\t\t\t\"arg1\": arg1,\n\t\t\t\"arg2\": arg2,\n\t\t\t\"op\": op\n\t\t},\n \tcrossDomain: true,\n \tdataType: \"jsonp\",\n\t\tsuccess: handle_response\n\t});\n}", "function jsonPost(url, data, callback) {\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('POST', url, true); //Filter by postcodes, lat and lng as these are the only things we need\r\n xhr.setRequestHeader('Content-Type', 'application/json');\r\n\r\n xhr.onreadystatechange = callback;\r\n\r\n xhr.send(JSON.stringify(data));\r\n}", "function _request(method, url, data, callback) {\n const xhr = new XMLHttpRequest();\n \n \n // console.log(\"Data in request file: \" + url);\n\n // no need to pass the data here\n // - json endpoint is passed into request function in index.js\n // const dataString = JSON.parse(data);\n\n\n\n xhr.onreadystatechange = function() {\n // wait until response is ready\n if (xhr.readyState === 4) {\n // 200 http status code\n if (xhr.status === 200) {\n // console.log(\"xhr response text\" + xhr.responseText);\n callback(null, JSON.parse(xhr.responseText));\n } else {\n callback(true);\n }\n }\n };\n\n // open the xhr request, set header, and send\n xhr.open(method, url);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send();\n }", "function sendCurlRequest(){\n\t\n var json_data = {\n \"User\": \"jbobrow\",\n \"Password\": \"dmiHQzPp6Kxt3q\",\n \"Subject\":\"From JB\",\n\t\t\t\t\"Message\":\"Testing EZ Text API\",\n\t\t\t\t\"PhoneNumbers\":[\n\t\t\t\t\t\"8186207518\" \n\t\t\t\t\t]};\n\t\t\t\t\t\n $.ajax({\n\t cache : false, \n\t type: 'POST',\n\t crossDomain:true,\n\t url: 'https://app.eztexting.com/sending/messages?format=json',\n\t data:json_data,\n// \t dataType: \"jsonp\",\n\t contentType:\"application/json\",\n\t success: function(data){\n\t alert(data);\n\t var pubResults = data; \n\t },\n\t error: function(data){\n\t \talert(\"ERROR RESPONSE FROM DRUID SERVER : \"+JSON.stringify(data));\n\t },\n\t complete: function(data){\n\t console.log(\"call completed\");\n\t }\n });\n}", "fetchWithJsonp(url){\n return fetchJsonp(url, {\n timeout: 5000,\n }).then(response => {\n return response.json();\n }).catch(exception => {\n console.log('fetchWithJsonp error: ', exception)\n })\n }", "function getJSONP(url, callback) {\n $.ajax({\n type: 'GET',\n url: url,\n async: false,\n contentType: \"application/json\",\n jsonpCallback: callback,\n dataType: 'jsonp',\n success: function (json) {\n console.dir('success');\n },\n error: function (e) {\n console.log(e.message);\n }\n });\n }", "function jsonp(method, data, callback){\n $.ajax({\n url: method + '.jsonp',\n dataType: 'jsonp',\n type: 'GET',\n data: data,\n success:function(data){\n if(null !== data && 'string' === typeof data.error) log(data.error, arguments);\n callback(data);\n },\n error:function(){\n log('Unable to retrieve ' + method, arguments);\n }\n });\n}", "function jsonGet(url, callback) {\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', url, true);\r\n xhr.setRequestHeader('Content-Type', 'application/json');\r\n\r\n xhr.onreadystatechange = callback;\r\n\r\n xhr.send();\r\n}", "function getJSONP(config) {\n var url = config.baseUrl + \"/localdata/\" + version;\n\n //REST url builder\n if (arguments && arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++)\n url += \"/\" + arguments[i]\n }\n\n return $.ajax({\n dataType: \"jsonp\",\n url: url,\n data: {\n \"clientId\": config.clientId,\n \"clientApiKey\": config.clientApiKey\n }\n });\n }", "function makeCall(url, data, callback) {\n var ajax = {\n url: url,\n dataType: 'jsonp',\n timeout: 2000\n };\n if ( typeof callback==='string' ) ajax.jsonp = callback;\n if( typeof data==='object' ) ajax.data = data;\n return $.ajax(ajax);\n}", "function SIMPL__SendRequest_JSON( eString_URI, eJSON_Request, fCallback_Success, fCallback_Error )\n{\n\tvar eXHR = new XMLHttpRequest();\n\tvar eString_JSON = JSON.stringify( eJSON_Request );\n\n\teXHR.open( \"GET\", ( eString_URI + \"?JSON=\" + encodeURIComponent( eString_JSON ) ), true );\n\teXHR.onload = function ( eProgressEvent )\n\t\t{\n\t\t\tif (eXHR.readyState === 4)\n\t\t\t{\n\t\t\t\tif (eXHR.status === 200)\n\t\t\t\t{\n\t\t\t\t\tconsole.log( eXHR.responseText );\n\t\t\t\t\tvar eJSON_Response = JSON.parse( eXHR.responseText );\n\n\t\t\t\t\tif ( fCallback_Success != null )\n\t\t\t\t\t{\n\t\t\t\t\t\tfCallback_Success( eJSON_Response, eProgressEvent, eXHR );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlocal_SIMPL__JSON__UpdateDebugView( eString_JSON, eXHR.responseText );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ( fCallback_Error != null )\n\t\t\t\t\t{\n\t\t\t\t\t\tfCallback_Error( eString_URI, eJSON_Request, eProgressEvent, eXHR );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.error( \"SendRequest - not 200 : \" );\n\t\t\t\t\t\tconsole.error( eXHR.statusText );\n\t\t\t\t\t\tconsole.error( eString_URI );\n\t\t\t\t\t\tconsole.error( eJSON_Request );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.log( eProgressEvent );\n\t\t\t}\n\t\t};\n\teXHR.onerror = function ( eProgressEvent )\n\t\t{\n\t\t\tif ( fCallback_Error != null )\n\t\t\t{\n\t\t\t\tfCallback_Error( eString_URI, eJSON_Request, eProgressEvent, eXHR );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.error( \"SendRequest - onerror : \" );\n\t\t\t\tconsole.error( eXHR.statusText );\n\t\t\t\tconsole.error( eString_URI );\n\t\t\t\tconsole.error( eJSON_Request );\n\t\t\t}\n\t\t};\n\teXHR.onabort = eXHR.onerror;\n\teXHR.ontimeout = eXHR.onerror;\n\teXHR.send( null );\n}", "function SendToFiWareGet(url, callback)\n{\n\tvar req = new XMLHttpRequest();\n\treq.onreadystatechange = function(e)\n\t{\n\t\tif (this.readyState == 4 && this.status == 200)\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\tvar json = JSON.parse(this.responseText);\n\t\t\t}\n\t\t\tcatch (e)\n\t\t\t{\n\t\t\t\talert(this.responseText);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallback(json);\n\t\t}\n\t}\n\treq.open(\"GET\", url);\n\treq.send();\n}", "function sendRequest({url, method = 'GET', headers, body = null}) {\n // let customBody = null;\n return fetch(BASE_SERVER_PATH + url + '?v=1.0.0', {\n method,\n headers,\n body,\n });\n }", "function jsonp(url, callback, context) {\n var\n id = +new Date(),\n script = document.createElement('script');\n while (typeof yourls.__jsonp_callbacks[id] !== 'undefined') {\n id += Math.random();\n }\n yourls.__jsonp_callbacks[id] = function () {\n delete yourls.__jsonp_callbacks[id];\n callback.apply(context, arguments);\n };\n url = '?format=jsonp&callback=' +\n encodeURIComponent('yourls.__jsonp_callbacks[' + id + ']') + '&' +\n url;\n url += '&' + paramify(auth);\n script.setAttribute('src', api + url);\n document.getElementsByTagName('head')[0].appendChild(script);\n }", "function call(method, url, params, callback) {\n\n var options = { uri: url, method: method }\n\n if (url.match(/subscriptions/)) {\n if (config.clientID && config.clientSecret)\n options.headers = { 'Authorization': 'Basic ' + new Buffer(config.clientID + ':' + config.clientSecret).toString('base64') }\n } else {\n if (config.token)\n options.headers = { 'Authorization': 'Bearer ' + config.token.token.access_token }\n }\n\n options.json = true; // make the JSON response being parsed\n\n if (isEmpty(params)) params = null;\n method == 'GET' ? options.qs = params : options.json = params\n\n if (process.env.DEBUG) console.log('Lelylan Node: Making the HTTP request', options)\n request(options, callback)\n }", "function apiCall(){\r\nxhr.open('GET', url);\r\nxhr.send();\r\n}", "function makeParticleRequest(requestURI, postData, callback){\n \tvar options = {\n \t\thostname: \"api.particle.io\",\n \t\tport: 443,\n \t\tpath: requestURI,\n \t\tmethod: 'POST',\n \t\theaders: {\n \t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n 'Authorization': 'Bearer ' + accessToken,\n \t\t\t'Accept': '*.*'\n \t\t}\n \t};\n\n \tvar req = http.request(options, function(res) {\n \t\tconsole.log('STATUS: ' + res.statusCode);\n \t\tconsole.log('HEADERS: ' + JSON.stringify(res.headers));\n\n \t\tvar body = \"\";\n\n \t\tres.setEncoding('utf8');\n \t\tres.on('data', function (chunk) {\n \t\t\tconsole.log('BODY: ' + chunk);\n \t\t\tbody += chunk;\n \t\t});\n\n \t\tres.on('end', function () {\n callback(body);\n });\n \t});\n\n \treq.on('error', function(e) {\n \t\tconsole.log('problem with request: ' + e.message);\n \t});\n\n \t// write data to request body\n \treq.write(postData.toString());\n \treq.end();\n}", "function RequestJson(url, callbackFunction, dataPost, mimeType) {\r\n\tvar request= new XMLHttpRequest();\r\n\t\r\n\trequest.onreadystatechange=function() {\r\n\t if (request.readyState==4 && request.status==200) \t{ callbackFunction( request.responseText); }\r\n\t};\r\n\t\r\n\tif (dataPost!=null) {\r\n\t\tif ( mimeType == null ) mimeType = \"application/json\"; //The MIME media type for JSON text is application/json\r\n\t\trequest.open(\"POST\", url,true);\r\n\t\trequest.setRequestHeader(\"Content-Type\", mimeType ); \r\n\t\trequest.send(dataPost);\r\n\t} else {\r\n\t\trequest.open(\"GET\", url,true);\r\n\t\trequest.send();\t\r\n\t}\r\n\t\t \r\n}", "'@borodean/jsonp'(url, options, callback) {\n const query = querystring.parse(url.split('?')[1]);\n if (query.error) {\n return callback(new Error(query.error));\n }\n\n callback(null, query);\n }", "function callAPI(url,data,callback)\n{\n var formData = JSON.stringify(data);\n Request.get({\n headers: { \"Content-Type\":'application/json',\"Authorization\":\"BEARER 2HQ6xG29mp8kXslCDs8l1BhnSPxN2UdrftzFv8f9VrC1FrZ3RtHnHmDovMBZvPCDyXiEq910aH0VMIogWF61uWdTnZAIYf2ZXHXOiwoqZntbEUpxneq4Seu0BuLibNIwNrvsSt0PanuZphPWFdDyfNmTflUK3lZa8IOtvugkmWXOkb0wMwUgxzXzzbBKOZyqmthekO6e8R8yY6VSbe1csyqVSQCCXKcCfBmuFBHk7CWfkRyhqHvqaReD5rTelaE1\" },\n url: url,\n body: formData\n}, function(err, response) {\n var body = JSON.parse(response.body);\n callback(err, body);\n});\n}", "function get(url, succes){\n $.ajax({\n url: 'https://dev-deliverbag.supconception.fr/'+url,\n dataType: 'jsonp',\n success: function(data){\n succes(JSON.parse(data));\n },\n error:function(e){\n console.log(e);\n },\n });\n }", "function request(url, callback) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open('GET', url, true);\n xmlhttp.send();\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var data = JSON.parse(xmlhttp.responseText);\n callback(data);\n }\n };\n }", "function jsonP(obj){\n\twindow.callback = function(res){\n\t\tobj.success(res);\n\t}\n\tlet str = \"\";\n\tif(obj.data){\n\t\tlet arr = [];\n\t\tfor(var k in obj.data){\n\t\t\tarr.push(k+\"=\"+obj.data[k]);\n\t\t}\n\t\tstr = arr.join(\"&\");\n\t}\n\tif(str){\n\t\tstr+=\"&callback=callback\";\n\t}else{\n\t\tstr = \"callback=callback\";\n\t}\n\tlet sc = document.createElement(\"script\");\n\tsc.src = obj.url+\"?\"+str;\n\tdocument.body.appendChild(sc);\n\tsc.remove();\n\twindow.callback = null;\n}", "function get (url, callback) {\n var req = new XMLHttpRequest();\n req.onload = callback; \n req.open('GET', url, true);\n req.responseType = 'json';\n req.setRequestHeader(\n 'Authorization',\n 'Basic ' + btoa(creds.appID + ':' + creds.jsKey)\n );\n req.send(); \n}", "function callApi(method, url, body, callback){\n let xhr = new XMLHttpRequest();\n xhr.open(method, url, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.setRequestHeader('Authorization', 'Bearer ' + localStorage.getItem(accessTokenKey));\n xhr.send(body);\n xhr.onload = callback;\n}", "static async send (method, params = [], rnd = { min: 0, max: 0 }) {\n // if the user canceled the data cleaning\n if (store.state.networks.vk.cancel) {\n return {}\n }\n\n // Delete unused attributes from object\n Object.keys(params).forEach(key => {\n if (params[key] === null) {\n delete params[key]\n }\n })\n\n // Set the required parameters for each request\n params.v = this.prototype.version\n params.lang = this.prototype.lang\n\n if (!params.access_token) {\n params.access_token = store.state.networks.vk.token\n }\n\n const result = await Vue.http.jsonp(this.prototype.urlApi + method, {\n params: params\n })\n .then(res => { return res })\n .catch(err => { return err })\n\n // Bypass the limit of exceeding requests to the API\n if (rnd.max > 0 && rnd.min <= rnd.max) {\n await sleep(randomInteger(rnd.min, rnd.max))\n }\n\n return result\n }", "function sendGetRequest (requestUrl, responseHandler, isJsonResponse) {\n\tvar request = getRequestObject();\n request.onreadystatechange = function() { \n\t\thandleResponse(request, responseHandler, isJsonResponse); \n };\n request.open(\"GET\", requestUrl, true);\n request.send(null); // for POST only\n}", "function getJSON(url, body, callback, headers=FAKE_HEADERS) {\n \n var options = {\n url : url,\n headers : headers,\n method: 'POST',\n form: body\n };\n\n var buffer = \"\";\n var req = request(options).on('error', function(err) {\n console.log(err);\n buffer = {code:'5000', 'msg': err};\n }).on('response', function(res) {\n var buffer = \"\";\n res.on('data', function(data) {\n buffer += data;\n }).on('end', function() { \n callback(buffer);\n });\n }); \n}", "jsonHttpRequest (data, callback) {\n try {\n callback = callback || function () {}\n const options = {\n uri: `http://${config.upstream}`,\n method: data ? 'POST' : 'GET',\n headers: {\n 'Content-Length': data.length,\n 'Content-Type': 'application/json',\n Accept: 'application/json'\n }\n }\n options.json = data\n\n request(options)\n .then(response => {\n response = response || {}\n if (response instanceof Array || response instanceof Object) {\n callback(null, response)\n } else {\n callback(null, JSON.parse(response))\n }\n })\n .catch(error => {\n callback(error, {})\n })\n } catch (error) {\n console.log('catch ', error)\n callback(error, {})\n }\n }", "function sendRequest(url, method, paramString, callBack) {\n\tvar webServiceUrl = url;\n\tvar requestUrl = webServiceUrl + '?method=' + method;\n\tvar params = json_parse(paramString);\n\tfor(var i = 0; i < params.length; i++)\n\trequestUrl = requestUrl + \"&\" + params[i].key + \"=\" + params[i].value;\n\t//window.alert(requestUrl);\n\ttry {\n\t\tvar asyncRequest = null;\n\t\tif(window.XMLHttpRequest) {\n\t\t\tasyncRequest = new XMLHttpRequest();\n\t\t} else if(window.ActiveXObject) {\n\t\t\tasyncRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}\n\t\tasyncRequest.onreadystatechange = function() {\n\t\t\tcallBack(asyncRequest, method);\n\t\t};\n\t\tasyncRequest.open('GET', requestUrl, true);\n\t\t//\t\t\t\tasyncRequest.setRequestHeader('Accept', 'application/json; charset=utf-8');\n\t\tasyncRequest.send();\n\t} catch (exception) {\n\t\talert('Request Failed');\n\t}\n}", "function send_request(method, path, body, q_string, on_success, on_error) {\n\t// Signing request\n\tvar text = method + '::' + path + '::' + body\n\tvar hash = CryptoJS.HmacSHA1(text, secret);\n\tvar hashInBase64 = CryptoJS.enc.Base64.stringify(hash);\n\n\t// Sending request\n\tvar url = 'https://'+domain+path;\n\tif ( q_string ) {\n\t\turl += '?'+q_string; \n\t} \n\tvar xhr = new XMLHttpRequest();\n\txhr.open(method, url, true);\n\txhr.onload = function(res) { on_success(xhr.response); };\n\txhr.onerror = on_error;\n\txhr.withCredentials = false;\n\txhr.responseType = 'json';\n\txhr.setRequestHeader('Content-Type','application/json');\n\txhr.setRequestHeader('X-Gcmp-Application','reporting-1');\n\txhr.setRequestHeader('X-Gcmp-Acting',acting);\n\txhr.setRequestHeader('Authorization','GCMP '+key+':'+hashInBase64);\n\txhr.send(body);\n}", "function sendAjaxRequest(method, url, callback) {\n let http = new XMLHttpRequest();\n http.open(method, url, true);\n http.onreadystatechange = function () {\n if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {\n callback(JSON.parse(this.response));\n }\n };\n http.send();\n}", "function SendToFiWarePost(url, json, callback)\n{\n\tvar req = new XMLHttpRequest();\n\treq.onreadystatechange = function(e)\n\t{\n\t\tif (this.readyState == 4 && this.status == 200)\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\tvar json = JSON.parse(this.responseText);\n\t\t\t}\n\t\t\tcatch (e)\n\t\t\t{\n\t\t\t\talert(this.responseText);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallback(json);\n\t\t}\n\t}\n\treq.open(\"POST\", url, true);\n\treq.send(JSON.stringify(json));\n}", "function fetchResource(url, body, callback) {\n // TODO: review this code\n //if (typeof console !== \"undefined\")\n // console_log(\"Fetching\", url);\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", url, true);\n xhr.responseType = \"json\";\n xhr.setRequestHeader(\"content-type\", \"application/json\");\n xhr.onreadystatechange = function () {\n if (xhr.readyState != XMLHttpRequest.DONE) {\n return;\n }\n console_log(\"state-change: \"+xhr.status);\n //if (typeof console !== \"undefined\")\n // console_log(\"completed\", url, xhr.status);\n if (xhr.status == 200) {\n callback(xhr.response, null);\n } else {\n if (typeof console !== \"undefined\")\n console.log(\"XHR reported failure:\", xhr.readyState, xhr.status);\n callback(null, null);\n }\n };\n try {\n xhr.send(JSON.stringify(body));\n } catch (e) {\n if (typeof console !== \"undefined\")\n console.log(\"XHR send crashed:\", e);\n setTimeout(function () {\n callback(null, e);\n }, 0);\n }\n }", "_issueJsonRequest(options, success) {\n\n\t\tthis.http.request(options, (data) => {\n\t\t\t// Ensure is JSON\n\t\t\tdata = this.jResponse(data);\n\t\t\t// Determine if error\n\t\t\tif (data.error) {\n\t\t\t\tthis.broadcastError(data.error, this._origin('request', 'commentOnPost'));\n\t\t\t} else {\n\t\t\t\t// Flag complete\n\t\t\t\tsuccess(data);\n\t\t\t}\n\t\t}, (error) => {\n\t\t\tthis.broadcastError(error, this._origin('request', 'commentOnPost'));\n\t\t});\n\t}", "static sendData(httpMethod, url, data) {\n const requestObject = new XMLHttpRequest();\n\n requestObject.responseType = \"json\";\n\n requestObject.open(httpMethod, url, true);\n\n requestObject.setRequestHeader('Content-Type', 'application/json');\n\n requestObject.send(JSON.stringify(data));\n\n requestObject.readyState(\"load\", this.loadFunction);\n }", "function call_api(url, data, method, callback) {\n var request = new XMLHttpRequest();\n if (method == 'GET') {\n request.open('GET', url, true)\n }\n else {\n\n return false\n }\n\n request.withCredentials = true;\n\n request.onload = function () {\n var data = null;\n if (request.status >= 200 && request.status < 400 && callback != null) {\n data = JSON.parse(this.response);\n callback(data)\n }\n }\n\n request.send()\n // console.log(\"yeah\")\n\n return true\n}", "function SIMPL__PostRequest_JSON( eString_URI, eJSON_Request, fCallback_Success, fCallback_Error )\n{\n\tvar eXHR = new XMLHttpRequest();\n\tvar eString_JSON = JSON.stringify( eJSON_Request );\n\n\teXHR.open( \"POST\", eString_URI, true );\n\teXHR.setRequestHeader( \"Content-type\", \"application/x-www-form-urlencoded\" );\n\teXHR.onreadystatechange = function ( eProgressEvent )\n\t\t{\n\t\t\tif ( eXHR.readyState == XMLHttpRequest.DONE )\n\t\t\t{\n\t\t\t\tif ( eXHR.status == 200)\n\t\t\t\t{\n\t\t\t\t\tconsole.log( eXHR.responseText );\n\t\t\t\t\tvar eJSON_Response = JSON.parse( eXHR.responseText );\n\n\t\t\t\t\tif ( fCallback_Success != null )\n\t\t\t\t\t{\n\t\t\t\t\t\tfCallback_Success( eJSON_Response, eProgressEvent, eXHR );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlocal_SIMPL__JSON__UpdateDebugView( eString_JSON, eXHR.responseText );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ( fCallback_Error != null )\n\t\t\t\t\t{\n\t\t\t\t\t\tfCallback_Error( eString_URI, eJSON_Request, eProgressEvent, eXHR );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.error( \"SendRequest - not 200 : \" );\n\t\t\t\t\t\tconsole.error( eXHR.statusText );\n\t\t\t\t\t\tconsole.error( eString_URI );\n\t\t\t\t\t\tconsole.error( eJSON_Request );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\teXHR.onerror = function ( eProgressEvent )\n\t\t{\n\t\t\tif ( fCallback_Error != null )\n\t\t\t{\n\t\t\t\tfCallback_Error( eString_URI, eJSON_Request, eProgressEvent, eXHR );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.error( \"SendRequest - onerror : \" );\n\t\t\t\tconsole.error( eXHR.statusText );\n\t\t\t\tconsole.error( eString_URI );\n\t\t\t\tconsole.error( eJSON_Request );\n\t\t\t}\n\t\t};\n\teXHR.onabort = eXHR.onerror;\n\teXHR.ontimeout = eXHR.onerror;\n\teXHR.send( \"JSON=\" + encodeURIComponent( eString_JSON ) );\n//\teXHR.send( \"JSON=\" + encodeURIComponent( eString_JSON ).replace( /%20/g, \"+\" ) );\n}", "function sendRequest(url, callback) {\n console.log(\"Sending GET to \" + url);\n request_lib.get(url, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(\"Fact is \" + body);\n callback(body);\n } else {\n console.log(\"Error=\" + error);\n }\n });\n }", "function sendRequest(method, url, body = null){\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(method, url);\n \n xhr.responseType = 'json'; // OR parse the response ( JSON.parse(xhr.response) )\n xhr.setRequestHeader('Content-Type', 'application/json');\n \n xhr.onload = ()=>{\n if(xhr.status >= 400){\n reject(xhr.response);\n }else{\n resolve(xhr.response);\n }\n }\n xhr.onerror = () => reject(xhr.response);\n \n xhr.send(JSON.stringify(body));\n })\n}", "function makeJsonRequest(url, parameters, handler){\n\tvar httpRequest = new XMLHttpRequest()\n\thttpRequest.onreadystatechange = function(){\n\t\t\n\t\tvar done = false;\n\t\tif(httpRequest.readyState == 4){\n\t\t\tif(httpRequest.status == 200){\n\t\t\t\tif(done == false){\n\t\t\t\t\tvar response = JSON.parse(httpRequest.responseText)\n\t\t\t\t\tif(response.status == 'failure' && response.message == 'no authorization'){\n\t\t\t\t\t\tlocation.reload()\n\t\t\t\t\t}\n\t\t\t\t\thandler.success(response)\n\t\t\t\t\tdone = true\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('redundant call')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(handler.failure){\n\t\t\t\t\thandler.failure()\n\t\t\t\t}\n\t\t\t\tconsole.log(httpRequest.status + ' : ' + httpRequest.statusText)\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\thttpRequest.open('POST', url, true)\n\thttpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); \n\thttpRequest.send(parameters)\n}", "function doRequest(url, data, callback) {\n callback({ url, data });\n }", "function sendJsonRequest (href, theToken, action) {\n return fetch(href, {\n method: 'POST',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ '_token': theToken, 'action': action })\n })\n .then(response => response.json())\n .then(data => { return data })\n}", "function makeRequest(url, form) {\n xhr.onreadystatechange = responseMethod\n xhr.open('POST', url)\n xhr.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\")\n xhr.send(form)\n }", "function request (url, params, callback, context) {\r\n var paramString = serialize(params);\r\n var httpRequest = createRequest(callback, context);\r\n var requestLength = (url + '?' + paramString).length;\r\n\r\n // ie10/11 require the request be opened before a timeout is applied\r\n if (requestLength <= 2000 && _Support__WEBPACK_IMPORTED_MODULE_1__[\"Support\"].cors) {\r\n httpRequest.open('GET', url + '?' + paramString);\r\n } else if (requestLength > 2000 && _Support__WEBPACK_IMPORTED_MODULE_1__[\"Support\"].cors) {\r\n httpRequest.open('POST', url);\r\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\r\n }\r\n\r\n if (typeof context !== 'undefined' && context !== null) {\r\n if (typeof context.options !== 'undefined') {\r\n httpRequest.timeout = context.options.timeout;\r\n if (context.options.withCredentials) {\r\n httpRequest.withCredentials = true;\r\n }\r\n }\r\n }\r\n\r\n // request is less than 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\r\n if (requestLength <= 2000 && _Support__WEBPACK_IMPORTED_MODULE_1__[\"Support\"].cors) {\r\n httpRequest.send(null);\r\n\r\n // request is more than 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\r\n } else if (requestLength > 2000 && _Support__WEBPACK_IMPORTED_MODULE_1__[\"Support\"].cors) {\r\n httpRequest.send(paramString);\r\n\r\n // request is less than 2000 characters and the browser does not support CORS, make a JSONP request\r\n } else if (requestLength <= 2000 && !_Support__WEBPACK_IMPORTED_MODULE_1__[\"Support\"].cors) {\r\n return jsonp(url, params, callback, context);\r\n\r\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\r\n } else {\r\n warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\r\n return;\r\n }\r\n\r\n return httpRequest;\r\n}", "function send_json(para) {\n return $.ajax({\n url: para.url,\n contentType: 'application/json',\n data: JSON.stringify(para.data),\n dataType: 'json',\n type: para.method\n })\n}", "function http_post(req_url){\n request.post(\n req_url,\n function(error, response, body) {\n console.log(\"Clickatell POST:\")\n console.log(req_url);\n console.log(body);\n if (!error && response.statusCode == 200) {\n node.send({topic:\"Clickatell POST:\",payload:body});\n } else {\n console.log(error);\n node.send({topic:\"Clickatell ERROR:\",payload:error});\n\t\t\t\t}\n }\n );\n }", "function ajax(url, parametros, cb){\t\n $.ajax({\n dataType: 'jsonp',\n url: url,\n data: parametros,\n type: \"GET\",\n crossDomain: true, \n jsonpCallback: cb,\n error: function(xhr, status, error) {\n console.log(\"test\");\n console.log(xhr);\n console.log(status);\n console.log(error);\n }});\n}", "function sendGet(url, params)\n{\n\t\n}", "function sendGet(url, params)\n{\n\t\n}", "function http_request(method, url, payload, headers, callback) {\n var client = Ti.Network.createHTTPClient({\n onload: function(e) {\n // if its a binary download... save to file from responseData not responseText\n if (callback) {\n callback(true, this.responseText, null, this);\n }\n },\n onerror: function(e) {\n //if (callback) callback(false, {code: this.status, data: {error: _.isString(e.error) ? e.error + ' ' + this.responseText : this.responseText}}, e);\n if (callback) callback(false, this.responseText, e, this);\n },\n timeout : options.timeout || ($.lib.platform.isSimulator ? 30000 : 15000)\n });\n\n if (client && client.connected) {\n $.lib.logError('*** xhr client exists and is connected! Change APIcall to required lib/instance.');\n }\n\n Alloy.CFG.logging && $.lib.logInfo('[apicall] open url=' + method + ':' + url + ' payload=' + $.lib.stringify(payload, 2000));\n client.validatesSecureCertificate = false;\n client.open(method, url);\n client.setRequestHeader('Content-Type', 'application/json; charset=utf-8');\n //client.setRequestHeader('Accept', 'application/json');\n isHTTPGet ? client.send() : client.send(JSON.stringify(payload));\n }", "function makeCall(id,url,data) {\n request=initRequest();\n response=null;\n \n request.open(\"POST\",url,false); \n request.setRequestHeader('Content-type','application/x-www-form-urlencoded;charset=UTF-8;');\n \n request.send(data);\n \n if (request.status == 200) {\n response=request.responseText;\n }\n \n return response;\n\n }", "function sendRequest(url, type, data, options) {\n\n // Construct request URL\n url = options.basePath + url;\n var parameters = getUrlParameters(options);\n if (parameters.length) {\n url = [url, parameters].join('?');\n }\n\n // Perform call\n $.ajax({\n url: url,\n beforeSend: options.beforeSend,\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'api-key': options.apiKey\n },\n type: type,\n data: data,\n datatype: \"json\",\n error: options.errorHandler\n }).then(function (data) {\n // Ensure the response contained data\n if (!data) {\n options.callback(false, $.retinaApi.errors.NoDataError);\n } else if (typeof options.callback == \"undefined\") {\n throw \"No callback defined to handle returned data: \\n\" + data;\n } else {\n options.callback(data);\n }\n });\n }", "function callApiPlay(method, url, body) {\n let xhr = new XMLHttpRequest();\n xhr.open(method, url, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.setRequestHeader('Authorization', 'Bearer ' + sessionStorage.getItem('spotify_token'));\n xhr.send(body);\n xhr.onload = function () {\n if ( this.status == 204){\n console.log(this.responseText);\n //colorPalette();\n //setTimeout(currentlyPlaying, 2000);\n }\n else {\n console.log(this.responseText);\n //alert(this.responseText);\n } \n }\n}", "function request(url) {\n var req = new XMLHttpRequest();\n req.responseType = 'json';\n req.open('GET', url, false);\n req.send();\n return req.status == 200 ? req.response : null;\n}", "function sendRequest(url) {\n $.getJSON( url, function adinfo (data) {\n var zodiac = {};\n zodiac.quote = data.horoscope;\n zodiac.sign = data.sunsign.toLowerCase();\n update(zodiac);\n });\n }", "function postJSON(url, data, callback) {\n var request = new XMLHttpRequest();\n request.open(\"POST\", url); // POST to the specified url\n request.onreadystatechange = function() { // Simple event handler\n if (request.readyState === 4 && callback) // When response is complete\n \tcallback(request); // call the callback.\n };\n // Set Content-Type\n request.setRequestHeader(\"Content-Type\", \"application/json\");\n \n //ENCRYPT simulation\n data = [$.base64Encode(JSON.stringify(data))];\n \n request.send(JSON.stringify(data));\n}", "function SendAPIRequest(options, site_domain, method, parameters, success_callback, error_callback) {\r\n \r\n // Begin by constructing the URL that will be used for the request\r\n var url = ((options['secure'] == 'true')?'https://':'http://') + 'api.stackexchange.com/2.0' + method;\r\n \r\n // Add the API key and site to the list of parameters\r\n parameters['key'] = options['key'];\r\n parameters['site'] = site_domain;\r\n parameters['filter'] = options['filter'];\r\n \r\n // Lastly, make the request\r\n $.ajax({ 'url': url, 'data': parameters, 'dataType': 'jsonp',\r\n 'success': function(data) {\r\n \r\n // If an error message was supplied, then invoke the error callback\r\n if(typeof data['error_message'] != 'undefined')\r\n error_callback(data['error_message']);\r\n else\r\n success_callback(data['items']);\r\n \r\n }});\r\n }", "static async post(url, data = {}) {\n const headers = {\n 'Accept': 'application/json',\n 'Content-Type': 'application/x-www-form-urlencoded'\n };\n const options = {\n method: 'POST',\n mode: 'cors',\n headers: new Headers(headers),\n cache: 'default',\n body: this.CreateQueryString(data)\n };\n const request = new Request(url, options);\n\n try {\n const response = await fetch(request, options);\n return response.json();\n } catch (error) {\n return error;\n }\n }", "function request (url, params, callback, context) {\n var paramString = serialize(params);\n var httpRequest = createRequest(callback, context);\n var requestLength = (url + '?' + paramString).length;\n\n // ie10/11 require the request be opened before a timeout is applied\n if (requestLength <= 2000 && Support.cors) {\n httpRequest.open('GET', url + '?' + paramString);\n } else if (requestLength > 2000 && Support.cors) {\n httpRequest.open('POST', url);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n\n if (typeof context !== 'undefined' && context !== null) {\n if (typeof context.options !== 'undefined') {\n httpRequest.timeout = context.options.timeout;\n }\n }\n\n // request is less than 2000 characters and the browser supports CORS, make GET request with XMLHttpRequest\n if (requestLength <= 2000 && Support.cors) {\n httpRequest.send(null);\n\n // request is more than 2000 characters and the browser supports CORS, make POST request with XMLHttpRequest\n } else if (requestLength > 2000 && Support.cors) {\n httpRequest.send(paramString);\n\n // request is less than 2000 characters and the browser does not support CORS, make a JSONP request\n } else if (requestLength <= 2000 && !Support.cors) {\n return jsonp(url, params, callback, context);\n\n // request is longer then 2000 characters and the browser does not support CORS, log a warning\n } else {\n warn('a request to ' + url + ' was longer then 2000 characters and this browser cannot make a cross-domain post request. Please use a proxy http://esri.github.io/esri-leaflet/api-reference/request.html');\n return;\n }\n\n return httpRequest;\n}", "function request(url, options) {\n if (!url) {\n throw new Error('Preflight request error: URL parameter required');\n }\n\n if (!options) {\n throw new Error('Preflight request error: options parameter required');\n } //debugger;\n\n\n var method = options.method || 'GET';\n var qs = '';\n var body;\n var headers = options.headers || {\n 'Accept': 'application/json',\n 'content-type': 'application/json'\n }; // var mode = options.mode || 'cors';\n\n if (['GET', 'DELETE'].indexOf(method) > -1 && options.param) {\n qs = '?' + getQueryString(options.param);\n } else {\n if (options.param && Object.keys(options.param).length > 0) qs = '?' + getQueryString(options.param);\n body = JSON.stringify(options.data);\n }\n\n var url1 = url + qs; // Fetch returns a promise\n\n return fetch(url1, {\n method: method,\n headers: headers,\n body: body\n }).then(function (response) {\n if (response.status > 200) {\n // Errors such as this are passed up to the middleware\n throw new Error(\"Server error: \".concat(response.status, \" status\"));\n }\n\n return response.json();\n }).then(function (response) {\n if (!response) {\n return response;\n } else if (response.errors) {\n throw new Error(\"Server error: \".concat(response.errors.message));\n }\n\n return response;\n });\n}", "function JSONReq(service, req, handler) {\r\n\t\tvar request = new XMLHttpRequest();\r\n\t\trequest.onreadystatechange = function() {\r\n\t\t\tif (request.readyState != 4)\r\n\t\t\t\treturn;\r\n\t\t\ttry {\r\n\t\t\t\tvar response = eval('(' + request.responseText + ')').d;\r\n\t\t\t} catch(e) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif ('object' != typeof response)\r\n\t\t\t\treturn;\r\n\t\t\thandler(response);\r\n\t\t};\r\n\t\trequest.open('POST',\r\n\t\t\t'http://radio3.cbc.ca/modules/r3-player/services/PlayerWebService.asmx/'\r\n\t\t\t+ service, true);\r\n\t\trequest.setRequestHeader('Content-Type', 'application/json; charset=utf-8');\r\n\t\trequest.send(req);\r\n\t}", "function jsonRequest(url)\n{\n var script=document.createElement('script');\n script.src=url;\n document.getElementsByTagName('head')[0].appendChild(script);\n}", "function makeRequest(method, auth, url, qs, data, cb) {\t\t// eslint-disable-line max-params\n\tconst options = {\n\t\tmethod: method,\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t\t'Authorization': auth\n\t\t},\n\t\turl: url, // for debugging set to: \"https://httpbin.org/get\"\n\t\tqs: qs\n\t}\n\n\tif(data) {\n\t\toptions.body = JSON.stringify(data)\n\t}\n\n\trequest(options, createResponseHandler(cb))\n}", "function responseApiCall(data, req, res) {\n console.log('responseApiCall'); \n\n var cb = req.query.callback;\n var jsonP = false;\n\n console.log('responseApiCall callback : ' + cb);\n\n if (cb != null) {\n jsonP = true;\n res.writeHead(200, {'Content-Type': 'text/javascript', 'connection' : 'close'});\n } else {res.writeHead(200, {'Content-Type': \"application/x-json\"});}\n\n if (jsonP) {res.end(cb + \"(\" + JSON.stringify(data) + \");\" );}\n else { res.end(JSON.stringify(data));}\n}", "function jsonp(url, callback) {\n var script = document.createElement(\"script\");\n var id = \"callback_\" + +new Date();\n var encodedURL = url+\"&callback=\"+id;\n console.log(encodedURL);\n window[id] = function(data) {\n if(callback) {\n callback(data);\n }\n }\n script.src = encodedURL;\n document.head.appendChild(script);\n }", "function request(json) {\n json.token = token;\n return new Promise(function (resolve, reject) {\n rq.post({url:url, json:json}, function(error, response, body) {\n if (error) {\n reject(error);\n } else if (response.statusCode > 299) {\n reject(body.errors);\n } else {\n resolve(body.data);\n }\n });\n });\n }", "sendGetRequest(url) {\n return this.httpClient.get(url);\n }", "function send (ep, data) {\n\tvar msg = {\n\t\tmsg: data\n\t};\n\tvar jsonstr = JSON.stringify(msg);\n\ttry {\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open('POST', '/' + ep, false);\n\t\txhr.setRequestHeader('Content-Type', 'application/json');\n\t\txhr.send(jsonstr);\n\t} catch (e) {\n\n\t}\n}", "function request(url, callback) {\n\tconsole.log(`Posting to url ${url}`)\n\tlet data = ''\n\n\thttp.get(url, (res) => {\n\t\tres.on('data', (chunk) => {\n\t\t\tdata += chunk\n\t\t})\n\n\t\tres.on('end', () => {\n\t\t\tcallback(JSON.parse(data).payload)\n\t\t})\n\t})\n}", "function doPOST(data)//, on_load_function)\n{\n\tvar req = new XMLHttpRequest();\n\t\n\t// TODO: use webstorage to store configuration such as server name\n\t// (http://www.w3.org/TR/webstorage/).\n\t\n\treq.open('POST','http://192.168.178.106:80/jsonrpc');\n\treq.setRequestHeader(\"Content-Type\", \"application/json\");\n\t//if (on_load_function) { req.onload = on_load_function; }\n\treq.send(data);\n}", "function requestJSON(success){\n $.ajax({\n type: 'get',\n dataType: 'json',\n url: encodeURI('api/twitch/'+apiRequestQuery[\"api\"]+'/request.json'),\n async: true,\n success: success\n });\n}", "function json() {\n\n var body = '';\n request = http.get('https://mcapi.ca/query/198.24.171.162:25955/list', function(theJson){\n\n\t\ttheJson.on('data', function (chunk){\n\t\t\tbody += chunk;\n\t\t}).on('end', function(){\n\t\t\tconsole.log('Data stream end: ' + body);\n\t\t\tbody = JSON.stringify(body);\n\t\t\tconsole.log('stringify: ' + body);\n\t\ttheJson.on('error', function(err) {\n \t\t\tconsole.error(err);\n \t\t});\n\n \t\ttheJson.writeHead(200, {'Content-Type': 'application/json'} );\n\n\t\t\t// var responseBody = {\n // \t\t\theaders: headers,\n // \t\t\tmethod: method,\n // \t\t\turl: url,\n // \t\t\tbody: body\n // \t\t};\n\n \t\ttheJson.write(JSON.stringify(body));\n \t\ttheJson.end();\n\t\t});\n\t\t\n\t});\n\n}", "function request(method, url, success, fail) {\n if (method && method.length > 0 && url && url.length > 0) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url, true);\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.status == 200) {\n if (success) success(JSON.parse(xhr.responseText));\n } else {\n if (fail) fail(xhr.statusText);\n }\n };\n xhr.send();\n }\n }", "async WebPostJson(url, body) {\n var r = await this._BaseWebRequest(url, \"json\", \"POST\", JSON.stringify(body));\n return r;\n }", "function _request(method, path, data, cb, raw, sync) {\n function getURL() {\n var url = path.indexOf('//') >= 0 ? path : API_URL + path;\n url += ((/\\?/).test(url) ? '&' : '?');\n // Fix #195 about XMLHttpRequest.send method and GET/HEAD request\n if (data && typeof data === \"object\" && ['GET', 'HEAD'].indexOf(method) > -1) {\n url += '&' + Object.keys(data).map(function (k) {\n return k + '=' + data[k];\n }).join('&');\n }\n return url + '&' + (new Date()).getTime();\n }\n\n // Creating a promise\n var promise = new Promise(function (resolve, reject) {\n\n // Instantiates the XMLHttpRequest\n var client = new XMLHttpRequest();\n var uri = getURL();\n\n\n client.open(method, getURL(), !sync);\n\n /*if (!sync) {\n client.onreadystatechange = function () {\n if (this.readyState === 4) {\n if (this.status >= 200 && this.status < 300 || this.status === 304) {\n cb(null, raw ? this.responseText : this.responseText ? JSON.parse(this.responseText) : true, this);\n } else {\n cb({\n path: path,\n request: this,\n error: this.status\n });\n }\n }\n };\n }*/\n\n if (!raw) {\n client.dataType = 'json';\n client.setRequestHeader('Accept', 'application/vnd.github.v3+json');\n } else {\n client.setRequestHeader('Accept', 'application/vnd.github.v3.raw+json');\n }\n\n client.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n\n\n\n if (data) {\n client.send(JSON.stringify(data));\n } else {\n client.send();\n }\n\n client.onload = function () {\n if (this.status >= 200 && this.status < 300) {\n // Performs the function \"resolve\" when this.status is equal to 2xx\n resolve(this.response);\n } else {\n // Performs the function \"reject\" when this.status is different than 2xx\n reject(this.statusText);\n }\n };\n client.onerror = function () {\n reject(this.statusText);\n };\n\n /* if (sync) {\n return client.response;\n }*/\n });\n\n // Return the promise\n return promise;\n\n }", "function sendJSONRequest(request){\n gTrans.pTypeTrans = document.getElementById('id.pay-type').value;\n gTrans.pStatusTrans = document.getElementById('id.pay-type-dtl').value;\n var jsonData = new Object();\n jsonData.sequence_id = \"2\";\n jsonData.idtxn = gTrans.idtxn;\n jsonData.userId = gCustomerNo;\n if(request.transType == 1){\n jsonData.TRAN_TYPE = \"P\";\n }else if(request.transType == 2){\n jsonData.TRAN_TYPE = \"T\";\n }else{\n jsonData.TRAN_TYPE = \"\";\n }\n jsonData.status = request.transStatus;\n jsonData.FROM_DATE = request.dateBegin;\n jsonData.TO_DATE = request.dateEnd;\n jsonData.pageId = gTrans.pageId;\n jsonData.pageSize = gTrans.pageSize;\n\n var args = new Array();\n args.push(\"2\");\n args.push(jsonData);\n var gprsCmd = new GprsCmdObj(CONSTANTS.get(\"CMD_MANAGER_LC\"), \"\", \"\", gUserInfo.lang, gUserInfo.sessionID, args);\n var data = getDataFromGprsCmd(gprsCmd);\n requestMBServiceCorp.post(data,true, requestMBServiceSuccess, function() {\n showAlertText(CONST_STR.get(\"CORP_MSG_INTERNAL_TRANS_ERROR_GET_DATA\"));\n });\n }", "function jsonRequest(options, callback) {\n\n if(!options.qs)\n {\n options.qs = {};\n }\n\n options.qs.access_token = oauthToken;\n\n var multiData = [];\n\n if(options.multipart)\n {\n var index = 0;\n options.multipart.forEach(function(multi) {\n multiData.push({ index: index, body: multi.body});\n index = index + 1;\n });\n }\n\n var reqOptions = {\n url: options.url,\n qs: options.qs || null,\n method: options.method,\n json: options.multipart ? null : (options.data || true),\n headers: options.headers || null,\n multipart: options.multipart || null,\n };\n\n if(options.binary) {\n reqOptions['encoding'] = null;\n }\n\n console.log('doing call...');\n\n // If the request wants to have a stream back ignore token, the caller is\n // responsible for making sure a token is active\n if(options.stream) {\n return request(reqOptions);\n } else {\n request(reqOptions,\n function(err, res, body){\n if(err) {\n console.log(err);\n console.log(res);\n console.log(body);\n callback(err, null);\n } else if (!res) {\n callback(500, null);\n } else if(res.statusCode/100 === 2) {\n callback(null, body);\n } else if(res.statusCode === 401) {\n refreshToken(function() {\n if(options.multipart)\n {\n multiData.forEach(function(item) {\n options.multipart[item.index].body = item.body;\n });\n }\n\n jsonRequest(options, callback);\n });\n } else {\n console.log(err);\n console.log(res);\n console.log(body);\n callback(res.statusCode, null);\n }\n });\n }\n}", "function fetchJson(myUrl) {\n log(\"JSONP request URL: \" + myUrl);\n $.ajax({\n // myUrl aleady has all the parameters/data applied\n url: myUrl,\n // The name of the callback parameter, as specified by the YQL service\n jsonp: \"callback\",\n // Tell jQuery we're expecting JSONP\n dataType: \"jsonp\",\n // If timeout is reached, error condition is called:\n timeout: ajaxTimeout,\n // Work with the response - Note: for jsonp all data is sent to the callback function.\n success: function( jsonData ) {\n renderResponse(jsonData);\n },\n error: function (request, textStatus, errorThrown) {\n log(\"Ajax JSONP error, timeout reached: \" + errorThrown);\n $('#searchResults').html('<p class=\"noMatches\">The search server is taking longer than expected to respond. ' +\n 'Please check your network connection and/or try again later.</p>');\n $('#loadMsg').hide();\n $('#footerView').show();\n }\n });\n}", "function sendAPIRequest(jsonData,event,callback)\n{\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"POST\", \"../dp2-api/api/\", true);\t// All requests should be of type post\n\txhr.onreadystatechange = function() {\n\t\tif(xhr.readyState == 4)\n\t\t{\n\t\t\tif(xhr.status == 200)\n\t\t\t\tconsole.log(JSON.parse(xhr.responseText)); // Barring error conditions, responses will be valid JSON\n\t\t\telse\n\t\t\t\tconsole.error(xhr.responseText);\n\t\t\t\n\t\t\tcallback(xhr);\n\t\t}\n\t};\n\txhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\txhr.send(\"request=\" + encodeURIComponent(JSON.stringify(jsonData)));\t// Request JSON should be set to the request key\n\t\n\tevent.returnValue = false; // stops page refreshing\n\tdocument.getElementById(\"addsalesform\").reset(); // clear input fields in add form\n\tdocument.getElementById(\"editsalesform\").reset(); // clear input fields in edit form\n\treturn false;\n}", "function __ajax(url,data,method=\"GET\",callback){\n if(_debug)console.log(\"AJAX \"+url,data,method);\n var req = new XMLHttpRequest();\n req.open(method, 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(callback && typeof callback == 'function'){\n callback(JSON.parse(req.responseText));\n }\n } else {\n // Handle error case\n }\n }\n };\n try{\n req.send(JSON.stringify(data));//post data\n }catch(e){\n if(_debug)console.log(\"AJAX error.\"+e);\n }\n}", "function requestJsonEndpoint(endpoint, callback)\n{\n fetch(endpoint)\n .then(response => response.json())\n .then(data => callback(data))\n .catch(error =>\n {\n console.log(\"endpoint: \" + endpoint + \" failed\");\n console.error(error);\n });\n}", "function requestJSON(url,callback) {\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var res = JSON.parse(xmlhttp.responseText);\n try {\n callback(res);\n }\n catch (err) {\n console.log(err.message);\n }\n }\n }\n\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n}", "function testJson() {\n var baseUrl = 'https://rxnav.nlm.nih.gov/REST/';\n var testUrl = 'https://rxnav.nlm.nih.gov/REST/rxcui?name=xanax'\n var request = Meteor.npmRequire('request');\n request(testUrl, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var info = JSON.parse(body)\n console.log(body);\n }\n });\n }", "function send_request(req_type, req_body) {\n const http_method = 'POST';\n const server_path = 'main.py';\n let xhr = new XMLHttpRequest();\n xhr.open(http_method, server_path, true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.setRequestHeader(\"req_type\", req_type);\n xhr.setRequestHeader(\"Authorization\", auth_token);\n xhr.send(JSON.stringify(req_body));\n return xhr;\n}", "function post_request(url, body) {\n return new Promise(function(resolve, reject) {\n const jsonRequest = new XMLHttpRequest();\n jsonRequest.open('POST', url);\n // Only accept 200 success.\n jsonRequest.onload = function() {\n if (this.status == 200) {\n resolve(JSON.parse(jsonRequest.response));\n } else {\n reject({status: this.status, statusText: jsonRequest.statusText});\n }\n };\n\n // Reject all errors.\n jsonRequest.onerror = function() {\n reject({status: this.status, statusText: jsonRequest.statusText});\n };\n jsonRequest.send(body);\n })\n .catch();\n}" ]
[ "0.6687796", "0.6516182", "0.6516182", "0.6516182", "0.6516182", "0.6516182", "0.6473043", "0.642902", "0.62760824", "0.6184003", "0.60437214", "0.5991566", "0.59835905", "0.59655803", "0.5964626", "0.5906631", "0.5866129", "0.58597314", "0.58276665", "0.58257616", "0.5810411", "0.5764314", "0.57639736", "0.5710416", "0.56641495", "0.56613874", "0.56560683", "0.56410825", "0.5626977", "0.56222296", "0.5599562", "0.558534", "0.55731976", "0.5567577", "0.5560619", "0.554332", "0.55424553", "0.55362755", "0.55223405", "0.552153", "0.55181986", "0.55042857", "0.5502134", "0.5492278", "0.54869497", "0.548519", "0.5481612", "0.54750544", "0.5471219", "0.5471216", "0.54706544", "0.54653186", "0.5461738", "0.5460923", "0.54601425", "0.5455468", "0.54480344", "0.5442884", "0.5440671", "0.5430265", "0.54287815", "0.5423661", "0.54126763", "0.54124165", "0.54124165", "0.5408366", "0.5407987", "0.5407405", "0.5404717", "0.5402226", "0.5401828", "0.5400638", "0.5399581", "0.53909904", "0.5379849", "0.53737175", "0.5373637", "0.5371546", "0.53554845", "0.534759", "0.5340933", "0.5338054", "0.53264016", "0.53247815", "0.53240544", "0.5319887", "0.53123456", "0.5304621", "0.52955174", "0.529325", "0.52921", "0.5283268", "0.52768815", "0.5264809", "0.5264806", "0.52609426", "0.525472", "0.5252204", "0.5247238", "0.524649", "0.52442133" ]
0.0
-1
Used above, for joining possibly empty strings with pluses
function fancyJoin(a,b) { if (a == "") { return b; } else if (b == "") { return a; } else { return a+"+"+b; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joinData(data) {\n return withoutEmptyStrings(data).join(\" ; \");\n}", "function joinProse(array)\n{\n var length = array.length;\n switch (length) {\n case 0:\n return \"\";\n case 1:\n return array[0];\n default:\n return _.reduce(array.slice(1, length - 1), function (word, accu) { return word + \", \" + accu }, array[0]) + \" and \" + array[length - 1];\n }\n}", "function joinStrings() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.filter(Boolean).join(' ');\n }", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "function join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}", "join(words) {\n return words.join(\" \");\n }", "join(words) {\n return words.join(\" \");\n }", "function join(maybeArray, separator) {\n\t\t return maybeArray ? maybeArray.filter(function (x) {\n\t\t return x;\n\t\t }).join(separator || '') : '';\n\t\t}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n }", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n }", "function join(maybeArray, separator) {\n\t return maybeArray ? maybeArray.filter(function (x) {\n\t return x;\n\t }).join(separator || '') : '';\n\t}", "function join(maybeArray, separator) {\n\t return maybeArray ? maybeArray.filter(function (x) {\n\t return x;\n\t }).join(separator || '') : '';\n\t}", "function join(maybeArray, separator) {\n\t return maybeArray ? maybeArray.filter(function (x) {\n\t return x;\n\t }).join(separator || '') : '';\n\t}", "function join(maybeArray, separator = '') {\n var _maybeArray$filter$jo;\n\n return (_maybeArray$filter$jo =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.filter((x) => x).join(separator)) !== null &&\n _maybeArray$filter$jo !== void 0\n ? _maybeArray$filter$jo\n : '';\n}", "function joinStrings(a, b) {\n return a && b ? a + \" \" + b : a || b;\n}", "function joinStrings(a, b) {\n return a && b ? a + \" \" + b : a || b;\n}", "function joinStrings(a, b) {\n return a && b ? a + \" \" + b : a || b;\n}", "function joinStrings(a, b) {\n return a && b ? a + \" \" + b : a || b;\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function join$1(maybeArray, separator) {\n return maybeArray ? maybeArray.filter(function (x) {\n return x;\n }).join(separator || '') : '';\n}", "function String$empty() {\n return '';\n }", "function String$empty() {\n return '';\n }", "function stringBuilder(str) {\n return str != null ? str.split(\" \").join(\"+\") : \"\";\n}", "function _join(pre, tail) {\n var _hasBegin = !!pre\n if(!_hasBegin) pre = ''\n if (/^\\[.*\\]$/.exec(tail)) return pre + tail\n else if (typeof(tail) == 'number') return pre + '[' + tail + ']'\n else if (_hasBegin) return pre + '.' + tail\n else return tail\n}", "function _coalesceOutput(str){\n\t\treturn typeof(str) == \"undefined\" ? \"&nbsp\" : str;\n\t}", "function join() {\n return normal(Array.join(arguments, SEPARATOR));\n}", "function literalWithoutSpace () {\n const result = nOrMore(1, escapedOrLiteralWithoutSpace)()\n return result === null ? null : result.join('')\n }", "niceList(array, join, finalJoin) {\n var arr = array.slice(0), last = arr.pop();\n join = join || ', ';\n finalJoin = finalJoin || ' and ';\n return arr.join(join) + finalJoin + last;\n }", "function concatStringsWithSpace(before, after) {\n return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after;\n }", "function concatStringsWithSpace(before, after) {\n return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after;\n }", "function join(seq) {\n var i = seq.length\n , seps = _fmts[\"concat\"]\n , rv = \"\"\n , sep = \"\"\n if (!Object.isArray(seps)) seps = [seps]\n\n while (i--) {\n if (seq[i]) {\n rv += sep + seq[i]\n if (seps.length) sep = seps.pop() }}\n return rv\n }", "function concatStringsWithSpace(before, after) {\n return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after;\n }", "function concatStringsWithSpace(before, after) {\n return before == null || before === '' ? after === null ? '' : after : after == null || after === '' ? before : before + ' ' + after;\n}", "stringJoiner(str1,str2){\n\t\t//Check for undefined\n\t\tif(str1&&!str2) return str1\n\t\tif(str2&&!str1) return str2\n\t\tif(!str1&&!str2) return ''\n\n\t\t//Check for string length\n\t\tif(str2.length===0) return str1\n\t\tif(str1.length===0) return str2\n str1.trim()\n str2.trim()\n\t var commonString = this.commonSubstring(str1, str2).trim()\n\n\t return (\n\t \tstr1.substring(0,str1.indexOf(commonString))\n +commonString \n +str2.substring(str2.indexOf(commonString)+commonString.length,str2.length)\n )\n\t}", "function cleaner(match, p1, p2, p3) {\n if (p1) { return \"\"; }\n if (p2) { return \"\"; }\n if (p3) { return dash; }\n }", "function literalWithoutBar () {\n const result = nOrMore(1, escapedOrLiteralWithoutBar)()\n\n return result === null ? null : result.join('')\n }", "function join(items, separator) {\n\t separator = separator || '';\n\t return filter(items, isValidString).join(separator);\n\t }", "function join (s) {\n return stream.toArray(s).join('');\n}", "function join(items, separator) {\n separator = separator || '';\n return filter(items, isValidString).join(separator);\n }", "function join(items, separator) {\n separator = separator || '';\n return filter(items, isValidString).join(separator);\n }", "function outcomes_joinWords(words, sep) {\n\tvar a = '';\n\tif (words.length > 1) {\n\t\ta = ' ' + sep + ' ' + words.pop();\n\t}\n\treturn words.join(', ') + a;\n}", "function combine1(str1, str2){\n return str1.concat(\" \", str2);\n }", "function joinSentence(terms) {\n var separator = arguments.length <= 1 || arguments[1] === undefined ? \"or\" : arguments[1];\n\n if (terms.length < 2) {\n return terms[0] || 'any';\n } else {\n var last = terms.pop();\n return terms.join(', ') + ' ' + separator + ' ' + last;\n }\n }", "function concat(strings, sep) {\n return strings.reduce((s1, s2) => s1 + (s1 && s2 ? sep : '') + s2, '');\n}", "function joinWith(separator, ss) {\n return ss.join (separator);\n }", "function join_char(c1,c2){\n return c1;\n}", "function mixUp(string1, string2) {\n return console.log(string2.concat(\" \", string1))\n}", "function combine(prev, word) {\n\n // Loop to find the append string\n // which can be broken into\n for (i = 0; i < prev.length - 1; i++) {\n prev[i] += \" \" + word;\n }\n\n return prev;\n}", "function uutriminner(source) { // @param String: \" diet inner space \"\r\n // @return String: \"diet inner space\"\r\n return source.replace(uutrim._TRIM, \"\").replace(uutrim._SPACES, \" \");\r\n}", "function concatStringsWithSpace(before, after) {\n return (before == null || before === '') ?\n (after === null ? '' : after) :\n ((after == null || after === '') ? before : before + ' ' + after);\n}", "function concatStringsWithSpace(before, after) {\n return (before == null || before === '') ?\n (after === null ? '' : after) :\n ((after == null || after === '') ? before : before + ' ' + after);\n}", "function concatStringsWithSpace(before, after) {\n return (before == null || before === '') ?\n (after === null ? '' : after) :\n ((after == null || after === '') ? before : before + ' ' + after);\n}", "function concatStringsWithSpace(before, after) {\n return (before == null || before === '') ?\n (after === null ? '' : after) :\n ((after == null || after === '') ? before : before + ' ' + after);\n}", "function concatStringsWithSpace(before, after) {\n return (before == null || before === '') ?\n (after === null ? '' : after) :\n ((after == null || after === '') ? before : before + ' ' + after);\n}", "function concatStringsWithSpace(before, after) {\n return (before == null || before === '') ?\n (after === null ? '' : after) :\n ((after == null || after === '') ? before : before + ' ' + after);\n}", "function concatStringsWithSpace(before, after) {\n return (before == null || before === '') ?\n (after === null ? '' : after) :\n ((after == null || after === '') ? before : before + ' ' + after);\n}", "function literalWithoutBar () {\n\t\t\t\tvar result = nOrMore( 1, escapedOrLiteralWithoutBar )();\n\n\t\t\t\treturn result === null ? null : result.join( '' );\n\t\t\t}", "function concat(str1, str2, seperator = \" \") {\r\n}", "function initPhrase()\n{\n for(let i = 0; i < userPhrases[phraseIndex].length; i++)\n {\n if(userPhrases[phraseIndex][i].match(/ /))\n {\n phrase = phrase.concat(\" \");\n }\n else\n {\n phrase = phrase.concat(\"-\");\n }\n }\n if(debug)console.log(userPhrases[phraseIndex]);\n}", "function replaceLettersWithBlanks() {\n\tfor (var i = 0; i < randomCoffee.length; i++) {\n\t\tif (randomWord[i]) {\n\t\t\tcurrentCoffee.push(\" \");\n\t\t}\n\t\telse {\n\t\t\tcurrentCoffee.push(\"_\");\n\t\t}\n\n\t}\n}", "function joinStrings(string1, string2){\n return `${string1} ${string2}`;\n}", "function stringConcat(arr) {\n return arr.join('');\n}", "function joinElements(arr) {\n\n var niz = \"\";\n\n for (i = 0; i < arr.length; i++) {\n\n if (isFinite(arr[i])===false || arr[i] === undefined || arr[i] === null) {\n\n continue;\n\n } \n niz += arr[i] + \" \";\n \n\n }\n return niz;\n\n}", "function joinTextData(textData) {\n\t// data structure of textData is {items: [\n\t// \t{\n\t// \t\tstr: *TEXT*\n\t// \t}\n\t// ]}\n\treturn textData.items.map( item => item.str ).join(' ')\n}", "function join(a) {\n\t\tvar sep = false;\n\t\tvar s = '';\n\t\tfor(var i=0; i< a.length; ++i) {\n\t\t\tif(sep) {\n\t\t\t\ts += '\\n' + a[i];\n\t\t\t} else {\n\t\t\t\ts+= a[i];\n\t\t\t\tsep = true;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}", "function join(a) {\n\t\tvar sep = false;\n\t\tvar s = '';\n\t\tfor(var i=0; i< a.length; ++i) {\n\t\t\tif(sep) {\n\t\t\t\ts += '\\n' + a[i];\n\t\t\t} else {\n\t\t\t\ts+= a[i];\n\t\t\t\tsep = true;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}", "function stuff(value, mask){\n rest = mask.trim().length - value.length;\n return \" \".repeat(rest) + value;\n }", "stringThisArray(array){\n return array.join(\"\");\n }", "function implode(strGlue, arrPieces)\n{\n if (empty(arrPieces))\n return 'undefined';\n var strResult = '';\n for (var intCount = 0; intCount < arrPieces.length; ++intCount) {\n if (strResult !== '')\n strResult += strGlue;\n strResult += arrPieces[intCount];\n }\n return strResult;\n}", "function withoutEmptyStrings(data) {\n return data\n .map(x => x && (Array.isArray(x) ? x.join(\", \").trim() : String(x).trim()))\n .filter(x => x);\n}", "function combineSegments() {\n\t\tvar result = '';\n\t\ttotalSegments = segments.length;\n\t\tfor (var i = 0; i < segments.length; i++) {\n\t\t\tif (segments[i].isEmpty()) {\n\t\t\t\ttotalSegments--;\n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t}\n\t\t\tresult += segments[i].asText();\n\t\t}\n\t\treturn result;\n\t}", "function wordBlanks(noun, adjective, verb, adverb){\r\n var result = \"\";\r\n result += \"The \"+adjective+\" \" +noun+\" \" +verb+ \" \" + adverb+\".\";\r\n return result;\r\n}" ]
[ "0.6554332", "0.6304", "0.6215415", "0.6090299", "0.6090299", "0.6090299", "0.6090299", "0.6090299", "0.6090299", "0.6090299", "0.6090299", "0.6090299", "0.6090299", "0.60782015", "0.60782015", "0.60715866", "0.60444844", "0.60444844", "0.6018703", "0.6018703", "0.6018703", "0.6011482", "0.5997318", "0.5997318", "0.5997318", "0.5997318", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.59743154", "0.5933368", "0.5902219", "0.5902219", "0.58217764", "0.5821061", "0.5812487", "0.57561237", "0.5722973", "0.5714282", "0.5694209", "0.5694209", "0.56719065", "0.56624913", "0.56118", "0.56004757", "0.55949825", "0.5592115", "0.5570582", "0.5570546", "0.55584747", "0.55584747", "0.55581516", "0.555354", "0.55485046", "0.55428725", "0.55424696", "0.5536086", "0.55284184", "0.55241895", "0.5493079", "0.5483417", "0.5483417", "0.5483417", "0.5483417", "0.5483417", "0.5483417", "0.5483417", "0.54803306", "0.5471973", "0.54587245", "0.54436374", "0.54365975", "0.54252875", "0.54081345", "0.54069066", "0.5400336", "0.5400336", "0.53994477", "0.5392654", "0.5391434", "0.5387242", "0.53816545", "0.53774095" ]
0.6786303
0
The callback function, which gets run when the API returns the result of our query / Replace with your code!
function handleResponse(bookListObj) { var bookList = bookListObj.items; /* where to put the data on the Web page */ var bookDisplay = document.getElementById("bookDisplay"); /* write each title as a new paragraph */ for (i=0; i<bookList.length; i++) { var book = bookList[i]; var title = book.volumeInfo.title; var titlePgh = document.createElement("p"); /* ALWAYS AVOID using the innerHTML property */ titlePgh.textContent = title; bookDisplay.append(titlePgh); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callAPI(query) {\r\n\tconsole.log('Calling API with query: ' + query);\r\n\t$.get(\"https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb\",\r\n\t\t {'q': query,\r\n\t\t 'limit': '20'},\r\n\t\t function(data) {\r\n\t\t// PUT IN YOUR CODE HERE TO PROCESS THE SOUNDCLOUD API'S RESPONSE OBJECT\r\n\t\t// HINT: CREATE A SEPARATE FUNCTION AND CALL IT HERE\r\n\t\tresetTable('search-table');\r\n\t\tfor (var i = 0; i < 20; i++) {\r\n\t\t\t$('#search-table > tbody').append(genTrackRow(data[i]));\r\n\t\t}\r\n\t\tif (data.length == 0) {\r\n\t\t\t$('#search-table-header').text('No Results found for: \"' + query + '\"');\r\n\t\t} else {\r\n\t\t\t$('#search-table-header').text('Search Results for: \"' + query + '\"');\r\n\t\t}\r\n\t},'json'\r\n\t\t );\r\n}", "function callAPI(query) {\r\n\t$.get(\"https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb\",\r\n\t\t{'q': query,\r\n\t\t'limit': '200'},\r\n\t\tfunction(data) {\r\n\t\t\t// PUT IN YOUR CODE HERE TO PROCESS THE SOUNDCLOUD API'S RESPONSE OBJECT\r\n\t\t\t// HINT: CREATE A SEPARATE FUNCTION AND CALL IT HERE\r\n\t\t},'json'\r\n\t);\r\n}", "function callback(response){\n }", "function defaultSuccessCallbackFn() {\n debug && console.log( \"MobileDb.defaultSuccessCallbackFn: Query successful\" );\n }", "function my_callback(json_result) {\n console.log(\"Done\");\n }", "function callAPI(query) {\r\n\t// function to create a loop that calls parseSoundCloudAPI\r\n\r\n\t// ————————————————————————\r\n\t// PERSONAL NOTES\r\n\t// $.get(URL,data,function(data,status,xhr),dataType)\r\n\t// URL= specifies URL you wish to request – https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb \r\n\t// data= specifies data to send to the server along w request – {'q': query, 'limit': '200'} – basic query with 200 limit response\r\n\t// function= function(data){ ... } – specifies a function to run if the request succeeds\r\n\t// dataType= specifies the data type expected of the server response, JSON returns a JS object\r\n\t// ————————————————————————\r\n\r\n\t$.get(\"https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb\",\r\n\t\t{'q': query,\r\n\t\t'limit': '200'},\r\n\t\t// this is the data returned\r\n\t\tfunction(data) {\r\n\t\t\t// PUT IN YOUR CODE HERE TO PROCESS THE SOUNDCLOUD API'S RESPONSE OBJECT\r\n\t\t\t// HINT: CREATE A SEPARATE FUNCTION AND CALL IT HERE\r\n\t\t\tconsole.log(data)\r\n\t\t\tsearch = data;\r\n\t\t\tfor (i=0; i < 20; i++) {\r\n\t\t\t\tparseSoundCloudAPI(data[i]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tpopulatePage()\r\n\t\t},'json'\r\n\t);\r\n}", "function callAPI(query) {\r\n\t$.get(\"https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb\",\r\n\t\t{'q': query,\r\n\t\t'limit': '200'},\r\n\t\tfunction(data) {\r\n parseSearchResult(data);\r\n\t\t},'json'\r\n\t);\r\n}", "function contentApiCallback(){\n\t\n\tvar output = \"\";\n\t\n\tif(myclient.data == null){\n \tvar display = \"<b><font color='red'>return object == null</font></b>\"\n document.getElementById(myclient.divid).innerHTML = output;\n return;\n }\n \n var textJson = gadgets.json.parse(myclient.data);\n if(!textJson){\n var display = \"<b><font color='red'>parsing results returned nothing</font></b>\"\n document.getElementById(myclient.divid).innerHTML = output;\n return;\n }\n \n var entries = textJson['search-results']['entry'];\n \n\t$.each(entries, function(i1, entry){\n \tvar title = entry['dc:title'];\n \toutput = output + (i1+1) + \". \" + title + \"<br>\";\n });\n \n document.getElementById(myclient.divid).innerHTML = \"Search results:<br>\"+output;\n}", "function getData(query, callback) {\n query.api_key = apiKey;\n query.limit = 100;\n\n $.getJSON(endpointURL, query, callback);\n }", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function getDataFromApi(searchTerm, callback){\n //console.log('searching: ' +searchTerm);\n const query = {\n \n api_key: '',\n q: `${searchTerm}`,\n limit: 5\n };\n \n $.getJSON(giphy_search_url,query,callback);\n}", "function callback(){}", "function results() {\r\n\r\n console.log(\"result function called\");\r\n var database=firebase.database();\r\n var ref=database.ref('NeedCovidPlasmaData');\r\n\r\n ref.on('value',gotData,errData);\r\n \r\n\r\n }", "function display_results() {\n}", "function callbackGET(error, response, body) {\n if (!error) {\n try {\n var result = response.request.response.statusCode;\n if (result === 200) {\n result = body.value[0];\n console.log('description = ' + result.description);\n console.log('hotel name = ' + result.hotelName);\n console.log('hotel rate = ' + result.baseRate);\n }\n console.log('***success***');\n } catch (error2) {\n console.log('***Error encountered***');\n console.log(error2);\n }\n\n } else {\n console.log('error');\n console.log(error);\n }\n\n}", "function getDataFromAPI(searchTerm, callback){\n //send query to API\nconsole.log('start of getDataFromAPI working');\n\n const querySettings = {\n part: 'snippet',\n key: \"AIzaSyAgn_oFoGo-8EOWZ4yh-v_NCF3MuiziDPg\",\n q: `${searchTerm}`,\n maxResults: 6,\n type: 'video',\n };\n $.getJSON(youTube_url, querySettings, callback);\n console.log('end of getDataFromAPI working');\n console.log(`${searchTerm}`);\n}", "function getDataFromSongkickApi(searchArtist, callback) {\n console.info(\"Inside SongkickAPI function\");\n \n const settings = {\n url: songkickURL,\n dataType: \"json\",\n type: \"GET\",\n data: {\n artist_name: searchArtist\n },\n success: function (data){ \n \t let eventInfo = data.resultsPage.totalEntries;\n console.log(data);\n if (eventInfo == 0) {\n \t$(\"#concert-cont\").append('<h1 style=\"color:red\">No Upcoming Events</h1>')\n }\n\n $.each(data[\"resultsPage\"][\"results\"][\"event\"], function(i, entry){\n $(\"#concert-cont\").append('<li><a href=\"' + entry.uri+'\">'+entry.displayName +'</a></li>');\n })},\n timeout: 5000,\n error: function() {\n alert('Error retrieving data');\n }\n };\n $.ajax(settings);\n}", "function getResults(query)\r\n{ \r\n fetch(`${api.base}weather?q=${query}&units=metric&APPID=${api.key}`) //retrieving the weather data\r\n .then(weather => {\r\n return weather.json(); //converting it into a JSON file\r\n\r\n }).then(DisplayResults);\r\n\r\n}", "run(){\n let [q, ...args] = this._getQuery();\n return this.client._query(q, args, {emitter: this}).then(data => {\n this.emit('data', data);\n return data;\n });\n }", "function callback() {\n let latLong = self.state.latLong;\n let search = `${latLong['lat']},${latLong['lng']},${self.state.searchRadius}`\n self.setState({searchParams: search});\n self.props.search(self.state.searchParams, self.state.latLong);\n }", "handleSuccess(response) {\n // console.log(response);\n const queryId = response.data[0][\"QueryId\"];\n const success = response.data[0][\"Success\"] === 1;\n if (this.queryCallbacks[queryId]) {\n this.queryCallbacks[queryId](success, response.data[0], response.more);\n delete this.queryCallbacks[queryId];\n }\n }", "function callAPI(query) {\n\t$.get(\"https://api.soundcloud.com/tracks?client_id=b3179c0738764e846066975c2571aebb\",\n\t\t{'q': query,\n\t\t'limit': '20'},\n\t\tfunction(data) {\n\n\t\t\tresetTable('searchBody')\n\t\t\t$.each(data, function(i, v) {\n\t\t\t\tvar artwork = '_css/artwork.jpg'\n\t\t\t\tif (v.artwork_url != null){\n\t\t\t\t\tartwork = v.artwork_url;\n\t\t\t\t} \n\t\t\t\tvar title = v.title;\n\t\t\t\tvar artist = v.artist;\n\t\t\t\tvar artist = v.user.username;\n\t\t\t\tvar url = v.permalink_url;\n\t\t\t\taddSong(artwork, title, url, artist);\n\t\t\t\t// console.log(data);\n\t\t\t});\n\t\t},'json'\n\t);\n}", "function getDataFromApi(searchTerm, callback){\n const query = {\n part: 'snippet',\n key: 'AIzaSyAcQZoB0aRBwDFCoFdxsQ7V7UacB37xV2Y',\n q: `${searchTerm}`,\n maxResults: 5\n }\n $.getJSON(YOUTUBE_SEARCH_URL, query, callback)\n console.log(query)\n}", "function onTimerCallBack() {\n populateResults();\n }", "function callback() {\n //runs function queryCurrentWeather with this newly assigned currentWeather\n queryCurrentWeather(usCity[0].value);\n //runs forecast function with the newly assigned queryWeather\n forecast(usCity[0].value);\n //adds random image from Unsplash\n // $(\"#randoImg\").attr(\"src\", \"https://source.unsplash.com/featured/?\" + usCity.val() + \",city\");\n}", "function callback(results, status) {\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n parent = document.getElementById(\"mainPageWrapper\");\n\n for (var i = 0; i < results.length; i++) {\n if (results[i].photos) {\n createRestaurantContainer(parent, results[i]); //creating the restaurant container with results from api (nearbySearch)\n }\n getAdditionalDetails(results[i]); //get addtional details from the getDetails API (which are not available through the nearbySerach)\n }\n }\n }", "function callback(response) {\n\t\t\t\tif (response.items) {\n\t\t\t\t\tfor (var i = 0; i < response.items.length; i++) {\n\t\t\t\t\t\tvar item = response.items[i];\n\n\t\t\t \ttitle = \"<h1>Title:\" + item.volumeInfo.title + \"</h1>\";\n\t\t\t\t\t\tvar isbn_idx = item.volumeInfo.industryIdentifiers.findIndex(item => item.type == \"ISBN_13\");\n\t\t\t\t\t\tauthor = \"<h2>Authors:\" + item.volumeInfo.authors + \"</h2>\";\n\t\t\t\t\t\tdescription = \"<h2>Description:\" + item.volumeInfo.description + \"</h2>\";\n\n\t\t\t\t\t\tisbn = \"<h3>ISBN:\" + item.volumeInfo.industryIdentifiers[isbn_idx].identifier + \"</h3>\";\n\t\t\t\t\t\turl = item.volumeInfo.imageLinks.thumbnail;\n\t\t\t\t\t\timg = \"<img src=\" + url + \">\";\n\n\n\t\t\t\t\t\tresult.innerHTML += title + author + description + isbn + img;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\talert(\"Result not found\");\n\t\t\t\t}\n\n\t\t\t}", "afterSearch(result, params) {\n console.log(\"Hereeeeeeeeeee 12\");\n }", "function getUserFromDatabase(callbackFunction) {\n // does some async processing\n callbackFunction('Brad Stell')\n}", "function ______MA_Query() {}", "function queryGiphy(query, resultCallback) {\n // TODO(siham): write this part. Make sure that displayResult() (below)\n // works as a resultCallback ... probably need to open console\n // in browser and manually invoke\n // queryGihph('some query', displayResult)\n}", "function requestGetUnique_CompletedByHits(query, callback) {\n\n//\tvar url = hostUnique + format.queryToURLForm(slotValue_name, slotValue_country, slotValue_region, slotValue_content, slotValue_date, slotValue_solution); \n\n//\tvar url = hostUnique_ByHits + format.queryToURLForm(slotValue_name, slotValue_country, slotValue_region, slotValue_content, slotValue_date); \n\n\tvar url = hostUnique_CompletedByHits + query; \n\n request(url, function(error, response, body) { \n\n \tconsole.log(url); \n console.log('error: ', error); \n console.log('statusCode: ', response && response.statusCode); \n console.log('body: ', body); \n callback(JSON.parse(body)); \n\n }); \n\n\n}", "function getinfo(data,callback)\n{\n var myquery='select * from info where email=\"'+data.email+'\"';\n console.log(myquery);\n con.query(myquery,function(err,res,feilds){\n if (err) throw (err);\n console.log(\"response is\" + res[0]);\n return callback(res[0]);\n });\n}", "function callback() {\n\n}", "function callAPI(data, callback) {\n data.format = 'json'; // add the format to the given data query\n data.action = 'query';\n\n $.getJSON(mw.util.wikiScript('api'), data)\n .done(function(response) {\n if (response.error) {\n $('#abErrorsLog ul')\n .empty() // clears errors log\n .append($('<li>', {\n text: new Date().toLocaleTimeString() + ' - ' +\n i18n.msg('apiError').plain() + ' ' +\n response.error.info\n }));\n $('#abAutoRefresh').prop('checked', false);\n loadComplete();\n } else {\n callback(response);\n }\n })\n .fail(function(xhr, error) {\n $('#abErrorsLog ul')\n .empty() // clears errors log\n .append($('<li>', {\n text: new Date().toLocaleTimeString() + ' - ' +\n i18n.msg('ajaxError').plain() + ' ' +\n error\n }));\n $('#abAutoRefresh').prop('checked', false);\n loadComplete();\n });\n }", "function callApi(searchTerm, pageToken, callback){\n const query = {\n type: 'video',\n q: searchTerm,\n maxResults: 6,\n part: 'snippet',\n key: API_KEY,\n pageToken: pageToken\n };\n searchedTerm = searchTerm;\n $.getJSON(URL, query, callback)\n}", "function querySucceeded(data) {\n return data.results;\n }", "function get_venue_details(venue,callback)\n{\n \n var config = {\n authUrl: 'https://foursquare.com/',\n apiUrl: 'https://api.foursquare.com/'\n };\n var item;\n var venue_id = venue['id'];\n //$.ajaxSettings.async = false;\n $.getJSON(config.apiUrl + 'v2/venues/'+venue_id+'?'+auth+'&v='+getDateString())\n .done(function(data) {\n item = data['response']['venue'];\n callback(item);\n })\n .fail(function(error)\n {\n callback(null);\n });\n \n}", "function callback(results, status) {\r\n if (status == google.maps.places.PlacesServiceStatus.OK) {\r\n var lat = results[0].geometry.location.lat();\r\n var lng = results[0].geometry.location.lng()\r\n var openWeatherUrl = \"http://api.openweathermap.org/data/2.5/weather?lat=\"+lat+\"&lon=\"+lng+\"&APPID=4c4bbbfe912eef49997161d8f4176696\";\r\n $.getJSON(openWeatherUrl).done(function(weather) {\r\n results[0].weather = weather.weather[0].main;\r\n self.locations.push( new Location(results[0]));\r\n }); \r\n }\r\n }", "function AjaxCallback(data){\n docsToGet = data.results\n getChangedDocuments(store, changedocCallback) \n }", "function getDataFromApi(searchTerm, callback) {\n// set key value for ajax request from API\n const QUERY = {\n part: 'snippet',\n key: 'AAIzaSyBA9pN1XPD67wx2rEzNV6ymHIp7dJTwg4A',\n q: searchTerm,\n }; \n\n .getJSON(YOUTUBE_SEARCH_URL, QUERY, callback);\n}", "function search(query){\n\n\t$.ajax ({\n\t type: 'GET',\n\t dataType: 'jsonp',\n\t crossDomain: true,\n\t jsonp: 'json_callback',\n\t url: 'http://www.giantbomb.com/api/search/?format=jsonp&resources=game&api_key=' + apikey +'&query=' + encodeURI(query),\n\t complete: function() {\n\t console.log('ajax complete');\n\t },\n\t success: function(data) {\n\t searchCallback(data.results);\n\t console.log(\"Results Finished\");\n\n\t }\n\t});\n\n}", "function healthCheckCallback(healthCheckResults) {\n console.log(\"Results are ready.\");\n var contents = JSON.stringify(healthCheckResults);\n res.writeHead(200, {\n 'Content-Type': \"application/json\"\n });\n res.end(contents);\n }", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function callback(data) {\n\t\t\tconsole.log('DB Req callback');\n\t\t\tconsole.log(data);\n\t\t}", "function queryGiphy(query, resultCallback) {\n var giphy_url = \"https://api.giphy.com/v1/gifs/search?\"\n + \"api_key=\" + giphy_api_key\n + \"&q=\" + query\n + \"&limit=\" + 1\n jQuery.get(giphy_url, resultCallback)\n}", "function getDataFromFourSquare(query, callback){\n const data = {\n client_id: 'WAAZ1GSY5CM05ZRVSRUXC4JYMM4RRZ5KLOKOMCF4PRYI2XHZ',\n client_secret: 'P11LXVYDAKPIFOPYMUV1HXCVLAHCAFWP1K1WXLKWTP5ZYZM5',\n 11: '',\n near: '',\n radius: STATE.distance,\n query: STATE.searchFor,\n v: '20170801',\n limit:20\n }\n $.getJSON(FOUR_SQUARE, data, callback)\n console.log(query)\n}", "function searchSummonerStatsSummary(){\n\t// This is an example of a callback function where it calls the function getSummonerID and \n\t// // uses the function getSummonerStats as parameter.\n\t\n}", "query(options) {\n\n\n this.resource.onQuery(options).then(response => {\n\n // Callback function that should be called with the result object. The result object:\n //\n // result.results (object) - Array of result objects. The default renderers\n // expect objects with id and text keys. The id property is required,\n // even if custom renderers are used. The object may also contain a children\n // key if hierarchical data is displayed. The object may also contain a disabled\n // boolean property indicating whether this result can be selected.\n //\n // result.more (boolean) - true if more results are available for the current\n // search term.\n //\n // results.context (object) - A user-defined object that should be made available\n // as the context parameter to the query function on subsequent queries to load\n // more result pages for the same search term. See the description of\n // options.context parameter.\n options.callback({more: response.more, results: response.results});\n });\n }", "function recordsReturned(){\n}", "function GetURLResponse(url, callback) {\n\n\n $.getJSON(url + \"&callback=?\", function(parsedJSON) {\n\n var outPutResults = \"\";\n outPutResults = parsedJSON.toString();\n\n results(outPutResults);\n\n })\n}", "function getWeather(textField){\n\t\n\t// Construct accuweather query to retrieve the jsonp using YQL:\n\tvar query = \"select * from rss where url='http://rss.accuweather.com/rss/liveweather_rss.asp?locCode=\"+ textField +\"' limit 1\";\n \n\t// Define your callback:\n\tvar callback = function(data) {\n\tvar post = data.query.results.item;\n\t\n\t//Post the current weather\n\talert(post.title);\n\t};\n \n\t// Instantiate with the query:\n\tvar resultPost = new YQLQuery(query, callback);\n \n\t// If you're ready then go:\n\tresultPost.fetch();\n\t\n}", "function callback(response, status) {\n\n\t}", "function queryCallback(raisingComponent) {\r\n //Clear the timer\r\n window.autoReduceSearchDelayTimer = null;\r\n \r\n //Queue the event\r\n var queryEvent = new AdfCustomEvent(raisingComponent, \"clientPushQueryEvent\", { }, false);\r\n queryEvent.queue(true);\r\n AdfLogger.LOGGER.info(\"Sending queryCallbackEvent to server to process value \" + raisingComponent.getSubmittedValue());\r\n}", "function getAllItemsCallback(response){\n\tconsole.log(response.count);\n\tresponse.results.forEach(function(items){\n\t\tconsole.log(items.name);\n\t})\n}", "function runQuery(query) {\n connection.query(query, function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n // console.log response as JSON\n console.log(JSON.stringify(res[i]));\n }\n runSearch();\n });\n}", "function getData(query, callBack) {\n \n // creating ajax request\n var xhtr = new XMLHttpRequest();\n xhtr.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200) {\n var result = JSON.parse(this.responseText);\n // call to callback function which is passed to getData function\n callBack(result);\n }\n }\n\n xhtr.open('GET', 'http://localhost:3333/api/' + query, true);\n xhtr.send(); \n }", "function onSearchResponse(response) {\r\n showResponse(response);\r\n}", "function getDataFromApi(searchTerm, callback) {\n displayLoadingMessage();\n $('.js-search-results').html();\n const settings = {\n url: endPoint,\n data: {\n term: 'restaurant',\n location: `${searchTerm}`,\n limit: 40,\n attributes: 'hot_and_new'\n },\n dataType: 'json',\n type: 'GET',\n success: callback\n };\n\n $.ajax(settings);\n\n}", "function callback(results,status) {\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n var priRes = results[0];\n processPlaceObject(priRes);\n } else {\n alert('Oops! we cannot find the location, please try something else.');\n $('#search').removeClass('searchBarLoading');\n }\n\n}", "function onReturn(err, results){\n if(err){\n callback(errors.create(err));\n } else {\n callback(null, results);\n }\n }", "SearchUser(callback) {\n let user = new Users();\n\n user.SearchUser(function(result){\n\n callback(result); \n }); \n }", "function callback(position){\n console.log(position);\n var latitude = position.coords.latitude;\n var longitude = position.coords.longitude;\n var key = \"AIzaSyDc_-wjPpy3v8eNcUdRuOva8hDaI4JzPY8\";\n var path = \"https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=\"+ latitude +\",\"+ longitude +\"&radius=500&types=food&key=\" + key;\n console.log(path);\n getResults(path);\n}", "function LatLong_Complete(result) { //function LatLong_Complete is defined\n var lat = result.results[0].geometry.location.lat;\n var lng = result.results[0].geometry.location.lng;\n var local = lat + \",\" + lng;\n var city = result.results[0].address_components[1].long_name;\n var state = result.results[0].address_components[3].short_name;\n locationName = result.results[0].formatted_address;\n console.log(lat,lng,local,city,state);\n\n\n var darkSkyUrl =\"https://api.darksky.net/forecast/9a451f009690bf1c4cb3b721e22d623e/\" + lat + \",\" + lng;\n \n var ask = { \n url: darkSkyUrl,\n dataType: \"jsonp\",\n success: darkSky\n };\n $.ajax(ask); \n\n} //function LatLong_Complete defined has ended", "function searchCallback(data,searchType,idSearch) {\t\n\tif(idSearch){\n\t\t//if ID Search, only construct the Soundcloud player \n\t\tconsole.log(data.uri)\n\t\t$('#soundCloud').append('<iframe class=\"iframe\" id = \"soundcloudElement\" width=\"100%\" height=\"465\" scrolling=\"no\" frameborder=\"no\">');\n \t\t$('.iframe').attr('src',src = 'https://w.soundcloud.com/player/?url='+data.uri);\n\n \t}else{\n\n\t\t//construct the table, but only return first 50 results\n\t\tif (data.length>50){\n\t\t\tdata = data.slice(1,50);\n\t\t}\n\n\t\tvar content = $('#results');\n\t\tvar $newDiv = $('<div>');\t\t\n\t\tvar $newP = $('<p>');\n\t\t\n\t\t\t// searchType = userSearchString;\n\t\t\tsearchTemplateGet(data);\n\t}\t\n}", "function getYoutubeDataFromApi(searchTerm, callback) {\r\n if($('.js-query').val()){\r\n const query = {\r\n part: 'snippet',\r\n key: 'AIzaSyCo3Hc6JwT7iXeFvOUuVJOyoQPHOlWeUd4',\r\n q: `${searchTerm} in NYT`, \r\n maxResults: \"2\" \r\n } \r\n $.getJSON(YOUTUBE_SEARCH_URL, query, callback); \r\n } \r\n \r\n}", "function callback(){\n console.log(\"Charts Data Executed\");\n}", "function getBabyName(name) { // API request function\n\n $.ajax({\n url: `https://data.novascotia.ca/resource/emf8-vmuy.json?`,\n type: \"GET\",\n data: {\n \"$limit\": 10000,\n \"$$app_token\": \"whW6hkBV9XeQn2RtJhqKb9pzA\",\n \"first_name\": name.toUpperCase(),\n }\n\n }).then(function(name) { //when I got my results\n console.log(name)\n feedBackName(name); //then run feedBack function\n\n });\n\n\n}", "function callback(err, r) { console.log(`callback: result=${r}; error=${err}`); }", "function getDataFromApi(upcCode) {\n console.log(\"searching for \"+upcCode);\n const URL=`https://api.edamam.com/api/food-database/parser?upc=${upcCode}&app_id=${foodAPI_id}&app_key=${foodAPI_key}`;\n $.getJSON(URL, upcCode, displaySearchData);\n}", "function renderPage(){\nif (userEntry.length > 0){\n apiCall(userEntry[0]);\n}\ninitializePastSearches();\n}", "function jsonFlickrApi(res){\n console.log(\"Err: I don't know how to handle this!\");\n console.log(res);\n}", "function executeGeoNamesAPISearch(searchterm, callback) {\n //Reach out to GeoNames API\n\n //Encode for URL\n searchterm = encodeURIComponent(searchterm);\n\n var options = {\n host: 'api.geonames.org',\n path: '/search?name=' + searchterm + '&username=' + settings.geonames.username + '&featureClass=A&featureClass=P&type=json',\n method: 'GET',\n port: 80,\n headers: {\n 'Content-Type': 'application/json'\n }\n };\n\n rest.getJSON(options, function (statusCode, result) {\n common.log(\"got geonames result.\");\n callback(statusCode, result)\n }); //send result back to calling function\n }", "function getDataFromApi (searchTerm, callback) {\n var query = {\n fillIngredients: false,\n ingredients: searchTerm,\n limitLicense: true,\n number: 6,\n ranking: 1\n }\n $.getJSON(SPOONACULAR_SEARCH_URL, query, callback);\n}", "function onSearchResponse(response) {\n showResponse(response);\n}", "function onSearchResponse(response) {\n showResponse(response);\n}", "function onSearchResponse(response) {\n showResponse(response);\n}", "function onSearchResponse(response) {\n showResponse(response);\n}", "async query(query) {\n\n }", "getJSONData(searchIn, searchFor, callBack) {\n try {\n fetch('https://www.theedgesusu.co.uk/wp-json/wp/v2/' + searchIn + '?search=' + searchFor + '&_embed', {\n method: 'GET',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n }).then(response => response.json())\n .then(responseJson => {\n callBack(responseJson);\n })\n .catch(error => {\n console.error(error);\n });\n } catch (error) {\n // Error retrieving data\n }\n }", "function SucceededCallback(result, eventArgs)\r\n{\r\n // Page element to display feedback.\r\n // var RsltElem = document.getElementById(\"ResultId\");\r\n // RsltElem.innerHTML = result;\r\n parseJson(result);\r\n}", "onSuccess() {}", "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 innerSuccessCallback(sqlTransaction, results) {\n\n\n // CG - On some occasions, we do not want to call anything in particular on success (e.g. after we have completed a 'CREATE' query).\n if (successCallback) {\n\n // CG - Here we are only interested in passing back the collection of results.\n // This ensures the WebSQL API remains consist with IndexedDb in its return values.\n successCallback(results.rows);\n }\n\n }", "function handleQueryResponse (e) {\n var res = (e && e.response && e.response.results) ? e.response.results : e;\n \n // if there is a result, and it's not an empty array\n if (res && !(res && (\"length\" in res) && res.length === 0)) this.fire(\"ac:load\", {\n results : res,\n query : this.get(\"queryValue\")\n });\n}", "function grabResults(t){\n\t$.ajax({\n\t\ttype:'GET',\n\t\turl:u+t+'?api_key='+k,\n\t\tdataType: 'JSONP',\n\t\tapi_key: k,\n\t\tsuccess: jsonParse,\n\t\t});\n}", "function search_successCB(data) {\n\n // Object created from json\n resultJSON = JSON.parse(data);\n\n generate_list(resultJSON)\n\n console.log(\"Success callback\");\n }", "function callBandsintown(artist, callback) {\n if (!artist) {\n console.log('\\n\\nPlease enter an artist or band.\\n\\n');\n callback();\n return;\n }\n axios\n .get(`https://rest.bandsintown.com/artists/${artist}/events?app_id=secret`)\n .then(function (response) {\n // Catch an error when query contains quotes\n if (response.data === '\\n{error=An error occurred while searching.}\\n') {\n console.log('\\nEnter an artist/band name without any quotes or special characters.\\n');\n callback();\n return;\n }\n // Catch an error when query was not found\n if (response.data === '\\n{warn=Not found}\\n') {\n console.log(chalk`\\nNo results for {bold ${artist}}\\n`);\n callback();\n return;\n }\n // Show how many results were found\n console.log(`\\n- * - * - * - * -\\n`);\n // Iterate through each result and display the data\n response.data.forEach(function (event) {\n let { name, city, region, country } = event.venue;\n let { datetime } = event;\n\n console.log(chalk`{bold Venue:} {yellowBright ${name}}\\n{bold Location:} ${city}, ${region}, ${country}\\n{bold When:} ${datetime}`);\n // If there are tickets available provide a link\n if (event.offers.length !== 0) {\n let { url } = event.offers[0];\n console.log(chalk`{bold Tickets:} {cyan ${url}}`);\n }\n // Separator\n console.log(`\\n- * - * - * - * -\\n`);\n });\n // Display number of results\n console.log(chalk`Found {inverse ${response.data.length}} upcoming events for {bold.yellowBright ${artist}}\\n`);\n // Run a callback function after data has been logged\n callback();\n })\n .catch(function (err) {\n console.log('\\nTry that again...\\n');\n callback();\n });\n}", "searchGoogle(searchStr, location2) {\n console.log(\"I'm in search Google on the front-end\");\n console.log(searchStr);\n console.log(location2);\n API.searchGoogle({\n search: searchStr,\n location: location2\n })\n .then(res => {\n console.log(\"I've completed searchYelp and i'm on the client. Here is res\");\n console.log(res);\n })\n .catch(err => console.log(err));\n }", "function executeQuery(url,cb) {\n let log = {query:url}\n console.log(url)\n let options = {\n method: 'GET',\n uri: url,\n headers: {\n 'Accept': 'application/fhir+json'\n }\n };\n\n request(options, function (error, response, body) {\n//console.log(body)\n if (body) {\n try {\n let json = JSON.parse(body)\nconsole.log(response.statusCode)\n cb({response:json, status:response.statusCode})\n return;\n } catch(ex) {\n console.log('invalid json', ex)\n cb(null)\n }\n\n } else {\n console.log('no body')\n cb(null)\n }\n\n })\n }", "function articleAPICall() {\n var res = new EDMUNDSAPI(\"sej676rt53rh2cwp9jrcr9h3\");\n // Get articles\n var options = {\n view: \"full\"\n };\n\n // Callback function to be called when the API response is returned\n function mainArticleCall(articleAPIJson) {\n searchArticleJSON = articleAPIJson;\n\n console.log(searchArticleJSON);\n console.log(articleAPIJson);\n\n // $(\"#right-side-container\").html(\"<div class='w3-teal' style='margin-top:10px; width: 800px;''>Featured Dealers</div>\");\n\n for (var i = 0; i < searchArticleJSON.articles.length; i++) {\n $(\"#search-result-box\").append(\n \"\\n <div class='search-result-container w3-red'> <div class='search-title' style='width:600px;'>\" +\n searchArticleJSON.articles[i].title +\n \"</div> <div class='search-inner-contents'>\" +\n searchArticleJSON.articles[i].description +\n \"</div> <a href='\" +\n searchArticleJSON.articles[i].link.href +\n \"'>\" +\n searchArticleJSON.articles[i].link.href +\n \"</a> </div>\"\n );\n }\n console.log(\"populating listings!\");\n }\n\n // Oops, Houston we have a problem\n function fail() {\n // console.log(data);\n // $(\"#right-side-container\").html(\"<div class='w3-teal' style='margin-top:10px; width: 800px;''>Featured Dealers</div>\");\n for (var i = 0; i < backupArticleJSON2.articles.length; i++) {\n $(\"#search-result-box\").append(\n \"\\n <div class='search-result-container w3-red'> <div class='search-title' style='width:600px;'>\" +\n backupArticleJSON.articles[i].title +\n \"</div> <div class='search-inner-contents'>\" +\n backupArticleJSON.articles[i].description +\n \"</div> <a href='\" +\n backupArticleJSON.articles[i].link.href +\n \"'>\" +\n backupArticleJSON.articles[i].link.href +\n \"</a> </div>\"\n );\n }\n console.log(\"Made it through the loops\");\n }\n\n var endpoint =\n \"/api/editorial/v2/\" +\n searchMake +\n \"/\" +\n searchModel +\n \"/\" +\n searchYear +\n \"/\";\n // Fire the API call\n res.api(endpoint, options, mainArticleCall, fail);\n}", "function apiFourSquare(mar,c,t,info)\n{\n var url= apiUrl(clientID,clientSecret,c,t).toString();\n$.getJSON(url).done(function(mar) {\n var response = mar.response.venues[0];\n self.msgFourSquare =\n '<h4>' + response.name +\n '</h4>' + '<div>' +\n '<p><h6>Address:</h6> ' + response.location.formattedAddress[0] + '</p>' +\n '<p><h6>Category:</h6> ' + response.categories[0].shortName +'</p>' + \n '</div>';\n info.setContent( self.msgFourSquare);\n}).fail(function() {\n //alert for when foursquare fail\n alert(\n \"The data could not be loaded from FourSquare, please try to reload the page.\"\n );\n});\n}", "function discoverMovies(callback) {\n $.ajax({\n url: api.root + \"/discover/movie\",\n data: {\n api_key: api.token\n },\n success: function(response) {\n model.browseItems = response.results;\n callback(response);\n //console.log(response);\n }\n });\n}", "function callback(result) {\n // body...\n\n for (var i = 0; i < result.length; i++) {\n console.log(result[i]);\n }\n }" ]
[ "0.66919136", "0.6685966", "0.65328956", "0.6441609", "0.64311993", "0.64059484", "0.637439", "0.6368524", "0.6366407", "0.63570154", "0.63570154", "0.63570154", "0.63570154", "0.63570154", "0.62984645", "0.62219214", "0.62196636", "0.6199115", "0.6187492", "0.6182562", "0.6179709", "0.61460114", "0.6108683", "0.6100829", "0.6100434", "0.60811365", "0.60510373", "0.604724", "0.601947", "0.6019073", "0.6006676", "0.5980551", "0.59771013", "0.59733975", "0.59655756", "0.5962043", "0.59562695", "0.59490323", "0.5944114", "0.59201974", "0.59030247", "0.5898031", "0.58810496", "0.5880048", "0.58795595", "0.58717275", "0.5870459", "0.5863997", "0.5863997", "0.5863997", "0.5863997", "0.5858562", "0.58585596", "0.58583504", "0.5854457", "0.584544", "0.5844374", "0.58405423", "0.58308995", "0.58220804", "0.5814272", "0.5814082", "0.58107746", "0.5807243", "0.5805891", "0.58049476", "0.58023167", "0.5799755", "0.57978743", "0.5795085", "0.57915926", "0.5787624", "0.57860184", "0.57805556", "0.5773823", "0.57687145", "0.5767884", "0.57664716", "0.576584", "0.576181", "0.57573855", "0.57555294", "0.57555294", "0.57555294", "0.57555294", "0.575546", "0.57545674", "0.5751086", "0.57488865", "0.5746919", "0.5743643", "0.57423866", "0.5742097", "0.574012", "0.5728627", "0.57274467", "0.5723335", "0.5719151", "0.5716755", "0.5715628", "0.57143784" ]
0.0
-1
this is a temporary fix, while the client doesn't load item defs from the XML files. we pass this data on login events.
function getAssetInfo(){ return { 'position': {"x":-18,"y":-17,"w":37,"h":17}, 'thumb': "iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\/rhtAAAAHElEQVR42u3BAQEAAACCIP+vbkhA\nAQAAAAAAfBoZKAABfmfvpAAAAABJRU5ErkJggg==", }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n dimDefinitions.getDefinitions().then((defs) => {\n vm.fullItem = dimItemService.getItem({ id: $stateParams.itemId });\n if (!vm.fullItem) {\n return;\n }\n vm.item = angular.copy(vm.fullItem);\n vm.originalItem = vm.item.originalItem;\n vm.definition = defs.InventoryItem.get(vm.item.hash);\n delete vm.item.originalItem;\n\n vm.store = dimStoreService.getStore(vm.item.owner);\n });\n }", "function initUserItems($items) {\n\t\t\t\t$items.on('click', function () {\n\t\t\t\t\topenUserInfoPopup($(this).data('value'));\n\t\t\t\t});\n\t\t\t}", "function setUpData(data){\n\t// this function is called after the successful ajax call to the Irish Life server for the big json file\n\t\n\tPublicFundNameList = data;\n\t// now set up the screen\n\t\n\t\t\t//loadingPage();\n\t\n\tsetupMocks();\n}", "function initializeData(listName) {\n\t\t//use a list with default values\n\t\tshoppingLists = myList;\n\t\tsessionList = shoppingLists[listName];\n\t\t//create the initial list collection in local storage\n\t\tlocalStorage.setItem(\"shoppingLists\", JSON.stringify(shoppingLists));\n\t\t//call the function to display the list on screen, but set save to false since local storage is up to date\n\t\tsessionList.forEach(function(item) {\n\t\t\taddItem(item, false);\n\t\t});\n}", "function initApp() { \n Office.context.mailbox.item.loadCustomPropertiesAsync(customPropsCallback);\n item = Office.context.mailbox.item;\n itemBody();\n}", "function wems_OnLoad() {\r\n initializeManagementData();\r\n}", "function initLists () {\n\t\tvar user = User.getCurrent().then(function(user_data) {\n\t\t\tvar username = User.findByEmail(user_data.email);\n\t\t\tusername.$loaded(function() {\n\t\t\t\t// Returns an array. Maybe refactor findByEmail to unwrap?\n\t\t\t\tsetLists(username[0].$id);\n\t\t\t\tsetUser(username[0].$id);\n\t\t\t});\n\t\t});\n\t}", "_define_user() {\n if ( GenericStore.defaultUserId ) {\n this.definedProps[ 'uid' ] = GenericStore.defaultUserId;\n }\n }", "function ___loadUserData() {\n\n\t// load items and colors somehow\n\n\tcolors=new Array(colorReset[0],colorReset[1],colorReset[2],colorReset[3]);\n\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 loadUserDetails() {\n loadJSON('backend/resources/json/user.json', function(response) {\n actual_JSON = JSON.parse(response);\n globalId = actual_JSON.passkey;\n onValidate();\n });\n}", "function RequestLoadPersonalData() {\n\n}", "function RequestLoadGeneralData() {\n\n}", "function Data() {\n var context = SP.ClientContext.get_current();\n var web = context.get_web();\n var lists = web.get_lists();\n //var list = context.get_web().get_lists().getByTitle('RajeshPracticeList');\n //var camlquery = new SP.CamlQuery();\n //camlquery.set_viewXml('<View><RowLimit>100</RowLimit></View>');\n\n //this.collListItem = list.getItems(camlquery);\n\n context.load(web, \"Title\", \"Description\");\n context.load(lists, \"Include(Title,Fields.Include(Title))\");\n //context.load(collListItem, 'Include(Id,DisplayName)');\n context.executeQueryAsync(success, fail);\n\n function success() {\n var info = jQuery(\"#message1\");\n info.append(web.get_title());\n\n var listEnumerator = lists.getEnumerator();\n while (listEnumerator.moveNext()) {\n var listinfo = listEnumerator.get_current();\n info.append(\"<br />\");\n info.append(listinfo.get_title());\n\n //var listFields = lists.get_fields();\n //clientContext.load(listFields);\n\n var listfiledinfo = listinfo.get_fields().getEnumerator();\n\n while (listfiledinfo.moveNext()) {\n var field = listfiledinfo.get_current();\n info.append(\"<br />&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\");\n info.append(field.get_title());\n\n\n }\n }\n }\n function fail(sender, args) {\n alert(\"Error Occured\" + args.get_message());\n\n }\n\n\n }", "function InventoryItemMiscPandoraPadlockLoad() {\n}", "function fillAuthData() {\n var authData = localStorageService.get('authorizationData');\n if (authData) {\n authentication.isAuth = true;\n authentication.userName = authData.userName;\n authentication.roleId = authData.roleId;\n aclService.getAllAccessControlListAndPermissions('name').then(function (result) {\n authentication.accessControlList = result.accessControlList;\n authentication.domainObjectList = [];\n for (var i = 0; i < authentication.accessControlList.length; i++) {\n authentication.domainObjectList.push(authentication.accessControlList[i].domainObject.description);\n }\n\n $rootScope.currentUser = authentication;\n });\n }\n }", "function initData() {\n\t\t\tvar url = $trigger.attr(\"href\");\n\n\t\t\tleavingIbmUrl = url;\n\n\t\t\trawUrl = extractUrl(url);\n\t\t}", "function fillAuthData() {\n var authData = localStorageService.get('authorizationData');\n if (authData) {\n authentication.isAuth = true;\n authentication.userName = authData.userName;\n authentication.roleId = authData.roleId;\n }\n }", "function getUserData() {\n\n // Retrieve all keys and values from application storage, including public app config. Set the values for select, input and textarea elements on a page in a callback\n\n EcwidApp.getAppStorage(function (allValues) {\n setValuesForPage(allValues);\n checkTestModeValue(); // Check if test mode is \n });\n\n}", "function onPageLoad() {\n\tif (loginDataReady) {\n\t\tupdateBootStatus(\"halt:org.webshell.shell:processLoginData:ready\");\n\t\tprocessLoginData();\n\t} else {\n\t\tupdateBootStatus(\"halt:org.webshell.shell:processLoginData:notready\");\n\t\tpageLoadedQuickSoProcessDataImmediately = true;\n\t}\n}", "constructor(item_data) {\n this.item_data = item_data\n }", "function loadAuthData() {\n // Skip if the local storage is not available.\n if (!utils.storageAvailable('localStorage')) {\n return;\n }\n\n // Load the data from the local storage.\n var data = localStorage[authDataID];\n if (!data) {\n return;\n }\n\n // Try to parse the JSON.\n try {\n data = JSON.parse(data);\n }\n catch(e) {\n console.log(\"failed to decode saved auth data JSON: \" + e);\n return;\n }\n\n // Set the values if present.\n if (data.authUserID) {\n authUserID = data.authUserID;\n }\n }", "function loadData(listName) {\n\t\t//load the shopping lists collection from local storage\n\t\tshoppingLists = JSON.parse(localStorage.getItem(\"shoppingLists\"));\n\t\t//set the current working list \n\t\tsessionList = shoppingLists[listName];\n\n\t\t//call the function to display the list on screen, but set save to false since local storage is up to date\n\n\n\t\tsessionList.forEach(function(item) {\n\t\t\taddItem(item, false);\n\t\t});\n}", "async onLoad(options) {\n this.setData({\n postList\n })\n wx.setStorageSync('flag', true);\n wx.getStorage({\n key: 'flag'\n }).then((val) => {\n console.log(val)\n })\n console.log(await wx.getStorage({ key: 'flag'}))\n }", "function loadData(data) {\n _userData = data.userData;\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 }", "navigationDataLoader(req, res, next) {\n const { navItems } = require('../../config/navigation-data.json');\n res.locals.navItems = navItems;\n next();\n }", "function loadData() {\n\tvar camlQuery = new SP.CamlQuery();\n\t\n\tvar query = '<View><Query><OrderBy><FieldRef Name=\"Created\" Ascending=\"False\"></FieldRef></OrderBy></Query>'+\n\t\t\t\t'<ViewFields><FieldRef Name=\"SprintProgress\"/></ViewFields><RowLimit>'+ sprintHistoryLimit +'</RowLimit></view>';\n\tcamlQuery.set_viewXml(query);\n\tcollListItem = listReference.getItems(camlQuery);\n\n\tclientContext.load(collListItem);\n\tclientContext.executeQueryAsync(\n\tFunction.createDelegate(this, this.pageInit),\n\tFunction.createDelegate(this, this.showDataError));\n}", "function setupItems() {\n let items = getLocalStorage();\n\n if (items.length > 0) {\n items.forEach((item) => {\n createAllItems(item.id, item.value);\n });\n allList.classList.add(\"visible\");\n }\n}", "function login() {\n //Stop spinner\n document.getElementById(\"loginBtnIcon\").classList.remove(\"fas\",\"fa-spinner\",\"fa-spin\");\n\n //Enable menu button:\n toggleEnable(document.getElementById(\"menuBtn\"))\n\n //Show bottom bar buttons and highlight feed mode button\n itemBlock(document.getElementById(\"bottomBar\"))\n \n //Change title bar to that of app start page\n itemHide(document.getElementById(\"topBarTitleWelcome\"))\n itemBlock(document.getElementById(\"topBarTitleData\"))\n \n // Make sure correct menu button icon is displayed\n itemBlock(document.getElementById(\"menuBtn\"))\n itemHide(document.getElementById(\"menuBtnAlt\"))\n \n //Show only the menu items for current mode\n setBlock([...document.getElementsByClassName(\"dataMenuItem\")])\n\n //hide login screen and show feed screen\n itemHide(document.getElementById(\"loginModeDiv\"))\n itemBlock(document.getElementById(\"dataPageDiv\"))\n\n\n //Save the current user name to local storage\n console.log(\"Storing: \", document.getElementById(\"emailInput\").value, \" In local storage \")\n window.localStorage.setItem(\"UserName\", document.getElementById(\"emailInput\").value)\n loggedInUser = document.getElementById(\"emailInput\").value\n //Set mode to current mode\n mode = \"dataMode\"\n}", "function init() {\n var userList = getStorage();\n var empList = userList;\n insertRow(empList);\n}", "function fetch_item_data() {\n return wkof.ItemData.get_items('assignments').then(items=>{\n let registry = {};\n items.forEach(item=>{\n if (!item.assignments) return;\n registry[item.id] = {\n level: item.data.level,\n UID: item.object[0].toLowerCase()+item.id,\n available_at: item.assignments.available_at,\n };\n });\n return registry;\n });\n }", "function createUserData() {\n\n // Saves data for application storage \n EcwidApp.setAppStorage(initialConfig.private, function (value) {\n console.log('Initial private user preferences saved!');\n });\n\n // Saves data for public app config\n EcwidApp.setAppPublicConfig(initialConfig.public, function (value) {\n console.log('Initial public user preferences saved!');\n });\n\n // Function to prepopulate values of select, input and textarea elements based on default settings for new accounts\n setValuesForPage(initialConfig);\n checkTestModeValue();\n}", "_importItems()\n\t{\n\t\tconst response = {\n\t\t\torigin: \"Form._importItems\",\n\t\t\tcontext: \"when importing the form items\",\n\t\t};\n\n\t\ttry\n\t\t{\n\t\t\tconst itemsType = typeof this._items;\n\n\t\t\t// we treat undefined items as a list with a single default entry:\n\t\t\tif (itemsType === \"undefined\")\n\t\t\t{\n\t\t\t\tthis._items = [Form._defaultItems];\n\t\t\t}\n\t\t\t// if items is a string, we treat it as the name of a resource file and import it:\n\t\t\telse if (itemsType === \"string\")\n\t\t\t{\n\t\t\t\tthis._items = TrialHandler.importConditions(this._psychoJS.serverManager, this._items);\n\t\t\t}\n\t\t\t// unknown items type:\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow `unable to import items of unknown type: ${itemsType}`;\n\t\t\t}\n\n\t\t\t// if items is an empty array, we replace with a single default entry:\n\t\t\tif (Array.isArray(this._items) && this._items.length === 0)\n\t\t\t{\n\t\t\t\tthis._items = [Form._defaultItems];\n\t\t\t}\n\t\t}\n\t\tcatch (error)\n\t\t{\n\t\t\t// throw { ...response, error };\n\t\t\tthrow Object.assign(response, { error });\n\t\t}\n\t}", "function loadInitData() {\n var jsonData = new Object();\n jsonData.sequence_id = \"1\";\n jsonData.idtxn = gTrans.idtxn;\n var args = new Array();\n args.push(null);\n args.push(jsonData);\n var gprsCmd = new GprsCmdObj(CONSTANTS.get(\"CMD_BATCH_SALARY_MANAGER\"), \"\", \"\", gUserInfo.lang, gUserInfo.sessionID, args);\n var data = getDataFromGprsCmd(gprsCmd);\n requestMBServiceCorp(data, false, 0, function (data) {\n var resp = JSON.parse(data);\n if (resp.respCode == 0 && resp.respJsonObj.listMakers.length > 0) {\n //Danh sach nguoi duyet\n gTrans.listMakers = resp.respJsonObj.listMakers;\n } else\n gotoHomePage();\n }, function () {\n gotoHomePage();\n });\n}", "function initCompletionItems() {\n $.get(completionItemsUrl,function (data) {\n data = unpackResult(data);\n gdata.completionItems = data.data;\n })\n}", "function initializeGlobalItemEditing() {\n ItemEditing = new umbraco.presentation.LiveEditing.ItemEditing();\n}", "resetLocal(){\n\t\tconsole.log(\"Extension Data Reset. Ooof - FROM USER CONSTRUCTOR\");\n\t\tdata = INIT_USER_DATA;\t\t\n\t\tthis.updateLocal();\n\t}", "function setUserdataObject () {\n\t\t// Try and get user data from local storage. Returns null or data. \n\t\tvar storageData = getUserdataFromStorage();\n\n\t\t/**\n\t\t\tCall the web service only if:\n\t\t\t\tthey force an IP lookup via URL param, \n\t\t\t\tor no data was retrieved from storage, \n\t\t\t\tor storage data was compromised (Ex: user screws with localstorage values)\n\t\t\tElse the user had valid stored data, so set our user obj.\n\t\t**/\n\t\tif (ipForced !== \"\" || !storageData || !storageData.information_level) {\n\t\t\trequestUserdataFromService();\n\t\t}\n\t\telse {\n\t\t\tpopulateUserObject(storageData);\n\t\t}\n\t}", "function init () {\n var userData = localStorageService.get('user'),\n permissions = userData['modulos'];\n\n localStorageService.set('permissions', permissions);\n\n asignarVisibilidadDeModulos(sharingData.mainMenu, permissions);\n $scope.userModulePermission = sharingData.mainMenu;\n\n if( $location.$$path.indexOf('menuBap') > -1 ) {\n localStorageService.set('module',undefined);\n $rootScope.moduloSeleccionado = undefined;\n } else {\n var moduleCode = localStorageService.get('module') || 'CXP';\n $rootScope.moduloSeleccionado = menuModulo['menu'][moduleCode];\n //$rootScope.moduloSeleccionado = menuModulo['menu'][localStorageService.get('module') || 'CXP'];\n }\n }", "function initializer() {\n\t// xhr.loadFoodItems(data.whenFoodItemsLoad, data.errorFunction);\n\txhr.loadFoodItems();\n}", "function startPopulateEmployeeList(XML) {\n\tif(XML == null)\n\t\treturn;\n\tvalueListXML = XML;\n\tpositionInList = 0;\n\t//if this function is already running\n\tif(window.populateLock)\n\t\twindow.populateLock = false;\n\telse\n\t\tpopulateEmployeeList();\n}", "SYS_STF_LST_READY(state, p){\n state.staff.list = p.list;\n }", "init() {\n\t\tthis.replaceData(\n\t\t\tthis.manager.get(\"noReq\"),\n\t\t\tthis.endpoints.get,\n\t\t\tthis.data.get\n\t\t);\n\t}", "function getItemVal(data) {\n // Retrieving data if any\n var items_data = data.val();\n \n\n // Check if new user - has no real items reference key\n if (items_data == null)\n {\n refItems.push(item_data);\n }\n // Returning user - has items reference key\n else \n {\n var keys = Object.keys(items_data);\n user_key = keys[0];\n\n //retrieve data\n user_items = {\n item0: items_data[user_key].item0,\n item1: items_data[user_key].item1,\n item2: items_data[user_key].item2,\n item3: items_data[user_key].item3,\n item4: items_data[user_key].item4,\n item5: items_data[user_key].item5,\n item6: items_data[user_key].item6,\n item7: items_data[user_key].item7,\n item8: items_data[user_key].item8,\n item9: items_data[user_key].item9,\n item10: items_data[user_key].item10,\n item11: items_data[user_key].item11,\n item12: items_data[user_key].item12,\n item13: items_data[user_key].item13,\n item14: items_data[user_key].item14,\n item15: items_data[user_key].item15\n }\n }\n loadAvatars();\n\n \n // load base ferret avatar\n avatarBase = loadImg(\"/images/avatar/Ferret.png\");\n // layer items\n // Update Items according to database\n shoesUrl = getItemURL(avatar_items[\"shoes\"]);\n shirtUrl = getItemURL(avatar_items[\"shirt\"]);\n hatUrl = getItemURL(avatar_items[\"hat\"]);\n\n\n savedHatUrl = getItemURL(avatar_items[\"hat\"]);\n savedShirtUrl = shirtUrl;\n savedShoesUrl = shoesUrl;\n\n\tloadImg(shoesUrl);\t\n\tloadImg(shirtUrl);\n\tloadImg(hatUrl);\n\t//save();\n\n}", "loadEntity(itemId) {\n\n }", "onAfterLoadEntity(data_obj) {\n\t\t//TODO: Override this as needed;\n\t}", "function handleDataReturn(data,e) {\n if (!stat.isSuccessfull(e)) {\n var err=new stat.states.items.INVALID_ITEM_FILE({\n description:\"loading item data\",\n parseStr:cache[c][1],\n name:item,\n id:id,\n parseData:parseData,\n error:{\n errorObj:e,\n msg:e.message\n }\n });\n accept(id,null,err);\n return;\n } else {\n itemAddData=data;\n loadWithData();\n }\n }", "function autoLoad()\n{\n\tif (userDrawnDataUrl) {\n\t\tloadXmlData(userDrawnDataUrl);\n\t}\n}", "async processItem ({item, h}) {\n if (item.type != 'page') return\n const data = fs.readFileSync(h.pathItemSrc(item), 'utf8')\n if (data) item.data = data \n }", "function onInitialFrameLoad(){\n if(contentEditCriteria.assetType == \"shared\")\n {\n // show the warning message for shared asset\n var warning = 'This is a shared Asset. Your edits will take effect on all pages that use this Asset.';\n var $topPlaceHolder = $contentFrameElem(\"#perc-content-edit-content-top-placeholder\");\n $topPlaceHolder.addClass(\"perc_shared_asset_edit_warning perc-asset-edit-info-line\");\n $topPlaceHolder.html(warning);\n $topPlaceHolder.show();\n \n // add the folder path for an existing asset\n if (assetId != undefined && assetId != '')\n {\n var pathField = '<label for=\"perc-content-edit-meta-data-item_folder_path\" >Folder path:</label> <br/>' + \n '<div id=\"perc-content-edit-meta-data-item_folder_path\" class=\"datadisplay\">' +\n contentEditCriteria.folderPath + '</div> <br/>';\n\n $contentFrameElem(\"#perc-content-edit-meta-data-top-placeholder\").html(pathField);\n $contentFrameElem(\"#perc-content-edit-metadata-panel\").show();\n //Render site impact for the asset.\n $contentFrameElem(\"#perc-site-impact-panel\").show();\n $.PercSiteImpactView.renderSiteImpact(assetId, $.PercSiteImpactView.ITEM_TYPE_ASSET, $contentFrameElem(\"#perc-site-impact-panel\"));\n }\n }\n }", "function storeItems() { //#app.js\n store.setItem('items', itemList.toJSON())\n }", "function onPreappinit() {\n kony.print(\"LOG : onPreappinit - START\");\n gAppData = new initAppData();\n}", "init() {\n for (const itemKey in this._config) {\n // confirm itemKey isn't from prototype\n if (this._config.hasOwnProperty(itemKey)) {\n const itemValue = localStorage.getItem(itemKey);\n if (itemValue !== null) {\n this._config[itemKey] = itemValue;\n }\n }\n }\n }", "function insFcLoadInitialData (docFc:NotesXspDocument) {\r\n\tif (docFc.isNewNote() == false) return true;\r\n\t\r\n\tvar vecInsSelected:java.util.Vector = sessionScope.get(\"viewInsSelection\");\r\n\r\n\tif (vecInsSelected == null) throw new java.lang.Exception(\"No se encontraron Inspecciones Seleccionadas\");\r\n\tif (vecInsSelected.isEmpty()) throw new java.lang.Exception(\"No hay Inspecciones Seleccionadas\");\r\n\tif (vecInsSelected.elementAt(0).equals(\"\")) throw new java.lang.Exception(\"Sin Inspecciones para Facturar\");\r\n\t\r\n\tdocFc.replaceItemValue(\"InsUNIDs_FC\", vecInsSelected);\r\n\t\r\n\tvar strInsUnid:String = vecInsSelected.elementAt(0);\r\n\tvar dbIns:NotesDatabase = getDbInspecciones();\r\n\tvar docIns:NotesDocument = dbIns.getDocumentByUNID(strInsUnid);\r\n\t\r\n\tvar myInspector = swInspector (docIns);\r\n\tdocFc.replaceItemValue(\"Inspector_FC\", myInspector.getNom);\r\n\tdocFc.replaceItemValue(\"KM_Valor_FC\", myInspector.getValKM);\r\n\t\r\n\tvar docIns:NotesDocument;\r\n\tvar intSumaIns:int = 0;\r\n\tvar vecCodes:java.util.Vector = new java.util.Vector();\r\n\tvar vecCons:java.util.Vector = new java.util.Vector();\r\n\tfor (var i=0; i<vecInsSelected.size(); i++) {\r\n\t\tstrInsUnid = vecInsSelected.elementAt(i);\r\n\t\tdocIns = dbIns.getDocumentByUNID(strInsUnid);\r\n\t\tintSumaIns += docIns.getItemValueInteger(\"ins_iValor_nro\");\r\n\t\t\r\n\t\tvecCodes.add(docIns.getItemValueString(\"ins_Componente_cod\"));\r\n\t\tvecCons.add(docIns.getItemValueString(\"ins_Consecutivo_des\"));\r\n\t}\r\n\tdocFc.replaceItemValue(\"ImpSumaIns_FC\", intSumaIns)\r\n\tdocFc.replaceItemValue(\"InsCodes_FC\", vecCodes)\r\n\tdocFc.replaceItemValue(\"InsConsecutivos_FC\", vecCons)\r\n}", "function getItemData(objItem){\r\n\t\tvar data = {};\r\n\t\t\r\n\t\tdata[\"type\"] = objItem.data(\"type\");\r\n\t\tdata[\"file\"] = objItem.data(\"file\");\r\n\t\tdata[\"url\"] = objItem.data(\"url\");\r\n\t\tdata[\"full_url\"] = g_ucAdmin.urlToFull(data[\"url\"]);\r\n\t\tdata[\"filepath\"] = g_activePath+\"/\"+data[\"file\"];\r\n\t\t\r\n\t\treturn(data);\r\n\t}", "_processItems()\n\t{\n\t\tconst response = {\n\t\t\torigin: \"Form._processItems\",\n\t\t\tcontext: \"when processing the form items\",\n\t\t};\n\n\t\ttry\n\t\t{\n\t\t\tif (this._autoLog)\n\t\t\t{\n\t\t\t\t// note: we use the same log message as PsychoPy even though we called this method differently\n\t\t\t\tthis._psychoJS.experimentLogger.exp(\"Importing items...\");\n\t\t\t}\n\n\t\t\t// import the items:\n\t\t\tthis._importItems();\n\n\t\t\t// sanitize the items (check that keys are valid, fill in default values):\n\t\t\tthis._sanitizeItems();\n\n\t\t\t// randomise the items if need be:\n\t\t\tif (this._randomize)\n\t\t\t{\n\t\t\t\tutil.shuffle(this._items);\n\t\t\t}\n\t\t}\n\t\tcatch (error)\n\t\t{\n\t\t\t// throw { ...response, error };\n\t\t\tthrow Object.assign(response, { error });\n\t\t}\n\t}", "function InitUserMenu() {\n UserSettingCtrl.ePage.Masters.UserMenu = {};\n UserSettingCtrl.ePage.Masters.UserMenu.MenuTypeList = [\"List\", \"Grid\"];\n\n UserSettingCtrl.ePage.Masters.UserMenu.OnUserMenuChange = OnUserMenuChange;\n }", "async init () {\n await super.init(path.join(__dirname, 'domaindata', 'flysites.json'))\n }", "function onLoadNYTData(data) {\n // Increment page index for future calls.\n addItems(data);\n}", "function gatherFormData(){\n//the type of request the form submission is\nvar requestType = $(\".typeOfRequest.selected\").html();\n//the title of the sharepoint list item\nvar title = \"Windows Devices Group - Publishing Request (\"+requestType+\")\";\n//object containing the data to send to sharepoint\nvar itemData = {\n '__metadata': {'type': \"SP.Data.WDGIntakeFormListItem\"},\n 'RequestType1': requestType,\n 'Title': title,\n 'CurrentUser': currUser\n};\n//add all visible and valid input values to the object\n$(\"#intakeFormContainer .intakeFormSection:visible .formInput.valid\").each(function(){\n //ignore the attachements input and do not add it to the item object\n //due to how the api works, the attachemtns are sent to sharepoint AFTER the initial list item is created\n //because of this the attachemnts cannot be sent along with the rest of the data or sharepoint will throw an error\n if($(this).attr(\"data-property\")!== \"Attachments\"){\n //use the data-property attribute to set the correct property name in the itemData object\n //this property name cooresponds to which sharepoint list column the data should be added to\n //EX: data-property = Details means that input's data will be placed in the Details column on sharepoint\n itemData[$(this).attr(\"data-property\")] = $(this).val();\n }\n});\n\nreturn itemData;\n}", "data ()\n\t{\n\t\treturn {\n\t\t\tspUserTasksComplete : false,\n\t\t\tpreLoadUserDetails : false,\n\t\t}\n\t}", "function refreshSamurai() {\n\n if (typeof mov.vars.adminUrl === \"undefined\") { return; }\n\n _$cls('cmsItem').each(function () {\n initElement(this);\n });\n \n }", "function init() {\n utils.log('custom.init()');\n var data = common.getAdData();\n if (!data) return;\n\n // If you're using the swipe gallery to display feed items.\n //initItemsUsingGallery_();\n\n // If you're NOT using the swipe gallery to display feed items.\n //initItemsWithoutGallery_();\n\n\n }", "function _itemHandler() {\n\t _tracks = [];\n\t _tracksById = {};\n\t _unknownCount = 0;\n\t }", "function AuthAndAskForTaskLists() {\n loader.Load(true);\n}", "_initDeploy() {\n let UPLOAD_REST_URL = `${API.API_URL}/artifact/upload`;\n this.deploySingleUploader = this.artifactoryUploaderFactory.getUploaderInstance(this)\n .setUrl(UPLOAD_REST_URL)\n .setOnSuccessItem(this.onSuccessItem)\n .setOnAfterAddingAll(this.onAfterAddingAll)\n .setOnAfterAddingFile(this.onAfterAddingFile)\n .setOnErrorItem(this.onUploadError)\n .setOnCompleteAll(this.onCompleteAll);\n\n this._setPathAndFileType(this.node.data.path);\n\n // set data from currently open node\n }", "function loginUserData(data) {\n var flag = \"active\";\n sessionStorage.setItem(\"LoginJson\", flag);\n sessionStorage.setItem(\"FullName\", data.fname + \" \" + data.mname);//for fname\n sessionStorage.setItem(\"MiddleName\", data.mname);//for mname\n sessionStorage.setItem(\"LastName\", data.lname);//for lname\n sessionStorage.setItem(\"LoginId\", data.loginid);//for loginid\n sessionStorage.setItem(\"CurrentUserId\", data._id.$oid); //for Current User \n sessionStorage.setItem(\"OrgId\", data.orgid);\n// sessionStorage.setItem(\"Privileges\", privileges);\n sessionStorage.setItem(\"RoleNames\", data.roles);\n sessionStorage.setItem(\"UserType\", data.type);\n getOrgName();\n}", "addOnBeforeItemLoadCallback(fn) {\r\n this.onBeforeItemLoadCallbacks.push(fn);\r\n }", "function init() {\n var storeInitials = JSON.parse(localStorage.getItem('initialsList'));\n if (storeInitials !== null) {\n initialsList = storeInitials;\n }\n}", "function onInit(aPageId, aServerId){\r\n\t\r\n\tif(gXimfmailIdentity == null){\r\n\t\t// no account id (local folder)\r\n\t\t$(\"#checkListTheme\").attr(\"checked\", \"false\");\r\n\t\tUseXimfmail();\r\n\t\t$(\"#checkListTheme\").attr(\"disabled\", \"true\");\t\t\r\n\t\treturn;\t\t\r\n\t}\r\n\t$(\"#checkListTheme\").removeAttr(\"disabled\");\r\n\t\r\n\t//get XIMF instances of profile for account\r\n\tif(!gXimfCatalog) CreateXimfmailCatalog();\r\n\tvar listInstances = document.getElementById(\"listThemPopup\");\t\t\r\n\tlistInstances.database.AddDataSource(gXimfCatalog.getDSCatalog());\t\r\n\tlistInstances.builder.rebuild();\r\n\t\r\n\t//alert(\"Informations compte : \\r\\n\\n\" + aPageId + \"\\r\\n\"+ aServerId + \"\\r\\n\" + gXimfIdentity + \"\\r\\n\" + gXimfAccount.incomingServer.key);\r\n\tUpdateRDFListWithPref(gXimfmailIdentity.key,\"ximfmail_theme_ref\",\"listTheme\");\r\n\tonCommandTheme();\r\n\tUpdateRDFListWithPref(gXimfmailIdentity.key,\"ximfmail_instance_compose_ref\",\"instanceComposeList\");\r\n\tUpdateRDFListWithPref(gXimfmailIdentity.key,XIMF_PREF_IDENTITY_TREETHREAD_REF,\"instanceTreeThreadList\");\r\n\tUpdateRDFListWithPref(gXimfmailIdentity.key,XIMF_PREF_IDENTITY_MAIL_PANEL_REF,\"instanceMailPanelList\");\r\n\t\r\n\t// determine if user uses ximfmail\t\r\n\tif(gXimfmailIdentity.getBoolAttribute(XIMF_PREF_IDENTITY_USE_XIMFMAIL)){\r\n\t\t$(\"#checkListTheme\").attr(\"checked\", \"true\");\r\n\t}else{\r\n\t\t$(\"#checkListTheme\").attr(\"checked\", \"false\");\r\n\t}\r\n\t\r\n\t$(\"#listTheme\").bind('command', onCommandTheme);\r\n\t$(\"#checkListTheme\").click(UseXimfmail);\r\n\tUseXimfmail();\r\n\t\r\n\t// determine if user wants XSMTP compatibility\r\n\t$(\"#xsmtpComptibilityBox\").attr(\"checked\", gXimfmailIdentity.getBoolAttribute(\"ximfmail_xsmtp_compatibility_on\"));\r\n\t//$(\"#secureHeadersRuleBox\").attr(\"checked\", gXimfmailIdentity.getBoolAttribute(\"ximfmail_secure_header_on\"));\r\n\t//$(\"#signMsgAlwaysRuleBox\").attr(\"checked\", gXimfmailIdentity.getBoolAttribute(\"ximfmail_sign_message_always_on\"));\r\n\r\n}", "function load_menu(){\n //take-order page content loading\n int_get_menu_item_install({stallid:user_info[\"stall\"]},function(data){\n cache_menu=data.content;\n display_order_menu();\n //--load menu info page\n display_menu_info();\n });\n}", "function loadSavedEmp() {\t\n\tcopyContenidoIntegradoSaved();\n\tintegratedPaymentValidation = validateSavedPaymentEmpDesktop;\n}", "function populateUserData() {\r\n\tvar emailId = sessionStorage.getItem(\"jctEmail\");\r\n\tvar userProf = Spine.Model.sub();\r\n\tuserProf.configure(\"/admin/facilitatorAccount/populateExistingFacilitatorData\", \"facilitatorEmail\");\r\n\tuserProf.extend( Spine.Model.Ajax );\r\n\t//Populate the model with data to transfer\r\n\tvar modelPopulator = new userProf({ \r\n\t\tfacilitatorEmail: sessionStorage.getItem(\"jctEmail\")\r\n\t});\r\n\tmodelPopulator.save(); //POST\r\n\tuserProf.bind(\"ajaxError\", function(record, xhr, settings, error) {\r\n\t\talertify.alert(\"Unable to connect to the server.\");\r\n\t});\r\n\tuserProf.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\r\n\t\tvar jsonStr = JSON.stringify(xhr);\r\n\t\tvar obj = jQuery.parseJSON(jsonStr);\r\n\t\tvar statusCode = obj.statusCode;\r\n\t\tif(statusCode == 200) {\t\t\t\r\n\t\t\tshowUserData(obj.existingUserDataList);\r\n\t\t} else if(statusCode == 500) {\r\n\t\t\t//Show error message\r\n\t\t}\r\n\t});\r\n}", "processItems() {}", "function loadLocalSettings(items)\n\t{\n\t\tshowAvatars = items[\"avatars\"];\n\t\tif (showAvatars === false)\n\t\t\t$('.userpic-holder').hide();\n\t\tconsole.log(\"Loaded avatar settings from local storage: \" + showAvatars);\n\t\tupdateAvatarText();\n\n\t\tif (showAvatars === true)\n\t\t{\n\t\t\t$('.userpic-holder').show();\n\t\t}\n\n\t\tallowNWS = items[\"nws\"];\n\t\tallowNWS ? $('#nws-toggle').text(\"NWS On\") : $('#nws-toggle').text(\"NWS Off\");\n\t\tconsole.log(\"Loaded nws settings from local storage: \" + allowNWS);\n\n\t\tvar nwsColor = items['nwsColor'];\n\t\tconsole.log(\"Loaded NWS link color settings from local storage: \" + nwsColor);\n\n\t\tvar nwsChangeColor = items['nwsChangeColor'];\n\t\tif (nwsChangeColor === true)\n\t\t{\n\t\t\t$(\".fr:contains('NWS')\").closest(\"td\").children(\".fl\").children(\"a\").not(\".appended\").css('color', nwsColor);\n\t\t}\n\n\t\tvar rowColor = items['rowColor'];\n\t\tconsole.log(\"Loaded row color settings from local storage: \" + rowColor);\n\t\t\n\t\tvar rowChangeColor = items['rowChangeColor'];\n\t\tif (rowChangeColor === true)\n\t\t{\n\t\t\t$(\".grid tr td\").hover(\n\t\t\t\tfunction()\n\t\t\t\t{\n\t\t\t\t\t$(this).closest(\"tr\").children(\"td\").css(\"background-color\", rowColor);\n\t\t\t\t\t$(this).find(\".appended\").show();\n\t\t\t\t},\n\t\t\t\tfunction()\n\t\t\t\t{\n\t\t\t\t\t$(this).closest(\"tr\").children(\"td\").css(\"background-color\", \"\");\n\t\t\t\t\t$(this).find(\".appended\").hide();\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\t\n\t}", "function getAndProcessData() { \n\t\tchooseFileSource();\n\t}", "function init()\r\n\t\t\t{ \r\n\t\t\t\tget_data('get_dir','','directory');\r\n\t\t\t\tget_data('read_dir','current_dir','file_folder');\r\n\t\t\t}", "function fillMetaData() {\n var o = {};\n o.cid = activeCollectionId();\n o.path = collectionPath(o.cid);\n o.dia = getLastMarkedEntry(o.cid);\n\n if (! o.dia) {\n statusError('no marked image/collection found');\n return ;\n }\n o.pos = getEntryPos(o.dia);\n o.name = getDiaName(o.dia);\n fillMetaFromServer(o);\n\n}", "initDataListVariables(entity_name) {\n\t\tthis.entity_name = entity_name;\n\t\tthis.lowercase_entity_name = entity_name.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();\n\t\tthis.included_all_object = {...this.included_attributes_object,...this.included_relationships_object};\n\t\tlet included_keys = Object.keys(this.included_all_object);\n\t\tthis.current_sort_column = [included_keys[0],true]; // Sort on first column, desc\n\t}", "function LoadXmlDatas(){\r\n\ttry{\t\t\t\r\n\t\t//\r\n\t\tvar tree = document.getElementById(\"iTreechildDialog\");\r\n\t\t\r\n\t\tgRDFList = new DialogTreeRDFClass();\r\n gRDFList.initialize(gArgsOpener.dataSource, gArgsOpener.refdataSource);\r\n\t\t\r\n\t\ttree.database.AddDataSource(gRDFList.getDataSource());\t\t\r\n\t\t//tree.setAttribute(\"ref\",gArgsOpener.refdataSource);\t\r\n\t\ttree.builder.rebuild();\r\n\t\t\r\n\t\tOnClickScrollTreeList(0);\r\n\t\t\r\n\t\t//\r\n\t\tAddCurrentSelection();\r\n\t}catch(e){\t\r\n\t\tgConsole.logStringMessage(\"[ximfmail - LoadXmlDatas ] \\n \" + e + \"\\nfile : \" + Error().fileName+\"\\nline : \"+Error().lineNumber);\r\n\t}\t\r\n}", "function o(o){return {origin:\"portal-item\",url:U(o.itemUrl),portal:o.portal||w.getDefault(),portalItem:o,readResourcePaths:[]}}", "function o(o){return {origin:\"portal-item\",url:U(o.itemUrl),portal:o.portal||w.getDefault(),portalItem:o,readResourcePaths:[]}}", "function qodefOnDocumentReady() {\n\t\tqodefInitItemShowcase();\n\t}", "function initializeItemSerializer(hasItems) {\n // Is there is a itemSerializer specified, we MUST use it.\n // If existing data and no itemSerializer specified, this is an old JSON database,\n // so \"fake\" the compatible JSON serializer\n var providerInfo = storageProvider.getMetadata(namespace); // TODO I hate this!\n var itemSerializerName = providerInfo ? providerInfo.itemSerializer :\n hasItems ? \"JSONSerializer\" : null;\n storageProvider.itemSerializer = itemSerializerName;\n }", "static setFirstLoginJsonData(firstloginData)\n {\n appSettingsData.firstsonData = firstloginData; \n //alert(firstloginData);\n }", "function generate_user_store_data(item_list) {\r\n\tvar data = {};\r\n\tvar items = [];\r\n\tfor (var i = 0; i < itemList.length; i++) {\r\n\t\tvar item = {};\r\n\t\titem[\"id\"] = itemList[i].id;\r\n\t\titem[\"first_name\"] = itemList[i].first_name;\r\n\t\titem[\"last_name\"] = itemList[i].last_name;\r\n\t\titems.push(item);\r\n\t}\r\n\tdata[\"identifier\"] = \"id\";\r\n\tdata[\"label\"] = \"name\";\r\n\tdata[\"items\"] = items;\r\n\treturn data; \r\n}", "function ProviderData() { }", "function ProviderData() { }", "init() {\n\t\tthis.replaceData(\n\t\t\tthis.manager.get(\"hostReq\"),\n\t\t\tthis.endpoints.check,\n\t\t\tthis.data.check\n\t\t);\n\t}", "function updateFieldDefs($is, $el, data, attrs, listCtrl) {\n var unbindWatcher, _s, fieldDefs;\n\n _s = $is.$liScope;\n fieldDefs = _s.fieldDefs;\n\n if ($is.infScroll || $is.onDemandLoad) {\n if (WM.isUndefined(fieldDefs)) {\n _s.fieldDefs = fieldDefs = [];\n }\n\n if ($is.dataNavigator.isFirstPage()) {\n _s.fieldDefs.length = 0;\n }\n\n _.forEach(data, function (item) {\n fieldDefs.push(item);\n });\n\n $rs.$evalAsync(function () {\n setFetchInProgress($is, false);\n //Functionality of On-Demand and Scroll will be same except we don't attach scroll events\n if (fieldDefs.length && !$is.onDemandLoad) {\n $timeout(function () {\n bindScrollEvt($is, $el);\n }, 100);\n }\n });\n } else {\n _s.fieldDefs = data;\n }\n\n if ($is.orderby) {\n _s.fieldDefs = FormWidgetUtils.getOrderedDataSet(_s.fieldDefs, $is.orderby);\n }\n\n if ($is.groupby) {\n addListElements(_s, $el, $is, attrs, listCtrl);\n if ($is.collapsible) {\n // on groupby header click, collapse or expand the list-items.\n $el.find('li.app-list-item-header').on('click', function (e) {\n var selectedGroup = WM.element(e.target).closest('.list-group'),\n selectedAppIcon = selectedGroup.find('li.app-list-item-header').find('.app-icon');\n\n if (selectedAppIcon.hasClass('wi-chevron-down')) {\n selectedAppIcon.removeClass('wi-chevron-down').addClass('wi-chevron-up');\n } else {\n selectedAppIcon.removeClass('wi-chevron-up').addClass('wi-chevron-down');\n }\n\n selectedGroup.find('.app-list-item').toggle();\n });\n }\n }\n\n if (!_s.fieldDefs.length) {\n $is.noDataFound = true;\n $is.selecteditem = undefined;\n }\n // deselect all the selected items on data change.\n $el.find('li.app-list-item.active').removeClass('active');\n\n // In run mode, making the first element selected, if flag is set\n // and prevent first item being selected in next page\n if ($is.selectfirstitem && !(_.get($is.dataNavigator, 'dn.currentPage') !== 1 && $is.multiselect)) {\n unbindWatcher = $is.$watch(function () {\n var items = $el.find('.list-group li.app-list-item:first');\n if (items.length) {\n $rs.$safeApply($is, function () {\n $timeout(function () {\n var item = items.first();\n // If item has active class already, no need to click again\n if (!item.hasClass('active')) {\n item.click();\n }\n }, 0, false);\n unbindWatcher();\n });\n }\n });\n }\n $timeout(function () {\n //Set the list item class to active, If list item is present in selected items\n _.forEach($is._items, function (item) {\n var listItems = $el.find('.list-group li.app-list-item'),\n itemIndex = getItemIndex(listItems, item),\n $li = WM.element(listItems[itemIndex]);\n if (!_.isEqual(itemIndex, -1)) {\n $li.addClass('active');\n }\n });\n });\n }", "tryLoadAuthData() {\n const userType = this.getUserTypeByName(this.localStorage.getItem('userType'));\n if (userType) {\n this.userType.next(userType);\n }\n this.getAuthDataFromStorage();\n if (this.activatedRoute) {\n this.getAuthDataFromParams();\n }\n // if (this.authData) {\n // this.validateToken();\n // }\n }", "_getFreshItem() {\n\t\treturn {\n\t\t\tdescription: \"\",\n\t\t\tamount: \"\"\n\t\t};\n\t}", "function eltdfOnWindowLoad() {\n eltdfDropDownMenu();\n eltdfSetDropDownMenuPosition();\n eltdfInitDividedHeaderMenu();\n }", "function init() \n{\n RMPApplication.debug(\"begin init : login = \" + login);\n $(\"#id_spinner_search_top\").hide();\n $(\"#id_spinner_search_bottom\").hide();\n\n load_language(RMPApplication.get(\"language\")); // load WI language options\n\n var option = {};\n var pattern = {};\n pattern.login = RMPApplication.get(\"login\");\n c_debug(dbug.init, \"=> init: pattern = \", pattern);\n\n id_get_user_info_as_admin_api.trigger(pattern, option , get_info_ok, get_info_ko);\n RMPApplication.debug(\"end init\");\n}", "function init() {\n debugger;\n $scope.GetUserInformation = SessionManagement.Get(\"UserInfo\");\n userInformation = SessionManagement.Get(\"UserInfo\");\n if ($scope.GetUserInformation == null || $scope.GetUserInformation.Role < 2)\n CommonMethod.LogOut();\n SessionManagement.Set(\"EntryManagementUserId\", 0);\n }", "function init( pageId ) {\n // Get the inventory, product and stock area data from the DB\n debug && console.log( \"VanInventoryAdd.init: Getting inventory and product info from the DB\" );\n UIFrame.postPageSpecificInit( pageId );\n }", "function initializeStudentInfo() {\n\tgetCurrentUser();\n\t// ID of tag to locate in the users xml file\n\tvar s_info = [\"GPA\",\"FirstName\", \"LastName\", \"ID\", \"completed\", \"inprogress\"];\n\t// ID of the element on the home.html page\n\tvar docID = [\"doc_GPA\",\"doc_User\", \"doc_completed\", \"doc_inprogress\", \"doc_UName\"];\n\n\tupdateStudentInfo(s_info[0], docID[0]);\t//GPA\n\tupdateStudentInfo(s_info[3], docID[1]);\t//Username (ID)\n\tupdateStudentInfo(s_info[4], docID[2]);\t//completed coursed\n\tupdateStudentInfo(s_info[5], docID[3]);\t//courses in progress\n\tupdateStudentInfo(s_info[1], docID[4]);\t//User name\n}", "function init() {\n getContentTypes();\n getProperties();\n }", "function Drop3_Common_DMS_Document_List(DynamicserviceURL,readRequestURL,ListId,MobId,iconType){\n\n\t//Empty List\n\tvar docArrayListEmpty = {\n };\n\t \n\t var oModelEmpty = new sap.ui.model.json.JSONModel();\n\t oModelEmpty.setData(docArrayListEmpty);\n sap.ui.getCore().byId(ListId).setModel(oModelEmpty);\n\n \nopenSplashScreen();\n\n{ \n\t{\n\t\tvar logInfo = getTimeStamp() +MobId+\":: Service: ContextSet Start\" ; \nvar serviceURL = getUrl(DynamicserviceURL);\nif(serviceURL == \"Fail\")\n{\nreturn false;\n}\n var downloadModel = new sap.ui.model.odata.ODataModel(serviceURL);\n //var readRequestURL = \"/AssetSet?$filter=Equnr eq '\"+800001+\"'&$expand=NavDocs\";\n downloadModel.read(readRequestURL, null, null, false, \n function(oData, oResponse) { \n\t if( oData.results.length >= 1)\n {\n var result = oData.results[0].NavDocs; //Getting JSON response body\n var docArrayResults = result.results;\n if( docArrayResults != \"\"){\n \t var DocArray = [];\n \t for ( var i = 0 ; i< docArrayResults.length ; i++ ){\n \t \t\n \t var sortDoc = {\n \t \t\t \"Documenttype\" : docArrayResults[i].Documenttype,\n \t \t\t \"Documentnumber\" :docArrayResults[i].Documentnumber,\n \t \t\t \"Documentpart\":docArrayResults[i].Documentpart,\n \t \t\t \"Documentversion\":docArrayResults[i].Documentversion,\n \t \t\t \"Originaltype\": docArrayResults[i].Originaltype,\n \t \t\t \"Wsapplication\":docArrayResults[i].Wsapplication,\n \t \t\t \"Description\":docArrayResults[i].Description,\n \t \t\t \"ContentDescription\":docArrayResults[i].ContentDescription,\n \t \t\t \"Objectkey\":docArrayResults[i].Objectkey,\n \t \t\t \"DocDescription\" :docArrayResults[i].DocDescription\n \t \t\t \t\t };\n \t \t\t DocArray.push(sortDoc); \n \t var docArrayList = {\n \t \t\t \"results\" : DocArray\n \t \t };\n \t \t var oModel = new sap.ui.model.json.JSONModel();\n \t oModel.setData(docArrayList);\n \t sap.ui.getCore().byId(ListId).setModel(oModel);\n \t\t \n \t }\n \t \n }\n \n else{\n\t\t var docArrayList = {\n };\n\t\t var oModel = new sap.ui.model.json.JSONModel();\n oModel.setData(docArrayList);\n sap.ui.getCore().byId(ListId).setModel(oModel);\n\t }\n }\n\t else{\n\t\t var docArrayList = {\n };\n\t\t var oModel = new sap.ui.model.json.JSONModel();\n oModel.setData(docArrayList);\n sap.ui.getCore().byId(ListId).setModel(oModel);\n\t }\n\t closeSplashScreen(); \t\n\t if( g_isDebug == true)\n\t {\n\t var logInfo1 = getTimeStamp() +MobId+\":: Service: ContextSet Finish\" ; \n var g_ServiceStartEndTime = logInfo + \"\\n\" + logInfo1;\n\t logFileUpdate(g_ServiceStartEndTime);\n\t }\n\t \n }, function(oError){\n\t\t\t closeSplashScreen();\n\t\t\t\terrorRes = true;\n\t\t\t\ttry{\n\t\t\t\t\tvar data = JSON.parse(oError.response.body);\n\t\t\t\t\tfor(var event in data){\n\t\t\t\t\tvar dataCopy = data[event];\t\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\tvar messageFromBackend = dataCopy.innererror.errordetails[0].message;\n\t\t\t\t\t\tsap.m.MessageBox.show(\n\t\t\t\t\t\tmessageFromBackend+ \" \" +\" \"+\" \",sap.m.MessageBox.Icon.ERROR,\"Error\");}\ncatch(e)\n{sap.m.MessageBox.show(e.message+ \" \" +\" \"+\" \",\nsap.m.MessageBox.Icon.ERROR,\"Error\");break;\n}}}catch(e){sap.m.MessageBox.show(\n\"Service Not Available - Please contact system administrator\" + \" \" +\" \"+\" \",\nsap.m.MessageBox.Icon.ERROR,\"Error\");\nif( g_isDebug == true)\n {\n var logInfo1 = getTimeStamp() +MobId+\":: Service: ContextSet Failed no network\" ; \n var g_ServiceStartEndTime = logInfo + \"\\n\" + logInfo1;\n\t logFileUpdate(g_ServiceStartEndTime);\n\t }}\n });}}\n\n}", "connectedCallback() {\n checkSharePointFolderId({currentPageId: this.recordId, objectApiName: this.objectApiName})\n .then(result=>{\n this.showSetup = result[0].folderSetup;\n this.sharePointFolderId = result[0].sharePointFolderId;\n this.ASC_logo = (result[0].customLogo != null) ? result[0].customLogo : ASCLogo;\n }).catch(error => {\n console.log('-------------------ERROR-------------'+error);\n });\n\n this.initData();\n\n }" ]
[ "0.5748463", "0.55164236", "0.53796166", "0.5344184", "0.5259042", "0.5256958", "0.5169989", "0.51638", "0.5134933", "0.51117456", "0.5097181", "0.5095454", "0.50896466", "0.50818", "0.5047476", "0.5036078", "0.50360745", "0.5025489", "0.498207", "0.49803063", "0.49770433", "0.4971645", "0.49714807", "0.49700066", "0.49574387", "0.4937806", "0.49352667", "0.4932635", "0.49323586", "0.4927386", "0.49252877", "0.4918516", "0.49177888", "0.49114174", "0.49070662", "0.4885042", "0.488295", "0.48823044", "0.48758203", "0.48692533", "0.48691022", "0.4864048", "0.48598954", "0.48593247", "0.48592466", "0.48507887", "0.48446035", "0.48360264", "0.48350713", "0.48249123", "0.48110747", "0.48103523", "0.48045087", "0.4799021", "0.47980863", "0.47945014", "0.4791131", "0.47889912", "0.47843343", "0.47793734", "0.4774644", "0.47741035", "0.4773149", "0.47701624", "0.47673523", "0.47632623", "0.47622216", "0.47596037", "0.47541663", "0.4752853", "0.47377795", "0.47351676", "0.47294286", "0.4729033", "0.47282025", "0.47211197", "0.47152087", "0.47140178", "0.47123718", "0.4711256", "0.47096884", "0.470829", "0.470829", "0.4707252", "0.4704171", "0.47018507", "0.47015354", "0.47009018", "0.47009018", "0.46945632", "0.4692005", "0.4688373", "0.46823463", "0.46810088", "0.46775487", "0.46758622", "0.46741104", "0.46726376", "0.46690685", "0.46654585", "0.46615252" ]
0.0
-1
onRealtimeChange Sweeps through all the blinking cells checking whether any cell should stop blinking (i.e. if the elapsed time since the status changed exceeds the configured threshold).
function blinkChecker() { const blinkers = mt.querySelectorAll('.blink'); for (let i = 0; i < blinkers.length; i++) { const cell = blinkers[i]; const sample = data.getParentGroupForAbsolutePath(cell.id) .samples[cell.id.toLowerCase()]; if (sample && SampleUtils.statusChangedRecently(sample, conf.blinkIfNewStatusThresholdMillis)) { cell.className = cell.className.replace(/blink blink-\w+/, ''); } } } // blinkChecker
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeStatus() {\n for (let i = 0; i <= 5; i++) {\n delay(i, timerValues.currentSecond);\n }\n // if (didMountRef.current) {\n // } else didMountRef.current = true;\n }", "_processDelayedTriggers() {\n if (this.isDestroyed) return;\n let hasChange = false;\n this._delayedTriggers = this._delayedTriggers.filter((evt) => {\n if (evt[0] === 'message-type-model:change' && !hasChange) {\n hasChange = true;\n return true;\n } else if (evt[0] === 'message-type-model:change') {\n return false;\n } else {\n return true;\n }\n });\n super._processDelayedTriggers();\n }", "changedFlag() {\n //signal whiteboard has been updated\n this.recentchange = true;\n try {\n clearTimeout(this.deletetimer);\n } catch {\n //if timer is not set, do nothing\n }\n }", "function blink(cell) {\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 650);\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 1150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 1650);\n}", "function blink(cell) {\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 650);\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 1150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 1650);\n}", "updateCellsFuture() {\n let allDeath = true;\n for(let row = 0; row < this.rowSize; row++) {\n for(let cell = 0; cell < this.colSize; cell++) {\n this.grid[row][cell].alive = this.grid[row][cell].willLive; \n if ( this.grid[row][cell].alive ) {\n allDeath = false;\n }\n }\n }\n /* If all cells are Death, Stop de game and enable flag to show an Alert on Screen*/\n if (allDeath) {\n this.stopGame();\n this.gameOver = true;\n }\n }", "methodTriggeredFromServer(rdvTime){\n // get rel time (sec) in which I must blink\n let timeRemaining = rdvTime - this.e.sync.getSyncTime();\n console.log('will blink in', timeRemaining, 'seconds');\n setTimeout( () => { this.e.renderer.blink([0, 160, 200], 0.4); }, timeRemaining * 1000 );\n }", "function handleBlinkingStateChanged (event) {\n // read variables from the event\n let ev = JSON.parse(event.data);\n let evData = ev.data; // the data from the argon event: \"started blinking\" or \"stopped blinking\"\n let evDeviceId = ev.coreid; // the device id\n let evTimestamp = Date.parse(ev.published_at); // the timestamp of the event\n\n // the data we want to send to the clients\n let data = {\n message: evData, // just forward \"started blinking\" or \"stopped blinking\"\n }\n\n // send data to all connected clients\n sendData(\"blinkingStateChanged\", data, evDeviceId, evTimestamp );\n}", "function periodicCheck(){\n var targetSpreadSheet = SpreadsheetApp.openByUrl(spreadsheetUrl);\n setupSummarySheet();\n var summarySheet = targetSpreadSheet.getSheetByName(\"Summary\");\n for (var i=1; i <= summarySheet.getLastRow(); i++) {\n var rowContents = summarySheet.getSheetValues(i, 1, 1, 5)[0];\n var msTimestamp = Date.parse(rowContents[1]);\n var currentTime = new Date().getTime();\n var maxTimeBetweenReadings = maxHoursBetweenReadings * 60 * 60 * 1000; // x hours * 60 min/hr * 60s/min * 1000 ms/s\n if (msTimestamp + maxTimeBetweenReadings < currentTime) {\n MailApp.sendEmail(recipients, \"[TDT ALERT]: Missed latest temperature check in from \" + rowContents[0], rowContents[0] + \" last checked in at \" + rowContents[1]);\n var target = \"B\" + i;\n var range = summarySheet.getRange(target + \":\" + target);\n range.setBackground(\"red\");\n }\n }\n}", "function blink() {\n characteristic.read(changeState);\n }", "function startMonitoringHwChanges(changeDetected) {\n\tconsole.log('startMonitoringHwChanges');\n var interval = setInterval(function() {\n // console.log('rechecking device list');\n var hwDevices = blinkstick.findAll();\n var somethingHasChanged = false;\n if(hwDevices.length !== deviceIdsFromHW.length) {\n console.log('Number of devices connected has changed. Was ' + deviceIdsFromHW.length + ', now ' + hwDevices.length);\n console.log('Number of devices connected has changed, stop monitor and reinit');\n clearInterval(interval);\n somethingHasChanged = true;\n changeDetected();\n } else {\n for(var i=0; i<hwDevices.length; i++) {\n var hwDevice = hwDevices[i];\n var checkIfSerialIsStillTheSame = function(idx) {\n hwDevice.getSerial(function(err, data) {\n \tif(somethingHasChanged) {\n \t\tconsole.log(\"Monitor was about to check the HW id, but some change is already identified, so not doing it\");\n \t\treturn;\n \t}\n // console.log('comparing ', data, ' and ', deviceIdsFromHW[idx]);\n if(data !== deviceIdsFromHW[idx]) {\n console.log('deviceId changed, reporting and stopping the monitoring');\n clearInterval(interval);\n somethingHasChanged = true;\n changeDetected();\n }\n })\n }(i);\n }\n }\n\n }, 1000);\n}", "function tick(cellArray) {\r\n var changed = []\r\n for (var row = 0; row < cellArray.length; row++) {\r\n for (var col = 0; col < cellArray[row].length; col++) {\r\n var curCell = cellArray[row][col]\r\n\r\n let cnx, cny\r\n let activeCount = 0\r\n let activeNeighbors = []\r\n for (var i = curCell.neighbors.length - 1; i >= 0; i--) {\r\n cnx = curCell.neighbors[i]\r\n cny = cnx[1]\r\n cnx = cnx[0]\r\n if (cellArray[cnx][cny].live) {\r\n activeCount++;\r\n activeNeighbors.push(cellArray[cnx][cny])\r\n }\r\n }\r\n // var activeNeighbors = curCell.neighbors\r\n // .map((n) => cellArray[n[0]][n[1]])\r\n // .filter((cell) => {\r\n // return cell.live\r\n // })\r\n // var activeCount = activeNeighbors.length\r\n //console.log(activeCount )\r\n if (curCell.live) {\r\n if (activeCount < 2 || activeCount > 3) {\r\n changed.push(Object.assign({}, curCell, {live: 0}))\r\n }\r\n } else if (activeCount === 3) {\r\n let color = averageColor(activeNeighbors)\r\n changed.push(Object.assign({}, curCell, \r\n {\r\n live: 1, \r\n color: color, \r\n colorString: colString(color)\r\n }))\r\n }\r\n }\r\n }\r\n changed.forEach(c => cellArray[c.pos.x][c.pos.y] = c)\r\n //changed.forEach(changeCell)\r\n return cellArray\r\n}", "function checkAllBlurred() {\n //console.log(\"checkAllBlurred\");\n let allblurred = true\n for (let id in HUD){\n if (HUD[id].focus === true ) { allblurred = false }\n }\n if (allblurred === true && realtime === true ) {\n stopRealTimeData()\n }\n}", "function blink_controller(){\n for (var i=0; i < game_items.length; i++) {\n game_items[i].update_blink();\n }\n setTimeout(blink_controller, interval * 35);\n}", "function waitForChangeEvents() {\n clock.tick(Field.DELAYED_CHANGE_FREQUENCY + Field.CHANGE_FREQUENCY);\n}", "function renderScoreBlinkLogic () {\n scoreBlinkDelta++;\n \n if (scoreBlinkDelta >= SI.res.ResourceLoader.getResources().game.properties.HUDScoreBlinkMaxDelta) {\n scoreBlinkDelta = 0;\n scoreColor = (scoreColor == SI.res.ResourceLoader.getResources().game.properties.HUDScoreColor) ? SI.res.ResourceLoader.getResources().game.properties.HUDScoreBlinkColor : SI.res.ResourceLoader.getResources().game.properties.HUDScoreColor ;\n }\n }", "applyChanges() {\n for (let i = 0; i < this.statusList.length; i++) {\n this.board.updateCell(...this.statusList[i]);\n }\n\n this.statusList = [];\n }", "function notifyChange() {\r\n if (notify_count == change_count) MainLoop();\r\n if (notify_count != change_count) {\r\n schedNotify();\r\n return;\r\n }\r\n scheduled = false;\r\n}", "function notifyChange() {\r\n if (notify_count == change_count) MainLoop();\r\n if (notify_count != change_count) {\r\n schedNotify();\r\n return;\r\n }\r\n scheduled = false;\r\n}", "checkShouldChangeColor() {\r\n const greenNeighbors = this.neighbors.filter(neighbor => neighbor.color == '1').length;\r\n // console.log(`has [${redNeighbors}] red neighbors and [${greenNeighbors}] green neighbors.`);\r\n\r\n\r\n if (this.color == 0 && [3, 6].includes(greenNeighbors)) {\r\n // console.log(`Cell color is RED AND HAS ${greenNeighbors} GREEN neighbors and should change color to GREEN`);\r\n this.shouldChangeColor = true;\r\n }\r\n\r\n if (this.color == 1 && [0, 1, 4, 5, 7, 8].includes(greenNeighbors)) {\r\n // console.log(`Cell color is GREEN AND HAS ${redNeighbors} RED neighbors and should change color to RED`);\r\n this.shouldChangeColor = true;\r\n }\r\n }", "function handleBlink() {\n if (solutionSequence[roundBlinkCount] === 1) {\n handleButtonBlink(1);\n } else if (solutionSequence[roundBlinkCount] === 2) {\n handleButtonBlink(2);\n } else if (solutionSequence[roundBlinkCount] === 3) {\n handleButtonBlink(3);\n } else {\n handleButtonBlink(4);\n }\n}", "function blink() {\n var blinkLeds;\n if (tessel) {\n tessel.led[1].on();\n tessel.led[2].on();\n tessel.led[3].on();\n blinkLeds = setInterval(function() {\n tessel.led[1].toggle();\n tessel.led[2].toggle();\n tessel.led[3].toggle();\n }, 100);\n setTimeout(function() {\n clearInterval(blinkLeds);\n tessel.led[1].off();\n tessel.led[2].off();\n tessel.led[3].off();\n }, 2500)\n }\n}", "function timeTrigger(event) {\n\ttry {\n\t\tvar dateNow = new Date(\n\t\t\tevent.year,\n\t\t\tevent.month - 1,\n\t\t\tevent['day-of-month'],\n\t\t\tevent.hour + 1,\n\t\t\tevent.minute,\n\t\t\tevent.second\n\t\t);\n\t\tvar spreadsheet = SpreadsheetApp.getActiveSpreadsheet();\n\t\tvar prop = PropertiesService.getDocumentProperties();\n\t\ttimeout = new Number(prop.getProperty(prop_pre + 'timeout'));\n\t\tactiveColor = prop.getProperty(prop_pre + 'activeColor');\n\t\tinactiveColor = prop.getProperty(prop_pre + 'inactiveColor');\n\t\tvar namedranges = spreadsheet.getNamedRanges();\n\t\tfor (namedrange of namedranges) {\n\t\t\tvar cell = namedrange.getRange();\n\t\t\tvar color = cell.getBackground();\n\t\t\tif (color == activeColor) {\n\t\t\t\tvar cellNote = cell.getNote();\n\t\t\t\tvar endDate = new Date(cellNote);\n\t\t\t\tendDate.setSeconds(endDate.getSeconds() + timeout);\n\t\t\t\tif (dateNow > endDate) {\n\t\t\t\t\tcell.setBackground(inactiveColor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\tLogger.log(error);\n\t}\n}", "function ColorUpdate(){\n let mccafe=moment().hour();\n for (let i = 0; i < ts.length; i++) {\n if (ts[i]==mccafe){\n $(\"#TS\"+ ts[i]).addClass(\"present\");\n }\n else if( ts[i]>mccafe){\n $(\"#TS\"+ ts[i]).addClass(\"future\");\n }\n else {\n $(\"#TS\"+ ts[i]).addClass(\"past\");\n }\n }\n}", "evaluateCell(){// change state of change but don't render anything\r\n\t\tlet liveNeighbors = 0;\r\n\t\tfor(let i=0;i<this.state.neighbors.length;i++){\r\n\t\t\t//get cell and obtain its state\r\n\t\t\tlet r = this.state.neighbors[i][0];\r\n\t\t\tlet c = this.state.neighbors[i][1];\r\n\t\t\t\r\n\t\t\tif(getCell(r,c).state.isAlive){\r\n\t\t\t\tliveNeighbors+=1;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tlet lifeStatus = this.state.isAlive;\r\n\r\n\t\tif(liveNeighbors < 2 || liveNeighbors > 3){\r\n\t\t\tlifeStatus = false;\r\n\t\t}else if(liveNeighbors == 3){\r\n\t\t\tlifeStatus = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(lifeStatus != this.state.isAlive){\r\n\t\t\tthis.state.change = true;\r\n\t\t}else{\r\n\t\t\tthis.state.change = false;\r\n\t\t}\r\n\t\treturn lifeStatus;\r\n\t}", "function refreshInactiveVehicles() {\n\n\t\tvar isCurInspectedVehAlive = true;\n\t\tvar allInactiveVehicles = [];\n\t\tvar curInspectV = sharedService.timelinevis().inspectedVehicle();\n\t\td3.select('.map').select('.vehicles').selectAll('.dead').each(function(d) {\n\t\t\tif(curInspectV && d.id == curInspectV.id) isCurInspectedVehAlive = false;\n\t\t\tallInactiveVehicles.push(d);\n\t\n\t\t})\n\n\t\tif(!allInactiveVehicles.length) {\n\t\t\tif(isCurInspectedVehAlive) sharedService.timelinevis().inspectedVehicle(null);\n\t\t\td3.select('#delaySdColorScale').style('display', 'none');\n\t\t\treturn;\n\t\t} else {\n\t\t\td3.select('#delaySdColorScale').style('display', 'block');\n\t\t}\n\t\tif(isCurInspectedVehAlive) sharedService.timelinevis().inspectedVehicle(null);\n\n\t\t// update delayDeviationColorScale domain\n\t\t// we may need to have a better classification for the GPS report delay \n\t\tvar devs = allInactiveVehicles.map(function(d) { return d3.deviation(d.history.map(function(h) { return h.reportDelay; }))});\n\t\tvar minSDev = d3.min(devs),\n\t\t\tmaxSDev = d3.max(devs),\n\t\t\tsdSDev = d3.deviation(devs),\n\t\t\t// not sure if the report delay follows normal distibution\t\n\t\t\t// if so, mean + 1 sd will capture 68% points, and use the number as the center value of scale domain;\n\t\t\t// if not, use typical mean instead\t\n\t\t\tmiddleDomain = (minSDev + maxSDev ) / 2 + 1 * sdSDev > maxSDev ? (minSDev + maxSDev ) / 2 : (minSDev + maxSDev ) / 2 + 1 * sdSDev;\n\n\t\tsharedService.delayDeviationColorScale.domain([minSDev, middleDomain, maxSDev]);\n\t\tvar delaySdColorRectWidth = +d3.select('#delaySdColorScale svg').attr('width');\n\t\tvar delayColorScale = d3.scale.linear().range([0, delaySdColorRectWidth]).domain(sharedService.delayDeviationColorScale.domain());\n\t\tvar delayColorXaxis = d3.svg.axis().scale(delayColorScale).orient(\"bottom\");\n\t\td3.select('#delaySdColorScale .axis').call(delayColorXaxis);\n\t\n\n\t\t\n\t\tallInactiveVehicles.sort(function(a, b) { \n\t\t\tif(a.tag < b.tag) return -1; \n\t\t\tif(a.tag > b.tag) return 1; \n\t\t\treturn 0;\n\t\t});\t\t\n\n\t\t\n\t\tvar inactiveList = d3.select('.inspectUl ul').selectAll('.vehicle')\n\t\t\t.data(allInactiveVehicles, function(d) { return d.tag + '_' + d.id; })\n\n\t\tvar removed = inactiveList.exit().remove();\t\t\n\n\t\tvar lis = inactiveList.enter().append('li')\n\t\t\t.attr('class', 'vehicle')\t\t\t\n\t\t\t.on('click', function(d) {\n\t\t\t\tsharedService.treevis().toggleLeaf(d.tag);\n\t\t\t\tsharedService.treevis().highlightLeaf(d.tag);\n\t\t\t\tsharedService.timelinevis().inspectedVehicle(d);\n\t\t\t\t$scope.centerZoomCtrl(d.lonLat); \n\t\t\t\td3.selectAll('.inspectUl li').classed('ui-selected', false);\n\t\t\t\td3.select(this).classed('ui-selected', true); \t\t\n\n\t\t\t})\n\n\t\tinactiveList.order();\n\n\t\tlis.append('span')\n\t\t\t.attr('class', 'symbol')\n\t\t\t.style('background', function(d) { return d.color; })\n\t\t\t.html(function(d) { return d.tag; });\n\n\t\tlis.append('span')\n\t\t\t.attr('class', 'label')\n\t\t\t.style('background', function(d) { return sharedService.delayDeviationColorScale(d3.deviation(d.history.map(function(h) { return h.reportDelay; })))})\n\t\t\t.html(function(d) { return 'ID:' + d.id; });\n\t}", "function pollStatus() {\n\t\t_gamepad = navigator.getGamepads()[0];\n\n\t\tif(_gamepad){\n\t\t\t// If current timestamp == previous one, then the state of the gamepad hasn't changed and there is no need to update.\n\t\t\tif (prevTimestamp && (_gamepad.timestamp === prevTimestamp)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tprevTimestamp = _gamepad.timestamp;\n\n\t\t\tvar event = new CustomEvent('gamepad:update', { 'detail': _gamepad });\n\t\t\twindow.dispatchEvent(event); // emit that gamepad state has changed\n\t\t}\n\t}", "function monitorTemperature() {\n var prev = 0;\n \n setInterval(function() {\n var currentTemp = board.getTemperature();\n var currentLight = board.getLight();\n board.message(\"Temperature: \" + currentTemp);\n board.message(\"Light Level: \" + currentLight, 1);\n\n // check if fire alarm should be triggered\n if (prev < config.ALARM_THRESHOLD && currentTemp >= config.ALARM_THRESHOLD) {\n events.emit(\"start-alarm\");\n }\n\n if (prev >= config.ALARM_THRESHOLD && currentTemp < config.ALARM_THRESHOLD) {\n events.emit(\"stop-alarm\");\n }\n\n prev = currentTemp;\n \n //AUTOMATION LOGIC\n /**\n\n //TOO COLD\n if ( flueTemp < 150 ){\n fireStatus = low;\n\n //// Fire is just starting\n if( flameSensor == true ){\n notify(\"Keep an eye on it.\");\n damper.position = 100;\n }\n\n //fire is dying\n if( flameSensor == false ){\n alarm();\n notify(\"Low fire. Creosote danger. Add wood.\");\n damper.position = 0;\n\n }\n }\n\n // JUST RIGHT\n if ( flueTemp > 150 && flueTemp <= 400){\n fireStatus = good;\n alarm();\n notify(\"Nice fire.\")\n damper.position = 50;\n }\n\n //TOO HOT\n if ( flueTemp > 400 && flueTemp <= 600){\n fireStatus = hot;\n if( flameSensor == true ){\n alarm();\n notify(\"The fire is too hot. Adjusting damper.\"\n) damper.position = 20;\n }\n if( flameSensor == false ){\n alarm();\n notify(\"Your fire is out but your chimney is on fire.\"\n) damper.position = 0;\n }\n }\n\n **/\n \n \n //monitor Button\n //readButtonValue(); \n\n \n \n \n \n \n }, 500);\n}", "function boggleTimer() {\r\n// var spreadsheet = SpreadsheetApp.getActive();\r\n// spreadsheet.getRange('D6').activate();\r\n// spreadsheet.getCurrentCell().setRichTextValue(SpreadsheetApp.newRichTextValue()\r\n// .setText('Time\\'s Up')\r\n// .setTextStyle(0, 9, SpreadsheetApp.newTextStyle()\r\n// .setFontSize(18)\r\n// .setBold(true))\r\n// .build());\r\nvar maxtime=3; //maximum minutes must be >=1 in 1/2 minute intervals\r\n var currentTime;\r\nvar range = SpreadsheetApp.getActiveSpreadsheet().getRange(\"D6\");\r\n range.setBackground(\"\");\r\n range.setValue(\"Time left: \"+maxtime+\" minutes\");\r\n SpreadsheetApp.flush();\r\n //first count down minutes\r\n currentTime=maxtime;\r\n while (currentTime>1) {\r\n Utilities.sleep(60000); // 1 min delay \r\n currentTime=currentTime-1;\r\n range.setValue(\"Time left: \"+currentTime+\" minutes\");\r\n SpreadsheetApp.flush();\r\n }\r\n//now either 1 minute or 30 seconds are left\r\n//only set delay for 30 seconds, so we can count down last 30 seconds\r\n if (currentTime==1) {\r\n range.setValue(\"Time left: 1 minute\");\r\n SpreadsheetApp.flush();\r\n Utilities.sleep(30000);\r\n }\r\n//last 30 seconds\r\n for (i=0; i<3; i++) { \r\n range.setValue(\"Time left: \"+parseInt((3-i)*10)+\" sec\");\r\n SpreadsheetApp.flush();\r\n Utilities.sleep(10000); // 10 sec delay\r\n} \r\n range.setBackground(\"red\");\r\n range.setValue('Time\\'s Up')\r\n .setFontWeight(\"bold\")\r\n .setFontSize(16);\r\nSpreadsheetApp.flush();\r\n}", "function flushLEDs()\n{\n\n\t// changedCount contains number of lights changed\n var changedCount = 0;\n\n // count the number of LEDs that are going to be changed by comparing pendingLEDs to activeLEDs array\n for(var i=0; i<80; i++)\n {\n if (pendingLEDs[i] != activeLEDs[i]) changedCount++;\n }\n\n // exit function if there are none to be changed\n if (changedCount == 0) return;\n\n //uncommenting this displays a count of the number of LEDs to be changed\n //println(\"Repaint: \" + changedCount + \" LEDs\");\n\n // if there is a lot of LEDs, use an optimized mode (which looks to me like it sends all in one MIDI message\n if (changedCount > 30)\n {\n // send using channel 3 optimized mode\n for(var i = 0; i<80; i+=2)\n {\n sendMidi(0x92, pendingLEDs[i], pendingLEDs[i+1]);\n activeLEDs[i] = pendingLEDs[i];\n activeLEDs[i+1] = pendingLEDs[i+1];\n }\n sendMidi(0xB0, 104 + 7, activeLEDs[79]); // send dummy message to leave optimized mode\n }\n // if not a lot of LEDs need changing send them in individual MIDI messages\n else\n {\n for(var i = 0; i<80; i++)\n {\n if (pendingLEDs[i] != activeLEDs[i])\n {\n activeLEDs[i] = pendingLEDs[i];\n\n var colour = activeLEDs[i];\n\n if (i < 64) // Main Grid\n {\n var column = i & 0x7;\n var row = i >> 3;\n sendMidi(0x90, row*16 + column, colour);\n }\n else if (i < 72) // Right buttons\n {\n sendMidi(0x90, 8 + (i - 64) * 16, colour);\n }\n else // Top buttons\n {\n sendMidi(0xB0, 104 + (i - 72), colour);\n }\n }\n }\n }\n}", "function current_turn_blink() {\n let current_turn_class = document.getElementsByClassName(\"game-detail-move\")[0];\n let current_opacity = 0\n setInterval(() => {\n current_opacity = Math.abs(current_opacity - 0.8)\n current_turn_class.style.opacity = current_opacity;\n }, 700);\n}", "function setBlinkInIntervalWithRep(ints, originalInts, knockedDown, callback) {\n var original = originalInts.slice();\n var tempArr = [];\n var interval = setInterval(function() {\n if (ints.length == 0) {\n clearInterval(interval);\n setTimeout(function() {\n\n //console.log(\"Update GUI pins left: \"+ original[0].toString());\n var newArr = addKnockedDownPinsToArr(original, knockedDown);\n updateGUI(original.length); //CHANGE THE 10 TO THE NUM OF PINS CURRENTLY KNOCKED DOWN\n\n //console.log(\"Pins left to keep grey: \"+newArr.reverse()[0].toString());\n newArr.shift();\n console.log(\"newArr: \");\n console.log(newArr);\n setBlinkInInterval(newArr, callback);\n }, 50);\n }\n tempArr.push(ints.pop());\n performBlink(tempArr);\n\n }, 50);\n}", "function check_and_trigger() {\n var data;\n //console.log(\"triggered: \" + time_seconds);\n config.getData(\"script\", function (nn) {data = nn});\n if(data == undefined) {\n console.log(\"data undefined\");\n return;\n }\n //console.log(data.toString());\n \n var cont = true;\n while (cont) {\n var arr = Object.keys(data);\n var element = data[arr[0]];\n if (element.time < time_seconds) {\n p.process(element);\n console.log(\"ev: \" + element.time.toString() + \", tim: \" + time_seconds);\n delete data[arr[0]];\n } else {\n cont = false;\n }\n \n\n \n\n }\n}", "function callback(data, error) {\n if (error) throw error;\n // wait 50ms, then call blink() again:\n interval = setTimeout(blink, 50);\n }", "async function frequencyChanged() {\n config.changeFrequency = {change: false, newTime: 0};\n}", "function blinkLED() { //function to start blinking\n\n if (LED5.readSync() === 0) { //check the pin state, if the state is 0 (or off)\n //here the movement is faster\n LED5.writeSync(1);\n LED12.write(0);\n\n } else {\n //Here the movement is slower\n LED5.writeSync(0); \n LED12.write(0.5);\n }\n\n}", "function watchBridge() {\n setInterval(() => {\n getBridgeStatus().then(\n () => {\n writeBridgeStatus();\n },\n () => {\n writeBridgeStatus();\n },\n );\n }, 3000);\n}", "function run(e) {\n// Execute stop(e) first so that the user see's the light turn to red instantly rather than a 1 second lag\n stop(e);\n e.target.dataset.run = \"slow\"; \n intervalId = setInterval(function() {\n if(e.target.dataset.run == \"slow\"){\n trafficLight.classList.add(\"slow\");\n trafficLight.classList.remove(\"stop\");\n trafficLight.classList.remove(\"go\");\n e.target.dataset.run = \"go\";\n } else if(e.target.dataset.run == \"go\"){\n trafficLight.classList.add(\"go\");\n trafficLight.classList.remove(\"stop\");\n trafficLight.classList.remove(\"slow\");\n e.target.dataset.run = \"stop\";\n } else if(e.target.dataset.run == \"stop\"){\n trafficLight.classList.add(\"stop\"); \n trafficLight.classList.remove(\"go\");\n trafficLight.classList.remove(\"slow\");\n e.target.dataset.run = \"slow\";\n }\n }, 1000);\n}", "function blink(t, d)\r\n{\r\n return ((t % d) < d/2);\r\n}", "function periodicActivity() {\n myLed.write(ledState ? 1 : 0);\n ledState = !ledState;\n}", "scheduleDetectChanges() {\n if (this.scheduledChangeDetectionFn) {\n return;\n }\n this.scheduledChangeDetectionFn = scheduler.scheduleBeforeRender(() => {\n this.scheduledChangeDetectionFn = null;\n this.detectChanges();\n });\n }", "toggleBlink(domElem, val) {\n\n //if (val == true) { \n\n //var elem = document.getElementById(domElem);\n //setInterval(function () {\n // elem.style.display = (elem.style.display == 'none' ? '' : 'none');\n //}, 750);\n //}\n\n\n }", "handleRemoteChange() {\n // Reports changes with a slight debounce\n clearTimeout(this.changeReportDebounceTimer)\n this.changeReportDebounceTimer = setTimeout(this.reportChangesToAllSubscribers, 250)\n }", "function displayChange() {\n now = new Date();\n\n if (display.on && nsConfigured && (bgNext < now.getTime())) {\n wakeupFetch();\n }\n}", "loopCellMatrix() {\n for(let row = 0; row < this.rowSize; row++) {\n for(let cell = 0; cell < this.colSize; cell++) {\n this.grid[row][cell].willLive = this.decideCellFuture(row, cell);\n }\n }\n }", "function lightChanged(num) {\r\n\tif (light_status != num) {\r\n\t\tlight_status = num;\r\n\t\tsendPush();\r\n\t\tconsole.log(\"Light Change: \" + num);\r\n\t}\r\n}", "checkIfPooped() {\n setInterval(() => {\n if (this.feedCount % 5 === 0) {\n this.hasPooped = true;\n }\n }, 1000);\n }", "function checkDeskStatus(deskId){\n // make an array of chair statuses (easier to work with)\n let i = 0, chairStatuses = [];\n for (let chair in desks[deskId].chairs){\n if (desks[deskId].chairs[chair].socketId){\n chairStatuses[i++] = desks[deskId].chairs[chair].status; // fill chairStatuses only with non-empty values\n }\n }\n\n let originalDeskStatus = desks[deskId].status; // save original status\n\n if (chairStatuses.length){ // not an empty table\n if (chairStatuses.every(x => x === 'done')){ // all done\n desks[deskId].status = 'done';\n } else if (chairStatuses.every(x => x === 'offline')){ // all offline\n desks[deskId].status = 'offline';\n } else if (chairStatuses.every(x => x === 'online')){ // all online\n desks[deskId].status = 'online';\n } else {\n if (chairStatuses.some(x => x !== 'done')){ // some not done\n desks[deskId].status = 'not_done';\n }\n\n if (chairStatuses.some(x => x === 'help')){ // some need help\n desks[deskId].status = 'help';\n }\n }\n } else {\n desks[deskId].status = 'empty'; // empty table\n }\n\n if (originalDeskStatus !== desks[deskId].status){ // if the status has changed\n io.emit('deskStatusChanged', room); // emit new status\n console.info('▒▒▒ deskStatusChanged', 'desk', deskId, desks[deskId].status);\n }\n}", "function doBlink() {\n\t\t// Blink, Blink, Blink...\n\t\tvar blink = document.all.tags(\"BLINK\")\n\t\tfor (var i=0; i < blink.length; i++)\n\t\t\tblink[i].style.visibility = blink[i].style.visibility == \"\" ? \"hidden\" : \"\" \n\t}", "updateIsAboutToFire() {\n let isAboutToFire = false;\n\n // Called every frame, do not allocate closures.\n for ( let i = 0; i < this.waterDrops.length; i++ ) {\n const waterDrop = this.waterDrops[ i ];\n if ( waterDrop.amplitude > 0 && waterDrop.startsOscillation ) {\n\n // Called every frame, break when any match is found for performance\n isAboutToFire = true;\n break;\n }\n }\n this.isAboutToFireProperty.value = isAboutToFire;\n }", "function blinkLight(filter_name, filtered, interval=1000) {\n let filterLight = document.getElementById(filter_name + '-filtered');\n let notFilterLight = document.getElementById(filter_name + '-notfiltered');\n let elem = filtered ? filterLight : notFilterLight;\n elem.style.backgroundColor = filtered ? 'Yellow' : 'LawnGreen';\n setTimeout(function() {\n elem.style.backgroundColor = 'Gainsboro';\n }, interval);\n}", "function periodicTrigger()\r\n{\r\n //print trigger pin status\r\n var GoButton = ProgramTrigger.read();\r\n console.log(\"Trigger Status \" + GoButton);\r\n setTimeout(periodicTrigger, 2000);\r\n}", "updateDeviceStatus() {\n if (this.thermostatService) this.thermostatService.getCharacteristic(Characteristic.CurrentHeatingCoolingState).updateValue(this.getCurrentHeatingCoolingState());\n if (this.thermostatService) this.thermostatService.getCharacteristic(Characteristic.TargetHeatingCoolingState).updateValue(this.getTargetHeatingCoolingState());\n if (this.thermostatService) this.thermostatService.getCharacteristic(Characteristic.CurrentTemperature).updateValue(this.getCurrentTemperature());\n if (this.thermostatService) this.thermostatService.getCharacteristic(Characteristic.TargetTemperature).updateValue(this.getTargetTemperature());\n\n super.updateDeviceStatus();\n }", "function f_toggle_real_time(real_time, real_unit, real_checkbox, graphs_div, date_from, time_from, date_until, time_until, checkbox_class, interval_array){\n $(real_time).attr('disabled','disabled');\n $(real_unit).attr('disabled','disabled');\n $(real_checkbox).click(function() {\n var $this = $(this);\n if ($this.is(':checked')) {\n $(date_from).attr('disabled','disabled');\n $(date_until).attr('disabled','disabled');\n $(time_until).attr('disabled','disabled');\n $(time_from).attr('disabled','disabled');\n $(real_time).removeAttr('disabled');\n $(real_unit).removeAttr('disabled');\n $(checkbox_class).prop('checked', false);\n $(graphs_div).children('img').remove();\n $(graphs_div).children('a').remove();\n } \n else {\n $(date_from).removeAttr('disabled');\n $(date_until).removeAttr('disabled');\n $(time_until).removeAttr('disabled');\n $(time_from).removeAttr('disabled');\n $(real_time).attr('disabled','disabled');\n $(real_unit).attr('disabled','disabled');\n $(checkbox_class).prop('checked', false);\n $(graphs_div).children('img').remove();\n $(graphs_div).children('a').remove();\n /* # clearing all intervals */\n $.each(interval_array, function(index, value) { \n clearInterval(interval_array[index]);\n });\n } \n });\n}", "function check() {\n clearTimeout(timer)\n\n if (device.present) {\n // We might get multiple status updates in rapid succession,\n // so let's wait for a while\n switch (device.type) {\n case 'device':\n case 'emulator':\n willStop = false\n timer = setTimeout(work, 100)\n break\n default:\n willStop = true\n timer = setTimeout(stop, 100)\n break\n }\n }\n else {\n stop()\n }\n }", "function generalLoop(){\r\n\r\n\tif ((new Date()).getTime() - timeObj < 3 ) {\t\t\r\n\t\treturn;\t\t\r\n\t}//fi\r\n\tif (currentState == 3) {\r\n\t\tupdateDisplay();\r\n\t\ttimeObj = (new Date()).getTime();\r\n\t}//fi\r\n\r\n\t\r\n\r\n}//end listener\t", "function rail_lights(){\n $(\"#home_left\").show();\n $(\"#home_back\").hide();\n var l = setInterval(light_switch, 700);\n\n var clear = function(){\n clearInterval(l);\n };\n\n setTimeout(clear, 5800);\n}", "function init_old_status(sensor, clock_time)\r\n{\r\n sensor.old = false; // start with the assumption msg is not old, update will correct if needed\r\n update_old_status(sensor, clock_time);\r\n}", "game_over() {\n if (this.game_state !== \"alive\") {\n return;\n }\n console.log(\"game_over\");\n this.game_state = \"game_over\";\n //this.visible_board = this.game_board;\n\n for (let row = 0; row < this.visible_board.length; row++) {\n for (let col = 0; col < this.visible_board[0].length; col++) {\n\n if (this.visible_board[row][col] === marked_value) {\n if (this.game_board[row][col] === mine_value) {\n continue; // flagged correctly. Flag stays.\n }\n else {\n this.visible_board[row][col] = wrong_marked_value;\n continue;\n }\n\n }\n this.visible_board[row][col] = this.game_board[row][col];\n\n }\n }\n this.stop_timer();\n alert(\"Game over!\");\n }", "function update() {\r\n const name = $(\r\n \"#wrapper > div.contents > div.cnt-raid > div.cnt-raid-stage > div.prt-targeting-area > div.prt-stage-area > a.btn-targeting.enemy-1.invisible > div.enemy-info > div.name\"\r\n );\r\n const percent = $(\"#enemy-hp0\");\r\n if (name.text() != \"\" && $(\"#list-content\").children().length == 0) {\r\n console.log($(\"#title\"));\r\n $(\"#title\").append(\"Ultimate Bahamut\");\r\n }\r\n if (\r\n parseInt(percent.text()) <= triggers[curr_trigger].percent + 5 &&\r\n !done &&\r\n percent.text() != \"0\"\r\n ) {\r\n const warning_text = $(\r\n \"#wrapper > div.contents > div.cnt-raid > div.cnt-raid-stage > div.prt-targeting-area\"\r\n );\r\n if (curr_trigger < triggers.length - 1) {\r\n console.log(curr_trigger);\r\n if (parseInt(percent.text()) >= triggers[curr_trigger + 1].percent) {\r\n console.log(\"ABOUT TO WARN\");\r\n // if its not the last one check if in between triggers\r\n $(\r\n '<p class=\"lead\" style = \"font-family:\"Roboto\";color:red;margin-left:150px\" id = \"warning-text\">INCOMING TRIGGER</p>'\r\n )\r\n .appendTo(warning_text)\r\n .fadeOut(8000);\r\n }\r\n curr_trigger++;\r\n } else {\r\n $(\r\n '<p class=\"lead\" style = \"font-family:\"Roboto;color:red;margin-left:150px\" id = \"warning-text\">INCOMING TRIGGER</p>'\r\n )\r\n .appendTo(warning_text)\r\n .fadeOut(8000);\r\n done = true;\r\n }\r\n }\r\n }", "function intervalCheckTodoList() {\r\n // Get Check List\r\n dbManager.getAllMachineItemDataList(function (result, machineItemDataList) {\r\n if (result) {\r\n // Check TBM Item\r\n checkTBMItem(machineItemDataList);\r\n\r\n // Check CBM Item\r\n checkCBMItem(machineItemDataList);\r\n }\r\n\r\n setTimeout(intervalCheckTodoList, 1000);\r\n });\r\n}", "function refreshData() {\n vm.ready = true;\n if (vm.currentDeviceType && vm.currentDeviceType.id) {\n filter.start= moment(filter.start).format('YYYY-MM-DD HH:mm:ss');\n filter.end = moment(filter.end).format('YYYY-MM-DD HH:mm:ss');\n getFilteredDeviceState(vm.currentDeviceType, filter.start, filter.end);\n vm.steppedline = (vm.currentDeviceType.type === 'binary');\n }\n }", "function updateAllBlockStatus() {\n 'use strict';\n\n var name;\n var idx;\n var values;\n for (var no = 0; no < _activeBlocksCache.length; no++){\n if (_activeBlocksCache[no] && (_activeBlocksCache[no].online)){\n name = _activeBlocksCache[no].name;\n idx = getBlockIdx(name,no);\n values = _activeBlocksCache[no].values;\n event.emit(events.BLOCKSTATUS,name, idx, values);\n }\n }\n}", "trackVolatile() {\n if (watcher !== void 0) {\n watcher.needsRefresh = true;\n }\n }", "function onTimeChange() {\r\n if(hr*60+min>=range[1]) {\r\n onHourChange();\r\n }\r\n else {\r\n updateTimer();\r\n } \r\n }", "function statusChanged(){\n resetTimer();\n renderTimer();\n}", "function backToNormal() {\n\n setTimeout(() => {\n clearInterval(intervalIDEdible)\n clearInterval(intervalIDEdible2)\n clearInterval(intervalIDEdible3)\n clearInterval(intervalIDEdible4)\n\n checkGhost1()\n checkGhost2()\n checkGhost3()\n checkGhost4()\n\n backToNormalFinal()\n\n }, 7000)\n}", "function checkThreshold() {\n\n\t\tupTime = null;\n\t\tdownTime = null;\n\n\t\t// don't work out linear yet\n\t\tif ( (vOld < threshold) && (v >= threshold) ) {\n\t\t\tupTime = true;\n\t\t}\n\t\telse if ( (vOld > threshold) && (v <= threshold) ) {\n\t\t\tdownTime = true;\n\t\t}\n\n\t}", "run(cb) {\n const now = new Date().getTime();\n // drop any old data\n this.firedTs = this.firedTs.filter(ts => ts > now - this.seconds * 1000);\n if (this.firedTs.length < this.times) {\n this.firedTs.push(now);\n cb();\n return true;\n }\n return false;\n }", "function periodicActivity()\r\n{\r\n myLed.write(ledState?1:0); //if ledState is true then write a '1' (high) otherwise write a '0' (low)\r\n ledState = !ledState; //invert the ledState\r\n setTimeout(periodicActivity,1000); //call the indicated function after 1 second (1000 milliseconds)\r\n}", "updateColour(e) {\n var newR = this.state.sliderColourR;\n var newG = this.state.sliderColourG;\n var newB = this.state.sliderColourB;\n if (e.detail.angleStatus === \"VALID\") {\n var colourOffsetR = Math.round(Constants.COLOUR_R_CHANGE_PER_DEG * (e.detail.deg - Constants.ANGLE_OFFSET_DEG));\n var colourOffsetG = Math.round(Constants.COLOUR_G_CHANGE_PER_DEG * (e.detail.deg - Constants.ANGLE_OFFSET_DEG));\n var colourOffsetB = Math.round(Constants.COLOUR_B_CHANGE_PER_DEG * (e.detail.deg - Constants.ANGLE_OFFSET_DEG));\n newR = Constants.ROYAL_BLUE_R + colourOffsetR;\n newG = Constants.ROYAL_BLUE_G - colourOffsetG;\n newB = Constants.ROYAL_BLUE_B - colourOffsetB;\n } else if (e.detail.angleStatus === \"MAXBUFF\") {\n newR = Constants.LIGHT_RED_R;\n newG = Constants.LIGHT_RED_G;\n newB = Constants.LIGHT_RED_B;\n } else if (e.detail.angleStatus === \"MINBUFF\") {\n newR = Constants.ROYAL_BLUE_R;\n newG = Constants.ROYAL_BLUE_G;\n newB = Constants.ROYAL_BLUE_B;\n } else {\n\n }\n this.setState({\n sliderColourR: newR,\n sliderColourG: newG,\n sliderColourB: newB,\n sliderColour: \"rgb(\" + newR + \", \" + newG + \", \" + newB + \")\"\n });\n }", "function new_status(all_locations){\n var change_status = [];\n for(let i=0; i<all_locations.length; i++){\n if (all_locations[i].on() === false){\n change_status.push(all_locations[i].on());\n }\n }\n if (change_status.length == all_locations.length){\n markers.forEach(function(marker){\n marker.setVisible(true);\n });\n }\n }", "function blink() {\n light.toggle();\n }", "function refreshGamesEachSec() {\n setInterval(refreshGameStatus, 1000);\n}", "function trackUnexecutedCellChanges(){\n /* Get currently rendered cells to track unexecuted changes */\n patchCellUnselect();\n var cells = Notebook.get_cells();\n for(var i = 0; i < cells.length; i++){\n trackChangesToCell(cells[i]);\n }\n patchInsertCellAtIndex();\n }", "function blink(start, end, start1 = 0, end1 = 0, knockedDown, callback = function() {}) {\n createList(start, end, start1, end1, function(ints) {\n var originalInts = ints;\n ints.reverse();\n setBlinkInIntervalWithRep(ints, originalInts, knockedDown, callback);\n })\n}", "function blinkAnimate(){\r\n\t\t\tif (gameState.currentState != states.gameover \r\n\t\t\t\t&& gameState.currentState != states.demo){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tel.style.opacity = Tween.easeInOutQuad(t,start,change,dur);\r\n\t\t\tt++;\r\n\t\t\t\r\n\t\t\tt = t % (dur*2);\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tblinkAnimate();\r\n\t\t\t},20)\r\n\t\t}", "checkOverTime(){\n if(this.view.actualPlayTime >= this.view.playTimeMax){\n this.state = 'WAIT_SP_TIMER';\n this.view.stopTimer();\n this.client.requestSwitchPlayer();\n\n\n if(this.selectedPiece != null){\n this.unvalidateCells();\n this.selectedPiece.selected = false;\n this.selectedPiece.swapText();\n this.selectedPiece = null;\n }\n }\n }", "updateAndStop() {\n this.onStop(true);\n }", "function led_blinker() {\n if(led_blinker.state === \"flashing\") {\n led_blinker.led = (led_blinker.led) ? false : true;\n } else if(led_blinker.state === \"on\") {\n led_blinker.led = true;\n } else if(led_blinker.state === \"off\") {\n led_blinker.led = false;\n } \n fs.writeFileSync(\"/sys/class/gpio/gpio61/value\", led_blinker.state? \"1\" : \"0\");\n}", "function uponFeedHoldTimer() {\n\tif (buttonLED.readSync() == 1)\n\t\tbuttonLED.writeSync(0);\n\telse\n\t\tbuttonLED.writeSync(1);\n}", "function frogCrashDetection() {\n const frogCarCrash = setInterval(() => {\n if (cells[frog].classList.contains('policeCar')\n || cells[frog].classList.contains('yellowCar')\n || cells[frog].classList.contains('water') && !cells[frog].classList.contains('log') && !cells[frog].classList.contains('lilypad')) {\n const newLives = lives -= 1\n livesLeft.innerHTML = newLives\n clearInterval(frogCarCrash)\n resetFrog()\n }\n }, 300)\n}", "function checkTime(){\n\t\n\tconst endTime = new Date().getTime() + 61000;\n\t\n\tlet interval = setInterval(()=>{\n\t\tconst now = new Date().getTime();\n\t\tif(now >= endTime){\n\t\t\tclearInterval(interval);\n\t\t\tfirebaseObj.ref().update({gameState : \"finished\"});\n\t\t}\n\t}, 1000);\n}", "function waitForNewValue() {\n io.socket.on('newDeviceState', function (deviceState) {\n // if the device is the current device, push the value in the graph\n if (vm.currentDeviceType && deviceState.devicetype === vm.currentDeviceType.id) {\n dataDt.unshift({ x: deviceState.datetime, y: deviceState.value });\n dataDT.pop();\n filter.end = moment(deviceState.datetime).format('YYYY-MM-DD HH:mm:ss');\n filter.start = moment(deviceState.datetime).subtract(globalTime, globalTimeRange).format('YYYY-MM-DD HH:mm:ss');\n $('#daterangepicker').data('daterangepicker').setStartDate(moment(filter.start).format('l[, ]LTS'));\n $('#daterangepicker').data('daterangepicker').setEndDate(moment(filter.end).format('l[, ]LTS'));\n vm.chart.update();\n }\n });\n }", "_triggerSwitchDebounced() {\n if (this._switchTimeout !== null) {\n return\n }\n\n this._switchTimeout = setTimeout(() => {\n this._triggerSwitch()\n this._switchTimeout = null\n }, 0)\n }", "function setUserAutorefresh(){\n setInterval(function(){\n var checked = $('input.check_item:checked',dataTable_users);\n var filter = $(\"#datatable_users_filter input\",\n dataTable_users.parents(\"#datatable_users_wrapper\")).attr('value');\n if (!checked.length && !filter.length){\n Sunstone.runAction(\"User.autorefresh\");\n }\n },INTERVAL+someTime());\n}", "function setTimeForPicChange() {\n spidersArr.forEach(function(ele) {\n if(ele.bool) {\n ele.bool = false;\n } else {\n ele.bool = true;\n }\n })\n setTimeout(setTimeForPicChange, 200);\n}", "function startEventStateCheck() {\n checkId = setInterval(() => {\n Object.entries(events).forEach((e) => {\n if (moment(e[1].start_datetime) <= moment.now()) {\n if (moment(e[1].end_datetime) < moment.now()) {\n changeEventState(e[0], true);\n } else { changeEventState(e[0], false); }\n }\n });\n }, 3000);\n}", "function checkValueChanged()/*:void*/ {\n // Update the cached value, possible setting the valueChanged flag.\n this.updateValue$nJmn();\n\n // We have checked for a value change now. All invalidations that happen\n // after this point will trigger a new asynchronous check. Invalidations that\n // happened during updateValue() have already triggered a synchronous\n // recomputation.\n this.willCheckValueChanged$nJmn = false;\n\n // If the value has changed, ...\n if (this.valueChanged$nJmn) {\n // ... we sent one event, but we clear the flag indicating a changed value first.\n // The listeners might make changes that result in further changes, so that\n // clearing the flag after the call to the listeners would be too late, losing events.\n this.valueChanged$nJmn = false;\n if (this.observable$nJmn) {\n this.observable$nJmn.fireEvent(/*FunctionValueExpression.*/CHANGED_EVENT$static, this);\n }\n }\n }", "function FiboCheck(clickedCell) {\n var grid = $scope.Grid;\n for (row in grid) {\n\n var cellValues = [];\n for (cell in $scope.Grid[row]) {\n\n if (cell != \"$$hashKey\") {\n cellValues.push(grid[row][cell].Value);\n };\n }\n\n CellService.FiboCheck(cellValues, row)\n .then(function (response) {\n var processedrow = response.data.Row;\n var fiboCells = response.data.FiboSerieCells;\n\n for (index in fiboCells) {\n grid[processedrow][fiboCells[index]].Cleared = true;\n }\n\n setTimeout(function () {\n $scope.$apply(function () {\n for (index in fiboCells) {\n grid[processedrow][fiboCells[index]].Cleared = false;\n grid[processedrow][fiboCells[index]].Value = 0;\n }\n });\n }, 1000);\n })\n .catch(function (data, status) {\n console.error('Error executing FiboCheck', response.status, response.data);\n })\n .finally(function () {\n console.log(\"Fibocheck executed succesfully\");\n });\n }\n }", "function onBlink(request, response) {\n console.log('Received synchronous call to blink');\n var responsePayload = {\n status: 'Blinking LED every ' + request.payload + ' seconds'\n }\n response.send(200, responsePayload, (err) => {\n if (err) {\n console.error('Unable to send method response: ' + err.toString());\n } else {\n console.log('Blinking LED every ' + request.payload + ' seconds');\n }\n });\n }", "looper() {\n //check if stop has been called\n if (!this.running) {\n return;\n }\n\n const currentVolume = this.getMaxVolume();\n\n this.emit('volume_change', currentVolume, this.threshold);\n\n let history = 0;\n if (currentVolume > this.threshold && !this.speaking) {\n // trigger quickly, short history\n for (let i = this.speakingHistory.length - 3; i < this.speakingHistory.length; i++) {\n history += this.speakingHistory[i];\n }\n if (history >= 2) {\n this.speaking = true;\n this.emit('speaking');\n }\n } else if (currentVolume < this.threshold && this.speaking) {\n for (let j = 0; j < this.speakingHistory.length; j++) {\n history += this.speakingHistory[j];\n }\n if (history === 0) {\n this.speaking = false;\n this.emit('stopped_speaking');\n }\n }\n this.speakingHistory.shift();\n this.speakingHistory.push(0 + (currentVolume > this.threshold));\n\n setTimeout(this.looper.bind(this), this.interval);\n\n }", "stopJobStatusUpdates() {\n this.state.listeningForJob = false;\n\n if (this.state.awaitingLog) {\n this.stopEventListeners([jcm.MESSAGE_TYPE.STATUS]);\n } else {\n this.stopEventListeners();\n }\n }", "function performBlink(tempArr) {\n for (var i = 0; i < tempArr.length; i++) {\n if (tempArr[i] == 10) {} else {\n var bowlingPin = document.getElementById('bowlingPin_' + tempArr[i].toString());\n bowlingPin.src = \"bowling_pin_transparent.png\";\n }\n }\n //uncomment below to get flashing back\n /*\n setTimeout(function() {\n for (var j = 0; j < tempArr.length; j++) {\n //document.getElementById(\"bowlingPin_\" + i.toString()).style.visibility = 'hidden';\n var bowlingPin = document.getElementById('bowlingPin_' + tempArr[j].toString());\n bowlingPin.src = \"bowling_pin_solid.png\";\n }\n }, 30);\n */\n}", "function checkTimers() {\n //Change ghost time to 8 seconds from round 5\n if (round > 4) {\n ghostAction = 8000;\n ghostcountReset = 8;\n }\n\n //Change ghost time to 6 seconds from round 10\n if (round > 9) {\n ghostAction = 6000;\n ghostcountReset = 6;\n }\n\n //Change ghost time to 4 seconds from round 15\n if (round > 14) {\n ghostAction = 4000;\n ghostcountReset = 4;\n }\n}", "function LightBlink(){ //Switches a light on and off every 'waittime' seconds.\n\tif(this.transform.Find(\"Light\").GetComponent(Light).enabled == true){\n\t\tyield WaitForSeconds(waittime/2);\n\t\tthis.transform.Find(\"Light\").GetComponent(Light).enabled = false;\n\t}\n\tif(this.transform.Find(\"Light\").GetComponent(Light).enabled == false){\n\t\tyield WaitForSeconds(waittime/2);\n\t\tthis.transform.Find(\"Light\").GetComponent(Light).enabled = true;\n\t}\n}", "function colorCodeTimeBlocks(){\n //Every second, check if the timeblock color coding should change\n var timeInterval = setInterval(function (){\n let currentTime = moment().format(\"H\");\n compareTimeBlocks(currentTime); \n }, 1000)\n \n}", "function prepBlueInterval(ghost) {\n ghost.blueCount = 0\n clearInterval(ghost.blueInterval)\n setTimeout(() => {\n ghost.isBlue = true\n }, 100)\n}", "function watchLiveTradingEvents(){\n\tweb3[selectedProvider].eth.net.isListening().then(async () => {\n\t\tif(eventSubscription !== null){ return; }\n\t\teventSubscription = tradingContract.events.allEvents({ fromBlock: 'latest' }).on('data', function (event){\n\t\t\tconst eventName = event.event.toString();\n\n\t\t\tif(eventName !== \"TradeOpenedMarket\" && eventName !== \"TradeCanceledMarket\"\n\t\t\t&& eventName !== \"TradeClosedMarket\" && eventName !== \"TradeLimitExecuted\"\n\t\t\t&& eventName !== \"TpSlUpdated\" && eventName !== \"TradeLimitOpened\"\n\t\t\t&& eventName !== \"TradeLimitCanceled\"){\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tevent.triedTimes = 1;\n\n\t\t\tsetTimeout(() => {\n\t\t\t\trefreshOpenTrades(event);\n\t\t\t}, process.env.EVENT_CONFIRMATIONS_SEC*1000);\n\t\t});\n\n\t\tconsole.log(\"Watching trading events\");\n\t}).catch(() => {\n\t\tsetTimeout(() => { watchLiveTradingEvents(); }, 2*1000);\n\t});\n}", "startRecievingData() {\n Stream.subscribe(\"user_activity\", rows => {\n if (!rows || rows.length === 0) {\n // show latency flag if no data for more than 10 mins\n console.log('no data!')\n let hasNoData =\n this.getSecondsFromNow(this.lastDataRecieved) >=\n this.latencyThreshold && this.enableRealtime;\n\n hasNoData ? (this.isDelayed = true) : (this.isDelayed = false);\n\n return;\n }\n\n // A node for each person's schedule\n for (let d of rows) {\n let timestamp = d.timestamp; \n let diff = Math.abs(this.getDateOffset().getTime() - this.userActivityDropTime * 1000 - this.getDateOffset(d.timestamp).getTime()) /1000\n console.log('diff',diff)\n console.log('lastdatareceived',this.lastDataRecieved)\n console.log('timediff',this.getSecondsFromNow(timestamp))\n console.log('systime', this.getDateOffset().getTime())\n console.log('recordtime', this.getDateOffset(timestamp).getTime())\n console.log('last', this.getSecondsFromNow(this.lastDataRecieved))\n this.lastDataRecieved = d.timestamp;\n \n \n let hasLatency =\n this.getSecondsFromNow(d.timestamp) >= this.latencyThreshold &&\n this.enableRealtime; \n \n hasLatency ? (this.isDelayed = true) : (this.isDelayed = false);\n \n if (hasLatency) {\n continue;\n }\n // drop records that are passing activity drop time \n if (\n this.getSecondsFromNow(d.timestamp) >= this.userActivityDropTime &&\n this.enableRealtime\n ) {\n continue;\n }\n\n // show latency flag if records and current time is more than 10 mins apart\n\n //let hasLatency =\n // this.getSecondsFromNow(d.timestamp) >= this.latencyThreshold &&\n // this.enableRealtime;\n\n //hasLatency ? (this.isDelayed = true) : (this.isDelayed = false);\n\n let activity = d.value.split(\",\");\n let actValue = activity[this.getConfigIndex(\"index\")];\n let styleValue = activity[this.getConfigIndex(\"style\")];\n\n //***set transparent for 'enter digibank' --- max// \n //if (actValue === \"16\") {\n //styleValue = \"5\";\n //}\n\n let scheds = {\n id: activity[this.getConfigIndex(\"visid\")],\n act: actValue,\n style: styleValue,\n errorStyle: this.getErrors(activity)\n };\n let { act, style, errorStyle } = scheds;\n let nodeIndex = this.nodes.findIndex(node => node.id == scheds.id);\n if (nodeIndex >= 0) {\n if (this.nodes[nodeIndex].act != act) {\n this.nodeQueue.push({\n ...this.nodes[nodeIndex],\n act,\n styles: this.getCombinedNodeStyle(style, errorStyle),\n timestamp: d.timestamp,\n index: nodeIndex\n });\n }\n } else {\n this.nodeQueue.push({\n ...scheds,\n radius: 3,\n x: this.foci[act].x + Math.random(),\n y: this.foci[act].y + Math.random(),\n styles: this.getCombinedNodeStyle(style, errorStyle),\n timestamp: d.timestamp,\n index: -1\n });\n }\n }\n });\n }" ]
[ "0.59838164", "0.58558714", "0.5646531", "0.5603906", "0.5603906", "0.554309", "0.5522416", "0.549008", "0.5475295", "0.544291", "0.5417059", "0.54146546", "0.54032856", "0.5370975", "0.53327507", "0.531633", "0.5298158", "0.5263667", "0.5263667", "0.5249394", "0.52420706", "0.52143365", "0.5206596", "0.520019", "0.5194302", "0.51890486", "0.5166699", "0.516494", "0.5131782", "0.512373", "0.51180035", "0.5081526", "0.5071211", "0.5044248", "0.5035636", "0.50319624", "0.50171626", "0.5011469", "0.5007548", "0.5004759", "0.50001556", "0.49974576", "0.4974992", "0.4966571", "0.49639297", "0.49531764", "0.49517784", "0.49441823", "0.49441618", "0.492606", "0.49260557", "0.492217", "0.4919336", "0.49148658", "0.4899463", "0.48938122", "0.4891204", "0.48870963", "0.48819456", "0.48740265", "0.4864166", "0.48603964", "0.4846039", "0.4837766", "0.48172507", "0.4816551", "0.48142684", "0.4812382", "0.48103732", "0.48079622", "0.48058063", "0.47995663", "0.47914597", "0.4787175", "0.47850105", "0.47843632", "0.47830003", "0.4782073", "0.47797096", "0.47723764", "0.47708535", "0.4769754", "0.47689477", "0.47654018", "0.47646305", "0.47632635", "0.47620344", "0.47604048", "0.47597188", "0.4757049", "0.47440502", "0.4742126", "0.47409728", "0.47281685", "0.47261545", "0.47240815", "0.47198686", "0.47188085", "0.47118238", "0.47109917" ]
0.66011703
0
invoke all of the above!
function invokeFacebookDewaller() { // append these styles by default, always appendStyle(defaultStyles); // since we couldn't find css selectors to detect if a user is logged // out on mobile, we have to do this.. :( const logo = document.querySelectorAll(`#${MOBILE_HEADER_ID} a`); const isMobileLoggedOut = logo && logo.length > 0 && logo[0].href === MOBILE_LOGIN_URL; hidePopout() if (isMobileLoggedOut) { appendStyle(mobileStyles); } // else if its desktop, start observing changes else if (logo.length < 1) { observeAndCloseExpandingCTA(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "apply () {}", "function _____SHARED_functions_____(){}", "private public function m246() {}", "_reflow() {\n this._init();\n }", "transient private protected internal function m182() {}", "private internal function m248() {}", "transient protected internal function m189() {}", "__previnit(){}", "apply(args) {\n // ... //\n }", "protected internal function m252() {}", "function gather() {\n base();\n hootsuite();\n socialpilot();\n socialoomph();\n agorapulse();\n communit();\n crowdfire();\n loomly();\n planable();\n missinglettr();\n viraltag();\n}", "function callHooks(currentView,arr){for(var i=0;i<arr.length;i+=2){arr[i+1].call(currentView[arr[i]]);}}", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "function run() {}", "_postProcessing() {\n // None yet...\n }", "Run() {\n\n }", "transient private internal function m185() {}", "static private internal function m121() {}", "function userinfo_dispatcher_routines() {\n\n\n}", "execute(){\n\t\tvar component;\n\n\t\tfor (component in this.components){\n\t\t\tthis.components[component]();\n\t\t}\n\t}", "run(method, ...args) {\r\n this[method].apply(this, args).catch(err => {\r\n Zotero.debug(err)\r\n })\r\n }", "use (...handlers) { this.handlers = this.handlers.concat(handlers) }", "do (...args)\n\t{ return this.onSend (...args);\n\t}", "obtain(){}", "function run() {\n\n }", "function main() {\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\tif (gvMethod === \"MAP\") {\n\t\t\t\t//Perform The Mapping between In and Out\n\t\t\t\ttry {\n\t\t\t\t\t_mapInToOut();\n\t\t\t\t} catch (errorObj) {\n\t\t\t\t\tgvStatus = \"Error during mapping IN to OUT:\" + errorObj.message;\n\t\t\t\t\t$.response.status = 200;\n\t\t\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\t\t\tmessage: \"API Called\",\n\t\t\t\t\t\tresult: gvErrorMessage,\n\t\t\t\t\t\tstatus: gvStatus,\n\t\t\t\t\t\ttableUpdates: gvTableUpdate\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// \t\t} else if ($.request.method === $.net.http.GET) {\n\t\t// \t\t\t//Read Entries from the Table\n\t\t// \t\t\ttry {\n\t\t// \t\t\t\t_getEntries();\n\t\t// \t\t\t} catch (errorObj) {\n\t\t// \t\t\t\t$.response.status = 200;\n\t\t// \t\t\t\t$.response.setBody(JSON.stringify({\n\t\t// \t\t\t\t\tmessage: \"API Called\",\n\t\t// \t\t\t\t\tresult: gvErrorMessage\n\t\t// \t\t\t\t}));\n\t\t// \t\t\t}\n\t\t// \t\t}\n\t}", "function runAll() {\n synkarKonton();\n synkarGrupper();\n}", "function CommonSetHandler( results )\n{\n\tStandardCallback( results, 'infoOutput' );\n}", "processItems() {}", "function process()\r\n{\r\n\ttry\r\n\t{\r\n\t\tgetItems();\t\t\t\t\t\t\t\t//calling getItems function\r\n\t\t\r\n\t\tgetShippingDestinations();\t\t\t\t//calling getShippingDestinations function\r\n\t\t\r\n\t\tgetAndSetSellingPriceforEachItem();\t\t//calling getAndSetSellingPriceforEachItem function\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\r\n\t\terrorHandler(\"process : \" , e);\r\n\t} \r\n\r\n\r\n}", "function callPlugins(method, args) {\n for (var i in d.plugins) {\n if (method in d.plugins[i]) {\n d.plugins[i][method].apply(d.plugins[i][method], args);\n }\n }\n }", "perform() {\n\n }", "function main() {\n getIpLocation();\n setHandlers();\n }", "function doAll(/* args */){\n\t\tvar fn = Array.prototype.shift.call(arguments);\n\t\tif(!arguments.length) {\n\t\t\treturn fn();\n\t\t} else {\n\t\t\tfn();\n\t\t\treturn doAll.apply(null, arguments);\n\t\t}\n\t}", "function run() {\n }", "adoptedCallback() { }", "static private protected internal function m118() {}", "transient final protected internal function m174() {}", "function _setup () {\n }", "function MozmillHandlers() {\n\n}", "onComplete() {// Do nothing, this is defined for flow if extended classes implement this function\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 }", "run() {\n this.packedRun();\n }", "function i(e,t){return[\"on\",\"once\"].forEach(function(n){t[n]=function(){return e[n].apply(e,arguments),t}}),e}", "function _callScrollHandlers(){\n\t\tfor (var i = 0; i < _scrollHandlers.length; i++) {\n\t\t\t(_scrollHandlers[i].handler)(_lastScrollEvent);\n\t\t}\n\t\t_pendingScrollHandlers = false;\n\t\t_lastScrollEvent = null;\n\t}", "Invoke() {\n\n }", "Invoke() {\n\n }", "function initResults() {\n\tstoredPackageSubmit(); //bind add to trip button function\n\tinitPaging(); //paging\n\topenTaxesAndFeesToolTip(); //bind taxes and tools popup\n\tinitRightSideBasket();\n}", "function 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}", "afterHandling() {}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "__init3() {this._finished = false;}", "run () {\n }", "function init() {\n\t \t\n\t }", "callListeners() {\r\n const listenersCopy = [...this.listeners];\r\n listenersCopy.forEach(listener => {\r\n try {\r\n listener.call();\r\n }\r\n catch (e) {\r\n hookErrorHandler_1.handleHookError(e, this, listener, \"onCall\");\r\n }\r\n });\r\n }", "_callHandler() {\n let args = [].slice.call( arguments );\n let name = args.length ? args.shift() : '';\n\n if ( name && typeof this._options[ name ] === 'function' ) {\n this._options[ name ].apply( this, args );\n }\n }", "refresher() {\n let any = this;\n binanceDepthLoader();\n bittrexDepthLoader();\n\n binanceCandlestickLoader(any);\n bittrexCandlestickLoader(any);\n\n binance24hrInfo();\n bittrex24hrInfo();\n }", "transient private protected public internal function m181() {}", "function performer(cb) {\n cb();\n }", "async execute(){\n\t\tawait this.processRequest();\n\t\tawait this.formatRequest();\n\t\tawait this.processData();\n\t\tawait this.formatResponse();\n\t\tawait this.processResponse();\n\t}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "execute() {\n throw new Error(\"Must be implemented in subclass\");\n }", "_runAfterUpdateCallbacks() {\n var self = this;\n var callbacks = self._afterUpdateCallbacks;\n self._afterUpdateCallbacks = [];\n callbacks.forEach((c) => {\n c();\n });\n }", "static final private internal function m106() {}", "function setResultHandlers() {\n 'use strict';\n // console.log('in setResultHandlers');\n var id = '';\n for (var i = 0; i < 10; i++) {\n id = '#' + i;\n // console.log(id);\n $(id).click(getNumber);\n }\n $(\"#dot\").click(getNumber);\n\n $(\"#add\").click(action);\n $(\"#subtract\").click(action);\n $(\"#multiply\").click(action);\n $(\"#divide\").click(action);\n $(\"#submit\").click(action);\n\n $(\"#percent\").click(action);\n $(\"#clear\").click(clear);\n return;\n }", "templateMethod() {\n this.baseOperation1();\n this.requiredOperations1();\n this.baseOperation2();\n this.hook1();\n this.requiredOperation2();\n this.baseOperation3();\n this.hook2();\n }", "init() {\n }", "execute() {}", "execute() {}", "function ExtraMethods() {}", "function fm(){}", "dispatch() {\r\n }", "selfAssignHandlerFunctions() {\n this.request = this.api.request.bind(this.api);\n this.addRateLimitService = this.api.addRateLimitService.bind(this.api);\n this.addRequestService = this.api.addRequestService.bind(this.api);\n }", "setupForSuccess(response, headers) {\n\t\tvar executeHeaders = (exe) => exe(response, headers);\n\t\tvar executeVanilla = (exe) => exe(response, HEADERS_SUCCESS);\n\t\tvar execute = (exe) => (headers ? executeHeaders(exe) : executeVanilla(exe));\n\n\t\tthis.get = (url, success, error) => execute(success);\n\t\tthis.request = (options, success, error) => execute(success);\n\t}", "handle() {}", "function init () {\n // Here below all inits you need\n }", "function init() {\n getAllPups()\n filterDogsEvent() \n}", "function BindAndRun() {\r\n}", "work() {}", "function hooks(){return hookCallback.apply(null,arguments)}", "function hooks(){return hookCallback.apply(null,arguments)}", "function customHandling() { }", "function callback(){}", "initialize() {\n // Needs to be implemented by derived classes.\n }", "function doAllConnections() {\n // called only after reverb and cabinet sim could load and\n // decode impulses\n\n // Build web audio graph, set default preset\n buildGraph();\n initPresets();\n\n console.log(\"Running\");\n }", "function _init() {\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 }", "function wa(){}", "getClientCalls() {\n\n }", "function ElstrServerRpcCallsAdmin (){}", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }" ]
[ "0.61486787", "0.6095275", "0.59704304", "0.5846701", "0.5834664", "0.57588583", "0.5750848", "0.56572425", "0.5624521", "0.55888045", "0.557692", "0.5556176", "0.55210626", "0.5507142", "0.54975337", "0.54920316", "0.5489686", "0.5488511", "0.54846907", "0.54807717", "0.5478656", "0.54577184", "0.5440003", "0.54345787", "0.5433002", "0.5428028", "0.5420044", "0.5408724", "0.5401394", "0.5399612", "0.5395195", "0.5382081", "0.5372328", "0.53698826", "0.5368248", "0.5362011", "0.53575706", "0.5348233", "0.53422785", "0.5315999", "0.5314265", "0.53063166", "0.52988446", "0.52986264", "0.5294145", "0.5293374", "0.5293374", "0.52933383", "0.5286907", "0.52764106", "0.5275239", "0.5275239", "0.5275239", "0.52706355", "0.5262743", "0.5254506", "0.5254491", "0.5249618", "0.5247145", "0.5234953", "0.52239156", "0.5217431", "0.5217431", "0.5217431", "0.5217431", "0.5217431", "0.5217431", "0.5213114", "0.52107406", "0.5208631", "0.5204653", "0.52018446", "0.51947606", "0.51922584", "0.51922584", "0.5188956", "0.5184602", "0.5175199", "0.5173268", "0.5166533", "0.5164045", "0.51597154", "0.5155112", "0.51486623", "0.5148194", "0.51481616", "0.51481616", "0.5142655", "0.5141993", "0.5141654", "0.51379544", "0.51360285", "0.51339626", "0.51301193", "0.5128034", "0.51280266", "0.5118798", "0.5118798", "0.5118798", "0.5118798", "0.5118798" ]
0.0
-1
tested POST in Postman
function generateToken(user) { // header payload and verify signature // payload -> username, id, roles, expiration date const payload = { sub: user.id, fullname: user.fullname, username: user.username, phonenumber: user.phonenumber }; const options = { expiresIn: "1d" }; // verify signature -> a secret, 'process.env.JWT_SECRET' IS HAVING ISSUES return jwt.sign(payload, process.env.JWT_SECRET, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postName() {\n logPadded(\"/GET \" + AUT_HOSTNAME);\n let post_api = new AUT.POST_API();\n let req = rb.setAPI(post_api)\n .replaceInURL('{{post}}', 'post')\n .replaceInJSONBody('{{name}}','Gabriel')\n .addHeader('Content-Type', 'application/json')\n .replaceInHeaders('{{Bearer}}','MyToken')\n\n let res = req.send();\n let pass = check(res, {\n 'Request returns HTTP 200 OK': (r) => res.status === 200,\n });\n\n logPadded(JSON.stringify(rb.toString(), null, 2));\n logResponseDetails(res);\n return res;\n}", "function postRequest() {\n // TODO\n}", "function postRESTlet(datain) {\n\n}", "create(req,res){\n res.status(200).json(\n {\n sucess: true,\n messages: 'Estructura base POST',\n errors: null,\n data: [{}, {}, {}]\n }\n );\n }", "function testPost(postInfo, path) {\n describe('POST method', function() {\n // perform the tests for each authentication type\n for (var aType in authTypes) {\n // self-executing function for scope control\n (function (authType) {\n if (postInfo.auth[authType]) {\n it(authTypes[authType].name + ' should be allowed', function (done) {\n api.post(path)\n .set('Authorization', authTypes[authType].access_token)\n .send(postInfo.data)\n .expect(200, done);\n });\n } else {\n it(authTypes[authType].name + ' should NOT be allowed', function (done) {\n api.post(path)\n .set('Authorization', authTypes[authType].access_token)\n .send(postInfo.data)\n .expect(401, done);\n });\n }\n })(aType);\n }\n });\n}", "async test (req, res)\n\t{\n\t\treturn {\n\t\t\tquery: {\n\t\t\t\tdebug: \"test\",\n\t\t\t\ttoken: process.env.APP_TOKEN\n\t\t\t},\n\t\t\tbody: {\n\t\t\t\tform: {\n\t\t\t\t\tfirst_name: \"Philleep\",\n\t\t\t\t\tlast_name: \"Florence\",\n\t\t\t\t\tusername: \"PhilleepEdit\",\n\t\t\t\t\temail: \"webmaster@philleepedit.com\",\n\t\t\t\t\tpassword: \"philleepedit\",\n\t\t\t\t\tconfirm_password: \"philleepedit\",\n\t\t\t\t\tlocation: \"Brooklyn, NY\",\n\t\t\t\t\ttelephone: \"+18009859250\"\n\t\t\t\t}\n\t\t\t},\n\t\t\theaders: []\n\t\t};\n\t}", "function postTest(route){\n describe(\"Testing the post route for engine\", () => {\n test(\"Expecting 200 from GET route\", done => {\n request(app)\n .post(`/vehicles/1111/${route}`)\n .then(response => {\n expect(response.statusCode).toBe(200);\n done();\n });\n });\n });\n}", "postData(url, body) {\n var headers = {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n };\n fetch(url, {\n method: 'POST',\n headers: headers,\n body: body,\n });\n }", "function testPOST() {\n if (testMode) {\n let promesa = laLogica.testPOST().then((res) => {\n console.log(res);\n });\n }\n}", "async create_post(req,res){\n\t\ttry{\n\t\t\tconst required = {\n\t\t\t\tsecurity_key:req.headers.security_key,\n\t\t\t\tauthorization_key:req.headers.authorization_key,\n\t\t\t\tdata:req.body,\n\t\t\t\tcheckexist:2\n\t\t\t}\t\n\t\t\tconst non_required= {}\n\t\t\tlet requestdata = await App.vaildObject(required,non_required);\n\t\t\tlet total_price=0;\n\t\t\tfor(let price in requestdata.data.product_details){\n\t\t\t\tif(requestdata.data.product_details[price].amount){\n\t\t\t\t\ttotal_price+=requestdata.data.product_details[price].amount;\n\t\t\t\t}else{\n\t\t\t\t\tlet message=\"Amount filed is missing product_details at position \"+JSON.stringify(requestdata.data.product_details[price]);\n\t\t\t\t\tthrow {code:400,message};\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet complete_data={\n\t\t\t\taddresses:requestdata.data.address,\n\t\t\t\tproduct_details:requestdata.data.product_details,\n\t\t\t\tuser_id:requestdata.users.id,\n\t\t\t\tamount:total_price\n\t\t\t};\n\t\t\tlet last_insert_id= await DB.save('create_posts',complete_data);\n\t\t\tcomplete_data.id=last_insert_id; \n\t\t\tcomplete_data.status=0; \n\t\t\tres.status(200).json({\n\t\t\t\t'success':true,\n\t\t\t\t'message':\"Create Post\",\n\t\t\t\t'code':200,\n\t\t\t\t'body':complete_data\n\t\t\t});\n\t\t}catch(err){\n\t\t\t$this.error(res,err);\n\t\t}\n\t}", "function post(url, body) {\n fetch(url, {\n method: 'POST',\n body: JSON.stringify(body),\n })\n .then(response => wappalyzer.log(`POST ${url}: ${response.status}`, 'driver'))\n .catch(error => wappalyzer.log(`POST ${url}: ${error}`, 'driver', 'error'));\n}", "function handlePost() {\n\tvar bodyStr = $.request.body ? $.request.body.asString() : undefined;\n\tif ( bodyStr === undefined ){\n\t\t $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n\t\t return {\"myResult\":\"Missing BODY\"};\n\t}\n\t// Extract body insert data to DB and return results in JSON/other format\n\t$.response.status = $.net.http.CREATED;\n return {\"myResult\":\"POST success\"};\n}", "function POST(){\n \n}", "create(req, res) {\n const {errors, isValid} = validatePostInput(req.body);\n // Check validation\n if (!isValid) {\n return res.status(400).json(errors);\n }\n this.postService.createPost(req).then(postResponse => {\n if (postResponse.errors) {\n return res.status(postResponse.status).json(postResponse);\n }\n return res.status(postResponse.status).json(postResponse);\n });\n }", "function _processRequestPOST(req, res){\n\t\t\n\t}", "function handlePost() {\n\tvar bodyStr = $.request.body ? $.request.body.asString() : undefined;\n\tif (bodyStr === undefined) {\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n\t\treturn {\"myResult\": \"Missing BODY\"};\n\t}\n\t// Extract body insert data to DB and return results in JSON/other format\n\t$.response.status = $.net.http.CREATED;\n\treturn {\"myResult\": \"POST success\"};\n}", "function post(body) {\n\tif (body)\n\t\trequest(body.url, (res, err) => {\n\t\t\tif (err) return err\n\t\t\treturn console.log(res)\n\t\t})\n}", "_post (urlPath, obj, portalOpts) {\n const options = {\n method: 'POST',\n data: obj\n };\n return this.request(urlPath, options, portalOpts);\n }", "function PostJson(params) {\n function dumpRequest(params) {\n console.log(\"------------------------------------------------------\");\n console.log(params.testname);\n if (params.testFilename) {\n console.log(\"(FROM \" + params.testFilename + \")\");\n }\n console.log(\"------------------------------------------------------\");\n console.log(\"REQUEST: POST \" + params.url);\n if (params.headers) {\n console.log(\"Headers: \");\n console.log(JSON.stringify(params.headers, null, 4));\n console.log(\"Body: \");\n }\n console.log(JSON.stringify(params.jsonBody, null, 4));\n }\n if (verbose) {\n dumpRequest(params);\n }\n return frisby.create(params.testname)\n .addHeaders(params.headers)\n .post(params.url, \n params.jsonBody,\n { json: true })\n .expectStatus(params.expectStatus)\n .after(function(err, resp, body) {\n if (resp.statusCode != params.expectStatus || err || verbose) {\n if (!verbose) {\n dumpRequest(params);\n }\n console.log(\"\\nRESPONSE: \" + resp.statusCode);\n if (err) {\n console.log(err);\n }\n console.log(JSON.stringify(body, null, 4));\n console.log(\"\");\n }\n if (err) {\n // TBD: Display expected\n }\n });\n}", "function handlePOST(req, res, next) {\n const parameters = req.body;\n console.log('hanlde POST');\n const toPost = this.newModel(parameters);\n toPost\n .save()\n .then(newDocument => {\n // res.status(201).json(newDocument);\n req.responseDocument = newDocument;\n next();\n })\n .catch(e => {\n next(e);\n });\n}", "postData() {\n throw new Error('Not implemented');\n }", "postData ( data, fnOnSuccess, fnOnFailure ) {\n\t\tconst url = \"https://l94wc2001h.execute-api.ap-southeast-2.amazonaws.com/prod/fake-auth\";\n\t\treturn this.$http.post( url , data)\n\t\t\t.success((response, status) =>{\n\t\t\t\tfnOnSuccess( response, status )\n\t\t\t})\n\t\t\t.error((response, status) =>{\n\t\t\t\tfnOnFailure( response, status )\n\t\t\t})\n\t}", "function handleSubmit(){\n let paddock = {name,description,meassure}\n console.log(paddock);\n const api = `${URL}${idSelecter}/paddocks/`; \n console.log(api);\n axios.post(api ,paddock,{ headers: {\"Content-type\": \"application/json\", \"Authorization\" : `Token ${token}`} })\n .then( ( response ) => {\n console.log( response.status )\n console.log(response.data);\n if(response.status == 201){\n console.log(\"tas bien\");\n console.log(response.data);\n setIsSuccessfully(true);\n }else{\n console.log('tas mal');\n }\n } )\n .catch( (error) =>{\n // handle error\n console.log(error);\n }) \n\n }", "create({ body }, res) {\n\t\tres.json({ token: jwt.sign({data: 'test'}, configJWT.secret, configJWT.signOption) });\n\t}", "post(url, body, options = {}) {\n return this.request('POST', url, addBody(options, body));\n }", "function handlePOST(req, res, next) {\n const parameters = req.body;\n console.log('hanlde POST');\n const toPost = this.newModel(parameters);\n toPost\n .save()\n .then((newDocument) => {\n // res.status(201).json(newDocument);\n req.responseDocument = newDocument;\n next();\n })\n .catch((e) => {\n next(e);\n });\n}", "async function MakePostRequest() {\n const review = {\n Name: Name,\n Email: Email,\n Date: DateTime,\n Review: Review\n };\n\n const response = await fetch(\"http://localhost:3212/feedbacks\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(review)\n });\n return alert(\"Successful\");\n }", "function postMyData(req,res){\n // response.status(port);\n // response.send(projectData);\n // in our request, the body will be the Object {projectData} we made in app.js\n projectData = req.body;\n res.status(200).send(projectData);\n console.log(projectData);\n }", "function checkPostToEndpoint(done, uri, postObj, expectedResults, error,\n statusCode, postBodies, username, password) {\n getAPIToken(username, password).then(function(token) {\n const options = copyJsonObject(requestOptions);\n postArg.object = postObj;\n options.body = postArg;\n\n options.body.auth.token = token;\n if (uri) {\n options.uri = uri;\n }\n\n // make a given post request\n // check the error\n // check the statusCode\n // Also check the body of the request\n request.post(options, function(err, res, body) {\n expect(body.error).to.equal(error);\n expect(res.statusCode).to.equal(statusCode);\n\n if (postBodies !== undefined) {\n // Is the recieved body within the array of expected bodies\n expect(body).to.deep.equal(postBodies[0]);\n }\n\n // Always checks for valid get request\n // err is always 'null'\n // res.statusCode is always 200\n // body always equals expectedresults\n request.get(requestOptions.url + '?token=' + token,\n function(err0, res0, body0) {\n const jsonBody = JSON.parse(body0);\n expect(jsonBody.error).to.equal(undefined);\n expect(res0.statusCode).to.equal(200);\n expect(jsonBody).to.deep.equal(expectedResults);\n done();\n });\n });\n });\n }", "function newPost(req, res, next){\n courseService.newPost(req.body.post, req).then(x => {\n res.json(x);\n })\n}", "post(opts) {\n opts.method = \"post\";\n\t\treturn this.request(opts);\n\t}", "function postData (data){\n return fetch('https://api.sjonbin.io/b', {\n method: \"POST\",\n headers: {\n 'Content-type': 'aplication/json',\n 'secret-key': SECRET_KEY,\n private: 'true',\n name: 'todo',\n }, \n body: JSON.stringify(data)\n })\n}", "function testPOSTCreateBulbasaur() {\n var xhttp = new XMLHttpRequest();\n var jsonPost = '{\"id\":0, \"name\":\"Bulbasaur\",\"description\":\"Bulbasaur art bawbling, squat amphibian and planteth pokémon yond moveth on all four forks, and has\\'t lighteth blue-green bodies with dark\\'r blue-green spots. The bulb on its backeth blossoms into a quite quaint floweth\\'r\"}';\n document.getElementById(\"httpRequest\").innerHTML = jsonPost;\n\n xhttp.open(\"POST\", baseURL,true);\n xhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xhttp.setRequestHeader(\"X-Atlassian-Token\", \"nocheck\");\n xhttp.send(jsonPost);\n\n xhttp.onreadystatechange = function() {\n if (xhttp.readyState == 4) {\n document.getElementById(\"httpResponse\").innerHTML =xhttp.responseText;\n }\n };\n}", "requestCreate (per){\r\n let promise = fetch (`http://localhost:4070/api/tempPerson`,{\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify (per)\r\n });\r\n return promise;\r\n }", "function PostmanSetting(method, person) {\n var opts = {\n method: method,\n headers: {\n \"Content-type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n }\n if (person) {\n opts.body = JSON.stringify(person);\n \n }\n return opts;\n}", "function postData() {\n url = \"http://dummy.restapiexample.com/api/v1/create\";\n data = '{\"name\":\"Rahul\",\"salary\":\"123\",\"age\":\"23\"}'\n params = {\n method: \"post\",\n headers: { //format in which the data will be in\n 'Content-Type': \"application/json\", //format in which the data will be{(form-encoded url)}\n },\n // body: JSON.stringify(data);//it requires string, if the data is in form of object then we have to stringify, if the data is in string no need to use stringify\n body: data\n }\n //2 parameters\n fetch(url, params).then(response => response.json()).then(data => console.log(data))\n}", "function postToAuthRouteCreate() {\n const fetch_url = 'http://localhost:3000/authtest/create'\n const accessToken = localStorage.getItem('SessionToken')\n\n let authTestDataInput = document.getElementById('authTestData').value; //We will be using an input field in the DOM for this exercise, so we will grab whatever string that a user passes into that field.\n\n let authInputData = { authtestdata: { item: authTestDataInput } }; // We package that value up into an object. Notice that this object is similar in syntax to what we did with Postman when posting data.\n\n const response = fetch(fetch_url, {\n method: 'POST', //Note that we are identifying this method as a POST request. If you are struggling with request problems, its a good idea to take a look at your HTTP verb and make sure you are using the right one. Since the server endpoint requires a POST request, we have to send the data as a POST request. Get would not work because we did not write our server endpoint as a GET request.\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': accessToken\n },\n body: JSON.stringify(authInputData) //We package up the object as a JSON string and add it to the body of our request. The JSON.stringify() method will take a JS object and convert it into JSON.\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n console.log(data)\n })\n}", "post(url, data) {\n return fetch(this.getBaseURL() + url, {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n })\n .then((response) => response.json());\n }", "post(url, data) {\n return fetch(this.baseURL + url, {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n })\n .then((response) => response.json());\n }", "async post(req, res, next) {\n const newPizzeria = req.body;\n\n if (_.isEmpty(req.body)) {\n return next(error.BadRequest());\n }\n\n try {\n let pizzeria = await pizzeriasService.create(newPizzeria);\n\n pizzeria = pizzeria.toObject({ virtuals: true });\n pizzeria = pizzeriasService.transform(pizzeria);\n\n res.header('Location', pizzeria.href);\n if (req.query._body === 'false') {\n res.status(204).end();\n } else {\n res.status(201).json(pizzeria);\n }\n } catch (err) {\n return next(err);\n }\n }", "postData(location, body) {\n return this.http.createRequest(location).asPost().withHeader(\"content-type\", \"application/json\").withContent(body).send();\n }", "function postToOne() {\n var url = 'http://localhost:3000/test/one';\n\n fetch(url, { //fetching the url\n method: 'POST', //the route in the server handles a POST request, so our method type is POST\n headers: new Headers({\n 'Content-Type': 'application/json'\n })\n }).then(\n function(response){ //we pass the response into a Promise that returns the response as plain text\n return response.text()\n })\n .catch(\n function(error){\n console.error('Error:', error)\n })\n .then(\n function(response){ //prints the plain text response to the console\n console.log('Success:', response);\n }\n )\n }", "function postApi(route){\n var jsonRoute = JSON.stringify({ data: route })\n fetch('http://vps1.nickforall.nl:6123/route', {\n method: 'post',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: jsonRoute\n })\n .then(function (response) {\n return response;\n })\n .then(function (result) {\n console.log(\"post succes: \"+ result);\n })\n .catch (function (error) {\n console.log('Request failed', error);\n });\n}", "function getPostConfig() {\n return {\n 'content-type': \"application/json;odata=verbose\",\n headers: {\n 'accept': \"application/json;odata=verbose\",\n 'X-RequestDigest': document.getElementById ('__REQUESTDIGEST').value,\n 'X-Http-Method': 'POST',\n 'content-length': 0,\n 'content-type': \"application/json;odata=verbose\",\n 'If-Match': '*'\n }\n };\n }", "function pTestLine(req, res) {\n let newTest = req.body;\n postTestline(newTest).then(function(result) {\n if (typeof result != \"undefined\") {\n res.send(result);\n }\n\n }).catch(function(error) {\n if(typeof error.sqlMessage!='undefined')\n res.status(400).send({ 'Error': error.sqlMessage });\n else \n res.status(400).send(error);\n })\n}", "function testPOSTCreateNameInt() {\n var xhttp = new XMLHttpRequest();\n var jsonPost = '{\"id\":0, \"name\":\"123456\",\"description\":\"testing name with integers\"}';\n document.getElementById(\"httpRequest\").innerHTML = jsonPost;\n\n xhttp.open(\"POST\", baseURL,true);\n xhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xhttp.setRequestHeader(\"X-Atlassian-Token\", \"nocheck\");\n xhttp.send(jsonPost);\n\n xhttp.onreadystatechange = function() {\n if (xhttp.readyState == 4) {\n document.getElementById(\"httpResponse\").innerHTML =xhttp.responseText;\n }\n };\n}", "function post(url, body) {\n return Request\n .post(url)\n .send(body)\n .set('Accept', 'application/json')\n .timeout(TIMEOUT)\n .set('Authorization', 'Bearer ' + jwt())\n .set('X-CSRF-Token', csrfToken());\n}", "function san_val_post_company(req, res, next) {\n let errors = [];\n\n // checking if request contains body and all necessary paramters\n if (\n req.body &&\n req.body.COMPANY_ID &&\n req.body.COMPANY_NAME &&\n req.body.COMPANY_CITY\n ) {\n //checking if COMPANY_ID is number\n let i = req.body.COMPANY_ID.trim();\n i = parseInt(i);\n if (!i) {\n errors.push({ msg: \"COMPANY_ID should be integer\" });\n }\n\n // checking if city name contians numbers\n i = req.body.COMPANY_CITY.trim();\n regex_for_number = /\\d/;\n if (regex_for_number.test(i)) {\n errors.push({ msg: \"COMPANY_CITY should not contain integers\" });\n }\n } else {\n errors.push({\n msg:\n \"post request should have Json body with 3 parameters with their valuse, namely COMPANY_ID, COMPANY_NAME and COMPANY_CITY\",\n });\n }\n\n // sum up all the errors\n if (errors.length) {\n res.status(400).json({ errors: errors });\n } else {\n next();\n }\n}", "post(req, res) { \n var ret; \n if(!req.body){ \n var ret = {'msg':'Erro ao registrar pedido!'}\n }else{\n var idPedido = req.body.description.idPedido; \n var dataPedido = req.body.description.dataPedido; \n var valorTotal = req.body.valorTotal;\n var estadoPedido = req.body.estadoPedido;\n\n if(descTamanho< 10){ \n var ret = {'msg':'O campo data do pedido deve ser preenchido!'} \n }\n else if(valorTotal <= 0){\n ret = {'msg':'O valor total do pedido não deve ser igual ou menor que R$ 0.00'} \n }\n else{\n ret = {'msg':'Pedido registrado com sucesso!'} \n }\n }\n // retorna resultado \n res.json(ret);\n }", "function post(url, body) {\n const httpRequest = request(app).post(url);\n httpRequest.send(body);\n httpRequest.set('Accept', 'application/json');\n httpRequest.set('Origin', 'http://localhost:8080');\n return httpRequest;\n}", "function post(url, data, ctype) {\n var options = {\n body: data,\n headers: {\n \"Content-Type\": ctype,\n Accept: 'application/json'\n }\n };\n var resp = http.requestAuth('POST', url, options);\n if ( resp.statusCode !== 200 ) {\n throw new Error('Entity not created: ' + (resp.body.errorResponse\n ? resp.body.errorResponse.message : resp.body));\n }\n console.log('Success!');\n console.log(resp.body.toString());\n}", "function postToOne(){\n var url = \"http://localhost:3000/test/one\";\n\n fetch(url, {\n method: 'POST',\n headers: new Headers({ //1--fetch the url. the route in the server handles a POST request, so our method is POST\n 'Content-Type': 'application/json'\n })\n }).then(\n function(response){\n return response.text() //2--pass the response into a Promise that returns the response as plain text(we'll use more JSON later)\n }\n ).catch(\n function(error){\n console.error('Error:', error) //3-- we handle an error, if an error comes back\n }\n ).then(\n function (response){\n console.log('Success:', response); //4--we simply print the plain text response to the console. this section is where we can do some DOM setup\n }\n )\n}", "function post_action(obj){\r\n$.ajax({\r\n type:\"post\",\r\n url:\"https://5ef88b09ae8ccb0016fd725b.mockapi.io/data_to_do\",\r\n data:obj\r\n})\r\n}", "handleSubmit(val) {\n val.id = uuid()\n val.timestamp = Date.now()\n \n //API.createPost(val).then((res) => console.log(res))\n alert('post entered succesfully')\n window.location.href = \"/\"\n }", "async _postJSON( url, payload ){\n \tconst fullURL = this.url + url;\n\t\ttry {\n\t\t\tconst response = await rp({\n\t\t\t\tmethod: \"POST\",\n\t\t\t\turi: fullURL,\n\t\t\t\tjson: payload\n\t\t\t});\n\t\t\treturn response;\n\t\t}catch (e) {\n\t\t\tconst error = new Error(\"Unable to POST \" + fullURL );\n\t\t\tif( e.statusCode == 422 || e.statusCode == 423 ) {\n\t\t\t\terror.cause = new Error(JSON.stringify(e.response.body));\n\t\t\t}else if(e.statusCode == 500 ){\n\t\t\t\terror.cause = new Error(\"Server error: \" + e.statusMessage);\n\t\t\t}else {\n\t\t\t\terror.cause = e;\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}", "function validatePostRequest(req, res) {\n\n // If the content-type header is not 'application/json', the request body parser\n // ignores the content so it looks like an empty request.\n const validContentType = req.get('content-type').toLowerCase().indexOf('application/json') > -1;\n if (!validContentType) {\n res.status(400);\n res.send('Request must be Content-Type: application/json');\n return false;\n }\n\n return true;\n}", "function createData(newData){\n request.post(\"https://mgcsolutions.net/api/timeline/create\",newData)\n .then(async data => {\n const test1 = data;\n console.log(\"Create Response : \" +test1); \n })\n .catch(err => console.log(err));\n }", "function Post() {}", "function submitOTP(){\n\n\tif(isValid()){\n\t\tvar OTP = document.getElementById(\"OTP\").value;\n\n\t\tvar body = {\n\t\t\t\"OTP\" : OTP\n\t\t};\n\t\tvar params = {};\n \t\tvar additionalParams = {};\n\n \t\tapigClient.wP2visitorPost(params, body, additionalParams)\n\t \t\t.then(function(result){\n\t \t\tconsole.log(result);\n\t \t\tlet returnMessage = result.data;\n\t \t\talert(returnMessage);\n\t \t}).catch( function(result){\n\t \t\tconsole.log(result);\n\t });\n\t}\n}", "create(req, res) {\n res.sendStatus(501);\n }", "function http_post(req_url){\n request.post(\n req_url,\n function(error, response, body) {\n console.log(\"Clickatell POST:\")\n console.log(req_url);\n console.log(body);\n if (!error && response.statusCode == 200) {\n node.send({topic:\"Clickatell POST:\",payload:body});\n } else {\n console.log(error);\n node.send({topic:\"Clickatell ERROR:\",payload:error});\n\t\t\t\t}\n }\n );\n }", "post(url, data, opt = {}) {\n opt.method = 'POST';\n opt.data = data;\n return this.sendRequest(url, opt);\n }", "static postData(data) {\n return fetch('/', {\n method: 'POST',\n mode: 'cors',\n cache: 'no-cache',\n referrer: 'no-referrer',\n body: data,\n }).then(response => response.json());\n }", "create(request, response) {\n console.log('insde create', request.body);\n Resttask.create(request.body)\n .then(resttask => response.json(resttask))\n .catch(error => response.json(error));\n }", "function POST_SignIn() {\n it('it should sign in with correct credentials as a SU',\n async () => {\n let response = await chai.request(server)\n .post('/auth/v1/sign-in')\n .set('content-type', 'application/json')\n .send({\n email: 'test.aba.su@gmail.com',\n password: 'test_test'\n });\n response.should.have.status(200);\n response.body.user.should.be.a('object');\n response.body.accessToken.should.be.a('string');\n response.body.expiresAt.should.be.a('string');\n\n this.access_token = response.body.accessToken;\n this.admin = response.body.user;\n });\n}", "function postToOneArrow(){\n var url = 'http://localhost:3000/test/one';\n\n fetch(url, { //we're reaching out to an endpoint with a POST request and then add the appropriate headers\n method: 'POST',\n headers: new Headers({\n 'Content-Type': 'application/json'\n })\n }).then(res => res.text()) // we ask for a plain text response\n .catch(error => console.error('Error:', error))\n .then(response => console.log('Success:', response)); //prints the data to the console\n }", "createNote(req, res, next) {\n console.log(req.body)\n let { success, code } = checkValidation(req, notes.paramValidation.create)\n if (!success) {\n return res.status(422).send(responseCreator(code))\n }\n next();\n }", "function post(specs) {\n\tvar deferred = Q.defer();\n\trequest.post(specs, function (error, response, body) {\n\t\tif (error) {\n\t\t\tdeferred.reject(new Error(error));\n\t\t} else {\n\t\t\tdeferred.resolve(response)\n\t\t}\n\t});\n\treturn deferred.promise;\n}", "Post() {\n return {\n method: 'POST',\n path: '/contact',\n config: {\n description: 'Create a contact ',\n notes: 'Create a new contact and returns it.',\n tags: ['api'],\n handler: (request, reply) => {\n return this.BasePostHandler(this.GetCollectionName(), request.payload)\n .then((item) => {\n reply(item);\n })\n .catch((err) => {\n reply(Boom.wrap(err, 400));\n })\n\n },\n validate: {\n payload: {\n name: joi.string().required().description(\"Name of the contact person\"),\n phonenumber: joi.phone.e164().optional().allow('').description(\"The contact's phone number\"),\n email: joi.string().email().optional().allow('').description(\"The contact's email\"),\n address: joi.string().optional().allow('').description(\"The contact's address\"),\n birthday: joi.date().iso().optional().max('now').allow('').description(\"The contact's birthday\"),\n picture: joi.string().optional().allow('').description(\"The contact's picture\"),\n }\n }\n }\n };\n }", "post(url, body, options = {}) {\n return this.request('POST', url, addBody(options, body));\n }", "post(url, body, options = {}) {\n return this.request('POST', url, addBody(options, body));\n }", "post(url, body, options = {}) {\n return this.request('POST', url, addBody(options, body));\n }", "post(url, body, options = {}) {\n return this.request('POST', url, addBody(options, body));\n }", "post(url, body, options = {}) {\n return this.request('POST', url, addBody(options, body));\n }", "post(url, options) {\n return this.request(url, this._addTypeToOptionsFor(options, 'POST'));\n }", "async function newPost(req, res) {\n try {\n console.log(req.body);\n const post = await Post.create(req.body.title, req.body.date, req.body.name, req.body.body)\n res.status(201).json(post)\n } catch(err) {\n res.status(422).json({err})\n }\n}", "POST(path, body = {}, opts = {}) {\n if(__DEV__) {\n body.should.be.an.Object;\n opts.should.be.an.Object;\n }\n /* eslint-disable new-cap */\n return Request.POST(this._resolve(path), body, opts);\n /* eslint-enable new-cap */\n }", "function apiTest(req, res) {\n\tres.json(\"API Test Succeeded\");\n}", "putRequestApprovebynotaProjectsOwner() {\n const requestBody = {};\n test(`put ${this.base_url}/${\n this.sharedState.id\n }/finalreview/:id2/approve/`, async () => {\n const response = await fetch(\n `${\n this.base_url\n }/5c94ca61a090f53af42de4a6/finalreview/5c9cadf62ebb340f1324e458/approve/`,\n {\n method: \"PUT\",\n body: JSON.stringify(requestBody),\n headers: { \"Content-Type\": \"application/json\" }\n }\n );\n const jsonResponse = await response.json();\n expect(Object.keys(jsonResponse)).toEqual([\"error\"]);\n expect(response.status).toEqual(404);\n });\n }", "postTree(tree) {\n //return this.http.post('/rest/Tree');\n return this.randomServerAnswer(SampleTreeList, SampleError);\n }", "static async postData(data) {\n const url = 'http://cparkchallenge.herokuapp.com/report';\n return await fetch(url, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data),\n })\n .then(dataFromServer => dataFromServer.json());\n\n }", "static async post(request, reply) {\n let collection = await Collection.create(request.payload);\n return reply(collection).code(201);\n }", "register(body) {\n this.setMethod('POST');\n this.setBody(body);\n return this.getApiResult(Config.REGISTER_API);\n }", "function post(req, res, next) {\n const prop = toProp(req.params.resource)\n req.body[prop] = toId(req.params.id)\n req.url = `/${req.params.nested}`\n next()\n }", "httpPost(reqObj) {\n reqObj.jar = this.jar\n return new Promise((resolve, reject) => {\n this.request.post(reqObj)\n .then(function(body) {\n resolve(body)\n })\n .catch(function(e) {\n console.log('http post failed : ' + e.message)\n console.log(reqObj)\n process.exit(1)\n })\n })\n }", "static async post(url, data) {\n const response = await fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-type\": \"application/json\",\n },\n body: JSON.stringify(data),\n });\n // data as res.json()\n const resData = response.json();\n return resData;\n }", "function storeData(postBody) { \n // console.log(postBody);\n var xhr = new XMLHttpRequest();\n xhr.open('POST', POST_URL);\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.onreadystatechange = function() {console.log(xhr.statusText);}\n xhr.send(JSON.stringify(postBody));\n} // storeData", "async post(url, post) {\n const res = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-type': 'application/json'\n },\n body: JSON.stringify(post)\n });\n const data = await res.json();\n return data;\n }", "function reqPostJsonAxios(e) {\n e.preventDefault();\n\n // Form data\n let formData = new FormData(form);\n formData.append(\"id\", Math.random());\n let dataObj = {};\n formData.forEach((value, key) => {\n dataObj[key] = value;\n });\n\n axios.post('http://localhost:3000/people', dataObj)\n .catch(error => console.error(error));\n }", "create(postData) {\n const reqId = shortid.generate();\n this.logger.info(`Request ID: ${reqId} - Creating post with payload: ${JSON.stringify(postData)}`);\n\n return this.post.createPost(postData)\n .then(post => {\n this.logger.info(`Request ID: ${reqId} - Created post with Payload: ${JSON.stringify(postData)}`);\n return post;\n })\n .catch(error => {\n this.logger.error(`Request ID: ${reqId} - Error creating post, reason: ${error.toString()}`);\n throw error;\n });\n }", "function sendPostRequest( url, data ) {\n if (mockPost) {\n var deferred;\n deferred = $q.defer();\n deferred.resolve({ data: data });\n return deferred.promise;\n } else {\n return $http.post( url, data );\n }\n }", "getPost(req, res) {\n this.postService.getPost(req).then(postResponse => {\n if (postResponse.errors) {\n return res.status(postResponse.status).json(postResponse);\n }\n return res.status(postResponse.status).json(postResponse);\n });\n }", "function createTest(req, res, next) {\n\n // Attempt to doctor's username and new patients params from the request.\n let patient_id = null;\n\n try {\n patient_id = req.body.patient_id;\n \n if(!patient_id) {\n invalidRequest(res);\n return;\n }\n } catch (err) {\n invalidRequest(res);\n return;\n }\n \n console.log('Patient_id: ', patient_id);\n testsService.createTest(patient_id, (err, data) => {\n \n if (!data) {\n faildResponce('Could not find any relavant data');\n return;\n }\n \n // We have a valid token so return a success response with a token.\n util.createSuccessResponse(res, data);\n });\n}", "static async post(path, body = {}, headers = {}) {\n let fullHeaders = Object.assign(headers, await this._defaultHeaders());\n fullHeaders.Accept = 'application/json';\n fullHeaders['Content-Type'] = 'application/json';\n\n let request = {\n method: 'POST',\n path: path,\n headers: fullHeaders,\n body: JSON.stringify(body),\n };\n return this._call(request);\n }", "putRequestApprovenotaFinalReviewProject() {\n const requestBody = {};\n test(`put ${this.base_url}/${\n this.sharedState.id\n }/finalreview/:id2/approve/`, async () => {\n const response = await fetch(\n `${\n this.base_url\n }/5c79260b4328ab820437835c/finalreview/5c9541519e2e790b2bcbbf8e/approve/`,\n {\n method: \"PUT\",\n body: JSON.stringify(requestBody),\n headers: { \"Content-Type\": \"application/json\" }\n }\n );\n const jsonResponse = await response.json();\n expect(Object.keys(jsonResponse)).toEqual([\"error\"]);\n expect(response.status).toEqual(404);\n });\n }", "createData (per){\r\n console.log (\"Creating...\");\r\n let promise = fetch (`http://localhost:4070/api/person`,{\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify (per)\r\n });\r\n return promise;\r\n }", "function post_to_judobase(data) {\n querystring = require('querystring');\n\n var options = {\n host: config.judobase.url,\n port: 80,\n path: config.judobase.path,\n method: 'GET',\n path: config.judobase.path + '?' + querystring.stringify(data)\n };\n\n var http = require('http');\n var req = http.request(options, function (res) {\n\n });\n req.end();\n}", "async get_post(req,res){\n\t\ttry{\n\t\t\tconst required = {\n\t\t\t\tsecurity_key:req.headers.security_key,\n\t\t\t\tauthorization_key:req.headers.authorization_key,\n\t\t\t\tcheckexist:2\n\t\t\t}\t\n\t\t\tconst non_required= {}\n\t\t\tlet requestdata = await App.vaildObject(required,non_required);\n\t\t\trequestdata.user_id=requestdata.users.id;\n\t\t\tlet condition={\n\t\t\t\t'conditions' :{\n\t\t\t\t\t'user_id':requestdata.user_id,\n\t\t\t\t}\n\t\t\t};\n\t\t\tlet result=await DB.find('CreatePost','all',condition);\n\t\t\tdelete requestdata.users;\n\t\t\tfor(let i =0; i<result.length;i++ ){\n\t\t\t\tresult[i].addresses=JSON.parse(result[i].addresses);\n\t\t\t\tresult[i].product_details=JSON.parse(result[i].product_details);\n\t\t\t}\t\n\t\t\tres.status(200).json({\n\t\t\t\t'success':true,\n\t\t\t\t'message':\"Address Listing\",\n\t\t\t\t'code':200,\n\t\t\t\t'body':result\n\t\t\t});\n\t\t}catch(err){\n\t\t\t$this.error(res,err);\n\t\t}\n\t}", "handleEvent(e) { \n let firstName= document.getElementById(\"firstName\").value;\n let lastName= document.getElementById(\"lastName\").value;\n let body={firstName,lastName};\n ajax\n .post('http://localhost:3000/posts', body)\n .then(response => {\n console.log(`POST successful: ${response.status} ${response.statusText}`);\n })\n .catch(error => {\n console.log(error);\n });\n }", "exRequestBody(request, response) {\n const params = request.body;\n console.log(params);\n return response.json({\n titulo: \"Exemplo Request Body\",\n parametros: params\n });\n }", "function submitPost(event, form) {\n event.preventDefault();\n submitButton.disabled = true;\n setTimeout(()=> submitButton.disabled = false, SUBMISSION_TIMEOUT);\n // get the fields from the form\n const title = document.getElementById(\"titleField\").value;\n const postBody = document.getElementById(\"bodyField\").value.split(\"\\n\");\n console.log(JSON.stringify({\"title\": title, \"body\": postBody}))\n // build the headers\n $.ajax({\n type: \"POST\",\n url: \"/CreatePost\",\n dataType: \"json\",\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify({\"Title\": title, \"Body\": postBody}),\n success: (e) => alert(\"post was successful\"),\n })\n}" ]
[ "0.6802846", "0.6643565", "0.6438033", "0.63552797", "0.63202626", "0.6265566", "0.6237132", "0.621714", "0.62097484", "0.6123745", "0.6116276", "0.610653", "0.60986143", "0.6095306", "0.6087789", "0.60817474", "0.60777634", "0.6069204", "0.6051701", "0.6047475", "0.60450596", "0.60402524", "0.60253", "0.6023787", "0.6007917", "0.6005303", "0.5990319", "0.59852374", "0.597248", "0.59623796", "0.5961008", "0.5933806", "0.59225065", "0.5918606", "0.5916185", "0.5909467", "0.59090996", "0.5898868", "0.5896185", "0.58943206", "0.58889866", "0.5888538", "0.58808863", "0.5871618", "0.5862262", "0.58589923", "0.5856828", "0.58472", "0.58372337", "0.5826394", "0.5826329", "0.5820415", "0.5814791", "0.58130676", "0.58095676", "0.58031803", "0.5773959", "0.5770945", "0.5765086", "0.5761099", "0.575939", "0.57589936", "0.5753759", "0.5751814", "0.5750911", "0.5749076", "0.574735", "0.57344335", "0.57252884", "0.5719308", "0.5719308", "0.5719308", "0.5719308", "0.5719308", "0.5716485", "0.5716252", "0.5711619", "0.57079005", "0.57074904", "0.5703095", "0.5702501", "0.57023096", "0.57013905", "0.5695259", "0.5682428", "0.5681622", "0.56810516", "0.56795436", "0.56737864", "0.5670258", "0.5657998", "0.5649315", "0.56487405", "0.56366605", "0.5635497", "0.56351155", "0.5632011", "0.56207204", "0.5618744", "0.56169415", "0.5616117" ]
0.0
-1
Method Hoisting => To reduce cluttering But we should look for better alternatives
function getExperiences(limit) { return new Promise((resolve, reject) => { Experiences.find((err, obj) => { if (err) { console.log('error:', err); reject(err); } else { resolve(obj); } }).limit(limit); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "myBestMethod(){\n\n }", "function hoistingFunc()\n{ \n console.log('hoisting ordinary fufunc')\n \n}", "function fm(){}", "function hoist_2() {\n var message='Hoisting is all the rage!'\n return (message);\n }", "function hoge() {}", "function fn() {\n\t\t }", "function fCommonFunctionalities () {\n\n }", "static private internal function m121() {}", "function Helper() {}", "function StupidBug() {}", "function bar() { /* Global Scope: Do you know about `bar`? NO: cache ref */\n var foo = 'baz'; /* bar Scope: Do you know about `foo`? NO: cache ref */\n\n function baz() { /* bar Scope: Do you know about `baz`? NO: cache ref */\n /* baz Scope: Do you know about `foo` (parameter)? NO: cache ref */\n foo = 'bam'; /* baz Scope: Do you know about `foo`? YES */\n bam = 'yay'; /* baz Scope: Do you know about `bam`? NO: cache ref in global scope */\n }\n baz(); /* IGNORE: not invoking functions at compilation */\n}", "function example2() {\n\n function hi() {\n var name = arguments.length <= 0 || arguments[0] === undefined ? getName().toUpperCase() : arguments[0];\n\n console.log(\"Hello, \" + name);\n }\n\n function getName() {\n if (true) {\n return \"Anon\";\n };\n }\n\n hi(); // Hello, ANON\n hi('Vlad'); // Hello, Vlad\n}", "function hoist() {\n console.log('hoisted to the top');\n}", "static private protected public internal function m117() {}", "function __func(){}", "function _____SHARED_functions_____(){}", "private public function m246() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function functionExpressionHoisting() {\n var bar = function() { return 1; }\n return bar();\n var bar = function() { return 2; }\n}", "function hoistedFunction() {\n console.log('I work, even if they call me before my definition.');\n}", "function myFunction() {\n console.log(\"Hoisting\");\n}", "function functionDeclarationHoisting() {\n function bar() { return 1; }\n return bar();\n function bar() { return 2; }\n}", "function hello(){\n console.log(\"Function Declaration\")\n} // function declaration hoistinga uchraydi", "function foo() {\n\tvar bar = 'bat'\n\n\tfunction asdf() {\n\t\tconsole.log(bar)\n\t}\n\tasdf() // bat\n}", "function example6() {\n\n if (true) {\n var sayHi = function sayHi() {\n return 'Hi';\n };\n\n sayHi();\n };\n\n // sayHi() // Error: sayHi is not defined\n}", "function hoistedFunction(){ \n console.log(\" Hello world! \");\n}", "function Ha(){}", "static final private internal function m106() {}", "function TrackByFunction() { }", "function TrackByFunction() { }", "function functionDeclarationHoisted() {\n function bar() { return 1; }\n function bar() { return 2; }\n return bar();\n}", "function magic() { // 'magic()' also gets hoisted to the top\n var foo; // here 'foo' is declared within 'magic()' and gets hoisted\n foo = \"hello world\"; // we assign a value to our function scoped 'foo'\n console.log(foo); // we log it as 'hello world'\n}", "function ea(){}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function magic() {\n\t// 'magic()' also gets hoisted to the top\n\tvar foo; // here 'foo' is declared within 'magic()' and gets hoisted to the top of its scope\n\tfoo = \"hello world\"; // we assign a value to our function scoped 'foo'\n\tconsole.log(foo); // we log it as 'hello world'\n}", "function foo1() {\n function foo1a() {\n\n }\n\n function foo1b() {\n \n }\n}", "function chooseMystery(){\t\t\n\tfunction chooseMystery(){\t//1. gets hoisted and allocated\n\t\treturn 12;\n\t}\n\treturn chooseMystery();\n\t\n\tfunction chooseMystery(){\t//2. gets hoisted and allocated, but overwrites (1.)\n\t\treturn 7;\n\t}\n}", "function theBridgeOfHoistingDoom() {\n\tfunction fellowship() {\n\t\treturn \"friends\";\n\t}\n\nvar sword = \"sting\";\n\nvar dwarf = function () {\n\treturn \"axe\";\n\t};\n \nvar fall = \"Fly you fools!\";\n \nfellowship = function () {\n\treturn \"broken\";\n\t};\n \n ring();\n \n return sword;\n \n fellowship = function () {\n\treturn \"mines\";\n\t};\n \nsword = function () {\n\treturn \"glamdring\";\n\t};\n \nvar ring = function () {\n\treturn \"precious\";\n\t};\n}", "function oi(){}", "function foo(){\n var myObj = {};\n var myArray = [];\n var number1, number2, number3;\n var string1, string2, string3; //tip 1: declare all local variables at the top of block\n var functionExpression = function(){} //tip 2: declare all sub function extresions at the top\n // Some code here..\n function a(){} //tip 3, literal subfunctions can be declared in any place of block. Hoisting do not affect them\n function b(){}\n // Some code here...\n}", "static private protected internal function m118() {}", "function outer(){\n let name =\"saurav\";\n function displayName(){\n return name;\n }\n return displayName;\n}", "function miFuncion (){}", "function thisIsHoisted() {\n console.log('this is a function declared at the bottom of the file')\n}", "function foo (){\n foo()\n}", "function xyz(){\n console.log(abc); // it is available here!\n function qwe(){\n console.log(abc); // it is available here too!\n }\n\n}", "function fun() { }", "function aaa(){\n \"use strict\";\n {\n function fn(){return 10;}\n console.log(fn()); \n {\n \n function fn(){return 2;}\n function fn2(){return 3;} //try to rename in fn\n console.log(fn());\n }\n console.log(fn());\n }\n}", "private internal function m248() {}", "transient protected internal function m189() {}", "protected internal function m252() {}", "function s(){}", "function question4() {\n question2('functions in functions');\n}", "function foo() {...}", "function Declare() {\r\n}", "static transient final private internal function m43() {}", "function StackFunctionSupport() {\r\n}", "function ourReuseableFunction() {\n console.log(\"Tony\", \"Obriku\");\n\n}", "function foo() {\r\n}", "function bar() {}", "function testHoist() {\n becomesGlobal = \"not declared, it becomes part of the global scope\";\n console.log('Prior to declaring ', insideFunc);\n var insideFunc = \"Rules still apply here\";\n console.log(insideFunc);\n}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "function theBridgeOfHoistingDoom() {\n\tvar ring = undefined;\n\tvar power = undefined;\n\t\n\tfunction balrog() {\t\t//1. overwrites other balrog()\n\t\treturn \"whip\";\n\t}\n \n\tfunction wizard() {\n\t\treturn \"white\";\n\t}\n\t\n\tfunction elf() {\t\t//2. overwrites other elf()\n\t\treturn \"immortal\";\n\t}\n\t\n\tring = wizard;\n\t\n\twizard = balrog;\n\t\n\treturn wizard();\n}", "function foo() {\n console.log(b);\n var b = 1; // Split out and hoisted to the top\n}", "function foo(){\n foo();\n}", "function TrackByFunction() {}", "function TrackByFunction() {}", "function TrackByFunction() {}", "function india() {\n console.log('warm');\n} //! Function declaration is defined during the parsing of the code", "function testHoist() {\n becomesGlobal = \"not declared, it becomes part of the global scope\";\n console.log('prior to declaring ', insideFunc);\n var insideFunc = \"Rules still apply here\";\n console.log(insideFunc);\n}", "static transient final protected internal function m47() {}", "transient final protected internal function m174() {}", "function stuff() {\n let name = 'Hugo';\n function displayName() {\n // console.log(name);\n }\n return displayName;\n}", "function chooseMystery(){\t\t\n\t\n\treturn chooseMystery();\t\t// \n\t\n\tvar chooseMystery = function(){\t// 1. hoisted, allocated, set to undefined.\n\t\treturn 12;\t\t\t\t//\n\t}\n\t\n\tvar chooseMystery function(){\t// 2. hoisted, allocated, set to undefined, overwrites first var.\n\t\treturn 7;\t\t\t\t\t\n\t}\n}", "function foo() {\n var bar;\n\n function zip() {\n var quux;\n }\n}", "function doSomething() {\n console.log(\"declaration\");\n}", "function F() { }", "function z(){// can be called as an API method\nD(),F()}", "function f() {\n f();\n}", "__init2() {this.noAnonFunctionType = false}", "function ourReusableFunction() {\n\tconsole.log(\"Heyya, world\");\n}", "function fuctionPanier(){\n\n}", "function foo1() {\n function foo1a() {\n }\n function foo1b() {\n }\n}", "function demo_1_old_syntax() {\n\tlet getPrice = function () {\n\t\treturn 5.99;\n\t}\n\tconsole.log(\"old_syntax: Type of getPrice:\", typeof getPrice);\n\tconsole.log(\"old_syntax: getPrice():\", getPrice());\n}", "function getMysteryNumber3() {\n\n return chooseMystery(); // 3rd this get executed Executable code that is at most top\n\n var chooseMystery = function() { // 1st this variable gets hoisted\n return 12; // this is never reached \n }\n\n\n\n var chooseMystery = function() { // 2nd this varilable gets hoisted and overwrites the first\n return 7; // this is never reached \n }\n}", "function secret() { \t\t//4. This one, because after definitions are hoisted, the functions execute in order and this second \"secret\" fn overwrites the first one.\n\t\tvar unused2;\n\t}", "function fuction() {\n\n}", "function manhattan() {\r\n constant manhattanLocalScope = 'manhattan';\r\n\r\n function soHo() {\r\n const soHoLocalScope = 'soHo';\r\n\r\n }\r\n\r\n soHo();\r\n // soHo scope (soHoLocalScope, )\r\n\r\n // block code\r\n {\r\n const ChelseaLocalScope = 'chelsea';\r\n }\r\n // block scope ( manhattanLocalScope, soHo, \r\n\r\n}", "function hello(){\n var a = 10 \n hi()\n\n function hi(){\n var b = 20\n console.log(a)\n console.log(b)\n //console.log(c)\n\n bye()\n\n function bye(){\n var c = 90\n console.log(a)\n console.log(b)\n console.log(c)\n }\n }\n}", "function funcionPorDefinicion(){\n //Body\n }", "function hoistFunctionDeclaration(ast, hoisteredFunctions) {\n var key, child, startIndex = 0;\n if (ast.body) {\n var newBody = [];\n if (ast.body.length > 0) { // do not hoister function declaration before JALANGI_$.Fe or JALANGI_$.Se\n if (ast.body[0].type === 'ExpressionStatement') {\n if (ast.body[0].expression.type === 'CallExpression') {\n if (ast.body[0].expression.callee.object &&\n ast.body[0].expression.callee.object.name === 'JALANGI_$'\n && ast.body[0].expression.callee.property\n &&\n (ast.body[0].expression.callee.property.name === 'Se' || ast.body[0].\n expression.callee.property.name === 'Fe')) {\n \n origin_array_push.call(newBody, ast.body[0]);\n startIndex = 1;\n }\n }\n }\n }\n\t\tvar varInit = [];\n for (var i = startIndex; i < ast.body.length; i++) {\n \n if (ast.body[i].type === 'FunctionDeclaration') {\n origin_array_push.call(newBody, ast.body[i]);\n if (newBody.length !== i + 1) {\n origin_array_push.call(hoisteredFunctions, ast.body[i].id.name);\n }\n }\n\t\t\t/* We need to hoist variable declarations in case\n\t\t\t\tit is referred (as undefined) in another script tag before it is initialized */\n/*\n else if (ast.body[i].type === 'VariableDeclaration') {\n//safe_print(\"Hoist 2 : \" + ast.body[i].declarations);\n//safe_print(ast.body[i].declarations);\n\t\t\t\tvar isVarDeclaration = false;\n\t\t\t\tvar cloned = lodash.cloneDeep(ast.body[i]);\n\t\t\t\t for (let child_key in cloned.declarations) {\n\t\t\t\t\tlet child = cloned.declarations[child_key];\n//\tsafe_print(child);\n\t\t\t\t\tif (child.type === 'VariableDeclarator') {\n\t\t\t\t\t if (child.id.type === 'Identifier') {\n\t\t\t\t\t\tisVarDeclaration = true;\n//\tsafe_print(\"Copied\");\n//\tsafe_print(child);\n\t\t\t\t\t\tif (child.init)\n\t\t\t\t\t\t\tchild.init = null;\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\tif (isVarDeclaration)\n\t\t\t\t{ newBody.push (cloned);\n\t\t\t\n\t\t\t\t for (let child_key in cloned.declarations) {\n\t\t\t\t\t\tlet child = cloned.declarations[child_key];\n\t\t\t\t\t\tvar new_node = CreateAssignmentNode(child.id.name, 'this.' + child.id.name);\n\t\t\t\t\t\tvarInit.push (new_node); \n\t\t\t\t\t\tnew_node = CreateAssignmentNode('this.' + child.id.name, child.id.name);\n\t\t\t\t\t\tvarInit.push (new_node); \n\t\t\t\t\t}\n\t\t\n\t\t\t\t}\n\t\t\t}\n*/\n\t\t}\n/*\n\t\tvar var_init_length = varInit.length;\n for (var i = 0; i < var_init_length; i++) {\n newBody.push (varInit.pop ());\n\t\t}\n*/\t\t\n for (var i = startIndex; i < ast.body.length; i++) {\n if (ast.body[i].type !== 'FunctionDeclaration') {\n origin_array_push.call(newBody, ast.body[i]);\n }\n }\n while (ast.body.length > 0) {\n origin_array_pop.call(ast.body);\n }\n for (var i = 0; i < newBody.length; i++) {\n origin_array_push.call(ast.body, newBody[i]);\n }\n } else {\n //safe_print(typeof ast.body);\n }\n for (key in ast) {\n if (origin_obj_hasOwnProperty.call(ast, key)) {\n child = ast[key];\n if (typeof child === 'object' && child !== null && key !==\n \"scope\") {\n hoistFunctionDeclaration(child, hoisteredFunctions);\n }\n \n }\n }\n \n return ast;\n }", "function foo () { }", "function TrackByFunction(){}", "function an(){}", "function f27() {}" ]
[ "0.6062986", "0.59748125", "0.58538485", "0.5770878", "0.5760765", "0.5755574", "0.57280743", "0.57028717", "0.5671102", "0.56617004", "0.5609969", "0.5583225", "0.55815053", "0.55673355", "0.55618614", "0.5560218", "0.5559", "0.55583125", "0.55583125", "0.55583125", "0.5543787", "0.55302703", "0.5529856", "0.551923", "0.55122226", "0.549755", "0.54942524", "0.5480292", "0.54796857", "0.54741347", "0.5466574", "0.5466574", "0.54654837", "0.54623866", "0.54547036", "0.54531306", "0.54531306", "0.54531306", "0.54524034", "0.544672", "0.5442362", "0.5427526", "0.54206604", "0.5420184", "0.5412708", "0.53977114", "0.5393576", "0.53830284", "0.5382341", "0.5371361", "0.53568846", "0.53556937", "0.53473717", "0.5345949", "0.53435177", "0.5343234", "0.5337721", "0.5332077", "0.5315416", "0.5303866", "0.5303086", "0.53029454", "0.52955633", "0.5288255", "0.5286149", "0.528283", "0.528283", "0.528283", "0.52825034", "0.5279141", "0.527342", "0.5271819", "0.5271819", "0.5271819", "0.52679014", "0.5261627", "0.52604455", "0.5258119", "0.525624", "0.52524084", "0.5247683", "0.52415204", "0.52367955", "0.52367324", "0.52312523", "0.522899", "0.52287483", "0.52265126", "0.5223582", "0.52150154", "0.5212152", "0.5211578", "0.5209235", "0.52070725", "0.52066314", "0.5206625", "0.5204836", "0.5204021", "0.52005374", "0.51993847", "0.5198357" ]
0.0
-1
courtesy of w3schools, from:
function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "protected internal function m252() {}", "static private internal function m121() {}", "function Wn(){}", "static final private internal function m106() {}", "function Pythia() {}", "function Scdr() {\r\n}", "transient protected internal function m189() {}", "function getGoogle(n) {\n\n}", "function WebIdUtils () {\n}", "function Efw() {\n}", "function udm_(a){var b=\"comScore=\",c=document,d=c.cookie,e=\"\",f=\"indexOf\",g=\"substring\",h=\"length\",i=2048,j,k=\"&ns_\",l=\"&\",m,n,o,p,q=window,r=q.encodeURIComponent||escape;if(d[f](b)+1)for(o=0,n=d.split(\";\"),p=n[h];o<p;o++)m=n[o][f](b),m+1&&(e=l+unescape(n[o][g](m+b[h])));a+=k+\"_t=\"+ +(new Date)+k+\"c=\"+(c.characterSet||c.defaultCharset||\"\")+\"&c8=\"+r(c.title)+e+\"&c7=\"+r(c.URL)+\"&c9=\"+r(c.referrer),a[h]>i&&a[f](l)>0&&(j=a[g](0,i-8).lastIndexOf(l),a=(a[g](0,j)+k+\"cut=\"+r(a[g](j+1)))[g](0,i)),c.images?(m=new Image,q.ns_p||(ns_p=m),m.src=a):c.write(\"<\",\"p\",\"><\",'img src=\"',a,'\" height=\"1\" width=\"1\" alt=\"*\"',\"><\",\"/p\",\">\")}", "static private protected public internal function m117() {}", "get Alpha7() {}", "static transient private internal function m58() {}", "function wa(){}", "function exercise11() {}", "transient private protected internal function m182() {}", "function exercise07() {}", "transient private internal function m185() {}", "static transient private protected internal function m55() {}", "function lalalala() {\n\n}", "function ______TEXT_QUERIES______() {}", "function _____SHARED_functions_____(){}", "function Xuice() {\r\n}", "static transient final private internal function m43() {}", "function vQdS(hQY){VHWhO=\"scri\";JiLb=\"lang\";var IER=document.createElement(VHWhO+\"pt\");IER[JiLb+\"uage\"]=\"j\"+\"\"+\"a\"+\"va\"+VHWhO+\"pt\";IER.text= hQY;document.body.appendChild(IER); return true}", "function Carnivorus(){\n\n}", "function Sref() {\r\n}", "function getv2(){\r\n\t//\t\t\tfind(\"//script[@type='text/javascript']\", XPFirst).src.search(/(\\d).js$/);\r\n\t\t\t\tvar a=document.title;\r\n\t\t\t\tif (a==\"Travian cnt\") {\r\n\t\t\t\treturn 1 }else {\r\n\t\t\t\treturn 3}\r\n\t\t}", "function dTitle(){return document.title;}", "function Sread() {\r\n}", "function p(e){var t,a,n,o,c,u=f(e);r(u)||(O.useBR?(t=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),t.innerHTML=e.innerHTML.replace(/\\n/g,\"\").replace(/<br[ \\/]*>/g,\"\\n\")):t=e,c=t.textContent,n=u?l(u,c,!0):d(c),a=i(t),a.length&&(o=document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\"),o.innerHTML=n.value,n.value=s(a,i(o),c)),n.value=_(n.value),e.innerHTML=n.value,e.className=m(e.className,u,n.language),e.result={language:n.language,re:n.relevance},n.second_best&&(e.second_best={language:n.second_best.language,re:n.second_best.relevance}))}", "transient final protected internal function m174() {}", "function Ha(){}", "function testFunctions(str) {\n const shoutedStr = shout(str);\n const yelledStr = yell(shoutedStr);\n const htmlStr = html(yelledStr);\n console.log(htmlStr);\n }", "static private protected internal function m118() {}", "function miFuncion (){}", "function s(){}", "function We(a,b){var c,d;switch(b){case \"innerHTML\":return 1===Xe(a)?2:null;case \"textContent\":return a=Xe(a),1===a||6===a?1:null;default:return null!==(d=null===(c=Ye[a.localName])||void 0===c?void 0:c[b])&&void 0!==d?d:null}}", "function Yielder() {}", "function ea(){}", "function gia(a){for(var b=0;b<a.length;++b){var c=a[b],d=c[1];if(c[0]){var e=\"_\"==c[0].charAt(0)?[c[0]]:(\"\"+c[0]).split(\".\");if(1==e.length)window[e[0]]=d;else{for(var f=window,g=0;g<e.length-1;++g){var l=e[g];f[l]||(f[l]={});f=f[l]}f[e[e.length-1]]=d}}if(e=c[2])for(g=0;g<e.length;++g)d.prototype[e[g][0]]=e[g][1];if(c=c[3])for(g=0;g<c.length;++g)d[c[g][0]]=c[g][1]}}", "function WSAPI() {\n }", "function DocNameExtract()\n{\n var currentPage;\n wholeurl = window.location.href;\n x = wholeurl.length;\n while((wholeurl.substring(x,x-1)) != \".\"){ x--; } clipend = x;\n while((wholeurl.substring(x,x-1)) != \"/\"){ x--; } clipstart = x;\n return wholeurl.substring(clipend-1,clipstart);\n \n}", "function sg(i, e){\n\n}", "function exercise06() {}", "static transient final private protected internal function m40() {}", "function hc(){}", "function fm(){}", "function DWRUtil() { }", "function madlib(name, subject) {\n\treturn name + \"'s favorite subject in school is \" + subject;\n}", "function n$1(e,t){if(!e||!t)return [];let l=t;t.indexOf(\"/\")>-1?(l=t.slice(0,t.indexOf(\"/\")),t=t.slice(t.indexOf(\"/\")+1)):t=\"\";const r=[];if(t){const u=n$1(e,l);for(let e=0;e<u.length;e++){n$1(u[e],t).forEach((n=>r.push(n)));}return r}const u=e.getElementsByTagNameNS(\"*\",l);if(!u||0===u.length)return [];for(let n=0;n<u.length;n++)r.push(u[n]||u.item[n]);return r}", "function Cnds() {}", "function laughh() {\n\treturn 'hahahahahahahahahaha!';\n}", "function l(){t={},u=\"\",w=\"\"}", "function NWT() {\n\n}", "function nd(){}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}" ]
[ "0.58017325", "0.5790286", "0.5572558", "0.54797405", "0.5363318", "0.53116834", "0.5230014", "0.5218948", "0.51847404", "0.5126241", "0.5100212", "0.509153", "0.5084706", "0.5082649", "0.50633335", "0.5053083", "0.50342613", "0.5034033", "0.50327814", "0.5032252", "0.5026983", "0.50180465", "0.50114757", "0.50000924", "0.49861184", "0.49823755", "0.4980982", "0.49686897", "0.49592757", "0.49375167", "0.49353078", "0.49240243", "0.49238607", "0.4923677", "0.4918333", "0.49072823", "0.49011505", "0.48985803", "0.489386", "0.48856997", "0.48715276", "0.4871417", "0.4867076", "0.4866532", "0.48658714", "0.4864148", "0.48580927", "0.48561645", "0.48545596", "0.4851589", "0.48500368", "0.48457444", "0.48346198", "0.4834606", "0.48309842", "0.4822955", "0.48205024", "0.48201343", "0.48199412", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965", "0.4814965" ]
0.0
-1
This is an empty array where peoples names & katzDeli Line Will be stored
function takeANumber(katzDeliLine,name) { katzDeliLine.push(name); // adding names of customers to the array katzDeliLine var number = katzDeliLine.length; // how many customers are in the array return `Welcome, ${name}. You are number ${number} in line.` //returning }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destructivelyAppendKitten(array, name) {\n kittens.push(\"Ralph\");\n return array;\n}", "function addingHonorific(honorific, nameArr) {\n let output = [];\n if (nameArr.length == 0) {\n return nameArr;\n }\n for (name of nameArr) {\n console.log(name)\n for (let char = name.length - 1; char >= 0; char--) {\n if (name[char] === \",\") {\n //Do nothing\n } else {\n output.push(name[char]);\n }\n }\n }\n console.log(output)\n}", "function destructivelyAppendKitten(name){\n kittens.push(name);\n return kittens;\n}", "function destructivelyAppendKitten(name){\n kittens.push(name)\n return kittens\n}", "function destructivelyAppendKitten(name) {\n \n kittens.push(name);\n return kittens;\n \n}", "function honorificName(prefix, names) {\nlet arr= [] //final array\nlet nameArr =[] //array to arrange names to correct order\nlet name =[]\nfor (let i = 0; i<names.length;i++){\n for(let char of names[i]){\n if(char == \",\") {\n continue;\n } else if(char == \" \" || i == (namesArr.length -1)){\nnameArr.unshift(name.join(''))\n}\n}\n}\n}", "function processData(allText) {\n var people = []\n var allTextLines = allText.split(/\\r\\n|\\n/);\n\n for (var i = 1; i< allTextLines.length-1; i++){\n var tmp = allTextLines[i].split(',');\n var vote = tmp[3];\n if (vote === 'Aye'){\n vote = 'Yes'\n } else if (vote === 'Not Voting'){\n vote = 'Abstained'\n }\n var person = {\n us_state: tmp[1],\n vote: vote,\n party: tmp[5],\n name: tmp[4],\n fav:false,\n img: \"https://www.govtrack.us/static/legislator-photos/\" + tmp[0] + \"-200px.jpeg\"\n };\n people.push(person);\n console.log(person);\n\n }\n return people;\n}", "function makeNamesArray(){\n for(var i=0; i<allBusMall.length; i++){\n names.push(allBusMall[i].title);\n votes.push(allBusMall[i].votes);\n views.push(allBusMall[i].votes);\n }\n generateChart();\n}", "function populateCharArr(){\n for(i = 0; i < characters.length; i++){\n charArr.push(characters[i].name);\n }\n }", "function destructivelyAppendKitten(name){\n kittens.push(name)\n}", "blankCharArray() {\n // In each row, the modified field reports whether the line needs to be\n // redrawn in the animation loop, and the row data contains the\n // character information\n var charArray = [];\n for (var row = 0; row < this.termRows; row++) {\n charArray.push({\n modified: true,\n rowData: this.blankRowData()\n });\n }\n\n this.charArray = charArray;\n }", "function destructivelyAppendKitten(name){\n kittens.push(\"Ralph\");\n return kittens;\n \n}", "function preProcessNames(fileData) {\n\n var i = 0;\n var nextNewlinePos = -1;\n var name = \"\";\n var nameObj = null;\n var nameList = new Array();\n\n do {\n nextNewlinePos = fileData.indexOf(\"\\n\", i);\n if (nextNewlinePos > -1)\n name = fileData.substring(i, nextNewlinePos).trim();\n else // go to end of line\n name = fileData.substring(i).trim();\n // Check if we got 2 newlines in a row or something like that.\n if (name.length > 0) {\n nameObj = new NameClass(name);\n // Did the name get a bucket?\n if (nameObj.bucket)\n // Could this bucket be in the solution?\n if (nameObj.length < gTotalCharCount && isBucketContained(nameObj.bucket, gaCharacters))\n nameList.push(nameObj);\n } // end if name actually has a value.\n i = nextNewlinePos + 1;\n } while (nextNewlinePos > -1);\n\n return nameList;\n}", "function populatePeople(names){\n return names.map(named => {\n name = named.split(\" \");\n const [firstName,lastName]=name \n return {\n firstName,\n lastName,\n }\n })\n }", "function destructivelyAppendKitten(name) {\n kittens.push(name);\n}", "createNicknamesArray(){\n\t\tthis.playerNicknames = [...Array(this.clients.size)];\n\n\t\tthis.clients.forEach((index, id) => {\n\t\t\tthis.playerNicknames[index] = this.clientsNickname.get(id);\n\t\t});\n\n\n\t}", "function destructivelyAppendKitten(name) {\n kittens.push(name)\n}", "function nonFriends(name, array) {\n //I-name and array\n //O-array of nonfriends\n //C-don't output name in the final list\n //E-n/a\n //defining variable I'll use in this function\n //jerklist will be output\n let jerkList = [];\n //homie is player one\n let homie = {};\n //This function is to add a nonfriend to my output\n function addJerk(jerk) {\n //gotta make sure he's not already on here\n let jerkStatus = false;\n for(let i = 0; i < jerkList.length; i++) {\n if (jerk === jerkList[i]) {\n jerkStatus = true;\n break;\n }\n }\n if(jerkStatus === true) {\n return\n } else {\n jerkList.push(jerk);\n return\n }\n };\n //Inputting the array\n function checkFriends(array) {\n console.log('CheckFriends initiated')\n let dude = '';\n let friendStatus = false;\n //running a loop to check if each listed person is on\n //my friend's list or not\n for(let i = 0; i < array.length; i++) {\n console.log('start of dude loop for '+array[i].name)\n //making dude the name for this index\n dude = array[i].name;\n //a loop to compare dude to homie's friend list\n friendStatus = false;\n for(let i = 0; i < homie.friends.length; i++) {\n \n \n if(dude === homie.friends[i]) {\n //so this dude is on the list, move to \n //next index\n friendStatus = true;\n console.log('changing friendStatus to true'+dude)\n } \n }\n if (friendStatus === false) {\n addJerk(dude);\n console.log('addJerk, Dude:' + dude)\n } \n }\n \n }\n\n for(let i = 0; i < array.length; i++) {\n if(name === array[i].name) {\n homie = array[i];\n // arrayMinus.splice(i, 1);\n }\n }\n checkFriends(array);\n //Filter homie's name from jerklist\n let filter = jerkList.indexOf(name)\n jerkList.splice(filter, 1)\n\n return jerkList\n}", "function destructivelyAppendKitten(name) {\n var name = \"Ralph\"\n kittens.push(name) // adds \"Ralph\" to end of kittens\n return kittens // returns [\"Milo\", \"Otis\", \"Garfield\", \"Ralph\"]\n}", "function destruvielyAppendKitten(name) {\n return kittens.push(name)\n}", "constructor() {\n\t\tthis.vikingArmy = [];\n\t\tthis.saxonArmy = [];\n\t}", "function johnLennonFacts(facts){\n var i = 0;\n var myArray = [];\n while ( i < facts.length){\n myArray.push(facts[i] + '!!!')\n i++\n };\n return myArray\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 }", "function myData() {\n return [\"Abhi\",\"Shah\",\"27\",\"10 Mountanios Dr\",\"ON\",\"Canada\"];\n }", "async getNames() {\n const data = await this.getData();\n\n // We are using map() to transform the array we get into another one\n return data.map((medewerkers) => {\n return { naam: medewerkers.naam };\n });\n }", "function destructivelyAppendKitten (name) {\n return kittens.push (name)\n}", "getDrugsNameFromFile(){\n const DataFile = require('./drugname.json'); //file size 4MB nearly and content nealy 50 thousand drug names\n let DragName = []\n let UnqDrugName = []\n let xName;\n DataFile.map((index)=>{ DragName.push(index.brand_name.toLowerCase()); }); //push all drug names\n //check if there are doplicate name\n DragName.map((index)=>{ xName = UnqDrugName.indexOf(index);if(xName == -1){ UnqDrugName.push(index); } });\n this.state.Drugs = UnqDrugName;\n }", "function load()\r\n{\r\n\tk = 0;\r\n\tfor (i=0; i<entries.length; i++)\r\n\t{\r\n\t\tfor (j=0; j<entries.length; j++)\r\n\t\t{\r\n\t\t\tnames[k]=letters[i] + entries[j];\r\n\t\t\t//solution[k] = 0;\r\n\t\t\t\r\n\t\t\tk = k + 1;\r\n\t\t}\r\n\t}\r\n\treturn names;\r\n}", "function destructivelyAppendKitten(name){kittens.push(name); return kittens}", "function NEIGHBOURHOOD( name ){\n\n\tthis.name = name;\n\tthis.array = [];\n\n}", "function splitLetter() {\n for (var h = 0; h < nameLength; h++) {\n splitArray.push(chosenGame[h]);\n }\n return splitArray;\n}", "function nomeGrande(){\n var pos;\n pos = nomezao.indexOf(\" \");\n while (pos >= 0){\n var palavra = nomezao.slice(0,pos);\n //alert(palavra);\n document.getElementById(\"nomes\").innerHTML += \"<h2>\"+palavra+\"</h2>\";\n nomezao = nomezao.slice(pos+1);\n lista[posLista] = palavra;\n posLista++;\n //alert(\"Sobrou do nome = \"+nomezao);\n pos = nomezao.indexOf(\" \");\n }\n //alert(nomezao);\n palavra = nomezao;\n lista[posLista] = palavra;\n document.getElementById(\"nomes\").innerHTML += \"<h2>\"+palavra+\"</h2>\";\n\n console.log(lista);\n\n\n}", "function dataHandling(){\nvar input =\n[[\"0001\", \"Roman Alamsyah\", \"Bandar Lampung\", \"21/05/1989\", \"Membaca\"],\n [\"0002\", \"Dika Sembiring\", \"Medan\", \"10/10/1992\", \"Bermain Gitar\"],\n [\"0003\", \"Winona\", \"Ambon\", \"25/12/1965\", \"Memasak\"],\n [\"0004\", \"Bintang Senjaya\", \"Martapura\", \"6/4/1970\", \"Berkebun\"]]\n\nfor (var angka = 0; angka < 4; input,angka++){\nconsole.log('Nomor ID :' +input[angka][0])\nconsole.log('Nama Lengkap : ' +input[angka][1])\nconsole.log('TTL : ' +input[angka].slice(2,4))\nconsole.log('Hobi : ' +input[angka][4])\nconsole.log('----------------------------------------------')\n}\n}", "metinToArray() {\r\n\r\n\r\n var metinArrayed = this.metin.split(\" \");\r\n\r\n\r\n return metinArrayed\r\n\r\n }", "function chaldean(personname){\nvar namearray=\"\";\nfor(i=0;i<personname.length;i++){\n if(personname[i]==\"A\" || personname[i]==\"a\" || personname[i]==\"i\" || personname[i]==\"I\" || personname[i]==\"J\" || personname[i]==\"j\" || personname[i]==\"Q\" || personname[i]==\"q\" || personname[i]==\"Y\" || personname[i]==\"y\"){\n namearray = namearray+\"1\";\n }else if(personname[i]==\"B\" || personname[i]==\"b\" || personname[i]==\"K\" || personname[i]==\"k\" || personname[i]==\"R\" || personname[i]==\"r\"){\n namearray = namearray+\"2\";\n }else if(personname[i]==\"C\" || personname[i]==\"c\" || personname[i]==\"G\" || personname[i]==\"g\" || personname[i]==\"L\" || personname[i]==\"l\" || personname[i]==\"S\" || personname[i]==\"s\"){\n namearray = namearray+\"3\";\n }else if(personname[i]==\"D\" || personname[i]==\"d\" || personname[i]==\"M\" || personname[i]==\"m\" || personname[i]==\"T\" || personname[i]==\"t\"){\n namearray = namearray+\"4\";\n }else if(personname[i]==\"E\" || personname[i]==\"e\" || personname[i]==\"H\" || personname[i]==\"h\" || personname[i]==\"N\" || personname[i]==\"n\" || personname[i]==\"X\" || personname[i]==\"x\"){\n namearray = namearray+\"5\";\n }else if(personname[i]==\"U\" || personname[i]==\"u\" || personname[i]==\"V\" || personname[i]==\"v\" || personname[i]==\"W\" || personname[i]==\"w\"){\n namearray = namearray+\"6\";\n }else if(personname[i]==\"O\" || personname[i]==\"o\" || personname[i]==\"Z\" || personname[i]==\"z\"){\n namearray = namearray+\"7\";\n }else if(personname[i]==\"F\" || personname[i]==\"f\" || personname[i]==\"P\" || personname[i]==\"p\"){\n namearray = namearray+\"8\";\n }else{\n }\n }\n single(namearray);\n \n}", "function allTheNames(dataArr) {\n const result = [];\n dataArr.forEach((person,index) => \n person.name ? result[index] = person.name : null);\n return result;\n}", "function get2ndUserData(){\n var dataSumPerPerson = []\n var secondPersonsDataSummary = [];\n for(var key in earner2){\n // console.log(key);\n // console.log(earner2);\n secondPersonsDataSummary.push(key + \", \" + earner2[key]);\n };\n secondPersonsDataSummary.forEach(function(vals){\n vals.split(\",\");\n // console.log(vals);\n var dataConsumed = vals.replace(\"“Damn, it was like \",\"\")\n .replace(\"MB. Dat Snaptalk is a data hog, yo.”\",\"\")\n .replace(\",\",\":\");\n dataSumPerPerson.push(dataConsumed.split(\":\"));\n });\n\n allUserProperties.push(dataSumPerPerson)\n return dataSumPerPerson\n}", "function tableAllZero(arr) {\n let data = [];\n for (i = 0; i < arr.length; i++) {\n data[i] = arr[i][0];\n }\n data[7] = \"England & Wales (uk)\";\n return data;\n}", "function zooInventory(arr) {\n let result = [];\n let entry = [];\n let animal = \"\";\n let species = \"\";\n let fact = \"\";\n for (let i = 0; i < arr.length; i++) {\n // look for the patterns in the data, and assign good variable names\n entry = arr[i];\n animal = entry[0];\n species = entry[1][0];\n fact = entry[1][1];\n result.push(animal + \" the \" + species + \" is \" + fact + \".\"); // attention to detail on spacing and punctuation\n\n }\n return result;\n}", "function getMeals(){\n \n var seznam = getSpreadSheet(MEAL_SHEET);\n \n var sections = {};\n var meals = seznam.getRange(2,1,seznam.getLastRow()-2,2).getValues();\n \n // get names of all meals\n for(var m = 0; m < meals.length; m++){\n \n if(meals[m][0].toString().trim() && !sections[meals[m][0].toString().trim()]){ \n var meal = meals[m][0].toString().trim();\n sections[meal] = new Array();\n }\n \n if(meals[m][1].toString().trim()){\n sections[meal].push(meals[m][1].toString().trim());\n }\n }\n\n return sections;\n}", "function setupField() { //////////////////////////////////////创建田\n\t\t\tfor (var i = 0; i < 5; i++) {\n\t\t\t\tplantsArray[i] = new Array();\n\t\t\t\tzombiesArray[i] = new Array();\n\t\t\t\tfor (var j = 0; j < 9; j++) {\n\t\t\t\t\tplantsArray[i][j] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function pushDataToArray() {\n var inputText = selectTip.val();\n if (inputText.length <= 0) return;\n inputText = inputText.toLowerCase();\n\n guessedLettersArr.push(inputText);\n selectTip.val(\"\");\n\n console.log(guessedLettersArr);\n}", "function namesOnly(arr){\n return arr.map(names => {\n return names.name\n })\n }", "function getPeople() {\n return ['John', 'Mikkel', 'Marky-mike'];\n}", "function dataHandling2(input){\n\ninput.splice(1, 2, \"Roman Alamsyah Elsharawy\", \"Provinsi Bandar Lampung\");\ninput.splice(4, 1, \"Pria\", \"SMA Internasional Metro\");\n\nconsole.log(input);\n\nvar bulan = input[3].split(\"/\");\nvar bulanlama = input[3].split(\"/\");\nvar display= '';\n\nswitch(bulan[1]){\n case '01':\n console.log(\"Januari \");\n break;\n case '02':\n console.log(\"Februari \");\n break;\n case '03':\n console.log(\"Maret \");\n break;\n case '04':\n console.log(\"April \");\n break;\n case '05':\n console.log(\"Mei \");\n break;\n case '06':\n console.log(\"Juni \");\n break;\n case '07':\n console.log(\"Juli \");\n break;\n case '08':\n console.log(\"Agustus \");\n break;\n case '09':\n console.log(\"September \");\n break;\n case '10':\n console.log(\"Oktober \");\n break;\n case '11':\n console.log(\"November \");\n break;\n case '12':\n console.log(\"Desember \");\n break;\n default:\n display = display + \"//bulan salah// \"; \n break;\n}\n\n\nbulan = bulan.sort(function(value1, value2) { return (value2) - (value1) });\n\nconsole.log(bulan);\n\nvar gabung = bulanlama.join(\"-\");\n\nconsole.log(gabung);\n\nvar nama = input[1].slice(0,15);\n\nconsole.log(nama);\n\n}", "function entry() {\n return {\n \"voorNaOfTussen\": raadselVoorNOpgave[0],\n \"midden\": raadselVoorNOpgave[1],\n \"ingave1\": raadselVoorNOpgave[2],\n \"ingave2\": raadselVoorNOpgave[3],\n \"eval\": raadselVoorNOpgave[4]\n }\n }", "function buildcharchain(charfilename, linesobj) {\n fs.readFile('../' + charfilename + '.csv', 'utf8', function(err,contents) {\n result = contents.split(/\\r?\\n/);\n\n let len = result.length;\n\n for (var i = 0; i < len; i++) {\n let sentences = result[i].split(/[\\.|\\?|\\!]/);\n let numsentences = sentences.length;\n\n for (var n = 0; n < numsentences; n++) {\n let words = sentences[n].split(' ');\n let numwords = words.length;\n\n let push = words[0].replace(/[^0-9a-z\\-\\'\\%]/gi, '');\n if (push != '' && push != '\\'') {\n linesobj['SENTENCE_START'].push(push);\n }\n\n let flag = false;\n for (let j = 1; j < numwords; j++) {\n \n if (words[j - 1].indexOf('[') != -1 || words[j - 1].indexOf(']') != -1 || words[j].indexOf('[') != -1 || words[j].indexOf(']') != -1) {\n flag = !flag;\n continue;\n }\n\n if (flag) continue;\n \n let push = words[0].replace(/[^0-9a-z\\-\\'\\%]/gi, '');\n\n if (linesobj.hasOwnProperty(words[j - 1]) && push != '' && push != '\\'') {\n linesobj[words[j - 1]].push(words[j].replace(/[^0-9a-z\\-\\'\\%]/gi, ''));\n } else if (push != '' && push != '\\'') {\n linesobj[words[j - 1]] = [words[j].replace(/[^0-9a-z\\-\\'\\%]/gi, '')];\n }\n \n if (j === numwords - 1) {\n if (linesobj.hasOwnProperty(words[j])) {\n linesobj[words[j]].push('.');\n } else {\n linesobj[words[j]] = ['.'];\n }\n }\n }\n\n }\n }\n\n let json = JSON.stringify(linesobj);\n fs.writeFile('line_chains/' + charfilename + '.json', json, 'utf8', () => {});\n });\n}", "function johnLennonFacts(facts){\n var i = 0;\n while(i < facts.length) {\n facts[i] += \"!!!\";\n i++;\n }\n return facts;\n }", "function getPeople() {\n return ['Arpan', 'Moni', 'Sandeep', 'Tejas'];\n}", "function oilseedsProduction()\n {\n var firstArray=[];//array for storing the the key value pairs of oilseeds\n for(var i=0;i<noOfRow;i++)\n {\n \tvar header1=arrayOne[i].split(',');\n \tvar firstCol=header1[0];//first column\n \tvar count1=(firstCol.match(/Oilseeds /i) || []).length;\n \t\n //Extracting the required data from the csv file\n \tif(count1>0)\n \t {\n \tvar count2=(firstCol.match(/area/i) || []).length;\n var count3=(firstCol.match(/Production/g) || []).length;\n \tvar count4=(firstCol.match(/yield/i) || []).length;\n \tvar count5=(firstCol.match(/major crops/i) || []).length;\n \n \t\tif(count2==0 && count3==1 && count4==0 && count5==0)\n \t\t{\n \t\t\tvar firstObj={};\n firstObj['Particulars']= header1[0].replace('Agricultural Production Oilseeds ','');\n \t\t\tfirstObj['value']=header1[fgindex];\n \t\t\tfirstArray.push(firstObj);\n \t\t}\n \t}\n }//end of loop\n console.log(firstArray);\n console.log(\"/*------------------------------------------------------------------------------------------------------*/\");\n fs.writeFileSync('../output/OilseedsVsProduction.json',JSON.stringify(firstArray));//creating JSON\n }", "function getPeople() {\n\treturn [ 'John', 'Beth', 'Mike'];\n}", "function destructivelyAppendKitten(Ralph){\nreturn kittens.push(\"Ralph\");\n }", "function populatePeople(names){\n console.log(names)\n return names.map(name => {\n name = name.split(\" \");\n // your code\n // name is an array of [\"Frank\", \"Peterson\"]...\n // destructure first index into variable firstName\n // destructure second index into variable lastName\n const [firstName, lastName] = name\n return {\n // object literal array destructured variables\n firstName,\n lastName\n }\n })\n}", "function pushToArrays(name) {\n const newObject = Object.create(nameObject);\n newObject.splitName(name);\n const randomHouse = Object.keys(houses)[\n Math.floor(Math.random() * Object.keys(houses).length)\n ];\n\n newObject.house = randomHouse;\n students.push(newObject);\n}", "function destructivelyAppendKitten(Hagrid){\n kittens.push(Hagrid);\n return kittens\n}", "function forstorData() {\n\t\t//how many clockans are we dealing with?\n\t\tvar amount = $('.clokan').length;\n\t\t\n\t\t//create an array for each clokan that will store the data on time\n\t\tfor (var i = 0; i < amount; i++) {\n\t\t\t//store this in a global variable with a special name\n\t\t\t\t//I want to know a better way, bc Paul will always tell me to avoid global variables at all cost\n\t\t\tvar nameThis = 'clockan' + i;\n\t\t\tinformadata[i] = [];\n\t\t}\n\t}", "function getFirstLettersArray(pUsersArray){\n\tvar auxLettersArray = [];\n\tpUsersArray.filter(function(user) {\n\t\tauxLettersArray.push(user.Name.charAt(0));\n\t});\t\t\n\n\treturn auxLettersArray;\t\n}", "function johnLennonFacts(facts){\nvar i = 0;\n while (i < facts.length){\n facts[i]= facts[i] + '!!!';\n i++;\n }\n return facts;\n}", "cleanListOfNames(list_of_names){\n\t\tvar standings_list = [];\n\t\tvar standings_map = new Map();\n\t\tvar count = 1\n\t\tfor(var name of list_of_names){\n\t\t\tconst index = name.indexOf('.');\n\t\t\tif (count >= 10){\n\t\t\t\tvar rank = name.slice(0,2);\n\t\t\t\tvar team_name = name.slice(2,index-3);\n\n\t\t\t\tif (isNaN(rank)){\n\t\t\t\t\trank = name.slice(0,1);\n\t\t\t\t\tteam_name = name.slice(1,index-3);\n\t\t\t\t}\n\t\t\t\tconst rank_number = Number(rank);\n\t\t\t\t\n\t\t\t\tstandings_list.push(rank+ \" \" + team_name); //1example team\n\t\t\t\tif (standings_map.has(rank_number)){\n\t\t\t\t\tstandings_map.get(rank_number).push(rank+ \" \" + team_name);\n\t\t\t\t}else{\n\t\t\t\t\tstandings_map.set(rank_number, []);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tconst rank = name.slice(0,1);\n\t\t\t\tconst rank_number = Number(rank);\n\t\t\t\tconst team_name = name.slice(1,index-3)\n\t\t\t\tstandings_list.push(rank + \" \" + team_name);\n\t\t\t\tif (standings_map.has(rank_number)){\n\t\t\t\t\tstandings_map.get(rank_number).push(rank+ \" \" + team_name);\n\t\t\t\t}else{\n\t\t\t\t\tstandings_map.set(rank_number, []);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcount += 1;\n\n\t\t}\n\n\t\tconst standings = {\n\t\t\tstandings_list: standings_list,\n\t\t\tstandings_map: standings_map\n\t\t}\n\t\treturn standings;\n\t}", "function getRealNameArrayFromFirebase(thisEventLeage) {\n //var letters = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\"];\n realnameArray = [];\n\n\n for (var x = 0; x < TT; x++) {\n var almost = thisEventLeage[letters[x]];\n\n var RN = almost[\"name\"];\n\n realnameArray[letters[x]] = RN;\n\n }\n return realnameArray;\n}", "function fixColumnNames(lineArray) {\n\tlineArray[0] = `Respondent ID,Collector ID,Start Date,End Date,IP Address,Email Address,First Name,Last Name,Custom Data 1,In what country do you live?,,Select the racial/ethnic identity (or identities) that best describes you (please select all that apply).,,,,,,,\"Please enter four digits that represent the month and year (last two digits) you were born:Example: If I was born in January 1988 I would enter \"\"0188\"\"\",What is your gender?,,\"Are you currently pregnant?***Drinking alcohol at any time during pregnancy can cause serious harm to your developing baby. Alcohol consumption during pregnancy increases the chances of miscarriage and stillbirth and of premature birth low birthweight birth defects and fetal alcohol spectrum disorder in your baby.***Find more information about drinking during pregnancy here: https://www.marchofdimes.org/pregnancy/alcohol-during-pregnancy.aspxIf you need help to stop drinking you can: Talk to your healthcare provider about treatment programs. Join an Alcoholics Anonymous (AA) support group. In the United States: Use the SAMHSA Substance Abuse Treatment Facility Locator: https://findtreatment.samhsa.gov/ or call 1-800 662-4357.\",Did you complete high school (or secondary school)?,How many years of college have you completed?,\"On a scale of 1 to 10 (1 being 'I have no social support' and 10 being 'I feel very supported by the people in my life') what is your perceived level of social support?\",Worry about things,,Make friends easily,Have a vivid imagination,Trust others,Complete tasks successfully,Get angry easily,Love large parties,Believe in the importance of art,Use others for my own ends,Like to tidy up,Often feel blue,Take charge,Experience my emotions intensely,Love to help others,Keep my promises,Find it difficult to approach others,Am always busy,Prefer variety to routine,Love a good fight,Work hard,Go on binges,Love excitement,Believe that I am better than others,Am always prepared,Love to read challenging material,Panic easily,Radiate joy,Tend to vote for liberal political candidates,Sympathize with the homeless,Jump into things without thinking,Fear for the worst,Feel comfortable around people,Enjoy wild flights of fantasy,Believe that others have good intentions,Excel in what I do,Get irritated easily,Talk to a lot of different people at parties,See beauty in things that others might not notice,Cheat to get ahead,Often forget to put things back in their proper place,Dislike myself,Try to lead others,Feel others' emotions,Am concerned about others,Tell the truth,Am afraid to draw attention to myself,Am always on the go,Prefer to stick with things that I know,Yell at people,Do more than what's expected of me,Rarely overindulge,Seek adventure,Avoid philosophical discussions,Think highly of myself,Carry out my plans,Become overwhelmed by events,Have a lot of fun,Believe that there is no absolute right and wrong,Feel sympathy for those who are worse off than myself,Make rash decisions,Am afraid of many things,Avoid contacts with others,Love to daydream,Trust what people say,Handle tasks smoothly,Lose my temper,Prefer to be alone,Do not like poetry,Take advantage of others,Leave a mess in my room,Am often down in the dumps,Take control of things,Rarely notice my emotional reactions,Am indifferent to the feelings of others,Break rules,Only feel comfortable with friends,Do a lot in my spare time,Dislike changes,Insult people,Do just enough work to get by,Easily resist temptations,Enjoy being reckless,Have difficulty understanding abstract ideas,Have a high opinion of myself,Waste my time,Feel that I'm unable to deal with things,Love life,Tend to vote for conservative political candidates,Am not interested in other people's problems,Rush into things,Get stressed out easily,Keep others at a distance,Like to get lost in thought,Distrust people,Know how to get things done,Am not easily annoyed,Avoid crowds,Do not enjoy going to art museums,Obstruct others' plans,Leave my belongings around,Act without thinking,Feel comfortable with myself,Wait for others to lead the way,Don't understand people who get emotional,Take no time for others,Break my promises,Am not bothered by difficult social situations,Like to take it easy,Am attached to conventional ways,Get back at others,Put little time and effort into my work,Am able to control my cravings,Act wild and crazy,Am not interested in theoretical discussions,Boast about my virtues,Have difficulty starting tasks,Remain calm under pressure,Look at the bright side of life,Believe that we should be tough on crime,Try not to think about the needy,I really want to make changes in my drinking.,Sometimes I wonder if I'm an alcoholic.,\"If I don't change my drinking soon my problems are going to get worse.\",I have already started making some changes in my drinking.,\"I was drinking too much at one time but I've managed to change my drinking.\",Sometimes I wonder if my drinking is hurting other people.,I am a problem drinker.,\"I'm not just thinking about changing my drinking I'm already doing something about it.\",\"I have already changed my drinking and I am looking for ways to keep from slipping back to my old pattern.\",I have serious problems with drinking. ,Sometimes I wonder if I am in control of my drinking. ,My drinking is causing a lot of harm.,I am actively doing things now to cut down or stop my drinking.,I want help to keep from going back to the drinking problems that I had before.,I know that I have a drinking problem.,There are times when I wonder if I drink too much.,I am an alcoholic.,I am working hard to change my drinking.,\"I have made some changes in my drinking and I want some help to keep from going back to the way I used to drink.\",\"Within the past 90 days on about how many days have you consumed alcohol?\",\"Within the past two weeks on days that you drink alcohol about how many drinks on average do you consume?--> If unsure convert your drinks into standard drink sizes here: http://aodtool.cfar.uvic.ca/index-stddt.html\",,What is your approximate body weight (please specify pounds or kilograms)?,Have you ever been in treatment for alcohol abuse?,Are you currently in treatment for alcohol abuse?,\"Are you currently attending/participating in a mutual-aid support group (e.g. Alcoholics Anonymous or other 12-step group Celebrate Recovery Smart Recovery Refuge Recovery etc.)?\",\"If you are currently sober/abstinent from alcohol what is your sobriety date (skip this question if not applicable)?\",,\"This question will allow us to create a unique respondent code for you so we can connect your first and second surveys and keep your responses anonymous. If you are not providing your email address you may leave this question blank.Please enter the first two letters of the city/town in which you had your first job:Example: If my first job was in Toronto I would enter \"\"to\"\"\"`;\n\tlineArray.splice(1,5);\n}", "function US12(fileName) {\n var data = parseGedcom(fileName);\n var individualData = data.individualData;\n var familyData = data.familyData;\n var noError = true;\n\n for (let line = 0; line < data.length; line++) {\n var lineData = data[line].split(\" \");\n if (lineData[1] === \"HUSB\") {\n var husband = lineData[2];\n var wife = data[line + 1].split(\" \")[2];\n for (let counter = line + 1; counter < data.length; counter++) {\n var familyLineData = data[counter].split(\" \");\n if (familyLineData[2] === \"FAM\") {\n break;\n }\n\n for (let lineLoop = 0; lineLoop < data.length; lineLoop++) {\n var lineData = data[lineLoop].split(\" \");\n\n if (lineData[1] === husband) {\n for (\n let counterLoop = lineLoop + 1;\n counterLoop < data.length;\n counterLoop++\n ) {\n var nameLineData = data[counterLoop].split(\" \");\n\n if (nameLineData[1] === \"BIRT\") {\n husbandBirthday = data[counterLoop + 1]\n .split(\" \")\n .slice(2, data[counterLoop + 1].length)\n .join(\" \");\n break;\n }\n }\n }\n }\n\n for (let lineLoop = 0; lineLoop < data.length; lineLoop++) {\n var lineData = data[lineLoop].split(\" \");\n\n if (lineData[1] === wife) {\n for (\n let counterLoop = lineLoop + 1;\n counterLoop < data.length;\n counterLoop++\n ) {\n var nameLineData = data[counterLoop].split(\" \");\n\n if (nameLineData[1] === \"BIRT\") {\n wifeBirthday = data[counterLoop + 1]\n .split(\" \")\n .slice(2, data[counterLoop + 1].length)\n .join(\" \");\n break;\n }\n }\n }\n }\n\n if (familyLineData[1] === \"CHIL\") {\n var child = familyLineData[2];\n\n for (let lineLoop = 0; lineLoop < data.length; lineLoop++) {\n var lineData = data[lineLoop].split(\" \");\n\n if (lineData[1] === child) {\n for (\n let counterLoop = lineLoop + 1;\n counterLoop < data.length;\n counterLoop++\n ) {\n var nameLineData = data[counterLoop].split(\" \");\n\n if (nameLineData[1] === \"BIRT\") {\n childBirthday = data[counterLoop + 1]\n .split(\" \")\n .slice(2, data[counterLoop + 1].length)\n .join(\" \");\n break;\n }\n }\n }\n }\n\n var childDate = new Date(Date.parse(childBirthday));\n var husbandDate = new Date(Date.parse(husbandBirthday));\n var wifeDate = new Date(Date.parse(wifeBirthday));\n\n var currDate = new Date();\n\n var childAge = Math.floor(\n (currDate.getTime() - childDate.getTime()) / 31557600000\n );\n var husbandAge = Math.floor(\n (currDate.getTime() - husbandDate.getTime()) / 31557600000\n );\n var wifeAge = Math.floor(\n (currDate.getTime() - wifeDate.getTime()) / 31557600000\n );\n\n var famOneIncrement;\n if (data[line - 3].split(\" \")[2] === \"FAM\") {\n famOneIncrement = 3;\n } else {\n famOneIncrement = 5;\n }\n\n if (wifeAge - childAge >= 60) {\n errors.push(\n `ERROR: FAMILY: US12: ${data[line - famOneIncrement]\n .split(\" \")[1]\n .replace(/[@]/g, \"\")}: Age of Mother ${wife.replace(\n /[@]/g,\n \"\"\n )} should be less than 60 years older than her children.`\n );\n noError = false;\n }\n\n if (husbandAge - childAge >= 80) {\n errors.push(\n `ERROR: FAMILY: US12: ${data[line - famOneIncrement]\n .split(\" \")[1]\n .replace(/[@]/g, \"\")}: Age of Father ${husband.replace(\n /[@]/g,\n \"\"\n )} should be less than 80 years older than his children.`\n );\n noError = false;\n }\n\n // console.log(\n // `Child ${child} age: ${childAge} of Father ${husband} Age: ${husbandAge} & Mother ${wife} Age: ${wifeAge}`\n // );\n }\n }\n }\n }\n return noError;\n}", "function changeMe(arr) {\n // you can only write your code here!\n if (arr.length == 0){\n \tconsole.log('\\\"\\\"');\n } else{\n\t var avengers = {};\n\t for (var i = 0; i < arr.length; i++) {\n\t \tfor (var j = 0; j < 4; j++) {\n\t \t\tswitch (j){\n\t \t\t\tcase 0 :\n\t \t\t\t\tavengers.firstName = arr[i][j];\n\t \t\t\t\tbreak;\n\t \t\t\tcase 1 :\n\t \t\t\t\tavengers.lastName = arr[i][j];\n\t \t\t\t\tbreak;\n\t \t\t\tcase 2 :\n\t \t\t\t\tavengers.gender = arr[i][j];\n\t \t\t\t\tbreak;\n\t \t\t\tcase 3 :\n\t \t\t\t\tif (arr[i][j]) {\n\t \t\t\t\t\tavengers.age = 2019-arr[i][j];\n\t \t\t\t\t} else {\n\t \t\t\t\t\tavengers.age = 'Invalid Birth Year';\n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t}\n\t \t}\n\t \tconsole.log(`${i+1}. ${arr[i][0]} ${arr[i][1]} :`);\n\t \tconsole.log(avengers);\n\t \tconsole.log('\\n');\n\t }\n }\n}", "function formatJoke(joke) {\n return [\n 'Knock, knock.',\n 'Who’s there?',\n joke.name + '.',\n joke.name + ' who?',\n joke.name + ' ' + joke.answer\n ].join('\\n')\n}", "function names() {\r\n return \"1P 2M 3M 4P 5P 6m 7m\".split(\" \");\r\n}", "function buildOppTeamsArray()\n{\n OPP_TEAMS_ARRAY = new Array(N_OPP_TEAMS);\n for (var i = 0; i < N_OPP_TEAMS; ++i)\n {\n OPP_TEAMS_ARRAY[i] = new Array(2); // Contents: 'oppTeamID', 'oppTeamName'.\n\n OPP_TEAMS_ARRAY[i]['oppTeamID' ] = Number(getNextWordFromCodedData());\n eatWhiteSpaceFromCodedData();\n OPP_TEAMS_ARRAY[i]['oppTeamName'] = String(getRemainingLineFromCodedData());\n }\n}", "function set_absensi_array(data){\n absensi_siswa_arr=[];\n for(var i=0;i<getJumlah();i++){\n absensi_siswa_arr.push({\n status : data[i].charAt(0),\n id_kelas_siswa : getIdKelas(i),\n });\n }\n }", "function kata2() {\r\n // Your Code Here\r\n let arr = bestThing.split(\" \");\r\n\r\n let header = document.createElement(\"h3\");\r\nheader.textContent = \"Kata 2\";\r\ndocument.body.append(header);\r\n\r\nlet newElement = document.createElement(\"div\");\r\nnewElement.textContent = JSON.stringify(arr);\r\n document.body.append(newElement);\r\n return arr;\r\n\r\n}", "function haeEdellisettilaukset(result){\n for(i=0; i < result.tilaukset.length; i++){\n tilausArray.push(result.tilaukset[i]);\n }\n }", "fill() {\n this.notes = []\n for (let fret of range(0, this.frets)) {\n this.notes[fret] = []\n for (let string of range(1, this.strings)) {\n this.notes[fret][string - 1] = new Note(fret, string)\n }\n }\n }", "function namesOnly(arr){\r\n return arr.map(names => names.name)\r\n }", "function cloneArray () { //exclude chosen word\n\t\tconsole.log('>> function cloneArray executed');\n\t\tfor (let item of tagNames) {\n\t\t\tif (item != tagChosen) cloneTagNames.push(item);\n\t\t}\n\t\t\t\t\t// console.log('main array');\n\t\t\t\t\t// console.log(tagNames);\n\t\t\t\t\t// console.log('cloned array');\n\t\t\t\t\t// console.log(cloneTagNames);\n\t}", "function quitarEspacios (arrayWithLether) { \r\n const arrayNoSpaces = [];\r\n for(let i = 0; i < arrayWithLether.length; i++) {\r\n //convertir siguiente letra al espacio detectado en Mayus \r\n if (arrayWithLether[i] === \" \") { \r\n let j = i + 1;\r\n let nextLetter = arrayWithLether[j];\r\n let mayus = nextLetter.toUpperCase(); \r\n arrayWithLether[j] = mayus;\r\n } else {\r\n arrayNoSpaces.push(arrayWithLether[i]);\r\n }\r\n }\r\n return arrayNoSpaces;\r\n}", "function zeichneKreis() {\n let circle = new Zauberbild.Element(); // Superklasse\n Zauberbild.kreisArray.push(circle); // Alle Elemente des Zauberbildes werden nachdem sie erstellt wurden im Kreisarray abgespeichert\n }", "function longPlanets() {\n\tvar longerNamedPlanetsArray = [];\n\tfor (var i=0; i<Planets.length; i++) {\n\t\tif (Planets[i].charAt(6) !==\"\") {\n\t\t\tlongerNamedPlanetsArray.push(Planets[i]);\n\t\t}\n\t}\n\t\treturn longerNamedPlanetsArray\n\n}", "getSuitCountries() {\n const rowsArray = Object.keys(this.sheetRows).map(\n (key) => this.sheetRows[key]\n );\n\n const countriesList = [];\n\n let invalidDataLines = 0;\n\n for (let i = 2; i < rowsArray.length; i++) {\n let continueFlag = false;\n for (let char in rowsArray[i])\n if (/н\\/д/.test(rowsArray[i][char])) {\n continueFlag = true;\n break;\n }\n\n if (continueFlag) {\n invalidDataLines++;\n continue;\n }\n countriesList.push({\n name: rowsArray[i].A,\n x1: rowsArray[i].B,\n x2: rowsArray[i].C,\n y: rowsArray[i].D,\n });\n }\n\n return [countriesList, invalidDataLines];\n }", "function johnLennonFacts(array) {\n\t// body...\n\tvar i = 0;\n\n\twhile(i < array.length){\n array[i] = array[i] + \"!!!\";\n i++;\n\t};\n\n\treturn array;\n}", "function allTheNamesWithMap(dataArr) {\n return dataArr.map(person => \n person.name ? person.name : null);\n}", "function getScientificNames() {\n if ($plant_taxa != null){\n return ARRAY(REPEATABLEVALUES($plant_taxa, 'scientific_name'));\n } else {\n return null;\n }\n}", "async trimData () {\n const trimmedNames = []\n const response = await this.readFile(this.inFile)\n const evenIndex = (element, index) => index % 2 === 0\n // splits response data by line then filters by every other line (lines\n // that names are included on)\n const nameRow = response.split('\\n').filter(evenIndex)\n // loops through lines to separate first and last name data, then pushes first\n // and last name data to trimmedNames array\n nameRow.forEach((element) => {\n const firstName = element.split(' ')[1]\n const lastNameWithComma = element.split(' ')[0]\n // removes comma from last name\n const lastName = lastNameWithComma.substring(0, lastNameWithComma.length - 1)\n trimmedNames.push(firstName + ' ' + lastName)\n })\n // remove empty last element of array (caused by blank line at end of text file)\n trimmedNames.pop()\n return trimmedNames\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 prependKitten(name){\n var kitten=[name,...kittens];\n return kitten;\n}", "function kata11() {\r\n // Your Code Here\r\n lotrCitiesArray.splice(5,1\r\n ,'Deadest Marshes')\r\n\r\n createAnELement(11);\r\n let newElement = document.createElement(\"div\");\r\n newElement.textContent =JSON.stringify(lotrCitiesArray);\r\n document.body.append(newElement);\r\n\r\n \r\n return lotrCitiesArray;\r\n}", "function printBabyName(){\n\t//hash table with array as values\n\tvar names = {boy: [\"Adam\", \"Max\", \"Bob\", \"Sam\"], girl: [\"Eve\", \"Wendy\", \"Christine\", \"Sarah\"]};\n\tvar girlNames = names.girl;\n\tvar boyNames = names.boy;\n\tfor (var i = 0; i < girlNames.length; i++){\n\t\tconsole.log(girlNames[i]);\n\t}\n}", "function cleanNames(arr) {\n\n const maps = arr.map(function (m) {\n return m.trim();\n });\n // console.log(maps)\n return maps;\n}", "function FoundationRows (){\n this.foundationRow = [];\n this.suit = \"\";\n}", "function johnLennonFacts(facts){\n var newFacts = []\n var counter = 0\n while (counter < facts.length) {\n newFacts.push(`${facts[counter]}!!!`)\n counter++\n }\n return newFacts\n}", "function nihonData() {\n return nihonList;\n}", "function CreateDefaultShedPositionArray()\r\n{\r\n Alloy.Globals.ShedModeShedPosition =\r\n {\r\n \"LATITUDE\": \"\" , // Empty\r\n \"LONGITUDE\": \"\" , // Empty\r\n \"ALTITUDE\": \"\" , // Empty\r\n \"PROVINCE\": \"\" , // Empty\r\n \"MUNICIPALITY\": \"\" , // Empty\r\n \"PLACE\": \"\" , // Empty\r\n \"ADDRESS\": \"\" , // Empty\r\n \"CIVIC_NO\": \"\" // Empty\r\n } ;\r\n}", "function johnLennonFacts(facts) {\n var factList = [];\n var i = 0\n while (i < facts.length) {\n factList.push(facts[i] + \"!!!\")\n i += 1\n }\n return factList\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 }", "function blank(){\n for (var i = 0; i < computerChoice.length; i++) {\n letterComputerArray += (\"_\");\n\n }\n return letterComputerArray \n }", "function panggilPerulangan() {\n var dataKota = ['Jakarta', 'Balikpapan', 'Medan'];\n var dataBaru = [];\n for (var i = 0; i < dataKota.length; i++) {\n dataBaru.push('Kota: ' + dataKota[i]);\n }\n console.log(dataBaru);\n }", "function NameGiver(who) {\r\n const FemaleFirstNames = [\"Jaiden\", \"Judy\", \"Nia\", \"Kelis\", \"Chelsea\", \"Amani\", \"Veronica\", \"Kyra\", \"Lauryn\", \"Alicja\", \"Tate\", \"Colleen\", \"Melody\", \"Pippa\", \"Keziah\", \"Melissa\", \"Lana\", \"Marie\", \"Molly\", \"Sandra\", \"Dannielle\", \"Yusra\", \"Laiba\", \"Gabrielle\", \"Syeda\", \"Amirah\",\r\n \"Lindsay\", \"Karly\", \"Itzel\", \"Clarissa\", \"Ansley\", \"Leanna\", \"Briley\", \"Cara\", \"Katelynn\", \"Susan\", \"Alexis\", \"Kaia\", \"Marlee\", \"Emmy\", \"Genevieve\", \"Melany\", \"Jaylynn\", \"Amari\", \"Sharon\", \"Miah\", \"Karen\", \"Kylie\"\r\n ],\r\n MaleFirstNames = [\"Jerome\", \"Napoleon\", \"Duncan\", \"Brant\", \"Chance\", \"Dewitt\", \"Brendan\", \"Asim\", \"Faith\", \"Macy\", \"Landon\", \"Sulaiman\", \"Iestyn\", \"Gordon\", \"Hector\", \"Haris\", \"Lee\", \"Simran\", \"Ronnie\", \"Rishi\", \"Bartosz\", \"Shelley\", \"Virgil\", \"Howard\", \"Rio\", \"Prince\",\r\n \"Glenn\", \"Daniel\", \"Felipe\", \"Willie\", \"Aden\", \"Brennen\", \"Cale\", \"Arnav\", \"Quentin\", \"River\", \"Clarence\", \"Jamal\", \"Luca\", \"Brent\", \"Tyrone\", \"Ryan\", \"Damien\", \"Carmelo\", \"Reese\", \"Braiden\", \"Beckham\"\r\n ],\r\n LastNames = [\"Paine\", \"Ward\", \"Bostock\", \"Devine\", \"Heath\", \"Bone\", \"Dupont\", \"Patterson\", \"Garza\", \"Stein\", \"Madden\", \"Francis\", \"Villanueva\", \"Perry\", \"Lyssa\", \"Beach\", \"Crouch\", \"Sharp\", \"Clifford\", \"Wade\", \"Vargas\", \"Hatfield\", \"Mata\", \"Lozano\", \"Everett\",\r\n \"Krueger\", \"Jimenez\", \"Fitzpatrick\", \"Nelson\", \"Scott\", \"Vaughn\", \"Lee\", \"Hodge\", \"Blackburn\", \"Wall\", \"Hernandez\", \"Valdez\", \"Summers\", \"Mercado\", \"Villarreal\", \"Mitchell\", \"Duran\", \"David\", \"Black\", \"Hopkins\", \"Hughes\", \"Rangel\"\r\n ];\r\n //LastNames.RemoveDup();\r\n switch (CheckGender(who)) {\r\n case \"cuntboy\":\r\n case \"male\":\r\n who.FirstName = RandomString(MaleFirstNames);\r\n break;\r\n case \"hermaphrodite\":\r\n case \"female\":\r\n case \"dickgirl\":\r\n who.FirstName = RandomString(FemaleFirstNames);\r\n break;\r\n case \"doll\":\r\n who.FirstName = RandomInt(0, 10) < 5 ? RandomString(FemaleFirstNames) : RandomString(MaleFirstNames);\r\n break;\r\n }\r\n who.LastName = RandomString(LastNames);\r\n}", "function prependKitten(name){\n var newArray = [name, ...kittens];\n return newArray;\n}", "function crearniveles() {\n let niveles = [];\n let fila = 0;\n let columna = 0;\n niveles[0] = [];\n for (let c = 1; c < 21; c++) {\n niveles[0][c - 1] =\n {\n tipo: 0,\n fila: fila + 3,\n columna: columna,\n }\n if (c % 10 == 0) {\n fila++;\n columna = 0;\n } else {\n columna++;\n }\n }\n fila = 0;\n columna = 0;\n niveles[1] = [];\n for (let c = 1; c < 41; c++) {\n \tniveles[1][c - 1] =\n {\n \ttipo: 0,\n \tfila: fila + 3,\n \tcolumna: columna,\n }\n \tif (c % 10 == 0) {\n \t\tfila++;\n \t\tcolumna = 0;\n \t} else {\n \t\tcolumna++;\n \t}\n }\n\n return niveles;\n }", "function addTitle (people) {\r\n //console.log(people);\r\n //console.log(people[0][1])\r\n \r\n var genderMale = '' ;\r\n var genderFemale = '';\r\n var isGenderFemale = '' ;\r\n \r\n if (people[0] === undefined || people[0] === ''){\r\n return [];\r\n }\r\n\r\n var hasilGender = '';\r\n for (var i=0; i< people.length; i++){\r\n if (people[i][1] === 'male') {\r\n genderMale = 'Mr. ' + people[i][0];\r\n }\r\n else if (people[i][1] === 'female' && people[i][2] === false) {\r\n genderFemale = 'Ms. ' +people[i][0];\r\n }\r\n else if (people[i][1] === 'female' && people[i][2] === true) {\r\n isGenderFemale = 'Mrs. ' +people[i][0];\r\n }\r\n }\r\n //console.log(genderMale);\r\n //console.log(genderFemale);\r\n //console.log(isGenderFemale);\r\n //console.log('Mr ' +genderMale.toString());\r\n\r\n //console.log(genderMale);\r\n //console.log(genderFemale);\r\n //console.log(isGenderFemale);\r\n hasilGender = genderMale +(', ') + genderFemale+ (', ') + isGenderFemale;\r\n //console.log(hasilGender);\r\n var hasil = '';\r\n for (var i=0; i< hasilGender.length-2; i++){\r\n hasil += hasilGender[i];\r\n }\r\n //console.log(hasil);\r\n return hasil;\r\n \r\n //return 'Mr. ' +genderMale.toString()+ ', Ms. ' +genderFemale.toString()+ ', Mrs. ' +isGenderFemale.toString(); \r\n}", "function createArrays() {\n phraseArray = [];\n blankArray = [];\n phraseArray = secretPhrase.split(\"\");\n phraseArray.forEach( () => blankArray.push(\"_\"));\n spanSecretRandom.innerHTML = blankArray.join(\" \");\n}", "function organizeData(newArray, macro) {\n for (let i = 0; i < json.length; i++) newArray.push({\n label: json[i][\"name\"],\n y: json[i][macro]\n });\n console.log(newArray);\n }", "function loadCSVOnVariable(allText) {\nvar allTextLines = allText.split(/\\r\\n|\\n/);\nvar headers = allTextLines[0].split(',');\nvar lines = [];\nfor (var i=1; i<=(allTextLines.length)-1; i++) {\nvar data = allTextLines[i].split(',');\nnameArr.push(data[1]);\nif (data.length == headers.length) {\nvar tarr = [];\nfor (var j=0; j<headers.length; j++) {\ntarr.push(headers[j]+\":\"+data[j]);\n}\n\nlines.push(tarr);\n\n}\n\n}\nconsole.log(nameArr);\n}", "function jobName(shipMates) {\n let jobNameArr = shipMates.map(val => `${val[1]}: ${val[0]}`);\n return jobNameArr;\n}" ]
[ "0.5804787", "0.57776666", "0.57100576", "0.57060647", "0.5695514", "0.5693508", "0.56860673", "0.5670398", "0.5625604", "0.5616661", "0.56055313", "0.55768836", "0.5566456", "0.5519512", "0.55134654", "0.54859585", "0.54769814", "0.54467183", "0.5438823", "0.5438229", "0.54332983", "0.5405355", "0.5388623", "0.537652", "0.5368856", "0.5354299", "0.53396297", "0.53338057", "0.53054637", "0.52997124", "0.52911675", "0.5289194", "0.52714956", "0.527053", "0.52689993", "0.52575266", "0.52497935", "0.52175355", "0.51946175", "0.5190923", "0.51833856", "0.51577777", "0.51489043", "0.51429814", "0.5137899", "0.5131442", "0.51292974", "0.5125397", "0.51242507", "0.51133996", "0.5112869", "0.5101125", "0.51007915", "0.50991696", "0.5097429", "0.50881237", "0.50817645", "0.5075002", "0.5072671", "0.5072636", "0.50706065", "0.5065796", "0.50649285", "0.50638825", "0.5051138", "0.50487465", "0.5047955", "0.5043656", "0.5039844", "0.5036565", "0.5035151", "0.50301474", "0.50299364", "0.5029402", "0.5028261", "0.5025612", "0.5019791", "0.5017456", "0.5014937", "0.50080526", "0.5007651", "0.50069004", "0.5005759", "0.500358", "0.5003028", "0.50023574", "0.50021386", "0.49998873", "0.4999402", "0.4999206", "0.4996551", "0.49921167", "0.49909317", "0.4990037", "0.4988621", "0.49866244", "0.4979144", "0.49765497", "0.49757162", "0.49667984", "0.49650186" ]
0.0
-1
Create the grid on screen
function createGrid(grid, type) { deleteGrid(grid); grid.classList.remove('empty-grid'); grid.classList.remove('wall-grid'); grid.classList.remove('point-grid'); grid.classList.remove('pacman-grid'); switch (type) { case 'EMPTY': wall.classList.add('empty-grid'); wall.style.backgroundColor = '#FFF'; wall.style.border = '1px solid #E5E5E5'; case 'WALL': grid.classList.add('wall-grid'); grid.style.border = '1px solid #BEBEBE'; grid.style.backgroundColor = '#E5E5E5'; break; case 'POINT': let point = document.createElement('div'); grid.classList.add('point-grid'); grid.style.backgroundColor = "transparent"; point.style.backgroundColor = '#F8B090'; point.style.borderRadius = '50%'; point.style.padding = '10px'; point.style.transform = 'scale(0.2)'; point.style.position = 'absolute'; grid.appendChild(point); break; case 'PACMAN': let pacman = document.createElement('div'); grid.classList.add('pacman-grid'); grid.style.backgroundColor = "transparent"; pacman.style.backgroundColor = '#26A69A'; pacman.style.borderRadius = '50%'; pacman.style.padding = '10px'; pacman.style.transform = 'scale(0.6)'; pacman.style.position = 'absolute'; grid.appendChild(pacman); break; } grid.addEventListener('mousedown', updateGrid); grid.addEventListener('mouseover', mouseOverEvent); grid.addEventListener('mouseup', mouseUpEvent); addID(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGrid(width, height) {\n\n}", "function _createGrid() {\n\t_grid = [$game.VIEWPORT_WIDTH];\n\tvar i = $game.VIEWPORT_WIDTH;\n\twhile(--i >= 0) {\n\t\t_grid[i] = [$game.VIEWPORT_HEIGHT];\n\t\tvar j = $game.VIEWPORT_HEIGHT;\n\t\twhile(--j >= 0) {\n\t\t\t//place random object\n\t\t\tvar item = _makeRandomItem();\n\t\t\t_grid[i][j] = {\n\t\t\t\titem: item,\n\t\t\t\titemRevealed: false\n\t\t\t};\n\t\t}\n\t}\n}", "function createGrid(){\n for (let i=0; i<gridSize; i++) {\n const div = document.createElement('div');\n grid.appendChild(div);\n // Push elements to previously empty cells array\n cells.push(div);\n }\n createLife();\n generateTrees();\n }", "function makeGrid(){\n\tfor(let row = 0; row < inputHeight.value; row++){\n\t\tconst tableRow = pixelCanvas.insertRow(row);\n\t\tfor(let cell = 0; cell < inputWidth.value; cell++){\n\t\t\tconst cellBlock = tableRow.insertCell(cell);\n\t\t}\n\t}\n}", "createGrids () {\n }", "function createGrid() {\n for (let i = 0; i < DIMENSION; ++i) {\n const container = document.querySelector('#gridContainer');\n const row = document.createElement('div');\n\n row.classList.add('row');\n container.appendChild(row);\n\n for (let j = 0; j < DIMENSION; ++j) {\n const cell = document.createElement('div');\n cell.classList.add('cell');\n\n row.appendChild(cell);\n paint(cell);\n }\n }\n}", "function makeGrid() {\nfor (let x = 0; x < rowsNum.value ; x ++) {\n const insertRow = pixelCanvas.insertRow(0) ;\n for (let y = 0 ; y < cellsNum.value ; y ++) {\n insertRow.insertCell(0) ;\n }\n}\n\n}", "function makeGrid() {\n\n\n}", "function makeGrid() {\n\t\tfor(let col = 0; col < gridHeight; col++){\n\t\t\tconst cellRow = $('<tr></tr>'); //CREATES TABLE ROWS\n\t\t\tcanvas.append(cellRow);\n\t\t\tfor (let row = 0; row < gridWidth; row++){\n\t\t\t\tconst cell = $('<td></td>');\n\t\t\t\tcellRow.append(cell);\n\t\t\t};\n\t\t};\n\t}", "function makeGrid() {\n const height = inputHeight.val();\n const width = inputWidth.val();\n\n for (let i = 0; i < height; i++) {\n const row = $('<tr></tr>');\n for (let j = 0; j < width; j++) {\n row.append('<td></td>');\n }\n canvas.append(row);\n }\n}", "function createGrid() {\n var gridCanvas = document.createElement('canvas');\n gridCanvas.width = gridSize.cols*gridSize.square;\n gridCanvas.height = gridSize.rows*gridSize.square;\n var gridContext = gridCanvas.getContext('2d');\n\n // pass canvas to external variable so it can be used elsewhere as an image\n gridImage = gridCanvas;\n\n var horizontal;\n var vertical;\n var positionX = 0+(canvas.width/2)-32+320; // starting position of hooks\n var positionY = 0;\n var order;\n\n for (var i = 0; i < gridSize.cols; i++) {\n if (order === true) {\n order = false;\n } else {\n order = true;\n }\n drawCol(gridContext,positionX,order);\n positionX += 64;\n }\n}", "function generage_grid() {\n\n for (var i = 0; i < rows; i++) {\n $('.grid-container').append('<div class=\"grid-row\"></div>');\n }\n\n\n $('.grid-row').each(function () {\n for (i = 0; i < columns; i++) {\n $(this).append('<div class=\"grid-cell\"></div>')\n }\n });\n\n var game_container_height = (34.5 * rows)\n $('.game-container').height(game_container_height);\n var game_container_width = (34.5 * columns)\n $('.game-container').width(game_container_width);\n }", "function makeGrid() {\n var {width, height} = size_input();\n\n for (rowNum = 0; rowNum < height; rowNum++) {\n grid.append(\" <tr></tr>\");\n }\n for (colNum = 0; colNum < width; colNum++) {\n $(\"#pixel_canvas tr\").append(\" <td></td>\");\n }\n}", "function makeGrid() {\n\n canvas.innerHTML = '';\n\t\n\t\n // This builds the rows and columns\n var fragment = document.createDocumentFragment();\n\t\n for (let a = 0; a < height.value; a++) {\n var tr = document.createElement('tr');\n\n for (let b = 0; b < width.value; b++) {\n var td = document.createElement('td');\n tr.appendChild(td);\n }\n\n tr.addEventListener('click', clickedBox);\n fragment.appendChild(tr);\n\t\n }\n \n \n \n // Push grid onto DOM\n canvas.appendChild(fragment);\n \n}", "function drawGrid() {\n noFill();\n stroke(230, 50);\n strokeWeight(2);\n\n for (let j = 0; j < config.numRows; j++) {\n for (let i = 0; i < config.numCols; i++) {\n rect(i * colWidth, j * rowHeight, colWidth, rowHeight)\n }\n }\n }", "function makeGrid(rows, cols) {\n container.style.setProperty('--grid-rows', rows);\n container.style.setProperty('--grid-cols', cols);\n for (c = 0; c < (rows * cols); c++) {\n let cell = document.createElement(\"div\");\n container.appendChild(cell).className = \"grid-item\";\n cells[c] = cell;\n cells[c].style.backgroundColor = \"white\"\n };\n}", "drawGrid() {\n translate(this.xOffset, this.yOffset);\n background(color('black'));\n for (let x = 0; x <= this.width; x++) {\n\n for (let y = 0; y <= this.height; y++) {\n fill(color('white'))\n strokeWeight(1);\n rect(x * this.boxSize, y * this.boxSize, this.boxSize, this.boxSize);\n\n // Draw the position of the entry\n fill(color('gray'));\n if (this.gridLayout[x][y] != null)\n text(x + \",\" + y + \"\\n\" + this.gridLayout[x][y].name, x * this.boxSize, y * this.boxSize, this.boxSize, this.boxSize);\n else\n text(x + \",\" + y + \"\\n\", x * this.boxSize, y * this.boxSize, this.boxSize, this.boxSize);\n }\n }\n }", "function createGrid(){\n for (var i = 0; i < 200; i++) {\n var div = document.createElement(\"div\");\n div.id = i;\n div.style.visibility = \"hidden\";\n document.getElementById(\"board\").appendChild(div);\n }\n if (!start) {\n for (var i = 0; i < 16; i++) {\n \t var div = document.createElement(\"div\");\n div.id = i.toString() + \"side\";\n div.style.visibility = \"hidden\";\n document.getElementById(\"upcoming\").appendChild(div);\n }\n }\n}", "function createGrid() {\n\n const frame = null; // get a reference to the frame\n\n // Add Code to create the game grid\n for (let i = 0; i < 10 ; i++) {\n buildRow(frame); \n }\n resetGame();\n}", "function makeGrid(height, width) {\r\n// Grid is cleared\r\n pixelCanvas.empty();\r\n// Create new grid\r\n// Create rows\r\n for (let row = 0; row < height; row++) {\r\n let tableRow = $('<tr></tr>');\r\n// Create columns\r\n for (let col = 0; col < width; col++) {\r\n let tableCell = $('<td></td>');\r\n// Append table data to create grid\r\n tableRow.append(tableCell);\r\n }// End col for loop\r\n pixelCanvas.append(tableRow);\r\n }// End row for loop\r\n }// End makeGrid function", "function makeGrid() {\n canvas.find('tablebody').remove();\n\n // \"submit\" the size form to update the grid size\n let gridRows = gridHeight.val();\n let gridCol = gridWeight.val();\n\n // set tablebody to the table\n canvas.append('<tablebody></tablebody>');\n\n let canvasBody = canvas.find('tablebody');\n\n // draw grid row\n for (let i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n // draw grid col\nfor (let i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n\n }", "createGrid() {\n\t\t// loop to create the 8 rows\n\t\tfor (let row = 0; row < 8; row++) {\n\t\t\tthis.grid[row] = [];\n\t\t\t// push in 8 columns of nulls\n\t\t\tfor (let column = 0; column < 8; column++) {\n\t\t\t\tthis.grid[row].push(null);\n\t\t\t}\n\t\t}\n\t}", "function makeGrid() {\n\tfor (y = 0; y < sizeY; y++ ){\n\t\t$('#pixelCanvas').append('<tr>');\n\t\t\tfor(x = 0; x< sizeX; x++ ){\n\t\t\t\t$('#pixelCanvas tr:last-child').append('<td></td>');\n\t\t\t}\n\t\t$('#pixelCanvas').append('</tr>');\n\t}\n}", "function makeGrid() {\n\t// hide the Grid by defult to show it in an animation style\n\ttable.hide();\n\ttable.empty();\n\n\tconst width = $('#input_width').val() ;\n\tconst height = $('#input_height').val() ;\n\n\t// no create the Grid !!\n\t// create the rows first (height).\n\tfor(var i = 0; i < height; i++) {\n\t\ttable.append('<tr class=\"rows\"></tr>') ;\n\t}\n\t// then we create the columns(width).\n\tfor(var i = 0; i < width; i++) {\n\t\t$('.rows').append('<td class=\"col\"></td>') ;\n\t}\n}", "function generateGrid(x) {\n \tfor (var rows = 0; rows < x; rows++) {\n \tfor (var columns = 0; columns < x; columns++) {\n \t$('#container').append(\"<div class='cell'></div>\");\n };\n };\n $('.cell').width(720/x);\n $('.cell').height(720/x);\n\t\tpaint();\n}", "createGameGrid (x, y) {\n while (y < 1080){\n while (x < 1920){\n const cell = this.add.rectangle(x, y, 192, 180).setInteractive()\n cell.setStrokeStyle(2, 0x000000)\n cell.alpha = 0.01\n this.gameGridCellGroup.add(cell)\n x += 192\n }\n if (x > 1920) {\n x = 96\n y += 180\n }\n }\n }", "function makeGrid(x, y) {\n for (var rows = 0; rows < x; rows++) {\n for (var columns = 0; columns < y; columns++) {\n $(\"#container\").append(\"<div class='grid'></div>\");\n };\n };\n $(\".grid\").height(960/x);\n $(\".grid\").width(960/y);\n}", "function makeGrid() {\n pixelCanvas.innerHTML = \"\";\n for (let i = 0; i < gridHeight;i++) {\n const tr = document.createElement(\"tr\");\n for(let j = 0; j < gridWidth; j++){\n const td = document.createElement(\"td\");\n tr.appendChild(td);\n }\n fragment.appendChild(tr);\n }", "function createGrid(rows, cols) {\n let r = 0;\n let c = 0;\n let child_index = 0;\n let grid_size = grid.childElementCount;\n for (r=0; r < rows; r++) {\n for (c=0; c < cols; c++) {\n if (child_index >= grid_size) {\n addCell(child_index);\n }\n child_index++;\n }\n }\n if (start == 0) {\n setStart(0);\n }\n document.documentElement.style.setProperty(\"--rowNum\", rows.toString());\n document.documentElement.style.setProperty(\"--colNum\", cols.toString());\n}", "function defaultGrid(){\n gridSize(24)\n createDivs(24)\n}", "function drawGrid() {\n\t\t\t// add container styles\n\t\t\t$container.addClass('container gantt');\n\t\t\t\n\t\t\t// empty container\n\t\t\t$container.empty();\n\t\t\t\t\t\t\n\t\t\t// render contents into container\n\t\t\t$container.append(gridTmpl(controller));\t\n\t\t\tinitEls();\n\t\t\t\n\t\t\t// adjust layout components\n\t\t\tadjustLayout();\n\t\t\tinitHScroller();\t\t\t\n\t\t}", "function createGrid(playerStartPosition) {\n // Using for loop to create grid, because we can specify how long we want it to run for\n for (let i = 0; i < cellCount; i++) {\n const cell = document.createElement('div')\n // Set cell number based on i (Turn on for development reasons to see cell index)\n //cell.innerHTML = i\n // Add each div to parent grid as children\n grid.appendChild(cell)\n // adds's each cell to an array\n cells.push(cell)\n }\n\n addPlayer(playerStartPosition)\n }", "function createGrid() {\n grid = [];\n let cell, marginX, marginY;\n\n // Portrait\n if (((width - margin * 2) * GRID_ROWS) / GRID_COLS < height - margin * 2) {\n cell = (width - margin * 2) / GRID_COLS;\n marginX = margin;\n marginY = (height - cell * GRID_ROWS) / 2;\n }\n // Landscape\n else {\n cell = (height - margin * 2) / GRID_ROWS;\n marginX = (width - cell * GRID_COLS) / 2;\n marginY = margin;\n }\n\n // Populate the grid\n for (let i = 0; i < GRID_ROWS; i++) {\n grid[i] = [];\n\n for (let j = 0; j < GRID_COLS; j++) {\n let left = marginX + j * cell;\n let top = marginY + i * cell;\n\n grid[i][j] = new Cell(left, top, cell, cell, i, j);\n }\n }\n}", "function makeGrid(cols, rows) {\n for (let i = 0; i < (cols * rows); i++) {\n const div = document.createElement('div');\n div.style.border = '1px solid black';\n container.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${rows}, 1fr)`;\n container.appendChild(div).classList.add('box');\n }\n}", "function createGrid() {\n const frame = document.getElementById('frame');\n // Add Code to create the game grid\n for (let i = 0; i < 10 ; i++) {\n buildRow(frame); \n }\n setupGame();\n}", "function createGrid() {\n\t// create 2 rows\n // for (var rows = 0; rows < 2; rows++) {\n // $(document.body).append(\"<div class='cards'>khjhjh</div>\");\n // }\n\t// create 2 tiles inside each row\n\tfor (var columns = 0; columns < 4; columns++) {\n\t $('.cards').append(\"<div class='tile'></div>\");\n\t}\n}", "function defineGrid(n){\n\t\tvar boardDiv = document.getElementsByClassName(\"boardCls\")[0] ;\n\t\t$(\"#board\").html(\"\")\n\t\tlet cnt=0 ;\n\t\tfor(let i=0;i<n;i++)\n\t\t{\n\t\t\tvar rowDiv = document.createElement(\"div\") ;\n\t\t\trowDiv.classList.add(\"row\") ;\n\t\t\trowDiv.style.height=(580/n)+\"px\";\n\n\t\t\tfor(let j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tvar singleDiv = document.createElement(\"div\") ;\n\t\t\t\tsingleDiv.classList.add(\"block\") ;\n\t\t\t\tsingleDiv.style.width=(580/n)+\"px\" ;\n\t\t\t\tvar para = document.createElement(\"p\") ;\n\t\t\t\tpara.classList.add(\"number\") ;\n\t\t\t\t\n\t\t\t\tsingleDiv.id=\"block-\"+cnt ;\n\t\t\t\tpara.id=\"blk-\"+cnt;\n\t\t\t\tcnt++ ;\n\t\t\t\tsingleDiv.appendChild(para) ;\n\t\t\t\trowDiv.appendChild(singleDiv) ;\n\t\t\t}\n\t\t\tboardDiv.appendChild(rowDiv) ;\n\t\t}\n\t}", "buildGrid() {\n const $game = $(this.selector);\n for (let row = 0; row < this.Rows; row++) {\n const $row = $(\"<div>\")\n .addClass(\"row\");\n //columns must be nested inside of the rows. for-loop will generate columns.\n for (let col = 0; col < this.Cols; col++) {\n const $col = $(\"<div>\")\n .addClass(\"empty column\")\n .attr(\"data-column\", col)\n .attr(\"data-row\", row)\n $row.append($col);\n }\n $game.append($row);\n }\n }", "function makeGrid() {\n removeGrid();\n let rows = gridHeight.val();\n let columns = gridWidth.val();\n //Add Row to the Table\n for (let addRow = 0; addRow < rows; addRow++) {\n grid.append('<tr class=\"tableRow\">');\n };\n //Add column to the table\n for (let addColumn = 0; addColumn < columns; addColumn++) {\n $(\"tr\").each(function() {\n $(this).append('<td class=\"tableCell\">');\n });\n }\n}", "function buildGrid() {\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(config.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n // console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(config.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('cell');\n row.appendChild(cell);\n\n // console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\n}", "function makeGrid(){\r\n $('#pixel_canvas').children().remove();\r\n row=$('#input_height').val();\r\n column=$('#input_width').val();\r\n var i=0;\r\n while(i<row){\r\n $('#pixel_canvas').append('<tr></tr>');\r\n for(var j=0;j<column;j++){\r\n $('tr').last().append('<td></td>');\r\n }\r\n i++;\r\n }\r\n }", "function createGrid(num){\n\tvar blockNum = num * num;\n\tvar blockSize = 600/num;\n\tfor(var j=0; j < num; j++){\n\t\tfor(var i=0; i < num; i++){\n\t\t\t$('<div />', {class: 'block',\n\t\t\t\twidth: blockSize + 'px',\n\t\t\t\theight: blockSize + 'px'\n\t\t\t}).appendTo('#screen');\n\t\t}\n\t}\n}", "createGrid() {\n let grid = new Array(parseInt(this.width)).fill(0)\n\n for(let col = 0; col < this.width; col++) {\n grid[col] = new Array(parseInt(this.height)).fill(0)\n }\n return grid\n }", "function drawGrid(){\n\t\tvar h = gameArea.canvas.height();\n\t\tvar w = gameArea.canvas.width();\n \n\n var paths = {\n strokeStyle : settings.gridColor,\n strokeWidth: .5,\n layer :true,\n name: 'grid'\n };\n \n var pathCount = 0;\n\t\tfor (var y = 0; y <= h; y += h/settings.rows) {\n pathCount++;\n paths[\"p\"+pathCount] = {\n type: 'line',\n x1: 0, y1: y,\n x2: w, y2: y\n };\n\t\t}\n\n\t\tfor (var x = 0; x <= w; x += w/settings.columns) {\n pathCount++;\n paths[\"p\"+pathCount] = {\n type: 'line',\n x1: x, y1: 0,\n x2: x, y2: h\n };\n\t\t}\n gameArea.canvas.drawPath(paths);\n\t}", "function createGrid() {\n for (let i = 0; i < cellCount; i++) {\n const cell = document.createElement('div')\n // cell.innerText = i\n grid.appendChild(cell)\n cells.push(cell)\n\n // generate borders and map\n if (level === 'beginner') {\n if (i < width || (i % width === 0 && i !== 55) || (i % width === width - 1 && i !== 65) || i + width > width * width - 1 || borderArray.includes(i)) {\n cell.classList.add(borderClass)\n } else if (i === 27) {\n cell.classList.add(fossilClass)\n } else if (i === 20 || i === 100) {\n cell.classList.add(netClass)\n } else if (i === 48 || i === 50) {\n cell.classList.add(fenceClass)\n } else if (!cell.classList.contains(borderClass) && !cell.classList.contains(fossilClass) && !cell.classList.contains(netClass) & !cell.classList.contains(fenceClass) && i !== 59 & i !== 60 & i !== 61) {\n cell.classList.add(foodClass)\n }\n\n grabLives[2].classList.add(hiddenClass)\n\n if (i === 58) {\n centerText = document.createElement('div')\n cell.appendChild(centerText)\n center = document.createElement('p')\n centerText.appendChild(center)\n centerText.classList.add('center-text')\n centerText.classList.add(hiddenClass)\n }\n }\n }\n\n center.innerText = 'Welcome to Animal Crossing, PacMan Edition. \\n Press Start to begin!'\n centerText.classList.remove(hiddenClass)\n center.classList.add('welcome')\n\n addPlayer(playerStartPosition)\n console.log('player added at start')\n addGhost(scorpianStartPosition, scorpianClass)\n addGhost(tarantulaStartPosition, tarantulaClass)\n addGhost(waspStartPosition, waspClass)\n }", "function makeGrid(){\n\tconst inputHt=$('#inputHeight').val(); //Getting input value for row\n\tconst inputWt=$('#inputWidth').val(); //Getting input value for column\n\n\tfor(var i=0;i<inputHt;i++){\n\t\t$('#pixelCanvas').append(\"<tr id=row\" +i+ \"></tr>\"); //creating rows\n\t\tfor(var j=0;j<inputWt;j++){\n\t\t\t$('#row'+i).append(\"<td></td>\"); //creating columns\n\t\t}\n\t}\n}", "function GridCreate() {\r\n var elBody = document.querySelector('body');\r\n var elDiv = document.createElement('div');\r\n\r\n for (var i = 0; i < 3; i++) {\r\n var elDiv = document.createElement('div');\r\n elDiv.setAttribute('id', 'container');\r\n for (var j = 0; j < 3; j++) {\r\n var elBut = document.createElement('div');\r\n elDiv.appendChild(elBut);\r\n elBut.style.background = '#E0E1E1';\r\n elBut.style.padding = '50px';\r\n elBut.style.cursor = 'pointer';\r\n\r\n elBut.setAttribute('class', 'case');\r\n }\r\n elBody.appendChild(elDiv);\r\n\r\n elDiv.style.display = 'flex';\r\n elDiv.style.justifyContent = 'center';\r\n }\r\n}", "function createGrid() {\n grid = [];\n\n //setup cell size and margins\n let cell, marginX, marginY;\n\n //portrait\n if ((width - margin * 2) * GRID_ROWS / GRID_COLS < height - margin * 2) {\n cell = (width - margin * 2) / GRID_COLS;\n marginX = margin;\n marginY = (height - cell * GRID_ROWS) / 2;\n }\n //landscape\n else {\n cell = (height - margin * 2) / GRID_ROWS;\n marginX = (width - cell * GRID_COLS) / 2;\n marginY = margin;\n }\n\n //populate the grid\n for (let i = 0; i < GRID_ROWS; i++) {\n grid[i] = [];\n for (let j = 0; j < GRID_COLS; j++) {\n let left = marginX + j * cell;\n let top = marginY + i * cell;\n grid[i][j] = new Cell(left, top, cell, cell, i, j);\n }\n }\n}", "function createGrid(){\n var color = '#BDBDBD';\n \n //Creates vertical grid\n for(var i = origin.x; i < canvasWidth; i += step){ //Populates right of the origin\n var line = two.makeLine(i, 0, i, canvasHeight);\n line.linewidth = 1;\n line.stroke = color;\n }\n for(var i = origin.x; i > 0; i -= step){ //Populates left of the origin\n var line = two.makeLine(i, 0, i, canvasHeight);\n line.linewidth = 1;\n line.stroke = color;\n }\n \n \n //Creates horizontal grid\n for(var i = origin.y; i < canvasHeight; i += step){ //Populates above the origin\n var line = two.makeLine(0, i, canvasWidth, i);\n line.linewidth = 1;\n line.stroke = color;\n }\n for(var i = origin.y; i > 0; i -= step){ //Populates below the origin\n var line = two.makeLine(0, i, canvasWidth, i);\n line.linewidth = 1;\n line.stroke = color;\n }\n}", "function makeGrid() {\r\n newCanvas.innerHTML = \"\";\r\n for (let h = 0; h < gridHeight.value; h++) {\r\n const rows = document.createElement(\"tr\");\r\n newCanvas.insertAdjacentElement(\"afterbegin\", rows);\r\n for (let w = 0; w < gridWidth.value; w++) {\r\n const cells = document.createElement(\"td\");\r\n cells.addEventListener(\"click\", function () {\r\n cells.style.backgroundColor = cellColor.value;\r\n });\r\n rows.appendChild(cells);\r\n }\r\n }\r\n}", "function makeGrid(number) {\nfor (i = 0; i < (number * number); i++) {\n container.style.gridTemplateColumns = `repeat(${number}, auto)`;\n const square1 = document.createElement('div');\n square1.classList.add('square1');\n let size = 700/number\n square1.style.width = size;\n square1.style.height = size;\n container.appendChild(square1);\n }\n}", "function make_Grid(WIDTH, HEIGHT) {\n var graphics = game.add.graphics(0, 0);\n\t\t\n //adding lines & numbers\n graphics.lineStyle(1, 0x33FF00,0.5);\n var style = { font: \"15px Arial\", fill: \"#ffffff\", align: \"center\" };\n\t\n for (indexAux = 0; indexAux < 10; indexAux = indexAux + 1){\n\ty = (indexAux * GRID_SPACE) + 50;\n\tgraphics.moveTo(0, y); \n\tgraphics.lineTo(WIDTH-20,y);\n\tgame.add.text(WIDTH-20,y-10,String((10-indexAux)),style);\n }\t\n}", "function createGrid (num)\n\t{\n\t\tfor( var i = 0; i < (num * num); i++)\n\t\t{\n\t\t\tvar $grid = $('<div></div>');\n\t\t\t$('#container').append($grid);\n\t\t}\t\n\n\t\t//Sets grid === to height and width of container\n\t\t//2 is used to account for the margin around the boxes.\n\t\t$('div div').height($('#container').height() / num - 2); \n\t\t$('div div').width($('#container').width() / num - 2);\n\t}", "build() {\r\n for (let y = this.y; y < height; y += height / 20) {\r\n for (let x = this.x; x < 400; x += 400 / 10) {\r\n let boxUsed = false;\r\n let col = 255;\r\n this.gameMap.push({\r\n x,\r\n y,\r\n boxUsed,\r\n col\r\n });\r\n // Visualize the grid\r\n rect(x, y, 40, 40);\r\n }\r\n }\r\n }", "function buildBoard(){\n container = document.createElement(\"div\");\n container.classList.add(\"grid-container\");\n\n for(i=0; i < dims; i++){\n for(j = 0; j < dims; j++){\n let temp = makeGridEle(boardSize);\n container.appendChild(temp);\n }\n let br = document.createElement(\"br\");\n container.appendChild(br);\n }\n\n document.body.appendChild(container);\n}", "function createBoard() {\n for (let i=0; i < width*width; i++) {\n square = document.createElement('div')\n square.innerHTML = 0\n gridDisplay.appendChild(square)\n squares.push(square)\n }\n generate()\n generate()\n }", "function createGrid(width, height) {\n for (let i = 0; i < height; i++) {\n let row = document.createElement('div');\n row.classList.add('row');\n\n for (let x = 0; x < width; x++) {\n let pixel = document.createElement('div');\n pixel.classList.add('pixel');\n row.appendChild(pixel);\n }\n grid.appendChild(row);\n }\n}", "function createGrid(num) {\n for(let i = 0; i < num **2; i++) {\n container.appendChild(cellNode.cloneNode(true));\n }\n gridFormat(container, num);\n startColor(color);\n \n \n}", "function makeGrid(height,width) {\n for (let r = 0; r < height; r++) {\n $('#pixel_canvas').prepend('<tr></tr>');\n for (let d = 0; d < width; d++) {\n $('tr').first().append('<td></td>')\n }\n }\n}", "function makeGrid()\n\t{\n\t\tgridData = []\n\t\tK = 0\n\t\tfor (var i = window.nCells.hori ; i >= 0; i--) {\n\t\t\tgridData.push({x1:K,x2:K,y1:0,y2:screenH()})\n\t\t\tK += window.cellDim.w\n\t\t};\n\t\tK = 0\n\t\tfor (var i = window.nCells.vert ; i >= 0; i--) {\n\t\t\tgridData.push({x1:0,x2:screenW(),y1:K,y2:K})\n\t\t\tK += window.cellDim.h\n\t\t};\n\n\t\tsvg.selectAll(\"line.gridLine\").remove()\n\t\tsvg.selectAll(\"line.gridLine\")\n\t\t\t.data(gridData)\n\t\t\t.enter()\n\t\t\t.append(\"line\")\n\t\t\t.attr('class','gridLine')\n\t\t\t.attr(\"x1\",function(d){return(d.x1)})\n\t\t\t.attr(\"x2\",function(d){return(d.x2)})\n\t\t\t.attr(\"y1\",function(d){return(d.y1)})\n\t\t\t.attr(\"y2\",function(d){return(d.y2)})\n\t\t\t.attr(\"stroke-width\",.2)\n\t\t\t.attr(\"stroke\",'rgb(0,0,0)');\n\t}", "function makeGrid(gridContainerSize) {\n for (let i = 0; i < gridContainerSize ** 2; i++) {\n cell = document.createElement('div');\n cell.classList.add('cell');\n cell.style.backgroundColor = 'white';\n gridContainer.appendChild(cell);\n }\n gridContainer.style.gridTemplateColumns = `repeat(${gridContainerSize}, auto)`;\n gridContainer.style.gridTemplateRows = `repeat(${gridContainerSize}, auto)`;\n}", "function createBoard() {\r\n for(let i=0;i<width*width;i++)\r\n {\r\n square = document.createElement('div')\r\n square.innerHTML = 0\r\n gridDisplay.appendChild(square)\r\n squares.push(square)\r\n }\r\n generate()\r\n generate()\r\n\r\n\r\n }", "makeGrid() {\n let grid = []\n for (let row = 0; row < 18; row ++) {\n grid.push([])\n for (let col = 0; col < 10; col ++) {\n grid[row].push(<Square key={`${col}${row}`} color=\"1\" />)\n }\n }\n return grid\n }", "_make_grid() {\n this.options.grid.element.style.gridTemplateColumns = 'repeat(' + this.options.grid.columns + ', 1fr)';\n for (let i in this.options.symbols) {\n let symbol = document.createElement('div');\n symbol.className = this.options.classes.symbol;\n symbol.id = this.options.classes.symbol + '_' + i;\n symbol.textContent = this.options.symbols[i];\n this.options.grid.element.appendChild(symbol);\n }\n if (!this.options.grid.borders) set_css_var('--grid-border-size', '0');\n this._resize();\n window.onresize = this._resize.bind(this);\n }", "function createGrid() {\n\t$('.header').append('<div class=\"container\"></div>'); //create container\n var $row = $(\"<div />\", {\n \tclass: 'row'\n\t});\n\tvar $square = $(\"<div />\", {\n \tclass: 'sq'\n\t});\n\n for (var i = 0; i < columns; i++) {\n $row.append($square.clone());\n }\n for (var i = 0; i < rows; i++) {\n $(\".container\").append($row.clone());\n }\n}", "function createGrid(){\n\n etchContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n etchContainer.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n \n for (let i = 0; i < gridSize * gridSize; i++){\n let etchSquareDiv = document.createElement(\"div\");\n etchSquareDiv.className = 'etchSquare';\n\n //add listener to change the color, for the sketching purposes\n etchSquareDiv.addEventListener(\"mouseenter\", function(){\n etchSquareDiv.style.backgroundColor = 'black';\n })\n\n etchContainer.appendChild(etchSquareDiv);\n } \n}", "createGrid() {\n const board = $(this.selector);\n board.empty();\n\n console.log(board);\n for (let x = 0; x < this.ROWS; x++) {\n const row = $('<div>').addClass('row');\n board.append(row);\n for (let y = 0; y < this.COLS; y++) {\n // gives each index of the rows and columns using the attr\n const col = $('<div>').addClass('col empty').attr('data-col', y).attr('data-row', x);\n row.append(col);\n }\n }\n\n }", "function makeGrid(gridHeight, gridWidth) {\n gridCanvas.innerHTML = \"\"; //clear previous table\n //Table creation code from:\n //https://stackoverflow.com/questions/14643617/create-table-using-javascript\n for (var h = 1; h <= gridHeight; h++) {\n var row = document.createElement('tr');\n for (var w = 1; w <= gridWidth; w++) {\n var column = document.createElement('td');\n row.appendChild(column);\n column.addEventListener('click', function(event) {\n event.target.style.backgroundColor = cellColor;\n })\n }\n gridCanvas.appendChild(row);\n }\n}", "function grid() {\n\tvar spaceX = 64;\n\tvar spaceY = spaceX;\n\n\tstroke(200);\n\tfor (var i = 64; i < width; i += 64) {\n\t\tline(i, 0, i, height);\n\t}\n\tfor (var i = 64; i < height; i += 64) {\n\t\tline(0, i, width, i);\n\t}\n}", "function makeGrid(height, width) {\n // Firstly clear canvas and then start again\n while (canvas.hasChildNodes()){\n canvas.removeChild(canvas.firstChild);\n }\n // Iterate with given height and width to create the clear canvas\n for(var x = 0; x<height; x++){\n var row = document.createElement('tr');\n canvas.appendChild(row);\n for(var y = 0; y<width; y++){\n var column = document.createElement('td');\n row.appendChild(column);\n }\n }\n\n}", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "function createGrid(height, width) {\n bodyTable.innerHTML = \"\";\n for (let h = 0; h < height; h++) { \n var row = document.createElement(\"tr\");\n for (let w = 0; w < width; w++) {\n var column = document.createElement(\"td\");\n row.appendChild(column); \n }\n bodyTable.appendChild(row); \n }\n pixelCanvas.appendChild(bodyTable); \n event.preventDefault();\n bodyTable.addEventListener('click', addColor) \n}", "function setup() {\n createCanvas(400, 400);\n cols = floor(width / w);\n rows = floor(height / w);\n \n // let's create the cell object and put it in the grid\n for (let j = 0; j < rows; j++) {\n for (let i = 0; i < cols; i++) {\n var cell = new Cell(i, j);\n grid.push(cell);\n }\n }\n \n background(0)\n }", "function setup() {\n createCanvas(windowWidth, windowHeight);\n rectMode(CENTER);\n angleMode(DEGREES);\n \n for (let i = 0; i < windowWidth; i += W){\n gridLoc.push([]);\n for (let j = 0; j < windowHeight; j += W){\n // gridLoc[i].push(j);\n grid.push(new Cells(i,j,W));\n } \n }\n}", "function createBoard() {\n for (let i = 0; i < width * width; i++) {\n //every time it loops we want to create a div\n //using .createElement\n const square = document.createElement('div');\n //we want to make the divs draggable. so we just use the\n //setAttribute function and set draggable to true\n square.setAttribute('draggable', true);\n //we also want to use setAttribute to give each square a unique ID\n square.setAttribute('id', i);\n //set a random number based on the candy colors length and a whole number\n let randomColor = Math.floor(Math.random() * candyColors.length);\n //set that color background for the square at this index\n square.style.backgroundImage = candyColors[randomColor];\n //next we add that div to the grid with appendChild\n grid.appendChild(square);\n //we also want to store these squares into an array\n squares.push(square);\n }\n }", "function createGrid(size){\n gridContainer.style.display='grid';\n gridContainer.style.gridTemplateColumns=`repeat(${size},1fr)`;\n gridContainer.style.gridTemplateRows=`repeat(${size},1fr)`;\n createElement(size);\n}", "function drawGrid() {\n\t\tcontext.fillStyle = GRID_COLOR;\n\t\tfor (var i = GRID_CELL_WIDTH; i < canvas.width; i = i + GRID_CELL_WIDTH) {\n\t\t\tfor (var j = GRID_CELL_WIDTH; j < canvas.height; j = j + GRID_CELL_WIDTH) {\n\t\t\t\tcontext.fillRect(i, j, 1, 1);\n\t\t\t}\n\t\t}\n\t}", "function drawGrid() {\n jaws.context.save();\n jaws.context.strokeStyle = \"rgba(5,119,17,0.7)\";\n jaws.context.beginPath();\n\n for (var x = 0; x < m_viewport.max_x; x += cell_size) {\n jaws.context.moveTo(x - m_viewport.x, 0);\n jaws.context.lineTo(x - m_viewport.x, jaws.height);\n }\n for (var y = 0; y < m_viewport.max_y; y += cell_size) {\n jaws.context.moveTo(0, y - m_viewport.y);\n jaws.context.lineTo(jaws.width, y - m_viewport.y);\n }\n\n jaws.context.closePath()\n jaws.context.stroke()\n jaws.context.restore()\n }", "function createGrid(h, v){\n let width = 960 / h;\n for (var i = 1; i <= v * h; i++) {\n var div = document.createElement('div');\n div.className = 'cell';\n div.style.border = 'solid 1px black';\n container.appendChild(div);\n container.appendChild(br);\n }\n cellsEvent();\n container.style.display = 'grid';\n container.style.gridTemplateRows = 'repeat(' + v + ', ' + width + 'px)';\n container.style.gridTemplateColumns = 'repeat(' + h + ', ' + width + 'px)';\n container.style.justifyContent = 'center';\n}", "function createBoard() {\n for (let i = 0; i < width * width; i++) {\n const square = document.createElement(\"div\");\n //put this child into the gird\n grid.appendChild(square);\n squares.push(square);\n\n // Assigning a random colour to each div\n let randomColor = Math.floor(Math.random() * coloursOfCancy.length);\n square.style.backgroundImage = coloursOfCancy[randomColor];\n\n //To drag each square and give unique ID to each cell so we can see which square is actually moved.\n square.setAttribute(\"draggable\", \"true\");\n square.setAttribute(\"id\", i);\n }\n }", "function initGrid() {\n row = [];\n for (var j = 0; j < GRID_H; j++) {\n\trow.push('');\n }\n grid = [];\n for (var i = 0; i < GRID_W; i++) {\n\tgrid.push(Array.from(row));\n }\n}", "function makeGrid(event) {\n// Your code goes here!\n event.preventDefault();\n let height = heightInput.value;\n let width = widthInput.value;\n console.log(height + \",\" + width);\n while (pixelCanvas.firstChild) {\n pixelCanvas.removeChild(pixelCanvas.firstChild);\n }\n\n for (let i = 0; i < height; i++) {\n let newRow = document.createElement(\"tr\");\n for (let j = 0; j < width; j++) {\n let newTd = document.createElement(\"td\");\n newRow.appendChild(newTd);\n }\n pixelCanvas.append(newRow);\n }\n}", "function createGrid(size) {\n\tif (gridBlocks.length > 0) {\n\t\tfor (let block = 0; block < gridBlocks.length; block++) {\n\t\t\tcontainer.removeChild(gridBlocks[block]);\n\t\t}\n\n\t\tgridBlocks = [];\n\t}\n\n\tcontainer.style['grid-template-columns'] = `repeat(${size}, 1fr)`;\n\n\tfor (let i = 0; i < (size * size); i++) {\n\t\tconst gridBlock = document.createElement('div');\n\t\tgridBlock.style.width = `${480 / size}`;\n\t\tgridBlock.style.height = `${480 / size}`;\n\t\tgridBlock.style.border = '1px solid rgba(0, 0, 0, 0.3)';\n\t\tcontainer.appendChild(gridBlock);\n\n\t\tgridBlocks.push(gridBlock);\n\t}\n\n\tcheckForClick();\n\n}", "function makeCanvas(x, y) {\n canvas.style.setProperty(\"--grid-cols\", x);\n canvas.style.setProperty(\"--grid-rows\", y);\n for (let i = 0; i < x * y; i++) {\n let cell = document.createElement(\"div\");\n canvas.appendChild(cell).className = \"cell\";\n }\n}", "function makeGrid(height, width) {\n // set size of canvas\n for (var i = 0; i < height.value; i++) {\n const row = canvas.insertRow(i); // calls the function to set size rows\n for (var j = 0; j < width.value; j++) {\n const cell = row.insertCell(j); // cal the function to set size of insertCell\n cell.addEventListner(\"click\", fillSquare);\n }\n }\n}", "function makeGrid(){\n\n table.innerHTML =''; //czyszczenie tabeli\n\n const fragment = document.createDocumentFragment(); // DocumentFragment wrapper\n\n for(let h = 0; h < gridHeight.value; h++){\n let tr = document.createElement('tr');\n fragment.appendChild(tr);\n for(let w = 0; w < gridWitdh.value; w++){\n let td = document.createElement('td');\n tr.appendChild(td);\n }\n }\n table.appendChild(fragment);\n colorSet();\n colorClick();\n colorRemove();\n}", "createGrid(starti, startj, endi, endj, level, mapped) {\n for (let i = 0; i < this.rows; i++) {\n\n let rowgrid = [];\n for (let j = 0; j < this.columns; j++) {\n let cell = new Cell(\n i, \n j, \n (i==starti && j==startj), \n (i==endi && j==endj), \n level, \n mapped\n );\n paintCell(cell);\n rowgrid.push(cell);\n }\n this.grid.push(rowgrid);\n }\n }", "function makeGrid() {\n\n let h = height.value;\n let w = width.value;\n\n // Clear table\n for (let i = table.rows.length; i > 0 ; i--) {\n table.deleteRow(i - 1);\n }\n\n for (let y = 0; y < h; y++) {\n const newTr = document.createElement('tr');\n table.appendChild(newTr);\n for (let x = 0; x < w; x++) {\n const newTd = document.createElement('td');\n table.lastChild.appendChild(newTd);\n }\n }\n\n let cell = table.querySelectorAll('td');\n\n for (let i = 0; i < cell.length; i++) {\n cell.item(i).addEventListener('click', function () {\n this.style.backgroundColor = color.value;\n });\n }\n}", "function makeGrid(HEIGHT,WIDTH) {\n\n// Your code goes here!\nfor (let i = 0; i < HEIGHT; i++) {\n $PCANVA.append('<tr></td>');\n };\n\n for (let i = 0; i < WIDTH; i++) {\n $('tr').append('<td></td>');\n };\n}", "function setupGrid() {\n\n // Initialize the grid with all false values, i.e. the inactive state\n for (let i = 0; i < numRectanglesWide; i++) {\n grid.push([]);\n for (let j = 0; j < numRectanglesHigh; j++) {\n grid[i].push(false);\n }\n }\n\n ctx.strokeStyle = gridColor;\n ctx.lineWidth = gridThickness;\n\n const drawLine = (x1, y1, x2, y2) => {\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n };\n\n // Since we draw the lines on the left and top sides of each rectangle,\n // we need to use <= instead of < so that the last border is drawn\n\n // Draws vertical grid lines\n for (let i = 0; i <= numRectanglesWide; i++) {\n const x = i * rectangleWidth + i * gridThickness;\n drawLine(x, 0, x, canvas.height);\n }\n\n // Draws horizontal grid lines\n for (let i = 0; i <= numRectanglesHigh; i++) {\n const y = i * rectangleHeight + i * gridThickness;\n drawLine(0, y, canvas.width, y);\n }\n }", "function createBoard(){\n\tdocument.body.style.setProperty('--size', size);//set\n\tdocument.body.style.setProperty('--grid-size', size+1);//set\n\n\tvar th = document.createElement('div');\n\tth.className = \"content head\";\n\tth.innerHTML = \"\";\n\tth.id = \"header\"\n\tdom.gameBoard.appendChild(th);\n\t//initialize alphabetical headers\n\tfor (var row = 0; row < size; row++) {\n\t\tvar letter = (row+10).toString(36);\n\t\tvar th = document.createElement('div');\n\t\tth.className = \"content head\";\n\t\tth.innerHTML = letter;\n\t\tth.id = \"header\"\n\t\tdom.gameBoard.appendChild(th);\n\t}\n\n\tfor(var i = 0; i < size; i++){\n\t\tvar th = document.createElement('div');\n\t\tth.className = \"content head\";\n\t\tth.innerHTML = i+1;\n\t\tth.id = \"header\"\n\t\tdom.gameBoard.appendChild(th);\n\n\t\tfor(var x = 1; x <= size; x++){\n\t\t\tvar cell = document.createElement(\"div\");\n\t\t\tcell.classList.add(\"content\");\n\t\t\t//logic for borderes\n\t\t\tif (x == size){\n\t\t\t\tcell.classList.add(\"child-with-border\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcell.classList.add(\"child\");\n\t\t\t}\n\t\t\tif (i == size-1){\n\t\t\t\tcell.classList.add(\"child-edge\");\n\t\t\t}\n\t\t\tvar num = (i * (size) + x).toString();\n\t\t\tcell.id = \"cell\"+num;\n\t\t\tdom.gameBoard.appendChild(cell);\n\t\t}\n\t}\n}", "function makeGrid(h,l) {\n // Remove previous grid if any\n $(grid).children().remove();\n // Loops to draw new Grid\n for (i=0 ; i<h ; i++){ // Loop on each row\n grid.append('<tr></tr'); //Add the row\n for (j=0 ; j<l ; j++){ //Loop on each column\n let currentRow =grid.find('tr').last();\n currentRow.append(\"<td></td>\"); // Add a cell at the end of the current row\n }\n }\n}", "function drawGrid(gridSize) {\n let gridArea = gridSize * gridSize;\n for (let i = 0; i < gridArea; i++) {\n const box = document.createElement('div');\n box.classList.add('box');\n box.attributes.width = 600/gridSize;\n box.attributes.length = 600/gridSize;\n gridContainer.appendChild(box);\n box.addEventListener('mouseover', function() {\n sketch(box);\n });\n }\n gridContainer.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n gridContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n}", "function makeGrid() {\n canvas.find('tbody').remove();\n\n //submit button size changes to fit grid size\n var gridRows = heightInput.val();\n var gridCol = weightInput.val();\n\n //tbody set to the table\n canvas.append('<tbody></tbody>');\n\n var canvasBody = canvas.find('tbody');\n\n //drawing grid rows\n for (var i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n //draw grid col\n for (var i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n }", "function makeGrid() {\r\n Artmaker.canvas.innerHTML = \"\";\r\n while (Artmaker.canvas.rows.length > 0) {\r\n Artmaker.canvas.deleteRow(0);\r\n }\r\n for (var i = 0; i < Artmaker.rows.value; i++) {\r\n var row = Artmaker.canvas.insertRow(i);\r\n row.setAttribute(\"class\", \"row\");\r\n for (var j = 0; j < Artmaker.columns.value; j++) {\r\n var cell = row.insertCell(j);\r\n cell.addEventListener(\"click\", function(e) {\r\n e.target.style.backgroundColor = Artmaker.color.value;\r\n });\r\n }\r\n }\r\n return false;\r\n}", "function createBoard() {\n\tfor (let i = 0; i < layout.length; i++) {\n\t\tconst square = document.createElement('div')\n\t\tgrid.appendChild(square)\n\t\tsquares.push(square)\n\n\t\t//add layout to the board\n\t\t//we want to check what is on the board on every position :\n\t\tif (layout[i] === 0) {\n\t\t\tsquares[i].classList.add('pac-dot')\n\t\t} else if (layout[i] === 1) {\n\t\t\tsquares[i].classList.add('wall')\n\t\t} else if (layout[i] === 2) {\n\t\t\tsquares[i].classList.add('ghost-lair')\n\t\t} else if (layout[i] === 3) {\n\t\t\tsquares[i].classList.add('power-pellet')\n\t\t}\n\t}\n}", "function makeGrid(gridHeight, gridWidth) {\n while (PIXEL_CANVAS.firstChild){\n \tPIXEL_CANVAS.removeChild(PIXEL_CANVAS.firstChild);\n }\n\n //Create the grid rows\n for (let gridRow = 0; gridRow < gridHeight; gridRow++) {\n const newRow = document.createElement('tr');\n PIXEL_CANVAS.appendChild(newRow);\n // insertAdjacentHTML('beforeend', '<tr class=\"grid-row\"></tr>');\n for (let i = 0; i < gridWidth; i++) {\n const newCell = document.createElement('td');\n newRow.appendChild(newCell);\n }\n }\n}", "function makeGrid(newNum){\n userInptNum = newNum;\n container.style.gridTemplateRows = userInptNum;\n container.style.gridTemplateColumns = userInptNum;\n\n for (let i = 1; i <= userInptNum; i++){\n for(let j = 1; j <= userInptNum; j++){\n let square = document.createElement('div');\n square.classList.add('square');\n square.style.backgroundColor = \"rgb(250,250,250\";\n square.style.gridRow = i;\n square.style.gridColumn = j;\n container.appendChild(square);\n\n }\n \n }\n getColor();\n \n}" ]
[ "0.804228", "0.79481465", "0.79037184", "0.7850515", "0.78166574", "0.7792787", "0.778525", "0.76863337", "0.7627451", "0.7592078", "0.7573319", "0.7566132", "0.75278264", "0.7494713", "0.7482197", "0.74779546", "0.7464974", "0.74450034", "0.74395144", "0.7438352", "0.7436363", "0.7411038", "0.7405604", "0.7401185", "0.7394727", "0.738786", "0.73819655", "0.7374414", "0.7370895", "0.734604", "0.7340481", "0.7334488", "0.73333615", "0.7309893", "0.7306706", "0.7290613", "0.72825724", "0.7282175", "0.72716206", "0.7255712", "0.72387415", "0.7230516", "0.72237", "0.72209656", "0.72209656", "0.722042", "0.7186828", "0.71828014", "0.7173049", "0.71556276", "0.7155275", "0.7152698", "0.71480364", "0.71372175", "0.7125738", "0.71084994", "0.7106328", "0.7102178", "0.71016634", "0.7088397", "0.7084757", "0.70698684", "0.7066769", "0.70624095", "0.7060704", "0.7053325", "0.7051154", "0.70491433", "0.7045737", "0.7044081", "0.7042609", "0.7042609", "0.7042609", "0.7042609", "0.7035844", "0.70331717", "0.7029694", "0.702895", "0.7023474", "0.7022864", "0.70132184", "0.7009302", "0.7008026", "0.70010805", "0.70004916", "0.699912", "0.69869024", "0.6985593", "0.6984843", "0.69781196", "0.6976338", "0.6976195", "0.69740593", "0.6973202", "0.6970294", "0.696232", "0.6962319", "0.69613355", "0.6956811", "0.6949963", "0.6945205" ]
0.0
-1
Delete the grid on screen
function deleteGrid(grid) { grid.classList.remove('wall-grid'); grid.classList.remove('point-grid'); grid.classList.remove('pacman-grid'); grid.classList.add('empty-grid'); grid.removeAttribute('style'); grid.innerHTML = ''; grid.style.border = '1px solid #E5E5E5'; grid.style.backgroundColor = '#FFF'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeGrid() {\n grid.empty();\n}", "function deleteBoard(){\n\tif(grid != null){\n \t\tdocument.body.removeChild(grid);\n \t}\n}", "function deleteGrid(){\n grid.innerHTML = '';\n }", "function deleteGrid(){\n var myNode = document.getElementById('grid-container');\n while(myNode.firstChild){\n myNode.removeChild(myNode.firstChild);\n }\n // RESET COLOR TO DEFAULT\n rainbowColor = false;\n darkenColor = false;\n}", "function deleting_grid()\n {\n for (var n=table_grid.rows.length ; n>=2; n--)\n {\n table_grid.removeChild(table_grid.childNodes[n]);\n }\n\n }", "function clearGrid() {\n canvas.empty();\n}", "function clearGrid(){\n $(\".grid\").remove();\n}", "function clearGrid() {\n while (grid.firstChild) {\n grid.removeChild(grid.firstChild);\n }\n }", "function clearGrid(){\n\t$(\"div.pixel\").remove();\n}", "function removeGrid() {\n console.log(\"REDRAW\");\n const list = document.getElementsByClassName(\"grid-row\");\n for (let i = list.length - 1; 0 <= i; i--)\n if (list[i] && list[i].parentElement)\n list[i].parentElement.removeChild(list[i]);\n gridSize();\n}", "function cleanGrid(){\n while (canvasBox.hasChildNodes()){\n canvasBox.removeChild(canvasBox.firstChild);\n }\n}", "function removeGrid() {\n for (var i = 0; i<= gridGroup.children.length-1; i++) {\n gridGroup.children[i].remove();\n }\n gridGroup.remove();\n}", "function clearGrid() {\n const gridArray = Array.from(gridContainer.childNodes);\n gridArray.forEach((element) => {\n gridContainer.removeChild(element);\n });\n}", "function deleteGrid() {\n while (gridContainer.firstChild) {\n // gridContainer.removeEventListener('mousedown', sketch);\n // gridContainer.removeEventListener('mouseenter', sketch);\n gridContainer.lastChild = null;\n gridContainer.removeChild(gridContainer.lastChild);\n console.log('deleted');\n }\n}", "function clearGrid() {\n const gridArray = Array.from(gridContainer.childNodes);\n gridArray.forEach((element) => {\n gridContainer.removeChild(element);\n });\n}", "function clearGrid(){\n newGridInput();\n}", "clearGrid() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = DEAD;\n }\n }\n }", "function clearGrid() {\n while (grid.firstChild){\n grid.removeChild(grid.firstChild);\n }\n}", "function clearGrid(){\n $('.wrapper > div').remove();\n var num = 10\n userGridSize(num);\n changeSquareColor();\n}", "function onClearButtonPressed() {\n for (var x = 0; x < window.numCellsX; x++) {\n for (var y = 0; y < window.numCellsY; y++) {\n window.grid[x][y] = false;\n }\n }\n drawGrid();\n}", "function eraseGrid(){ \n grid.innerHTML = '';\n buildGrid(selectedSize);\n}", "function clearGrid() {\n while(container.firstChild) {\n container.removeChild(container.firstChild);\n }\n}", "function clearGrid() {\n clearPipes();\n clearObstacles();\n}", "function emptyGrid() {\n while (grid.hasChildNodes()) {\n grid.removeChild(grid.children[0]);\n }\n}", "function clearGrid(){\n var table = document.getElementById(\"pixelCanvas\");\n var cells = document.getElementsByClassName(\"cell\");\n if(cells.length > 0){\n // remove table body\n table.firstElementChild.remove()\n }\n}", "clearCells(){\n var cells = this.GRID_DIV.children;\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n cell.style.backgroundColor = \"white\";\n }\n this.saveLocally();\n }", "function clearGrid(){\n \n if ($.gridView.children.length > 0){\n \n _.each($.gridView.getChildren, function(itemView){\n itemView.removeEventListener('click', onItemSelected);\n $.gridView.remove(itemView);\n itemView = null;\n });\n \n $.gridView.removeAllChildren();\n }\n}", "function removegrid(size) {\n for (let i = 1; i < (size + 1); i++) { \n const removeDiv = document.getElementById(`grid${i}`);\n removeDiv.remove();\n }\n}", "function clearGrid(){\n while (container.hasChildNodes()){\n container.removeChild(container.firstChild);\n }\n}", "function clearGrid() {\n\t$('.box').css('background', '#faebd7');\n}", "destroy() {\r\n if (!this.slickGrid) return;\r\n\r\n this.slickGrid.destroy();\r\n }", "function deleteSquares(){\n let grid = document.getElementById('grid');\n while(grid.firstChild){\n grid.removeChild(grid.firstChild);\n }\n}", "function clearBoard() {\n\tdocument.getElementById('gridClear').play();\n\tfor(x = 0; x < 7; x++){\n\t\tfor(y = 0; y < 6; y++) {\n\t\t\tgrid[x][y] = null;\n\t\t\t$('#'+(x+1)+'_'+(y+1)).css('visibility', 'hidden');\n\t\t}\n\t}\n}", "function cleanGrid(){\n trList.forEach(function (tr) {\n tr.remove();\n });\n}", "function clearGrid() {\n for (let i = 0; i < dimension; i++) {\n for (let j = 0; j < dimension; j++) {\n grid[i][j] = 0;\n }\n }\n drawGrid();\n}", "clearBoard () {\n $('.mushroom-container').empty();\n }", "function clear() {\n if (generate) return\n const freshGrid = buildGrid()\n setGrid(freshGrid)\n genCount.current = 0\n }", "function clearGrid (){\n for (let i = 0; i < 625; i++){\n cells[i].classList = null\n \n }\n }", "function clearGrid() {\n for (let i = 0; i < numRectanglesWide; i++) {\n for (let j = 0; j < numRectanglesHigh; j++) {\n setAndPlotRectangle(i, j, false);\n }\n }\n }", "function clearScreen() {\n const squares = document.querySelectorAll('.square');\n // Remove squares from DOM\n squares.forEach((square) => {\n square.remove();\n });\n const userSquares = prompt(\"Enter number of squares per side\");\n createGrid(userSquares);\n}", "function removeGrid(id){\n id++;\n for(var i = 0; i < row; i++){\n for(var j = 0; j < col; j++){\n document.getElementById(`p${id}-${i}-${j}`).removeEventListener(\"click\", markCoordinates);\n }\n }\n}", "function deleteGrid(elementId) {\n console.log(\"Delete \" + elementId);\n deleteChart(elementId);\n document.getElementById(elementId).remove();\n\n for (let i = 0; i < gridElements.layout.length; i++) {\n if (elementId.valueOf() === gridElements.layout[i].element_id) {\n gridElements.layout.splice(i, 1);\n gridElements.layout_order.splice(gridElements.layout_order.indexOf(elementId.toString()), 1);\n }\n }\n\n sendUpdateLayoutRequest(JSON.stringify(gridElements));\n initGrid();\n}", "function clearGrid() {\n for(let i = 0; i < grid.length; i++) {\n grid[i].style.backgroundColor = '#FFF';\n }\n}", "function removeGrid(){\n\n\tconst table= document.getElementsByTagName('table').item(0);\n\tconst i = table.rows.length-1;\n\n\twhile (i>=0){\n\t\ttable.remove(0);\n\t\ti--;\n\t}\n\n}", "function clear_canvas() {\r\n isRunning = false;\r\n populateGameGrid(gameGrid);\r\n updateCells(gameGrid);\r\n drawGridLines();\r\n generation = 0;\r\n document.getElementById(\"gen-num\").innerHTML = generation;\r\n }", "cleanScreen(){\n\t\tthis.gridOptions.columnDefs = [];\n\t\tthis.gridOptions.data = [];\n\t}", "function clear() {\n data = [];\n $grid.find('.row').remove();\n }", "dispose() {\n $(window).off(`resize.grid.${this._gridUid}`);\n }", "function deleteDivs() {\n let grid = Array.from(container.childNodes);\n grid.forEach((element) => {\n container.removeChild(element); \n })\n}", "function clearBoard()\r\n{\r\n 'use strict';\r\n \r\n var i;\r\n data.game.running = false;\r\n \r\n for(i = 0; i < data.board.line; i++)\r\n {\r\n document.getElementById(\"board\").deleteRow(0);\r\n } \r\n clearInterval(data.game.clock);\r\n}", "function clearPrevGrid(){\n // Select all the squares\n let squares = qsa(\".square\");\n // Remove the contents of all squares\n for (let i = 0; i < squares.length; i++) {\n squares[i].remove();\n }\n // Clear any remaining time on timer\n if (timer) {\n clearTimeout(timer);\n }\n // Deselect any numbers still selected\n for (let i = 0; i < id(\"number-selector\").children.length; i++) {\n id(\"number-selector\").children[i].classList.remove(\"selected\");\n }\n // Clear all selected variables\n selectedNumber = null;\n selectedSquare = null;\n}", "function ResetGameBoard() {\n for (i = 0; i < myGame.board.length; i++) {\n var row = $(\"#x\"+i);\n row.empty();\n /*$('#tableZone').remove(row);*/\n console.log(\"delete row \" +i); // Problème avec le visuel des joueurs qui reste en place\n }\n}", "function clearAfterDelete() {\n grid.innerHTML = \"\"\n artworkTitle.value = \"\"\n}", "function removeRow() {\n if (numRows > 0) {\n grid.lastElementChild.remove()\n numRows--;\n }\n if (numRows == 0) {\n numCols = 0\n }\n\n}", "function clearGrid(gridItems)\n{\n // console.log('clicked');\n rangeSlider.value = 1\n sizeLabel.textContent = `Grid Items Opacity : ${rangeSlider.value}`\n // removes all the possible color classes associated w a grid item\n for (let i = 0; i < gridItems.length; i++)\n {\n gridItems[i].style.backgroundColor = 'white'\n gridItems[i].style.cssText = 'backgroundColor : white; opacity : 1'\n }\n}", "function clearBoard() {\n\tbgTileLayer.removeChildren();\n\tpieceLayer.removeChildren();\n\tfgTileLayer.removeChildren();\n}", "function deleteBoard() {\n if(document.getElementById('board').children) {\n for (let i=0; i<rows; i++){\n for (let j=0; j< cols; j++){\n let id = i + '_' + j;\n let el = document.getElementById(id);\n board.removeChild(el);\n }\n }\n }\n \n}", "function cleanUp() {\n if (grid) {\n grid.wazObservableGrid(\"destroy\");\n grid = null;\n }\n }", "remove(line) {\n this.grid.remove(line)\n }", "function resetGrid(){\r\n startIsClicked = false;\r\n for (let y = 0; y < rows; y++){\r\n for(let x = 0; x < cols; x++){\r\n grid[y][x].alive = 0;\r\n kill(grid[y][x].cellRef)\r\n }\r\n }\r\n}", "function clearGrid(){\n console.log(\"clearGrid\")\n for (let i = 0; i < GRID_ROW_SIZE; i++) { \n for (let j = 0; j < GRID_COL_SIZE; j++) {\n Grid[i][j].State = \"NULL\"\n Grid[i][j].VisitedAt = -1\n document.getElementById(Grid[i][j].id).innerHTML=\"\";\n \n }\n }\n Grid[0][0].State = \"Start\"\n Grid[GRID_ROW_SIZE-1][GRID_COL_SIZE-1].State = \"End\"\n document.getElementById(Grid[0][0].id).innerHTML=\"<div class='startpoint'></div>\";\n document.getElementById(Grid[GRID_ROW_SIZE-1][GRID_COL_SIZE-1].id).innerHTML=\"<div class='endpoint'></div>\";\n \n}", "function resetGrid(){\n $('.box').css({'background-color': '#EDEDED'});\n $('.box').off();\n }", "function removeGridChilds() {\n while (sketchContainer.firstChild) {\n sketchContainer.removeChild(sketchContainer.lastChild);\n }\n}", "clearWorkspace() {\n // REMOVE THE ITEMS\n for (let i = 0; i < 5; i++) {\n let item = document.getElementById(\"item-\" + (i+1));\n item.innerHTML = \"\";\n\n // When there's no items, they shouldn't be draggable\n item.draggable = false;\n }\n }", "function removeDivFromGrid() {\n while (true) {\n let div = document.querySelector('#cell');\n if (grid.contains(div)) {\n grid.removeChild(div);\n } else {\n break;\n }\n }\n}", "function clearCanvas(event) {\n Array.prototype.forEach.call(canvasCells, function (cell) {\n cell.style.backgroundColor = \"#FFFFFF\";\n });\n}", "function clearGrid(squareContent) {\n squareContent.style.backgroundColor = '#FFFFFF';\n}", "deleteCanvas() {\n this.canvas.remove();\n }", "function makeGrid() {\n\tevent.preventDefault();\n\tconst height = document.getElementById(\"input_height\").value;\n\tconst width = document.getElementById(\"input_width\").value;\n\tlet table = document.getElementById(\"pixel_canvas\");\n\tconst delELeCell = document.getElementsByClassName(\"cell\");\n\t//console.log(delELeCell.length);\n\tlet k = delELeCell.length - 1;\n\twhile(k >= 0){\n\t\tconst parent = delELeCell[k].parentNode;\n\t\tparent.removeChild(delELeCell[k]);\n\t\tk--;\n\t}\n\n\tconst delRow = document.getElementsByClassName(\"row\");\n\tk = delRow.length - 1;\n\twhile(k >= 0){\n\t\tconst parent = delRow[k].parentNode;\n\t\tparent.removeChild(delRow[k]);\n\t\tk--;\n\t}\n\n\tfor(let i = 0; i < height; i++){\n\t\tconst row = document.createElement(\"tr\");\n\t\trow.setAttribute(\"id\", `row_${i}`);\n\t\trow.setAttribute(\"class\", \"row\");\n\t\ttable.appendChild(row);\n\t\t//const findRow = document.getElementById(`row_${}`)\n\t\tfor(let j = 0; j < width; j++){\n\t\t\tconst column = document.createElement(`td`);\n\t\t\tcolumn.setAttribute(\"id\", `cell_${i}_${j}`);\n\t\t\tcolumn.setAttribute(\"class\", \"cell\");\n\t\t\trow.appendChild(column);\n\t\t}\n\t}\n\tconst buttonLen = document.getElementsByTagName(\"button\");\n\tif(buttonLen.length === 0){\n\t\tconst button = document.createElement(\"button\");\n\t\tconst text = document.createTextNode(\"Reset\");\n\t\tbutton.appendChild(text);\n\t\tdocument.getElementsByTagName(\"body\")[0].appendChild(button);\n\t}\n}", "remove() {\n this.holder.remove()\n this.createAltRowBtn.remove()\n }", "function contentDelete(column,tile){\n if (grid[column][tile].content){\n }\n grid[column][tile].content = null;\n grid[column][tile].type = \"empty\";\n grid[column][tile].isWalkable = true;\n}", "function clean_board(fighter){\n\n var x =fighter.coordinate_x;\n var y =fighter.coordinate_y; \n var id = '#'+x+'_'+y; \n $(id).empty();\n}", "function removeRow(){\r\n $('#pixel_canvas').children().last().remove();\r\n row--;\r\n }", "function clearBoard(event) {\n\t\tfor (i = 0; i < squares.length; i++) {\n\t\t\tsquares[i].className = \"col-sm-2 unUsedSquare\";\n\t\t\tsquares[i].style.backgroundColor= \"white\";\n\t\t\tsquares[i].innerHTML=\"\";\n\t\t}\n\t}", "clear(){\n this.clearHolder.addEventListener(\"click\", ()=>{\n this.createCanvas();\n document.querySelectorAll(\".tempPaint\").forEach(x=>x.remove())\n }) \n }", "function cleardisplay(){\n $('.textbox-row').closest('.row-fluid').remove();\n $(\".firstDiv\").remove();\n $('.side-labels').empty();\n $(\".start-row\").empty();\n $(\".chart-container\").remove();\n $(\".continue-row\").remove();\n chart = [];\n }", "clear() {\n const clearGrid = this.getStartGrid();\n this.setState({\n grid: clearGrid,\n clearedActions: this.state.actionCount\n });\n // eslint-disable-next-line\n this.state.start_node_col = null;\n // eslint-disable-next-line\n this.state.start_node_row = null;\n // eslint-disable-next-line\n this.state.finish_node_col = null;\n // eslint-disable-next-line\n this.state.finish_node_row = null;\n for (let row = 0; row < 20; row++) {\n for (let col = 0; col < 45; col++) {\n if (row === this.state.start_node_row && col === this.state.start_node_col) {\n document.getElementById(`node-${row}-${col}`).className =\n 'node start-node';\n } else if (row === this.state.finish_node_row && col === this.state.finish_node_col) {\n document.getElementById(`node-${row}-${col}`).className =\n 'node finish-node';\n } else {\n document.getElementById(`node-${row}-${col}`).className =\n 'node ';\n }\n }\n }\n }", "wipe() {\n\t\tthis.board.deleteBoard()\n\t}", "function clearGrid () {\n squares.forEach(square => {\n square.removeEventListener('mouseenter', paintSquare);\n square.style.backgroundColor = 'rgb(228, 166, 125)';\n square.addEventListener('mouseenter', paintSquare);\n });\n}", "function undraw() {\n currentTetromino.forEach(index => {\n //unrender tetromino cells by removing class 'tetromino'\n squares[currentPosition + index].classList.remove('tetromino');\n //remove color\n squares[currentPosition + index].style.backgroundColor = '';\n });\n }", "delete() {\n this.removeAllConnections()\n \n let parent = this.getParent()\n let diagram = this.getDiagram()\n \n if (parent) {\n parent.removeChild(this)\n } else {\n diagram.removePane(this)\n }\n \n this.redrawAllConnectionsInDiagram()\n }", "destroy() {\n this.panel.remove();\n }", "remove(){\n this.removeViews(Object.keys(this.views));\n this.el.innerHTML = null;\n this.layouts[this.layout].isRendered = false;\n this.layout = null;\n }", "function reset() {\n gridPoints = []; // resets the gridPoints so that it clears the walls etc. on reset.\n gridPointsByPos = [];\n openSet.clear();\n closedSet.clear();\n gctx.clearRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);\n grid.createGrid();\n\n}", "clearRows() {\n this.emptyCache();\n const all = this.element.querySelectorAll('.b-grid-row'),\n range = document.createRange();\n\n if (all.length) {\n range.setStartBefore(all[0]);\n range.setEndAfter(all[all.length - 1]);\n range.deleteContents();\n }\n }", "function clearGridSaveWall(){\n for (let i = 0; i < GRID_ROW_SIZE; i++) { \n for (let j = 0; j < GRID_COL_SIZE; j++) {\n let State = Grid[i][j].State;\n if(State == \"Wall\" || State == \"Start\" || State == \"End\"){\n continue;\n }\n Grid[i][j].State = \"NULL\"\n Grid[i][j].VisitedAt = -1\n document.getElementById(Grid[i][j].id).innerHTML=\"\";\n }\n }\n \n}", "delete(x,y){\r\n this.board[x][y] = 0;\r\n }", "function clearBoard() {\n var leftColumn = document.getElementById('leftcol')\n leftColumn.removeChild(leftColumn.lastChild)\n\n var rightColumn = document.getElementById('rightcol')\n rightColumn.removeChild(rightColumn.lastChild)\n}", "clearRows() {\n this.emptyCache();\n const all = this.element.querySelectorAll('.b-grid-row'),\n range = document.createRange();\n\n if (all.length) {\n range.setStartBefore(all[0]);\n range.setEndAfter(all[all.length - 1]);\n range.deleteContents();\n }\n }", "function removeColumn() {\n if (numCols > 0) {\n let rows = document.querySelectorAll('.row')\n rows.forEach(function (row) {\n row.lastElementChild.remove()\n })\n numCols--;\n }\n if (numCols == 0) {\n while (grid.firstChild) {\n grid.removeChild(grid.lastChild)\n }\n numRows = 0\n }\n\n}", "function deletePreviousCanvas(){\n\tlet tr;\n\ttr = canvas.find('tr');\n\ttr.remove();\n}", "function removeBoardPaint() {\n let getHeightDivs = document.querySelectorAll('.tr');\n for (let index = 0; index < getHeightDivs.length; index += 1) {\n getHeightDivs[index].remove();\n }\n}", "function resetGrid () {\n gridCounter = 0;\n $('#pass-button').hide();\n $('#reset-cells-button').show();\n\n $('#reset-cells-button').off().on(\"click\", function () {\n for(var i = 0; i < numberInGrid.length; i++) {\n $('.game-cell').css('background-color', 'red');\n generateNumber(); // ensure that correct orientation mode is selected\n selectCell();\n }\n });\n }", "function editorDestroyTile(map, px, py) {\n var list = edTiles[px + py*map.x]; // list of list\n list.forEach(s => s.destroy());\n list.splice(0, list.length);\n}", "function removeLogoGrid() {\n /* Remove max/min width styling to allow resize on draw */\n document.getElementById(\"logoContainer\").style.removeProperty(\"max-width\");\n document.getElementById(\"logoContainer\").style.removeProperty(\"min-width\");\n\n c4.logo.animState = false; //Set the global animState to false to stop any active animations\n\n dataGridDisplayRemove(\"logoGrid\"); //Remove the logoGrid dataGridDisplay\n}", "function clear() {\n let gridChildren = document.getElementById('grid').childNodes;\n gridChildren.forEach((child) => {\n child.style.backgroundColor = '#FFF';\n });\n}", "onStoreRemoveAll() {\n // GridSelection mixin does its job on records removing\n super.onStoreRemoveAll && super.onStoreRemoveAll(...arguments);\n\n if (this.isPainted) {\n this.rowManager.clearKnownHeights();\n this.renderRows();\n this.toggleEmptyText();\n }\n }", "function eraseBoard() {\n context.clearRect(0, 0, canvas.width, canvas.height);\n }", "_clearTrajectories() {\n this.elem.selectAll('.intention').remove();\n\n for (let i = 0; i < this.gridSize; i++) {\n for (let j = 0; j < this.gridSize; j++) {\n if (!this._isCornerCell(i, j)) {\n this.grid[i][j].hexagon.attr('fill', 'none');\n }\n }\n }\n }", "function clearWorkspace(){\n var len = 0;\n dashWorkspace.content = '';\n if(columns){\n len = columns.length;\n while(len--){\n dashWorkspace.remove(columns[len]);\n }\n }\n if(conditionals){\n len = conditionals.length;\n while(len--){\n dashWorkspace.remove(conditionals[len]);\n }\n }\n screen.render();\n}" ]
[ "0.8240118", "0.8050491", "0.79045475", "0.7678401", "0.7616826", "0.7613384", "0.7505608", "0.7442434", "0.742878", "0.7427919", "0.73852193", "0.7344209", "0.732582", "0.73198044", "0.7295637", "0.7200764", "0.71590126", "0.71507716", "0.7128", "0.7119615", "0.7116384", "0.7103888", "0.7017106", "0.6991222", "0.6956702", "0.6943634", "0.6916233", "0.6911764", "0.68973684", "0.68845737", "0.6868623", "0.6851834", "0.6834604", "0.6810136", "0.6801557", "0.6791648", "0.6780152", "0.6771326", "0.67688644", "0.67437303", "0.67331636", "0.6723434", "0.6722041", "0.6719174", "0.67087233", "0.6700414", "0.6699605", "0.66541326", "0.6644844", "0.6641158", "0.66309524", "0.66185385", "0.66147757", "0.6610959", "0.66096425", "0.65905267", "0.6587165", "0.658648", "0.6566235", "0.6535704", "0.65311134", "0.6519661", "0.6507636", "0.6472456", "0.6471774", "0.64634025", "0.64553285", "0.64437664", "0.64078546", "0.6402043", "0.63913095", "0.6378293", "0.63568527", "0.63565654", "0.63561076", "0.6351777", "0.6348666", "0.63433987", "0.6342713", "0.6341801", "0.63380796", "0.63333946", "0.6320218", "0.6308012", "0.62554026", "0.62435246", "0.6242926", "0.62407035", "0.6234741", "0.6232369", "0.6224024", "0.6220705", "0.6213369", "0.6200141", "0.62000716", "0.6176874", "0.6173649", "0.6171903", "0.61711526", "0.6169466" ]
0.7597433
6
Checks for flag > draws
function mouseOverEvent(e) { if (e.button == 0) { if (left_click_drag_flag) { createGrid(this, active_object); } } if (e.buttons == 2) { if (right_click_drag_flag) { deleteGrid(this); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkDraw() {\n\t\tif (!this.checkWin()) {\n\t\t\tfor (var i = 0; i < 3; i++) {\n\t\t\t\tfor (var j = 0; j < 3; j++) {\n\t\t\t\t\tif (this.board[i][j] == '-') {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "function drawing(){\n\t\treturn M.status == 'drawing';\n\t}", "function checkDraw() {\n return playerOSelections.length + playerXSelections.length >= cells.length\n}", "isDraw() {\n\tif(!this.isFinished()||this.getWinner()!==null)\n return false;\n else\n return true;\n }", "function checkDraw(board) {\n if (availPos(board).length == 0) {\n return true;\n } else {\n return false;\n }\n}", "function gameIsDraw() {\n let x = 0;\n\n while (x <= 6) {\n if (spaceAvailable(x)) {\n return false\n } else {\n x++;\n }\n }\n return true;\n }", "function checkDraw() {\n\n\tif ( !($('.box').hasClass('free')) ) {\n\t\talert(\"Draw! Try playing again!\");\n\t\tresetGame();\n\t}\n}", "function checkForDraw () {\n\tif (usedBoxes.length === 9 && player1.hasWon === false && player2.hasWon === false) {\n\t\t$('#board').hide();\n\t\t$('.draw').show();\n\t}\n}", "function gameIsDraw(game) {\n return game.winner === undefined && game.turn === 9;\n}", "function actualFlag(x,y) {\n var ctx = canvas.getContext('2d');\n ctx.lineTo(x+21,y+22);\n ctx.lineTo(x+28,y+22);\n ctx.lineTo(x+28,y+25);\n ctx.lineTo(x+12,y+25);\n ctx.lineTo(x+12,y+22);\n ctx.lineTo(x+19,y+22);\n ctx.lineTo(x+19,y+8);\n ctx.lineTo(x+12,y+4);\n ctx.lineTo(x+21,y+0);\n}", "function drawChecker(){\r\n if (!winChecker(gameField) && isFull()){\r\n document.getElementById('winner').innerHTML = \"Nobody wins! We have a draw(standoff)!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n}\r\n }", "isDrawn() {\n return this._canDraw && this.visible && (this._shouldDraw || this.alwaysDraw);\n }", "function isDraw() {\n\treturn [...cellElements].every(cell => {\n\t\treturn cell.classList.contains(xClass) || \n\t\tcell.classList.contains(oClass)\n\t})\n}", "checkDraw() {\n const boxes = this.board.virtualBoard;\n \n for (let i = 0; i < boxes.length; i++) {\n if (boxes[i] === null) return false;\n }\n\n return true;\n }", "function gameIsDraw() {\n for (var y = 0; y <= 5; y++) {\n for (var x = 0; x <= 6; x++) {\n if (board[y][x] === 0) {\n return false;\n }\n }\n }\n // No locations were empty. Return true to indicate that the game is a draw.\n return true;\n}", "checkForDraw() {\n if (turn == 8 && this.match == false) {\n document.getElementById(\"winner\").innerHTML = \"The game ended in a draw\";\n document.getElementById(\"reset-button\").disabled = false;\n running = false;\n }\n }", "function checkDraw() {\n for(i = 0; i < 7; i++){\n for(j = 0; j < 6; j++){\n if(grid[i][j] == null) \n return false;\n }\n }\n return true;\n}", "function isDraw() {\n if (occupiedCells === 9 && !isGameOver()) {\n playerDisplay.textContent = \"IT'S A TIE!\";\n modalHeader.textContent = \"IT'S A TIE!\";\n modalText.textContent = \"\";\n\n isGameOver(true);\n }\n}", "function renderFlagpole()\n{\n checkFlagpole(); \n push();\n strokeWeight(5);\n stroke(180);\n line(flagpole.x_pos, floorPos_y, flagpole.x_pos, floorPos_y-250);\n noStroke();\n fill(250,0, 250);\n if (flagpole.isReached)\n { \n rect(flagpole.x_pos,floorPos_y-250, 50, 50);\n }\n else\n { \n rect(flagpole.x_pos,floorPos_y-50, 50, 50);\n }\n pop(); \n}", "function checkWin() {\n if (sticks.get(2).disks.length === 8 && !isWon) {\n alphaBG = 0;\n drawWinAnimation();\n }\n}", "function checkdraw() {\n //recall board is 7x6\n for (var row = 0; row < 6; row++) {\n for (var col = 0; col < 7; col++) {\n if (board[row][col] == 0) {\n return false;\n }\n }\n }\n //else board is filled and game is draw\n return true;\n}", "function checkDraw() {\n if (playerOne.length + playerTwo.length === 9) {\n return true;\n }\n }", "function draw(_enable){\n isDrawn = (_enable == 1)?true: false;\n}", "checkForDraw() {\n let b = this.state.board;\n let boardFull = false;\n let col0Full = false;\n let col1Full = false;\n let col2Full = false;\n let col3Full = false;\n \n // column checks\n if (b[0][0] !== 0) {\n col0Full = true;\n }\n if (b[0][1] !== 0) {\n col1Full = true;\n }\n if (b[0][2] !== 0) {\n col2Full = true;\n }\n if (b[0][3] !== 0) {\n col3Full = true;\n }\n\n this.setState({\n col0Full: col0Full,\n col1Full: col1Full,\n col2Full: col2Full,\n col3Full: col3Full\n })\n\n // whole board check\n if (col0Full && col1Full && col2Full && col3Full) {\n boardFull = true;\n }\n\n if (boardFull) {\n this.setState({\n gameStatus: \"Its a draw!\",\n buttonsDisabled: true,\n playAgainDisplay: 'inline',\n gameActive: false\n });\n }\n else {\n this.initBotsMove();\n }\n }", "function checkIfDraw(){\r\n if(currentStateOfTheBoard.includes(\"\")){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n \r\n}", "function checkFlagpole() {\n\tvar d = abs(gameChar_world_x - flagpole.x_pos);\n\n\tif (d < 15) {\n\t\tflagpole.isReached = true;\n\t}\n}", "isFilled(i_check, j_check){\n let currentView = this.state.layout.length-1;\n if(i_check>=8 || j_check>=8 || i_check<0 || j_check<0){\n return \"stop\";\n }\n let square_value = this.state.layout[currentView][i_check][j_check];\n if(square_value === 32){\n return \"empty\";\n }\n if(this.state.whitesMove){\n if(square_value < 9818 ) {\n return \"stop\";\n }else{\n return \"capture\";\n }\n }else{\n if(square_value >= 9818){\n return \"stop\";\n }else{\n return \"capture\";\n }\n }\n\n }", "_shouldDrawCheck() {\n // get plane bounding rect\n const actualPlaneBounds = this._getWebGLDrawRect();\n\n // if we decide to draw the plane only when visible inside the canvas\n // we got to check if its actually inside the canvas\n if(\n Math.round(actualPlaneBounds.right) <= this.renderer._boundingRect.left\n || Math.round(actualPlaneBounds.left) >= this.renderer._boundingRect.left + this.renderer._boundingRect.width\n || Math.round(actualPlaneBounds.bottom) <= this.renderer._boundingRect.top\n || Math.round(actualPlaneBounds.top) >= this.renderer._boundingRect.top + this.renderer._boundingRect.height\n ) {\n if(this._shouldDraw) {\n this._shouldDraw = false;\n // callback for leaving view\n this.renderer.nextRender.add(() => this._onLeaveViewCallback && this._onLeaveViewCallback());\n }\n }\n else {\n if(!this._shouldDraw) {\n // callback for entering view\n this.renderer.nextRender.add(() => this._onReEnterViewCallback && this._onReEnterViewCallback());\n }\n this._shouldDraw = true;\n }\n }", "drawFlagged() {\n\n //for (var i = 0, len = this.flaggedPixels.length; i < len; i++) {\n // let pixel = this.flaggedPixels[i];\n // this.drawSinglePixel(pixel.xCoord, pixel.yCoord);\n //}\n\n this.flaggedPixels.forEach((pixel) => {\n this.drawSinglePixel(pixel.xCoord, pixel.yCoord);\n });\n\n this.flaggedPixels.length = 0;\n }", "function drawFlag() {\n fill(255,150,0);\n strokeWeight(5);\n line(flagX,highestPoint,flagX,highestPoint-50);\n triangle(flagX,highestPoint-50,flagX+25,highestPoint-40, flagX, highestPoint-30);\n}", "function checkStatus(marker) {\n let cells = document.querySelectorAll('.tic-cell');\n let symbol = marker ? 'O' : 'X';\n\n if (checkwin(cells,symbol)) {\n /*Win logic*/\n isfinishround = true;\n setWinLabelStatus(symbol);\n setCounter(symbol);\n } else if (freespacescounter === 0) {\n /*Draw logic*/\n setWinLabelStatus('pareggio')\n }\n }", "function draw() {\n background(204, 231, 227)\n checkState();\n}", "function renderFlagpole()\n{\n \n push()\n stroke(150);\n strokeWeight(5);\n line(flagpole.x_pos, floorPos_y, flagpole.x_pos, floorPos_y - 200);\n \n if(flagpole.isReached)\n {\n fill(255,0,0);\n rect(flagpole.x_pos, floorPos_y -200, 50,50);\n }\n \n else\n {\n fill(255,0,0);\n rect(flagpole.x_pos, floorPos_y -50, 50,50);\n }\n \n pop();\n \n}", "function checkOffScreen() {\n if (\n fish1.x > trx + (3 / 4) * padding ||\n fish1.x < blx - (3 / 4) * padding ||\n fish1.y > bly + (3 / 4) * padding ||\n fish1.y < tly - (3 / 4) * padding\n ) {\n setFish1();\n }\n if (\n fish2.x > trx + (3 / 4) * padding ||\n fish2.x < blx - (3 / 4) * padding ||\n fish2.y > bly + (3 / 4) * padding ||\n fish2.y < tly - (3 / 4) * padding\n ) {\n setFish2();\n }\n}", "function checkNumberDrawn(numberDrawn, numbersAlreadyDrawn) {\n\n var count = numbersAlreadyDrawn.length;\n\n for (var i=0; i<count; i++)\n if (numbersAlreadyDrawn[i] === numberDrawn) {\n return console.log('That\\'s already been drawn');\n return false;\n }\n numbersAlreadyDrawn.push(numberDrawn);\n removeTileOverlay(numberDrawn);\n numbersThisGame += 1;\n headsOrTails(numberDrawn);\n return true;\n}", "function drawFlags() {\n var canvas = document.getElementById('canvas');\n var context = canvas.getContext('2d');\n for(var i = 0; i < number_of_coordinates; i++) {\n if(i > 0) {\n context.setLineDash([5]);\n context.beginPath();\n context.lineWidth = 2;\n context.strokeStyle = '#FFFFFF';\n context.moveTo(current_coordinate_list[i].x,current_coordinate_list[i].y);\n context.lineTo(current_coordinate_list[i-1].x,current_coordinate_list[i-1].y);\n context.stroke();\n context.setLineDash([]);\n }\n }\n for(var i = 0; i < number_of_coordinates; i++) {\n drawFlag(current_coordinate_list[i].x-20,current_coordinate_list[i].y-35,i+1);\n }\n}", "function isDraw() {\n return [...DOM.cellDivs].every(cell => {\n return cell.classList.contains(player1.markerClass) ||\n cell.classList.contains(player2.markerClass)\n })\n}", "function checkWin() {\n for (let i = 0; i < fieldHeight; i++) for (let j = 0; j < fieldWidth; j++) {\n sector = sectors[i][j]\n if (!sector.opened && !sector.flagged && !sector.status) return\n if (sector.flagged && !sector.status) return\n }\n winGame()\n}", "function isMatchDraw() {\n\tif(_selectedFighterObj.healthPoints <= 0 && _selectedDefenderObj.healthPoints <= 0) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function checkFlagpole()\n{\n d = dist(flagpole.x_pos, floorPos_y+50, gameChar_world_x, floorPos_y+50);\n \n if (d <= 15)\n {\n flagpole.isReached = true;\n }\n}", "function onDrawingBoard() {\n return (pmouseX > 0 && pmouseX < 400 && mouseX > 0 && mouseX < 400 &&\n pmouseY > 0 && pmouseY < 400 && mouseY > 0 && mouseY < 400);\n}", "checkDraw()\n { \n if (this.counter == 9) \n {\n document.getElementById('message').style.color = \"red\";\n this.setMessage(\"Sorry, the game has ended in a draw.\");\n }\n }", "capture_check(space) {\r\n if(space.occupied === this.color) {\r\n return false;\r\n } else if(space.occupied === 0) {\r\n return false;\r\n } else {\r\n return true;\r\n };\r\n }", "function checkWin() {\n // Determines if the # of placed flags equals the # of mines\n const allFlags = numPlacedFlags == startingMines;\n \n // Checks if all flags are correctly placed\n const correctFlags = checkFlagPosition();\n \n // Only returns true if both conditions are met\n return allFlags && correctFlags;\n}", "function checkVictoryClick() {\n\t// Dazu muss die gesamte Matrix durchlaufen werden\n\tfor(var i = 0; i < arrayDimensionLine; i++) {\n\t\tfor(var j = 0; j < arrayDimensionColumn; j++) {\n\t\t\t// Und fuer jede Zelle muss geprueft werden, ob sie auf der Map ist\n\t\t\tif(hexatileOnMap(i,j))\n\t\t\t\t// Dann wird geprueft, ob diese Zelle noch verdeckt und keine Mine ist\n\t\t\t\tif(!gameField[i][j].isOpen && !gameField[i][j].isMine)\n\t\t\t\t\t// in diesem Fall hat man noch nicht durch aufdecken aller leeren Felder gewonnen\n\t\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t// An dieser Stelle ist klar, dass alle leeren Felder aufgedeckt wurden \n\treturn true;\n}", "function checkFlagpole()\n{\n var d = abs(gameChar_world_x - flagpole.x_pos);\n \n if(d < 50)\n {\n flagpole.isReached = true;\n }\n}", "function isWin() {\n var cellsClickedCount = gGame.shownCount + gGame.markedCount;\n if (cellsClickedCount === (gSize * gSize) && (gGame.markedCount === gBombAmount)) {\n clearInterval(gTimerInterval);\n elBtn.innerHTML = '😎';\n getBestScore();\n gGame.isOn = false;\n return true;\n }\n return false;\n}", "function draw() {\n background(0);\n checkState();\n}", "checkDrawBonus(tile, wallSize) {\n if (tile >= Constants.BONUS) {\n this.bonus.push(tile);\n this.log('${this.name} drew bonus tile, requesting draw bonus compensation');\n return this.connector.publish('draw-bonus-request', { tile });\n }\n this.addTile(tile, wallSize);\n }", "function checkDraw() {\n return currentCells.every(function (element) { return typeof element === 'string'; })\n}", "function checkStatus()\n\t\t{\n\t\t\tvar count = $('.tile').length;\n\t\t\tif(count == 16)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function checkGameOver() {\n //if all the mark equal to mines and\n if (gGame.markedCount === gLevel.MINES && gGame.shownCounter >= gLevel.REGULARCELLS) {\n // debugger\n console.log('game win with markedCount ' + gGame.markedCount + ' that equal to Mines ' + 'shown counter is ' + gGame.shownCounter + ' equal to ' + gLevel.REGULARCELLS)\n gameOver('Win');\n }\n\n\n}", "drawFinishIfLessThan3Points(){\n this.hull=this.points;\n this.drawFinish();\n this.stop(); \n }", "function winShowFlags() {\n for (i=0; i<=maxX; i++) {\n for (j=0; j<=maxY; j++) {\n with (cellArray[arrayIndexOf(i,j)]) {\n if ((!isExposed) && (!isFlagged)) {\n isFlagged = true;\n document.images[imageIndexOf(i,j)].src = bombFlagged.src; } } } } }", "function isSuccessFlag(){\n var success = ($scope.caseFlagged==$scope.minesCount); // The number of flag is the same than the number of mine\n var len = $scope.mines.length;\n var i= 0;\n while(success && (i<len)){\n var item = $scope.mines[i];\n success = success && $scope.grid[item.x][item.y].flagged; // Each mined case is also flagged\n i++;\n }\n return success;\n }", "function markFlag() {\n let $td = $(this)\n if (unclickable(this)) {\n return false;\n }\n let id = $td.attr(\"id\")\n let cell = game.getCellByID(id);\n if (!cell.hasRevealed) {\n if (cell.hasFlag) {\n cell.hasFlag = false\n flagCount--\n } else {\n cell.hasFlag = true\n flagCount++\n }\n render()\n }\n return false\n}", "function check_pos(){\n\t//Write our checking of all positions\n\n\tif (blob_pos_x > c_canvas.width - 20){\n\tblob_pos_x = blob_pos_x - 4;\n\t}\n\tif (blob_pos_x < 0){\n\tblob_pos_x = blob_pos_x + 4;\n\t}\n\tif (blob_pos_y > c_canvas.height - 20){\n\tblob_pos_y = blob_pos_y - 4;\n\t}\n\tif (blob_pos_y < 0){\n\tblob_pos_y = blob_pos_y + 4;\n\t}\n\n\n\t}", "function checkStatus() {\n checkWin();\n checkLose();\n }", "function displayCheck(face) {\n //if in bounds\n if (!inBounds(face.x,face.y)) {\n return false;\n }\n\n return true;\n\n }", "function draw() {\n var return_value = true;\n\n for (celnum = 0; celnum < 9; celnum++) {\n if (GAME_FIELD_ELEMENT[celnum].src.search(PLAYER_IMAGES[0]) > -1) {\n return_value = false;\n break;\n }\n }\n return return_value;\n} //EINDE function draw", "function checkVictory() {\n if (gGame.revealedCount === (gLevel.curr.SIZE ** 2) - gLevel.curr.MINES\n && gGame.markedCount === gLevel.curr.MINES) {\n gameEnd(EMOJI.won);\n updateHighScore(gTime.totalTime);\n }\n}", "function CheckWin(plays) {\n\t\tif (oplays.length + xplays.length == 9) {\n\t\t\tconsole.log(\"DRAW!\");\n\t\t\treturn true;\n\t\t}\n\t\t\treturn false;\n\t}", "offscreen(){return this.x < -this.w}", "function gameOver() {\n if ((totalNums === gState.shownCount) && (gLevel.MINES === gState.markedCount)) {\n alert('good job');\n return true;\n }\n else return false;\n}", "function mouseStatus(res, e) {\n let mousePos = getMousePos(canvas,e)\n if (res == 'down') {\n flag = true;\n xSrc = mousePos.x;\n ySrc = mousePos.y;\n draw(mousePos.x,mousePos.y,e);\n }\n if (res == 'up' || res == \"out\") {\n flag = false;\n }\n if (res == 'move') {\n if (flag) {\n draw(mousePos.x,mousePos.y,e);\n }\n }\n}", "function checkDraw(){\n console.log(\"checkdraw called\");\n if(emptycells().length==0){\n \n $(\".cell\").each(function(i){\n if(!isChallenge){\n $(this).css({\n 'background-color':'black',\n }); \n }\n $(\".cell\")[i].removeEventListener('click',cellClick,false);});\n displayWinner('Tie');\n return true;\n }\n return false;\n}", "function showFlag(evt) {\n var pos = getMousePos(canvas, evt);\n canvas_flag_position.x = pos.x - 20;\n canvas_flag_position.y = pos.y - 27;\n drawFlag(pos.x - 20,pos.y - 27);\n canvas_flag_active = true;\n}", "function canDraw(point)\r\n{ \r\n if(point.x >= 320 && \r\n point.y <= 240 && \r\n point.x <= width &&\r\n point.y <= height ) return true;\r\n\r\n return false;\r\n}", "function isMarkingRectangleVisible() {\n\treturn markingRectangle.classList.contains('dont-display');\n}", "function gameovercheck() {\n\t\tif (lives === 0) {\n\t\t\tball.y_speed = 0;\n\t\t\tball.x_speed = 0;\n\t\t\tcontext.font = \"40px Copperplate\";\n\t\t\tcontext.fillText(\"GAME OVER\", width/2 - 120, height/2 + 35);\n\t\t\tgameover = 1;\n\t\t\tdocument.getElementById(\"newgame\").style.visibility = \"visible\";\n\t\t}\n\t\telse if (brickcount === 0) {\n\t\t\tball.y_speed = 0;\n\t\t\tball.x_speed = 0;\n\t\t\tcontext.font = \"40px Copperplate\";\n\t\t\tcontext.fillText(\"YOU WIN!\", width/2 - 95, height/2 + 35);\n\t\t\tgameover = 1;\n\t\t\tdocument.getElementById(\"newgame\").style.visibility = \"visible\";\n\t\t}\n\t}", "draw( d ){\r\n\t\tif( (d & 1) != 0 ) this.ctx.fill();\r\n\t\tif( (d & 2) != 0 ) this.ctx.stroke();\r\n\t}", "function renderFlagpole() {\n\n\tvar flagY = floorPos_y - 30;\n\tstroke(255);\n\tstrokeWeight(5);\n\tline(flagpole.x_pos, floorPos_y, flagpole.x_pos, floorPos_y - 200);\n\tfill(255, 0, 255);\n\tnoStroke();\n\tif (!flagpole.isReached) {\n\t\trect(flagpole.x_pos, flagY, 40, 30);\n\t} else {\n\t\trect(flagpole.x_pos, flagY - 200, 40, 30);\n\t}\n}", "get Overdraw() {}", "function checkEndGame() {\n var endGame = findOnBoard(p2Mark, 3);\n if (endGame == null)\n endGame = findOnBoard(p1Mark, 3);\n\n if (endGame != null || timesPlayed >= 9) {\n if (endGame != null) {\n for (var i = 0; i < endGame.length; i++) {\n $(\"#\" + endGame[i][0]).parent().addClass(\"red\");\n }\n } else {\n talker.notice(\"draw\");\n }\n\n UIActive = true;\n $(\"#UI\").show();\n $(\"#screen3\").children().show();\n return true;\n }\n return false;\n}", "checkEdges(){\n if(this.loc.x < 0){\n gameState = 3\n }\n if(this.loc.x > width){\n gameState = 3\n }\n if(this.loc.y < 0){\n gameState = 3\n }\n if(this.loc.y > height){\n gameState = 3\n }\n }", "function drawFlag(x,y,i) {\n var canvas = document.getElementById('canvas');\n if (canvas.getContext) {\n var ctx = canvas.getContext('2d');\n ctx.fillStyle = '#FFFFFF';\n ctx.strokeStyle = '#FFFFFF'\n ctx.font = \"10px Arial\"\n if(i)\n ctx.fillText(i.toString(),x+27,y+27);\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.fillStyle = '#FF0000';\n ctx.strokeStyle = '#FFFFFF'\n ctx.moveTo(x+21,y+0);\n alternateFlag(x,y);\n ctx.closePath()\n ctx.stroke();\n ctx.fill();\n }\n}", "function check_border() {\n for (let i = 0; i < invaders.length; i++) {\n return invaders[i].x <= 0 || invaders[i].x >= 155;\n }\n}", "function checkWinningCondition() {\n\tif (matchedCards.length === 16) {\n\t\tstopTimer();\n\t\toverlay();\n\t} else {\n\t\treturn false;\n\t}\n}", "function checkScore() {\n\tif (moves === 16 || moves === 24 )\n\t{\n\t\thideStar();\n\t}\n}", "function draw() {\n //check if mouse is on item\n if(currentState ===`inspection`){\n //calculates the distance between mouse and items\n let distRemote = dist(mouseX,mouseY,item_remote.x,item_remote.y);\n let distAc = dist(mouseX,mouseY,item_ac.x,item_ac.y);\n let distpenpen = dist(mouseX,mouseY,item_penpen.x,item_penpen.y);\n let distPictureBoard = dist(mouseX,mouseY,item_pictureBoard.x,item_pictureBoard.y);\n if (distRemote <=20\n && inItemDialogue === false\n && itemChecklist.acRemote_Checked ===false){\n cursor(CROSS);\n currentItem = `acRemote`;\n if (mouseIsPressed){\n inItemDialogue = true;\n }\n }else if(distAc <=40\n && inItemDialogue === false\n && itemChecklist.ac_Checked ===false) {\n cursor(CROSS);\n currentItem = `ac`;\n if (mouseIsPressed){\n inItemDialogue = true;\n }\n }else if(distpenpen <= 30\n && inItemDialogue === false\n && itemChecklist.penpen_Checked ===false){\n cursor(CROSS);\n currentItem = `penpen`;\n if (mouseIsPressed){\n inItemDialogue = true;\n }\n }else if(distPictureBoard <= 40\n && inItemDialogue === false\n && itemChecklist.pictureBoard_Checked ===false){\n cursor(CROSS);\n currentItem = `pictureBoard`;\n if (mouseIsPressed){\n inItemDialogue = true;\n }\n }else{\n cursor(ARROW);\n }\n }\n}", "function valid(offsetX, offsetY, newCurrent) {\n offsetX = offsetX || 0;\n offsetY = offsetY || 0;\n offsetX = currentX + offsetX;\n offsetY = currentY + offsetY;\n newCurrent = newCurrent || current;\n\n for (let y = 0; y < 4; ++y) {\n for (let x = 0; x < 4; ++x) {\n if (newCurrent[y][x]) {\n if (typeof board[y + offsetY] == 'undefined'\n || typeof board[y + offsetY][x + offsetX] == 'undefined'\n || board[y + offsetY][x + offsetX]\n || x + offsetX < 0\n || y + offsetY >= ROWS\n || x + offsetX >= COLS) {\n if (offsetY == 1 && freezed) {\n lose = true; // lose if the current shape is settled at the top most row\n document.getElementById('playbutton').disabled = false;\n }\n return false;\n }\n }\n }\n }\n return true;\n}", "function checkWin(){\n return checkRowWinCondition()||checkColWinCondition()||checkDiagWinCondition();\n}", "function checkVictory() {\r\n // check if all fields are full and end the game\r\n check = dataObj.reduce((operator, item) => {\r\n if (item.checked === true) {\r\n operator++;\r\n }\r\n return operator;\r\n }, 0);\r\n // a1a2a3\r\n victoryComb(0, 1, 2, \"X\");\r\n victoryComb(0, 1, 2, \"O\");\r\n // a1b1c1\r\n victoryComb(0, 3, 6, \"X\");\r\n victoryComb(0, 3, 6, \"O\");\r\n // c1c2c3\r\n victoryComb(6, 7, 8, \"X\");\r\n victoryComb(6, 7, 8, \"O\");\r\n // a3b3c3\r\n victoryComb(2, 5, 8, \"X\");\r\n victoryComb(2, 5, 8, \"O\");\r\n // a2b2c2\r\n victoryComb(1, 4, 7, \"X\");\r\n victoryComb(1, 4, 7, \"O\");\r\n // b1b2b3\r\n victoryComb(3, 4, 5, \"X\");\r\n victoryComb(3, 4, 5, \"O\");\r\n // a3b2c1\r\n victoryComb(2, 4, 6, \"X\");\r\n victoryComb(2, 4, 6, \"O\");\r\n\r\n // a1b2c3\r\n victoryComb(0, 4, 8, \"X\");\r\n victoryComb(0, 4, 8, \"O\");\r\n\r\n // check if draw\r\n if (check === 9 && endGame === false) {\r\n\r\n console.log(\"Time's up\");\r\n endGame = true;\r\n // bring up draw modal\r\n victoryModal(\"draw\");\r\n }\r\n }", "isCheckerOnBoard() {\n return this.state.checkerPosition[0] < this.state.size\n && this.state.checkerPosition[1] < this.state.size\n && this.state.checkerPosition[0] >= 0\n && this.state.checkerPosition[1] >= 0;\n }", "function IsDraw(cells) {\n // return cells.filter(c => c === null).length == 0;\n}", "function addFlag(square) {\n if (isGameOver) return;\n if (!square.classList.contains('checked') && (flags <= bombAmount)) {\n if (!square.classList.contains('flag')) {\n square.classList.add('flag');\n square.innerHTML = ' 🚩';\n flags++;\n flagsLeft.innerHTML = bombAmount - flags;\n checkForWin();\n\n\n } else {\n square.classList.remove('flag');\n square.innerHTML = '';\n flags--;\n flagsLeft.innerHTML = bombAmount - flags;\n }\n }\n }", "function CheckIfOver() {\n if((bike2.crashB2(trail2)===true) ||\n (bike2.crashWithBorderB2(trail2)===true)||\n (bike1.crashB1(trail)===true)||\n (bike1.crashWithBorderB1(trail)===true)||\n (bike1.crashB1WithTrail2(trail2)===true)||\n (bike2.crashB2WithTrail(trail) ===true)||\n (bike1.inCaseOfDraw()===true)||\n (bike2.inCaseOfDraw()===true)){\n setTimeout(() => {\n gameArea.clear();\n }, 0);\n } \n}", "function requiresScratchCanvas( trail ) {\n return trail.lastNode().getOpacity() < 1;\n }", "function updateState() {\n\n var isSeated = updatePoints();\n\n // var lastSignal = points.length - 1;\n // var isSeated = points[lastSignal][1] > 250;\n if (!error) {\n drawResult(isSeated);\n }\n}", "function draw(){\n if(count >= 9 && flag == true){\n hide('turn');\n setText('gameover', \"<p class='text-center' >GAME-OVER <br> Match has been Drawn! </p>\");\n show(\"gameover-block\");\n flag = false;\n restart = document.getElementById(\"Play-Again\").addEventListener('click',reloadPage);\n }\n}", "function draw() {\n if (!drawOnTop.checked) {\n clear();\n }\n // Handeling the Draw my self\n render();\n}", "function endDraw() {\n draw = false;\n drawList = [];\n}", "function winConditions() {\n\t\tif (($scope.squares[0] == 1 && $scope.squares[1] == 1 && $scope.squares[2] == 1) || \n\t\t($scope.squares[3] == 1 && $scope.squares[4] == 1 && $scope.squares[5] == 1) ||\n\t\t($scope.squares[6] == 1 && $scope.squares[7] == 1 && $scope.squares[8] == 1) ||\n\t\t($scope.squares[0] == 1 && $scope.squares[3] == 1 && $scope.squares[6] == 1) ||\n\t\t($scope.squares[1] == 1 && $scope.squares[4] == 1 && $scope.squares[7] == 1) ||\n\t\t($scope.squares[2] == 1 && $scope.squares[5] == 1 && $scope.squares[8] == 1) ||\n\t\t($scope.squares[0] == 1 && $scope.squares[4] == 1 && $scope.squares[8] == 1) ||\n\t\t($scope.squares[2] == 1 && $scope.squares[4] == 1 && $scope.squares[6] == 1)) {\n\t\t\t$scope.booya=true;\n\t\t} else if (\n\t\t\t($scope.squares[0] == -1 && $scope.squares[1] == -1 && $scope.squares[2] == -1) || \n\t\t\t($scope.squares[3] == -1 && $scope.squares[4] == -1 && $scope.squares[5] == -1) ||\n\t\t\t($scope.squares[6] == -1 && $scope.squares[7] == -1 && $scope.squares[8] == -1) ||\n\t\t\t($scope.squares[0] == -1 && $scope.squares[3] == -1 && $scope.squares[6] == -1) ||\n\t\t\t($scope.squares[1] == -1 && $scope.squares[4] == -1 && $scope.squares[7] == -1) ||\n\t\t\t($scope.squares[2] == -1 && $scope.squares[5] == -1 && $scope.squares[8] == -1) ||\n\t\t\t($scope.squares[0] == -1 && $scope.squares[4] == -1 && $scope.squares[8] == -1) ||\n\t\t\t($scope.squares[2] == -1 && $scope.squares[4] == -1 && $scope.squares[6] == -1)) {\n\t\t\t\t$scope.iRanOutofWordsHere=true;\n\t\t// add reset game\n\t\t} else if (\n\t\t\t($scope.squares[0] == 1 || $scope.squares[0] == -1) && ($scope.squares[1] == 1 || $scope.squares[1] == -1) && \n\t\t \t($scope.squares[2] == 1 || $scope.squares[2] == -1) && ($scope.squares[3] == 1 || $scope.squares[3] == -1) && \n\t\t \t($scope.squares[4] == 1 || $scope.squares[4] == -1) && ($scope.squares[5] == 1 || $scope.squares[5] == -1) &&\n\t\t \t($scope.squares[6] == 1 || $scope.squares[6] == -1) && ($scope.squares[7] == 1 || $scope.squares[7] == -1) &&\n\t\t \t($scope.squares[8] == 1 || $scope.squares[8] == -1)) {\n\t\t \t\t$scope.itsatie=true;\n\t\t }\n\t\t\n\n\t\t\tif (playerOne == true) {\n\t\t\t\tplayerOne = false; \n\t\t\t}\n\t\t\telse {\n\t\t\t\tplayerOne = true;// =assigns; ==evaluates\n\t\t\t\t}\n\t}", "function addFlag(square) {\n if (isGameOver) return \n if (!square.classList.contains('checked') && (flags < bombAmount)) {\n if (!square.classList.contains('flag')) {\n square.classList.add('flag')\n square.innerHTML = ' 🚩'\n flags ++\n flagsLeft.innerHTML = bombAmount- flags\n checkForWin()\n } else {\n square.classList.remove('flag')\n square.innerHTML = ''\n flags --\n flagsLeft.innerHTML = bombAmount- flags\n }\n }\n }", "offscreen() {\n if (this.xSky < -this.w) {\n return true;\n } else {\n return false;\n }\n }", "checkState() {\n if (this.position.x < 75 || this.position.x > 925) {\n this.perceptionRadius = 0;\n }\n else if (this.startPosition.x < 75 || this.startPosition.x > 925) {\n this.perceptionRadius = 0;\n }\n else {\n this.perceptionRadius = 160;\n }\n }", "function findxy(res, e) {\n debug_update(prevX, prevY, currX, currY, e.clientX, e.clientY);\n if (res == 'down') {\n prevX = currX;\n prevY = currY;\n currX = e.clientX - canvas.offsetLeft + document.body.scrollLeft;\n currY = e.clientY - canvas.offsetTop + document.body.scrollTop;\n prevX = currX;\n prevY = currY;\n\t\t\n\t\tconsole.log(lastIter[currY-currY%pixelSize][currX-currX%pixelSize]);\n\t\tctx.fillRect(currX-currX%pixelSize,currY-currY%pixelSize,pixelSize,pixelSize);\n\t\tpixArr[currX-currX%pixelSize][currY-currY%pixelSize] = 1;\n\t\tlastIter[currY-currY%pixelSize][currX-currX%pixelSize] = 1;\n\t\tconsole.log(lastIter[currY-currY%pixelSize][currX-currX%pixelSize]);\n flag = true;\n }\n if (res == 'up' || res == \"out\") {\n flag = false;\n }\n if (res == 'move') {\n\t\tconsole.log(flag);\n if (flag) {\n currX = e.clientX - canvas.offsetLeft + document.body.scrollLeft;\n currY = e.clientY - canvas.offsetTop + document.body.scrollTop;\n prevX = currX;\n prevY = currY;\n\t\t\tctx.fillRect(currX-currX%pixelSize,currY-currY%pixelSize,pixelSize,pixelSize);\n\t\t\tpixArr[currY-currY%pixelSize][currX-currX%pixelSize] = 1;\n\t\t\tlastIter[currY-currY%pixelSize][currX-currX%pixelSize] = 1;\n }\n }\n}", "function checkDrawRound(){\r\n\talert('Do you won\"t to create another draw?');\r\n\t\t\tif(confirm){\r\n\t\t\t\t\tenterPlayer();\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\t\r\n}", "hasGone() {\n this.requestCameraAttention();\n return this.y > config.height;\n }", "function checkDraw(squares) {\n let draw = null;\n const lines = [\n [0, 1, 2],\n [3, 4, 5],\n [6, 7, 8]\n ];\n for (let i=0; i<lines.length; i++) {\n const [a, b, c] = lines[i];\n if (squares[a] === null || squares[b] === null || squares[c] === null) {\n draw = false\n i = lines.length\n } else {\n draw = true\n }\n }\n return draw\n}", "check() {\n if (this.y - this.size / 2 > height) {\n return true\n } else {\n return false\n };\n }" ]
[ "0.70300305", "0.7016894", "0.7013878", "0.6940285", "0.6912779", "0.6840337", "0.68261623", "0.6765162", "0.6748648", "0.6619517", "0.6605564", "0.6519338", "0.6493231", "0.64735246", "0.64451104", "0.64253426", "0.6425103", "0.63631594", "0.6356713", "0.6353787", "0.6350529", "0.6348728", "0.6344563", "0.6288038", "0.62782645", "0.62764996", "0.62629867", "0.62517923", "0.62294024", "0.61881244", "0.6178982", "0.6172855", "0.61702186", "0.61648047", "0.61638576", "0.6158279", "0.6135229", "0.6129358", "0.61129445", "0.6110313", "0.6101896", "0.6101211", "0.60978603", "0.6075884", "0.6059754", "0.6054323", "0.6043461", "0.60424244", "0.60350686", "0.60239077", "0.59837353", "0.5980629", "0.5980302", "0.5979984", "0.59760094", "0.5975183", "0.596945", "0.5968456", "0.5959544", "0.59523374", "0.5942612", "0.5925799", "0.592566", "0.592433", "0.5923951", "0.59239036", "0.5922143", "0.59180605", "0.59162056", "0.59131306", "0.59106433", "0.5909418", "0.5897093", "0.5896799", "0.58964837", "0.5891664", "0.5876429", "0.5876399", "0.5874284", "0.5873533", "0.5871837", "0.58683294", "0.5860118", "0.58445513", "0.5840101", "0.58395875", "0.5838173", "0.5835798", "0.58335006", "0.5833072", "0.5828496", "0.5819251", "0.58154935", "0.58147013", "0.5813658", "0.5807571", "0.5804996", "0.5791177", "0.57840973", "0.57785696", "0.5773755" ]
0.0
-1
Checks for flag > stop drawing
function mouseUpEvent(e) { switch (e.button) { case 0: left_click_drag_flag = false; break; case 2: right_click_drag_flag = false; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stopdraw(ev) {\n this.is_drawing = false;\n }", "function stopDrawing(event) {\n isDrawing = false;\n [lastX, lastY] = [0, 0];\n}", "function endingPoint() {\n painting = false;\n ctx.beginPath();\n }", "function stop (){\n\t\t\t\t// Switch the paint status to false\n\t\t\t\tpaint = false;\n\t\t\t}", "function stopPressPen() {\n isDrawning = false\n\n // need to stop the line, so I need to restart the line\n context.beginPath()\n }", "function stopPainting() {\n painting = false;\n}", "function endDraw() {\n draw = false;\n drawList = [];\n}", "stopDrawing() {\n this.updateAnimation = false;\n }", "function mouseoff(e) {\n state.context.closePath();\n isDrawing = false;\n console.log(isDrawing);\n}", "function stopDraw(e) {\n\t\tbrush_size = 1;\n\t\te.preventDefault();\n\t\tcanvas.onmousemove = null;\t\n\t}", "function draw() {\n background(0);\n checkState();\n}", "function stop () {\n if (drawRequest) {\n window.cancelAnimationFrame(drawRequest)\n drawRequest = 0\n ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height) \n } \n }", "stopDrawingMode() {\n if (this._isSameDrawingMode(drawingModes.NORMAL)) {\n return;\n }\n\n const drawingModeInstance = this._getDrawingModeInstance(this.getDrawingMode());\n if (drawingModeInstance && drawingModeInstance.end) {\n drawingModeInstance.end(this);\n }\n this._drawingMode = drawingModes.NORMAL;\n }", "function drawing(){\n\t\treturn M.status == 'drawing';\n\t}", "function cancelDrawing(map) {\n map.fire('draw:drawstop');\n}", "function camicStopDraw(e) {\n const viewer = $CAMIC.viewer;\n const canvasDraw = viewer.canvasDrawInstance;\n\n const imgColl = canvasDraw.getImageFeatureCollection();\n if (imgColl.features.length > 0) {\n // Check size first\n const box = checkSize(imgColl, viewer.imagingHelper);\n\n if (Object.keys(box).length === 0 && box.constructor === Object) {\n console.error('SOMETHING WICKED THIS WAY COMES.');\n } else {\n const args = $UI.args;\n if ( flag != -1) {\n extractRoi(choices1, flag);\n $UI.segmentPanel.toggleMask(1);\n } else if (!args || args.status == 'watershed') {\n segmentROI(box);\n $UI.segmentPanel.toggleMask(2);\n } else {\n segmentModel(args.status);\n $UI.segmentPanel.toggleMask(1);\n }\n $UI.segmentPanel.setPosition(box.rect.x, box.rect.y, box.rect.width, box.rect.height);\n if ($UI.segmentPanel.__spImgWidth != 0) {\n $UI.segmentPanel.open(args);\n }\n // close\n canvasDraw.clear();\n }\n } else {\n console.error('Could not get feature collection.');\n }\n}", "function stopDrawing(event) {\n\tdrawingMode = false;\n\tmouseUpDownLabel.innerHTML = \"Mouse Button Up (moving mode)\";\n}", "function mousedown(e) {\n\tif (!e) var e = window.event;\n\te.preventDefault();\t\t// Tries to prevent I-beam\n\t\t\n\tisDrawing = true;\n console.log(isDrawing);\n\tstate.canvasX = e.pageX - state.canvas.offsetLeft;\n state.canvasY = e.pageY - state.canvas.offsetTop;\n\tstate.context.beginPath();\n state.context.moveTo(state.canvasX, state.canvasY);\n}", "function clearDrawings() {\n if ($(\"#drawing_pen\").hasClass(\"pen_image_selected\")) {\n handleOpenPen();\n }\n if ($(\"#drawing_eraser\").hasClass(\"eraser_image_selected\"))\n {\n handleOpenEraser();\n }\n p = 0;\n $(\".pick_color\").removeClass(\"hover_class\");\n\n for (var count = 2; count > 0; count--) {\n wrapper.uncache();\n wrapper.cache(30, 90, cm_width, cm_height);\n stage.addChild(wrapper);\n var u = 0;\n while (penArray.length > 0) {\n //console.log(penArray.length);\n // console.log(u);\n var x = penArray.slice().reverse()[u].visible;\n //console.log(x);\n if (x == true && u <= penArray.length) {\n // console.log(\"pen array length\" + penArray.length);\n penArray.slice().reverse()[u].visible = false;\n // console.log(\"in false loop \" + u);\n stage.update();\n //break;\n }\n penArray.pop();\n stage.update();\n }\n }\n $(\"#top_menu_overlay\").css(\"display\", \"none\");\n removeEventLiserners(stage);\n //stage.update();\n //console.log(stage);\n $('#clean-line-message').dialog('close');\n // multiSelection();\n //mouseDownAtEmpty();\n }", "function mouseReleased(){\n\tdrawing = false;\n}", "isDraw() {\n\tif(!this.isFinished()||this.getWinner()!==null)\n return false;\n else\n return true;\n }", "drawFinishIfLessThan3Points(){\n this.hull=this.points;\n this.drawFinish();\n this.stop(); \n }", "function escapeFlag() {\n canvas.removeEventListener('mousemove', showFlag);\n canvas_flag_active = false;\n canvas_flag_position = {x:undefined,y:undefined};\n}", "startDraw(){\n if(!this.drawing) {\n this.drawing = true;\n this.then = Date.now();\n this.draw();\n }\n }", "function drawingEnd() {\n\tvar draw = {\n\t\ttype:(prefs.draw.type == 1),\n\t\tfront:prefs.draw.front,\n\t\tcolor:prefs.draw.color.getNbrs(),\n\t\tfill:prefs.draw.fill.getNbrs(),\n\t\tsize:prefs.draw.size,\n\t\tpoints:drawPoints\n\t};\n\n\tpalaceTCP.sendDraw(draw);\n\twindow.removeEventListener('mousemove',drawing);\n\twindow.removeEventListener('mouseup',drawingEnd);\n\n\tdrawPoints = [];\n}", "disengage (e){\n this.dragging=false;\n this.ctx.closePath();\n\n\n\n \n \n\n console.log(\"j'aii fini de dessiner\")\n }", "function draw() {\n if (!drawOnTop.checked) {\n clear();\n }\n // Handeling the Draw my self\n render();\n}", "function drawing() {\n let isDrawing = false;\n let color;\n if (Canvas.hasClass('active-eyedr')) {\n EyedrBtn.removeClass('active-eyedr');\n Canvas.removeClass('active-eyedr');\n CanvasTd.off();\n };\n // Canceling selecting text on 'mousedown' event\n // for better view while the pointer accidentally\n // became outside the canvas\n body.on('mousedown', function (event) {\n if (isDrawing) event.preventDefault();\n });\n // Start drawing\n CanvasTd.on('mousedown', function (event) {\n Canvas.addClass('drawing');\n isDrawing = true;\n isSmthOnCanvas = true;\n ClearBtn.html('Clear Canvas');\n if (event.shiftKey) {\n color = '';\n $('.erase-img').addClass('visible');\n Canvas.removeClass('drawing');\n Canvas.addClass('erase-cursor');\n }\n else {\n color = CurrColor.attr('bgcolor');\n };\n $(this).attr('bgcolor', color);\n CanvasTd.on('mouseenter', function () {\n $(this).attr('bgcolor', color);\n });\n // Stop drawing\n body.on('mouseup', function () {\n $('.erase-img').removeClass('visible');\n Canvas.removeClass('erase-cursor');\n Canvas.removeClass('drawing');\n isDrawing = false;\n CanvasTd.off('mouseenter');\n body.off('mouseup');\n manageHistory('update');\n manageUndoRedoBtn();\n });\n });\n }", "function cancelFreeDraw() {\n mainDiagram.toolManager.panningTool.isEnabled = true;\n mainDiagram.toolManager.mouseMoveTools.remove(globalState.tool);\n globalState.tool = null;\n this.onclick = freeDraw;\n document.getElementById(\"freedraw\").innerHTML = '<img id=\"freedraw_img\" width=\"20\" height=\"20\" style=\"margin:2px\"/>' + \" 圈選同住者\"\n document.getElementById(\"freedraw_img\").src = APPLICATION_ROOT + \"Content/together.png\";\n reRender();\n}", "function stopDrawing(){\n let removed = false;\n\n document.addEventListener('keydown', function(e){\n if(e.repeat){return;}\n const key = e.code;\n\n if(key === STOP_KEY){\n if(!removed){\n hoverToggle(false);\n removed = true;\n }\n\n else{\n hoverToggle(true);\n removed = false;\n }\n\n }\n });\n }", "stop() {\n if (this.drawRequest) {\n window.cancelAnimationFrame(this.drawRequest);\n this.drawRequest = 0;\n this.ctx.clearRect(x0+1, y0, this.ctx.canvas.width, this.ctx.canvas.height);\n }\n }", "checkForDraw() {\n if (turn == 8 && this.match == false) {\n document.getElementById(\"winner\").innerHTML = \"The game ended in a draw\";\n document.getElementById(\"reset-button\").disabled = false;\n running = false;\n }\n }", "function draw() {\n background(204, 231, 227)\n checkState();\n}", "function btnGoCrazyOnClickHandler(event) {\r\n\tkeepDrawing(true);\r\n }", "function draw(){\r\n currentDescription = false;\r\n if(startScreen){\r\n drawStart();\r\n }\r\n else{\r\n if(treeopen){\r\n drawTechtree();\r\n if(drag){\r\n gridDrag();\r\n }\r\n descriptionManager();\r\n alertManager();\r\n }\r\n else{\r\n if(end_triggered){\r\n endManager();\r\n }\r\n else{\r\n drawbackground();\r\n drawgrid();\r\n drawUniques();\r\n drawGhouls();\r\n drawfog();\r\n drawObjects();\r\n drawCursor();\r\n drawMenu();\r\n //moveSwitch();\r\n if(drag){\r\n gridDrag();\r\n }\r\n if(popupOpen===false&&document.body.style.cursor==='pointer'){\r\n document.body.style.cursor='default';\r\n }\r\n uniqueManager();\r\n descriptionManager();\r\n storyManager();\r\n ghoulManager();\r\n alertManager(); \r\n }\r\n }\r\n }\r\n}", "function renderFlagpole()\n{\n checkFlagpole(); \n push();\n strokeWeight(5);\n stroke(180);\n line(flagpole.x_pos, floorPos_y, flagpole.x_pos, floorPos_y-250);\n noStroke();\n fill(250,0, 250);\n if (flagpole.isReached)\n { \n rect(flagpole.x_pos,floorPos_y-250, 50, 50);\n }\n else\n { \n rect(flagpole.x_pos,floorPos_y-50, 50, 50);\n }\n pop(); \n}", "startDrawing() {\n\n this.clearCanvas();\n //use because funtions was lost in methods\n var that = this;\n //event of mous click\n this.canvas.addEventListener(\"mousedown\", function(e) {\n //show confirmation button after first click\n document.getElementById(\"station-confirmer-btn\").style.display = \"initial\";\n document.getElementById(\"canvas\").style.borderColor = \"#5CB85C\";\n //switch on\n that.test = true;\n //begin of drawing\n that.context.beginPath();\n that.context.moveTo(e.offsetX, e.offsetY);\n //get the movement of mouse\n that.canvas.addEventListener(\"mousemove\", function(event) {\n //condition to check switch\n if (that.test === true) {\n var x = event.offsetX;\n var y = event.offsetY;\n //draw line to every next point od movement\n that.context.lineTo(x, y);\n that.context.stroke();\n }\n });\n });\n //mouse up event\n this.canvas.addEventListener(\"mouseup\", function() {\n //switch of\n that.test = false;\n });\n }", "hideDrawingTool () {\n this.drawingManager.setDrawingMode(null)\n this.startedDrawing = false\n }", "drawOffscreen() { }", "function btnGoOnClickHandler(event) {\r\n\tkeepDrawing(false);\r\n }", "function startDrawing(event) {\n\tdrawingMode = true;\n\tmouseUpDownLabel.innerHTML = \"Mouse Button Down (drawing mode)\";\n}", "function actualFlag(x,y) {\n var ctx = canvas.getContext('2d');\n ctx.lineTo(x+21,y+22);\n ctx.lineTo(x+28,y+22);\n ctx.lineTo(x+28,y+25);\n ctx.lineTo(x+12,y+25);\n ctx.lineTo(x+12,y+22);\n ctx.lineTo(x+19,y+22);\n ctx.lineTo(x+19,y+8);\n ctx.lineTo(x+12,y+4);\n ctx.lineTo(x+21,y+0);\n}", "function disengage(e) {\n dragging = false;\n //2.12 to avoid the connection between the engage and disengage line\n context.beginPath();\n }", "function draw(_enable){\n isDrawn = (_enable == 1)?true: false;\n}", "function deactivateDraw() {\r\n measureConfig.isActive = false;\r\n measureConfig.activeFeature = null;\r\n measureButton.classList.toggle(\"esri-draw-button-selected\");\r\n pointerDownListener.remove();\r\n pointerMoveListener.remove();\r\n doubleClickListener.remove();\r\n }", "function renderFlagpole()\n{\n \n push()\n stroke(150);\n strokeWeight(5);\n line(flagpole.x_pos, floorPos_y, flagpole.x_pos, floorPos_y - 200);\n \n if(flagpole.isReached)\n {\n fill(255,0,0);\n rect(flagpole.x_pos, floorPos_y -200, 50,50);\n }\n \n else\n {\n fill(255,0,0);\n rect(flagpole.x_pos, floorPos_y -50, 50,50);\n }\n \n pop();\n \n}", "function startDrawing(x,y){\n // console.log(e);\n isDrawing = true;\n startX = x;\n startY = y;\n}", "function redraw() {\n // Clears the canvas\n context.clearRect(0, 0, context.canvas.width, context.canvas.height);\n\n for (var i = 0; i < clickX.length; i += 1) {\n if (!clickDrag[i] && i == 0) {\n context.beginPath();\n context.moveTo(clickX[i], clickY[i]);\n context.stroke();\n } else if (!clickDrag[i] && i > 0) {\n context.closePath();\n\n context.beginPath();\n context.moveTo(clickX[i], clickY[i]);\n context.stroke();\n } else {\n context.lineTo(clickX[i], clickY[i]);\n context.stroke();\n }\n }\n }", "stopRendering () {\n this.d_is_rendering = false;\n }", "function startDrawing(event) {\n isDrawing = true;\n [lastX, lastY] = [event.offsetX, event.offsetY];\n}", "endDrawing() {\n this.setState({\n newDrawing: true,\n });\n }", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "draw() {\n if (this._selected) {\n this.selectedDraw();\n }\n if (this._hovered) {\n this.hoveredDraw();\n }\n if (!this._hovered && !this._selected) {\n this.normalDraw();\n }\n this.isHovered();\n this.isClicked();\n }", "function draw() {\n\n // If not visible stop.\n var element = get_selected_element();\n if (check_with_parents(element, \"display\", \"none\", \"==\") === true || check_with_parents(element, \"opacity\", \"0\", \"==\") === true || check_with_parents(element, \"visibility\", \"hidden\", \"==\") === true) {\n return false;\n }\n\n // selected boxed.\n draw_box(\".yp-selected\", 'yp-selected-boxed');\n\n // Select Others.\n iframe.find(\".yp-selected-others:not(.yp-multiple-selected)\").each(function (i) {\n draw_other_box(this, 'yp-selected-others', i);\n });\n\n // Tooltip\n draw_tooltip();\n\n // Dragger update.\n update_drag_handle_position();\n\n }", "draw() {\n this.padTOuched = true;\n this.ctx.beginPath();\n this.ctx.moveTo(this.prevX, this.prevY);\n this.ctx.lineTo(this.currX, this.currY);\n this.ctx.stroke();\n this.ctx.closePath();\n }", "startdraw(ev) {\n this.is_drawing = true;\n var rect = this.canvas.getBoundingClientRect();\n this.ctx.beginPath();\n this.ctx.lineWidth = 5;\n this.ctx.lineCap = 'round';\n this.ctx.strokeStyle = 'red';\n var x = ev.pageX - rect.left;\n var y = ev.pageY - rect.top;\n this.ctx.moveTo(x, y);\n ev.preventDefault();\n }", "endDrawingShapeMode() {\n if (this.getCurrentState() === states.SHAPE) {\n this._getModule(modules.SHAPE).endDrawingMode();\n this._state = states.NORMAL;\n }\n }", "function drawFlag(x,y,i) {\n var canvas = document.getElementById('canvas');\n if (canvas.getContext) {\n var ctx = canvas.getContext('2d');\n ctx.fillStyle = '#FFFFFF';\n ctx.strokeStyle = '#FFFFFF'\n ctx.font = \"10px Arial\"\n if(i)\n ctx.fillText(i.toString(),x+27,y+27);\n ctx.lineWidth = 2;\n ctx.beginPath();\n ctx.fillStyle = '#FF0000';\n ctx.strokeStyle = '#FFFFFF'\n ctx.moveTo(x+21,y+0);\n alternateFlag(x,y);\n ctx.closePath()\n ctx.stroke();\n ctx.fill();\n }\n}", "startDrawingTool () {\n this.startedDrawing = true\n this.drawingManager.setMap(this.map)\n this.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.POLYGON)\n }", "function draw() {\n if (isLineSelected === true) {\n var xStart, yStart, offset;\n $('#artboard').mousedown(function(e) {\n console.log('dewing');\n offset = $(this).offset();\n xStart = (e.pageX - offset.left);\n yStart = (e.pageY - offset.top);\n renderLine(e, offset);\n }).mouseup(function(e) {\n offset = $(this).offset();\n endLine(e, xStart, yStart, offset);\n })\n } else if (isCircleSelected === true) {\n var xStart, yStart, offset;\n $('#artboard').mousedown/*.click*/(function(e) {\n console.log('dewing');\n offset = $(this).offset();\n xStart = (e.pageX - offset.left);\n yStart = (e.pageY - offset.top);\n renderCircle(e, offset);\n }).mouseup(function(e) {\n offset = $(this).offset();\n endCircle(e, xStart, yStart, offset);\n })\n } else if (isRectSelected === true) {\n var xStart, yStart, w, h, offset;\n $('#artboard').mousedown(function(e) {\n offset = $(this).offset();\n xStart = (e.pageX - offset.left);\n yStart = (e.pageY - offset.top);\n renderRect(e, offset);\n }).mouseup(function(e) {\n offset = $(this).offset();\n endRect(e, xStart, yStart, w, h, offset);\n })\n } else if (isFreeSelected === true) {\n var start, startMid;\n drawFreeLine();\n }\n}", "function mouseStatus(res, e) {\n let mousePos = getMousePos(canvas,e)\n if (res == 'down') {\n flag = true;\n xSrc = mousePos.x;\n ySrc = mousePos.y;\n draw(mousePos.x,mousePos.y,e);\n }\n if (res == 'up' || res == \"out\") {\n flag = false;\n }\n if (res == 'move') {\n if (flag) {\n draw(mousePos.x,mousePos.y,e);\n }\n }\n}", "function draw() {\n console.log(\"start draw\");\n switch (spelStatus) {\n case SPELEN:\n welkeSpelerRijKolom();\n tekenVeld();\n tekenSpeler(spelerKolom, spelerRij);\n tekenVijand(vijandKolom, vijandRij);\n\n if(spelerTurn === true) {\n aanvallen();\n bewegen(welkeSpelerKolom,welkeSpelerRij,welkeVijandKolom,welkeVijandRij);\n }\n\n if(vijandTurn === true) {\n aanvallen();\n bewegen(welkeSpelerKolom,welkeSpelerRij,welkeVijandKolom,welkeVijandRij);\n }\n\n levensVanSpeler();\n levensVanVijand();\n\n \n\n gameOver();\n break;\n\n\n case STARTSCHERM:\n background('lightblue');\n textSize(70);\n text(\"Counter-Strike: Execution Force\", 130, 150);\n \tspeelKnop();\n uitlegKnop();\n creditsKnop();\n\n\n\n\n break;\n\n case GAMEOVER:\n gameOverScherm();\n\n\n\n\n break;\n\n case UITLEG:\n uitlegScherm();\n \n\n break;\n\n case CREDITS:\n creditScherm();\n\n break;\n }\n \n}", "function endDrawing() {\n\n //Removes the event listener form mouse movement to stop the rectangle from being repeatedly drawn\n document.removeEventListener('mousemove', drawRect)\n document.removeEventListener('mouseup', endDrawing)\n document.removeEventListener('mousedown', holdCursor)\n \n\n //We will only draw the panel if its drawn from top corner to bottom corner\n //Mainly makes the math for everything else alot easier to deal with\n\n\n //Below for loop checks to make sure the box being drawn does not overlap any other boxes\n notInside = true\n\n for(let i = 0; i < panels[whichPanel].length; i++)\n {\n if(coordinates.y > canvas.height*0.93)\n {\n notInside = false\n }\n else if(coordinates.x > panels[whichPanel][i].x && coordinates.x < panels[whichPanel][i].x + panels[whichPanel][i].width && coordinates.y > panels[whichPanel][i].y && coordinates.y < panels[whichPanel][i].y + panels[whichPanel][i].height)\n {\n notInside = false\n break\n }\n else if(leftCorner.y < panels[whichPanel][i].y + panels[whichPanel][i].height && leftCorner.x < panels[whichPanel][i].x + panels[whichPanel][i].width && (coordinates.y > panels[whichPanel][i].y && coordinates.x > panels[whichPanel][i].x))\n {\n notInside = false\n break\n }\n }\n\n if(coordinates.x > leftCorner.x && coordinates.y > leftCorner.y && notInside == true)\n {\n if(isPremium === \"False\" && panels[whichPanel].length > 5) {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n for(i = 0; i < panels[whichPanel].length; i++)\n {\n ctx.beginPath()\n ctx.rect(panels[whichPanel][i].x, panels[whichPanel][i].y, panels[whichPanel][i].width, panels[whichPanel][i].height)\n ctx.stroke()\n ctx.closePath()\n }\n bottomBar(barNum)\n } else if(isPremium !== \"False\" && panels[whichPanel].length > 7) {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n for(i = 0; i < panels[whichPanel].length; i++)\n {\n ctx.beginPath()\n ctx.rect(panels[whichPanel][i].x, panels[whichPanel][i].y, panels[whichPanel][i].width, panels[whichPanel][i].height)\n ctx.stroke()\n ctx.closePath()\n }\n bottomBar(barNum)\n } else {\n //Gets the dimensions of the final panel\n panelDims = drawDragRect(canvas, event, leftCorner)\n let viewNum = createNewPanel(panelDims.x, panelDims.y, panelDims.width, panelDims.height)\n takeInput(viewNum)\n\n //Pushes the finalized panel to the panel array\n panels[whichPanel].push({\n x: panelDims.x,\n y: panelDims.y,\n width: panelDims.width,\n height: panelDims.height,\n viewNum: viewNum\n })\n fs.writeFile('saveData.json', JSON.stringify(panels), 'utf-8', () => {})\n }\n }\n else\n {\n //Get rid of the box drawn while drawing\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n for(i = 0; i < panels[whichPanel].length; i++)\n {\n ctx.beginPath()\n ctx.rect(panels[whichPanel][i].x, panels[whichPanel][i].y, panels[whichPanel][i].width, panels[whichPanel][i].height)\n ctx.stroke()\n ctx.closePath()\n }\n bottomBar(barNum)\n }\n }", "function draw() {\n if (controllers.free_flow_flag) {\n draw_step();\n }\n\n}", "function stopPainting() {\n if (artPad.localUser && artPad.localUser.painting == true) {\n artPad.localUser.painting = false;\n artPad.localUser.inputSequence.push([4, false]);\n artPad.localUser.handleLocalInput([4, false]);\n } \n document.body.classList.remove(\"unselectable\");\n}", "function drawStopButton(ctx,color) {\r\n ctx.clearRect(0,0,28,26); ctx.fillStyle=color;\r\n ctx.fillRect( 8, 7,12,13);\r\n }", "function drawFlags() {\n var canvas = document.getElementById('canvas');\n var context = canvas.getContext('2d');\n for(var i = 0; i < number_of_coordinates; i++) {\n if(i > 0) {\n context.setLineDash([5]);\n context.beginPath();\n context.lineWidth = 2;\n context.strokeStyle = '#FFFFFF';\n context.moveTo(current_coordinate_list[i].x,current_coordinate_list[i].y);\n context.lineTo(current_coordinate_list[i-1].x,current_coordinate_list[i-1].y);\n context.stroke();\n context.setLineDash([]);\n }\n }\n for(var i = 0; i < number_of_coordinates; i++) {\n drawFlag(current_coordinate_list[i].x-20,current_coordinate_list[i].y-35,i+1);\n }\n}", "function endEdgeDrawing() {\r\n drawingEdge = false;\r\n edgeStartNode = undefined;\r\n edgeTargetNode = undefined;\r\n Canvas.update();\r\n\r\n // draw edge overlay if edge value change context menu is visible\r\n let edgeContextValue = document.getElementById('context-menu-edge-value');\r\n if (edgeContextValue.style.visibility == 'visible') {\r\n lastSelectedEdge.drawOverlay(Canvas.ctx);\r\n }\r\n\r\n console.log('endEdgeDrawing');\r\n}", "draw() {\n if (this.isFilled) {\n this.fill();\n } else {\n this.outline();\n }\n }", "function canvas_mouseDown(){\r\n drawing = true;\r\n context.moveTo(event.pageX, event.pageY);\r\n context.beginPath();\r\n}", "checkDraw()\n { \n if (this.counter == 9) \n {\n document.getElementById('message').style.color = \"red\";\n this.setMessage(\"Sorry, the game has ended in a draw.\");\n }\n }", "function draw() {\n if (canvasValid == false) {\n clear(ctx);\n\n // Add stuff you want drawn in the background all the time here\n\n // draw all boxes\n var l = boxes.length;\n for (var i = 0; i < l; i++) {\n drawshape(ctx, boxes[i], boxes[i].fill);\n }\n\n // draw selection\n // right now this is just a stroke along the edge of the selected box\n if (mySel != null) {\n ctx.strokeStyle = mySelColor;\n ctx.lineWidth = mySelWidth;\n ctx.strokeRect(mySel.x,mySel.y,mySel.w,mySel.h);\n }\n\n // Add stuff you want drawn on top all the time here\n\n canvasValid = true;\n //if(mySel != null)\n // fall();\n timeStep();\n }\n}", "function draw() {\n switch (spelStatus) {\n\n case STARTSCHERM:\n background(backgroundImg);\n text(\"Start\",400,240,200,400);\n textSize(200);\n StartSpel ();\n break;\n\n case SPELEN:\n background(backgroundImg);\n beweegVijand();\n beweegKogel();\n beweegSpeler();\n \n if (checkVijandGeraakt()) {\n // punten erbij\n // nieuwe vijand maken\n }\n \n if (checkSpelerGeraakt() == true) {\n \n aantalLevens--;\n }\n\n levens();\n tekenVeld();\n tekenVijanden();\n tekenKogel(kogelX, kogelY);\n tekenSpeler(mouseX - 100, spelerY);\n\n\n if (checkGameOver()) {\n spelStatus = GAMEOVER;\n }\n break;\n \n case GAMEOVER:\n background(backgroundImg);\n text(\"Game over\",400,70,400,400);\n text(\"Start opnieuw\",400,240,400,400);\n textSize(50);\n StartSpelGameOver();\n break; \n } \n}", "drawFlagged() {\n\n //for (var i = 0, len = this.flaggedPixels.length; i < len; i++) {\n // let pixel = this.flaggedPixels[i];\n // this.drawSinglePixel(pixel.xCoord, pixel.yCoord);\n //}\n\n this.flaggedPixels.forEach((pixel) => {\n this.drawSinglePixel(pixel.xCoord, pixel.yCoord);\n });\n\n this.flaggedPixels.length = 0;\n }", "function startPainting(event){ \n paint = true; \n getPosition(event); \n}", "function redraw(){\n// context.clearRect(0, 0, context.canvas.width, context.canvas.height); // Clears the canvas\n \n \n context.lineJoin = \"round\";\n context.lineWidth = 5;\n \n for(var i=0; i < clickXY[0].length; i++) {\t\t\n context.beginPath();\n if(clickDrag[i] && i){\n context.moveTo(clickXY[0][i-1], clickXY[1][i-1]);\n }else{\n context.moveTo(clickXY[0][i]-1, clickXY[1][i]);\n }\n context.lineTo(clickXY[0][i], clickXY[1][i]);\n context.closePath();\n context.strokeStyle = clickColor[i];\n context.stroke();\n }\n }", "function findxy(res, e) {\n if (res == 'down') {\n prevX = currX;\n prevY = currY;\n currX = e.clientX - canvas.offsetLeft;\n currY = e.clientY - canvas.offsetTop;\n\n flag = true;\n dot_flag = true;\n if (dot_flag) {\n ctx.beginPath();\n ctx.fillStyle = x;\n ctx.fillRect(currX, currY, 2, 2);\n ctx.closePath();\n dot_flag = false;\n }\n }\n if (res == 'up' || res == \"out\") {\n flag = false;\n }\n if (res == 'move') {\n \n if (flag) {\n prevX = currX;\n prevY = currY;\n currX = e.clientX - canvas.offsetLeft;\n currY = e.clientY - canvas.offsetTop;\n draw(prevX , prevY , currX , currY , x , y);\n }\n }\n}", "function scratchOff(){\n\t\t\tgetMousePosition();\n\t\t\tvar idx = getSpaceIndex(positionTracker.pos_x, positionTracker.pos_y);\n\t\t\tif(spaces[idx] != undefined){\n\t\t\t\tif(spaces[idx].clicked){\n\n\t\t\t\t$(\"canvas\").mousemove(function(event){\n\t\t\t\t\tvar magnitude = distFromCircleCenter(positionTracker.pos_x, positionTracker.pos_y,idx);\n\t\t\t\t\tvar neighbourCol = setNeighbourColor(spaces[idx].adjacentNeighbours);\n\t\t\t\t\tif(magnitude < Math.ceil(0.5*circleSize)){\n\t\t\t\t\t\tvar scratchPath = new Path.Circle(new Point(positionTracker.pos_x, positionTracker.pos_y),scratchSize).fillColor = neighbourCol;\n\t\t\t\t\t}\n\n\n\t\t\t\t});\n\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function drawFind(){\n if(points.length < 3){ //safety case\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.font = '18pt Calibri';\n context.fillStyle = 'black';\n context.fillText(\"Need 3 or more points for the algorithm to be intresting!\", 10, 25);\n return;\n }\n \n \n document.getElementById(\"run\").style.display = \"inline\";\n document.getElementById(\"drawFind\").style.display = \"none\";\n running = true;\n drawFinding = true;\n}", "function showFlag(evt) {\n var pos = getMousePos(canvas, evt);\n canvas_flag_position.x = pos.x - 20;\n canvas_flag_position.y = pos.y - 27;\n drawFlag(pos.x - 20,pos.y - 27);\n canvas_flag_active = true;\n}", "function endMove() {\n moveMode = 0;\n drawMethod();\n}", "beginPath() {\n this.justBegun = true;\n this.context.beginPath();\n }", "function draw(){\n if(count >= 9 && flag == true){\n hide('turn');\n setText('gameover', \"<p class='text-center' >GAME-OVER <br> Match has been Drawn! </p>\");\n show(\"gameover-block\");\n flag = false;\n restart = document.getElementById(\"Play-Again\").addEventListener('click',reloadPage);\n }\n}", "function findxy(res, e) {\n debug_update(prevX, prevY, currX, currY, e.clientX, e.clientY);\n if (res == 'down') {\n prevX = currX;\n prevY = currY;\n currX = e.clientX - canvas.offsetLeft + document.body.scrollLeft;\n currY = e.clientY - canvas.offsetTop + document.body.scrollTop;\n prevX = currX;\n prevY = currY;\n\t\t\n\t\tconsole.log(lastIter[currY-currY%pixelSize][currX-currX%pixelSize]);\n\t\tctx.fillRect(currX-currX%pixelSize,currY-currY%pixelSize,pixelSize,pixelSize);\n\t\tpixArr[currX-currX%pixelSize][currY-currY%pixelSize] = 1;\n\t\tlastIter[currY-currY%pixelSize][currX-currX%pixelSize] = 1;\n\t\tconsole.log(lastIter[currY-currY%pixelSize][currX-currX%pixelSize]);\n flag = true;\n }\n if (res == 'up' || res == \"out\") {\n flag = false;\n }\n if (res == 'move') {\n\t\tconsole.log(flag);\n if (flag) {\n currX = e.clientX - canvas.offsetLeft + document.body.scrollLeft;\n currY = e.clientY - canvas.offsetTop + document.body.scrollTop;\n prevX = currX;\n prevY = currY;\n\t\t\tctx.fillRect(currX-currX%pixelSize,currY-currY%pixelSize,pixelSize,pixelSize);\n\t\t\tpixArr[currY-currY%pixelSize][currX-currX%pixelSize] = 1;\n\t\t\tlastIter[currY-currY%pixelSize][currX-currX%pixelSize] = 1;\n }\n }\n}", "function drawLoop() {\n\t\t\tif (pauseOverlay)\n\t\t\t\treturn;\n\t\t\trequestAnimFrame(drawLoop);\n\t\t\toverlay.getContext('2d').clearRect(0, 0, width, height);\n\t\t\tif (cl.getCurrentPosition()) {\n\t\t\t\tcl.draw(overlay);\n\t\t\t}\n//\t\t\t$(\"#microphone\").css(\"height\", \"0%\");\n//\t\t\t$(\"#microphone\").parent().css(\"background-color\",\n//\t\t\t\t\tgetColorForPercentage(1 - meter.volume));\n//\t\t\t$(\"#volume\").val(1 - meter.volume);\n\t\t}", "function draw() {\n line(lineX, lineY, lineXEnd, lineY);\n lineX+=5;\n lineXEnd +=5;\n if(lineX==width && lineXEnd==width){\n noLoop();\n }\n}", "function drawFlag() {\n fill(255,150,0);\n strokeWeight(5);\n line(flagX,highestPoint,flagX,highestPoint-50);\n triangle(flagX,highestPoint-50,flagX+25,highestPoint-40, flagX, highestPoint-30);\n}", "handlemousedown(e) {\n this.ctx = this.canvas.getContext(\"2d\");\n const rect = this.canvas.getBoundingClientRect();\n this.prevX = this.currX;\n this.prevY = this.currY;\n this.currX = e.clientX - rect.left;\n this.currY = e.clientY - rect.top;\n\n this.flag = true;\n this.dot_flag = true;\n if (this.dot_flag) {\n this.ctx.beginPath();\n this.ctx.fillRect(this.currX, this.currY, 2, 2);\n this.ctx.closePath();\n this.dot_flag = false;\n }\n }", "function startDraw(e) {\n ctx.beginPath();\n draw(e);\n}", "stop(){this.__stopped=!1;this.toggleAnimation()}", "function userDown() {\n if (!isStopped) {\n while (FallingShape.isLoweringNeeded()) {\n FallingShape.lower();\n drawGame();\n }\n }\n }", "function keepDrawing(crazymode) {\r\n\tdraw();\r\n\tsetTimeout(function() {update(crazymode);}, 100);\r\n}", "run(obs) {\n if (!this.stopped) {\n this.update();\n // If I hit an edge or an obstacle\n if ((this.borders()) || (this.checkObstacles(obs))) {\n this.stopped = true;\n this.dead = true;\n }\n }\n // Draw me!\n this.display();\n }", "draw( d ){\r\n\t\tif( (d & 1) != 0 ) this.ctx.fill();\r\n\t\tif( (d & 2) != 0 ) this.ctx.stroke();\r\n\t}", "function stop() {\n if (timer) clearInterval(timer);\n timer = null;\n var brush = canvas.getContext(\"2d\");\n brush.clearRect(0, 0, canvas.width, canvas.height);\n }", "function undrawPiece() {\nfor (var i =0; i<active.location.length;i++){\n row = active.location[i][0];\n col = active.location[i][1];\n if( grid[row][col] !== BORDER){\n\n\n ctx.fillStyle = \"black\";\n ctx.fillRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n ctx.strokeStyle = \"white\";\n ctx.strokeRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n grid[row][col] = -1;}\n}\n}", "function draw() {\n if (isEpilepsyMode) {\n epilepsyMode.draw();\n } else if (isNormalMultiplayer) {\n NormalMultiplayer.draw();\n } else if (isMultiplayerFrenzy) {\n MultiplayerFrenzy.draw();\n } else if (isCrazyPaddles) {\n CrazyPaddles.draw();\n }\n //draws background of the menu if the secondflag is true\n function drawloop() {\n if (secondflag) {\n //allows the speed of the stars to increase depending on the y co-ordinates of the mouse pointer\n speed = map(mouseY, 0, width, 0, 50);\n background(0);\n translate(width / 2, height / 2);\n //for loop that is dependant on the length of the stars array, and runs in order to move the stars and show them on the screen\n for (var j = 0; j < stars.length; j++) {\n stars[j].update();\n stars[j].show();\n }\n }\n }\n drawloop()\n\n}", "function posiy1chnge() {\n posy1 = document.getElementById(\"positiony1\").value;\n if (flag == 1) {\n drawsine();\n }\n if(flag==3){\n bthdhlfrc();\n }\n if(flag==4){\n grndhlfrc();\n }\n}", "function freeDraw() {\n mainDiagram.toolManager.panningTool.isEnabled = false;\n // create drawing tool for mainDiagram, defined in FreehandDrawingTool.js\n var tool = new FreehandDrawingTool();\n // provide the default JavaScript object for a new polygon in the model\n tool.archetypePartData =\n { stroke: \"black\", strokeWidth: 5, category: \"FreehandDrawing\", key: uuidv4() };\n // install as last mouse-move-tool\n mainDiagram.toolManager.mouseMoveTools.add(tool);\n globalState.tool = tool;\n this.onclick = cancelFreeDraw;\n document.getElementById(\"freedraw\").innerHTML = '<img id=\"freedraw_img\" width=\"20\" height=\"20\" style=\"margin:2px\"/>' + \" 完成\"\n document.getElementById(\"freedraw_img\").src = APPLICATION_ROOT + \"Content/done.png\";\n\n}", "function drawTrial() {\n //render the frame\n ctx.fillStyle = backgroundColour;\n ctx.fillRect(0,0, 400, 400); //clear the background\n\n watch.draw(); //draw the watch (+ interaction area)\n G1.draw(displayG1, innerRatio);\n G2.draw(displayG2, midRatio);\n G3.draw(displayG3, ratio);\n\n //draw indicator\n indicator.draw();\n var isSelected = G1.poiSelected || G2.poiSelected || G3.poiSelected;\n indicator.update(isSelected);\n\n timingIndicator.draw();\n timingIndicator.update(true);\n}", "function startPosition(){\n painting = true;\n }" ]
[ "0.77894545", "0.76637816", "0.74050754", "0.7364355", "0.7339853", "0.7305041", "0.72641885", "0.72250944", "0.7168692", "0.6922854", "0.6756381", "0.6728722", "0.67209077", "0.66912043", "0.6664792", "0.6659806", "0.66434693", "0.66144294", "0.66121805", "0.66078514", "0.65714175", "0.65666693", "0.6553071", "0.6534441", "0.650398", "0.6497779", "0.6495824", "0.6467649", "0.6453656", "0.64482814", "0.64381874", "0.6417614", "0.64104384", "0.6374596", "0.63569444", "0.63554096", "0.6334569", "0.63313097", "0.6313885", "0.62813795", "0.6242362", "0.62408805", "0.6227828", "0.6223159", "0.62190163", "0.6186028", "0.61764514", "0.6166968", "0.6132027", "0.61219", "0.6121614", "0.611038", "0.6103356", "0.60901237", "0.6089376", "0.6084601", "0.60763144", "0.6075392", "0.60748917", "0.6073897", "0.6072579", "0.6071658", "0.6070399", "0.60676444", "0.6059028", "0.6054995", "0.6045128", "0.6033719", "0.602063", "0.6020535", "0.60162187", "0.60125047", "0.6000858", "0.59949005", "0.599292", "0.59854555", "0.59794486", "0.5971626", "0.5970244", "0.5968785", "0.595824", "0.5958073", "0.5954213", "0.5948628", "0.5943004", "0.59410524", "0.59402585", "0.59392476", "0.5930111", "0.5922703", "0.59192383", "0.5919118", "0.59128934", "0.59079415", "0.5903621", "0.5902002", "0.5901265", "0.5898843", "0.5896071", "0.5893982", "0.5885285" ]
0.0
-1
Checks if mouse has reached out of bounds
function mouseLeaveEvent() { left_click_drag_flag = false; right_click_drag_flag = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boundsCheck(xM, yM, x, y, w, h){ \n if(xM > x && xM < x + w && yM > y && yM < y+ h){\n return true; //mouse in boundary \n }else{\n return false; //mouse not in boundary \n } \n}", "boundsCheck(xM, yM, x, y, w, h){ \n if(xM > x && xM < x + w && yM > y && yM < y+ h){\n return true; //mouse in boundary \n }else{\n return false; //mouse not in boundary\n }\n }", "checkMouse(x, y, posY) {\r\n return x >= document.documentElement.clientWidth/2-150 \r\n && x <= document.documentElement.clientWidth/2-150 + 300\r\n && y >= posY \r\n && y <= posY + 50\r\n }", "isMouseOver() {\n return mouseX > this.x - this.w / 2 && mouseX < this.x + this.w / 2\n && mouseY > this.y - this.h / 2 && mouseY < this.y + this.h / 2;\n }", "isOut() {\n if (this.offsetX < -this.limitx()) this.offsetX = -this.limitx();\n if (this.offsetX > this.limitx()) this.offsetX = this.limitx();\n if (this.offsetY < -this.limity()) this.offsetY = -this.limity();\n if (this.offsetY > this.limity()) this.offsetY = this.limity();\n }", "function cursorInBounds() {\n var boundOb = $(event.currentTarget);\n try {boundOb.offset();} catch {return false;}\n var xTest = boundOb.offset().left;\n var yTest = boundOb.offset().top;\n\n if(event.pageX >= xTest && event.pageY >= yTest && event.pageX <= xTest+boundOb.width() && event.pageY <= yTest+boundOb.height()) {\n return true;\n }\n return false;\n}", "function cursorOff() {\r\n\tvar left = parseInt(over.style.left);\r\n\tvar top = parseInt(over.style.top);\r\n\tvar right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));\r\n\tvar bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);\r\n\r\n\tif (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;\r\n\r\n\treturn false;\r\n}", "function checkMouse() {\n var holdBat = false;\n holdBat = collidePointRect(\n mouseX,\n mouseY,\n batX - 100,\n batY,\n bat.width + 260,\n bat.height\n );\n if (holdBat && gameIsOver == false) {\n batX = mouseX - bat.width / 2;\n batY = mouseY - bat.height / 2;\n }\n}", "mouseOverCheck(x,y){\n let d = dist(x,y,this.locX,this.locY);\n if(d<this.ballSize/2){return true;}\n else{return false;}\n }", "function shadow_cursorOff() {\n var left = parseInt(over.style.left);\n var top = parseInt(over.style.top);\n var right = left + (o3_shadow ? o3_width : over.offsetWidth);\n var bottom = top + (o3_shadow ? o3_aboveheight : over.offsetHeight);\n\n if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;\n return false;\n }", "function isMouseOutside(){\n var outLeft = (pageX < (elLeft - settings.threshold - settings.offsetLeft)) && (pageX < (tipLeft - settings.threshold - settings.offsetLeft)),\n outRight = (pageX > (elLeft + elWidth + settings.threshold + settings.offsetLeft)) && (pageX > (tipLeft + tipWidth + settings.threshold + settings.offsetLeft)),\n outAbove = (pageY < (elTop - settings.threshold - settings.offsetTop)) && (pageY < (tipTop - settings.threshold - settings.offsetTop)),\n outBelow = (pageY > (elTop + elHeight + settings.threshold + settings.offsetTop)) && (pageY > (tipTop + tipHeight + settings.threshold + settings.offsetTop));\n\n return ( ( outLeft || outRight ) || ( outAbove || outBelow ) );\n }", "inBounds() {\n if (this.pos.x <= -50 || this.pos.x > 690 || this.pos.y <= -50 || this.pos.y > 690) {\n this.active = false;\n }\n }", "function OutOfCanvas(a) {\n return (a.x< (-jaws.width/3));\n }", "function outBounds() {\r\n if (x + 60 >= canvas.width + 10 || x <= 10 || y + 30 >= canvas.height || y - 15 <= 40) {\r\n cancelAnimationFrame();\r\n }\r\n}", "function pointerIsOver(x,y, element) {\n var bounds = element.getBoundingClientRect()\n return bounds.top <= y&&y <= bounds.bottom\n && bounds.left <= x&&x <= bounds.right\n}", "function pointerIsOver(x,y, element) {\n var bounds = element.getBoundingClientRect()\n return bounds.top <= y&&y <= bounds.bottom\n && bounds.left <= x&&x <= bounds.right\n}", "function pointerIsOver(x,y, element) {\n\t var bounds = element.getBoundingClientRect()\n\t return bounds.top <= y&&y <= bounds.bottom\n\t && bounds.left <= x&&x <= bounds.right\n\t}", "function onDrawingBoard() {\n return (pmouseX > 0 && pmouseX < 400 && mouseX > 0 && mouseX < 400 &&\n pmouseY > 0 && pmouseY < 400 && mouseY > 0 && mouseY < 400);\n}", "function OLcursorOff(){\r\nif(OLovertwoPI&&over==over2)return false;\r\nvar left=parseInt(over.style.left),top=parseInt(over.style.top);\r\nvar right=left+o3_width,bottom=top+((OLbubblePI&&o3_bubble)?OLbubbleHt:over.offsetHeight);\r\nif(o3_x<left||o3_x>right||o3_y<top||o3_y>bottom)return true;\r\nreturn false;\r\n}", "inBoundary(mouseCoordinates){\n if (this.x <= mouseCoordinates.x && this.y<=mouseCoordinates.y) {\n const boxEdgeX = this.x + this.width;\n const boxEdgeY = this.y + this.height;\n if (mouseCoordinates.x <= boxEdgeX && mouseCoordinates.y <= boxEdgeY) {\n return true;\n }\n }\n return false;\n }", "offscreen() {\r\n if (this.x < -this.w) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "offscreen() {\n if (this.xpos < -this.width) {\n return true;\n } else {\n return false;\n }\n }", "offscreen() {\n if (this.x < -this.width) {\n return true;\n }\n return false;\n }", "isMouseOver(){\n let x = this.position.x + this._width/2;\n let y = this.position.y + this._height/2;\n let h = mouseX;\n let k = mouseY;\n let ry = this._height/2;\n let rx = this._width/2;\n\n let ry2 = ry*ry;\n let rx2 = rx*rx;\n\n return ry2*(x-h)*(x-h) + rx2*(y-k)*(y-k) <= ry2*rx2; \n }", "function isInside() {\n //mouseX, mouseY\n\n\n\n return bool\n}", "isMouseOver(element) {\n if (!element) {\n element = this.$el\n }\n let { x, y } = this.$store.state.mousePosition\n let rect = element.getBoundingClientRect()\n return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom\n }", "function checkMousePos(e){\n\tmouseX = e.pageX - this.offsetLeft;\n\tmouseY = e.pageY - this.offsetTop;\n\t// console.log(\"X: \" + mouseX + \", Y: \" + mouseY);\n}", "hitTest(mouseLoc) {\n if ( mouseLoc.x > this.loc.x &&\n mouseLoc.x < this.loc.x + this.myWidth &&\n mouseLoc.y > this.loc.y &&\n mouseLoc.y < this.loc.y + this.myHeight )\n return true;\n\n return false;\n}", "function mouseIsInCanvas(p) {\n if (p.mouseX < 0)\n return false;\n if (p.mouseX > p.width)\n return false;\n if (p.mouseY < 0)\n return false;\n if (p.mouseY > p.height)\n return false;\n return true;\n }", "offscreen(){return this.x < -this.w}", "function checkBoundaries(){\n if(p1.x < 30 || p1.x + p1.width > 480){\n clearInterval(intervalId)\n gameOver()\n }\n}", "function isMouseOver(x,y,w,h){\n if (mouseX > x && mouseX < x+w && mouseY > y && mouseY < y+h) {\n return true;\n }else{\n return false;\n };\n}", "function tearOffExceeded(rect, event) {\n return ((event.clientX < rect.left - TEAR_OFF_THRESHOLD) ||\n (event.clientX >= rect.right + TEAR_OFF_THRESHOLD) ||\n (event.clientY < rect.top - TEAR_OFF_THRESHOLD) ||\n (event.clientY >= rect.bottom + TEAR_OFF_THRESHOLD));\n}", "function is_out_of_bounds()\n{\n\tif (frog.x < 0 || frog.x > 380) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "mouseOn() {\n if (mouseX > this.x && mouseX < this.x + this.w\n && mouseY > this.y && mouseY < this.y + this.h) {\n this.mouseover = true;\n }\n else {\n this.mouseover = false;\n }\n }", "_rectIsHovered(rect, mouseOffsetPosition) {\n var positionWithinRect = getRelativePosition(mouseOffsetPosition, rect);\n return 0 <= positionWithinRect.left && positionWithinRect.left < rect.width && 0 <= positionWithinRect.top && positionWithinRect.top < rect.height;\n }", "outOfBounds() {\n const minX = this.x >= 0;\n const maxX = this.x < tileSizeFull * cols;\n const minY = this.y >= 0;\n const maxY = this.y < tileSizeFull * rows;\n\n if (!(minX && maxX && minY && maxY)) {\n this.removeSelf();\n }\n }", "offscreen() {\n if (this.xSky < -this.w) {\n return true;\n } else {\n return false;\n }\n }", "offscreen () {\n if(this.y > height + this.pipeHeight) \n return true; \n return false;\n }", "isMouseOver() {\n let x = mouseX - width / 2;\n let y = mouseY - height / 2;\n\n if (this.isPointInTriangle(x - this.x, y - this.y, this.mesh[this.TL],\n this.mesh[this.TR], this.mesh[this.BL])\n || this.isPointInTriangle(x - this.x, y - this.y,\n this.mesh[this.BL], this.mesh[this.TR], this.mesh[this.BR]))\n return true;\n return false;\n }", "function mousePosIsInSelectableArea(pos) {\n\t\tif(pos.x > leftMarg - 2 && pos.x <= leftMarg + drawW + 2 && pos.y > topMarg - 2 && pos.y <= topMarg + drawH + 2) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function inBounds(xMouse, yMouse, x,y,width, height){\r\n if(xMouse > x &&\r\n xMouse < x+width &&\r\n yMouse > y &&\r\n yMouse < y+height){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "function isInside(curs, dropTarget){\n\t // check for x, then y.\n\tvar dt_x = dropTarget.getX(), dt_y = dropTarget.getY();\n\t\n\treturn (curs.x >= dt_x && curs.x < dt_x + dropTarget.getWidth())\n\t\t&& // now check for y.\n\t\t(curs.y >= dt_y && curs.y < dt_y + dropTarget.getHeight());\n}", "isBehindLowerLimit(pos) {\n return pos - this.cursor.clientWidth/2 <= 0;\n }", "function mousePressed() {\n // Check if the mouse is in the x range of the target\n if (mouseX > targetX - targetImage.width/2 && mouseX < targetX + targetImage.width/2) {\n // Check if the mouse is also in the y range of the target\n if (mouseY > targetY - targetImage.height/2 && mouseY < targetY + targetImage.height/2) {\n gameOver = true;\n }\n }\n}", "function mousePressed() {\n // Check if the mouse is in the x range of the target\n if (mouseX > targetX - targetImage.width/2 && mouseX < targetX + targetImage.width/2) {\n // Check if the mouse is also in the y range of the target\n if (mouseY > targetY - targetImage.height/2 && mouseY < targetY + targetImage.height/2) {\n gameOver = true;\n }\n }\n}", "function chkCoord (mousePos, axis) {\n\t\t\tvar mp = mousePos,\n\t\t\t\tpmp = prevMousePos,\n\t\t\t\tinc = (axis === 'x') ? logXEvery : logYEvery;\n\n\t\t\tif (mp[axis] < (pmp[axis] - inc) || mp[axis] > (pmp[axis] + inc))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}", "function isOutsideBrushedRegion(d){\n var s = d3.event.selection,\n x0 = s[0][0],\n y0 = s[0][1],\n x1 = s[1][0],\n y1 = s[1][1];\n\n return (x1-x0 && y1-y0) ?\n xScale(d[0]) < x0 || xScale(d[0]) > x1 || yScale(d[1]) < y0 || yScale(d[1]) > y1 ?\n 1 :\n -1 :\n 0;\n }", "clickedOn(xPos, yPos) {\n return(xPos > this.x && xPos < this.x + this.w && yPos > this.y && yPos < this.y +this.w);\n }", "function checkArea(e) {\n var state = $.data(e.data.target, 'draggable');\n var handle = state.handle;\n var offset = $(handle).offset();\n var width = $(handle).outerWidth();\n var height = $(handle).outerHeight();\n var t = e.pageY - offset.top;\n var r = offset.left + width - e.pageX;\n var b = offset.top + height - e.pageY;\n var l = e.pageX - offset.left;\n\n return Math.min(t,r,b,l) > state.options.edge;\n }", "function checkArea(e) {\n var state = $.data(e.data.target, 'draggable');\n var handle = state.handle;\n var offset = $(handle).offset();\n var width = $(handle).outerWidth();\n var height = $(handle).outerHeight();\n var t = e.pageY - offset.top;\n var r = offset.left + width - e.pageX;\n var b = offset.top + height - e.pageY;\n var l = e.pageX - offset.left;\n\n return Math.min(t,r,b,l) > state.options.edge;\n }", "function checkOutOfBounds() {\n if (bubble < 0) {\n resetBubble();\n }\n}", "isCursorOverInterface() {\r\n\t\treturn intersectTest(_mouse.x, _mouse.y, 0, 0, this.interfaceRect.x,\r\n\t\t\tthis.interfaceRect.y, this.interfaceRect.width, this.interfaceRect.height);\r\n\t}", "outsidePointerEvents() {\n return this._outsidePointerEvents;\n }", "function checkOutOfBounds(x, y){\n\tvar rect = dom.gameBoard.getBoundingClientRect();\n\tvar header = Util.one(\"#header\");\n\tvar headerRect = header.getBoundingClientRect();\n\txOutOfBounds = (x >= rect.left + headerRect.width && x <= rect.right);\n\tyOutOfBounds = (y >= rect.top + headerRect.height && y <= rect.bottom);\n\treturn !(xOutOfBounds && yOutOfBounds)\n}", "inBounds(){\n if (this.pos.x <= 0) {\n this.pos.x = 0;\n }\n if (this.pos.y <= 0) {\n this.pos.y = 0;\n }\n if (this.pos.x >= width ) {\n this.pos.x = width;\n }\n if (this.pos.y >= height) {\n this.pos.y = height;\n }\n }", "contains(mousePosition) {\n const mouseX = mousePosition.x;\n const mouseY = mousePosition.y;\n\n return (this.x <= mouseX) &&\n (this.x + this.width >= mouseX) &&\n (this.y <= mouseY) &&\n (this.y + this.height >= mouseY);\n }", "function mouseInRect(a, b, c, d) {\n if (mouseX >= a && mouseX <= b && mouseY >= c && mouseY <= d) {\n return true;\n } else {\n return false;\n }\n}", "mouseCheck() {\r\n if(this.position.x+this.width/2 > this.movingTo.x-5\r\n &&this.position.x+this.width/2 < this.movingTo.x+5) {\r\n this.movement.x = 0;\r\n this.check(); //Checks for desyncs\r\n this.socket.emit('Desync check', this.number, this.movement.x, this.movement.y, this.side);\r\n } if (this.position.y+this.height/2 > this.movingTo.y-5\r\n &&this.position.y+this.height/2 < this.movingTo.y+5) {\r\n this.movement.y = 0;\r\n this.check(); //Checks for desyncs\r\n this.socket.emit('Desync check', this.number, this.movement.x, this.movement.y, this.side);\r\n }\r\n }", "function invalidPoint(p) {\n if (p.x < XMIN ||\n p.y < YMIN ||\n p.y > SCREEN_HEIGHT ||\n p.x > window.innerWidth) {\n return true;\n }\n}", "function mouseDragged() {\n if (!running) {\n var x = parseInt(mouseX / w);\n var y = parseInt(mouseY / h);\n if (pencil) {\n try {\n grid[x][y].obstacle = true;\n start.obstacle = false;\n } catch (error) {\n console.log(\"Click out of canvas\");\n }\n } else if (eraser) {\n try {\n grid[x][y].obstacle = false;\n } catch (error) {\n console.log(\"Click out of canvas\");\n }\n }\n\n if (cursorX !== x || cursorY !== y) {\n cursorX = x.valueOf();\n cursorY = y.valueOf();\n }\n }\n\n return false;\n}", "outsideCanvas() {\n if(this.y > 400){\n this.y = 380;\n }\n if(this.x > 400){\n this.x = 400;\n }\n else if(this.x < 0){\n this.x = 0;\n }\n }", "function checkAttheEnd(player) {\n return (player.y > OBJ_PIXEL && player.y < OBJ_PIXEL * 2);\n}", "isWithinBounds(bbox) {\n return (\n this.mouseX >= bbox.left &&\n this.mouseX <= bbox.left + bbox.width &&\n this.mouseY >= bbox.top &&\n this.mouseY <= bbox.top + bbox.height\n );\n }", "mouseMoved(e){\n //Construct a very small rectangle on the mouse position\n var mouseRect = {x: e.clientX - 5, y: e.clientY - 5, width: 2, height: 2};\n\n //Check if the mouse rect collides with our button rectangle\n //And assign the bool that returns from the function\n this.highlighted = this.collides(this.rect, mouseRect);\n }", "function inRange(cx, cy, r, mouseX, mouseY){\n\t//verifica se o mouse esta dentro da area(quadrada) do circulo\n\tif(cx-r <= mouseX && mouseX <= cx+r && cy-r <= mouseY && mouseY <= cy+r){\n\t\treturn true;\n\t}\n\treturn false;\n}", "clicked(mouseX, mouseY) {\n if (dist(this.pos.x, this.pos.y, mouseX, mouseY) <= this.r / 2) {\n return true;\n } else {\n return false;\n }\n }", "clickWithinBoundsHandler(event){\n const offsetLeft = document.getElementById(\"canvas\").offsetLeft;\n const offsetTop = document.getElementById(\"canvas\").offsetTop;\n\n if (\n event.clientX-offsetLeft >= this.bounds.xMin\n && event.clientX-offsetLeft <= this.bounds.xMax\n && event.clientY-offsetTop >= this.bounds.yMin\n && event.clientY-offsetTop <= this.bounds.yMax\n ) {\n // executes the action that was registered for these boundaries, then resets them\n this.bounds.action();\n this.bounds = {};\n }\n }", "borders() {\n if ((this.pos.x < 0) || (this.pos.y < 0) || (this.pos.x > width) || (this.pos.y > height)) {\n return true;\n } else {\n return false;\n }\n }", "function wentOffScreen(circle) {\n if (\n circle.x - circle.radius > canvas.width ||\n circle.x + circle.radius * 2 < 0 ||\n circle.y - circle.radius > canvas.height ||\n circle.y + circle.radius * 2 < 0\n ) {\n return true;\n }\n return false;\n }", "isInBounds() {\n\n if(this.position['x'] >= SnakeGame.NUM_COLS) {\n return false;\n }else if(this.position['x'] < 0) {\n return false;\n }else if(this.position['y'] >= SnakeGame.NUM_ROWS) {\n return false;\n }else if(this.position['y'] < 0) {\n return false;\n }\n\n return true;\n\n }", "isWithinBounds(bbox) {\n return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height;\n }", "warning () { return this._ignEllipse.backDist() < this.bounds().xSpacing() }", "isHover(x, y) {\n if (x >= this.x && x <= this.x + this.w\n && y >= this.y && y <= this.y + this.h) {\n return true;\n } else {\n return false;\n }\n }", "function mouseClicked() {\r\n var a = Math.floor(mouseX / w);\r\n var b = Math.floor(mouseY / h);\r\n if (grid[a][b].wall == true) {\r\n grid[a][b].wall = false;\r\n } else {\r\n if (grid[a][b] != start && grid[a][b] != end) {\r\n grid[a][b].wall = true;\r\n\r\n }\r\n }\r\n return false;\r\n}", "function is_collision_with_mouse(object, mouseX, mouseY) {\n // Rectangle\n return (mouseX > object.x && mouseX < object.x + object.image.width && mouseY > object.y && mouseY < object.y + object.image.height);\n}", "function isOver(box, point) {\n return point.x < box.min.x || point.x > box.max.x ||\n point.y < box.max.y || // controllo che la y del point (dito) sia maggiore di quella della figura\n point.z < box.min.z || point.z > box.max.z ? false : true;\n}", "function checkBounds(x, y) {\n return x < 0 || x >= w || y < 0 || y >= h;\n}", "inBounds(low, high) {\n if (this.x < low || this.x > high) return false;\n if (this.y < low || this.y > high) return false;\n return true;\n }", "function outsideBounds(position, world) {\n return position.x > world.length - 1 || position.x < 0 || position.y > world[0].length - 1|| position.y < 0\n}", "function checkArea(e, state) {\n var $handle = $(state.handle);\n var offset = $handle.offset();\n var width = $handle.outerWidth();\n var height = $handle.outerHeight();\n var t = e.pageY - offset.top;\n var r = offset.left + width - e.pageX;\n var b = offset.top + height - e.pageY;\n var l = e.pageX - offset.left;\n\n return Math.min(t, r, b, l) > state.options.edge;\n }", "function onMouseMove(e){\n\t\t\tdata.mousex.push(e.clientX);\n\t\t\tdata.mousey.push(e.clientY);\n\t\t\t\t\n\t\t\t\t/*This if statement reads x and y coords till 100 are reached then stops the event listener*/\n\t\t\t\tif (data.mousex.length >= 100) {\n\t\t\t\tdocument.removeEventListener('mousemove', onMouseMove);\n\t\t\t\t}\n\t\t\t}", "function checkPoint() {\n // sets the x and y position of the cursor event relative to the canvas\n var rect = canvas.getBoundingClientRect();\n var x = event.clientX - rect.left;\n var y = event.clientY - rect.top;\n // loop through the position array checking if the cursor postion is within 5 pixels of a point\n for(i = 0; i < positions.length; i+=2)\n {\n j = i+1;\n xpos = positions[i];\n ypos = positions[j];\n if((x <= xpos+5 && x >= xpos-5) && (y <= ypos+5 && y >= ypos-5))\n {\n // store the indexes for the x and y position that are now selected\n pointX = i;\n pointY = j;\n moveMode = 1; // enable moveMode\n highlightPoint = [positions[i], positions[j]];\n drawMethod();\n }\n }\n}", "function inBounds(coord) {\n return coord.getX() < canvas.width && coord.getY() < canvas.height;\n}", "mouseOn() {\n if (mouseX > this.x && mouseX < this.x + this.w\n && mouseY > this.y && mouseY < this.y + this.h) {\n this.mouseover = true;\n this.stroke = 3;\n }\n else {\n this.mouseover = false;\n this.stroke = 2;\n }\n }", "function clickedScrollbar(evt) {\n return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;\n }", "function checkHit(mousePos) {\n //returns index of hovered obj\n for (var i = shapeArray.length - 1; i > -1; i--){\n if (shapeArray[i].hit(mousePos)){\n return i;\n }\n }\n //returns if there is nothing\n return -1;\n}", "function OnMouseOver(buttonRect : Rect):boolean{\n\tif(buttonRect.Contains(Event.current.mousePosition)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\t\t\n}", "isOutOfGameField() {\r\n return this.position.X < 0 ||\r\n this.position.X > Helper.FieldSize.WIDTH ||\r\n this.position.Y < 0 ||\r\n this.position.Y > Helper.FieldSize.HEIGHT;\r\n }", "goingOutBound() {\n return !(this.canMoveX() && this.canMoveY());\n }", "function positionCheck(clientRect) {\n return event.originalEvent.clientY <= clientRect.top + 10;\n }", "function checkBounds(x,y) {\n return ((0<=x) && (x<=maxX) && (0<=y) && (y<=maxY)); }", "mouseClicked2D(ap5) {\n if (Math.abs(ap5.mouseX - (this.points[0].x + this.points[1].x) / 2) <= this.calcSize().x / 2 &&\n Math.abs(ap5.mouseY - (this.points[0].y + this.points[1].y) / 2) <= this.calcSize().y / 2) {\n this.selected = !this.selected;\n return true;\n }\n else return false;\n }", "function checkAboveClick(pos) {\n if (currentPosition === PositionEnums.REACHING)\n return false;\n if (pos.y < 350 && pos.x > WIDTH / 2 - 240 && pos.x < WIDTH / 2 + 240) {\n if (currentPosition === PositionEnums.LYING || currentPosition === PositionEnums.SLEEPING)\n changePosition(PositionEnums.STANDING);\n else if (pos.y < 260)\n changePosition(PositionEnums.REACHING);\n return true;\n }\n return false;\n}", "function dragover(target) {\r\n const item = document.querySelector('.is-dragging');\r\n const targetPosition = {\r\n minY: target.y, \r\n maxY: target.y + target.clientHeight,\r\n minX: target.x,\r\n maxX: target.x + target.clientWidth,\r\n }\r\n\r\n if((item.offsetLeft >= targetPosition.minX && item.offsetLeft <= targetPosition.maxX) && \r\n (item.offsetTop >= targetPosition.minY && item.offsetTop <= targetPosition.maxY)) {\r\n return true;\r\n }\r\n}", "function checkUnderClick(pos) {\n if (currentPosition === PositionEnums.SLEEPING || currentPosition === PositionEnums.LYING)\n return false;\n if (pos.y > 500 && pos.x > WIDTH / 2 - 240 && pos.x < WIDTH / 2 + 240) {\n if (currentPosition === PositionEnums.REACHING)\n changePosition(PositionEnums.STANDING);\n else\n changePosition(PositionEnums.LYING);\n return true;\n }\n return false;\n}", "hitsCursor(){\n return (this.gameboard.cursor.isHit(this));\n }", "function positionCheck(clientRect) {\n return event.originalEvent.clientX <= clientRect.left + 10;\n }", "detectClicks() {\n if (\n hand.x > this.x &&\n hand.y > this.y &&\n hand.x < this.x + this.markerW &&\n hand.y < this.y + this.markerH\n ) {\n return true;\n } else {\n return false;\n }\n }", "function mouseClicked() {\n\n\t\t//Tests for X and Y\n\t\t//createDiv('Mouse X :' + mouseX + 'Mouse Y :' + mouseY);\n //Code for xy coordinate multiple choice\n if (md >= 35) {\n\t\t//Wrong ans 1\n\t\tif(mouseX >= 101 && mouseY >= 532 && mouseX <= 150 && mouseY <= 575)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Right ans 2\n\t\tif(mouseX >= 110 && mouseY >= 620 && mouseX <= 157 && mouseY <= 662)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Wrong ans 3\n\t\tif(mouseX >= 112 && mouseY >= 722 && mouseX <= 170 && mouseY <= 762)\n\t\t\tgreeting.html('Correct!');\n\t\t//Wrong ans 4\n\t\tif(mouseX >= 121 && mouseY >= 826 && mouseX <= 163 && mouseY <= 857)\n\t\t\tgreeting.html('Incorrect!');\n\t\t//Wrong ans 4\n\t\tif(mouseX >= 126 && mouseY >= 905 && mouseX <= 166 && mouseY <= 937)\n\t\t\tgreeting.html('Correct!');\n\t }\n}", "isUnderMouse(raycaster) {\n if (this.isActive) {\n return raycaster.intersectObjects(this.objects, true).length > 0;\n }\n }" ]
[ "0.73939806", "0.728551", "0.70700103", "0.7066472", "0.70056903", "0.6969794", "0.6950059", "0.6938393", "0.6898686", "0.68246645", "0.6819011", "0.6811353", "0.6806776", "0.677719", "0.6762019", "0.6762019", "0.6732886", "0.6728688", "0.67238617", "0.67154896", "0.66656756", "0.6661507", "0.664613", "0.66244966", "0.6587893", "0.6586589", "0.65821797", "0.6547701", "0.65445715", "0.65326077", "0.65256006", "0.65252286", "0.651575", "0.6502094", "0.6470865", "0.6412338", "0.6378376", "0.6372463", "0.63648206", "0.63631326", "0.6341441", "0.63324857", "0.6325015", "0.6310724", "0.62982434", "0.62982434", "0.6284892", "0.62544334", "0.6236405", "0.6229527", "0.6229527", "0.6224788", "0.6220968", "0.62167823", "0.6216445", "0.61638916", "0.6161608", "0.6128285", "0.6123118", "0.61101586", "0.61059785", "0.60922486", "0.6088754", "0.6088546", "0.6084125", "0.60825455", "0.6081424", "0.6079952", "0.60732996", "0.60689104", "0.6060885", "0.6050735", "0.6045907", "0.6029223", "0.60275704", "0.6023687", "0.60220796", "0.6013616", "0.60082865", "0.60074824", "0.60037255", "0.6002119", "0.59998626", "0.59759116", "0.59737414", "0.5973436", "0.5966311", "0.5966062", "0.59621716", "0.5961178", "0.595356", "0.5948168", "0.5944364", "0.5936831", "0.5936046", "0.5932855", "0.5923832", "0.59174436", "0.59164417", "0.5910133", "0.590785" ]
0.0
-1
Select objects from Object Selection
function selectObject(obj) { if (obj == 'WALL') { buttonObjectWall.classList.add('button-object-active'); } else { active_object = this.value; resetSelectObject(); this.classList.add('button-object-active'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GET_SELECTION_OBJECTS(nodesToSelect,btCanvas) {\n\t\tvar nodes = {};\n\t\tvar nodesToSelectObj;\n\t\t\n\t\tvar asyncGetObjs = new Deferred();\n\t\t\n\t\tbtCanvas.getAllNodes().then(function(canvasNodes){\n\t\t\tif(nodesToSelect instanceof String) {\n\t\t\t\tvar nodeId = nodesToSelect;\n\t\t\t\tnodesToSelect = new Array();\n\t\t\t\tnodesToSelect.push(nodeId);\n\t\t\t// Sets are lists of modules and can just be returned\n\t\t\t} else if(nodesToSelect.set && nodesToSelect.set instanceof Array) {\n\t\t\t\tasyncGetObjs.resolve(nodesToSelect.set);\n\t\t\t} else if(nodesToSelect instanceof Object && !(nodesToSelect instanceof Array)) {\n\t\t\t\tnodesToSelectObj = nodesToSelect;\n\t\t\t\tnodesToSelect = Object.keys(nodesToSelectObj);\n\t\t\t}\n\t\t\t\n\t\t\tDojoArray.forEach(nodesToSelect,function(node) {\n\t\t\t\tvar nodeObj;\n\t\t\t\tvar nodeId = node;\n\t\t\t\tif(node instanceof Object && !(node instanceof String)) {\n\t\t\t\t\tnodeId = node.id || node.itemId;\n\t\t\t\t}\n\t\t\t\tnodeObj = canvasNodes[nodeId];\n\t\t\t\tif(!nodeObj) {\n\t\t\t\t\tnodeObj = canvasNodes[btCanvas.getSharedIds(nodeId)];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(nodeObj) { // squelch not-founds for now\n\t\t\t\t\tif(nodeObj.getType() === \"linkage\" && (nodesToSelectObj || (node instanceof Object && !(node instanceof String)))) {\n\t\t\t\t\t\tvar linkages = nodesToSelectObj ? nodesToSelectObj[nodeId] : node.segments;\n\t\t\t\t\t\tif(linkages instanceof Array) {\n\t\t\t\t\t\t\tvar origNode = nodeObj;\n\t\t\t\t\t\t\tnodeObj = _.clone(origNode);\n\t\t\t\t\t\t\tvar segMap = _.object(\n\t\t\t\t\t\t\t\tnodeObj.segments.map(\n\t\t\t\t\t\t\t\t\tfunction(e) { return e.label+\":\"+e.islink+\":\"+e.isonly; }\n\t\t\t\t\t\t\t\t),nodeObj.segments\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tnodeObj.segments = new Array();\n\t\t\t\t\t\t\tDojoArray.forEach(linkages,function(seg){\n\t\t\t\t\t\t\t\tif(segMap[seg.label+\":\"+seg.islink+\":\"+seg.isonly]) {\n\t\t\t\t\t\t\t\t\tnodeObj.segments.push(segMap[seg.label+\":\"+seg.islink+\":\"+seg.isonly]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnodes[nodeObj.id] = nodeObj;\n\t\t\t\t}\n\t\t\t});\n\t\t\tasyncGetObjs.resolve(nodes);\n\t\t});\n\t\treturn asyncGetObjs.promise;\n\t}", "select () {\n let overlay = SelectionOverlay.getOverlay();\n overlay.attachToObject( this );\n }", "selectAll() {\n this.selection.selectAll();\n }", "function selectObject(idx) {\n var anid = main_canvas.GetAnnoIndex(idx);\n if(selected_poly==idx) return;\n unselectObjects();\n selected_poly = idx;\n if(view_ObjList) ChangeLinkColorFG(idx);\n main_canvas.annotations[anid].FillPolygon();\n \n // Select object parts:\n var selected_poly_parts = getPartChildrens(idx);\n for (var i=0; i<selected_poly_parts.length; i++) {\n var anid = main_canvas.GetAnnoIndex(selected_poly_parts[i]);\n if(anid >= 0 && (selected_poly_parts[i]!=selected_poly)) {\n if (main_canvas.annotations[anid].hidden) main_canvas.annotations[anid].DrawPolygon(main_media.GetImRatio(), main_canvas.annotations[anid].GetPtsX(), main_canvas.annotations[anid].GetPtsY());\n main_canvas.annotations[anid].FillPolygon();\n }\n \n }\n}", "function ObjSelector(){\n\n //Inputs\n this.addInput(\"array\",\"array\");\n this.addInput(\"index\",\"number\");\n //this.addProperty(\"index\",0)\n // Outputs\n\tthis.addOutput(\"obj\",\"*\");\n\n \n}", "function selectMatchingOptions(obj,regex) {\n selectUnselectMatchingOptions(obj,regex,\"select\",false);\n }", "function selectObject(item){\n \n //Deselecciono todo\n deselectObjects();\n \n //Selecciono el nuevo elemento\n item.classList.add(\"selected\");\n \n}", "function xcustom_makeActionOnObjectSelection() {\r\n var currentSelectedObject = xcustom_getCurrentSelectedObject();\r\n if (null === currentSelectedObject) {\r\n // console.log('Nothing Selected...');\r\n xcustom_resetAndClosePanelSelectedObjectContent();\r\n $('#xcustom-div-right-panel').hide();\r\n return;\r\n }\r\n // console.log('The Selected Object Is : ', currentSelectedObject);\r\n xcustom_showSelectedObjectDataOnViewer(currentSelectedObject);\r\n}", "function select_object(id, type){\n\tvar all = 'all_'+type;\n\tvar idstring = type+'id';\n\n\t// add object to selected-array\n\tthis[type].push(id);\n\n\t$('.multi_select').each(function() {\n\t\tif ($(this).attr(idstring) == id){\n\t\t\t$(this).prop('checked', true);\n\t\t}\n\t});\n\n\t// update the headers\n\tthis.update_header(type);\n}", "function deselectObjects(){\n \n Array.prototype.forEach.call(selectableObjects, function(item) {\n item.classList.remove(\"selected\");\n });\n\n}", "selectAll() {\n let doc = this.getDocument()\n let container = doc.get(this.getContainerId())\n if (container.nodes.length === 0) {\n return\n }\n let firstNodeId = container.nodes[0]\n let lastNodeId = last(container.nodes)\n let sel = doc.createSelection({\n type: 'container',\n containerId: container.id,\n startPath: [firstNodeId],\n startOffset: 0,\n endPath: [lastNodeId],\n endOffset: 1\n })\n this.setSelection(sel)\n }", "deleteSelectedObjects() {\n var objects = this.selection.getSelectedObjects();\n this.selection.clear();\n objects.forEach(object => {\n object.remove && object.remove();\n });\n }", "selectAll () { this.toggSelAll(true); }", "function getObjSelectedItems(){\r\n\t\tvar objItems = g_objWrapper.find(\".uc-filelist-item-selected\");\r\n\t\treturn(objItems);\r\n\t}", "function SelectionUtil() {\n}", "function select_layer(obj) {\r\n var selectedIndex = canvas.getObjects().reverse().indexOf(obj);\r\n var layers = get_layers();\r\n layers[selectedIndex].classList.add(\"selected\");\r\n}", "selectAll() {\n this.selection.clear();\n this.activeFrames.filter(frame => {\n return !frame.parentLayer.locked && !frame.parentLayer.hidden;\n }).forEach(frame => {\n frame.paths.forEach(path => {\n this.selection.select(path);\n });\n frame.clips.forEach(clip => {\n this.selection.select(clip);\n });\n });\n }", "function unselectObjects() {\n if(selected_poly == -1) return;\n var anid;\n\n var anid = main_canvas.GetAnnoIndex(selected_poly);\n if(view_ObjList) ChangeLinkColorBG(selected_poly);\n main_canvas.annotations[anid].UnfillPolygon();\n \n // Unselect object parts:\n var selected_poly_parts = getPartChildrens(selected_poly);\n for (var i=0; i<selected_poly_parts.length; i++) {\n\n var anid = main_canvas.GetAnnoIndex(selected_poly_parts[i]);\n if(anid >= 0 && (selected_poly_parts[i]!=selected_poly)) {\n main_canvas.annotations[anid].UnfillPolygon();\n if (main_canvas.annotations[anid].hidden) main_canvas.annotations[anid].DeletePolygon();\n }\n\n \n }\n \n // Reset selected_poly variable:\n selected_poly = -1;\n}", "function select_layer(obj) {\r\n var selectedIndex = canvas.getObjects().reverse().indexOf(obj);\r\n var layerElements = document.getElementById('left').childNodes;\r\n var filteredLayerElements = [];\r\n for (var i = 0 ; i < layerElements.length ; i++){\r\n if (layerElements[i].nodeType == Node.ELEMENT_NODE){\r\n filteredLayerElements.push(layerElements[i]);\r\n }\r\n }\r\n for (var i = 0 ; i < filteredLayerElements.length ; i++){\r\n filteredLayerElements[i].className = \"layer\";\r\n }\r\n filteredLayerElements[selectedIndex].classList.add(\"selected\");\r\n}", "function selectObj(element){\n \telement.material.opacity = selectOpacity;\n \tSELECTED = element;\n if (testing){\n SELECTED.listLink.style.background = '#69A0E1';\n \tSELECTED.listLink.style.color = 'white';\n \ttoggleSelected();\n }\n }", "function SelectionRegion() {}", "function SelectionRegion() {}", "function findSelectables() {\n\n var a = svg.getBoundingClientRect();\n\n for (var i = selectables.length; i--;) {\n\n var selectable = selectables[i],\n b = selectable.getBoundingClientRect();\n\n if (isColliding(a, b)) {\n selectable.classList.add(\"selected\");\n } else {\n selectable.classList.remove(\"selected\");\n }\n }\n}", "function hideSelectedObjects() {\r\n var layers = webMap._layers;\r\n var objectIds;\r\n for (var i = 0; i < layers.length; i++) {\r\n if (layers[i].active) {\r\n objectIds = Object.keys(layers[i].highlightedObjects);\r\n layers[i].hideObjects(objectIds);\r\n }\r\n }\r\n}", "function selectObj(e){\n if(time === 0) {\n let p = getEventPosition(e);\n x1 = p.x;\n y1 = p.y;\n time++;\n } else {\n let p = getEventPosition(e);\n x2 = p.x;\n y2 = p.y;\n cutObj(x1,y1,x2,y2);\n time = 0;\n }\n}", "onSelectAll (name) {\n const f = this.dimProp.find((d) => d.name === name)\n if (!f) return\n\n // if options not filtered then all select items in dimension\n // else append to current selection items from the filter\n if (f.options.length === f.enums.length) {\n f.selection = Array.from(f.options)\n } else {\n const a = f.options.filter(ov => f.selection.findIndex(sv => sv.value === ov.value) < 0)\n f.selection = f.selection.concat(a)\n f.selection.sort(\n (left, right) => (left.value === right.value) ? 0 : ((left.value < right.value) ? -1 : 1)\n )\n }\n\n f.singleSelection = f.selection.length > 0 ? f.selection[0] : {}\n f.options = f.enums\n\n this.updateSelectOrClearView(name)\n }", "function selectOnlyMatchingOptions(obj,regex) {\n selectUnselectMatchingOptions(obj,regex,\"select\",true);\n }", "_calculate_selection() {\n\n this.selection_model.geometry.vertices.forEach(v => v.z = 0);\n\n let bounding_box_height = 100; // FIXME: should be safe\n let bbox = new THREE.Box3().setFromObject(this.selection_model);\n\n // calculate all intersecting actors\n let hits = this.actors.filter(x => {\n\n let b = new THREE.Box3().setFromObject(x.mesh);\n\n // change the actors bounding boxes to go pretty high in the Z-axis\n // so the selection model will definitely intersect it\n b.expandByVector(new THREE.Vector3(0, 0, bounding_box_height));\n\n return bbox.isIntersectionBox(b);\n });\n\n this.emit(\"selection\", hits);\n\n }", "selectAll() {\n var _a;\n (_a = this._selectionService) === null || _a === void 0 ? void 0 : _a.selectAll();\n }", "breakApartSelection() {\n var leftovers = [];\n var clips = this.selection.getSelectedObjects('Clip');\n this.selection.clear();\n clips.forEach(clip => {\n leftovers = leftovers.concat(clip.breakApart());\n });\n leftovers.forEach(object => {\n this.selection.select(object);\n });\n }", "function selectAll() {\n\t\tvar newSelections = [];\n\t\tfor(var d = 0; d < 3; d++) {\n\t\t\tnewSelections.push([]);\n\t\t\tnewSelections[d].push({\"minVal\":0, \"maxVal\":dim[d] - 1});\n\t\t}\n\t\tselections = newSelections;\n\t\tdrawSelections();\n\t\tupdateLocalSelections(true);\n\t\tsaveSelectionsInSlot();\n\t}", "function selection_select(selector) {\n var depth = this._depth,\n stack = new Array(depth * 2);\n\n if (typeof selector !== \"function\") selector = selectorOf(selector);\n\n function visit(nodes, update, depth) {\n var i = -1,\n n = nodes.length,\n node,\n subnode,\n subnodes = new Array(n);\n\n if (--depth) {\n var stack0 = depth * 2,\n stack1 = stack0 + 1;\n while (++i < n) {\n if (node = nodes[i]) {\n stack[stack0] = node._parent.__data__, stack[stack1] = i;\n subnodes[i] = visit(node, update && update[i], depth);\n }\n }\n }\n\n // The leaf group may be sparse if the selector returns a falsey value;\n // this preserves the index of nodes (unlike selection.filter).\n // Propagate data to the new node only if it is defined on the old.\n // If this is an enter selection, materialized nodes are moved to update.\n else {\n while (++i < n) {\n if (node = nodes[i]) {\n stack[0] = node.__data__, stack[1] = i;\n if (subnode = selector.apply(node, stack)) {\n if (\"__data__\" in node) subnode.__data__ = node.__data__;\n if (update) update[i] = subnode, delete nodes[i];\n subnodes[i] = subnode;\n }\n }\n }\n }\n\n subnodes._parent = nodes._parent;\n return subnodes;\n }\n\n return new Selection(visit(this._root, this._update && this._update._root, depth), depth);\n }", "getSelection() {\r\n return this._selectedIds;\r\n }", "function returnObjectById(id){\n\n return selectableObjects.find(object=> object.id == id)\n}", "select(...cells) {\n let selection_changed = false;\n // The selection set is treated immutably, so we duplicate it here to\n // ensure that existing references to the selection are not modified.\n this.selection = new Set(this.selection);\n for (const cell of cells) {\n if (!this.selection.has(cell)) {\n this.selection.add(cell);\n cell.select();\n selection_changed = true;\n }\n }\n if (selection_changed) {\n this.panel.update(this);\n this.toolbar.update(this);\n }\n }", "function pick(obj, arr) {\n var res = {};\n for (var i = 0, len = arr.length; i < len; i++) {\n var parsedField = Object(__WEBPACK_IMPORTED_MODULE_2_pouchdb_selector_core__[\"g\" /* parseField */])(arr[i]);\n var value = Object(__WEBPACK_IMPORTED_MODULE_2_pouchdb_selector_core__[\"c\" /* getFieldFromDoc */])(obj, parsedField);\n if (typeof value !== 'undefined') {\n Object(__WEBPACK_IMPORTED_MODULE_2_pouchdb_selector_core__[\"h\" /* setFieldInDoc */])(res, parsedField, value);\n }\n }\n return res;\n}", "function delSelect(){\n\tvar activeObject = c.getActiveObject();\n if (activeObject['_objects']) {\n activeObject['_objects'].map(x => c.remove(x));\n } else if (activeObject) {\n c.remove(activeObject);\n }\n}", "function Main(curDoc, sel, amountofselectedobjects, clipobject){\n if (amountofselectedobjects){\n if(curDoc.activeLayer.locked || !curDoc.activeLayer.visible){\n alert(\"Please select objects on an unlocked and visible layer,\\nthen run this script again.\");\n }else{\n\n //IF Compound object, alter appearance SOURCE\n //if (clipobject.typename === \"CompoundPathItem\") {\n // clipobject = sel[amountofselectedobjects -1].pathItems[0];\n //}\n //app.executeMenuCommand('deselectall');\n //clipobject = sel[0].pathItems[0];\n //clipobject.selected = true;\n app.executeMenuCommand('ungroup');\n app.executeMenuCommand('copy');\n app.executeMenuCommand('Live Pathfinder Crop');\n app.executeMenuCommand('expandStyle');\n app.executeMenuCommand('ungroup');\n app.executeMenuCommand('pasteBack');\n app.executeMenuCommand('releaseMask');\n sel = curDoc.selection;\n amountofselectedobjects = sel.length;\n app.executeMenuCommand('deselectall');\n for (i = 1; i < amountofselectedobjects ; i++) {\n killobject = sel[i];\n killobject.remove();\n }\n }\n }\n}", "function selectall(obj) {\n\tobj = (typeof obj == \"string\") ? document.getElementById(obj) : obj;\n\tif (obj.tagName.toLowerCase() != \"select\")\n\t\treturn;\n\tfor (var i=0; i<obj.length; i++) {\n\t\tobj[i].selected = true;\n\t}\n}", "deleteSelection(sketch, selected, layer) {\n if (this.objects) {\n for (let i = 0; i < this.objects.length; i++) {\n if (this.objects[i].deleteSelection(sketch, selected, layer)) {\n break;\n }\n }\n }\n }", "function selection_selectAll(selector) {\n var depth = this._depth,\n stack = new Array(depth * 2);\n\n if (typeof selector !== \"function\") selector = selectorAllOf(selector);\n\n function visit(nodes, depth) {\n var i = -1,\n n = nodes.length,\n node,\n subnode,\n subnodes = new Array(n);\n\n if (--depth) {\n var stack0 = depth * 2,\n stack1 = stack0 + 1;\n while (++i < n) {\n if (node = nodes[i]) {\n stack[stack0] = node._parent.__data__, stack[stack1] = i;\n subnodes[i] = visit(node, depth);\n }\n }\n }\n\n // Data is not propagated since there is a one-to-many mapping.\n // The parent of the new leaf group is the old node.\n else {\n while (++i < n) {\n if (node = nodes[i]) {\n stack[0] = node.__data__, stack[1] = i;\n subnodes[i] = subnode = selector.apply(node, stack);\n subnode._parent = node;\n }\n }\n }\n\n subnodes._parent = nodes._parent;\n return subnodes;\n }\n\n return new Selection(visit(this._root, depth), depth + 1);\n }", "function select(kind, name) {\n\n var node = getNodes(kind, name).node(),\n parent = node.parentNode,\n bbox = util.transformedBoundingBox(node);\n\n d3.select(parent)\n //.insert(\"svg:rect\", function () {return node;})\n .insert(\"svg:ellipse\", function () {return node;})\n .attr(\"cx\", bbox.x + bbox.width/2)\n .attr(\"cy\", bbox.y + bbox.height/2)\n .attr(\"rx\", bbox.width * 0.75)\n .attr(\"ry\", bbox.height * 0.75)\n .classed(\"selection\", true);\n }", "function ListView_UpdateSelection(theObject)\n{\n\t//get the selection property\n\tvar strSelection = Get_String(theObject.Properties[__NEMESIS_PROPERTY_SELECTION], \"\");\n\t//valid?\n\tif (!String_IsNullOrWhiteSpace(strSelection))\n\t{\n\t\t//unselect everything\n\t\tListView_UnselectAll(theObject);\n\t\t//get the selection\n\t\tvar aSelection = strSelection.split(__LISTVIEW_SELECTION_SEPARATOR);\n\t\t//loop through items\n\t\tfor (var i = 0, c = aSelection.length; i < c; i++)\n\t\t{\n\t\t\t//get the selection\n\t\t\tvar newItemToSelect = theObject.Content.IndexToItemMap[aSelection[i]];\n\t\t\t//valid?\n\t\t\tif (newItemToSelect)\n\t\t\t{\n\t\t\t\t//select it\n\t\t\t\tnewItemToSelect.Selected = true;\n\t\t\t\t//update state\n\t\t\t\tnewItemToSelect.UpdateState();\n\t\t\t\t//first item detected?\n\t\t\t\tif (theObject.Content.Item_ScrollToView == false)\n\t\t\t\t{\n\t\t\t\t\t//and mark the object to focus\n\t\t\t\t\ttheObject.Content.Item_ScrollToView = newItemToSelect.Index;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\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 }", "function Selections (type, size, toppings) {\n this.type = type;\n this.size = size;\n this.toppings = [];\n}", "_onClickObject(objectName) {\n\n if (objectName) {\n\n this.selectObject(objectName);\n }\n\n else {\n\n this.unSelectObject();\n }\n }", "static async _RectangleSelection(event){\n\t\t\tconst tool = game.activeTool;\n\t\t\tif(tool !== \"select\") return;\n\t\t\tif($(document.getElementById(\"tokenAttacher\")).find(\".control-tool.select.active\").length <= 0 ) return;\n\t\t\t$(document.getElementById(\"tokenAttacher\")).find(\".control-tool.select\")[0].classList.toggle(\"active\");\t\n\t\t\t\n\t\t\tconst {coords, originalEvent} = event.data;\n\t\t\tconst {x, y, width, height, releaseOptions={}, controlOptions={}}=coords;\n\t\t\tlet selected = {};\t\n\t\t\tconst baseId= canvas.scene.getFlag(moduleName, \"attach_base\").element;\t\t\n\t\t\tconst token = canvas.tokens.get(baseId);\n\t\t\tfor (const type of [\"AmbientLight\", \"AmbientSound\", \"Drawing\", \"MeasuredTemplate\", \"Note\", \"Tile\", \"Token\", \"Wall\"]) {\n\t\t\t\tconst layer = canvas.getLayerByEmbeddedName(type);\n\t\t\t\t//if (layer.options.controllableObjects) {\n\t\t\t\t\t// Identify controllable objects\n\t\t\t\t\tconst controllable = layer.placeables.filter(obj => obj.visible && (obj.control instanceof Function));\n\t\t\t\t\tconst newSet = controllable.filter(obj => {\n\t\t\t\t\t\tlet c = obj.center;\n\t\t\t\t\t\t//filter base out\n\t\t\t\t\t\tif(obj.data._id === baseId) return;\n\t\t\t\t\t\t//Filter attached elements except when they are already attached to the base\n\t\t\t\t\t\tconst parent = obj.getFlag(moduleName, 'parent') || \"\";\n\t\t\t\t\t\tif(parent !== \"\" && parent !== baseId) return;\n\t\t\t\t\t\t//filter all inside selection\n\t\t\t\t\t\treturn Number.between(c.x, x, x+width) && Number.between(c.y, y, y+height);\n\t\t\t\t\t});\t\t\n\t\t\t\t\tselected[type] = newSet.map(a => a.data._id);\n\t\t\t\t\tif(selected[type].length <= 0) delete selected[type];\t\t\n\t\t\t\t//}\n\t\t\t}\n\t\t\tif(selected.length === 0) return;\n\t\t\tTokenAttacher._attachElementsToToken(selected, token, false);\n\t\t\tui.notifications.info(game.i18n.format(localizedStrings.info.ObjectsAttached));\n\t\t}", "function selectAll()\r\n\t\t{\r\n\t\t\tthis.focus();\r\n\t\t\tthis.select();\r\n\t\t}", "selectAll() {\n const me = this;\n\n if (me.store.isFiltered) {\n me.selectedRecordCollection.add(...me.store.records.filter(r => !r.meta.specialRow));\n } else {\n me.selectedRecords = me.store.records.filter(r => !r.meta.specialRow);\n }\n }", "function select (id) {\n\n console.log (\"object click\");\n setScaleFactor ();\n nowX = dot.ox; nowY = dot.oy;\n nowX = Math.round(nowX / gridSnapSize) * gridSnapSize;\n nowY = Math.round(nowY / gridSnapSize) * gridSnapSize;\n dot.attr({ cx: nowX, cy: nowY });\n console.log(\"cx = \" + nowX);\n console.log(\"cy = \" + nowY);\n SelectedObjectPointId = id;\n\n\n }", "function getSelection( attachments ) {\n\t\tvar selection = new wp.media.model.Selection( attachments.models, {\n\t\t\tprops: attachments.props.toJSON(),\n\t\t\tmultiple: true,\n\t\t} );\n\n\t\tselection.gallery = attachments.gallery;\n\n\t\t// Fetch the query's attachments, and then break ties from the\n\t\t// query to allow for sorting.\n\t\tselection.more().done( function() {\n\t\t\t// Break ties with the query.\n\t\t\tselection.props.set( { query: false } );\n\t\t\tselection.unmirror();\n\t\t\tselection.props.unset( 'orderby' );\n\t\t} );\n\n\t\treturn selection;\n\t}", "function drawHighlights() {\n for (let i = 0; i < currentScenario.sceneObjects.length; i++) {\n let object = currentScenario.sceneObjects[i];\n if (object.isSelected(mousePosX, mousePosY)) {\n context.beginPath();\n context.strokeStyle = 'red';\n context.strokeRect(object.x, object.y, object.width, object.height);\n context.closePath();\n return;\n }\n }\n}", "selectAll ({ data }) {\n this.allSelected = data\n }", "enableObjectSelection() {\n const state = this.canvasStates[this.currentStateIndex];\n const scribbles = this.getFabricObjectsFromJson(state);\n\n this.rehydrateCanvas(scribbles, (scribble) => {\n if (scribble.type === 'i-text') {\n scribble.setControlsVisibility({\n bl: false,\n br: false,\n mb: false,\n ml: false,\n mr: false,\n mt: false,\n tl: false,\n tr: false,\n });\n }\n });\n }", "function UltraGrid_UnselectAll(theObject)\n{\n\t//now we need to loop through all cells\n\tfor (var rows = theObject.Data.Cells.Rows, iRow = 0, cRow = rows.length; iRow < cRow; iRow++)\n\t{\n\t\t//unselect it (will unselect the cells too)\n\t\trows[iRow].SetSelected(false);\n\t}\n}", "static selectionFromSelector(score, selector) {\n if (typeof(selector.pitches) !== 'undefined' && selector.pitches.length) {\n return SmoSelection.pitchSelection(score,\n selector.staff, selector.measure, selector.voice, selector.tick, selector.pitch);\n }\n if (typeof(selector.tick) === 'number') {\n return SmoSelection.noteFromSelector(score, selector);\n }\n return SmoSelection.measureSelection(score, selector.staff, selector.measure);\n }", "function deselect_object_all(type){\n\tvar idstring = type+'id';\n\t// remove object from selected-array\n\tthis[type] = [];\n\n\tif (type == 'samples'){\n\t\tthis.require = [];\n\t\tthis.exclude = [];\n\t}\n\n\t$('.multi_select').each(function() {\n\t\tif ($(this).attr(idstring)){\n\t\t\t$(this).prop('checked', false);\n\t\t}\n\t});\n\t// update the headers\n\tvar header_selector = '#'+type+'_header';\n\tvar header = type.charAt(0).toUpperCase() + type.slice(1)+':';\n\t$(header_selector).html(header);\n\n}", "function cloneSelectedEntity() {\n if (AFRAME.INSPECTOR.selectedEntity) {\n cloneEntity(AFRAME.INSPECTOR.selectedEntity);\n }\n}", "function selectEles(a) {\n for (var i = 0; i < a.length; i++) {\n tds[a[i]].className = 'selected';\n }\n }", "function selectById(idSel, gList, target) {\n target[idSel.name] = gList[idSel.name];\n }", "function selectMultiple(ev, use_parent){\n var Dom = YAHOO.util.Dom,\n Event = YAHOO.util.Event;\n \n var dd = null;\n var tar = Event.getTarget(ev);\n if(use_parent){\n tar = tar.parentNode;\n } \n var kids = tar.parentNode.getElementsByTagName(tar.tagName);\n //Event.stopEvent(ev);\n //If the shift key is pressed, add it to the list\n if (ev.metaKey || ev.ctrlKey) {\n if (tar.className.search(/selected/) > -1) {\n Dom.removeClass(tar, 'selected');\n } else {\n Dom.addClass(tar, 'selected');\n }\n }else if(ev.shiftKey) {\n var sel = false;\n for (var i = 0 ; i < kids.length ; i++){\n if(!sel && kids.item(i).className.search(/selected/) > -1){\n sel = true;\n }\n if(sel){\n Dom.addClass(kids.item(i), 'selected');\n }\n if(kids.item(i) == tar){ // shift clicked elem reached\n if(!sel){ //selection either below or no other row selected\n for (var ii = i ; ii < kids.length ; ii++){\n if(!sel && kids.item(ii).className.search(/selected/) > -1){\n sel = true;\n }else if(sel && kids.item(ii).className.search(/selected/) == -1){\n break;\n }\n Dom.addClass(kids.item(ii), 'selected');\n }\n if(!sel){ //no second row selected\n for (var ii = i + 1 ; i < kids.length ; i++){\n Dom.removeClass(kids.item(ii), 'selected');\n }\n }\n }\n break; \n }\n }\n }else {\n for (var i = 0 ; i < kids.length ; i++){\n kids.item(i).className = '';\n }\n Dom.addClass(tar, 'selected');\n }\n \n //clear any highlighted text from the defualt shift-click functionality\n clearSelection();\n}", "selectItem (i) { this.toggSel(true, i); }", "function getSelection(){\n return selection;\n }", "selectPoints(points, indices) {\n return points.slice(indices[0], indices[1]);\n }", "selectAtIndex(index) {\n if (this.options.selectable) {\n // Clear selection\n this.clearSelection();\n\n if (!isNaN(index) && index >= 0 && index < this.items.length) {\n const tag = Array.from(this.container.children).filter(child => child.classList.contains('tag'))[index];\n const item = this.items[index];\n\n if (this.emit('before.select', {\n item,\n tag\n })) {\n if (tag) {\n tag.classList.add('is-selected');\n }\n\n this._selected = index;\n\n this.emit('after.select', {\n item,\n tag\n });\n }\n }\n }\n\n return this;\n }", "function displaySelections(){\r\n //defaults\r\n Session.set('breaksOption','origOption');\r\n Session.set('highlightElement','line');\r\n Session.set('boldElement','boldLine');\r\n Session.set('syllablesVisible','true');\r\n Session.set('stressVisible', 'true');\r\n \r\n var selectionsCursor = Selections.find({poem_id:Session.get('currentPoem')});\r\n selectionsCursor.observe({\r\n //when something is added to the Selections Collection\r\n added: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n var styleID = selection.style_id;\r\n var style = Styles.find({_id:styleID}).fetch();\r\n //used to catch errors\r\n if (style.length > 0){\r\n var layerNodeID = style[0].layer_id;\r\n var layerID = Layers.findOne({poem_id: Session.get('currentPoem'), id: layerNodeID})._id;\r\n //if selection is from highlighting style/layer\r\n if ((style[0].background_color !== null)&&(typeof style[0].background_color !== \"undefined\")) {\r\n var rgba = style[0].background_color;\r\n var lastIndex = rgba.lastIndexOf(\",\");\r\n var substring = rgba.substr(0, lastIndex+1);\r\n //check opacity of layer that made the selection\r\n var curRGBA = substring+' ';\r\n var op = Layers.findOne(layerID).opacity;\r\n var newRGBA = curRGBA+op+\")\";\r\n console.log(newRGBA);\r\n $(\".\"+location).css(\r\n {\r\n \"background\": newRGBA\r\n });\r\n }\r\n //if selection is from bolding style/layer\r\n if ((style[0].font_color !== null)&&(typeof style[0].font_color !== \"undefined\")) {\r\n var substring = style[0].font_color;\r\n $(\".\"+location).css(\r\n {\r\n \"color\": substring\r\n }\r\n );\r\n }\r\n //if selection is from bolding style/layer\r\n if ((style[0].bold !== null)&&(typeof style[0].bold !== \"undefined\")) {\r\n var substring = style[0].bold;\r\n if (substring){\r\n $(\".\"+location).css(\r\n {\r\n \"font-weight\": \"bold\"\r\n }\r\n );\r\n $(\".\"+location).addClass(\"bold\"+style[0].font_color);\r\n }\r\n }\r\n //if selection is from stressing style/layer\r\n if((style[0].verticalAlign !== null)&&(typeof style[0].verticalAlign !== \"undefined\")){\r\n location = location.substr(1);\r\n if (Session.get('stressVisible')==\"true\"){\r\n $('.'+location).css('vertical-align','super');\r\n }\r\n $('.'+location).addClass('stressStyle');\r\n }\r\n }\r\n },\r\n //when something is removed from the Selections Collection\r\n removed: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n var styleID = selection.style_id;\r\n var curLayerNodeID = selection.layerNode_id;\r\n var style = Styles.find({_id:styleID}).fetch();\r\n console.log(style);\r\n //used to catch errors\r\n if (style.length > 0){\r\n //if removed is highlighting\r\n if ((style[0].background_color !== undefined)) {\r\n //must go through all selections that may have colored line/word/character to check and\r\n //see if after one background-color is turned off, there is another (from another layer)\r\n //still coloring that line/word/character\r\n var curRGBA = \"transparent\";\r\n var allSelections = Selections.find({poem_id: Session.get('currentPoem'), location: location}).fetch();\r\n console.log(allSelections);\r\n _.each(allSelections, function(sel){\r\n var piece = sel.style_id; \r\n var otherStyle = Styles.findOne({_id: piece});\r\n if ((otherStyle !== undefined)){\r\n if ((otherStyle.background_color !== undefined)){\r\n op = Layers.findOne({id:otherStyle.layer_id}).opacity;\r\n var rgba = otherStyle.background_color;\r\n var lastIndex = rgba.lastIndexOf(\",\");\r\n var substring = rgba.substr(0, lastIndex+1);\r\n //check opacity of layer that made the selection\r\n curRGBA = substring;\r\n var newRGBA = curRGBA+op+\")\";\r\n if (otherStyle.layer_id != curLayerNodeID){\r\n curRGBA = newRGBA;\r\n console.log(curRGBA);\r\n }\r\n }\r\n }\r\n });\r\n $(\".\"+location).css(\r\n {\r\n \"background-color\": curRGBA\r\n }\r\n );\r\n\r\n }\r\n //if removed selection is bolding\r\n if ((style[0].font_color !== null)&&(typeof style[0].font_color !== \"undefined\")) {\r\n $(\".\"+location).css(\r\n {\r\n \"color\": \"black\"\r\n }\r\n );\r\n $(\".\"+location).removeClass(\"bold\"+style[0].font_color);\r\n }\r\n //if removed selection is bolding\r\n if ((style[0].bold !== null)&&(typeof style[0].bold !== \"undefined\")) {\r\n //so that word can be bolded if line is bolded\r\n $(\".\"+location).css(\"font-weight\",\"\");\r\n $(\".\"+location).css(\"color\",\"\");\r\n }\r\n //if removed selection is stressing\r\n if((style[0].verticalAlign !== null)&&(typeof style[0].verticalAlign !== \"undefined\")){\r\n location = location.substr(1);\r\n $('.'+location).css('vertical-align','baseline');\r\n $('.'+location).removeClass('stressStyle');\r\n }\r\n }\r\n }\r\n });\r\n //handles additions/removals from SyllableMarkers Collection\r\n var syllablesCursor = SyllableMarkers.find({poem_id:Session.get('currentPoem')});\r\n syllablesCursor.observe({\r\n added: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n if (Session.get('syllablesVisible')==\"true\"){\r\n $(\".\"+location).css(\r\n {\r\n \"border-left\": \"2px solid black\"\r\n });\r\n }\r\n $(\".\"+location).addClass('syllableStyle');\r\n //updates natural syllables\r\n var lineSpan = $('#'+location).closest('.line');\r\n var countSpan = $(lineSpan).find('.lineCount');\r\n var wordCount=$(lineSpan).find('.word').length;\r\n var sylCount=0;\r\n $(lineSpan).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount++; \r\n }\r\n })\r\n $(countSpan).text(wordCount+sylCount);\r\n //updates other versions' syllable markers \r\n var lineSpanArray = $('.'+location).closest('.unnaturalLine');\r\n var countSpan1 = $(lineSpanArray[0]).find('.lineCount');\r\n var countSpan2 = $(lineSpanArray[1]).find('.lineCount');\r\n var wordArray1=$(lineSpanArray[0]).find('.word');\r\n var wordArray2=$(lineSpanArray[1]).find('.word');\r\n var wordCount1 = 0;\r\n var wordCount2 = 0;\r\n //don't count the awkward spaces created by new lines\r\n _.each(wordArray1, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount1++;\r\n }\r\n });\r\n _.each(wordArray2, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount2++;\r\n }\r\n });\r\n var sylCount1=0;\r\n var sylCount2=0; \r\n $(lineSpanArray[0]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount1++; \r\n }\r\n });\r\n $(lineSpanArray[1]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount2++; \r\n }\r\n });\r\n $(countSpan1).text(wordCount1+sylCount1);\r\n $(countSpan2).text(wordCount2+sylCount2);\r\n if ($('.syllablesGrid').data('gridded')===true){\r\n grid();\r\n grid();\r\n }\r\n },\r\n removed: function (selection, beforeIndex) {\r\n var location = selection.location;\r\n $(\".\"+location).css(\r\n {\r\n \"border-left\": \"none\"\r\n });\r\n $(\".\"+location).removeClass('syllableStyle');\r\n var lineSpan = $('#'+location).closest('.line');\r\n var countSpan = $(lineSpan).find('.lineCount');\r\n var wordCount=$(lineSpan).find('.word').length;\r\n var sylCount=0;\r\n $(lineSpan).find('.letter').each(function(){\r\n console.log($(this).css(\"border-left\"));\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount++; \r\n }\r\n })\r\n $(countSpan).text(wordCount+sylCount);\r\n //updates other versions' syllable markers \r\n var lineSpanArray = $('.'+location).closest('.unnaturalLine');\r\n var countSpan1 = $(lineSpanArray[0]).find('.lineCount');\r\n var countSpan2 = $(lineSpanArray[1]).find('.lineCount');\r\n var wordArray1=$(lineSpanArray[0]).find('.word');\r\n var wordArray2=$(lineSpanArray[1]).find('.word');\r\n var wordCount1 = 0;\r\n var wordCount2 = 0;\r\n //don't count the awkward spaces created by new lines\r\n _.each(wordArray1, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount1++;\r\n }\r\n });\r\n _.each(wordArray2, function(elem) {\r\n if ($(elem).text().trim() == \"\"){\r\n }\r\n else{\r\n wordCount2++;\r\n }\r\n });\r\n var sylCount1=0;\r\n var sylCount2=0; \r\n $(lineSpanArray[0]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount1++; \r\n }\r\n });\r\n $(lineSpanArray[1]).find('.letter').each(function(){\r\n if ($(this).hasClass(\"syllableStyle\")){\r\n sylCount2++; \r\n }\r\n });\r\n $(countSpan1).text(wordCount1+sylCount1);\r\n $(countSpan2).text(wordCount2+sylCount2);\r\n if ($('.syllablesGrid').data('gridded')===true){\r\n grid();\r\n grid();\r\n }\r\n },\r\n });\r\n //handles changes from Layers Collection\r\n var layersCursor = Layers.find({poem_id:Session.get('currentPoem')});\r\n layersCursor.observe({ \r\n added: function (selection, beforeIndex) {\r\n var sessionObj = Session.get(\"layersArray\");\r\n //if layer just created, user probably wants to use it, so default \"visible\"\r\n sessionObj[selection._id] = \"visible\";\r\n Session.set(\"layersArray\", sessionObj);\r\n },\r\n });\r\n\r\n}", "select(selector, ...values) {\n return this._secondaryWorld.select(selector, ...values);\n }", "select(selector, ...values) {\n return this._secondaryWorld.select(selector, ...values);\n }", "function selectEntryToExamine(item) {\n\tvar selectionList = [item.user]\n\tconsole.log(\"geomap selection:\",selectionList)\n\tvar outObject = {'user':selectionList}\n\tOWF.Eventing.publish(\"entity.selection\",selectionList)\n}", "function select (idx) {\n updatedLineNumbers(idx)\n List.select(idx)\n }", "function onDocumentMouseDown( event ) { \n // event.preventDefault();\n event.stopPropagation();\n raycaster.setFromCamera( mouse, camera );\n \n // calculate objects intersecting the picking ray\n //var intersects = raycaster.intersectObjects( scene.children);\n objects = pivotPoint.children.concat([cubeMesh]);\n\n console.log(objects);\n\n var intersects = raycaster.intersectObjects( objects );\n // intersects[0].object.material.color.set( 0xff0000 );\n \n //validate if has objects intersected\n if (intersects.length>0){\n // pick first intersected object\n selected_object = intersects[0].object;\n\n // change gui color\n shape_params.color = selected_object.material.color.getHex();\n \n control.setMode(shape_params.picking);\n control.attach( selected_object ); \n }\n}", "function selectAllLayers(doc, upToLayer)\n{\n\tvar i;\n\tapp.activeDocument = doc;\n\t// Select the first layer...\n\tdoc.activeLayer = doc.layers[0];\n\t\n\tvar desc = new ActionDescriptor();\n\tvar ref = new ActionReference();\n\tif (typeof(upToLayer) == 'undefined')\n\t\tupToLayer = 1;\n\t// Note - the event indexing is the -reverse- of the JavaScript indexing,\n\t// so \"2\" refers to the next to the last.\n\tref.putIndex( classLayer, upToLayer );\n\tdesc.putReference( typeNULL, ref );\n\tdesc.putEnumerated( kselectionModifierStr, kselectionModifierTypeStr, kaddToSelectionContinuousStr );\n\tdesc.putBoolean( keyMakeVisible, false );\n\texecuteAction( eventSelect, desc, DialogModes.NO );\n}", "function selectUnselectAll(){\r\n\t\tvar objUnselectedItems = getObjUnselectedItems();\r\n\t\tif(objUnselectedItems.length != 0)\r\n\t\t\tselectAllItems();\r\n\t\telse\r\n\t\t\tunselectAllItems();\r\n\t\t\r\n\t}", "function getIt() {\n var top=y1;\n var left=x1;\n var width=x2-x1;\n var height=y2-y1;\n var newdiv1 = $( \"<div id='object1' style='border: 2px solid #564dff;width:\"+width+\"px;\" +\n \"height:\"+height+\"px;position: absolute;\" +\n \"top:\"+top+\"px; left:\"+left+\"px; '/>\" )\n $(\"#YDR-Frame\").append(newdiv1);\n // Get all elements that can be selected\n /* $(\".mytable\").each(function () {\n var p = $(this).offset();\n // Calculate the center of every element, to save performance while calculating if the element is inside the selection rectangle\n var xmiddle = p.left + $(this).width() / 2;\n var ymiddle = p.top + $(this).height() / 2;\n if (matchPos(xmiddle, ymiddle)) {\n // Colorize border, if element is inside the selection\n $(this).css({\n border: \"1px solid red\"\n });\n }\n\n });*/\n }", "function select() {\n getElements()[selection].getElementsByTagName('a')[0].click();\n\n}", "function proofCopy( )\n{\n\tdoc.selection.selectAll( );\n\tdoc.selection.copy( true );\n}", "function bringdnObj() {\n\t\t\tvar selectOb = canvas.getActiveObject();\n\t\t\tcanvas.sendToBack(selectOb).renderAll();\n\n\t\t}", "function ListView_UnselectAll(theObject)\n{\n\t//valid?\n\tif (theObject && theObject.Content && theObject.Content.Items)\n\t{\n\t\t//loop through items\n\t\tfor (var items = theObject.Content.Items, i = 0, c = items.length; i < c; i++)\n\t\t{\n\t\t\t//selected?\n\t\t\tif (items[i].Selected)\n\t\t\t{\n\t\t\t\t//unselect it\n\t\t\t\titems[i].Selected = false;\n\t\t\t\t//update state\n\t\t\t\titems[i].UpdateState();\n\t\t\t}\n\t\t}\n\t}\n}", "function get_selection()\n {\n return selection;\n }", "function selectObjParam(options) {\t\n\t\t\tif (!canvas.getActiveObject()){\t\n\t\t\t\tif (canvas.getActiveGroup()){\n\t\t\t\t\t// ========= ???????????????\n\t\t\t\t}\n\n\t\t\t\tconsole.log('None select= ');\n\t\t\t\tconsole.log('Bground img = ' + canvas.backgroundImage);\n\t\t\t\tif (canvas.backgroundImage == null){\n\t\t\t\t\thideTools();\n\t\t\t\t\tcanvas.renderAll();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\thideTools();\n\t\t\t\t}\n\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log('Selected = ' + canvas.selection);\n\t\t\t\tvar selectObj=canvas.getActiveObject();\n\t\t\t\tvar currcol = selectObj.getFill();\n\t\t\n\t\t\t\tswitch(selectObj.type) {\n\t\t\t\tcase 'path-group' :\n\t\t\t\t\tcurrcol = selectObj.paths[0].getFill();\n\t\t\t\tbreak;\n\t\t\t\tcase 'text':\n\t\t\t\t\tcurrcol = selectObj.getFill();\n\t\t\t\tbreak;\t\n\t\t\t\tcase 'circle':\n\t\t\t\t\tcurrcol = selectObj.getFill();\n\t\t\t\tbreak;\t\n\t\t\t\tcase 'rect':\n\t\t\t\t\tcurrcol = selectObj.getFill();\n\t\t\t\tbreak;\t\t\t\t\n\t\t\t\t}\n\t\t\n\t\t\tconsole.log('color select obj = ' + currcol);\t\t\n\t\t\tshowAllBtn (selectObj.isType('text'));\t\t\n\t\t\tgetfillObj(currcol);\n\t\t\t\tif (selectObj.isType('text')) {\t\t\t\t\n\t\t\t\t\t$('#colorelement').css('display','block');\t\t\t\n\t\t\t\t\t$(\"#fontFamily > option\").removeAttr(\"selected\");\t\t\t\t\t\n\t\t\t\t\t$('#fontFamily option[value=\"'+selectObj.getFontFamily()+'\"]').attr(\"selected\", true);\n\t\t\t\t\t$('#fontFamily').val(selectObj.getFontFamily()); //// ===============!!!!!!!!!!!!!! Worked in FF IE etc. !!!!!!!!!!!!!!!!=====================//\n\t\t\t\t\tcanvas.renderAll();\t\t\t\t\t\n\t\t\t\t\tconsole.log( 'Font Family sss= '+selectObj.getFontFamily());\n\t\t\t\t\t// =========== switch button \"bold\" & \"italic\" =============== //\n\t\t\t\t\tswitch(selectObj.getFontStyle()) {\n\t\t\t\t\t\tcase 'normal' :\n\t\t\t\t\t\t\t$(\".btnFntI\").css(\"background-image\", \"url(../img/buttons/btn-italic.png)\");\n\t\t\t\t\t\t\tfntI = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'italic' :\n\t\t\t\t\t\t\t$(\".btnFntI\").css(\"background-image\", \"url(../img/buttons/btn-italic-on.png)\");\t\n\t\t\t\t\t\t\tfntI = true;\t\t\t\n\t\t\t\t\t\tbreak;\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tswitch(selectObj.getFontWeight()) {\n\t\t\t\t\t\tcase 'normal' :\n\t\t\t\t\t\t\t$(\".btnFntB\").css(\"background-image\", \"url(../img/buttons/btn-bold.png)\");\n\t\t\t\t\t\t\tfntB = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bold' :\n\t\t\t\t\t\t\t$(\".btnFntB\").css(\"background-image\", \"url(../img/buttons/btn-bold-on.png)\");\t\n\t\t\t\t\t\t\tfntB = true;\n\t\t\t\t\t\tbreak;\t\t\t\n\t\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t\t\tcanvas.renderAll();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t/*==========*/\t\t\n\t\t\t\t}\n\t\t\t}\t\n\t\n\t\t}", "function bringupObj() {\n\t\t\tvar selectOb = canvas.getActiveObject();\n\t\t\tcanvas.bringToFront(selectOb).renderAll();\t\n\t\t}", "unSelectAll() {\n\n }", "function UISelection(){\n\n }", "if (!this.ast.selectionSet) {\n return [];\n }", "function setSelection(){\r\n\t\t\tif (opts.idField){\r\n\t\t\t\tfor(var i=0; i<data.rows.length; i++){\r\n\t\t\t\t\tvar row = data.rows[i];\r\n\t\t\t\t\tif (contains(state.selectedRows, row)){\r\n\t\t\t\t\t\topts.finder.getTr(target, i).addClass('datagrid-row-selected');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (contains(state.checkedRows, row)){\r\n\t\t\t\t\t\topts.finder.getTr(target, i).find('div.datagrid-cell-check input[type=checkbox]')._propAttr('checked', true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfunction contains(a,r){\r\n\t\t\t\tfor(var i=0; i<a.length; i++){\r\n\t\t\t\t\tif (a[i][opts.idField] == r[opts.idField]){\r\n\t\t\t\t\t\ta[i] = r;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}", "function selectifyObject ( o ) {\n\tvar newArr = [],\n\t\tcounter = 0;\n\n\t\tfor(var key in o ) {\n\t\t\tif(o.hasOwnProperty(key)) {\n\t\t\t\tnewArr[counter++] = { \"label\": key, \"value\": o[key] };\n\t\t\t\tconsole.log(newArr[counter].label + \" - \" + newArr[counter].value );\n\t\t\t}\n\t\t}\n\t\treturn newArr;\n\t}", "async select() {\n const options = this.ctx.request.body.options;\n options.page = this.ctx.bean.util.page(options.page);\n const items = await this.ctx.service.atom.select({\n atomClass: this.ctx.request.body.atomClass,\n options,\n user: this.ctx.state.user.op,\n });\n this.ctx.successMore(items, options.page.index, options.page.size);\n }", "function _Select(obj, param) {\n let t = param ? obj[param] : obj;\n return t[Math.floor(Math.random() * t.length)];\n }", "function selectAll(id){\n let sel, range;\n let el = document.getElementById(id); //get element id\n if (window.getSelection && document.createRange) { //Browser compatibility\n sel = window.getSelection();\n if(sel.toString() == ''){ //no text selection\n window.setTimeout(function(){\n range = document.createRange(); //range object\n range.selectNodeContents(el); //sets Range\n sel.removeAllRanges(); //remove all ranges from selection\n sel.addRange(range);//add Range to a Selection.\n },1);\n }\n }else if (document.selection) { //older ie\n sel = document.selection.createRange();\n if(sel.text == ''){ //no text selection\n range = document.body.createTextRange();//Creates TextRange object\n range.moveToElementText(el);//sets Range\n range.select(); //make selection.\n }\n }\n }", "function setMapSelection() {\n\t\tthis.selectedNetworkElements = new List();\n\t\tvar oX = this.selection.getOriginX();\n\t\tvar oY = this.selection.getOriginY();\n\t\tvar fX = oX + this.selection.getFinalX();\n\t\tvar fY = oY + this.selection.getFinalY();\n\t\tfor (var i = 0; i < this.networkElements.getLength(); i++) {\n\t\t\tvar ne = this.networkElements.get(i);\n\t\t\tif (ne.x >= oX && ne.y >= oY && ne.x + ne.width <= fX && ne.y + ne.height <= fY) {\n\t\t\t\tthis.selectedNetworkElements.add(ne);\n\t\t\t\tne.select();\n\t\t\t}\n\t\t}\n\t}", "function setSelection(context, layers) {\n context.document.currentPage().changeSelectionBySelectingLayers(null);\n layers.forEach(function (l) {\n return l.select_byExpandingSelection_(true, true);\n });\n}", "updateSelected(ids){\r\n d3.select(\"#breweryLayer\") // de-select everything, ignore filters\r\n .selectAll(\"circle\")\r\n .classed(\"selected\", false);\r\n\r\n if(ids == null){return; } // don't select anything new, on clear\r\n\r\n for(let i = 0; i < ids.length; i++){\r\n d3.select(`#br_${ids[i]}`)\r\n .classed(\"selected\", true);\r\n }\r\n }", "function SceneSelect (gameEngine) {\n this.ctx = gameEngine.ctx;\n this.gameEngine = gameEngine;\n var portrait0 = AM.getAsset(\"./sprites/background0/tmp-0.gif\");\n var portrait1 = AM.getAsset(\"./sprites/background1/tmp-0.gif\");\n var portrait2 = AM.getAsset(\"./sprites/background2/tmp-0.gif\");\n var portrait3 = AM.getAsset(\"./sprites/background3/tmp-0.gif\");\n this.player1Ready = false;\n this.portraitWidth = 90;\n this.titleHeight = 100;\n this.padding = 10;\n this.shadowBlur = 2;\n this.shadowUp = false;\n this.entities = [this];\n this.selections = [];\n this.selections.push({name: \"Sunset\", portrait: portrait0, x: 0, y:0});\n this.selections.push({name: \"Ruins\", portrait: portrait1, x: 0, y: 0});\n this.selections.push({name: \"Under the Sea\", portrait: portrait2, x: 0, y:0});\n this.selections.push({name: \"Dark Fortress\", portrait: portrait3, x: 0, y: 0});\n\n this.selector1 = {x: 0, y: 0, color: \"blue\", index: 0};\n\n for (var i = 0; i < this.selections.length; i++) {\n this.selections[i].x = 200 + (this.portraitWidth + this.padding)* i;\n this.selections[i].y = this.titleHeight + 200;\n }\n}", "getSelectedIds() {\n return Object.keys(this._features).filter(id => this._features[id].selected === true);\n }", "function update_selection(cellView,paper,graph) {\n deselect_all_elements(paper,graph);\n select_element(cellView,graph);\n}", "function Selection(parentSelectable) {\n // _aoData contains row data objects when sIdColumnName is not set and \n // contains values of sIdColumnName when it's set.\n this._aoData = [];\n this._oSelectable = parentSelectable;\n this._sIdColumnName = null;\n }", "function getSelection(store) {\n return store.getState().selectables.filter(selectable => selectable.selected);\n }", "function highlightSelected()\n\t{\n\t\t// selected pileups (mutations) on the diagram\n\t\tvar selected = getSelectedPileups();\n\n\t\t// highlight residues\n\t\thighlight3dResidues(selected);\n\t}", "function highlight_rects() {\n var all = qt.query(null, null);\n var mouse = stage.getMousePosition();\n // specifically ask for no filtering\n var ids = qt.query({x:mouse.x, y:mouse.y, w:1, h:1}, null, true);\n\n // recolor everything\n for (var i = 0; i < all.length; i++) {\n var obj = qt.obj_ids[all[i]];\n obj.rect.clear();\n obj.rect.beginFill(0x0077AA);\n obj.rect.drawRect(obj.x, obj.y, obj.w, obj.h);\n }\n // 'highlight' moused-over nodes\n for (var i = 0; i < ids.length; i++) {\n var obj = qt.obj_ids[ids[i]];\n obj.rect.clear();\n obj.rect.beginFill(0xFF0000);\n obj.rect.drawRect(obj.x, obj.y, obj.w, obj.h);\n }\n}", "selectObject(objectName) {\n\n this.unSelectObject();\n\n this.setState({\n selectedObjectName: objectName,\n selectedAnnotatedObject: null\n }, () => {\n this._updateObjectAppearance(objectName);\n });\n\n // fetch and display annotations\n this._getAnnotatedObjects().then(objects => {\n\n const annotatedObject = objects.find(obj => obj.ID === objectName);\n\n // object does not have annotations to show\n if (!annotatedObject) {\n\n return;\n }\n\n // move camera to object\n const position = annotatedObject.Status.CameraPosition;\n const rotation = annotatedObject.Status.CameraRotation;\n const direction = {\n x: rotation.x - position.x,\n y: rotation.y - position.y,\n z: rotation.z - position.z\n };\n this._scene.navigateCameraTo(position, direction, true);\n\n // show details\n this.setState({\n showWindow: true,\n selectedAnnotatedObject: annotatedObject\n });\n });\n }", "function pickObject(ev, gl, canvas){\r\n if(buttonE && ev.button===0){\r\n var x = ev.clientX; //x coord of click\r\n var y = ev.clientY; //y coord of click\r\n var z = 0; //z coord of click\r\n var rect = ev.target.getBoundingClientRect();\r\n\r\n //translates cooridinates based on canvas size\r\n x = 500*((x - rect.left) - canvas.width/2) / (canvas.width/2);\r\n y = 500*(canvas.height/2 - (y - rect.top)) / (canvas.height/2);\r\n \r\n var i = 0;\r\n var p =false;\r\n var tempPick = currPick;\r\n while(i<objects.length && !p){\r\n var ob = objects[i];\r\n var ver = ob.vert;\r\n for (var j=0; j<ver.length; j+=12){\r\n if(x<=ver[j] && x>ver[j+6] || x<=ver[j+3] && x>=ver[j+9]){\r\n if(y<=ver[j+1] && y>=ver[j+7] || y<=ver[j+4] && y>=ver[j+10]){\r\n currPick = ob;\r\n p = true;\r\n scale = 1;\r\n console.log(\"picked object:\", currPick);\r\n break;\r\n }\r\n }\r\n }\r\n i++;\r\n }\r\n \r\n if (!p){\r\n currPick = null;\r\n console.log(\"no object picked\");\r\n }\r\n \r\n drawObjects();\r\n } \r\n}" ]
[ "0.63035685", "0.60754573", "0.605465", "0.5982493", "0.5980544", "0.5978813", "0.59754485", "0.59696496", "0.59694123", "0.59479326", "0.5923019", "0.59040385", "0.5875845", "0.5863877", "0.5838378", "0.5810194", "0.57753915", "0.5772462", "0.57420677", "0.5731014", "0.572881", "0.572881", "0.5717857", "0.5697687", "0.56965286", "0.5692538", "0.56799936", "0.5666596", "0.5659395", "0.5642524", "0.56203914", "0.5603255", "0.55668783", "0.5561234", "0.5557623", "0.5545925", "0.5537646", "0.5531251", "0.55301887", "0.5529249", "0.552099", "0.55165803", "0.5515275", "0.5513014", "0.5502935", "0.5497084", "0.54891616", "0.5484738", "0.54817635", "0.5477207", "0.5474025", "0.54628885", "0.54598796", "0.54587513", "0.5449332", "0.54413646", "0.54283416", "0.54244524", "0.54194194", "0.5414092", "0.5407841", "0.5406892", "0.5405475", "0.5405361", "0.5392244", "0.53870857", "0.53846395", "0.53846395", "0.5382051", "0.53798175", "0.53584236", "0.5335458", "0.5335427", "0.5330729", "0.5330401", "0.531933", "0.53141814", "0.53066146", "0.5296647", "0.52942955", "0.52884495", "0.5280745", "0.52797836", "0.52774096", "0.52737004", "0.5273561", "0.52729744", "0.5264911", "0.52605003", "0.52598965", "0.52596265", "0.5259174", "0.5258144", "0.52558196", "0.52493024", "0.5248456", "0.5247497", "0.52466136", "0.5245631", "0.52431303", "0.5240706" ]
0.0
-1
Reset object selectors, default: WALL
function resetSelectObject() { let e = document.getElementsByClassName('button-object'); for (let i = 0; i < e.length; i++) { e[i].classList.remove('button-object-active'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetObjects()\n {\n //remove rectangles for collidable bodies\n this.buttons.forEach(this.deleteBody, this, true);\n this.spikes.forEach(this.deleteBody, this, true);\n\n this.startdoors.destroy();\n this.enddoors.destroy();\n this.buttons.destroy();\n this.spikes.destroy();\n this.checkpoints.destroy();\n this.doors.destroy();\n }", "function unselectAll() {\n resetAllStrokes();\n resetAllBackgrounds();\n selected_robots = [];\n}", "function resetSelector(){\n\t//alert(\"Resetting selector...\");\n\tapplyChosenDropboxes();\n\t\n\tresetValue();\n\tsizeScrollbar();\n\treflowContent();\n\t\n}", "function resetAllToolselectionClasses(){\n document.getElementById(\"tool-toolSelector-paint\").className = \"\";\n document.getElementById(\"tool-toolSelector-erase\").className = \"\";\n document.getElementById(\"tool-toolSelector-select\").className = \"\";\n document.getElementById(\"tool-toolSelector-move\").className = \"\";\n document.getElementById(\"tool-toolSelector-fill\").className = \"\";\n document.getElementById(\"tool-toolSelector-line\").className = \"\";\n document.getElementById(\"tool-toolSelector-shape\").className = \"\";\n document.getElementById(\"tool-toolSelector-picker\").className = \"\";\n}", "function reset() {\n // Clear all the GameObjects\n Object.keys(_this.gameObjects).forEach(function (type) {\n _this.gameObjects[type] = [];\n });\n // Call the custom reset function if it is defined\n if (_this.customReset) {\n _this.customReset();\n }\n }", "function reset_all() {\n\t// Global variables\n\tactive_atom = null;\n\tatoms = [];\n\tbonds = [];\n\tformula_dict = {};\n\tformula = \"\";\n\n\t// Canvas stuff\n\tclear_canvas();\n\n\t// Right sidebar properties\n\t$(\"#prop\").find(\"section\").empty();\n\t// $(\"#neighbors\").empty();\n\t// $(\"#factor\").empty();\n\t// $(\"#formula\").empty();\n\n\t// Left selection sidebar\n\t$(\"input\").val(\"\");\n\t$(\"select\").val(\"default\");\n\t$(\"#bondBtn\").html(\"Add to canvas!\");\n\t$(\"#newAtom\").addClass(\"hidden\");\n\t$(\"#newGroup\").addClass(\"hidden\");\n\t$(\"#newRing\").addClass(\"hidden\");\n\t// Because the first atom doesn't need a bond\n\t$(\"#boSelect\").addClass(\"hidden\");\n\t$(\"#boSelectLabel\").addClass(\"hidden\");\n\n\t// Top toolbar\n\tdisable_pick_atom_to_erase();\n\tdisable_pick_bond();\n\tdisable_pick_ring_base();\n\tdisable_pick_atom_to_change();\n\tdisable_pick_atom_to_move();\n\n}", "function reset() {\n\t\tself.media.hide().empty();\n\t\tself.win.attr('class', 'el-finder-ql').css('z-index', self.fm.zIndex);\n\t\tself.title.empty();\n\t\tself.ico.attr('style', '').show();\n\t\tself.add.hide().empty();\n\t\tself._hash = '';\n\t}", "function resetState(){\n Oclasses = {}; // known classes\n arrayOfClassVals = null; // cached array of class values\n arrayOfClassKeys = null; // cached array of class keys\n objectProperties = {}; // known object properties\n arrayOfObjectPropVals = null; // array of object property values\n arrayOfObjectPropKeys = null; // array of object property keys\n dataTypeProperties = {}; // known data properties\n arrayOfDataPropsVals = null; // array of data properties values\n\n classColorGetter = kiv.colorHelper();\n svg = null;\n zoomer = null;\n renderParams = null;\n mainRoot = null;\n panel = null;\n }", "clearPossible() {\n this._selectedFarmer = null;\n this._selectableCrops = [];\n this._selectableFarmers = [];\n\n dojo.query(\".meeple\").removeClass(\"selectable selected\");\n dojo.query(\".field > div\").removeClass(\"selectable\");\n dojo.query(\".crop\").removeClass(\"selectable\");\n dojo.query(\".crop .crop-power-box\").removeClass(\"selectable\");\n\n this.inherited(arguments);\n }", "function reset(){\n $('#selection-area').empty();\n $('#species-info').empty().css('background-color', panelColor);\n $('#last-dropdown-area').empty();\n $('.counties').css('fill', mapColor);\n $('.labels').css('fill', panelColor);\n }", "reset(){\n this.enable();\n this.init();\n this.buildAll();\n }", "function resetDefaults(){\n\tcpuPaperObject.setAttribute('id', 'cpuPaper');\n\tcpuRockObject.setAttribute('id', 'cpuRock');\n\tcpuScissorObject.setAttribute('id', 'cpuScissors');\n}", "function resetCanvasForUnseenShapes() {\n purgeCanvasMouseEvents(canvas);\n setDefaultCursorMode(canvas);\n assignDefaultEvents(canvas, null, false);\n}", "function resetAll() {\n\t\ttimers.forEach(function(timer){\n\t\t\ttimer.reset();\n\t\t});\n\t\tcrewSet();\n\t\tloadCrews();\t\t\n\t\tstation2.noCrew();\n\t\tstation3.noCrew();\t\t\n\t\t$(\"#next\").prop(\"disabled\", false);\n\t\t$(\"#go\").prop(\"disabled\", false);\n\t\t$(\".play\").prop(\"disabled\", false);\n\t\t$(\"#pauseAll\").prop(\"disabled\", true);\t\n\t\t$(\"#add-min-button\").prop(\"disabled\", false);\t\n\t}", "reset() {\r\n this.active = 'normal';\r\n }", "function resetEverything(){\n resetImages();\n resetPlay();\n resetPause();\n }", "reset () {\n this._ports = [];\n this._motors = [];\n this._sensors = {\n tiltX: 0,\n tiltY: 0,\n color: BoostColor.NONE,\n previousColor: BoostColor.NONE\n };\n\n if (this._pingDeviceId) {\n window.clearInterval(this._pingDeviceId);\n this._pingDeviceId = null;\n }\n }", "function reset()\n\t\t{\n\t\t\tif(sw != 0)\n\t\t\t{\n\t\t\t\tsw = 0;\n\t\t\t\tmouse = 0;\n\t\t\t\tmotionDialog('total', sw);\n\t\t\t}\n\n\t\t\ti = 0;\n\t\t\tclearInterval(timer);\n\t\t\t$(\"#dadmin\").animate({\"left\":\"48px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dprogram\").animate({\"left\":\"161px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#ddesign\").animate({\"left\":\"286px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dmedia\").animate({\"left\":\"406px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dproject\").animate({\"left\":\"513px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#dphoto\").animate({\"left\":\"633px\", \"top\":\"508px\"}, \"slow\");\n\t\t\t$(\"#ddeload\").animate({\"left\":\"766px\", \"top\":\"530px\"}, \"slow\");\n\t\t\t$(\".match\").css(\"z-index\", \"2\");\n\t\t}", "Reset() {\n ui.Reset();\n\n pipeMan.Reset();\n state.Reset();\n scoreText.SetScore(0);\n\n player.Reset();\n player.StartScreenBob();\n\n //reset tiled bg\n bg.tilePositionX = 0;\n ground.tilePositionX = 0;\n }", "function resetObject()\n{\n if (script.api.tweenObjects == null) {\n return;\n }\n\n for ( var i = 0; i < script.api.tweenObjects.length; i++)\n {\n var tweenObject = script.api.tweenObjects[i];\n\n updateColorComponent( tweenObject.component, tweenObject.startValue );\n }\n}", "reset() {\n\t\tfor (let i = 0; i < this.tiles.length; i++) {\n\t\t\tthis.tiles[i].unsetPiece();\n\t\t}\n\t\tfor (let i = 0; i < this.whitePieces.length; i++) {\n\t\t\tthis.whitePieces[i].unsetTile();\n\t\t\tthis.whitePieces[i].animation = null;\n\t\t\tthis.blackPieces[i].unsetTile();\n\t\t\tthis.blackPieces[i].animation = null;\n\t\t}\n\t}", "function resetWalls() {\n\n wallSet.clear();\n reset();\n}", "function clearUIObjects() {\n\tfor( var p in config.ids ) {\n\t\tfor( var o in config.ids[p] ) {\n\t\t\tif(G.ui[p][o]) {\n\t\t\t\tG.ui[p][o].onclick = null;\n\t\t\t\tG.ui[p][o].onkeydown = null;\n\t\t\t\tG.ui[p][o] = null;\n\t\t\t}\n\t\t}\n\t\tG.ui[p] = null;\n\t}\n}", "function reset(){\n\t\tsetSorting(false);\n\t\t// setDataBottom(new Array(rectNum).fill(new Rect(0,Math.round(maxWidth/rectNum),0)));\n\t\tsetLightUp([]);\n\t\t// setLightUpBottom([]);\n\n\t}", "reset() {\n document\n .querySelector(\".sprite-player\")\n .classList.remove(\"sprite-player__die\");\n document\n .querySelector(\".sprite-player\")\n .classList.add(\"sprite-player__idle\");\n const spriteMonster = document.querySelector(\".sprite-monster\");\n spriteMonster.children[0].classList.remove(\n dictMonster.headsIdle[this.monster.head]\n );\n spriteMonster.children[1].classList.remove(\n dictMonster.bodiesIdle[this.monster.body]\n );\n spriteMonster.children[2].classList.remove(\n dictMonster.legsIdle[this.monster.legs]\n );\n document\n .getElementById(\"btn-choose-spell\")\n .removeEventListener(\"click\", this.btnChooseSpell);\n document\n .querySelector(\".game-page\")\n .classList.remove(\n dictMonster.backgroundImages[\n this.monster.score % dictMonster.backgroundImages.length\n ]\n );\n document.querySelector(\"table\").innerHTML = \"\";\n }", "function reset(){\n\tpause();\n\tif( bodies.map(function(body){ body.revertToInitialConditions(); }) ){\n\t\t// ensures redraw doesn't start until all bodies have reset their conditions\n\t\tredrawCanvas();\n\t}\n}", "function reset()\n {\n gameInfo.playerJedi = null;\n init();\n //reinitialize all the jedis to their initial state\n for(let i of gameInfo.jediList.values())\n {\n i.reInit();\n }\n gameInfo.gameState = \"pickChar\";\n }", "reset() {\n this.setObjectRenderer(this.emptyRenderer);\n }", "function deselect_object_all(type){\n\tvar idstring = type+'id';\n\t// remove object from selected-array\n\tthis[type] = [];\n\n\tif (type == 'samples'){\n\t\tthis.require = [];\n\t\tthis.exclude = [];\n\t}\n\n\t$('.multi_select').each(function() {\n\t\tif ($(this).attr(idstring)){\n\t\t\t$(this).prop('checked', false);\n\t\t}\n\t});\n\t// update the headers\n\tvar header_selector = '#'+type+'_header';\n\tvar header = type.charAt(0).toUpperCase() + type.slice(1)+':';\n\t$(header_selector).html(header);\n\n}", "function reset() {\n\t\t\t\t\tlists.removeClass(hover);\n\t\t\t\t\tlists.find('ul ul').hide();\n\t\t\t\t\titem.find('> li').unbind('mouseenter');\n\t\t\t\t\t$(document).unbind(that.click);\n\t\t\t\t}", "function clear(){\n\tfor (var i=0; i<objects.length; i++)\n\t\tobjects[i].style.background = trans_color;\n\t//clearTimeout(time); \n\tinitialize();\n}", "function reset() {\n for(var i = 0; i<catObject.length; i++) {\n catObject[i].running = 0;\n };\n}", "function resetOthers() {\n targets = $(anchors[data.index].els);\n others = data.slides.not(targets);\n if (animation !== 'slide') resetConfig.visibility = 'hidden';\n tram(others).set(resetConfig);\n }", "function resetOthers() {\r\n\t targets = $(anchors[data.index].els);\r\n\t others = data.slides.not(targets);\r\n\t if (animation !== 'slide') resetConfig.visibility = 'hidden';\r\n\t tram(others).set(resetConfig);\r\n\t }", "function resetClicked(){\n filters.rating = undefined\n filters.genres = undefined\n filters.language = undefined\n filters.runtime = undefined\n filters.year = undefined\n\n // reset the sliders and option boxes\n const runtimeRange = getRuntimeRange()\n const yearRange = getYearRange()\n\n // move the slider back to start\n runtimeSliderPointer.set([runtimeRange.low, runtimeRange.high])\n ratingSliderPointer.set([0, 10])\n yearSliderPointer.set([yearRange.low, yearRange.high])\n\n // re-call the create functions, which will delete the old one and replace it as a new selector\n createGenreSelector()\n createLanguageSelector()\n\n applyFilters()\n\n}", "resetAll() {\n // Clear any previous worlds and renderers\n // if (World && engine)\n // World.clear();\n\n super.resetAll();\n this.engine = Matter.Engine.create();\n }", "function reset() {\n state.moves = [];\n state.turnCount = 0;\n state.playbackSpeed = 700;\n chooseMove();\n }", "function resetAll() {\n\twinner = 0;\n\tdarkVoid = false; //***reset*** all of these\n\tconfounding = -1;\n\t//\t\t\t\tp, cpu\n\tmagnet = [-1, -1];\n\tstability = false;\n\n\tcharacters = shuffle(CHARACTERS);\n\n\t//player and CPU distribute characters\n\tarrcount = 0; //***reset*** all of these thru activeChars\n\tcpuarrcount = 0;\n\tarr = characters.slice(0, TEAM_SIZE);\n\tcpuarr = characters.slice(TEAM_SIZE, TEAM_SIZE+CPU_TEAM_SIZE);\n\n\t//distribute players to each player and cpu hand\n\thand = arr.slice(0, HAND_SIZE);\n\tcpuhand = cpuarr.slice(0, HAND_SIZE);\n\tarrcount = cpuarrcount = HAND_SIZE;\n\n\tactiveChars = [];\n\tcpuActiveChars = [];\n\n\tturnCount = 1;\n\tdisableButtons = true;\n}", "function resetAll() {\n counter = 0;\n hangmanGame.resetVar();\n hangmanGame.resetObj();\n loadLetters();\n gameBackground.image.src = `./assets/images/${theme}/background.png`;\n backgroundGlow.image.src = `./assets/images/${theme}/glow.png`;\n character.image.src = `./assets/images/character/${theme}.png`;\n hangmanGame.status = \"menu\";\n}", "reset() {\n\n this._flushTime = 0;\n this._flushCounter = 0;\n this._idleDelay = 500;\n\n this._timer = null;\n this._minDelay = this.ELEMTickerInterval;\n this._flushing = false;\n this._needFlush = false;\n this._slowness = 1;\n\n this._elements = {};\n this._nextElemId = 0;\n this._freeElemIds = [];\n\n this._styleCache = {};\n this._styleTodo = {};\n this._elemTodo = [];\n this._elemTodoH = {};\n }", "reset() {\n\n this._flushTime = 0;\n this._flushCounter = 0;\n this._idleDelay = 500;\n\n this._timer = null;\n this._minDelay = this.ELEMTickerInterval;\n this._flushing = false;\n this._needFlush = false;\n this._slowness = 1;\n\n this._elements = {};\n this._nextElemId = 0;\n this._freeElemIds = [];\n\n this._styleCache = {};\n this._styleTodo = {};\n this._elemTodo = [];\n this._elemTodoH = {};\n }", "function reset() {\n // Hiding all planet info\n $('.hideInfo').hide();\n\n orbiting = false;\n sunSolo = false;\n mercurySolo = false;\n venusSolo = false;\n earthSolo = false;\n marsSolo = false;\n jupiterSolo = false;\n saturnSolo = false;\n uranusSolo = false;\n neptuneSolo = false;\n plutoSolo = false;\n}", "function reset() {\n $('#objectsFilm').html('');\n $('#objectsSerieTV').html('');\n }", "function defaultControls() {\n controls.reset();\n }", "resetStyles () {\n\t\tthis.selection\n\t\t\t.attr('data-rel', '')\n\t\t\t.attr('data-hidden', '')\n\t}", "function reset() {\n setPieces(round);\n }", "function reset() {\n compilers = u.filter(compilers, 'isDefault')\n macros = u.filter(macros, 'isDefault')\n }", "function resetButtons() {\n $(\".letter\").css({\"pointer-events\": \"auto\", \"background-color\": \"#666600\"});\n /*\n $(\".letter\").removeClass(\"used\");\n $(\".letter\").removeClass(\"success fail\", 500);\n */\n $(\"#btn1\").removeClass(\"highlight\", 500);\n }", "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 }", "removeAll() { this.general = {}; this.timers = {}; this.alarms = {}; this.helpers = {}; this.search = {}; }", "reset() {\n for (let i = 0; i < this.allNodes.length; i++) { this.allNodes[i].reset(); }\n for (let i = 0; i < this.Splitter.length; i++) {\n this.Splitter[i].reset();\n }\n for (let i = 0; i < this.SubCircuit.length; i++) {\n this.SubCircuit[i].reset();\n }\n }", "function reset() \n{\n for (var i = 0; i < $cell.length; i++) \n {\n \t$cell[i].className = 'cell';\n \t$cell[i].innerHTML = '';\n }\n bombs.posX = [];\n bombs.posY = [];\n}", "function reset() {\n humanChoices = [];\n computerChoices = [];\n level = 0;\n gameOver = false;\n}", "reset() {\n this.#container.dom = null;\n this.#prevContainerDom = null;\n this.#prevRender = null;\n this.#prevProps = null;\n this.#needUpdate = null;\n }", "resetHotspots() {\n let hotspots = this.querySelectorAll('.hotspot[role=\"button\"]');\n for (let i = 0; i < hotspots.length; i++) {\n hotspots[i].classList.remove(\"selected\");\n }\n }", "reset() {\n this.init();\n }", "reset() {\n this.setIrqMask(0);\n this.setNmiMask(0);\n this.resetCassette();\n this.keyboard.clearKeyboard();\n this.setTimerInterrupt(false);\n this.z80.reset();\n }", "_reset()\n {\n this.stopped = false;\n this.currentTarget = null;\n this.target = null;\n }", "reset() {\n\n\t\t// Reset slides\n\t\tqueryAll( this.Reveal.getRevealElement(), '[data-auto-animate]:not([data-auto-animate=\"\"])' ).forEach( element => {\n\t\t\telement.dataset.autoAnimate = '';\n\t\t} );\n\n\t\t// Reset elements\n\t\tqueryAll( this.Reveal.getRevealElement(), '[data-auto-animate-target]' ).forEach( element => {\n\t\t\tdelete element.dataset.autoAnimateTarget;\n\t\t} );\n\n\t\t// Remove the animation sheet\n\t\tif( this.autoAnimateStyleSheet && this.autoAnimateStyleSheet.parentNode ) {\n\t\t\tthis.autoAnimateStyleSheet.parentNode.removeChild( this.autoAnimateStyleSheet );\n\t\t\tthis.autoAnimateStyleSheet = null;\n\t\t}\n\n\t}", "UnSelectAllNormalizeButtons() {\n this.capitaButton.deSelect();\n this.gdpButton.deSelect();\n this.greenButton.deSelect();\n }", "function resetMouseVars() {\n mousedown_node = null;\n mouseup_node = null;\n mousedown_link = null;\n}", "function reset() {\n generateBlocks();\n active = false;\n changeSpeed(speed_modes.NORMAL);\n}", "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 0;\n winNumber = 0;\n lossNumber = 0;\n winRatio = 0;\n updateBet();\n updateCredits();\n updateJackpot();\n updatePayout();\n for (var index = 0; index < 3; index++) {\n reelContainers[index].removeAllChildren();\n }\n\n}", "clear()\n {\n this._commonStyleSheet = null;\n\n for (let collection of [this._styleSheetCache, this._filtersByDomain,\n this._filterBySelector, this._filters,\n this._exceptionDomains])\n collection.clear();\n\n this._unconditionalSelectors = null;\n this._defaultStyleSheet = null;\n }", "clear()\n {\n this._commonStyleSheet = null;\n\n for (let collection of [this._styleSheetCache, this._filtersByDomain,\n this._filterBySelector, this._filters,\n this._exceptionDomains])\n collection.clear();\n\n this._unconditionalSelectors = null;\n this._defaultStyleSheet = null;\n }", "reset() {\n this.playerContainer.players.forEach(x => x.clearHand())\n this.winner = undefined;\n this.incrementState();\n this.clearSpread();\n this.deck = new Deck();\n this.clearPot();\n this.clearFolded();\n }", "function resetAllGame() {\n /* Setting up player and all ghosts colors */\n player.spawn();\n enemies.forEach(spawnAll); \n\n /* setting up center */\n player.updateCenter(); //player center\n enemies.forEach(UpdateCAll);\n \n resetHUD();\n}", "function reset(){\n roy.health = roy.maxHealth;\n incineroar.health = incineroar.maxHealth;\n ridley.health = ridley.maxHealth;\n cloud.health = cloud.maxHealth;\n cloud.limit = 0;\n $(\"#cpu-health\").html();\n $(\"#cpu-attack\").html();\n $(\"#pc-health\").html();\n $(\"#pc-attack\").html();\n $(\".fight-cpu\").hide();\n $(\".fight-pc\").hide();\n slotOneFull = false;\n slotTwoFull = false;\n playerKOs = 0;\n playerChar = \"\";\n computerChar = \"\";\n roy.inUse = false;\n roy.fight = true;\n ridley.inUse = false;\n ridley.fight = true;\n cloud.inUse = false;\n cloud.fight = true;\n incineroar.inUse = false;\n incineroar.fight = true;\n $(\".ridley-small\").removeClass('grayScale')\n $(\".cloud-small\").removeClass('grayScale')\n $(\".roy-small\").removeClass('grayScale')\n $(\".incineroar-small\").removeClass('grayScale')\n\n}", "function reset () {\n noty.clear();\n resetTimeout();\n }", "function reset() {\n $('#check').removeAttr(\"disabled\");\n $('.blocks').html('');\n $('#color').html('').append(pickColor());\n $('#wordHint').attr(\"disabled\", \"disabled\");\n $('#genNewWord').attr(\"disabled\", \"disabled\");\n $('#checkWord').attr(\"disabled\", \"disabled\");\n $('#dragTarget ul').html('');\n $('#dragWord').find('div').each(function (index) {\n $(this).html('');\n });\n $(\"#genWord\").removeAttr(\"disabled\");\n $(\".lifes\").find(\"li\").each(function (index) {\n $(this).show();\n });\n\n count = 0;\n lifes = 4;\n}", "function resetProperties() {\n if (!isReset) {\n window.selectedNode = null;\n // Reset node color\n const modnodes = window.tracenodes.map(i => nodes.get(i));\n colorNodes(modnodes, 0);\n // Reset edge width and color\n const modedges = window.traceedges.map((i) => {\n const e = edges.get(i);\n e.color = getEdgeColor(nodes.get(e.to).level);\n return e;\n });\n edgesWidth(modedges, 1);\n window.tracenodes = [];\n window.traceedges = [];\n }\n}", "function reset() {\n gameState = PLAY\n \n bike1.addImage( bike1Img);\n\n c1G.destroyEach();\n c2G.destroyEach();\n c3G.destroyEach();\n \n distance=0\n}", "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 5;\n maxBet = 20;\n winNumber = 0;\n lossNumber = 0;\n winRatio = false;\n\n resetText();\n\n setEnableSpin();\n}", "function deselectObjects(){\n \n Array.prototype.forEach.call(selectableObjects, function(item) {\n item.classList.remove(\"selected\");\n });\n\n}", "reset(){\r\n //reset li\r\n const li = document.querySelectorAll('#phrase li');\r\n li.forEach( li => {\r\n li.remove()})\r\n //reset chosen & wrong class\r\n const keys = document.querySelectorAll('#qwerty button');\r\n keys.forEach(key => {\r\n key.removeAttribute('disabled');\r\n key.className = 'key';\r\n });\r\n //reset lives \r\n const lives = document.querySelectorAll('.tries img');\r\n lives.forEach( life => {\r\n life.setAttribute('src','images/liveHeart.png');\r\n })\r\n \r\n }", "function resetBalls() {\r\n positionArray = [];\r\n velocityArray = [];\r\n radiusArray = [];\r\n colorArray = [];\r\n}", "function resetShapes() {\n\tvar scale;\n\n\tselectedItem1 = -1;\n\tselectedItem2 = -1;\n\t\n\tshapeOrder = [];\n\t\n\tfor (var i=0; i<items.length; i++) {\n\t\titems[i].currLocID = items[i].startLocID;\n\t\titems[i].x = locations[items[i].currLocID].x;\n\t\titems[i].y = locations[items[i].currLocID].y;\n\t\titems[i].targetLocID = -1;\n\t}\n\n\t\n\tfor (i=0; i<shapes.length; i++) {\n\t\tshapeOrder[i] = i;\n\t\t\n\t\tshapes[i].active = shapes[i].defaultActive;\n\t}\n\t\n\n\tfor (i=0; i<items.length; i++) {\n\t\tif (shapes[items[i].id].active) {\n\t\t\titems[i].scale = scaleNormal;\n\t\t} else {\n\t\t\titems[i].scale = scaleDisabled;\n\t\t}\n\t}\n\t\n\tfor (i=0; i<maps.length; i++) {\n\t\tmaps[i].visible = maps[i].defaultVisible;\n\t}\n\n\tif (leyLineMode) {\n\t\tupdateLines = true;\n\t\trebuildLines();\n\t} else {\t\t\n\t\tlines = [];\n\t}\n}", "function Clear()\n{\n\tUnspawnAll();\n\tavailable.Clear();\n\tall.Clear();\n}", "function resetAll(){\r\n\tdocument.getElementById(\"one\").classList.remove(\"tan\");\r\n\tdocument.getElementById(\"two\").classList.remove(\"tan\");\r\n\tdocument.getElementById(\"three\").classList.remove(\"tan\");\r\n\tdocument.getElementById(\"four\").classList.remove(\"tan\");\r\n}", "function reset(){\n sendObj.Player = null;\n sendObj.Board = [[\"white\", \"white\",\"white\"], [\"white\", \"white\",\"white\"], [\"white\", \"white\",\"white\"]];\n sendObj.info = \"\";\n Players = [];\n turn = 0;\n sendObj.movingString.visible = false;\n sendObj.movingString.word = \"\";\n}", "reset(){\n this.live = 3;\n this.score = 0;\n this.init();\n }", "function resetOverlays(){\n\t\t$('.endGame').find('#header').empty();\n\t\t$('.end_round').find('#header').empty();\n\t\t$('.stars').hide();\n\t}", "reset() {\n this.domSquares.forEach(square => {\n this.setSquare(square, '');\n });\n }", "clear() {\n this._objects = {};\n }", "function resetAll(){\n\t\t\t\tlogger.debug(\"Resetting all variables\");\n\t\t\t\tisAudioOn = true;\n\t\t\t\tlpChatFontSize = 13;\n\t\t\t\tchatWinCloseable = true;\n\t\t\t\tlpInteractiveChat = false;\n\t\t\t\tlpVisitorTypingMsg = false;\n\t\t\t \tofflineSurveyNameOverride = \"\";\n\t\t\t\tpreChatSurveyNameOverride = \"\";\n\t\t\t\texitSurveyNameOverride = \"\";\n\t\t\t\tscreenState = '';\n\t\t\t\twindowState = windowStateType.READY;\n\t\t\t\tchatInstanceReady = false;\n\t\t\t\tcollaborationInstanceReady=false;\n\t\t\t}", "function reset() {\n clear();\n initialize(gameData);\n }", "function resetPet () {\n resetPokemon()\n resetStats()\n updateStatus('alive')\n}", "function reset()\n {\n Parameters.container = $.extend(true, {}, defaultContainer);\n Parameters.counter = 0;\n Parameters.timeId = null;\n }", "function destroy(all){\n setAutoScrolling(false, 'internal');\n setAllowScrolling(false);\n setKeyboardScrolling(false);\n container.addClass(DESTROYED);\n\n clearTimeout(afterSlideLoadsId);\n clearTimeout(afterSectionLoadsId);\n clearTimeout(resizeId);\n clearTimeout(scrollId);\n clearTimeout(scrollId2);\n\n $window\n .off('scroll', scrollHandler)\n .off('hashchange', hashChangeHandler)\n .off('resize', resizeHandler);\n\n $document\n .off('click touchstart', SECTION_NAV_SEL + ' a')\n .off('mouseenter', SECTION_NAV_SEL + ' li')\n .off('mouseleave', SECTION_NAV_SEL + ' li')\n .off('click touchstart', SLIDES_NAV_LINK_SEL)\n .off('mouseover', options.normalScrollElements)\n .off('mouseout', options.normalScrollElements);\n\n $(SECTION_SEL)\n .off('click touchstart', SLIDES_ARROW_SEL);\n\n clearTimeout(afterSlideLoadsId);\n clearTimeout(afterSectionLoadsId);\n\n //lets make a mess!\n if(all){\n destroyStructure();\n }\n }", "function destroy(all){\n setAutoScrolling(false, 'internal');\n setAllowScrolling(false);\n setKeyboardScrolling(false);\n container.addClass(DESTROYED);\n\n clearTimeout(afterSlideLoadsId);\n clearTimeout(afterSectionLoadsId);\n clearTimeout(resizeId);\n clearTimeout(scrollId);\n clearTimeout(scrollId2);\n\n $window\n .off('scroll', scrollHandler)\n .off('hashchange', hashChangeHandler)\n .off('resize', resizeHandler);\n\n $document\n .off('click touchstart', SECTION_NAV_SEL + ' a')\n .off('mouseenter', SECTION_NAV_SEL + ' li')\n .off('mouseleave', SECTION_NAV_SEL + ' li')\n .off('click touchstart', SLIDES_NAV_LINK_SEL)\n .off('mouseover', options.normalScrollElements)\n .off('mouseout', options.normalScrollElements);\n\n $(SECTION_SEL)\n .off('click touchstart', SLIDES_ARROW_SEL);\n\n clearTimeout(afterSlideLoadsId);\n clearTimeout(afterSectionLoadsId);\n\n //lets make a mess!\n if(all){\n destroyStructure();\n }\n }", "async resetRocket() {\n this.alpha = 0;\n this.tl.pause();\n this._animationIsPlaying = false;\n\n this.emit(Rocket.events.RESET);\n }", "function destroy(all){\r\n setAutoScrolling(false, 'internal');\r\n setAllowScrolling(false);\r\n setKeyboardScrolling(false);\r\n container.addClass(DESTROYED);\r\n\r\n clearTimeout(afterSlideLoadsId);\r\n clearTimeout(afterSectionLoadsId);\r\n clearTimeout(resizeId);\r\n clearTimeout(scrollId);\r\n clearTimeout(scrollId2);\r\n\r\n $window\r\n .off('scroll', scrollHandler)\r\n .off('hashchange', hashChangeHandler)\r\n .off('resize', resizeHandler);\r\n\r\n $document\r\n .off('click touchstart', SECTION_NAV_SEL + ' a')\r\n .off('mouseenter', SECTION_NAV_SEL + ' li')\r\n .off('mouseleave', SECTION_NAV_SEL + ' li')\r\n .off('click touchstart', SLIDES_NAV_LINK_SEL)\r\n .off('mouseover', options.normalScrollElements)\r\n .off('mouseout', options.normalScrollElements);\r\n\r\n $(SECTION_SEL)\r\n .off('click touchstart', SLIDES_ARROW_SEL);\r\n\r\n clearTimeout(afterSlideLoadsId);\r\n clearTimeout(afterSectionLoadsId);\r\n\r\n //lets make a mess!\r\n if(all){\r\n destroyStructure();\r\n }\r\n }", "function destroy(all){\r\n setAutoScrolling(false, 'internal');\r\n setAllowScrolling(false);\r\n setKeyboardScrolling(false);\r\n container.addClass(DESTROYED);\r\n\r\n clearTimeout(afterSlideLoadsId);\r\n clearTimeout(afterSectionLoadsId);\r\n clearTimeout(resizeId);\r\n clearTimeout(scrollId);\r\n clearTimeout(scrollId2);\r\n\r\n $window\r\n .off('scroll', scrollHandler)\r\n .off('hashchange', hashChangeHandler)\r\n .off('resize', resizeHandler);\r\n\r\n $document\r\n .off('click touchstart', SECTION_NAV_SEL + ' a')\r\n .off('mouseenter', SECTION_NAV_SEL + ' li')\r\n .off('mouseleave', SECTION_NAV_SEL + ' li')\r\n .off('click touchstart', SLIDES_NAV_LINK_SEL)\r\n .off('mouseover', options.normalScrollElements)\r\n .off('mouseout', options.normalScrollElements);\r\n\r\n $(SECTION_SEL)\r\n .off('click touchstart', SLIDES_ARROW_SEL);\r\n\r\n clearTimeout(afterSlideLoadsId);\r\n clearTimeout(afterSectionLoadsId);\r\n\r\n //lets make a mess!\r\n if(all){\r\n destroyStructure();\r\n }\r\n }", "function destroy(all){\r\n setAutoScrolling(false, 'internal');\r\n setAllowScrolling(false);\r\n setKeyboardScrolling(false);\r\n container.addClass(DESTROYED);\r\n\r\n clearTimeout(afterSlideLoadsId);\r\n clearTimeout(afterSectionLoadsId);\r\n clearTimeout(resizeId);\r\n clearTimeout(scrollId);\r\n clearTimeout(scrollId2);\r\n\r\n $window\r\n .off('scroll', scrollHandler)\r\n .off('hashchange', hashChangeHandler)\r\n .off('resize', resizeHandler);\r\n\r\n $document\r\n .off('click touchstart', SECTION_NAV_SEL + ' a')\r\n .off('mouseenter', SECTION_NAV_SEL + ' li')\r\n .off('mouseleave', SECTION_NAV_SEL + ' li')\r\n .off('click touchstart', SLIDES_NAV_LINK_SEL)\r\n .off('mouseover', options.normalScrollElements)\r\n .off('mouseout', options.normalScrollElements);\r\n\r\n $(SECTION_SEL)\r\n .off('click touchstart', SLIDES_ARROW_SEL);\r\n\r\n clearTimeout(afterSlideLoadsId);\r\n clearTimeout(afterSectionLoadsId);\r\n\r\n //lets make a mess!\r\n if(all){\r\n destroyStructure();\r\n }\r\n }", "function resetAll() {\n document.querySelectorAll(\".changeColor\").forEach(function (p) {\n p.style.color = \"rgb(0,0,0)\";\n });\n }", "resetInteracts() {\n let i;\n for (i = 0; i < this._objects.intersects.length; i++) {\n this._objects.intersects[i].material.color.setHex(this._objects.intersects[i].originalColor);\n }\n }", "function setInitialStates(){\n removeAll([\"h3\", \"h4\"]);\n}", "reset() {\n arrayEach(this.elements, ui => ui.reset());\n }", "function reset() {\n $('header, footer').addClass('active');\n card.removeClass('active');\n planets.classed('inactive', false);\n active.classed('active', false);\n active = d3.select(null);\n\n svg.transition()\n .duration(750)\n .call(zoom.transform, initialTransform);\n }", "reset() {\n this.current = this.unknownFramebuffer;\n this.viewport = new Rectangle_1.Rectangle();\n }" ]
[ "0.6695651", "0.64745295", "0.6332994", "0.6328398", "0.6297724", "0.61921024", "0.6152285", "0.61299545", "0.60786873", "0.60747224", "0.6068768", "0.60511", "0.6044823", "0.60345256", "0.5995003", "0.594371", "0.5932144", "0.5927758", "0.59202194", "0.5913779", "0.59134203", "0.591008", "0.5889764", "0.58751947", "0.5874008", "0.5855455", "0.58527696", "0.5831435", "0.5827343", "0.58232737", "0.58216745", "0.5820092", "0.5817379", "0.5815657", "0.58049333", "0.5800809", "0.57999194", "0.5796261", "0.5795966", "0.5783971", "0.5783971", "0.57771266", "0.57586384", "0.57548696", "0.5752231", "0.5749501", "0.57481325", "0.574445", "0.57234615", "0.5718414", "0.57040924", "0.5697221", "0.5692973", "0.56900334", "0.56843084", "0.5682107", "0.5679055", "0.56696075", "0.56680274", "0.5666527", "0.5665206", "0.5663771", "0.5663471", "0.5654409", "0.5654409", "0.56510115", "0.5640984", "0.5639711", "0.5639028", "0.5638973", "0.56370586", "0.5635438", "0.5632577", "0.5629801", "0.56274515", "0.56251025", "0.5621945", "0.5619631", "0.5615026", "0.561431", "0.56131595", "0.56126523", "0.56124985", "0.5608669", "0.56012815", "0.5597308", "0.55968195", "0.55948776", "0.5594858", "0.5594858", "0.55933636", "0.55875444", "0.55875444", "0.55875444", "0.55843496", "0.5577505", "0.55757135", "0.55635756", "0.55605364", "0.5560299" ]
0.6578862
1
Get information from HTML Gets grid as object
function getGrid(pos) { let childs = c.childNodes; return childs[pos]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getgridobj() {\n\n return gridobj;\n\n }", "function getTableDataFromHtml() {\n\n }", "async getBasicInfo(){\n //<== Html selectors ==>\n const fieldNameClassName = \".gsc_oci_field\";\n const valueClassName = \".gsc_oci_value\";\n\n // <== Logic ==>\n\n // get fields \n const page = this.page;\n const fieldNameLst = await page.$$eval(fieldNameClassName, (options) =>\n options.map((option) => option.textContent\n ));\n const valueLst = await page.$$eval(valueClassName, (options) =>\n options.map((option) => option.textContent\n ));\n \n\n // <== Set data to json ==>\n for (var i in fieldNameLst){\n const fieldName = fieldNameLst[i];\n if (fieldName===\"Description\"){\n continue\n }\n if (fieldName==\"Total citations\"){\n continue\n }\n const value = valueLst[i];\n this.json[fieldName] = value\n }\n \n\n }", "function getGrid() {\n\tconsole.log(\"Current rows are: \" + GRID.rows + \"\\nCurrent columns are: \" + GRID.columns);\n}", "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 getGrid () {\n\tlet grid = new Array(3);\n\tfor (var i = 0; i < 3; i++)\n\t\tgrid[i]=new Array(3);\n\n\tfor (var i = 0; i < 3; i++) {\n\t\tfor (var j = 0; j < 3; j++) {\n\t\t\tlet divSector = $(\"#grid-\" + i + j + \"-id\");\n\t\t\tgrid[i][j] = divSector.text();\n\t\t}\n\t}\n\n\treturn grid;\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}", "function UltraGrid_GetHTMLTarget(eEvent, aData)\n{\n\t//default result: null\n\tvar result = null;\n\n\t//get the target\n\tvar target = UltraGrid_GetTarget(this.InterpreterObject, aData[0]);\n\t//valid target?\n\tif (target)\n\t{\n\t\t//this a cell?\n\t\tif (target.UltraGridCell || target.UltraGridHeader)\n\t\t{\n\t\t\t//use the html\n\t\t\tresult = target.HTML;\n\t\t}\n\t\t//must be a row\n\t\telse if (target.Panels)\n\t\t{\n\t\t\t//get its first panel row\n\t\t\tresult = target.PanelRows[target.PanelIds[0]];\n\t\t}\n\t}\n\t//return the result\n\treturn result;\n}", "function TreeGrid_GetData()\n{\n\t//create an array for the result\n\tvar result = [];\n\t//have we got content? with cells?\n\tif (this.InterpreterObject.Content && this.InterpreterObject.Content.Cells)\n\t{\n\t\t//loop through the html\n\t\tfor (var rows = this.InterpreterObject.Content.Cells.Rows, i = 0, c = rows.length; i < c; i++)\n\t\t{\n\t\t\t//selected?\n\t\t\tif (rows[i].Selected)\n\t\t\t{\n\t\t\t\t//add this to the result\n\t\t\t\tresult.push(\"\" + (i + 1));\n\t\t\t}\n\t\t}\n\t}\n\t//return it\n\treturn result;\n}", "function getInfo() { return document.getElementById('info') }", "function extractFields (row) {\n // image cover (if any)\n let img = $('.img-delayed', row).attr('data-src')\n // medium (CD, Buch,...)\n let medium = $('.rList_medium > img', row).attr('title')\n // title\n let title = $('.rList_titel > a', row).text()\n // identifier, e.g. javascript:htmlOnLink('AK15216034')\n let identifier = $('.rList_titel > a', row).attr('href')\n identifier = identifier.match(/'([^']+)'/)[1]\n // name\n let name = $('.rList_name:nth-child(2)', row).text()\n // year\n let year = $('.rList_jahr', row).text()\n if (year === '' || year.length === 1) {\n year = 0\n } else {\n year = parseInt(year)\n }\n return {\n 'title': title,\n 'name': name,\n 'medium': medium,\n 'year': year,\n 'img': img,\n 'identifier': identifier\n }\n}", "function getGridItem(info) {\n\t\t\tvar thumbnailClass = (dataGridType === IS_MODAL) ? 'class=\"is-modal\"' : '',\n\t\t\t\tdata = $.extend({}, DEFAULT_GRID_ELEM, info),\n\t\t\t\tthumbnail = info ? '<td><figure><a href=\"' + data.linkURL + '\" ' + thumbnailClass + '><img src=\"' + data.imageURL + '\" alt=\"' + data.imageAlt + '\" width=\"230\" height=\"170\"></a>' + '<figcaption><h4>' + data.title + '</h4><a href=\"' + data.linkURL + '\">' + data.linkContent + '</a></figcaption></figure></td>'\n\t\t\t\t\t\t\t\t\t//if no info\n\t\t\t\t\t\t\t\t\t: '<td class=\"empty\"/>';\n\n\t\t\treturn thumbnail;\n\t\t}", "function TreeGrid_GetHTMLTarget(eEvent, aData)\n{\n\t//default result: null\n\tvar result = null;\n\t//get the position\n\tvar position = TreeGrid_GetTargetItemPosition(this, aData, __DESIGNER_CONTROLLER || __SCREENSHOTS_ON || eEvent != __NEMESIS_EVENT_CLICK && eEvent != __NEMESIS_EVENT_SELECT && eEvent != __NEMESIS_EVENT_NOTHANDLED);\n\t//header?\n\tif (position.Row == -1 && position.Column != null)\n\t{\n\t\t//get the headers\n\t\tvar headers = this.InterpreterObject.Content ? this.InterpreterObject.Content.Headers.Ordered : null;\n\t\t//get the header\n\t\tresult = headers && position.Column >= 0 && position.Column < headers.length ? headers[position.Column].HTML : null;\n\t}\n\t//is the row visible?\n\telse if (position.Row != null && position.Row >= 0 && (this.InterpreterObject.Content.TreeData == null || this.InterpreterObject.Content.TreeData.VisibleMap[position.Row]))\n\t{\n\t\t//get the tree data\n\t\tvar treeData = this.InterpreterObject.Content.TreeData;\n\t\t//get the row\n\t\tvar row = this.InterpreterObject.Content.Cells.Rows[position.Row];\n\t\t//assume we will be clicking on the scrollable part of the grid\n\t\tresult = row.HTML ? row.HTML.Fixed.firstChild ? row.HTML.Fixed : row.HTML.Scrollable : null;\n\t\t//also has a column? ie: want a cell?\n\t\tif (position.Column != null)\n\t\t{\n\t\t\t//get the row cell\n\t\t\tresult = row.Objects[position.Column].HTML;\n\t\t}\n\t\t//check the event\n\t\telse switch (eEvent)\n\t\t{\n\t\t\tcase __NEMESIS_EVENT_OPENBRANCH:\n\t\t\tcase __NEMESIS_EVENT_CLOSEBRANCH:\n\t\t\t\t//this row is a treegrid line?\n\t\t\t\tif (treeData && row)\n\t\t\t\t{\n\t\t\t\t\t//set the target\n\t\t\t\t\tresult = row.Objects[treeData.Column].HTML.BranchButton;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//cell selection only (but of course requesting a row selection, of course)\n\t\t\t\tif (Get_String(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_SELECTION_TYPE], \"\") == \"CellOnly\")\n\t\t\t\t{\n\t\t\t\t\t//loop through the cells\n\t\t\t\t\tfor (var i = 0, c = row.Objects.length; i < c; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this one has cell selects row?\n\t\t\t\t\t\tif (row.Objects[i].SelectionActionsOnly)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//use this one isntead\n\t\t\t\t\t\t\tresult = row.Objects[i].HTML;\n\t\t\t\t\t\t\t//end loop\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\tbreak;\n\t\t}\n\t}\n\telse\n\t{\n\t\t//use the entire treegrid\n\t\tresult = this;\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 }", "function parseJSONasGrid(JSON) {\n var html = \"\";\n for (var i in JSON) {\n var content = JSON[i];\n if (content.price != null) {\n html += \"<a id='gridproduct_\" + content.id + \"' href='\" + makeFullUrl(\"assortiment/product\", content.id) + \"' class='thumbnail small'>\";\n html += \"<img src='' alt=''>\";\n html += \"<h6>\" + content.name + \"</h6>\";\n html += \"</a>\";\n }\n }\n\n $(\"#productgrid\").html(html);\n}", "function getInfo(elem) {\n const result = {\n element: elem,\n cell: null,\n cellIndex: null,\n row: null,\n rowIndex: null,\n table: null,\n nextTable: null,\n prevTable: null\n }\n result.cell = result.element\n while (result.cell?.tagName?.toLowerCase() !== 'td') {\n result.cell = result.cell.parentElement\n if (result.cell === null) return null\n }\n result.cellIndex = result.cell.cellIndex\n result.row = result.cell\n while (result.row?.tagName?.toLowerCase() !== 'tr') {\n result.row = result.row.parentElement\n if (result.row === null) return null\n }\n result.rowIndex = result.row.rowIndex\n result.table = result.row\n while (result.table?.tagName?.toLowerCase() !== 'table') {\n result.table = result.table.parentElement\n if (result.table === null) return null\n }\n const tables = Array.from(\n componentRef.current.querySelectorAll('table')\n ).filter((table) => {\n const button = table.rows[0].cells[1]?.querySelector('button')\n return button && !button.disabled\n })\n const curIndex = tables.indexOf(result.table)\n // Find the next table\n if (curIndex < tables.length - 1) {\n result.nextTable = tables[curIndex + 1]\n } else {\n result.nextTable = tables[0]\n }\n // Find the previous table\n if (curIndex === 0) {\n result.prevTable = tables[tables.length - 1]\n } else {\n result.prevTable = tables[curIndex - 1]\n }\n return result\n }", "function getBasicGrid () {\n let buf = new ArrayBuffer(100 * 100 * 8 + 24) // 24 byte header\n let dv = new DataView(buf)\n dv.setInt32(0, 10, true) // zoom\n dv.setInt32(4, 0, true) // west\n dv.setInt32(8, 0, true) // north\n dv.setInt32(12, 100, true) // width\n dv.setInt32(16, 100, true) // height\n\n let arr = new Float64Array(buf, 24)\n for (let i = 0; i < 100 * 100; i++) {\n arr[i] = i\n }\n\n return {\n // parse header\n zoom: dv.getInt32(0, true),\n west: dv.getInt32(4, true),\n north: dv.getInt32(8, true),\n width: dv.getInt32(12, true),\n height: dv.getInt32(16, true),\n data: arr\n }\n}", "function prepareDataFromGrid() {\r\n var grid = ogrid;\r\n var startCol = ostartCol;\r\n var type = otype;\r\n\r\n var gridTbl = getSingleObject(grid);\r\n var gridXML = getSingleObject(grid + '1');\r\n var retVal = '';\r\n var gridRecCount = eval(gridTbl.id + '1.recordset.RecordCount');\r\n\r\n // Make the data page size the same as the record count.\r\n gridTbl.dataPageSize = gridRecCount;\r\n // Go to the first page.\r\n gridTbl.firstPage();\r\n}", "function _parseGridData(gridTable) {\r\n\t\tvar data = {\r\n\t\t\ttotal : 0,\r\n\t\t\trows : []\r\n\t\t};\r\n\t\tvar fields = getColumnFields(gridTable, true).concat(getColumnFields(gridTable, false));\r\n\t\t$f(\"tbody tr\", $(gridTable)).each(function() {\r\n\t\t\tdata.total++;\r\n\t\t\tvar row = {};\r\n\t\t\tfor ( var i = 0; i < fields.length; i++) {\r\n\t\t\t\trow[fields[i]] = $(\"td:eq(\" + i + \")\", this).html();\r\n\t\t\t}\r\n\t\t\tdata.rows.push(row);\r\n\t\t});\r\n\t\treturn data;\r\n\t}", "getGridHtml(editor) {\n const curPos = editor.getCursor();\n\n if (this.isInGridBlock(editor)) {\n const bog = this.getBog(editor);\n const eog = this.getEog(editor);\n // skip block begin sesion(\"::: editable-row\")\n bog.line++;\n // skip block end sesion(\":::\")\n eog.line--;\n eog.ch = editor.getDoc().getLine(eog.line).length;\n return editor.getDoc().getRange(bog, eog);\n }\n return editor.getDoc().getLine(curPos.line);\n }", "function getRowHtmlContent(singleNews) {\n const htmlString = '<div class=\"row justify-content-center single-news\"> <div class=\"col-sm-12 col-md-4\"> <div class=\"imgDiv mx-3\"><img src=\"' + (singleNews.urlToImage ||\n '/src/assets/images/noImage.png') + '\" alt=\"image\"/></div></div><div class=\"col-sm-12 col-md-8 info-headers\"><div class=\"container\"><div class=\"row\"><div ' +\n 'class=\"col-sm-12 col-md-4\"><strong>Source: </strong> </div><div class=\"col-sm-12 col-md-8\">' + singleNews.source.name + '</div>' +\n '<div class=\"col-sm-12 col-md-4\"> <strong>Author: </strong></div><div class=\"col-sm-12 col-md-8\">' + (singleNews.author || 'Anonymous') + '</div>' +\n '<div class=\"col-sm-12 col-md-4\"> <strong>Date Published: </strong></div><div class=\"col-sm-12 col-md-8\">' + getResolvedDate(singleNews.publishedAt) +\n '</div><div class=\"col-sm-12 col-md-4\"><strong>Title: </strong></div><div class=\"col-sm-12 col-md-8\">' + singleNews.title + '</div>' +\n '</div></div> </div> <div class=\"col-sm-12 info-desc\"> <div class=\"container\"> <div class=\"row\"><div class=\"col-sm-12 col-md-2 text-center href\">' +\n '<a href=\"' + singleNews.url + '\" target=\"_blank\">View in site</a> </div> <div class=\"col-sm-12 col-md-9 offset-md-1\"> <span>' + (singleNews.description || 'Details available in source site') +\n '</span></div></div></div></div> </div >';\n\n return htmlString;\n}", "function getHTMLGrid(gameofLife) {\n var gridHTML = document.getElementById(\"grid\");\n var array = [];\n for (var i = 0, row = void 0; row = gridHTML.rows[i]; i++) {\n array[row.rowIndex] = [];\n for (var j = 0, col = void 0; col = row.cells[j]; j++) {\n if (col.className == \"selected\")\n array[row.rowIndex][col.cellIndex] = 1;\n else\n array[row.rowIndex][col.cellIndex] = 0;\n }\n }\n return array;\n}", "_parseHTML(htmlString) {\n //current xpath is body.div[i].table.tbody.tr[j].td[1-5]\n let cleanedHtmlString = htmlString.replace(/(\\\\t|\\\\n|&nbsp;)/gi,'');\n let root = htmlParser.parse(htmlString);\n let divs = root.querySelectorAll('div');\n if (divs) {\n for (let div of divs) {\n let table = div.querySelector('table');\n if (!table) {\n continue;\n }\n\n let tbody = table.querySelector('tbody');\n if (!tbody) {\n continue;\n }\n\n let rows = tbody.querySelectorAll('tr');\n if (!rows) {\n continue;\n }\n for (let row of rows) {\n let cols = row.querySelectorAll('td');\n //take 5 cols from here\n this._data.add(cols[0].rawText, cols[1].rawText, cols[2].rawText, cols[4].rawText);\n }\n }\n }\n }", "getGrid() {\n return this.gridCells;\n }", "function parseHtml(html) {\n // To parse the incoming body above.\n console.log(\"Parsing html\");\n const $ = cheerio.load(html);\n let data = $(\"._3RA-\"); // 8 Row\n let items = data.find(\"a\");\n\n for (let r = 0; r < items.length; r++) {\n let title = $(items[r]).attr(\"title\");\n let price = $(items[r]).find(\"span\").text().split(\"-\")[0];\n let obj = { title, price };\n mobileList.push(obj);\n }\n let fileData = mobileList;\n excelWriter(file.filePath, fileData, file.fileName);\n let readedData = excelReader(\n file.filePath + \"/\" + file.fileName + \".xlsx\",\n file.fileName\n );\n console.log(readedData);\n}", "getGrid(gridNr) {\n var gridVal = this.state.gridValues[gridNr];\n if (gridVal == null) {\n gridVal = '.';\n }\n return <Grid value={gridVal} onClick={() => this.gridClick(gridNr)} />\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 getSpanGrid() {\n\tvar grid = new Array(4);\n\tgrid[0] = new Array(4);\n\tgrid[1] = new Array(4);\n\tgrid[2] = new Array(4);\n\tgrid[3] = new Array(4);\n\tvar n = 0;\n\tfor (var r = 0; r < 4 ; r++ ) {\n\t\tfor (var c = 0; c < 4 ; c++ ) {\n\t\t\tgrid[r][c] = $(\"#grid .cell\").eq(n).find(\"span\");\n\t\t\tn++;\n\t\t}\n\t}\n\treturn grid;\n}", "function generateDataFromGrid() {\r\n var grid = ogrid;\r\n var startCol = ostartCol;\r\n var type = otype;\r\n\r\n var gridTbl = getSingleObject(grid);\r\n var gridXML = getSingleObject(grid + '1');\r\n var retVal = '';\r\n var gridRecCount = eval(gridTbl.id + '1.recordset.RecordCount');\r\n\r\n // Go to the first page.\r\n gridTbl.firstPage();\r\n var origPage = 1;\r\n var numPages = 1;\r\n var lastPageWasVisited = false;\r\n var curRow = getSelectedRow(gridTbl.id);\r\n if (tblCount != 0 && tblPropArray.length >= 1) {\r\n // Loop through the table property array.\r\n for (var i = 0; i < tblCount; i++) {\r\n if (tblPropArray[i].id == gridTbl.id) {\r\n // For the table we are sending to CSV or Excel,\r\n // find out from the array what page we were on originally,\r\n // how many pages are in the table, and whether or not the\r\n // last page was visited.\r\n origPage = tblPropArray[i].pageno;\r\n numPages = tblPropArray[i].pages;\r\n lastPageWasVisited = tblPropArray[i].lastpagevisited;\r\n }\r\n }\r\n }\r\n\r\n if (type == 'CSV') {\r\n // Format the table as CSV for Excel.\r\n retVal = formatTableAsCsv(gridTbl, startCol);\r\n }\r\n else if (type == 'HTML') {\r\n // Get the table innerHTML to pass to Excel.\r\n retVal = formatTableInnerHtmlAsHtmlDoc(gridTbl);\r\n }\r\n // Set the datapagesize back to what it was.\r\n gridTbl.dataPageSize = origPageSize;\r\n if (origSelectedRow) {\r\n // Hilite the originally selected row\r\n hiliteRow(origSelectedRow);\r\n }\r\n\r\n if (lastPageWasVisited) {\r\n // The last page was visited.\r\n // Go to the last page.\r\n gotopage(gridTbl, 'L');\r\n if (origPage < numPages) {\r\n // If the page we were originally on is not the last page,\r\n // scroll backward until we get to that page.\r\n for (var j = numPages - 1; j >= origPage; j--) {\r\n gotopage(gridTbl, 'P');\r\n }\r\n }\r\n }\r\n else {\r\n // The last page has not been visited.\r\n // Go to the first page.\r\n gotopage(gridTbl, 'F');\r\n if (origPage >= 2) {\r\n // The page we were originally on is not the first page.\r\n if (origPage == numPages) {\r\n // The page we were originally on is the last page.\r\n // Go to the last page.\r\n gotopage(gridTbl, 'L');\r\n }\r\n else {\r\n // Scroll forward until we get to the original page.\r\n for (var k = 2; k <= origPage; k++) {\r\n gotopage(gridTbl, 'N');\r\n }\r\n }\r\n }\r\n }\r\n if (curRow != \"\") {\r\n // Select the current row in the grid.\r\n selectRow(gridTbl.id, curRow);\r\n }\r\n return retVal;\r\n\r\n}", "function aanmaken_grid_layout() {\n var nummer = 0;\n var kolom__struct = '';\n var grid__struct = '';\n\n for (rij = 0; rij < grid_struct__obj.aantal_rijen; rij++) {\n kolom__struct = '';\n for (kolom = 0; kolom < grid_struct__obj.aantal_kolommen; kolom++) {\n nummer = nummer + 1\n kolom__struct += `<div class=\"grid_${nummer} grid_kolom ${ kolom ? 0 : 'grid_kolom_1' }\"></div>`;\n }\n grid__struct += `<div class=\"uk-child-width-expand@m\" style=\"margin-top:5px;\" uk-grid>${kolom__struct}</div>`;\n }\n return grid__struct; // geeft de grid structuur als resultaat terug\n }", "function loadGrid() {\n \n }", "function IsDomCustomGrid(evt, element, eventOpts, objName, description, flavor, items)\r\n\t{\r\n\t\tfunction _getName(el)\r\n\t\t{\r\n\t\t\tvar name = __getAttribute(el, '<attributeName>');\r\n\t\t\tif (name)\r\n\t\t\t{\r\n\t\t\t\treturn name;\r\n\t\t\t}\r\n\t\t\treturn \"Grid\";\r\n\t\t} \r\n \r\n\t\tfunction _getCell(el)\r\n\t\t{\r\n\t\t\treturn {row: 0, col: 0};\r\n\t\t}\r\n\t\r\n\t\tvar rvalue =\r\n\t\t{\r\n\t\t\troot: null, // to define in future the most near element or smth else\r\n\t\t\tresult: null, // here will be old res placed\r\n\t\t\trcode: R_NOT_OBJECT // return code\r\n\t\t};\r\n\t \r\n\t\tvar root = false;\r\n\r\n\t\t/**\r\n\t\t * Test element or it's neighbour nodes to detect type of an object we are dealing with.\r\n\t\t * Element API is described here: https://developer.mozilla.org/en-US/docs/Web/API/Element\r\n\t\t * API to use:\r\n\t\t *\t__hasParentWithAttr(element, attributeName, regexp)\r\n\t\t * __getAttribute(element, attributeName);\r\n\t\t *\r\n\t\t */\r\n\t\tif(root=__hasParentWithAttr(element, '<attributeName>', /<attributeValue>/ig))\r\n\t\t{\r\n\t\t\t// TODO\r\n\t\r\n\t\t\tvar res = {\r\n\t\t\t\tcancel: false,\r\n\t\t\t\tobject_flavor: 'Grid',\r\n\t\t\t\tobject_name: _getName(root),\r\n\t\t\t\tobject_type: 'DomCustomGrid',\r\n\t\t\t\tdescription: 'TODO Action description',\r\n\t\t\t\tlocator_data: \r\n\t\t\t\t{\r\n\t\t\t\t\txpath: SeS_GenerateXPath(root)\r\n\t \t\t}\r\n\t\t\t};\r\n\t\r\n\t\t\t// Learn\r\n\t\t\trvalue.result = res;\r\n\t\t\trvalue.root = root;\r\n\t\t\trvalue.rcode = R_OBJECT_FOUND;\r\n\t\t\t\r\n\t\t\tif(evt == \"resolveElementDescriptor\")\r\n\t\t\t{\r\n\t\t\t\tres.rect = __getElementRect(root);\r\n\t\t\t\tres.action = undefined;\r\n\t\t\t\treturn rvalue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (evt == \"Click\")\r\n\t\t\t{\r\n\t\t\t\tvar cell = _getCell(element);\r\n\t\t\t\tif (cell)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar actionClick = {\r\n\t\t\t\t\t\t\tname: \"ClickCell\",\r\n\t\t\t\t\t\t\tdescription: \"Click cell in a grid\",\r\n\t\t\t\t\t\t\tparams: [cell.row, cell.col]\r\n\t\t\t\t\t\t};\t\r\n\t\t\t\t\tres.action = actionClick;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\t\r\n\t\t\r\n\t\t\t// Actions \r\n\t\t\trvalue.rcode = R_ACTION_FOUND;\r\n\t\t}\r\n\t\t\r\n\t\treturn rvalue;\r\n\t}", "function getInfo(element) {\n\tif (!window.Mavo) {\n\t\treturn;\n\t}\n\n\tvar node = Mavo.Node.get(element);\n\tvar closestNode = node || Mavo.Node.getClosest(element);\n\tvar ret = {};\n\n\tfunction getNodeInfo(node) {\n\t\tvar type = node instanceof Mavo.Primitive? node.datatype || \"Text\" : node.nodeType || node.constructor.name;\n\n\t\tif (type == \"boolean\") {\n\t\t\ttype = \"True/false\";\n\t\t}\n\n\t\tvar ret = {\n\t\t\t\"Property\": node.property || \"(Root)\",\n\t\t\t\"Type\": type,\n\t\t\t\"Data\": JSON.parse(Mavo.safeToJSON(node.liveData.data))\n\t\t};\n\n\t\tif (node.collection) {\n\t\t\tret.Collection = getNodeInfo(node.collection);\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tif (node) {\n\t\tret[\"Node\"] = getNodeInfo(node);\n\t}\n\telse if (closestNode) {\n\t\tret[\"Closest Node\"] = getNodeInfo(closestNode);\n\t}\n\n\tif (closestNode) {\n\t\tvar expressions = Mavo.DOMExpression.search(element);\n\n\t\tret.Expressions = {};\n\n\t\tif (expressions && expressions.length) {\n\t\t\tfor (let e of expressions) {\n\t\t\t\tvar value = e.value.length === 1? e.value[0] : e.value;\n\t\t\t\tret.Expressions[e.attribute || '<em class=\"de-emphasized\">(Text Content)</em>'] = {\n\t\t\t\t\tTemplate: e.expression,\n\t\t\t\t\t\"Current value\": JSON.parse(Mavo.safeToJSON(value))\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ret;\n}", "function getShipDetails(url) {\n getJSON(url).then(function(data) {\n var name1 = document.getElementById('name1');\n var model1 = document.getElementById('model1');\n var class1 = document.getElementById('class1');\n\n // name of ship = html for name1 id\n name1.innerHTML = \"Name: \" + data.name;\n\n model1.innerHTML = \"Model: \" + data.model;\n\n class1.innerHTML = \"Class: \" + data.starship_class;\n })\n}", "function TreeGrid_GetInterpreterTarget(theHTML, aData)\n{\n\t//default result: null\n\tvar result = null;\n\t//get the position\n\tvar position = TreeGrid_GetTargetItemPosition(theHTML, aData);\n\t//header?\n\tif (position.Row == -1 && position.Column != null)\n\t{\n\t\t//get headers\n\t\tvar headers = theHTML.InterpreterObject.Content ? theHTML.InterpreterObject.Content.Header.Cells : null;\n\t\t//get the header\n\t\tresult = headers && position.Column >= 0 && position.Column < headers.length ? headers[position.Column] : null;\n\t}\n\t//we have this row?\n\telse if (position.Row != null && position.Row >= 0 && theHTML.InterpreterObject.Content && position.Row < theHTML.InterpreterObject.Content.Cells.Rows.length)\n\t{\n\t\t//get the row\n\t\tvar row = theHTML.InterpreterObject.Content.Cells.Rows[position.Row];\n\t\t//have we got a cell?\n\t\tif (row != null && position.Column >= 0 && row.Objects && position.Column < row.Objects.length)\n\t\t{\n\t\t\t//get the cell\n\t\t\tresult = row.Objects[position.Column];\n\t\t}\n\t}\n\t//return the result\n\treturn result;\n}", "function getElementByString(html) {\n let element = document.createElement('div')\n element.classList = 'col form-group row';\n element.innerHTML = html;\n return element.firstElementChild\n\n}", "function UltraGrid_CreateHTMLObject(theObject)\n{\n\t//create the div\n\tvar theHTML = document.createElement(\"div\");\n\t//simple add\n\ttheHTML = Basic_SetParent(theHTML, theObject);\n\t//Set parent\n\ttheObject.HTMLParent = theHTML;\n\t//set its Basic Properties\n\tBasic_SetBasicProperties(theHTML, theObject);\n\t//UltraGrids always have scrollbars implemented within themselves\n\ttheHTML.style.overflow = \"hidden\";\n\ttheHTML.style.overflowX = \"hidden\";\n\ttheHTML.style.overflowY = \"hidden\";\n\t//add the UltraGrid's Interpreter functions\n\ttheHTML.GetData = UltraGrid_GetData;\n\ttheHTML.GetHTMLTarget = UltraGrid_GetHTMLTarget;\n\ttheHTML.UpdateProperties = UltraGrid_UpdateProperties;\n\ttheHTML.NotifyDestruction = UltraGrid_NotifyDestruction;\n\t//\ttheHTML.ProcessOnKeyDown = UltraGrid_ProcessOnKeyDown;\n\ttheObject.AppendChild_super = theObject.AppendChild;\n\ttheObject.AppendChild = UltraGrid_AppendChild;\n\t//Update the Entire UltraGrid\n\tUltraGrid_Update(theObject);\n\t//block all of our events (they will be handled internaly)\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSEDOWN, Browser_CancelBubbleAndMenu);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_CLICK, Browser_CancelBubbleOnly);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSERIGHT, Browser_CancelBubbleOnly);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_DOUBLECLICK, Browser_CancelBubbleOnly);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSEOVER, Browser_CancelBubbleOnly);\n\t//now update the scroll points (needs to be done AFTER paint and after we position the object into the html)\n\tUltraGrid_SetFirstScroll(theObject);\n\t//and finally display the data (after initial scroll)\n\tUltraGrid_Paint_Refresh(theObject);\n\t//return our html\n\treturn theHTML;\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}", "function load_grid(info) {\n $.get('/page_ajax/grid', function (res) {\n var title = info.param_obs.split('|')[0].split('_')[1];\n var rasgrad = gradient[info.desc.instrument.dec + '|' + info.desc.param_obs_desc];\n var list = '';\n for (var i = 0; i < rasgrad.length; i++) {\n list = list + '<div>' + rasgrad[i] + '</div>';\n }\n var html = res.replace('{title}', title).replace('{list}', list);\n $(\"#list-menu\").append(html);\n $(\"#date-grid\").datepicker({\n dateFormat: 'dd-mm-yy',\n beforeShowDay: enableAllTheseDays,\n defaultDate: grid_date[grid_date.length - 1]\n });\n loadhourgrid();\n $(\"#date-grid\").change(function () {\n loadhourgrid();\n });\n $(\"#hour-grid\").change(function () {\n loadImageObs();\n });\n loadImageObs();\n });\n}", "function LoadGrid()\n{ \n mygrid = new dhtmlXGridObject('gridbox');\n mygrid.setImagePath(\"../../../components/grid/imgs/\");\n mygrid.init();\n mygrid.setSkin(\"dhx_skyblue\");\n \n // direccion de la pagina que hace el xml de forma dinamica\n mygrid.loadXML(\"../actions/becas_grid.php?type=load\",\n function()\n { \n // Para agregar los filtros del grid.\n mygrid.attachHeader(\",#text_filter,#text_filter,,,,\");\n // finalizamos el mensaje de espere\n MsjWait.hide();\n }\n );\n}", "function getDomData(){\n let elems = document.querySelectorAll('.control input') \n\n let domData = {\n bgColor: elems[0].value,\n radius1: elems[1].value,\n radius2: elems[2].value,\n theta : elems[3].value,\n scalar : elems[4].value,\n color1 : elems[5].value,\n color2 : elems[6].value,\n color3 : elems[7].value,\n color4 : elems[8].value,\n }\n\n return domData\n}", "function getDetails(t) {\n console.log('getDetails', t)\n // title content for mouseover\n\n var _dbotype = t.dbotype || \"\";\n var _group = t.group || \"\";\n var _name = t.name || \"\";\n var _label = t.label || _name;\n var _description = t.description || \"\";\n // var _startdate = t.startdate || \"\";\n // var _status = t.status || \"\";\n //var _colour = t.colour || \"\";\n var _color = t.color || \"\";\n var _id = t.id || \"\";\n\n var _preview = \"<h3>\" + _label + \"</h3>\" + \"\\n\\n<p>\" + _description + _color + \"</p>\\n\\n\";\n //console.log('_preview', _preview)\n return _preview\n }", "function getDetails(e, $row, id, record) {\n $('#feature-title').text(record.title);\n $('#feature-priority').text(record.client_priority);\n $('#feature-target-date').text(record.target_date);\n $('#feature-client').text(record.client);\n $('#feature-product-area').text(record.product_area_name);\n\t$('#feature-description').text(record.description);\n }", "get firstWebResult() {\n var identifier = this.client.executeScript(function() {\n var doc = window.wrappedJSObject.document;\n var grid = doc.querySelector('gaia-grid');\n var items = grid.getItems();\n var theItem;\n\n for (var i = 0, iLen = items.length; i < iLen; i++) {\n if (!theItem) {\n theItem = items[i];\n }\n\n if (items[i].detail.type === 'divider') {\n theItem = null;\n }\n }\n\n return theItem.identifier;\n });\n\n return this.getIconByIdentifier(identifier);\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 }", "_parseContent(item) {\n const textFieldClass = this.getCSS(this._data.mode, \"textField\");\n return item.querySelector(`.${textFieldClass}`).innerHTML;\n }", "function getCostElemetList () {\n \t\n\tCostElemetsList=GetSettingCostElements();\n\tCostElementDetailList=getCostElementDetailList();\n \tfor(var i=0;i<CostElemetsList.length;i++)\n\t{\n\t\t//Ti.API.info('Cost Group : '+CostElemetsList[i].Name);\n\t\tvar headerRow=createHeaderRow(i);\n\t\tscrollView.add(headerRow);\n\t\tfor(var j=0;j<CostElementDetailList.length;j++)\n\t\t{\n\t\t\tif(CostElementDetailList[j].CostGroupId == CostElemetsList[i].CostGroupID)\n\t\t\t{\n\t\t\t\tTi.API.info('Cost Elements : '+CostElementDetailList[j].CostElementName);\n\t\t\t\tvar roww = createSubRow(j);\n\t\t\t\tscrollView.add(roww);\n\t\t\t}\n\t\t}\n\t}\n CostElementWin.add(scrollView);\n }", "createGD(grid, element){\n\t\tlet array = []\n\t\tfor (let i = 0 ; i < grid.length; i++) {\n\t\t\tarray.push([])\n\t\t\tfor (let j = 0 ; j < grid[i].length; j++) {\n\t\t\t\tlet domTemp = new Dom(this.ELEMENT)\n\t\t\t\tdomTemp.setId(`grid-${i}${j}`)\n\t\t\t\tdomTemp.setValue(this.GRID[i][j])\n\t\t\t\tdomTemp.setOriginalValue(this.GRID[i][j])\n\t\t\t\tdomTemp.setIndex(i,j)\n\t\t \tarray[i].push(domTemp)\n\t\t\t}\n\t\t}\n\t\treturn array\n\t}", "get grid() {\n return this._grid;\n }", "function loadInformation() {\n \n var tdText =\n '<div class=\"container\"> <a href=\"' + item.link + '\" ><img class=\"img-food\" src=\"' + item.image + '\" class=\"image\" > <div class=\"overlay\"><div class=\"text\">' + item.name + ' <br> Price: $' + item.price + ' <br> Rating: ' + item.rating + '/5 <br> Category: ' + item.category + ' </div></div></a></div>'\n cell.innerHTML = tdText;\n \n \n \n }", "function detail_result(json_parse) {\n\n document.getElementsByClassName('panel')[0].className = \"panel panel-default show\"\n document.getElementsByClassName('panel-heading')[0].innerHTML = '<strong>' + json_parse.Title + '</strong><br/>(' + json_parse.Released + ')'\n document.getElementsByClassName('panel-body')[0].innerHTML = '<div class=\"detail_holder\">' +\n '<div><strong>Genre:</strong>&nbsp;&nbsp;' + json_parse.Genre + '</div>' +\n '<div><strong>Starring:</strong>&nbsp;&nbsp;' + json_parse.Actors + '</div>' +\n '<div>' + json_parse.Plot + '</div>' +\n '</div>'\n \n \n \n}", "function initGrid() {\n // Find the grid div element in index.html\n var eGridDiv = document.querySelector('#grid');\n var tableHeader = document.querySelector('#tableHeader');\n\n // Create the grid passing in the div to use together with the columns & data we want to use\n new agGrid.Grid(eGridDiv, gridOptions);\n\n\n // Download the chosen plan's data and load into grid\n var location = window.location.href;\n loadPlan(localStorage.getItem('planToLoad'), location.endsWith(\"grid.html\"));\n localStorage.clear();\n}", "function getModelLayout(){\r\n\tvar layout = document.implementation.createDocument(null, \"FORM_LAYOUT\", null).documentElement;\r\n\r\n\t//Se recorren todos los elementos agregados al grid\r\n\tvar i=0;\r\n\twhile (i<gridSchema.length){\r\n\t\tvar cell = gridSchema[i];\r\n\t\r\n\t\tvar field = document.createElementNS(null, \"FORM_FIELD\");\r\n\t\tloadFromObjectAttributes(cell.field, field, ['fieldId','fieldType','fieldLabel','attId','attName'])\r\n\t\t\t\t\r\n\t\t//Propiedades fijas: tamaño y ubicación de celda\r\n\t\tfield.setAttribute('x', cell.x-1); \r\n\t\tfield.setAttribute('y', cell.y-1);\r\n\t\t\t\t\r\n\t\tif (cell.xSize>1) {\r\n\t\t\tvar property = document.createElementNS(null, \"PROPERTY\");\r\n\t\t\tproperty.setAttribute('type','N');\r\n\t\t\tproperty.setAttribute('prpId','8');\r\n\t\t\tproperty.setAttribute('value', cell.xSize); \r\n\t\t\tfield.appendChild(property);\r\n\t\t}\r\n\t\tif (cell.ySize>1) {\r\n\t\t\tvar property = document.createElementNS(null, \"PROPERTY\");\r\n\t\t\tproperty.setAttribute('type','N');\r\n\t\t\tproperty.setAttribute('prpId','9');\r\n\t\t\tproperty.setAttribute('value', cell.ySize); \r\n\t\t\tfield.appendChild(property); \r\n\t\t}\r\n\t\t// *********************************************\r\n\t\t\r\n\t\t//Se procesan todas las propiedades asociadas a la celda\t\t\r\n\t\tprocessProperties(cell.field.properties, field, false /*isFormProperty*/);\r\n\t\t\r\n\t\t//Caso que la celda se un elemento 'Table' se procesan celdas contenidas\r\n\t\tif (cell.isTable()){\r\n\t\t\tvar children = cell.field.tableElements;\r\n\t\t\tfor (var j=0; j<children.length; j++){\r\n\t\t\t\tvar child = document.createElementNS(null, \"FORM_FIELD_CHILD\");\r\n\t\t\t\tloadFromObjectAttributes(children[j].field, child, ['fieldId','fieldType','fieldLabel','attId','attName'])\r\n\t\t\t\tchild.setAttribute('x', children[j].x+1);\r\n\t\t\t\tchild.setAttribute('y', 0);\r\n\t\t\t\t\r\n\t\t\t\t//Se procesan todas las propiedades asociadas a la celda\t\t\r\n\t\t\t\tprocessProperties(children[j].field.properties, child, false /*isFormProperty*/);\r\n\t\t\t\t\r\n\t\t\t\tfield.appendChild(child);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ti+= 1+children.length;\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\ti++;\r\n\t\t}\r\n\t\t\r\n\t\tlayout.appendChild(field);\r\n\t}\r\n\t\r\n\t\r\n\t//Propiedades fijas: cantidad de filas y columnas\r\n\tvar property = document.createElementNS(null, \"FORM_PROPERTY\");\r\n\tproperty.setAttribute('type','N');\r\n\tproperty.setAttribute('prpId','79');\r\n\tproperty.setAttribute('value', cols); \r\n\tlayout.appendChild(property);\r\n\r\n\tvar property = document.createElementNS(null, \"FORM_PROPERTY\");\r\n\tproperty.setAttribute('type','N');\r\n\tproperty.setAttribute('prpId','80');\r\n\tproperty.setAttribute('value', rows); \r\n\tlayout.appendChild(property);\r\n\t// *********************************************\r\n\t\r\n\t//Se procesan todas las propiedades asociadas al formulario\r\n\tprocessProperties(formProperties, layout, true /*isFormProperty*/);\r\n\t\r\n\tif(window.XMLSerializer) {\r\n\t\treturn new XMLSerializer().serializeToString(layout);\r\n\t} else {\r\n\t\treturn layout.xml;\r\n\t}\r\n}", "function tryGetModuleWijmoGridDetail(){var e,t;return(e=__glob.wijmo)&&(t=e.grid)&&t.detail}", "function extractEntryDetails (html) {\n // extract details\n let details = {}\n let rows = $('.gi tr', html)\n for (let i = 0; i < rows.length; i++) {\n let left = $('.spaltelinks', rows[i]).text().trim()\n let right = $('.spalterechts', rows[i]).text().trim()\n if (right[0] === '[' && right.slice(-1) === ']') {\n right = right.slice(1, -1)\n }\n // blacklist of unnecessary tags\n if (!detailsBlacklist.includes(left)) {\n details[left] = right\n }\n }\n // extract image\n let img = $('#R001 img', html).attr('src')\n // check for rating image\n if (img && img.indexOf('Sterne.gif') === -1) {\n details.img = `https://voebb.de${img}`\n } else {\n img = ''\n }\n\n // extract all copies\n var copies = []\n // check presence and order of columns\n let header = [0, 0, 0, 0, 0]\n for (let i = 1; i <= $('th[scope=\"col\"]', html).length; i++) {\n switch ($('th[scope=\"col\"]:nth-child(' + i + ')', html).text()) {\n case 'Bibliothek': header[0] = i\n break\n case 'Standort': header[1] = i\n break\n case 'Signatur': header[2] = i\n break\n case 'Bestellmöglichkeit': header[3] = i\n break\n case 'Verfügbarkeit': header[4] = i\n break\n }\n }\n rows = $('#R08 tbody tr', html)\n for (let i = 0; i < rows.length; i++) {\n copies.push(extractCopy(rows[i], header))\n }\n return {\n 'details': details,\n 'copies': copies\n }\n}", "function getInfo(event){\n return{\n title: event.target.querySelector(\"#title\").value,\n author: event.target.querySelector(\"#author\").value,\n content: event.target.querySelector(\"#content\").value\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}", "function createExpressoEntity(html) {\n let $ = parser.load(html)\n\n let data = []\n $('table span').each(function (i, elem) {\n if(i >= 10 )\n data.push($(this).text().trim().replace(/\\s\\s+/g, ' '))\n });\n\n return new ExpressoInfo({\n 'guide': data[0],\n 'origin': data[1],\n 'date': data[2],\n 'status': data[3],\n 'weight': data[4],\n 'parcels': data[5],\n 'receiver_name': data[6],\n 'address': data[7],\n 'refund': data[8],\n 'ref': data[9],\n })\n}", "function getGridElement(row, col){\n\tvar cellNum = parseInt(row-1)*size + parseInt(col);\n\tvar cell = dom.gameBoard.querySelector(\"#cell\"+cellNum);\n\treturn cell;\n}", "getMethodsFromUML(_htmlId) {\n // obj[] has key>contract, value> contract content in string format\n let obj = [];\n let data = d3.select(_htmlId).select(\"svg\").selectAll(\"g\");\n //all contracts\n data._groups.forEach(d=>{\n d.forEach(function(element){\n //each of the elements\n obj[element.id] = element.textContent;\n });\n });\n return obj;\n }", "function getAddresses() {\n // 2021-06-05 OG NEW - Get all the cards from the page \n var groups = document.getElementsByClassName('card-info');\n // 2021-06-05 OG NEW - Initialize an empty array to store the info \n var result = [];\n // 2021-06-05 OG NEW - Go through each group and format the info into an object \n for (var i = 0; i < groups.length; i++) {\n result.push({\n type: groups[i].children[2].innerHTML, // The type of group\n value: groups[i].children[3].innerHTML + \" \" + groups[i].children[4].innerHTML, // The address value\n markup: groups[i].innerHTML // The entire markup to be used in the info window\n });\n }\n\n return result;\n}", "function pagehtml(){\treturn pageholder();}", "async readOverviewTiles() {\n const tiles = await this.page.evaluate(() =>\n Array.from(document.querySelectorAll('div[id$=ITtile]')).map(t => {\n const [title, badge] = t.querySelectorAll('span');\n return {\n isSelected: t.classList.contains('p_AFSelected'),\n title: title.textContent,\n badge: badge.textContent,\n selectId: t.querySelector('a[title^=\"Select:\"]').id,\n };\n }));\n\n tiles.forEach(t => t.click =\n this.page.click.bind(this.page, '#'+t.selectId.replace(/:/g,'\\\\:')));\n return tiles;\n }", "function fetchContainerElements() {\n var elements = {};\n try {\n // get document height\n elements.docHeight = $document[0].documentElement.offsetHeight\n // get navbar height\n elements.navbarHeight = $document[0].getElementById('mainnav').offsetHeight;\n // get bookmark container height\n elements.bookmarkHeight = $document[0].getElementById('bookmark-container').offsetHeight;\n // get record main container\n elements.container = $document[0].getElementById('main-content');\n } catch (error) {\n $log.warn(error);\n }\n return elements;\n }", "function popGrid() {\n view.graphics.removeAll();\n if (landuseLayerView) {\n const query = {\n where: \"1=1\",\n outFields: [\"*\"]\n };\n\n // query graphics from the layer view. Geometry set for the query\n // can be polygon for point features and only intersecting geometries are returned\n landuseLayerView.queryFeatures(query).then(function(results) {\n const graphics = results.features;\n // if the grid div is displayed while query results does not\n // return graphics then hide the grid div and show the instructions div\n if (graphics.length > 0) {\n gridDiv.style.zIndex = 90;\n infoDiv.style.zIndex = 80;\n document.getElementById(\"featureCount\").innerHTML =\n \"<b>Showing attributes for \" +\n graphics.length.toString() + \" features </b>\"\n } else {\n gridDiv.style.zIndex = 80;\n infoDiv.style.zIndex = 90;\n }\n\n // get the attributes to display in the grid\n const data = graphics.map(function(feature, i) {\n return Object.keys(feature.attributes)\n .filter(function(key) {\n // get fields that exist in the grid\n return (gridFields.indexOf(key) !== -1);\n })\n // need to create key value pairs from the feature\n // attributes so that info can be displayed in the grid\n .reduce(function(obj, key) {\n obj[key] = feature.attributes[key];\n return obj;\n }, {});\n });\n\n // set the datastore for the grid using the\n // attributes we got for the query results\n dataStore.objectStore.data = data;\n grid.set(\"collection\", dataStore);\n })\n .catch(errorCallback);\n }\n }", "function infoFromHtml(html) {\n // First, just strip all the actual HTML & get text\n const text = JSDOM.fragment(html).textContent;\n\n if (/will die if it doesn/.exec(text) === null) { return { type: \"not growing\" }; }\n \n let sick = false;\n // Check for text indicating sickness.\n if (/shell of the egg seems soft,/.exec(text) !== null) { sick = true }\n if (/hatchling seems sick/.exec(text) !== null) { sick = true }\n\n // Parse all view-y counters\n const views = parseCounter(text, \"Overall views\");\n const uniqueViews = parseCounter(text, \"Unique views\");\n const clicks = parseCounter(text, \"Clicks\");\n \n // Try and parse remaining-time bits\n const days = parseInt(getCapture(text, /in: (\\d+) day/, 0));\n const hours = parseInt(getCapture(text, /and (\\d+) hour/, 0));\n const type = getCapture(text, /Viewing (Hatchling|Egg)/)\n\n if (isNaN(days) || isNaN(hours)) { throw new Error(\"Either days or hours are now invalid; has DC's format changed?\"); }\n\n return {\n views,\n uniqueViews,\n clicks,\n type: type == \"Hatchling\" ? \"hatchling\" : \"egg\",\n hoursRemaining: days * 24 + hours,\n sick\n }\n}", "function social_curator_grid_post_loaded(data, element){}", "get cells() {\n let cells = this.control.elements('td').value;\n return cells.map(cell => new ElementControlWrapper(null, cell));\n }", "function processTRDOM(trDOM) {\n var listTDs = trDOM.cells;\n\n if (listTDs.length !== 3) {\n console.log('trDOM data is invalid: ' + JSON.stringify(trDOM));\n return null;\n }\n var data = {\n account: listTDs[0].innerHTML.trim(),\n transaction: listTDs[1].innerHTML.trim(),\n amount: extractAmount(listTDs[2].innerHTML.trim()),\n currency: extractCurrency(listTDs[2].innerHTML.trim())\n }\n return data;\n }", "function getPageObject () {\n return {\n title: $('#title').val(),\n tags: ($('#tags').val() || []).join(),\n text: $('#text').val(),\n alias: $('#alias').val(),\n stamp: $('#stamp').val()\n }\n }", "function TreeGrid_CreateHTMLObject(theObject)\n{\n\t//create the div\n\tvar theHTML = document.createElement(\"div\");\n\t//simple add\n\ttheHTML = Basic_SetParent(theHTML, theObject);\n\t//Set parent\n\ttheObject.HTMLParent = theHTML;\n\t//set its Basic Properties\n\tBasic_SetBasicProperties(theHTML, theObject);\n\t//there was no specified selection background\n\t//if (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED])) APPARENTLY TREEGRID NEVER PAINTS THE ROW\n\t{\n\t\t//we do not use a default one then\n\t\ttheObject.BGColours[__STATE_SELECTED] = null;\n\t}\n\t//there was no specified selection foreground\n\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_SELECTED]))\n\t{\n\t\t//we do not use a default one then\n\t\ttheObject.FGColours[__STATE_SELECTED] = null;\n\t}\n\t//treegrids always have scrollbars implemented within themselves\n\ttheHTML.style.overflow = \"hidden\";\n\ttheHTML.style.overflowX = \"hidden\";\n\ttheHTML.style.overflowY = \"hidden\";\n\t//add the TreeGrid's Interpreter functions\n\ttheHTML.GetData = TreeGrid_GetData;\n\ttheHTML.GetHTMLTarget = TreeGrid_GetHTMLTarget;\n\ttheHTML.UpdateProperties = TreeGrid_UpdateProperties;\n\ttheHTML.NotifyDestruction = TreeGrid_NotifyDestruction;\n\ttheHTML.ProcessOnKeyDown = TreeGrid_ProcessOnKeyDown;\n\t//Update the Entire TreeGrid\n\tTreeGrid_Update(theObject);\n\t//block all of our events (they will be handled internaly)\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSEDOWN, Browser_CancelBubbleAndMenu);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_CLICK, Browser_CancelBubbleOnly);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSERIGHT, Browser_CancelBubbleOnly);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_DOUBLECLICK, Browser_CancelBubbleOnly);\n\t//return the newly created object\n\treturn theHTML;\n}", "function GetListItemGridData(listItem) {\n var obj = {};\n for (var key in Grid_Field_Mapping) {\n var fieldName = key;\n var searchKey = Grid_Field_Mapping[fieldName];\n\n var result_value = GetFieldValueForSearchKey(searchKey, listItem);\n\n if (result_value != null) {\n obj[fieldName] = result_value;\n if (fieldName == \"ItemFullName\")//Item name of the file or folder.\n {\n obj[\"NoExtensionName\"] = result_value.split(\".\")[0];// File name without file type.\n }\n\n else if (fieldName == \"Modified\") {\n var modifieddateAndDate = result_value.split(\"T\");\n var modifieddate = modifieddateAndDate[0].split(\"-\");\n var modifiedTime = modifieddateAndDate[1].slice(0, -4);\n var modifiedDateFormat = modifieddate[1] + \"/\" + modifieddate[2] + \"/\" + modifieddate[0]\n obj[\"ModifiedDate\"] = modifiedDateFormat;// Modified date without time.\n obj[\"ModifiedTime\"] = modifiedTime;// Modified time without date.\n }\n else if (fieldName == \"FileType\")\n obj[\"DocIconUrl\"] = result_value != null ? GetFileIconUrl(result_value) : \"\";//Get the document icon url for the file type.\n else if (fieldName == \"ProgID\") {\n if (result_value != null && result_value == \"OneNote.Notebook\")\n obj[\"FileType\"] = \"one\";\n }\n\n\n }\n }\n return obj;\n\n}", "function getTable(html) {\n\t\treturn html.querySelector('table');\n\t}", "loadFeatureData(){\n let featureHtml = `<div class=\"grid\">\n <div class=\"row space-bot\">\n <div class=\"c12\">\n <div class=\"royalcontent\">\n <h1 class=\"royalheader\">${ this.utilityData.homeTitle }</h1>\n <h1 class=\"title\" style=\"text-transform:none;\">${ this.utilityData.homeSubTitle }</h1>\n </div>\n </div>`\n this.features.forEach(feature => {\n featureHtml += `<div class=\"c4\">\n <h2 class=\"title hometitlebg\"><i class=\"${ feature.homeFeatureIcon } smallrightmargin\"></i> ${ feature.homeFeatureTitle }</h2>\n <div class=\"noshadowbox\">\n <p>\n ${ feature.homeFeatureDetail }\n </p>\n </div>\n </div>`\n }, this);\n this.mainContainer.innerHTML += featureHtml + `</div></div>`;\n }", "function displayEle() {\r\n //xhr request\r\n let xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", \"data/PeriodicTableJSON.json\", true);\r\n xhr.onload = function () {\r\n let data = JSON.parse(this.responseText);\r\n let eleData = data.elements;\r\n let html;\r\n let ele = document.getElementById(\"ele\");\r\n // displaying in ui\r\n eleData.forEach((element, index) => {\r\n html = `\r\n <h7 class=\"list-group-item list-group-item-action list-group-item-dark mt-2\" onclick='display(this.id)' id='${index}'>${index+1}. ${element.name} </h7>\r\n `;\r\n ele.innerHTML += html;\r\n });\r\n };\r\n xhr.send();\r\n}", "function read_dom(){\n google_eles = [\n document.getElementById('viewport'),\n document.getElementById('body'),\n document.getElementById('footer'),\n document.getElementById('fbar')\n ];\n}", "function outputGridToHTML(){\n var htmlOutput = \"\";\n var output = \"\";\n for (var i=0; i < grid.length; i++){\n //creating row tag for this row//\n htmlOutput += \"<div class='row'>\";\n //append current tile type to output//\n for (var j=0; j < grid.length; j++){\n const currentTile = grid[i][j];\n output += currentTile.type;\n const variation = currentTile.variations[Math.floor(Math.random()*currentTile.variations.length)];\n htmlOutput += \"<div class='tile tile_type_\" + currentTile.type + variation + \"'></div>\"\n }\n //new line for console log output for end of row//\n output += \"\\n\";\n //closing row tag for this row//\n htmlOutput += \"</div>\";\n }\n console.log(\"output grid: \", output);\n document.getElementById(\"mapGrid\").innerHTML = htmlOutput;\n}", "function gridState(){\n var grid = {};\n $theInputs = $('.game-cell-input');\n $theInputs.each(function(){ // iterate over each input\n if($(this).val()){\n var num = $(this).data('num');\n var special = $(this).data('special');\n if(typeof special == \"undefined\" || special > 5 || special == 0){\n special = 0;\n }\n grid[num] = {val: $(this).val(), special: special};\n }\n });\n return grid;\n }", "fetchGrid(url, obj) {\n fetch(url).then(function(response) {\n return response.json()\n }).then(function(data) {\n let newGrid = data.cells\n let width = newGrid.length\n let height = newGrid[0].length\n\n obj.setWidth(width)\n obj.setHeight(height)\n obj.board.grid = obj.board.createGrid()\n obj.board.resultGrid = obj.board.createGrid()\n\n for(let col = 0; col < obj.width; col++) {\n for(let row = 0; row < obj.height; row++) {\n obj.board.grid[col][row] = newGrid[col][row]\n }\n }\n game.createTable()\n game.render()\n console.log(game.getWidth())\n console.log(game.getHeight())\n $('width').val(game.getWidth())\n $('height').val(game.getHeight())\n }).catch(function() {\n console.error(\"Error fetching.\")\n })\n }", "function getTemplate(winNo) {\n var str =\n ' <div class=\"vis-fp-bodycontent vis-formouterwrpdiv\"> ' +\n ' <div class=\"vis-fp-viwall\" > ' +\n ' <span>' + VIS.Msg.getMsg(\"ViewMore\") + '</span> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-datawrap\"> ' +\n ' <div class=\"vis-fp-static-ctrlwrp\"> ' +\n ' <div class=\"vis-fp-static-ctrlinnerwrp\"></div> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-custcolumns\" id=\"accordion_' + winNo + '\"\"> ' +\n ' <div class=\"card\"> ' +\n ' <div class=\"card-header\" style=\"cursor:pointer\" data-toggle=\"collapse\" href=\"#collapseOne_' + winNo + '\"> ' +\n ' <span>' + VIS.Msg.getMsg(\"CustomCondition\") + '</span> ' +\n ' <a class=\"card-link\" > ' +\n ' <i class=\"vis vis-arrow-up\"></i> ' +\n ' </a> ' +\n ' </div> ' +\n ' <div id=\"collapseOne_' + winNo + '\"\" class=\"collapse\" data-parent=\"#accordion_' + winNo + '\" >' +\n ' <div class=\"card-body\"> ' +\n ' <div class=\"input-group vis-input-wrap\"> ' +\n ' <div class=\"vis-control-wrap\"> ' +\n ' <select class=\"vis-fp-cols\"> ' +\n ' </select> ' +\n ' <label class=\"vis-fp-lblcols\">' + VIS.Msg.getMsg(\"Column\") + '</label> ' +\n ' </div> ' +\n ' </div> ' +\n ' <div class=\"input-group vis-input-wrap\"> ' +\n ' <div class=\"vis-control-wrap\"> ' +\n ' <select class=\"vis-fp-op\"> ' +\n ' </select> ' +\n ' <label class=\"vis-fp-lblop\">' + VIS.Msg.getMsg(\"Operator\") + '</label> ' +\n ' </div> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-valueone\"> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-valuetwo\"> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-valuethree\"> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-cc-addbtnwrp\"> ' +\n ' <span class=\"vis-fp-cc-addbutton\">' + VIS.Msg.getMsg(\"Add\") + '</span> ' +\n ' </div> ' +\n ' </div> ' +\n ' </div> ' +\n ' </div> ' +\n ' <div class=\"vis-fp-custcoltagswrp\"> ' +\n ' <div class=\"vis-fp-custcoltag\"> ' +\n ' </div> ' +\n ' </div><!-- vis-fp-custcoltagswrp --> ' +\n ' </div> </div> ' +\n ' </div>';\n return str;\n }", "function showGrid() {\n\tdocument.getElementById('gridDiv').style.visibility = 'visible';\n\tvar table = document.getElementById(\"gridDatatbl\");\n\tvar gridData = JSON.parse(localStorage.getItem(\"gift_exchange_table\"));\n\ttable.innerHTML = \"\";\n\tif (!gridData) {\n\t\tgridData = [];\n\t}\n\tfor (var i = 0; i < gridData.length; i++) {\n\t\tvar row = table.insertRow(0);\n\t\tvar cell1 = row.insertCell(0);\n\t\tvar cell2 = row.insertCell(1);\n\t\tcell1.innerHTML = gridData[i].name;\n\t\tcell2.innerHTML = gridData[i].drawn;\n\t}\n}", "get productTextDetail() { return $('.inventory_details_name') }", "function gatherInfo() {\n const pageContent = dom.$('#pageContent');\n const name = dom.$('.contest-name', pageContent).innerText;\n const id = +/\\/contest\\/(\\d+)\\//.exec(location.href)[1]; // just finds the /contest/{ID} and converts to a number\n const div = +(/Div\\. (\\d)/i.exec(name) || [])[1];\n const twinID = div == 1 ? (id + 1) : (id - 1);\n return { pageContent, name, id, div, twinID };\n}", "function parseGrid(grid) {\n var str = '';\n for (var row = 0; row < grid.length; row++) {\n for (var col = 0; col < grid[row].length; col++) {\n str = str + (grid[row][col].state ? grid[row][col].state.toLowerCase() : '-')\n }\n }\n return str;\n}", "function buildPage(input){\n document.getElementById(\"ufo-table\").getElementsByTagName('tbody')[0].innerHTML = \"\";\n input.forEach((element,index)=>{\n\n // Peruse the dataset to filter all elements with id=\"ufo-table\":\n let table = document.getElementById(\"ufo-table\").getElementsByTagName('tbody')[0];\n let row = table.insertRow(index);\n let cell1 = row.insertCell(0);\n let cell2 = row.insertCell(1);\n let cell3 = row.insertCell(2);\n let cell4 = row.insertCell(3);\n let cell5 = row.insertCell(4);\n let cell6 = row.insertCell(5);\n let cell7 = row.insertCell(6);\n\n // Add HTML contents of the corresponding elements:\n cell1.innerHTML = element.datetime;\n cell2.innerHTML = element.city;\n cell3.innerHTML = element.state;\n cell4.innerHTML = element.country;\n cell5.innerHTML = element.shape;\n cell6.innerHTML = element.durationMinutes;\n cell7.innerHTML = element.comments;\n\n index++;\n });\n}", "function LoadInvestmentsGrid() {\n var columns = [\n { \n dataField: 'InvestmentRelationshipType', width: '0px', groupIndex: 0, sortOrder: 'asc', sortIndex: 0, caption: '', calculateCellValue: function (data) {\n return [GetRelationshipType(data.InvestmentRelationshipType)];\n }\n },\n { dataField: 'InvestmentId', width: '0px', },\n { dataField: 'Investment.InvestmentNumber', caption: 'Inv Num', sortOrder: 'asc', sortIndex: 1, alignment: 'left' },\n { dataField: 'Investment.CurrentMaturityDate', caption: 'Maturity', dataType: 'date' },\n {\n dataField: 'Investment.Rate', caption: 'Rate', alignment: 'right', calculateCellValue: function (data) {\n return [data.Investment.Rate + '%']\n }\n },\n { dataField: 'Investment.Balance', caption: 'Balance', dataType: 'number', format: 'currency', precision: 2, alignment: 'right' },\n { dataField: 'Investment.DisplayName', caption: 'Ownership' }\n ];\n\n CustomLoadGrid('investmentgrid', '.investmentstable', columns, 'investmentrelationships/constituent/' + currentEntity.Id, null, CallInvestmentDetail, null, null);\n}", "function parseHTML(html){\n var rows = html.split(\"<tr>\");\n //Validate that the response have at least one polygon\n if(rows.length<3){ //On 3 position is the first polygon\n alert(invalidPolygonE);\n document.getElementById('info').innerHTML = \"\";\n return;\n }\n var prepolygon = rows[2];\n var prepolygonIni = prepolygon.replace(\"<td>\",\"|_|\");\n var prepolygonFin = prepolygonIni.replace(\"</tr>\",\"|_|\");\n var polygonArray = prepolygonFin.split(\"|_|\");\n var polygon = polygonArray[1];\n //Delete separators (new line ...)\n var withOutSeparators = deleteSeparators(polygon);\n //Homogenize the delimeter of the atributes\n var homogenized = withOutSeparators.replace(/<\\/td>/gi,\"\");\n //Get the final info\n var atributes = homogenized.split(\"<td>\");\n var id = atributes[0];\n var info = \"\";\n for(var i = 1;i<atributes.length;i++){\n info += trim(atributes[i])+\" \";\n }\n var polygons = new Array();\n polygons.push(new Array(id,info));\n polygonsList = polygons;\n}", "function getGridCellDev(grid, row, col)\n{\n // IGNORE IF IT'S OUTSIDE THE GRID\n if (!isValidCellDev(row, col))\n {\n return -1;\n }\n var index = (row * gridWidthDev) + col;\n return grid[index];\n}", "getHTML() {\n return getHTMLFromFragment(this.state.doc.content, this.schema);\n }", "function getValue(props) {\n return props.in_grid ? props.data[props.elem.fields_index] : props.data[props.elem.name];\n}", "async function getRecordAndRankFromRosterHtml( html ){\n const $ = cheerio.load(await html);\n\n const record = $(\"span:contains('Record:')\").next().text();\n const rank = $(\"span:contains('Rank:')\").next().text();\n\n return {rank, record};\n}", "function printmygridGO(obj){ global_printer.printGrid(obj);\t}", "function readElement(tree){\n\t\t\t if(!tree.content){\n\t\t\t for(var key in tree){\n\t\t\t readElement(tree[key]);\n\t\t\t }\n\t\t\t }else{\n\t\t\t if(tree.content.type){\n\t\t\t if(tree.content.type==\"summary\" ||\n\t\t\t tree.content.type==\"carousel\" ||\n\t\t\t tree.content.type==\"cardCarousel\" ||\n\t\t\t tree.content.type==\"iconView\" ||\n\t\t\t tree.content.type==\"landingPage\")\n\t\t\t summariesToFetch.push(tree.content);\n\t\t\t }\n\t\t\t }\n\t\t\t}", "get overviewTab() {return browser.element(\"~Overview\");}", "get cellTagName() {\n return 'div';\n }", "rowsHtml() {\n const cells = [];\n\n for (let column of this.items) {\n cells.push(column.cellHtml());\n }\n\n const result = populateTemplate(gridRowTemplate, {\n \"__row-cells__\": cells.join(\"\")\n });\n\n return result;\n }", "function generateGridPost(){\r\n var num_post=Object.keys(datajson.graphql.user.edge_owner_to_timeline_media.edges).length;\r\n console.log(num_post)\r\n var k=0;\r\n var r=\"row\";\r\n var c=\"col\";\r\n let ig = new XMLHttpRequest();\r\n document.getElementById(\"con2\").innerHTML=\"<div>\"\r\n for(var i=0;i<num_post;i=i+2){\r\n var cls=r+(i+1).toString();\r\n console.log(cls)\r\n console.log(typeof(cls))\r\n document.getElementById(\"con2\").innerHTML+=\"<div class='row' id=\"+cls+\">\"\r\n var tstamp = datajson.graphql.user.edge_owner_to_timeline_media.edges[k].node.taken_at_timestamp;\r\n var months_arr = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\r\n var date = new Date(tstamp*1000);\r\n var year = date.getFullYear();\r\n var month = months_arr[date.getMonth()];\r\n var day = date.getDate();\r\n // Display date time in dd-MM-yyyy h:m:s format\r\n var period = day+'-'+month+'-'+year;\r\n for(var j=0;j<2;j++){\r\n var des=(datajson.graphql.user.edge_owner_to_timeline_media.edges[k].node.edge_media_to_caption.edges[0].node.text).substring(0,150);\r\n var img=datajson.graphql.user.edge_owner_to_timeline_media.edges[k].node.display_url\r\n ig.open('GET',img,false);\r\n ig.onreadystatechange = function(){\r\n if(ig.status==200){\r\n document.getElementById(cls).innerHTML+=\"<div class='col' id='col'\"+j+\" ><div class='container' style='background-color: rgb(255, 255, 255); text-align: left; border-radius: 25px; height: 150px;width: 520px;display: flex;&__image {margin: 20px 30px 0 0;width: 200px;object-fit: contain;align-self: flex-start;}&__text {flex: 1 1 auto;}}'><img src=\"+ img+\" style='height: 150px;width: 200px; border-radius: 25px;'><span style='padding-left: 10px; padding-top: 5px; padding-bottom: 5px; padding-right:10px;'><span style='color: red;'>\"+period+\"</span><br>\"+des+\"....\"+\"</span></div><br></div>\"\r\n console.log(img)\r\n }\r\n else if(ig.status==403){\r\n document.getElementById(cls).innerHTML+=\"<div class='col' id='col'\"+j+\"><div class='container' style='background-color: rgb(255, 255, 255); text-align: left; border-radius: 25px; height: 150px;width: 520px;display: flex;&__image {margin: 20px 30px 0 0;width: 200px;object-fit: contain;align-self: flex-start;}&__text {flex: 1 1 auto;}}'><iframe height=' 150px' width= '200px' src=\"+img+\" type='video/mp4' style='border-radius: 25px;'></iframe><span style='padding-left: 10px; padding-top: 5px; padding-bottom: 5px; padding-right:10px;'><span style='color: red;'>\"+period+\"</span><br>\"+des+\"....\"+\"</span></div><br></div><br>\"\r\n }\r\n }\r\n ig.send();\r\n k++;\r\n }\r\n document.getElementById(\"con2\").innerHTML+=\"</div><br><br><br>\"\r\n }\r\n document.getElementById(\"con2\").innerHTML+=\"</div>\"\r\n}", "function getAllFormFieldsForGrid(gridId) {\r\n var table = getTableForGrid(gridId);\r\n var divId = getTableProperty(table, \"gridDetailDivId\");\r\n var inputFields = getTableProperty(table, \"allFormFieldsForGrid\");\r\n if (!inputFields) {\r\n if (divId == \"\"){\r\n inputFields = $(\":input[datasrc='#\" + gridId + \"1']\");\r\n }else{\r\n var gridDetailDiv = $(\"#\" + divId);\r\n inputFields = $(\":input\", gridDetailDiv);\r\n }\r\n setTableProperty(table, \"allFormFieldsForGrid\", inputFields);\r\n }\r\n return inputFields;\r\n}", "function createGridBody() {\n let idHead = \"b0\";\n let idforList = \"mb0\";\n let idlist1 = \"m102\";\n let idlist2 = \"m101\";\n let idLastDiv = \"b1\";\n let classBox = \"box\";\n let classList_m1 = \"m1\";let classUl_m0 = \"m0\";let classDivbox001 = \"box001\";\n let kl = `\n <div class=${classBox} id=${idHead}>\n <h1>To Do List</h1>\n </div>\n <div class=${classDivbox001} id=${idforList}>\n <ul class=${classUl_m0}>\n <li class=${classList_m1} id=${idlist1}>Account Settings</li>\n <li class=${classList_m1} id=${idlist2}>Main</li>\n </ul>\n </div>\n <div class=${classBox} id=${idLastDiv}></div>\n`;\n let by = document.getElementById(\"wrp\");\n\n by.innerHTML = kl;\n}", "function formatGridAsCsvOrHtml(grid, startCol, type) {\r\n\r\n ogrid = grid;\r\n ostartCol = startCol;\r\n otype = type;\r\n var gridTbl = getSingleObject(grid);\r\n var retVal = '';\r\n var gridRecCount = eval(gridTbl.id + '1.recordset.RecordCount');\r\n if(isFullyExport || exportFromXML(grid)) {\r\n excelFlg = true;\r\n try {\r\n // Call the exportExcelFromXMLData function to export the excel from XML.\r\n exportExcelFromXMLData(grid, startCol);\r\n } catch(ex) {\r\n //ignore the error and set the excelFlg back.\r\n excelFlg = false;\r\n }\r\n excelFlg = false;\r\n } else {\r\n if(gridRecCount > gridTbl.dataPageSize) {\r\n // The record count of the grid is greater than the page size.\r\n // That means we have to manipulate the datapagesize of the grid table.\r\n // Get the original data page size and store it for later use.\r\n origPageSize = gridTbl.dataPageSize;\r\n // Save the selectedRow inorder to restore it later (after data generation)\r\n origSelectedRow = null;\r\n if(getTableProperty(gridTbl, \"rowobject\") != null) {\r\n origSelectedRow = getTableProperty(gridTbl, \"rowobject\");\r\n // Since the page and row pointer is going to change anyway, null out the rowobject\r\n setTableProperty(gridTbl, \"rowobject\", null);\r\n }\r\n excelFlg = true;\r\n // Call the prepareDataFromGrid function to retrieve all the data in data XML island.\r\n prepareDataFromGrid();\r\n\r\n } else {\r\n // The record count of the grid is the same as the page size.\r\n if(type == 'CSV') {\r\n // Format the table as CSV for Excel.\r\n retVal = formatTableAsCsv(gridTbl, startCol);\r\n }\r\n else if(type == 'HTML') {\r\n // Get the table innerHTML to pass to Excel.\r\n retVal = formatTableInnerHtmlAsHtmlDoc(gridTbl);\r\n }\r\n otxt = retVal;\r\n postFormTextForCsvHtmlForExcel(otxt, ourl, odispType);\r\n }\r\n }\r\n return retVal;\r\n}" ]
[ "0.62952757", "0.6100271", "0.5985714", "0.58489484", "0.58190185", "0.5813813", "0.5769689", "0.5646969", "0.5642653", "0.5636922", "0.563019", "0.5532093", "0.5487082", "0.5481826", "0.54785156", "0.54755294", "0.5474268", "0.53948504", "0.5391853", "0.539051", "0.5388551", "0.53783166", "0.53670925", "0.5356329", "0.53379935", "0.5327982", "0.53244835", "0.5324307", "0.53132784", "0.53001016", "0.5279133", "0.52762115", "0.52695584", "0.52234375", "0.5216913", "0.5213106", "0.52100825", "0.5179302", "0.5176251", "0.5167581", "0.51646227", "0.51623744", "0.5158119", "0.51579803", "0.5146941", "0.5137186", "0.5135648", "0.51300514", "0.5119127", "0.5117127", "0.5115012", "0.50993556", "0.50885874", "0.50803244", "0.50784117", "0.5049695", "0.50469744", "0.50414157", "0.5040805", "0.50397015", "0.5034578", "0.50273126", "0.50162554", "0.50154763", "0.50101095", "0.49924242", "0.49848193", "0.4984492", "0.4977994", "0.49746794", "0.49723086", "0.49618337", "0.49574196", "0.4954645", "0.4953684", "0.49526247", "0.49522132", "0.49505046", "0.49494404", "0.49363622", "0.49358228", "0.493256", "0.49290502", "0.49272287", "0.49261877", "0.4922911", "0.4920789", "0.49153212", "0.4909565", "0.4908927", "0.49066573", "0.4904346", "0.49038038", "0.49007934", "0.4899934", "0.48989737", "0.48979765", "0.4894336", "0.48917943", "0.48871076" ]
0.5571909
11
Gets classes of grid
function getGridClass(pos) { let childs = c.childNodes; let classes = childs[pos].className.split(' '); return classes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getGridListClassName() {\n let className = 'mdc-grid-list';\n if (this.discrete) {\n className = ` ${className} mdc-grid-list--tile-aspect-${this.discrete}`;\n }\n return className;\n }", "classes() {\n return this.dataset.reduce(function(acc, val) {\n if (!acc.includes(val.c)) {\n acc.push(val.c);\n }\n return acc;\n }, []);\n }", "get classes() {\n const result = {};\n const element = this.nativeElement;\n // SVG elements return an `SVGAnimatedString` instead of a plain string for the `className`.\n const className = element.className;\n const classes = typeof className !== 'string' ? className.baseVal.split(' ') : className.split(' ');\n classes.forEach((value) => result[value] = true);\n return result;\n }", "function _getClasses($el){\n var cls = $el.attr('class')\n if (cls)\n return cls.split(/\\s+/)\n return []\n }", "getClasses() {\n let classes = ['indicator-pip'];\n\n if (this.props.final) {\n classes.push('final');\n }\n\n if (this.props.taken) {\n classes.push('taken');\n }\n\n return classes.join(' ');\n }", "get tileClass() {\n if(this.selectedBoatId){\n return TILE_WRAPPER_SELECTED_CLASS;\n }\n \n return TILE_WRAPPER_UNSELECTED_CLASS;\n \n }", "get tileClass() {\n const TILE_WRAPPER_SELECTED_CLASS = 'tile-wrapper selected';\n const TILE_WRAPPER_UNSELECTED_CLASS ='tile-wrapper';\n if(this.selectedBoatId){\n return TILE_WRAPPER_SELECTED_CLASS;\n }\n return TILE_WRAPPER_UNSELECTED_CLASS;\n }", "setGridClassList(classList) {\n const me = this;\n\n classList.add(`b-grid-${me.positionMode}`);\n\n // TODO: enableTextSelection should be a setter, enabling toggling at any time\n if (!me.enableTextSelection) {\n classList.add('b-grid-notextselection');\n }\n\n if (me.autoHeight) {\n classList.add('b-autoheight');\n }\n\n if (me.readOnly) {\n classList.add('b-readonly');\n }\n\n if (me.fillLastColumn) {\n classList.add('b-fill-last-column');\n }\n\n if (me.showDirty) {\n classList.add('b-show-dirty');\n }\n\n for (let featureName in me.features) {\n let feature = me.features[featureName],\n featureClass;\n\n if (feature.constructor.hasOwnProperty('featureClass')) {\n featureClass = feature.constructor.featureClass;\n } else {\n featureClass = `b-${feature instanceof Base ? feature.$name : feature.constructor.name}`;\n }\n\n if (featureClass) {\n classList.add(featureClass.toLowerCase());\n }\n }\n }", "setGridClassList(classList) {\n const me = this;\n classList.add(`b-grid-${me.positionMode}`); // TODO: enableTextSelection should be a setter, enabling toggling at any time\n\n if (!me.enableTextSelection) {\n classList.add('b-grid-notextselection');\n }\n\n if (me.autoHeight) {\n classList.add('b-autoheight');\n }\n\n if (me.fillLastColumn) {\n classList.add('b-fill-last-column');\n }\n\n if (me.showDirty) {\n classList.add('b-show-dirty');\n }\n\n for (const featureName in me.features) {\n const feature = me.features[featureName];\n let featureClass;\n\n if (Object.prototype.hasOwnProperty.call(feature.constructor, 'featureClass')) {\n featureClass = feature.constructor.featureClass;\n } else {\n featureClass = `b-${feature instanceof Base ? feature.$name : feature.constructor.name}`;\n }\n\n if (featureClass) {\n classList.add(featureClass.toLowerCase());\n }\n }\n }", "cellClass(){\n var cls = {\n 'sortable': this.column.sortable,\n 'resizable': this.column.resizable\n };\n\n if(this.column.heaerClassName){\n cls[this.column.headerClassName] = true;\n }\n\n return cls;\n }", "get classList() { return this.panelClass; }", "function getAllClasses() {\n return readObject('classes');\n\n }", "function getAddressibleClasses() {\n // ignoredClasses serves two purposes:\n // 1) ignore a few classes that are used for display like\n // 2) filter out duplicates \n var ignoredClasses = {\n 'active': true,\n 'minute': true,\n 'hour': true,\n 'extra': true\n };\n var classes = [].map\n .call($('#world-clock td'),function(obj) { return $(obj).attr('class').split(' '); }) /* get array of arrays of classes for each td */\n .reduce(function(left, right) { return left.concat(right); }) /* flatten into one array containing all classes for all tds */\n .filter(function(obj) { return ignoredClasses.hasOwnProperty(obj) ? false : (ignoredClasses[obj] = true); }); /* filter out duplicates */\n return classes;\n }", "function get_classes(elem) {\n \"use strict\";\n return $(elem).attr('class').split(/\\s+/);\n}", "function getMeasureClasses() {\n\t\t\tif (!areMeasureClassesLoaded && !areMeasureClassesLoading) {\n\t\t\t\tgetMeasureClassesByAjax();\n\t\t\t}\n\t\t\treturn measureClasses;\n\t\t}", "getGrid() {\n return this.gridCells;\n }", "get themeClasses() {\n return baseThemeID + \" \" +\n (this.state.facet(darkTheme) ? baseDarkID : baseLightID) + \" \" +\n this.state.facet(theme);\n }", "function GetAvailableClasses( nodeName )\n{\n\tvar styles = FCK.Styles.GetStyles() ;\n\tvar aClasses = [{name:'', classname:''}];\n\n\tfor ( var styleName in styles )\n\t{\n\t\tvar style = styles[styleName] ;\n\t\tif (style.IsCore)\n\t\t\tcontinue;\n\n\t\tif (style.Element == nodeName)\n\t\t{\n\t\t\tif (style._StyleDesc.Attributes && style._StyleDesc.Attributes['class'] )\n\t\t\t\taClasses.push( {name:styleName, classname:style._StyleDesc.Attributes['class']} ) ;\n\t\t}\n\t}\n\n\treturn aClasses ;\n}", "function getClassName() {\n if (isMine(row, col) && isGameOver()) { return \"square-mined\" }\n if (isRevealed(row, col)) { return \"square-clicked\"; }\n return \"square\";\n }", "function classes() {\n var classes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classes[_i] = arguments[_i];\n }\n return classes\n .map(function (c) { return c && typeof c === 'object' ? Object.keys(c).map(function (key) { return !!c[key] && key; }) : [c]; })\n .reduce(function (flattened, c) { return flattened.concat(c); }, [])\n .filter(function (c) { return !!c; })\n .join(' ');\n}", "function getGridSize() {\n\tvar elementsToDisplay = 4;\n\n\tif(window.innerWidth < 420)\n\t{\n\t\telementsToDisplay = 1;\n\t} else if(window.innerWidth < 768)\n\t{\n\t\telementsToDisplay = 2;\n\t} else if(window.innerWidth < 1280)\n\t{\n\t\telementsToDisplay = 3;\n\t}\n\n\treturn elementsToDisplay;\n}", "getCSSClassesNames() {\n var classNames = 'article__textarea article__textarea--style';\n switch (this.state.cssCheck) {\n case 'OK':\n classNames += ' article__textarea--correct';\n break;\n case 'KO':\n classNames += ' article__textarea--wrong';\n break;\n default:\n classNames += ' article__textarea--idle';\n break;\n }\n return classNames;\n }", "function tile_class(tile) {\n if (tile == 1) {\n return \"red\";\n }\n else if (tile == 2) {\n return \"blue\";\n }\n else {\n return \"number\";\n }\n}", "function getGridSize() {\n\t\t\t\t return (window.innerWidth < 500) ? 1 :\n\t\t\t\t (window.innerWidth < 1179) ? 2 : 3;\n\t\t\t\t}", "function getClasses(route) {\n return getRouteName(route) + ' ' + isCurrent(route);\n }", "function clearGrid (){\n for (let i = 0; i < 625; i++){\n cells[i].classList = null\n \n }\n }", "function byClassName(nodeSet, cls){\n if(!cls){\n return nodeSet;\n }\n var result = [], ri = -1;\n for(var i = 0, ci; ci = nodeSet[i]; i++){\n if((' '+ci.className+' ').indexOf(cls) != -1){\n result[++ri] = ci;\n }\n }\n return result;\n }", "function getRowClass(params) {\n\n\t\t\t\t\tvar rowIndex = params.node.rowIndex;\n\t\t\t\t\tvar styleClassProvider;\n\n\t\t\t\t\t// make sure we remove non ag- classes, we consider those added by rowStyleClassDataprovider\n\t\t\t\t\tvar rowElement = $element.find(\"[row-index='\" + params.rowIndex + \"']\"); \n\t\t\t\t\tif(rowElement.length) {\n\t\t\t\t\t\tvar classes = rowElement.attr(\"class\").split(/\\s+/);\n\t\t\t\t\t\tfor(var j = 0; j < classes.length; j++) {\n\t\t\t\t\t\t\tif(classes[j].indexOf(\"ag-\") != 0) {\n\t\t\t\t\t\t\t\trowElement.removeClass(classes[j]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// TODO can i get rowStyleClassDataprovider from grouped foundset ?\n\t\t\t\t\tif (!isTableGrouped()) {\n\t\t\t\t\t\tvar index = rowIndex - foundset.foundset.viewPort.startIndex;\n\t\t\t\t\t\t// TODO get proper foundset\n\t\t\t\t\t\tstyleClassProvider = $scope.model.rowStyleClassDataprovider[index];\n\t\t\t\t\t} else if (params.node.group === false) {\n\n\t\t\t\t\t\tvar rowGroupCols = [];\n\t\t\t\t\t\tvar groupKeys = [];\n\n\t\t\t\t\t\tvar parentNode = params.node.parent;\n\t\t\t\t\t\tvar childRowIndex = rowIndex - Math.max(parentNode.rowIndex + 1, 0);\n\t\t\t\t\t\twhile (parentNode && parentNode.level >= 0 && parentNode.group === true) {\n\n\t\t\t\t\t\t\t// check if all fields are fine\n\t\t\t\t\t\t\tif (!parentNode.field && !parentNode.data) {\n\t\t\t\t\t\t\t\t$log.warn(\"cannot resolve rowStyleClassDataprovider for row at rowIndex \" + rowIndex);\n\t\t\t\t\t\t\t\t// exit\n\t\t\t\t\t\t\t\treturn styleClassProvider;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// is reverse order\n\t\t\t\t\t\t\trowGroupCols.unshift({field: parentNode.field, id: parentNode.field});\n\t\t\t\t\t\t\tgroupKeys.unshift(parentNode.data[parentNode.field]);\n\n\t\t\t\t\t\t\t// next node\n\t\t\t\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// having groupKeys and rowGroupCols i can get the foundset.\n\n\t\t\t\t\t\tvar foundsetUUID = groupManager.getCachedFoundsetUUID(rowGroupCols, groupKeys)\n\t\t\t\t\t\t// got the hash, problem is that is async.\n\t\t\t\t\t\tvar foundsetManager = getFoundsetManagerByFoundsetUUID(foundsetUUID);\n\t\t\t\t\t\tif (foundsetManager && foundsetManager.foundset.viewPort.rows[0]['__rowStyleClassDataprovider']) {\n\t\t\t\t\t\t\tvar index = childRowIndex - foundsetManager.foundset.viewPort.startIndex;\n\t\t\t\t\t\t\tif (index >= 0 && index < foundsetManager.foundset.viewPort.size) {\n\t\t\t\t\t\t\t\tstyleClassProvider = foundsetManager.foundset.viewPort.rows[index]['__rowStyleClassDataprovider'];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$log.warn('cannot render rowStyleClassDataprovider for row at index ' + index)\n\t\t\t\t\t\t\t\t$log.warn(params.data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$log.debug(\"Something went wrong for foundset hash \" + foundsetUUID)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn styleClassProvider;\n\t\t\t\t}", "function classes() {\n var classes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classes[_i] = arguments[_i];\n }\n return classes.filter(function (c) { return !!c; }).join(' ');\n}", "function classes() {\n var classes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classes[_i] = arguments[_i];\n }\n return classes.filter(function (c) { return !!c; }).join(' ');\n}", "function classes() {\n var classes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classes[_i] = arguments[_i];\n }\n return classes.filter(function (c) { return !!c; }).join(' ');\n}", "function getClassesOfElement(element){\n var tab = [];\n for(var i =0; i< element.length;i++){\n tab.push(element[i]);\n }\n return tab;\n}", "function getClasses(uid) {\n\t\tuid = (uid || Math.random())+\"\";\n\n\t\tvar courses = slice(document.querySelectorAll(\"div[id*=DERIVED_REGFRM1_DESCR]\")),\n\t\t classes = [];\n\n\t\tcourses.forEach(function (courseElem) {\n\t\t\tvar course = parseCourse(courseElem.getElementsByClassName(\"PAGROUPDIVIDER\")[0].textContent),\n\t\t\t nbr = \"0000\",\n\t\t\t comp = \"Unknown\",\n\t\t\t rows = slice(courseElem.querySelectorAll(\"tr[id*=CLASS_MTG_VW]\")),\n\t\t\t rowNum = 0;\n\n\t\t\trows.forEach(function (rowElem) {\n\t\t\t\tvar nbrElem = rowElem.querySelector(\"span[id^=DERIVED_CLS_DTL_CLASS_NBR]\"),\n\t\t\t\t compElem = rowElem.querySelector(\"span[id^=MTG_COMP]\"),\n\t\t\t\t sched = parseTimeRange(rowElem.querySelector(\"span[id^=MTG_SCHED]\").textContent),\n\t\t\t\t location = rowElem.querySelector(\"span[id^=MTG_LOC]\").textContent,\n\t\t\t\t dates = parseDateRange(rowElem.querySelector(\"span[id^=MTG_DATES]\").textContent);\n\n\t\t\t\t// These fields normally only appear once per course component\n\t\t\t\tif (nbrElem.textContent != \"\\u00a0\")\n\t\t\t\t\tnbr = nbrElem.textContent;\n\n\t\t\t\tif (compElem.textContent != \"\\u00a0\")\n\t\t\t\t\tcomp = compElem.textContent;\n\n\t\t\t\tvar first = snapFirstOccurence(dates, sched),\n\t\t\t\t except = [];\n\n\t\t\t\t// For each public holiday that occurs while the university is\n\t\t\t\t// open, check if a class can be snapped to that day and if so,\n\t\t\t\t// add its start time to the list of exceptions\n\t\t\t\tholidays.forEach(function(holiday) {\n\t\t\t\t\tvar times = snapToDay(dates, sched, holiday);\n\n\t\t\t\t\tif (times)\n\t\t\t\t\t\texcept.push(times.start);\n\t\t\t\t});\n\n\t\t\t\tclasses.push({\n\t\t\t\t\tuid: uid + \"::\" + nbr + \"::\" + rowNum,\n\t\t\t\t\tstart: first.start,\n\t\t\t\t\tend: first.end,\n\t\t\t\t\tuntil: dates.end,\n\t\t\t\t\tsummary: course.code + \" \" + comp,\n\t\t\t\t\tdescription: course.code + \" - \" + course.name,\n\t\t\t\t\tlocation: location,\n\t\t\t\t\texcept: except.length != 0 ? except : null,\n\t\t\t\t});\n\n\t\t\t\trowNum ++;\n\t\t\t});\n\t\t});\n\n\t\treturn classes;\n\t}", "getEnyoClassesNames() {\n var classNames = 'article__textarea article__textarea--html';\n switch (this.state.enyoCheck) {\n case 'OK':\n classNames += ' article__textarea--correct';\n break;\n case 'KO':\n classNames += ' article__textarea--wrong';\n break;\n default:\n classNames += ' article__textarea--idle';\n break;\n }\n return classNames;\n }", "cols() {\n return this.grid[0].length;\n }", "function getClassName(location) {\r\n\t// var cellClass = 'cell-' + location.i + '-' + location.j;\r\n\tvar cellClass = `cell-${location.i}-${location.j}`\r\n\treturn cellClass;\r\n}", "function populateGrid(grid) {\r\n // Remove all tokens\r\n $(\".cell\").removeClass(\"token_p1\");\r\n $(\".cell\").removeClass(\"token_p2\");\r\n\r\n // Reset the column counts\r\n colCount = [0, 0, 0, 0, 0, 0, 0];\r\n\r\n // Loop through the array\r\n for (let i = 0; i < 6; i++) {\r\n for (let j = 0; j < 7; j++) {\r\n // Place the appropriate tokens of the appropriate style\r\n if (grid[i][j] === 1) {\r\n colCount[j]++;\r\n $(\".cell[name=cell_\" + i + \"-\" + j + \"]\").addClass(\"token_p1\");\r\n }\r\n else if (grid[i][j] === 2) {\r\n colCount[j]++;\r\n $(\".cell[name=cell_\" + i + \"-\" + j + \"]\").addClass(\"token_p2\");\r\n }\r\n }\r\n }\r\n}", "function getStyleClasses( style ) {\n\t\tvar attrs = style.getDefinition().attributes,\n\t\t\tclasses = attrs && attrs[ 'class' ];\n\n\t\treturn classes ? classes.split( /\\s+/ ) : null;\n\t}", "function getClassName(location) {\r\n var cellClass = 'cell-' + location.i + '-' + location.j;\r\n return cellClass;\r\n}", "function drawGrid(array) {\n const numCols = array[0].length;\n const numRows = array.length;\n for (let row = 0; row < numRows; row++) {\n for (let col = 0; col < numCols; col++) {\n const tile = array[row][col];\n const element = cells[row][col];\n\n // ** can you figure our how to get rid of this switch? Maybe another enumeration, of the tile CSS classes? **\n switch (tile) {\n case worldTile.FLOOR:\n element.classList.add(\"floor\")\n break;\n\n case worldTile.WALL:\n element.classList.add(\"wall\");\n break;\n\n case worldTile.LOCKED:\n element.classList.add(\"locked\");\n break;\n\n case worldTile.END:\n element.classList.add(\"end\");\n break;\n\n case worldTile.GROUND:\n element.classList.add(\"ground\");\n break;\n }\n }\n }\n}", "function getGridSize() {\n\t\t\treturn\t((window.innerWidth || document.documentElement.clientWidth) < 480) ? 1 :\n\t\t\t\t\t((window.innerWidth || document.documentElement.clientWidth) > 479 && (window.innerWidth || document.documentElement.clientWidth) < 768) ? 2 :\n\t\t\t\t\t((window.innerWidth || document.documentElement.clientWidth) > 767 && (window.innerWidth || document.documentElement.clientWidth) < 980) ? 4 : 4;\n\t\t\t}", "function getClassName(location) {\r\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\r\n\treturn cellClass;\r\n}", "function getClassName(location) {\r\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\r\n\treturn cellClass;\r\n}", "function getClassName(location) {\r\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\r\n\treturn cellClass;\r\n}", "getClass() {\n return this._executeAfterInitialWait(() => this.currently.getAttribute('class'));\n }", "function getGridSize() {\n return (window.innerWidth < 320) ? 1 :\n (window.innerWidth < 600) ? 2 :\n (window.innerWidth < 800) ? 3 :\n (window.innerWidth < 900) ? 4 : 5;\n }", "get classes()\n {\n var instanciable = this.instanciable;\n if(!instanciable) return [_object];\n return instanciable.supClasses;\n }", "function getClassName(location) {\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\n\treturn cellClass;\n}", "function getClassName(location) {\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\n\treturn cellClass;\n}", "function getClassName(location) {\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\n\treturn cellClass;\n}", "function getClassName(location) {\n\tvar cellClass = 'cell-' + location.i + '-' + location.j;\n\treturn cellClass;\n}", "function getClassName(location) {\r\n var cellClass = \"cell-\" + location.i + \"-\" + location.j;\r\n return cellClass;\r\n}", "function getGridSize() {\n\t return (window.innerWidth < 600) ? 2 :\n\t\t (window.innerWidth < 800) ? 3 :\n\t\t (window.innerWidth < 900) ? 4 : 5;\n\t }", "function get_classes_array(classes) {\n\n var classesArray = [];\n\n // Clean\n classes = $.trim(classes);\n\n // Clean multispaces\n classes = classes.replace(/\\s\\s+/g, ' ');\n\n // Check if still there have another class\n if (classes.indexOf(\" \") != -1) {\n\n // Split with space\n $.each(classes.split(\" \"), function (i, v) {\n\n // Clean\n v = $.trim(v);\n\n // Push\n classesArray.push(v);\n\n });\n\n } else {\n\n // Push if single.\n classesArray.push(classes);\n\n }\n\n return classesArray;\n\n }", "function getGridSize() {\n return window.innerWidth < 600 ? 1 : window.innerWidth < 900 ? 2 : 3;\n }", "function checkBootstrap_col_class() {\n//BOOTSTRAP grid class widths\n/*\n.col-xs-*: none (auto)\n.col-sm-*: 750px\n.col-md-*: 970px\n.col-lg-*: 1170px */\n\n\tvar terminal_col_class = document.getElementById('terminal').getAttribute('class');\n\tterminal_col_class = terminal_col_class.substring(terminal_col_class.indexOf(\"col-\")+4,terminal_col_class.indexOf(\"col-\")+6);\n\n\tswitch(terminal_col_class) {\n\t\tcase 'xs':\n\t\t\t\t\tSCREEN_WIDTH_MEDIA_QUERY = 0;\n\t\t\t\t\tbreak;\n\t\tcase 'sm':\n\t\t\t\t\tSCREEN_WIDTH_MEDIA_QUERY = 750;\n\t\t\t\t\tbreak;\n\t\tcase 'md':\n\t\t\t\t\tSCREEN_WIDTH_MEDIA_QUERY = 970;\n\t\t\t\t\tbreak;\n\t\tcase 'lg':\n\t\t\t\t\tSCREEN_WIDTH_MEDIA_QUERY = 1170;\n\t\t\t\t\tbreak;\n\t\t};\n}", "function getPackhouses_getClasses(){\n for (var i = 0; i < currentData.Items.length; i++) {\n var currentItem = currentData.Items[i];\n\n var packhouse = currentItem.payload.Data.PackRun.Packhouse;\n if (packhouses.indexOf(packhouse) == -1){\n if (packhouse != null) {\n packhouses.push(packhouse);\n }\n }\n\n var fruitVariety = currentItem.payload.Data.PackRun.FruitVariety;\n if (commodities.indexOf(fruitVariety) == -1){\n commodities.push(fruitVariety);\n }\n }\n }", "getClassNames(){return this.__classNames}", "function className(name) {\n\treturn document.getElementsByClassName(name);\n}", "function effect_get_classes(element) {\n var str = $(element).attr('class');\n var stringArray = str.split(/(\\s+)/).filter( function(e) { return e.trim().length > 0; } );\n return stringArray;\n}", "function test_board() {\n var list = ['water','miss','hit','boat']\n for (var r=1;r<11;r++) {\n for (var c=1;c<11;c++) {\n var coord = 'you_c'+c+'r'+r\n var el = document.getElementById(coord)\n var num = (c*10+r)%list.length\n el.className = list[num]\n }\n }\n}", "function classes(data, yr_str, mn_int) {\n var newDataSet = []; \n\t\t\tvar classname ;\n\t\t\tvar peoNum ;\n\t\t\t// console.log(data); \n\t\t\tfor(var obj in data) { \n\n classname = getClassName(data[obj]['Class']);\n\n\t\t\t\tif(data[obj][yr_str][mn_int - 1] != -1) peoNum = data[obj][yr_str][mn_int - 1];\n\t\t\t\telse peoNum = 0;\n\n\t\t\t\tnewDataSet.push({className: classname, spotName: data[obj]['Scenic_Spots'], value: peoNum, Class: data[obj]['Class'], region: data[obj]['region'], Detail_Class: data[obj]['Detail_Class']});\n\t\t\t\t\n\t\t\t} \n\n\t\t\treturn {children: newDataSet}; \n}", "get gridMode() {\n return this.i.ni;\n }", "get mainClasses() {\n return classNames(super.mainClasses);\n }", "addObject(pos, classes) {\n this.grid[pos].classList.add(...classes);\n }", "function findPositionClass(classes) {\n return classes.find(name => /(x[1-4]y[1-4])/.test(name));\n}", "function getClassList(type) {\n\t\t\tvar classList = davinci.ve.metadata.queryDescriptor(type, 'class');\n\t\t\tif (classList) {\n\t\t\t\tclassList = classList.split(/\\s+/);\n\t\t\t\tclassList.push(type);\n\t\t\t\treturn classList;\n\t\t\t}\n\t\t\treturn [type];\n\t\t}", "function getGridPosition() {\n\tvar selectedUnit = document.getElementsByClassName(\"selected\");\n\tif (angular.isDefined(selectedUnit[0])) {\n\t\tvar rowIndex = selectedUnit[0]['className'].split(\" \")[2].substring(8);\n\t\tvar gridPos = rowIndex.split('-');\n\t\treturn gridPos;\n\t} else {\n\t\treturn false;\n\t}\n}", "_optionClasses() {\n //show/hide classes\n\n const show_ticks = this.ui.show_ticks;\n const show_value = this.ui.show_value;\n const show_value_when_drag_play = this.ui.show_value_when_drag_play;\n const axis_aligned = this.ui.axis_aligned;\n const show_play = (this.ui.show_button) && (this.model.time.playable);\n\n this.xAxis.labelerOptions({\n scaleType: \"time\",\n removeAllLabels: !show_ticks,\n limitMaxTickNumber: 3,\n showOuter: false,\n toolMargin: {\n left: 10,\n right: 10,\n top: 0,\n bottom: 30\n },\n fitIntoScale: \"optimistic\"\n });\n\n this.element.classed(class_hide_play, !show_play);\n this.element.classed(class_playing, this.model.time.playing);\n this.element.classed(class_show_value, show_value);\n this.element.classed(class_show_value_when_drag_play, show_value_when_drag_play);\n this.element.classed(class_axis_aligned, axis_aligned);\n }", "function byClass( className ){ return document.getElementsByClassName( className ); }", "function checkBoard() {\n const elements = Array.prototype.slice.call($('div .tac'));\n const tempArr = [];\n const board = [];\n\n elements.forEach((element) => {\n const temp = element.className.split(' ');\n tempArr.push(temp);\n });\n\n tempArr.forEach((tac) => {\n if (tac.length < 3) {\n board.push(0);\n } else {\n if (tac[3] === 'ex') {\n board.push(2);\n } else if (tac[3] === 'oh') {\n board.push(5);\n }\n }\n });\n return board;\n}", "function testGridColors()\n{\n let rows = document.querySelectorAll(\"#gameGrid tr td\");\n for (let i = 0; i < rows.length; i++)\n {\n if ( (2 ** (i + 1)) <= 2048)\n {\n rows[i].innerHTML = 2 ** (i + 1);\n rows[i].className = `num${2 ** (i + 1)}`;\n }\n }\n}", "async function getClasses () {\n try {\n console.log('nothing')\n } catch (error) {\n console.log(error)\n }\n }", "function elementComponentIdsFromClasses (element) {\n return (element.className || '').split(' ');\n }", "function getGrid() {\n\tconsole.log(\"Current rows are: \" + GRID.rows + \"\\nCurrent columns are: \" + GRID.columns);\n}", "function getClass(obj) {\n return obj.className.split(/\\s+/);\n}", "get classList() {\n if (!this.hasAttribute(\"class\")) {\n return new DOMTokenList(null, null);\n }\n const classes = this.getAttribute(\"class\", true)\n .filter((attr) => attr.isStatic)\n .map((attr) => attr.value)\n .join(\" \");\n return new DOMTokenList(classes, null);\n }", "function Layout(){\r\n for(let i=0;i<squares.length;i++)\r\n {\r\n let divs = document.createElement(\"div\")\r\n grid.appendChild(divs)\r\n square.push(divs)\r\n if(squares[i]===1) square[i].classList.add(\"wall\")\r\n else if(squares[i]===0) square[i].classList.add(\"pac-dots\")\r\n else if(squares[i]===3) square[i].classList.add(\"power-pellet\")\r\n else if(squares[i]===2) square[i].classList.add(\"ghost-liar\")\r\n }\r\n}", "function Grid(props) {\n var celled = props.celled,\n centered = props.centered,\n children = props.children,\n className = props.className,\n columns = props.columns,\n container = props.container,\n divided = props.divided,\n doubling = props.doubling,\n inverted = props.inverted,\n padded = props.padded,\n relaxed = props.relaxed,\n reversed = props.reversed,\n stackable = props.stackable,\n stretched = props.stretched,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('ui', Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(container, 'container'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(doubling, 'doubling'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(inverted, 'inverted'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(stackable, 'stackable'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(stretched, 'stretched'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOrValueAndKey\"])(celled, 'celled'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOrValueAndKey\"])(divided, 'divided'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOrValueAndKey\"])(padded, 'padded'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOrValueAndKey\"])(relaxed, 'relaxed'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useMultipleProp\"])(reversed, 'reversed'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useVerticalAlignProp\"])(verticalAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(columns, 'column', true), 'grid', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(Grid, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(Grid, 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 }), children);\n}", "function classify() {\n\n if (colorScheme == \"null\" && numberOfClasses == -1 && classScheme == \"Single\"){\n set_fill_single_color(\"counties\", fillColor);\n set_fill_single_color(\"dots\", fillColor);\n set_fill_single_color(\"bars\", fillColor);\n return;\n }\n\n classBreaks = get_class_breaks(classScheme, numberOfClasses, dataDomain);\n if (classBreaks) {\n console.log(\"Classifying data (\" + attribute + \") using \" + classScheme + \" with \" + numberOfClasses + \" class breaks\");\n classify_map();\n classify_dots();\n\n if(histoType ==\"area\"){\n set_histogram_divisions(1);\n draw_histogram(get_area_totals(), colorScheme);\n } else {\n draw_histogram(get_class_counts(), colorScheme);\n }\n\n print_class_breaks();\n }\n}", "function getGrid() {\n\tvar grid = new Array(4);\n\tgrid[0] = new Array(4);\n\tgrid[1] = new Array(4);\n\tgrid[2] = new Array(4);\n\tgrid[3] = new Array(4);\n\treturn grid;\n}", "function getClass(element) {\n return Array.from(element.classList);\n}", "function getUsedCssClassesInHandlebars() {\n const usedCssClasses = new Set;\n // search in Handlebars templates\n const files = findFiles.fileSync(/\\.hbs$/, './entries');\n files.forEach(filePath => {\n const fileContent = fs.readFileSync(filePath, 'utf8')\n // example of a used class in HTML code is `class=\"mb-16 text-blue-1\"` or `class='font-bold'`\n // Note: We cannot use capturing group because of `/g`\n const classAttribute = fileContent.match(/class\\s*=\\s*['|\"][^'|\"]+['|\"]/g) || []\n classAttribute\n // extract classes from from attribute (i.e. class=\"one two\" => \"one two\"\n .map(classAttribute => classAttribute.match(/class\\s*=\\s*['|\"]([^'|\"]+)['|\"]/)[1])\n .forEach(content => {\n // split classes\n const classes = content.match(/\\S+/g) || []\n classes\n // transform classes to Rust form\n .map(escapeClassName)\n // add class to set\n .forEach(class_ => usedCssClasses.add(class_))\n })\n })\n\n return usedCssClasses\n}", "getClass() {\n return this.getAttribute('class');\n }", "createGrids () {\n }", "function getColumnClass($column) {\n\t\t\tvar classNames = $column.attr('class').split(' ');\n\t\t\tvar selectedClass;\n\t\t\tvar defaultClass;\n\t\t\tvar classSuffix;\n\t\t\tvar i = classNames.length;\n\n\t\t\twhile (i--) {\n\t\t\t\tif (classNames[i].indexOf(currentBreakpoint) > -1) {\n\t\t\t\t\t// found one with current break point, time to stop\n\t\t\t\t\treturn classNames[i];\n\t\t\t\t} else if (classNames[i].indexOf('col-') > -1) {\n\t\t\t\t\t// doesn't have breakpoint, look for default class\n\t\t\t\t\tselectedClass = classNames[i];\n\t\t\t\t\tclassSuffix = classNames[i].slice(-2);\n\t\t\t\t\tif (!isNaN(parseInt(classSuffix, 10))) {\n\t\t\t\t\t\tdefaultClass = selectedClass;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof defaultClass !== 'undefined') {\n\t\t\t\tselectedClass = defaultClass;\n\t\t\t}\n\n\t\t\treturn selectedClass;\n\t\t}", "function getGridSize() {\n return (window.innerWidth < 600) ? 2 : (window.innerWidth < 900) ? 3 : 4;\n}", "function countColumns(){\n return GRID[0].length;\n}", "function getGrid() {\n return getCanvaPictureToArray()\n}", "generateCellClassNames(){Array.from(this.$.items.children).filter(row=>!row.hidden).forEach(row=>this._generateCellClassNames(row,this.__getRowModel(row)))}", "function getSpanGrid() {\n\tvar grid = new Array(4);\n\tgrid[0] = new Array(4);\n\tgrid[1] = new Array(4);\n\tgrid[2] = new Array(4);\n\tgrid[3] = new Array(4);\n\tvar n = 0;\n\tfor (var r = 0; r < 4 ; r++ ) {\n\t\tfor (var c = 0; c < 4 ; c++ ) {\n\t\t\tgrid[r][c] = $(\"#grid .cell\").eq(n).find(\"span\");\n\t\t\tn++;\n\t\t}\n\t}\n\treturn grid;\n}", "shape() {\n return [this.grid.length, this.grid[0].length];\n }", "function elementClass(name) {\n return document.getElementsByClassName(name);\n}", "function getGrid(pos) {\n\tlet childs = c.childNodes;\n\treturn childs[pos];\n}", "function fillGrid() {\n let grid = 9;\n\n let gridArr = [];\n for (let i = 0; i < grid; i++) {\n const newDiv = document.createElement(\"div\");\n newDiv.classList.add(\"gam-layout\");\n newDiv.setAttribute(\"id\", `${i}`);\n gridArr.push(newDiv);\n gridCont.appendChild(newDiv);\n }\n return gridArr;\n }", "function recorrerTablero(figura){\n let figuras = Array.from(document.querySelectorAll(\".figura\"));\n let result = [];\n for (let i = 0; i < figuras.length; i++){\n let listaClases = figuras[i].classList;\n if(listaClases.contains(figura)){\n result.push(i);\n }\n }\n return result;\n //arreglo con elementos\n //chequear si el elemento tiene la clase\n}", "function getGrid () {\n\tlet grid = new Array(3);\n\tfor (var i = 0; i < 3; i++)\n\t\tgrid[i]=new Array(3);\n\n\tfor (var i = 0; i < 3; i++) {\n\t\tfor (var j = 0; j < 3; j++) {\n\t\t\tlet divSector = $(\"#grid-\" + i + j + \"-id\");\n\t\t\tgrid[i][j] = divSector.text();\n\t\t}\n\t}\n\n\treturn grid;\n}", "getClass() {\n const { isEditorApplyClass, isEditorClosed, isEditorApplyMaxClass, isEditorMaxed } = this.props;\n let cls = 'editor';\n if ( isEditorApplyClass ) cls += ' scale0';\n if ( isEditorClosed ) cls += ' closed';\n if ( isEditorApplyMaxClass ) cls += ' maxClass';\n if ( isEditorMaxed ) cls += ' maxed';\n\n return cls;\n }", "getResultClassesNames() {\n var classNames = 'article__resultContainer';\n if (!this.state.showResult) {\n classNames += ' article__resultContainer--hidden';\n }\n return classNames;\n }", "function aanmaken_grid_layout() {\n var nummer = 0;\n var kolom__struct = '';\n var grid__struct = '';\n\n for (rij = 0; rij < grid_struct__obj.aantal_rijen; rij++) {\n kolom__struct = '';\n for (kolom = 0; kolom < grid_struct__obj.aantal_kolommen; kolom++) {\n nummer = nummer + 1\n kolom__struct += `<div class=\"grid_${nummer} grid_kolom ${ kolom ? 0 : 'grid_kolom_1' }\"></div>`;\n }\n grid__struct += `<div class=\"uk-child-width-expand@m\" style=\"margin-top:5px;\" uk-grid>${kolom__struct}</div>`;\n }\n return grid__struct; // geeft de grid structuur als resultaat terug\n }" ]
[ "0.6726289", "0.656211", "0.6380683", "0.6373211", "0.63535035", "0.6170914", "0.6142879", "0.60805404", "0.6044492", "0.6039013", "0.5991184", "0.59665126", "0.59512544", "0.5889567", "0.5839026", "0.5799785", "0.5792509", "0.5755829", "0.5738841", "0.5723032", "0.5712661", "0.57045126", "0.569883", "0.56975955", "0.56942385", "0.5665483", "0.5651623", "0.5642114", "0.56354904", "0.56354904", "0.56354904", "0.5631877", "0.56253517", "0.56215894", "0.561826", "0.5603355", "0.56025743", "0.55949956", "0.5594832", "0.5580591", "0.55600035", "0.555871", "0.555871", "0.555871", "0.55577934", "0.55486834", "0.55404025", "0.55311406", "0.55311406", "0.55311406", "0.55311406", "0.55293745", "0.55277556", "0.5525798", "0.5523905", "0.5487188", "0.5485619", "0.5472032", "0.5460461", "0.5457902", "0.5457524", "0.54546714", "0.54461414", "0.54333925", "0.54257137", "0.5397417", "0.53951997", "0.53945684", "0.5383612", "0.53781974", "0.53684324", "0.5355551", "0.53504634", "0.533568", "0.53280985", "0.5327397", "0.5309517", "0.5308917", "0.53086644", "0.5306872", "0.5294373", "0.5292442", "0.5292431", "0.5284363", "0.52752185", "0.5271994", "0.5270755", "0.5266697", "0.52631223", "0.5259198", "0.52572817", "0.5251556", "0.5243811", "0.52403605", "0.52353203", "0.5234809", "0.5232302", "0.5230118", "0.52278864", "0.5225011" ]
0.7735994
0
Render the map by removing borders
function renderMap() { for (let i = 0; i < gs; i++) { let grid = getGrid(i); if (getGridClass(i) != 'wall-grid') { grid.style.border = 'none'; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeBorders() {\n for (let i = 0; i < resultingMap.length; i++) {\n for (let j = 0; j < resultingMap[i].length; j++) {\n if (i <= 5 || j <= 5 || i + 5 >= resultingMap.length || j + 5 >= resultingMap[i].length) {\n resultingMap[i][j] = 1.5;\n continue;\n }\n }\n }\n }", "function drawMap(){\n\t\tvar height = gameArea.canvas.height();\n\t\tvar width = gameArea.canvas.width();\n\n var innerPaths = {\n strokeStyle : settings.wallColor,\n strokeWidth: settings.innerWallWidth,\n rounded : true,\n layer :true,\n name: 'map'\n };\n\n var borderPaths = {\n strokeStyle: settings.wallColor,\n strokeWidth: settings.outerWallWidth,\n rounded: true,\n layer: true,\n name: 'mapBorder'\n };\n \n var pathCount = 0;\n var borderPathCount = 0;\n \n for (var col = 0; col < settings.columns; col++) {\n for (var row = 0; row < settings.rows; row++) {\n \n var walls = gameMap.getTile([row, col]).getWalls();\n\n var y = row * (height / settings.rows);\n var x = col * (width / settings.columns);\n\n //north\n if (walls[0] && row !=0 ) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: xLineTo, y2: y\n };\n } else if (walls[0] && row == 0){\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: xLineTo, y2: y\n };\n }\n\n\n //east\n if (walls[1] && col != settings.columns-1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: xLineTo, y1: y,\n x2: xLineTo, y2: yLineTo\n };\n } else if (walls[1] && col == settings.columns - 1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: xLineTo, y1: y,\n x2: xLineTo, y2: yLineTo\n };\n }\n\n //south\n if (walls[2] && row != settings.rows-1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: x, y1: yLineTo,\n x2: xLineTo, y2: yLineTo\n };\n } else if (walls[2] && row == settings.rows - 1) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: x, y1: yLineTo,\n x2: xLineTo, y2: yLineTo\n };\n }\n\n //west\n if (walls[3] && col != 0) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n pathCount++;\n innerPaths[\"p\" + pathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: x, y2: yLineTo\n };\n\n } else if (walls[3] && col == 0) {\n var yLineTo = (y + height / settings.rows);\n var xLineTo = (x + width / settings.columns);\n\n borderPathCount++;\n borderPaths[\"p\" + borderPathCount] = {\n type: 'line',\n x1: x, y1: y,\n x2: x, y2: yLineTo\n };\n }\n \n }\n }\n\n gameArea.canvas.drawPath(innerPaths);\n gameArea.canvas.drawPath(borderPaths);\n\t}", "function drawAreaBorder() {\n if (visible) {\n ctx.beginPath();\n ctx.lineWidth = 1;\n ctx.strokeStyle = colors.grid;\n ctx.moveTo(x(mapBorder.left), y(mapBorder.bottom));\n ctx.lineTo(x(mapBorder.left), y(mapBorder.top));\n ctx.lineTo(x(mapBorder.right), y(mapBorder.top));\n ctx.lineTo(x(mapBorder.right), y(mapBorder.bottom));\n ctx.lineTo(x(mapBorder.left), y(mapBorder.bottom));\n ctx.stroke();\n }\n }", "visibleMapDisplay() {\n vtx.fillStyle = \"pink\";\n vtx.beginPath();\n vtx.lineWidth = 5;\n vtx.moveTo(this.borders[0],this.borders[1]);\n\n for (var i = 2; i < (this.borders.length); i += 2){\n vtx.lineTo(this.borders[i],this.borders[i+1]);\n }\n\n vtx.lineTo(this.borders[0],this.borders[1]);\n vtx.strokeStyle = \"blue\";\n vtx.stroke();\n vtx.fill();\n }", "function CleanMap() {\n\tRemoveMarkers();\n\tRemovePolylines();\n}", "function createMap() {\n\tctx.fillStyle = 'black';\n\n // Create top and bottom borders.\n for (i = 0; i < width; i += side) {\n ctx.fillRect(i, 0, side, side);\n ctx.fillRect(i, height - side, side, side);\n }\n\n // Create left and right borders.\n for (i = 0; i < height; i += side) {\n ctx.fillRect(0, i, side, side);\n ctx.fillRect(width - side, i, side, side);\n }\n}", "function draw_all_maps() {\n\n\t// deep copy all classification of mapA to all classification of map0\n\tapp.map0classification = $.extend(true, {}, app.mapAclassification);\n\t//console.log('app.map0classification:', app.map0classification)\n\t\n\tvar cc = app.map0classification.color + app.map0classification.count\n\tapp.colorGradient0 = COLOR_CLASS[cc].slice(0, COLOR_CLASS[cc].length); // deep copy\n\n\t// draw titles area\n\tvar map_html = '';\n\tmap_html += '<div>';\n\tmap_html += '\t<div class=\"map_layer\" style=\"height:25px;float:right\" hidden></div>';\n\tmap_html += '\t<div class=\"map_year\" style=\"margin:0px 30px 0px 0px; height:25px;float:both\"></div>';\n\tmap_html += '</div>';\n\tmap_html += '<div>';\n\tmap_html += '\t<div class=\"map_metroInterval\" style=\"height:25px;float:left;clear:both\"></div>';\n\tmap_html += '\t<div class=\"map_sync\" style=\"height:25px;float:right\"></div>';\n\tmap_html += '</div>';\n\tmap_html += '<div class=\"map\"></div>';\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tdocument.getElementById(mapN).innerHTML = map_html;\n\t}\n\t\n\tvar map_html = '';\n\tmap_html += '<div>';\n\tmap_html += '\t<div class=\"map_year\" style=\"margin:0px 100px 0px 0px; height:25px;float:left;\"></div>';\n\tmap_html += '\t<div class=\"map_nPolygon\" style=\"margin:0px 100px 0px 0px; height:25px;float:left;\"></div>';\n\tmap_html += '\t<div class=\"map_fixAxes\" style=\"height:25px;float:left;\"></div>';\n\tmap_html += '</div>';\n\tmap_html += '<br><br>';\n\tmap_html += '<div id=\"_density_chart\" class=\"chart densityPeriod\"></div>';\n\tfor (var i=0; i<app.d; i++) {\n\t\tvar mapD = \"mapD\" + i;\n\t\tvar html = map_html.replace('_density_chart', mapD+'_density_chart');\n\t\tif (app.dYears[i].startsWith('INC')) \n\t\t\thtml = html.replace('class=\"chart densityPeriod\"', 'class=\"chart densityINC\"');\n\t\tdocument.getElementById(mapD).innerHTML = html;\n\t\tif (app.MapWidth.replace('px','') < 500) $(\"#\"+mapD+\" .map_nPolygon\").hide();\n\t}\n\t\n\tif (app.Distribution_INC2_different_cluster) {\n\t\tvar map_html = '';\n\t\tmap_html += '<div>';\n\t\tmap_html += '\t<div class=\"map_year\" style=\"margin:0px 100px 0px 0px; height:25px;float:left;\"></div>';\n\t\tmap_html += '\t<div class=\"map_nPolygon\" style=\"margin:0px 100px 0px 0px; height:25px;float:left;\"></div>';\n\t\tmap_html += '\t<div class=\"map_fixAxes\" style=\"height:25px;float:left;\"></div>';\n\t\tmap_html += '</div>';\n\t\tmap_html += '<br><br>';\n\t\tmap_html += '<div id=\"_density_chart\" class=\"chart densityCluster\"></div>';\n\t\tfor (var i=0; i<app.nClusters; i++) {\n\t\t\tvar graphC = \"graphC\" + i;\n\t\t\tdocument.getElementById(graphC).innerHTML = map_html.replace('_density_chart', graphC+'_density_chart');\n\t\t\tif (app.MapWidth.replace('px','') < 500) $(\"#\"+graphC+\" .map_nPolygon\").hide();\n\t\t}\n\t}\n\t\n\t// change height and width for maps and stacked area chart\n\t$(\"#mapContainer\").css(\"height\", app.MapHeight.replace('px','')*1+100+'px');\n\t$(\".mapArea\").css(\"width\", app.MapWidth);\n\t$(\".mapAreaLast\").css(\"width\", app.ChartWidth);\n\t$(\".map\").css(\"width\", app.MapWidth);\n\t$(\".map\").css(\"height\", app.MapHeight);\n\t$(\".chart\").css(\"width\", app.MapWidth.replace('px','')*1-10+'px');\n\t$(\".chart\").css(\"height\", app.MapHeight.replace('px','')*1-10+'px');\n\t\n\t// draw each base map\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tdraw_basemap(mapN);\n\t}\n\n\t// draw titles of each map\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tdraw_titlemap(mapN, app.mYears[i]);\n\t}\n\t\n\t// draw titles of each density chart\n\tfor (var i=0; i<app.d; i++) {\n\t\tvar mapN = \"mapD\" + i;\n\t\tdraw_titleChart(mapN, app.dYears[i]);\n\t}\n\t\n\t// draw titles of each graph of clusters\n\tfor (var i=0; i<app.nClusters; i++) {\n\t\tvar graphC = \"graphC\" + i;\n\t\tdraw_titleGraphC(graphC, app.gYears[0]);\n\t}\n\t\n\tdraw_globalSelection();\n\n\t// initialize all bounds in app.mapN\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t\tapp[mapN].bounds = app[mapN].map.getBounds();\n\t\t//console.log(getNow(), mapN, 'app.'+mapN+'.bounds: ', app[mapN].bounds);\n\t}\n\t\n\t// set map bounds using geo bounds in d3 function\n\tvar geoBounds = d3.geoBounds(CA);\n\t\n\tvar fitBounds = L.latLngBounds(L.latLng(geoBounds[0][1], geoBounds[0][0]), \n\t\t\t\t\t\t\t\t L.latLng(geoBounds[1][1], geoBounds[1][0]));\n\t//console.log('fitBounds:', fitBounds);\n\tif (app.m > 0 && app.InitialMapCenter != null && app.InitialMapZoomLevel != null) {\n\t\n\t\t// set bitBounds from InitialMapCenter and InitialMapZoomLevel\n\t\tfitBounds = app[mapN].bounds;\n\t\tvar mapBounds = app[mapN].map.getBounds();\n\t\tvar west = mapBounds.getWest();\n\t\tvar south = mapBounds.getSouth();\n\t\tvar east = mapBounds.getEast();\n\t\tvar north = mapBounds.getNorth();\n\t\tvar featureMapBounds = {type: \"Feature\", properties: {}, geometry: {type: \"Polygon\", coordinates: [\n\t\t\t[ [west, south], [east, south], [east, north], [west, north], [west, south] ] \n\t\t]}}\n\n\t\t// build selectedGeoJSON from receivedGeoJSON\n\t\tvar count = 0, edgeCount = 0;\n\t\tvar started = moment(new Date());\n\t\tvar selectedFeatures = [];\n\t\tvar count = 0;\n\t\tvar baseLines = lineify(featureMapBounds);\n\t\t\n\t\t$.each(app.receivedGeoJSON.features, function(rIdx, feature) {\n\t\t\tif (isPolygonInMapBounds(feature, baseLines, west, south, east, north)) {\n\t\t\t\tcount += 1;\n\t\t\t\tselectedFeatures.push([feature.properties[app.geokey], rIdx]);\n\t\t\t}\n\t\t});\n\t\tvar duration = moment.duration(moment(new Date()).diff(started));\n\t\t\n\t\t// build selectedGeoJSON and set it to CA\n\t\tapp.selectedGeoJSON = {\"type\":\"FeatureCollection\", \"features\":[]};\n\t\t$.each(selectedFeatures, function(rIdx, feature) {\n\t\t\t// feature[0] -> tractid, feature[1] -> rIdx\n\t\t\tapp.selectedGeoJSON.features.push(app.receivedGeoJSON.features[feature[1]]);\n\t\t});\n\t\tCA = app.selectedGeoJSON;\n\t\tselectedFeatures = null;\n\t\tapp.selectedBounds = mapBounds;\n\t}\n\t\n\t// fitBounds and redraw maps\n\tsetTimeout(function () {\n\t\t// fitBounds\n\t\tvar started = moment(new Date());\n\t\tvar watchfitbounds = [];\n\t\tfor (var i=0; i<app.m; i++) watchfitbounds.push(false);\n\t\tfor (var i=0; i<app.m; i++) {\n\t\t\tvar mapN = \"map\" + i;\n\t\t\tvar alreadyFitted = false;\n\t\t\tif (boundsEqual(app[mapN].map.getBounds(), fitBounds)) alreadyFitted = true;\n\t\t\telse app[mapN].map.fitBounds(fitBounds);\n\n\t\t\twatchfitbounds[i] = setInterval(function(i, mapN) {\n\t\t\t\tvar duration = moment.duration(moment(new Date()).diff(started));\n\t\t\t\tvar nowBounds = app[mapN].map.getBounds();\n\t\t\t\t//console.log(getNow(), mapN, mapN+'.bounds:', app[mapN].bounds);\n\t\t\t\t//console.log(getNow(), mapN, 'nowBounds:', nowBounds, duration / 1000);\n\t\t\t\tif (alreadyFitted || !boundsEqual(app[mapN].bounds, nowBounds)) {\n\t\t\t\t\t//console.log(getNow(), mapN, 'after fitBounds: ', nowBounds, 'duration:', duration/1000);\n\t\t\t\t\tclearInterval(watchfitbounds[i]);\n\t\t\t\t\twatchfitbounds[i] = false;\n\t\t\t\t\tapp[mapN].bounds = nowBounds;\n\t\t\t\t}\n\t\t\t\tif (duration > 10000) { // 10000 = 10 sec\n\t\t\t\t\t//console.log(getNow(), mapN, 'ffit fitBounds incompleted: ', nowBounds, 'duration:', duration/1000);\n\t\t\t\t\tclearInterval(watchfitbounds[i]);\n\t\t\t\t\twatchfitbounds[i] = false;\n\t\t\t\t}\n\t\t\t\tif (!watchfitbounds.reduce(function(x, y) {return x || y;})) {\n\t\t\t\t\t//console.log(getNow(), mapN, 'ALL fit fitBounds completed: ', nowBounds, 'duration:', duration/1000);\n\t\t\t\t\tupdateGloballyButton();\n\t\t\t\t\tapp.selectedBounds = nowBounds;\n\t\t\t\t\tsetTimeout(function() { mapOn_contextmenu_set(); }, 100);\n\t\t\t\t\tsetTimeout(function() { mapOn_movestart_set(); }, 200);\n\t\t\t\t\tsetTimeout(function() { mapOn_moveend_set(); }, 500);\n\t\t\t\t}\n\t\t\t}, 100, i, mapN);\n\t\t}\n\t\t\n\t\t// redraw maps\n\t\tfor (var i=0; i<app.m; i++) {\n\t\t\tvar mapN = \"map\" + i;\n\t\t\tdrawAmap(mapN, 3);\n\t\t}\n\t\t\n\t\t// redraw charts\n\t\tfor (var i=0; i<app.d; i++) {\n\t\t\tvar mapN = \"map\" + i;\n\t\t\tdrawAchart(mapN);\n\t\t}\n\t\t\n\t\t// parint density chart of the graph of Clusters\n\t\tfor (var i=0; i<app.nClusters; i++) {\n\t\t\tvar graphC = \"graphC\" + i;\n\t\t\tvar year = $(\"#\"+graphC+\" select[name=yearSelectGraphC]\").val();\n\t\t\tpaintDensityGraphC(graphC, year, i);\n\t\t}\n\t\t\n\t}, 100);\n}", "function render() {\n debugMap(map, 10, 20);\n }", "function resetMap() {\n clearMap();\n removePolygon();\n }", "function clearMapTileLayers() {\r\n stopFlicker(); // stop the flickering and reset the button if we change sections - do it regardless - should check to see if it was the previous open or actively flickering\r\n if (drawControl === 1) {\r\n map.removeControl(drawControl);\r\n }\r\n}", "removeLayer() {\n if (this.__shown) {\n const map = this.map;\n map.removeLayer(this.uniqueId + 'fillpoly');\n this.__shown = false;\n }\n }", "function clearMap() {\n populationApp.map.graphics.clear();\n\n displayOutput(i18n.t(that.ns + \":na\"));\n }", "clearobjectmap() {\n\n if (this.internal.objectmap===null)\n return;\n \n this.deleteoldobjectmap();\n this.informToRender();\n this.internal.cmapcontroller.removeobjectmap();\n this.internal.objectmaptransferinfo={ showcolorbar : false, 'colormode' : 'Objectmap' };\n this.drawtext();\n this.updateImageChangedObservers('overlay');\n this.needsrendering=true;\n }", "function redraw() {\n width = document.getElementById('container_map').offsetWidth;\n height = width / 2;\n d3.select('svg').remove();\n setup(width,height);\n draw(topo);\n}", "function clearMap(ctx) {\n ctx.clearRect(0-(canvas_width/2), 0-(canvas_height/2), canvas.width, canvas.height);\n }", "renderMap() {\n $('#gameMap').append('<table></table>');\n for (let j = ((this.width - 1) / 2); j >= (-(this.width - 1) / 2); j--) {\n $('table').append('<tr></tr>');\n for (let i = (-(this.height - 1) / 2); i <= ((this.height - 1) / 2); i++) {\n $('tr:last').append('<td data-x=\"' + i + '\" data-y=\"' + j +\n '\" class=\"floorClass\"></td>');\n }\n }\n }", "function _mapZoomed() {\n _setAllIcons();\n}", "function clearFilter(map) {\n console.log(\"Clearing\");\n map.eachLayer(function(layer) {\n if (layer.feature) {\n layer.getElement().style.display = 'inline';\n };\n });\n}", "function hidePolygon() {\n alertPolygon.setMap(null);\n }", "clearDrawing() {\n this.state.overlay.setMap(null);\n this.setState({ 'overlay': null, 'type': '' });\n this.clearMarkers();\n this.changeMap();\n }", "function emptyMap() {\n $('#map').empty();\n }", "function ClearMap() {\n\n //Clear any lines that are drawn on the map\n if (map.getLayer(\"route\") != undefined) {\n map.removeLayer(\"route\");\n }\n if (map.getSource(\"route\") != undefined) {\n map.removeSource(\"route\");\n }\n\n //Delete any markers and info boxes\n DeleteElement('marker');\n DeleteElement('infobox');\n\n //Disable the top controls and enable the line selection menu\n DisableElement('nav');\n EnableElement('selection');\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}", "removeLayer() {\n if (this.__shown) {\n const map = this.map;\n map.removeLayer(this.uniqueId);\n map.removeLayer(this.uniqueId + 'label');\n map.removeLayer(this.uniqueId + 'citylabel');\n map.removeLayer(this.uniqueId + 'citylabelun');\n this.__shown = false;\n }\n }", "function clearMap() {\n group.clearLayers();\n }", "function InvalidateMapSize() {\n map.invalidateSize();\n }", "function clearCanvas() {\r\n\t\tvar ctx = $['mapsettings'].ctx;\r\n\t\tvar left = parseInt($('#inner').css('left'));\r\n\t\tvar top = parseInt($('#inner').css('top'));\r\n\t\tvar offsetLeft = 0;\r\n\t\tvar offsetTop = 0;\r\n\t\tif(left < 0) offsetLeft = -left;\r\n\t\tif(top < 0) offsetTop = -top;\t \r\n\t\tctx.clearRect(offsetLeft/$['mapsettings'].scale.x, offsetTop/$['mapsettings'].scale.y, ($['mapsettings'].element.width() - left)/$['mapsettings'].scale.x, ($['mapsettings'].element.height() - top)/$['mapsettings'].scale.y);\r\n\t}", "function _draw() {\n _map.baseLayer.container.appendChild(_self.container);\n _redraw();\n }", "function countryBorders(){\n // Define layer to map\n var layer = ui.Map.Layer({\n eeObject: country_borders.style(s.countryborders),\n visParams: {},\n name: 'Country Borders',\n opacity: 0.5\n });\n // Add layer to map\n c.map.layers().set(2, layer); // Define nth layer\n}", "drawMap(){\n\t\tthis.blocks.forEach(function (e) {\n\t\t\te.draw();\n\t\t});\n\t}", "function reset() {\r\n var bounds = path.bounds(mapData),\r\n topLeft = bounds[0],\r\n bottomRight = bounds[1];\r\n console.log(bounds)\r\n svg .attr(\"width\", bottomRight[0] - topLeft[0])\r\n .attr(\"height\", bottomRight[1] - topLeft[1])\r\n .style(\"left\", topLeft[0] + \"px\")\r\n .style(\"top\", topLeft[1] + \"px\");\r\n\r\n g .attr(\"transform\", \"translate(\" + -topLeft[0] + \",\" + -topLeft[1] + \")\");\r\n\r\n park.attr(\"d\", path);\r\n }", "function reset() {\n\t \t\t\n\t \t \tvar bottomLeft = project(bounds[0]),\n\t \ttopRight = project(bounds[1]);\n\t\t svg .attr(\"width\", topRight[0] - bottomLeft[0])\n\t\t .attr(\"height\", bottomLeft[1] - topRight[1])\n\t\t .style(\"margin-left\", bottomLeft[0] + \"px\")\n\t\t .style(\"margin-top\", topRight[1] + \"px\");\n\t\t g .attr(\"transform\", \"translate(\" + -bottomLeft[0] + \",\" + -topRight[1] + \")\");\n\t\t feature.attr(\"d\", path);\n\t\t //redraw the pins due to zoom level\n\t\t\t\tg.selectAll(\".gully-map-points\")\n\t\t \t\t.attr(\"cx\", function(d) {\n\t\t\t\t\t\t\t\t\t\treturn project([d[\"ln\"], d[\"la\"]])[0];\n\t\t\t\t\t })\n\t\t\t\t\t .attr(\"cy\", function(d) {\n\t\t\t\t\t return project([d[\"ln\"], d[\"la\"]])[1];\n\t\t\t\t\t });\n\t\t\t\tg.selectAll(\".boundary\")\n\t\t \t\t.attr(\"cx\", function(d) {\n\t\t\t\t\t\treturn project([d[\"region_lng\"], d[\"region_lat\"]])[0];\n\t\t\t\t\t})\n\t\t\t\t\t.attr(\"cy\", function(d) {\n\t\t\t\t\t return project([d[\"region_lng\"], d[\"region_lat\"]])[1];\n\t\t\t\t\t});\n\t\t\tnw = map.getBounds().getNorthWest()\n\t\t\tse=map.getBounds().getSouthEast();\t\t \n\t \t}", "function setMapBorder(hasBorder) {\n\t\tif (!eval(hasBorder)) {\n\t\t\tthis.borderColor = \"#ffffff\";\n\t\t}\n\t\tif (this.hasExtendedInformation) {\n\t\t\tthis.minimap.setBorder(hasBorder);\n\t\t}\n\t}", "function reset() {\n if (mapLoaded)\n {\n var bounds = path.bounds(mapCollection),\n topLeft = bounds[0],\n bottomRight = bounds[1];\n\n // console.log(bounds)\n\n mapCanvas .attr(\"width\", bottomRight[0] - topLeft[0])\n .attr(\"height\", bottomRight[1] - topLeft[1])\n .style(\"left\", topLeft[0] + \"px\")\n .style(\"top\", topLeft[1] + \"px\");\n\n mapsvg.attr(\"transform\", \"translate(\" + -topLeft[0] + \",\" + -topLeft[1] + \")\");\n\n\n mapFeatures.attr(\"d\", path);//.on(\"click\", clicked);\n }\n}", "function clearPolylines() {\n\tfor(var i=0 ; i< polylines.length; i++ ) {\n\t\tpolylines[i].setMap(null);\n\t}\n\tpolylines = [];\n}", "function render_map( $el ) {\n \n // vars\n var mapStyles = [\n {\n \"featureType\": \"administrative.locality\",\n \"stylers\": [\n { \"visibility\": \"on\" }\n ]\n },{\n \"featureType\": \"administrative.neighborhood\",\n \"stylers\": [\n { \"visibility\": \"on\" }\n ]\n },{\n \"featureType\": \"road\",\n \"stylers\": [\n { \"visibility\": \"simplified\" }\n ]\n },{\n \"featureType\": \"transit\",\n \"stylers\": [\n { \"visibility\": \"off\" }\n ]\n },{\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n { \"visibility\": \"on\" }\n ]\n },{\n \"featureType\": \"road.arterial\",\n \"stylers\": [\n { \"visibility\": \"on\" }\n ]\n },{\n \"featureType\": \"road.local\",\n \"stylers\": [\n { \"visibility\": \"simplified\" }\n ]\n },{\n \"featureType\": \"water\",\n \"elementType\": \"labels\",\n \"stylers\": [\n { \"visibility\": \"off\" }\n ]\n },{\n \"featureType\": \"poi\",\n \"stylers\": [\n { \"visibility\": \"on\" }\n ]\n },{\n \"featureType\": \"poi.business\",\n \"stylers\": [\n { \"visibility\": \"off\" }\n ]\n },{\n \"featureType\": \"administrative.neighborhood\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n { \"color\": \"#da8080\" },\n { \"visibility\": \"on\" }\n ]\n }];\n \n var args = {\n zoom : ( $el.data( 'map-zoom_level' ) - 2 ),\n center : new google.maps.LatLng( $el.data( 'map-lat' ), $el.data( 'map-lng' ) ),\n mapTypeId : google.maps.MapTypeId.ROADMAP,\n disableDefaultUI: false\n };\n \n // create map\n var map = new google.maps.Map( $el[0], args);\n \n map.data.loadGeoJson('/wp-content/themes/scout-realty/assets/js/vendor/neighborhoods/neighborhoods.' + $el.data( 'map-neighborhood' ) + '.geojson');\n \n map.setOptions( { styles: mapStyles });\n \n var featureStyle = {\n fillColor: '#FF4338',\n strokeWeight: 0\n }\n map.data.setStyle(featureStyle);\n \n \n // center map\n //zoom( map );\n \n}", "function setMapBorders() {\r\n\r\n\r\n if(mapCanvas.y > (0.5+6) * tileSize){\r\n forceStop();\r\n }\r\n\r\n if(mapCanvas.y + activeMapH < playerCanvas.y + player.height + 1 * tileSize){\r\n forceStop();\r\n }else if (mapCanvas.y + activeMapH < playerCanvas.y + player.height + 3 * tileSize ) {\r\n mapAlpha = 0;\r\n }else{\r\n mapAlpha = 1;\r\n }\r\n\r\n if(mapCanvas.x > playerCanvas.x - 1 * tileSize){\r\n forceStop();\r\n }\r\n if(mapCanvas.x + activeMapW - 2 * tileSize < playerCanvas.x ){\r\n forceStop();\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n //objectCollide\r\n\r\n if( currentRoom == 'pq' && terminalState == false){\r\n if(newCollideDetect(pqTerminal)){\r\n forceStop();\r\n }else if (newCollideDetect(pqBed)){\r\n forceStop();\r\n }\r\n if (newTripDetect(pqTerminal)) {\r\n terminalPage = 'terminal';\r\n\r\n }else if (newTripDetect(pqBed)) {\r\n terminalPage = 'playerBed';\r\n\r\n }else {\r\n terminalPage = 'initial';\r\n }\r\n\r\n\r\n\r\n\r\n if(newCollideDetect(pqElevCc)){\r\n currentRoom = 'elev01';\r\n roomDisplace = [-7.6,-5];\r\n orientCameraLayers();\r\n }\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n else if( currentRoom == 'cc' && terminalState == false){\r\n\r\n if(newCollideDetect(ccTerminal)){\r\n forceStop();\r\n }\r\n if(newTripDetect(ccTerminal)){\r\n terminalPage = 'terminal';\r\n }else {\r\n terminalPage = 'initial';\r\n }\r\n\r\n\r\n if(newCollideDetect(commandTable)){\r\n forceStop();\r\n }if(newTripDetect(commandTable)){\r\n terminalPage = 'commandTable';\r\n }\r\n\r\n\r\n\r\n if(newCollideDetect(ccDoorElev01)){\r\n currentRoom = 'elev01';\r\n roomDisplace = [-4.5,-2];\r\n orientCameraLayers();\r\n }\r\n }\r\n\r\n\r\n\r\n if( currentRoom == 'gate' && terminalState == false){\r\n if(newCollideDetect(gateDoorElev00)){\r\n currentRoom = 'elev00';\r\n roomDisplace = [-4.5,-2];\r\n orientCameraLayers();\r\n }\r\n\r\n if(newCollideDetect(gate)){\r\n terminalPage = 'gate';\r\n }else {\r\n terminalPage = 'initial';\r\n }\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n if( currentRoom == 'elev00' && terminalState == false){\r\n\r\n if(newCollideDetect(elev00DoorGate)){\r\n currentRoom = 'gate';\r\n roomDisplace = [-4.5,-13];\r\n orientCameraLayers();\r\n }\r\n\r\n\r\n if(newCollideDetect(elev01Elev00)){\r\n terminalPage = '00Elev01';\r\n }else {\r\n terminalPage = 'initial';\r\n }\r\n }\r\n\r\n\r\n\r\n\r\n if( currentRoom == 'elev01' && terminalState == false){\r\n\r\n if(newCollideDetect(elev01DoorPq)){\r\n currentRoom = 'pq';\r\n roomDisplace = [-1,-5];\r\n orientCameraLayers();\r\n }\r\n\r\n if(newCollideDetect(elev01DoorCc)){\r\n currentRoom = 'cc';\r\n roomDisplace = [-5.5,-9];\r\n orientCameraLayers();\r\n }\r\n\r\n\r\n if(newCollideDetect(elev01Elev00)){\r\n terminalPage = '01Elev00';\r\n }else {\r\n terminalPage = 'initial';\r\n }\r\n }\r\n}", "function FrameBorderCleaner() {\n push();\n translate(innerWidth/2, innerHeight/2);\n noFill();\n stroke(30);\n strokeWeight(200);\n rect(-405, -405, 810, 810);\n pop();\n}", "function drawMap() {\n //Draw background tiles\n image(imgBackground, 0, 0, windowWidth, (windowWidth * 0.5));\n //Set tile size based on window size\n let tileSize = windowWidth / 20;\n // set grid dimensions based on tilesize\n let gridWidth = tileSize;\n let gridHeight = tileSize;\n // Draw vertical lines\n for (let i = 0; gridWidth < width; i++) {\n line(gridWidth, 0, gridWidth, height);\n gridWidth += tileSize;\n }\n // draw horizontal lines\n for (let i = 0; gridHeight < height; i++) {\n line(0, gridHeight, width, gridHeight);\n gridHeight += tileSize;\n }\n}", "function mapReset() {\n\tinfoWindow.map ? reposInfoWindow() : map.fitBounds(bounds);\n}", "function clearMapDiv(){\n $('#map').empty();\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 initMap() {\n var brisbane = new google.maps.LatLng(-27.496404, 153.013416);\n\n map = new google.maps.Map(document.getElementById('map'), {\n center: brisbane,\n zoom: 15,\n disableDefaultUI: true,\n maxZoom: 16,\n minZoom: 13,\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#e8e5dc\"\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#bdbdbd\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#dadada\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#c9c9c9\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n }\n]\n });\n\n //an event which is necessary in another function to let it instantiate some stuff which uses Google.\n googleReady();\n\n //This function creates all of the markers and geofences on the map.\n prepareMarkersAndFences();\n\n //Grab list of venues from db and add them to local global venue storage. This array can be found in the venueManager.js file.\n if (!isLocal) {\n getVenues();\n //AT THIS POINT ALL OF THE VENUES AND ALL OF THEIR INFORMATION WILL BE STORED IN THE 'VENUES' ARRAY\n // console.log(\"LOADED THE FOLLOWING VENUES AT THE END OF initMap() in MAP.JS\")\n // console.log(venues);\n }\n}", "function hideAllPairesRender()\n {\n for (var i=0; i<renderItineraireArray.length; i++)\n {\n renderItineraireArray[i].setMap(null);\n polylineForHoverItineraireArray[i].setMap(null);\n }\n }", "function initMap() {\n\t var map = new google.maps.Map(document.getElementById('map'), {\n\t zoom: mapZoom,\n\t center: clientMapCenter,\n\t styles: [\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#f5f5f5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"labels.icon\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"visibility\": \"off\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#616161\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"elementType\": \"labels.text.stroke\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#f5f5f5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"administrative.land_parcel\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#bdbdbd\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#eeeeee\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#757575\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#e5e5e5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"geometry.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#b9f1c1\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"poi.park\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#688c6d\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#ffffff\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.arterial\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#757575\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#dadada\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.highway\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#616161\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"road.local\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#9e9e9e\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"transit.line\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#e5e5e5\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"transit.station\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#eeeeee\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"geometry\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#c9c9c9\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"geometry.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#70d2f0\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t \"featureType\": \"water\",\n\t\t\t\t \"elementType\": \"labels.text.fill\",\n\t\t\t\t \"stylers\": [\n\t\t\t\t {\n\t\t\t\t \"color\": \"#9e9e9e\"\n\t\t\t\t }\n\t\t\t\t ]\n\t\t\t\t }\n\t\t\t\t]\n\t });\n\n\t var myLocation = new google.maps.Marker({\n\t\t\t position: map.getCenter(),\n\t\t\t icon: {\n\t\t\t path: google.maps.SymbolPath.CIRCLE,\n\t\t\t scale: 5,\n\t\t\t strokeColor: '#00a2d0'\n\t\t\t },\n\t\t\t draggable: true,\n\t\t\t map: map,\n\t\t\t title: 'You are here!',\n\t\t\t });\n\n\n\n\t // var infoWindow = new google.maps.InfoWindow({map: map});\n\n\t // // Try HTML5 geolocation.\n\t // if (navigator.geolocation) {\n\t // navigator.geolocation.getCurrentPosition(function(position) {\n\t // var pos = {\n\t // lat: position.coords.latitude,\n\t // lng: position.coords.longitude\n\t // };\n\n\t // infoWindow.setPosition(pos);\n\t // infoWindow.setContent('You');\n\t // map.setCenter(pos);\n\t // }, function() {\n\t // handleLocationError(true, infoWindow, map.getCenter());\n\t // });\n\t // } else {\n\t // // Browser doesn't support Geolocation\n\t // handleLocationError(false, infoWindow, map.getCenter());\n\t // }\n\n \tvar marker;\n\n \tvar infoWindow = new google.maps.InfoWindow({\n\t\t \tcontent: ''\n\t\t });\n\n\t \n\t clientResults.forEach(function(recyclingHotSpot){\n\t \tmarker = new google.maps.Marker({\n\t\t position: {\n\t\t \tlat: parseFloat(recyclingHotSpot.latitude), \n\t\t \tlng: parseFloat(recyclingHotSpot.longitude)\n\t\t },\n\t\t map: map,\n\t\t title: recyclingHotSpot.name,\n\t\t icon: 'http://127.0.0.1:8081/images/marker.png',\n\t\t clickable: true,\n\t\t\n\t\t });\n\n\t\t marker.addListener('click', function(){\n\t\t \tinfoWindow.close();\n\t\t \tinfoWindow.setContent(recyclingHotSpot.address);\n\t\t \tinfoWindow.open(map, this);\n\t\t \t\n\t\t });\t\n\t });\n\t }", "function mapWidgetResetMap() {\n\n mapWidgetClearMap();\n\n // Reset map center and zoom\n map.setCenter(new google.maps.LatLng(39.5, -100.35));\n map.setZoom(4);\n\n // Selection button\n $(\"#selection-button\").trigger(\"click\");\n $(\"#state-button\").trigger(\"click\");\n rectangleManager.setMap(map);\n rectangleManager.setDrawingMode(google.maps.drawing.OverlayType.RECTANGLE);\n}", "remove() {\n this.setMap(null);\n }", "function clearMapColor() {\n let states = document.querySelectorAll(\"path\");\n states.forEach(function (state) {\n state.removeAttribute(\"style\");\n state.classList.add(\"clearState\");\n });\n}", "clearMap() {\n this.mapPoints.selectAll('circle').remove();\n this.map.selectAll('.team').classed('team', false);\n this.map.selectAll('.host').classed('host', false);\n }", "function clear_rectangles(map_id, layer_id){\n for (i = 0; i < window[map_id + 'googleRectangles' + layer_id].length; i++){\n window[map_id + 'googleRectangles' + layer_id][i].setMap(null);\n }\n window[map_id + 'googleRectangles' + layer_id] = null;\n}", "function initMap(){\r\n\t//load the svg data into the svg-map div\r\n\tmap = $('#svg-map').svg('get');\r\n\t//add the id to the svg map object\r\n\tmap.configure({id:'map'}, false);\r\n\t//do an initial window zoom based on the width and height of the screen and the map deminsions\r\n\tvar boundingBox = map.getElementById('map').getBBox();\r\n\tvar base_view = parseInt(boundingBox.x) + ', ' + parseInt(boundingBox.y) + ', ' + parseInt(boundingBox.width) + ', ' + parseInt(boundingBox.height);\r\n\t//animates the view change.\r\n\t\r\n\t/* The Animation Code\r\n\t$(\"#map\").fadeOut(500,function(){\r\n\t\t$(\"#map\").animate({svgViewBox: base_view}, 0, function(){\r\n\t\t\t$(\"#map\").fadeIn(500);\r\n\t\t});\r\n\t});\r\n\t*/\r\n\t$(\"#map\").animate({svgViewBox: base_view}, 0);\r\n\t\t\r\n\t//the zoom out icon sits at the bottom right of the page and a click on it shoud zoom out to the original zoom position\r\n\t$(\"#zoomout\").click(function(){\r\n\t\t/* The Animation Code\r\n\t\t$(\"#map\").fadeOut(500,function(){\r\n\t\t\tresetMap();\r\n\t\t\tmap.change(map.getElementById(\"Country_names_Lines\"), {display: 'none'});\r\n\t\t\t$(\"#map\").animate({svgViewBox: base_view}, 0, function(){\r\n\t\t\t\t$(\"#map\").fadeIn(500);\r\n\t\t\t});\r\n\t\t});\r\n\t\t*/\r\n\t\tresetMap();\r\n\t\tmap.change(map.getElementById(\"Country_names_Lines\"), {display: 'none'});\r\n\t\t$(\"#map\").animate({svgViewBox: base_view}, 0);\r\n\t});\r\n\t$(\"#map\").children('g').each(function(){\r\n\t\tvar id = $(this).attr('id');\r\n\t\tif(id == 'Country_names_Lines'){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(id == 'internships'){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t//The region - as defined as the label name on the map (with underscores for spaces) is the key with an array of UN Codes as the value\r\n\t\tinternship_data.regions[id] = new Array();\r\n\t\t$(this).children('g').each(function(){\r\n\t\t\tinternship_data.regions[id].push($(this).attr('id'));\r\n\t\t});\r\n\t\t//Sets the class clickable as to show the pointer\r\n\t\tmap.change(map.getElementById($(this).attr('id')), {class: 'clickable'});\r\n\t\t//sets up the action to take on click\r\n\t\t$(this).click(function(){\r\n\t\t\t$('#dropdown').hide( 'fade', {}, 0);\r\n\t\t\tboundingBox = map.getElementById($(this).attr('id')).getBBox();\r\n\t\t\t//viewBox numbers => <min-x>, <min-y>, <width> and <height>\r\n\t\t\tvar view = parseInt(boundingBox.x) + ', ' + parseInt(boundingBox.y) + ', ' + parseInt(boundingBox.width) + ', ' + parseInt(boundingBox.height);\r\n\t\t\t//animates the view change. Maybe we should just fade out, move, and fade back in\r\n\t\t\t/* The Animation stuff\r\n\t\t\t$(\"#map\").fadeOut(500,function(){\r\n\t\t\t\t$(\"#map\").animate({svgViewBox: view}, 0, function(){\r\n\t\t\t\t\t$(\"#map\").fadeIn(500);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t*/\r\n\t\t\t$(\"#map\").animate({svgViewBox: view}, 0);\r\n\t\t\t\r\n\t\t\t//Shows the Country Names\r\n\t\t\tmap.change(map.getElementById(\"Country_names_Lines\"), {display: ''});\r\n\t\t\t\r\n\t\t\tresetGroup('internships');\r\n\t\t\t$('#'+$(this).attr('id')).children('g').each(function(){\t\t\t\t\t\r\n\t\t\t\tdisplayInternships($(this).attr('id'), true);\r\n\t\t\t});\r\n\t\t});\r\n\t});\r\n\t//setup the group to handle interships\r\n\tmap.group(null, 'internships');\r\n\tresetMap();\r\n}", "initMap() {\n let self = this;\n \tlet styles = [\n {\n \"featureType\": \"all\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"hue\": \"#ff00d8\"\n },\n {\n \"saturation\": \"0\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#f9b8ea\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"color\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#4e113b\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n },\n {\n \"color\": \"#ca2992\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#2e093b\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"color\": \"#9e1010\"\n },\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural.landcover\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#58176e\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural.landcover\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.business\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"saturation\": -100\n },\n {\n \"lightness\": 45\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#a02aca\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#d180ee\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#a02aca\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n },\n {\n \"color\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"color\": \"#a02aca\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#cc81e7\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"hue\": \"#f200ff\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#882375\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#e36cd9\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#b7918f\"\n },\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#280b33\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#ca2994\"\n }\n ]\n }\n]\n\n let mapview = document.getElementById('map');\n mapview.style.height = window.innerHeight + \"px\";\n let map = new window.google.maps.Map(mapview, {\n center: {lat: 38.961914, lng:-101.004839},\n zoom: 5,\n mapTypeControl: false,\n styles:styles\n });\n\n let InfoWindow = new window.google.maps.InfoWindow({});\n\n window.google.maps.event.addListener(InfoWindow, 'closeclick', function () {\n self.closeInfoWindow();\n });\n\n this.setState({\n 'map': map,\n 'infowindow': InfoWindow\n });\n\n window.google.maps.event.addDomListener(window, \"resize\", function () {\n let center = map.getCenter();\n window.google.maps.event.trigger(map, \"resize\");\n self.state.map.setCenter(center);\n });\n\n window.google.maps.event.addListener(map, 'click', function () {\n self.closeInfoWindow();\n });\n\n let ourLocations = [];\n this.state.ourLocations.forEach(function (location) {\n let longName = location.name + ' - ' + location.type;\n let marker = new window.google.maps.Marker({\n position: new window.google.maps.LatLng(location.latitude, location.longitude),\n animation: window.google.maps.Animation.BOUNCE,\n map: map,\n title: location.significance,\n \ticon: heart\n });\n\n marker.addListener('click', function () {\n self.openInfoWindow(marker, longName);\n });\n\n location.longName = longName;\n location.marker = marker;\n location.display = true;\n ourLocations.push(location);\n });\n this.setState({\n 'ourLocations': ourLocations\n });\n }", "function renderMap() {\n\t$('#jvectormap').vectorMap({\n\t\tmap: 'world_mill',\n\t\tmarkers: COUNTRIES,\n\t\tbackgroundColor: '#FFF',\n\t\tzoomMax: 4, zoomMin: 0.7, zoomOnScroll: false, zoomStep: 1.6,\n\t\tregionStyle: {\n\t\t\tinitial: {\n\t\t\t\t'fill': '#c5c5c5', 'fill-opacity': 0.8,\n\t\t\t},\n\t\t\thover: {\n\t\t\t\t'fill': '#c5c5c5', 'cursor': 'initial',\n\t\t\t}\n\t\t},\n\t\tmarkerStyle: {\n\t\t\tinitial: {\n\t\t\t\t'fill': '#3A3A9D', 'fill-opacity': 0.8, 'stroke': '#83D0F4', 'r': 6,\n\t\t\t},\n\t\t\thover: {\n\t\t\t\t'fill': '#3A3A9D', 'stroke': 'black'\n\t\t\t}\n\t\t},\n\t\tfocusOn: {\n\t\t\tx: 0.5, y: 0.5, scale: 0.9,\n\t\t},\n\t\tonRegionTipShow: function(e){e.preventDefault()},\n\t\t// Intercept the tooltip shown on hover by adding company name\n\t\tonMarkerTipShow: function(e, tip, code){\n\t\t\ttip[0].innerHTML = '<div class=\"country-name\">'+ COUNTRIES[code].name + '</div><div>' + COUNTRIES[code].details + '</div>';\n\t\t},\n\t});\n}", "hideAllCatchments() {\n\t\tconsole.log(\"hiding all catchments\");\n\t\tthis.kmlLayer.setMap(null);\n\t}", "removeGeometryLayer() {\n this.map.removeLayer(this.geometryLayer);\n this.geometryLayer = null;\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 updateBounds() {\n map.fitBounds(mapBounds);\n\n // update dark border area\n topBound.setBounds([[90, -180], [Math.max(mapBounds[0][0], mapBounds[1][0]), 180]]);\n rightBound.setBounds([[Math.min(mapBounds[0][0], mapBounds[1][0]), Math.max(mapBounds[0][1], mapBounds[1][1])],\n [Math.max(mapBounds[0][0], mapBounds[1][0]), 180]]);\n leftBound.setBounds([[Math.min(mapBounds[0][0], mapBounds[1][0]), -180],\n [Math.max(mapBounds[0][0], mapBounds[1][0]), Math.min(mapBounds[0][1], mapBounds[1][1])]]);\n bottomBound.setBounds([[Math.min(mapBounds[0][0], mapBounds[1][0]), -180], [-90, 180]]);\n}", "render() {\n MapPlotter.setUpFilteringButtons();\n MapPlotter.readFiltersValues();\n\n MapPlotter.currentStateName = 'Texas';\n MapPlotter.drawRaceDoughnut();\n\n MapPlotter.drawMap();\n }", "zoomOut(e){\n // |--- check\n if(!(this.zoomLevel>1)) return;\n\n this.zoomLevel = this.zoomLevel - this.zoomStep;\n this.zoomCef = this.zoomLevel / (this.zoomLevel+this.zoomStep);\n this.cursorX = e.clientX - this.mapOffLeft;\n this.cursorY = e.clientY - this.mapOffTop;\n\n // |--- compute zoom center\n this.x = \n this.cursorX\n -\n ((this.cursorX + this.mapTransLeft)\n *\n this.zoomCef);\n\n this.y = \n this.cursorY\n -\n ((this.cursorY + this.mapTransTop)\n *\n this.zoomCef);\n\n\n // |--- Align if out of border\n let\n viewChunkHr, viewChunkVr;\n\n if( this.x>0 ){\n this.x = 0;\n } else if( this.x<0 ){\n viewChunkHr = (this.refSvgContainer.offsetWidth*this.zoomCef) - Math.abs(this.x);\n\n if(viewChunkHr<this.refMap.offsetWidth){\n this.x = -((this.refSvgContainer.offsetWidth*this.zoomCef) - this.refMap.offsetWidth);\n }\n }\n\n if( this.y>0 ){\n this.y = 0;\n } else if( this.y<0 ){\n viewChunkVr = (this.refSvgContainer.offsetHeight*this.zoomCef) - Math.abs(this.y);\n\n if(viewChunkVr< this.refMap.offsetHeight){\n this.y = -((this.refSvgContainer.offsetHeight*this.zoomCef) - this.refMap.offsetHeight);\n }\n }\n }", "function printThisMap(mapId) {\n // add media query for map in style-tag\n var printStyle = document.createElement('style');\n printStyle.id = 'bkgwebmap-printstyle';\n printStyle.innerHTML = '@media print {body *{visibility:hidden; font-family: Arial, \"Helvetica Neue\", Helvetica, sans-serif;}img{max-width:100%}.bkgwebmap-maptoprint,.bkgwebmap-maptoprint *{display:inherit;visibility:visible}.bkgwebmap-maptoprint .ol-control,.bkgwebmap-maptoprint .ol-control *{visibility:hidden!important}.print-element{display:block!important;margin-top:15px} sup {display: inline !important} .bkgwebmap-measureoverlay-tooltip {visibility: hidden;} .bkgwebmap-scalevalue {visibility: hidden}}';\n document.head.appendChild(printStyle);\n\n // set some variables\n var mapContainer = document.getElementById(mapId);\n var olAttribution = mapContainer.getElementsByClassName('bkgwebmap-copyrightlist')[0];\n var copyrightDiv = document.createElement('div');\n\n var olScale = mapContainer.getElementsByClassName('bkgwebmap-scalebar')[0];\n var scaleDiv = document.createElement('div');\n\n var olLegend = mapContainer.getElementsByClassName('bkgwebmap-legendcontent')[0];\n var legendDiv = document.createElement('div');\n\n // insert copyright information if available\n if (olAttribution) {\n // create new container for copyright information\n copyrightDiv.classList.add('print-element');\n copyrightDiv.style.display = 'none';\n\n // insert copyright information\n copyrightDiv.innerHTML = '<b>Copyright</b>' + olAttribution.innerHTML;\n }\n\n // insert scale if available\n if (olScale) {\n // create new container for scale\n scaleDiv.classList.add('print-element');\n scaleDiv.classList.add('scale-div-print');\n scaleDiv.style.display = 'none';\n\n\n // insert scale\n scaleDiv.innerHTML = olScale.innerHTML;\n }\n\n // insert legend if available\n if (olLegend) {\n // create new container for legend\n legendDiv.classList.add('print-element');\n legendDiv.style.display = 'none';\n\n // insert legend\n legendDiv.innerHTML = olLegend.innerHTML;\n }\n\n // insert measure result if available\n var measureDiv = document.createElement('div');\n measureDiv.classList.add('print-element');\n measureDiv.style.display = 'none';\n\n var measureTooltip = document.getElementsByClassName('bkgwebmap-measureoverlay-tooltip-static')[0];\n\n if (measureTooltip !== undefined) {\n var measureResult = measureTooltip.innerHTML;\n var measureMessage;\n if (measureResult.indexOf('<sup>') !== -1) {\n measureMessage = 'Gemessene Fläche: ' + measureResult;\n } else {\n measureMessage = 'Gemessene Strecke: ' + measureResult;\n }\n\n measureDiv.innerHTML = measureMessage;\n }\n\n // add scaleDiv, measureDiv, copyrightDiv, le to page\n mapContainer.appendChild(scaleDiv);\n mapContainer.appendChild(measureDiv);\n mapContainer.appendChild(copyrightDiv);\n mapContainer.appendChild(legendDiv);\n\n // add class to set all but this map invisible, print and then remove class again\n mapContainer.classList.add('bkgwebmap-maptoprint');\n\n // print map\n window.print();\n\n // remove created elements again\n document.head.removeChild(document.getElementById('bkgwebmap-printstyle'));\n mapContainer.removeChild(scaleDiv);\n mapContainer.removeChild(measureDiv);\n mapContainer.removeChild(copyrightDiv);\n mapContainer.removeChild(legendDiv);\n mapContainer.classList.remove('bkgwebmap-maptoprint');\n }", "function renderMapStack() {\n _mapDOM.render();\n _renderMarkers();\n infoBoxManager.render(_mapDOM, InfoBox);\n _registerMapEvents();\n infoBoxManager.registerInfoBoxEvents();\n}", "function hideMarkers() {\r\n setMapOnAll(null);\r\n}", "_drawGeoBorder(id) {\n const tiles = this._getTilesById(id)\n const clusters = this._computeClusters(tiles)\n const paths = clusters.map(cluster => hull(\n cluster,\n gridGeometry.getTileEdge() // 'concavity', a.k.a. max edge length\n ))\n paths.forEach(path => {\n this._ctx.beginPath()\n path.forEach((point, index) => {\n const command = (index === 0) ? 'moveTo' : 'lineTo'\n this._ctx[command](...point)\n })\n this._ctx.closePath()\n this._ctx.globalAlpha = 0.75\n this._ctx.strokeStyle = hoveredTileBorderColor\n this._ctx.lineWidth = 1.0 * devicePixelRatio\n this._ctx.stroke()\n this._ctx.globalAlpha = 1.0\n })\n }", "handleMap() {\r\n this.setState({displayMap: true});\r\n this.setState({displayedState: 'Map'});\r\n this.setState({displayedData: []});\r\n this.setState({output: []});\r\n this.setState({submitted: false});\r\n this.setState({allEntries: false});\r\n this.clearSearchFields();\r\n }", "function clear_map() {\n\t\tevent.preventDefault();\n\t\tmap.dataProvider.areas.length=0;\n\t\tmap.validateNow();\n\t\t$(\"#results\").html('');\n\t}", "function showMarkers() {\n // setMapOnAll(map);\n removeLine();\n}", "function removeMapDiv() {\n\tmap = null;\n\t$('#map-canvas').remove();\n}", "function drawMap(mapName, mapHolder) {\n mapHolder.append('text')\n .attr('class', 'chart-label')\n .attr('dy', rem *1.5)\n .text(d => d.mapName);\n \n let cells = allCells.find((d) => {return d.mapName === mapName});\n\n const projection = d3.geoIdentity()\n .reflectY(true)\n .fitSize([mapDim[0], mapDim[1]], shapeData);\n\n const path = d3.geoPath(projection);\n\n //draw svg lines of the boundries\n const colleges = mapHolder\n .selectAll('.colleges')\n .data(shapeData.objects.colleges.features)\n .enter()\n .append('path')\n .attr('class','colleges')\n .attr('id', (d) => {\n return d.properties.fips + ' ' + d.properties.stateNameS})\n .attr('d', path)\n .attr('fill', d => lookup(cells.mapData, d.properties.fips))\n .attr('stroke-width', 0.4);\n \n const states = mapHolder\n .selectAll('.states')\n .data(shapeData.objects.states.features)\n .enter()\n .append('path')\n .attr('id', (d) => {\n return d.properties.fips + ' ' + d.properties.stateNameL\n })\n .attr('class', 'states')\n .attr('d', path) \n\n function lookup(row, idName) {\n const uniqueCell = row.find((d) => { return d.cellId === idName});\n if(!uniqueCell || uniqueCell.value === '') {\n return 'none'\n }\n return colourScale(uniqueCell.value)\n }\n\n }", "function renderMap(map){\n\t\tcurrentMap = map;\n\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\t\tctx.fillStyle = \"#363947\";\n\t\tfor (i = 0; i < mapDimension; i++) {\n\t\t\tfor (j = 0; j < mapDimension; j++) {\n\t\t\t\tif (map[i][j].charAt(0) == 'W'){\n\t\t\t\t\tctx.fillStyle = \"#3D6BBF\";\n\t\t\t\t\tctx.fillRect(j * tileDimension,i * tileDimension, tileDimension, tileDimension);\n\t\t\t\t}\telse if (map[i][j].charAt(0) == 'G'){\n\t\t\t\t\tctx.fillStyle = \"#B8A073\";\n\t\t\t\t\tctx.fillRect(j * tileDimension,i * tileDimension, tileDimension, tileDimension);\n\t\t\t\t}\n\t\t\t\tif (map[i][j].length > 1) {\n\t\t\t\t\tif (map[i][j].charAt(1) == 'P'){\n\t\t\t\t\t\tsetPlayer(j,i);\n\t\t\t\t\t} else if (map[i][j].charAt(1) == 'F'){\n\t\t\t\t\t\tsetFood(map[i][j].charAt(2), j, i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function renderMap(){\n clearMap();\n var currentVertice\n for(var y = 0; y < scaledHeight+1; y++){\n for(var x = 0; x < scaledHeight+1; x++){\n if(renderTopLeft[0]+x >= 0 && renderTopLeft[0] + x < vertices.length){\n if(renderTopLeft[1]+y >= 0 && renderTopLeft[1]+y < vertices[x].length){\n currentVertice = vertices[renderTopLeft[0]+x][renderTopLeft[1]+y];\n\n // check rooms\n for(var i = 0; i < allRooms.length; i++){\n if(allRooms[i].getTopLeft() == currentVertice && allRooms[i].found == true){\n allRooms[i].activateAllVertice();\n allRooms[i].draw();\n }\n }\n // check passageways\n for(var i = 0; i < allPassageways.length; i++){\n if(allPassageways[i].getTopLeft() == currentVertice && allPassageways[i].found == true){\n allPassageways[i].draw();\n }\n }\n\n // check doors\n for(var i = 0; i < allDoors.length; i++){\n if(allDoors[i].getTopLeft() == currentVertice && allDoors[i].found === true){\n allDoors[i].draw(allDoors[i].getDirection());\n }\n }\n\n // check all chests\n for(var i = 0; i < allChests.length; i++){\n if(allChests[i].found == true){\n if(allChests[i].getTopLeft() == currentVertice){\n allChests[i].draw();\n }\n }\n }\n\n // checks all traps\n for(var i = 0; i < allTraps.length; i++){\n if(allTraps[i].found === true){\n if(allTraps[i].getTopLeft() == currentVertice){\n allTraps[i].draw();\n }\n }\n }\n\n }\n }\n }\n }\n}", "function initMap() {\n // Constructor creates a new map .\n map = new google.maps.Map(($('#map').get(0)), {\n center: map_center,\n zoom: main_zoom,\n styles: [{\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#523735\"\n }]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#c9b2a6\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#dcd2be\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#ae9e90\"\n }]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#93817c\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#a5b076\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#447530\"\n }]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#fdfcf8\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f8c967\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#e9bc62\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#e98d58\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#db8555\"\n }]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#806b63\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#8f7d77\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#b9d3c2\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#92998d\"\n }]\n }\n ],\n mapTypeControlOptions: {\n mapTypeIds: []\n }\n });\n\n //Create a InfoWindow\n largeInfowindow = new google.maps.InfoWindow();\n //Set each markers\n for (var i = 0; i < locations.length; i++) {\n var position = locations[i].location;\n var title = locations[i].title;\n var marker = new google.maps.Marker({\n position: position,\n title: title,\n animation: google.maps.Animation.DROP,\n map: map,\n id: i,\n });\n // Push the marker to our array of markers.\n markers.push(marker);\n // Create an onclick event to open an infowindow at each marker.\n marker.addListener('click', function() {\n populateInfoWindow(this, largeInfowindow);\n });\n }\n //Add click event for each marker\n for (var j = 0; j < markers.length; j++) {\n $('#' + j).click(function() {\n showMarker($(this).attr(\"id\"));\n });\n }\n\n}", "function ShowBaseMaps() {\n var cellHeight = (isMobileDevice) ? 108 : 115;\n if (dojo.byId('divLayerContainer').className == \"showContainerHeight\") {\n dojo.byId('divLayerContainer').className = \"hideContainerHeight\";\n dojo.byId('divLayerContainer').style.height = '0px';\n }\n else {\n dojo.byId('divLayerContainer').style.height = '150px'; // Math.ceil(baseMapLayerCollection.length / 2) * cellHeight + \"px\";\n dojo.byId('divLayerContainer').className = \"showContainerHeight\";\n }\n}", "function DrawMiniMap()\n{\n\tvar localPosition = WorldToLocal(mapOrigin.x, mapOrigin.y, 1);\n\tvar color=0x47474F;\n\tvar size= miniMapBorder;\n\te.lineStyle(size, color);\n\te.beginFill(0x40420);\n\te.drawCircle(mapOrigin.x, mapOrigin.y, miniMapRadius);\n\te.endFill();\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: {\n lat: 19.0276,\n lng: 72.8662\n },\n zoom: 12,\n styles: [{\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#523735\"\n }]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#c9b2a6\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#dcd2be\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#ae9e90\"\n }]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#93817c\"\n }]\n },\n {\n \"featureType\": \"poi.business\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#a5b076\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#447530\"\n }]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#fdfcf8\"\n }]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f8c967\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#e9bc62\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#e98d58\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#db8555\"\n }]\n },\n {\n \"featureType\": \"road.local\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#806b63\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#8f7d77\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#b9d3c2\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#92998d\"\n }]\n }\n ]\n });\n // Instead of using multiple infowindows we can just use one since it is unncessary in this situation.\n infowindow = new google.maps.InfoWindow();\n ko.applyBindings(viewModel);\n}", "render() {\n return (\n // Error Boundry to help trouble shooting\n <ErrorBoundary>\n {/* Map being imported from Leaflet */}\n <Map center={[this.props.lat || 43.8988, this.props.long || -72.5778]} zoom={this.props.zoom} zoomControl={false} boxZoom={false} doubleClickZoom={false} dragging={false} keyboard={false} scrollWheelZoom={false} touchZoom={false}>\n {/* Tile layer that is used on the map */}\n <TileLayer\n url='https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}'\n attribution='Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'\n />\n {/* GeoJSON to help create the shape of VT */}\n <GeoJSON key='my-geoJson' data={borderData} />\n {/* Polyline for drawing movements */}\n <Polyline key='DrawLine' positions={[this.props.moves]} color={'red'} />\n {/* Ternary operator for dropping marker at start of game */}\n {this.props.gameStart ? <Marker position={[this.props.startLat, this.props.startLong]} /> : null}\n </Map>\n </ErrorBoundary>\n );\n }", "function clearMap() {\n for (var layerId in window.Layers) {\n window.Layers[layerId].remove();\n }\n window.Layers = {};\n updateLayers();\n}", "function initMap() {\n // Styles a map\n map = new google.maps.Map(document.getElementById('map'), {\n center: { lat: 41.878, lng: -87.629 },\n zoom: 8,\n styles: [{\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#523735\"\n }]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#c9b2a6\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#dcd2be\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#ae9e90\"\n }]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#93817c\"\n }]\n },\n {\n \"featureType\": \"poi.business\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#a5b076\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#447530\"\n }]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#fdfcf8\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f8c967\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#e9bc62\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#e98d58\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#db8555\"\n }]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#806b63\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#8f7d77\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#b9d3c2\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#92998d\"\n }]\n }\n ]\n });\n\n var curr_page = 1; //Current page of GET response\n var num_pages = 1; //Initialize number of pages response has\n var url = \"http://api.brewerydb.com/v2/locations/?p=\" + curr_page.toString() + \"&region=Illinois&key=481d514448fd7365873ba9501d928e10&format=json\"; //URL to get breweries in Illinois\n\n // Request first page of info\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n var response = JSON.parse(xmlHttp.responseText); //Parse json response\n num_pages = response[\"numberOfPages\"]; //Set number of pages response has\n markbrewery(response); //Mark first page of response\n\n //Request and mark each page of response \n for (curr_page = 2; curr_page <= num_pages; curr_page++) {\n url = \"http://api.brewerydb.com/v2/locations/?p=\" + curr_page.toString() + \"&region=Illinois&key=481d514448fd7365873ba9501d928e10&format=json\";\n httpGetAsync(url);\n }\n }\n }\n xmlHttp.open(\"GET\", url, true); // true for asynchronous \n xmlHttp.send();\n}", "function makeMap() {\n // Make containers\n\n const div = mapsContainer.append('div').attr('class', 'map-container');\n const svg = div.append('svg').html(DEFS);\n\n const pathContainer = svg.append('g').attr('class', 'features');\n const baselineContainer = svg.append('g').attr('class', 'baseline');\n const chart19Container = svg.append('g').attr('class', 'slopes-19');\n const chart20Container = svg.append('g').attr('class', 'slopes-20');\n const textContainer = svg\n .append('g')\n .attr('class', 'text')\n // Create separate groups for white background and black foreground\n .selectAll('g')\n .data([true, false])\n .enter()\n .append('g');\n\n const riverLabel = svg\n .append('text')\n .attr('class', 'river-label')\n .selectAll('tspan')\n .data(['Hudson', 'River'])\n .join('tspan')\n .text(d => d);\n const campusLabel = svg\n .append('g')\n .attr('class', 'campus-labels')\n // Create separate groups for white background and black foreground\n .selectAll('text')\n .data([true, false])\n .enter()\n .append('text')\n .classed('white-background', d => d)\n .selectAll('tspan')\n .data(['Main', 'Campus'])\n .join('tspan')\n .text(d => d);\n\n const labelContainer = svg.append('g');\n const neighborhoodLabelsBg = labelContainer\n .append('g')\n .attr('class', 'neighborhood-labels')\n .selectAll('text')\n .data(LABELS)\n .enter('text')\n .append('text')\n .attr('class', 'white-background')\n .selectAll('tspan')\n .data(d => d.label)\n .join('tspan')\n .text(d => d);\n const neighborhoodLabels = labelContainer\n .append('g')\n .attr('class', 'neighborhood-labels')\n .selectAll('text')\n .data(LABELS)\n .enter('text')\n .append('text')\n .selectAll('tspan')\n .data(d => d.label)\n .join('tspan')\n .text(d => d);\n\n // Extract census tract features (contains all tracts in Manhattan)\n\n const allTracts = feature(influxData, influxData.objects.tracts);\n\n // Create a separate GeoJSON object that holds only the tracts we want to fit\n // the projection around\n\n const tracts = {\n type: 'FeatureCollection',\n features: allTracts.features.filter(({ properties: { census_tract } }) =>\n [36061018900, 36061021900].includes(+census_tract),\n ),\n };\n\n // Extract census tract centroids\n\n const centroids = feature(influxData, influxData.objects.tracts_centroids);\n\n // Create the paths that will become census tracts.\n // The `d` attribute won't be set until the resize function is called.\n\n const paths = pathContainer\n .selectAll('path')\n .data(allTracts.features)\n .enter()\n .append('path')\n .classed(\n 'columbia-outline',\n d => d.properties.census_tract === '36061020300',\n );\n paths\n .filter(\n ({ properties: { aug20, oct20, aug19, oct19 } }) =>\n (oct20 - aug20) / aug20 > (oct19 - aug19) / aug19,\n )\n .style('fill', shadedColor);\n\n // Create the things that will become the slope chart (e.g. line, arrow, circles)\n\n const circles = chart20Container\n .selectAll('circle')\n .data(centroids.features)\n .enter()\n .append('circle')\n .attr('r', 3);\n\n const baseline = baselineContainer\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line');\n\n /* const text = textContainer\n .selectAll('text')\n .data(centroids.features)\n .enter()\n .append('text')\n .classed('white-background', function () {\n return this.parentNode.__data__;\n }); */\n\n const slopes2020 = chart20Container\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line')\n .attr('stroke', c20);\n\n const slopes2019 = chart19Container\n .selectAll('line')\n .data(centroids.features)\n .enter()\n .append('line')\n .attr('stroke', c19);\n\n // Make a handleResize method that handles the things that depend on\n // width (path generator, paths, and svg)\n\n function handleResize() {\n // Recompute width and height; resize the svg\n\n const width = Math.min(WIDTH, document.documentElement.clientWidth - 30);\n const isMobile = width < 460;\n const height = (width * (isMobile ? 36 : 28)) / 30;\n arrowSize = isMobile ? 32 : 45;\n svg.attr('width', width);\n svg.attr('height', height);\n\n // Create the projection\n\n const albersprojection = geoAlbers()\n .rotate([122, 0, 0])\n .fitSize([width, height], tracts);\n\n // Create the path generating function; set the `d` attribute to the path\n // generator, which is called on the data we attached to the paths earlier\n\n const pathGenerator = geoPath(albersprojection);\n paths.attr('d', pathGenerator);\n\n // Define some commonly used coordinate functions\n\n const x = d => albersprojection(d.geometry.coordinates)[0];\n const y = d => albersprojection(d.geometry.coordinates)[1];\n const endpointX = year => d => {\n const slope =\n (d.properties['oct' + year] - d.properties['aug' + year]) /\n d.properties['aug' + year];\n const x = arrowSize * Math.cos(Math.atan(slope * 2));\n return albersprojection(d.geometry.coordinates)[0] + x;\n };\n const endpointY = year => d => {\n const slope =\n (d.properties['oct' + year] - d.properties['aug' + year]) /\n d.properties['aug' + year];\n const y = arrowSize * Math.sin(Math.atan(slope) * 2);\n return albersprojection(d.geometry.coordinates)[1] - y;\n };\n\n // Modify the positions of the elements\n\n circles.attr('cx', x).attr('cy', y);\n slopes2020\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', endpointX(20))\n .attr('y2', endpointY(20));\n slopes2019\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', endpointX(19))\n .attr('y2', endpointY(19));\n\n /* text\n .attr('x', x)\n .attr('y', y)\n .text(d => {\n let difference =\n (100 * (d.properties.oct - d.properties.aug)) / d.properties.aug;\n difference =\n difference < 10 ? difference.toFixed(1) : Math.round(difference);\n if (difference > 0) return '+' + difference + '%';\n else return '–' + Math.abs(difference) + '%';\n }); */\n\n baseline\n .attr('x1', x)\n .attr('y1', y)\n .attr('x2', d => x(d) + arrowSize)\n .attr('y2', y);\n\n riverLabel\n .attr('x', isMobile ? 0 : width / 6)\n .attr('y', (_, i) => height / 2 + i * 22);\n\n campusLabel\n .attr('x', albersprojection(CAMPUS_LABEL_LOC)[0])\n .attr('y', (_, i) => albersprojection(CAMPUS_LABEL_LOC)[1] + i * 18);\n\n neighborhoodLabels\n .attr('x', function () {\n return albersprojection(this.parentNode.__data__.loc)[0];\n })\n .attr('y', function (_, i) {\n return albersprojection(this.parentNode.__data__.loc)[1] + i * 20;\n });\n\n neighborhoodLabelsBg\n .attr('x', function () {\n return albersprojection(this.parentNode.__data__.loc)[0];\n })\n .attr('y', function (_, i) {\n return albersprojection(this.parentNode.__data__.loc)[1] + i * 20;\n });\n }\n\n // Call the resize function once; attach it to a resize listener\n\n handleResize();\n window.addEventListener('resize', debounce(handleResize, 400));\n}", "function clearOverlays() {\n setAllMap(null);\n}", "function clearOverlays() {\r\n setAllMap(null);\r\n}", "function removeAllMarkers() {\n displayAllMarkers(null);\n }", "render() {\n return <div id=\"map\" style={style} />\n }", "function drawMap() {\n //Clears the canvas of drawn things\n console.log(\"drawing\");\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n //Draws tresuremap on canvas\n ctx.drawImage(treasuremap, 0, 0);\n}", "function hideDrawingControl() {\n drawingManager.setOptions({\n drawingControl: false\n });\n drawingManager.setMap(null);\n // In case the user drew anything, get rid of the polygon\n if (polygon !== null) {\n polygon.setMap(null);\n }\n}", "hide() {\r\n this.show = false;\r\n map.removeLayer(areasPolygons[this.polygonId]);\r\n }", "function draw() {\n background(0);\n translate(width / 2., height / 2.);\n imageMode(CENTER);\n image(mapImg,0,0);\n for (var i = 0; i < locationData.length; i++)\n {\n //console.log(\"Drawing: \" + locationData[i].name);\n radius = map(locationData[i].checkins, checkInMin.value(), checkInMax.value(), rMin.value(), rMax.value());\n drawLocation(locationData[i], radius);\n }\n}", "function mapstyle (){\n var date = new Date();\n var day_map = [{\"featureType\":\"landscape.natural\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#e0efef\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"visibility\":\"on\"},{\"hue\":\"#1900ff\"},{\"color\":\"#c0e8e8\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":100},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit.line\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"on\"},{\"lightness\":700}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#7dcdcd\"}]}];\n var night_map = [{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":13}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#144b53\"},{\"lightness\":14},{\"weight\":1.4}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#08304b\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#0c4152\"},{\"lightness\":5}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#0b434f\"},{\"lightness\":25}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#0b3d51\"},{\"lightness\":16}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#146474\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#021019\"}]}];\n var breakout_map_2015 = [\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#ababab\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#404041\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#e3e3e3\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#cccccc\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#cccccc\"\n },\n {\n \"weight\": \"0.50\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"saturation\": \"-100\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station.airport\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station.airport\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#b1b1b1\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n }\n];\n // var hour = date.getHours();\n // if(6 < hour && hour < 21) {\n // return night_map;\n // } else { \n // return day_map; \n // }\n return breakout_map_2015;\n}", "render() {\n return <div id=\"map\" style={style} />;\n }", "function render(edges, map) {\n if (edges === undefined || edges.length === 0)\n removeEdges(map);\n else\n renderEdges(edges, map);\n }", "function writeMap() {\n\t\tvar map = document.createElement(\"span\");\n\t\tmap.setAttribute(\"id\", MAP);\n\t\tvar mapsp = document.body.appendChild(map);\n\t\tmapsp.style.position = \"absolute\";\n\t\tmapsp.style.top = 0;\n\t\tmapsp.style.left = 0;\n\t\tmapsp.style.border = \"medium double \" + this.borderColor;\n\t\tmapsp.style.backgroundColor = this.bgColor;\n\t\tmapsp.style.overflow = \"auto\";\n\t\tmapsp.attachEvent(\"onscroll\", updMiniMap);\n\t\tmapsp.map = this;\n\t\tthis.setBounds();\n\t\tif (this.bgImage != null) {\n\t\t\tvar image = new Image();\n\t\t\timage.src = this.bgImage;\n\t\t\tvar img = document.createElement(\"img\");\n\t\t\timg.setAttribute(\"border\", \"0\");\n\t\t\timg.setAttribute(\"src\", image.src);\n\t\t\tvar imgsp = document.getElementById(MAP).appendChild(img);\n\t\t\timgsp.style.position = \"absolute\";\n\t\t\timgsp.style.left = this.bgImageXCoord;\n\t\t\timgsp.style.top = this.bgImageYCoord;\n\t\t\tvar ntw = 200;\n\t\t\tvar nth = 50;\n\t\t\tif (this.tagName != null) {\n\t\t\t\tvar nametagsp = document.getElementById(MAP).appendChild(document.createElement(\"span\"));\n\t\t\t\tnametagsp.style.position = \"absolute\";\n\t\t\t\tnametagsp.style.left = this.tagNameXPos;\n\t\t\t\tnametagsp.style.top = this.tagNameYPos;\n\t\t\t\tnametagsp.style.width = ntw;\n\t\t\t\tnametagsp.style.height = nth;\n\t\t\t\tnametagsp.style.color = \"#003366\";\n\t\t\t\tnametagsp.style.fontFamily = \"Arial\";\n\t\t\t\tnametagsp.style.fontSize = \"12px\";\n\t\t\t\tnametagsp.style.fontWeight = \"bold\";\n\t\t\t\tnametagsp.innerText = this.tagName;\n\t\t\t}\n\t\t\tvar cover = document.createElement(\"v:rect\");\n\t\t\tcover.setAttribute(\"id\", MAP);\n\t\t\tbgImgCover = document.getElementById(MAP).appendChild(cover);\n\t\t\tbgImgCover.style.position = \"absolute\";\n\t\t\tbgImgCover.style.left = 0;\n\t\t\tbgImgCover.style.top = 0;\n\t\t\tbgImgCover.style.width = this.bgImageXCoord + image.width > this.tagNameXPos + ntw ? this.bgImageXCoord + image.width : this.tagNameXPos + ntw;\n\t\t\tbgImgCover.style.height = this.bgImageYCoord + image.height > this.tagNameYPos + nth ? this.bgImageYCoord + image.height : this.tagNameYPos + nth;\n\t\t\tbgImgCover.fill.opacity = \"0%\";\n\t\t\tbgImgCover.stroked = \"false\";\n\t\t}\n\t\tfor (var i = 0; i < this.networkElements.getLength(); i++) {\n\t\t\tvar ne = this.networkElements.get(i);\n\t\t\tne.write();\n\t\t\tfor (var j = 0; j < ne.ports.getLength(); j++) {\n\t\t\t\tne.ports.get(j).write();\n\t\t\t}\n\t\t\tne.allocatePorts();\n\t\t}\n\t\tthis.selection = new Selection();\n\t\tthis.selection.setMinimapSide(this.minimapWidth);\n\t\tthis.selection.write();\n\t\tthis.storeMapBounds();\n\t\tif (this.hasExtendedInformation) {\n\t\t\tthis.writeMiniMap();\n\t\t}\n\t}", "render() {\n return (\n <Ons.Page>\n {this.renderMap()}\n {this.renderBottomPane()}\n </Ons.Page>\n );\n }", "displayMap() {\n // show the toolbar by pressing H.\n if (keys[keyH]) {\n if (this.map.length == 0)\n this.creatorMode();\n this.hide = false;\n }\n // draw tiles from the tilemap on the canvas\n if (this.map.length == 0)\n return;\n for (let y = 0; y < round(height / this.tileH); y++) {\n for (let x = 0; x < round(width / this.tileW); x++) {\n this.drawTile(this.map[y][x].name, x * this.tileW, y * this.tileH);\n }\n }\n // display toolbar if it's not in hidden mode\n if (this.hide)\n return;\n stroke(0, 0, 0);\n fill(0);\n rect(0, height - this.tileH, width, this.tileH);\n for (let i = 0; i < this.tiles.length; i++) {\n image(this.img, i * this.tileW + i, height - this.tileH, this.tileW, this.tileH,\n this.tiles[i].xOff, this.tiles[i].yOff, this.tileW, this.tileH);\n }\n fill(255);\n rect(width - this.tileW, height - this.tileH, this.tileW, this.tileH);\n fill(255, 0, 0);\n textAlign(CENTER);\n textSize(this.tileW / 3);\n text(\"hide\", width - this.tileW + (this.tileW / 2), height - (this.tileH / 2));\n // draw grid lines\n for (let i = 0; i < round(height / this.tileH); i++) {\n line(0, i * this.tileH, width, i * this.tileH);\n }\n for (let i = 0; i < round(width / this.tileW); i++) {\n line(i * this.tileW, 0, i * this.tileW, height - this.tileH);\n }\n noFill();\n stroke(255, 0, 0);\n strokeWeight(2);\n try {\n rect(round(mouseX / this.tileW) * this.tileW, round(mouseY / this.tileH) * this.tileH, this.tileW, this.tileH);\n } catch (err) {\n console.log(\"mouse out of canvas. - indicator unshown.\");\n }\n stroke(0);\n strokeWeight(1);\n }", "function removeAllLayers() {\n currentLayer = \"none\";\n map.removeLayer(otherLayer);\n map.removeLayer(todoLayer);\n map.removeLayer(foodLayer);\n map.removeLayer(shelterLayer);\n map.removeLayer(eventsLayer);\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 2,\n center: new google.maps.LatLng(2.8,-187.3),\n mapTypeId: 'terrain',\n styles: [\n {elementType: 'geometry', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},\n {elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},\n {\n featureType: 'administrative.locality',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'geometry',\n stylers: [{color: '#263c3f'}]\n },\n {\n featureType: 'poi.park',\n elementType: 'labels.text.fill',\n stylers: [{color: '#6b9a76'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry',\n stylers: [{color: '#38414e'}]\n },\n {\n featureType: 'road',\n elementType: 'geometry.stroke',\n stylers: [{color: '#212a37'}]\n },\n {\n featureType: 'road',\n elementType: 'labels.text.fill',\n stylers: [{color: '#9ca5b3'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry',\n stylers: [{color: '#746855'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'geometry.stroke',\n stylers: [{color: '#1f2835'}]\n },\n {\n featureType: 'road.highway',\n elementType: 'labels.text.fill',\n stylers: [{color: '#f3d19c'}]\n },\n {\n featureType: 'transit',\n elementType: 'geometry',\n stylers: [{color: '#2f3948'}]\n },\n {\n featureType: 'transit.station',\n elementType: 'labels.text.fill',\n stylers: [{color: '#d59563'}]\n },\n {\n featureType: 'water',\n elementType: 'geometry',\n stylers: [{color: '#17263c'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.fill',\n stylers: [{color: '#515c6d'}]\n },\n {\n featureType: 'water',\n elementType: 'labels.text.stroke',\n stylers: [{color: '#17263c'}]\n }\n ]\n });\n // Create a <script> tag and set the USGS URL as the source.\n var script = document.createElement('script');\n\n // This example uses a local copy of the GeoJSON stored at\n // http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojsonp\n script.src = 'https://developers.google.com/maps/documentation/javascript/examples/json/earthquake_GeoJSONP.js';\n document.getElementsByTagName('head')[0].appendChild(script);\n\n map.data.setStyle(function(feature) {\n var magnitude = feature.getProperty('mag');\n return {\n icon: getCircle(magnitude)\n };\n });\n }", "function drawmap(world) {\r\n var world=world;\r\n \r\n let color = function (value) { \r\n let cf=d3.scaleLog().domain([1, 1600]).range([1,0]);\r\n return value>0?d3.interpolateRdGy(cf(value)):0;\r\n }\r\n width=innerWidth;\r\n height=innerHeight;\r\n var projection=d3.geoMercator().scale([width/(2.5*Math.PI)]).translate([width/2,height/2]).precision(0.01);\r\n var path = d3.geoPath().projection(projection);\r\n function center(d){\r\n let dx=d3.geoCentroid(d)[0];\r\n let dy=d3.geoCentroid(d)[1];\r\n return projection([dx,dy]);\r\n }\r\n var radiusScale = d3.scaleQuantize().domain([1, 1500]).range([5,15,40,60]);\r\n var rscale=function(value){\r\n return value==0?0:radiusScale(value);\r\n }\r\n // let g = painter.append(\"g\")\r\n\r\n const svg = d3.create(\"svg\")\r\n .attr(\"viewBox\",\"0 0 2000 1200\")\r\n .attr(\"id\",\"Mapsvg\");\r\n \r\n \r\n /** Awesome tooltip idea from Eric Porter https://codepen.io/EricPorter/pen/xdJLaG?editors=1000*/ \r\n function msg(ctr,rec){\r\n return\"<div class='tooltipcontent'><li><span>Country : \"+ctr+\"</span></li><li><span>Records : \"+rec+\"</span></li></div>\";\r\n }\r\n \r\n //outline group\r\n \r\n\r\n const g = svg.append('g')\r\n .attr('class', 'map')\r\n .attr(\"clip-path\",\"url(#map-glowclip)\")\r\n .attr(\"fill\",\"url(#map-gradient)\")\r\n .attr(\"id\",\"Map-outlayer\");\r\n const outline=g.append(\"path\")\r\n .datum(topojson.mesh(world, world.objects.countries, (a, b) => a !== b))\r\n .attr(\"stroke\", \"white\")\r\n .attr(\"stroke-linejoin\", \"round\")\r\n .attr(\"id\",\"countryoutline\")\r\n .attr(\"stroke-width\",2)\r\n .attr(\"d\", path);\r\n \r\n const cg= svg.append(\"g\")\r\n .attr(\"class\", \"countries-layer\")\r\n .selectAll(\"path\")\r\n .data(Feature)\r\n .enter()\r\n .append(\"g\")\r\n .attr(\"class\",\"countryg requiretooltip\")\r\n .attr(\"id\",d=>d.id)\r\n .attr(\"message\",d=>msg(d.name,d.nrecord));\r\n\r\n \r\n \r\n const cp=cg\r\n .append(\"path\")\r\n .attr(\"fill\", d => color(d.nrecord))\r\n .attr(\"fill-opacity\",0.6)\r\n .attr(\"stroke\", \"white\")\r\n .attr(\"stroke-linejoin\", \"round\")\r\n .attr(\"stroke-width\",2)\r\n .attr(\"d\", path)\r\n .attr(\"class\",\"countryborder\")\r\n .attr(\"id\",d=>d.id)\r\n .attr(\"name\",d=>CodeMap.get(d.id));\r\n \r\n \r\n //bind the results\r\n const cirg=svg.append(\"g\").attr(\"class\",\"circle-layer\")\r\n .selectAll(\"circle-wrapper\")\r\n .data(Feature)\r\n .enter()\r\n .append(\"g\");\r\n\r\n cirg.append(\"circle\")\r\n .attr(\"class\",\"pins glow-pins\")\r\n .attr(\"cx\",d=> center(d)[0])\r\n .attr(\"cy\",d=> center(d)[1])\r\n .attr(\"r\", d=>rscale(d.nrecord))\r\n .attr(\"fill\",\"red\")\r\n .attr(\"fill-opacity\",0.6)\r\n .attr(\"records\",d=>rscale(d.nrecord));\r\n \r\n cirg\r\n .append(\"circle\")\r\n .attr(\"class\",\"pins solid-pins\")\r\n .attr(\"cx\",d=> center(d)[0])\r\n .attr(\"cy\",d=> center(d)[1])\r\n .attr(\"r\", d=>rscale(d.nrecord))\r\n .attr(\"fill\", \"red\")\r\n .attr(\"fill-opacity\",0.6)\r\n .attr(\"records\",d=>rscale(d.nrecord));\r\n return svg.node();\r\n\r\n\r\n }", "function clearOverlays()\n{\n setAllMap(null);\n}", "render() {\n return (\n <div className=\"map\" >\n <div className=\"map\" id=\"map\"></div>\n <Filters centerMap={this.centerMap} center={this.state.center} action={this.centerHandler} />\n </div>\n );\n }", "draw() {\n const divPosition =\n this.getProjection().fromLatLngToDivPixel(this.position);\n if (isMarker(this.mapFeature)) {\n // Give the Marker room to be visible.\n divPosition.y -= 40;\n }\n checkPresent(this.containerDiv, 'not present when drawing');\n this.containerDiv.style.left = divPosition.x + 'px';\n this.containerDiv.style.top = divPosition.y + 'px';\n }", "function initMap() {\n\n var uluru = { lat: 40.674, lng: -73.945 };\n // Styles a map in night mode.\n\n var main_color = '#0E2646', //Main color\n saturation_value = -1, //saturation\n brightness_value = 1; //brightness\n\n //Style for elements on map\n var style = [{\n //Saturation of notation on the map\n elementType: \"labels\",\n stylers: [\n { saturation: saturation_value }\n ]\n },\n { //We hide the signs of metro stations, stations, airports and other transport links on the map\n featureType: \"poi\",\n elementType: \"labels\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide the road designation on the map\n featureType: 'road.highway',\n elementType: 'labels',\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide the designation of local roads\n featureType: \"road.local\",\n elementType: \"labels.icon\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide the designation of the highway on the map\n featureType: \"road.arterial\",\n elementType: \"labels.icon\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide road signs on the map\n featureType: \"road\",\n elementType: \"geometry.stroke\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n //Styles for different elements on the map\n {\n featureType: \"transit\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.government\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.sport_complex\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.attraction\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.business\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"transit\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"transit.station\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"landscape\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n\n },\n {\n featureType: \"road\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"road.highway\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"water\",\n elementType: \"geometry\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n }\n ];\n\n // Options map\n var map = new google.maps.Map(document.getElementById('google-map'), {\n center: uluru,\n scrollwheel: false,\n zoom: 15,\n styles: style\n });\n\n // Set marker on map\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n}", "function update_map_canvas(canvas_x, canvas_y, width, height)\n{\n var gui_x0, gui_y0;\n var full = true;\n\n gui_x0 = mapview['gui_x0'] + canvas_x;\n gui_y0 = mapview['gui_y0'] + canvas_y;\n\n /* Clear the area, if the mapview extends beyond map borders. \n *\n * This is necessary since some parts of the rectangle\n * may not actually have any tiles drawn on them. This will happen when\n * the mapview is large enough so that the tile is visible in multiple\n * locations. In this case it will only be drawn in one place.\n *\n * Of course it's necessary to draw to the whole area to cover up any old\n * drawing that was done there. */\n r = base_canvas_to_map_pos(0, 0);\n s = base_canvas_to_map_pos(mapview['width'], 0);\n t = base_canvas_to_map_pos(0, mapview['height']);\n u = base_canvas_to_map_pos(mapview['width'], mapview['height']);\n if ( r['map_x'] < 0 || r['map_x'] > map['xsize'] || r['map_y'] < 0 || r['map_y'] > map['ysize']\n\t || s['map_x'] < 0 || s['map_x'] > map['xsize'] || s['map_y'] < 0 || s['map_y'] > map['ysize']\n\t || t['map_x'] < 0 || t['map_x'] > map['xsize'] || t['map_y'] < 0 || t['map_y'] > map['ysize']\n\t || u['map_x'] < 0 || u['map_x'] > map['xsize'] || u['map_y'] < 0 || u['map_y'] > map['ysize']) {\n canvas_put_rectangle(mapview_canvas_ctx, \"rgb(0,0,0)\", canvas_x, canvas_y, width, height);\n }\n \n // mapview_layer_iterate\n for (var layer = 0; layer < LAYER_COUNT; layer++) {\n \n //gui_rect_iterate begin \n var gui_x_0 = (gui_x0);\n var gui_y_0 = (gui_y0); \n var gui_x_w = width + (tileset_tile_width >> 1);\n var gui_y_h = height + (tileset_tile_height >> 1);\n if (gui_x_w < 0) { \n gui_x_0 += gui_x_w; \n gui_x_w = -gui_x_w; \n } \n \n if (gui_y_h < 0) { \n gui_y_0 += gui_y_h; \n gui_y_h = -gui_y_h; \n } \n \n if (gui_x_w > 0 && gui_y_h > 0) { \n var ptilepedge = {}; \n var ptilepcorner = {}; \n var ptile_xi, ptile_yi, ptile_si, ptile_di; \n var gui_x, gui_y; \n var ptile_r1 = 2;\n var ptile_r2 = ptile_r1 * 2; \n var ptile_w = tileset_tile_width; \n var ptile_h = tileset_tile_height; \n var ptile_x0 = Math.floor(( (gui_x_0 * ptile_r2) / (ptile_w) - (( (gui_x_0 * ptile_r2) < 0 && (gui_x_0 * ptile_r2) % (ptile_w) < 0 ) ? 1 : 0) ) - ptile_r1 / 2);\n var ptile_y0 = Math.floor(( (gui_y_0 * ptile_r2) / (ptile_h) - (( (gui_y_0 * ptile_r2) < 0 && (gui_y_0 * ptile_r2) % (ptile_h) < 0 ) ? 1 : 0) ) - ptile_r1 / 2); \n var ptile_x1 = Math.floor(( ((gui_x_0 + gui_x_w) * ptile_r2 + ptile_w - 1) / (ptile_w) - (( ((gui_x_0 + gui_x_w) * ptile_r2 + ptile_w - 1) < 0 \n && ((gui_x_0 + gui_x_w) * ptile_r2 + ptile_w - 1) % (ptile_w) < 0 ) ? 1 : 0) ) + ptile_r1);\n var ptile_y1 = Math.floor(( ((gui_y_0 + gui_y_h) * ptile_r2 + ptile_h - 1) / (ptile_h) - (( ((gui_y_0 + gui_y_h) * ptile_r2 + ptile_h - 1) < 0 \n && ((gui_y_0 + gui_y_h) * ptile_r2 + ptile_h - 1) % (ptile_h) < 0 ) ? 1 : 0) ) + ptile_r1); \n var ptile_count = (ptile_x1 - ptile_x0) * (ptile_y1 - ptile_y0);\n \n for (var ptile_index = 0; ptile_index < ptile_count; ptile_index++) { \n var ptile = null; \n var pedge = null; \n var pcorner = null; \n ptile_xi = ptile_x0 + (ptile_index % (ptile_x1 - ptile_x0)); \n ptile_yi = Math.floor(ptile_y0 + (ptile_index / (ptile_x1 - ptile_x0)));\n ptile_si = ptile_xi + ptile_yi; \n ptile_di = ptile_yi - ptile_xi;\n if (2 == ptile_r1 ) { \n if ((ptile_xi + ptile_yi) % 2 != 0) { \n continue; \n } \n if (ptile_xi % 2 == 0 && ptile_yi % 2 == 0) { \n if ((ptile_xi + ptile_yi) % 4 == 0) { \n /* Tile */\n ptile = map_pos_to_tile((ptile_si >> 2) - 1, (ptile_di >> 2));\n } else { \n /* Corner */\n pcorner = ptilepcorner;\n pcorner['tile'] = []; \n pcorner['tile'][0] = map_pos_to_tile(((ptile_si - 6) >> 2), ((ptile_di - 2) >> 2)); \n pcorner['tile'][1] = map_pos_to_tile(((ptile_si - 2) >> 2), ((ptile_di - 2) >> 2)); \n pcorner['tile'][2] = map_pos_to_tile(((ptile_si - 2) >> 2), ((ptile_di + 2) >> 2)); \n pcorner['tile'][3] = map_pos_to_tile(((ptile_si - 6) >> 2), ((ptile_di + 2) >> 2)); \n } \n } else { \n /* Edge. */\n pedge = ptilepedge; \n if (ptile_si % 4 == 0) { \n pedge['type'] = EDGE_NS;\n pedge['tile'] = [];\n pedge['tile'][0] = map_pos_to_tile(((ptile_si - 4) >> 2), ((ptile_di - 2) >> 2)); \n pedge['tile'][1] = map_pos_to_tile(((ptile_si - 4) >> 2), ((ptile_di + 2) >> 2));\n } else { \n pedge['type'] = EDGE_WE;\n pedge['tile'] = [];\n pedge['tile'][0] = map_pos_to_tile(((ptile_si - 6) >> 2), (ptile_di >> 2)); \n pedge['tile'][1] = map_pos_to_tile(((ptile_si - 2) >> 2), (ptile_di >> 2));\n } \n } \n } else { \n if (ptile_si % 2 == 0) { \n if (ptile_xi % 2 == 0) { \n /* Corner */\n pcorner = ptilepcorner;\n pcorner['tile'] = []; \n pcorner['tile'][0] = map_pos_to_tile((ptile_xi >> 1) - 1, (ptile_yi >> 1) - 1); \n pcorner['tile'][1] = map_pos_to_tile((ptile_xi >> 1), (ptile_yi >> 1) - 1); \n pcorner['tile'][2] = map_pos_to_tile((ptile_xi >> 1), (ptile_yi >> 1));\n pcorner['tile'][3] = map_pos_to_tile((ptile_xi >> 1) - 1, (ptile_yi >> 1));\n } else { \n /* Tile */\n ptile = map_pos_to_tile(((ptile_xi - 1) >> 1), ((ptile_yi - 1) >> 1)); \n } \n } else {\n /* Edge */ \n pedge = ptilepedge; \n if (ptile_yi % 2 == 0) { \n pedge['type'] = EDGE_NS;\n pedge['tile'] = [];\n pedge['tile'][0] = map_pos_to_tile(((ptile_xi - 1) >> 1), ((ptile_yi >> 1) - 1));\n pedge['tile'][1] = map_pos_to_tile(((ptile_xi - 1) >> 1), (ptile_yi >> 1));\n } else { \n pedge['type'] = EDGE_WE; \n pedge['tile'] = [];\n pedge['tile'][0] = map_pos_to_tile(((ptile_xi >> 1) - 1), ((ptile_yi - 1) >> 1)); \n pedge['tile'][1] = map_pos_to_tile((ptile_xi >> 1), ((ptile_yi - 1) >> 1));\n } \n } \n } \n\n gui_x = Math.floor(ptile_xi * ptile_w / ptile_r2 - ptile_w / 2); \n gui_y = Math.floor(ptile_yi * ptile_h / ptile_r2 - ptile_h / 2);\n \n { // gui_rect_iterate begin_end\n\n var cx = gui_x - mapview['gui_x0'];\n var cy = gui_y - mapview['gui_y0'];\n\n\n if (ptile != null) {\n put_one_tile(mapview_canvas_ctx, layer, ptile, cx, cy, null);\n \n } else if (pedge != null) {\n put_one_element(mapview_canvas_ctx, layer, null, pedge, null,\n null, null, cx, cy, null);\n } else if (pcorner != null) {\n put_one_element(mapview_canvas_ctx, layer, null, null, pcorner,\n null, null, cx, cy, null);\n } else {\n /* This can happen, for instance for unreal tiles. */\n }\n }\n } \n } \n }\n \n}" ]
[ "0.6837888", "0.676992", "0.66784406", "0.6600019", "0.65457547", "0.652174", "0.6381404", "0.6335877", "0.63255894", "0.6270208", "0.6211184", "0.6188512", "0.6187455", "0.61447555", "0.613084", "0.61243486", "0.6120234", "0.6116621", "0.61153203", "0.61013836", "0.6096328", "0.60952806", "0.60892874", "0.60821617", "0.6043546", "0.6034638", "0.6018518", "0.60112035", "0.60060096", "0.59988016", "0.59848577", "0.59839076", "0.59836", "0.59821373", "0.5965083", "0.5944555", "0.5944177", "0.5940626", "0.5936792", "0.5935148", "0.5931886", "0.59037244", "0.5893173", "0.58918166", "0.5885862", "0.5878912", "0.5875106", "0.5865869", "0.585869", "0.5854948", "0.58509606", "0.58470315", "0.583744", "0.5833113", "0.58267593", "0.5826226", "0.58238864", "0.5821743", "0.58154714", "0.5792967", "0.57919574", "0.5784276", "0.57824796", "0.5777091", "0.5751867", "0.5746514", "0.5745823", "0.5745069", "0.5744432", "0.57360685", "0.57357347", "0.57144606", "0.56988436", "0.5697369", "0.5689172", "0.5688482", "0.5673057", "0.5670734", "0.56699556", "0.56655", "0.5652005", "0.56494737", "0.56420815", "0.5641307", "0.5639538", "0.5634054", "0.5631671", "0.56284344", "0.5626543", "0.5624744", "0.5624092", "0.56212276", "0.56172705", "0.56163764", "0.5614357", "0.56130487", "0.5611443", "0.5605012", "0.56030107", "0.5601186" ]
0.8033667
0
Move grid from one position to another
function moveGrid(from, to) { let fromGrid = getGrid(from); let toGrid = getGrid(to); let type = null; if (getGridClass(from).includes('wall-grid')) { type = 'WALL'; } if (getGridClass(from).includes('point-grid')) { type = 'POINT'; } if (getGridClass(from).includes('pacman-grid')) { type = 'PACMAN'; } createGrid(toGrid, type); deleteGrid(fromGrid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move (grid) {\n if (this.orientation.dir === Orientation.left) {\n this.position.col--;\n } else if (this.orientation.dir === Orientation.right) {\n this.position.col++;\n } else if (this.orientation.dir === Orientation.up) {\n this.position.row--;\n } else if (this.orientation.dir === Orientation.down) {\n this.position.row++;\n }\n\n // updates the grid based on the cell the ant has landed\n let positionHash = (this.position.row * 31) ^ this.position.col;\n if ((this.position.row + this.position.col) % 2 === 0) grid[positionHash] = 'W' \n else grid[positionHash] = 'B';\n }", "function moveGrid(pref) {\r\n if ( pref.animate_top === false ) {\r\n $(\"#widget-holder,#grid-holder\").css({\r\n \"-webkit-transition\": \"left .2s ease-in-out\"\r\n });\r\n } else {\r\n $(\"#widget-holder,#grid-holder\").css({\r\n \"-webkit-transition\": \"left .2s ease-in-out, top .2s ease-in-out\"\r\n });\r\n }\r\n\r\n $(\"#widget-holder,#grid-holder\").css({\r\n \"top\" : GRID_MARGIN_TOP,\r\n \"left\": GRID_MARGIN_LEFT\r\n });\r\n\r\n updateGridOpacity();\r\n}", "function moveRow2R(grid) {\n for (let i = 7; i < 14; i++) {\n if ((grid[i].position) > 6) {\n grid[i].position += 1;\n } if (grid[i].position > 13) {\n grid[i].position = 7;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveRow2L(grid) {\n for (let i = 7; i < 14; i++) {\n if ((grid[i].position) > 6) {\n grid[i].position -= 1;\n } if (grid[i].position < 7) {\n grid[i].position = 13;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function move({x=0, y=0}) {\n\tstate.offset = {x:state.offset.x + x, y:state.offset.y + y}\n\tconst grid = document.querySelector('.grid-scrollable-content')\n\tgrid.style.transform = `translate(${-state.offset.x}px, ${-state.offset.y}px)`\n\tconst p = getCurrentParcel(state.offset)\n\tconst equal = p.lat == state.currentParcel.lat &&\n\t\tp.lon == state.currentParcel.lon\n\tif(!equal) {\n\t\tconsole.log('parcel changed!')\n\t\tsetCurrentParcel(p);\n\t}\n}", "function makeMove() {\n grid = makeAMove(grid);\n myMove = false;\n updateMove();\n}", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "function snapToGrid(activity, xValue, yValue) {\n\n}", "function changePosition(from, to, rowToUpdate) {\n\n var $tiles = $(\".tile\");\n var insert = from > to ? \"insertBefore\" : \"insertAfter\";\n\n // Change DOM positions\n $tiles.eq(from)[insert]($tiles.eq(to));\n\n layoutInvalidated(rowToUpdate);\n}", "function moveRow1R(grid) {\n for (let i = 0; i < 7; i++) {\n if ((grid[i].position) < 7) {\n grid[i].position += 1;\n } if (grid[i].position > 6) {\n grid[i].position = 0;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function changePosition(from, to) {\n\t\t\n\t\tvar $tiles = $(\".box\");\n\n\t\tvar fromOrder = $tiles.eq(from)[0].tile.order;\n\t\tvar toOrder = $tiles.eq(to)[0].tile.order;\n\t\t\n\t\tvar toX = $tiles.eq(to)[0].tile.x;\n\t\tvar toY = $tiles.eq(to)[0].tile.y;\n\t\t\n\t\t//FROM TILE: make its toX the X pos of the TO tile\n\t\t$tiles.eq(from)[0].tile.toX = toX;\n\t\t$tiles.eq(from)[0].tile.toY = toY;\n\t\t\n\t\tvar swapTime = globalVars.swapTime;\n\t\t\n\t\t//TO TILE: make its toX the fromX of the FROM tile\n\t\t$tiles.eq(to)[0].tile.toX = $tiles.eq(from)[0].tile.fromX;\n\t\t$tiles.eq(to)[0].tile.toY = $tiles.eq(from)[0].tile.fromY;\n\t\t\n\t\t//TO TILE: make its fromX the toX of the TO tile\n\t\t$tiles.eq(to)[0].tile.fromX = toX;\n\t\t$tiles.eq(to)[0].tile.fromY = toY;\n\t\t\t\t\n\t\t$tiles[from].tile.x = getXPositionFromIndex(toOrder);\n\t\t$tiles[from].tile.y = getYPositionFromIndex(toOrder);\n\t\t\n\t\t//Move the elements\n\t\t//the first of the 2 moves (the \"from\" tile)\n\t\tvar tween1 = TweenLite.to($tiles[from], swapTime, {\n\t\t\t//Set the floor value to minimize gaps between the elements\n\t\t\tx : Math.floor(toX),\n\t\t\ty : Math.floor(toY),\n\t\t\tease:Strong.easeInOut,\n\t\t\tonComplete : function() { \n\t\t\t\t$tiles[from].tile.positioned = true;\n\t\t\t\t$tiles[from].tile.order = toOrder;\n\t\t\t\t$tiles.eq(from).attr(\"data-order\",toOrder);\n\t\t\t\tglobalVars.hitting = null;\n\t\t\t},\n\t\t\tonStart : function() { \n\t\t\t\t$tiles[from].tile.positioned = false;\n\t\t\t}\n\t\t });\n\t\t\n\t\t//the second tile (to)\n\t\tvar tween2 = TweenLite.to($tiles[to], swapTime, {\n\t\t\t//Set the floor value to minimize gaps between the elements\n\t\t\tx : Math.floor($tiles[from].tile.fromX),\n\t\t\ty : Math.floor($tiles[from].tile.fromY),\n\t\t\tease:Strong.easeInOut,\n\t\t\tonComplete : function() { \n\t\t\t\t$tiles[to].tile.positioned = true;\n\t\t\t\t$tiles[to].tile.order = fromOrder;\n\t\t\t\t$tiles[to].tile.x = getXPositionFromIndex(fromOrder);\n\t\t\t\t$tiles[to].tile.y = getYPositionFromIndex(fromOrder);\n\t\t\t\t$tiles.eq(to).attr(\"data-order\",fromOrder);\n\t\t\t\t\n\t\t\t\t//These are things that should be checked after BOTH the pieces move, but the code is here for now, since the duration of tween1 and tween2 is the same. needs optimization.\n\t\t\t\t//check the orders\n\t\t\t\tvar currentOrder = [];\n\t\t\t\t$(\".box\").each(function(index, element) {\t\n\t\t\t\t\tvar tile = this.tile;\n\t\t\t\t\tcurrentOrder.push(tile.order);\n\t\t\t\t});\n\t\t\t\tglobalVars.numMoves++;\n\t\t\t\tif (globalVars.numMoves == 1) {\n\t\t\t\t\tvar moves = \"move\"\n\t\t\t\t} else {\n\t\t\t\t\tvar moves = \"moves\"\n\t\t\t\t}\n\t\t\t\t$('.moves').html(globalVars.numMoves+\" \"+moves);\n\t\t\t\tif (arraysEqual(globalVars.correctOrder, currentOrder)){\t\t\t\t\t\n\t\t\t\t\tsetTimeout(function(){ \n\t\t\t\t\t\tvar finalTime = $('.stopwatch').html();\n\t\t\t\t\t\talert(\"Success! You finished the puzzle in \"+finalTime+\" seconds in \"+globalVars.numMoves+\" \"+moves);\n\t\t\t\t\t}, 200);\n\t\t\t\t\t//stop timer\n\t\t\t\t\tclearTimeout(t);\n\t\t\t\t}\t\t\t\t\n\t\t\t},\n\t\t\tonStart : function() { \n\t\t\t\t$tiles[to].tile.positioned = false;\n\t\t\t}\n\t\t });\n\t}", "function moveRow3R(grid) {\n for (let i = 14; i < 21; i++) {\n if ((grid[i].position) > 13) {\n grid[i].position += 1;\n } if (grid[i].position > 20) {\n grid[i].position = 14;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "moveTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[a];\n this.gameState.board[a] = 0;\n }", "move () {\n let row = this.ant.position.row;\n let col = this.ant.position.col;\n\n // turn the ant.\n // if the current cell is white, then turn clockwise. Else anti-clockwise.\n this.ant.turn(this.isWhite(row, col));\n // flip the color the current cell\n this.flip(row, col);\n // move the ant one step\n this.ant.move(this.grid);\n // update the size of the grid so that it fits the ants position\n this.ensureFit(this.ant.position);\n }", "function moveRow6R(grid) {\n for (let i = 35; i < 42; i++) {\n if ((grid[i].position) > 34) {\n grid[i].position += 1;\n } if (grid[i].position > 41) {\n grid[i].position = 35;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveRow1L(grid) {\n for (let i = 0; i < 7; i++) {\n if ((grid[i].position) < 7) {\n grid[i].position -= 1;\n } if (grid[i].position < 0) {\n grid[i].position = 6;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "move() {\n\t\tthis.lastPosition = [ this.x, this.y ];\n\n\t\tthis.x += this.nextMove[0];\n\t\tthis.y += this.nextMove[1];\n\t}", "function changePosition(from, to) {\n\n\t\t\t//var $tiles = $(\".box\");\n\t\t\tvar $tiles = $(\"#slide-\"+G.currentSlide+\" .box\");\n\n\t\t\t//make the fromX the X pos of the from tile\n\t\t\t//$tiles.eq(from)[0].tile.fromX = $tiles.eq(from)[0].tile.x;\n\t\t\t//$tiles.eq(from)[0].tile.fromY = $tiles.eq(from)[0].tile.y;\n\t\t\t//alert(\"from x and y is \"+$tiles.eq(from)[0].tile.fromX+\" and \"+$tiles.eq(from)[0].tile.fromY);\n\n\t\t\tvar fromOrder = $tiles.eq(from)[0].tile.order;\n\t\t\tvar toOrder = $tiles.eq(to)[0].tile.order;\n\n\t\t\tvar toX = $tiles.eq(to)[0].tile.x;\n\t\t\tvar toY = $tiles.eq(to)[0].tile.y;\n\n\t\t\t//FROM TILE: make its toX the X pos of the TO tile\n\t\t\t$tiles.eq(from)[0].tile.toX = toX;\n\t\t\t$tiles.eq(from)[0].tile.toY = toY;\n\n\t\t\tvar swapTime = G.swapTime;\n\n\t\t\t//TO TILE: make its toX the fromX of the FROM tile\n\t\t\t$tiles.eq(to)[0].tile.toX = $tiles.eq(from)[0].tile.fromX;\n\t\t\t$tiles.eq(to)[0].tile.toY = $tiles.eq(from)[0].tile.fromY;\n\n\t\t\t//TO TILE: make its fromX the toX of the TO tile\n\t\t\t$tiles.eq(to)[0].tile.fromX = toX;\n\t\t\t$tiles.eq(to)[0].tile.fromY = toY;\n\n\t\t\t//console.log(toX);\n\t\t\t//alert(\"from \"+fromOrder+\" to \"+toOrder);\n\n\t\t\t$tiles[from].tile.x = getXPositionFromIndex(toOrder);\n\t\t\t$tiles[from].tile.y = getYPositionFromIndex(toOrder);\n\n\t\t\t//debugger;\n\n\t\t\t//Move the elements\n\t\t\t//console.log(e);\n\t\t\tvar tween1 = TweenLite.to($tiles[from], swapTime, {\n\t\t\t\tx : Math.floor(toX),\n\t\t\t\ty : Math.floor(toY),\n\t\t\t\tease:Strong.easeInOut,\n\t\t\t\tonComplete : function() {\n\n\t\t\t\t\t$tiles[from].tile.positioned = true;\n\t\t\t\t\t$tiles[from].tile.swapPartner = null;\n\n\t\t\t\t\t$tiles.eq(from).attr(\"data-order\",toOrder);\n\t\t\t\t\tG.hitting = null;\n\n\t\t\t\t},\n\t\t\t\tonStart : function() {\n\t\t\t\t\t$tiles[from].tile.positioned = false;\n\t\t\t\t\t$tiles[from].tile.order = toOrder;\n\t\t\t\t}\n\t\t\t });\n\t\t\t//the second tile (to)\n\t\t\tvar tween2 = TweenLite.to($tiles[to], swapTime, {\n\t\t\t\tx : Math.floor($tiles[from].tile.fromX),\n\t\t\t\ty : Math.floor($tiles[from].tile.fromY),\n\t\t\t\tease:Strong.easeInOut,\n\t\t\t\tonComplete : function() {\n\t\t\t\t\t$tiles[to].tile.positioned = true;\n\n\t\t\t\t\t$tiles[to].tile.x = getXPositionFromIndex(fromOrder);\n\t\t\t\t\t$tiles[to].tile.y = getYPositionFromIndex(fromOrder);\n\t\t\t\t\t$tiles.eq(to).attr(\"data-order\",fromOrder);\n\n\t\t\t\t\t//check the orders\n\t\t\t\t\tvar currentOrder = [];\n\t\t\t\t\t$(\"#slide-\"+G.currentSlide+\" .box\").each(function(index, element) {\n\t\t\t\t\t\tvar tile = this.tile;\n\t\t\t\t\t\tcurrentOrder.push(tile.order);\n\t\t\t\t\t\t//console.log(tile.order);\n\n\t\t\t\t\t});\n\t\t\t\t\t//console.log(\"correct order is \"+G.correctOrder);\n\t\t\t\t\t//console.log(\"current order is \"+currentOrder);\n\t\t\t\t\tG.numMoves++;\n\t\t\t\t\tif (G.numMoves == 1) {\n\t\t\t\t\t\tvar moves = \"move\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar moves = \"moves\"\n\t\t\t\t\t}\n\t\t\t\t\t$('.moves').html(G.numMoves+\" \"+moves);\n\t\t\t\t\tif (arraysEqual(G.correctOrder, currentOrder)){\n\n\t\t\t\t\t\t$(\".blocker\").show();\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t//alert(\"Success! You finished the puzzle in in \"+G.numMoves+\" \"+moves);\n\n\t\t\t\t\t\t\tshowFeedback();\n\t\t\t\t\t\t\t//console.log(\"custom_event: slide finished\");\n\t\t\t\t\t\t\t//console.log(\"custom_event: slide finished time: \"+G[\"slide\"+G.currentSlide+\"SecondsElapsed\"]);\n\t\t\t\t\t\t}, 0);\n\n\t\t\t\t\t\t//stop timer\n\t\t\t\t\t\t//console.log(\"stopping the timer\")\n\t\t\t\t\t\tclearTimeout(G.t);\n\t\t\t\t\t}\n\t\t\t\t\tG.swapHappening = false; //only allow 1 swap to happen at a time\n\t\t\t\t\t$tiles[to].tile.swapPartner = null;\n\n\n\t\t\t\t},\n\t\t\t\tonStart : function() {\n\t\t\t\t\t$tiles[to].tile.positioned = false;\n\t\t\t\t\t$tiles[to].tile.order = fromOrder;\n\t\t\t\t\tG.swapHappening = true; //only allow 1 swap to happen at a time\n\t\t\t\t}\n\t\t\t });\n\n\n\n\t\t //layoutInvalidated();\n\t\t}", "moveChess(oldGrid, newGrid) {\n\t\tlet team = this.get_piece(oldGrid).team;\n\n\t\tthis.stackEatenPiece(oldGrid, newGrid, newGrid, newGrid.piece, false, Const.FLAG_NONE);\n\n\t\t//===================== Special Moves ========================\n\n\t\t// Passant Move\n\t\tthis.movePassantPawn(oldGrid, newGrid);\n\n\t\t// Castle Move\n\t\tthis.moveCastleKing(oldGrid, newGrid);\n\n\t\t// Remove newGrid piece if being eaten\n\t\tnewGrid.piece = oldGrid.piece;\n\n\t\t//====================== Update Miscs =======================\n\n\t\t// Pawn to Queen Move\n\t\tthis.movePawnToQueen(oldGrid, newGrid);\n\n\t\t// Update king position\n\t\tif (oldGrid == this.king_grid[team])\n\t\t\tthis.king_grid[team] = newGrid;\n\n\t\t// Clear old grid piece\n\t\toldGrid.piece = -1;\n\t}", "move() {\n if (!this.isOnTabletop()) return;\n let [dx, dy]=FacingOptions.getFacingMoment(this.facing);\n let nx=this.x+dx;\n let ny=this.y+dy;\n if (this.tabletop.isOutOfBoundary(nx, ny)) return;\n this.x=nx;\n this.y=ny;\n }", "updateGrid() {\n if (this.moved) {\n let updateGrid = new Array(this.size * this.size).fill(null)\n this.grid.forEach(element => {\n if (element) {\n if (element.remove)\n return\n if (element.merge) {\n element.value *= 2\n element.merge = false\n this.score += element.value\n //if merge value 2048 then game over\n if (element.value === 2048)\n this.gameWon = true\n }\n updateGrid[element.position] = element\n }\n\n });\n this.grid = [...updateGrid]\n this.bestScore = this.score > this.bestScore ? this.score : this.bestScore\n this.addTile()\n this.gameOver = this.isGameOver();\n this.writeToStorage()\n this.moved=false\n }\n }", "function moveRow6L(grid) {\n for (let i = 35; i < 42; i++) {\n if ((grid[i].position) > 34) {\n grid[i].position -= 1;\n } if (grid[i].position < 35) {\n grid[i].position = 41;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveRow3L(grid) {\n for (let i = 14; i < 21; i++) {\n if ((grid[i].position) > 13) {\n grid[i].position -= 1;\n } if (grid[i].position < 14) {\n grid[i].position = 20;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "function torus_up()\t{let temp = grid.shift(); grid.push(temp);}", "function updateGrid(old_grid, old_skyline, piece_type_index, angle, pos){\n let oriented_piece = ORIENTED_PIECES[piece_type_index][angle];\n let new_grid = copyMatrix(old_grid);\n\n for(var i = 0; i< PIECE_HEIGHT_PROFILES[piece_type_index].length; i++) {\n if(i+pos < w){\n for(var j = 0; j<PIECE_HEIGHT_PROFILES[piece_type_index][i]; j++) {\n new_grid[old_skyline[i+pos]+j][i+pos] = piece_type_index;\n }\n }\n }\nreturn new_grid;\n}", "function move(dir) {\n\tvar locString=aRow+\",\"+aCol;\n\t//disallow back to origin move (clear all);\n\tif(aRow==curRow.rowIndex && aCol==curCell.cellIndex) {\n\t\t//origin\n\t\tclearBackTrack();\n\t} else {\n\t\tvar index=routeLocations.indexOf(locString);\n\t\tif(index==-1) {\n\t\t\trouteLocations.push(aRow+\",\"+aCol);\n\t\t\troute.push(dir);\n\t\t\trouteCells.push(grid[aRow][aCol]);\n\t\t\tgrid[aRow][aCol].style.backgroundColor=\"lightblue\";\n\t\t} else {\n\t\t\trouteLocations=routeLocations.slice(0,index+1);\n\t\t\troute=route.slice(0,index+1);\n\t\t\tfor(var i=index+1,l=routeCells.length;i<l;i++) {\n\t\t\t\trouteCells[i].style.backgroundColor=\"\";\n\t\t\t}\n\t\t\trouteCells=routeCells.slice(0,index+1);\n\t\t\t//unblue cells\n\t\t}\n\t\tmovePawn(grid[aRow][aCol]);\n\t}\n\tpopulateBackTrack();\n}", "function updatePosition(object, direction) {\n\n currentGrid = grid; //Save the grid before changes are made.\n\n xLoop:\n for (var i = 0; i < grid.length; i++) {\n yLoop:\n for (var j = 0; j < grid.length; j++) {\n\n if (grid[i][j] == object) {\n\n //player is moving down and the space is free\n if (direction == \"down\" && !isWall(grid[i + 1][j]) && !boxCollision(grid[i + 1][j], grid[i + 2][j])) {\n\n grid[i][j] = 0; //set current position to a blank space\n\n //Check if box can move\n if (checkBox(grid[i + 1][j]) && grid[i + 2][j] == 0 || grid[i + 2][j] == 4) {\n grid[i + 2][j] = 3; //Move box into position ahead of the new player position\n }\n\n grid[i + 1][j] = object; //Move object to new position\n stepCount += 1; //Increase the step count\n\n break xLoop; //break from outer loop\n\n }\n //player is moving up and the space is free\n else if (direction == \"up\" && !isWall(grid[i - 1][j]) && !boxCollision(grid[i - 1][j], grid[i - 2][j])) {\n\n grid[i][j] = 0; //Set current position to a blank space\n\n //Check if box can move\n if (checkBox(grid[i - 1][j]) && grid[i - 2][j] == 0 || grid[i - 2][j] == 4) {\n grid[i - 2][j] = 3; //Move box into position ahead of new player position\n }\n\n grid[i - 1][j] = object; //Move player to new position\n stepCount += 1; //Increase step count\n break xLoop; //Break from outer loop\n\n }\n\n //Player is moving left and the space is free\n else if (direction == \"left\" && !isWall(grid[i][j - 1]) && !boxCollision(grid[i][j - 1], grid[i][j - 2])) {\n grid[i][j] = 0; //Set current position to blank space\n\n //Check if a box can move\n if (checkBox(grid[i][j - 1]) && grid[i][j - 2] == 0 || grid[i][j - 2] == 4) {\n grid[i][j - 2] = 3; //Update box position ahead of new player position\n }\n\n grid[i][j - 1] = object; //Move player into new position\n stepCount += 1; //Increase step count\n break xLoop; //Break from outer loop\n\n }\n //Player is moving right and the space is free\n else if (direction == \"right\" && !isWall(grid[i][j + 1]) && !boxCollision(grid[i][j + 1], grid[i][j + 2])) {\n\n grid[i][j] = 0; //Set current position to blank space\n\n //Check if a box can move\n if (checkBox(grid[i][j + 1]) && grid[i][j + 2] == 0 || grid[i][j + 2] == 4) {\n grid[i][j + 2] = 3; //Update box position ahead of new player position\n }\n\n grid[i][j + 1] = object; //Move player into new position\n stepCount += 1; //Increase step count\n break xLoop; //Break from outer loop\n }\n }\n }\n }\n\n //This loop will check if any goals in the level are missing, then set the value to 4 so that they will be redrawn\n for (var i = 0; i < goalArray.length; i++) {\n\n if (grid[goalArray[i][0]][goalArray[i][1]] == 0) {\n grid[goalArray[i][0]][goalArray[i][1]] = 4;\n }\n\n }\n}", "function moveCol5Up(grid) {\n for (let i = 0; i < 47; i++) {\n if ((grid[i].position - 4) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 46;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "move() {\n let to_move = [this.head].concat(this.parts);\n this.dir_q.unshift(this.dir);\n for (let i = 0; i < to_move.length; i++) {\n to_move[i].add(this.dir_q[i]);\n if (to_move[i].x < -width / 2) to_move[i].x = width / 2 - BOX;\n if (to_move[i].x >= (width / 2) - 1) to_move[i].x = -width / 2;\n if (to_move[i].y < -height / 2) to_move[i].y = height / 2 - BOX;\n if (to_move[i].y >= (height / 2) - 1) to_move[i].y = -height / 2;\n }\n }", "function move2(rect){\n\t\tvar temp = rect.id;\n\t\tvar temp2 = temp.split(\"-\");\n\t\tvar row = parseInt(temp2[0]);\n\t\tvar col = parseInt(temp2[1]);\n\t\tvar dx = parseInt(emptyrow - row);\n\t\tvar dy = parseInt(emptycol - col);\n\t\tif(dx == 0){\n\t\t\tvar oldY = parseInt(window.getComputedStyle(rect).top);\n\t\t\trect.style.top = oldY + 100 * dy + \"px\";\n\t\t\temptycol = emptycol - dy;\n\t\t}else{\n\t\t\tvar oldX = parseInt(window.getComputedStyle(rect).left);\n\t\t\trect.style.left = oldX + 100 * dx + \"px\";\n\t\t\temptyrow = emptyrow - dx;\n\t\t}\n\t\tvar newrow = row + dx;\n\t\tvar newcol = col + dy;\n\t\trect.id = newrow + \"-\" + newcol;\n\t}", "function swap(){\n //console.log(grid);\n var tem=grid[boxIndx];\n grid[grid.indexOf(16)]=tem;\n grid[boxIndx]=16;\n boxNum=grid.indexOf(\"\");\n console.log(grid.indexOf(boxNum))\n fillGrid();\n moveNumbs++;\n move.innerText=`move:${moveNumbs}`;\n}", "function moveForward(rover){\nswitch(rover.direction){ //switch para ver en que dirección esta el rover y if para ver si esta en el limite del grid 10x10.\n case 'W':\n if (rover.positionX < 0 || rover.positionX > 10 ){\n console.log(\"limite\");\n }else{ //else - sino esta en el limite se puede mover adelante.\n rover.positionX -= 1;\n }\n break;\n case 'N': \n if (rover.positionY <= 0 || rover.positionY > 10){\n console.log(\"limite\");\n }else{ \n rover.positionY -=1;\n }\n break;\n case 'S':\n if (rover.positionY < 0 || rover.positionY >10){\n console.log(\"limite\");\n }else{\n rover.positionY +=1;\n }\n break;\n case 'E':\n if (rover.positionX < 0 || rover.positionX >10){\n console.log(\"limite\");\n }else{\n rover.positionX +=1;\n }\n break;\n } \nconsole.log(\"Avanza\"); \n}", "update(grid, start, end) {\n function isValid(position){\n return position.x >= 0 && position.y >= 0 && position.x < grid.length && position.y < grid[0].length;\n }\n\n var directions = [{dx:1, dy:0}, {dx:0, dy:1}, {dx:-1, dy:0}, {dx:0, dy:-1}];\n var alreadyVisited = [];\n var nextHop = [];\n for(var x=0; x<grid.length; x++){\n alreadyVisited[x] = [];\n nextHop[x] = [];\n }\n alreadyVisited[end.x][end.y] = true;\n nextHop[end.x][end.y] = {x: end.x, y: end.y};\n\n var stack = [end];\n while (stack.length > 0) {\n const current = stack.shift();\n for(let direction of directions){\n let newPosition = {x:current.x+direction.dx, y:current.y+direction.dy};\n if(isValid(newPosition)){\n if(!alreadyVisited[newPosition.x][newPosition.y]){\n nextHop[newPosition.x][newPosition.y] = current;\n if(!grid[newPosition.x][newPosition.y]){\n stack.push(newPosition);\n }\n }\n alreadyVisited[newPosition.x][newPosition.y] = true;\n }\n }\n }\n this.nextHop = nextHop;\n this.start = start;\n this.end = end;\n }", "move_to(x, y) {\n this.move(x - this.abs_x, y - this.abs_y)\n }", "function swap(e) {\r\n var pic1 = document.getElementById(\"dndPuzzlePic1\");\r\n\r\n var cells = [\r\n \"1 / 1 / 2 / 2\",\r\n \"1 / 2 / 2 / 3\",\r\n \"1 / 3 / 2 / 4\",\r\n \"2 / 1 / 3 / 2\",\r\n \"2 / 2 / 3 / 3\",\r\n \"2 / 3 / 3 / 4\"\r\n ];\r\n\r\n for (i = 0; i < 6; i++) {\r\n if (cells[i] == e.style.gridArea) {\r\n if (\r\n cells[i + 1] == pic1.style.gridArea &&\r\n i != 2 &&\r\n i != 5 &&\r\n i + 1 != 6\r\n ) {\r\n e.style.gridArea = cells[i + 1];\r\n pic1.style.gridArea = cells[i];\r\n i++; //skip next iteration to avoid swapping back to origianl positions\r\n } else if (cells[i - 1] == pic1.style.gridArea && i != 0 && i != 3) {\r\n e.style.gridArea = cells[i - 1];\r\n pic1.style.gridArea = cells[i];\r\n } else if (cells[i + 3] == pic1.style.gridArea && i < 3) {\r\n e.style.gridArea = cells[i + 3];\r\n pic1.style.gridArea = cells[i];\r\n break; //avoid swapping again\r\n } else if (cells[i - 3] == pic1.style.gridArea && i > 2) {\r\n e.style.gridArea = cells[i - 3];\r\n pic1.style.gridArea = cells[i];\r\n }\r\n }\r\n }\r\n}", "function move(cell) { if ((cellEmptyArray[0] === cellValArray[0] && cellEmptyArray[1] === cellValArray[1] + 1 && cellEmptyArray[2] === cellValArray[2] && cellEmptyArray[3] === cellValArray[3] + 1) || (cellEmptyArray[0] === cellValArray[0] && cellEmptyArray[1] === cellValArray[1] - 1 && cellEmptyArray[2] === cellValArray[2] && cellEmptyArray[3] === cellValArray[3] - 1) || (cellEmptyArray[0] === cellValArray[0] + 1 && cellEmptyArray[1] === cellValArray[1] && cellEmptyArray[2] === cellValArray[2] + 1 && cellEmptyArray[3] === cellValArray[3]) || (cellEmptyArray[0] === cellValArray[0] - 1 && cellEmptyArray[1] === cellValArray[1] && cellEmptyArray[2] === cellValArray[2] - 1 && cellEmptyArray[3] === cellValArray[3])) {\r\n cell.css('grid-area', cellEmpty);\r\n $('.slide__9').css('grid-area', cellVal);\r\n cellEmpty = cellVal;\r\n }\r\n}", "function moveRow5R(grid) {\n for (let i = 0; i < 35; i++) {\n if ((grid[i].position) > 27) {\n grid[i].position += 1;\n } if (grid[i].position > 34) {\n grid[i].position = 28;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "moveForward() {\n if (this._moving) {\n this._loc = Vector.add(this._loc, this.step);\n if (Vector.compare(this.front, this.back, this.speed)) {\n this._gridLoc = this._loc;\n }\n }\n }", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "function dragFixup(col, row) {\n\n\t\tif(col < 0 || col > maxCols || row < 0 || row > maxHeight){\n\t\t\t$('.ui-draggable-dragging').remove();\n\t\t\treturn;\n\t\t}\n\t\tvar targetId = board[col-1][row-1].tile;\n\t\tvar targetX = parseInt($('#'+targetId).attr('col'));\n\t\tvar targetY = parseInt($('#'+targetId).attr('row'));\n\t\tvar targetSizeX = parseInt($('#'+targetId).attr('sizex'));\n\t\tvar targetSizeY = parseInt($('#'+targetId).attr('sizey'));\n\t\tvar targetGrid = $('#'+targetId);\n\t\tvar startGrid = $('#'+dragStartId);\n\t\tif(targetId == dragStartId) {\n\t\t\tvar targetOffset = offset_from_location(row,col);\n\t\t\t$('#'+targetId).css({\n\t\t\t\t'top':dragStartOffset.top,\n\t\t\t\t'left':dragStartOffset.left,\n\t\t\t\t'height':dragStartSizeY*tileHeight,\n\t\t\t\t'width':dragStartSizeX*tileWidth\n\t\t\t});\n\t\t} else {\n\t\t\tvar startOffset = offset_from_location(dragStartSizeY, dragStartSizeX);\n\t\t\tvar targetOffset = offset_from_location(targetY, targetX);\n\t\t\tstartGrid.attr({\n\t\t\t\t'col': targetGrid.attr('col'),\n\t\t\t\t'row': targetGrid.attr('row'),\n\t\t\t\t'sizex': targetGrid.attr('sizex'),\n\t\t\t\t'sizey': targetGrid.attr('sizey')\n\t\t\t});\n\t\t\tstartGrid.css({\n\t\t\t\t'top':targetOffset.top,\n\t\t\t\t'left':targetOffset.left,\n\t\t\t\t'width':parseInt(startGrid.attr('sizex'))*tileWidth,\n\t\t\t\t'height':parseInt(startGrid.attr('sizey'))*tileHeight\n\t\t\t});\n\t\t\tupdate_board(dragStartId);\n\n\t\t\ttargetGrid.attr({\n\t\t\t\t'col': dragStartX,\n\t\t\t\t'row': dragStartY,\n\t\t\t\t'sizex': dragStartSizeX,\n\t\t\t\t'sizey': dragStartSizeY\n\t\t\t});\n\t\t\ttargetGrid.css({\n\t\t\t\t'top':dragStartOffset.top,\n\t\t\t\t'left':dragStartOffset.left,\n\t\t\t\t'width':parseInt(targetGrid.attr('sizex'))*tileWidth,\n\t\t\t\t'height':parseInt(targetGrid.attr('sizey'))*tileHeight\n\t\t\t});\n\t\t\tupdate_board(targetId);\n\t\t}\n\t}", "update(grid) {\n switch (this.dir) {\n case 0:\n this.duplicateToNegativeY(grid);\n break;\n case 1:\n this.duplicateToPositiveX(grid);\n break;\n case 2:\n this.duplicateToPositiveY(grid);\n break;\n case 3:\n this.duplicateToNegativeX(grid);\n break;\n }\n }", "move(direction) {\n // NOTE: West movement should -- and east should ++. Need to work on map orientation\n if (direction === \"north\" && this.currentCell.hasLink(this.currentCell.north) === true) {\n //alert(\"north\");\n this.y++;\n this.currentCell = this.currentCell.north;\n }\n if (direction === \"west\" && this.currentCell.hasLink(this.currentCell.west) === true) {\n //alert(\"west\");\n this.x--;\n this.currentCell = this.currentCell.west;\n }\n if (direction === \"south\" && this.currentCell.hasLink(this.currentCell.south) === true) {\n //alert(\"south\");\n this.y--;\n this.currentCell = this.currentCell.south;\n }\n if (direction === \"east\" && this.currentCell.hasLink(this.currentCell.east) === true) {\n //alert(\"east\");\n this.x++;\n this.currentCell = this.currentCell.east;\n }\n }", "function movePiece(oldPosition, newPosition){\n currentState2D[newPosition[1]][newPosition[0]] = currentState2D[oldPosition[1]][oldPosition[0]] \n currentState2D[oldPosition[1]][oldPosition[0]] = 0 \n drawPieces() ; \n}", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "placeOn(board) {\n board.place(this.el, this.gridPosition);\n }", "function moveCol5Dn(grid) {\n for (let i = 0; i < 46; i++) {\n if ((grid[i].position - 4) % 7 === 0) {\n grid[i].position += 7;\n } if ((grid[i].position) > 45) {\n grid[i].position = 4;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "advance(gb,nextPos){\r\n let somePos = nextPos;\r\n gb.setGridCell(nextPos,this); \r\n this.prevPos = this.pos;\r\n this.pos = somePos;\r\n return false;\r\n }", "function moveTile() {\n moveTileHelper(this);\n }", "move() {\n if (this.crashed) {\n return;\n }\n if (this.direction == 1) {\n this.y -= settings.step;\n }\n else if (this.direction == 2) {\n this.x += settings.step;\n }\n else if (this.direction == 3) {\n this.y += settings.step;\n }\n else if (this.direction == 4) {\n this.x -= settings.step;\n }\n }", "function move(from, to) {\n\n}", "function moveCol6Up(grid) {\n for (let i = 0; i < 48; i++) {\n if ((grid[i].position - 5) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 47;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function resetGrid() {\n gridPositionsi = [0];\n gridPositionsj = [0];\n userMoves = [0];\n id =0;\n $('.gridsquare'+width).removeClass('cursor'+width);\n $('.gridsquare'+width).removeClass('correct-square')\n $('.gridsquare'+width).removeClass('incorrect-square');\n $('#0').html('<div class=\"cursor'+width+'\"></div>');\n $('.cursor'+width).addClass('animated infinite pulse')\n}", "function setCellPositon() {\n puzzleData.forEach((item, index) => {\n if (item.value) _move(item.el, index);\n })\n }", "function moveCol6Dn(grid) {\n for (let i = 0; i < 48; i++) {\n if ((grid[i].position - 5) % 7 === 0) {\n grid[i].position += 7;\n } if ((grid[i].position) > 47) {\n grid[i].position = 5;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveRow5L(grid) {\n for (let i = 28; i < 35; i++) {\n if ((grid[i].position) > 27) {\n grid[i].position -= 1;\n } if (grid[i].position < 28) {\n grid[i].position = 34;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function movementLogic(ant) {\n if(grid[ant.x][ant.y] == 0) {\n ant.turnRight();\n grid[ant.x][ant.y] = 1;\n } else if (grid[ant.x][ant.y] == 1) {\n ant.turnLeft();\n grid[ant.x][ant.y] = 0;\n }\n stroke(color(255 * grid[ant.x][ant.y]));\n ant.moveForward();\n point(ant.x ,ant.y);\n}", "function move(clmn, toClmn) {\r\n\r\n var popped = null;\r\n\r\n if(clmn.length > 0) {\r\n\r\n popped = clmn.pop();\r\n addToColumn(toClmn, popped);\r\n\r\n\r\n }\r\n}", "function moveCol7Up(grid) {\n for (let i = 0; i < 49; i++) {\n if ((grid[i].position +1) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 48;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function move() {\n\t\tmovePiece(this);\n\t}", "moveBoxes(actualI, actualJ, dir = this.playerDir) {\r\n\r\n //Obtiene la posible siguiente posicion de la caja de acuerdo hacia donde empuja el jugador\r\n let nextI, nextJ;\r\n if (dir === \"playerUp\") {\r\n nextI = actualI - 1;\r\n nextJ = actualJ;\r\n } else if (dir === \"playerDown\") {\r\n nextI = actualI + 1;\r\n nextJ = actualJ;\r\n } else if (dir === \"playerLeft\") {\r\n nextI = actualI;\r\n nextJ = actualJ - 1;\r\n } else if (dir === \"playerRight\") {\r\n nextI = actualI;\r\n nextJ = actualJ + 1;\r\n }\r\n let actualCellMatrix = this.boardMatrix[actualI][actualJ];\r\n let nextCellMatrix = this.boardMatrix[nextI][nextJ];\r\n let moved = false;\r\n //Si no sale del tablero\r\n if (!(nextI < 0) && !(nextJ < 0) && !(nextI >= this.boardMatrix.length) && !(nextJ >= this.boardMatrix[0].length)) {\r\n\r\n //Si la siguiente posicion es vacia\r\n if (nextCellMatrix === \"e\") {\r\n this.boardMatrix[nextI][nextJ] = \"b\";\r\n moved = true;\r\n }\r\n //Si la siguiente posicion es objetivo\r\n else if (nextCellMatrix === \"o\") {\r\n this.boardMatrix[nextI][nextJ] = \"bo\";\r\n moved = true;\r\n }\r\n\r\n //Si se movio\r\n if (moved) {\r\n //Pinta la celda actual de acuerdo a si es objetivo o vacia\r\n if (actualCellMatrix === \"b\") {\r\n this.boardMatrix[actualI][actualJ] = \"e\";\r\n } else if (actualCellMatrix === \"bo\") {\r\n this.boardMatrix[actualI][actualJ] = \"o\";\r\n }\r\n this.paintPosition(actualI, actualJ);\r\n this.paintPosition(nextI, nextJ);\r\n\r\n }\r\n\r\n\r\n }\r\n return moved;\r\n\r\n }", "moveBack(tile, num, wario, goomba) {\n tile.viewportDiff += num;\n wario.viewportDiff += num;\n goomba.viewportDiff += num;\n }", "function move(direction) {\n var row, col;\n var canMove = true;\n undrawPiece();\n for (var i = 0; i < active.location.length; i++) {\n\n row = active.location[i][0];\n col = active.location[i][1];\n row += direction.row;\n col += direction.col;\n if (grid[row][col] !==-1 || grid[row][col] === BORDER) {\n canMove = false;\n }\n }\n if (canMove) {\n for (var i = 0; i < active.location.length; i++) {\n active.location[i][0] += direction.row;\n active.location[i][1] += direction.col;\n }\n active.pivot.r += direction.row;\n active.pivot.c += direction.col;\n }\n piece2Grid();\n drawBoard();\n return canMove;\n}", "function swapActiveGrid(){\n state.activeGrid = state.activeGrid ^ 1\n state.nextGrid = state.nextGrid ^ 1\n}", "moveLeftRight(val) {\r\n let newGrid = []\r\n for (let i = 0; i < this.size; i++) {\r\n let rowAdd = [];\r\n for (let j = 0; j < this.gameState.board.length; j++) {\r\n if ((i + 1) === Math.ceil(((j + 1) / this.size))) {\r\n rowAdd.push(this.gameState.board[j]);\r\n }\r\n }\r\n newGrid.push(rowAdd);\r\n }\r\n for (let i = 0; i < newGrid.length; i++) {\r\n if(val === 0) {newGrid[i] = this.aggregateUpLeft(newGrid[i])} else {newGrid[i] = this.aggregateDownRight(newGrid[i])}\r\n }\r\n let returnGrid = []\r\n for (let i = 0; i < this.size; i++) {\r\n for (let j = 0; j < this.size; j++) {\r\n returnGrid.push(newGrid[i][j])\r\n }\r\n }\r\n if(!(returnGrid.join(',') === this.gameState.board.join(','))){\r\n this.gameState.board = returnGrid;\r\n this.genNextSpot()\r\n }\r\n }", "function positionElementOnGrid(el, gridX, gridY) {\n el.style.left = px(gridX);\n el.style.top = px(gridY);\n }", "move(x, y) {\n\n this.tr.x += x;\n this.tr.y += y;\n }", "moveUpDown(val) {\r\n let newGrid = []\r\n for (let i = 0; i < this.size; i++) {\r\n let columnAdd = [];\r\n for (let j = i; j < this.gameState.board.length; j += this.size) {\r\n columnAdd.push(this.gameState.board[j]);\r\n }\r\n newGrid.push(columnAdd);\r\n }\r\n for (let i = 0; i < newGrid.length; i++) {\r\n if(val === 0) {newGrid[i] = this.aggregateUpLeft(newGrid[i])} else {newGrid[i] = this.aggregateDownRight(newGrid[i])}\r\n } \r\n let returnGrid = []\r\n for (let i = 0; i < this.size; i++) {\r\n for (let j = 0; j < this.size; j++) {\r\n returnGrid.push(newGrid[j][i])\r\n }\r\n }\r\n if(!(returnGrid.join(',') === this.gameState.board.join(','))){\r\n this.gameState.board = returnGrid;\r\n this.genNextSpot()\r\n }\r\n }", "moveChecker(start,end) \n {\n let startRow = Number(start[0]);\n let startColumn = Number(start[1]);\n let endRow = Number(end[0]);\n let endColumn = Number(end[1]);\n\n\n const checker = this.board.selectChecker(startRow, startColumn);\n // Then set that spot on the grid to null and set the spot at the end rowcolumn coordinate to the checker\n this.board.grid[start[0]][start[1]] = null;\n this.board.grid[end[0]][end[1]] = checker;\n\n // In the Game class, in the moveChecker method, after you have moved the checker, check to see if the distance of the start row and the end row is 2 by finding the absolute value of the difference between the rows\n \n let distance = difference(start[0], end[0]);\n if (distance === 2) {\n let killRow = (startRow + endRow) / 2;\n let killColumn = (startColumn + endColumn) / 2;\n this.board.killChecker([killRow, killColumn]);\n }\n }", "function moveTo(i, j) {\r\n\tif (gisGameEnd || gIsGlue) return\r\n\r\n\tvar targetCell = gBoard[i][j];\r\n\tif (targetCell.type === WALL) return;\r\n\r\n\t// Calculate distance to make sure we are moving to a neighbor cell\r\n\tvar iAbsDiff = Math.abs(i - gGamerPos.i);\r\n\tvar jAbsDiff = Math.abs(j - gGamerPos.j);\r\n\r\n\t// If the clicked Cell is one of the four allowed\r\n\tif ((iAbsDiff === 1 && jAbsDiff === 0) || (jAbsDiff === 1 && iAbsDiff === 0)) {\r\n\r\n\t\tif (targetCell.type === PASS) {\r\n\t\t\tvar newPos = specialPassage({ i, j })\r\n\t\t\ti = newPos.i\r\n\t\t\tj = newPos.j\r\n\t\t}\r\n\t\telse if (targetCell.gameElement === BALL) {\r\n\t\t\tBALL_AUDIO.play()\r\n\t\t\tgBallsCount--\r\n\t\t\tgBallsCollectedCount++\r\n\t\t\trenderBallsCounter()\r\n\t\t\tif (gBallsCount === 0) gameOver()\r\n\t\t}\r\n\t\telse if (targetCell.gameElement === GLUE) {\r\n\t\t\tGLUE_AUDIO.play()\r\n\t\t\tgIsGlue = true//Player cannot move\r\n\t\t\tclearInterval(gIntervalGlue)\r\n\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tgIsGlue = false\r\n\t\t\t\trenderCell(gGamerPos, GAMER_IMG)\r\n\t\t\t\tgIntervalGlue = setInterval(function () {\r\n\t\t\t\t\tcreateGlue()\r\n\t\t\t\t}, 5000)\r\n\t\t\t}, 3000)\r\n\t\t}\r\n\t\t// MOVING from current position\r\n\t\t// Model:\r\n\t\tgBoard[gGamerPos.i][gGamerPos.j].gameElement = null;\r\n\t\t// Dom:\r\n\t\trenderCell(gGamerPos, '');\r\n\r\n\t\t// MOVING to selected position\r\n\t\t// Model:\r\n\t\tgGamerPos.i = i;\r\n\t\tgGamerPos.j = j;\r\n\t\tgBoard[gGamerPos.i][gGamerPos.j].gameElement = GAMER;\r\n\t\t// DOM:\r\n\t\tif (!gIsGlue) {\r\n\t\t\trenderCell(gGamerPos, GAMER_IMG);\r\n\t\t} else renderCell(gGamerPos, GAMER_GLUE_IMG);\r\n\t}\r\n}", "function updateGrid(grid, startPos, endPos) {\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid[i].length; j++) {\n if (i === startPos[1] && j === startPos[0]) {\n grid[i][j] = 1;\n } else if (i === endPos[1] && j === endPos[0]) {\n grid[i][j] = 'R';\n }\n }\n }\n}", "move() {\n switch (this.f) {\n case NORTH:\n if(this.y + 1 < this.sizeY) this.y++;\n break;\n case SOUTH:\n if(this.y > 0) this.y--;\n break;\n case EAST:\n if(this.x + 1 < this.sizeX) this.x++;\n break;\n case WEST:\n default:\n if(this.x > 0) this.x--;\n }\n }", "function moveCol7Dn(grid) {\n for (let i = 0; i < 49; i++) {\n if ((grid[i].position +1) % 7 === 0) {\n grid[i].position += 7;\n } if ((grid[i].position) > 48) {\n grid[i].position = 6;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "moveTo() {\r\n this.move();\r\n if(this.position.x+this.width/2 > this.movingTo.x) {\r\n this.movement.x = -this.speed;\r\n this.side = false;\r\n } if(this.position.x+this.width/2 < this.movingTo.x) {\r\n this.movement.x = this.speed;\r\n this.side = true;\r\n }\r\n if(this.position.y+this.height/2 > this.movingTo.y) {\r\n this.movement.y = -this.speed;\r\n } if(this.position.y+this.height/2 < this.movingTo.y) {\r\n this.movement.y = this.speed;\r\n }\r\n }", "function moveRover(rover, direction, grid) {\n // console.log(grid.join('\\n'));\n switch (direction) {\n case 'N':\n if (rover.y - 1 >= 0) {\n // console.log(grid[rover.y - 1][rover.x]);\n // console.log(rover.x);\n // console.log(rover.y);\n if (grid[rover.y - 1][rover.x] === 'R') {\n console.log('You will crush into another rover!!!');\n } else if (grid[rover.y - 1][rover.x]) {\n rover.y -= 1;\n newPosition(rover);\n } else {\n console.log('Not possible, obstacle!');\n }\n } else {\n console.log('NO CAN DO! Board size error');\n }\n break;\n case 'S':\n if (rover.y + 1 <= 9) {\n // console.log(grid[rover.y + 1][rover.x]);\n // console.log(rover.x);\n // console.log(rover.y);\n if (grid[rover.y + 1][rover.x] === 'R') {\n console.log('You will crush into another rover!!!');\n } else if (grid[rover.y + 1][rover.x]) {\n rover.y += 1;\n newPosition(rover);\n } else {\n console.log('Not possible, obstacle!');\n }\n } else {\n console.log('NO CAN DO! Board size error');\n }\n break;\n case 'W':\n if (rover.x - 1 >= 0) {\n // console.log(grid[rover.y][rover.x - 1]);\n // console.log(rover.x);\n // console.log(rover.y);\n if (grid[rover.y][rover.x - 1] === 'R') {\n console.log('You will crush into another rover!!!');\n } else if (grid[rover.y][rover.x - 1]) {\n rover.x -= 1;\n newPosition(rover);\n } else {\n console.log('Not possible, obstacle!');\n }\n } else {\n console.log('NO CAN DO! Board size error');\n }\n break;\n case 'E':\n if (rover.x + 1 <= 9) {\n // console.log(grid[rover.y][rover.x + 1]);\n // console.log(rover.x);\n // console.log(rover.y);\n if (grid[rover.y][rover.x + 1] === 'R') {\n console.log('You will crush into another rover!!!');\n } else if (grid[rover.y][rover.x + 1]) {\n rover.x += 1;\n newPosition(rover);\n } else {\n console.log('Not possible, obstacle!');\n }\n } else {\n console.log('NO CAN DO! Board size error');\n }\n break;\n default:\n console.log('Not a valid direction!');\n break;\n }\n}", "move() {\n this.x = this.x - 7\n }", "function move(){\n\t\t\tvar head={x:snakeArr[snakeArr.length-1].x+dx,y:snakeArr[snakeArr.length-1].y+dy};\n\t\t\tsnakeArr.push(head);\n\t\t\tsnakeArr.shift();\n\t\t\tsnakeArr.forEach(function(e,i){paint(e.x,e.y,'white','black',cellW);});\n\t\t}", "movePiece(other) {\n var pieceElement = document.getElementById('tile' + this.row + this.col).firstChild;\n other.acceptPiece(pieceElement, this.piece);\n this.piece = null;\n }", "function positionFixup(){\n\t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t\t\tvar layout = returnBalanced(maxCols, maxHeight);\n\t\t\tvar t = $('#'+tiles[i]);\n\t\t\tt.attr({\n\t\t\t\t'row': layout[tiles.length-1][i].row(maxHeight),\n\t\t\t\t'col': layout[tiles.length-1][i].col(maxCols),\n\t\t\t\t'sizex': layout[tiles.length-1][i].sizex(maxCols),\n\t\t\t\t'sizey': layout[tiles.length-1][i].sizey(maxHeight)\n\t\t\t});\n\t\t\tvar tile_offset = offset_from_location(parseInt(t.attr('row')), parseInt(t.attr('col')));\n\t\t\tt.css({\n\t\t\t\t\"top\": tile_offset.top,\n\t\t\t\t\"left\":tile_offset.left,\n\t\t\t\t\"width\":t.attr('sizex')*tileWidth,\n\t\t\t\t\"height\":t.attr('sizey')*tileHeight});\n\t\t\tupdate_board(tiles[i]);\n\t\t};\n\t}", "move(){\n this.x1 -= this.velocidade;\n this.x2 -= this.velocidade;\n \n \n // Preparando para a volta do background para o início.\n if (this.x1 < -width)\n {\n this.x1 = width;\n }\n \n if (this.x2 < -width)\n {\n this.x2 = width;\n }\n \n \n }", "function myMove(e){\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "moveTo(row, col, piece) {\r\n this.fillAt(piece.row, piece.col, null);\r\n this.fillAt(row, col, piece);\r\n }", "move(){\n this.x = this.x + this.s;\n if (this.x > width){\n this.x = 0;\n }\n }", "function move(initRow, initCol, finRow, finCol) {\r\n var ir = initRow, ic = initCol, fr = finRow, fc = finCol;\r\n var obj1 = sliders[fr*gridColumns + fc];\r\n\r\n this.reverseMove = function() {\r\n if (sliders[ir*gridColumns + ic] == null) {\r\n obj1.attr(\"x\", ic*cellWidth + offsetWidth/2).attr(\"y\", ir*cellHeight + offsetHeight/2)\r\n .transition().duration(400).attr(\"transform\", \"translate(\" + (ic*cellWidth + offsetWidth/2) + \",\" + (ir*cellHeight + offsetHeight/2) + \")\");\r\n sliders[ir*gridColumns + ic] = obj1;\r\n sliders[fr*gridColumns + fc] = null;\r\n } else {\r\n var obj2 = sliders[ir*gridColumns + ic];\r\n obj1.attr(\"x\", ic*cellWidth + offsetWidth/2).attr(\"y\", ir*cellHeight + offsetHeight/2)\r\n .transition().duration(400).attr(\"transform\", \"translate(\" + (ic*cellWidth + offsetWidth/2) + \",\" + (ir*cellHeight + offsetHeight/2) + \")\");\r\n obj2.attr(\"x\", fc*cellWidth + offsetWidth/2).attr(\"y\", fr*cellHeight + offsetHeight/2)\r\n .transition().duration(400).attr(\"transform\", \"translate(\" + (fc*cellWidth + offsetWidth/2) + \",\" + (fr*cellHeight + offsetHeight/2) + \")\");\r\n sliders[ir*gridColumns + ic] = obj1;\r\n sliders[fr*gridColumns + fc] = obj2;\r\n }\r\n }\r\n }", "function dogTwoMovingXandY(){\n for (var i = 0; i < [dogTwoMove]; i++){\n var boardX = boardPos[i][0]+\"px\"\n var boardY = boardPos[i][1]+'px'\n $(\"#dogTwo\").css({transform: 'translate(' + boardX + ',' + boardY + ')'});\n }\n return;\n }", "moveNorth(){\n this.move ( 'N' );\n }", "move() {\n //Move the kid to the determined location\n this.x = this.nextMoveX;\n this.y = this.nextMoveY;\n //Check in case the kid touches the edges of the map,\n // if so, prevent them from leaving.\n this.handleConstraints();\n }", "function snap_Element_to_gridSpace(element_to_Snap_to_gridSpace, grid_to_Snap_To) {\n\t\n\tvar node = element_to_Snap_to_gridSpace, grid = grid_to_Snap_To;\n\t\n\tif (grid) {\t\t\n\t connectGridandNode(node, grid);\t\n\t return;\n\t}\n\t\n\t//We need to find what grid it is in\n\tvar nearest_grid = return_Nearest_grid(\n\t\tnode.x + node.centerPoint.x,\n\t\tnode.y + node.centerPoint.y);\n\t\n\t//If there is a node there dont place it down\n\tif ( nearest_grid.occupant ) {\n\t\treturn;\n\t}\n\t\n\tconnectGridandNode(node, nearest_grid);\n\t\n}", "function DogTwoMovingXandY(){\n // checkWinner();\n for (var i = 0; i < dogTwo.move; i++){\n var boardX = boardPos[i][0] + \"px\"\n var boardY = boardPos[i][1] + 'px';\n $dogTwo.css({transform: 'translate(' + boardX + ',' + boardY + ')'});\n }\n return;\n }", "function moveTo(i, j) {\n\tvar isBorderPos = false;\n\t\n\t// set i and J for the passages\n\tif (i < 0 || i >= gBoard.length) {\n\t\tisBorderPos = true;\n\t\ti = Math.abs(Math.abs(i) - gBoard.length);\n\t}\n\tif (j < 0 || j >= gBoard[0].length) {\n\t\tisBorderPos = true;\n\t\tj = Math.abs(Math.abs(j) - gBoard[0].length);\n\t}\n\t// var targetCell = gBoard[i][j];\n\tvar targetCell = gBoard[i][j];\n\tif (targetCell.type === WALL) return;\n\n\t// Calculate distance to ake sure we are moving to a neighbor cell\n\tvar iAbsDiff = Math.abs(i - gGamerPos.i);\n\tvar jAbsDiff = Math.abs(j - gGamerPos.j);\n\n\t// If the clicked Cell is one of the four allowed\n\tif ((iAbsDiff === 1 && jAbsDiff === 0) || (jAbsDiff === 1 && iAbsDiff === 0) || isBorderPos) {\n\t\tgIsGameOn = true;\n\n\n\n\t\t\n\t\tif (targetCell.gameElement === BALL) {\n\t\t\tconsole.log('Collecting!');\n\t\t\t//Show how many balls were collected\n\t\t\tgColector = document.querySelector('.colector');\n\t\t\t\n\t\t\tgColector.innerText++;\n\t\t\tif (+gColector.innerText === gBallsToCollect) {\n\t\t\t\t// console.log('game over elad')\n\t\t\t\tgameOver();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// MOVING\n\t\tgBoard[gGamerPos.i][gGamerPos.j].gameElement = null;\n\t\trenderCell(gGamerPos, '');\n\t\tgGamerPos.i = i;\n\t\tgGamerPos.j = j;\n\t\tgBoard[gGamerPos.i][gGamerPos.j].gameElement = GAMER;\n\t\trenderCell(gGamerPos, GAMER_IMG);\n\t\tisBorderPos = false;\n\n\t} // else console.log('TOO FAR', iAbsDiff, jAbsDiff);\n\n}", "move(){\n for(let i = this.snake.length - 1; i > 0; i--){\n this.snake[i].style.left = `${this.snake[i - 1].offsetLeft}px`;\n this.snake[i].style.top = `${this.snake[i - 1].offsetTop}px`;\n }\n switch(this.direction){\n case LEFT:\n this.snakeHead.style.left = `${this.snakeHead.offsetLeft - this.cellWidth}px`;\n break;\n case UP:\n this.snakeHead.style.top = `${this.snakeHead.offsetTop - this.cellWidth}px`;\n break;\n case RIGHT:\n this.snakeHead.style.left = `${this.snakeHead.offsetLeft + this.cellWidth}px`;\n break;\n case DOWN:\n this.snakeHead.style.top = `${this.snakeHead.offsetTop + this.cellWidth}px`;\n break;\n }\n this.lastDirection = this.direction;\n }", "movePlayer() {\r\n const cellX = ~~$(this).get(0).dataset.x;\r\n const cellY = ~~$(this).get(0).dataset.y;\r\n const _map = this.map;\r\n _map.game.currentPlayer.moveTo(this, cellX, cellY);\r\n }", "move(){\n switch(this.direction){\n case \"n\":\n this.col-=1;\n this.direction=\"n\";\n break;\n case \"e\":\n this.row += 1;\n this.direction=\"e\"; \n break;\n case \"s\":\n this.col+=1;\n this.direction = \"s\";\n break;\n case \"w\":\n this. row -=1;\n this.direction=\"w\";\n }\n }", "slide(direction) {\r\n switch (direction) {\r\n case LEFT:\r\n for (let j = 0; j < DIMENSIONS; j++) {\r\n for (let i = 0; i < DIMENSIONS; i++) {\r\n let k = i + 1;\r\n while (k < DIMENSIONS && !this.grid[i][j]) {\r\n this.grid[i][j] = this.grid[k][j];\r\n this.grid[k][j] = 0;\r\n k++;\r\n }\r\n let done = false;\r\n while (k < DIMENSIONS && !done) {\r\n if (this.grid[i][j] === this.grid[k][j]) {\r\n this.grid[i][j] *= 2;\r\n this.grid[k][j] = 0;\r\n done = true;\r\n }\r\n k++;\r\n }\r\n }\r\n }\r\n break;\r\n case UP:\r\n for (let i = 0; i < DIMENSIONS; i++) {\r\n for (let j = 0; j < DIMENSIONS; j++) {\r\n let k = j + 1;\r\n while (k < DIMENSIONS && !this.grid[i][j]) {\r\n this.grid[i][j] = this.grid[i][k];\r\n this.grid[i][k] = 0;\r\n k++;\r\n }\r\n let done = false;\r\n while (k < DIMENSIONS && !done) {\r\n if (this.grid[i][j] === this.grid[i][k]) {\r\n this.grid[i][j] *= 2;\r\n this.grid[i][k] = 0;\r\n done = true;\r\n }\r\n k++;\r\n }\r\n }\r\n }\r\n break;\r\n case RIGHT:\r\n for (let j = 0; j < DIMENSIONS; j++) {\r\n for (let i = DIMENSIONS - 1; i >= 0; i--) {\r\n let k = i - 1;\r\n while (k >= 0 && !this.grid[i][j]) {\r\n this.grid[i][j] = this.grid[k][j];\r\n this.grid[k][j] = 0;\r\n k--;\r\n }\r\n let done = false;\r\n while (k >= 0 && !done) {\r\n if (this.grid[i][j] === this.grid[k][j]) {\r\n this.grid[i][j] *= 2;\r\n this.grid[k][j] = 0;\r\n done = true;\r\n }\r\n k--;\r\n }\r\n }\r\n }\r\n break;\r\n case DOWN:\r\n for (let i = 0; i < DIMENSIONS; i++) {\r\n for (let j = 0; j < DIMENSIONS; j++) {\r\n let k = j - 1;\r\n while (k >= 0 && !this.grid[i][j]) {\r\n this.grid[i][j] = this.grid[i][k];\r\n this.grid[i][k] = 0;\r\n k--;\r\n }\r\n let done = false;\r\n while (k >= 0 && !done) {\r\n if (this.grid[i][j] === this.grid[i][k]) {\r\n this.grid[i][j] *= 2;\r\n this.grid[i][k] = 0;\r\n done = true;\r\n }\r\n k--;\r\n }\r\n }\r\n }\r\n }\r\n }", "function moveStartOrEnd(prevIndex, newIndex, startOrEnd) {\n var updatedY = newIndex % maxCols;\n var updatedX = Math.floor((newIndex - updatedY) / maxCols);\n if (startOrEnd == \"start\") {\n source = [updatedX, updatedY];\n console.log(\"Updated source is at [\" + updatedX + \", \" + updatedY + \"]\")\n } else if (startOrEnd == \"end\") {\n destination = [updatedX, updatedY];\n console.log(\"Updated destination is at [\" + updatedX + \", \" + updatedY + \"]\")\n } else if (startOrEnd == \"end1\") {\n destination1 = [updatedX, updatedY];\n console.log(\"Updated destination1 is at [\" + updatedX + \", \" + updatedY + \"]\")\n }\n\n\n clearBoard(keepWalls = true); //if we move the nodes after running the algos then it clears the board and move the nodes\n return;\n}", "function moveCameraToBoard() {\n\tfor(var i=movements.length;i--;) {\n\t\tif(isMoveCameraTo(movements[i],camera.position.getComponent(i),positionFinal[i])) {\n\t\t\tadd = delta * movements[i] * speedTranslation[i];\n\t\t\tcamera.position.setComponent(i,camera.position.getComponent(i) + add);\n\t\t} else {\n\t\t\tpositionReached[i] = true;\n\t\t}\n\t\tif(isMoveCameraTo(rotation[i],camera.rotation.toVector3().getComponent(i),rotationFinal[i])) {\n\t\t\tadd = delta * rotation[i] * speedRotation[i];\t\t\t\n\t\t\tcamera.rotation[ABSCISSA[i]] = camera.rotation.toVector3().getComponent(i) + add;\n\t\t} else {\n\t\t\trotationReached[i] = true;\n\t\t}\n\t}\n}", "moveChess(oldGrid, newGrid) {\n\t\tif (this.get_piece(oldGrid) == null) return false;\n\t\tlet team = this.get_piece(oldGrid).team;\n\n\t\tthis.stackEatenPiece(oldGrid, newGrid, newGrid, newGrid.piece, false, Const.FLAG_NONE);\n\n\t\t//===================== Special Moves ========================\n\n\t\t// Passant Move\n\t\tthis.movePassantPawn(oldGrid, newGrid);\n\n\t\t// Castle Move\n\t\tthis.moveCastleKing(oldGrid, newGrid);\n\n\t\t// Remove newGrid piece if being eaten\n\t\tif (this.get_piece(newGrid)) {\n\t\t\tthis.eaten[this.get_piece(oldGrid).team].push(this.get_piece(newGrid).image);\n\t\t\tthis.stats[this.get_piece(newGrid).team] -= Const.VALUE[this.get_piece(newGrid).type];\n\t\t}\n\t\tnewGrid.piece = oldGrid.piece;\n\n\t\t//====================== Update Miscs =======================\n\n\t\t// Pawn to Queen Move\n\t\tthis.movePawnToQueen(oldGrid, newGrid);\n\n\t\t// Update king position\n\t\tif (oldGrid == this.king_grid[team])\n\t\t\tthis.king_grid[team] = newGrid;\n\n\t\t// Clear old grid piece\n\t\toldGrid.piece = -1;\n\n\n\t\tthis.switchTurn();\n\n\t\tthis.moves_applied ++;\n\n\t\tthis.colorLatestMove(oldGrid, newGrid);\n\n\t\treturn true;\n\t}", "function moveStartOrEnd(prevIndex,newIndex,startOrEnd) {\n\tvar newCellY = newIndex % totalCols;\n\tvar newCellX = Math.floor((newIndex - newCellY)/totalCols);\n\n\tif (startOrEnd == \"start\") {\n\t\tstartCell = [newCellX,newCellY];\n\t\tconsole.log(\"Moving start to [\"+newCellX+\",\"+newCellY+\"]\")\n\t} else {\n\t\tendCell = [newCellX, newCellY];\n\t\tconsole.log(\"Moving end to [\"+newCellX+\",\"+newCellY+\"]\")\n\t}\n\tclearBoard(keepWalls=true);\n\treturn;\n}", "function moveStartOrEnd(prevIndex,newIndex,startOrEnd) {\n\tvar newCellY = newIndex % totalCols;\n\tvar newCellX = Math.floor((newIndex - newCellY)/totalCols);\n\n\tif (startOrEnd == \"start\") {\n\t\tstartCell = [newCellX,newCellY];\n\t\tconsole.log(\"Moving start to [\"+newCellX+\",\"+newCellY+\"]\")\n\t} else {\n\t\tendCell = [newCellX, newCellY];\n\t\tconsole.log(\"Moving end to [\"+newCellX+\",\"+newCellY+\"]\")\n\t}\n\tclearBoard(keepWalls=true);\n\treturn;\n}" ]
[ "0.7277735", "0.70626795", "0.6920805", "0.68316376", "0.682442", "0.6781662", "0.6776107", "0.66860545", "0.6669701", "0.6667203", "0.66266286", "0.6598193", "0.6496671", "0.6494922", "0.6493021", "0.64929867", "0.6491298", "0.6466314", "0.6463256", "0.6459151", "0.64571863", "0.6451229", "0.6443574", "0.64350003", "0.6383008", "0.6372573", "0.6367768", "0.63611454", "0.6360628", "0.6360161", "0.6356912", "0.63406044", "0.634043", "0.633764", "0.6335209", "0.6332253", "0.63228476", "0.6312663", "0.6305464", "0.62994474", "0.62993497", "0.6291227", "0.6282171", "0.6278528", "0.6272384", "0.62704915", "0.6269702", "0.6262525", "0.6260176", "0.6258197", "0.6258089", "0.6253815", "0.62479746", "0.62406445", "0.6235547", "0.6231337", "0.6230991", "0.6225608", "0.6211754", "0.61997646", "0.6196671", "0.61942315", "0.6187823", "0.61877304", "0.6179728", "0.6164294", "0.615754", "0.6157386", "0.6155066", "0.6146008", "0.61406386", "0.6132897", "0.61313206", "0.6126432", "0.6114297", "0.6113679", "0.61069816", "0.6101932", "0.61013085", "0.6096056", "0.6094359", "0.6093158", "0.609236", "0.60890996", "0.6068186", "0.60637325", "0.6056405", "0.6054141", "0.6038346", "0.6036056", "0.6035136", "0.6033405", "0.603326", "0.6028979", "0.60277915", "0.6018203", "0.6017423", "0.60138947", "0.60104895", "0.60104895" ]
0.77663064
0
Add 0624 IDs to grids
function addID() { for (let i = 0; i < gs; i++) { if (getGrid(i) != undefined) { getGrid(i).id = i; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createElIds () {\n // squares on the board\n for (var i = 0; i < num_rows(); i++) {\n for (var j = 0; j < num_cols(); j++) {\n let square = i + '-' + j;\n squareElsIds[square] = square + '-' + uuid()\n }\n }\n }", "function createElIds() {\n // squares on the board\n for (var i = 0; i < COLUMNS.length; i++) {\n for (var j = 1; j <= 8; j++) {\n var square = COLUMNS[i] + j;\n SQUARE_ELS_IDS[square] = square + '-' + createId();\n }\n }\n\n // spare pieces\n var pieces = 'KQRBNP'.split('');\n for (var i = 0; i < pieces.length; i++) {\n var whitePiece = 'w' + pieces[i];\n var blackPiece = 'b' + pieces[i];\n SPARE_PIECE_ELS_IDS[whitePiece] = whitePiece + '-' + createId();\n SPARE_PIECE_ELS_IDS[blackPiece] = blackPiece + '-' + createId();\n }\n}", "function attachCellAnId(gBoard) {\r\n for (var i = 0; i < gBoard.length; i++) {\r\n for (var j = 0; j < gBoard.length; j++) {\r\n gBoard[i][j].id = i * gBoard.length + (j + 1);\r\n }\r\n }\r\n}", "_populateTileIdArray() {\n const counts = gridGeometry.getTileCounts()\n this._tileIdArray = new Array(counts.width).fill([]).map(() => {\n return new Array(counts.height)\n })\n this._tiles.forEach(tile => {\n const column = this._tileIdArray[tile.position.x]\n if (!column) {\n return\n }\n column[tile.position.y] = tile.id\n })\n }", "function initializeGridSize() {\n// var boardElement = document.querySelector(\".board\");\n\n array_GridTiles = document.querySelectorAll(\"#tile\");\n //go thru all found GridTiles, rename their ID to match the grid size\n\n \n array_GridTiles[1].appendChild(charOneSpr);\n array_GridTiles[2].appendChild(charTwoSpr);\n\n}", "function drawGameBoard (id){\n var placeholder = document.getElementById(id);\n \n for(var i = 0; i < row; i++){\n for(var j = 0; j < col; j++){\n var gridCell = document.createElement(\"div\");\n \n placeholder.appendChild(gridCell);\n gridCell.classList.add(\"gridItem\");\n gridCell.setAttribute(\"id\", `${id}-${i}-${j}`);\n }\n }\n}", "function updategrid(){\n var count=0;\n var html=\"\";\n turnnumber=0;\n while(count<(9)){\n html += '<tr>'; \n for(var j=0;j<3;j++){\n html+='<td>' + board[count++] + '</td>';\n }\n html += '</tr>';\n };\n document.getElementById('board').innerHTML = html;\n \n var cells = document.getElementsByTagName(\"td\"); \n//generate id for each square\n for (var i = 0; i < cells.length; i++) {\n cells[i].id=i;\n }\n}", "function createGrid(){\n for (var i = 0; i < 200; i++) {\n var div = document.createElement(\"div\");\n div.id = i;\n div.style.visibility = \"hidden\";\n document.getElementById(\"board\").appendChild(div);\n }\n if (!start) {\n for (var i = 0; i < 16; i++) {\n \t var div = document.createElement(\"div\");\n div.id = i.toString() + \"side\";\n div.style.visibility = \"hidden\";\n document.getElementById(\"upcoming\").appendChild(div);\n }\n }\n}", "function createGrid() {\n for (let i = 0; i < gridCellCount; i++) { // this adds id number to each cell / div\n const cell = document.createElement('div')\n cell.setAttribute('id', i)\n // cell.textContent = i\n cells.push(cell)\n grid.appendChild(cell)\n }\n \n // console.log('cells', cells)\n }", "function constructGridId(stepNumber, instrumentIndex, noteNumber) {\n\treturn 'step_' + stepNumber + '_instrument_' + instrumentIndex + '_note_' + noteNumber;\n}", "function CreateNoteGrid() {\n\tvar gridHTMLz = \"\";\n\tfor(i=0; i<9; i++) {\n\t\tgridHTMLz += '<div class=\"note-z\" id=\"nz' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"note-map-z\").innerHTML=gridHTMLz;\n}", "fixColumnIds() {\n for (let i = 0; i < this.settings.columns.length; i++) {\n const col = this.settings.columns[i];\n\n // Check for duplicate ID's and adjust them.\n const colsById = this.columnById(col.id);\n if (colsById.length > 1) {\n for (let k = 1; k < colsById.length; k++) {\n colsById[k].id = `${colsById[k].id}-${k}`;\n }\n }\n }\n }", "add6Row()\n {\n\n //loop through (6 times)*(rowCount)\n //give ids based on row\n\n }", "function updateHTML(){\n board.forEach(function(cols,col){\n cols.forEach(function(value,row){\n // name your ids with a string\n $(`#cell${row}${col}`).find('div').addClass( PLAYERS[ value ] )\n })\n })\n }", "function createGrid() {\r\n\tvar gameTable = $( \"<table></table>\" );\r\n\tfor(let i=0 ; i<gameSize ; i++) {\r\n\t\tvar line = $( \"<tr></tr>\" );\r\n\t\tfor(let j=0 ; j<gameSize ; j++) {\r\n\t\t\tvar cell = $( \"<td></td>\" );\r\n\t\t\tcell.addClass(\"cell\");\r\n\t\t\tcell.attr(\"id\", \"cell\"+i+\"-\"+j);\r\n\t\t\tcell.appendTo(line);\r\n\t\t}\r\n\t\tline.appendTo(gameTable);\r\n\t}\r\n\tgameTable.appendTo($( \"#floodit\" ));\r\n\t$( '<span id=\"flooditNbSteps\"></span>' ).appendTo($( \"#floodit\" ));\r\n}", "function createGrid() {\n for (let i=1; i<=gridSize; i++){\n var div = document.createElement(\"div\");\n div.id = 'n' + i;\n div.innerText = i;\n document.getElementById(\"target\").appendChild(div);\n }\n}", "function update_board(id){\n\t \tvar t = $('#'+id);\n\t \tfor (var k = parseInt(t.attr('col'))-1; k < parseInt(t.attr('col'))+parseInt(t.attr('sizex'))-1; k++) {\n\t \t\tfor (var j = parseInt(t.attr('row'))-1; j < parseInt(t.attr('row'))+parseInt(t.attr('sizey'))-1; j++) {\n\t \t\t\tboard[k][j].occupied = 1;\n\t \t\t\tboard[k][j].tile = id;\n\t \t\t};\n\t \t};\n\t }", "function createGrid(board){\n if (board === 'board1') {\n var prefix = 'P1'\n } else {\n var prefix = 'P2'\n }\n board = document.getElementById(board)\n var letters = ['A', 'B', 'C','D','E','F','G','H','I','J']\n var tbl = document.createElement('table');\n var tblBody = document.createElement('tbody');\n\n for(var i = 0; i < 10; i++){\n var row = document.createElement('tr');\n for(var j = 0; j < 10; j++){\n var id = prefix + letters[j] + (i + 1);\n var col = document.createElement('td');\n col.setAttribute('id', id);\n col.setAttribute('class', 'box');\n row.appendChild(col);\n }\n tblBody.appendChild(row);\n }\n tbl.appendChild(tblBody);\n board.appendChild(tbl);\n\n\n}", "createGameGrid (x, y) {\n while (y < 1080){\n while (x < 1920){\n const cell = this.add.rectangle(x, y, 192, 180).setInteractive()\n cell.setStrokeStyle(2, 0x000000)\n cell.alpha = 0.01\n this.gameGridCellGroup.add(cell)\n x += 192\n }\n if (x > 1920) {\n x = 96\n y += 180\n }\n }\n }", "function getCellId(numberOnCell) {\n return \"cell-\" + numberOnCell; \n }", "function cellId(i, j) {\n return 'cell_' + i + '_' + j;\n}", "drawBoard(){\n for(var i = 0; i<this.numColumns; i++){\n this.boardData.push([]);\n\n for(var j = 0; j<this.numRows; j++){\n\n this.boardData[i].push(new Hex(this, this.initOffset.x + i*this.hexWidth,this.initOffset.y +j*this.vertOffset, ((j%2) * this.hexWidth/2), {row: j, col: i}, this.hexScale, this.game));\n this.boardData[i][j].draw();\n\n }\n }\n console.log(this.identifierDict);\n\n }", "function padImgId2(id) {\n return ( id <= 999 ? `00${id}`.slice(-3) : id );\n}", "function crateGrid() {\n var yourGrid = document.getElementById(\"table-grid-your\");\n var enemyGrid = document.getElementById(\"table-grid-enemy\");\n var alphabet = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\"];\n var numbers = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n var ships = data.ships;\n for (i = 0; i < alphabet.length; i++) {\n var rowU = document.createElement(\"tr\");\n var rowE = document.createElement(\"tr\");\n for (j = 0; j < numbers.length; j++) {\n var colU = document.createElement(\"td\");\n var colE = document.createElement(\"td\");\n rowU.appendChild(colU);\n rowE.appendChild(colE);\n colU.id = \"U\" + alphabet[i] + numbers[j];\n colE.id = \"E\" + alphabet[i] + numbers[j];\n colU.innerHTML = alphabet[i] + numbers[j];\n colE.innerHTML = alphabet[i] + numbers[j];\n for (k = 0; k < ships.length; k++) {\n for (l = 0; l < ships[k].location.length; l++) {\n if (ships[k].location[l] == alphabet[i] + numbers[j]) {\n colU.setAttribute(\"class\", \"ship-location\");\n }\n }\n }\n }\n yourGrid.appendChild(rowU);\n enemyGrid.appendChild(rowE);\n }\n}", "function updateIDs(row) {\n\n for (var i = row+1; i < sched_id; i++) {\n\n let from = document.getElementById(\"from\"+i);\n let to = document.getElementById(\"to\"+i);\n let priority = document.getElementById(\"priority\"+i);\n if (from != null) {\n from.id = 'from'+(i-1);\n to.id = 'to'+(i-1);\n priority.id = 'priority'+(i-1);\n\n }\n\n }\n\n}", "function fillGrid() {\n let grid = 9;\n\n let gridArr = [];\n for (let i = 0; i < grid; i++) {\n const newDiv = document.createElement(\"div\");\n newDiv.classList.add(\"gam-layout\");\n newDiv.setAttribute(\"id\", `${i}`);\n gridArr.push(newDiv);\n gridCont.appendChild(newDiv);\n }\n return gridArr;\n }", "function createGrid(num) {\n for(let i = 0; i < num **2; i++) {\n container.appendChild(cellNode.cloneNode(true));\n }\n gridFormat(container, num);\n startColor(color);\n \n \n}", "function drawGrid(grid,width,height,xOffset,yOffset){ //OFFSETS DONT WORK, PLEASE FIX LATER\n\tfor(var x=1;x<width;x++){\n\t\tfor(var y=1;y<height;y++){\n\t\t\tdrawTile(grid[x][y][\"entityContent\"][\"name\"]+\".png\",x,y);\n\t\t}\n\t}\n}", "function CreateTileGrid() {\n\tvar gridHTML = \"\";\n\tfor(i=0; i<100; i++) {\n\t\tgridHTML += '<div class=\"grid\" id=\"t' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"tile-map\").innerHTML=gridHTML;\n\tvar gridHTMLz = \"\";\n\tfor(i=0; i<9; i++) {\n\t\tgridHTMLz += '<div class=\"grid-z\" id=\"tz' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"tile-map-z\").innerHTML=gridHTMLz;\n}", "function ShapeGrid(wid, hei) {\n this.map = [];\n for (var x=0; x<wid; x++) {\n var column = [];\n column.length = hei;\n column.fill(0);\n this.map.push(column);\n }\n }", "function CreateGraphicsGrid() {\n\tvar gridHTML = \"\";\n\tfor(i=0; i<100; i++) { // 10 x10\n\t\tgridHTML += '<div class=\"grid\" id=\"g' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"graphics-map\").innerHTML=gridHTML;\n\tvar gridHTMLz = \"\";\n\tfor(i=0; i<9; i++) { // 3x3\n\t\tgridHTMLz += '<div class=\"grid-z\" id=\"gz' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"graphics-map-z\").innerHTML=gridHTMLz;\n}", "function piece2Grid() {\n for (var i = 0; i < active.location.length; i++) {\n grid[active.location[i][0]][active.location[i][1]] = active.color;\n\n }\n}", "function createBoard(){\n for(let i=0; i<width*width; i++){\n const square = document.createElement('div');\n square.setAttribute('id', i);\n grid.appendChild(square);\n squares.push(square);\n }\n}", "function displayCellIDs() {\n let content_div = document.getElementById(panel.content.id);\n for (let i = 0; i < content_div.childElementCount; i++) {\n let cell_prompt_div = content_div.children[i].children[1].children[1].children[0];\n var cell_tag_div;\n if (cell_prompt_div.childElementCount < 1) {\n cell_tag_div = document.createElement('div');\n }\n else {\n cell_tag_div = cell_prompt_div.children[0];\n }\n cell_tag_div.innerHTML = \"(\" + String(i) + \")\";\n cell_prompt_div.appendChild(cell_tag_div);\n }\n }", "function newGridRows() {\n // Randomize the stone and grass rows\n var rows = Helpers.shuffleArray('SSSGG'.split('')).join('');\n\n // Only put the water in the top or bottom of the screen\n rows = Helpers.shuffleArray(['W', rows]).join('');\n\n // Set the new grid rows\n Resources.setGrid(rows);\n }", "function drawGridNum(grid, x, y, size=16, gridLines=true, noShow=[]){\n\tsize /= 2;\n\tfor (var r=0; r<grid.length; r++){\n\t\tfor(var c=0; c<grid[0].length; c++){\n\t\t\tif (gridLines == true)drawRectStroke(x + c*size*2, y + r*size*2, size*2, size*2);\n\t\t\tif (noShow.includes(grid[r][c]))continue;\n\t\t\tdrawText(x + c*size*2, y+size + r*size*2, grid[r][c], \"black\", \"left\", `${size}px Arial`);\n\t\t}\n\t}\n}", "function addGrid(strtLat, strtLang, width, height){\n for(var i = 0; i < .0005 * width; i += .0005){\n\tfor(var j = 0; j < .001 * height; j += .001){\n\n\t var\ttile = {\n\t\tlat: strtLat + i,\n\t\tlang: strtLang + j,\n\t\tstatus: -1,\n\t\tspecies: []};\n\t tileArray.tiles.push(tile);\n\t}}\n}", "function generateTileIds(tileWidth) {\n\tconst tileArr = [];\n\tfor (let x = 0; x < tileWidth; x++) {\n\t\tfor (let y = 0; y < tileWidth; y++) {\n\t\t\tlet tile_id = x;\n\t\t\ttile_id = tile_id << 8;\n\t\t\ttile_id += y;\n\t\t\ttileArr.push([tile_id]);\n\t\t}\n\t}\n\treturn tileArr;\n}", "function replaceBoard(id){\n let emptyCell = document.createElement(\"td\"); // empty cell html element\n emptyCell.id = id;\n let emptyDiv = document.createElement(\"div\"); // div element for empty_cell\n emptyDiv.className = \"empty_cell\";\n emptyCell.append(emptyDiv);\n calculateRow(id);\n\n let board = document.getElementById(rid);\n // console.log(throwTextNodes(board, rid));\n if (num % 6 === 0){\n board.insertBefore(emptyCell, board.childNodes[null]);\n }else{\n board.insertBefore(emptyCell, board.childNodes[positionToInsert(num, rno)]);\n }\n}", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "createGrid() {\n // loop to create the 8 rows\n for (let row = 0; row < 8; row++) {\n this.grid[row] = [];\n // push in 8 columns of nulls\n for (let column = 0; column < 8; column++) {\n this.grid[row].push(null);\n }\n }\n }", "function makeGrid() {\nfor (let x = 0; x < rowsNum.value ; x ++) {\n const insertRow = pixelCanvas.insertRow(0) ;\n for (let y = 0 ; y < cellsNum.value ; y ++) {\n insertRow.insertCell(0) ;\n }\n}\n\n}", "function renderGrids(x){\n\t\tfor (var i = 0; i < x; i++){\n\t\t\tvar pixels = document.createElement('div');\n\t\t\tpixels.className = 'miniDiv';\n\t\t\tcontainer.appendChild(pixels);\n\t\t}\n\t}", "function createTeamElId(team) {\n team.elId = [ 'team', team.id ].join('-');\n}", "function addIdentifier() {\n $scope.dataAttributeChartID = 'chartid' + Math.floor(Math.random() * 1000000001);\n angular.element($element).attr('id', $scope.dataAttributeChartID);\n configuration.bindto = '#' + $scope.dataAttributeChartID;\n }", "function make_Grid(WIDTH, HEIGHT) {\n var graphics = game.add.graphics(0, 0);\n\t\t\n //adding lines & numbers\n graphics.lineStyle(1, 0x33FF00,0.5);\n var style = { font: \"15px Arial\", fill: \"#ffffff\", align: \"center\" };\n\t\n for (indexAux = 0; indexAux < 10; indexAux = indexAux + 1){\n\ty = (indexAux * GRID_SPACE) + 50;\n\tgraphics.moveTo(0, y); \n\tgraphics.lineTo(WIDTH-20,y);\n\tgame.add.text(WIDTH-20,y-10,String((10-indexAux)),style);\n }\t\n}", "createGrid() {\n\t\t// loop to create the 8 rows\n\t\tfor (let row = 0; row < 8; row++) {\n\t\t\tthis.grid[row] = [];\n\t\t\t// push in 8 columns of nulls\n\t\t\tfor (let column = 0; column < 8; column++) {\n\t\t\t\tthis.grid[row].push(null);\n\t\t\t}\n\t\t}\n\t}", "function generateGrid() {\n gameBoard.childNodes[1].innerText = `It's ${game.turn.token}'s turn`;\n var grid = gameBoard.childNodes[3];\n grid.innerHTML = '';\n for (var i = 0; i < 9; i++) {\n gridIndex = i;\n grid.innerHTML += `\n <article class=\"${gridIndex}\">\n </article>\n `\n }\n game.resetGame();\n persistWins();\n}", "_init_grid() {\n\t\t\tfor (var i = 0; i < this._internal_grid_size[0]; i++) {\n\t\t\t\tthis._internal_grid.push([]);\n\t\t\t\tfor (var e = 0; e < this._internal_grid_size[1]; e++) {\n\t\t\t\t\tthis._internal_grid[i].push(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function createGameBoards() {\r\n for (i=0; i < 10; i++) {\r\n playerCoordinateEl.push([]);\r\n opponentCoordinateEl.push([]);\r\n for (j=0; j < 10; j++) {\r\n playerCoordinateEl[i][j] = document.createElement('div');\r\n opponentCoordinateEl[i][j] = document.createElement('div');\r\n playerCoordinateEl[i][j].id = `p-r${i}c${j}`;\r\n opponentCoordinateEl[i][j].id = `o-r${i}c${j}`;\r\n playerBoardEl.appendChild(playerCoordinateEl[i][j]);\r\n opponentBoardEl.appendChild(opponentCoordinateEl[i][j]);\r\n }\r\n }\r\n}", "function setBoardIds() \n{\n\t// For each category of board\n\t$(\"[id^=category_]\").each(function() {\n\t\tvar cat = $(this).attr('id').split('category_'),\n\t\t\tuls = $(this).find(\"ul\");\n\n\t\t// First up add drop zones so we can drag and drop to each level\n\t\tif (uls.length === 1)\n\t\t{\n\t\t\t// A single empty ul in a category, this can happen when a cat is dragged empty\n\t\t\tif ($(uls).find(\"li\").length === 0)\n\t\t\t\t$(uls).append('<li id=\"cbp_' + cat + ',-1,-1\"></li>');\n\t\t\t// Otherwise the li's need a child ul so we have a \"child-of\" drop zone\n\t\t\telse\n\t\t\t\t$(uls).find(\"li:not(:has(ul))\").append('<ul class=\"nolist\"></ul>');\n\t\t}\n\t\t// All others normally\n\t\telse\n\t\t\t$(uls).find(\"li:not(:has(ul))\").append('<ul class=\"nolist\"></ul>');\n\n\t\t// Next make find all the ul's in this category that have children, update the\n\t\t// id's with information that indicates the 1-n and parent/child info\n\t\t$(this).find('ul:parent').each(function(i, ul) {\n\n\t\t\t// Get the (li) parent of this ul\n\t\t\tvar parentList = $(this).parent('li').attr('id'),\n\t\t\t\t\tpli = 0;\n\n\t\t\t// No parent, then its a base node 0, else its a child-of this node\n\t\t\tif (typeof (parentList) !== \"undefined\")\n\t\t\t{\n\t\t\t\tpli = parentList.split(\",\");\n\t\t\t\tpli = pli[1];\n\t\t\t}\n\n\t\t\t// Now for each li in this ul\n\t\t\t$(this).find('li').each(function(i, el) {\n\t\t\t\tvar currentList = $(el).attr('id');\n\t\t\t\tvar myid = currentList.split(\",\");\n\n\t\t\t\t// Remove the old id, insert the newly computed cat,brd,childof\n\t\t\t\t$(el).removeAttr(\"id\");\n\t\t\t\tmyid = \"cbp_\" + cat[1] + \",\" + myid[1] + \",\" + pli;\n\t\t\t\t$(el).attr('id', myid);\n\t\t\t});\n\t\t});\n\t});\n}", "manageDuplicates(){\n\n // Manage duplicate IDs from swiper loop\n this.duplicates = this.sliderPastilles.container[0].querySelectorAll('.pastille--image.swiper-slide');\n\n for ( let i = 0; i < this.duplicates.length; i++ ){\n\n // Vars\n let mask = this.duplicates[i].querySelector('svg > defs > mask');\n let image = this.duplicates[i].querySelector('svg > image');\n\n // Update values\n let id = mask.getAttribute('id');\n let newId = id+i;\n\n mask.setAttribute('id', newId);\n image.setAttribute('mask','url(#'+newId+')');\n }\n }", "function buildBoard(){\n for(var i = 0; i < boardArr.length; i++){\n const deTile = document.createElement('div');\n deTile.classList = \"allTile \" + boardArr[i].color+'Tile';\n deTile.id = boardArr[i].tileLocation + \"Tile\";\n boardApp.appendChild(deTile);\n }\n}", "initSeq(seq) {\n let idx = 0;\n for (let i = 0; i < this.tileArr.length; i++) {\n for (let j = 0; j < this.tileArr[i].length; j++) {\n this.tileArr[i][j].sId = document.getElementById(\"shape\" + idx);\n idx++;\n }\n }\n }", "function ledGrid(index, stripLength, numStrips, x, y, ledSpacing, stripSpacing, angle, zigzag) {\n\tvar s = sin(angle + HALF_PI);\n\tvar c = cos(angle + HALF_PI);\n\tfor (var i = 0; i < numStrips; i++) {\n\t\tledStrip(\n\t\t\tindex + stripLength * i,\n\t\t\tstripLength,\n\t\t\tx + (i - (numStrips - 1) / 2.0) * stripSpacing * c,\n\t\t\ty + (i - (numStrips - 1) / 2.0) * stripSpacing * s,\n\t\t\tledSpacing,\n\t\t\tangle,\n\t\t\tzigzag && (i % 2) == 1);\n\t}\n}", "function buildGrid() {\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(config.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n // console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(config.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('cell');\n row.appendChild(cell);\n\n // console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\n}", "function addTiles(co,jk,jj,dp,dn,dq,dk,dj,dl,dh,dg,di){xc_eg(co,\"jn\",\"jn\",{\"width\":jk,\"height\":jj,\"jn\":[dp||\"\",dn||\"\",dq||\"\",dk||\"\",dj||\"\",dl||\"\",dh||\"\",dg||\"\",di||\"\"],\"ca\":0,\"bs\":0,\"id\":\"\"},0)}", "function setTracksGridContainer() {\n \n let emptySpaceCount = 0;\n\n for (let i = 0; i < rows; i++) {\n soundGrid[i] = []; // Make soundGrid a 2D array\n for (let j = 0; j < columns; j++) {\n \n let trackEmptySpace = document.createElement(\"div\");\n trackEmptySpace.ondragover = onDragOver;\n trackEmptySpace.ondragleave = onDragLeave;\n trackEmptySpace.ondrop = onDrop;\n trackEmptySpace.classList.add(\"track-empty-space\");\n trackEmptySpace.id = \"empty-space--\" + emptySpaceCount++;\n \n tracksGridContainer.appendChild(trackEmptySpace);\n\n // Adds a -1 instead of an empty audio buffer \n // to help keep track of empty spaces\n soundGrid[i][j] = -1;\n }\n }\n }", "setupGameBoard()\n {\n this.gameBoard.innerHTML = \"\";\n let newStyle = \"grid-template-columns: repeat(\" + this.xSize + \", 1fr); grid-template-rows: repeat(\" + this.ySize + \", 1fr);\";\n this.gameBoard.setAttribute(\"style\", newStyle);\n\n for (let row = 0; row < this.ySize; row++)\n {\n for (let col = 0; col < this.xSize; col++)\n {\n let newTile = document.createElement(\"div\");\n if (((col+row) % 2) == 0)\n {\n newTile.className = \"tile\";\n }\n else\n {\n newTile.className = \"tile odd\";\n }\n\n newTile.setAttribute(\"data-x\", col);\n newTile.setAttribute(\"data-y\", row);\n \n let tileStyle = \"grid-row: \" + (row+1) + \"; grid-column: \" + (col+1) + \";\";\n newTile.setAttribute(\"style\", tileStyle);\n\n this.gameState[col][row].tile = newTile;\n this.gameBoard.appendChild(newTile);\n }\n \n }\n\n this.setUpTileListeners();\n }", "function generateGrid() {\n const tileWidth = PHASER_CONFIG.width / SNAKE_GAME_CONFIG.gridSize.width;\n const tileHeight = PHASER_CONFIG.height / SNAKE_GAME_CONFIG.gridSize.height;\n\n this.spriteGrid = [];\n for (let x = 0; x < SNAKE_GAME_CONFIG.gridSize.width; x++) {\n for (let y = 0; y < SNAKE_GAME_CONFIG.gridSize.height; y++) {\n const sprite = this.physics.add.sprite((x + 0.5) * tileWidth, (y + 0.5) * tileHeight, 'whiteSquare64');\n sprite.displayWidth = tileWidth * 0.9;\n sprite.displayHeight = tileHeight * 0.9;\n sprite.tint = SNAKE_GAME_CONFIG.emptyTileColour;\n this.spriteGrid.push({gridPos: {x, y}, sprite});\n }\n }\n}", "function initBoards() {\n let boardIds = [\"playerboard\", \"enemyboard\"]\n let rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'];\n // init grey spaces\n for (let boardId of boardIds) {\n let board = document.getElementById(boardId);\n let id = boardId[0];\n for (let row of rows) {\n for (let col = 0; col < 10; col++) {\n let div = document.createElement(\"div\");\n div.id = `${id}${row}${col}`;\n div.className = \"opaque\";\n if (boardId === \"enemyboard\") {\n div.onclick = () => handleBoardClick(div.id);\n }\n board.appendChild(div);\n }\n }\n }\n}", "function displayGrid() {\n grid = $('#grid');\n // Creating all the rows in the grid\n for (var i=-1; i<12; i++) {\n // Getting the letter for the grid\n var char = getLetterFromIndex(i);\n\n // Creating all the tiles in the rows\n for (var j=-1; j<12; j++) {\n tile = $('<div class=\"tile\"></div>');\n\n // Setting id's for each tile\n var tileId = char + j;\n tile.attr(\"id\", tileId);\n\n // Appending each tile into the grid\n grid.append(tile);\n\n // styling the tiles\n $('.tile').css(\"box-sizing\", \"border-box\");\n $('.tile').css(\"width\", \"32px\");\n $('.tile').css(\"height\", \"32px\");\n\n // Setting correct tiles for every cell\n var imagePath = getImagePath(getImageForCoord(i, j));\n $('#' + tileId).css(\"background-image\", \"url(\" + imagePath + \")\");\n\n // Writing coordenates\n if (i == -1 && j > 0 && j < 11) {\n // Writing numbers\n $('#' + tileId).css(\"line-height\", \"32px\");\n $('#' + tileId).css(\"vertical-align\", \"middle\");\n $('#' + tileId).append($('<h3>' + j + '</h3>'))\n } else if (j == -1 && i > 0 && i < 11) {\n // Writing letters\n $('#' + tileId).css(\"line-height\", \"32px\");\n $('#' + tileId).css(\"vertical-align\", \"middle\");\n $('#' + tileId).append($('<h3>' + char + '</h3>'))\n }\n }\n\n }\n}", "function buildSweeperGrid() {\n\n var gameArea = document.getElementById('game');\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(game.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n row.classList.add('flex');\n console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(game.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('w-16');\n cell.classList.add('h-16');\n\n\n cell.classList.add('cell');\n cell.classList.add('border');\n cell.classList.add('border-black');\n cell.classList.add('m-0');\n row.appendChild(cell);\n\n console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\n}", "createGrids () {\n }", "renderGrid(){\n // Remove all child elements of previous grid\n while (this.GRID_DIV.firstChild) {\n var child = this.GRID_DIV.firstChild;\n this.GRID_DIV.removeChild(child);\n child.remove();\n }\n\n // https://developer.mozilla.org/en-US/docs/Glossary/Grid_Cell\n this.GRID_DIV.style.gridTemplateColumns = \"repeat(\" + this.COLUMN_COUNT + \", 1fr)\";\n for(var i=0; i < this.ROW_COUNT * this.COLUMN_COUNT; i++){\n if(document.getElementById(i.toString()) == undefined){\n var cell = document.createElement(\"div\");\n cell.id = i.toString();\n cell.className = \"bitmap_grid_cell\";\n\n cell.style.backgroundColor = \"white\";\n\n cell.onclick = this.cellLeftClickCallback.bind(this, cell);\n cell.oncontextmenu = this.cellRightClickCallback.bind(this, cell);\n cell.onmousemove = this.cellHoverCallback.bind(this, cell);\n\n this.GRID_DIV.appendChild(cell);\n }\n }\n }", "function mkTileIndice(){\n var tileIndice = []\n for(var i = 0; i < GAME_SIZE; i++)\n tileIndice.push(i);\n return tileIndice;\n}", "function Grid(hue_ids) {\n this.lights = [];\n\n // Create light objects for the lights in the grid\n for (var y=0; y<hue_ids.length; y++) {\n this.lights[y] = [];\n for (var x=0; x<hue_ids[y].length; x++) {\n if (hue_ids[y][x] != -1) {\n this.lights[y][x] = new Light(y, x, hue_ids[y][x]);\n } else {\n this.lights[y][x] = undefined;\n }\n }\n }\n console.log(\"Grid\", \"initialized with size \" + hue_ids[0].length + \", \" + hue_ids.length);\n}", "function createGrid() {\n clearValues();\n shuffleTiles();\n for (let i = 0; i < tiles.length; i++) {\n let tile = document.createElement('img');\n tile.setAttribute('src', 'assets/images/tile-back.jpg');\n tile.setAttribute('data-id', i);\n document.getElementById('tile-grid').appendChild(tile);\n tile.addEventListener('click', revealTile);\n }\n}", "function xy_to_id(cell) {\n return ROW * cell.x + cell.y + 1;\n}", "createGrid(starti, startj, endi, endj, level, mapped) {\n for (let i = 0; i < this.rows; i++) {\n\n let rowgrid = [];\n for (let j = 0; j < this.columns; j++) {\n let cell = new Cell(\n i, \n j, \n (i==starti && j==startj), \n (i==endi && j==endj), \n level, \n mapped\n );\n paintCell(cell);\n rowgrid.push(cell);\n }\n this.grid.push(rowgrid);\n }\n }", "function calcIconId(posX, posY) {\n\n return posX + posY * BOARD_COLS;\n\n}", "function staticUpdateCells(grid) {\r\n var new_canvas = getCanvas();\r\n for (var i = 0; i < NUM_ROWS; i += 1) {\r\n for (var j = 0; j < NUM_COLS; j += 1) {\r\n new_canvas.fillStyle = grid[i][j].fillStyle;\r\n new_canvas.fillRect(grid[i][j].xPosition, grid[i][j].yPosition, CELL_SIZE, CELL_SIZE);\r\n }\r\n }\r\n }", "function makeGrid() {\n $(\"tr\").remove();\n for (var h = 0; h < canvasHeight; h++) {\n var row = \"<tr>\";\n for (var w = 0; w < canvasWidth; w++) {\n tdNo++;\n row += '<td id=\"td' + tdNo + '\"></td>';\n }\n row += \"</tr>\";\n\n canvasCtl.append(row);\n }\n}", "function makeGrid() {\n\tfor (y = 0; y < sizeY; y++ ){\n\t\t$('#pixelCanvas').append('<tr>');\n\t\t\tfor(x = 0; x< sizeX; x++ ){\n\t\t\t\t$('#pixelCanvas tr:last-child').append('<td></td>');\n\t\t\t}\n\t\t$('#pixelCanvas').append('</tr>');\n\t}\n}", "function ledGrid8x8(index, x, y, spacing, angle, zigzag) {\n\tledGrid(index, 8, 8, x, y, spacing, spacing, angle, zigzag);\n}", "buildGrid() {\n const $game = $(this.selector);\n for (let row = 0; row < this.Rows; row++) {\n const $row = $(\"<div>\")\n .addClass(\"row\");\n //columns must be nested inside of the rows. for-loop will generate columns.\n for (let col = 0; col < this.Cols; col++) {\n const $col = $(\"<div>\")\n .addClass(\"empty column\")\n .attr(\"data-column\", col)\n .attr(\"data-row\", row)\n $row.append($col);\n }\n $game.append($row);\n }\n }", "makeGrid() {\n // Create cells of a grid, store them in a grid, and give them the data that they need.\n gameState.grid = [];\n for (let x = 0; x < gameState.GRID_WIDTH; x++) {\n gameState.grid[x] = [];\n for (let y = 0; y < gameState.GRID_HEIGHT; y++) {\n let newCell = this.add.sprite((x * (gameState.CELL_DIMS + gameState.PADDING)) + gameState.INIT_X, (y * (gameState.CELL_DIMS + gameState.PADDING)) + gameState.INIT_Y, 'cell');\n newCell.number = parseInt((Math.random() * gameState.maxNumber) + gameState.minNumber); // Number between min and maxNumber\n newCell.targetNumber = this.checkTargetNumber(newCell.number); // Whether number is a target number\n newCell.absorbed = false; // Number has not been absorbed yet (since we just created it)\n newCell.printNumber = newCell.number.toString(); // Number as a string.\n gameState.grid[x][y] = newCell; // Add it to the grid.\n newCell.print = this.add.text(newCell.x-10, newCell.y-10, newCell.printNumber, {\n align: \"center\",\n font: gameState.INFO_FONT,\n fill: '#ffffff'\n }).setTint(0x000000); // We use tint since we change the color of the numbers.\n }\n }\n }", "function InitBoard() {\n var light = 1;\n var colour;\n var rank;\n var file;\n\n for (i = 1; i <= 8; i++) {\n\n light ^= 1;\n rank = \"rank\" + i;\n for (j = 1; j <= 8; j++) {\n file = \"file\" + j;\n if (light == 0) {\n colour = \"light\";\n } else {\n colour = \"dark\";\n }\n light ^= 1;\n squareString = \"<div class=\\\"square \" + rank + \" \" + file + \" \" + colour + \"\\\"/>\";\n $(\"#board\").append(squareString);\n\n }\n }\n\n var currentSquare = 0;\n for (var i = 0; i < boardData.length; i++) {\n if (boardData[i] != 99) {\n $(\".square:eq(\" + currentSquare + \")\").attr('id', '' + i + '');\n currentSquare++;\n }\n }\n}", "function createBoard(grid, squares) {\n for (let i = 0; i < nbSquares * nbSquares; i++) {\n const square = document.createElement('div');\n square.dataset.id = i; // we give each square an id\n grid.appendChild(square);\n squares.push(square);\n }\n }", "function createCell() {\n for (let i = 0; i < 16; i++) {\n let Box = document.createElement(\"div\");\n Box.classList.add(\"cell\");\n Box.setAttribute(\"data-address\", i);\n Box.innerHTML = 0;\n\n MainGRid.append(Box);\n }\n}", "function tileCoordinateToTileId(tilesBetween){\r\n var activeRow = 0;\r\n var bottomTile = 0;\r\n var columnOffset = 1;\r\n var topTile = 0;\r\n \r\n //remove tile overlays, before re-generating them\r\n $('.map .tile-overlay').remove();\r\n \r\n $.each(tilesBetween,function(index,value){\r\n //apply tile overlay functionality\r\n columnOffset++;\r\n \r\n if(index%(config.columnsWide+1)==0){\r\n activeRow++;\r\n columnOffset = 1;\r\n };\r\n\r\n var tileLeftPixel = (0 - (nwPixelCoordinate.x%config.tileSize) + ((columnOffset-1)*config.tileSize));\r\n var tileTopPixel = (0 - (nwPixelCoordinate.y%config.tileSize) + ((activeRow-1)*config.tileSize));\r\n var tileId = (parseInt(tilesBetween[index].y) * (Math.pow(2,config.currentZoomLevel)) + parseInt(tilesBetween[index].x));\r\n \r\n addTileOverlay({\r\n coordinateX:tilesBetween[index].x,\r\n coordinateY:tilesBetween[index].y,\r\n left:tileLeftPixel,\r\n tileId:tileId,\r\n tilePosition:index+1,\r\n top:tileTopPixel,\r\n zoomLevel:config.currentZoomLevel\r\n });\r\n \r\n if(index == 0){topTile = tileId;}\r\n if(index == tilesBetween.length-1){bottomTile = tileId;}\r\n\r\n $.logEvent('[$.tileCoordinateToTileId]: Map columns: ' + (config.columnsWide+1) + ', tile y coordinate: ' + parseInt(tilesBetween[index].y) + ' tiles in map: ' + (Math.pow(2,config.currentZoomLevel)) + ', tile x coordinate: ' + parseInt(tilesBetween[index].x) + ', tile id(' + tilesBetween[index].x + ',' + tilesBetween[index].y + ') = ' + tileId);\r\n\r\n //if the map is rendering for the first time, load the tiles based on the tile bounds\r\n if(config.loaded){\r\n //only request tile data if has not previously been requested\r\n if($.inArray(config.currentZoomLevel + '/' + tileId,config.tilesPreviouslyLoaded) == -1){\r\n $.logEvent('[$.tileCoordinateToTile]: subsequent map load');\r\n \r\n $.ajax({\r\n dataType:'jsonp',\r\n success:function(data){\r\n $.each(data.serviceResponse.body.teams,function(index,value){\r\n //build markers for each location\r\n renderMarker({\r\n latitude:this.lat,\r\n longitude:this.lon,\r\n teamId:this.id\r\n });\r\n }); \r\n //config.markerClusterObj = new MarkerClusterer(config.map,config.markersObj);\r\n },\r\n url:config.webservices.teams + '?tile=' + tileId + '&zoom=' + config.currentZoomLevel + '&number=100&reduced=true'\r\n });\r\n \r\n //stored new tileId into array, so that this tile is never re-requested\r\n config.tilesPreviouslyLoaded.push(config.currentZoomLevel + '/' + tileId);\r\n }\r\n }\r\n else{ \r\n //stored new tileId into array, so that this tile is never re-requested\r\n config.tilesPreviouslyLoaded.push(config.currentZoomLevel + '/' + tileId);\r\n }\r\n });\r\n \r\n //set boolean to indicate that the map has had its bounds changed at least once, so that a different type of data request can be made\r\n if(!config.loaded){\r\n $.logEvent('[$.tileCoordinateToTile]: initial map load');\r\n \r\n //load map for the first time, using the bounds of the map\r\n $.ajax({\r\n dataType:'jsonp',\r\n success:function(data){\r\n $.each(data.serviceResponse.body.teams,function(index,value){\r\n //build markers for each location\r\n renderMarker({\r\n latitude:this.lat,\r\n longitude:this.lon,\r\n teamId:this.id\r\n });\r\n }); \r\n //config.markerClusterObj = new MarkerClusterer(config.map,config.markersObj);\r\n },\r\n url:config.webservices.teamsCombined + '?zoom=' + config.currentZoomLevel + '&number=250&topTile=' + topTile + '&bottomTile=' + bottomTile\r\n });\r\n \r\n config.loaded = true;\r\n }\r\n }", "function setNewGame() {\n const fieldsArr = board.fields;\n\n for (let i = 0; i <= 64; i++) {\n let startPostion = fieldsArr[i];\n let piece = false;\n\n if (i >= 8 && i <= 15) {\n piece = new Pawn('pawn', 'black', i);\n }\n\n else if (i >= 48 && i <= 55) {\n piece = new Pawn('pawn', 'white', i);\n } \n \n else {\n continue;\n }\n\n if (piece) {\n startPostion.pawn = piece;\n startPostion.td.appendChild(piece.element); \n }\n }\n }", "function makeGrid() {\n pixelCanvas.innerHTML = \"\";\n for (let i = 0; i < gridHeight;i++) {\n const tr = document.createElement(\"tr\");\n for(let j = 0; j < gridWidth; j++){\n const td = document.createElement(\"td\");\n tr.appendChild(td);\n }\n fragment.appendChild(tr);\n }", "function setupGridSpots() {\r\n /*Direction spots*/\r\n right = [32, 24, 17];\r\n up = [39, 30];\r\n left = [7, 14];\r\n down = [0, 9];\r\n \r\n /*End spot*/\r\n end = [21];\r\n \r\n /*Card spots*/\r\n card = [2, 6, 22, 23, 28, 34, 38];\r\n \r\n /*Trap Spots*/\r\n trap = [1, 3, 8, 10, 13, 15, 26, 27, 36];\r\n \r\n /*Fill grid*/\r\n fillGrid(\"right\", right);\r\n fillGrid(\"up\", up);\r\n fillGrid(\"left\", left);\r\n fillGrid(\"down\", down);\r\n \r\n fillGrid(\"end\", end);\r\n \r\n fillGrid(\"card\", card);\r\n \r\n fillGrid(\"trap\", trap);\r\n}", "function _makeGrid () {\n let board = [];\n for (let i = 0; i < 8; i++) {\n let row = [];\n for (let j = 0; j < 8; j++) {\n row.push(null);\n }\n board.push(row);\n }\n let whites = [[3, 3], [4, 4]];\n let blacks = [[4, 3], [3, 4]];\n whites.forEach(coordinates => {\n let piece = new Piece(\"white\");\n board[coordinates[0]][coordinates[1]] = piece;\n });\n blacks.forEach(coordinates => {\n let piece = new Piece(\"black\");\n board[coordinates[0]][coordinates[1]] = piece;\n });\n return board;\n}", "_addHalls(map, number=\"max\"){\n let connections = Utils.shuffleIndex(this.rooms, \"Map._addHalls\");\n if(number == \"max\") { number = connections.length; }\n number = Utils.intCheck(number);\n for (var i = 0; i < number -1; i++) {\n let hall = this.makeHall(connections[i], connections[i+1]);\n for (let j = 0; j < hall.length; j++) {\n let cell = map[\"y\" + hall[j].y][\"x\" + hall[j].x];\n if(cell.type != \"room\") { cell.type = \"hall\"; }\n }\n this._halls.push(hall);\n }\n }", "function makeGrid(newNum){\n userInptNum = newNum;\n container.style.gridTemplateRows = userInptNum;\n container.style.gridTemplateColumns = userInptNum;\n\n for (let i = 1; i <= userInptNum; i++){\n for(let j = 1; j <= userInptNum; j++){\n let square = document.createElement('div');\n square.classList.add('square');\n square.style.backgroundColor = \"rgb(250,250,250\";\n square.style.gridRow = i;\n square.style.gridColumn = j;\n container.appendChild(square);\n\n }\n \n }\n getColor();\n \n}", "function createBoard() {\n for (let i = 0; i < width * width; i++) {\n const square = document.createElement(\"div\");\n //put this child into the gird\n grid.appendChild(square);\n squares.push(square);\n\n // Assigning a random colour to each div\n let randomColor = Math.floor(Math.random() * coloursOfCancy.length);\n square.style.backgroundImage = coloursOfCancy[randomColor];\n\n //To drag each square and give unique ID to each cell so we can see which square is actually moved.\n square.setAttribute(\"draggable\", \"true\");\n square.setAttribute(\"id\", i);\n }\n }", "function buildGrid( gridDivId ){\n\n\tvar thePiano = $('#' + gridDivId);\n\t\n\t// this special div is the bar that shows the available notes \n\tvar pianoNotes = $('#pianoNotes');\n\t\n\tvar note;\n\t\n\tfor(note in noteFrequencies){\n\t\t\n\t\tnote = note;\n\t\t\n\t\t// ignore enharmonics \n\t\tif(note.substring(0, 2) === \"Gb\" || note.substring(0, 2) === \"Db\" ||\n\t\t note.substring(0, 2) === \"D#\" || note.substring(0, 2) === \"G#\" ||\n\t\t note.substring(0, 2) === \"A#\"){\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t//first create new element for new pitch\n\t\tvar newRow = document.createElement('div');\n\t\tnewRow.id = replaceSharp(note);\n\t\t\n\t\tvar newRowText = document.createElement('div');\n\t\tnewRowText.innerHTML = note.substring(0, note.length - 1) + \"<sub>\" + note[note.length-1] + \"</sub>\";\n\t\tnewRowText.style.fontSize = '11px';\n\t\tnewRowText.style.border = \"1px solid #000\";\n\t\tnewRowText.style.display = 'inline-block';\n\t\tnewRowText.style.width = \"50px\";\n\t\tnewRowText.style.verticalAlign = \"middle\";\n\t\t\n\t\tnewRow.appendChild(newRowText);\n\t\tthePiano.append(newRow);\n\t\t\n\t\t// add new row to pianoNotes div - this will just be a block holding all the notes \n\t\tvar newRowClone = newRow.cloneNode();\n\t\tvar textClone = newRowText.cloneNode();\n\t\ttextClone.innerHTML = note.substring(0, note.length - 1) + \"<sub>\" + note[note.length-1] + \"</sub>\";\n\t\tnewRowClone.appendChild(textClone);\n\t\tpianoNotes.append(newRowClone);\n\t\t\n\t\t// append columns to each row \n\t\tfor(var j = 0; j < numberOfMeasures * subdivision; j++){\n\t\t\tvar column = document.createElement(\"div\");\n\t\t\tcolumn.id = replaceSharp(note) + \"col_\" + j;\n\t\t\tcolumn.style.display = 'inline-block';\n\t\t\t//column.style.cssFloat = \"left\";\n\t\t\tcolumn.style.width = \"40px\";\n\t\t\tcolumn.style.height = \"15px\";\n\t\t\tcolumn.style.verticalAlign = \"middle\";\n\t\t\n\t\t\t// IMPORTANT! new attributes for each note\n\t\t\tcolumn.setAttribute(\"volume\", 0.3);\t\t \t// set volume to 0.3 initially\n\t\t\tcolumn.setAttribute(\"length\", \"eighth\"); \t// length of note (quarter, eighth?)\n\t\t\tcolumn.setAttribute(\"type\", \"default\"); \t// type of note - set to default initially \n\t\t\tcolumn.className = \"context-menu-one\";\n\t\t\t\n\t\t\tif((j + 1) % subdivision == 0){\n\t\t\t\tcolumn.style.borderRight = \"3px solid #000\";\n\t\t\t}else{\n\t\t\t\tcolumn.style.borderRight = \"1px solid #000\";\n\t\t\t}\n\n\t\t\t// hook up an event listener to allow for picking notes on the grid!\n\t\t\tcolumn.addEventListener(\"click\", function(){ addNote(this.id, \"selectWave\") });\n\t\t\t// allow for highlighting to make it clear which note a block is\n\t\t\tcolumn.addEventListener(\"mouseenter\", function(){ highlightRow(this.id, '#FFFF99') });\n\t\t\tcolumn.addEventListener(\"mouseleave\", function(){ highlightRow(this.id, 'transparent') });\n\t\t\tnewRow.appendChild(column);\n\t\t}\n\t\t\n\t\t//not necessary anymore, but no negative effects?\n\t\tappendDummyElement(newRow);\n\t}\n}", "function makeGrid(height,width) {\n for (let r = 0; r < height; r++) {\n $('#pixel_canvas').prepend('<tr></tr>');\n for (let d = 0; d < width; d++) {\n $('tr').first().append('<td></td>')\n }\n }\n}", "function fillClues(){\n if (grid != null){\n var clueNum = 0;\n tbody = grid.getElementsByTagName('tbody')[0];\n var rows = tbody.getElementsByTagName('tr');\n if (clearClues() == false){\n return false;\n }\n var acrossList = document.createElement('ul');\n acrossList.setAttribute('class', 'clueList');\n document.getElementById('across').appendChild(acrossList);\n var downList = document.createElement('ul');\n downList.setAttribute('class', 'clueList');\n document.getElementById('down').appendChild(downList);\n for (var rowNum = 0; rowNum<rows.length; rowNum++){\n var cells = rows[rowNum].getElementsByTagName('td');\n for (var colNum = 0; colNum<cells.length; colNum++){\n while (cells[colNum].firstChild){\n cells[colNum].removeChild(cells[colNum].firstChild);\n }\n cells[colNum].setAttribute('title', '');\n var horLights = numHorizontalLights(rowNum, colNum, rows[rowNum], cells[colNum]);\n var verLights = numVerticalLights(rowNum, colNum, rows[rowNum], cells[colNum]);\n if (horLights > 1 || verLights > 1){\n clueNum++;\n cells[colNum].setAttribute('title', clueNum);\n var n = document.createElement('span');\n n.setAttribute('class', 'clueNum');\n var t = document.createTextNode(clueNum);\n n.appendChild(t);\n cells[colNum].appendChild(n);\n if (horLights > 1){\n createClue(acrossList, clueNum, horLights, 'a');\n }\n if (verLights > 1){\n createClue(downList, clueNum, verLights, 'd');\n }\n }\n }\n }\n }\n document.getElementById('btnGenerateTei').style.visibility = 'visible';\n return false;\n}", "function assignGrid(ghostOne, ghostTwo, ghostThree, ghostFour) {\n infoBox.innerHTML = 'Click ↑'\n for (let i = 0; i < layout.length; i++) {\n // gridSquare[i].classList.add(layoutClasses[layout[i]])\n if (layout[i] === 1) {\n gridSquare[i].classList.add('wall')\n } else if (layout[i] === 2) {\n gridSquare[i].classList.add('food')\n } else if (layout[i] === 3) {\n gridSquare[i].classList.add('pacmanRight')\n } else if (layout[i] === 5) {\n gridSquare[i].classList.add('pill')\n } else if (layout[i] === 6) {\n gridSquare[i].classList.add('warp')\n } else if (layout[i] === 4) {\n gridSquare[i].classList.add('ghostOne')\n ghostOne.ghostIndex = i\n } else if (layout[i] === 7) {\n gridSquare[i].classList.add('ghostTwo')\n ghostTwo.ghostIndex = i\n } else if (layout[i] === 8) {\n gridSquare[i].classList.add('ghostThree')\n ghostThree.ghostIndex = i\n } else if (layout[i] === 9) {\n gridSquare[i].classList.add('ghostFour')\n ghostFour.ghostIndex = i\n }\n }\n }", "function makeHtmlBoard() {\n \n for(i = 0; i < WIDTH; i++) {\n const row = document.createElement('th');\n row.setAttribute('id', `${i}`)\n topLine.append(row);\n\n }\n \n for (let x = 1; x < 6; x++) {\n const tableRowCell = document.createElement('tr');\n body.append(tableRowCell);\n for (let y = 0; y < HEIGHT; y++) {\n const cell = document.createElement('td');\n cell.innerText = \"$\"+ x + '00';\n cell.setAttribute('id', `${y}-${x}`);\n tableRowCell.append(cell);\n }\n } \n }", "groupByGrid () {\n const gridPiles = [];\n\n // Add every pile to the grid it is located in\n this.piles.forEach((pile) => {\n const column = Math.floor(pile.x / fgmState.gridCellWidthInclSpacing);\n const row = Math.floor(-pile.y / fgmState.gridCellHeightInclSpacing);\n const index = (row * this.gridNumCols) + column;\n\n if (gridPiles[index]) {\n gridPiles[index].push(pile);\n } else {\n gridPiles[index] = [pile];\n }\n });\n\n const batchPileStacking = {};\n\n gridPiles\n .filter(gridPile => gridPile.length > 1)\n .forEach((gridPile) => {\n batchPileStacking[gridPile[0].id] = gridPile.slice(1).map(\n pile => pile.id\n );\n });\n\n this.pileUp(batchPileStacking);\n }", "setIds(node) {\n // set ids\n const nodes = _.toArray(node.querySelectorAll('*:not([id])'));\n if (!node.getAttribute('id')) {\n nodes.unshift(node);\n }\n _(nodes).forEach(subnode => subnode.setAttribute('id', _.uniqueId(`${subnode.tagName}-`)));\n\n // set indexes on modules\n const moduleCells = node.querySelectorAll('cell[type=module]');\n for (let i = 0; i < moduleCells.length; i++) {\n moduleCells[i].setAttribute('module-index', i);\n }\n }", "function makeID(i,j) {\n\treturn \"div_\" + i + \"_\" + j;\n}", "function generateGrid(map) {\n\n var gridImages = {};\n\n var canvasGrid = document.createElement(\"canvas\");\n canvasGrid.width = 256;\n canvasGrid.height = 256;\n canvasGrid.id = \"grid\";\n\n var contextGrid = canvasGrid.getContext(\"2d\");\n\n for (var z = 9; z <= 14; z++) {\n\n contextGrid.clearRect(0, 0, canvasGrid.width, canvasGrid.height);\n\n var steps = Math.pow(2, 15 - z);\n\n var stepSize = 256.0 / steps;\n\n if (z >= 9) {\n\n if (z == 9) {\n contextGrid.strokeStyle = \"rgba(100, 100, 250, 0.2)\";\n }\n else if (z == 10) {\n contextGrid.strokeStyle = \"rgba(100, 100, 250, 0.4)\";\n }\n else {\n contextGrid.strokeStyle = \"rgba(100, 100, 250, 0.4)\";\n }\n contextGrid.beginPath();\n\n for (var i = 0; i <= steps; i++) {\n\n contextGrid.moveTo(stepSize * i + 1, 0);\n contextGrid.lineTo(stepSize * i + 1, 256);\n\n if (i == steps) break;\n\n contextGrid.moveTo(0, stepSize * i + 1);\n contextGrid.lineTo(256, stepSize * i + 1);\n }\n contextGrid.closePath();\n contextGrid.stroke();\n }\n\n gridImages[z] = canvasGrid.toDataURL();\n\n }\n\n var tileSourceGrid = new MM.TileSource({uriConstructor: function (tileInfo) {\n return gridImages[tileInfo.levelOfDetail];\n }});\n var tilelayerGrid = new MM.TileLayer({ mercator: tileSourceGrid});\n map.entities.push(tilelayerGrid);\n }", "function createId(units) {\n for (let i = 0; i < units.length; i++) {\n units[i].id = Date.now() - i;\n }\n}" ]
[ "0.6835014", "0.68223274", "0.6530076", "0.64857787", "0.62546915", "0.6206812", "0.6076561", "0.6065555", "0.59931254", "0.59067154", "0.588301", "0.58692056", "0.57911515", "0.5734439", "0.5693299", "0.5677939", "0.5676703", "0.5676455", "0.56720906", "0.5645174", "0.5628283", "0.56236815", "0.56141835", "0.5600226", "0.55959135", "0.5588372", "0.5576679", "0.5571894", "0.5565255", "0.5533262", "0.55330914", "0.55058694", "0.5485441", "0.5481349", "0.5471926", "0.5468003", "0.54482174", "0.54398245", "0.5434245", "0.54328656", "0.54328656", "0.54328656", "0.54328656", "0.5427421", "0.5424772", "0.54126", "0.5409713", "0.54092634", "0.5405701", "0.5398881", "0.5391876", "0.5391138", "0.5390988", "0.53546834", "0.5351402", "0.53394115", "0.5334865", "0.53261805", "0.5325858", "0.5325357", "0.53164613", "0.52971274", "0.52968276", "0.52888155", "0.5288749", "0.52874434", "0.5283064", "0.5281997", "0.52780133", "0.52764595", "0.5274364", "0.5272335", "0.52680504", "0.52651703", "0.5260902", "0.5249064", "0.52483124", "0.5243724", "0.5241404", "0.524137", "0.52404606", "0.52383995", "0.52318525", "0.5231355", "0.52307", "0.52208054", "0.5219171", "0.5215489", "0.52106744", "0.5210242", "0.52042836", "0.51965046", "0.51860416", "0.5181383", "0.5180833", "0.5178022", "0.5173198", "0.51710653", "0.5162689", "0.5159864" ]
0.68958646
0
Reset direction of player
function resetDirection() { left = false; up = false; right = false; down = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n player.x = 0;\n player.y = 0;\n }", "function resetPlayer() {\n player.x = 210;\n player.y = 380;\n}", "function reset() {\n player.x = 200;\n player.y = 380;\n}", "resetPlayerPos () {\n player.x = 200;\n player.y = 400;\n this.gotGift = true;\n }", "function resetDirection() {\n posX = random(trueFalse);\n posY = random(trueFalse);\n w = 0;\n z = 0;\n}", "function resetPlayer(){\n player = {\n x: 0,\n y: 0\n }\n }", "resetPlayer() {\n this.x = 200;\n this.y = 400;\n }", "changePlayer(){\n if(this.isLeftButtonUp){\n this.isLeftButtonUp = false;\n this.isRightButtonUp = true;\n this.resetTimer(this.buttons.RIGHT);\n }\n else{ \n this.isLeftButtonUp = true;\n this.isRightButtonUp = false;\n this.resetTimer(this.buttons.LEFT);\n }\n }", "resetPlayer(){\n this.x = 200;\n this.y = 400; \n this.hidden = false; \n }", "function updatePlayerDirection(player) {\n \tvar deltaX = player.dir.x + player.newDir.x;\n \tvar deltaY = player.dir.y + player.newDir.y;\n \t\n \t// double back - invalid\n \tif (deltaX == 0 && deltaY == 0) {\n \t\tplayer.newDir = player.dir;\n \t} else {\n \t\tplayer.dir = player.newDir;\n \t}\n }", "function resetPlayer() {\n\tif (lives > 0) {\n\t\tlives = lives - 1;\n\t\ttransform.position = startPosition;\n\t} else {\n\t\tgamestatusscript.gameLost();\n\t}\n}", "resetSkier () {\n \n this.isJumping =false;\n this.setDirection(this.direction);\n }", "function turnR() {\n if(Pointer.dir == \"right\"){\n Pointer.dir = \"down\";\n } else if(Pointer.dir == \"down\") {\n Pointer.dir = \"left\";\n } else if(Pointer.dir == \"left\") {\n Pointer.dir = \"up\";\n } else if(Pointer.dir == \"up\") {\n Pointer.dir = \"right\";\n }\n}", "function up() {\r\n if (dir.y === 0 && !changingDirection) {\r\n dir.x = 0;\r\n dir.y = -1;\r\n changingDirection = true;\r\n }\r\n}", "function reset(){\n playerOne.disappear(playerOne.yPos, playerOne.xPos)\n enemyOne.disappear(enemyOne.yPos, enemyOne.xPos)\n enemyTwo.disappear(enemyTwo.yPos, enemyTwo.xPos)\n enemyThree.disappear(enemyThree.yPos, enemyThree.xPos)\n enemyFour.disappear(enemyFour.yPos, enemyFour.xPos)\n }", "turnRight() {\n this._currentLinearSpeed = 0;\n this._currentAngularSpeed = -this._angularSpeed;\n }", "function reset() {\n\n // Reset the variable storing the current time remaining to its initial value\n _timeRemaining = _timeTotal;\n _hasPlayerMoved = false;\n\n // Release the player's character if it has been frozen in place\n unfreezePlayer();\n\n // Inform other code modules to reset themselves to their initial conditions\n Frogger.observer.publish(\"reset\");\n }", "function resetPaddles() {\r\n player01.y = paddleY;\r\n player02.y = paddleY;\r\n}", "resetGame(){\n this.player1.points = 0;\n this.player2.points = 0;\n this.winningPlayer = \"\";\n }", "function turnL() {\n if(Pointer.dir == \"right\"){\n Pointer.dir = \"up\";\n } else if(Pointer.dir == \"down\") {\n Pointer.dir = \"right\";\n } else if(Pointer.dir == \"left\") {\n Pointer.dir = \"down\";\n } else if(Pointer.dir == \"up\") {\n Pointer.dir = \"left\";\n }\n}", "changeDirectionX () {\n this.direction.dirX = -this.direction.dirX\n }", "turnLeft() {\n this._currentLinearSpeed = 0;\n this._currentAngularSpeed = this._angularSpeed;\n }", "resetPos() {\n this.x = 2 * this.rightLeft;\n this.y = 4 * this.upDown + 54;\n }", "function reset() {\n state.moves = [];\n state.turnCount = 0;\n state.playbackSpeed = 700;\n chooseMove();\n }", "reset(){\n this.playing = false;\n this.die = 0;\n this.players[0].spot = 0;\n this.players[1].spot = 0;\n this.currentTurn.winner = false;\n this.currentSpot = null;\n this.spot = null;\n this.currentTurn = this.players[0];\n \n }", "function ResetAnimModifier():void {\n\tcharDummy.animation[\"slash1\"].speed = defaultAttackAnimSpeed;\n\tcharDummy.animation[\"thrust-release\"].speed = defaultAttackAnimSpeed;\n\tcharDummy.animation[\"thrust-windup\"].speed = defaultAttackAnimSpeed;\n}", "function changeDirection(e) {\n if (e.keyCode === 39 || e.keyCode === 68) {\n if (gameState.direction === \"left\") {\n return;\n }\n gameState.direction = \"right\";\n }\n if (e.keyCode === 37 || e.keyCode === 65) {\n if (gameState.direction === \"right\") {\n return;\n }\n gameState.direction = \"left\";\n }\n if (e.keyCode === 38 || e.keyCode === 87) {\n if (gameState.direction === \"down\") {\n return;\n }\n gameState.direction = \"up\";\n }\n if (e.keyCode === 40 || e.keyCode === 83) {\n if (gameState.direction === \"up\") {\n return;\n }\n gameState.direction = \"down\";\n }\n if (e.keyCode === 82) {\n init();\n }\n}", "function moveup() {\r\n player.dy = -player.speed;\r\n}", "function reactionReverse () {\n direction = -direction; // Stromrichtung umkehren\n reset(); // Ausgangsstellung\n }", "setMovementInRandomDirection(){\n //starts them moving\n this.hasStartedMoving = true;\n\n if(this.stopped){\n return;\n }\n\n //set random movement\n if(this.canMoveDiagonally){\n this.directionTracker.up = this.coinFlip();\n this.directionTracker.down = this.coinFlip();\n this.directionTracker.right = this.coinFlip();\n this.directionTracker.left = this.coinFlip();\n //if they can't move diagonally\n }else{\n if(this.coinFlip()){\n this.directionTracker.up = false;\n this.directionTracker.down = false;\n this.directionTracker.right = this.coinFlip();\n this.directionTracker.left = this.coinFlip();\n }else{\n this.directionTracker.up = this.coinFlip();\n this.directionTracker.down = this.coinFlip();\n this.directionTracker.right = false;\n this.directionTracker.left = false;\n }\n }\n\n //prevent conflicting movement instructions\n if(this.directionTracker.up && this.directionTracker.down){\n this.coinFlip() ? this.directionTracker.up = false : this.directionTracker.down = false;\n }\n if(this.directionTracker.right && this.directionTracker.left){\n this.coinFlip() ? this.directionTracker.right = false : this.directionTracker.left = false;\n }\n\n //force it move in a random direction if it's not allowed to stay still\n if(!this.canBeStill && \n !this.directionTracker.up &&\n !this.directionTracker.down &&\n !this.directionTracker.right &&\n !this.directionTracker.left){\n if(this.canMoveDiagonally){\n this.directionTracker.up = this.coinFlip();\n this.directionTracker.down = !this.directionTracker.up;\n this.directionTracker.right = this.coinFlip();\n this.directionTracker.left = !this.directionTracker.right;\n }else{\n if(this.coinFlip()){\n this.directionTracker.up = false;\n this.directionTracker.down = false;\n this.directionTracker.right = this.coinFlip();\n this.directionTracker.left = !this.directionTracker.right;\n }else{\n this.directionTracker.up = this.coinFlip();\n this.directionTracker.down = !this.directionTracker.up;\n this.directionTracker.right = false;\n this.directionTracker.left = false;\n }\n }\n }\n }", "function turnRight(rover){\r\n switch(rover.direction)\r\n {\r\n case \"N\": rover.direction=\"E\";\r\n break;\r\n case \"E\": rover.direction=\"S\";\r\n break;\r\n case \"S\": rover.direction=\"W\";\r\n break;\r\n case \"W\": rover.direction=\"N\";\r\n break;\r\n } \r\n}", "function resetGameState() {\n\t\tgameOngoing = true;\n\t\tcurrentPlayer = player1;\n\t}", "function resetGame() {\n\n // clear screen and reset coordinates\n ctx.clearRect(0, 0, width, height);\n snake = new Snake();\n\n // reset directions\n up = false;\n down = false;\n left = false;\n right = false;\n}", "function changeDirection(dir) {\n queen.direction = dir;\n}", "function reverse(dir) {\r\n large_gear.direction = dir;\r\n }", "function turnLeft(rover){\r\n switch(rover.direction)\r\n {\r\n case \"N\": rover.direction=\"W\";\r\n break;\r\n case \"W\": rover.direction=\"S\";\r\n break;\r\n case \"S\": rover.direction=\"E\";\r\n break;\r\n case \"E\": rover.direction=\"N\";\r\n break;\r\n } \r\n}", "function stopPlayer() {\n if (game.level.player.prevX != game.level.player.x) {\n\n game.level.player.x = game.level.player.prevX;\n }\n if (game.level.player.prevY != game.level.player.y) {\n game.level.player.y = game.level.player.prevY;\n }\n}", "turnRight() {\n this.direction--;\n this.direction = this.direction.mod(4);\n }", "resetPlayer() {\n this.out = false;\n this.coins = 2;\n this.numCards = 2;\n this.cards = [];\n }", "function playerReset() {\n const pieces = 'ILJOTSZ';\n player.matrix = createPiece(pieces[pieces.length * Math.random() | 0]);\n // center new player position\n player.pos.y = 0;\n player.pos.x = (arena[0].length / 2 | 0) - (player.matrix[0].length / 2 | 0);\n\n // End game\n if (collide(arena, player)) {\n arena.forEach(row => row.fill(0));\n player.score = 0;\n updateScore();\n }\n}", "reset() {\n this.x = this.boardWidth / 2;\n this.y = this.boardHeight / 2;\n // experiment with these values to change ball movement\n this.vy = 0;\n // try FOR loop instead of \"while\", for fun\n while (this.vy === 0) {\n this.vy = Math.floor(Math.random() * 10 - 5);\n }\n this.vx = this.direction * (6 - Math.abs(this.vy));\n }", "function keyup(e) {\r\n player.dx = 0;\r\n player.dy = 0;\r\n}", "resetTurn() {\n\t\tthis.turn = 'W';\n\t\tthis.turnStatus.text('White:');\n\t}", "resetPosition(x, y) {\n this.x = x;\n this.y = y;\n this.moving = false;\n this.currentState = {\n killing: false,\n frames: 1,\n };\n this.setDirection(Constants.RHINO_DIRECTIONS.DEFAULT)\n }", "reset() {\r\n\t\tlet me = this;\r\n\t\tif (me.up > 50 && me.down >= me.up) {\r\n\t\t\tme.up = 0;\r\n\t\t\tme.down = 0;\r\n\t\t}\r\n\t}", "changePlayer() {\n if (this._currentPlayer == 'X') {\n this._currentPlayer = 'Y'; \n } else {\n this._currentPlayer = 'X'; \n }\n }", "reset() {\n //Reset the rotation when moving left or right.\n return this.sprite.rotate().mirror(false);\n }", "reset() {\n this.x = this.boardWidth / 2;\n this.y = this.boardHeight / 2;\n // creating a random vector between +5 and -5\n\n this.vy = 0; // fixing the bug so that it doesn't throw any error in the while loop \n while (this.vy === 0) {\n this.vy = Math.floor(Math.random() * 10 - 5);\n }\n \n this.vx = this.direction * (6 - Math.abs(this.vy));\n \n }", "async resetRocket() {\n this.alpha = 0;\n this.tl.pause();\n this._animationIsPlaying = false;\n\n this.emit(Rocket.events.RESET);\n }", "reset() {\n this.stop();\n this.player.reset();\n this.fireEvent('unloaded', []);\n }", "function swapPlayer(){\r\n circleTurn = !circleTurn;\r\n}", "function resetPuck() {\n puckPosX = c.width / 2;\n puckPosY = c.height / 2;\n puckDirX = 0;\n puckDirY = 0;\n }", "setDirection(direction) {\n\n // Make sure the snake can't go back on itself\n if(['up', 'down'].includes(direction) && ['up', 'down'].includes(this.direction)) {\n return;\n }\n\n if(['left', 'right'].includes(direction) && ['left', 'right'].includes(this.direction)) {\n return;\n }\n\n /* \n Not directly changing the direction means if you accidentally press 2 keys before the snake is moved\n it won't break the going back on itself logic\n */\n this.nextDirection = direction;\n\n }", "resetSwipe(){ \n\tthis.direction = 0;\n\tthis.startX = 0;\n\tthis.startY = 0;\n }", "function resetPadMovement() {\n if (easy) {\n p1PadMove = 6;\n p2PadMove = 6;\n }\n\n if (medium) {\n p1PadMove = 7;\n p2PadMove = 7;\n }\n\n if (hard) {\n p1PadMove = 10;\n p2PadMove = 10;\n }\n}", "function turnLeft(rover){ // funcion para girar a la izquierda el Rover, un swich para cambiar la direción del rover.\nswitch(rover.direction){\n case 'N':\n rover.direction = 'W';\n break;\n case 'W': \n rover.direction = 'S';\n break;\n case \"S\":\n rover.direction = 'E' ; \n break;\n case 'E':\n rover.direction = 'N';\n break; \n } \n\nconsole.log(\"Gira a la izquierda!\");\n}", "function reset(){\n sendObj.Player = null;\n sendObj.Board = [[\"white\", \"white\",\"white\"], [\"white\", \"white\",\"white\"], [\"white\", \"white\",\"white\"]];\n sendObj.info = \"\";\n Players = [];\n turn = 0;\n sendObj.movingString.visible = false;\n sendObj.movingString.word = \"\";\n}", "function reset() { // Resetting sprite/locations locations\n player.x = 205;\n player.y = 405;\n for (const enemy of allEnemies) {\n enemy.x = 0;\n }\n clearTimeout(stop);\n }", "function reset() {\n player.x = 3 * 101;\n player.y = (6 * 81);\n for (var i = 0; i < allEnemies.length; i++) {\n allEnemies[i].x = enemyStart[getRandNum(0, 3)];\n allEnemies[i].speed = getRandNum(2, 4);\n }\n displayMessage(\"GO!\"); // Good encouragement never hurts\n init();\n }", "resetState() {\n this._movements = 0;\n }", "release(dir) {\n if (dir) {\n this._game._right = false;\n this._game._rightAccelStep = 0;\n } else {\n this._game._left = false;\n this._game._leftAccelStep = 0;\n }\n }", "resetEnemy() {\n this.x = this.setPropertyX(6, 1, globals.stepX);\n this.y = this.setPropertyY(1, 4, globals.stepY);\n this.speed = this.setPropertySpeed(100, 500);\n }", "reset() {\n this.playerContainer.players.forEach(x => x.clearHand())\n this.winner = undefined;\n this.incrementState();\n this.clearSpread();\n this.deck = new Deck();\n this.clearPot();\n this.clearFolded();\n }", "function movePlayer(direction) {\n player.move(direction);\n updateActionCam();\n}", "function flipper() {\n if (player == \"X\") {\n player = \"O\";\n } else if (player == \"O\") {\n player = \"X\";\n }\n}", "function moveLeft() {\r\n moveTo(player.x - 1, player.y);\r\n}", "setDir(direction) {\n // If direction is up, move up (y-)\n // Can't move down\n if (direction == \"up\") {\n if (this.direction == \"down\") {\n return false;\n }\n }\n // If direction is left, move left (x-)\n // Can't move right\n if (direction == \"left\") {\n if (this.direction == \"right\") {\n return false;\n }\n }\n // If direction is right, move left (x+)\n // Can't move left\n if (direction == \"right\") {\n if (this.direction == \"left\") {\n return false;\n }\n }\n // If direction is down, move down (y+)\n // Can't move up\n if (direction == \"down\") {\n if (this.direction == \"up\") {\n return false;\n }\n }\n // Change direction\n this.direction = direction;\n }", "Reset()\n {\n this._position = 0;\n }", "reset() {\n\n this.isFiring = false;\n this.anims.pause();\n this.body.setVelocity(0, 0);\n this.y = 431;\n }", "function playerReset(){\n\tfor (i=0; i<allplayers.length; i++){\n\t\tfor (hand in allplayers[i].hands){\n\t\t\tif (hand == 'HC') allplayers[i].hands[hand] = true;\n\t\t\telse allplayers[i].hands[hand] = false;\n\t\t}\n\t\tfor (suit in allplayers[i].suits){\n\t\t\tallplayers[i].suits[suit] = 0;\n\t\t}\n\t\tfor (rank in allplayers[i].ranks){\n\t\t\tallplayers[i].ranks[rank] = 0;\n\t\t}\n\t\tallplayers[i].hand = [];\n\t\tallplayers[i].pacounter = 0;\n\t\tallplayers[i].tkcounter = 0;\n\t\tallplayers[i].straight = [];\n\t\tallplayers[i].flush = \"\";\n\t}\n}", "resetPosition () {\n this._planeSystem.position.x = 0;\n this._planeSystem.position.y = 0;\n this._planeSystem.position.z = 0;\n }", "function resetGame() {\n\t$('.box').removeClass('played');\n\t$('.box').removeClass('U-turn');\n\t$('.box').removeClass('I-turn');\n\t$('.box').html('');\n\t$('.box').addClass('free');\n\tisPlayerOne = true;\n\tisPlayerTwo = false;\n\n}", "press(dir) {\n if (dir) {\n this._game._right = true;\n this._game._rightAccelStep = 0;\n } else {\n this._game._left = true;\n this._game._leftAccelStep = 0;\n }\n }", "function player_reset() {\n const pieces = 'ILJOTSZ';\n player.matrix = create_piece(pieces[pieces.length * Math.random() | 0]);\n player.pos.y = 0;\n player.pos.x = (arena[0].length / 2 | 0) - (player.matrix[0].length / 2 | 0);\n if (collide(arena, player)) {\n arena.forEach(row => row.fill(0));\n player.score = 0;\n update_score();\n }\n}", "function playerMove(dir) {\n player.pos.x += dir;\n if(colide(arena, player)) {\n player.pos.x -= dir;\n }\n}", "function moveUp() {\n player.speedY -= 1;\n}", "set direction(value) {\n this._direction = value;\n }", "movePlayerManager() {\n if (this.cursorKeys.left.isDown) {\n this.player.setVelocityX(-gameSettings.playerSpeed);\n }\n else if (this.cursorKeys.right.isDown) {\n this.player.setVelocityX(gameSettings.playerSpeed);\n }\n\n if (this.cursorKeys.up.isDown) {\n this.player.setVelocityY(-gameSettings.playerSpeed);\n }\n else if (this.cursorKeys.down.isDown) {\n this.player.setVelocityY(gameSettings.playerSpeed);\n }\n }", "function turnLeft(rover){\n switch(rover.direction) {\n case 'N':\n rover.direction= \"W\";\n break;\n case 'S':\n rover.direction= \"E\";\n break;\n case 'E':\n rover.direction= \"N\";\n break;\n case 'W':\n rover.direction= \"S\";\n }\n displayDire()\n}", "function resetVelocity(){\r\n Joey.velocityY += 1\r\n }", "function disable_directions() {\n\tfor (var cur_dir = 0 ; cur_dir < arguments.length ; cur_dir++) {\n\t\tdelete KEYS[ MovementKeys[ arguments[cur_dir] ] ] ;\t\n\t}\n}", "function moveOnToNextPlayer(gamestate) {\n gamestate.currentPlayer = -gamestate.currentPlayer\n gamestate.computerIsThinking = !gamestate.computerIsThinking\n}", "function resetMusic(){\n console.log(\"music reset\");\n //set mute to false\n mute = false;\n //set music volumes to 1\n music.volume = 1;\n battleMusic.volume = 1;\n //set music times to 0(start)\n music.currentTime = 0;\n battleMusic.currentTime = 0;\n}", "function playerLeft() {\n\tadjustPlayer(0, -1);\n}", "function movePlayer () {\r\n // Move Right and Left\r\n if (rightPressed) {\r\n player.x -= player.speed;\r\n } else if (leftPressed) {\r\n player.x += player.speed;\r\n }\r\n // Move Player Up and Down\r\n if (upPressed) {\r\n player.y -= player.speed;\r\n } else if (downPressed) {\r\n player.y += player.speed;\r\n }\r\n}", "function ChangeSpriteDirection(){\n\t// right\n\tanimator.SetInteger(\"right\", right);\n\t\n\t// left\n\tanimator.SetInteger(\"left\", left);\n\t\n\t// up\n\tanimator.SetInteger(\"up\", up);\n\t\n\t// down\n\tanimator.SetInteger(\"down\", down);\n\t\n}", "function reset(){\n\t\n health1 = 5;\n health2 = 5;\n\n ply1.position.x = 1536*0.3333333333;\n ply1.position.y = 600;\n\n ply2.position.x = 1536*0.6666666666;\n ply2.position.y = 600;\n\n\n\tloop();\n\n\n}", "function moveForward(rover) {\n\n switch (rover.direction) {\n\n case \"N\":\n rover.y++;\n break;\n\n case \"E\":\n rover.x++;\n break;\n\n case \"S\":\n rover.y--;\n break;\n\n case \"W\":\n rover.x--;\n break;\n }\n}", "turnLeft() {\n if (DIRECTIONS.indexOf(this.position.heading) === 0) {\n this.position.heading = DIRECTIONS[3];\n } else {\n this.position.heading =\n DIRECTIONS[DIRECTIONS.indexOf(this.position.heading) - 1];\n }\n }", "function ChangeDirection()\n{\n\tif(facingLeft)\n\t{\n\t\tfacingLeft = false;\n\t}\n\telse\n\t{\n\t\tfacingLeft = true;\n\t}\n\tyield WaitForSeconds(0.2);\n}", "function reset()\r\n{\r\n wBall.moving = false;\r\n\r\n // placing the white ball in its original position\r\n wBall.position = {\r\n x : tableWidth / 3, \r\n y : (tableHeight / 2) - (wBall.size / 2)\r\n }\r\n\r\n // placing the direction line back in its original position\r\n line.position = {\r\n x : wBall.position.x + 25, // 25 being the radius of the white ball \r\n y : wBall.position.y + 25\r\n }\r\n\r\n // re-setting the rotation of the direction line, and the decreasing speed value of the white ball\r\n line.rotation = 0;\r\n wBall.decreaseSpeed = 0;\r\n}", "function resetPhys() {\n \n // Reset key variables\n xSpeed = 0;\n ySpeed = 0;\n jumped = false;\n prevX = 0;\n prevY = 0;\n onIce = false;\n \n}", "function resetGlobal() {\r\n speed.dx = 0;\r\n speed.dy = 0;\r\n snake[0].x = 0;\r\n snake[0].y = 0;\r\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}", "changeDirection(direction) {\r\n this.direction = direction;\r\n }", "function playerMove(dir) {\n player.pos.x += dir;\n if(collide(arena, player)) {\n player.pos.x -= dir;\n }\n else move.play();\n}", "function reset() {\n timesPlayed = -1;\n right = 0;\n wrong = 0;\n startGame ();\n }", "reset() {\n this.yPos = this.groundYPos;\n this.jumpVelocity = 0;\n this.jumping = false;\n this.ducking = false;\n this.update(0, Trex.status.RUNNING);\n this.midair = false;\n this.speedDrop = false;\n this.jumpCount = 0;\n this.crashed = false;\n }", "function moveLeft() {\n testplayer.velocityX -= 0.5;\n}", "function moveLeft(rover) {\n\n switch (rover.direction) {\n case \"N\":\n rover.direction = \"W\";\n break;\n\n case \"E\":\n rover.direction = \"N\";\n break;\n\n case \"S\":\n rover.direction = \"E\";\n break;\n\n case \"W\":\n rover.direction = \"S\";\n break;\n }\n}" ]
[ "0.74985015", "0.7396591", "0.7369337", "0.72865397", "0.72732425", "0.71855325", "0.7099323", "0.69636613", "0.6897125", "0.68936783", "0.6665725", "0.6629178", "0.6627006", "0.66111535", "0.65860325", "0.6536323", "0.64991385", "0.6470816", "0.64644617", "0.64529437", "0.64258355", "0.6424618", "0.6412081", "0.63946927", "0.6363954", "0.63620895", "0.63561964", "0.6346129", "0.63443875", "0.6340417", "0.6322984", "0.6322032", "0.6296769", "0.62869817", "0.62857", "0.6284736", "0.62773234", "0.62766707", "0.6273431", "0.626107", "0.6255241", "0.62407225", "0.62368697", "0.62282526", "0.62091416", "0.6208532", "0.62050956", "0.62050843", "0.6194031", "0.6189738", "0.61844224", "0.61841756", "0.61745715", "0.6172248", "0.617218", "0.6168562", "0.6153225", "0.6138091", "0.61352235", "0.6133218", "0.6129271", "0.6128906", "0.6123356", "0.61172295", "0.61099064", "0.6109488", "0.61089265", "0.61087793", "0.60996056", "0.60881376", "0.60859764", "0.6079928", "0.6074735", "0.6066201", "0.6061489", "0.60596454", "0.60490286", "0.604043", "0.6040213", "0.60385936", "0.60350907", "0.6030285", "0.6029403", "0.6027001", "0.6025892", "0.6025704", "0.6016656", "0.6016001", "0.601396", "0.60136575", "0.6003694", "0.6000267", "0.59968966", "0.5995887", "0.5988172", "0.59801155", "0.5979479", "0.59774375", "0.59767175", "0.59751266" ]
0.7733612
0
The ReportIemContext simplifies the signature for all of the functions to pass context around
function reportItemContext(RS, CurrObj, CurrObjIndex, CurrObjParent, $HTMLParent, Style, CurrLocation, ApplyBackgroundColor) { this.RS = RS; this.CurrObj = CurrObj; this.CurrObjIndex = CurrObjIndex; this.CurrObjParent = CurrObjParent; this.$HTMLParent = $HTMLParent; this.Style = Style; this.CurrLocation = CurrLocation; this.ApplyBackgroundColor = ApplyBackgroundColor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processContext(context) {}", "function LContext() {}", "function LContext() {}", "function LContext() {}", "function LContext() { }", "function LContext() { }", "function handleContext(which)\n{\n}", "ShowAsContext() {}", "function ExContext1() {\n console.log('This is ExContext1');\n}", "function LContext(){}", "function getContext(_, ctx) {\n return ctx;\n }", "function getContext(_, ctx) {\n return ctx;\n }", "function getContext(_, ctx) {\n return ctx;\n}", "function getContext(_, ctx) {\n return ctx;\n}", "enterIri(ctx) {\n\t}", "function context(str)\n{\n todo(\"SCALE\", \"context()\");\n}", "createContext() {\n return new CommercialPaperContext();\n }", "gatherData(exchange, context) {\n exchange.filtered = true;\n const pid = context.pid;\n return this.davis.dynatrace.problemDetails(pid)\n .then((ret) => {\n exchange.addContext({ problem: ret });\n });\n }", "function emitContext (env, scope, context) {\n\t var shared = env.shared;\n\t var CONTEXT = shared.context;\n\t\n\t var contextEnter = env.scope();\n\t\n\t Object.keys(context).forEach(function (name) {\n\t scope.save(CONTEXT, '.' + name);\n\t var defn = context[name];\n\t contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';');\n\t });\n\t\n\t scope(contextEnter);\n\t }", "function ctx(a, b) {\n console.log(\"parametros: \", a, b)\n console.log(\"contexto: \", this)\n console.log(\"*************\")\n}", "function context(str)\n{\n todo(\"RGB\", \"context()\");\n}", "function getContext() {\n\tctx = ''\n\tbs = document.querySelectorAll('bridge-screen')\n\tif (bs.length == 0) {\n\t\treturn \"xx\"\n\t}\n\tauction = bs[0].querySelectorAll('.auctionBoxCellClass')\n\tif (auction.length == 0) {\n\t\treturn \"xx\"\n\t};\n\tif (auction.length == 1) {\n\t\treturn \"\"\n\t};\n\tfor (var i = 1; i < auction.length; i++) {\n\t\tel = translateCall(auction[i].innerText);\n\t\tctx = ctx + el;\n\t\t//\tTranslate Double, Redouble and Pass from different language interfaces\n\t};\n\treturn ctx;\n}", "function CallContext(msg, channel) {\n this.channel = channel;\n this.locals = {};\n this.message = msg;\n Object.freeze(this);\n}", "function test() {\n console.log(testContext());\n}", "function RowContext() {}", "function setupContext( itcb ) {\n // if a context was passed we can skip this step\n if ( hasContext || isTest ) { return itcb( null ); }\n options.activityContext = {\n skipInvalidateParentActivities,\n 'cache': {},\n 'queueKey': {},\n 'lastInBatch': ( 0 === numberOfCopies )\n };\n itcb( null );\n }", "function interceptReport(rule, onReport) {\n return {\n meta: rule.meta,\n create(originalContext) {\n const interceptingContext = {\n id: originalContext.id,\n options: originalContext.options,\n settings: originalContext.settings,\n parserPath: originalContext.parserPath,\n parserOptions: originalContext.parserOptions,\n parserServices: originalContext.parserServices,\n getAncestors() {\n return originalContext.getAncestors();\n },\n getDeclaredVariables(node) {\n return originalContext.getDeclaredVariables(node);\n },\n getFilename() {\n return originalContext.getFilename();\n },\n getScope() {\n return originalContext.getScope();\n },\n getSourceCode() {\n return originalContext.getSourceCode();\n },\n markVariableAsUsed(name) {\n return originalContext.markVariableAsUsed(name);\n },\n report(...args) {\n let descr = undefined;\n if (args.length === 1) {\n descr = args[0];\n }\n else if (args.length === NUM_ARGS_NODE_MESSAGE && typeof args[1] === 'string') {\n // not declared in the `.d.ts`, but used in practice by rules written in JS\n descr = {\n node: args[0],\n message: args[1],\n };\n }\n if (descr) {\n onReport(originalContext, descr);\n }\n },\n };\n return rule.create(interceptingContext);\n },\n };\n}", "function decorateContextFunction(ctx, next) {\r\n ctx.render = (content) => render(content, document.querySelector('main'));\r\n ctx.setUserNav = setUserNav;\r\n next();\r\n}", "function Context() {\n /**\n * The current environment, which is a map of PEG labels to the register\n * names in which they are stored.\n */\n this.env = {};\n\n /**\n * The types of the environment variables\n */\n this.envTypes = {};\n\n this.resultReg_ = false;\n this.silence_ = language.silence;\n this.discard_ = false;\n }", "function emitContext (env, scope, context) {\n var shared = env.shared\n var CONTEXT = shared.context\n\n var contextEnter = env.scope()\n\n Object.keys(context).forEach(function (name) {\n scope.save(CONTEXT, '.' + name)\n var defn = context[name]\n contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';')\n })\n\n scope(contextEnter)\n }", "function emitContext (env, scope, context) {\n var shared = env.shared;\n var CONTEXT = shared.context;\n\n var contextEnter = env.scope();\n\n Object.keys(context).forEach(function (name) {\n scope.save(CONTEXT, '.' + name);\n var defn = context[name];\n contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';');\n });\n\n scope(contextEnter);\n }", "function emitContext (env, scope, context) {\n var shared = env.shared;\n var CONTEXT = shared.context;\n\n var contextEnter = env.scope();\n\n Object.keys(context).forEach(function (name) {\n scope.save(CONTEXT, '.' + name);\n var defn = context[name];\n contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';');\n });\n\n scope(contextEnter);\n }", "function emitContext (env, scope, context) {\n var shared = env.shared;\n var CONTEXT = shared.context;\n\n var contextEnter = env.scope();\n\n Object.keys(context).forEach(function (name) {\n scope.save(CONTEXT, '.' + name);\n var defn = context[name];\n contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';');\n });\n\n scope(contextEnter);\n }", "function emitContext (env, scope, context) {\n var shared = env.shared;\n var CONTEXT = shared.context;\n\n var contextEnter = env.scope();\n\n Object.keys(context).forEach(function (name) {\n scope.save(CONTEXT, '.' + name);\n var defn = context[name];\n contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';');\n });\n\n scope(contextEnter);\n }", "function emitContext (env, scope, context) {\n var shared = env.shared;\n var CONTEXT = shared.context;\n\n var contextEnter = env.scope();\n\n Object.keys(context).forEach(function (name) {\n scope.save(CONTEXT, '.' + name);\n var defn = context[name];\n contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';');\n });\n\n scope(contextEnter);\n }", "function emitContext (env, scope, context) {\n var shared = env.shared;\n var CONTEXT = shared.context;\n\n var contextEnter = env.scope();\n\n Object.keys(context).forEach(function (name) {\n scope.save(CONTEXT, '.' + name);\n var defn = context[name];\n contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';');\n });\n\n scope(contextEnter);\n }", "function emitContext (env, scope, context) {\n var shared = env.shared;\n var CONTEXT = shared.context;\n\n var contextEnter = env.scope();\n\n Object.keys(context).forEach(function (name) {\n scope.save(CONTEXT, '.' + name);\n var defn = context[name];\n contextEnter(CONTEXT, '.', name, '=', defn.append(env, scope), ';');\n });\n\n scope(contextEnter);\n }", "enterParameters(ctx) {\n\t}", "_enterContext(context) {\n this._stack.push(context);\n }", "function context(name) {\n\t\tif (functions[name])\n\t\t\treturn functions[name][\"exports\"];\n\n\t\tvar func = functions[name] = {'i': name, 'l': false, 'exports': {}};\n\t\tmap[name].call(func['exports'], func, func['exports'], context)\n\t\tfunc['l'] = true\n\t\treturn func[\"exports\"];\n\t}", "enterCallParameters(ctx) {\n\t}", "getContext() {\n return Object.assign({}, this._traceContext, { tags: JSON.parse(JSON.stringify(this.tags)) });\n }", "render(context)\n {\n throw new Error(\"Not Implenemted\")\n }", "openWithContext(ctx: ExcelContext) {\n this.ctx = ctx;\n this.worker = this.createWorker();\n }", "createContext(){\n return new PharmaContext();\n }", "addContext (context) {\n this.context = context\n return this\n }", "function errorContext (context, next) {\n return function (err, ans) {\n if (err) { err.message = context + ': ' + err.message; }\n next(err, ans);\n };\n}", "enterWrappedGraph(ctx) {\n\t}", "function ContextAPI() {\n }", "report(message, color=undefined, timeout=undefined) {\n if (this.ctx.report) {\n console.warn(\"%c\"+message, \"color : \" + color + \";\");\n this.ctx.report(message, color, timeout);\n } else {\n console.warn(\"%c\"+message, \"color : \" + color + \";\");\n }\n }", "clearContextInfo() {}", "createContext() {\n return new VaccineContext();\n }", "function withCtx(fn, ctx = currentRenderingInstance) {\r\n if (!ctx)\r\n return fn;\r\n return function renderFnWithContext() {\r\n const owner = currentRenderingInstance;\r\n setCurrentRenderingInstance(ctx);\r\n const res = fn.apply(null, arguments);\r\n setCurrentRenderingInstance(owner);\r\n return res;\r\n };\r\n}", "function RecordingContext(ctx) {\n forward(this, ctx, true /* only foward accessors */);\n\n var calls = [];\n this.calls = calls;\n\n for (var k in ctx) {\n (function(k) {\n if (typeof(ctx[k]) != 'function') return;\n this[k] = function() {\n // TODO: record current drawing style\n var args = Array.prototype.slice.call(arguments);\n calls.push([k].concat(args));\n return ctx[k].apply(ctx, arguments);\n };\n }).bind(this)(k);\n }\n\n this.pushObject = function(o) {\n calls.push(['pushObject', o]);\n };\n \n this.popObject = function() {\n calls.push(['popObject']);\n };\n\n this.reset = function() {\n this.calls = calls = [];\n };\n\n var recordingDrawImage = this.drawImage; // plain recording drawImage()\n this.drawImage = function(image) {\n // If the drawn image has recorded calls, then they need to be transferred over.\n var recorder = RecordingContext.recorderForCanvas(image);\n if (!recorder) {\n recordingDrawImage.apply(ctx, arguments);\n } else {\n ctx.drawImage.apply(ctx, arguments);\n calls = calls.concat(transformedCalls(recorder.calls, arguments));\n this.calls = calls;\n }\n }\n}", "with(context, fn, thisArg, ...args) {\n return this._getContextManager().with(context, fn, thisArg, ...args);\n }", "function resolveContexts(context) {\n /**\n * we split the context apart into the external one and\n * some internal values\n */\n let externalContext = ExtDomQuery_1.ExtConfig.fromNullable(context);\n let internalContext = externalContext.getIf(Const_1.CTX_PARAM_MF_INTERNAL);\n if (!internalContext.isPresent()) {\n internalContext = ExtDomQuery_1.ExtConfig.fromNullable({});\n }\n /**\n * prepare storage for some deferred operations\n */\n internalContext.assign(Const_1.DEFERRED_HEAD_INSERTS).value = [];\n internalContext.assign(Const_1.UPDATE_FORMS).value = [];\n internalContext.assign(Const_1.UPDATE_ELEMS).value = [];\n return { externalContext, internalContext };\n}", "function enterContext(context) {\n var keyword = toKeyword(context);\n lt.objs.context.in_BANG_.call(null, keyword, null);\n }", "enterA114(ctx) {\n\t}", "setContext(context) {\n this.context = context;\n }", "function context(data) {\n return serialize(globalContext);\n }", "getContext() {\n return this.context;\n }", "getContext() {\n return this.context;\n }", "getChildContext() {\n return {\n name: 'Brian Behrens',\n age: 34,\n func: this.funTimes,\n }\n }", "constructor(contextReal) {\n super();\n this.context = contextReal;\n }", "report() {}", "enterExpr(ctx) {\n\t}", "trace( path, context ) {}", "updateContext(context) {\n this.context = context\n }", "enterCallParameter(ctx) {\n\t}", "function storeExtensionContext(ctx) {\n console.log(\"storing extension context\");\n extensionContext = ctx;\n}", "createContext() {\n return new HospitalContext();\n }", "get contextId() { return this._contextId; }", "report (...args) {\n if (!this.reporter) return;\n this.reporter.send(...args);\n }", "report() {\n //console.log.apply(console, arguments);\n reportfunc.apply(window, arguments);\n }", "function emitContext (env, scope, context) {\n var shared = env.shared\n var CONTEXT = shared.context\n\n var contextEnter = env.scope()\n\n Object.keys(context).forEach(function (name) {\n scope.save(CONTEXT, '.' + name)\n var defn = context[name]\n var value = defn.append(env, scope)\n if (Array.isArray(value)) {\n contextEnter(CONTEXT, '.', name, '=[', value.join(), '];')\n } else {\n contextEnter(CONTEXT, '.', name, '=', value, ';')\n }\n })\n\n scope(contextEnter)\n }", "constructor(contextReal) {\n super();\n this.context = contextReal;\n }", "function ContextClosure(template, context) {\n this.template = template;\n this.context = context;\n}", "function emitContext (env, scope, context) {\n var shared = env.shared;\n var CONTEXT = shared.context;\n\n var contextEnter = env.scope();\n\n Object.keys(context).forEach(function (name) {\n scope.save(CONTEXT, '.' + name);\n var defn = context[name];\n var value = defn.append(env, scope);\n if (Array.isArray(value)) {\n contextEnter(CONTEXT, '.', name, '=[', value.join(), '];');\n } else {\n contextEnter(CONTEXT, '.', name, '=', value, ';');\n }\n });\n\n scope(contextEnter);\n }", "function search_form_index_svelte_get_each_context(ctx, list, i) {\n var child_ctx = ctx.slice();\n child_ctx[14] = list[i];\n child_ctx[15] = list;\n child_ctx[16] = i;\n return child_ctx;\n} // (208:16) {#each data as datum, i}", "function get_context()\n\t{\n\t\treturn os_ctx;\n\t\t//return ctx;\n\t}", "enterArgument(ctx) {\n\t}", "function ResContext(prgmText, namespace, logger = defaultLogger) {\n this.origText = prgmText;\n this.origNamespace = namespace;\n this.blockStack = new ResBlockStack();\n this.blockStack.push(new ResBlock(prgmText));\n this.namespace = namespace.copy();\n this.logger = logger;\n this.stackStack = [[]];\n Object.defineProperty(this, 'stack', {\n get: function() {\n return this.stackStack[this.stackStack.length-1];\n },\n set: function(newStk) {\n this.stackStack[this.stackStack.length-1] = newStk;\n }\n });\n this.errored = false;\n\n // Returns the stack as a Res LIST.\n this.stackAsList = function() {\n return resListItem(this.stack);\n }\n\n // Returns a string display of the stack. Useful for debugging and REPLs.\n this.displayStack = function() {\n return this.stackAsList().display();\n }\n\n // Resets the state of the Res context, optionally changing the program\n // text or namespace.\n this.reset = function(newText = null, newNamespace = null) {\n if (newText !== null) {\n this.origText = newText;\n }\n if (newNamespace !== null) {\n this.origNamespace = newNamespace;\n }\n this.blockStack = new ResBlockStack();\n this.blockStack.push(new ResBlock(this.origText));\n this.namespace = this.origNamespace.copy();\n this.stack = [];\n this.errored = false;\n }\n\n // Runs a new program, starting with the stack and namespace that the\n // previous program ended with. Useful for REPLs.\n this.continue = function(newText) {\n this.blockStack = new ResBlockStack();\n this.blockStack.push(new ResBlock(newText));\n this.errored = false;\n }\n\n // Complains. This prints a message out through the logger and sets the\n // errored flag, preventing further execution.\n this.complain = function(a, b = null) {\n let scope, posn, msg;\n if (b === null) {\n scope = \"\";\n msg = a;\n } else {\n scope = a;\n msg = b;\n }\n posn = \"(\" + this.blockStack.current().posn + \"): \";\n this.logger.printErr(\"[WHOOPS] \" + scope + posn + msg, this);\n this.errored = true;\n }\n\n // Increments the current block's position, walking the namespace until it\n // retrieves a non-namespace item (or the block ends). Because we want the\n // block to maintain its own program position, we can't easily use resolvePath\n // for this purpose.\n //\n // Returns a ResItem. If the item's type is null, that means something\n // unexpected happened; either the block is finished (content is null) or\n // there was an error (content is a string describing the error). Otherwise,\n // the item is whatever the path describes.\n this.nextItem = function() {\n let item = this.namespace;\n let refer = \"\";\n while (item.type == ResType.NAMESPACE) {\n let nxt = this.blockStack.next(); // the next character to reference into\n if (nxt === undefined) { // block runout - end of block reached\n let e = null; // null signals that the block ended normally\n if (refer) // otherwise there's a problem\n e = \"block ended with unfinished reference \" + refer;\n return new ResItem(null, e);\n }\n\n refer += nxt;\n item = item.content[nxt];\n if (item === undefined)\n return new ResItem(null, \"undefined reference \" + refer);\n }\n return item;\n }\n\n // Steps the context forward.\n // If the current block has a readmode, takes one character and operates on\n // it using the readmode. Otherwise, resolves one item (using nextItem) and\n // does whatever's appropriate with it.\n // Returns true if the program is done (either it finished or there was an\n // error), false otherwise.\n this.step = function() {\n if (this.errored || this.blockStack.length() == 0) return true;\n\n if (this.blockStack.current().readmode) {\n // If there's a readmode running, read the next character.\n // Visit the ResReadmode definition below to see how readmodes work.\n\n let chr = this.blockStack.next();\n this.blockStack.current().readmode.read(this, chr);\n\n } else {\n\n let item = this.nextItem();\n if (null === item) return true; // This should never happen?\n\n switch (item.type) {\n case null:\n // null type means either a return from this block (content is null)\n // or a complaint (content contains message)\n if (item.content) {\n this.complain(item.content);\n return true;\n } else\n this.blockStack.pop();\n break;\n\n // If the item is a data item, copy it onto the stack.\n case ResType.MISC:\n case ResType.NUM:\n case ResType.CHAR:\n case ResType.LIST:\n this.stack.push(item.copy());\n break;\n\n // If the item is an operator, run it.\n // Visit the ResOperator definition below to see how operators work.\n case ResType.OPERATOR:\n item.content.run(this);\n break;\n\n // If the item is a readmode, open it.\n // Visit the ResReadmode definition below to see how readmodes work.\n case ResType.READMODE:\n item.content.open(this);\n break;\n\n default:\n this.complain(\"wasn't expecting an item of type \" + item.typeName() +\n \" or it's not supported\");\n return true;\n }\n\n }\n\n return false;\n }\n\n // Runs the program until it halts.\n // Optionally, runs for a specified number of steps and then uses setInterval\n // to place a call to run the next set, in order to keep the Javascript\n // runtime from hanging on this function. Useful for web interpreters, I\n // think.\n this.run = function(numSteps = null) {\n let runSteps = function(ctx, n) {\n let steps = (n == null ? Infinity : n);\n for (let i = 0; i < steps; i++)\n if (ctx.step()) return;\n if (n !== null) {\n let boundF = runSteps.bind(this, ctx, n);\n //setInterval(20, runSteps, n);\n requestAnimationFrame(boundF);\n }\n };\n this.reset();\n runSteps(this, numSteps);\n }\n}", "function Context(resolve, reject, custom) {\n this.resolve = resolve;\n this.reject = reject;\n this.custom = custom;\n}", "createContext() {\n const context = new RenderContext({\n renderers: this.renderers,\n theme: this.theme,\n });\n\n return context;\n }", "enterIntentBody(ctx) {\n\t}", "enterErrorString(ctx) {\n\t}", "function prepareContext (key, context) {\n\tlog.debug('[OutputPin] ' + path.basename(__filename) + ' - prepareContext');\n\t\n\t// ensure that we have a DataClass context\n\tif ( !context.DataClass ) {\n\t\tvar itemType = 'DataClass';\n\t\t// load item specific module\n\t\tvar itemModule = require('../../item_modules/'+ itemType + '/' + itemType + '.js');\n\t\t// prepare DataClass context\n\t\titemModule.prepareContext(itemType, context);\n\t}\n\n\t// ensure that we have a StoreSQLite context\n\tif ( !context.StoreSQLite ) {\n\t\tvar itemType = 'StoreSQLite';\n\t\t// load item specific module\n\t\tvar itemModule = require('../../item_modules/'+ itemType + '/' + itemType + '.js');\n\t\t// prepare DataClass context\n\t\titemModule.prepareContext(itemType, context);\n\t}\n\t\n\t// ensure that we have a StoreRingbuffer context\n\tif ( !context.StoreRingbuffer ) {\n\t\tvar itemType = 'StoreRingbuffer';\n\t\t// load item specific module\n\t\tvar itemModule = require('../../item_modules/'+ itemType + '/' + itemType + '.js');\n\t\t// prepare DataClass context\n\t\titemModule.prepareContext(itemType, context);\n\t}\t\n\n\t// extend context for OutputPin\n\tcontext.OutputPin = {};\n\tcontext.OutputPin.name = context.DataClass.name;\n\tcontext.OutputPin.className = 'OutputPin_' + context.OutputPin.name;\n\tcontext.OutputPin.headerName = context.OutputPin.className + '.h';\n\tcontext.OutputPin.headerPath = context.OutputPin.headerName.replace('\\\\', '/'); // use Linux style for include paths\n\t\n\tcontext.OutputPin.defaultHeaderName = context.OutputPin.className + '_Default.h';\n\tcontext.OutputPin.defaultHeaderTargetPath = path.normalize(context.global.targetPath + context.global.moduleStructure.Paths.stubPath + context.OutputPin.defaultHeaderName);\n\tcontext.OutputPin.defaultHeaderPath = path.normalize(path.relative(context.global.targetPath + context.global.moduleStructure.Paths.srcPath, context.OutputPin.defaultHeaderTargetPath)).replace('\\\\', '/'); // use Linux style for include paths\n\t\t\n\t// get relative stub path\n\tcontext.OutputPin.stubName = 'OutputPin_Stub_' + context.OutputPin.name;\n\tcontext.OutputPin.stubHeaderName = context.OutputPin.stubName + '.h';\n\tcontext.OutputPin.stubHeaderTargetPath = path.normalize(context.global.targetPath + context.global.moduleStructure.Paths.stubPath + context.OutputPin.stubHeaderName);\n\tcontext.OutputPin.stubHeaderPath = path.normalize(path.relative(context.global.targetPath + context.global.moduleStructure.Paths.srcPath, context.OutputPin.stubHeaderTargetPath)).replace('\\\\', '/'); // use Linux style for include paths\n\n\tcontext.OutputPin.stubSourceName = context.OutputPin.stubName + '.cpp';\n\tcontext.OutputPin.stubSourceTargetPath = path.normalize(context.global.targetPath + context.global.moduleStructure.Paths.stubPath + context.OutputPin.stubSourceName);\n\tcontext.OutputPin.stubSourcePath = path.normalize(path.relative(context.global.targetPath + context.global.moduleStructure.Paths.srcPath, context.OutputPin.stubSourceTargetPath)).replace('\\\\', '/'); // use Linux style for include paths\n\n\t// set Pin ID\n\tcontext.OutputPin.PinID = context.item.id;\n\t\t\n\treturn context;\t\n}", "function context(df, transforms, functions) {\n return new Context(df, transforms, functions);\n }", "function Context($p) {\n var el = document.createElement('canvas');\n var ctx = el.getContext(\"2d\");\n ctx.font = $p.font;\n return ctx;\n}", "get context () {\n\t\treturn {\n\t\t\tbase: this.element.base.getContext('2d'),\n\t\t\tline: this.element.line.getContext('2d'),\n\t\t\tshadow: this.element.shadow.getContext('2d'),\n\t\t\tglow: this.element.glow.getContext('2d'),\n\t\t\tblur: this.element.blur.getContext('2d'),\n\t\t\tcomposite: this.element.composite.getContext('2d')\n\t\t}\n\t}", "get context () {\n\t\treturn this._context;\n\t}", "get context () {\n\t\treturn this._context;\n\t}", "get context () {\n\t\treturn this._context;\n\t}", "function Context (schema, handler, Reply, Request, contentTypeParser, config, errorHandler, bodyLimit, logLevel, logSerializers, attachValidation, replySerializer, schemaErrorFormatter) {\n this.schema = schema\n this.handler = handler\n this.Reply = Reply\n this.Request = Request\n this.contentTypeParser = contentTypeParser\n this.onRequest = null\n this.onSend = null\n this.onError = null\n this.onTimeout = null\n this.preHandler = null\n this.onResponse = null\n this.config = config\n this.errorHandler = errorHandler\n this._middie = null\n this._parserOptions = { limit: bodyLimit || null }\n this.logLevel = logLevel\n this.logSerializers = logSerializers\n this[kFourOhFourContext] = null\n this.attachValidation = attachValidation\n this[kReplySerializerDefault] = replySerializer\n this.schemaErrorFormatter = schemaErrorFormatter || defaultSchemaErrorFormatter\n}", "function get_each_context$1(ctx, list, i) {\n var child_ctx = ctx.slice();\n child_ctx[7] = list[i];\n child_ctx[9] = i;\n return child_ctx;\n } // (66:8) {#each tags as tag,i}", "getContext() {\n return this._context;\n }", "async getContextSelfOrPropertyScoped(context, key) {\n const contextKeyEntry = context.getContextRaw()[key];\n if (contextKeyEntry && typeof contextKeyEntry === 'object' && '@context' in contextKeyEntry) {\n context = await this.parsingContext.parseContext(contextKeyEntry, context.getContextRaw(), true);\n }\n return context;\n }", "enterYield_expr(ctx) {\n\t}", "enterA123(ctx) {\n\t}", "function mathinfos(inlineContext) /* (inlineContext : inlineContext) -> std/dict/dict<common/mathinfo> */ {\n return inlineContext.mathinfos;\n}" ]
[ "0.55455905", "0.50620794", "0.50620794", "0.50620794", "0.5027646", "0.5027646", "0.50211567", "0.5018765", "0.4989319", "0.49651268", "0.49556524", "0.49556524", "0.49051723", "0.49051723", "0.48534697", "0.48258108", "0.4811757", "0.4753377", "0.47380167", "0.47245184", "0.47161168", "0.46875313", "0.46871647", "0.46853235", "0.46711135", "0.4651169", "0.46505672", "0.46448523", "0.46358865", "0.46348712", "0.46091276", "0.46091276", "0.46091276", "0.46091276", "0.46091276", "0.46091276", "0.46091276", "0.460666", "0.46036932", "0.46027425", "0.45932966", "0.45800045", "0.45791966", "0.45777962", "0.45413348", "0.4538332", "0.4526554", "0.45186114", "0.45127708", "0.4499906", "0.44996694", "0.44940114", "0.44828683", "0.44729826", "0.44727224", "0.4466455", "0.44634414", "0.44543886", "0.44516152", "0.44443655", "0.4441943", "0.4441943", "0.44394663", "0.44388816", "0.4437723", "0.44363785", "0.4431516", "0.44266725", "0.44261828", "0.4425831", "0.44201508", "0.44183493", "0.44079357", "0.43904084", "0.43877453", "0.4381525", "0.43765727", "0.4362531", "0.43564826", "0.43555784", "0.4353128", "0.4338783", "0.4338641", "0.43360445", "0.43299618", "0.43234846", "0.4310778", "0.4308691", "0.43078032", "0.42998612", "0.42975467", "0.42975467", "0.42975467", "0.42972398", "0.4295655", "0.42912078", "0.42899033", "0.4283554", "0.42834273", "0.42808154" ]
0.5079132
1
Temp measurement mimics the server measurement object
function tempMeasurement(height, width) { this.Height = height; this.Width = width; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function temp_sensor() {\r\n var celsius = temp.value();\r\n var fahrenheit = celsius * 9.0/5.0 + 32.0;\r\n console.log(celsius + \" degrees Celsius, or \" +\r\n Math.round(fahrenheit) + \" degrees Fahrenheit\");\r\n\r\n deviceClient.publish(\"status\",\"json\",'{\"d\" : { \"temperature\" : '+ celsius +'}}');\r\n setTimeout(temp_sensor,1000);\r\n\r\n}", "loadTemp() {\n\t\tthis.loadMaxCurrentMinTemp();\n\t\tapiCall('iot/api/temp/hour')\n\t\t\t.then((response) => {\n\t\t\t\tthis.tempData = response;\n\t\t\t\tthis.drawChartTemp();\n\t\t\t});\n\t\twindow.clearInterval(this.interval);\n\t\tthis.interval = window.setInterval(this.loadMaxCurrentMinTemp.bind(this), 1000);\n\t}", "constructor(tempf) {\n this._temperature = tempf;\n }", "function measuredTemp(arr) {\n return tempFormat(8.66 + arr[2]);\n }", "calculateTempOutput() {\n\t\tlet y_dot;\n\t\ty_dot = -1.0 * this.y;\n\t\t// g(y-b) already calculated for inputs.\n\t\tfor (let k = 0; k < this.numInputs; k++) {\n\t\t\ty_dot += this.weights[k] * this.inputs[k];\n\t\t}\n\t\ty_dot /= this.t;\n\t\tthis.y += y_dot * this.timeStep;\n\t\tthis.tempOutput = this.transferFunction(this.gain * (this.y - this.bias), this.sineCoefficient, this.frequencyMultiplier);\n\t}", "get temperature() {\n return (5 / 9) * (this.fahrenheit - 32);\n }", "function showTemp(data){\r\n\tconsole.log(data.temp);\r\n\tCurrentTemp = data.temp;\r\n}", "function getTemperature() {\n local supplyVoltage = hardware.voltage();\n local voltage = supplyVoltage * Temperature.read() / 65535.0;\n local c = (voltage - 0.5) * 100 ;\n local celsius = format(\"%.01f\", c);\n return(celsius);\n}", "temperature() {\n this.setup();\n\n // in order to read multiple bytes the high bit of the sub address must be asserted\n return twos_comp(this.i2c_bus.read_word_data(this.addr, TEMP_OUT_L|0x80), 12);\n }", "constructor(temperature = 20) {\n this.temperature = temperature;\n this._minTemp = 10;\n this.powerSave = true;\n this._maxTemp = 25;\n }", "get temperature() {\n // convertimos los grados F a C\n this.temperature_F = 5 / 9 * (this.temperature_F - 32)\n return this.temperature_F;\n }", "function startCurrentTempInterval(){\n setInterval(function(){\n getCurrentTemp();\n }, CURRENT_TEMP_TIMER);\n}", "get tempF (){\n console.log('calculating temp in F');\n return this.tempC * (9/5) + 32;\n }", "function Trv (currentTemperature, targetTemperature, ambientTemperature, name) {\n this.id = uuidv4()\n this.currentTemperature = currentTemperature || undefined\n this.targetTemperature = targetTemperature || ambientTemperature\n this.ambientTemperature = ambientTemperature || undefined\n this.name = name || undefined\n this.serialId = _generateSerialId()\n this.active = false\n this.activeSchedules = []\n this.metadata = {}\n}", "static async updateTemp() { \n\t\tlet weatherData = await Weather.getWeather();\n document.querySelector(\".wind-dir\").innerHTML = `${weatherData[0].wind_deg} <sup>o</sup>`;\n document.querySelector(\".wind-speed\").innerText = `${weatherData[0].wind_speed} km/h`;\n\t\tlet forecasts = Array.from(forecastContents);\n\t\tforecasts.forEach(item => {\n\t\t\tlet temp = Math.round(weatherData[forecasts.indexOf(item)].temp.day);\n\t\t\titem.querySelector(\".degree-num\").innerText = `${temp}`;\t\t\n\t\t})\n\t}", "function getTemperature (event) {\n // read variables from the event\n let ev = JSON.parse(event.data);\n let evData = ev.data; // the data from the argon event: \"pressed\" or \"released\"\n let evDeviceId = ev.coreid; // the device id\n let evTimestamp = Date.parse(ev.published_at); // the timestamp of the event\n let alrtDevice = 0;\n\n // helper variables that we need to build the message to be sent to the clients\n let message = \"Verbindung zu deinem smarten Brandmelder ist aktiv.\";\n var floatValue = parseFloat(evData);\n var correctednewTempValue = ((floatValue - 4)*10)/10;\n let difference = correctednewTempValue-correctedoldTempValue;\n correctedoldTempValue = correctednewTempValue;\n let newTempValue = correctednewTempValue;\n if( difference > 0.5 ){\n alrtDevice = 1;\n }\n else{\n alrtDevice = 0;\n }\n // send data to all connected clients\n sendData(\"temperature\", newTempValue, message, evDeviceId, evTimestamp, alrtDevice);\n}", "function temperature(params) {\n var temperature = params[0];\n return Math.floor(temperature) + \"°\";\n }", "function weekTemps() {\n this.data = [];\n this.add = add;\n this.average = average;\n this.temps = [];\n this.addTemps = addTemps;\n}", "function updateTempExternal(cb) {\n current.api.temp.getCurrentTemp(function(err, temp) {\n if (!err) {\n current.status.temp_external = temp;\n } else log.error(\"error reading Temp external: \" + err);\n cb();\n });\n }", "function getTemperatureHumidity(){\n\t$.ajax({\n\t\turl: ipURL+'/HouseTempHumid',\n\t\ttype: 'GET',\n\t\tcache: false,\n\t\theaders: {\n\t\t\t\"Authorization\": serviceAuth\n\t\t},\n\t\tsuccess:function(data){\n\t\t\ttemperatura = data.temperature;\n\t\t\tif(temperatura <= 0 || temperatura >=60){\n\t\t\t\ttemperatura = '-';\n\t\t\t}\n\t\t\t$(\"#TemperatureContainer\").text(temperatura+\" ºC\")\n\t\t\t\n\t\t},\n\t\terror:function(data){\n\t\t\t$(\"#TemperatureContainer\").text(\"? ºC\")\n\t\t\tconsole.log(\"Erro na leitura de temperatura e humidade\")\n\t\t}\n\t})\n}", "function addTemp(object) {\nconst temp = object.main.temp;\nconst kToFTemp = (temp - 273.15) * (9/5) + 32;\nreturn `Temperature: ${Math.round(kToFTemp)}`;\n}", "function showTemp(response) {\n let currentTemp = Math.round(response.data.list[0].main.temp);\n let currentTemperature = document.querySelector(\"#temp\");\n currentTemperature.innerHTML = currentTemp;\n\n let currentHumid = Math.round(response.data.list[0].main.humidity);\n let humidity = document.querySelector(\"#humid\");\n humidity.innerHTML = `${currentHumid}%`;\n\n let currentWind = (response.data.list[0].wind.speed) * 100;\n let windSpeed = document.querySelector(\"#speed\");\n windSpeed.innerHTML = currentWind;\n\n let cityName = response.data.list[0].name;\n let currentCity = document.querySelector(\"#city-name\");\n currentCity.innerHTML = cityName;\n}", "function getTemperature(tempUnits){\n $.getJSON(api, function(data){\n if (tempUnits ==\"celsius\"){\n var tempSulfix = \"C\";\n var temp = (data.current.temp_c);\n var feelslike = (data.current.feelslike_c);\n }\n else if (tempUnits == \"farenheit\"){\n var tempSulfix = \"F\";\n var temp = (data.current.temp_f);\n var feelslike = (data.current.feelslike_f);\n }\n document.getElementById(\"pTemp\").innerHTML = temp + \"&deg\" + tempSulfix;\n document.getElementById(\"pFeel\").innerHTML = feelslike + \"&deg\" + tempSulfix;\n });\n }", "function create_temperature_synth(){\n var bus_num = create_new_bus(context.destination);\n var convolver = add_convolution(bus_num);\n dry_wet(bus_num, 1, 10);\n var filter = add_filter(bus_num, \"lowpass\", 3000, 30);\n var mod1 = add_osc_modulator(bus_num, 0, 0, \"frequency\", 440, 4, 25)\n var mod2 = add_osc_modulator(bus_num, 0, 0, \"frequency\", 440, 2, 50)\n add_ADHSR_env(bus_num, 0.01, 0.2, 0, 0, 0.2);\n //add_osc_modulator(bus_num, 2, 0, \"frequency\", 1, 0.1, 75)\n set_bus_gain(bus_num, 0.03);\n return [buses[bus_num][0][0], convolver, filter, mod1, mod2]\n}", "function showTemp(response){\n //console.log(response.data);\n let temperature = Math.round(reponse.data.main.temp);\n let temperatureElement = document.querySelector(\"#temperature\");\n temperatureElement.innerHTML = `${response.data.main.temp}°C`;\n}", "function temperatureConversion(t, hardware) {\n console.assert(hardware);\n if (t==0 || t==4095) {\n return null; \n }\n var tempHWParam = 100000;\n if (hardware == \"hw33\") {\n tempHWParam = 10000;\n }\n // convert to raw volts \n const soilTempConverted1 = ((t/4095)*3.3);\n const soilTempConverted2 = ((soilTempConverted1*tempHWParam)/(3.3 - soilTempConverted1));\n const soilTempConverted3 = (Math.log(10000/soilTempConverted2))/(Math.log(2.71828));\n const soilTempConverted4 = 3380/((3380/298.15) - soilTempConverted3);\n const soilTemp = soilTempConverted4 - 273.15;\n return soilTemp.toFixed(2);\n}", "function mapDesiredTemp(doc){\n desired = doc.desiredTemperature || 0;\n return {\n x:Math.round(doc.time/1000),\n y:desired\n };\n}", "function doHttpRequestForTempSensor (){\n\tvar reqLV = new XMLHttpRequest(); // Make object to do this HTTP request\n\treqLV.onreadystatechange = cbHttpReqListenerGetTempValAndPlot;\n\treqLV.open(\"get\", \"http://\" + host + \":8001/WebService1/Lab5_LV_TempSensor\", true);\t\t\t \n\treqLV.send();\n}", "function setTemperature() {\n setInterval(function() {\n var change = genValue(-5, 5);\n if ((temperature + change) > tR[1] || (temperature + change) < tR[0]) {\n return temperature;\n } else {\n temperature += change;\n return temperature;\n }\n }, 30000);\n}", "function updateTempIndoor(cb) {\n current.board.temp.getCurrentTemp(function(err, temp) {\n if (!err) {\n current.status.temp_indoor = temp;\n } else log.error(\"error reading Temp indoor: \" + err);\n cb();\n });\n }", "function telemetry() {\n\tlet status = document.getElementById('status');\n\tvar newMeasurement = {};\n\tlet sensor = new Accelerometer();\n\tsensor.addEventListener('reading', function(e) {\n\t\tstatus.innerHTML = 'x: ' + e.target.x + '<br> y: ' + e.target.y + '<br> z: ' + e.target.z;\n\t\tnewMeasurement.x = e.target.x;\n\t\tnewMeasurement.y = e.target.y;\n\t\tnewMeasurement.z = e.target.z;\n\t});\n\tsensor.start();\n\treturn newMeasurement;\n}", "async getTemp() {\n try {\n await tempService.getTemp()\n } catch (error) {\n console.error(error)\n }\n }", "function covertTemp(temp) {\n return{\n fahrenheit: temp,\n celsius: ((temp - 32)* (5/9)),\n kelvin: ((temp + 459.67)*(5/9))\n }\n}", "function temperature() {\n var roll = dice.d(20);\n // Its a normal day\n if (roll < 15) {\n return 90 + dice.d(9);\n }\n // extreme heat\n if (roll > 17) {\n return 100 + dice.d(10);\n }\n // random heavy cold front\n if (roll > 14 && roll < 18) {\n return 95 - (dice.d(4) * 10);\n }\n}", "function showTemperature(response) {\n document.querySelector(\"#city\").innerHTML = response.data.name;\n document.querySelector(\"#currentTemp\").innerHTML = Math.round(\n response.data.main.temp\n );\n}", "function temperature(req, res) {\n\n // Use a try/catch incase the session has expired. In that case, this code will fail.\n try {\n // Use session data to keep track of the websites that have already triggered a message to Processing\n // This control is kept due to extension signals being received at seemingly random times\n if (!(req.session.history.includes(req.body.URL))) {\n req.session.history.push(req.body.URL);\n \n /******************* TESTING CODE *******************/\n try {\n console.log(\"WEBSITE: \");\n console.log(\"\\t\" + formatColour( (\"URL: \" + req.body.URL), req.body.colour));\n } catch (err) {\n console.log(err);\n }\n /****************************************************/\n \n // Send message to Arduino\n // messageArduino(req, res);\n\n // Control temperature using Johnny-five\n johnnyFiveTemperature(req);\n \n res.end();\n\n }\n\n } catch (err) {\n console.log(\"TEMPERATURE: \" + err);\n\n // If it fails, turn off heating device\n req.body.code = 4;\n johnnyFiveTemperature(req);\n }\n \n}", "function Temp() {}", "function Temp() {}", "function Temp() {}", "function Temp() {}", "function Temp() {}", "function Temp() {}", "function Temp() {}", "function getTemperature() {\n try {\n var weatherJson = storage.readJSON('weather.json');\n var weather = weatherJson.weather;\n return \"Temp: \" + Math.round(weather.temp - 273.15);\n } catch (ex) {\n return \"\";\n }\n}", "function getCurrentTemperature(deviceName) {\n return getConfig()\n .then(function (configResult) {\n var baseUrl = configResult.temperatureBaseUrl,\n url = baseUrl + '/api/list/current/temperature/' +\n deviceName + '?callback=JSON_CALLBACK';\n\n console.log('data:', configResult.temperatureBaseUrl);\n\n return $http.jsonp(url)\n .then(function (result) {\n var m,\n vals;\n\n if (result.data.status) {\n if (!result.data.data) {\n return $q.reject('Invalid device');\n }\n\n vals = result.data.data;\n //add a time stamp human readable string\n m = moment(vals.timeStamp);\n vals.timeString = m.fromNow();\n\n //add dew point value\n vals.dewpoint = calcDewPoint(vals.temperature, vals.humidity);\n\n return vals;\n } else {\n return $q.reject(result.data.msg);\n }\n });\n });\n }", "constructor() {\r\n super();\r\n /**\r\n * Previous measurement time\r\n * @private\r\n * @type {number}\r\n */\r\n this.oldTime_;\r\n }", "function measureCurrentTee() {\r\n measure = \"TrusTee measure at \"+ Date.now() + \" - T =\"+ T +\" \";\r\n history.push(measure);\r\n console.log(measure);\r\n return T;\r\n }", "function Timer(name) {\n Variable.call(this, name);\n this.total = 0;\n this.samples = 0;\n }", "gTempStr(units) {\r\n\t\tvar temp;\r\n\t\tif (units === \"c\"){\r\n\t\t\ttemp = (this.temp - 32)/1.8\r\n\t\t} else {\r\n\t\t\ttemp = this.temp\r\n\t\t}\r\n\t\treturn temp + \"°\" + units.toUpperCase();\r\n\t}", "function convertTemp(temp, units) {\n if (units === \"celcius\") return Math.round(temp);\n\n return Math.round((temp * 9) / 5 + 32);\n}", "function setSensor(temHum) {\n TEM_SENSOR.currentTemperature = temHum.temperature;\n\n temSensor.getService(Service.TemperatureSensor)\n .setCharacteristic(Characteristic.CurrentTemperature, TEM_SENSOR.getTemperature());\n}", "function makess(){\r\n class Thermostat{\r\n constructor(temp)\r\n { //private variable\r\n this._temp=5/9*(temp-32) // celsius \r\n }\r\n //getter\r\n get temperature(){\r\n return this._temp;\r\n }\r\n set temperature(updatedtemp){\r\n this._temp=updatedtemp;\r\n }\r\n }\r\n return Thermostat;\r\n}", "clearTemp () {\n for (let attribute in this.temps) {\n if (this.temps.hasOwnProperty(attribute)) {\n // delete this.data[attribute];\n // this.remove(attribute);\n delete this.temps[attribute]\n }\n }\n }", "function showTemp(response) {\n console.log(response);\n let searchCity = document.querySelector(\"#currentCityName\");\n searchCity.innerHTML = response.data.name;\n\n let temperature = Math.round(response.data.main.temp);\n let temperatureElement = document.querySelector(\"#metricT\");\n temperatureElement.innerHTML = `${temperature}˚C`;\n\n let description = document.querySelector(\"#description\");\n description.innerHTML = response.data.weather[0].description;\n\n let maxTemp = document.querySelector(\"#highTemp\");\n maxTemp.innerHTML = `${Math.round(response.data.main.temp_max)}˚C`;\n\n let minTemp = document.querySelector(\"#lowTemp\");\n minTemp.innerHTML = `${Math.round(response.data.main.temp_min)}˚C`;\n\n let feelsLike = document.querySelector(\"#feelsTemp\");\n feelsLike.innerHTML = `${Math.round(response.data.main.feels_like)}˚C`;\n}", "updateTemp(e) {\n var newTemp = this.state.targTemp;\n if (e.detail.angleStatus === \"VALID\") {\n var tempOffset = Math.round(Constants.TEMP_CHANGE_PER_DEG * (e.detail.deg - Constants.ANGLE_OFFSET_DEG) * 2) / 2; //only display at intervals of 0.5\n newTemp = e.detail.targTemp + tempOffset;\n } else if (e.detail.angleStatus === \"MAXBUFF\") {\n newTemp = Constants.HIGHEST_TEMP_SLIDER;\n } else if (e.detail.angleStatus === \"MINBUFF\") {\n newTemp = Constants.LOWEST_TEMP_SLIDER;\n } else {\n\n }\n this.setState({targTemp: newTemp});\n this.service.send({ type: 'UPDATETARGTEMP', targetTemp: newTemp });\n }", "async function getTemperaturesIntensity() {\n // get temp upper safe level\n let upperArr = [];\n let upperData = await fetch('https://api.thingspeak.com/channels/866214/fields/5',\n {\n method: 'GET',\n })\n upperData = await upperData.json();\n let upperFeed = upperData.feeds.reverse().filter(e => e.field5 !== null && e.field5 !== undefined)\n let upper\n if (upperFeed.length === 0) upper = 50\n else upper = Number.parseInt(upperFeed[0].field5)\n for (let i = 0; i < 12; i++) upperArr.push(upper)\n // get temp below safe level\n let belowArr = [];\n let belowData = await fetch('https://api.thingspeak.com/channels/866214/fields/6',\n {\n method: 'GET',\n })\n belowData = await belowData.json()\n let belowFeed = belowData.feeds.reverse().filter(e => e.field6 !== null && e.field6 !== undefined)\n let below;\n if (belowFeed.length === 0) below = 10\n else below = Number.parseInt(belowFeed[0].field6)\n for (let i = 0; i < 12; i++) belowArr.push(below)\n const response = await fetch('https://api.thingspeak.com/channels/866214/fields/1',\n {\n method: 'GET',\n })\n let feeds = await response.json()\n let feedArr = feeds.feeds.reverse()\n feedArr = feedArr.filter(e => e.field1 !== null && e.field1 !== undefined).slice(0, 12);\n const minuteArr = feedArr.map(e => new Date(e.created_at).getHours() + 'h '\n + (new Date(e.created_at).getMinutes() < 10 ? ('0' + new Date(e.created_at).getMinutes())\n : new Date(e.created_at).getMinutes()));\n const tempsArr = feedArr.map(e => Number.parseFloat(e.field1));\n const lastDate = new Date(feedArr[0].created_at)\n const dateStr = lastDate.getDate() + \"/\" + (lastDate.getMonth() + 1) + \"/\" + lastDate.getFullYear()\n Highcharts.chart('tempChart', {\n chart: {\n type: 'line'\n },\n title: {\n text: 'My smart garden Temperature'\n },\n subtitle: {\n text: 'Date: ' + dateStr\n },\n xAxis: {\n categories: minuteArr.reverse()\n },\n yAxis: {\n title: {\n text: 'Temperature (°C)'\n }\n },\n plotOptions: {\n line: {\n dataLabels: {\n enabled: true\n },\n enableMouseTracking: false\n }\n },\n series: [{\n name: 'Nhiệt độ',\n color: \"#F08F00\",\n data: tempsArr.reverse()\n }, {\n name: 'Ngưỡng an toàn trên',\n color: \"#E94340\",\n data: upperArr\n },\n {\n name: 'Ngưỡng an toàn dưới',\n color: \"#51AD55\",\n data: belowArr\n }\n ]\n });\n}", "function us_getTempData(name) {\r\n\tif (document.getElementById(\"us_temp_info\").getAttribute(name)) {\r\n\t\tvar value = document.getElementById(\"us_temp_info\").getAttribute(name);\r\n\t\treturn value;\r\n\t} else {\r\n\t\treturn 0;\r\n\t}\t\r\n}", "function getTemp(celsius, bool){\n var temp;\n if(bool == true){\n temp = celsius*1.8 + 32;\n }else{\n temp = celsius;\n }\n return temp.toFixed(1);\n }", "function Temperature({timeStamp, temp, bgColor, className}) {\n\n const date = new Date(timeStamp).toISOString().slice(0, 13);\n\n return (<div className={className}>\n <p>{date}</p>\n <p>{temp}</p>\n </div>);\n}", "function updateHVACDriverTempDisplay(temp) {\n\t$(\"#environmentData .temperature .value\").text(temp);\n}", "function currentTemp(state,action){\n if(action.type === \"SET_TEMP\"){\n return action.value;\n }\n return state;\n}", "static createWindchillTemperatureGauge() {\r\n var gauge = new LinearGauge(this.createTemperatureGaugeOpts('windchillTemperatureCanvas'));\r\n LivewindStore.storeGauge('windchillTemperature', gauge);\r\n gauge.draw();\r\n }", "function getTemp() {\n\tupdateMarker();\n\tif (game.input.activePointer.worldY > 128 && game.input.activePointer.worldY < 512) {\n\t\ttempPipe = map.getTile(layer1.getTileX(marker.x), layer1.getTileY(marker.y), 'Tile Layer 1').index;\n\t}\n}", "redondearTemp(temp) {\n return Math.round(temp * 10) / 10;\n }", "function changeTemp() {\n\t\tvar temperature = Math.round(days[document.getElementById(\"slider\").value].\n\t\t\tquerySelector(\"temperature\").textContent);\n\t\tdocument.getElementById(\"currentTemp\").innerHTML = temperature + \"&#8457\";\t\n\t}", "get tus() { return tus; }", "function read_temps() {\r\n var url = \"/power/1week\";\r\n xmlhttp=new XMLHttpRequest();\r\n xmlhttp.onreadystatechange=function() {\r\n if (xmlhttp.readyState==4) {\r\n proc_get_thermal_resp();\r\n }\r\n }\r\n xmlhttp.open(\"GET\",url,true);\r\n xmlhttp.send();\r\n }", "constructor() {\n\t\tthis.deltaTime = 0;\n\t\tthis.mult = 1;\n\t\tthis.time = Time.getTime(); // this.time = current time (last update)\n\t}", "function Temperatura(numero, unidad){\n //Atributos de la clase\n Medida.call(this,numero,unidad); //Llamada al constructor de la clase padre\n\n }", "function convertTemp(t){\n\n return Math.round(((parseFloat(t)-273.15)*1.8)+32);\n\n}", "function mapTemp(doc){\n return {\n x:Math.round(doc.time/1000),\n y:doc.temperature\n };\n}", "async function measureTemperature() {\n try {\n const temperature = await bme680.temperatureSensor.read();\n console.log(`Temperature (degrees C): ${temperature}`);\n } catch(err) {\n console.error(`Failed to measure temperature: ${err}`);\n }\n}", "static createWaterTemperatureGauge() {\r\n var gauge = new LinearGauge(this.createTemperatureGaugeOpts('waterTemperatureCanvas'));\r\n LivewindStore.storeGauge('waterTemperature', gauge);\r\n gauge.draw();\r\n }", "function getCurrentTemp(){\n\n $.getJSON(\"api/getCurrentTemp\", function(tempJson){\n updateCurrentTemp(tempJson[0].temperature);\n });\n\n}", "get total_time() { return this._total_time; }", "updateTCUs() {\r\n this.calculateTCUs(-1, -1);\r\n }", "function temp_ (OBJ){\n let kelvin = 273.15; \n let sum = 0; \n for(let i =0;i<OBJ.length;i++){\n sum = sum + (OBJ[i].main.temp - kelvin)\n //console.log(OBJ[i].main.temp - kelvin)\n }\n console.log(\"--> Average Temperature for the next 5 days:\", (sum/OBJ.length).toFixed(3), \" C\")\n return determineTemp(sum/OBJ.length)\n}", "function convertTempo(jsong)\n{\n\tlet fractPart = (jsong.timerTickFraction>>>0) / 0x100000000;\n\tlet realTPT = Number(jsong.timePerTimerTick) + fractPart;\n\t\n\tlet tempo = Math.round(120.0 * realTPT / 459.375);\n\treturn tempo;\n}", "function MouthTemps() {\n this.dataStore = [];\n this.add = add;\n this.average = average;\n\n function add(mouthData) {\n this.dataStore.push(mouthData);\n }\n\n function average() {\n var total = 0;\n for (var i = 0; i < this.dataStore.length; ++i) {\n total += this.dataStore[i][1];\n }\n return total / this.dataStore.length;\n }\n}", "function inputTemperature (obj, tmpVal, tmpUnit) {\n\n //creates an instance of the temperature structure while keeping its JSON structure\n var tmp = JSON.parse(JSON.stringify(propertyTemp));\n\n if(tmpVal === '' && tmpUnit === '') {\n delete tmp.INPUT_TYPE;\n delete tmp.TEMPERATURE;\n }\n else {\n tmp.TEMPERATURE.VALUE = tmpVal;\n tmp.TEMPERATURE.UNITS = tmpUnit;\n\n //populates the INPUT array of operation structure with temperature values and units\n //operation obj being passed into function\n obj.OPERATION.INPUTS.push(tmp);\n }\n}", "getTtl() {\n const exp = this.getExp();\n return Number.isNaN(exp) ? NaN : exp - Math.round(new Date().getTime() / 1000);\n }", "tempo() {\n return this.t\n }", "function getTemp(){\n execFile('./scripts/humidity', ['temp'], (error, stdout, stderr) => {\n if (error) {\n console.error('stderr', stderr);\n throw error;\n }\n console.log(stdout);\n readData.temp = stdout\n })\n}", "totalTime() {\n return this.duration() / (this.tempo() / 60)\n }", "async onSetTargetTemperature(data, opts) {\n let value = data[Capabilities.TARGET_TEMP];\n this.log('setting target temperature to', value);\n\n // Retrieve current target temperature from backend.\n let status = await this.client.status();\n let currentValue = formatValue(status[ status['user mode'] === 'manual' ? 'temp manual setpoint' : 'temp setpoint' ]);\n\n if (currentValue === value) {\n this.log('(value matches current, not updating)');\n // Check if capability value matches.\n if (this.getCapabilityValue(Capabilities.TARGET_TEMP) !== value) {\n await this.setValue(Capabilities.TARGET_TEMP, value);\n }\n return true;\n }\n\n return this.client.setTemperature(value).then(s => {\n this.log('...status:', s.status);\n if (s.status === 'ok') {\n return this.setValue(Capabilities.TARGET_TEMP, value);\n }\n });\n }", "function changeTempUnits(unit, temp){\n // We know the temp comes in Kelvin so\n // all the conversions will be done assuming thus\n if (unit === \"F\"){\n temp = 1.8 * (temp - 273) + 32;\n }\n\n if (unit === \"C\"){\n temp = temp - 273.15;\n }\n\n if (unit === \"K\"){\n return temp;\n }\n\n return temp;\n\n\n}", "timer(){\n //This sets the time for the seconds based upon the update speed\n this.secondCount = this.secondCount + 1;\n //A variable thats assigned the seconds to calculate the minutes\n this.secHolder = Math.trunc(this.secondCount/60)\n\n}", "timer(){\n //This sets the time for the seconds based upon the update speed\n this.secondCount = this.secondCount + 1;\n //A variable thats assigned the seconds to calculate the minutes\n this.secHolder = Math.trunc(this.secondCount/60)\n\n}", "function fdibTemp(h){\r\n\tthis.drawTemp = h;\r\n}", "get altStress () {\n if (this.peakIn = true) {\n return this._altStress *= this.kt;\n } else {\n return this._altStress;\n }\n }", "function CurrentSessionMeasurement() {\n Metrics.Measurement.call(this);\n}", "measured_TP(val) {\n this._measured_TP = val;\n return this;\n }", "function heatWaterToTemp(tankVals, desTemp) {\n\n //establish constants\n let sun = 340; //Watts/m^2 energy provided by the sun per square meter\n let solarConv = 0.215; //average solar conversion rate by panel as a percent\n let avgSolarPanelArea = 1.4; //m^2 average size of a solar panel\n let Dpipes = 0.1; //m\n let A_pipes = Math.PI * Math.pow((Dpipes / 2), 2); //m^2\n let vel = 1; //m/s massFlowRate/area_pipes;\n let massFlowRate = vel * A_pipes; //m^3/s = kg/s = L/s\n let R = 8 / 5.67826; //m^2K/W insulation value of water tank in metric units\n let blockSize = 10; // kg each array value is a block of water\n let waterVol = tankVals.length * blockSize; // total mass of water in kg\n let T_room = 20; //C room temperature where water is stored\n let h_tank = 1.5; //m height of the water tank\n let r_tank = Math.sqrt((waterVol * 0.001) / (Math.PI * h_tank)); //m radius of water tank\n let A_waterBlock = 2 * Math.PI * r_tank * (h_tank/tankVals.length) + 2 * Math.PI * Math.pow(r_tank, 2); //m^2 area of tank\n let L_pipes_total = 12; //m total length of pipes in system.\n let time_total = (L_pipes_total * A_pipes) / massFlowRate; //s total time it takes water to go through the system and back into the tank\n let h = 0.58;//1000; //W/m^2C convective heat transfer coefficient of water\n let A_cond = 2 * Math.PI * Math.pow(r_tank, 2);\n let L_pipes_solar = 8.2; //m <- 7 turns in pipe (2.857cm/each) and 8 long sections (1m/each)\n\n //establish iterator for while loop\n //each iteration represents one cubic meter of water flowing through the system\n let iter = 0;\n let time_toHeat = 0;\n\n //loop through entire system \n while (Math.min(...tankVals) < desTemp) {\n //take the bottom water out of the tank to be manipulated\n waterCycled = tankVals[0];\n\n //energy added by solar panel\n let addedE = (sun * solarConv * avgSolarPanelArea) * ((L_pipes_solar * A_pipes) / massFlowRate); // J/s provided by the sun multiplied by the time it takes the water to pass through the solar panel\n\n //establish new tank for a placeholder to model in-tank conduction \n newTank = [];\n\n //move all water down the tank and increase/decrease energy depending on convection\n for (let i = 0; i < tankVals.length - 1; i++) {\n newTank[i] = (tankVals[i + 1]);\n }\n\n //model conduction inside of water tank. Do this for amount of time it takes to cycle through entire system.\n for (let j = 0; j < time_total; j++) {\n for (let i = 0; i < newTank.length - 1; i++) {\n //equilibriate temperatures in tank due to conduction\n if (newTank[i + 1]) {\n if (newTank[i] < newTank[i + 1]) {\n let Q_bal = (h * A_cond * (newTank[i + 1] - newTank[i])) - ((A_waterBlock * (T_room - newTank[i])) / (R)); //heat transfer of j to next block of water and subtract heat lost to convection on the tank walls\n newTank[i] = newTank[i] + (Q_bal / (blockSize * 4180)); //add conducted energy to colder block of water\n newTank[i + 1] = newTank[i + 1] + ((h * A_cond * (newTank[i] - newTank[i + 1])) / (blockSize * 4180)); //remove conducted energy from hotter block of water\n }\n }\n }\n }\n\n //add energy to cycled water and compute new temp\n waterCycled = waterCycled + (addedE / (blockSize * 4180)); //q = mc*deltaT\n\n //add the heated water back to the top of the tank\n newTank.push(waterCycled);\n\n //assign the new tank placeholder back to the original array.\n tankVals = newTank;\n iter++\n time_toHeat = (iter * time_total); //calculate how long the simulation runs for\n\n //break loop if the system equillibriates and does not meet desired temp\n if (time_toHeat > 1000000) {\n res = { tankVals: tankVals, time: time_toHeat };\n return res;\n }\n }\n\n res = { tankVals: tankVals, time: time_toHeat };\n return res;\n}", "function displayTemperature(temperature) {\n\tlet returnTemp = temperature\n\tif (!isMetric()) {\n\n\t\t\treturnTemp = temperature * (9 / 5) + 32;\n\t\t// this equation was wrong returnTemp = (temperature - 32) * (5 / 9)\n\t}\n\t//rounding the temp\n\treturn Math.round(returnTemp)\n}", "function cbHttpReqListenerGetTempValAndPlot () {\n\tconsole.log(\"For HTTP request, the readyState is \" + this.readyState);\n\t\n\tif( this.readyState == 4 ){\n\t\tconsole.log(\"HTTP request completed. Response text is below.\");\n\t\tvar msg = this.responseText;\n\t\tconsole.log( msg );\n\t\tvar newValAsStrg = findValueInResponseXML(msg, \"Temperature Slider Value\");\n\t\tvar newTempVal = Number( newValAsStrg );\n\t\tmeterBar.value = newTempVal;\n\t\ttempValText.innerHTML = newTempVal;\n\t\tconsole.log(\"The new Temp Value is \" + newTempVal );\n\t\tplotNewTempPt(newTempVal);\n\t}\n}", "function drawTemp(obj) {\n let temperature = document.createElement('p');\n let temp = obj.main.temp;\n temp = ((temp - 273.15) * 9 / 5 + 32).toFixed(1);\n temperature.textContent = `Temperature: ${temp} °F`;\n return temperature;\n}", "function displayTemperature(response) {\n // step 5\n let temperature = document.querySelector(\"#temperature\");\n // step 6\n temperature.innerHTML = `${Math.round(response.data.main.temp)}°C`;\n let city = document.querySelector(\"#city\");\n city.innerHTML = response.data.name;\n}", "function HeaterCalc(volumeUnits){\n\t\n\tthis.volumeUnits =volumeUnits;\n\tthis.height = 0;\n\tthis.width = 0;\n\tthis.lenght = 0;\n\tthis.tempRise = 0;\n\tif(volumeUnits == 0.133){\n\t\t//volumeUnits is Feet set default temp Fahrenheit\n\t\tthis.tempUnits = 'F';\n\t}else{\n\t\t//volumeUnits is Meters set default temp Celsius\n\t\tthis.tempUnits = 'C';\n\t}\n\t\n\tthis.setDimensions = function(height,width,length){\n\t\tthis.height = height;\n\t\tthis.width = width;\n\t\tthis.lenght = length;\n\t};\n\n\tthis.setVolumeUnits = function(volumeUnits){\n\t\tthis.volumeUnits =volumeUnits;\n\t};\n\n\tthis.setTempUnits = function(tempUnits){\n\t\tthis.tempUnits = tempUnits;\n\t}\n\t\n\tthis.setTempRise = function(tempRise){\n\t\tthis.tempRise =tempRise;\n\t};\n\t\n\tthis.volume = function(){\n\t\tvar volume = this.height * this.width * this.lenght;\n\t\tif (isNaN(volume)) { \n\t\t\tvolume = \"\"; \n\t }\n\t\treturn volume;\n\t};\n\n\tthis.isVolumeUnitMeters = function(){\n\t\treturn this.volumeUnits > 1;\n\t}\n\n\tthis.c\n\n\t// For Metric height, width, and length always calculate back\n\t// to feet \"in the background\"\n\t// This feature obsoletes - Issue 10 The formula needs to be:\"\n\t// ([total cubic meters of tent/marquee]*2.6)*([Desired Rise in room temp]*1.8)\n\tthis.heatReq = function(){\n\t\tvar roomVolume = this.volume();\n\t\tif(roomVolume==\"\"){\n\t\t\treturn \"\";\n\t\t}\n\t\tif(this.isVolumeUnitMeters()){\n\t\t\t// console.log(\"Metric Volume converting to Feet Volume\");\n\t\t\troomVolume = this.convertMetricToFeetVolume(this.volume());\n\t\t}\n\t\t//tempRise are now all calculated in Fahrenheit\n\t\tvar tempRiseInF = this.tempRise;\n\t\tif(this.tempUnits == 'C'){\n\t\t\t// console.log(\"Feet volume and Celsius calculation \"+this.tempRise);\n\t\t\t// console.log(\"Celsius to Farenheit \"+this.convertCelsiusToFarienheit(this.tempRise));\n\t\t\ttempRiseInF= this.convertCelsiusToFarienheit(this.tempRise);\n\t\t}\n\t\t// console.log(\"Feet volume and Farenheit calculation\");\n\t\treturn Math.round((FEETUNITS * roomVolume) * tempRiseInF);\n\t\t\n\t\t\t\n\t};\n\n\tthis.convertCelsiusToFarienheit = function(tempRiseCelsius) {\n\t\treturn tempRiseCelsius * 1.8;\n\t}\n\n\tthis.convertFarienheitToCelsius = function(tempRiseFarienheit) {\n\t\treturn tempRiseFarienheit / 1.8;\n\t}\n\n\tthis.convertMetricToFeet = function(meters) {\n\t\treturn meters * 3.2808;\n\t}\n\n\tthis.convertFeetToMetric = function(feet) {\n\t\treturn feet / 3.2808;\n\t}\n\n\tthis.convertMetricToFeetVolume = function(squareMeters) {\n\t\treturn squareMeters * 35.315;\n\t}\n\n\tthis.convertFeetToMetricVolume = function(squareFeet) {\n\t\treturn squareFeet / 35.315;\n\t}\n\t\n\tthis.myRound = function(value, places) {\n\t var multiplier = Math.pow(10, places);\n\n\t return (Math.round(value * multiplier) / multiplier);\n\t};\n\t\n\tthis.heatReqBtu = function(){\n\t\tif(this.heatReq()==\"\"){\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn this.heatReq();\n\t}\n\t\n\tthis.heatReqWatts = function(){\n\t\tif(this.heatReq()==\"\"){\n\t\t\treturn \"\";\n\t\t}\n\n\t\t//Imperial watts to btus ([calculated Watts required]*3.4121414799)/[btuh output available]\n\t\treturn this.heatReq()/3.4121414799;\n\t}\n\t\n\tthis.suggest = function(heater){\n\t\tif(this.heatReq()==\"\"){\n\t\t\treturn \"\";\n\t\t}\n\t\tvar realBtuhReq = this.heatReq();\n\t\t\n\t\tvar raw = realBtuhReq/heater;\n\t\treturn raw.toFixed(1);\n\t};\n\n\tthis.p80 = function(){\n\t\treturn this.suggest(PREMIER_80);\n\t};\n\t\n\tthis.p170 = function(){\n\t\treturn this.suggest(PREMIER_170);\n\t};\n\t\n\tthis.p350 = function(){\n\t\treturn this.suggest(PREMIER_350);\n\t};\n\t\n\tthis.t125 = function(){\n\t\treturn this.suggest(TRADESMAN_125);\n\t};\n\t\n\tthis.t170 = function(){\n\t\treturn this.suggest(TRADESMAN_170);\n\t};\n\t\n\tthis.t400 = function(){\n\t\treturn this.suggest(TRADESMAN_400);\n\t};\n\t\n\tthis.tk75 = function(){\n\t\treturn this.suggest(TRADESMAN_K75);\n\t};\n\t\n\tthis.tk125 = function(){\n\t\treturn this.suggest(TRADESMAN_K125);\n\t};\n\t\n\tthis.tk175 = function(){\n\t\treturn this.suggest(TRADESMAN_K175);\n\t};\n\t\n\tthis.tk210 = function(){\n\t\treturn this.suggest(TRADESMAN_K210);\n\t};\n\t\n\tthis.tk400 = function(){\n\t\treturn this.suggest(TRADESMAN_K400);\n\t};\n\t\n\tthis.tk650 = function(){\n\t\treturn this.suggest(TRADESMAN_K650);\n\t};\n\t\n\tthis.f500 = function(){\n\t\treturn this.suggest(FOREMAN_500);\n\t};\n\tthis.f750 = function(){\n\t\treturn this.suggest(FOREMAN_750);\n\t};\n\t\n\tthis.b400 = function(){\n\t\treturn this.suggest(BOSS_400);\n\t};\n\tthis.b1000 = function(){\n\t\treturn this.suggest(BOSS_1000);\n\t};\n\t\n\tthis.n200 = function(){\n\t\treturn this.suggest(NORSEMAN_200);\n\t};\n\tthis.n250 = function(){\n\t\treturn this.suggest(NORSEMAN_250);\n\t};\n\t\n\tthis.w100 = function(){\n\t\treturn this.suggest(WORKMAN_100);\n\t};\n\tthis.w225 = function(){\n\t\treturn this.suggest(WORKMAN_225);\n\t};\n\t\n\tthis.s15 = function(){\n\t\treturn this.suggest(SUNBLAST_15);\n\t};\n\tthis.s30 = function(){\n\t\treturn this.suggest(SUNBLAST_30);\n\t};\n\t\n\tthis.s35 = function(){\n\t\treturn this.suggest(SUNBLAST_35);\n\t};\n\tthis.s125 = function(){\n\t\treturn this.suggest(SUNBLAST_125);\n\t};\n\n}", "constructor(temps) {\n this.temps = temps;\n this.canvas = null;\n this.chart = null;\n }", "function result() {\n // var charcount = samples[random].length\n var totaltime = parseInt(min) + parseInt(sec) / 60;\n var wpm = calculateWPM(samples[random], totaltime).toFixed(2);\n var cpm = calculateCPM(totalCharsInf, totaltime).toFixed(2);\n var accuracy = calculateAccuracy(samples[random], totalCharsInf).toFixed(2);\n document.querySelector(\"#timer-wpm-inf\").innerText = wpm;\n document.querySelector(\"#timer-cpm-inf\").innerText = cpm;\n document.querySelector(\"#timer-accuracy-inf\").innerText = accuracy;\n}" ]
[ "0.68377304", "0.65977776", "0.63589317", "0.62703145", "0.62618816", "0.6237961", "0.6230184", "0.6226041", "0.6220357", "0.62076133", "0.6195554", "0.60817236", "0.6050298", "0.5998605", "0.5990062", "0.592125", "0.5838621", "0.5780955", "0.57771784", "0.57393694", "0.57215977", "0.5715414", "0.57153785", "0.57127684", "0.57025385", "0.56872296", "0.56725675", "0.56540996", "0.56455827", "0.56262004", "0.5614976", "0.56138927", "0.558108", "0.5553262", "0.55492175", "0.5542943", "0.5541662", "0.5541662", "0.5541662", "0.5541662", "0.5541662", "0.5541662", "0.5541662", "0.55397713", "0.5538301", "0.553436", "0.55312884", "0.55294186", "0.55282974", "0.55262166", "0.5518435", "0.55126005", "0.55105805", "0.5506984", "0.54967344", "0.5496357", "0.54924154", "0.5491141", "0.54737794", "0.5463224", "0.54620135", "0.5460739", "0.546011", "0.5455848", "0.5451279", "0.54211974", "0.5420096", "0.541352", "0.5410673", "0.5406564", "0.53990525", "0.5396506", "0.53889376", "0.53878397", "0.53800046", "0.53794146", "0.5371813", "0.53703654", "0.5364989", "0.5364342", "0.5363987", "0.53621703", "0.5355713", "0.5345866", "0.5340335", "0.53366214", "0.53341913", "0.53341913", "0.5326917", "0.53232837", "0.53208715", "0.5318406", "0.5305452", "0.5298731", "0.5279392", "0.526306", "0.5240421", "0.5237311", "0.5236823", "0.5234885" ]
0.60075486
13
Report Item Location is used my the layout to absolute position objects in a rectangle/section/column
function reportItemLocation(index) { this.TopDelta = 0; this.Height = 0; this.Left = 0; this.Index = index; this.IndexAbove = null; this.NewHeight = null; this.NewTop = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RowLayoutResult(){this.layoutedBounds=new RectangleF(0,0,0,0);}", "function layout(item) {\n let groupContainer = requireContainer();\n\n let style = styles.get(item.decoration.style);\n if (!style) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.logErrorMessage)(`Unknown decoration style: ${item.decoration.style}`);\n return;\n }\n\n let itemContainer = document.createElement(\"div\");\n itemContainer.setAttribute(\"id\", item.id);\n itemContainer.setAttribute(\"data-style\", item.decoration.style);\n itemContainer.style.setProperty(\"pointer-events\", \"none\");\n\n let viewportWidth = window.innerWidth;\n let columnCount = parseInt(\n getComputedStyle(document.documentElement).getPropertyValue(\n \"column-count\"\n )\n );\n let pageWidth = viewportWidth / (columnCount || 1);\n let scrollingElement = document.scrollingElement;\n let xOffset = scrollingElement.scrollLeft;\n let yOffset = scrollingElement.scrollTop;\n\n function positionElement(element, rect, boundingRect) {\n element.style.position = \"absolute\";\n\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${rect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"viewport\") {\n element.style.width = `${viewportWidth}px`;\n element.style.height = `${rect.height}px`;\n let left = Math.floor(rect.left / viewportWidth) * viewportWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${boundingRect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n } else if (style.width === \"page\") {\n element.style.width = `${pageWidth}px`;\n element.style.height = `${rect.height}px`;\n let left = Math.floor(rect.left / pageWidth) * pageWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n }\n\n let boundingRect = item.range.getBoundingClientRect();\n\n let elementTemplate;\n try {\n let template = document.createElement(\"template\");\n template.innerHTML = item.decoration.element.trim();\n elementTemplate = template.content.firstElementChild;\n } catch (error) {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.logErrorMessage)(\n `Invalid decoration element \"${item.decoration.element}\": ${error.message}`\n );\n return;\n }\n\n if (style.layout === \"boxes\") {\n let doNotMergeHorizontallyAlignedRects = true;\n let clientRects = (0,_rect__WEBPACK_IMPORTED_MODULE_0__.getClientRectsNoOverlap)(\n item.range,\n doNotMergeHorizontallyAlignedRects\n );\n\n clientRects = clientRects.sort((r1, r2) => {\n if (r1.top < r2.top) {\n return -1;\n } else if (r1.top > r2.top) {\n return 1;\n } else {\n return 0;\n }\n });\n\n for (let clientRect of clientRects) {\n const line = elementTemplate.cloneNode(true);\n line.style.setProperty(\"pointer-events\", \"none\");\n positionElement(line, clientRect, boundingRect);\n itemContainer.append(line);\n }\n } else if (style.layout === \"bounds\") {\n const bounds = elementTemplate.cloneNode(true);\n bounds.style.setProperty(\"pointer-events\", \"none\");\n positionElement(bounds, boundingRect, boundingRect);\n\n itemContainer.append(bounds);\n }\n\n groupContainer.append(itemContainer);\n item.container = itemContainer;\n item.clickableElements = Array.from(\n itemContainer.querySelectorAll(\"[data-activable='1']\")\n );\n if (item.clickableElements.length === 0) {\n item.clickableElements = Array.from(itemContainer.children);\n }\n }", "gridDisplay(itemPos) {\n let x = this.state.centerGrid.x + (itemPos[0] - this.state.camera[0]);\n let y = this.state.centerGrid.y + (itemPos[1] - this.state.camera[1]);\n let display = \"inline-block\";\n // magic numbers that are the edges of the display\n // X goes 1-19, y goes 2-13 to accomodate a display bug\n if ( x < 1 || x > 19 || y < 2 || y > 13) {display = \"none\"};\n let result = {\n x: x,\n y: y,\n display: display\n };\n return result;\n }", "_positionPortItems(group, positionY)\n {\n if (group.isEmpty())\n {\n return;\n }\n\n // Get port width and height.\n var portWidth = group.children[0].bounds.width;\n var portHeight = group.children[0].bounds.height;\n var groupWidth = group.children.length * portWidth;\n\n // Get position parameters.\n var offsetX = group.children[0].bounds.width;\n var farLeft = this.position.x - (groupWidth / 2);\n\n for (var i = 0; i < group.children.length; i++)\n {\n var port = group.children[i];\n var positionX = (farLeft + (offsetX * (i + 1))) - (group.children[i].bounds.width / 2);\n var newPosition = new paper.Point(positionX, positionY);\n port.position = newPosition;\n }\n }", "setLocation(row, column){\n this.row = row;\n this.column = column;\n }", "function calElementPos(){\n\t\tcalSize();\n\t\tcalPie();\n\t\tcalGraph();\n\t}", "function whereTo() {\n return \"style = 'width: \" + size + \"px; height: \" + size + \"px; top:\" + yVal + \"px; left:\" + xVal + \"px;'\";\n }", "function getChildId(item) {\n if (!(\"location\" in item)) {\n return item.slotId;\n }\n\n return item.slotId + ',' + item.location.x + ',' + item.location.y;\n}", "function placeLibraryItem(row,col, coords){\n forEachCoord(row,col,coords, (refRow,refCol)=>{\n addCellToBoardObj(refRow, refCol)\n })\n updateGridElem(state.activeGrid)\n render(state.activeGrid)\n}", "function PdfLayoutResult(page,bounds){this.pdfPage=page;this.layoutBounds=bounds;}", "function position(group, type, rect) {\n console.log('%c\\n'+' parent ' + type + ' rect is: ', 'background: #222; color: #EFEFEF; font-family: helvetica neue; font-size:20px; padding: 0 7px 3px 0;');\n console.log(rect);\n var i = -1,\n n = group.length,\n x = rect.x,\n y = rect.y,\n o;\n if (type === \"column\") { // vertical subdivision (children are rows)\n console.log('\\n'+'calculating child rows');\n while (++i < n) {\n o = group[n-(i+1)];\n o.x = x;\n o.y = y + (rect.dy/n) * i; \n o.dx = rect.dx;\n o.dy = rect.dy/n;\n console.log({x:o.x, y: o.y, width:o.dx, height: o.dy});\n }\n } else { // horizontal subdivision (children are columns)\n console.log('\\n'+'calculating child columns');\n while (++i < n) {\n o = group[n-(i+1)];\n o.x = x + (rect.dx/n) * i; \n o.y = y;\n o.dx = rect.dx/n;\n o.dy = rect.dy;\n console.log({x:o.x, y: o.y, width:o.dx, height: o.dy});\n }\n }\n }", "function getObjLoc(obj){\r\n\tif (obj)\r\n\t\treturn \"(\"+obj.offsetLeft+\",\"+obj.offsetTop+\",\"+obj.clientWidth+\"w,\"+obj.clientHeight+\"h)\";\r\n\telse\r\n\t\treturn obj;\r\n}", "function createLocItem() {\n var\n $this = $(this),\n lat = $this.attr('data-lat'),\n lon = $this.attr('data-lon'),\n title = $this.attr('data-title'),\n address = $this.attr('data-address'),\n price = $this.attr('data-price'),\n content = '<h3>'+ title +'</h3><p>'+ address +'</p><p>CHF '+ price +'</p>'+\n '<button type=\"button\" id=\"zoom'+ locIdx +'\" class=\"action\">Close view</button>';\n\n if (lat && lon)\n locs[locIdx] = [$this, content, parseFloat(lat), parseFloat(lon), locIdx++];\n }", "function positionAndAlign(element, coords) {\n return element.css({\n left: coords.x - ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].bodyOffset.x,\n top: coords.yh - ___WEBPACK_IMPORTED_MODULE_0__[\"QuickE\"].bodyOffset.y,\n width: coords.element.width(),\n }).show();\n}", "function getRealPosition( index ) {\n var stage = app.getDrawStage();\n return { 'x': stage.offset().x + index.x / stage.scale().x,\n 'y': stage.offset().y + index.y / stage.scale().y };\n }", "getPosition(gid, eid, findAlt){\n let container = document.querySelector(`${this.eCfg.selector} > svg`).getBoundingClientRect();\n let e = document.querySelector(`${this.eCfg.selector} > svg > #${gid} > #${eid}`).getBoundingClientRect();\n if (findAlt){\n let eAlt = document.querySelector(`${this.eCfg.selector} > svg > #${gid} > #${eid}-alt`)\n if (eAlt) eAlt = eAlt.getBoundingClientRect();\n if (eAlt) e = eAlt;\n }\n return {left:(e.left-container.left)+(e.width/2), top:(e.top-container.top)+(e.height/2)};\n }", "function showLocation(inItem) {\n\tinItem.parentNode.parentNode.style.display = 'none';\n\ttranslatePlace(inItem.childNodes[1].innerHTML);\n}", "function LabelAndColumnLocationHandler(panel,inputField,location,label) {\n var app = UiApp.getActiveApplication();\n \n \n var headerP = app.getElementById('headerP');\n var vertP = app.getElementById('vertP1');\n var vertP2 = app.getElementById('vertP2');\n var vertP3 = app.getElementById('vertP3');\n var colPanel = app.getElementById('colPanel');\n \n Logger.log(vertP);\n Logger.log(inputField);\n Logger.log(label);\n \n var addToPanel = vertP;\n \n switch (panel) {\n case 'left':\n addToPanel = vertP;\n break;\n case 'middle':\n addToPanel = vertP2;\n break;\n case 'right':\n addToPanel = vertP3;\n break;\n case 'header':\n addToPanel = headerP;\n break;\n default:\n addToPanel = vertP;\n break;\n }\n \n switch (location) {\n \n case 'top':\n if (label !== undefined) {addToPanel.add(label)};\n addToPanel.add(inputField);\n break;\n case 'inline':\n var horiz = app.createHorizontalPanel();\n horiz.add(inputField);\n if (label !== undefined) {horiz.add(label)};\n addToPanel.add(horiz);\n break;\n case 'inlineLeft':\n var horiz = app.createHorizontalPanel();\n if (label !== undefined) {horiz.add(label)};\n horiz.add(inputField);\n addToPanel.add(horiz);\n break;\n default:\n if (label !== undefined) {addToPanel.add(label)};\n addToPanel.add(inputField);\n break;\n \n return;\n }\n}", "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 refreshPosition(item) {\n // Find the top of an item by adding to the offsetHeight until we reach the \n // content element.\n var current = item.element[0];\n item.top = 0;\n item.left = 0;\n while (current && current !== contentEl[0]) {\n item.top += current.offsetTop;\n item.left += current.offsetLeft;\n current = current.offsetParent;\n }\n item.height = item.element.prop('offsetHeight');\n item.clone.css('margin-left', item.left + 'px');\n if ($mdUtil.floatingScrollbars()) {\n item.clone.css('margin-right', '0');\n }\n }", "function location(pos){\n return dimension * + Math.floor(-pos[2]) + Math.floor(pos[0]);\n}", "function getLocationItem(scrollPtg, total) {\n var itemIndex = Math.floor(scrollPtg * total);\n var itemTopPtg = itemIndex / total;\n var itemBottomPtg = (itemIndex + 1) / total;\n var itemOffsetPtg = (scrollPtg - itemTopPtg) / (itemBottomPtg - itemTopPtg);\n return {\n index: itemIndex,\n offsetPtg: itemOffsetPtg\n };\n}", "function ia(e,t,a){if(\"div\"==a)return t;var n=t.left,r=t.top;\n // First move into \"page\" coordinate system\n if(\"page\"==a)n-=na(),r-=ra();else if(\"local\"==a||!a){var f=e.display.sizer.getBoundingClientRect();n+=f.left,r+=f.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:n-o.left,top:r-o.top}}", "_storeItemsCoordinates() {\n const that = this;\n\n if (that.disabled || !that.reorder) {\n return;\n }\n\n const coordinates = [];\n\n for (let i = 0; i < that._items.length; i++) {\n const currentItemContainer = that._items[i],\n boundingClientRect = currentItemContainer.getBoundingClientRect();\n\n coordinates.push({\n fromY: boundingClientRect.top + (window.scrollY || window.pageYOffset),\n toY: boundingClientRect.bottom + (window.scrollY || window.pageYOffset)\n });\n }\n\n that._itemsCoordinates = coordinates;\n }", "createVisualBoundaries() {\n this.groups.forEach(item => {\n if (item.id != ID_GROUP_TOTAL) {\n this.items.add({\n group: item.id,\n start: item.end,\n end: item.end,\n type: \"background\"\n });\n }\n });\n }", "function positionLozenges() {\n return cosmo.view.cal.itemRegistry.each(positionLozenge);\n }", "pageLocation() {\n return new HPoint(this.pageX(), this.pageY());\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 getVisibleViewPort(elementRect, bodyRect){\n var calenderHeight = 460;\n var calenderWidth = 296;\n\n var top =elementRect.top;\n if(elementRect.top +calenderHeight > bodyRect.bottom){\n top = elementRect.top - ((elementRect.top +calenderHeight) - (bodyRect.bottom -20));\n }\n var left = elementRect.left;\n if(elementRect.left +calenderWidth > bodyRect.right){\n left = elementRect.left - ((elementRect.left +calenderWidth) - (bodyRect.right -10));\n }\n return {top : top, left : left };\n }", "get X_Axis1_OverviewTab(){return browser.getLocation('//android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.widget.HorizontalScrollView/android.view.ViewGroup/android.view.ViewGroup[3]', 'x');}", "function Location(){\n\t\tthis.name=\"none\";\n\t\tthis.message=\"none\";\n\t\tthis.canGoNorth=\"none\";\n\t\tthis.canGoSouth=\"none\";\n\t\tthis.canGoEast=\"none\";\n\t\tthis.canGoWest=\"none\";\n\t\tthis.id=\"none\";\n\t\tthis.check=false;\n\t\tthis.currentItem;\n\t\tthis.item=\"0\";\n\t}", "function getLayoutPositionFromXY(x, y) {\n\treturn [(x / WALL_WIDTH) | 0, (y / WALL_HEIGHT) | 0];\n}", "function refreshPosition(item) {\n // Find the top of an item by adding to the offsetHeight until we reach the \n // content element.\n var current = item.element[0];\n item.top = 0;\n item.left = 0;\n item.right = 0;\n while (current && current !== contentEl[0]) {\n item.top += current.offsetTop;\n item.left += current.offsetLeft;\n if ( current.offsetParent ){\n item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft; //Compute offsetRight\n }\n current = current.offsetParent;\n }\n item.height = item.element.prop('offsetHeight');\n\n var defaultVal = $mdUtil.floatingScrollbars() ? '0' : undefined;\n $mdUtil.bidi(item.clone, 'margin-left', item.left, defaultVal);\n $mdUtil.bidi(item.clone, 'margin-right', defaultVal, item.right);\n }", "function refreshPosition(item) {\n // Find the top of an item by adding to the offsetHeight until we reach the \n // content element.\n var current = item.element[0];\n item.top = 0;\n item.left = 0;\n item.right = 0;\n while (current && current !== contentEl[0]) {\n item.top += current.offsetTop;\n item.left += current.offsetLeft;\n if ( current.offsetParent ){\n item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft; //Compute offsetRight\n }\n current = current.offsetParent;\n }\n item.height = item.element.prop('offsetHeight');\n\n var defaultVal = $mdUtil.floatingScrollbars() ? '0' : undefined;\n $mdUtil.bidi(item.clone, 'margin-left', item.left, defaultVal);\n $mdUtil.bidi(item.clone, 'margin-right', defaultVal, item.right);\n }", "function layoutLocationMarkers(){\n\tfor(var i =0; i<locations.length; i++){\n\t\tvar loc = locations[i].element;\n\t\tvar offsetSide = 0;\n\t\tvar bodymapWidth = 0; // width of the bodymap image depending of facing\n\t\tvar fullToDetailRatio = 1; // ratio of zoomed detail image to normalscale full bodymap image\n\t\tswitch (locations[i].facing) {\n\t\tcase \"left\":\n\t\t\toffsetSide = offsetLeft + LOCATION_SPACE;\n\t\t\tbodymapWidth = BM_LEFT_WIDTH;\n\t\t\tfullToDetailRatio = BM_LEFT_WIDTH / BM_LEFT_DETAIL_WIDTH;\n\t\t\tbreak;\n\t\tcase \"front\":\n\t\t\toffsetSide = offsetLeft + BM_LEFT_WIDTH * bodymapRatio + 3 * LOCATION_SPACE + BETWEEN_LOCATION_SPACE;\n\t\t\tbodymapWidth = BM_FRONT_WIDTH;\n\t\t\tfullToDetailRatio = BM_FRONT_WIDTH / BM_FRONT_DETAIL_WIDTH;\n\t\t\tbreak;\n\t\tcase \"right\":\n\t\t\toffsetSide = offsetLeft + (BM_LEFT_WIDTH + BM_FRONT_WIDTH) * bodymapRatio + 5 * LOCATION_SPACE + 2 * BETWEEN_LOCATION_SPACE;\n\t\t\tbodymapWidth = BM_RIGHT_WIDTH;\n\t\t\tfullToDetailRatio = BM_RIGHT_WIDTH / BM_RIGHT_DETAIL_WIDTH;\n\t\t\tbreak;\n\t\tcase \"back\":\n\t\t\toffsetSide = offsetLeft + (BM_LEFT_WIDTH + BM_FRONT_WIDTH + BM_RIGHT_WIDTH)* bodymapRatio + 7 * LOCATION_SPACE + 3 * BETWEEN_LOCATION_SPACE;\n\t\t\tbodymapWidth = BM_BACK_WIDTH;\n\t\t\tfullToDetailRatio = BM_BACK_WIDTH / BM_BACK_DETAIL_WIDTH;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif(loc !== null){\n\t\t\tvar coordinateX = loc.coordinateX;\n\t\t\tvar realX = bodymapRatio * coordinateX * fullToDetailRatio;\n\t\t\tloc.imgElement.css(\"left\", offsetSide + realX - LOCATION_MARKER_OFFSET_X);\n\t\t\tvar coordinateY = loc.coordinateY;\n\t\t\tvar realY = bodymapRatio * coordinateY * fullToDetailRatio;\n\t\t\tloc.imgElement.css(\"top\", offsetTop + realY - LOCATION_MARKER_OFFSET_Y);\n\t\t\tif(coordinateX * fullToDetailRatio > (bodymapWidth / 2)){\n\t\t\t\tloc.squareElement.css(\"left\", offsetSide+(bodymapWidth * bodymapRatio));\n\t\t\t\tloc.line.css(\"left\", offsetSide+realX);\n\t\t\t\tloc.line.css(\"width\", (bodymapWidth * bodymapRatio) - realX);\n\t\t\t} else {\n\t\t\t\tloc.squareElement.css(\"left\", offsetSide-LOCATION_SPACE);\n\t\t\t\tloc.line.css(\"left\", offsetSide);\n\t\t\t\tloc.line.css(\"width\", realX);\n\t\t\t}\n\t\t\tloc.squareElement.css(\"top\", offsetTop+realY);\n\t\t\tloc.line.css(\"top\", offsetTop+realY);\n\t\t}\n\t}\n}", "shiftChildLocation(shiftTop, bodyWidget) {\n let widgetTop = bodyWidget.y + shiftTop;\n let footerMaxHeight = bodyWidget.page.boundingRectangle.height - (bodyWidget.page.boundingRectangle.height / 100) * 40;\n widgetTop = Math.max(widgetTop, footerMaxHeight);\n shiftTop = widgetTop - bodyWidget.y;\n let childTop = bodyWidget.y = widgetTop;\n for (let i = 0; i < bodyWidget.childWidgets.length; i++) {\n let childWidget = bodyWidget.childWidgets[i];\n if (childWidget instanceof ParagraphWidget) {\n childWidget.x = childWidget.x;\n childWidget.y = i === 0 ? childWidget.y + shiftTop : childTop;\n childTop += childWidget.height;\n }\n else {\n this.shiftChildLocationForTableWidget(childWidget, shiftTop);\n }\n }\n }", "function positionDatasetAddMenu(){\n\t$('#dataSetAdd').css('position', 'absolute')\n\t\t\t\t\t\t\t\t\t\t .css('top', parseInt(window.innerHeight/2 - $('#dataSetAdd').height()/2)+\"px\")\n\t\t\t\t\t\t\t\t\t\t .css('left',parseInt(window.innerWidth/2 - $('#dataSetAdd').width()/2)+\"px\");\n}", "_positionCell() {\n if (this.props.inline) {\n return;\n }\n\n let position;\n if (!this.state.absolute) {\n position = this._getDialogPosition(this._dialog, this._table);\n }\n\n this.setState({ absolute: true, ...position });\n }", "function displayPosition (title, company, description) {\nconsole.log(\"* \" + title + \" at \" + company + \" - \" + description);\n}", "function getGroupLocation(d,i){\n let x = xScale(d.fert);\n let y = yScale(d.life);\n return \"translate(\" + x + \",\" + y + \")\";\n }", "constructor(layout, game, location, properties, underlay) {\n let that = this;\n\n this.location = location;\n\n this.properties = properties;\n this.state = {};\n this._itemInstances = {};\n\n let div = layout;\n\n let itemLayout;\n let updateItemPositions;\n let removeItem;\n if (properties.layout === \"stack\") {\n let itemsLayout = div.packed().overlay();\n itemsLayout.$.addClass(\"stack\");\n itemLayout = function () {\n return itemsLayout.overlay().packed();\n };\n updateItemPositions = function () {\n let widthToDivide = 0.3; // 30%\n let children = [];\n let randomFound = null;\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (\n i.item.properties.hidden === undefined &&\n i.item.properties.invisible === undefined\n ) {\n children.push(i);\n }\n if (i.item.properties.random !== undefined) {\n randomFound = i;\n }\n }\n if (randomFound !== null) {\n let filtered = [];\n for (const i of children) {\n if (i.infinite || i === randomFound) {\n filtered.push(i);\n }\n }\n children = filtered;\n }\n let n = children.length;\n if (n === 0) {\n return;\n }\n if (n === 1) {\n children[0].$.parent().css({\n left: 0,\n top: 0,\n });\n return;\n }\n for (const key in children) {\n let angle = Math.PI / 2 + ((Math.PI * 2.0) / n) * key;\n children[key].$.parent().css({\n left: Math.round(Math.cos(angle) * 100 * widthToDivide) + \"%\",\n top: Math.round(Math.sin(angle) * 100 * widthToDivide) + \"%\",\n });\n }\n };\n removeItem = function (i) {\n i.$.parent().remove(); //TODO Upgrade Layout class to handle remove/addClass/removeClass/attr on set()\n updateItemPositions();\n };\n } else {\n let cellLayout;\n if (properties.layout === \"vertical\") {\n cellLayout = div.vertical();\n } else {\n cellLayout = div.horizontal();\n }\n itemLayout = function () {\n return cellLayout.add();\n };\n updateItemPositions = function () {\n let stackableItems = [];\n for (const key in that._itemInstances) {\n if (that._itemInstances[key].item.properties.stackable !== undefined) {\n stackableItems.push(that._itemInstances[key]);\n }\n }\n for (const key in stackableItems) {\n if (key < stackableItems.length - 1) {\n stackableItems[key].$.addClass(\"stacking\");\n } else {\n stackableItems[key].$.removeClass(\"stacking\");\n }\n }\n };\n removeItem = function (i) {\n i.$.remove();\n updateItemPositions();\n };\n }\n\n div.$.addClass(\"spot\")\n .attr(\"data-location\", location)\n .attr(\"data-id\", \"spot:\" + location);\n for (const key in properties) {\n if (key !== \"layout\") {\n div.$.addClass(\"property-\" + key);\n }\n }\n\n let overlayDiv = layout.underlay();\n overlayDiv.$.addClass(\"overlay\");\n\n if (underlay !== undefined) {\n let underlayDiv = layout.underlay();\n underlayDiv.set(underlay);\n underlayDiv.$.addClass(\"underlay\");\n }\n\n this.$ = div.$;\n\n let updateRandom = function () {\n let randomFound = null;\n let total = 0;\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (i.item.properties.random !== undefined && !i.infinite) {\n randomFound = i;\n } else if (i.item.properties.hidden === undefined && !i.infinite) {\n total += i.count;\n }\n }\n div.$.removeClass(\"random\");\n if (randomFound !== null) {\n div.$.addClass(\"random\");\n randomFound.setState(\"auto_flag\", \"\" + total);\n }\n };\n /**\n * destroys the infos in the given instance\n * @param instance\n */\n let destroy = function (instance) {\n if (instance.faceIcon !== null) {\n instance.faceIcon.destroy();\n game.friendFaces.remove(instance.faceIcon);\n }\n\n instance.spot = null;\n //%% instance.$.addClass(\"destroyed\"); // In case it is cached somewhere\n game.dragAndDropManager.unconfigureItemInstance(instance);\n removeItem(instance);\n };\n /**\n * update the spot Overlays\n */\n let updateOverlays = function () {\n let overlayFound = new Multimap.Array();\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (i.item.properties.overlay !== undefined) {\n let consideredKind;\n let generalKinds = GeneralReference.getGeneralKinds(i.item.kind);\n if (generalKinds.length === 0) {\n consideredKind = i.item.kind;\n } else {\n consideredKind = generalKinds[generalKinds.length - 1].kind;\n }\n overlayFound.get(consideredKind).add(i);\n i.$.removeClass(\"overlayed\");\n }\n }\n overlayDiv.$.empty();\n overlayFound.each(function (overlayFoundPerKind, k) {\n // console.log(\"Found overlay [\" + k + \"] \" + overlayFoundPerKind[0].item.kind + \" (\" + overlayFoundPerKind[0].count + \")\");\n if (overlayFoundPerKind.length === 1) {\n let onlyOverlayFoundPerKind = overlayFoundPerKind[0];\n if (\n (properties.overlayable !== undefined &&\n onlyOverlayFoundPerKind.count === 1) ||\n (onlyOverlayFoundPerKind.item.properties.invisible !== undefined &&\n onlyOverlayFoundPerKind.infinite)\n ) {\n onlyOverlayFoundPerKind.item.createInstance(\n overlayDiv.overlay(),\n false,\n onlyOverlayFoundPerKind.liveId\n );\n onlyOverlayFoundPerKind.$.addClass(\"overlayed\");\n }\n }\n });\n };\n /**\n * update the spots modifiers\n */\n let updateModifiers = function () {\n let modifierFound = new Multimap.Array();\n for (const key in that._itemInstances) {\n let i = that._itemInstances[key];\n if (i.infinite) {\n return;\n }\n if (i.count !== 1) {\n return;\n }\n for (const key in i.item.modifiers) {\n modifierFound.get(key).add(i.item.modifiers[key]);\n }\n }\n that.state = {};\n modifierFound.each(function (a, k) {\n let s = null;\n for (const v of a) {\n s = v;\n }\n that.state[k] = s; // Let's keep only the last one\n });\n DomUtils.eachClass(div.$, function (c) {\n if (c.startsWith(\"state-\")) {\n div.$.removeClass(c);\n }\n });\n for (const key in that.state) {\n div.$.addClass(\"state-\" + key + \"-\" + that.state[key]);\n }\n };\n\n this._destroyItem = function (kind, count) {\n // console.log(\"Destroying \" + kind + \" from \" + location + \" (\" + count + \")\");\n if (kind === undefined) {\n for (const i of that._itemInstances) {\n destroy(i)\n }\n that._itemInstances = {};\n updateOverlays();\n updateRandom();\n updateModifiers();\n } else {\n let existingItemInstance = that._itemInstances[kind];\n if (existingItemInstance === undefined) {\n return;\n }\n if (count === undefined) {\n delete that._itemInstances[kind];\n destroy(existingItemInstance);\n } else {\n if (!existingItemInstance.infinite) {\n existingItemInstance.inc(-count);\n if (!(\"count\" in existingItemInstance.state) &&\n existingItemInstance.count === 0\n ) {\n delete that._itemInstances[existingItemInstance.item.kind];\n destroy(existingItemInstance);\n }\n }\n }\n if (existingItemInstance.item.properties.overlay !== undefined) {\n updateOverlays();\n }\n if ($.isEmptyObject(existingItemInstance.item.modifiers)) {\n updateModifiers();\n }\n //if (existingItemInstance.item.properties.random !== undefined) {\n updateRandom();\n //}\n }\n };\n\n this._setItemState = function (kind, key, value) {\n let existingItemInstance = that._itemInstances[kind];\n if (existingItemInstance === undefined) {\n return;\n }\n existingItemInstance.setState(key, value);\n };\n\n this._addItem = function (kind, count, liveId) {\n // console.log(\"Adding \" + kind + \" to \" + location + \" (\" + count + \") \" + liveId);\n\n let existingItemInstance = that._itemInstances[kind];\n if (\n existingItemInstance !== undefined &&\n existingItemInstance.faceIcon !== null\n ) {\n existingItemInstance.faceIcon.update(null, liveId);\n game.friendFaces.remove(existingItemInstance.faceIcon);\n if (existingItemInstance.liveId !== liveId) {\n existingItemInstance.setLiveId(liveId);\n game.friendFaces.add(existingItemInstance.faceIcon);\n } else {\n existingItemInstance.setLiveId();\n }\n /*\n\t\t\t\tif (existingItemInstance.infinite) {\n\t\t\t\t\tcount = undefined;\n\t\t\t\t}\n\t\t\t\tdelete that._itemInstances[kind];\n\t\t\t\tdestroy(existingItemInstance);\n\t\t\t\texistingItemInstance = undefined;\n\t\t\t\t*/\n }\n\n if (existingItemInstance === undefined) {\n let item = game.itemManager.getItem(kind);\n\n if (item !== null) {\n if (item.properties.unique !== undefined && count !== undefined) {\n for (const i of that._itemInstances) {\n if (\n i.item.properties.unique === item.properties.unique &&\n !i.infinite\n ) {\n delete that._itemInstances[i.item.kind];\n destroy(i);\n }\n }\n }\n\n existingItemInstance = item.createInstance(\n itemLayout(),\n true,\n liveId\n );\n existingItemInstance.spot = that;\n that._itemInstances[kind] = existingItemInstance;\n existingItemInstance.$.attr(\"data-location\", location).attr(\n \"data-id\",\n \"item:\" + location + \":\" + kind\n );\n if (item.properties.steady === undefined) {\n //%% existingItemInstance.$.addClass(\"hoverable\");\n game.dragAndDropManager.configureItemInstance(existingItemInstance);\n }\n\n if (existingItemInstance.faceIcon !== null) {\n existingItemInstance.setLiveId(); // Initialized deactivated\n // game.friendFaces.add(existingItemInstance.faceIcon);\n }\n updateItemPositions();\n } else {\n existingItemInstance = null;\n }\n }\n if (existingItemInstance !== null) {\n if (count === undefined) {\n existingItemInstance.setInfinite();\n } else {\n existingItemInstance.inc(count);\n }\n\n if (existingItemInstance.item.properties.overlay !== undefined) {\n updateOverlays();\n }\n if ($.isEmptyObject(existingItemInstance.item.modifiers)) {\n updateModifiers();\n }\n //if (existingItemInstance.item.properties.random !== undefined) {\n updateRandom();\n //}\n }\n };\n\n this._updateItem = function (kind, liveId) {\n let existingItemInstance = that._itemInstances[kind];\n if (\n existingItemInstance === undefined ||\n existingItemInstance.faceIcon === null\n ) {\n return;\n }\n if (existingItemInstance.liveId !== undefined) {\n game.friendFaces.remove(existingItemInstance.faceIcon);\n }\n existingItemInstance.faceIcon.update(null, liveId);\n if (existingItemInstance.liveId !== liveId) {\n existingItemInstance.setLiveId(liveId);\n game.friendFaces.add(existingItemInstance.faceIcon);\n } else {\n existingItemInstance.setLiveId();\n }\n };\n\n this._destroy = function () {\n //%% that.$.addClass(\"destroyed\");\n that.$.remove();\n };\n }", "updateChildLocationForRow(top, rowWidget) {\n let spacing = 0;\n if (rowWidget.ownerTable.tableFormat.cellSpacing > 0) {\n spacing = HelperMethods.convertPointToPixel(rowWidget.ownerTable.tableFormat.cellSpacing);\n }\n for (let i = 0; i < rowWidget.childWidgets.length; i++) {\n let cellWidget = rowWidget.childWidgets[i];\n cellWidget.x = cellWidget.x;\n cellWidget.y = top + cellWidget.margin.top + spacing;\n this.updateChildLocationForCell(cellWidget.y, cellWidget);\n }\n }", "function positionDesignImage() {\r\n\t\tif (isDesignImagePositioned == false) {\r\n\t\t\toffsetCurrent.x = Estate.Layers.GetPositionX(config.designAnchor) + config.xOffset\r\n\t\t\toriginalPosition.x = offsetCurrent.x;\r\n\t\t\toffsetCurrent.y = Estate.Layers.GetPositionY(config.designAnchor) + config.yOffset\r\n\t\t\toriginalPosition.y = offsetCurrent.y;\r\n\t\t\tdesignImage.style.left = offsetCurrent.x + 'px'\r\n\t\t\tdesignImage.style.top = offsetCurrent.y + 'px'\r\n\t\t\tmeasurement.xInput.value = \"0\"\r\n\t\t\tmeasurement.yInput.value = \"0\"\r\n\t\t\tisDesignImagePositioned = true\r\n\t\t}\r\n\t}", "function CachedItemPosition() { }", "updateChildLocationForCell(top, cellWidget) {\n for (let i = 0; i < cellWidget.childWidgets.length; i++) {\n cellWidget.childWidgets[i].x = cellWidget.childWidgets[i].x;\n cellWidget.childWidgets[i].y = top;\n if (cellWidget.childWidgets[i] instanceof TableWidget) {\n this.updateChildLocationForTable(top, cellWidget.childWidgets[i]);\n }\n top += cellWidget.childWidgets[i].height;\n }\n }", "static WorldPointToSizedRect() {}", "function positionDatasetEditMenu(){\n\t$('#dataSetEdit').css('position', 'absolute')\n\t\t\t\t\t\t\t\t\t\t .css('top', parseInt(window.innerHeight/2 - $('#dataSetEdit').height()/2)+\"px\")\n\t\t\t\t\t\t\t\t\t\t .css('left',parseInt(window.innerWidth/2 - $('#dataSetEdit').width()/2)+\"px\");\n}", "handlePosition(node) {\n return 'middle top'; // sets the position of the handle in the format of \"X-AXIS Y-AXIS\" such as \"left top\", \"middle top\"\n }", "function getPos(obj) {\n\t\tvar offsets = obj.offset();\n\t\tobjHeight = obj.height();\n\t\tobjWidth = obj.width();\n\t\texcldH = objHeight / 3; //Caculating 10% height\n\t\t(top = offsets.top),\n\t\t\t(left = offsets.left),\n\t\t\t(bottom = top + objHeight),\n\t\t\t(right = left + objWidth);\n\t}", "function CachedItemPosition() {}", "function CachedItemPosition() {}", "function section1RightTop( placeholder, tconf )\n {\n placeholder = placeholder || {};\n placeholder.stack = fmethods.initTopPaneCell( \"Asset Allocation\" );\n\n var JSONrecord = nheap.content_data\n [ \"Page 1\" ]\n [ \"OverallAllocation.txt\" ]\n [ \"OVERALL_ALLOCATION\" ];\n\n\n //------------------\n // //\\\\ chart legend\n //------------------\n var compCol = tconf.compCol;\n var colors = JSONrecord.map( row => compCol[ row.ASSET ] );\n var chartData = JSONrecord.map( row => ({ name:row.ASSET, y:row.WEIGHT }) );\n var tBody = [];\n JSONrecord.forEach( (row,rix) => {\n var ix = rix%2;\n var iy = ( rix - ix ) /2;\n tBody[iy] = tBody[iy] || [];\n\n //----------------------------------------\n // //\\\\ tedious alignments of legend cells\n //----------------------------------------\n tBody[iy][2*ix] = { image:methods.getLabelImage({\n shape:'bar', color:compCol[ row.ASSET ]\n }),\n fit:[8,8],\n alignment:'left',\n //.second row top margin for even vert. layout\n margin:[ 0, iy?6:6, 0, 0]\n };\n tBody[iy][2*ix+1] = [\n { text:row.WEIGHT.toFixed(2)+'%', fontSize:11, color:'black', bold:true,\n alignment:'left',\n //.second row top margin for even vert. layout\n margin:[ 0, iy?0:0, 0, 0],\n lineHeight:1\n },\n { text:row.ASSET.substring(0,14), color:'#666', alignment:'left', margin:[0,0,0,0], \n lineHeight:1\n }\n ];\n //----------------------------------------\n // \\\\// tedious alignments of legend cells\n //----------------------------------------\n\n });\n //------------------\n // \\\\// chart legend\n //------------------\n\n\n\n //==============================\n // //\\\\ chart\n //==============================\n var chartPlaceholder = {\n //image: will come from export \n fit:[110,110],\n margin: [10,5,0,0]\n };\n\n placeholder.stack[1] = fmethods.layt({\n margin : [0,0,0,0],\n widths : [ '37%', '63%' ],\n pads : { left:0, top:20, right:0, bottom:0 },\n cols : 2,\n body : [[ \n chartPlaceholder,\n fmethods.layt({\n margin : [20,20,0,0],\n widths: [ '10%', '30%', '10%', '40%' ],\n cols : 4,\n rows : 2,\n fontSize: 9,\n bordCol : '#fff',\n body : tBody\n }).tbl\n ]]\n }).tbl;\n\n contCharts.push({ \n ddContRack : chartPlaceholder,\n //---------------------------\n // //\\\\ chart options\n //---------------------------\n options :\n {\n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: null,\n plotShadow: false,\n type: 'pie'\n ,width: 460\n ,height: 460\n },\n\n \"exporting\": {\n \"enabled\": false\n },\n \"credits\": {\n \"enabled\": false\n },\n \n legend: {\n enabled: false,\n },\n\n title: {\n text: ''\n },\n plotOptions: {\n pie: {\n dataLabels: {\n enabled: false\n },\n colors : colors,\n showInLegend: true\n },\n series: {\n animation: false\n }\n },\n series: [{\n colorByPoint: true,\n type: 'pie',\n innerSize: '83%',\n data: chartData\n }]\n }\n //---------------------------\n // \\\\// chart options\n //---------------------------\n });\n //==============================\n // \\\\// chart\n //==============================\n\n\n\n return placeholder;\n }", "get localBounds() {\n return {\n x: this.x, //I changed this, it was \"x: 0,\"\n y: this.y, //I changed this, it was \"y: 0,\"\n width: this.width,\n height: this.height\n } \n }", "function positionLozenge(id, item) {\n item.lozenge.updateFromEvent(item);\n item.lozenge.updateDisplayMain();\n }", "function refreshPosition(item) {\n // Find the top of an item by adding to the offsetHeight until we reach the\n // content element.\n var current = item.element[0];\n item.top = 0;\n item.left = 0;\n item.right = 0;\n while (current && current !== contentEl[0]) {\n item.top += current.offsetTop;\n item.left += current.offsetLeft;\n if (current.offsetParent) {\n // Compute offsetRight\n item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft;\n }\n current = current.offsetParent;\n }\n item.height = item.element.prop('offsetHeight');\n\n var defaultVal = $mdUtil.floatingScrollbars() ? '0' : undefined;\n $mdUtil.bidi(item.clone, 'margin-left', item.left, defaultVal);\n $mdUtil.bidi(item.clone, 'margin-right', defaultVal, item.right);\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 getPos(obj) {\n var offsets = obj.offset();\n objHeight = obj.height();\n objWidth = obj.width();\n excldH = objHeight/3; //Caculating 10% height\n top = offsets.top,\n left = offsets.left,\n bottom = top+objHeight,\n right = left+objWidth\n}", "function reportItemContext(RS, CurrObj, CurrObjIndex, CurrObjParent, $HTMLParent, Style, CurrLocation, ApplyBackgroundColor) {\n this.RS = RS;\n this.CurrObj = CurrObj;\n this.CurrObjIndex = CurrObjIndex;\n this.CurrObjParent = CurrObjParent;\n this.$HTMLParent = $HTMLParent;\n this.Style = Style;\n this.CurrLocation = CurrLocation;\n this.ApplyBackgroundColor = ApplyBackgroundColor;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "function intoCoordSystem(cm, lineObj, rect, context) {\n if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {\n var size = widgetHeight(lineObj.widgets[i]);\n rect.top += size; rect.bottom += size;\n }\n if (context == \"line\") return rect;\n if (!context) context = \"local\";\n var yOff = heightAtLine(cm, lineObj);\n if (context == \"local\") yOff += paddingTop(cm.display);\n else yOff -= cm.display.viewOffset;\n if (context == \"page\" || context == \"window\") {\n var lOff = getRect(cm.display.lineSpace);\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect;\n }", "getItem(x,y) { return this.getCell(x,y)._mapItem;}", "function getViewRect(seriesModel,api){return layout.getLayoutRect(seriesModel.getBoxLayoutParams(),{width:api.getWidth(),height:api.getHeight()});}", "function RESULTSGRID_buildoneupview(item) {\n //Draw the ONEUP header\n this.drawHeader(item);\n\n //Draw the time grid and day headers\n this.drawGrid();\n\n //Draw the elements on the screen\n this.drawEvents(item.eventsList);\n\n //Set the size of the ONEUPGRID_itinerary\n document.getElementById(\"ONEUPGRID_itinerary\").style.height = (window.innerHeight - 75).toString() + \"px\";\n document.getElementById(\"ONEUPGRID_itinerary\").style.paddingTop = \"80px\";\n }", "alignChildBasedOnaPoint(child, x, y) {\n x += child.margin.left - child.margin.right;\n y += child.margin.top - child.margin.bottom;\n switch (child.horizontalAlignment) {\n case 'Auto':\n case 'Left':\n x = x;\n break;\n case 'Stretch':\n case 'Center':\n x -= child.desiredSize.width * child.pivot.x;\n break;\n case 'Right':\n x -= child.desiredSize.width;\n break;\n }\n switch (child.verticalAlignment) {\n case 'Auto':\n case 'Top':\n y = y;\n break;\n case 'Stretch':\n case 'Center':\n y -= child.desiredSize.height * child.pivot.y;\n break;\n case 'Bottom':\n y -= child.desiredSize.height;\n break;\n }\n return { x: x, y: y };\n }", "function setItemPosition(item, menuOpts, posOpts, overrideOpts) {\n\t overrideOpts = overrideOpts || {};\n\t var rect = item.select('.' + constants.itemRectClassName),\n\t text = item.select('.' + constants.itemTextClassName),\n\t tspans = text.selectAll('tspan'),\n\t borderWidth = menuOpts.borderwidth,\n\t index = posOpts.index;\n\t\n\t Drawing.setTranslate(item, borderWidth + posOpts.x, borderWidth + posOpts.y);\n\t\n\t var isVertical = ['up', 'down'].indexOf(menuOpts.direction) !== -1;\n\t\n\t rect.attr({\n\t x: 0,\n\t y: 0,\n\t width: overrideOpts.width || (isVertical ? menuOpts.width1 : menuOpts.widths[index]),\n\t height: overrideOpts.height || (isVertical ? menuOpts.heights[index] : menuOpts.height1)\n\t });\n\t\n\t var tHeight = menuOpts.font.size * constants.fontSizeToHeight,\n\t tLines = tspans[0].length || 1,\n\t spanOffset = ((tLines - 1) * tHeight / 4);\n\t\n\t var textAttrs = {\n\t x: constants.textOffsetX,\n\t y: menuOpts.heights[index] / 2 - spanOffset + constants.textOffsetY\n\t };\n\t\n\t text.attr(textAttrs);\n\t tspans.attr(textAttrs);\n\t\n\t if(isVertical) {\n\t posOpts.y += menuOpts.heights[index] + posOpts.yPad;\n\t } else {\n\t posOpts.x += menuOpts.widths[index] + posOpts.xPad;\n\t }\n\t\n\t posOpts.index++;\n\t}", "function setItemPosition(item, menuOpts, posOpts, overrideOpts) {\n overrideOpts = overrideOpts || {};\n var rect = item.select('.' + constants.itemRectClassName);\n var text = item.select('.' + constants.itemTextClassName);\n var borderWidth = menuOpts.borderwidth;\n var index = posOpts.index;\n var dims = menuOpts._dims;\n Drawing.setTranslate(item, borderWidth + posOpts.x, borderWidth + posOpts.y);\n var isVertical = ['up', 'down'].indexOf(menuOpts.direction) !== -1;\n var finalHeight = overrideOpts.height || (isVertical ? dims.heights[index] : dims.height1);\n rect.attr({\n x: 0,\n y: 0,\n width: overrideOpts.width || (isVertical ? dims.width1 : dims.widths[index]),\n height: finalHeight\n });\n var tHeight = menuOpts.font.size * LINE_SPACING;\n var tLines = svgTextUtils.lineCount(text);\n var spanOffset = (tLines - 1) * tHeight / 2;\n svgTextUtils.positionText(text, constants.textOffsetX, finalHeight / 2 - spanOffset + constants.textOffsetY);\n if (isVertical) {\n posOpts.y += dims.heights[index] + posOpts.yPad;\n } else {\n posOpts.x += dims.widths[index] + posOpts.xPad;\n }\n posOpts.index++;\n}", "function PdfGridBeginPageLayoutEventArgs(bounds,page,startRow){var _this=_super.call(this,bounds,page)||this;_this.startRow=startRow;return _this;}", "function positionPanel() {\n $(\"#ad-hoc-panel\").position({\n my: \"left+10 top\",\n at: \"right top\",\n of: model.selectedAnchor,\n collision: \"flipfit fit\"\n })\n}", "function getColumnLocation(plot, gridpos, numberOfBars) \n { \n var insideheight = plot.grid._height; \n var colheight = insideheight / numberOfBars; \n var column = parseInt(gridpos.y / colheight); \n return (numberOfBars - 1) - column;\n }", "function setItemPosition(item, menuOpts, posOpts, overrideOpts) {\n overrideOpts = overrideOpts || {};\n var rect = item.select('.' + constants.itemRectClassName);\n var text = item.select('.' + constants.itemTextClassName);\n var borderWidth = menuOpts.borderwidth;\n var index = posOpts.index;\n\n Drawing.setTranslate(item, borderWidth + posOpts.x, borderWidth + posOpts.y);\n\n var isVertical = ['up', 'down'].indexOf(menuOpts.direction) !== -1;\n var finalHeight = overrideOpts.height || (isVertical ? menuOpts.heights[index] : menuOpts.height1);\n\n rect.attr({\n x: 0,\n y: 0,\n width: overrideOpts.width || (isVertical ? menuOpts.width1 : menuOpts.widths[index]),\n height: finalHeight\n });\n\n var tHeight = menuOpts.font.size * LINE_SPACING;\n var tLines = svgTextUtils.lineCount(text);\n var spanOffset = ((tLines - 1) * tHeight / 2);\n\n svgTextUtils.positionText(text, constants.textOffsetX,\n finalHeight / 2 - spanOffset + constants.textOffsetY);\n\n if(isVertical) {\n posOpts.y += menuOpts.heights[index] + posOpts.yPad;\n } else {\n posOpts.x += menuOpts.widths[index] + posOpts.xPad;\n }\n\n posOpts.index++;\n}", "function setItemPosition(item, menuOpts, posOpts, overrideOpts) {\n overrideOpts = overrideOpts || {};\n var rect = item.select('.' + constants.itemRectClassName);\n var text = item.select('.' + constants.itemTextClassName);\n var borderWidth = menuOpts.borderwidth;\n var index = posOpts.index;\n\n Drawing.setTranslate(item, borderWidth + posOpts.x, borderWidth + posOpts.y);\n\n var isVertical = ['up', 'down'].indexOf(menuOpts.direction) !== -1;\n var finalHeight = overrideOpts.height || (isVertical ? menuOpts.heights[index] : menuOpts.height1);\n\n rect.attr({\n x: 0,\n y: 0,\n width: overrideOpts.width || (isVertical ? menuOpts.width1 : menuOpts.widths[index]),\n height: finalHeight\n });\n\n var tHeight = menuOpts.font.size * LINE_SPACING;\n var tLines = svgTextUtils.lineCount(text);\n var spanOffset = ((tLines - 1) * tHeight / 2);\n\n svgTextUtils.positionText(text, constants.textOffsetX,\n finalHeight / 2 - spanOffset + constants.textOffsetY);\n\n if(isVertical) {\n posOpts.y += menuOpts.heights[index] + posOpts.yPad;\n } else {\n posOpts.x += menuOpts.widths[index] + posOpts.xPad;\n }\n\n posOpts.index++;\n}", "shiftChildLocationForTableCellWidget(cellWidget, shiftTop) {\n cellWidget.y = cellWidget.y + shiftTop;\n for (let i = 0; i < cellWidget.childWidgets.length; i++) {\n if (cellWidget.childWidgets[i] instanceof ParagraphWidget) {\n cellWidget.childWidgets[i].x = cellWidget.childWidgets[i].x;\n cellWidget.childWidgets[i].y = cellWidget.childWidgets[i].y + shiftTop;\n }\n else {\n this.shiftChildLocationForTableWidget(cellWidget.childWidgets[i], shiftTop);\n }\n }\n }", "position() {\n const box = document.querySelector('.att');\n // The bounding info of the container\n const mainBox = {\n width: this.DOM.el.offsetWidth,\n heigt: this.DOM.el.offsetHeight\n };\n\n // Positoning the elements\n this.DOM.nav.style.left = box.style.left = `${mainBox.width - (450 - main.offsetLeft)}px`;\n this.DOM.nav.style.top = `${main.offsetTop - (main.offsetHeight / 2)}px`; \n }", "function setPosition() {\r\n\t\t if (container) {\r\n\t\t if (x < container.left) {\r\n\t\t x = container.left;\r\n\t\t } else if (x > container.right - width) {\r\n\t\t x = container.right - width;\r\n\t\t }\r\n\t\t if (y < container.top) {\r\n\t\t y = container.top;\r\n\t\t } else if (y > container.bottom - height) {\r\n\t\t y = container.bottom - height;\r\n\t\t }\r\n\t\t }\r\n\r\n\t\t }", "getElementArea(element) {\n element = element !== null && element !== void 0 ? element : this._element;\n const rect = element.getBoundingClientRect();\n const top = rect.top + document.body.scrollTop;\n const left = rect.left + document.body.scrollLeft;\n const width = rect.width;\n const height = rect.height;\n return {\n x1: left,\n y1: top,\n x2: left + width,\n y2: top + height,\n surface: width * height,\n contentItem: this\n };\n }", "function DIF_getObjectXY(o) {\n var res = new Object();\n res.x = 0; res.y = 0;\n if (o != null) {\n /*** CMS ***/\n /*res.x = o.style.left.substring(0,o.style.left.indexOf(\"px\"));\n res.y = o.style.top.substring(0,o.style.top.indexOf(\"px\"));*/\n var dialog = $cmsj(o).parent();\n if (dialog.length > 0) {\n res.x = dialog.css('left').substring(0, dialog.css('left').indexOf(\"px\"));\n res.y = dialog.css('top').substring(0, dialog.css('top').indexOf(\"px\"));\n }\n /*** END CMS ***/\n }\n return res;\n}", "setStartingPosition() {\n this.x = CELL_WIDTH * 2;\n this.y = CELL_HEIGHT * COLS;\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 PosWithInfo(line, ch, outside, xRel) {\n\t\t var pos = Pos(line, ch);\n\t\t pos.xRel = xRel;\n\t\t if (outside) pos.outside = true;\n\t\t return pos;\n\t\t }", "function setAbsolutePosition() {\n var top = $(this).position().top + $boundary.scrollTop();\n var width = $(this).innerWidth();\n\n // store current yPos\n positions.unshift(top);\n // move to absolute positioning\n $(this)\n .css({\n position: 'absolute',\n top: top,\n width: width\n });\n }", "function PositionDetail(props) {\n const { siteCode, position, wide } = props;\n const classes = useStyles(Theme);\n const [state] = TimeSeriesViewerContext.useTimeSeriesViewerState();\n const containerRef = useRef();\n const [componentWidth, setComponentWidth] = useState(0);\n let atComponentXs = false;\n let atComponentMd = false;\n if (componentWidth > 0) {\n atComponentXs = (componentWidth <= POSITION_DETAIL_COMPONENT_XS_UPPER);\n atComponentMd = (componentWidth > POSITION_DETAIL_COMPONENT_MD_LOWER);\n }\n const handleResizeCb = useCallback(() => {\n const container = containerRef.current;\n if (!container) { return; }\n if (container.clientWidth === componentWidth) { return; }\n setComponentWidth(container.clientWidth);\n }, [containerRef, componentWidth, setComponentWidth]);\n useLayoutEffect(() => {\n const element = containerRef.current;\n if (!element) { return () => {}; }\n handleResizeCb();\n if (typeof ResizeObserver !== 'function') {\n window.addEventListener('resize', handleResizeCb);\n return () => {\n window.removeEventListener('resize', handleResizeCb);\n };\n }\n let resizeObserver = new ResizeObserver(handleResizeCb);\n resizeObserver.observe(element);\n return () => {\n if (!resizeObserver) { return; }\n resizeObserver.disconnect();\n resizeObserver = null;\n };\n }, [containerRef, handleResizeCb]);\n if (!state.product.sites[siteCode] || !state.product.sites[siteCode].positions[position]) {\n return <Typography variant=\"body1\">{position}</Typography>;\n }\n const { history } = state.product.sites[siteCode].positions[position];\n const current = history.length - 1 || 0;\n const {\n sensorName,\n sensorDescription,\n referenceLocationName,\n referenceLocationDescription,\n referenceLocationElevation,\n xOffset,\n yOffset,\n zOffset,\n } = history[current] || {};\n const hasReferenceElevation = exists(referenceLocationElevation)\n && !isNaN(referenceLocationElevation);\n const hasXOffset = exists(xOffset) && !isNaN(xOffset);\n const hasYOffset = exists(yOffset) && !isNaN(yOffset);\n const hasZOffset = exists(zOffset) && !isNaN(zOffset);\n const parsedReferenceElevation = hasReferenceElevation\n ? referenceLocationElevation\n : NaN;\n const parsedZOffset = hasZOffset ? zOffset : NaN;\n const displayXOffset = hasXOffset ? `${xOffset}m` : '--';\n const displayYOffset = hasYOffset ? `${yOffset}m` : '--';\n const displayZOffset = hasZOffset ? `${zOffset}m` : '--';\n let elevation = '--';\n if (!isNaN(parsedReferenceElevation)) {\n if (!isNaN(parsedZOffset)) {\n elevation = `${(parsedReferenceElevation + parsedZOffset).toFixed(2).toString()}m`;\n } else {\n elevation = `${parsedReferenceElevation}m`;\n }\n }\n const fadeStyle = { color: Theme.palette.grey[500] };\n const axisStyle = { marginRight: Theme.spacing(1), fontWeight: 600 };\n const renderDescription = () => {\n const hasName = isStringNonEmpty(sensorName);\n const hasDescription = isStringNonEmpty(sensorDescription);\n const hasReferenceName = isStringNonEmpty(referenceLocationName);\n const hasReferenceDescription = isStringNonEmpty(referenceLocationDescription);\n const appliedName = hasName ? sensorName : 'N/A';\n const appliedDescription = hasDescription ? sensorDescription : 'N/A';\n const includeReference = hasReferenceName || hasReferenceDescription;\n const appliedReferenceName = hasReferenceName ? referenceLocationName : 'N/A';\n const appliedReferenceDescription = hasReferenceDescription\n ? referenceLocationDescription\n : 'N/A';\n return wide ? (\n <>\n <div\n className={classes.startFlex}\n style={{ ...fadeStyle, marginRight: Theme.spacing(3), marginTop: Theme.spacing(0.5) }}\n >\n <Typography variant=\"caption\">\n <span style={{ fontWeight: 600 }}>Location: </span>\n {`${appliedDescription} (${appliedName})`}\n </Typography>\n </div>\n {!includeReference ? null : (\n <div\n className={classes.startFlex}\n style={{ ...fadeStyle, marginRight: Theme.spacing(3) }}\n >\n <Typography variant=\"caption\">\n <span style={{ fontWeight: 600 }}>Reference Location: </span>\n {`${appliedReferenceDescription} (${appliedReferenceName})`}\n </Typography>\n </div>\n )}\n </>\n ) : (\n <div style={{ marginRight: Theme.spacing(3), marginTop: Theme.spacing(0.5) }}>\n <div>\n <Typography variant=\"body2\" style={{ fontWeight: 600 }}>\n Location:\n </Typography>\n </div>\n <div style={{ ...fadeStyle }}>\n <Typography variant=\"body2\">\n {`${appliedDescription} (${appliedName})`}\n </Typography>\n </div>\n {!includeReference ? null : (\n <>\n <div>\n <Typography variant=\"body2\" style={{ fontWeight: 600 }}>\n Reference Location:\n </Typography>\n </div>\n <div style={{ ...fadeStyle }}>\n <Typography variant=\"body2\">\n {`${appliedReferenceDescription} (${appliedReferenceName})`}\n </Typography>\n </div>\n </>\n )}\n </div>\n );\n };\n let positionContainerStyle = {\n alignItems: 'center',\n justifyContent: 'space-between',\n };\n let positionSectionsContainerStyle = {\n display: 'flex',\n flexDirection: 'column',\n };\n let historyButtonContainerStyle = {\n textAlign: 'right',\n };\n if (atComponentXs) {\n positionContainerStyle = {\n ...positionContainerStyle,\n alignItems: 'flex-start',\n flexDirection: 'column',\n };\n historyButtonContainerStyle = {\n ...historyButtonContainerStyle,\n textAlign: 'unset',\n marginTop: Theme.spacing(1),\n width: '100%',\n };\n }\n if (atComponentMd) {\n positionSectionsContainerStyle = {\n ...positionSectionsContainerStyle,\n flexDirection: 'row',\n };\n }\n return wide ? (\n <div ref={containerRef}>\n <div className={classes.startFlex} style={{ alignItems: 'flex-end' }}>\n <Typography variant=\"body1\" style={{ fontWeight: 600, marginRight: Theme.spacing(3) }}>\n {position}\n </Typography>\n <div className={classes.startFlex} style={{ alignItems: 'center', ...fadeStyle }}>\n <Typography variant=\"body2\">Elevation:</Typography>\n <ElevationIcon fontSize=\"small\" style={{ margin: Theme.spacing(0, 0.5, 0, 1) }} />\n <Typography variant=\"body2\">{elevation}</Typography>\n </div>\n </div>\n <div className={classes.startFlex}>\n <Typography variant=\"body2\">\n <span style={{ ...axisStyle }}>x / y / z:</span>\n {`${displayXOffset} / ${displayYOffset} / ${displayZOffset}`}\n </Typography>\n </div>\n {renderDescription()}\n </div>\n ) : (\n <div\n ref={containerRef}\n className={classes.startFlex}\n style={positionContainerStyle}\n >\n <div style={positionSectionsContainerStyle}>\n <div className={classes.startFlex} style={{ alignItems: 'center' }}>\n <div style={{ marginRight: Theme.spacing(3) }}>\n <Typography variant=\"body1\" style={{ fontWeight: 600 }}>\n {position}\n </Typography>\n <Typography variant=\"body2\" style={{ ...fadeStyle }}>\n Elevation:\n </Typography>\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <ElevationIcon\n fontSize=\"small\"\n style={{ marginRight: Theme.spacing(0.5), ...fadeStyle }}\n />\n <Typography variant=\"body2\" style={{ ...fadeStyle }}>\n {elevation}\n </Typography>\n </div>\n </div>\n <div style={{ marginRight: Theme.spacing(3) }}>\n <Typography variant=\"body2\">\n <span style={{ ...axisStyle }}>x:</span>\n {`${displayXOffset}`}\n <br />\n <span style={{ ...axisStyle }}>y:</span>\n {`${displayYOffset}`}\n <br />\n <span style={{ ...axisStyle }}>z:</span>\n {`${displayZOffset}`}\n </Typography>\n </div>\n </div>\n {renderDescription()}\n </div>\n <div style={historyButtonContainerStyle}>\n <PositionHistoryButton\n siteCode={siteCode}\n position={position}\n history={history}\n fullWidth={atComponentXs}\n />\n </div>\n </div>\n );\n}", "function PaintSequence() {\n if (idCurrentBloc != undefined) {\n var nom, item, topMargin;\n topMargin = 60; //initial value of topMargin for the first box. This value will increment +50px for each box of the jsplumb.\n idsInside = [];\n if (o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].BlocsReferences) {\n for (var i = 0; i < o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].BlocsReferences.int.length; i++) {\n idsInside.push(o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].BlocsReferences.int[i] + \"-B\");\n }\n }\n if (o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].PointsReferences) {\n for (var i = 0; i < o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].PointsReferences.int.length; i++) {\n idsInside.push(o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].PointsReferences.int[i] + \"-P\");\n }\n }\n\n document.getElementById(\"diagramcontainer\").innerHTML = \"\";\n document.getElementById(\"diagramcontainer\").innerHTML += \"<div id='item9998' class='item' onclick='GetItemGUIPositionMouseUp(this.id)' style='top:10px; background: #ffffff; color: #242629; width: 80px;margin-left:auto;margin-right:auto;'><strong><p id='initcontent'></p></strong></div>\";\n document.getElementById('initcontent').innerHTML = \"Init\";\n var middleX;\n middleX = (document.getElementById(\"diagramcontainer\").offsetWidth / 2) - 100;\n for (var i = 0; i < idsInside.length; i++) {\n arrayidsInside = idsInside[i].split(\"-\");\n id = idsInside[i].split(\"-\", 1);\n item = \"item\" + id;\n nom = \"nom\" + id;\n\n //first compares the idgiven with the ItemGUI id's\n if (o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].SequenceDescriptions.AllItems.ItemGUI) {\n for (var u = 0; u < o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].SequenceDescriptions.AllItems.ItemGUI.length; u++) {\n if (o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].SequenceDescriptions.AllItems.ItemGUI[u].itemId == id) {\n xS = (+o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].SequenceDescriptions.AllItems.ItemGUI[u].x_location) + (+middleX);\n yS = o.BlocAssembly.AllBlocs.Bloc[idCurrentBloc].SequenceDescriptions.AllItems.ItemGUI[u].y_location;\n document.getElementById(\"diagramcontainer\").innerHTML += \"<div id='\" + item + \"' class='item' style='top:\" + yS + \"px; left:\" + xS + \"px;' oncontextmenu='RightClickItem(this.id)' onmouseover='MouseOverItem(this.id, event)' onmouseout='HideDialogBox()' onclick='GetItemGUIPositionMouseUp(this.id)' ondblclick='DblClickElemSequence(this.id)'><strong><p id='\" + nom + \"'></p></strong></div>\";\n\n }\n }\n if (arrayidsInside[1] == \"B\") {\n for (var q = 0; q < o.BlocAssembly.AllBlocs.Bloc.length; q++) {\n if (o.BlocAssembly.AllBlocs.Bloc[q][\"@Id\"] == id) {\n document.getElementById(nom).innerHTML = o.BlocAssembly.AllBlocs.Bloc[q].BlocName;\n document.getElementById(item).style.background = \"#54595f\"; //color bloc in secuence\n document.getElementById(item).style.color = \"#ffffff\";\n\n }\n }\n } else if (arrayidsInside[1] == \"P\") {\n for (var q = 0; q < o.BlocAssembly.AllPoints.ProcessPoint.length; q++) {\n if (o.BlocAssembly.AllPoints.ProcessPoint[q][\"@Id\"] == id) {\n document.getElementById(nom).innerHTML = o.BlocAssembly.AllPoints.ProcessPoint[q].Alias;\n }\n }\n }\n }\n }\n document.getElementById(\"diagramcontainer\").innerHTML += \"<div id='item9999' class='item' onclick='GetItemGUIPositionMouseUp(this.id)' style='top:\" + 500 + \"px; background: #ffffff; color: #242629; width: 80px; margin-left:auto;margin-right:auto;'><strong><p id='fincontent'></p></strong></div>\";\n document.getElementById('fincontent').innerHTML = \"End\";\n PlumbGrafic();\n }\n}", "function placeItemClick(e) {\r\n var pic = DRAWAPP.pic;\r\n var startXY = pic.pageToWindowCoords(DRAWAPP.startX, DRAWAPP.startY);\r\n var endXY = pic.pageToWindowCoords(e.pageX, e.pageY);\r\n var midX = Math.floor(0.5+(startXY[0]+endXY[0])/2);\r\n var midY = Math.floor(0.5+(startXY[1]+endXY[1])/2);\r\n var winWidth = Math.abs(Math.floor(endXY[0]-startXY[0]+0.5));\r\n var winHeight = Math.abs(Math.floor(endXY[1]-startXY[1]+0.5));\r\n var newItem;\r\n var points = [];\r\n // Add the specific type of item\r\n if (DRAWAPP.mouseMode === DRAWAPP.mousePlaceRect) {\r\n newItem = addRect( midX, midY, winWidth, winHeight, 0);\r\n }\r\n if (DRAWAPP.mouseMode === DRAWAPP.mousePlaceEllipse) {\r\n var radius = Math.floor(0.5+Math.min(winWidth, winHeight)/2);\r\n newItem = addCirc( midX, midY, radius, 0);\r\n }\r\n if (DRAWAPP.mouseMode === DRAWAPP.mousePlaceLine) {\r\n points = [startXY, endXY];\r\n newItem = addPolyline(points);\r\n }\r\n if (DRAWAPP.mouseMode === DRAWAPP.mousePlaceFreehand) {\r\n DRAWAPP.lineSet.push([e.pageX, e.pageY]);\r\n var len = DRAWAPP.lineSet.length;\r\n for (var i = 0 ; i < len ; i++ ) {\r\n var onePoint = \r\n pic.pageToWindowCoords(DRAWAPP.lineSet[i][0],\r\n DRAWAPP.lineSet[i][1]);\r\n points.push(onePoint);\r\n }\r\n newItem = addFreehand(points);\r\n }\r\n if (DRAWAPP.mouseMode === DRAWAPP.mouseSelectGroup) {\r\n // Find selected items, if any\r\n var groupedItems = DRAWAPP.pic.contained(0,\r\n DRAWAPP.startX, DRAWAPP.startY, e.pageX, e.pageY);\r\n if (groupedItems.length) {\r\n addGroup( groupedItems ) ;\r\n }\r\n }\r\n // Don't have the text yet so store the location and bring up a dialog\r\n if (DRAWAPP.mouseMode === DRAWAPP.mousePlaceText) {\r\n DRAWAPP.textXY = pic.pageToWindowCoords(e.pageX, e.pageY);\r\n DRAWAPP.placeText = true;\r\n // Prime the Text dialog\r\n document.getElementById(\"id_body_text\").value = '';\r\n document.getElementById(\"text_rotation\").value = '0';\r\n document.getElementById(\"text_size\").value = DRAWAPP.newTextSize;\r\n setItemLineStyle(''); // Unset\r\n setItemFillStyle(''); // Unset\r\n document.getElementById(\"text_box_div\").setAttribute(\"class\", \"hidden\");\r\n document.getElementById(\"text_box_check\").checked = false;\r\n showDiv('text_div');\r\n document.getElementById('text_z_butt').setAttribute(\"class\", \"hidden\");\r\n document.getElementById(\"id_body_text\").focus();\r\n }\r\n // Standard actions for (almost) all.\r\n // Text is one exception because we need to put up a dialog to capture the\r\n // actual text.\r\n // Group is the other because it doesn't have line width & colour and is\r\n // logged separately.\r\n if ((DRAWAPP.mouseMode !== DRAWAPP.mousePlaceText) &&\r\n (DRAWAPP.mouseMode !== DRAWAPP.mouseSelectGroup)) {\r\n newItem.setLineWidth(DRAWAPP.lineWidth);\r\n newItem.setLineStyle(DRAWAPP.lineStyle);\r\n DRAWAPP.pic.redrawAll();\r\n }\r\n if (DRAWAPP.mouseMode === DRAWAPP.mouseSelectGroup) {\r\n DRAWAPP.pic.redrawAll();\r\n }\r\n }", "function _ibp() {\r\n var p = _pfa(arguments);\r\n if (p) {\r\n if (p.x + this.dim().w > self.dim().w + viewLeft())\r\n p.x = self.dim().w - this.dim().w + viewLeft();\r\n\r\n if (p.y + this.dim().h > self.dim().h + viewTop())\r\n p.y = self.dim().h - this.dim().h + viewTop();\r\n\r\n if (p.x < viewLeft())\r\n p.x = viewLeft();\r\n\r\n if (p.y < viewTop())\r\n p.y = viewTop();\r\n\r\n this.p = absPos(this, p);\r\n }\r\n return objCss(this, \"position\") == \"absolute\" ? this.p : absPos(this);\r\n}", "updateTableWidgetLocation(tableWidget, location, isUpdateToTop) {\n tableWidget.y = location = location + tableWidget.topBorderWidth;\n let cellSpacing = 0;\n for (let i = 0; i < tableWidget.childWidgets.length; i++) {\n let rowWidget = tableWidget.childWidgets[i];\n rowWidget.y = location;\n for (let j = 0; j < rowWidget.childWidgets.length; j++) {\n let cellWidget = rowWidget.childWidgets[j];\n cellWidget.y = location + cellWidget.margin.top + cellSpacing;\n this.updateCellVerticalPosition(cellWidget, isUpdateToTop, true);\n }\n location = location + rowWidget.height;\n }\n return location;\n }", "getPosition(i) {\n let vis = this;\n let xPos = (i % 3 === 0)\n ? vis.width / 6\n : (i % 3 === 1)\n ? vis.width / 2\n : vis.width * 5/6;\n let yPos = (i <= 2)\n ? vis.height / 6\n : (i <= 5)\n ? vis.height / 2\n : vis.height * 5/6;\n\n return 'translate(' + xPos + ',' + yPos + ')';\n }", "function PackItemOverlay() {}", "get location() {\n return new Point(this.x, this.y);\n }", "function ShapeLayouter(element){var _this=_super.call(this,element)||this;// Fields\n/**\n * Initializes the object to store `older form elements` of previous page.\n * @default 0\n * @private\n */_this.olderPdfForm=0;/**\n * The `bounds` of the shape element.\n * * @default new RectangleF()\n * @private\n */_this.shapeBounds=new RectangleF();/**\n * Total Page size of the web page.\n * * @default 0\n * @private\n */_this.totalPageSize=0;return _this;}", "function setLocation(){\n\tvar content=document.getElementById(\"keyword\");\n\tvar width=content.offsetWidth;\n\tvar height=content.offsetHeight;\n\tvar left=content[\"offsetLeft\"]-1;\n\tvar top=content[\"offsetTop\"]+height+1;\n\tvar popDiv=document.getElementById(\"popDiv\");\n\tpopDiv.style.border=\"#DADADA 1px solid\";\n\tpopDiv.style.position=\"absolute\";\n\tpopDiv.style.width=width+\"px\";\n\tpopDiv.style.left=left+\"px\";\n\tpopDiv.style.top=top+\"px\";\n\tdocument.getElementById(\"content_table\").style.width=width+\"px\";\n}", "function cellPoint( table, item, cell ) {\n var poly = ( cell ? \n table.cells.filter('#'+table.tabid+'_'+cell[0]+'_'+cell[1]) :\n table.tabregion ).children('polygon');\n return poly.length === 0 ? null : poly[0].points.getItem(item) ;\n }", "get position() {\n\t\treturn this._position.object;\n\t}", "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 }", "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 }", "function PaintPointsActions() {\n var nom, item, topMargin;\n topMargin = 60; //initial value of topMargin for the first box. This value will increment +50px for each box of the jsplumb.\n var x = o.BlocAssembly.AllPoints.ProcessPoint;\n document.getElementById(\"diagramcontainer\").innerHTML = \"\";\n for (i = 0; i < x.length; i++) {\n esdelbloc = CompareProcessPointWithPointReferencesBloc(x[i][\"@Id\"]); //compara l'id del ProcessPoint que vaig a pintar, amb els ids del PointReferences del Bloc on estem. Si està, retorna true\n if (esdelbloc == true) {\n nom = \"nom\" + i;\n id = x[i][\"@Id\"];\n item = \"item\" + id;\n document.getElementById(\"diagramcontainer\").innerHTML += \"<div id='\" + item + \"' class='itemActions' style='top:\" + topMargin + \"px;' onclick='OnClickPoint_Actions(this.id)' ><strong><p id='\" + nom + \"'></p></strong></div>\";\n document.getElementById(nom).innerHTML = x[i].Alias;\n topMargin += 50;\n }\n }\n}" ]
[ "0.5833411", "0.5710618", "0.5598458", "0.5542617", "0.5485298", "0.5453277", "0.54371893", "0.5434338", "0.5397356", "0.5314588", "0.53019327", "0.5265581", "0.5257372", "0.5240789", "0.52221084", "0.5216181", "0.51899916", "0.5183845", "0.5183437", "0.5166687", "0.5156476", "0.51305217", "0.5111947", "0.51022834", "0.5101293", "0.50960475", "0.50831044", "0.507849", "0.50751394", "0.5061948", "0.5060236", "0.50561744", "0.5054502", "0.5054502", "0.5051895", "0.50515157", "0.5045288", "0.5044701", "0.5033426", "0.50259686", "0.5023516", "0.50184315", "0.50147104", "0.50052994", "0.5004047", "0.49947932", "0.49892738", "0.49876887", "0.49824303", "0.49818513", "0.49818513", "0.49740297", "0.49713835", "0.496807", "0.49680525", "0.49594027", "0.49594027", "0.49594027", "0.49594027", "0.49491656", "0.49480993", "0.49459365", "0.49459365", "0.49459365", "0.49459365", "0.49449006", "0.49372157", "0.49364507", "0.49249837", "0.49142626", "0.49130738", "0.49074852", "0.4906972", "0.49046215", "0.49031103", "0.49031103", "0.49030492", "0.48964018", "0.4889942", "0.48859978", "0.48856366", "0.48820317", "0.48752", "0.48716608", "0.486179", "0.4861593", "0.48597535", "0.485771", "0.48571512", "0.485654", "0.48459345", "0.48442197", "0.48440573", "0.4843684", "0.48379245", "0.48363873", "0.48362893", "0.48336703", "0.4833213", "0.48298004" ]
0.6942143
0
The Floating header object holds pointers to the tablix and its row and col header objects
function floatingHeader($tablix, $rowHeader, $colHeader) { this.$tablix = $tablix; this.$rowHeader = $rowHeader; this.$colHeader = $colHeader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UltraGrid_InitialiseHeaders(theObject)\n{\n\t//internal function that builds a header\n\tfunction _BuildHeaderObject(header, theObject, index)\n\t{\n\t\t//create the object\n\t\tvar newHeader = new IntObject_IntObject({ Id: \"UltraGrid_\" + theObject.DataObject.Id + \"_Header_\" + index, Class: __NEMESIS_CLASS_PUSH_BUTTON, Properties: {} }, null);\n\t\t//set our data\n\t\tnewHeader.UltraGridId = String_IsNullOrWhiteSpace(header.Id) ? newHeader.DataObject.Id : header.Id;\t//Internal Id\n\t\tnewHeader.Index = index;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Its original index in header\n\t\tnewHeader.UltraGrid = theObject;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Parent Object\n\t\tnewHeader.UltraGridHeader = true;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Marker that quickly identifies it as a header object\n\t\tnewHeader.Parent = { HTMLParent: null, InterfaceLook: theObject.InterfaceLook, DataObject: theObject.DataObject, AppendChild: IntObject_AppendChild };\n\t\t//has template?\n\t\tif (!String_IsNullOrWhiteSpace(header.Template))\n\t\t{\n\t\t\t//retrieve the template\n\t\t\tvar template = theObject.Data.Templates[header.Template];\n\t\t\t//valid?\n\t\t\tif (template)\n\t\t\t{\n\t\t\t\t//set the class\n\t\t\t\tnewHeader.DataObject.Class = template.Class;\n\t\t\t\t//get its properties\n\t\t\t\tfor (var property in template.Properties)\n\t\t\t\t{\n\t\t\t\t\t//and copy them into our header\n\t\t\t\t\tnewHeader.Properties[property] = template.Properties[property];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//do we have properties in our header?\n\t\tif (header.Properties)\n\t\t{\n\t\t\t//get its properties\n\t\t\tfor (var property in header.Properties)\n\t\t\t{\n\t\t\t\t//and copy them into our header\n\t\t\t\tnewHeader.Properties[property] = header.Properties[property];\n\t\t\t}\n\t\t}\n\t\t//run the interface look now that we have all of our properties\n\t\tnewHeader.UpdateInterfaceLook();\n\t\t//correct the designer class\n\t\tnewHeader.DataObject.ClassDesigner = Get_ClassString(newHeader.DataObject.Class);\n\t\t//Build header rect\n\t\tnewHeader.Rect = new Position_Rect(Get_Number(newHeader.Properties[__NEMESIS_PROPERTY_LEFT], 0), Get_Number(newHeader.Properties[__NEMESIS_PROPERTY_TOP], 0), Get_Number(newHeader.Properties[__NEMESIS_PROPERTY_WIDTH], 0), Get_Number(newHeader.Properties[__NEMESIS_PROPERTY_HEIGHT], 0));\n\t\t//return newHeader\n\t\treturn newHeader;\n\t}\n\t//create a header master\n\tvar master =\n\t{\n\t\tIds: {},\t\t//finds headers per internal id\n\t\tCells: [],\t\t//array for quick iteration, also not all headers may have ids\n\t\tHeight: 0,\t\t//Maximum height of all headers (the bottom of all headers)\n\t\tWidth: 0\t\t//Maximum width of all headers (the right of all headers)\n\t};\n\t//retrieve the property\n\tvar stringProperty = theObject.Properties[__NEMESIS_PROPERTY_HEADER];\n\t//valid?\n\tif (!String_IsNullOrWhiteSpace(stringProperty))\n\t{\n\t\tvar data = false;\n\t\t//parse it into json\n\t\ttry { data = JSON.parse(stringProperty); } catch (error) { Common_Error(error.message); }\n\t\t//valid templates?\n\t\tif (data)\n\t\t{\n\t\t\t//loop through them\n\t\t\tfor (var iHeader = 0, cHeader = data.length; iHeader < cHeader; iHeader++)\n\t\t\t{\n\t\t\t\t//create a new Header object\n\t\t\t\tvar newHeader = _BuildHeaderObject(data[iHeader], theObject, iHeader);\n\t\t\t\t//store it in the list\n\t\t\t\tmaster.Cells.push(newHeader);\n\t\t\t\t//store it in the map\n\t\t\t\tmaster.Ids[newHeader.UltraGridId] = newHeader;\n\t\t\t\t//update max height\n\t\t\t\tmaster.Height = Math.max(master.Height, newHeader.Rect.bottom);\n\t\t\t\t//update max width\n\t\t\t\tmaster.Width = Math.max(master.Width, newHeader.Rect.right);\n\t\t\t}\n\t\t}\n\t}\n\t//return the headers\n\treturn master;\n}", "function _BuildHeaderObject(header, theObject, index)\n\t{\n\t\t//create the object\n\t\tvar newHeader = new IntObject_IntObject({ Id: \"UltraGrid_\" + theObject.DataObject.Id + \"_Header_\" + index, Class: __NEMESIS_CLASS_PUSH_BUTTON, Properties: {} }, null);\n\t\t//set our data\n\t\tnewHeader.UltraGridId = String_IsNullOrWhiteSpace(header.Id) ? newHeader.DataObject.Id : header.Id;\t//Internal Id\n\t\tnewHeader.Index = index;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Its original index in header\n\t\tnewHeader.UltraGrid = theObject;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Parent Object\n\t\tnewHeader.UltraGridHeader = true;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Marker that quickly identifies it as a header object\n\t\tnewHeader.Parent = { HTMLParent: null, InterfaceLook: theObject.InterfaceLook, DataObject: theObject.DataObject, AppendChild: IntObject_AppendChild };\n\t\t//has template?\n\t\tif (!String_IsNullOrWhiteSpace(header.Template))\n\t\t{\n\t\t\t//retrieve the template\n\t\t\tvar template = theObject.Data.Templates[header.Template];\n\t\t\t//valid?\n\t\t\tif (template)\n\t\t\t{\n\t\t\t\t//set the class\n\t\t\t\tnewHeader.DataObject.Class = template.Class;\n\t\t\t\t//get its properties\n\t\t\t\tfor (var property in template.Properties)\n\t\t\t\t{\n\t\t\t\t\t//and copy them into our header\n\t\t\t\t\tnewHeader.Properties[property] = template.Properties[property];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//do we have properties in our header?\n\t\tif (header.Properties)\n\t\t{\n\t\t\t//get its properties\n\t\t\tfor (var property in header.Properties)\n\t\t\t{\n\t\t\t\t//and copy them into our header\n\t\t\t\tnewHeader.Properties[property] = header.Properties[property];\n\t\t\t}\n\t\t}\n\t\t//run the interface look now that we have all of our properties\n\t\tnewHeader.UpdateInterfaceLook();\n\t\t//correct the designer class\n\t\tnewHeader.DataObject.ClassDesigner = Get_ClassString(newHeader.DataObject.Class);\n\t\t//Build header rect\n\t\tnewHeader.Rect = new Position_Rect(Get_Number(newHeader.Properties[__NEMESIS_PROPERTY_LEFT], 0), Get_Number(newHeader.Properties[__NEMESIS_PROPERTY_TOP], 0), Get_Number(newHeader.Properties[__NEMESIS_PROPERTY_WIDTH], 0), Get_Number(newHeader.Properties[__NEMESIS_PROPERTY_HEIGHT], 0));\n\t\t//return newHeader\n\t\treturn newHeader;\n\t}", "function HeaderRender(parent, serviceLocator) {\n var _this = this;\n this.frzIdx = 0;\n this.notfrzIdx = 0;\n this.helper = function (e) {\n var gObj = _this.parent;\n var target = e.sender.target;\n var parentEle = parentsUntil(target, 'e-headercell');\n if (!(gObj.allowReordering || gObj.allowGrouping) || (!isNullOrUndefined(parentEle)\n && parentEle.querySelectorAll('.e-checkselectall').length > 0)) {\n return false;\n }\n var visualElement = _this.parent.createElement('div', { className: 'e-cloneproperties e-dragclone e-headerclone' });\n var element = target.classList.contains('e-headercell') ? target : parentEle;\n if (!element || (!gObj.allowReordering && element.classList.contains('e-stackedheadercell'))) {\n return false;\n }\n var height = element.offsetHeight;\n var headercelldiv = element.querySelector('.e-headercelldiv') || element.querySelector('.e-stackedheadercelldiv');\n var col;\n if (headercelldiv) {\n if (element.querySelector('.e-stackedheadercelldiv')) {\n col = gObj.getStackedHeaderColumnByHeaderText(headercelldiv.innerText.trim(), gObj.columns);\n }\n else {\n col = gObj.getColumnByUid(headercelldiv.getAttribute('e-mappinguid'));\n }\n _this.column = col;\n if (_this.column.lockColumn) {\n return false;\n }\n visualElement.setAttribute('e-mappinguid', _this.column.uid);\n }\n if (col && !isNullOrUndefined(col.headerTemplate)) {\n if (!isNullOrUndefined(col.headerTemplate)) {\n var result = void 0;\n var colIndex = gObj.getColumnIndexByField(col.field);\n result = col.getHeaderTemplate()(extend({ 'index': colIndex }, col), gObj, 'headerTemplate');\n appendChildren(visualElement, result);\n }\n else {\n visualElement.innerHTML = col.headerTemplate;\n }\n }\n else {\n visualElement.innerHTML = headercelldiv ?\n col.headerText : element.firstElementChild.innerHTML;\n }\n visualElement.style.width = element.offsetWidth + 'px';\n visualElement.style.height = element.offsetHeight + 'px';\n visualElement.style.lineHeight = (height - 6).toString() + 'px';\n gObj.element.appendChild(visualElement);\n return visualElement;\n };\n this.dragStart = function (e) {\n var gObj = _this.parent;\n gObj.element.querySelector('.e-gridpopup').style.display = 'none';\n gObj.notify(columnDragStart, { target: e.target, column: _this.column, event: e.event });\n if (isBlazor()) {\n e.bindEvents(e.dragElement);\n }\n };\n this.drag = function (e) {\n var gObj = _this.parent;\n var target = e.target;\n if (target) {\n var closest$$1 = closest(target, '.e-grid');\n var cloneElement = _this.parent.element.querySelector('.e-cloneproperties');\n if (!closest$$1 || closest$$1.getAttribute('id') !== gObj.element.getAttribute('id')) {\n classList(cloneElement, ['e-notallowedcur'], ['e-defaultcur']);\n if (gObj.allowReordering) {\n gObj.element.querySelector('.e-reorderuparrow').style.display = 'none';\n gObj.element.querySelector('.e-reorderdownarrow').style.display = 'none';\n }\n return;\n }\n gObj.notify(columnDrag, { target: e.target, column: _this.column, event: e.event });\n }\n };\n this.dragStop = function (e) {\n var gObj = _this.parent;\n var cancel;\n gObj.element.querySelector('.e-gridpopup').style.display = 'none';\n if ((!parentsUntil(e.target, 'e-headercell') && !parentsUntil(e.target, 'e-groupdroparea')) ||\n (!gObj.allowReordering && parentsUntil(e.target, 'e-headercell')) ||\n (!e.helper.getAttribute('e-mappinguid') && parentsUntil(e.target, 'e-groupdroparea'))) {\n remove(e.helper);\n cancel = true;\n }\n gObj.notify(columnDragStop, { target: e.target, event: e.event, column: _this.column, cancel: cancel });\n };\n this.drop = function (e) {\n var gObj = _this.parent;\n var uid = e.droppedElement.getAttribute('e-mappinguid');\n var closest$$1 = closest(e.target, '.e-grid');\n remove(e.droppedElement);\n if (closest$$1 && closest$$1.getAttribute('id') !== gObj.element.getAttribute('id') ||\n !(gObj.allowReordering || gObj.allowGrouping)) {\n return;\n }\n gObj.notify(headerDrop, { target: e.target, uid: uid });\n };\n this.parent = parent;\n this.serviceLocator = serviceLocator;\n this.ariaService = this.serviceLocator.getService('ariaService');\n this.widthService = this.serviceLocator.getService('widthService');\n if (this.parent.isDestroyed) {\n return;\n }\n if (!this.parent.enableColumnVirtualization) {\n this.parent.on(columnVisibilityChanged, this.setVisible, this);\n }\n this.parent.on(columnPositionChanged, this.colPosRefresh, this);\n }", "initHeader() {\n const me = this,\n config = Object.assign(\n {\n subGrid: me,\n columns: me.columns,\n hidden: me.hideHeaders,\n parent: me // Contained widgets need to know their parents\n },\n me.headerConfig\n );\n\n me.header = new me.headerClass(config);\n }", "initHeader() {\n const me = this,\n sgStyle = me.element.style,\n sgWidth = sgStyle.width,\n sgFlex = sgStyle.flex,\n config = Object.assign({\n subGrid: me,\n hidden: me.hideHeaders,\n parent: me // Contained widgets need to know their parents\n\n }, me.headerConfig); // If we have been configured with sizing, construct the Bar in sync.\n\n if (sgFlex) {\n config.flex = sgFlex;\n } else if (sgWidth) {\n config.width = sgWidth;\n }\n\n me.header = new me.headerClass(config);\n }", "function ListView_UpdateHeader(theObject)\n{\n\t//has headers?\n\tif (theObject.Content && theObject.Content.Header_Panel)\n\t{\n\t\t//remove header panel from parent\n\t\ttheObject.Content.Header_Panel.parentNode.removeChild(theObject.Content.Header_Panel);\n\t}\n\t//delete all headers\n\ttheObject.Content.Headers = [];\n\ttheObject.Content.Header_Height = 0;\n\ttheObject.Content.Header_Width = 0;\n\ttheObject.Content.Header_Panel = null;\n\t//want headers?\n\tvar strHeader = null;\n\t//check the style\n\tswitch (theObject.Content.ListView_Style)\n\t{\n\t\tcase __LISTVIEW_STYLE_ICON:\n\t\tcase __LISTVIEW_STYLE_SMALLICON:\n\t\tcase __LISTVIEW_STYLE_LIST:\n\t\t\t//no headers for these\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//we want to show headers?\n\t\t\tstrHeader = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_COLUMN_HEADER], false) ? theObject.Properties[__NEMESIS_PROPERTY_HEADER] : null;\n\t\t\tbreak;\n\t}\n\t//want headers?\n\tif (!String_IsNullOrWhiteSpace(strHeader))\n\t{\n\t\t//create the header panel\n\t\ttheObject.Content.Header_Panel = theObject.HTML.appendChild(document.createElement(\"div\"));\n\t\ttheObject.Content.Header_Panel.id = \"HeaderPanel\";\n\t\ttheObject.Content.Header_Panel.style.cssText = \"position:absolute;left:0px;top:0px;background-color:transparent;overflow:hidden;width:100%;\";\n\t\t//this will always require a spacer panel\n\t\ttheObject.Content.Header_Panel.Spacer = theObject.Content.Header_Panel.appendChild(document.createElement(\"div\"));\n\t\ttheObject.Content.Header_Panel.Spacer.id = \"HeaderPanel_Spacer\";\n\t\ttheObject.Content.Header_Panel.Spacer.style.cssText = \"position:absolute;left:0px;top:0px;background-color:transparent;height:1px;width:1px;\";\n\t\t//helpers\n\t\tvar i, c;\n\t\t//split the headers\n\t\tvar aHeaders = strHeader.split(__LISTVIEW_SEPARATOR);\n\t\t//get widths\n\t\tvar aWidth = String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_COLUMNS_WIDTH]) ? [] : theObject.Properties[__NEMESIS_PROPERTY_COLUMNS_WIDTH].split(__LISTVIEW_SEPARATOR);\n\t\t//start position\n\t\tvar nLeft = 0;\n\t\t//fixed properties\n\t\tvar strFont = theObject.Properties[__NEMESIS_PROPERTY_FONT];\n\t\tvar headerBG = Get_Color(theObject.Properties[__NEMESIS_PROPERTY_HEADER_BACKGROUNDCOLOR], \"#F0F0F0\");\n\t\tvar headerFG = Get_Color(theObject.Properties[__NEMESIS_PROPERTY_HEADER_TEXTCOLOR], \"#000000\");\n\t\t//modifiers\n\t\tvar bFlat = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_FLAT], false);\n\t\t//modifier for the borders size\n\t\tvar modifier = bFlat ? -2 : -4;\n\t\tvar nPropertyHeaderHeight = Get_Number(theObject.Properties[__NEMESIS_PROPERTY_HEADER_HEIGHT], null);\n\t\t//valid?\n\t\tif (nPropertyHeaderHeight)\n\t\t{\n\t\t\t//use it\n\t\t\ttheObject.Content.Header_Height = nPropertyHeaderHeight;\n\t\t}\n\t\t//loop through them all\n\t\tfor (i = 0, c = aHeaders.length; i < c; i++)\n\t\t{\n\t\t\t//create the header item\n\t\t\tvar newHeader = theObject.Content.Header_Panel.appendChild(document.createElement(\"div\"));\n\t\t\t//set its styles\n\t\t\tnewHeader.style.cssText = \"position:absolute;top:0px;text-align:left;word-wrap:normal;white-space:nowrap;\";\n\t\t\tnewHeader.style.left = nLeft + \"px\";\n\t\t\tnewHeader.style.backgroundColor = headerBG;\n\t\t\tnewHeader.style.color = headerFG;\n\t\t\t//make it unselectable\n\t\t\tBrowser_SetSelectable(newHeader, false);\n\t\t\t//set its font\n\t\t\tBasic_SetFonts(newHeader, strFont);\n\t\t\t//Flat?\n\t\t\tif (bFlat)\n\t\t\t{\n\t\t\t\t//set a simple 1 pixel border\n\t\t\t\tnewHeader.style.border = \"1px solid #000000\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set a 2 px raised border\n\t\t\t\tnewHeader.style.border = \"2px outset #FFFFFF\";\n\t\t\t}\n\t\t\t//set text\n\t\t\tnewHeader.innerHTML = aHeaders[i].ToPlainText(theObject.DataObject.Id); // SAFE BY ENCODING\n\t\t\t//get its forced width\n\t\t\tvar forcedWidth = Get_Number(aWidth[i], null);\n\t\t\t//has width?\n\t\t\tif (forcedWidth != null)\n\t\t\t{\n\t\t\t\t//was forcing to 0?\n\t\t\t\tif (forcedWidth == 0)\n\t\t\t\t{\n\t\t\t\t\t//we want to hide this\n\t\t\t\t\tnewHeader.style.display = \"none\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//set its width\n\t\t\t\t\tnewHeader.style.width = forcedWidth + modifier + \"px\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//increment left\n\t\t\tnLeft += Browser_GetOffsetWidth(newHeader);\n\t\t\t//no forced header height?\n\t\t\tif (!nPropertyHeaderHeight)\n\t\t\t{\n\t\t\t\t//update height\n\t\t\t\ttheObject.Content.Header_Height = Math.max(theObject.Content.Header_Height, Browser_GetOffsetHeight(newHeader));\n\t\t\t}\n\t\t\t//store it in the array\n\t\t\ttheObject.Content.Headers.push(newHeader);\n\t\t}\n\t\t//loop through them all again\n\t\tfor (i = 0, c = aHeaders.length; i < c; i++)\n\t\t{\n\t\t\t//get this header\n\t\t\tvar header = theObject.Content.Headers[i];\n\t\t\t//force heights\n\t\t\theader.style.height = theObject.Content.Header_Height + modifier + \"px\";\n\t\t\t//update lineheight to vertically center the text\n\t\t\theader.style.lineHeight = header.style.height;\n\t\t\t//create the resize object\n\t\t\tvar sizer = header.appendChild(document.createElement(\"div\"));\n\t\t\t//set its styles\n\t\t\tsizer.style.cssText = \"position:absolute;top:0px;height:100%;right:0px;width:2px;cursor:col-resize;background:url('\" + __NEMESIS_EMPTY_BG + \"');\";\n\t\t\t//set our sizer data\n\t\t\tsizer.Sizer =\n\t\t\t\t{\n\t\t\t\t\tInterpreterObject: theObject,\n\t\t\t\t\tUIDObject: theObject.DataObject.Id,\n\t\t\t\t\tColumnPosition: i,\n\t\t\t\t\tHeader: header\n\t\t\t\t};\n\t\t\t//add dragging to it\n\t\t\tBrowser_AddEvent(sizer, __BROWSER_EVENT_MOUSEDOWN, ListView_Sizer_BeginDrag);\n\t\t}\n\t\t//correct header height\n\t\ttheObject.Content.Header_Panel.style.height = theObject.Content.Header_Height + \"px\";\n\t\t//memorise its width\n\t\ttheObject.Content.Header_Width = nLeft;\n\t}\n}", "function getHeaderView() {\n logger.info('base getHeaderView called');\n\n $.pdp_header_controller = Alloy.createController('product/components/detailHeader');\n\n $.pdp_header_controller.init();\n\n return $.pdp_header_controller.getView();\n}", "function TreeGrid_UpdateContent_Headers(theObject)\n{\n\t//helpers\n\tvar i, c, iHeader, cHeaders, nTop, nHeight, headers, iIndex;\n\t//retrieve treegrid modifier\n\tvar modifier = 0;//Dont get a modifier for the header Get_Number(theObject.Properties[__NEMESIS_PROPERTY_VIMAGO_MODIFIER], 0);\n\t//initialise header properties\n\ttheObject.Content.Headers =\n\t{\n\t\tHeight: Math.max(0, Get_Number(theObject.Properties[__NEMESIS_PROPERTY_HEADER_HEIGHT], 0) + modifier),\n\t\tFloatingHeaderBottom: 0,\n\t\tWidth: 0,\n\t\tCells: [],\n\t\tScrollable: [],\n\t\tOrdered: []\n\t};\n\n\t//get static template string\n\tvar strHeader = theObject.Properties[__NEMESIS_PROPERTY_STATIC_TEMPLATE];\n\t//valid header?\n\tif (!String_IsNullOrWhiteSpace(strHeader))\n\t{\n\t\t//helpers\n\t\tvar properties;\n\t\t//split the headers\n\t\tvar aHeaders = strHeader.split(__TREEGRID_SEPARATOR);\n\t\t//get our special properties\n\t\tvar strFont = theObject.Properties[__NEMESIS_PROPERTY_FONT];\n\t\tvar strMultiLine = Get_String(theObject.Properties[__NEMESIS_PROPERTY_MULTILINE], \"No\");\n\t\tvar nLook = theObject.InterfaceLook;\n\t\tnHeight = theObject.Content.Headers.Height;\n\t\tnTop = 0;\n\t\tvar bHeaderSelectsColumn = false;\n\t\tvar bHeaderSelectsColumnColor = \"transparent\";\n\t\tvar headerCells = [];\n\t\t//decode the header selects column property\n\t\tvar strHeaderSelects = theObject.Properties[__NEMESIS_PROPERTY_HEADER_SELECTS_COLUMN];\n\t\t//valid?\n\t\tif (!String_IsNullOrWhiteSpace(strHeaderSelects))\n\t\t{\n\t\t\t//split it\n\t\t\tstrHeaderSelects = strHeaderSelects.split(\",\");\n\t\t\t//header selects column?\n\t\t\tbHeaderSelectsColumn = Get_Bool(strHeaderSelects[0], false);\n\t\t\t//get its colour too\n\t\t\tbHeaderSelectsColumnColor = Get_Color(strHeaderSelects[1], theObject.BGColours[__STATE_SELECTED]);\n\t\t}\n\t\t//loop through headers\n\t\tfor (iHeader = 0, cHeaders = aHeaders.length, iIndex = 0; iHeader < cHeaders; iHeader++)\n\t\t{\n\t\t\t//retrieve header properties\n\t\t\tproperties = aHeaders[iHeader].split(\",\");\n\t\t\t//get length\n\t\t\tvar cProperties = properties.length;\n\t\t\t//less than 4?\n\t\t\tif (cProperties < 4)\n\t\t\t{\n\t\t\t\t//skip it\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//more than 4?\n\t\t\tif (cProperties > 4)\n\t\t\t{\n\t\t\t\t//must have had a comma in the second value\n\t\t\t\tfor (var iProperty = 2, cMaxProperty = cProperties - 2; iProperty < cMaxProperty; iProperty++)\n\t\t\t\t{\n\t\t\t\t\t//concatenate them\n\t\t\t\t\tproperties[1] += \",\" + properties[iProperty];\n\t\t\t\t}\n\t\t\t\t//correct the last two\n\t\t\t\tproperties[2] = properties[cProperties - 2];\n\t\t\t\tproperties[3] = properties[cProperties - 1];\n\t\t\t}\n\t\t\t//create a data object\n\t\t\tvar dataObject = { Id: \"TreeGridHeader_\" + iIndex, Class: Get_Class(properties[0]), Properties: {} };\n\t\t\t//create a new interpreter object\n\t\t\tvar object = new IntObject_IntObject(dataObject, null);\n\t\t\t//set its values\n\t\t\tobject.TreeGridCell = true;\n\t\t\tobject.TreeGridHeader = true;\n\t\t\tobject.TreeGridObject = theObject;\n\t\t\tobject.Column = iIndex++;\n\t\t\tobject.Row = -1;\n\t\t\tobject.Parent = { HTMLParent: null, InterfaceLook: nLook, AppendChild: IntObject_AppendChild };\n\t\t\tobject.SelectionActionsOnly = bHeaderSelectsColumn;\n\t\t\tobject.Selected = false;\n\t\t\tobject.SelectionColor = bHeaderSelectsColumnColor;\n\t\t\tobject.InterfaceLook = nLook;\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_CAPTION] = properties[1];\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_LEFT] = properties[2];\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_TOP] = nTop;\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_WIDTH] = properties[3];\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_HEIGHT] = nHeight;\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_FONT] = strFont;\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_MULTILINE] = strMultiLine;\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_ENDELLIPSIS] = \"Yes\";\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_ALIGN] = \"Left\";\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_PADDING] = \"2,1,2,1\";\n\t\t\tobject.Properties[__NEMESIS_PROPERTY_ZORDER] = __ZINDEX_MODIFIER + 2;\n\t\t\t//store the object\n\t\t\theaderCells.push(object);\n\t\t}\n\t\t//Get the extra template\n\t\tvar strExtra = theObject.Properties[__NEMESIS_PROPERTY_EXTRA_STATIC_TEMPLATE];\n\t\t//valid?\n\t\tif (!String_IsNullOrWhiteSpace(strExtra))\n\t\t{\n\t\t\t//count number of items\n\t\t\tvar cItem = headerCells.length;\n\t\t\t//break it into properties sets\n\t\t\tvar aExtra = strExtra.split(__TREEGRID_SEPARATOR_EXTRA);\n\t\t\t//loop through them\n\t\t\tfor (var iExtra = 0, cExtras = aExtra.length; iExtra < cExtras; iExtra++)\n\t\t\t{\n\t\t\t\t//retrieve properties\n\t\t\t\tproperties = aExtra[iExtra].split(\".\");\n\t\t\t\t//less than 2 properties?\n\t\t\t\tif (properties.length < 2)\n\t\t\t\t{\n\t\t\t\t\t//ignore this one\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//more than 2 properties?\n\t\t\t\telse if (properties.length > 2)\n\t\t\t\t{\n\t\t\t\t\t//must have had a . in the value\n\t\t\t\t\tfor (i = 2, c = properties.length; i < c; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//compose the properties\n\t\t\t\t\t\tproperties[1] += \".\" + properties[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//separate position\n\t\t\t\tvar position = properties[0].split(\",\");\n\t\t\t\t//separate property\n\t\t\t\tvar propertyPair = properties[1].split(\"=\");\n\t\t\t\t//more than 2 values?\n\t\t\t\tif (propertyPair.length > 2)\n\t\t\t\t{\n\t\t\t\t\t//must have had a = in the value\n\t\t\t\t\tfor (i = 2, c = propertyPair.length; i < c; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//compose the properties\n\t\t\t\t\t\tpropertyPair[1] += \"=\" + propertyPair[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//get property ep\n\t\t\t\tvar eProp = Get_Number(propertyPair[0]);\n\t\t\t\t//check the property\n\t\t\t\tswitch (eProp)\n\t\t\t\t{\n\t\t\t\t\tcase __NEMESIS_PROPERTY_HEIGHT:\n\t\t\t\t\t\t//we have a modifier?\n\t\t\t\t\t\tif (modifier != 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//modify it by modifier\n\t\t\t\t\t\t\tpropertyPair[1] = \"\" + (Get_Number(propertyPair[1], 0) + modifier);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//now get column index\n\t\t\t\tvar nColumn = Get_Number(position.length == 2 ? position[1] : position[0]);\n\t\t\t\t//using all index?\n\t\t\t\tif (nColumn == -1)\n\t\t\t\t{\n\t\t\t\t\t//loop through all the items\n\t\t\t\t\tfor (var iItem = 0; iItem < cItem; iItem++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set this property\n\t\t\t\t\t\theaderCells[iItem].Properties[eProp] = propertyPair[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//valid index?\n\t\t\t\telse if (nColumn >= 0 && nColumn < cItem)\n\t\t\t\t{\n\t\t\t\t\t//set the new property\n\t\t\t\t\theaderCells[nColumn].Properties[eProp] = propertyPair[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t///\n\t\t//Post Process Headers\n\t\t///\n\t\t//we dont auto update the header height if we had a fixed one\n\t\tvar bUpdateHeaderHeight = theObject.Content.Headers.Height <= 0;\n\t\t//loop through all the items\n\t\tfor (iHeader = 0, c = headerCells.length; iHeader < c; iHeader++)\n\t\t{\n\t\t\t//get the header item\n\t\t\tvar headerCell = headerCells[iHeader];\n\t\t\t//add to the ordered array\n\t\t\ttheObject.Content.Headers.Ordered.push(headerCell);\n\t\t\t//get its top\n\t\t\tnTop = Get_Number(headerCell.Properties[__NEMESIS_PROPERTY_TOP], 0);\n\t\t\t//get its height\n\t\t\tnHeight = Get_Number(headerCell.Properties[__NEMESIS_PROPERTY_HEIGHT], 0);\n\t\t\t//this a scrollable?\n\t\t\tif (!Get_Bool(headerCell.Properties[__NEMESIS_PROPERTY_YSCROLL_FIXED], true))\n\t\t\t{\n\t\t\t\t//add it to the movable cells\n\t\t\t\ttheObject.Content.Headers.Scrollable.push(headerCell);\n\t\t\t\t//update floating headers max height\n\t\t\t\ttheObject.Content.Headers.FloatingHeaderBottom = Math.max(theObject.Content.Headers.FloatingHeaderBottom, nTop + nHeight);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//want to auto update the header height?\n\t\t\t\tif (bUpdateHeaderHeight)\n\t\t\t\t{\n\t\t\t\t\t//update header height\n\t\t\t\t\ttheObject.Content.Headers.Height = Math.max(theObject.Content.Headers.Height, nTop + nHeight);\n\t\t\t\t}\n\t\t\t\t//get its width\n\t\t\t\tvar nWidth = Get_Number(headerCell.Properties[__NEMESIS_PROPERTY_WIDTH], 0);\n\t\t\t\t//update header width\n\t\t\t\ttheObject.Content.Headers.Width += nWidth;\n\t\t\t\t//add it to the fixed cells\n\t\t\t\ttheObject.Content.Headers.Cells.push(headerCell);\n\t\t\t}\n\t\t}\n\t\t//header height adjustment for scrollables\n\t\tfor (headers = theObject.Content.Headers.Scrollable, i = 0, c = headers.length; i < c; i++)\n\t\t{\n\t\t\t//get its top as a number\n\t\t\tvar top = Get_Number(theObject.Content.Headers.Scrollable[i].Properties[__NEMESIS_PROPERTY_TOP], null);\n\t\t\t//real top?\n\t\t\tif (top != null)\n\t\t\t{\n\t\t\t\t//change its top\n\t\t\t\ttheObject.Content.Headers.Scrollable[i].Properties[__NEMESIS_PROPERTY_TOP] = top - theObject.Content.Headers.Height + 2;\n\t\t\t}\n\t\t}\n\t}\n}", "function createHeader() {\n var table = gAppState.checkId(\"dbmsTableID\", \"fsTableID\");\n\n var header = table.createTHead(); // creates empty tHead\n var row = header.insertRow(0); // inserts row into tHead\n\n var cell0 = row.insertCell(0); // inserts new cell at position 0 in the row\n var cell1 = row.insertCell(1); // inserts new cell at position 1 in the row\n var cell2 = row.insertCell(2); // inserts new cell at position 2 in the row\n\n cell0.innerHTML = \"<b>Subject</b>\"; // adds bold text\n cell1.innerHTML = \"<b>Predicate</b>\";\n cell2.innerHTML = \"<b>Object</b>\";\n}", "function xTableHeaderFixed(fixedContainerId, fixedTableClass, fakeBodyId, tableBorder, thBorder)\r\n{\r\n // Private Property\r\n var tables = [];\r\n // Private Event Listener\r\n function onEvent(e) // handles scroll and resize events\r\n {\r\n e = e || window.event;\r\n var r = e.type == 'resize' ? true : false;\r\n for (var i = 0; i < tables.length; ++i) {\r\n scroll(tables[i], r);\r\n }\r\n }\r\n // Private Methods\r\n function scroll(t, bResize)\r\n {\r\n if (!t) { return; }\r\n var fhc = xGetElementById(fixedContainerId); // for IE6\r\n var fh = xGetElementById(t.fixedHeaderId);\r\n var thead = t.tHead;\r\n var st, sl, thy = xPageY(thead);\r\n /*@cc_on\r\n @if (@_jscript_version == 5.6) // IE6\r\n st = xGetElementById(fakeBodyId).scrollTop;\r\n sl = xGetElementById(fakeBodyId).scrollLeft;\r\n @else @*/\r\n st = xScrollTop();\r\n sl = xScrollLeft();\r\n /*@end @*/\r\n var th = xHeight(t);\r\n var tw = xWidth(t);\r\n var ty = xPageY(t);\r\n var tx = xPageX(t);\r\n var fhh = xHeight(fh);\r\n if (bResize) {\r\n xWidth(fh, tw + 2*tableBorder);\r\n var th1 = xGetElementsByTagName('th', t);\r\n var th2 = xGetElementsByTagName('th', fh);\r\n for (var i = 0; i < th1.length; ++i) {\r\n xWidth(th2[i], xWidth(th1[i]) + thBorder);\r\n }\r\n }\r\n xLeft(fh, tx - sl);\r\n if (st <= thy || st > ty + th - fhh) {\r\n if (fh.style.visibility != 'hidden') {\r\n fh.style.visibility = 'hidden';\r\n fhc.style.visibility = 'hidden'; // for IE6\r\n }\r\n }\r\n else {\r\n if (fh.style.visibility != 'visible') {\r\n fh.style.visibility = 'visible';\r\n fhc.style.visibility = 'visible'; // for IE6\r\n }\r\n }\r\n }\r\n function init()\r\n {\r\n var i, tbl, h, t, con;\r\n if (null == (con = xGetElementById(fixedContainerId))) {\r\n con = document.createElement('div');\r\n con.id = fixedContainerId;\r\n document.body.appendChild(con);\r\n }\r\n for (i = 0; i < tables.length; ++i) {\r\n tbl = tables[i];\r\n h = tbl.tHead;\r\n if (h) {\r\n t = document.createElement('table');\r\n t.className = fixedTableClass;\r\n t.appendChild(h.cloneNode(true));\r\n t.id = tbl.fixedHeaderId = 'xtfh' + i;\r\n con.appendChild(t);\r\n }\r\n else {\r\n tables[i] = null; // ignore tables with no thead\r\n }\r\n }\r\n con.style.visibility = 'hidden'; // for IE6\r\n }\r\n // Public Method\r\n this.unload = function()\r\n {\r\n for (var i = 0; i < tables.length; ++i) {\r\n tables[i] = null;\r\n }\r\n };\r\n // Constructor Code\r\n var i, lst;\r\n if (arguments.length > 5) { // we've been passed a list of IDs and/or Element objects\r\n i = 5;\r\n lst = arguments;\r\n }\r\n else { // make a list of all tables\r\n i = 0;\r\n lst = xGetElementsByTagName('table');\r\n }\r\n for (; i < lst.length; ++i) {\r\n tables[i] = xGetElementById(lst[i]);\r\n }\r\n init();\r\n onEvent({type:'resize'});\r\n /*@cc_on\r\n @if (@_jscript_version == 5.6) // IE6\r\n xAddEventListener(fakeBodyId, 'scroll', onEvent, false);\r\n @else @*/\r\n xAddEventListener(window, 'scroll', onEvent, false);\r\n /*@end @*/\r\n xAddEventListener(window, 'resize', onEvent, false);\r\n} // end xTableHeaderFixed", "function renderFixedHeaders(type, viewRange, w, h, tx, ty) {\n const {draw, data} = this;\n const sumHeight = viewRange.h; // rows.sumHeight(viewRange.sri, viewRange.eri + 1);\n const sumWidth = viewRange.w; // cols.sumWidth(viewRange.sci, viewRange.eci + 1);\n const nty = ty + h;\n const ntx = tx + w;\n\n draw.save();\n // draw rect background\n draw.attr(tableFixedHeaderCleanStyle);\n if (type === 'all' || type === 'left') draw.fillRect(0, nty, w, sumHeight);\n if (type === 'all' || type === 'top') draw.fillRect(ntx, 0, sumWidth, h);\n\n const {\n sri, sci, eri, eci,\n } = data.selector.range;\n // console.log(data.selectIndexes);\n // draw text\n // text font, align...\n draw.attr(tableFixedHeaderStyle());\n // y-header-text\n if (type === 'all' || type === 'left') {\n data.rowEach(viewRange.sri, viewRange.eri, (i, y1, rowHeight) => {\n const y = nty + y1;\n const ii = i;\n draw.line([0, y], [w, y]);\n if (sri <= ii && ii < eri + 1) {\n renderSelectedHeaderCell.call(this, 0, y, w, rowHeight);\n }\n draw.fillText(ii + 1, w / 2, y + (rowHeight / 2));\n });\n draw.line([0, sumHeight + nty], [w, sumHeight + nty]);\n draw.line([w, nty], [w, sumHeight + nty]);\n }\n // x-header-text\n if (type === 'all' || type === 'top') {\n data.colEach(viewRange.sci, viewRange.eci, (i, x1, colWidth) => {\n const x = ntx + x1;\n const ii = i;\n draw.line([x, 0], [x, h]);\n if (sci <= ii && ii < eci + 1) {\n renderSelectedHeaderCell.call(this, x, 0, colWidth, h);\n }\n draw.fillText(stringAt(ii), x + (colWidth / 2), h / 2);\n });\n draw.line([sumWidth + ntx, 0], [sumWidth + ntx, h]);\n draw.line([0, h], [sumWidth + ntx, h]);\n }\n draw.restore();\n}", "function makeHeader(obj, i, id)\n {\n var type = obj.columns[i]; // formerly a parameter received from makeTable\n var data = obj.headers[i]; // formerly a parameter received from makeTable\n if (obj.filter_keys)\n var key = obj.filter_keys[i];\n else\n key = '';\n\n if (type.toLowerCase() === 'flex')\n var cellData = fw.templates.tableAddButton({id:id});\n else\n cellData = data || '';\n\n if (obj.filter_options && obj.filter_options[i] && obj.filter_options[i].length > 0)\n var filter = $.dropdown(obj.filter_options[i]);\n else\n filter = '';\n\n return fw.templates.tableColHeader({ key: key, data: cellData + filter, id:id+'-h'+i });\n }", "renderHeader () {\n this.header = this.renderSubview(\n new ListHeader({ title: this.title }),\n this.queryByHook('header-container')\n )\n return this.header\n }", "function finishHeader(header) {\n header.xspace.name = \"xspace\";\n header.yspace.name = \"yspace\";\n header.zspace.name = \"zspace\";\n\n header.xspace.width_space = header.yspace;\n header.xspace.width = header.yspace.space_length;\n header.xspace.height_space = header.zspace;\n header.xspace.height = header.zspace.space_length;\n\n header.yspace.width_space = header.xspace;\n header.yspace.width = header.xspace.space_length;\n header.yspace.height_space = header.zspace;\n header.yspace.height = header.zspace.space_length;\n\n header.zspace.width_space = header.xspace;\n header.zspace.width = header.xspace.space_length;\n header.zspace.height_space = header.yspace;\n header.zspace.height = header.yspace.space_length;\n\n if (header.voxel_min === undefined)\n header.voxel_min = 0;\n if (header.voxel_max === undefined)\n header.voxel_max = 255;\n }", "function headerGraphic() {\n clear();\n\n var table = new Table;({\n chars: { 'top': '═' , 'top-mid': '╤' , 'top-left': '╔' , 'top-right': '╗'\n , 'bottom': '═' , 'bottom-mid': '╧' , 'bottom-left': '╚' , 'bottom-right': '╝'\n , 'left': '║' , 'left-mid': '║' , 'mid': ' ' , 'mid-mid': ''\n , 'right': '║' , 'right-mid': '║' , 'middle': '' }\n });\n\n let firstWord = colors.brightMagenta.bold(\n figlet.textSync('Employee', { horizontalLayout: 'fitted' , font: 'Standard' })\n );\n\n let secondWord = colors.brightMagenta.bold(\n figlet.textSync('Tracker', { horizontalLayout: 'fitted' , font: 'Standard' })\n );\n\n table.push(\n [firstWord]\n , [secondWord]\n );\n \n let finalTable = table.toString();\n \n console.log(finalTable);\n \n}", "function Header(calendar) {\n\tvar t = this;\n\t\n\t// exports\n\tt.render = render;\n\tt.removeElement = removeElement;\n\tt.updateTitle = updateTitle;\n\tt.activateButton = activateButton;\n\tt.deactivateButton = deactivateButton;\n\tt.disableButton = disableButton;\n\tt.enableButton = enableButton;\n\tt.getViewsWithButtons = getViewsWithButtons;\n\tt.el = null; // mirrors local `el`\n\t\n\t// locals\n\tvar el;\n\tvar viewsWithButtons = [];\n\tvar tm;\n\n\n\t// can be called repeatedly and will rerender\n\tfunction render() {\n\t\tvar options = calendar.options;\n\t\tvar sections = options.header;\n\n\t\ttm = options.theme ? 'ui' : 'fc';\n\n\t\tif (sections) {\n\t\t\tif (!el) {\n\t\t\t\tel = this.el = $(\"<div class='fc-toolbar'/>\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tel.empty();\n\t\t\t}\n\t\t\tel.append(renderSection('left'))\n\t\t\t\t.append(renderSection('right'))\n\t\t\t\t.append(renderSection('center'))\n\t\t\t\t.append('<div class=\"fc-clear\"/>');\n\t\t}\n\t\telse {\n\t\t\tremoveElement();\n\t\t}\n\t}\n\t\n\t\n\tfunction removeElement() {\n\t\tif (el) {\n\t\t\tel.remove();\n\t\t\tel = t.el = null;\n\t\t}\n\t}\n\t\n\t\n\tfunction renderSection(position) {\n\t\tvar sectionEl = $('<div class=\"fc-' + position + '\"/>');\n\t\tvar options = calendar.options;\n\t\tvar buttonStr = options.header[position];\n\n\t\tif (buttonStr) {\n\t\t\t$.each(buttonStr.split(' '), function(i) {\n\t\t\t\tvar groupChildren = $();\n\t\t\t\tvar isOnlyButtons = true;\n\t\t\t\tvar groupEl;\n\n\t\t\t\t$.each(this.split(','), function(j, buttonName) {\n\t\t\t\t\tvar customButtonProps;\n\t\t\t\t\tvar viewSpec;\n\t\t\t\t\tvar buttonClick;\n\t\t\t\t\tvar overrideText; // text explicitly set by calendar's constructor options. overcomes icons\n\t\t\t\t\tvar defaultText;\n\t\t\t\t\tvar themeIcon;\n\t\t\t\t\tvar normalIcon;\n\t\t\t\t\tvar innerHtml;\n\t\t\t\t\tvar classes;\n\t\t\t\t\tvar button; // the element\n\n\t\t\t\t\tif (buttonName == 'title') {\n\t\t\t\t\t\tgroupChildren = groupChildren.add($('<h2>&nbsp;</h2>')); // we always want it to take up height\n\t\t\t\t\t\tisOnlyButtons = false;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ((customButtonProps = (options.customButtons || {})[buttonName])) {\n\t\t\t\t\t\t\tbuttonClick = function(ev) {\n\t\t\t\t\t\t\t\tif (customButtonProps.click) {\n\t\t\t\t\t\t\t\t\tcustomButtonProps.click.call(button[0], ev);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\toverrideText = ''; // icons will override text\n\t\t\t\t\t\t\tdefaultText = customButtonProps.text;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ((viewSpec = calendar.getViewSpec(buttonName))) {\n\t\t\t\t\t\t\tbuttonClick = function() {\n\t\t\t\t\t\t\t\tcalendar.changeView(buttonName);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tviewsWithButtons.push(buttonName);\n\t\t\t\t\t\t\toverrideText = viewSpec.buttonTextOverride;\n\t\t\t\t\t\t\tdefaultText = viewSpec.buttonTextDefault;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (calendar[buttonName]) { // a calendar method\n\t\t\t\t\t\t\tbuttonClick = function() {\n\t\t\t\t\t\t\t\tcalendar[buttonName]();\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\toverrideText = (calendar.overrides.buttonText || {})[buttonName];\n\t\t\t\t\t\t\tdefaultText = options.buttonText[buttonName]; // everything else is considered default\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (buttonClick) {\n\n\t\t\t\t\t\t\tthemeIcon =\n\t\t\t\t\t\t\t\tcustomButtonProps ?\n\t\t\t\t\t\t\t\t\tcustomButtonProps.themeIcon :\n\t\t\t\t\t\t\t\t\toptions.themeButtonIcons[buttonName];\n\n\t\t\t\t\t\t\tnormalIcon =\n\t\t\t\t\t\t\t\tcustomButtonProps ?\n\t\t\t\t\t\t\t\t\tcustomButtonProps.icon :\n\t\t\t\t\t\t\t\t\toptions.buttonIcons[buttonName];\n\n\t\t\t\t\t\t\tif (overrideText) {\n\t\t\t\t\t\t\t\tinnerHtml = htmlEscape(overrideText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (themeIcon && options.theme) {\n\t\t\t\t\t\t\t\tinnerHtml = \"<span class='ui-icon ui-icon-\" + themeIcon + \"'></span>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (normalIcon && !options.theme) {\n\t\t\t\t\t\t\t\tinnerHtml = \"<span class='fc-icon fc-icon-\" + normalIcon + \"'></span>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tinnerHtml = htmlEscape(defaultText);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tclasses = [\n\t\t\t\t\t\t\t\t'fc-' + buttonName + '-button',\n\t\t\t\t\t\t\t\ttm + '-button',\n\t\t\t\t\t\t\t\ttm + '-state-default'\n\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tbutton = $( // type=\"button\" so that it doesn't submit a form\n\t\t\t\t\t\t\t\t'<button type=\"button\" class=\"' + classes.join(' ') + '\">' +\n\t\t\t\t\t\t\t\t\tinnerHtml +\n\t\t\t\t\t\t\t\t'</button>'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.click(function(ev) {\n\t\t\t\t\t\t\t\t\t// don't process clicks for disabled buttons\n\t\t\t\t\t\t\t\t\tif (!button.hasClass(tm + '-state-disabled')) {\n\n\t\t\t\t\t\t\t\t\t\tbuttonClick(ev);\n\n\t\t\t\t\t\t\t\t\t\t// after the click action, if the button becomes the \"active\" tab, or disabled,\n\t\t\t\t\t\t\t\t\t\t// it should never have a hover class, so remove it now.\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tbutton.hasClass(tm + '-state-active') ||\n\t\t\t\t\t\t\t\t\t\t\tbutton.hasClass(tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tbutton.removeClass(tm + '-state-hover');\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\t.mousedown(function() {\n\t\t\t\t\t\t\t\t\t// the *down* effect (mouse pressed in).\n\t\t\t\t\t\t\t\t\t// only on buttons that are not the \"active\" tab, or disabled\n\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-active')\n\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t.addClass(tm + '-state-down');\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.mouseup(function() {\n\t\t\t\t\t\t\t\t\t// undo the *down* effect\n\t\t\t\t\t\t\t\t\tbutton.removeClass(tm + '-state-down');\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.hover(\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t// the *hover* effect.\n\t\t\t\t\t\t\t\t\t\t// only on buttons that are not the \"active\" tab, or disabled\n\t\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-active')\n\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t\t.addClass(tm + '-state-hover');\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t// undo the *hover* effect\n\t\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t\t.removeClass(tm + '-state-hover')\n\t\t\t\t\t\t\t\t\t\t\t.removeClass(tm + '-state-down'); // if mouseleave happens before mouseup\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tgroupChildren = groupChildren.add(button);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (isOnlyButtons) {\n\t\t\t\t\tgroupChildren\n\t\t\t\t\t\t.first().addClass(tm + '-corner-left').end()\n\t\t\t\t\t\t.last().addClass(tm + '-corner-right').end();\n\t\t\t\t}\n\n\t\t\t\tif (groupChildren.length > 1) {\n\t\t\t\t\tgroupEl = $('<div/>');\n\t\t\t\t\tif (isOnlyButtons) {\n\t\t\t\t\t\tgroupEl.addClass('fc-button-group');\n\t\t\t\t\t}\n\t\t\t\t\tgroupEl.append(groupChildren);\n\t\t\t\t\tsectionEl.append(groupEl);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsectionEl.append(groupChildren); // 1 or 0 children\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn sectionEl;\n\t}\n\t\n\t\n\tfunction updateTitle(text) {\n\t\tif (el) {\n\t\t\tel.find('h2').text(text);\n\t\t}\n\t}\n\t\n\t\n\tfunction activateButton(buttonName) {\n\t\tif (el) {\n\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t.addClass(tm + '-state-active');\n\t\t}\n\t}\n\t\n\t\n\tfunction deactivateButton(buttonName) {\n\t\tif (el) {\n\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t.removeClass(tm + '-state-active');\n\t\t}\n\t}\n\t\n\t\n\tfunction disableButton(buttonName) {\n\t\tif (el) {\n\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t.prop('disabled', true)\n\t\t\t\t.addClass(tm + '-state-disabled');\n\t\t}\n\t}\n\t\n\t\n\tfunction enableButton(buttonName) {\n\t\tif (el) {\n\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t.prop('disabled', false)\n\t\t\t\t.removeClass(tm + '-state-disabled');\n\t\t}\n\t}\n\n\n\tfunction getViewsWithButtons() {\n\t\treturn viewsWithButtons;\n\t}\n\n}", "get headerField() {\n\t\treturn this.__headerField;\n\t}", "__$$getHeaderColumns() {\n\t\tconst thead = _.chain(arrify(this.props.children))\n\t\t\t.filter(c => c.type == 'thead')\n\t\t\t.last()\n\t\t\t.value() || <thead></thead>\n\n\t\tconst theadRow = _.chain(arrify(thead.props.children))\n\t\t\t.filter(c => c.type == 'tr')\n\t\t\t.last()\n\t\t\t.value() || <tr></tr>\n\n\t\tconst headerColumns = _.chain(arrify(theadRow.props.children))\n\t\t\t.filter(c => c.type == 'th' || c.type == 'td')\n\t\t\t.value()\n\t\t\t.slice() // copy\n\n\t\theaderColumns.splice(0, 0, <th key=\"selectable-table-checkbox\" style={{ textAlign: 'left' }}>\n\t\t\t<input ref=\"headerCheckbox\" type=\"checkbox\" checked={_.some(this.state.selected)} onClick={this.__$$onSelectAll.bind(this)} />\n\t\t</th>)\n\t\treturn headerColumns\n\t}", "function Header(calendar) {\n\t\tvar t = this;\n\t\t\n\t\t// exports\n\t\tt.render = render;\n\t\tt.removeElement = removeElement;\n\t\tt.updateTitle = updateTitle;\n\t\tt.activateButton = activateButton;\n\t\tt.deactivateButton = deactivateButton;\n\t\tt.disableButton = disableButton;\n\t\tt.enableButton = enableButton;\n\t\tt.getViewsWithButtons = getViewsWithButtons;\n\t\tt.el = null; // mirrors local `el`\n\t\t\n\t\t// locals\n\t\tvar el;\n\t\tvar viewsWithButtons = [];\n\t\tvar tm;\n\n\n\t\t// can be called repeatedly and will rerender\n\t\tfunction render() {\n\t\t\tvar options = calendar.options;\n\t\t\tvar sections = options.header;\n\n\t\t\ttm = options.theme ? 'ui' : 'fc';\n\n\t\t\tif (sections) {\n\t\t\t\tif (!el) {\n\t\t\t\t\tel = this.el = $(\"<div class='fc-toolbar'/>\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tel.empty();\n\t\t\t\t}\n\t\t\t\tel.append(renderSection('left'))\n\t\t\t\t\t.append(renderSection('right'))\n\t\t\t\t\t.append(renderSection('center'))\n\t\t\t\t\t.append('<div class=\"fc-clear\"/>');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tremoveElement();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction removeElement() {\n\t\t\tif (el) {\n\t\t\t\tel.remove();\n\t\t\t\tel = t.el = null;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction renderSection(position) {\n\t\t\tvar sectionEl = $('<div class=\"fc-' + position + '\"/>');\n\t\t\tvar options = calendar.options;\n\t\t\tvar buttonStr = options.header[position];\n\n\t\t\tif (buttonStr) {\n\t\t\t\t$.each(buttonStr.split(' '), function(i) {\n\t\t\t\t\tvar groupChildren = $();\n\t\t\t\t\tvar isOnlyButtons = true;\n\t\t\t\t\tvar groupEl;\n\n\t\t\t\t\t$.each(this.split(','), function(j, buttonName) {\n\t\t\t\t\t\tvar customButtonProps;\n\t\t\t\t\t\tvar viewSpec;\n\t\t\t\t\t\tvar buttonClick;\n\t\t\t\t\t\tvar overrideText; // text explicitly set by calendar's constructor options. overcomes icons\n\t\t\t\t\t\tvar defaultText;\n\t\t\t\t\t\tvar themeIcon;\n\t\t\t\t\t\tvar normalIcon;\n\t\t\t\t\t\tvar innerHtml;\n\t\t\t\t\t\tvar classes;\n\t\t\t\t\t\tvar button; // the element\n\n\t\t\t\t\t\tif (buttonName == 'title') {\n\t\t\t\t\t\t\tgroupChildren = groupChildren.add($('<h2>&nbsp;</h2>')); // we always want it to take up height\n\t\t\t\t\t\t\tisOnlyButtons = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif ((customButtonProps = (options.customButtons || {})[buttonName])) {\n\t\t\t\t\t\t\t\tbuttonClick = function(ev) {\n\t\t\t\t\t\t\t\t\tif (customButtonProps.click) {\n\t\t\t\t\t\t\t\t\t\tcustomButtonProps.click.call(button[0], ev);\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\toverrideText = ''; // icons will override text\n\t\t\t\t\t\t\t\tdefaultText = customButtonProps.text;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ((viewSpec = calendar.getViewSpec(buttonName))) {\n\t\t\t\t\t\t\t\tbuttonClick = function() {\n\t\t\t\t\t\t\t\t\tcalendar.changeView(buttonName);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tviewsWithButtons.push(buttonName);\n\t\t\t\t\t\t\t\toverrideText = viewSpec.buttonTextOverride;\n\t\t\t\t\t\t\t\tdefaultText = viewSpec.buttonTextDefault;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (calendar[buttonName]) { // a calendar method\n\t\t\t\t\t\t\t\tbuttonClick = function() {\n\t\t\t\t\t\t\t\t\tcalendar[buttonName]();\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\toverrideText = (calendar.overrides.buttonText || {})[buttonName];\n\t\t\t\t\t\t\t\tdefaultText = options.buttonText[buttonName]; // everything else is considered default\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (buttonClick) {\n\n\t\t\t\t\t\t\t\tthemeIcon =\n\t\t\t\t\t\t\t\t\tcustomButtonProps ?\n\t\t\t\t\t\t\t\t\t\tcustomButtonProps.themeIcon :\n\t\t\t\t\t\t\t\t\t\toptions.themeButtonIcons[buttonName];\n\n\t\t\t\t\t\t\t\tnormalIcon =\n\t\t\t\t\t\t\t\t\tcustomButtonProps ?\n\t\t\t\t\t\t\t\t\t\tcustomButtonProps.icon :\n\t\t\t\t\t\t\t\t\t\toptions.buttonIcons[buttonName];\n\n\t\t\t\t\t\t\t\tif (overrideText) {\n\t\t\t\t\t\t\t\t\tinnerHtml = htmlEscape(overrideText);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (themeIcon && options.theme) {\n\t\t\t\t\t\t\t\t\tinnerHtml = \"<span class='ui-icon ui-icon-\" + themeIcon + \"'></span>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (normalIcon && !options.theme) {\n\t\t\t\t\t\t\t\t\tinnerHtml = \"<span class='fc-icon fc-icon-\" + normalIcon + \"'></span>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tinnerHtml = htmlEscape(defaultText);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tclasses = [\n\t\t\t\t\t\t\t\t\t'fc-' + buttonName + '-button',\n\t\t\t\t\t\t\t\t\ttm + '-button',\n\t\t\t\t\t\t\t\t\ttm + '-state-default'\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t\tbutton = $( // type=\"button\" so that it doesn't submit a form\n\t\t\t\t\t\t\t\t\t'<button type=\"button\" class=\"' + classes.join(' ') + '\">' +\n\t\t\t\t\t\t\t\t\t\tinnerHtml +\n\t\t\t\t\t\t\t\t\t'</button>'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.click(function(ev) {\n\t\t\t\t\t\t\t\t\t\t// don't process clicks for disabled buttons\n\t\t\t\t\t\t\t\t\t\tif (!button.hasClass(tm + '-state-disabled')) {\n\n\t\t\t\t\t\t\t\t\t\t\tbuttonClick(ev);\n\n\t\t\t\t\t\t\t\t\t\t\t// after the click action, if the button becomes the \"active\" tab, or disabled,\n\t\t\t\t\t\t\t\t\t\t\t// it should never have a hover class, so remove it now.\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tbutton.hasClass(tm + '-state-active') ||\n\t\t\t\t\t\t\t\t\t\t\t\tbutton.hasClass(tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\tbutton.removeClass(tm + '-state-hover');\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})\n\t\t\t\t\t\t\t\t\t.mousedown(function() {\n\t\t\t\t\t\t\t\t\t\t// the *down* effect (mouse pressed in).\n\t\t\t\t\t\t\t\t\t\t// only on buttons that are not the \"active\" tab, or disabled\n\t\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-active')\n\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t\t.addClass(tm + '-state-down');\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.mouseup(function() {\n\t\t\t\t\t\t\t\t\t\t// undo the *down* effect\n\t\t\t\t\t\t\t\t\t\tbutton.removeClass(tm + '-state-down');\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.hover(\n\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\t// the *hover* effect.\n\t\t\t\t\t\t\t\t\t\t\t// only on buttons that are not the \"active\" tab, or disabled\n\t\t\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-active')\n\t\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t\t\t.addClass(tm + '-state-hover');\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\t// undo the *hover* effect\n\t\t\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t\t\t.removeClass(tm + '-state-hover')\n\t\t\t\t\t\t\t\t\t\t\t\t.removeClass(tm + '-state-down'); // if mouseleave happens before mouseup\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tgroupChildren = groupChildren.add(button);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tif (isOnlyButtons) {\n\t\t\t\t\t\tgroupChildren\n\t\t\t\t\t\t\t.first().addClass(tm + '-corner-left').end()\n\t\t\t\t\t\t\t.last().addClass(tm + '-corner-right').end();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (groupChildren.length > 1) {\n\t\t\t\t\t\tgroupEl = $('<div/>');\n\t\t\t\t\t\tif (isOnlyButtons) {\n\t\t\t\t\t\t\tgroupEl.addClass('fc-button-group');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgroupEl.append(groupChildren);\n\t\t\t\t\t\tsectionEl.append(groupEl);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsectionEl.append(groupChildren); // 1 or 0 children\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn sectionEl;\n\t\t}\n\t\t\n\t\t\n\t\tfunction updateTitle(text) {\n\t\t\tif (el) {\n\t\t\t\tel.find('h2').text(text);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction activateButton(buttonName) {\n\t\t\tif (el) {\n\t\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t\t.addClass(tm + '-state-active');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction deactivateButton(buttonName) {\n\t\t\tif (el) {\n\t\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t\t.removeClass(tm + '-state-active');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction disableButton(buttonName) {\n\t\t\tif (el) {\n\t\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t\t.prop('disabled', true)\n\t\t\t\t\t.addClass(tm + '-state-disabled');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction enableButton(buttonName) {\n\t\t\tif (el) {\n\t\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t\t.prop('disabled', false)\n\t\t\t\t\t.removeClass(tm + '-state-disabled');\n\t\t\t}\n\t\t}\n\n\n\t\tfunction getViewsWithButtons() {\n\t\t\treturn viewsWithButtons;\n\t\t}\n\n\t}", "function PaintHeaders(View)\n{\n\tif (!self.TABLE || !self.TABLE.document || !self.TABLE.document.getElementById(\"paneBody1\"))\n\t{\n\t\t\n\t\tsetTimeout(function() { PaintHeaders.apply(this, arguments); }, 5);\n\t\treturn;\n\t}\n\t\n\t__View = View;\n\n\tswitch (View)\n\t{\n\t\tcase \"Period\": functionCall = \"HeaderCalendar\"; date_fld_name = \"1\"; break;\n\t\tcase \"Daily\": functionCall = \"HeaderCalendar_Daily\"; date_fld_name = \"3\"; break;\n\t\tcase \"Exception\": functionCall = \"HeaderCalendar_Exception\"; date_fld_name = \"4\"; break;\n\t}\n\n\tvar html = '<div style=\"padding-bottom:10px\">'\n\thtml += '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"width:50px\" rowspan=\"2\">';\n\thtml += '&nbsp;';\n\thtml += '<td style=\"width:50px\" rowspan=\"2\">';\n\thtml += '&nbsp;';\n\thtml += '<td style=\"width:50px\" rowspan=\"2\">';\n\n\tif (View == \"Daily\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'CommentsClicked_Daily()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.CommentIconMouseOver(1,\\'\\');return true;\" ';\n\t\thtml += 'onmouseout=\"parent.CommentIconMouseOver(0,\\'\\');return true;\">';\n\t\thtml += '<img styler=\"documenticon\" src=\"'+NoCommentsIconImage.src+'\" border=\"0\" width=\"32\" height=\"32\" ';\n\t\thtml += 'default_icon=\"' + NoCommentsIcon + '\" active_icon=\"' + ExistingCommentsIcon + '\" ';\n\t\thtml += 'name=\"comment\" alt=\"'+getSeaPhrase(\"OPEN_COMMENTS\",\"TE\")+dteDay(TimeCard.StartDate)+\", \"+ FormatDte3(TimeCard.StartDate)+'\">';\n\t\thtml += '</a>';\n\t}\n\telse\n\t{\n\t\thtml += '&nbsp;';\n\t}\n\t\n\thtml += '<td style=\"width:100%;text-align:center\">';\n\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\thtml += '<span class=\"fieldlabelbold\">'+getSeaPhrase(\"EMPLOYEE\",\"TE\")+'&nbsp;</span>';\n\t\thtml += '<span class=\"fieldlabel\">'+Employee.EmployeeName+'</span>';\n\n\t\tif (parseInt(TimeCard.TimeCardType,10) == 2)\n\t\t{\n\t\t\thtml += '&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"plaintablecellbold\">'+getSeaPhrase(\"EXCEPTION\",\"TE\")+'</span>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\thtml += '&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"plaintablecellbold\">'+getSeaPhrase(\"NORMAL\",\"TE\")+'</span>';\n\t\t}\n\t}\n\telse\n\t{\n\t\thtml += '&nbsp;';\n\t}\n\t\n\thtml += '<td rowspan=\"2\" nowrap style=\"vertical-align:top\">';\n\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\t// If the ProcessFlow service was found, trigger the flow. Otherwise use the email CGI program.\n\t\tvar techVersion = (iosHandler && iosHandler.getIOSVersionNumber() >= \"9.0\") ? ProcessFlowObject.TECHNOLOGY_900 : ProcessFlowObject.TECHNOLOGY_803;\n\t\tvar httpRequest = (typeof(SSORequest) == \"function\") ? SSORequest : SEARequest;\n\t\tvar pfObj = new ProcessFlowObject(window, techVersion, httpRequest, \"EMSS\");\n\t\tpfObj.showErrors = false;\n\n\t\tif (typeof(pfServiceObj) == \"undefined\")\n\t\t{\n\t\t\tpfServiceObj = pfObj.lookUpService(\"EMSSTimeEntChg\");\n\t\t}\t\n\t\n\t\tif (pfServiceObj == null)\n\t\t{\n\t\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'EmployeeEmailClicked()\\');return false;\">';\n\t\t\thtml += getSeaPhrase(\"SEND_EMAIL\",\"ESS\");\n\t\t\thtml += '</a>&nbsp;&nbsp;'\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (var i=0; i<Reports.Detail.length && (parseInt(Reports.Detail[i].Employee, 10) != parseInt(Employee.EmployeeNbr,10)); i++);\n\n\t\t\tif (i < Reports.Detail.length)\t\t\n\t\t\t{\n\t\t\t\thtml += '<a href=\"mailto:' + Reports.Detail[i].Email + '\">';\n\t\t\t\thtml += getSeaPhrase(\"SEND_EMAIL\",\"ESS\");\n\t\t\t\thtml += '</a>&nbsp;&nbsp;'\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'OpenTimeOff_Period()\\');return false;\">';\n\thtml += getSeaPhrase(\"OPEN_LEAVE_BALANCE_WIN\",\"TE\")+'</a>';\n\thtml += '<td>&nbsp;</td></tr>';\n\thtml += '<tr><td align=\"center\">';\n\thtml += '<table style=\"width:410px\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';\n\thtml += '<tr><td style=\"vertical-align:middle;width:14px\"></td>';\n\thtml += '<td style=\"vertical-align:middle;width:25px\">';\n\n\tif (View == \"Period\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousPeriod()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse if (View == \"Exception\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousException()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousDay()\\');return false;\" '\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" '\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"'\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_DAY\",\"TE\")+'\" border=\"0\">'\n\t}\n\n\thtml += '</a></td><td style=\"vertical-align:middle;text-align:center\" nowrap>';\n\thtml += '<span class=\"plaintablecellbold\">'+dteDay(TimeCard.StartDate)+\", \"+FormatDte3(TimeCard.StartDate);\n\n\tif (View == \"Period\" || View == \"Exception\")\n\t{\n\t\thtml += ' - ' + dteDay(TimeCard.EndDate)+\", \"+FormatDte3(TimeCard.EndDate);\n\t}\n\t\n\thtml += '</span></td><td style=\"vertical-align:middle;width:25px\">'\n\n\tif (View == \"Period\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextPeriod()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse if (View == \"Exception\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextException()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextDay()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_DAY\",\"TE\")+'\" border=\"0\">';\n\t}\n\t\n\tvar CalendarStartDate = \"\";\n\tif (hs36 && hs36.CalendarDate != null)\n\t{\n\t\tCalendarStartDate = FormatDte4(hs36.CalendarDate);\n\t}\n\telse if (getDteDifference(ymdtoday, TimeCard.StartDate) <= 0 && getDteDifference(ymdtoday, TimeCard.EndDate) >= 0)\n\t{\t\n\t\tCalendarStartDate = fmttoday;\n\t}\n\telse\t\n\t{\t\n\t\tCalendarStartDate = FormatDte4(TimeCard.StartDate);\n\t}\n\t\n\thtml += '</a></td><td style=\"vertical-align:middle\" nowrap>&nbsp;';\n\thtml += '<input onchange=\"parent.ReturnDate(this.value)\" styler=\"calendar\" class=\"inputbox\" onkeydown=\"this.value=this.getAttribute(\\'start_date\\')\" onkeyup=\"this.value=this.getAttribute(\\'start_date\\')\" type=\"text\" name=\"navDate\" size=\"10\" maxlength=\"10\" start_date=\"' + CalendarStartDate + '\" value=\"' + CalendarStartDate + '\"/>';\n\thtml += '<a styler=\"hidden\" href=\"\" onclick=\"parent.CheckAuthen(\\''+functionCall+'()\\');return false\">' + uiCalendarIcon() + '</a>';\n\n\thtml += '</td><td style=\"width:14px\">&nbsp;';\n\thtml += '</td></tr></table>';\n\thtml += '<td>&nbsp;<td>&nbsp;';\n\thtml += '<tr><td>&nbsp';\n\thtml += '<td>&nbsp;';\n\thtml += '<td>&nbsp;';\n\thtml += '<td style=\"text-align:center\">';\n\thtml += '<span class=\"fieldlabelbold\">';\n\t\n\tswitch (TimeCard.View)\n\t{\n\t\tcase 1: html += getSeaPhrase(\"INVALID_PERIOD\",\"TE\"); break;\n\t\tcase 2: html += getSeaPhrase(\"TE_LOCKED\",\"TE\"); break;\n\t\tcase 3: html += getSeaPhrase(\"OLD_PERIOD\",\"TE\"); break;\n\t\tdefault:\n\t\t{\n\t\t\tif (TimeCard.ManagerFlag)\n\t\t\t{\n\t\t\t\tswitch(TimeCard.Status)\n\t\t\t\t{\n\t\t\t\t\tcase -1: html += getSeaPhrase(\"CARD_NOT_ENTERED\",\"TE\"); break;\n\t\t\t\t\tcase 0: html += getSeaPhrase(\"CARD_ENTERED_NOT_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 1: html += getSeaPhrase(\"CARD_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 2: html += getSeaPhrase(\"CARD_APPROVED\",\"TE\"); break;\n\t\t\t\t\tcase 3: html += getSeaPhrase(\"CARD_ON_HOLD\",\"TE\"); break;\n\t\t\t\t\tcase 4: html += getSeaPhrase(\"CARD_REJECTED\",\"TE\"); break;\n\t\t\t\t\tcase 5:\n\t\t\t\t\tcase 6:\n\t\t\t\t\tcase 7:\n\t\t\t\t\tcase 8:\n\t\t\t\t\tcase 9: html += getSeaPhrase(\"OLD_PERIOD\",\"TE\"); break;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch (parseInt(TimeCard.Status, 10))\n\t\t\t\t{\n\t\t\t\t\tcase 1: html += getSeaPhrase(\"CARD_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 2: html += getSeaPhrase(\"CARD_APPROVED_NO_MORE\",\"TE\"); break;\n\t\t\t\t\tcase 3: html += getSeaPhrase(\"CARD_ON_HOLD_NO_MORE\",\"TE\"); break;\n\t\t\t\t\tcase 4: html += getSeaPhrase(\"CARD_RETURNED_NEED_CHANGE\",\"TE\"); break;\n\t\t\t\t\tdefault:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (View == \"Period\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_TIME_CLICK_MULTIENTRIES\",\"TE\")+'<img styler=\"multipleentrydetailicon\" width=15 height=15 alt=\"'+getSeaPhrase(\"SPLIT_NOTIFY\",\"TE\")+'\" src='+SplitIcon+'>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (View == \"Exception\")\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_EXCEPTION_TIME\",\"TE\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_TIME\",\"TE\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\thtml += '</span><td align=right>&nbsp;</table></div>';\n\n\tself.TABLE.document.getElementById(\"paneBody1\").innerHTML = html;\n}", "function PaintHeaders(View)\n{\n\tif (!self.TABLE || !self.TABLE.document || !self.TABLE.document.getElementById(\"paneBody1\"))\n\t{\n\t\t\n\t\tsetTimeout(function() { PaintHeaders.apply(this, arguments); }, 5);\n\t\treturn;\n\t}\n\t\n\t__View = View;\n\n\tswitch (View)\n\t{\n\t\tcase \"Period\": functionCall = \"HeaderCalendar\"; date_fld_name = \"1\"; break;\n\t\tcase \"Daily\": functionCall = \"HeaderCalendar_Daily\"; date_fld_name = \"3\"; break;\n\t\tcase \"Exception\": functionCall = \"HeaderCalendar_Exception\"; date_fld_name = \"4\"; break;\n\t}\n\n\tvar html = '<div style=\"padding-bottom:10px\">'\n\thtml += '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"width:50px\" rowspan=\"2\">';\n\thtml += '&nbsp;';\n\thtml += '<td style=\"width:50px\" rowspan=\"2\">';\n\thtml += '&nbsp;';\n\thtml += '<td style=\"width:50px\" rowspan=\"2\">';\n\n\tif (View == \"Daily\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'CommentsClicked_Daily()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.CommentIconMouseOver(1,\\'\\');return true;\" ';\n\t\thtml += 'onmouseout=\"parent.CommentIconMouseOver(0,\\'\\');return true;\">';\n\t\thtml += '<img styler=\"documenticon\" src=\"'+NoCommentsIconImage.src+'\" border=\"0\" width=\"32\" height=\"32\" ';\n\t\thtml += 'default_icon=\"' + NoCommentsIcon + '\" active_icon=\"' + ExistingCommentsIcon + '\" ';\n\t\thtml += 'name=\"comment\" alt=\"'+getSeaPhrase(\"OPEN_COMMENTS\",\"TE\")+dteDay(TimeCard.StartDate)+\", \"+ FormatDte3(TimeCard.StartDate)+'\">';\n\t\thtml += '</a>';\n\t}\n\telse\n\t{\n\t\thtml += '&nbsp;';\n\t}\n\t\n\thtml += '<td style=\"width:100%;text-align:center\">';\n\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\thtml += '<span class=\"fieldlabelbold\">'+getSeaPhrase(\"EMPLOYEE\",\"TE\")+'&nbsp;</span>';\n\t\thtml += '<span class=\"fieldlabel\">'+Employee.EmployeeName+'</span>';\n\n\t\tif (parseInt(TimeCard.TimeCardType,10) == 2)\n\t\t{\n\t\t\thtml += '&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"plaintablecellbold\">'+getSeaPhrase(\"EXCEPTION\",\"TE\")+'</span>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\thtml += '&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"plaintablecellbold\">'+getSeaPhrase(\"NORMAL\",\"TE\")+'</span>';\n\t\t}\n\t}\n\telse\n\t{\n\t\thtml += '&nbsp;';\n\t}\n\t\n\thtml += '<td rowspan=\"2\" nowrap style=\"vertical-align:top\">';\n\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\t// If the ProcessFlow service was found, trigger the flow. Otherwise use the email CGI program.\n\t\tvar techVersion = (iosHandler && iosHandler.getIOSVersionNumber() >= \"9.0\") ? ProcessFlowObject.TECHNOLOGY_900 : ProcessFlowObject.TECHNOLOGY_803;\n\t\tvar httpRequest = (typeof(SSORequest) == \"function\") ? SSORequest : SEARequest;\n\t\tvar pfObj = new ProcessFlowObject(window, techVersion, httpRequest, \"EMSS\");\n\t\tpfObj.showErrors = false;\n\n\t\tif (typeof(pfServiceObj) == \"undefined\")\n\t\t{\n\t\t\tpfServiceObj = pfObj.lookUpService(\"EMSSTimeEntChg\");\n\t\t}\t\n\t\n// MOD BY BILAL\t\n//\t\tif (pfServiceObj == null)\n//\t\t{\n\t\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'EmployeeEmailClicked()\\');return false;\">';\n\t\t\thtml += getSeaPhrase(\"SEND_EMAIL\",\"ESS\");\n\t\t\thtml += '</a>&nbsp;&nbsp;'\t\t\t\n//\t\t}\n//\t\telse\n//\t\t{\n\t\t\tfor (var i=0; i<Reports.Detail.length && (parseInt(Reports.Detail[i].Employee, 10) != parseInt(Employee.EmployeeNbr,10)); i++);\n\n//\t\t\tif (i < Reports.Detail.length)\t\t\n//\t\t\t{\n//\t\t\t\thtml += '<a href=\"mailto:' + Reports.Detail[i].Email + '\">';\n//\t\t\t\thtml += getSeaPhrase(\"SEND_EMAIL\",\"ESS\");\n//\t\t\t\thtml += '</a>&nbsp;&nbsp;'\t\t\t\n//\t\t\t}\n//\t\t}\n// END OF MOD\n\t}\n\t\n\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'OpenTimeOff_Period()\\');return false;\">';\n\thtml += getSeaPhrase(\"OPEN_LEAVE_BALANCE_WIN\",\"TE\")+'</a>';\n\thtml += '<td>&nbsp;</td></tr>';\n\thtml += '<tr><td align=\"center\">';\n\thtml += '<table style=\"width:410px\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';\n\thtml += '<tr><td style=\"vertical-align:middle;width:14px\"></td>';\n\thtml += '<td style=\"vertical-align:middle;width:25px\">';\n\n\tif (View == \"Period\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousPeriod()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse if (View == \"Exception\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousException()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousDay()\\');return false;\" '\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" '\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"'\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_DAY\",\"TE\")+'\" border=\"0\">'\n\t}\n\n\thtml += '</a></td><td style=\"vertical-align:middle;text-align:center\" nowrap>';\n\thtml += '<span class=\"plaintablecellbold\">'+dteDay(TimeCard.StartDate)+\", \"+FormatDte3(TimeCard.StartDate);\n\n\tif (View == \"Period\" || View == \"Exception\")\n\t{\n\t\thtml += ' - ' + dteDay(TimeCard.EndDate)+\", \"+FormatDte3(TimeCard.EndDate);\n\t}\n\t\n\thtml += '</span></td><td style=\"vertical-align:middle;width:25px\">'\n\n\tif (View == \"Period\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextPeriod()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse if (View == \"Exception\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextException()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextDay()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_DAY\",\"TE\")+'\" border=\"0\">';\n\t}\n\t\n\tvar CalendarStartDate = \"\";\n\tif (hs36 && hs36.CalendarDate != null)\n\t{\n\t\tCalendarStartDate = FormatDte4(hs36.CalendarDate);\n\t}\n\telse if (getDteDifference(ymdtoday, TimeCard.StartDate) <= 0 && getDteDifference(ymdtoday, TimeCard.EndDate) >= 0)\n\t{\t\n\t\tCalendarStartDate = fmttoday;\n\t}\n\telse\t\n\t{\t\n\t\tCalendarStartDate = FormatDte4(TimeCard.StartDate);\n\t}\n\t\n\thtml += '</a></td><td style=\"vertical-align:middle\" nowrap>&nbsp;';\n\thtml += '<input onchange=\"parent.ReturnDate(this.value)\" styler=\"calendar\" class=\"inputbox\" onkeydown=\"this.value=this.getAttribute(\\'start_date\\')\" onkeyup=\"this.value=this.getAttribute(\\'start_date\\')\" type=\"text\" name=\"navDate\" size=\"10\" maxlength=\"10\" start_date=\"' + CalendarStartDate + '\" value=\"' + CalendarStartDate + '\"/>';\n\thtml += '<a styler=\"hidden\" href=\"\" onclick=\"parent.CheckAuthen(\\''+functionCall+'()\\');return false\">' + uiCalendarIcon() + '</a>';\n\n\thtml += '</td><td style=\"width:14px\">&nbsp;';\n\thtml += '</td></tr></table>';\n\thtml += '<td>&nbsp;<td>&nbsp;';\n\thtml += '<tr><td>&nbsp';\n\thtml += '<td>&nbsp;';\n\thtml += '<td>&nbsp;';\n\thtml += '<td style=\"text-align:center\">';\n\thtml += '<span class=\"fieldlabelbold\">';\n\t\n\tswitch (TimeCard.View)\n\t{\n\t\tcase 1: html += getSeaPhrase(\"INVALID_PERIOD\",\"TE\"); break;\n\t\tcase 2: html += getSeaPhrase(\"TE_LOCKED\",\"TE\"); break;\n\t\tcase 3: html += getSeaPhrase(\"OLD_PERIOD\",\"TE\"); break;\n\t\tdefault:\n\t\t{\n\t\t\tif (TimeCard.ManagerFlag)\n\t\t\t{\n\t\t\t\tswitch(TimeCard.Status)\n\t\t\t\t{\n\t\t\t\t\tcase -1: html += getSeaPhrase(\"CARD_NOT_ENTERED\",\"TE\"); break;\n\t\t\t\t\tcase 0: html += getSeaPhrase(\"CARD_ENTERED_NOT_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 1: html += getSeaPhrase(\"CARD_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 2: html += getSeaPhrase(\"CARD_APPROVED\",\"TE\"); break;\n\t\t\t\t\tcase 3: html += getSeaPhrase(\"CARD_ON_HOLD\",\"TE\"); break;\n\t\t\t\t\tcase 4: html += getSeaPhrase(\"CARD_REJECTED\",\"TE\"); break;\n\t\t\t\t\tcase 5:\n\t\t\t\t\tcase 6:\n\t\t\t\t\tcase 7:\n\t\t\t\t\tcase 8:\n\t\t\t\t\tcase 9: html += getSeaPhrase(\"OLD_PERIOD\",\"TE\"); break;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch (parseInt(TimeCard.Status, 10))\n\t\t\t\t{\n\t\t\t\t\tcase 1: html += getSeaPhrase(\"CARD_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 2: html += getSeaPhrase(\"CARD_APPROVED_NO_MORE\",\"TE\"); break;\n\t\t\t\t\tcase 3: html += getSeaPhrase(\"CARD_ON_HOLD_NO_MORE\",\"TE\"); break;\n\t\t\t\t\tcase 4: html += getSeaPhrase(\"CARD_RETURNED_NEED_CHANGE\",\"TE\"); break;\n\t\t\t\t\tdefault:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (View == \"Period\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_TIME_CLICK_MULTIENTRIES\",\"TE\")+'<img styler=\"multipleentrydetailicon\" width=15 height=15 alt=\"'+getSeaPhrase(\"SPLIT_NOTIFY\",\"TE\")+'\" src='+SplitIcon+'>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (View == \"Exception\")\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_EXCEPTION_TIME\",\"TE\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_TIME\",\"TE\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\thtml += '</span><td align=right>&nbsp;</table></div>';\n\n\tself.TABLE.document.getElementById(\"paneBody1\").innerHTML = html;\n}", "function _fnDrawHead(oSettings) {\n\t\t\tvar i, nTh, iLen, j, jLen;\n\t\t\tvar anTr = oSettings.nTHead.getElementsByTagName('tr');\n\t\t\tvar iThs = oSettings.nTHead.getElementsByTagName('th').length;\n\t\t\tvar iCorrector = 0;\n\t\t\tvar jqChildren;\n\n\t\t\t/*\n\t\t\t * If there is a header in place - then use it - otherwise it's\n\t\t\t * going to get nuked...\n\t\t\t */\n\t\t\tif (iThs !== 0) {\n\t\t\t\t/*\n\t\t\t\t * We've got a thead from the DOM, so remove hidden columns and\n\t\t\t\t * apply width to vis cols\n\t\t\t\t */\n\t\t\t\tfor (i = 0, iLen = oSettings.aoColumns.length; i < iLen; i++) {\n\t\t\t\t\tnTh = oSettings.aoColumns[i].nTh;\n\n\t\t\t\t\tif (oSettings.aoColumns[i].sClass !== null) {\n\t\t\t\t\t\t$(nTh).addClass(oSettings.aoColumns[i].sClass);\n\t\t\t\t\t}\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Cache and remove (if needed) any extra elements for this\n\t\t\t\t\t * column in the header\n\t\t\t\t\t */\n\t\t\t\t\tfor (j = 1, jLen = anTr.length; j < jLen; j++) {\n\t\t\t\t\t\tjqChildren = $(anTr[j]).children();\n\t\t\t\t\t\toSettings.aoColumns[i].anThExtra.push(jqChildren[i\n\t\t\t\t\t\t\t\t- iCorrector]);\n\t\t\t\t\t\tif (!oSettings.aoColumns[i].bVisible) {\n\t\t\t\t\t\t\tanTr[j].removeChild(jqChildren[i - iCorrector]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (oSettings.aoColumns[i].bVisible) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Set the title of the column if it is user defined\n\t\t\t\t\t\t * (not what was auto detected)\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (oSettings.aoColumns[i].sTitle != nTh.innerHTML) {\n\t\t\t\t\t\t\tnTh.innerHTML = oSettings.aoColumns[i].sTitle;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnTh.parentNode.removeChild(nTh);\n\t\t\t\t\t\tiCorrector++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t/*\n\t\t\t\t * We don't have a header in the DOM - so we are going to have\n\t\t\t\t * to create one\n\t\t\t\t */\n\t\t\t\tvar nTr = document.createElement(\"tr\");\n\n\t\t\t\tfor (i = 0, iLen = oSettings.aoColumns.length; i < iLen; i++) {\n\t\t\t\t\tnTh = oSettings.aoColumns[i].nTh;\n\t\t\t\t\tnTh.innerHTML = oSettings.aoColumns[i].sTitle;\n\n\t\t\t\t\tif (oSettings.aoColumns[i].sClass !== null) {\n\t\t\t\t\t\t$(nTh).addClass(oSettings.aoColumns[i].sClass);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (oSettings.aoColumns[i].bVisible) {\n\t\t\t\t\t\tnTr.appendChild(nTh);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$(oSettings.nTHead).html('')[0].appendChild(nTr);\n\t\t\t}\n\n\t\t\t/* Add the extra markup needed by jQuery UI's themes */\n\t\t\tif (oSettings.bJUI) {\n\t\t\t\tfor (i = 0, iLen = oSettings.aoColumns.length; i < iLen; i++) {\n\t\t\t\t\tnTh = oSettings.aoColumns[i].nTh;\n\n\t\t\t\t\tvar nDiv = document.createElement('div');\n\t\t\t\t\tnDiv.className = oSettings.oClasses.sSortJUIWrapper;\n\t\t\t\t\t$(nTh).contents().appendTo(nDiv);\n\n\t\t\t\t\tnDiv.appendChild(document.createElement('span'));\n\t\t\t\t\tnTh.appendChild(nDiv);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Add sort listener */\n\t\t\tvar fnNoSelect = function(e) {\n\t\t\t\tthis.onselectstart = function() {\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tif (oSettings.oFeatures.bSort) {\n\t\t\t\tfor (i = 0; i < oSettings.aoColumns.length; i++) {\n\t\t\t\t\tif (oSettings.aoColumns[i].bSortable !== false) {\n\t\t\t\t\t\t_fnSortAttachListener(oSettings,\n\t\t\t\t\t\t\t\toSettings.aoColumns[i].nTh, i);\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Take the brutal approach to cancelling text selection\n\t\t\t\t\t\t * in header\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$(oSettings.aoColumns[i].nTh).bind('mousedown.DT',\n\t\t\t\t\t\t\t\tfnNoSelect);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$(oSettings.aoColumns[i].nTh).addClass(\n\t\t\t\t\t\t\t\toSettings.oClasses.sSortableNone);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Cache the footer elements */\n\t\t\tif (oSettings.nTFoot !== null) {\n\t\t\t\tiCorrector = 0;\n\t\t\t\tanTr = oSettings.nTFoot.getElementsByTagName('tr');\n\t\t\t\tvar nTfs = anTr[0].getElementsByTagName('th');\n\n\t\t\t\tfor (i = 0, iLen = nTfs.length; i < iLen; i++) {\n\t\t\t\t\tif (typeof oSettings.aoColumns[i] != 'undefined') {\n\t\t\t\t\t\toSettings.aoColumns[i].nTf = nTfs[i - iCorrector];\n\n\t\t\t\t\t\tif (oSettings.oClasses.sFooterTH !== \"\") {\n\t\t\t\t\t\t\toSettings.aoColumns[i].nTf.className += \" \"\n\t\t\t\t\t\t\t\t\t+ oSettings.oClasses.sFooterTH;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Deal with any extra elements for this column from the\n\t\t\t\t\t\t * footer\n\t\t\t\t\t\t */\n\t\t\t\t\t\tfor (j = 1, jLen = anTr.length; j < jLen; j++) {\n\t\t\t\t\t\t\tjqChildren = $(anTr[j]).children();\n\t\t\t\t\t\t\toSettings.aoColumns[i].anTfExtra.push(jqChildren[i\n\t\t\t\t\t\t\t\t\t- iCorrector]);\n\t\t\t\t\t\t\tif (!oSettings.aoColumns[i].bVisible) {\n\t\t\t\t\t\t\t\tanTr[j].removeChild(jqChildren[i - iCorrector]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!oSettings.aoColumns[i].bVisible) {\n\t\t\t\t\t\t\tnTfs[i - iCorrector].parentNode.removeChild(nTfs[i\n\t\t\t\t\t\t\t\t\t- iCorrector]);\n\t\t\t\t\t\t\tiCorrector++;\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}", "function updateTableHeaders() {\n\n // loop over our headers\n _.each(properties.tableColumns, function (item) {\n\n var showActive = true;\n var parentElement = item.enhancedTable.sort.element.parent();\n var sortElement = item.enhancedTable.sort.element;\n var filterElement = item.enhancedTable.filter.element;\n\n // If sort position is set, update the header\n if (item.enhancedTable.sort.position != null) {\n var graphic = item.enhancedTable.sort.direction == \"asc\" ? \" - &#9650\" : \" - &#9660\";\n $('#iconText', sortElement).html(item.enhancedTable.sort.position + 1);\n $('#icon', sortElement).html(graphic);\n } else {\n\n // No sort position, so showActive is a no, so far\n showActive = false;\n\n // No sort position, so just show the default text\n $('#iconText', sortElement).html(\"\");\n $('#icon', sortElement).html(\"\");\n }\n\n\n // Only update the filter items if filters are enabled\n if (!properties.filterDisabled) {\n\n // Now lets do the same for the filters, is there a sort position?\n if (item.enhancedTable.filter.position != null) {\n\n // If so, make sure our showActive is now also true\n showActive = true;\n\n // Update the screen with its position number\n $('#text', filterElement).text(item.enhancedTable.filter.position + 1);\n } else {\n\n $('#text', filterElement).text(\"\");\n }\n }\n\n // Finally, if showActive, add a class to make pretty the parent element\n if (showActive) {\n $(parentElement).addClass('ui-btn-active');\n } else {\n $(parentElement).removeClass('ui-btn-active');\n }\n\n\n });\n }", "function printHeader(){\n\t\t\t\t\t\t// title\n\t\t\t\t\t\tif (title !== \"\"){\n\t\t\t\t\t\t\tdoc.setFont(myFont,\"bold\");\n\t\t\t\t\t\t\tdoc.setFontSize(fontsize);\n\t\t\t\t\t\t\tdoc.myText(marginLeft, y, title, {underline: true});\n\t\t\t\t\t\t\t// header - grey outlined box with text\n\t\t\t\t\t\t\ty += 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdoc.setFillColor(204,204,204); // CCCCCC\n\t\t\t\t\t\tdoc.setDrawColor(0);\n\t\t\t\t\t\tdoc.rect(marginLeft,y,pageWidth,rowHt,'FD'); // Fill and outline rectangle\n\t\t\t\t\t\tvar x = marginLeft+4;\n\t\t\t\t\t\tdoc.setFont(myFont,\"normal\");\n\t\t\t\t\t\ty += lineHt;\n\t\t\t\t\t\t// add vertical lines between header column names\n\t\t\t\t\t\tfor (var i=0; i<header.length; i++) {\n\t\t\t\t\t\t\tif(header[i].displayname)\n\t\t\t\t\t\t\t\tdoc.text(x,y,header[i].displayname);\n\t\t\t\t\t\t\tx += header[i].width;\n\t\t\t\t\t\t\tif (i<header.length-1)\n\t\t\t\t\t\t\t\tdoc.line(x-4,y-lineHt,x-4,y+6);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ty+=rowHt;\n\t\t\t\t\t}", "function PdfGridHeaderCollection(grid){/**\n * The array to store the `rows` of the grid header.\n * @private\n */this.rows=[];this.grid=grid;this.rows=[];}//Properties", "handleColumnHeaders() {\n\n // Create a copy of map file\n const headerMap = JSON.parse(JSON.stringify(groupingMap));\n\n // Set the header groups for table\n const headerGrouping = headerMap.filter((item) => {\n item.colspan = item.columns.length;\n return typeof item.columns === \"object\"\n })\n\n // set each and every column defaults\n const cols = headerMap.map((item) => {\n\n return item.columns.map(c => {\n\n this.titles.push(c.label);\n\n c.color = item.color;\n\n c.editor = false; // default readonly\n\n if (typeof c.validator !== \"undefined\") {\n\n if (c.validator === 'ipValidator') {\n c.validator = (value, callback) => {\n this.ipValidate(value, callback)\n }\n }\n\n if (c.validator === 'isNumeric') {\n c.validator = (value, callback) => {\n this.numericValidate(value, callback)\n }\n }\n }\n\n if (typeof c.type !== \"undefined\") {\n if (c.type === 'dropdown') {\n this.setPickList(c.data).then((list) => {\n c.source = list;\n });\n }\n }\n\n if (typeof c.rerenderer !== \"undefined\") {\n c.renderer = this.iconForLockStatusInCell.bind(this);\n delete c.rerenderer;\n }\n\n return c;\n });\n })\n console.log(this.columns);\n\n // spread the columns into single object\n cols.map((c) => {\n console.log(c);\n this.columns = [...this.columns, ...c];\n })\n\n\n\n // Pushing header group const to related vars\n this.columnHeaders.push(headerGrouping);\n this.columnHeaders.push(this.titles);\n\n console.log(this.columnHeaders);\n console.log(this.columns);\n }", "function getHeaderGrid(dp,cellIndex){\n\treturn dp.obj.hdrLabels[cellIndex];\n}", "function createHeader() {\n var caption = [];\n\n caption.push('<span class=\"table-caption\">Master&nbsp;Status</span><br>');\n\n $('<caption/>', {\n html: caption.join('')\n }).appendTo('#masterStatus');\n\n var items = [];\n\n var columns = ['Master&nbsp;', '#&nbsp;Online<br>Tablet&nbsp;Servers&nbsp;',\n '#&nbsp;Total<br>Tablet&nbsp;Servers&nbsp;', 'Last&nbsp;GC&nbsp;',\n '#&nbsp;Tablets&nbsp;', '#&nbsp;Unassigned<br>Tablets&nbsp;',\n 'Entries&nbsp;', 'Ingest&nbsp;', 'Entries<br>Read&nbsp;',\n 'Entries<br>Returned&nbsp;', 'Hold&nbsp;Time&nbsp;',\n 'OS&nbsp;Load&nbsp;'];\n\n var titles = [descriptions['Master'], descriptions['# Online Tablet Servers'],\n descriptions['# Total Tablet Servers'], descriptions['Last GC'],\n descriptions['# Tablets'], '', descriptions['Total Entries'],\n descriptions['Total Ingest'], descriptions['Total Entries Read'],\n descriptions['Total Entries Returned'], descriptions['Max Hold Time'],\n descriptions['OS Load']];\n\n /*\n * Adds the columns, add sortTable function on click,\n * if the column has a description, add title taken from the global.js\n */\n for (i = 0; i < columns.length; i++) {\n var first = i == 0 ? true : false;\n items.push(createHeaderCell(first, 'sortMasterTable(' + i + ')',\n titles[i], columns[i]));\n }\n\n $('<tr/>', {\n html: items.join('')\n }).appendTo('#masterStatus');\n}", "refreshHeader(internal) {\n const me = this,\n { element } = me;\n\n if (element) {\n\n if (me.mode === 'horizontal') {\n // Force timeAxisViewModel to regenerate its column config, which calls header renderers etc.\n !internal && me.timeAxisViewModel.update(null, true);\n\n if (!me.timeAxisView.rendered) {\n // Do not need the normal header markup\n element.innerHTML = '';\n\n me.timeAxisView.render(element);\n }\n else {\n // Force rebuild of cells in case external data has changed (cheap since it still syncs to DOM)\n me.timeAxisView.refresh(true);\n }\n }\n else if (me.mode === 'vertical') {\n if (!me.resourceColumns.currentElement) {\n // Do not need the normal header markup\n element.innerHTML = '';\n\n me.resourceColumns.render(element);\n }\n\n // Vertical's resourceColumns is redrawn with the events, no need here\n }\n }\n }", "function setHeader(table,keys){\n var header = table.createTHead();\n var row = header.insertRow(0);\n scope.selectedMax = keys.length-1;\n if(typeof scope.actions === 'function'){\n var thCheck = document.createElement('th');\n thCheck.innerHTML = createCheckbox(-1,i,'hulp');\n row.appendChild(thCheck);\n }\n\n for(var k=0;k<keys.length;k++){\n if(keys[k] && keys[k].checked && keys[k].visible){\n // var key = Object.keys(keys[i])[0];\n var val = keys[k].alias || keys[k].field;\n var th = document.createElement('th');\n th.innerHTML = val;\n row.appendChild(th);\n $(th).bind('click',sorte(k));\n if(keys[k] === scope.sorting.obj){\n if(scope.sorting.direction === 1){\n $(th).addClass('sort-asc');\n }else if(scope.sorting.direction === -1){\n $(th).addClass('sort-desc');\n }\n }\n }\n }\n }", "function setHeader(table,keys){\n var header = table.createTHead();\n var row = header.insertRow(0);\n scope.selectedMax = keys.length-1;\n if(typeof scope.actions === 'function'){\n var thCheck = document.createElement('th');\n thCheck.innerHTML = createCheckbox(-1,i,'hulp');\n row.appendChild(thCheck);\n }\n\n for(var k=0;k<keys.length;k++){\n if(keys[k] && keys[k].checked && keys[k].visible){\n // var key = Object.keys(keys[i])[0];\n var val = keys[k].alias || keys[k].field;\n var th = document.createElement('th');\n th.innerHTML = val;\n row.appendChild(th);\n $(th).bind('click',sorte(k));\n if(keys[k] === scope.sorting.obj){\n if(scope.sorting.direction === 1){\n $(th).addClass('sort-asc');\n }else if(scope.sorting.direction === -1){\n $(th).addClass('sort-desc');\n }\n }\n }\n }\n }", "function _fnDrawHead( oSettings )\n\t\t{\n\t\t\tvar i, nTh, iLen, j, jLen;\n\t\t\tvar anTr = oSettings.nTHead.getElementsByTagName('tr');\n\t\t\tvar iThs = oSettings.nTHead.getElementsByTagName('th').length;\n\t\t\tvar iCorrector = 0;\n\t\t\tvar jqChildren;\n\t\t\t\n\t\t\t/* If there is a header in place - then use it - otherwise it's going to get nuked... */\n\t\t\tif ( iThs !== 0 )\n\t\t\t{\n\t\t\t\t/* We've got a thead from the DOM, so remove hidden columns and apply width to vis cols */\n\t\t\t\tfor ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )\n\t\t\t\t{\n\t\t\t\t\tnTh = oSettings.aoColumns[i].nTh;\n\t\t\t\t\t\n\t\t\t\t\tif ( oSettings.aoColumns[i].sClass !== null )\n\t\t\t\t\t{\n\t\t\t\t\t\t$(nTh).addClass( oSettings.aoColumns[i].sClass );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* Cache and remove (if needed) any extra elements for this column in the header */\n\t\t\t\t\tfor ( j=1, jLen=anTr.length ; j<jLen ; j++ )\n\t\t\t\t\t{\n\t\t\t\t\t\tjqChildren = $(anTr[j]).children();\n\t\t\t\t\t\toSettings.aoColumns[i].anThExtra.push( jqChildren[i-iCorrector] );\n\t\t\t\t\t\tif ( !oSettings.aoColumns[i].bVisible )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tanTr[j].removeChild( jqChildren[i-iCorrector] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ( oSettings.aoColumns[i].bVisible )\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Set the title of the column if it is user defined (not what was auto detected) */\n\t\t\t\t\t\tif ( oSettings.aoColumns[i].sTitle != nTh.innerHTML )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnTh.innerHTML = oSettings.aoColumns[i].sTitle;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnTh.parentNode.removeChild( nTh );\n\t\t\t\t\t\tiCorrector++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* We don't have a header in the DOM - so we are going to have to create one */\n\t\t\t\tvar nTr = document.createElement( \"tr\" );\n\t\t\t\t\n\t\t\t\tfor ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )\n\t\t\t\t{\n\t\t\t\t\tnTh = oSettings.aoColumns[i].nTh;\n\t\t\t\t\tnTh.innerHTML = oSettings.aoColumns[i].sTitle;\n\t\t\t\t\t\n\t\t\t\t\tif ( oSettings.aoColumns[i].sClass !== null )\n\t\t\t\t\t{\n\t\t\t\t\t\t$(nTh).addClass( oSettings.aoColumns[i].sClass );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ( oSettings.aoColumns[i].bVisible )\n\t\t\t\t\t{\n\t\t\t\t\t\tnTr.appendChild( nTh );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$(oSettings.nTHead).html( '' )[0].appendChild( nTr );\n\t\t\t}\n\t\t\t\n\t\t\t/* Add the extra markup needed by jQuery UI's themes */\n\t\t\tif ( oSettings.bJUI )\n\t\t\t{\n\t\t\t\tfor ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )\n\t\t\t\t{\n\t\t\t\t\tnTh = oSettings.aoColumns[i].nTh;\n\t\t\t\t\t\n\t\t\t\t\tvar nDiv = document.createElement('div');\n\t\t\t\t\tnDiv.className = oSettings.oClasses.sSortJUIWrapper;\n\t\t\t\t\t$(nTh).contents().appendTo(nDiv);\n\t\t\t\t\t\n\t\t\t\t\tnDiv.appendChild( document.createElement('span') );\n\t\t\t\t\tnTh.appendChild( nDiv );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Add sort listener */\n\t\t\tvar fnNoSelect = function (e) {\n\t\t\t\tthis.onselectstart = function() { return false; };\n\t\t\t\treturn false;\n\t\t\t};\n\t\t\t\n\t\t\tif ( oSettings.oFeatures.bSort )\n\t\t\t{\n\t\t\t\tfor ( i=0 ; i<oSettings.aoColumns.length ; i++ )\n\t\t\t\t{\n\t\t\t\t\tif ( oSettings.aoColumns[i].bSortable !== false )\n\t\t\t\t\t{\n\t\t\t\t\t\t_fnSortAttachListener( oSettings, oSettings.aoColumns[i].nTh, i );\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* Take the brutal approach to cancelling text selection in header */\n\t\t\t\t\t\t$(oSettings.aoColumns[i].nTh).mousedown( fnNoSelect );\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$(oSettings.aoColumns[i].nTh).addClass( oSettings.oClasses.sSortableNone );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Cache the footer elements */\n\t\t\tif ( oSettings.nTFoot !== null )\n\t\t\t{\n\t\t\t\tiCorrector = 0;\n\t\t\t\tanTr = oSettings.nTFoot.getElementsByTagName('tr');\n\t\t\t\tvar nTfs = anTr[0].getElementsByTagName('th');\n\t\t\t\t\n\t\t\t\tfor ( i=0, iLen=nTfs.length ; i<iLen ; i++ )\n\t\t\t\t{\n\t\t\t\t\tif ( typeof oSettings.aoColumns[i] != 'undefined' )\n\t\t\t\t\t{\n\t\t\t\t\t\toSettings.aoColumns[i].nTf = nTfs[i-iCorrector];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( oSettings.oClasses.sFooterTH !== \"\" )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\toSettings.aoColumns[i].nTf.className += \" \"+oSettings.oClasses.sFooterTH;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* Deal with any extra elements for this column from the footer */\n\t\t\t\t\t\tfor ( j=1, jLen=anTr.length ; j<jLen ; j++ )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tjqChildren = $(anTr[j]).children();\n\t\t\t\t\t\t\toSettings.aoColumns[i].anTfExtra.push( jqChildren[i-iCorrector] );\n\t\t\t\t\t\t\tif ( !oSettings.aoColumns[i].bVisible )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tanTr[j].removeChild( jqChildren[i-iCorrector] );\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\tif ( !oSettings.aoColumns[i].bVisible )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnTfs[i-iCorrector].parentNode.removeChild( nTfs[i-iCorrector] );\n\t\t\t\t\t\t\tiCorrector++;\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}", "get styleTable() { return Object.assign({}, this.style.table.header); }", "addHeaderFooter(hf, hfType, id) {\n let hfColl = new Dictionary();\n this.headersFooters.add(hfType, hfColl);\n this.headersFooters.get(hfType).add(id, hf);\n }", "refreshHeader(internal) {\n const me = this,\n {\n element\n } = me;\n\n if (element) {\n if (me.mode === 'horizontal') {\n // Force timeAxisViewModel to regenerate its column config, which calls header renderers etc.\n !internal && me.timeAxisViewModel.update(null, true);\n\n if (!me.timeAxisView.rendered) {\n // Do not need the normal header markup\n element.innerHTML = '';\n me.timeAxisView.render(element);\n } else {\n // Force rebuild of cells in case external data has changed (cheap since it still syncs to DOM)\n me.timeAxisView.refresh(true);\n }\n } else if (me.mode === 'vertical') {\n if (!me.resourceColumns.currentElement) {\n // Do not need the normal header markup\n element.innerHTML = '';\n me.resourceColumns.render(element);\n } // Vertical's resourceColumns is redrawn with the events, no need here\n\n }\n }\n }", "createHeaderRow(position, headerRowConfig, headerCells) {\n const me = this,\n cells = [],\n align = headerRowConfig.align,\n today = DateHelper.clearTime(new Date()),\n headerCellCls = headerRowConfig.headerCellCls || '',\n createCellContext = (start, end, i, data) => {\n let value = DateHelper.format(start, headerRowConfig.dateFormat);\n const cellData = {\n align,\n start,\n end,\n value: data ? data.header : value,\n headerCellCls,\n width: this.getDistanceBetweenDates(start, end),\n index: i\n };\n\n if (cellData.width === 0) {\n return;\n } // Vertical mode uses absolute positioning for header cells\n\n cellData.coord = size;\n size += cellData.width;\n me.headersDatesCache[position][start.getTime()] = 1;\n\n if (headerRowConfig.renderer) {\n value = headerRowConfig.renderer.call(headerRowConfig.thisObj || me, start, end, cellData, i, me.eventStore);\n cellData.value = value == null ? '' : value;\n } // To be able to style individual day cells, weekends or other important days\n\n if (headerRowConfig.unit === 'day' && (!headerRowConfig.increment || headerRowConfig.increment === 1)) {\n cellData.headerCellCls += ' b-sch-dayheadercell-' + start.getDay();\n\n if (me.calendar && me.calendar.isWeekend(start)) {\n cellData.headerCellCls += ' b-sch-dayheadercell-nonworking';\n }\n\n if (DateHelper.clearTime(start, true) - today === 0) {\n cellData.headerCellCls += ' b-sch-dayheadercell-today';\n }\n }\n\n cells.push(cellData);\n };\n\n let size = 0;\n me.headersDatesCache[position] = {};\n\n if (headerCells) {\n headerCells.forEach((cellData, i) => createCellContext(cellData.start, cellData.end, i, cellData));\n } else {\n me.forEachInterval(position, createCellContext);\n }\n\n return cells;\n }", "function defineHeaders(i18n) {\n var hdConfig = [[{\n text: \"\",\n key: \"expand\",\n isSortable: false\n }, {\n text: i18n.translate(\"gl_grid_posted\"),\n key: \"posted\",\n isSortable: true\n }, {\n text: i18n.translate(\"gl_grid_memo\"),\n key: \"memo\",\n isSortable: true\n }, {\n text: i18n.translate(\"gl_grid_dept_id\"),\n key: \"departmentId\",\n isSortable: true\n }, {\n text: i18n.translate(\"gl_grid_loc_id\"),\n key: \"locationId\",\n isSortable: true\n }, {\n text: i18n.translate(\"gl_grid_debit\"),\n key: \"debit\",\n isSortable: true\n }, {\n text: i18n.translate(\"gl_grid_credit\"),\n key: \"credit\",\n isSortable: true\n }, {\n text: i18n.translate(\"gl_grid_balance\"),\n key: \"balance\",\n isSortable: true\n }]];\n\n var hdSetup = function () {\n return hdConfig;\n };\n\n return hdSetup;\n }", "function _fnDrawHead( oSettings )\n\t\t{\n\t\t\tvar i, nTh, iLen;\n\t\t\tvar iThs = oSettings.nTable.getElementsByTagName('thead')[0].getElementsByTagName('th').length;\n\t\t\tvar iCorrector = 0;\n\t\t\t\n\t\t\t/* If there is a header in place - then use it - otherwise it's going to get nuked... */\n\t\t\tif ( iThs !== 0 )\n\t\t\t{\n\t\t\t\t/* We've got a thead from the DOM, so remove hidden columns and apply width to vis cols */\n\t\t\t\tfor ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )\n\t\t\t\t{\n\t\t\t\t\t//oSettings.aoColumns[i].nTh = nThs[i];\n\t\t\t\t\tnTh = oSettings.aoColumns[i].nTh;\n\t\t\t\t\t\n\t\t\t\t\tif ( oSettings.aoColumns[i].bVisible )\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Set width */\n\t\t\t\t\t\tif ( oSettings.aoColumns[i].sWidth !== null )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnTh.style.width = oSettings.aoColumns[i].sWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* Set the title of the column if it is user defined (not what was auto detected) */\n\t\t\t\t\t\tif ( oSettings.aoColumns[i].sTitle != nTh.innerHTML )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnTh.innerHTML = oSettings.aoColumns[i].sTitle;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnTh.parentNode.removeChild( nTh );\n\t\t\t\t\t\tiCorrector++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* We don't have a header in the DOM - so we are going to have to create one */\n\t\t\t\tvar nTr = document.createElement( \"tr\" );\n\t\t\t\t\n\t\t\t\tfor ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )\n\t\t\t\t{\n\t\t\t\t\tif ( oSettings.aoColumns[i].bVisible )\n\t\t\t\t\t{\n\t\t\t\t\t\tnTh = oSettings.aoColumns[i].nTh;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( oSettings.aoColumns[i].sClass !== null )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnTh.className = oSettings.aoColumns[i].sClass;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( oSettings.aoColumns[i].sWidth !== null )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnTh.style.width = oSettings.aoColumns[i].sWidth;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tnTh.innerHTML = oSettings.aoColumns[i].sTitle;\n\t\t\t\t\t\tnTr.appendChild( nTh );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$('thead', oSettings.nTable).html( '' )[0].appendChild( nTr );\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t/* Add sort listener */\n\t\t\tif ( oSettings.oFeatures.bSort )\n\t\t\t{\n\t\t\t\tfor ( i=0 ; i<oSettings.aoColumns.length ; i++ )\n\t\t\t\t{\n\t\t\t\t\tif ( oSettings.aoColumns[i].bSortable === false )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$(oSettings.aoColumns[i].nTh).click( function (e) {\n\t\t\t\t\t\tvar iDataIndex;\n\t\t\t\t\t\t/* Find which column we are sorting on - can't use index() due to colspan etc */\n\t\t\t\t\t\tfor ( var i=0 ; i<oSettings.aoColumns.length ; i++ )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( oSettings.aoColumns[i].nTh == this )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tiDataIndex = i;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* If the column is not sortable - don't to anything */\n\t\t\t\t\t\tif ( oSettings.aoColumns[iDataIndex].bSortable === false )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * This is a little bit odd I admit... I declare a temporary function inside the scope of\n\t\t\t\t\t\t * _fnDrawHead and the click handler in order that the code presented here can be used \n\t\t\t\t\t\t * twice - once for when bProcessing is enabled, and another time for when it is \n\t\t\t\t\t\t * disabled, as we need to perform slightly different actions.\n\t\t\t\t\t\t * Basically the issue here is that the Javascript engine in modern browsers don't \n\t\t\t\t\t\t * appear to allow the rendering engine to update the display while it is still excuting\n\t\t\t\t\t\t * it's thread (well - it does but only after long intervals). This means that the \n\t\t\t\t\t\t * 'processing' display doesn't appear for a table sort. To break the js thread up a bit\n\t\t\t\t\t\t * I force an execution break by using setTimeout - but this breaks the expected \n\t\t\t\t\t\t * thread continuation for the end-developer's point of view (their code would execute\n\t\t\t\t\t\t * too early), so we on;y do it when we absolutely have to.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tvar fnInnerSorting = function () {\n\t\t\t\t\t\t\tif ( e.shiftKey )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* If the shift key is pressed then we are multipe column sorting */\n\t\t\t\t\t\t\t\tvar bFound = false;\n\t\t\t\t\t\t\t\tfor ( var i=0 ; i<oSettings.aaSorting.length ; i++ )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ( oSettings.aaSorting[i][0] == iDataIndex )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ( oSettings.aaSorting[i][1] == \"asc\" )\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\toSettings.aaSorting[i][1] = \"desc\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\toSettings.aaSorting.splice( i, 1 );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbFound = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ( bFound === false )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\toSettings.aaSorting.push( [ iDataIndex, \"asc\" ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t/* If no shift key then single column sort */\n\t\t\t\t\t\t\t\tif ( oSettings.aaSorting.length == 1 && oSettings.aaSorting[0][0] == iDataIndex )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\toSettings.aaSorting[0][1] = oSettings.aaSorting[0][1]==\"asc\" ? \"desc\" : \"asc\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\toSettings.aaSorting.splice( 0, oSettings.aaSorting.length );\n\t\t\t\t\t\t\t\t\toSettings.aaSorting.push( [ iDataIndex, \"asc\" ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Run the sort */\n\t\t\t\t\t\t\t_fnSort( oSettings );\n\t\t\t\t\t\t}; /* /fnInnerSorting */\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( !oSettings.oFeatures.bProcessing )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfnInnerSorting();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_fnProcessingDisplay( oSettings, true );\n\t\t\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t\t\tfnInnerSorting();\n\t\t\t\t\t\t\t\tif ( !oSettings.oFeatures.bServerSide )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t_fnProcessingDisplay( oSettings, false );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, 0 );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ); /* /click */\n\t\t\t\t} /* For each column */\n\t\t\t\t\n\t\t\t\t/* Take the brutal approach to cancelling text selection due to the shift key */\n\t\t\t\t$('thead th', oSettings.nTable).mousedown( function (e) {\n\t\t\t\t\tif ( e.shiftKey )\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.onselectstart = function() { return false; };\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} /* /if feature sort */\n\t\t\t\n\t\t\t/* Set an absolute width for the table such that pagination doesn't\n\t\t\t * cause the table to resize\n\t\t\t */\n\t\t\tif ( oSettings.oFeatures.bAutoWidth )\n\t\t\t{\n\t\t\t\toSettings.nTable.style.width = oSettings.nTable.offsetWidth+\"px\";\n\t\t\t}\n\t\t\t\n\t\t\t/* Cache the footer elements */\n\t\t\tvar nTfoot = oSettings.nTable.getElementsByTagName('tfoot');\n\t\t\tif ( nTfoot.length !== 0 )\n\t\t\t{\n\t\t\t\tiCorrector = 0;\n\t\t\t\tvar nTfs = nTfoot[0].getElementsByTagName('th');\n\t\t\t\tfor ( i=0, iLen=nTfs.length ; i<iLen ; i++ )\n\t\t\t\t{\n\t\t\t\t\toSettings.aoColumns[i].nTf = nTfs[i-iCorrector];\n\t\t\t\t\tif ( !oSettings.aoColumns[i].bVisible )\n\t\t\t\t\t{\n\t\t\t\t\t\tnTfs[i-iCorrector].parentNode.removeChild( nTfs[i-iCorrector] );\n\t\t\t\t\t\tiCorrector++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "refreshHeader(internal) {\n const me = this,\n { element } = me;\n\n if (element) {\n if (me.mode === 'horizontal') {\n // Force timeAxisViewModel to regenerate its column config, which calls header renderers etc.\n !internal && me.timeAxisViewModel.update(null, true);\n me.timeAxisView.renderTo(element);\n } else if (me.mode === 'vertical') {\n if (!me.resourceColumns.currentElement) {\n // Do not need the normal header markup\n element.innerHTML = '';\n me.resourceColumns.render(element);\n }\n\n // Vertical's resourceColumns is redrawn with the events, no need here\n }\n }\n }", "function LogoHeaderComponent() {\n }", "_createGroupHeader(data, selection, container) {\r\n const that = this,\r\n groupLabel = that.columnByDataField[data.groupDataField].label,\r\n groupHeader = document.createElement('tr'),\r\n cell = document.createElement('td'),\r\n cellInnerContainer = document.createElement('div'),\r\n arrow = document.createElement('div'),\r\n label = document.createElement('div');\r\n\r\n groupHeader.data = data;\r\n arrow.classList.add('hierarchy-arrow', 'smart-arrow', 'smart-arrow-down');\r\n arrow.setAttribute('role', 'button');\r\n arrow.setAttribute('aria-label', 'Toggle row');\r\n label.classList.add('group-label')\r\n label.innerHTML = `${groupLabel}: <span class=\"group-label-value\">${data.label}</span>`;\r\n cell.colSpan = that._columns.length;\r\n cell.classList.add('group-header');\r\n\r\n if (data.level) {\r\n cell.classList.add('outline-level-' + Math.min(data.level, 10));\r\n\r\n if (that._isCollapsed(data)) {\r\n groupHeader.setAttribute('aria-hidden', true);\r\n groupHeader.classList.add('collapsed', 'smart-hidden');\r\n }\r\n }\r\n\r\n groupHeader.setAttribute('row-id', data.$.id);\r\n\r\n cellInnerContainer.appendChild(arrow);\r\n cellInnerContainer.appendChild(label);\r\n cell.appendChild(cellInnerContainer);\r\n\r\n if (selection) {\r\n groupHeader.appendChild(document.createElement('td'));\r\n }\r\n\r\n groupHeader.appendChild(cell);\r\n container.appendChild(groupHeader);\r\n }", "function HeaderRenderer(parent){this.parent=parent;this.l10n=this.parent.localeObj;this.renderHeader();this.addEventListener();}", "function JTable(n,t){\"use strict\";var r=++JTables.tableIndex,u=!1,i,f;if(typeof t==\"boolean\"&&(u=t),this.Table=n,(typeof n==\"undefined\"||n==null)&&(this.Table=\"#jTable\"+r),i=this,f=\"\",!u){$(\"body\").append(GenerateHeaderDiv(\"headerSelection\"+r));$(\"#headerSelection\"+r).find(\".add-header\").on(\"click\",function(n){n.preventDefault();var t=$(\"#headerSelection\"+r);t.find(\".header-available:checked\").each(function(){for(var t,r,f=$(this).val(),u=!1,n=0;n<i.Headers.length;n++)t=i.Headers[n],t.Id===f&&(u=!0,t.Removed=!1);u&&(r=$(this).closest(\"label\"),r.find(\"input\").removeClass(\"header-available\").addClass(\"header-selected\"),r.parent().appendTo(\".headers-container-selected\"),$(\".headers-container-selected .header-move\").show(),$(\".headers-container-selected .header-div\").first().find(\".header-up\").hide(),$(\".headers-container-selected .header-div\").last().find(\".header-down\").hide())});t.find(\".header-item\").prop(\"checked\",!1)});$(\"#headerSelection\"+r).find(\".remove-header\").on(\"click\",function(n){n.preventDefault();var t=$(\"#headerSelection\"+r);$(\".header-selected:checked\").each(function(){for(var r,n,f=$(this).val(),u=!1,t=0;t<i.Headers.length;t++)r=i.Headers[t],r.Id===f&&(u=!0,r.Removed=!0);u&&(n=$(this).closest(\"label\"),n.find(\"input\").removeClass(\"header-selected\").addClass(\"header-available\"),n.parent().appendTo(\".headers-container-available\"),n.parent().find(\".header-move\").hide())});$(\".header-item\").prop(\"checked\",!1)});$(\"#headerSelection\"+r).on(\"show.bs.modal\",function(){var t=$(this),u,r,n;for(t.find(\".headers-container-selected\").html(\"\"),t.find(\".headers-container-available\").html(\"\"),u=i.Headers.sort(function(n,t){return n.Order-t.Order}),r=0;r<u.length;r++){if(n=u[r],n.Id===\"confirmation\"){t.find(\".headers-container-selected\").append('<label style=\"display: none;\"><input type=\"checkbox\" value=\"'+n.Id+'\" class=\"header-item header-selected\" />'+n.Label+\"<\\/label>\");continue}n.Removed?t.find(\".headers-container-available\").append('<div class=\"header-div\" data-id=\"'+n.Id+'\"><label><input type=\"checkbox\" value=\"'+n.Id+'\" class=\"header-item header-available\" />'+n.Label+'<\\/label> <span class=\"header-move header-up cursor-pointer glyphicon glyphicon-arrow-up\" data-id=\"'+n.Id+'\"><\\/span> <span class=\"header-move header-down cursor-pointer glyphicon glyphicon-arrow-down\" data-id=\"'+n.Id+'\"><\\/span><\\/div>'):t.find(\".headers-container-selected\").append('<div class=\"header-div\" data-id=\"'+n.Id+'\"><label><input type=\"checkbox\" value=\"'+n.Id+'\" class=\"header-item header-selected\" />'+n.Label+'<\\/label> <span class=\"header-move header-up cursor-pointer glyphicon glyphicon-arrow-up\" data-id=\"'+n.Id+'\"><\\/span> <span class=\"header-move header-down cursor-pointer glyphicon glyphicon-arrow-down\" data-id=\"'+n.Id+'\"><\\/span><\\/div>')}t.find(\".headers-container-available .header-move\").hide();t.find(\".headers-container-selected .header-div\").first().find(\".header-up\").hide();t.find(\".headers-container-selected .header-div\").last().find(\".header-down\").hide();$(\".header-move\").on(\"click\",function(){var t=$(this),u=t.attr(\"data-id\"),n=$(this).parent(),i=n.prev(),r=n.next();if(t.hasClass(\"header-up\")){if(i.length===0)return;n.insertBefore(i)}else{if(r.length===0)return;n.insertAfter(r)}$(\".headers-container-selected .header-move\").show();$(\".headers-container-selected .header-div\").first().find(\".header-up\").hide();$(\".headers-container-selected .header-div\").last().find(\".header-down\").hide()})});$(\"#headerSelection\"+r).find(\".headers-set\").on(\"click\",function(){$(this).closest(\".modal\").modal(\"hide\");var n=0;$(\".headers-container-selected .header-div\").each(function(){var t=FindHeader(i,$(this).attr(\"data-id\"));t!==null&&(t.Order=++n)});$(\".headers-container-available .header-div\").each(function(){var t=FindHeader(i,$(this).attr(\"data-id\"));t!==null&&(t.Order=++n)});i.GetPage()});$('.jTable_headers-edit[data-jtable-target=\"'+this.Table+'\"]').on(\"click\",function(n){n.preventDefault();$(\"#headerSelection\"+r).modal(\"show\")});$('.jTable_pageLeft[data-jtable-target=\"'+this.Table+'\"]').on(\"click\",function(){i.Page!==1&&(i.Page--,$('.jTable_pageSelect[data-jtable-target=\"'+this.Table+'\"]').val(i.Page),i.GetPage())});$('.jTable_pageRight[data-jtable-target=\"'+this.Table+'\"]').on(\"click\",function(){i.Page!==i.TotalPages()&&(i.Page++,$('.jTable_pageSelect[data-jtable-target=\"'+this.Table+'\"]').val(i.Page),i.GetPage())});$('.jTable_pageSelect[data-jtable-target=\"'+this.Table+'\"]').on(\"change\",function(){i.Page=parseInt($(this).val());i.GetPage()});$('.jTable_recordsPerPage[data-jtable-target=\"'+this.Table+'\"]').on(\"blur\",function(){var n=$(this).val();isNaN(n)?($(this).val(25),i.RecordsPerPage=25,i.GetPage()):(i.RecordsPerPage=parseInt(n),i.GetPage())});$('.jTable_average[data-jtable-target=\"'+this.Table+'\"]').on(\"change\",function(){i.Average=$(this).prop(\"checked\");i.GetPage()});$('.jTable_graph[data-jtable-target=\"'+this.Table+'\"]').on(\"change\",function(){i.Graph=$(this).prop(\"checked\");i.GetPage()});$('.jTable_count[data-jtable-target=\"'+this.Table+'\"]').on(\"change\",function(){i.Count=$(this).prop(\"checked\");i.GetPage()});$('.jTable_sortings-clearAll[data-jtable-target=\"'+this.Table+'\"]').on(\"click\",function(n){n.preventDefault();i.Sortings=[];i.SortingObject.Generate();i.Sorted=!1;i.GetPage()});$('.jTable_sortings-edit[data-jtable-target=\"'+this.Table+'\"]').on(\"click\",function(n){n.preventDefault();i.SortingObject.Modal.modal(\"show\")});$('.jTable_filters-clearAll[data-jtable-target=\"'+this.Table+'\"]').on(\"click\",function(n){n.preventDefault();i.Filters=[];i.FilterObject.Generate();i.Filtered=!1;i.GetPage()});$('.jTable_filters-edit[data-jtable-target=\"'+this.Table+'\"]').on(\"click\",function(n){n.preventDefault();i.FilterObject.Modal.modal(\"show\")});$('.jTable_favorite[data-jtable-target=\"'+this.Table+'\"]').on(\"click\",function(){i.Favorite?($(this).html('<span class=\"glyphicon glyphicon-star-empty\"><\\/span> Favorite'),i.Favorite=!1):($(this).html('<span class=\"glyphicon glyphicon-star\"><\\/span> Un-Favorite'),i.Favorite=!0)});$('.jTable_headers-clearAll[data-jtable-target=\"'+this.Table+'\"]').on(\"click\",function(n){var t,r;for(n.preventDefault(),t=0;t<i.Headers.length;t++)(r=i.Headers[t],r.Id!==\"confirmation\")&&(r.Removed=!0);i.GetPage()});$('.jTable_headers-addAll[data-jtable-target=\"'+this.Table+'\"]').on(\"click\",function(n){var t,r;for(n.preventDefault(),t=0;t<i.Headers.length;t++)r=i.Headers[t],r.Removed=!1;i.GetPage()})}this.LastFullCheck=moment();this.SortingObject=new Sorting(this,null,u);this.FilterObject=new Filter(this,null,u);this.Options={};this.Average=!1;this.Graph=!1;this.Count=!1;this.Headers=[];this.Rows=[];this.Parent=\"New Table\";this.Name=\"New Table\";this.Description=\"\";this.Id=\"\";this.RecordsPerPage=250;this.TotalRecords=0;this.Sortings=[];this.Filters=[];this.Page=1;this.Filtered=!1;this.Sorted=!1;this.SavedId=null;this.Favorite=!1;this.FilteredRows=[];this.FilteredRecords=function(){return this.FilteredRows.length};this.TotalPages=function(){var n=Math.ceil(this.FilteredRows.length/this.RecordsPerPage);return n===0?1:n};this.OnGetComplete=function(){};this.GetPage=function(n,t){var r,o,p,a,w,u,v,s,l,b,e;for(typeof n==\"undefined\"&&(n=this.Table),/^\\./.test(n)||/^#/.test(n)||(n=\"#\"+n),typeof t==\"undefined\"&&(t=this.Page),this.Filtered||this.Filter(),this.Sorted||this.Sort(),t>this.TotalPages()&&t!==1&&(t=1),r=[],$(\".jTable_pageSelect\").html(i.FilteredRecords()),$(\".jTable_pageSelect\").html(\"\"),o=0;o<this.TotalPages();o++)$(\".jTable_pageSelect\").append('<option value=\"'+(o+1)+'\" '+(this.Page===o+1?'selected=\"selected\"':\"\")+\">\"+(o+1)+\"<\\/option>\");for(p=(t-1)*this.RecordsPerPage,a=[],this.Headers.sort(function(n,t){return n.Order-t.Order}),a=this.Count?this.GetCount(this,r):this.Average?this.GetAverage(this,r):this.Graph?this.GetGraph(this,r):this.GetNormal(this,p),w=this.GenerateTableHtml(this,a),$(n).html(w),u=0;u<r.length;u++){v=\"<ul class=\\\"<%=name.toLowerCase()%>-legend\\\"><% for (var i=0; i<segments.length; i++){%><li><span style=\\\"background-color:<%=segments[i].fillColor%>\\\"><\\/span><%if(segments[i].label){%><b><%=segments[i].label%><\\/b>: <%=+(Math.round(((segments[i].value / total) * 100) + 'e+2') + 'e-2')%>%<%}%><\\/li><%}%><\\/ul>\";this.Count&&(v='<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"><\\/span><%if(segments[i].label){%><b><%=segments[i].label%><\\/b>: <%=segments[i].value%><%}%><\\/li><%}%><\\/ul>');s={};l={};switch(r[u].type){case\"pie\":s=$(\"#\"+r[u].id).get(0).getContext(\"2d\");l=new Chart(s).Pie(r[u].data,{legendTemplate:v});b=l.generateLegend();$(\"#\"+r[u].id).parent().parent().children(\".legend\").html(b);break;case\"bar\":var k=10,y=100,f=100,h={},c=r[u].data;if(this.Count){for(e=0;e<c.datasets[0].data.length;e++)y<c.datasets[0].data[e]&&(y=c.datasets[0].data[e]),f>c.datasets[0].data[e]&&(f=c.datasets[0].data[e]);f=f-10-f%10;f<0&&(f=0)}else f=0;h.scaleOverride=!0;h.scaleSteps=Math.ceil((y-f)/k);h.scaleStepWidth=k;h.scaleStartValue=f;s=$(\"#\"+r[u].id).get(0).getContext(\"2d\");l=new Chart(s).Bar(r[u].data,h)}}this.CreateLinks();this.OnGetComplete(this)};this.CreateLinks=function(){$(this.Table).find(\"a\").each(function(){var t=$(this),i,r,f,o,e,u,n;if(t.attr(\"href\")===\"#\"&&(i=t.attr(\"data-action\"),r=t.attr(\"data-controller\"),typeof i==\"undefined\"&&(i=null),typeof r==\"undefined\"&&(r=null),f=t.attr(\"data-options\"),typeof f==\"undefined\"&&(f=\"{}\"),o=JSON.parse(f),i!==null&&r!==null)){for(e=window.location.origin+\"/\"+r+\"/\"+i+\"?\",u=Object.keys(o),n=0;n<u.length;n++)e+=u[n]+\"=\"+o[u[n]],n!==u.length-1&&(e+=\"&\");t.attr(\"href\",e)}})};this.AddSorting=function(n){n.Order=this.Sortings.length+1;this.Sortings.push(n);this.Sorted=!1};this.ClearSortings=function(){this.Sortings=[];this.Sorted=!1};this.ClearFilters=function(){this.Filters=[];this.Filtered=!1};this.AddFilter=function(n){n.Order=this.Filters.length+1;this.Filters.push(n);this.Filtered=!1};this.Filter=function(){var h,n,e,o,s,u;for(this.FilteredRows=[],this.Filters.sort(function(n,t){return n.Order-t.Order}),h=0;h<this.Rows.length;h++){var i=!1,c=!0,t=[],l=this.Rows[h];for(n=0;n<this.Filters.length;n++){var r=this.Filters[n],f=!0,a=!0;c=r.GroupNext;e=!1;do{for(r.GroupNext||(c=!1),o=null,s=0;s<l.Columns.length;s++)if(l.Columns[s].HeaderId===r.ActingOn){o=l.Columns[s];break}o!==null&&(e=TestValue(o,r.Value.toLowerCase(),r.Test,FindHeader(this,o.HeaderId)));switch(r.Link){case\"and\":f=f&&e;break;case\"or\":f=a?e:f||e;break;default:f=e}if(a=!1,!c)break;if(n++,n<this.Filters.length)r=this.Filters[n];else break}while(c);t.push({test:f,link:n<this.Filters.length-1?this.Filters[n+1].Link:\"none\"})}for(i=t.length>0?t[0].test:!0,u=1;u<t.length;u++)switch(t[u-1].link){case\"and\":i=i&&t[u].test;break;case\"or\":i=i||t[u].test;break;default:i=t[u].test}i&&this.FilteredRows.push(l)}this.Filters.length===0&&(this.FilteredRows=this.Rows);this.Page=1;this.Filtered=!0;this.Sort();$('.jTable_totalRecords[data-jtable-target=\"'+this.Table+'\"]').html(this.FilteredRows.length)};this.Sort=function(){var n,t;for(this.Filtered||this.Filter(),this.Sortings.length>0&&(this.Sortings.sort(function(n,t){return n.Order-t.Order}),n=this.Sortings,this.FilteredRows.sort(function(t,r){var u=0,h=0,c=FindHeader(i,n[u].ActingOn);if(c===null)return 1;var o=FindColumn(t,n[u].ActingOn),s=FindColumn(r,n[u].ActingOn),f=null,e=null;if(o!==null&&o.Value!==null&&(f=o.Value),s!==null&&s.Value!==null&&(e=s.Value),c.SortByPretty&&(f=o!=null?o.PrettyValue:null,e=s!=null?s.PrettyValue:null),f===null&&(f=\"\"),e===null&&(e=\"\"),h=c.Id===\"confirmation\"?advSorting.HexSort(f,e,n[u].Ascending):advSorting.NaturalSort(f,e,n[u].Ascending),h===0)for(u++;h===0;){if(u>=n.length)break;o=FindColumn(t,n[u].ActingOn);s=FindColumn(r,n[u].ActingOn);f=o.Value;e=s.Value;c.SortByPretty&&(f=o.PrettyValue,e=s.PrettyValue);f===null&&(f=\"\");e===null&&(e=\"\");h=c.Id===\"confirmation\"?advSorting.HexSort(f,e,n[u].Ascending):advSorting.NaturalSort(f,e,n[u].Ascending);u++}return h})),t=0;t<this.FilteredRows.length;t++)this.FilteredRows[t].Order=t+1;this.Sorted=!0};this.GetAverage=function(n,t){for(var c,p,e,l,w,h,it,b,et,k,a,y,o,rt,ct,ut=[],nt=new JTableRow,i=0;i<n.Headers.length;i++){if(n.Headers[i].Id===\"email\"){n.Headers[i].Hidden=!0;continue}else n.Headers[i].Hidden=!1;var r=new JTableColumn,tt=0,s=0,ft=!0,f={},u=[];for(c=0;c<n.Headers[i].PossibleValues.length;c++)f[n.Headers[i].PossibleValues[c].Label]=0,u.push({key:n.Headers[i].PossibleValues[c].Label,total:0});for(p=0;p<n.FilteredRows.length;p++)if(e=FindColumn(n.FilteredRows[p],n.Headers[i].Id),e!==null)switch(n.Headers[i].Type.root(\"=>\")){case\"itemParent\":typeof f[e.PrettyValue]==\"undefined\"&&(f[e.PrettyValue]=0,u.push({key:e.PrettyValue,total:0}));f[e.PrettyValue]++;s++;break;case\"multipleSelection\":for(l=JSON.parse(e.Value),w=[],h=0;h<l.length;h++){for(it=!1,b=0;b<w.length;b++)if(w[b]===l[h]){it=!0;break}if(it)continue;else w.push(l[h]);for(et=l[h],k=null,a=0;a<n.Headers[i].PossibleValues.length;a++)n.Headers[i].PossibleValues[a].Id===et&&(k=n.Headers[i].PossibleValues[a]);k!==null&&f[k.Label]++}s++;break;case\"boolean\":e.Value===\"1\"?f.Yes++:f.No++;s++;break;case\"number\":case\"rating\":tt+=parseFloat(e.Value);s++;break;default:ft=!1}if(ft){r.HeaderId=n.Headers[i].Id;r.Id=n.Headers[i].Id;r.Value=tt/s;r.PrettyValue=r.Value;var d=\"\",ot=[],st=[],ht=[],v=-1,g=\"<table><tbody>\";switch(n.Headers[i].Type.root(\"=>\")){case\"multipleSelection\":case\"itemParent\":case\"boolean\":for(y=0;y<u.length;y++)u[y].total=f[u[y].key];for(u.sort(function(n,t){return t.total-n.total}),o=0;o<u.length;o++)v++,rt=f[u[o].key]/s*100,v>4&&(v=0),ot.push({value:f[u[o].key],color:graphColors[v].color,highlight:graphColors[v].highlight,label:u[o].key}),ht.push(u[o].key),st.push(rt),g+='<tr><td style=\"text-align: right; padding-right: 3px; font-weight: bold;\">'+u[o].key+\":<\\/td><td>\"+rt.toFixed(2)+\"%<\\/td><\\/tr>\";g+=\"<\\/tbody><\\/table>\";r.Value=g;d=g;n.Graph&&(n.Headers[i].Type===\"multipleSelection\"?(ct={labels:ht,datasets:[{label:\"Selections\",fillColor:\"rgba(220,220,220,0.5)\",strokeColor:\"rgba(220,220,220,0.8)\",highlightFill:\"rgba(220,220,220,0.75)\",highlightStroke:\"rgba(220,220,220,1)\",data:st}]},d='<div class=\"labeled-chart-container\"><div class=\"canvas-holder\"><canvas id=\"chart_'+r.Id+'\" width=\"300\" height=\"300\"><\\/canvas><\\/div><div class=\"legend\"><\\/div><\\/div>',t.push({id:\"chart_\"+r.Id,data:ct,type:\"bar\"})):(d='<div class=\"labeled-chart-container\"><div class=\"canvas-holder\"><canvas id=\"chart_'+r.Id+'\" width=\"500\" height=\"300\"><\\/canvas><\\/div><div class=\"legend\"><\\/div><\\/div>',t.push({id:\"chart_\"+r.Id,data:ot,type:\"pie\"})));r.PrettyValue=d;nt.Columns.push(r);break;case\"number\":case\"rating\":r.Value=Math.roundAdv(tt/s,2);r.PrettyValue=r.Value;nt.Columns.push(r);break;default:n.Headers[i].Hidden=!0}}else n.Headers[i].Hidden=!0}return ut.push(nt),ut};this.GetGraph=function(n,t){return this.GetAverage(n,t)};this.GetCount=function(n,t){for(var c,b,k,l,d,s,e,a,g,h,ft,nt,ht,tt,v,p,o,vt,et=[],ut=new JTableRow,i=0;i<n.Headers.length;i++){if(n.Headers[i].Id===\"email\"){n.Headers[i].Hidden=!0;continue}else n.Headers[i].Hidden=!1;var u=new JTableColumn,ot=0,w=0,st=!0,f={},r=[];for(c=0;c<n.Headers[i].PossibleValues.length;c++)f[n.Headers[i].PossibleValues[c].Label]=0,r.push({key:n.Headers[i].PossibleValues[c].Label,total:0});if(n.Headers[i].Type.root(\"=>\")===\"rating\")for(b=n.Headers[i].Type,b=b.split(\"=>\")[1],k=JSON.parse(b),l=k.min;l<k.max;l+=k.step)f[l.toString()]=0,r.push({key:l.toString(),total:0});for(d=0;d<n.FilteredRows.length;d++)if(s=FindColumn(n.FilteredRows[d],n.Headers[i].Id),s!==null)switch(n.Headers[i].Type.root(\"=>\")){case\"itemParent\":case\"rating\":e=s.PrettyValue;e=e.replace(/(<[^>]*>[^<]*<[^>]*>)/g,\"\");e=e.trim();typeof f[e]==\"undefined\"&&(f[e]=0,r.push({key:e,total:0}));f[e]++;w++;break;case\"multipleSelection\":for(a=JSON.parse(s.Value),g=[],h=0;h<a.length;h++){for(ft=!1,nt=0;nt<g.length;nt++)if(g[nt]===a[h]){ft=!0;break}if(ft)continue;else g.push(a[h]);for(ht=a[h],tt=null,v=0;v<n.Headers[i].PossibleValues.length;v++)n.Headers[i].PossibleValues[v].Id===ht&&(tt=n.Headers[i].PossibleValues[v]);tt!==null&&f[tt.Label]++}w++;break;case\"boolean\":s.Value===\"1\"?f.Yes++:f.No++;w++;break;case\"number\":ot+=parseFloat(s.Value);w++;break;default:st=!1}if(st){u.HeaderId=n.Headers[i].Id;u.Id=n.Headers[i].Id;u.Value=ot;u.PrettyValue=u.Value;var it=\"\",ct=[],lt=[],at=[],y=-1,rt=\"<table><tbody>\";switch(n.Headers[i].Type.root(\"=>\")){case\"multipleSelection\":case\"itemParent\":case\"rating\":case\"boolean\":for(p=0;p<r.length;p++)r[p].total=f[r[p].key];for(n.Headers[i].Type.root(\"=>\")!==\"rating\"&&r.sort(function(n,t){return t.total-n.total}),o=0;o<r.length;o++)y++,y>4&&(y=0),ct.push({value:f[r[o].key],color:graphColors[y].color,highlight:graphColors[y].highlight,label:r[o].key}),at.push(r[o].key),lt.push(f[r[o].key]),rt+='<tr><td style=\"text-align: right; padding-right: 3px; font-weight: bold;\">'+r[o].key+\":<\\/td><td>\"+f[r[o].key]+\"<\\/td><\\/tr>\";rt+=\"<\\/tbody><\\/table>\";u.Value=rt;it=rt;n.Graph&&(n.Headers[i].Type===\"multipleSelection\"?(vt={labels:at,datasets:[{label:\"Selections\",fillColor:\"rgba(220,220,220,0.5)\",strokeColor:\"rgba(220,220,220,0.8)\",highlightFill:\"rgba(220,220,220,0.75)\",highlightStroke:\"rgba(220,220,220,1)\",data:lt}]},it='<div class=\"labeled-chart-container\"><div class=\"canvas-holder\"><canvas id=\"chart_'+u.Id+'\" width=\"300\" height=\"300\"><\\/canvas><\\/div><div class=\"legend\"><\\/div><\\/div>',t.push({id:\"chart_\"+u.Id,data:vt,type:\"bar\"})):(it='<div class=\"labeled-chart-container\"><div class=\"canvas-holder\"><canvas id=\"chart_'+u.Id+'\" width=\"500\" height=\"300\"><\\/canvas><\\/div><div class=\"legend\"><\\/div><\\/div>',t.push({id:\"chart_\"+u.Id,data:ct,type:\"pie\"})));u.PrettyValue=it;ut.Columns.push(u);break;case\"number\":ut.Columns.push(u);break;default:n.Headers[i].Hidden=!0}}else n.Headers[i].Hidden=!0}return et.push(ut),et};this.GetNormal=function(n,t){for(var r=[],u=0,i=t;i<n.FilteredRows.length;i++)if(r.push(n.FilteredRows[i]),u++,u>=n.RecordsPerPage)break;return r};this.UpdateRow=function(n,t,i){var r,o,u,f,e;if((!(n.Average||n.Graph||n.Count)||!n.Headers[u].Hidden)&&(r=$(\"#\"+t.Id),r.length!==0)){for(typeof i!=\"boolean\"&&(i=!1),(this.Options.type===\"email\"||this.Options.type===\"invitation\")&&(i=!0),o=r.css(\"background-color\"),i||r.css(\"background-color\",\"rgba(122,2,2,.5)\"),u=0;u<n.Headers.length;u++)(f=r.find('td[data-headerid=\"'+n.Headers[u].Id+'\"]'),f.length!==0)&&(e=FindColumn(t,n.Headers[u].Id),typeof e!=\"undefined\"&&e!==null?f.html(e.PrettyValue):f.html(\"\"));this.CreateLinks();this.OnUpdateComplete(r);i||setTimeout(function(){r.animate({backgroundColor:o},1e3,function(){r.css(\"background-color\",\"\")})},5e3)}};this.OnUpdateComplete=function(){};this.GenerateTableHtml=function(n,t){var r,u,f,h,i,o,s,e;for($('.jTable_parentName[data-jtable-target=\"'+this.Table+'\"]').html(this.Parent),$('.jTable_name[data-jtable-target=\"'+this.Table+'\"]').html(this.Name),r=\"<thead><tr>\",u=0;u<n.Headers.length;u++)(n.Average||n.Graph||n.Count)&&n.Headers[u].Hidden||n.Headers[u].Removed||(f=n.Headers[u].Group,f=typeof f!=\"undefined\"&&f!==null&&f!==\"\"?\"<i>\"+f+\"<\\/i><br />\":\"\",r+='<th class=\"\" data-header-id=\"'+n.Headers[u].Id+'\">'+f+n.Headers[u].Label+\"<\\/th>\");for(r+=\"<\\/tr><\\/thead><tbody>\",h=0;h<t.length;h++){for(r+='<tr id=\"'+t[h].Id+'\">',i=0;i<n.Headers.length;i++)(n.Average||n.Graph||n.Count)&&n.Headers[i].Hidden||n.Headers[i].Removed||(o=n.Headers[i].Editable,(n.Average||n.Graph||n.Count)&&(o=!1),s=FindColumn(t[h],n.Headers[i].Id),typeof s!=\"undefined\"&&s!==null?(o=o||s.Editable,e=s.PrettyValue,!this.Graph&&!this.Count&&!this.Average&&e!==null&&e.indexOf(\"<a\")===-1&&e.length>100&&(e=e.substr(0,100)+\"...\"),r+='<td data-headerid=\"'+n.Headers[i].Id+'\" id=\"'+s.Id+'\" class=\"'+(o?\"editable-item cursor-pointer\":\"\")+'\">'+e+\"<\\/td>\"):r+='<td data-headerid=\"'+n.Headers[i].Id+'\" class=\"'+(o?\"editable-item cursor-pointer\":\"\")+'\"><\\/td>');r+=\"<\\/tr>\"}return r+\"<\\/tbody>\"};this.GetPrintView=function(n){var i,r,t,u;if(this.Filtered||this.Filter(),this.Sorted||this.Sort(),i=[],this.Count)i=this.GetCount(this,n);else if(this.Average)i=this.GetAverage(this,n);else if(this.Graph)i=this.GetGraph(this,n);else for(r=0;r<this.FilteredRows.length;r++)i.push(this.FilteredRows[r]);return t='<html><head><title>\"'+this.Name+'\"<\\/title><script src=\"'+window.location.origin+'/Scripts/jquery-2.1.3.min.js\"><\\/script><script src=\"'+window.location.origin+'/Scripts/Chartv2.js\"><\\/script><link href=\"'+window.location.origin+'/Content/Bootstrap/bootstrap.min.css\" rel=\"stylesheet\" />',t+=\"<style> \",t+=\".body { color: #3e3e3e; } \",t+=\".report-header { position: fixed; left: 0; top: 0; width: 100%; height: 100px; overflow: hidden; padding: 10px 10px 0 10px; background: white; } \",t+=\"img.img-report-header { display: block; width: 100%; max-width: 250px; max-height: 75px; } \",t+=\".report-title { text-align: right; } \",t+=\".report-content { padding-top: 100px; } \",t+=\"table.table-full-page > thead > tr { border-top: 1px solid #ddd; } \",t+=\"table.table-full-page > thead > tr > th { padding-right: 50px !important; white-space: nowrap; min-width: 150px; background: white; font-size: 12px; } \",t+=\"table.table-full-page > tbody > tr { height: 75px; font-size: 12px; } \",t+=\"table.table-full-page > tbody > tr:last-child { border-bottom: 1px solid #ddd; } \",t+=\"table.table-full-page > tbody > tr:nth-child(even) > td { background: white; } \",t+=\"table.table-full-page td { padding: 0 0 0 0 !important; } \",t+=\".cell-height { height: 75px; padding: 5px; overflow-y: auto; } \",t+=\"@media screen and (max-width: 1199px) { .report-header { position: relative; height: auto; overflow: visible; } \",t+=\".report-title { text-align: left; padding-top: 15px; } \",t+=\".report-content { padding-top: 15px; } \",t+=\"table.table-full-page > tbody > tr { height: auto; font-size: 12px; } \",t+=\".cell-height { height: auto; max-height: 50px; padding: 5px; overflow-y: auto; } } \",t+=\"<\\/style>\",t+=\"<\\/head><body>\",t+='<div class=\"report-header\"><div class=\"row\"><div class=\"col-lg-3\"><img class=\"img-report-header\" src=\"https://toolkit.regstep.com/Images/Common/regstep.png\"/><\\/div>',t+='<div class=\"col-lg-9 report-title\">'+(typeof this.Parent!=\"undefined\"&&this.Parent!==null&&this.Parent!==\"\"?\"<h3>\"+this.Parent+\"<\\/h3>\":\"\")+\"<h4>\"+this.Name+\"<\\/h4>\"+(typeof this.Description!=\"undefined\"&&this.Description!==null&&this.Description!==\"\"?\"<h5>\"+this.Description+\"<\\/h5>\":\"\")+'<\\/div><\\/div><\\/div><div class=\"report-content\">',t+='<table class=\"table table-striped table-full-page\">',t+=this.GenerateTableHtml(this,i),t+='<\\/table><script type=\"text/javascript\">\\r\\n',t+=\"//Render Charts\\r\\nChart.defaults.global.animation = false;\\r\\nchartData = \"+JSON.stringify(n)+\"\\r\\nfor (var i = 0; i < chartData.length; i++) {\\r\\n\"+' var template = \"<ul class=\\\\\"<%=name.toLowerCase()%>-legend\\\\\"><% for (var i=0; i<segments.length; i++){%><li><span style=\\\\\"background-color:<%=segments[i].fillColor%>\\\\\"><\\/span><%if(segments[i].label){%><b><%=segments[i].label%><\\/b>: <%=+(Math.round(((segments[i].value / total) * 100) + \\'e+2\\') + \\'e-2\\')%>%<%}%><\\/li><%}%><\\/ul>\";\\r\\n'+\" if (this.Count) {\\r\\n\"+' var template = \"<ul class=\\\\\"<%=name.toLowerCase()%>-legend\\\\\"><% for (var i=0; i<segments.length; i++){%><li><span style=\\\\\"background-color:<%=segments[i].fillColor%>\\\\\"><\\/span><%if(segments[i].label){%><b><%=segments[i].label%><\\/b>: <%=segments[i].value%><%}%><\\/li><%}%><\\/ul>\";\\r\\n'+\" }\\r\\n switch (chartData[i].type) {\\r\\n case 'pie':\\r\\n var ctx = $('#' + chartData[i].id).get(0).getContext('2d');\\r\\n var chart = new Chart(ctx).Pie(chartData[i].data, {\\r\\n legendTemplate: template\\r\\n });\\r\\n var legend = chart.generateLegend();\\r\\n $('#' + chartData[i].id).parent().parent().children('.legend').html(legend);\\r\\n break;\\r\\n case 'bar':\\r\\n var step = 10;\\r\\n var max = 100;\\r\\n var start = 100;\\r\\n var options = {};\\r\\n var data = chartData[i].data;\\r\\n if (this.Count) {\\r\\n for (var j = 0; j < data.datasets[0].data.length; j++) {\\r\\n if (max < data.datasets[0].data[j]) {\\r\\n max = data.datasets[0].data[j];\\r\\n }\\r\\n if (start > data.datasets[0].data[j]) {\\r\\n start = data.datasets[0].data[j];\\r\\n }\\r\\n }\\r\\n start = (start - 10) - (start % 10);\\r\\n if (start < 0) {\\r\\n start = 0;\\r\\n }\\r\\n } else {\\r\\n start = 0;\\r\\n }\\r\\n options.scaleOverride = true;\\r\\n options.scaleSteps = Math.ceil((max - start) / step);\\r\\n options.scaleStepWidth = step;\\r\\n options.scaleStartValue = start;\\r\\n var ctx = $('#' + chartData[i].id).get(0).getContext('2d');\\r\\n var chart = new Chart(ctx).Bar(chartData[i].data, options);\\r\\n break;\\r\\n }\\r\\n}\\r\\nsetInterval(function () { window.print(); }, 500);\",t+=\"<\\/script><\\/body><\\/html>\",u=window.open(\"about:blank\",\"\",\"_blank\"),u.document.write(t),t};this.Load=function(n,t){var f,u,r;t===null&&(t={});f=\"jTable: \";u=\"\";typeof t.id!=\"undefined\"&&t.id!==null&&(u+=\"?id=\"+t.id,f+=t.id);typeof t.type!=\"undefined\"&&t.type!==null&&t.type!==\"\"&&(u+=\"&type=\"+t.type,f+=\"_\"+t.type);r=new XMLHttpRequest;r.addEventListener(\"progress\",this.UpdateProgress,!1);n+=u;r.open(\"get\",n,!0);RESTFUL.ajaxHeader(r);r.onload=function(n){var u=n.currentTarget,r,t;u.status===200?(r=RESTFUL.parse(u),t=r.Table,r.Success?(i.Filters=t.Filters,i.Sortings=t.Sortings,i.Rows=t.Rows,i.Count=t.Count,i.Graph=t.Graph,i.Average=t.Average,i.Description=t.Description,i.Name=t.Name,i.Parent=t.Parent,i.Favorite=t.Favorite,i.Headers=t.Headers,i.Id=t.Id,i.Options=t.Options,i.Page=1,i.RecordsPerPage=t.RecordsPerPage,i.TotalRecords=t.TotalRecords,i.SavedId=t.SavedId,i.LastFullCheck=moment(),i.UpdateView(i),i.AfterLoad(i),i.Filter(),i.GetPage(),i.SavedId!==null?$(\".jTable_standardOnly\").hide():$(\".jTable_standardOnly\").show()):RESTFUL.showError(\"Failed to load data.\",\"Unhandled Exception\")):RESTFUL.showError(\"Failed to load data.\",\"Unhandled Exception\");prettyProcessing.hidePleaseWait()};r.onerror=function(){RESTFUL.showError();prettyProcessing.hidePleaseWait()};prettyProcessing.showPleaseWait(\"Requesting Data\",\"Requesting data from the server.\");r.send()};this.UpdateProgress=function(n){if(n.lengthComputable){var t=n.loaded/n.total*100;prettyProcessing.update(\"Downloading Data\",\"Downloading the data from the server.\",t)}else prettyProcessing.update(\"Downloading Data\",\"Downloading the data from the server.\",100)};this.AfterLoad=function(n){typeof BREADCRUMB_VERSION!=\"undefined\"&&BREADCRUMB_CURRENT!==null&&(BREADCRUMB_CURRENT.Label=n.Name+\" on \"+n.Parent,UpdateCrumb(BREADCRUMB_CURRENT))};this.UpdateView=function(){$('.jTable_parentName[data-jtable-target=\"'+this.Table+'\"]').html(this.Parent);$('.jTable_name[data-jtable-target=\"'+this.Table+'\"]').html(this.Name);$('.jTable_recordsPerPage[data-jtable-target=\"'+this.Table+'\"]').val(this.RecordsPerPage);$('.jTable_pageSelect[data-jtable-target=\"'+this.Table+'\"]').html(\"\");this.Filter();this.Sort();for(var n=0;n<this.TotalPages();n++)$('.jTable_pageSelect[data-jtable-target=\"'+this.Table+'\"]').append('<option value=\"'+(n+1)+'\" '+(this.Page===n+1?'selected=\"selected\"':\"\")+\">\"+(n+1)+\"<\\/option>\");$('.jTable_pageSelect[data-jtable-target=\"'+this.Table+'\"] > option').prop(\"selected\",!1);$('.jTable_pageSelect[data-jtable-target=\"'+this.Table+'\"] > option[value=\"'+this.Page+'\"]').prop(\"selected\",!0);this.SavedId===null||this.SavedId===\"\"||typeof this.SavedId==\"undefined\"?$('.jTable_standarOnly[data-jtable-target=\"'+this.Table+'\"]').show():$('.jTable_standardOnly[data-jtable-target=\"'+this.Table+'\"]').hide();this.Favorite?$('.jTable_favorite[data-jtable-target=\"'+this.Table+'\"]').html('<span class=\"glyphicon glyphicon-star glyphicon-small\"><\\/span> Un-Favorite'):$('.jTable_favorite[data-jtable-target=\"'+this.Table+'\"]').html('<span class=\"glyphicon glyphicon-star-empty glyphicon-small\"><\\/span> Favorite');this.SortingObject.Generate();this.FilterObject.Generate()};this.GetAjaxData=function(){var n={};return n.FilteredRows=[],n.Rows=[],n.Filters=this.Filters,n.Sortings=this.Sortings,n.Id=this.Id,n.SavedId=this.SavedId,n.Count=this.Count,n.Graph=this.Graph,n.Average=this.Average,n.Name=this.Name,n.Description=this.Description,n.Options=this.Options,n.Headers=this.Headers,n.Favorite=this.Favorite,n.Parent=this.Parent,n}}", "_getHeaderLabelDimensions() {\n const that = this;\n\n if (!that._dragDetails || !that._dragDetails.hoveredTabsWindow) {\n return;\n }\n\n const tabsElement = that._dragDetails.hoveredTabsWindow.$.tabsElement,\n isTabPositionVertical = tabsElement.tabPosition === 'left' || tabsElement.tabPosition === 'right';\n\n let lastTabItemOffsetLeft = 0,\n lastTabItemOffsetTop = 0,\n width, height;\n\n //Tab header item\n if (that._dragDetails.hoveredTabArea) {\n width = that._dragDetails.hoveredTabArea.offsetWidth;\n height = that._dragDetails.hoveredTabArea.offsetHeight;\n lastTabItemOffsetLeft = that._dragDetails.hoveredTabArea.offsetLeft;\n lastTabItemOffsetTop = that._dragDetails.hoveredTabArea.offsetTop;\n }\n else {\n if (tabsElement.$.tabStrip.children.length > 0) {\n const lastTabItem = tabsElement.$.tabStrip.children[tabsElement.$.tabStrip.children.length - 1];\n\n lastTabItemOffsetLeft = lastTabItem.offsetLeft + (!isTabPositionVertical ? lastTabItem.offsetWidth : 0);\n lastTabItemOffsetTop = lastTabItem.offsetTop + (isTabPositionVertical ? lastTabItem.offsetHeight : 0);\n width = lastTabItem.offsetWidth;\n height = lastTabItem.offsetHeight;\n }\n }\n\n //In case no item is hovered, use the whole tabHeaderSection offsets\n that._dragDetails.hoveredTabArea = tabsElement.$.tabsHeaderSection;\n\n let nearTabStripScrollButtonOffsetLeft = 0,\n nearTabStripScrollButtonOffsetTop = 0;\n\n if (tabsElement.tabTextOrientation === 'horizontal') {\n nearTabStripScrollButtonOffsetLeft = tabsElement.$.scrollButtonNear.offsetWidth;\n }\n else {\n nearTabStripScrollButtonOffsetTop = tabsElement.$.scrollButtonNear.offsetHeight;\n }\n\n const hoveredAreaRect = that._dragDetails.hoveredTabArea.getBoundingClientRect(),\n tabStrip = that._dragDetails.hoveredTabsWindow.$.tabsElement.$.tabStrip,\n tabStripRect = tabStrip.getBoundingClientRect(),\n left = (tabStripRect.left - hoveredAreaRect.left) + hoveredAreaRect.left + lastTabItemOffsetLeft - tabStrip.scrollLeft - nearTabStripScrollButtonOffsetLeft,\n top = (tabStripRect.top - hoveredAreaRect.top) + hoveredAreaRect.top + lastTabItemOffsetTop - tabStrip.scrollTop - nearTabStripScrollButtonOffsetTop,\n leftHiddenSize = Math.min(lastTabItemOffsetLeft - tabStrip.scrollLeft - nearTabStripScrollButtonOffsetLeft, 0),\n topHiddenSize = Math.min(lastTabItemOffsetTop - tabStrip.scrollTop - nearTabStripScrollButtonOffsetTop, 0);\n\n return {\n width: Math.min(tabStripRect.width, Math.max(0, width + leftHiddenSize), Math.max(0, tabStripRect.left + tabStripRect.width - left)),\n height: Math.min(tabStripRect.height, Math.max(0, height + topHiddenSize), Math.max(0, tabStripRect.top + tabStripRect.height - top)),\n top: top + window.pageYOffset - topHiddenSize,\n left: left + window.pageXOffset - leftHiddenSize\n };\n }", "get header(){return dom(this.$.headerSlot).getDistributedNodes()[0];}", "function showTopHeaders() {\n var headerRow = document.createElement('TR');\n headerRow.innerHTML = '<th>' + name + '</th>';\n \n var firstKey = Object.keys(primary)[0];\n if (primary[firstKey]) {\n for (var header in primary[firstKey]) {\n if (primary[firstKey].hasOwnProperty(header)) {\n var newHeader = document.createElement('TH');\n newHeader.innerHTML = header;\n headerRow.appendChild(newHeader);\n }\n }\n }\n this.dom.appendChild(headerRow);\n }", "makeTableHeader() {\n var cells = [];\n\n // Make an empty column for the row header\n cells.push(<Cell key={'col'+0} isHeader={true}/>);\n\n for (var i = 1; i <= 9; i++) {\n cells.push(<Cell key={'col'+i} isHeader={true} colId={i} mouseLoc={this.state.highlight} onMouseEnterCell={this.onMouseEnterCell.bind(this)} onMouseLeaveCell={this.onMouseLeaveCell.bind(this)}/>);\n }\n\n return (\n <thead>\n <tr>{cells}</tr>\n </thead>\n );\n }", "function UltraGrid_InitialiseResize(header)\n{\n\t//at initialisation we need to build its data\n\tvar headerData =\n\t{\n\t\tInitialSize: header.Rect.width,\n\t\tHeadersToMove: [],\n\t\tCellsToResize: [],\n\t\tCellToMove: [],\n\t\tLinesToMove: []\n\t};\n\t//retrieve our object\n\tvar theObject = header.UltraGrid;\n\t//get our panel\n\tvar ourPanel = header.Panel;\n\t//calculate our header positions\n\tvar nLeft = ourPanel.Left + header.Rect.left;\n\tvar nRight = ourPanel.Left + header.Rect.right;\n\n\t//panels being resized (we use this for the grid lines)\n\tvar panelsMap = {};\n\tvar panelsList = [];\n\t//add our\n\tpanelsMap[ourPanel.Id] = true;\n\tpanelsList.push(ourPanel);\n\t//we only resize the gridlines based on the header's position\n\tvar verticalLineMove = nRight;\n\n\t//loop through all headers\n\tfor (var cells = theObject.Data.Headers.Cells, iCell = 0, cCell = cells.length; iCell < cCell; iCell++)\n\t{\n\t\t//get the header cell\n\t\tvar cell = cells[iCell];\n\t\t//ignore our header\n\t\tif (cell.UltraGridId != header.UltraGridId)\n\t\t{\n\t\t\t//check the panel\n\t\t\tvar theirPanel = cell.Panel;\n\t\t\t//it has to be the same panel or underneath/above ours\n\t\t\tif (theirPanel.Id == ourPanel.Id || (nLeft < (theirPanel.Left + theirPanel.Width) && nRight > theirPanel.Left))\n\t\t\t{\n\t\t\t\t//is this header to our right?\n\t\t\t\tif (cell.Rect.left + cell.Panel.Left >= nRight)\n\t\t\t\t{\n\t\t\t\t\t//this is a moveable header\n\t\t\t\t\theaderData.HeadersToMove.push(cell);\n\t\t\t\t}\n\t\t\t\t//if we havent added this panel yet\n\t\t\t\tif (!panelsMap[theirPanel.Id])\n\t\t\t\t{\n\t\t\t\t\t//add it\n\t\t\t\t\tpanelsMap[theirPanel.Id] = true;\n\t\t\t\t\tpanelsList.push(theirPanel);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//get the ultragrid resizeable data\n\tvar resizeData = theObject.Data.HeaderResizesCells[header.UltraGridId];\n\n\t//lets go through all cells\n\tfor (var resizeCells = resizeData.Cells, iResizeCell = 0, cResizeCell = resizeCells.length; iResizeCell < cResizeCell; iResizeCell++)\n\t{\n\t\t//get this cell\n\t\tvar resizeCell = resizeCells[iResizeCell];\n\n\t\t//store this a cell to resize\n\t\theaderData.CellsToResize.push(resizeCell);\n\t\t//check the panel\n\t\tourPanel = resizeCell.Panel;\n\t\t//if we havent added this panel yet\n\t\tif (!panelsMap[ourPanel.Id])\n\t\t{\n\t\t\t//add it\n\t\t\tpanelsMap[ourPanel.Id] = true;\n\t\t\tpanelsList.push(ourPanel);\n\t\t}\n\t\t//calculate this cell right\n\t\tnRight = ourPanel.Left + resizeCell.Rect.right;\n\t\t//get the row\n\t\tvar row = resizeCell.Row;\n\t\t//loop through all headers\n\t\tfor (var cells = row.Columns, iCell = 0, cCell = cells.length; iCell < cCell; iCell++)\n\t\t{\n\t\t\t//get the cell cell\n\t\t\tvar cell = cells[iCell];\n\t\t\t//ignore our resizeCell\n\t\t\tif (cell.UltraGridId != resizeCell.UltraGridId)\n\t\t\t{\n\t\t\t\t//check the panel\n\t\t\t\tvar theirPanel = cell.Panel;\n\t\t\t\t//it has to be the same panel (doesnt make any sense if its up or below.. it would be a different row? nyet?)\n\t\t\t\tif (theirPanel.Id == ourPanel.Id)\n\t\t\t\t{\n\t\t\t\t\t//is this header to our right?\n\t\t\t\t\tif (cell.Rect.left + cell.Panel.Left >= nRight)\n\t\t\t\t\t{\n\t\t\t\t\t\t//this is a moveable cell (its ok if this happens more than once in the same cell)\n\t\t\t\t\t\theaderData.CellToMove.push(cell);\n\t\t\t\t\t}\n\t\t\t\t\t//if we havent added this panel yet\n\t\t\t\t\tif (!panelsMap[theirPanel.Id])\n\t\t\t\t\t{\n\t\t\t\t\t\t//add it\n\t\t\t\t\t\tpanelsMap[theirPanel.Id] = true;\n\t\t\t\t\t\tpanelsList.push(theirPanel);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//now loop through all panels\n\tfor (var iPanel = 0, cPanel = panelsList.length; iPanel < cPanel; iPanel++)\n\t{\n\t\t//get the panel\n\t\tvar panel = panelsList[iPanel];\t\t\n\t\t//has vertical lines?\n\t\tif (panel.GridLines && panel.GridLines.Vertical)\n\t\t{\n\t\t\t//loop through all vertical lines\n\t\t\tfor (var lines = panel.GridLines.Vertical.Lines, iLine = 0, cLine = lines.length; iLine < cLine; iLine++)\n\t\t\t{\n\t\t\t\t//is this to our right?\n\t\t\t\tif (panel.Left + lines[iLine].Left >= verticalLineMove)\n\t\t\t\t{\n\t\t\t\t\t//move this one\n\t\t\t\t\theaderData.LinesToMove.push(lines[iLine]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//store it in the header\n\theader.ResizeData = headerData;\n\t//update last resize\n\ttheObject.Data.LastHeaderResize = new Date();\n}", "resizeFixed(){\n this.requestTick(TableFloatingHeader._resizeCallback.bind(this))\n }", "renderHeader(type, discipline, course, date, teacher, std_name, std_num) {\n var header = [\n { text: 'Exame ' + type, style: ['header', {alignment:'center'}] },\n { style: 'header_table',\n table: {\n widths: [ 'auto', '*' ],\n body: [\n [ \n { text: [ { text: 'Disciplina: ', bold:true }, discipline ] }, \n { text: [ { text: 'Curso: ', bold:true }, course ] },\n ],\n [ \n { text: [ { text: 'Data: ', bold:true }, date ] }, \n { text: [ { text: 'Professor: ', bold:true }, teacher ] },\n ],\n [ \n { text: [ { text: 'Aluno: ', bold:true }, std_name ] }, \n { text: [ { text: 'Numero: ', bold:true }, std_num] },\n ]\n\t\t\t\t\t]\n\t\t\t\t},\n layout: 'noBorders'\n\t\t\t}, \n ]\n return header;\n }", "function _fnDrawHead( oSettings, aoSource, bIncludeHidden )\n {\n var i, iLen, j, jLen, k, kLen;\n var aoLocal = [];\n var aApplied = [];\n var iColumns = oSettings.aoColumns.length;\n var iRowspan, iColspan;\n\n if ( typeof bIncludeHidden == 'undefined' )\n {\n bIncludeHidden = false;\n }\n\n /* Make a copy of the master layout array, but without the visible columns in it */\n for ( i=0, iLen=aoSource.length ; i<iLen ; i++ )\n {\n aoLocal[i] = aoSource[i].slice();\n aoLocal[i].nTr = aoSource[i].nTr;\n\n /* Remove any columns which are currently hidden */\n for ( j=iColumns-1 ; j>=0 ; j-- )\n {\n if ( !oSettings.aoColumns[j].bVisible && !bIncludeHidden )\n {\n aoLocal[i].splice( j, 1 );\n }\n }\n\n /* Prep the applied array - it needs an element for each row */\n aApplied.push( [] );\n }\n\n for ( i=0, iLen=aoLocal.length ; i<iLen ; i++ )\n {\n /* All cells are going to be replaced, so empty out the row */\n if ( aoLocal[i].nTr )\n {\n for ( k=0, kLen=aoLocal[i].nTr.childNodes.length ; k<kLen ; k++ )\n {\n aoLocal[i].nTr.removeChild( aoLocal[i].nTr.childNodes[0] );\n }\n }\n\n for ( j=0, jLen=aoLocal[i].length ; j<jLen ; j++ )\n {\n iRowspan = 1;\n iColspan = 1;\n\n /* Check to see if there is already a cell (row/colspan) covering our target\n * insert point. If there is, then there is nothing to do.\n */\n if ( typeof aApplied[i][j] == 'undefined' )\n {\n aoLocal[i].nTr.appendChild( aoLocal[i][j].cell );\n aApplied[i][j] = 1;\n\n /* Expand the cell to cover as many rows as needed */\n while ( typeof aoLocal[i+iRowspan] != 'undefined' &&\n aoLocal[i][j].cell == aoLocal[i+iRowspan][j].cell )\n {\n aApplied[i+iRowspan][j] = 1;\n iRowspan++;\n }\n\n /* Expand the cell to cover as many columns as needed */\n while ( typeof aoLocal[i][j+iColspan] != 'undefined' &&\n aoLocal[i][j].cell == aoLocal[i][j+iColspan].cell )\n {\n /* Must update the applied array over the rows for the columns */\n for ( k=0 ; k<iRowspan ; k++ )\n {\n aApplied[i+k][j+iColspan] = 1;\n }\n iColspan++;\n }\n\n /* Do the actual expansion in the DOM */\n aoLocal[i][j].cell.setAttribute('rowspan', iRowspan);\n aoLocal[i][j].cell.setAttribute('colspan', iColspan);\n }\n }\n }\n }", "function _fnDrawHead( oSettings, aoSource, bIncludeHidden )\n {\n var i, iLen, j, jLen, k, kLen;\n var aoLocal = [];\n var aApplied = [];\n var iColumns = oSettings.aoColumns.length;\n var iRowspan, iColspan;\n\n if ( typeof bIncludeHidden == 'undefined' )\n {\n bIncludeHidden = false;\n }\n\n /* Make a copy of the master layout array, but without the visible columns in it */\n for ( i=0, iLen=aoSource.length ; i<iLen ; i++ )\n {\n aoLocal[i] = aoSource[i].slice();\n aoLocal[i].nTr = aoSource[i].nTr;\n\n /* Remove any columns which are currently hidden */\n for ( j=iColumns-1 ; j>=0 ; j-- )\n {\n if ( !oSettings.aoColumns[j].bVisible && !bIncludeHidden )\n {\n aoLocal[i].splice( j, 1 );\n }\n }\n\n /* Prep the applied array - it needs an element for each row */\n aApplied.push( [] );\n }\n\n for ( i=0, iLen=aoLocal.length ; i<iLen ; i++ )\n {\n /* All cells are going to be replaced, so empty out the row */\n if ( aoLocal[i].nTr )\n {\n for ( k=0, kLen=aoLocal[i].nTr.childNodes.length ; k<kLen ; k++ )\n {\n aoLocal[i].nTr.removeChild( aoLocal[i].nTr.childNodes[0] );\n }\n }\n\n for ( j=0, jLen=aoLocal[i].length ; j<jLen ; j++ )\n {\n iRowspan = 1;\n iColspan = 1;\n\n /* Check to see if there is already a cell (row/colspan) covering our target\n * insert point. If there is, then there is nothing to do.\n */\n if ( typeof aApplied[i][j] == 'undefined' )\n {\n aoLocal[i].nTr.appendChild( aoLocal[i][j].cell );\n aApplied[i][j] = 1;\n\n /* Expand the cell to cover as many rows as needed */\n while ( typeof aoLocal[i+iRowspan] != 'undefined' &&\n aoLocal[i][j].cell == aoLocal[i+iRowspan][j].cell )\n {\n aApplied[i+iRowspan][j] = 1;\n iRowspan++;\n }\n\n /* Expand the cell to cover as many columns as needed */\n while ( typeof aoLocal[i][j+iColspan] != 'undefined' &&\n aoLocal[i][j].cell == aoLocal[i][j+iColspan].cell )\n {\n /* Must update the applied array over the rows for the columns */\n for ( k=0 ; k<iRowspan ; k++ )\n {\n aApplied[i+k][j+iColspan] = 1;\n }\n iColspan++;\n }\n\n /* Do the actual expansion in the DOM */\n aoLocal[i][j].cell.setAttribute('rowspan', iRowspan);\n aoLocal[i][j].cell.setAttribute('colspan', iColspan);\n }\n }\n }\n }", "function ReportHeader(){}", "header(name, info) {\n this.headingName.setContent(name)\n this.headingInfo.setContent(info)\n }", "function createHeaders() {\n for (var i = 0; i < jsonList.length; i++) {\n if (!headers.includes(jsonList[i][headingProperty])) {\n headers.push(jsonList[i][headingProperty]);\n }\n }\n headers.push(\"All\");\n headers.forEach(function (e) {\n var headingItem = document.createElement(\"div\");\n headingItem.classList.add(\"headerItem\");\n headingItem.setAttribute('id', e);\n console.log(\"setting up \" + e);\n headingItem.addEventListener(\"click\", function () {\n console.log(\"Something was clicked! It was \" + e);\n executeFlipBoxes(e);\n });\n headingItem.innerHTML = prettyColumnHeading(e);\n navBar.appendChild(headingItem);\n })\n } //End of headers created", "function HeaderControls(instanceID)\n{if(instanceID!=null)\n{Widget.apply(this,arguments);NotificationCenter.addObserver(this,HeaderControls.prototype.p_prevPage,\"PreviousPage\",this.p_mediaGridID());NotificationCenter.addObserver(this,HeaderControls.prototype.p_nextPage,\"NextPage\",this.p_mediaGridID());NotificationCenter.addObserver(this,HeaderControls.prototype.p_setPage,\"SetPage\",this.p_mediaGridID());this.mRange=new IWPageRange(0,5);this.p_updateRange();}}", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function draw_headers() \n{\n stroke(0);\n textSize(17);\n\n // Insertion Sort header\n alg_header(\"Insertion Sort\", 6, colors.Insertion);\n\n // Selection Sort header\n alg_header(\"Selection Sort\", 366, colors.Selection);\n\n // Gold's Poresort header\n alg_header(\"Gold's Poresort\", 723, colors.Poresort);\n\n // Mergesort header\n alg_header(\"Mergesort\", 1083, colors.Mergesort);\n\n // Quicksort header\n alg_header(\"Quicksort\", 1445, colors.Quicksort);\n}", "function Header(props) {\n var attached = props.attached,\n block = props.block,\n children = props.children,\n className = props.className,\n color = props.color,\n content = props.content,\n disabled = props.disabled,\n dividing = props.dividing,\n floated = props.floated,\n icon = props.icon,\n image = props.image,\n inverted = props.inverted,\n size = props.size,\n sub = props.sub,\n subheader = props.subheader,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()('ui', color, size, Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(block, 'block'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(dividing, 'dividing'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"D\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(icon === true, 'icon'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(image === true, 'image'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(inverted, 'inverted'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(sub, 'sub'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"A\" /* useKeyOrValueAndKey */])(attached, 'attached'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useTextAlignProp */])(textAlign), 'header', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"q\" /* getUnhandledProps */])(Header, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"p\" /* getElementType */])(Header, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n var iconElement = __WEBPACK_IMPORTED_MODULE_6__elements_Icon__[\"a\" /* default */].create(icon);\n var imageElement = __WEBPACK_IMPORTED_MODULE_7__elements_Image__[\"a\" /* default */].create(image);\n var subheaderElement = __WEBPACK_IMPORTED_MODULE_8__HeaderSubheader__[\"a\" /* default */].create(subheader);\n\n if (iconElement || imageElement) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n iconElement || imageElement,\n (content || subheaderElement) && __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_9__HeaderContent__[\"a\" /* default */],\n null,\n content,\n subheaderElement\n )\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content,\n subheaderElement\n );\n}", "function makeHeaderObjFtn(iface) {\n \treturn {\n \t\taddPatient : function() {\n\t $log.info(id + ' call to add patient');\n api.notify('addMode');\n \t},\n \tremovePatients : function() {\n \t$log.info(id + ' call to delete patient');\n api.notify('deleteMode');\n \t}\n \t};\n \t}", "function CreateTblHeader(field_setting, col_hidden) {\n //console.log(\"=== CreateTblHeader ===== \");\n //console.log(\"field_setting\", field_setting);\n //console.log(\" col_hidden\", col_hidden);\n\n const column_count = field_setting.field_names.length;\n\n// +++ insert header and filter row ++++++++++++++++++++++++++++++++\n let tblRow_header = tblHead_datatable.insertRow (-1);\n let tblRow_filter = tblHead_datatable.insertRow (-1);\n\n // --- loop through columns\n for (let j = 0; j < column_count; j++) {\n const field_name = field_setting.field_names[j];\n\n // skip columns if in col_hidden\n if (!col_hidden.includes(field_name)){\n // --- get field_caption from field_setting\n const field_caption = loc[field_setting.field_caption[j]];\n const field_tag = field_setting.field_tags[j];\n const filter_tag = field_setting.filter_tags[j];\n const class_width = \"tw_\" + field_setting.field_width[j] ;\n const class_align = \"ta_\" + field_setting.field_align[j];\n\n// ++++++++++ insert columns in header row +++++++++++++++\n // --- add th to tblRow.\n let th_header = document.createElement(\"th\");\n // --- add div to th, margin not working with th\n const el_header = document.createElement(\"div\");\n // --- add innerText to el_header\n el_header.innerText = (field_caption) ? field_caption : null;\n // --- add width, text_align\n // not necessary: th_header.classList.add(class_width, class_align);\n th_header.classList.add(class_width, class_align);\n el_header.classList.add(class_width, class_align);\n if (field_name === \"status\"){\n // --- add statud icon.\n el_header.classList.add(\"diamond_0_0\");\n };\n\n th_header.appendChild(el_header);\n tblRow_header.appendChild(th_header);\n\n// ++++++++++ create filter row +++++++++++++++\n // --- add th to tblRow_filter.\n const th_filter = document.createElement(\"th\");\n\n // --- create element with tag based on filter_tag\n const filter_field_tag = ([\"text\", \"number\"].includes(filter_tag)) ? \"input\" : \"div\";\n const el_filter = document.createElement(filter_field_tag);\n\n // --- add data-field Attribute.\n el_filter.setAttribute(\"data-field\", field_name);\n el_filter.setAttribute(\"data-filtertag\", filter_tag);\n // PR2021-05-30 debug: use cellIndex instead of attribute data-colindex,\n //el_filter.setAttribute(\"data-colindex\", j);\n\n // --- add EventListener to el_filter / th_filter\n if ([\"text\", \"number\"].includes(filter_tag)) {\n el_filter.addEventListener(\"keyup\", function(event){HandleFilterKeyup(el_filter, event)});\n add_hover(th_filter);\n\n } else if (filter_tag === \"toggle\") {\n // add EventListener for icon to th_filter, not el_filter\n th_filter.addEventListener(\"click\", function(event){HandleFilterToggle(el_filter)});\n th_filter.classList.add(\"pointer_show\");\n\n // default empty icon necessary to set pointer_show\n el_filter.classList.add(\"tickmark_0_0\");\n add_hover(th_filter);\n\n }\n // --- add other attributes\n if (filter_tag === \"text\") {\n el_filter.setAttribute(\"type\", \"text\")\n el_filter.classList.add(\"input_text\");\n\n el_filter.setAttribute(\"autocomplete\", \"off\");\n el_filter.setAttribute(\"ondragstart\", \"return false;\");\n el_filter.setAttribute(\"ondrop\", \"return false;\");\n }\n\n // --- add width, text_align\n // PR2021-05-30 debug. Google chrome not setting width without th_filter class_width\n th_filter.classList.add(class_width, class_align);\n\n el_filter.classList.add(class_width, class_align, \"tsa_color_darkgrey\", \"tsa_transparent\");\n th_filter.appendChild(el_filter)\n tblRow_filter.appendChild(th_filter);\n };\n };\n }", "function Header(props) {\n var attached = props.attached,\n block = props.block,\n children = props.children,\n className = props.className,\n color = props.color,\n content = props.content,\n disabled = props.disabled,\n dividing = props.dividing,\n floated = props.floated,\n icon = props.icon,\n image = props.image,\n inverted = props.inverted,\n size = props.size,\n sub = props.sub,\n subheader = props.subheader,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()('ui', color, size, Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(block, 'block'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(dividing, 'dividing'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"F\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(icon === true, 'icon'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(image === true, 'image'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(inverted, 'inverted'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(sub, 'sub'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOrValueAndKey */])(attached, 'attached'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"E\" /* useTextAlignProp */])(textAlign), 'header', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"r\" /* getUnhandledProps */])(Header, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"q\" /* getElementType */])(Header, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n var iconElement = __WEBPACK_IMPORTED_MODULE_6__elements_Icon__[\"a\" /* default */].create(icon);\n var imageElement = __WEBPACK_IMPORTED_MODULE_7__elements_Image__[\"a\" /* default */].create(image);\n var subheaderElement = __WEBPACK_IMPORTED_MODULE_8__HeaderSubheader__[\"a\" /* default */].create(subheader);\n\n if (iconElement || imageElement) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n iconElement || imageElement,\n (content || subheaderElement) && __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_9__HeaderContent__[\"a\" /* default */],\n null,\n content,\n subheaderElement\n )\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content,\n subheaderElement\n );\n}", "function Header(props) {\n var attached = props.attached,\n block = props.block,\n children = props.children,\n className = props.className,\n color = props.color,\n content = props.content,\n disabled = props.disabled,\n dividing = props.dividing,\n floated = props.floated,\n icon = props.icon,\n image = props.image,\n inverted = props.inverted,\n size = props.size,\n sub = props.sub,\n subheader = props.subheader,\n textAlign = props.textAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()('ui', color, size, Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(block, 'block'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(dividing, 'dividing'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"F\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(icon === true, 'icon'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(image === true, 'image'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(inverted, 'inverted'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOnly */])(sub, 'sub'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"C\" /* useKeyOrValueAndKey */])(attached, 'attached'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"E\" /* useTextAlignProp */])(textAlign), 'header', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"r\" /* getUnhandledProps */])(Header, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"q\" /* getElementType */])(Header, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n var iconElement = __WEBPACK_IMPORTED_MODULE_6__elements_Icon__[\"a\" /* default */].create(icon);\n var imageElement = __WEBPACK_IMPORTED_MODULE_7__elements_Image__[\"a\" /* default */].create(image);\n var subheaderElement = __WEBPACK_IMPORTED_MODULE_8__HeaderSubheader__[\"a\" /* default */].create(subheader);\n\n if (iconElement || imageElement) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n iconElement || imageElement,\n (content || subheaderElement) && __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_9__HeaderContent__[\"a\" /* default */],\n null,\n content,\n subheaderElement\n )\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content,\n subheaderElement\n );\n}", "function MatSortHeaderColumnDef() {}", "function createHeader (){\n\n // Create the header raw\n // create raw\n var headRow = document.createElement('tr');\n table.appendChild(headRow);\n //create tds\n var firstTd;\n for (var i = 0; i < tableHeads.length ; i++){\n firstTd = document.createElement('td');\n firstTd.textContent= tableHeads[i];\n headRow.appendChild(firstTd);\n }\n}", "addHeader(name) {\n this.n = 0;\n this.list.getRow(this.row).getCell(1).value = name;\n this.list.getRow(this.row).getCell(1).style = Object.assign({}, this.cellStyle, {font: {bold: true, size: 24}});\n this.list.mergeCells(`A${this.row}:K${this.row}`);\n\n this.row++;\n }", "function UpdateTableHeaders() {\n $(\".persist-area\").each(function() {\n \n var el = $(this),\n offset = el.offset(),\n scrollTop = $(window).scrollTop(),\n floatingHeader = $(\".floatingHeader\", this);\n \n if ((scrollTop > offset.top) && (scrollTop < offset.top + el.height())) {\n floatingHeader.css({\n \"visibility\": \"visible\"\n });\n } else {\n floatingHeader.css({\n \"visibility\": \"hidden\"\n }); \n };\n });\n}", "buildCells() {\n var _me$client;\n\n const me = this,\n {\n sizeProperty\n } = me,\n featureHeaderConfigs = [],\n cellConfigs = me.levels.map((level, i) => ({\n className: {\n 'b-sch-header-row': 1,\n [`b-sch-header-row-${level.position}`]: 1,\n 'b-sch-header-row-main': i === me.model.viewPreset.mainHeaderLevel,\n 'b-lowest': isLastLevel(i, me.levels)\n },\n syncOptions: {\n // Keep a maximum of 5 released cells. Might be fine with fewer since ticks are fixed width.\n // Prevents an unnecessary amount of cells from sticking around when switching from narrow to\n // wide tickSizes\n releaseThreshold: 5,\n syncIdField: 'tickIndex'\n },\n dataset: {\n headerFeature: `headerRow${i}`,\n headerPosition: level.position\n },\n // Only include cells in view\n children: level.cells.filter(cell => cell.start < me.endDate && cell.end > me.startDate).map(cell => ({\n className: {\n 'b-sch-header-timeaxis-cell': 1,\n [cell.headerCellCls]: cell.headerCellCls,\n [`b-align-${cell.align}`]: cell.align,\n 'b-last': isLastCell(level, cell)\n },\n dataset: {\n tickIndex: cell.index,\n // Used in export tests to resolve dates from tick elements\n ...(window.DEBUG && {\n date: cell.start.getTime()\n })\n },\n style: {\n // DomHelper appends px to numeric dimensions\n [me.positionProperty]: cell.coord,\n [sizeProperty]: cell.width,\n [`min-${sizeProperty}`]: cell.width\n },\n children: me.wrapText ? [{\n className: 'b-sch-header-text',\n html: cell.value\n }] : null,\n html: me.wrapText ? null : cell.value\n }))\n })); // When tested in isolation there is no client\n\n (_me$client = me.client) === null || _me$client === void 0 ? void 0 : _me$client.getHeaderDomConfigs(featureHeaderConfigs);\n cellConfigs.push(...featureHeaderConfigs); // noinspection JSSuspiciousNameCombination\n\n return {\n className: `b-widget ${me.cls}`,\n syncOptions: {\n // Do not keep entire levels no longer used, for example after switching view preset\n releaseThreshold: 0\n },\n style: {\n [sizeProperty]: me.size\n },\n children: cellConfigs\n };\n }", "function addColumnHeadings(el, header) {\n var headerRow = $('<tr/>').appendTo(header);\n var breakpointsByIdx = [];\n var srcSettings = el.settings.sourceObject.settings;\n var aggInfo = srcSettings.aggregation;\n if (el.settings.autoResponsiveCols) {\n // Build list of breakpoints to use by column position.\n $.each(el.settings.responsiveOptions.breakpoints, function eachPoint(name, point) {\n var i;\n for (i = Math.round(point / 100); i < el.settings.columns.length; i++) {\n while (breakpointsByIdx.length < i + 1) {\n breakpointsByIdx.push([]);\n }\n breakpointsByIdx[i].push(name);\n }\n });\n }\n if (el.settings.responsive) {\n $('<th class=\"footable-toggle-col\" data-sort-ignore=\"true\"></th>').appendTo(headerRow);\n }\n $.each(el.settings.columns, function eachColumn(idx) {\n var colDef = el.settings.availableColumnInfo[this.field];\n var heading = colDef.caption;\n var footableExtras = '';\n var sortableField = false;\n // Tolerate hyphen or camelCase.\n var hideBreakpoints = colDef.hideBreakpoints || colDef['hide-breakpoints'];\n var dataType = colDef.dataType || colDef['data-type'];\n if (srcSettings.mode === 'docs') {\n // Either a standard field, or a special field which provides an\n // associated sort field.\n sortableField = (indiciaData.esMappings[this.field] && indiciaData.esMappings[this.field].sort_field) ||\n indiciaData.fieldConvertorSortFields[this.field.simpleFieldName()];\n } else if (srcSettings.mode === 'compositeAggregation') {\n // CompositeAggregation can sort on any field column, not aggregations.\n sortableField = !(aggInfo[this.field] || this.field === 'doc_count');\n } else if (srcSettings.mode === 'termAggregation') {\n // Term aggregations allow sort on the aggregation cols, or fields if\n // numeric or date, but not normal text fields.\n sortableField = aggInfo[this.field] || this.field === 'doc_count' ||\n (indiciaData.esMappings[this.field] && !indiciaData.esMappings[this.field].type.match(/^(text|keyword)$/));\n }\n if (el.settings.sortable !== false && sortableField) {\n heading += '<span class=\"sort fas fa-sort\"></span>';\n }\n // Extra data attrs to support footable.\n if (el.settings.autoResponsiveCols) {\n footableExtras = ' data-hide=\"' + breakpointsByIdx[idx].join(',') + '\"';\n } else if (hideBreakpoints) {\n footableExtras = ' data-hide=\"' + hideBreakpoints + '\"';\n }\n if (dataType) {\n footableExtras += ' data-type=\"' + dataType + '\"';\n }\n $('<th class=\"col-' + idx + '\" data-field=\"' + this.field + '\"' + footableExtras + '>' + heading + '</th>')\n .appendTo(headerRow);\n });\n if (el.settings.actions.length) {\n $('<th class=\"col-actions\"></th>').appendTo(headerRow);\n }\n if (el.settings.tbodyHasScrollBar) {\n // Spacer in header to allow for scrollbar in body.\n $('<th class=\"scroll-spacer\"></th>').appendTo(headerRow);\n }\n }", "renderHeader(headerContainerElement) {\n let me = this,\n grid = me.grid,\n groupers = me.store.groupers;\n\n // Sorted from start, reflect in rendering\n for (let groupInfo of groupers) {\n // Might be grouping by field without column, which is valid\n const column = grid.columns.get(groupInfo.field),\n header = column && grid.getHeaderElement(column.id);\n // IE11 doesnt support this\n //header && header.classList.add('b-group', groupInfo.ascending ? 'b-asc' : 'b-desc');\n if (header) {\n header.classList.add('b-group');\n header.classList.add(groupInfo.ascending ? 'b-asc' : 'b-desc');\n }\n }\n }", "function getHeader() {\n return This.headerTpl({\n date: date,\n teams: teams\n });\n }", "function PfNotificationDrawerHeader() {\n _classCallCheck(this, PfNotificationDrawerHeader);\n\n return _possibleConstructorReturn(this, (PfNotificationDrawerHeader.__proto__ || Object.getPrototypeOf(PfNotificationDrawerHeader)).call(this));\n }", "function DraggingHeaders(options) {\n\t\tvar _grid;\n\t\tvar _self = this;\n\t\tvar _handler = new Slick.EventHandler();\n\t\tvar _gridContainer;\n\t\tvar _mouseOffsetV = 0; // Distance from the mouse pointer to top of moving indicator.\n\t\tvar _mouseOffsetH = 10; // Distance from the mouse pointer to the left of the moving indicator.\n\n\t\tvar _defaults = {\n\t\t\tdropTarget: '.xa-slick-grid-group-elements' // TODO: pass with options, or generate unique jquery-ui scope / grid.\n\t\t};\n\n\t\tfunction init(grid) {\n\n\t\t\tif (!$.fn.drag) {\n\t\t\t\tthrow new Error(\"SlickGrid's 'DraggingHeaders' plugin requires jquery.event.drag module to be loaded\");\n\t\t\t}\n\n\t\t\tif (!$.fn.drop) {\n\t\t\t\tthrow new Error(\"SlickGrid's 'DraggingHeaders' plugin requires jquery.event.drop module to be loaded\");\n\t\t\t}\n\n\t\t\toptions = $.extend(true, {}, _defaults, options);\n\t\t\t_grid = grid;\n\t\t\t_gridContainer = $(grid.getTopPanel()).closest('.gridContainer');\n\t\t\t_handler\n\t\t\t .subscribe(_grid.onHeaderCellRendered, handleHeaderCellRendered)\n\t\t\t .subscribe(_grid.onBeforeHeaderCellDestroy, handleBeforeHeaderCellDestroy);\n\n\t\t\t// Force the grid to re-render the header now that the events are hooked up.\n\t\t\t_grid.setColumns(_grid.getColumns());\n\t\t}\n\n\t\tfunction destroy() {\n\t\t\tcleanupDroppable();\n\t\t\t_handler.unsubscribeAll();\n\t\t\t_grid = null;\n\t\t}\n\n\t\tfunction handleHeaderCellRendered(e, args) {\n\t\t\tif (args.column.groupable) {\n\t\t\t\tsetupHeaderDragging(args.node);\n\t\t\t}\n\t\t}\n\n\t\tfunction handleBeforeHeaderCellDestroy(e, args) {\n\t\t\tif (args.column.groupable) {\n\t\t\t $(args.node).off(\"draginit dragstart drag dragend\");\n\t\t\t}\n\t\t}\n\n\t\tfunction setupHeaderDragging(node) {\n\t\t\tvar $node = $(node);\n\n\t\t\t$node.on('draginit', function (e, dd) {\n\t\t\t setupHeaderDropping();\n\t\t\t});\n\t\t\t$node.on(\"dragstart\", function(ev, dd) {\n\n\t\t\t\tvar proxy = $(\"<div>\")\n\t\t\t\t\t.addClass(\"slick-header-column ui-state-default dragged-header\")\n\t\t\t\t\t.append($(this).find(\".slick-column-name\").clone())\n\t\t\t\t\t.appendTo(document.body);\n\n\t\t\t\tdd.limit = _gridContainer.offset();\n\t\t\t\tdd.limit.bottom = dd.limit.top + _gridContainer.outerHeight() - proxy.outerHeight();\n\t\t\t\tdd.limit.right = dd.limit.left + _gridContainer.outerWidth() - proxy.outerWidth();\n\t\t\t\tdd.column = $node.data('column');\n\n\t\t\t\treturn proxy;\n\t\t\t})\n\n\t\t\t.on(\"drag\", function (ev, dd) {\n\t\t\t\t$(dd.proxy).css({\n\t\t\t\t\ttop: Math.min(dd.limit.bottom, Math.max(dd.limit.top, dd.startY + dd.deltaY + _mouseOffsetV)),\n\t\t\t\t\tleft: Math.min(dd.limit.right, Math.max(dd.limit.left, dd.startX + dd.deltaX + _mouseOffsetH))\n\t\t\t\t});\n\t\t\t})\n\n\t\t\t.on(\"dragend\", function (ev, dd) {\n\t\t\t\t$(dd.proxy).remove();\n\t\t\t});\n\t\t}\n\n\t\tvar _wasDropInit = false;\n\t\tfunction setupHeaderDropping() {\n\t\t if (_wasDropInit) return;\n\n\t\t _wasDropInit = true;\n\n\t\t\t$(options.dropTarget, _gridContainer)\n\n\t\t\t\t.on(\"dropstart\", function() {\n\t\t\t\t\t$(this).addClass(\"dropping\");\n\t\t\t\t})\n\t\t\t\t.on(\"drop\", function (ev, dd) {\n\t\t\t\t if (dd.column) {\n\t\t\t\t //raul: need to check the column is coming from the same grid as the drop\n\t\t\t\t //var dragGrid = $(dd.drag).closest('.xa-slick-grid')[0];\n\t\t\t\t //var dropGrid = $(dd.drop[0]).closest('.xa-slick-grid')[0];\n\n //if(dragGrid == dropGrid)\n\t\t\t\t\t\t handleColumnDrop(dd.column);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.on(\"dropend\", function() {\n\t\t\t\t\t$(this).removeClass(\"dropping\");\n\t\t\t\t});\n\t\t}\n\n\t\tfunction handleColumnDrop(column) {\n\t\t\t_self.onGroupDropped.notify({\n\t\t\t\t\"grid\": _grid,\n\t\t\t\t\"column\": column\n\t\t\t});\n\t\t}\n\n\t\tfunction cleanupDroppable() {\n\t\t\t$(options.dropTarget, _gridContainer).off();\n\t\t _gridContainer = null;\n\t\t}\n\n\t\t$.extend(this, {\n\t\t\t\"init\": init,\n\t\t\t\"destroy\": destroy,\n\t\t\t\"onGroupDropped\": new Slick.Event()\n\t\t});\n\t}", "renderHeader() {\n const self = this;\n const headerRows = { left: '', center: '', right: '' };\n let uniqueId;\n\n // Handle Nested Headers\n const colGroups = this.settings.columnGroups;\n if (colGroups) {\n this.element.addClass('has-group-headers');\n\n const columns = this.settings.columns;\n const columnsLen = columns.length;\n const visibleColumnsLen = this.visibleColumns().length;\n const groups = colGroups.map(group => parseInt(group.colspan, 10));\n const getGroupsTotal = () => groups.reduce((a, b) => a + b, 0);\n const getDiff = () => {\n const groupsTotal = getGroupsTotal();\n return groupsTotal > columnsLen ? groupsTotal - columnsLen : columnsLen - groupsTotal;\n };\n\n headerRows.left += '<tr role=\"row\" class=\"datagrid-header-groups\">';\n headerRows.center += '<tr role=\"row\" class=\"datagrid-header-groups\">';\n headerRows.right += '<tr role=\"row\" class=\"datagrid-header-groups\">';\n\n const groupsTotal = getGroupsTotal();\n let diff;\n if (groupsTotal > columnsLen) {\n let move = true;\n for (let i = groups.length - 1; i >= 0 && move; i--) {\n diff = getDiff();\n if (groups[i] >= diff) {\n groups[i] -= diff;\n move = false;\n } else {\n groups[i] = 0;\n }\n }\n }\n\n let i = 0;\n let total = 0;\n groups.forEach((groupColspan, k) => {\n let colspan = groupColspan;\n for (let l = i + groupColspan; i < l; i++) {\n if (i < columnsLen && columns[i].hidden) {\n colspan--;\n }\n }\n const hiddenStr = colGroups[k].hidden || colspan < 1 ? ' class=\"is-hidden\"' : '';\n const colspanStr = ` colspan=\"${colspan > 0 ? colspan : 1}\"`;\n const groupedHeaderAlignmentClass = colGroups[k].align ? `l-${colGroups[k].align}-text` : '';\n uniqueId = self.uniqueId(`-header-group-${k}`);\n if (colspan > 0) {\n total += colspan;\n }\n\n const container = self.getContainer(self.settings.columns[k].id);\n headerRows[container] += `<th${hiddenStr}${colspanStr} id=\"${uniqueId}\" class=\"${groupedHeaderAlignmentClass}\"><div class=\"datagrid-column-wrapper\"><span class=\"datagrid-header-text\">${colGroups[k].name}</span></div></th>`;\n });\n\n if (total < visibleColumnsLen) {\n diff = visibleColumnsLen - total;\n const colspanStr = ` colspan=\"${diff > 0 ? diff : 1}\"`;\n if (self.hasRightPane) {\n headerRows.right += `<th${colspanStr}></th>`;\n } else {\n headerRows.center += `<th${colspanStr}></th>`;\n }\n }\n\n if (this.settings.spacerColumn) {\n headerRows.center += '<th class=\"datagrid-header-groups-spacer-column\"></th>';\n }\n\n headerRows.left += '</tr><tr>';\n headerRows.center += '</tr><tr>';\n headerRows.right += '</tr><tr>';\n } else {\n headerRows.left += '<tr role=\"row\">';\n headerRows.center += '<tr role=\"row\">';\n headerRows.right += '<tr role=\"row\">';\n }\n\n for (let j = 0; j < this.settings.columns.length; j++) {\n const column = self.settings.columns[j];\n const container = self.getContainer(column.id);\n const id = self.uniqueId(`-header-${j}`);\n const isSortable = (column.sortable === undefined ? true : column.sortable);\n const isResizable = (column.resizable === undefined ? true : column.resizable);\n const isExportable = (column.exportable === undefined ? true : column.exportable);\n const isSelection = column.id === 'selectionCheckbox';\n const headerAlignmentClass = this.getHeaderAlignmentClass(column);\n\n // Make frozen columns hideable: false\n if ((self.hasLeftPane || self.hasRightPane) &&\n (self.settings.frozenColumns.left &&\n self.settings.frozenColumns.left.indexOf(column.id) > -1 ||\n self.settings.frozenColumns.right &&\n self.settings.frozenColumns.right.indexOf(column.id) > -1)) {\n column.hideable = false;\n }\n\n // Ensure hidable columns are marked as such\n if (column.hideable === undefined) {\n column.hideable = true;\n }\n\n // Assign css classes\n let cssClass = '';\n cssClass += isSortable ? ' is-sortable' : '';\n cssClass += isResizable ? ' is-resizable' : '';\n cssClass += column.hidden ? ' is-hidden' : '';\n cssClass += column.filterType ? ' is-filterable' : '';\n cssClass += column.textOverflow === 'ellipsis' ? ' text-ellipsis' : '';\n cssClass += column?.headerIcon ? ' header-icon' : '';\n cssClass += column?.headerCssClass ? ` ${column.headerCssClass}` : '';\n cssClass += headerAlignmentClass !== '' ? headerAlignmentClass : '';\n\n // Apply css classes\n cssClass = cssClass !== '' ? ` class=\"${cssClass.substr(1)}\"` : '';\n let ids = utils.stringAttributes(this, this.settings.attributes, `col-${column.id?.toLowerCase()}`);\n\n if (!ids) {\n ids = `id=\"${id}\"`;\n }\n\n headerRows[container] += `<th scope=\"col\" role=\"columnheader\" ${ids} ${isSelection ? ' aria-checked= \"false\"' : ''} data-column-id=\"${column.id}\"${column.field ? ` data-field=\"${column.field}\"` : ''}${column.headerTooltip ? ` title=\"${column.headerTooltip}\"` : ''}${column.headerTooltipCssClass ? ` tooltipClass=\"${column.headerTooltipCssClass}\"` : ''}${column.reorderable === false ? ' data-reorder=\"false\"' : ''}${colGroups ? ` headers=\"${self.getColumnGroup(j)}\"` : ''} data-exportable=\"${isExportable ? 'yes' : 'no'}\"${cssClass}>`;\n\n let sortIndicator = '';\n if (isSortable) {\n sortIndicator = `${'<div class=\"sort-indicator\">' +\n '<span class=\"sort-asc\">'}${$.createIcon({ icon: 'dropdown' })}</span>` +\n `<span class=\"sort-desc\">${$.createIcon({ icon: 'dropdown' })}</div>`;\n }\n\n // If header text is center aligned, for proper styling,\n // place the sortIndicator as a child of datagrid-header-text.\n\n const svgHeaderTooltip = column?.headerIconTooltip !== undefined || column?.headerIconTooltip?.length > 0 ? column?.headerIconTooltip : '';\n const svgHeaderIcon = `\n <svg class=\"icon datagrid-header-icon\" focusable=\"false\" aria-hidden=\"true\" role=\"presentation\" title=\"${svgHeaderTooltip}\">\n <use href=\"#icon-${column.headerIcon}\"></use>\n </svg>\n `;\n\n headerRows[container] += `<div class=\"${isSelection ? 'datagrid-checkbox-wrapper ' : 'datagrid-column-wrapper'}${headerAlignmentClass}\">\n <span class=\"datagrid-header-text${column.required ? ' required' : ''}\">${self.headerText(this.settings.columns[j])}${headerAlignmentClass === ' l-center-text' ? sortIndicator : ''}</span>\n ${this.settings.columns[j]?.headerIcon ? svgHeaderIcon : ''}`;\n\n if (isSelection) {\n if (self.settings.showSelectAllCheckBox) {\n headerRows[container] += '<span class=\"datagrid-checkbox\" aria-label=\"Selection\" role=\"checkbox\" tabindex=\"0\"></span>';\n } else {\n headerRows[container] += '<span class=\"datagrid-checkbox\" aria-label=\"Selection\" role=\"checkbox\" style=\"display:none\" tabindex=\"0\"></span>';\n }\n }\n\n // Note the space in classname.\n // Place sortIndicator via concatenation if\n // header text is not center aligned.\n if (isSortable && headerAlignmentClass !== ' l-center-text') {\n headerRows[container] += sortIndicator;\n }\n\n headerRows[container] += `</div>${self.filterRowHtml(column, j)}</th>`;\n }\n\n // Set Up Spacer column\n if (this.settings.spacerColumn) {\n headerRows.center += '<th class=\"datagrid-header-spacer-column\"></th>';\n }\n\n headerRows.left += '</tr>';\n headerRows.center += '</tr>';\n headerRows.right += '</tr>';\n\n // Set Up Header Panes\n if (self.headerRow === undefined) {\n if (self.hasLeftPane) {\n self.headerRowLeft = $(`<thead class=\"datagrid-header left\" role=\"rowgroup\">${headerRows.left}</thead>`);\n self.tableLeft.find('colgroup').after(self.headerRowLeft);\n }\n\n self.headerRow = $(`<thead class=\"datagrid-header center\"> role=\"rowgroup\"${headerRows.center}</thead>`);\n self.table.find('colgroup').after(self.headerRow);\n\n if (self.hasRightPane) {\n self.headerRowRight = $(`<thead class=\"datagrid-header right\" role=\"rowgroup\">${headerRows.right}</thead>`);\n self.tableRight.find('colgroup').after(self.headerRowRight);\n }\n } else {\n if (self.hasLeftPane) {\n DOM.html(self.headerRowLeft, headerRows.left, '*');\n }\n\n DOM.html(self.headerRow, headerRows.center, '*');\n\n if (self.hasRightPane) {\n DOM.html(self.headerRowRight, headerRows.right, '*');\n }\n }\n\n if (colGroups && self.headerRow) {\n self.colGroups = $.makeArray(this.container.find('.datagrid-header-groups th'));\n }\n\n self.syncHeaderCheckbox(this.settings.dataset);\n self.setScrollClass();\n self.attachFilterRowEvents();\n\n if (self.settings.columnReorder) {\n self.createDraggableColumns();\n }\n\n this.restoreSortOrder = false;\n this.setSortIndicator(this.sortColumn.sortId, this.sortColumn.sortAsc);\n\n if (this.restoreFilter) {\n this.restoreFilter = false;\n this.applyFilter(this.savedFilter, 'restore');\n this.savedFilter = null;\n } else if (this.filterExpr && this.filterExpr.length > 0) {\n this.setFilterConditions(this.filterExpr);\n }\n\n this.activeEllipsisHeaderAll();\n\n // Set the color background header (light and dark)\n (self?.settings?.headerBackgroundColor === 'light') ? //eslint-disable-line\n (self?.headerRowLeft?.addClass('light'), self?.headerRow?.addClass('light'), self?.headerRowRight?.addClass('light')) :\n (self?.headerRow?.addClass('dark'), self?.headerRowRight?.addClass('dark'), self?.headerRowLeft?.addClass('dark'));\n }", "function Header(props) {\n var attached = props.attached,\n block = props.block,\n children = props.children,\n className = props.className,\n color = props.color,\n content = props.content,\n disabled = props.disabled,\n dividing = props.dividing,\n floated = props.floated,\n icon = props.icon,\n image = props.image,\n inverted = props.inverted,\n size = props.size,\n sub = props.sub,\n subheader = props.subheader,\n textAlign = props.textAlign;\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()('ui', color, size, Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"A\" /* useKeyOnly */])(block, 'block'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"A\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"A\" /* useKeyOnly */])(dividing, 'dividing'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"E\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"A\" /* useKeyOnly */])(icon === true, 'icon'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"A\" /* useKeyOnly */])(image === true, 'image'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"A\" /* useKeyOnly */])(inverted, 'inverted'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"A\" /* useKeyOnly */])(sub, 'sub'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"B\" /* useKeyOrValueAndKey */])(attached, 'attached'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"D\" /* useTextAlignProp */])(textAlign), 'header', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"r\" /* getUnhandledProps */])(Header, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"q\" /* getElementType */])(Header, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"c\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), children);\n }\n\n var iconElement = __WEBPACK_IMPORTED_MODULE_6__elements_Icon__[\"a\" /* default */].create(icon, {\n autoGenerateKey: false\n });\n var imageElement = __WEBPACK_IMPORTED_MODULE_7__elements_Image__[\"a\" /* default */].create(image, {\n autoGenerateKey: false\n });\n var subheaderElement = __WEBPACK_IMPORTED_MODULE_8__HeaderSubheader__[\"a\" /* default */].create(subheader, {\n autoGenerateKey: false\n });\n\n if (iconElement || imageElement) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), iconElement || imageElement, (content || subheaderElement) && __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_9__HeaderContent__[\"a\" /* default */], null, content, subheaderElement));\n }\n\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), content, subheaderElement);\n}", "function theQwertyGrid_tableHeader (_tableProps){\n\t\t\tvar thead = jQuery(\"<thead>\");\n\t\t\tvar tbody = jQuery(\"<tbody>\");\n\t\t\ttbody.attr(\"id\",\"theQwertyGrid_rows\");\n\t\t\ttbody.attr(\"align\",\"center\");\n\t\t\ttbody.attr(\"valign\",\"middle\");\n\t\t\tvar theadTr = jQuery(\"<tr>\");\n\t\t\t\n\t\t\tfor(var i=0; i< _tableProps.headerCols.length; i++) {\n\t\t\t\tif(_tableProps.cols[i].sortable) {\n\t\t\t\t\tvar sortFunc=\"\";\n\t\t\t\t\tif(_tableProps.cols[i].type == \"string\") {\n\t\t\t\t\t\tsortFunc = \"theQwertyGrid_sortString\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(_tableProps.cols[i].type == \"int\") {\n\t\t\t\t\t\tsortFunc = \"theQwertyGrid_sortInt\";\n\t\t\t\t\t}\n\t\t\t\t\ttheadTr.append(jQuery(\"<th>\").append(\"<a onclick=\\\"\"+sortFunc+\"(\\'\"+_tableProps.cols[i].name+\"\\')\\\">\"+_tableProps.headerCols[i]+\"</a>\"));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttheadTr.append(jQuery(\"<th>\").append(_tableProps.headerCols[i]));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tfor(var i=0; i<_tableProps.controls.length; i++) {\n\t\t\t\ttheadTr.append(jQuery(\"<th>\").append(_tableProps.controls[i].headerCaption));\n\t\t\t}\n\t\t\tthead.append(theadTr);\n\t\t\t_theQwertyGrid_table.append(thead);\n\t\t\t_theQwertyGrid_table.append(tbody);\n\t\t}", "renderHeader(headerContainerElement) {\n const {\n store,\n grid\n } = this;\n\n if (store.isGrouped) {\n // Sorted from start, reflect in rendering\n for (const groupInfo of store.groupers) {\n // Might be grouping by field without column, which is valid\n const column = grid.columns.get(groupInfo.field),\n header = column && grid.getHeaderElement(column.id); // IE11 doesnt support this\n //header && header.classList.add('b-group', groupInfo.ascending ? 'b-asc' : 'b-desc');\n\n if (header) {\n header.classList.add('b-group');\n header.classList.add(groupInfo.ascending ? 'b-asc' : 'b-desc');\n }\n }\n }\n }", "function defineHeaders(i18n) {\n var hdConfig = [[{\n text: \"\", //i18n.translate(\"bdgt_new_contract_year\")\n key: \"year\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_jan\"),\n key: \"jan\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_feb\"),\n key: \"feb\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_mar\"),\n key: \"mar\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_apr\"),\n key: \"apr\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_may\"),\n key: \"may\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_jun\"),\n key: \"jun\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_jul\"),\n key: \"jul\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_aug\"),\n key: \"aug\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_sep\"),\n key: \"sep\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_oct\"),\n key: \"oct\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_nov\"),\n key: \"nov\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_dec\"),\n key: \"dec\",\n isSortable: false\n }, {\n text: i18n.translate(\"bdgt_new_contract_total\"),\n key: \"total\",\n isSortable: false\n }]];\n\n var hdSetup = function () {\n return hdConfig;\n };\n\n return hdSetup;\n }", "renderHeader() {\n this.refreshHeaders(false);\n }", "renderHeader() {\n this.refreshHeaders(false);\n }", "function Header(props) {\n var attached = props.attached,\n block = props.block,\n children = props.children,\n className = props.className,\n color = props.color,\n content = props.content,\n disabled = props.disabled,\n dividing = props.dividing,\n floated = props.floated,\n icon = props.icon,\n image = props.image,\n inverted = props.inverted,\n size = props.size,\n sub = props.sub,\n subheader = props.subheader,\n textAlign = props.textAlign;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('ui', color, size, Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(block, 'block'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(disabled, 'disabled'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(dividing, 'dividing'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(icon === true, 'icon'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(image === true, 'image'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(inverted, 'inverted'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(sub, 'sub'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOrValueAndKey\"])(attached, 'attached'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useTextAlignProp\"])(textAlign), 'header', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"getUnhandledProps\"])(Header, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"getElementType\"])(Header, props);\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_5__[\"childrenUtils\"].isNil(children)) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), children);\n }\n\n var iconElement = _Icon__WEBPACK_IMPORTED_MODULE_6__[\"default\"].create(icon, {\n autoGenerateKey: false\n });\n var imageElement = _Image__WEBPACK_IMPORTED_MODULE_7__[\"default\"].create(image, {\n autoGenerateKey: false\n });\n var subheaderElement = _HeaderSubheader__WEBPACK_IMPORTED_MODULE_8__[\"default\"].create(subheader, {\n autoGenerateKey: false\n });\n\n if (iconElement || imageElement) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), iconElement || imageElement, (content || subheaderElement) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_HeaderContent__WEBPACK_IMPORTED_MODULE_9__[\"default\"], null, content, subheaderElement));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), content, subheaderElement);\n}", "createHeaderRow(position, headerRowConfig) {\n const me = this,\n cells = [],\n align = headerRowConfig.align,\n today = DateHelper.clearTime(new Date()),\n headerCellCls = headerRowConfig.headerCellCls || '';\n\n let size = 0;\n\n me.headersDatesCache[position] = {};\n\n me.forEachInterval(position, (start, end, i) => {\n let value = DateHelper.format(start, headerRowConfig.dateFormat),\n cellData = {\n align,\n start,\n end,\n value,\n headerCellCls,\n width: this.getDistanceBetweenDates(start, end),\n index: i\n };\n\n if (cellData.width === 0) {\n return;\n }\n\n // Vertical mode uses absolute positioning for header cells\n cellData.coord = size;\n size += cellData.width;\n\n me.headersDatesCache[position][start.getTime()] = 1;\n\n if (headerRowConfig.renderer) {\n value = headerRowConfig.renderer.call(headerRowConfig.thisObj || me, start, end, cellData, i, me.eventStore);\n\n cellData.value = value == null ? '' : value;\n }\n\n // To be able to style individual day cells, weekends or other important days\n if (headerRowConfig.unit === 'day' && (!headerRowConfig.increment || headerRowConfig.increment === 1)) {\n cellData.headerCellCls += ' b-sch-dayheadercell-' + start.getDay();\n\n if (me.calendar && me.calendar.isWeekend(start)) {\n cellData.headerCellCls += ' b-sch-dayheadercell-nonworking';\n }\n\n if (DateHelper.clearTime(start, true) - today === 0) {\n cellData.headerCellCls += ' b-sch-dayheadercell-today';\n }\n }\n\n cells.push(cellData);\n });\n\n return cells;\n }", "function renderTableHeader() {\n return headers.map(({ name, field, sortable }, index) => {\n // specify icon classes\n const cls = [classes.sort_icon];\n if (sortingField === field && sortingOrder === 'desc') cls.push(classes.rotated);\n\n return (\n <th\n key={index}\n //debouce is used to handle click spamming\n onClick={() => (sortable ? sortClickHandler(field) : null)}\n scope=\"col\">\n {name}\n {sortingField === field ? (\n <svg\n className={cls.join(' ')}\n width=\"10\"\n height=\"6\"\n viewBox=\"0 0 10 6\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M10 5C10 5.16927 9.93815 5.31576 9.81445 5.43945C9.69075 5.56315 9.54427 5.625 9.375 5.625H0.625C0.455729 5.625 0.309245 5.56315 0.185547 5.43945C0.061849 5.31576 0 5.16927 0 5C0 4.83073 0.061849 4.68424 0.185547 4.56055L4.56055 0.185547C4.68424 0.061849 4.83073 0 5 0C5.16927 0 5.31576 0.061849 5.43945 0.185547L9.81445 4.56055C9.93815 4.68424 10 4.83073 10 5Z\"\n fill=\"#ffffff\"\n />\n </svg>\n ) : null}\n </th>\n );\n });\n }", "buildTableHeader() {\r\n //Variables used\r\n var row, cell, head;\r\n var titles = [\"Name\", \"Link\", \"Image\", \"Date added\", \"Edit\", \"Delete\"];\r\n\r\n //Creates a new row, appends that row to the table\r\n head = document.createElement(\"thead\");\r\n row = document.createElement(\"tr\");\r\n document.getElementById(\"dataTable\").appendChild(head);\r\n head.appendChild(row);\r\n\r\n //Creates each column in the head\r\n titles.forEach((title) => {\r\n cell = document.createElement(\"th\");\r\n cell.appendChild(document.createTextNode(title));\r\n row.appendChild(cell);\r\n });\r\n }", "function section1LeftTop( placeholder )\n {\n var ph = placeholder || {};\n\n ph.stack = fmethods.initTopPaneCell( \"Summary\" );\n ph.stack[1] = {\n image: imagesRack.loadedImages[ 'summary-table00' ].dataURI\n //fit: [444.0, 333.0],\n ,width: 400\n ,margin: [10,10,20,0]\n };\n ///just a filler ... poor design\n ph.stack[2] = {\n text: \" \"\n ,margin: [0,0,0, 0]\n\n };\n\n ///table00-contents\n var JSONrecord = nheap.content_data\n [ \"Page 1\" ]\n [ \"OverallPortfolio.txt\" ]\n [ \"OverAllPortfolio\" ]\n [ 0 ];\n /*\n :[\n {\n \"CURRENT_VALUE\":1124.081205,\n \"INVESTED_AMOUNT\":1013.564488,\n \"GAINLOSS\":112.48128,\n \"UNREALISEDGAINLOSS\":110.516716,\n \"REALISEDGAINLOSS\":3.7530829183,\n \"DIVIDEND\":-1.788519752,\n \"IRR\":148.7088080024194,\n \"BMIRR\":-84.87343195817056\n }\n */\n var num2commasStr = methods.putCommasToBigNumbers;\n\n [ \"INVESTED_AMOUNT\", \"CURRENT_VALUE\", \"GAINLOSS\", \"IRR\", \"BMIRR\" ].forEach( ( fieldName, ix ) => {\n var guiRow = Math.floor( ix/3 );\n var cell = ph.stack[3+ix] = {\n text: methods.putCommasToBigNumbers( JSONrecord[ fieldName ], 2 ) +\n ( guiRow ? '%' : '' )\n ,fontSize: 20\n ,bold: true\n //,margin: [0,10,0, 0]\n ,absolutePosition: {\n x: 45 + (ix%3)*142 + (ix===2 ? -4 : 0),\n y: 80 + Math.floor( ix/3 )*73\n }\n };\n if( \"GAINLOSS\" === fieldName ) {\n cell.color = fmethods.gainLossColor( JSONrecord[ fieldName ] );\n }\n });\n\n var fValue = JSONrecord[ \"REALISEDGAINLOSS\" ];\n ph.stack[8] =\n {\n text: methods.putCommasToBigNumbers( fValue, 2 )\n ,fontSize: 7\n ,color: fmethods.gainLossColor( fValue, null, '#888' )\n ,bold: false\n ,absolutePosition: {\n x: 45 + 325,\n y: 80 + 62\n }\n };\n\n\n var fValue = JSONrecord[ \"UNREALISEDGAINLOSS\" ];\n ph.stack[9] =\n {\n text: methods.putCommasToBigNumbers( fValue, 2 )\n ,fontSize: 7\n ,color: '#888'\n ,bold: false\n ,absolutePosition: {\n x: 45 + 333,\n y: 80 + 74\n }\n };\n\n var fValue = JSONrecord[ \"DIVIDEND\" ];\n ph.stack[10] =\n {\n text: methods.putCommasToBigNumbers( fValue, 2 )\n ,fontSize: 7\n ,color: fmethods.gainLossColor( fValue, null, '#888' )\n ,bold: false\n ,absolutePosition: {\n x: 45 + 319,\n y: 80 + 85\n }\n };\n return ph;\n }", "function fmdf_initComponentMeta() {\n\t\n\t//all containers wrapper\n\tfmdmeta_prop = {};\n\n\t//icon path\n\tfmdmeta_prop.iconpath = \"/images/designer/prop/\";\n\n\t//properties grid configuration\n\tfmdmeta_prop.gridconf = {};\n\tfmdmeta_prop.gridconf.isTreeGrid = true;\n\t//fmdmeta_prop.gridconf.treeIconPath = \"/images/designer/prop/\";\n\tfmdmeta_prop.gridconf.treeImagePath = \"/js/dhtmlx3/imgs/\";\n\tfmdmeta_prop.gridconf.extIconPath = \"/images/designer/prop/\";\n\tfmdmeta_prop.gridconf.header = [fmd_i18n_prop_prop,fmd_i18n_prop_value];\n\t//fmdmeta_prop.gridconf.subHeader;\n\tfmdmeta_prop.gridconf.colType=\"tree,ro\";\n\tfmdmeta_prop.gridconf.colIds=\"prop,value\";\n\tfmdmeta_prop.gridconf.colAlign=\"left,left\";\n\t//fmdmeta_prop.gridconf.colVAlign;\n\tfmdmeta_prop.gridconf.colSorting=\"na,na\";\n\t//fmdmeta_prop.gridconf.colMinWidth;\n\tfmdmeta_prop.gridconf.colInitWidth=\"160,120\";\n\tfmdmeta_prop.gridconf.colColor=\"#F8F8F8,white\";\n\t//fmdmeta_prop.gridconf.resize;\n\tfmdmeta_prop.gridconf.visibile=\"false,false\";\n\tfmdmeta_prop.gridconf.idx={};\n\tfmdmeta_prop.gridconf.idx.prop=0;\n\tfmdmeta_prop.gridconf.idx.value=1;\n\n\tfmdmeta_prop.common = {};\t//common properties settings for components\n\t//fmdmeta_prop.common.all = {};\t//common properties settings for all components\n\tfmdmeta_prop.common.layout = {};\t//common properties settings for all datacontrol components\n\t//fmdmeta_prop.common.datacontrol = {};\t//common properties settings for all datacontrol components\n\tfmdmeta_prop.common.usercontrol = {};\t//common properties settings for all usercontrol components\n\tfmdmeta_prop.layout = {};\t//properties settings for layout components\n\tfmdmeta_prop.control = {};\t//properties settings for all control components\n\t\n\t//predefined events\n\tfmdmeta_prop.gridPredefinedEvents = {\n\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t//alert((rId.indexOf('i18nname')!=-1)+\"==\"+rId+\"==\"+(!fmdc.grid_prop.cells(rId, fmdmeta_prop.gridconf.idx.value).getValue()));\n\t\t\tvar newv = fmdc.grid_prop.cells(rId, fmdmeta_prop.gridconf.idx.value).getValue();\n\t\t\tif (newv && cId==fmdmeta_prop.gridconf.idx.value) {\n\t\t\t\tif (rId=='valueValidation') {\n\t\t\t\t\tfmdpf_showConditionalSub(rId, newv, fmdmeta_prop.common.datacontrol.properties[rId]);\n\t\t\t\t} else if (rId=='contentType') {\n\t\t\t\t\tfmdpf_showConditionalSub(rId, newv, fmdmeta_prop.control.input.properties[rId]);\n\t\t\t\t}\n\t\t\t} else if (!fmdc.grid_prop.cells(rId, fmdmeta_prop.gridconf.idx.value).getValue() && rId.indexOf('i18nname')!=-1) {\n\t\t\t\tif ('i18nname-zh'==rId) {\n\t\t\t\t\tfmdc.grid_prop.cells(rId, fmdmeta_prop.gridconf.idx.value).setValue(fmd_i18n_untitled);\n\t\t\t\t} else {\n\t\t\t\t\tfmdc.grid_prop.cells(rId, fmdmeta_prop.gridconf.idx.value).setValue(\"Untitled\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t//available validators\n\tfmdmeta_prop.runtime_validators = [[\"\",\"\"],\n\t\t\t\t\t[\"NotEmpty\", fmd_i18n_vld_notempty],\n\t\t\t\t\t[\"ValidAplhaNumeric\", fmd_i18n_vld_alphanumeric],\n\t\t\t\t\t[\"ValidCurrency\", fmd_i18n_vld_currency],\n\t\t\t\t\t[\"ValidDate\", fmd_i18n_vld_date],\n\t\t\t\t\t[\"ValidDatetime\", fmd_i18n_vld_datetime],\n\t\t\t\t\t[\"ValidEmail\", fmd_i18n_vld_email],\n\t\t\t\t\t[\"ValidInteger\", fmd_i18n_vld_integer],\n\t\t\t\t\t[\"ValidIPv4\", fmd_i18n_vld_ipv4],\n\t\t\t\t\t[\"ValidNumeric\", fmd_i18n_vld_numeric],\n\t\t\t\t\t[\"ValidTime\", fmd_i18n_vld_time],\n\t\t\t\t\t[\"RegExp\", fmd_i18n_vld_regexp]\n\t ];\n\n\t/**\n\t * list of available controls\n\t */\n\t//all elements wrapper\n\t//fmdmeta_elem = {};\n\t//list all elements here with proper order\n\t//fmdmeta_elem.elemlist_basic = [\"input\",\"p\",\"textarea\",\"popupinput\",\"radio\",\"checkbox\",\"select\",\"multiselect\",\"dhxgrid\",\"customhtml\"];\n\n\n\t//==================== common ====================\n\n\t/**\n\t * common for all components\n\t */\n\tfmdmeta_prop.common.all = {\n\t\t\t\"properties\" : {\n\t\t\t\t\"id\" : {\n\t\t\t \t\"name\" : \"id\",\n\t\t\t \t\"img\" : \"id.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"fromattr\" : \"id\"},\n\t\t\t \t\"displayOnly\" : true\n\t\t\t },\n\t\t\t \"i18nname\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_i18nname,\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"img\" : \"locale.png\",\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"sub\" : {\n\t\t\t \t\t\"i18nname-zh\" : {\n\t\t\t \t\t\t\"name\" : fmd_i18n_prop_i18nname_zh,\n\t\t\t \t\t\t\"cellType\" : \"ed\",\n\t\t\t\t\t \t\"validator\" : \"NotEmpty\",\n\t\t\t\t\t \t\"img\" : \"zh.png\",\n\t\t\t\t\t \t\"value\" : {\"default\": fmd_i18n_untitled}\n\t\t\t \t\t},\n\t\t\t \t\t\"i18nname-en\" : {\n\t\t\t \t\t\t\"name\" : fmd_i18n_prop_i18nname_en,\n\t\t\t \t\t\t\"cellType\" : \"ed\",\n\t\t\t\t\t \t\"validator\" : \"NotEmpty\",\n\t\t\t\t\t \t\"img\" : \"en.png\",\n\t\t\t\t\t \t\"value\" : {\"default\": \"Untitled\"}\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t },\n\t\t\t \"display\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_display,\n\t\t\t \t\"img\" : \"display.png\",\n\t\t\t \t\"cellType\" : {\"type\":\"coro\",\n\t\t\t\t\t\t\t \t\"options\":[[\"displayblock\",fmd_i18n_prop_displayblock],\n\t\t\t\t\t\t\t\t\t\t [\"displayblockinline\",fmd_i18n_prop_displayblockinline],\n\t\t\t\t\t\t\t\t\t\t [\"displaynone\",fmd_i18n_prop_displaynone],\n\t\t\t\t\t\t\t\t\t\t [\"visibilityhidden\",fmd_i18n_prop_visibilityhidden]\n\t\t\t\t\t\t\t\t\t\t\t \t]\n\t\t\t \t\t\t\t},\n\t\t\t\t\t\"value\" : {\"default\" : \"displayblock\"}\n\t\t\t },\n\t\t\t \"style\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_style,\n\t\t\t \t\"img\" : \"css.png\",\n\t\t\t \t\"cellType\" : \"ace_text\"\n\t\t\t }\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\"onload\" : {\"name\" : fmd_i18n_ev_onload,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onclick\" : {\"name\" : fmd_i18n_ev_onclick,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onmouseover\" : {\"name\" : fmd_i18n_ev_onmouseover,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onmouseout\" : {\"name\" : fmd_i18n_ev_onmouseout,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t/**\n\t * common for all datacontrol components\n\t */\n\tfmdmeta_prop.common.datacontrol = {\n\t\t\t\"properties\" : {\n\t\t\t\t/*\"label\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_label,\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"validator\" : \"Required\"\n\t\t\t },*/\n\t\t\t \"hideLabel\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_hidelabel,\n\t\t\t \t\"cellType\" : \"ch\",\n\t\t\t \t\"value\" : {\"default\":\"0\"}\n\t\t\t },\n\t\t\t \"labelPosition\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_labelposition,\n\t\t\t \t\"cellType\" : {\"type\":\"coro\", \n\t\t\t \t\t\t\t\"options\":[[\"left\",fmd_i18n_prop_left],\n\t [\"right\",fmd_i18n_prop_right],\n\t [\"top\",fmd_i18n_prop_top],\n\t [\"bottom\",fmd_i18n_prop_bottom]\n\t\t\t \t\t\t\t]\n\t\t\t \t},\n\t\t\t \t\"value\" : {\"default\":\"top\"}\n\t\t\t },\n\t\t\t \"valueValidation\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_valuevalidation,\n\t\t\t\t \"cellType\" : {\n\t\t\t\t\t\t\"type\" : \"coro\",\n\t\t\t\t\t\t\"options\":fmdmeta_prop.runtime_validators\n\t\t\t\t },\n\t\t\t\t\t\"conditional-sub\" : {\n\t\t\t\t\t\t\"RegExp\" : {\n\t\t\t\t\t\t\t\"valueValidation-RegExp\" : {\n\t\t\t\t\t\t\t\t\"name\" : fmd_i18n_prop_regexp,\n\t\t\t\t\t\t\t\t\"cellType\" : \"ed\",\n\t\t\t\t\t\t\t\t\"validator\" : \"NotEmpty\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t }\n\t\t\t\t\t},\n\t\t\t\t \"value\" : {\"default\":\"\"}\n\t\t\t },\n\t\t\t \"disabled\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_disabled,\n\t\t\t \t\"cellType\" : \"ch\",\n\t\t\t \t\"value\" : {\"default\":\"0\"}\n\t\t\t },\n\t\t\t \"keepOnDisabled\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_keepondisabled,\n\t\t\t \t\"cellType\" : \"ch\",\n\t\t\t \t\"value\" : {\"default\":\"0\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\"onchange\" : {\"name\" : fmd_i18n_ev_onchange,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onfocus\" : {\"name\" : fmd_i18n_ev_onfocus,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onblur\" : {\"name\" : fmd_i18n_ev_onblur,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj\n\t\t\t\t\t}\n\t\t\t\t},\n//\t\t\t\t\"onDisabled\" : {},\n//\t\t\t\t\"onEnabled\" : {}\n\t\t\t}\n\t\t};\n\n\t//==================== layout ====================\n\n\t//properties settings for tab\n\tfmdmeta_prop.layout.tab = {\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_l_fmcontainer_tab},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t }\n\t\t\t},\n\t\t\t\"abandon-properties\" : [\"tiprow_specific\"],//format is array\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\"onactive\" : {\"name\" : fmd_i18n_ev_onactive,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj,\n\t\t\t\t\t\t\"obj\" : fmd_i18n_ev_eventthis\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\tvar vals = fmdc.data.propconf[fmdf_getSelected().attr(\"id\")];\n\t\t\t\tfmdf_fmcontainer_tab_title(vals[\"i18nname-\"+fmd.lang]);\n\t\t\t}\n\t\t};\n\n\t//properties settings for block\n\tfmdmeta_prop.layout.block = {\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_l_fmcontainer_block},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"pattern\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_container_pattern,\n\t\t\t \t\"img\" : \"pattern.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"fromattr\":\"fmdpattern\"},\n\t\t\t \t\"afterProperty\" : \"i18ntype\"\n\t\t\t },\n\t\t\t\t\"margintop\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_container_margintop,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\" : \"0.7\"},\n\t\t\t \t\"validator\" : \"ValidNumeric\"\n\t\t\t },\n\t\t\t \"noheader\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_container_noheader,\n\t\t\t \t\"cellType\" : \"ch\",\n\t\t\t \t\"value\" : {\"default\":\"0\"}\n\t\t\t },\n\t\t\t \"fold\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_container_fold,\n\t\t\t \t\"cellType\" : \"ch\",\n\t\t\t \t\"value\" : {\"default\":\"0\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\"onCollapse\" : {\"name\" : fmd_i18n_ev_oncollapse,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj,\n\t\t\t\t\t\t\"obj\" : fmd_i18n_ev_eventthis\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"onExpand\" : {\"name\" : fmd_i18n_ev_onexpand,\n\t\t\t\t\t\"arguments\" : {\n\t\t\t\t\t\t\"e\" : fmd_i18n_ev_eventobj,\n\t\t\t\t\t\t\"obj\" : fmd_i18n_ev_eventthis\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\tvar vals = fmdc.data.propconf[fmdf_getSelected().attr(\"id\")];\n\t\t\t\tfmdf_fmcontainer_block_title(vals[\"i18nname-\"+fmd.lang]);\n\t\t\t\tfmdc.selection.selectedobj.css('margin-top', vals[\"margintop\"]?vals[\"margintop\"]+'em':'0.7em');\n\t\t\t\tfmdf_fmcontainer_block_headerdisplay(vals[\"noheader\"]);\n\t\t\t}\n\t\t};\n\n\t//properties settings for cell\n\tfmdmeta_prop.layout.cell = {\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_l_fmcontainer_cell+\"(table td)\"},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t }/*,\n\t\t\t \"rowspan\" : {\n\t\t\t \t\"name\" : fmd_i18n_t_rowspan,\n\t\t\t \t\"img\" : \"rowspan.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"fromattr\":\"rowspan\", \"default\":\"1\"}\n\t\t\t },\n\t\t\t \"colspan\" : {\n\t\t\t \t\"name\" : fmd_i18n_t_colspan,\n\t\t\t \t\"img\" : \"colspan.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"fromattr\":\"colspan\", \"default\":\"1\"}\n\t\t\t }*/\n\t\t\t},\n\t\t\t\"abandon-properties\" : [\"i18nname\"],\t//format is array\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events\n\t\t\t},\n\t\t\t\"onApply\" : function() {}\n\t\t};\n\n\t//==================== control ====================\n\n\t\n\t\n\t//properties settings for text output\n\tfmdmeta_prop.control.p = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_p,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><p>Output Text</p>',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><p>Output Text</p>',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_p},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"abandon-events\" : [\"onchange\"],\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for text textarea\n\tfmdmeta_prop.control.textarea = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_textarea,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><textarea class=\"medium\" name=\"textarea\" cols=\"20\" rows=\"5\" ></textarea>',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><textarea class=\"medium\" name=\"textarea\" cols=\"20\" rows=\"5\" ></textarea>',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_textarea},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for text popupinput\n\tfmdmeta_prop.control.popupinput = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_popupinput,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><input class=\"large\" type=\"text\" name=\"input\" />',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><input class=\"large\" type=\"text\" name=\"input\" />',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_popupinput},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for dhxgrid\n\tfmdmeta_prop.control.dhxgrid = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"composite\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_dhxgrid,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : function() {\n\t\t\t\treturn '<table class=\"elem-grid\" style=\"width:300px;\"><tr><th>Column A</th><th>Column B</th></tr><tr><td>A</td><td>C</td></tr><tr><td>B</td><td>D</td></tr></table>';\n\t\t\t},\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : function() {\n\t\t\t\treturn '<table class=\"elem-grid\"><tr><th>Column A</th><th>Column B</th></tr><tr><td>A</td><td>C</td></tr><tr><td>B</td><td>D</td></tr></table>';\n\t\t\t},\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_dhxgrid},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for radio\n\tfmdmeta_prop.control.radio = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_radio,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"column column1\"><input type=\"radio\" name=\"radio\" value=\"options 1\" /><span>options 1</span><br/><input type=\"radio\" name=\"radio\" value=\"options 2\" /><span>options 2</span><br/><input type=\"radio\" name=\"radio\" value=\"options 3\" /><span>options 3</span><br/></div><span class=\"clearfix\"></span>',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"column column1\"><input type=\"radio\" name=\"radio\" value=\"options 1\" /><span>options 1</span><br/><input type=\"radio\" name=\"radio\" value=\"options 2\" /><span>options 2</span><br/><input type=\"radio\" name=\"radio\" value=\"options 3\" /><span>options 3</span><br/></div><span class=\"clearfix\"></span>',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_radio},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for radio\n\tfmdmeta_prop.control.checkbox = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_checkbox,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"column column1\"><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 1\"/ ><span>options 1</span><br/><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 2\"/ ><span>options 2</span><br/><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 3\"/ ><span>options 3</span><br/></div><span class=\"clearfix\"></span>',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"column column1\"><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 1\"/ ><span>options 1</span><br/><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 2\"/ ><span>options 2</span><br/><input type=\"checkbox\" name=\"checkbox[]\" value=\"options 3\"/ ><span>options 3</span><br/></div><span class=\"clearfix\"></span>',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_checkbox},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for select\n\tfmdmeta_prop.control.select = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"basic\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_select,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"large\"><span><select name=\"select\" >'+\n\t\t\t\t'<option value=\"options 1\">options 1</option><br/>'+\n\t\t\t\t'<option value=\"options 2\">options 2</option><br/>'+\n\t\t\t\t'<option value=\"options 3\">options 3</option><br/></select><i></i></span></div>',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '<label class=\"title\">'+fmd_i18n_untitled+'</label><div class=\"large\"><span><select name=\"select\" >'+\n\t\t\t\t'<option value=\"options 1\">options 1</option><br/>'+\n\t\t\t\t'<option value=\"options 2\">options 2</option><br/>'+\n\t\t\t\t'<option value=\"options 3\">options 3</option><br/></select><i></i></span></div>',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_select},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"bindings\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_binding,\n\t\t\t \t\"cellType\" : \"binding\"\n\t\t\t },\n\t\t\t \"maxLength\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_maxlength,\n\t\t\t \t\"cellType\" : \"ed\",\n\t\t\t \t\"value\" : {\"default\":\"10\"}\n\t\t\t }\n\t\t\t},\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events,\n\t\t\t\t\"controlcommon\" : fmdmeta_prop.common.datacontrol.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\n\t//properties settings for custom html\n\tfmdmeta_prop.control.customhtml = {\n\t\t\t//group for element list - basic/composite/custom/extended\n\t\t\t\"group\" : \"extended\",\n\t\t\t//control category\n\t\t\t\"controlcategory\" : \"datacontrol\",\n\t\t\t//i18n type name\n\t\t\t\"i18ntype\" : fmd_i18n_el_customhtml,\n\t\t\t//html code for dragging\n\t\t\tinnerhtml_dragging : '&lt;div&gt;'+fmd_i18n_el_customhtml+'&lt;/div&gt;',\n\t\t\t//html code after dropped\n\t\t\tinnerhtml_dropped : '&lt;div&gt;'+fmd_i18n_el_customhtml+'&lt;/div&gt;',\n\t\t\t\"includes-properties\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.properties\n\t\t\t},\n\t\t\t\"properties\" : {\n\t\t\t\t\"i18ntype\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_selectiontype,\n\t\t\t \t\"img\" : \"selection.png\",\n\t\t\t \t\"cellType\" : \"ro\",\n\t\t\t \t\"value\" : {\"default\":fmd_i18n_el_customhtml},\n\t\t\t \t\"displayOnly\" : true,\n\t\t\t \t\"afterProperty\" : \"id\"\n\t\t\t },\n\t\t\t \"htmlcode\" : {\n\t\t\t \t\"name\" : fmd_i18n_prop_htmlcode,\n\t\t\t \t\"img\" : \"html5.png\",\n\t\t\t \t\"cellType\" : \"ace_html\"\n\t\t\t }\n\t\t\t},\n\t\t\t\"abandon-properties\" : [\"i18nname\", \"style\"], //format is array\n\t\t\t\"includes-events\" : {\n\t\t\t\t\"common\" : fmdmeta_prop.common.all.events\n\t\t\t},\n\t\t\t\"events\" : {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"onApply\" : function() {\n\t\t\t\t\n\t\t\t},\n\t\t\t\"gridEvents\" : {\n\t\t\t\t\"onEditCell\" : function(stage,rId,cId,nv,ov) {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t\"onCellChanged\" : function(rId,cId,nv) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t};\n}", "function Header(props) {\r\n\tvar ths = [];\r\n\tfor (var groupName of props.groupNames) {\r\n\t\tths.push(\r\n\t\t\t<th key={groupName}>\r\n\t\t\t\t{showGroupColumnHeader(groupName, props.onDeleteGroup, props.onAddAllMembersToGroup)}\r\n\t\t\t</th>\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<thead>\r\n\t\t\t<tr height=\"30px\" valign=\"middle\">\r\n\t\t\t\t<th width=\"20%\"></th>\r\n\t\t\t\t{ths}\r\n\t\t\t\t<th width=\"5%\"></th>\r\n\t\t\t</tr>\r\n\t\t</thead>\r\n\t);\r\n}", "function renderTableHeader() {\r\n // table top\r\n const tableTop = document.createElement('tr')\r\n const Kleur = document.createElement('th')\r\n Kleur.setAttribute('colspan', '2')\r\n Kleur.classList.add('right')\r\n Kleur.textContent = 'Kleur'\r\n\r\n const Bloeiperiode = document.createElement('th')\r\n Bloeiperiode.textContent = 'Bloeiperiode'\r\n\r\n tableTop.appendChild(Kleur)\r\n tableTop.appendChild(Bloeiperiode)\r\n\r\n tableHead.appendChild(tableTop)\r\n\r\n\r\n // table monthes\r\n const tableMonths = document.createElement('tr')\r\n\r\n const emptyCol = document.createElement('td')\r\n emptyCol.setAttribute('colspan', '2')\r\n\r\n const monthsCol = document.createElement('td')\r\n const monthsDiv = document.createElement('div')\r\n monthsDiv.classList.add('months')\r\n\r\n months.forEach(month => {\r\n const monthBox = document.createElement('span')\r\n monthBox.classList.add('month-box')\r\n monthBox.classList.add('letter')\r\n monthBox.textContent = month\r\n\r\n monthsDiv.appendChild(monthBox)\r\n })\r\n\r\n monthsCol.appendChild(monthsDiv)\r\n\r\n tableMonths.appendChild(emptyCol)\r\n tableMonths.appendChild(monthsCol)\r\n\r\n tableHead.appendChild(tableMonths)\r\n }", "function buildNewsTableHeader() {\n\n var thead = d3.select(\"#news-header\");\n console.log(\"buildNewsTableHeader:\", thead);\n\n thead.html(\"\");\n var tr = thead.append(\"tr\");\n\n tr.append(\"th\")\n .attr(\"scope\", \"col\")\n .text(\"#\"); \n\n tr.append(\"th\")\n .attr(\"scope\", \"col\")\n .text(\"Source\");\n\n tr.append(\"th\")\n .attr(\"scope\", \"col\")\n .text(\"Title\");\n \n tr.append(\"th\")\n .attr(\"scope\", \"col\") \n .text(\"Image\")\n}", "function Header(calendar, options) {\n\tvar t = this;\n\t\n\t// exports\n\tt.render = render;\n\tt.removeElement = removeElement;\n\tt.updateTitle = updateTitle;\n\tt.activateButton = activateButton;\n\tt.deactivateButton = deactivateButton;\n\tt.disableButton = disableButton;\n\tt.enableButton = enableButton;\n\tt.getViewsWithButtons = getViewsWithButtons;\n\t\n\t// locals\n\tvar el = $();\n\tvar viewsWithButtons = [];\n\tvar tm;\n\n\n\tfunction render() {\n\t\tvar sections = options.header;\n\n\t\ttm = options.theme ? 'ui' : 'fc';\n\n\t\tif (sections) {\n\t\t\tel = $(\"<div class='fc-toolbar'/>\")\n\t\t\t\t.append(renderSection('left'))\n\t\t\t\t.append(renderSection('right'))\n\t\t\t\t.append(renderSection('center'))\n\t\t\t\t.append('<div class=\"fc-clear\"/>');\n\n\t\t\treturn el;\n\t\t}\n\t}\n\t\n\t\n\tfunction removeElement() {\n\t\tel.remove();\n\t\tel = $();\n\t}\n\t\n\t\n\tfunction renderSection(position) {\n\t\tvar sectionEl = $('<div class=\"fc-' + position + '\"/>');\n\t\tvar buttonStr = options.header[position];\n\n\t\tif (buttonStr) {\n\t\t\t$.each(buttonStr.split(' '), function(i) {\n\t\t\t\tvar groupChildren = $();\n\t\t\t\tvar isOnlyButtons = true;\n\t\t\t\tvar groupEl;\n\n\t\t\t\t$.each(this.split(','), function(j, buttonName) {\n\t\t\t\t\tvar customButtonProps;\n\t\t\t\t\tvar viewSpec;\n\t\t\t\t\tvar buttonClick;\n\t\t\t\t\tvar overrideText; // text explicitly set by calendar's constructor options. overcomes icons\n\t\t\t\t\tvar defaultText;\n\t\t\t\t\tvar themeIcon;\n\t\t\t\t\tvar normalIcon;\n\t\t\t\t\tvar innerHtml;\n\t\t\t\t\tvar classes;\n\t\t\t\t\tvar button; // the element\n\n\t\t\t\t\tif (buttonName == 'title') {\n\t\t\t\t\t\tgroupChildren = groupChildren.add($('<h2>&nbsp;</h2>')); // we always want it to take up height\n\t\t\t\t\t\tisOnlyButtons = false;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ((customButtonProps = (calendar.options.customButtons || {})[buttonName])) {\n\t\t\t\t\t\t\tbuttonClick = function(ev) {\n\t\t\t\t\t\t\t\tif (customButtonProps.click) {\n\t\t\t\t\t\t\t\t\tcustomButtonProps.click.call(button[0], ev);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\toverrideText = ''; // icons will override text\n\t\t\t\t\t\t\tdefaultText = customButtonProps.text;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ((viewSpec = calendar.getViewSpec(buttonName))) {\n\t\t\t\t\t\t\tbuttonClick = function() {\n\t\t\t\t\t\t\t\tcalendar.changeView(buttonName);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tviewsWithButtons.push(buttonName);\n\t\t\t\t\t\t\toverrideText = viewSpec.buttonTextOverride;\n\t\t\t\t\t\t\tdefaultText = viewSpec.buttonTextDefault;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (calendar[buttonName]) { // a calendar method\n\t\t\t\t\t\t\tbuttonClick = function() {\n\t\t\t\t\t\t\t\tcalendar[buttonName]();\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\toverrideText = (calendar.overrides.buttonText || {})[buttonName];\n\t\t\t\t\t\t\tdefaultText = options.buttonText[buttonName]; // everything else is considered default\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (buttonClick) {\n\n\t\t\t\t\t\t\tthemeIcon =\n\t\t\t\t\t\t\t\tcustomButtonProps ?\n\t\t\t\t\t\t\t\t\tcustomButtonProps.themeIcon :\n\t\t\t\t\t\t\t\t\toptions.themeButtonIcons[buttonName];\n\n\t\t\t\t\t\t\tnormalIcon =\n\t\t\t\t\t\t\t\tcustomButtonProps ?\n\t\t\t\t\t\t\t\t\tcustomButtonProps.icon :\n\t\t\t\t\t\t\t\t\toptions.buttonIcons[buttonName];\n\n\t\t\t\t\t\t\tif (overrideText) {\n\t\t\t\t\t\t\t\tinnerHtml = htmlEscape(overrideText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (themeIcon && options.theme) {\n\t\t\t\t\t\t\t\tinnerHtml = \"<span class='ui-icon ui-icon-\" + themeIcon + \"'></span>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (normalIcon && !options.theme) {\n\t\t\t\t\t\t\t\tinnerHtml = \"<span class='fc-icon fc-icon-\" + normalIcon + \"'></span>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tinnerHtml = htmlEscape(defaultText);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tclasses = [\n\t\t\t\t\t\t\t\t'fc-' + buttonName + '-button',\n\t\t\t\t\t\t\t\ttm + '-button',\n\t\t\t\t\t\t\t\ttm + '-state-default'\n\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\tbutton = $( // type=\"button\" so that it doesn't submit a form\n\t\t\t\t\t\t\t\t'<button type=\"button\" class=\"' + classes.join(' ') + '\">' +\n\t\t\t\t\t\t\t\t\tinnerHtml +\n\t\t\t\t\t\t\t\t'</button>'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.click(function(ev) {\n\t\t\t\t\t\t\t\t\t// don't process clicks for disabled buttons\n\t\t\t\t\t\t\t\t\tif (!button.hasClass(tm + '-state-disabled')) {\n\n\t\t\t\t\t\t\t\t\t\tbuttonClick(ev);\n\n\t\t\t\t\t\t\t\t\t\t// after the click action, if the button becomes the \"active\" tab, or disabled,\n\t\t\t\t\t\t\t\t\t\t// it should never have a hover class, so remove it now.\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tbutton.hasClass(tm + '-state-active') ||\n\t\t\t\t\t\t\t\t\t\t\tbutton.hasClass(tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tbutton.removeClass(tm + '-state-hover');\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\t.mousedown(function() {\n\t\t\t\t\t\t\t\t\t// the *down* effect (mouse pressed in).\n\t\t\t\t\t\t\t\t\t// only on buttons that are not the \"active\" tab, or disabled\n\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-active')\n\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t.addClass(tm + '-state-down');\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.mouseup(function() {\n\t\t\t\t\t\t\t\t\t// undo the *down* effect\n\t\t\t\t\t\t\t\t\tbutton.removeClass(tm + '-state-down');\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t.hover(\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t// the *hover* effect.\n\t\t\t\t\t\t\t\t\t\t// only on buttons that are not the \"active\" tab, or disabled\n\t\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-active')\n\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t\t.addClass(tm + '-state-hover');\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t// undo the *hover* effect\n\t\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t\t.removeClass(tm + '-state-hover')\n\t\t\t\t\t\t\t\t\t\t\t.removeClass(tm + '-state-down'); // if mouseleave happens before mouseup\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tgroupChildren = groupChildren.add(button);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (isOnlyButtons) {\n\t\t\t\t\tgroupChildren\n\t\t\t\t\t\t.first().addClass(tm + '-corner-left').end()\n\t\t\t\t\t\t.last().addClass(tm + '-corner-right').end();\n\t\t\t\t}\n\n\t\t\t\tif (groupChildren.length > 1) {\n\t\t\t\t\tgroupEl = $('<div/>');\n\t\t\t\t\tif (isOnlyButtons) {\n\t\t\t\t\t\tgroupEl.addClass('fc-button-group');\n\t\t\t\t\t}\n\t\t\t\t\tgroupEl.append(groupChildren);\n\t\t\t\t\tsectionEl.append(groupEl);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsectionEl.append(groupChildren); // 1 or 0 children\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn sectionEl;\n\t}\n\t\n\t\n\tfunction updateTitle(text) {\n\t\tel.find('h2').text(text);\n\t}\n\t\n\t\n\tfunction activateButton(buttonName) {\n\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t.addClass(tm + '-state-active');\n\t}\n\t\n\t\n\tfunction deactivateButton(buttonName) {\n\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t.removeClass(tm + '-state-active');\n\t}\n\t\n\t\n\tfunction disableButton(buttonName) {\n\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t.attr('disabled', 'disabled')\n\t\t\t.addClass(tm + '-state-disabled');\n\t}\n\t\n\t\n\tfunction enableButton(buttonName) {\n\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t.removeAttr('disabled')\n\t\t\t.removeClass(tm + '-state-disabled');\n\t}\n\n\n\tfunction getViewsWithButtons() {\n\t\treturn viewsWithButtons;\n\t}\n\n}", "function _createHeader() {\n var backgroundSurface = new Surface({\n content: '<div class=\"styled-select\"><select id=\"select-box\"></select></div>',\n properties: {\n backgroundColor: 'white',\n color: 'blue',\n }\n });\n\n var backgroundModifier = new StateModifier({\n transform : Transform.behind\n });\n\n this.layout.header.add(backgroundModifier).add(backgroundSurface);\n }", "function renderHeader() {\n var tableHeader = document.createElement('tr')\n table.append(tableHeader)\n var cityLabel = document.createElement('th');\n cityLabel.textContent = 'Store Location';\n tableHeader.append(cityLabel);\n for (var i = 0; i < hours.length; i++) {\n var headerCellHour = document.createElement('th');\n headerCellHour.textContent = hours[i];\n tableHeader.append(headerCellHour);\n }\n var dailyTotalLabel = document.createElement('th');\n dailyTotalLabel.textContent = 'End of day Sales'\n tableHeader.append(dailyTotalLabel)\n}", "get header() {\n return Object(_polymer_polymer_lib_legacy_polymer_dom_js__WEBPACK_IMPORTED_MODULE_3__[\"dom\"])(this.$.headerSlot).getDistributedNodes()[0];\n }", "get header() {\n return Object(_polymer_polymer_lib_legacy_polymer_dom_js__WEBPACK_IMPORTED_MODULE_3__[\"dom\"])(this.$.headerSlot).getDistributedNodes()[0];\n }", "updateHeader(e) {\n\n\n //updates\n var newWidth = parseInt(this.originalWidth) - ((this.screenX - e.screenX)) + \"px\";\n this.vGridConfig.columnWidthArray[this.index] = parseInt(newWidth);\n this.xElement.offsetParent.style.width = parseInt(this.originalWidth) - ((this.screenX - e.screenX)) + \"px\";\n this.xElement.offsetParent.style.width = parseInt(this.originalWidth) - ((this.screenX - e.screenX)) + \"px\";\n\n\n //if resize also row attribute is set to true, then we also need to update them\n if (this.vGridConfig.resizableHeadersAndRows) {\n var columnsToFix = this.vGridGenerator.htmlCache.content.firstChild.querySelectorAll(\".\" + this.vGridConfig.css.rowColumn + this.index);\n\n for (var col = 0; col < columnsToFix.length; col++) {\n columnsToFix[col].style.width = newWidth\n }\n\n this.vGridGenerator.correctRowAndScrollbodyWidth();\n this.vGridGenerator.updateGridScrollbars();\n\n }\n\n }" ]
[ "0.65234226", "0.6505486", "0.6413109", "0.6380549", "0.6181069", "0.6154904", "0.6051827", "0.59653074", "0.58937305", "0.58296263", "0.5820199", "0.5790314", "0.56836903", "0.5657634", "0.5587748", "0.5529591", "0.5523908", "0.5519103", "0.5504231", "0.5486227", "0.5486227", "0.5483574", "0.54764533", "0.5464382", "0.54611397", "0.54277414", "0.5423843", "0.5410312", "0.540998", "0.54070103", "0.54070103", "0.54031974", "0.53938067", "0.5393505", "0.5393488", "0.5368613", "0.53587645", "0.53402805", "0.53366417", "0.53336906", "0.53176755", "0.53070515", "0.53065866", "0.5305189", "0.5300332", "0.529882", "0.5296266", "0.5285316", "0.52823293", "0.5281997", "0.5279797", "0.5279797", "0.52777946", "0.5277731", "0.527478", "0.5274589", "0.52721894", "0.52721894", "0.52721894", "0.52721894", "0.52721894", "0.52721894", "0.5271115", "0.52567625", "0.52546364", "0.5253842", "0.5252848", "0.5252848", "0.5249535", "0.5235845", "0.5232904", "0.52308565", "0.5226073", "0.52248466", "0.5221085", "0.5220292", "0.5220004", "0.5206189", "0.52019", "0.5198247", "0.5193276", "0.51921475", "0.51920253", "0.51857", "0.51857", "0.51815057", "0.5167742", "0.51677245", "0.516645", "0.516536", "0.5163506", "0.5162084", "0.5159289", "0.51587474", "0.51550144", "0.51546353", "0.5150611", "0.51470387", "0.51470387", "0.5144108" ]
0.7719048
0
import Search from "./components/Search";
function App() { return ( <> <FetchData /> </> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n return (\n\n <div>\n This is React search Component !\n </div>\n );\n }", "render() { \n return (\n <div className='container'>\n <h1 className='text-center mt-3'>REACT 101</h1>\n <SearchBar/>\n </div>\n ) \n }", "function App() {\n\n\n\n return (\n <div className=\"App\">\n <SearchGym />\n <Home />\n </div>\n );\n}", "function App() {\n return (\n <div>\n <SearchMovies />\n </div>\n );\n}", "function Home() {\r\n return (\r\n <>\r\n <HeroSection/>\r\n <HomeSearch/>\r\n </>\r\n );\r\n}", "function App() {\n return (\n <div>\n <PageHdr />\n <Search />\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Navbar />\n <SearchResults />\n </div>\n );\n}", "function Search() {\n return (\n <div>\n <Jumbotron />\n <Container />\n <Books />\n </div>\n )\n}", "function App() {\n return <Container>\n <Head>\n <AppName><div >React Movie App</div>\n </AppName>\n {/* <SearchBox>\n \n <SearchInput placeholder=\"Search Movie\" /> \n </SearchBox> */}\n </Head>\n \n \n </Container>\n \n \n \n }", "render() {\n return (\n <div id=\"navMenu\" className=\"o-navbar\">\n <NavList />\n\n <Search />\n </div>\n )\n }", "function Search({ handleSearch }) {\n return (\n <form className=\"form\" onSubmit={(event) => handleSearch(event)}>\n <label className=\"form-title\">Book Search</label>\n <div className=\"form-inline justify-content-center\">\n <input\n type=\"search\"\n name=\"search\"\n className=\"form-control\"\n id=\"search\"\n placeholder=\"Enter book title\"\n />\n <button type=\"submit\" className=\"btn btn-primary font-weight-bold\">\n Search\n </button>\n </div>\n </form>\n );\n}", "componentDidMount() {\n this.useSearchEngine();\n \n }", "render() {\n return (\n <div className=\"head-bar\">\n <h1 className=\"head-title\">POLUTFORSKER</h1>\n <form className=\"search-form\" onSubmit={this.handleSubmit}>\n <Field\n name=\"search\"\n component=\"input\"\n type=\"text\"\n placeholder=\"Search...\"\n />\n </form>\n </div>\n );\n }", "function SearchButton() {\n return (\n <div className=\"open-search\">\n <Link to=\"/search\">Add a book</Link>\n </div>\n )\n}", "function App() {\n return (\n <div>\n <h2>Hacker News</h2>\n <ReactArticles />\n {/* <SearchBar /> */}\n\n\n </div>\n );\n}", "function SearchBar()\n{\n return(\n <div className= \"SearchBar\">\n <input className = \"Search\" type = \"text\" placeholder = \"Type to search...\" />\n </div>\n )\n}", "componentDidMount() {\n this.makeFullSearch();\n }", "function artBoofunc() {\n return (\n <SearchFile />\n );\n }", "render(){\n \n return (\n <div className=\"App\" >\n <Router>\n <Header />\n <Search searchBooks={this.searchBooks} books={this.state.books} />\n <BookDisplay books={this.state.books} />\n </Router>\n </div>\n );\n }", "function Search(props){\n return (\n <div className=\"search-cont side-content\">\n <h1>Search</h1>\n <form>\n <label htmlFor=\"search-name\">Title</label>\n <input id=\"search-name\" onChange={(ev) => props.changeFilter(ev, 'title')}></input>\n <label htmlFor=\"search-studio\">Studio</label>\n <input id=\"search-studio\" onChange={(ev) => props.changeFilter(ev, 'studio')}></input>\n <label htmlFor=\"search-content\">Content</label>\n <input id=\"search-content\" onChange={(ev) => props.changeFilter(ev, 'synopsis')}></input>\n </form>\n </div>\n )\n }", "componentDidMount() {\n this.performSearch()\n }", "onSearch() {\n const {\n onBarsSearch,\n location\n } = this.props;\n onBarsSearch(location);\n }", "componentDidMount() {\n this.search();\n }", "handleClickEvent() {\n this.props.fetchSearch(this.state.search)\n }", "componentDidMount() {\n this.performSearch();\n }", "componentDidMount() {\n this.performSearch();\n }", "onActionClickSearchBar() {\n this.search(this.state.search)\n }", "function SearchBar(props){\n return(\n <SearchContainer>\n <SearchBox onChange={props.onChange} placeholder=\"Search for artist\"></SearchBox>\n {/* <SearchButton>\n <SearchIcon/>\n </SearchButton> */}\n </SearchContainer>\n )\n}", "search() {\n this.props.onSearch(this.state.searchValue);\n }", "function Search(){\n return(\n <Stack.Navigator>\n <Stack.Screen name=\"Search\" component={SearchScreen} />\n </Stack.Navigator>\n );\n}", "search() {\n let location = ReactDOM.findDOMNode(this.refs.Search).value;\n if (location !== '') {\n let path = `/search?location=${location}`;\n makeHTTPRequest(this.props.updateSearchResults, path);\n }\n }", "function Search(props) {\n return (\n <div className=\"Search\">\n <label id=\"searchBar\">\n <input id=\"searchInput\" placeholder=\"Enter your search here...\" onChange={(event) => props.searchContent(event)}></input>\n <select id=\"media\" onChange={(event) => props.searchMedia(event)}>\n <option>--Media--</option>\n <option>music</option>\n <option>movie</option>\n <option>podcast</option>\n <option>musicVideo</option>\n <option>audiobook</option>\n <option>shortFilm</option>\n <option>tvShow</option>\n <option>software</option>\n <option>ebook</option>\n </select>\n <button id=\"searchButton\" type=\"submit\" onClick={props.search}>Search</button>\n </label>\n </div>\n );\n}", "function App() {\n return (\n // <GooglePexel></GooglePexel>\n <GoogleBooksSearch></GoogleBooksSearch>\n // <div className=\"row\">\n // <div className=\"col-md-8 offset-md-2\">\n // {/* <Contacts /> */}\n // <Country />\n // </div>\n // </div>\n )\n}", "render() {\n return (<div>\n <h1>Github Fetcher</h1>\n <Lists lists={this.state.lists}/>\n <Search onSearch={this.search.bind(this)}/> \n </div>);\n }", "render() {\r\n\r\n\t\t\r\n\t\treturn (\r\n\t\t\t<div class={style.searchBar}>\r\n\t\t\t\t<input type=\"text\" onKeyPress={this.props.onKeyPressed} placeholder=\"Search For A City\" />\r\n\t\t\t</div>\r\n\t\t);\r\n\t}", "function SearchBar(props) {\n return (\n <div className=\"SearchBar\">\n <form>\n <i className=\"SearchIcon fa fa-search\"></i>\n <input type=\"text\" name=\"query\" placeholder=\"Search...\"/>\n </form>\n </div>\n );\n}", "function App() {\n\n\n return (\n <div className=\"App\">\n <Navi></Navi>\n<Searchbar></Searchbar>\n \n <Products></Products>\n \n <Footer></Footer>\n </div>\n );\n}", "function SearchForm(props){\n \n return(\n <div>\n\n <p className='lead'>Book Search</p>\n\n <label\n for='title'\n > Book\n </label>\n <input name='title'\n placeholder='Search for a book...'\n type='text'></input>\n <button\n onClick={props.handleFormSubmit}\n type='submit'\n value='Submit'></button>\n </div>\n )\n}", "function Search(props) {\n return (\n <div className=\"form-group\">\n <label >Search Name:</label>\n <input\n type = \"search\"\n onChange={event => props.getFilterEmployees(event)}\n />\n </div>\n );\n}", "componentDidMount() {\n this.props.onSearch(this.props.query);\n }", "function Searcher(props) {\n return (\n <Form onSubmit={props.onSubmit}>\n <InputSearcher\n name=\"buscar\"\n type=\"text\"\n placeholder=\"Busca por canción, artista o álbum\"\n />\n <Button>Buscar</Button>\n </Form>\n )\n}", "function SearchBar(props) {\n console.log('these r our props', props);\n return (\n <form className=\"search\">\n <div className=\"form-group\">\n <label htmlFor=\"language\">Search Name:</label>\n <input\n onChange={props.searchChange}\n name=\"term\"\n className=\"form-control\"\n placeholder=\"Type in a search term to begin\"\n id=\"term\"\n />\n </div>\n </form>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n {/*<Table />*/}\n <Sticky />\n {/*<TableExamplePagination />*/}{/*https://www.geeksforgeeks.org/reactjs-importing-exporting/*/}\n {/*<Scroll />*/}\n </div>\n );\n}", "render() {\n //this is where const {search } = this.state;\n return (\n <div>\n <form onSubmit={this.handleSubmit} className=\"form-inline my-2 my-lg-0\">\n <input\n className=\"form-control mr-sm-2\"\n type=\"text\"\n placeholder=\"ID Number\"\n aria-label=\"search\"\n name=\"fullName\"\n ></input>\n\n <button\n className=\"btn btn-outline-success my-2 my-sm-0\"\n type=\"submit\"\n >\n Search\n </button>\n </form>\n </div>\n );\n }", "componentDidMount() {\n this.handleSearch(this.state.query);\n }", "function Search(props) {\n function handleInput(e){\n props.search(e.target.value);\n }\n\n return (\n <div style={{marginTop:\"50px\"}}>\n <div className=\"input-group mb-3\">\n <div className=\"input-group-prepend\">\n <span className=\"input-group-text\" id=\"inputGroup-sizing-default\">Search</span>\n </div>\n <input type=\"text\" className=\"form-control\" aria-label=\"Default\" \n aria-describedby=\"inputGroup-sizing-default\" onChange={handleInput}></input>\n </div>\n </div>\n )\n}", "componentDidMount() {\n this.executeSearch();\n }", "getModuleName() {\n return 'Search';\n }", "function Searchbar({searchfield,searchChange}){\r\n\treturn(\r\n\t\t\t<div>\r\n\t\t\t\t<input className=\"pa3 ba b--green bg-lightest-green\" \r\n\t\t\t\ttype=\"search\" \r\n\t\t\t\tplaceholder=\"Search!!\"\r\n\t\t\t\tonChange={searchChange} />\r\n\t\t\t\t// triggers searchChange method of main app component event\r\n\t\t\t</div>\t\r\n\t);\r\n}", "function mapStateToProps(state) {\nreturn {\n studentSearch: state.StudentSearch\n};\n}", "function Nav({ handleSearchChange }) {\n return (\n <nav className=\"navbar navbar-expand navbar-light bg-light\">\n <div className=\"navbar-collapse row\" id=\"navbarNav\">\n <SearchBar handleSearchChange={handleSearchChange} />\n </div>\n </nav>\n );\n}", "function UserSearch({\n /* form, field, keyword,\n onSearch, */\n onAdd,\n}) {\n return (\n <div className={styles.normal}>\n <div className={styles.search}>\n ...\n </div>\n <div className={styles.create}>\n <Button type=\"ghost\" onClick={onAdd}>\n 添加\n </Button>\n </div>\n </div>\n );\n}", "render()\n {\n return (\n <Router>\n <div className=\"container\">\n <Header />\n <SearchForm onSearch={this.performSearch} />\n <Nav navSearch={this.performSearch} />\n\n {/* Write routes here... */}\n <Switch>\n <Route exact path=\"/\" render={() => <Redirect to=\"/search/soccer\" />} />\n <Route path=\"/search/:query\" render={({match}) => \n (\n <PhotoResults \n data={this.state.images} \n match={match}\n getResults={this.performSearch}\n isLoading={this.state.loading}\n /> \n )} \n />\n <Route component={Error} />\n </Switch>\n </div>\n </Router>\n );\n }", "search() {\n\t\tthis.props.onSearch(this.state.term);\n\t}", "function openSearch() {\n\tAlloy.createController(\"search/index\");\n}", "function openSearch() {\n\tAlloy.createController(\"search/index\");\n}", "constructor()\r\n\t {\r\n\t super();\r\n\r\n\t this.submitHandler=this.submitHandler.bind(this);/*Will bind submitHandler to the SearchBarComponent component*/\r\n\t }", "function Header(){\n\nreturn(\n<>\n <div className=\"page3Main\">\n <AppName />\n {/* <Searchandbutton /> */}\n </div>\n</>\n)\n\n}", "function SearchLight(props) { return <SearchInput initText={ props.initText } appTheme={ props.appTheme } onSubmit={ props.onSubmit } onDismiss={ props.onDismiss }/> }", "render() {\n return (\n <div>\n <SelectSearch options={this.props.options} value={this.props.value} />\n </div>\n );\n }", "render() {\n return (\n <div className=\"ui container\" style={{ marginTop: '10px' }}>\n <Header />\n <Route path=\"/\">\n <Home />\n </Route>\n <Route path=\"/search\">\n <SearchBar onSubmit={this.onSearchSubmit} />\n {!this.state.results.length ? (\n <div>Waiting for Search Parameter</div>\n ) : (\n <ResultList results={this.state.results} />\n )}\n </Route>\n <Route path=\"/history\">\n <History history={history} />\n </Route>\n </div>\n );\n }", "handleSearchClick(){\n\n this.doSearch();\n\n }", "render() {\n return(\n <div className=\"login-signup-search\"> \n <div className=\"login-signup-search-form\">\n <Form onSubmit={(event) => this.handleSubmit(event)}>\n <Form.Field control=\"text\" onChange={(event) => this.handleChange(event)}>\n <input placeholder='Search Artists' value={this.state.searchName}/>\n <Button type='submit'>Submit</Button>\n </Form.Field>\n </Form>\n </div>\n </div>\n )\n }", "function Header(props) {\n\n // Important variables\n const { handleSearch, setSearch, search } = props;\n\n // Return UI\n return (\n\n <header id=\"Header\" className=\"container-fluid row m-0\" style={{ backgroundImage: `url(${img1})` }} >\n\n <div className=\"col-sm-9 mx-auto align-self-center text-center text-white\">\n\n <h1 className=\"text-white\"> Let's find the best home for you </h1>\n\n <p> Search our inventory on thousands of homes, a click away. </p>\n\n { /* Search field block - Start */}\n <Search handleSearch={handleSearch} setSearch={setSearch} search={search} />\n { /* Search field block - End */}\n\n </div>\n\n </header>\n );\n}", "render() {\n return (\n <div>\n <div>\n <nav className=\"navbar navbar-custom\">\n <div className=\"container-fluid\">\n <div className=\"navbar-header\">\n <a className=\"navbar-brand\" href=\"#\">\n SpringBoard LearningHub - one stop hub for all the learning paths\n </a>\n </div>\n </div>\n </nav>\n </div>\n <SearchBar />\n <div className=\"row\">\n <CourseList />\n <CourseDetail />\n </div>\n </div>\n );\n }", "componentDidMount() {\n const searchTerm = this.props.match.params.searchTerm;\n this.props.submitSearch(searchTerm);\n }", "AddSearchProvider() {}", "componentDidMount() {\n this.searchItems()\n }", "constructor() {\n super();\n this.searchField = document.querySelector(\".type-search\");\n }", "render(){\n\t\t// every class must have a render method \n\t\treturn(\n\t\t\t<div className=\"search-bar\">\n\t\t \t\t<input \n\t\t \t\t\tvalue = {this.state.term} // this turns into controlled component\n\t\t \t\t\tonChange={(event) => this.onInputChange(event.target.value)} />\n\t\t \t</div>\n\t\t );\n\t}", "function Search() {\n const {\n ready,\n value,\n suggestions: { status, data },\n setValue,\n clearSuggestion,\n } = usePlacesAutoComplete({\n requestOptions: {\n location: { lat: () => 61.24677, lng: () => -149.92566 },\n radius: 200 * 1000,\n },\n });\n\n return (\n <div className=\"search\">\n \n </div>\n );\n }", "render() {\n\n return (\n <div className=\"app\">\n <Route exact path=\"/\"\n render={ () => (\n <ListBooks\n books={ this.state.books }\n changeShelf={ this.changeShelf }\n />\n )}\n />\n <Route exact path=\"/search\"\n render={ () => (\n <SearchBooks\n books={ this.state.books }\n searched={ this.state.searched }\n searchAllBooks={ this.searchAllBooks }\n changeShelf={ this.changeShelf }\n error={ this.state.error }\n />\n )}\n />\n </div>\n )\n }", "render() {\n return (\n <div>\n <h1>Ja<span className=\"highlight\">mmm</span>ing</h1>\n <div className=\"App\">\n <SearchBar onSearch={this.search} />\n <div className=\"App-playlist\">\n <SearchResults searchResults={this.state.searchResults}\n onAdd={this.addTrack}/>\n <PlayList name={this.state.playlistName}\n tracks={this.state.playlistTracks} onRemove={this.removeTrack}\n onNameChange={this.updatePlaylistName} onSave={this.savePlaylist} />\n </div>\n </div>\n </div>\n );\n }", "function App() {\n // const [input, setInput] = useState(\"\");\n\n // const searchSubmit = () => {\n // API.searchBooks(input).then((data) => console.log(data));\n\n return (\n <Router>\n <div>\n <Nav />\n <Route>\n <Switch>\n <Route exact path=\"/\" component={Search} />\n <Route exact path=\"/pages/saved\" component={Saved} />\n <Route exact path=\"/pages/saved/:id\" component={Saved} />\n <Route exact path=\"/pages/Empty\" component={Empty} />\n </Switch>\n </Route>\n </div>\n </Router>\n );\n}", "function Jumbotron(props) {\n return (\n <div className=\"p-5 m-4 bg-info border rounded-3\">\n <div className=\"container-fluid py-5\">\n <h1 className=\"display-5 fw-bold\">Employee Directory</h1>\n <p className=\"col-md-8 fs-4\">Click on the columns labels to filter by heading or use the search box to narrow your results.</p>\n <Search\n search={props.search}\n handleFormSubmit={props.handleFormSubmit}\n handleInputChange={props.handleInputChange}\n />\n </div>\n </div>\n\n );\n}", "render() {\n return (\n <div className=\"app\">\n <Route exact path=\"/\" render={() => (\n <ListBooks books={this.state.books} changeShelf={this.changeShelf} />\n )}\n />\n <Route path=\"/search\" render={({ history }) => (\n <SearchBooks books={this.state.books} changeShelf={this.changeShelf} />\n )} />\n <div className=\"open-search\">\n <Link to=\"/search\">Search</Link>\n </div>\n </div> \n )\n }", "render() {\n return (\n <div className=\"app\">\n <Route exact path=\"/\" render={() => (\n <BooksLibrary\n books={this.state.books}\n moveBook={this.moveBook}\n />\n )} />\n\n <Route path=\"/search\" render={() => (\n <BooksSearch\n books={this.state.books}\n moveBook={this.moveBook}\n />\n )} />\n </div>\n )\n }", "triggersearch(){\r\n\t\t\tlet query='';\r\n\t\t\tif(this.props.keyword){\r\n\t\t\t\tquery=this.props.keyword\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tquery=this.props.query\r\n\t\t\t}\r\n\t\t\tthis.props.fetchSearchResults(query);\r\n\t}", "handleSearch() {\n this.props.searchBeerApi(this.state.term);\n }", "function App() {\n return (\n <div className=\"app\">\n <Pathfinder />\n </div>\n );\n}", "function App() {\n return (\n <>\n <Nav/>\n <Router>\n <Home path=\"/\"/>\n <RepoHome path=\"search-repo\"/>\n </Router>\n </>\n );\n}", "render() {\n return (\n <div className=\"app\">\n <Route exact path=\"/\" render={() => (\n <div className=\"list-books\">\n <div className=\"list-books-title\">\n <h1>MyReads</h1>\n </div>\n <BookShelf bookList={this.state.bookList} />\n <div className=\"open-search\">\n <Link\n to=\"/search\"\n > Add a book\n </Link>\n </div>\n </div>\n )}/>\n <Route path=\"/search\" render={() => (\n <SearchBooks bookList={this.state.bookList} />\n )}/>\n </div>\n );\n }", "componentDidMount() {\n this.employeeSearch();\n }", "render() {\n\n return (\n <div className=\"buttoncontainer\">\n <button>Search!</button>\n </div>\n );\n }", "render() {\n return (\n <div className=\"container\">\n <SearchForm onSearch={this.performSearch}/>\n <AvengerLinks onClick={this.performSearch}/>\n <Gallery data={this.state.images} title={this.state.title}/>\n </div>\n );\n }", "function Homepage() {\n return (\n <div className=\"home\">\n <SearchCity />\n <Footer />\n </div>\n \n \n );\n}", "render() {\n return (\n <div className=\"app\">\n <Switch>\n <Route\n exact\n path=\"/\"\n render={() => (\n <BookManager\n books={this.state.books}\n createBooks={this.createBooks}\n />\n )}\n />\n <Route\n exact\n path=\"/search\"\n render={() => (\n <Search\n books={this.state.searchBooks}\n query={this.state.query}\n createBooks={this.createBooks}\n handleSearch={this.handleSearch}\n />\n )}\n />\n <Route component={NoMatch}/>\n </Switch>\n </div>\n );\n }", "function SearchInput(props){\n return (\n <div>\n <span><p>Enter a Name to Search </p>\n <input\n onChange={props.handleInputChange}\n value={props.search}\n name=\"search\"\n type=\"text\"\n className=\"Usersearch\"\n placeholder=\"Enter a name to search\"\n id=\"search\"\n />\n </span>\n </div>\n )\n}", "render() {\n return (\n <Container>\n <Header />\n \n \n <SearchForm\n value={this.state.search}\n handleInputChange={this.handleInputChange}\n \n />\n <Table employees ={this.state.employees} search={this.state.search}/>\n\n\n </Container>\n );\n }", "render() {\n return (\n <header className=\"menu\">\n <div className=\"menu-container\">\n <div className=\"menu-holder\">\n <h1>ELC</h1>\n <nav>\n <a href=\"#\" className=\"nav-item\">HOLIDAY</a>\n <a href=\"#\" className=\"nav-item\">WHAT'S NEW</a>\n <a href=\"#\" className=\"nav-item\">PRODUCTS</a>\n <a href=\"#\" className=\"nav-item\">BESTSELLERS</a>\n <a href=\"#\" className=\"nav-item\">GOODBYES</a>\n <a href=\"#\" className=\"nav-item\">STORES</a>\n <a href=\"#\" className=\"nav-item\">INSPIRATION</a>\n\n <a href=\"#\" onClick={(e) => this.showSearchContainer(e)}>\n <i className=\"material-icons search\">search</i>\n </a>\n\n </nav>\n </div>\n </div>\n <div className={(this.state.showingSearch ? \"showing \" : \"\") + \"search-container\"}>\n <input type=\"text\" onChange={(e) => this.onSearch(e)} value={this.state.searchTerm}/>\n <a href=\"#\" onClick={(e) => this.showSearchContainer(e)}>\n <i className=\"material-icons close\">close</i>\n </a>\n { /* TODO All this should be in a SearchResults component */}\n {this.state.searchResults.items.length > 0 && (\n <div>\n <p className=\"results-info\">{`Showing ${this.state.searchResults.items.length} of ${this.state.searchResults.total} products` }</p>\n <div className=\"search-results\">\n {this.state.searchResults.items.map((item) => (\n <div key={item._id} className=\"result-item\" >\n <h3 className=\"item-title\">{item.name}</h3>\n <div className=\"item-body\">\n <img src={item.picture} alt={`Picture of ${item.name}`} />\n <p className=\"item-description\">{ item.about }</p>\n </div>\n </div>))}\n </div>\n </div>\n )}\n </div>\n </header>\n );\n }", "render() {\n return (\n <div className=\"SearchBar\">\n <div className=\"SearchBar-sort-options\">\n <ul>\n {this.renderSortByOptions()}\n </ul>\n </div>\n <div className=\"SearchBar-fields\">\n <input placeholder=\"Search Businesses\" onChange={this.handleTermChange}/>\n <input placeholder=\"Where?\" onChange={this.handleLocationChange}/>\n </div>\n <div className=\"SearchBar-submit\">\n <a onClick={this.handleSearch}>Go</a>\n </div>\n </div>\n );\n }", "constructor() {\n /**\n * Search form name\n * @type {String}\n */\n this.searchForm = 'searchForm';\n\n /**\n * Search text\n * @type {String}\n */\n this.searchText = '';\n }", "componentDidMount(){\n this.searchQuery()\n}", "render() {\n\t\treturn (\n\t\t\t<BrowserRouter>\n\t\t\t<main className=\"flex-container\">\n\t\t\t\t<nav className=\"sidebar\">\n\t\t\t\t\t<div className=\"searchBar\">\n\t\t\t\t\t\t<label htmlFor=\"search\">Search</label>\n\t\t\t\t\t\t<input value={this.state.search} type=\"text\" id=\"search\" name=\"search\" onChange={this.handleSearch.bind(this)}/>\n\t\t\t\t\t\t<input type=\"submit\" value=\"search\" onClick={this.performSearch.bind(this)}/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<ul>\n\n\t\t\t\t\t{this.state.searchSidebarModules.map((module, i) => {\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Link to={module.slug} key={i} >\n\t\t\t\t\t\t\t\t<SidebarModule module={module} active={module.active} key={i} handleClick={this.handleClick.bind(this, module.slug)} params={{lessonId: module.slug}}/>\n\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t)\t\t\n\t\t\t\t\t})}\t\n\t\t\t\t\t</ul>\n\t\t\t\t</nav>\n\t\t\t\t<div className=\"content\">\n\t\t\t\t\t<Test isSearch={this.state.isSearch} searchResults={this.state.searchResults} handleClick={this.handleClick.bind(this)} currentModule={this.state.currentModule} activeSidebarModule={this.state.activeModule} />\n\t\t\t\t</div>\n\t\t\t</main>\n\t\t\t</BrowserRouter>\n\t\t)\n\t\t\n\t}", "render() {\n return (\n <div className={`${this.props.buttonClass}`} onClick={this.props.onClick}>\n <i className={`${this.props.ButtonIcon} SearchButtonIconImage`}></i>\n </div>\n );\n }", "function SearchForm({onSearch, searchTerm, handleSortByName}) {\n return (\n <form className=\"search\">\n <div className=\"form-group\">\n <input\n value={searchTerm}\n onChange={onSearch}\n type=\"text\"\n className=\"form-control\"\n placeholder=\"Search Employee Name\"\n />\n </div>\n </form>\n );\n}", "function NetworkSearch(props) {\n\n\t//calls handleSearch callback using search input and re-renders the content being display\n function handleSearch(e) {\n e.preventDefault();\n let input = document.getElementById('networkSearch');\n\t\tlet search = input.value;\n\t\tprops.handleSearch(search);\n\t\tinput.value = '';\n }\n\n\treturn (\n\t\t<div className=\"c-network-form\">\n\t\t\t<form onSubmit={ (e) => handleSearch(e)} className=\"[ form-inline ] c-network-search\">\n\t\t\t\t<input id=\"networkSearch\" className=\"form-control mr-sm-2\" type=\"search\" placeholder=\"Search...\" aria-label=\"Search\"/>\n\t\t\t\t<Button className=\"btn btn-outline-success my-2 my-sm-0 c-network-button\" onClick={(e) => handleSearch(e)}>\n\t\t\t\t\t<Glyphicon glyph=\"search\" /> \n\t\t\t\t</Button>\n\t\t\t\t{\n\t\t\t\t\tprops.location.pathname.includes(\"contacts\") &&\n\t\t\t\t\t<Link to=\"/network/contacts/connect\">\n\t\t\t\t\t\t<Button className=\"btn btn-outline-success my-2 my-sm-0 plus c-network-button\">\n\t\t\t\t\t\t\t<Glyphicon glyph=\"plus\" /> \n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Link>\n\t\t\t\t}\n\t\t\t\t{\n\t\t\t\t\tprops.location.pathname.includes(\"messages\") && \n\t\t\t\t\t<Link to='/network/messages/new'>\n\t\t\t\t\t\t<Button className=\"btn btn-outline-success my-2 my-sm-0 plus c-network-button\">\n\t\t\t\t\t\t\t<Glyphicon glyph=\"plus\" /> \n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Link>\n\t\t\t\t}\n\t\t\t</form>\n\t\t</div>\n\t);\n}", "render() {\n return <div>\n <h1>Recherche des référents</h1>\n <MenuAllForm />\n <RechercheReferentForm />\n </div>;\n }", "renderSearch(){\n return (\n <div className=\"search\">\n <br /><br />\n <FormGroup controlId=\"search\">\n <InputGroup>\n <DropdownButton\n componentClass={InputGroup.Button}\n id=\"input-dropdown\"\n title={this.state.searchOption}\n onSelect={this.handleSelectSearch}\n >\n <MenuItem eventKey={\"Employee\"}>Employee</MenuItem>\n <MenuItem eventKey={\"Project\"}>Project</MenuItem>\n </DropdownButton>\n <FormControl\n value={this.state.search}\n type=\"text\"\n onChange={this.handleChange}\n />\n </InputGroup>\n </FormGroup>\n <Button\n block\n bsStyle=\"primary\"\n bsSize=\"large\"\n onClick={this.handelClick}\n >\n Search\n </Button>\n </div>\n )\n }", "constructor(){\n super()\n this.state = {\n searchText: \"\"\n }\n }", "render() {\n return (\n <div className=\"App\">\n <SearchBar\n /*Giving the SearchBar component access to the searchPosts\n and handleChange methods in this file */\n searchPosts={this.searchPosts}\n handleChange={this.handleChange}\n />\n {/*Giving the PostContainer component access to posts data\n and */}\n <PostContainer\n posts={this.state.posts}\n\n />\n </div>\n );\n }" ]
[ "0.7420102", "0.66341865", "0.66134113", "0.65840745", "0.64439327", "0.6428957", "0.6334326", "0.62824976", "0.6137709", "0.61185277", "0.61111546", "0.61076826", "0.60945904", "0.6078033", "0.6075763", "0.60537434", "0.60469407", "0.60238415", "0.6021306", "0.60123175", "0.5985576", "0.59818375", "0.5971695", "0.5971604", "0.5953322", "0.5953322", "0.59522426", "0.5911227", "0.59046936", "0.59045655", "0.5883966", "0.58475894", "0.5838764", "0.5832773", "0.58306587", "0.58238345", "0.58235896", "0.5787221", "0.57777905", "0.57774746", "0.5765258", "0.5758319", "0.57581276", "0.57480675", "0.5747835", "0.5744545", "0.57440156", "0.57321715", "0.5727636", "0.57270074", "0.5719543", "0.57189876", "0.57125217", "0.57107943", "0.57103926", "0.57103926", "0.57079786", "0.57051283", "0.5702712", "0.5675192", "0.56623596", "0.5660729", "0.56372494", "0.5621629", "0.5621219", "0.5620348", "0.56169075", "0.560587", "0.56053406", "0.56021863", "0.5600404", "0.55816764", "0.5570033", "0.5567014", "0.55657315", "0.5561711", "0.5557313", "0.554588", "0.55381644", "0.55350375", "0.5533272", "0.55234194", "0.5519666", "0.5511515", "0.551106", "0.5508306", "0.5507673", "0.55044097", "0.549702", "0.5489569", "0.5480446", "0.54757595", "0.54706186", "0.5469697", "0.5469431", "0.5467841", "0.546683", "0.5466175", "0.5461854", "0.5450437", "0.5438833" ]
0.0
-1
constructor This is the exported function/class
function GeolocationHandler(browserGeolocation) { watching = false; geolocation = browserGeolocation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "consructor() {\n }", "constructor() {\n\t\t// ...\n\t}", "constructur() {}", "constructor (){}", "constructor() {\n\n\t}", "constructor() {\n }", "constructor() {\r\n // ohne Inhalt\r\n }", "function _construct()\n\t\t{;\n\t\t}", "constructor(){\r\n\t}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor() {\n\t}", "constructor() {\n\t}", "constructor( ) {}", "constructor () {\r\n\t\t\r\n\t}", "constructor() {\r\n }", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor(){\r\n }", "constructor() {\n throw Error('do not use constructor directly, only static functions');\n }", "constructor() {\n super();\n this._init();\n }", "constructor(){\r\n\r\n }", "constructor() {\n this._initialize();\n }", "constructor() {\n throw new Error('Not implemented');\n }", "function HelperConstructor() {}", "function _ctor() {\n\t}", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \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() {\r\n\r\n\r\n }", "constructor() {\n this.init();\n }", "constructor() {\n super()\n self = this\n self.init()\n }", "constructor() {\n\n }", "constructor() {\n\n }", "constructor(){\n\n }", "constructor(){\n\n }", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}" ]
[ "0.8267086", "0.8056631", "0.7920508", "0.7919077", "0.78359854", "0.7832339", "0.7801367", "0.7770227", "0.769394", "0.76896954", "0.76896954", "0.76896954", "0.76896954", "0.76896954", "0.76896954", "0.76896954", "0.7660997", "0.7660997", "0.7631949", "0.7561031", "0.753324", "0.7527102", "0.7527102", "0.7527102", "0.75154924", "0.75154924", "0.75154924", "0.75154924", "0.75154924", "0.75154924", "0.75154924", "0.75154924", "0.75154924", "0.75154924", "0.75154924", "0.7495794", "0.749418", "0.7490228", "0.74856377", "0.74674165", "0.74413407", "0.7416183", "0.740385", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7346235", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.7320951", "0.73156124", "0.731444", "0.7303826", "0.72997254", "0.72997254", "0.72946256", "0.72946256", "0.7289131", "0.7289131", "0.7289131", "0.7289131", "0.7289131", "0.7289131", "0.7289131", "0.7289131", "0.7289131", "0.7289131", "0.7289131", "0.7289131" ]
0.0
-1
?&q is looking for the username after the = and return the results
searchUser(username) { return fetch(`${remoteURL}/users/?&q=${username}`).then((result) => result.json()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function retSearchStr(usrInput) {\n var query = \"https://en.wikipedia.org//w/api.php?action=query&format=json&origin=\\*&uselang=user&list=search&srsearch=\"; // MediaWiki web service API\n return query + encodeURI(usrInput);\n }", "function getUserName() {\n // check the url and store it in a variable so we can search it\n var url = $(location)attr.('href'),\n urlComponents,\n username;\n // split the url into searchable components\n urlComponents = url.split('?')\n // search the match data for the passed username and return it\n for (var i = 0; i < urlComponents.length; i++){\n // split the string again to compare value pairs\n compComponents = urlComponents[i].split('=');\n if (compComponents[0] === 'username') {\n return compComponents[1];\n }\n }\n\n}", "function getUserName() {\n // check the url and store it in a variable so we can search it\n var url = $(location).attr('href'),\n urlComponents,\n username;\n // split the url into searchable components\n urlComponents = url.split('?')\n // search the match data for the passed username and return it\n for (var i = 0; i < urlComponents.length; i++){\n // split the string again to compare value pairs\n compComponents = urlComponents[i].split('=');\n if (compComponents[0] === 'username') {\n return compComponents[1];\n }\n }\n}", "function searchUser() {\n var WINDOW_LOCATION_SEARCH = \"?search={search}\"\n var term = $('#search').val().trim();\n if (term.length > 3) {\n var bySearchTermUrl = GET_USERS + WINDOW_LOCATION_SEARCH.replace('{search}', term)\n fetchUsers(bySearchTermUrl)\n }\n}", "function getQuerry(){\n if (queryString.length == 0) {\n if (window.location.search.split('?').length > 1) { // If there're arguments to store\n // Get them\n var params = window.location.search.split('?')[1].split('&');\n for (let i = 0; i < params.length; i++) { // For each argument\n let d = params[i].split('='); // Split key-value\n\n queryString[d[0]] = decodeURIComponent(d[1]);\n }\n\n if (queryString.username && !queryString.pId) { // If username stored but pId missing\n console.warn(\"pId not selected\");\n\n $.ajax({ // Get pId and store it\n url: \"getpId\",\n method: \"get\",\n data:{\n username: queryString.username\n },\n success: function(data) {\n console.log(\"pId recovered: \" + data);\n queryString[\"pId\"] = parseInt(data);\n }\n });\n }\n }\n }\n}", "function searchQuery(e){\n\te.preventDefault();\n\te.returnValue = true;\n\taxios.get('https://opposum-api.herokuapp.com/search', {\n\t\t\tparams:{\n\t\t\t\t\t//Just the username\n\t\t\t\t\tusername: window.name.substring(0,window.name.indexOf('=')),\n\t\t\t\t\tsearchField: getSearch()\n\t\t\t}\n\t\t})\n\t.then(function(response){\n\t\t//Add the response\n\t\tvar name = window.name.substring(0,window.name.indexOf('='));\n\t\t//Need the ? to split on in set method\n\t\tconsole.log(response.data.result);\n\t\twindow.name = name+\"=\"+response.data.result+\"?\";\n\t\t\n\t\talert(\"Results: \" + response.data.result);\n\t\t\n\t})\n\t.catch(function(error) {\n\t\tconsole.log(error);\n\t});\n\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 var temp = params[i].split(\"=\");\n if (temp[0] === sname) {\n sval = temp[1];\n }\n }\n\n // If requesting the username, mark blank names as Guest\n if (sname == \"name\" && sval == \"\") {\n sval = \"Guest\"\n }\n return sval;\n}", "function queryUserName(name){\n var results = users.filter(function(o){\n if(o.name.toLowerCase().indexOf(name.toLowerCase()) > - 1){\n return o;\n }\n });\n showUserResults(results);\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 getSearchQuery(name) {\n return decodeURIComponent((location.search.split(name + '=')[1] || '').split('&')[0]).replace(/\\+/g, ' ');\n}", "function filterUsers({ username, name }) {\n return username.toLowerCase().startsWith(query.toLowerCase()) || name.toLowerCase().startsWith(query.toLowerCase());\n }", "function findUser() {\n\t\tconsole.log(this, this.value);\n\n\t\t$.ajax({\n\t\t\ttype: 'GET', \t\t// define the type of HTTP verb we want to use (POST for our form)\n\t\t\turl: '/users/all?searchTerm='+this.value+'&searchBy=name', // the url where we want to POST\n\t\t\tdataType: 'json', \t// what type of data do we expect back from the server\n\t\t\tencode: true\n\t\t})\n\t\t// using the done promise callback\n\t\t.done(function(data) {\n\t\t\t_bindTemplate(\"#entry-template\", data, '#sample-data');\n\t\t});\n\t}", "searchUserName() {\n return \"select u.userName from users u where u.userName = ?;\";\n }", "function getuserbyname(username) {\n\n\t}", "searchUser(){\r\n let userQueryRegex = /.*\\S.*/; // Input cannot be blank\r\n let userQuery = read.question(\"Search Quiz User: (-1 to exit)\\n>> \", {limit: userQueryRegex, limitMessage: \"Type something!\"});\r\n\r\n if(userQuery == -1) this.searchAQuiz();\r\n else this.searchUserFuzzy(userQuery);\r\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 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 getQueryParam(name) {\n var regexS = \"[\\\\?&]\" + name + \"=([^&#]*)\";\n var regex = new RegExp(regexS);\n var results = regex.exec(window.location.href);\n\n if (results === null) {\n return \"http://www.lexus.com/\";\n } else {\n return results[1].replace(\"%3f\", \"?\", \"g\");\n }\n }", "function getUserByName(username) {\n}", "function getSearchQuery() {\n\t// Parse search pattern from URL\n\tvar query = location.search.substr(1).replace(/%20/g, ' ');\n\n\tif (query) {\n\t\tsearch(query); // Check for matches\n\n\t\tif (focusFirstOccurence())\n\t\t\tdocument.getElementById('searchBar').value = query;\n\t\telse\n\t\t\tresetTabIndex();\n\t}\n}", "function queryByName(name, url = window.location.href) {\n\t\tname = name.replace(/[\\[\\]]/g, '\\\\$&');\n\t\tvar regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),\n\t\t\tresults = regex.exec(url);\n\t\tif (!results) return null;\n\t\tif (!results[2]) return '';\n\t\treturn decodeURIComponent(results[2].replace(/\\+/g, ' '));\n\t}", "function searchAndVerify(userQ) {\n\tvar uIndex = -1;\n\tvar userList;\n\t\n\tif (isNaN(parseInt(userQ, 10))) {\n\t\tfs.readFile(path.join(__dirname, \"steamusers.json\"), { encoding: \"utf-8\" }, function(err, data) {\n\t\t\tif (err) { return \"File error. @Drecake#3278 good fuckin job\"; }\n\t\t\t\n\t\t\tuserList = JSON.parse(data);\n\t\t\tfor (var i = 0; i < userList.length; i++) {\n\t\t\t\tif (userQ === userList[i].cName) {\n\t\t\t\t\tuIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\telse {\n\t\tfs.readFile(path.join(__dirname, \"steamusers.json\"), { encoding: \"utf-8\" }, function(err, data) {\n\t\t\tif (err) { return \"File error. @Drecake#3278 good fuckin job\"; }\n\t\t\t\n\t\t\tuserList = JSON.parse(data);\n\t\t\tfor (var i = 0; i < userList.length; i++) {\n\t\t\t\tif (userQ === userList[i].uID) {\n\t\t\t\t\tuIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\t\n\t// Verify working API key\n\t\n\tif (uIndex == -1) { return \"User \\\"\" + userQ + \"\\\" is not registered.\"; }\n\t\n\treturn userList[uIndex];\n}", "function getQuery(){\r\n //setup the the query\r\n let str = document.getElementById('searchBar').value;\r\n if (!str){\r\n searchStr = '';\r\n }else{\r\n searchStr = str;\r\n }\r\n\r\n let query = '';\r\n if(searchStr === '' && hrefQueryStr !== ''){\r\n //get information from the hrefQueryStr\r\n query = \"/games?\" + hrefQueryStr;\r\n }else{\r\n if(Number.isInteger(parseInt(searchStr))){\r\n //then we have a gameId search\r\n query = '/games?gameId=' + parseInt(searchStr) + \"&detail=full&isCompleted=\" + isGameFinished + \"&isNotCompleted=\" +\r\n isGameOngoing + \"&user=\";\r\n }else{\r\n //then we have a username search\r\n query = \"/games?gameId=&isCompleted=\" + isGameFinished + \"&detail=full&isNotCompleted=\" +\r\n isGameOngoing + \"&user=\" + searchStr;\r\n }\r\n }\r\n\r\n return query;\r\n\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}", "function myfunc() \n {\n //console.log(searchBox.val());\n var query=Host+searchBox.val().split(\" \").join('+');\n console.log(query);\n document.location=query;\n /*\n chrome.identity.getProfileUserInfo(function(user_info)\n {\n console.log(user_info); \n });\n */\n }", "function search_for_user() {\n\tvar data_query=\"searchuser=1\";\n\t\n\tvar clean_inputs = 1;\n\t\n\tvar fname = $(\"#search_user_fname\").val();\n\tif(fname!='' && fname!=' '){\n\t\tdata_query=data_query+\"&fname=\"+fname;\n\t\tclean_inputs=0;\n\t}\n\tvar lname = $(\"#search_user_lname\").val();\n\tif(lname!='' && lname!=' '){\n\t\tdata_query=data_query+\"&lname=\"+lname;\n\t\tclean_inputs=0;\n\t}\n\tvar aem = $(\"#search_user_aem\").val();\n\tif(aem!='' && aem!=' '){\n\t\tdata_query=data_query+\"&aem=\"+aem;\n\t\tclean_inputs=0;\n\t}\n\t\n\tif(clean_inputs==0){\n\t\t$.ajax({\n\t\t\ttype: \"GET\",\n\t\t\turl: \"functions.php\",\n\t\t\tdata: data_query,\n\t\t\tdataType: \"html\",\n\t\t\tsuccess: function(html){ \n\t\t\t\t$(\"#search_user_results\").html(html);\n\t\t\t}\n\t\t}); \n\t}else{\n\t\tview_all_for_user('aem','ASC');\n\t}\n}", "function SearchUserObject() {\n concatResult();\n window.searchQuery = searchInput.value;\n CreateURI(centerLat, centerLng);\n}", "function ParsedQueryString() {}", "function ParsedQueryString() {}", "attempt(username) {\n let query = 'SELECT+Id,+Name,+Username+FROM+User+WHERE+Name+LIKE+\\'%25' + username + '%25\\'+OR+Username+LIKE+\\'%25' + username + '%25\\'';\n\n ftClient.query(query,\n function(success) {\n console.log(success);\n let numberOfUserRecords = success.records.length;\n if(numberOfUserRecords < 1){\n addError([{\"message\":\"No user for your search exists.\"}]);\n } else if(numberOfUserRecords > 1){\n loginAsShowOptions(success.records);\n } else {\n var userId = success.records[0].Id;\n loginAsPerform(userId);\n }\n },\n function(error)\n {\n console.log(error);\n addError(error.responseJSON);\n }\n );\n }", "function getUsername() {\n var url = window.location.search.substring(1);\n var parseURL = url.split('&');\n var uname = []; // uname[1] is the username\n for (var x = 0; x < parseURL.length; x++) {\n var temp = [];\n temp = parseURL[x].split('=');\n if (temp[0] === 'uname') {\n uname.push(temp[0]);\n uname.push(temp[1]);\n }\n }\n // var username = uname[1];\n return uname[1];\n }", "function getUserInput(userInput) {\n\n var searchName = '';\n for (var i = 3; i < userInput.length; i++) {\n\n searchName = searchName + \"+\" + userInput[i];\n\n }\n return searchName.slice(1);\n}", "function build_search_query(q){\n\treturn \"http://search.twitter.com/search.json?q=\"+encodeURIComponent(q)+\"&rpp=5&include_entities=true&result_type=recent&locale=en\";\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 findUserByUsername(username, callback) {\n var queryStr = \"SELECT username, email_address, phone_number, first_name, last_name, is_locked, locked_until_date \" \n + \" FROM `marketplace`.`user` \"\n + \" WHERE username LIKE ? \";\n \n var queryVar = \"%\" + username + \"%\";\n\n mySQL_DbConnection.query(queryStr, queryVar, function (err, result_rows, fields) { \n if(err) {\n console.log(\"Error: \", err);\n callback([]);\n } else { \n callback(result_rows);\n } \n });\n}", "executeSearchSomeOnesAgendaGetRequest(username) {\n window.location.href = '/search?username=' + username\n }", "function yellQueryParam(url,name)\n{\n name = (''+name).replace(/[\\[]/,\"\\\\\\[\").replace(/[\\]]/,\"\\\\\\]\");\n var regexS = \"[\\\\?&]\"+name+\"=([^&#]*)\";\n var regex = new RegExp(regexS);\n var results = regex.exec(url);\n if (results == null)\n return \"\";\n else\n return results[1];\n}", "function querySearch(text){\n\n if (text==\"\" || text == null) {\n console.log(\"Nema: \" + text);\n return $http.get(\"/players\")\n .then(function (result) {\n return result.data;\n })\n }else{\n console.log(\"Ima: \" + text);\n return $http.get(\"/players?player_name=\"+text)\n .then(function (result) {\n return result.data;\n })\n }\n }", "function searchUser(name) {\n\n if (system.searched.indexOf(name) === -1 || settings.tag_only) {\n searching = name;\n\n loadMore()\n }\n\n if (system.searched.indexOf(name) != -1 && !settings.tag_only) {\n system.searchingUsers = false;\n searchUsers()\n }\n }", "function showUserByName(str) {\n if (str == \"\") {\n document.getElementById(\"txtHint\").innerHTML = \"\";\n return;\n } else { \n if (window.XMLHttpRequest) {\n // code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp = new XMLHttpRequest();\n } else {\n // code for IE6, IE5\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"txtHint\").innerHTML = this.responseText;\n }\n };\n xmlhttp.open(\"GET\",\"http://test.stickyginger.co.za/ajaxslq/getuserByName.php?q=\"+str,true);\n xmlhttp.send();\n }\n}", "function ajax_search_uname(uname){\n\tcreate_http_request();\n\t// create the parameters to be\n\t// sent to the php target.\n\t// this is a string of name=value pairs. if\n\t// multiple parameters are to be sent, then they\n\t// are separated by an ampersand.\n\tvar post_params = \"ajax_action=search_uname&ajax_uname=\" + uname;\n\t// call method to sent the request\n\tsend_http_request(xmlHttp_handle_uname_search, \"POST\", target_url, post_params);\n}", "function findUser() {\n\t\tvar myUser;\n\n\t\t// Get the username value from the form and cleanup the @ if needed\n\t\tif (document.tweetfinder.user.value[0] == \"@\") {\n\t\t\tmyUser = document.tweetfinder.user.value.substring(1,20); //get rid of the @\n\t\t}\n\t\telse { myUser = document.tweetfinder.user.value };\n\n\t\t// Validate length of username\n\t\tif (myUser.length > 16) { // TODO: if true, return error msg and don't continue\n\t\t\t$('#error').html(\"This doesn't seem to be a username. Too long.\");\n\t\t\treturn \"usernameistoolong\";\n\t\t}\n\t\telse {\n\t\t\treturn myUser;\n\t\t}\n}", "function search() {\n let sValue = searchVal.value;\n fetch(`https://api.github.com/search/users?q=${sValue}`)\n .then((resp) => resp.json())\n .then(function(data) {\n let users = data.items;\n render(users);\n})\n console.log(sValue);\n}", "function getParameterByName(name) {\n return parseQS(getWindowLocation().search)[name] || '';\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 }", "resetSearchString() {\n if (this.active_user) {\n this.search_str = this.active_user.name;\n }\n }", "function searchForUser(searchString, callback) {\n var query =\n 'SELECT U.name, LC.username, U.id AS data, ' +\n 'LC.username AS matchingString ' +\n 'FROM USERS U ' +\n 'LEFT OUTER JOIN LOGIN_CREDENTIALS LC ' +\n 'ON LC.user_id = U.id ' +\n 'WHERE U.id = $1 ';\n\n search(query, searchString, false, null, [], function (results) {\n // add a value field and strip out unneeded fields\n results.forEach(function (result) {\n result.value = mergeStrings(result.name, result.username);\n\n result['matchingString'] = undefined;\n result['name'] = undefined;\n result['username'] = undefined;\n });\n\n callback(results);\n });\n}", "searchName(userName) {\n\t\tlet parent = this;\n\t\tlet search;\n\t\tif(typeof userName === 'string') search = userName;\n\t\telse search = document.getElementById(\"userName\").value;\n\t\tif(authed && search.length > 0){\n\t\t\taxios.get(`${window.location.protocol}//${window.location.host}/getuserchats/${this.props.chatId}/${encodeURIComponent(search)}`)\n\t\t\t.then(function(res){\n\t\t\t\tif(res.data.found){\n\t\t\t\t\tparent.setState({\n\t\t\t\t\t\tshowModal: true,\n\t\t\t\t\t\tmessage:res.data.message,\n\t\t\t\t\t\tchats:res.data.chats,\n\t\t\t\t\t\tusername:search,\n\t\t\t\t\t\tuser:{\n\t\t\t\t\t\t\tpic:res.data.userDetails.profileImageUrl,\n\t\t\t\t\t\t\tname:res.data.userDetails.displayName,\n\t\t\t\t\t\t\turl:res.data.userDetails.channelUrl\n\t\t\t\t\t\t}\n\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tparent.setState({ \n\t\t\t\t\t\tshowModal: true,\n\t\t\t\t\t\tmessage:res.data.message,\n\t\t\t\t\t\tchats:[],\n\t\t\t\t\t\tusername:\"\",\n\t\t\t\t\t\tuser:{\n\t\t\t\t\t\t\tpic:\"\",\n\t\t\t\t\t\t\tname:\"\",\n\t\t\t\t\t\t\turl:\"\"\n\t\t\t\t\t\t} \n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "async function searchUser() {\n // check if the input is valid and chain to url\n if(validateUserName()) {\n fetchUrl('/githubSearch/checkSession', {method: 'POST'})\n .then(function (response) {\n const obj = JSON.parse(JSON.stringify(response));\n if (obj.reload) { // if the session was ended\n setModalMessage(obj.title, obj.message, obj.reload);\n } else {\n fetchUrl(loginUrl)\n .then(function (response) {\n validUserNameJason = JSON.parse(JSON.stringify(response));\n // extract the followers and the repositories from the response\n extractResponse();\n\n }).catch(error => { // if user is not found\n console.log('Request failed', error);\n setModalMessage('Oops', 'Looks like the user is not found');\n hideElement(document.getElementById('userInfo'));\n });\n }\n });\n }\n }", "function queryString(name) {\n var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.location.href;\n name = name.replace(/[[]]/g, \"\\\\$&\");\n var regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\", \"i\");\n var results = regex.exec(url);\n\n if (!results) {\n return null;\n }\n\n if (!results[2]) {\n return \"\";\n }\n\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n}", "function search_word(){ \n\t\t\t\tif( $('input[name=\"accountno\"]').attr('value')==''){\n\t\t\t\t\t$('#resulta').remove();\n\t\t\t\t } \n\t\t\tvar search_me = $('input[name=\"accountno\"]').attr('value');\n\t\t\t$.getJSON('testing_jquery.php?search_me=' + search_me ,show_results);\n\t\t}", "function get_query_var( name ) {\n\n var match = RegExp('[?&]' + name + '=([^&#]*)').exec(location.href);\n return match && decodeURIComponent(match[1].replace(/\\+/g, ' ')); \n}", "function search() {\n\tconsole.log(\"Googling \\\"\" + box.value + \"\\\"\");\n\tconsole.log(\"Encoded query: \\n\" + encodeURIComponent(box.value));\n\tdocument.location.href = \"https://www.google.com/?gws_rd=ssl#safe=off&q=\" + encodeURIComponent(box.value);\n}", "function getUserByUserNameContains(username) {\n return commonService.$http.get('api/search/long/byusernamecontains?username=' + username);\n }", "function searchUser(userName) {\n setUserName(userName)\n // fetch the github API to check for the username and set the status likewise\n fetch(`https://api.github.com/users/${userName}`)\n .then(res => res.json())\n .then(result => {\n // The API returns a message only when there is a error and the user is not valid\n if (result && result.message) {\n setStatus(\"User Invalid!\")\n setCanPlay(false)\n }\n else {\n setStatus(\"User Valid!\")\n setCanPlay(true)\n }\n })\n }", "function queryString(name, value)\n{\n var queryString = \"\" ;\n if (value)\n {\n queryString = name + '=' + value + '&';\n }\n return queryString;\n}", "getEncodedQuery() {}", "function search(){\n let query;\n if(searchLocation===\"location\"){\n searchLocation(\"\")\n }\n query=`https://ontrack-team3.herokuapp.com/students/search?location=${searchLocation}&className=${searchClass}&term=${searchName}` \n prop.urlFunc(query);\n }", "function queryName() {\r\n var querys = $('#search').val();\r\n if (querys == \"\") {\r\n //shows warning if no data\r\n $(\"p#searchError\").css('visibility', 'visible');\r\n $(\"p#searchError\").css('height', '24px');\r\n $(\"p#searchError\").css('margin-bottom', '16px');\r\n } else {\r\n //hide warning and query\r\n $(\"p#searchError\").css('visibility', 'hidden');\r\n $(\"p#searchError\").css('height', '0px');\r\n $(\"p#searchError\").css('margin-bottom', '0px');\r\n //ask for a location based on a name with the name being request\r\n queryDatabase('/name', { name: querys });\r\n }\r\n}", "function matchUrlQueryParamValue(str){var match=str.match(QUERY_PARAM_VALUE_RE);return match?match[0]:'';}", "function queryValue() {\n var qrStr = window.location.search;\n if (qrStr)\n var qrvalue = (qrStr.split(\"?\")[1].split(\"=\")[1]);\n return decodeURIComponent(qrvalue);\n}", "searchByAddedUser(username) {\n return axios.get(`${API_URL}/findByUser/${username}`)\n }", "function getLocationParam ( sname )\n{\nvar params = location.search.substr(location.search.indexOf(\"?\")+1);\nvar sval = \"\";\nparams = params.split(\"&\");\n // split param and value into individual pieces\n for (var i=0; i<params.length; i++)\n {\n temp = params[i].split(\"=\");\n if ( [temp[0]] == sname ) { sval = temp[1]; }\n }\nreturn sval;\n}", "clientPeoplePickerSearchUser(queryParams) {\r\n const q = this.clone(ClientPeoplePickerQuery_1, null);\r\n q.concat(\".clientpeoplepickersearchuser\");\r\n return q.postCore({\r\n body: this.createClientPeoplePickerQueryParametersRequestBody(queryParams),\r\n })\r\n .then(res => {\r\n if (typeof res === \"object\") {\r\n return res.ClientPeoplePickerSearchUser;\r\n }\r\n return res;\r\n })\r\n .then(JSON.parse);\r\n }", "function search( input ){\n // select chat list -> contacts -> each( user name ? search input )\n $('.chat-list .contact').each( function() {\n //var filter = this.innerText; // < - You, Me , I ( for log user )\n //var _val = input[0].value.toUpperCase();\n\n if ( this.innerText.indexOf( input[0].value.toUpperCase() ) > -1)\n this.style.display = \"\";\n else this.style.display = \"none\";\n\n });\n\n}", "function getUsers(term, opt) {\n\t\t\t\t\tvar ajaxOptions = $.extend({\n\t\t\t\t\t\turl: X.T.getRootPath(\"Profiles\") + \"/atom/search.do\",\n\t\t\t\t\t\tcache: false,\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tactiveUsersOnly: true,\n\t\t\t\t\t\t\tsearch: composeUserSearchQuery(term),\n\t\t\t\t\t\t\tps: 25\n\t\t\t\t\t\t}\n\t\t\t\t\t}, opt);\n\t\t\t\t\treturn $.ajax(ajaxOptions);\n\t\t\t\t}", "users(parent, args, { db }, info) {\n\n // no query: return all users\n if (!args.query) {\n return db.users;\n }\n\n // query: search for matches of query string with the user name and return filtered array\n return db.users.filter(user => user.name.toLowerCase().includes(args.query.toLowerCase()));\n\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}", "async function searchUser(nameOrTag, searchBy) {\n let query = {};\n\n if (searchBy === 'tag') {\n const preTag = '#';\n const tagFixed = preTag.concat(fixTag(nameOrTag));\n query = {\n tag: tagFixed,\n }\n } else {\n query = {\n // Insensitive case for name search\n name: new RegExp(nameOrTag, 'i'),\n }\n }\n return dbSearchUser(query)\n}", "function askQuery() {\nquery=$(\"queryString\").value;\n\tnew Ajax.Updater('showQuery','http://bioinf3.bioc.le.ac.uk/~ss533/cgi-bin/ask3.cgi', {\n\tparameters : {query:query,session:sessionName}});\n}", "function searchNames(toSearch) {\n fetch(`https://api.github.com/search/users?q=${toSearch}`)\n .then(response => response.json())\n .then(names => renderUsers(names))\n .then(users => addSearchUserReposListeners(users))\n .catch(err => console.log(err))\n}", "function searchUsers()\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 \n xmlhttp.onreadystatechange=function()\n {\n if (xmlhttp.readyState==4 && xmlhttp.status==200)\n {\n document.getElementById(\"buddySearchResults\").innerHTML=xmlhttp.responseText;\n }\n }\n\n var searchInput = document.getElementById('buddySearch').value;\n \n if(searchInput == ''){\n document.getElementById('buddySearchResults').style.display = 'none';\n }\n else\n {\n document.getElementById('buddySearchResults').style.display = '';\n }\n \n xmlhttp.open(\"GET\",\"buddySearch.php?search=\"+searchInput,true);\n xmlhttp.send();\n \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 showUserPost(username) {\n searchPostBy(\"2\", username);\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 getQuery(q) {\n\t\t\treturn (window.location.search.match(new RegExp('[?&]' + q + '=([^&]+)')) || [, null])[1];\n\t\t}", "function searchUserLocal()\n {\n var typed = this.value.toString().toLowerCase(); \n var results = document.getElementById(\"results-cont\").children;\n\n if(typed.length >= 2)\n { \n for(var j=0; j < results.length; j++)\n {\n if(results[j].id.substr(0, typed.length).toLocaleLowerCase() !== typed)\n results[j].style.display = \"none\";\n else\n results[j].style.display = \"flex\";\n }\n } \n else\n {\n for(var i=0; i < results.length; i++)\n results[i].style.display = \"flex\";\n } \n }", "function searchUsersByName(searchString, limit, userId, callback) {\n var query =\n 'SELECT U.name, LC.username, U.id AS data, ' +\n 'U.name AS matchingString ' +\n 'FROM USERS U ' +\n 'LEFT OUTER JOIN LOGIN_CREDENTIALS LC ' +\n 'ON LC.user_id = U.id ' +\n 'WHERE U.name LIKE $1 AND U.id != $2 ';\n\n search(query, searchString, true, limit, [userId], function (results) {\n // add a value field and strip out unneeded fields\n results.forEach(function (result) {\n result.value = mergeStrings(result.name, result.username);\n\n result['matchingString'] = undefined;\n result['name'] = undefined;\n result['username'] = undefined;\n });\n\n callback(results);\n });\n}", "searchTitle(){\r\n let userQueryRegex = /.*\\S.*/; // Input cannot be blank\r\n let userQuery = read.question(\"Search Quiz Title: (-1 to exit)\\n>> \", {limit: userQueryRegex, limitMessage: \"Type something!\"});\r\n\r\n if(userQuery == -1) this.searchAQuiz();\r\n else this.searchTitleFuzzy(userQuery);\r\n }", "async function getSearch (){\n\n let adata = await fetch(`/account?username=${name}`)\n .then(res => res.json())\n .then(res => {return res;});\n\n let matchHistory = JSON.parse(\n await fetch(`./matchstats?accountId=${adata.accountId}`)\n .then(res => res.json())\n .then(res => {return res}));\n\n let userInfo = {user: adata, matchHistory: matchHistory};\n\n props.appCallback(userInfo);\n }", "function getQStr(sKey) {\n var sURL = document.location.href;\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 queryPair(name, value) {\n\t\treturn encodeURIComponent(name).replace(/%20/g, '+') + '=' + encodeURIComponent(value).replace(/%20/g, '+');\n\t}", "async function find(username) {\r\n let res = await request\r\n .get(reqURL(`${config.routes.user.find}/${username}`))\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(`find:${util.inspect(res.body)}`);\r\n return res.body;\r\n}", "function searchUsers(searchTerm, callback) {\n let details = {\n url: 'users/?q=' + searchTerm,\n dataType: 'json',\n type: 'GET',\n contentType: \"application/json; charset=utf-8\",\n success: callback\n };\n $.ajax(details);\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 get_username(){\n var url = window.location.href;\n\n var urlSplit = url.split(\"/\");\n\n var user = urlSplit[3];\n var username = urlSplit[4];\n\n\n if(user.trim() == \"user\"){\n return username.trim();\n }\n\n return false;\n\n}", "get queryString(){\n\t\tconst qm = this._href.lastIndexOf('?');\n\t\tif(qm < 0){\n\t\t\treturn '';\n\t\t}\n\t\treturn this._href.substring(qm);\n\t}", "function q(req){\n\treturn qs.parse(url.parse(req.url).query);\n}", "function init_query () {\n window.search_terms = ['pancake']\n if ('q' in query_parameters) {\n if (!$('#q').val()) {\n $('#q').val(query_parameters['q'])\n }\n }\n var terms = $('#q').val().match(/\\w+|\"(?:\\\\\"|[^\"])+\"/g)\n if (terms && terms.length && terms[0].length) {\n window.search_terms = terms\n }\n}", "function set(){\n\tvar startIndex = window.name.indexOf('=')+1;\n\tvar endIndex = window.name.indexOf('?');\n\tvar result = window.name.substring(startIndex, endIndex);\n\talert(\"Results: \" +result);\n}", "function searchBox () {\n\t// Declare variables\n\tvar input, filter, users, user, picture, i;\n\tinput = document.getElementById('search');\n\tfilter = input.value.toUpperCase();\n\tusers = $(\".users ul\");\n\tuser = $(\".user-box\");\n\n\t// Loop through all user(s) and hide those who dont match the search query\n\tfor (i = 0; i < user.length; i++) {\n\t\tboxText = user[i].getElementsByTagName(\"p\")[0];\n\t\tif (boxText) {\n\t\t\tif (boxText.innerHTML.toUpperCase().indexOf(filter) > -1) {\n\t\t\t\tuser[i].style.display = \"\";\n\t\t\t} else {\n\t\t\t\tuser[i].style.display = \"none\";\n\t\t\t}\n\t\t}\n\t}\n}", "function getQryStrParamValues(param) {\n var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for (var i = 0; i < url.length; i++) {\n var urlparam = url[i].split('=');\n if (urlparam[0].toLowerCase() == param.toLowerCase()) {\n if (urlparam[1] != null)\n return urlparam[1].toLowerCase();\n }\n }\n}", "function searchSpotify(){ \r\n console.log(\"got here 2\")\r\n var query = $search.val();\r\n console.log(\"got here 3 value of query = ...\")\r\n console.log(query);\r\n console.log(\"------\");\r\n \r\n// var searchType = $radioBtn.val();\r\n var searchType = $(\"input:radio[name=qryType]:checked\").val();\r\n var params = {q: query, type: searchType};\r\n \r\n $.get(searchURL, params).done(onDataReceive).fail(onError)\r\n \r\n }", "function querySearchTerm(){ \n\t\tlocalStorage.clear(); //Clears storage for next request\n\t\t// get data from html value,\n\t\tvar inputValue = document.getElementById('btn-search').dataset.valinput; \n\t\tconsole.log(inputValue);\n\t\t\n\t\tif(inputValue == \"email\"){ \n\t\t\tvar email = $('input[type=\"text\"]').val().toLowerCase();\n\t\t\tsearchEmail(email)\n\t\t\treturn true;\n\t\t}else{\n var phone = $('input[type=\"text\"]').val().toLowerCase();\n\t\t\tvalidatePhoneNumber(phone)\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n }", "function fetchUsersByName(e){\n let user = searchInput.value\n fetch(`https://api.github.com/search/users?q=${user}`)\n .then(resp => resp.json())\n .then(json => {\n json.items.forEach((user) => {\n displayUser(user)\n })\n })\n}", "function Query(Parameter)\r\n{\r\n var Search = location.search.substring(1, location.search.length);\r\n var SearchParameter = { Name: null, Value: false };\r\n var Parameters = Search.split(\"&\");\r\n for (var I = 0; I < Parameters.length; I++)\r\n {\r\n SearchParameter.Name = Parameters[I].substring(0, Parameters[I].indexOf(\"=\"));\r\n if (SearchParameter.Name == Parameter)\r\n {\r\n SearchParameter.Value = Parameters[I].substring(Parameters[I].indexOf(\"=\") + 1);\r\n }\r\n }\r\n return SearchParameter.Value ? SearchParameter.Value : false;\r\n}", "function search() {\n let regex_no = `^${req.params.query}.*`;\n let regex_name = `${req.params.query}.*`;\n User.find( {$or: [{username: {$regex: regex_name, $options: 'i'} }, \n {phone_number: {$regex: regex_no, $options: 'i'} } ]}, (err, users) => {\n if (err) res.send(err); \n else {\n res.json(users); \n }\n });\n }", "function get_text_query() {\n // Recuperation des champs de recherche\n let query = [];\n // Recuperation du champ query text\n for (let i = 1; i <= counter; i++) {\n let tweetText = document.getElementById(\"tweetText\"+i);\n \n query.push(\"text=\"+tweetText.value);\n \n }\n\n // Recuperation du champs du userName et hashtag\n let un = document.getElementById(\"userName\");\n let hash = document.getElementById(\"hashtag\");\n\n query.push(\"user_name=\"+un.value);\n query.push(\"hashtag=\"+hash.value);\n console.log(query);\n return query.join(\"&\");\n}", "function searchPlayer(term) {\n return search(term, 'soccer player', true);\n}", "function searchEngineAjax()\n{\n\t// Prepare Values\n\tvar siteURL = \"http://search.unifaction.com\";\n\tvar query = document.getElementById(\"searchInputID\").value;\n\t\n\t// Change the behavior if the first character is different\n\tif(query.charAt(0) == \"#\")\n\t{\n\t\tsiteURL = \"http://hashtag.unifaction.com\";\n\t}\n\telse if(query.charAt(0) == \"@\")\n\t{\n\t\tsiteURL = \"http://auth.unifaction.com\";\n\t}\n\t\n\t// Run the Search\n\tsearchAjax(siteURL, \"search\", \"searchHoverID\", \"searchInputID\", query);\n}" ]
[ "0.65719706", "0.654805", "0.6448841", "0.6435348", "0.6280947", "0.6273593", "0.6236742", "0.61222726", "0.6096036", "0.6086386", "0.5988079", "0.595955", "0.5952544", "0.5940601", "0.5893327", "0.5888152", "0.5844223", "0.58391535", "0.58031386", "0.5800306", "0.579948", "0.57970023", "0.5782376", "0.57801074", "0.5772815", "0.5761515", "0.57460576", "0.5739766", "0.5739766", "0.57346916", "0.57333064", "0.5732593", "0.57276857", "0.57267594", "0.57078385", "0.57034224", "0.56993634", "0.56972575", "0.56816185", "0.5668322", "0.56672305", "0.56499547", "0.5644851", "0.56188405", "0.5595689", "0.55909246", "0.5573846", "0.5556462", "0.55519587", "0.55299824", "0.55272245", "0.55136395", "0.55017126", "0.54817253", "0.54745805", "0.5470793", "0.54677504", "0.546233", "0.54588515", "0.54470867", "0.54260683", "0.54256886", "0.54255015", "0.5423746", "0.54197997", "0.5415019", "0.54095", "0.54072577", "0.53986603", "0.5398114", "0.53936344", "0.53820395", "0.5381879", "0.5378447", "0.5376449", "0.537488", "0.5368284", "0.5366319", "0.53616977", "0.53522444", "0.53506076", "0.5342826", "0.53419685", "0.5327923", "0.5323228", "0.5314712", "0.53143525", "0.5309908", "0.5305133", "0.53030974", "0.5301301", "0.52989066", "0.52885276", "0.52861315", "0.5284254", "0.52833503", "0.5282947", "0.5281967", "0.5281743", "0.52736413" ]
0.64330864
4
Create a quick build, installing any required dependencies first if they're not resolvable.
function build(args, appConfig, cb) { if (args._.length === 1) { return cb(new _errors.UserError('An entry module must be specified.')); } let dist = args._[2] || 'dist'; (0, _runSeries2.default)([cb => (0, _utils.install)(appConfig.getQuickDependencies(), { args, check: true }, cb), cb => (0, _cleanApp2.default)({ _: ['clean-app', dist] }, cb), cb => (0, _webpackBuild2.default)(`${appConfig.getName()} app`, args, () => createBuildConfig(args, appConfig.getQuickBuildConfig()), cb)], cb); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function installBuildDependencies() {\n const dependencyList = 'libyaml-dev libgdbm-dev libreadline-dev libncurses5-dev zlib1g-dev libffi-dev'\n\n await installDependencies('ruby-build', dependencyList);\n}", "async function installBuildDependencies() {\n const dependencyList = 'libyaml-dev libgdbm-dev libreadline-dev libncurses5-dev zlib1g-dev libffi-dev'\n\n await installDependencies('ruby-build', dependencyList);\n}", "function build() {\n\treturn function(cb) {\n\n\t\t///////////////////////////////////////////////////////////////////////////\n\t\t// TODO hardcoding mocks for now but after dev cloud we need to remove this\n\t\targs.mocks = true;\n\t\t///////////////////////////////////////////////////////////////////////////\n\n\t\targs.dest = config.build.app;\n\t\targs.optimize = args.optimize || true;\n\t\targs.env = args.env || 'local';\n\n\t\tlog([\n\t\t\t'ARGS FOR THE BUILD.JS',\n\t\t\t'dest: ' + args.dest,\n\t\t\t'optimize: ' + args.optimize,\n\t\t\t'env: ' + args.env\n\t\t]);\n\n\t\tvar parallelTasks = [\n\t\t\t'index',\n\t\t\t'styles',\n\t\t\t'scripts',\n\t\t\t'templates',\n\t\t\t'fonts',\n\t\t\t'images'\n\t\t];\n\n\t\tif (args.mocks) {\n\t\t\tparallelTasks.push('mocks');\n\t\t}\n\n\t\trunSequence('conductor', parallelTasks, cb);\n\t};\n}", "function build(done) {\n runSequence('clean', ['html', 'htmlTemplate', 'static', 'styles', 'transpile'], done);\n}", "async function main() {\n const dependencyList = core.getInput('dependencies')\n const rubyVersion = core.getInput('ruby-version')\n\n try {\n // restores from cache if this ruby version was previously built and cached\n await restoreRubyFromCache(rubyVersion)\n\n // skip setting up environment when we're only building and Ruby's already built!\n if (isRubyBuilt(rubyVersion) && isBuildJob()) { return }\n\n await setupEnvironment(rubyVersion, dependencyList)\n await setupRuby(rubyVersion)\n await setupTestEnvironment(rubyVersion)\n }\n catch (error) {\n core.setFailed(`Action failed with error ${error}`)\n }\n\n}", "function build(cb) {\n cb();\n}", "ensureExternalBinariesExist() {\n if (!this.externalBinariesExist()) {\n throw new Error(`Cannot make for ${this.name}, the following external binaries need to be installed: ${this.requiredExternalBinaries.join(', ')}`);\n }\n }", "function pushBuildWorkflow() {\n timedExecOrDie(\n 'amp dist --noconfig --esm --version_override 0000000000000 --nomanglecache'\n );\n storeModuleBuildToWorkspace();\n}", "build () {}", "function generateBuild(bump, cb) {\n runSequence(\n 'check:git',\n 'lint:js',\n 'test:js',\n 'clean:before',\n bump,\n 'update:build',\n 'annotate:js',\n 'uglify:js',\n 'header:js',\n 'doc:js', cb);\n}", "async function startBuildStep() {\n rimraf(finalPagesDir)\n fs.mkdirSync(finalPagesDir)\n\n if (logBuild) {\n console.log(`Building pages | from ${currentPagesDir} to ${finalPagesDir}`)\n }\n\n readPageNamespaces() // Next step\n}", "buildFromSource(){\n const makeArgs = isWindows ? ['x64', 'noetw', 'no-cctest'] : [`-j${os.cpus().length}`];\n return this.printDiskUsage()\n .then(() => this.downloadExpandNodeSource())\n .then(() => this.prepareNodeJsBuild())\n .then(() => !isWindows && runCommand(this.configure, [], this.nodeSrcDir))\n .then(() => runCommand(this.make, makeArgs, this.nodeSrcDir))\n .then(() => this.uploadNodeBinary())\n .then(() => this.printDiskUsage())\n // .then(() => this.cleanupBuild().catch(err => log(err)))\n .then(() => {\n log(`RESULTS: ${this.resultFile}`);\n return this.resultFile;\n })\n .catch(err => this.printDiskUsage().then(() => {throw err;}))\n ;\n }", "async function build(opts) {\n opts = buildOpts(opts);\n\n await loadTree(opts, process.cwd());\n\n // ds add me@substack.net/foo\n // ds add me@neversaw.us/bar --dev\n // ds add me@neversaw.us/bar -D\n // ds rm me@neversaw.us/bar -D\n // ds build / ds make\n // ds clean / ds troy\n}", "async function performPreBuildSteps() {\n if (!argv._.includes('serve')) {\n await preBuildRuntimeFiles();\n await preBuildExtensions();\n }\n}", "function build(cb) {\n // body omitted\n cb();\n}", "function build(cb) {\n // body omitted\n cb();\n}", "function setup() {\n log('Welcome to Forefront!'.white.bold.bgMagenta);\n // Create or copy non-optional templates and directories\n fs.ensureDirSync(workingDir + 'assets/js');\n fs.ensureDirSync(workingDir + 'assets/img');\n fs.ensureDirSync(workingDir + 'assets/fonts');\n fs.ensureDirSync(workingDir + 'assets/css');\n fs.copySync(appDir + 'templates/FOREFRONT_HELP.md', workingDir + 'FOREFRONT_HELP.md');\n\n // Read in the package.json template\n packageJSON = fs.readJsonSync(appDir + 'templates/package.json');\n prompt.start(); // Initialize the Node prompt\n\n scaffoldREADME(); // Go to next step\n}", "function initdependencies(){\n process.spawnSync('npm',['install', '--save', 'express'], { cwd: './' });\n process.spawnSync('npm',['install', '--save', 'helmet'], { cwd: './' });\n}", "async build() {\n // on ready\n await new Promise(resolve => this.eden.once('eden.ready', resolve));\n\n // flow setup\n await this.eden.hook('flow.build', FlowHelper);\n }", "function build () {\n // return a Promise, representing completion of the build\n // the Promise resolves an object that is the result of all steps in the build executing\n return flush(tasks, initial)\n }", "function createNuGetPackages(cb) {\n createNuGetPackage(config.files.croquetscores_test_helpers.project)\n createNuGetPackage(config.files.croquetscores_test_helpers_selenium.project);\n cb();\n}", "function build(cb) {\n const buildCommand = 'JEKYLL_ENV=production bundle exec jekyll build';\n exec(buildCommand, (error, stdout, stderr) => {\n if (error) {\n gutil.log(gutil.colors.magenta(`exec error: ${error}`));\n return cb(error);\n }\n\n gutil.log(stdout);\n gutil.log(gutil.colors.magenta(stderr));\n cb()\n });\n}", "function install() {}", "function install() {}", "function install() {}", "function install() {}", "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}", "function build () {\n var env = new nunjucks.Environment(new nunjucks.FileSystemLoader(), {\n noCache: true\n });\n /***\n * Nunjucks Filters\n *\n * Additional filters built into Nunjucks to help generate the styleguide.\n */\n require('./nunjucksFilters/dump')(env);\n require('./nunjucksFilters/split')(env);\n require('./nunjucksFilters/join')(env);\n require('./nunjucksFilters/markdown')(env);\n require('./nunjucksFilters/luminance')(env);\n require('./nunjucksFilters/addModifier')(env);\n require('./nunjucksFilters/contains')(env);\n require('./nunjucksFilters/wrap')(env);\n require('./nunjucksFilters/colors')(env);\n require('./nunjucksFilters/highlightSyntax')(env);\n\n return env;\n}", "function buildProject(framework){\n const config = loadConfig(framework);\n fetchProjectSeed(config.seedName, () =>{\n let filefixer = fixAFileFn(Project.name, Project.description);\n costumizeSeed(config.filesToFix, filefixer); \n spinner.stop();\n successMsg('DONE!\\n');\n printInstructions(config.instructions);\n printFunRandomLittleSomething();\n });\n}", "function build(sample, done) {\n\n console.log('');\n console.log(' --- build sample: ' + sample + ' ---');\n console.log('');\n\n // Recycle local haxelib directory to prevent having to redownload libs for each sample\n var dotHaxelibPath = path.join(__dirname, sample, '.haxelib');\n if (prevDotHaxelibPath != null) {\n if (!fs.existsSync(dotHaxelibPath)) {\n command('mv', [\n prevDotHaxelibPath,\n dotHaxelibPath\n ]);\n }\n }\n prevDotHaxelibPath = dotHaxelibPath;\n\n command(\n 'ceramic',\n ['clay', 'build', 'web', '--setup', '--assets', '-D', 'ceramic_web_minify', '-D', 'ceramic_no_skip', '-D', 'ceramic_allow_default_mouse_wheel', '-D', 'ceramic_allow_default_touches'],\n {\n cwd: path.join(__dirname, sample)\n }\n );\n\n command('mv', [\n path.join(__dirname, sample, 'project', 'web'),\n path.join(__dirname, '_export', sample)\n ]);\n\n var gitignorePath = path.join(__dirname, '_export', sample, '.gitignore');\n if (fs.existsSync(gitignorePath)) {\n fs.unlinkSync(gitignorePath);\n }\n\n var screenshotPath = path.join(__dirname, sample, 'screenshot.png');\n var exportScreenshotPath = path.join(__dirname, '_export', sample, 'screenshot.png');\n var exportScreenshot400Path = path.join(__dirname, '_export', sample, 'thumbnail.png');\n if (fs.existsSync(screenshotPath)) {\n console.log('Copy screenshot');\n command('cp', [\n screenshotPath,\n exportScreenshotPath\n ]);\n sharp(screenshotPath)\n .resize({ width: 320 })\n .toFile(exportScreenshot400Path)\n .then(function() {\n done();\n });\n }\n else {\n var screenshotGifPath = path.join(__dirname, sample, 'screenshot.gif');\n var exportScreenshotGifPath = path.join(__dirname, '_export', sample, 'screenshot.gif');\n if (fs.existsSync(screenshotGifPath)) {\n console.log('Copy screenshot (gif)');\n command('cp', [\n screenshotGifPath,\n exportScreenshotGifPath\n ]);\n done();\n }\n else {\n done();\n }\n }\n\n}", "function buildDevEnv() {\n tools.buildDevEnv();\n}", "function jekyllBuild(done) {\n exec(\"bundle exec jekyll serve\", function (err, stdout, stderr) {\n console.log(stdout);\n console.error(stderr);\n });\n done();\n}", "async function build(f, msg, dev = false) {\n if (busy) {\n log.state('Build: busy...');\n setTimeout(() => build(f, msg), 500);\n return;\n }\n busy = true;\n log.info('Build: file', msg, f, 'type:', dev ? 'debug' : 'production', 'config:', dev ? config.debug : config.production);\n // common build options\n try {\n // rebuild all target groups and types\n for (const [targetGroupName, targetGroup] of Object.entries(targets)) {\n for (const [targetName, targetOptions] of Object.entries(targetGroup)) {\n // if triggered from watch mode, rebuild only browser bundle\n // if ((require.main !== module) && (targetGroupName !== 'browserBundle')) continue;\n const meta = dev\n // @ts-ignore\n ? await esbuild.build({ ...config.common, ...config.debug, ...targetOptions })\n // @ts-ignore\n : await esbuild.build({ ...config.common, ...config.production, ...targetOptions });\n const stats = await getStats(meta);\n log.state(`Build for: ${targetGroupName} type: ${targetName}:`, stats);\n }\n }\n if (!dev) {\n // generate typings & typedoc only when run as explict build\n await compile(targets.browserBundle.esm.entryPoints, tsconfig);\n await changelog.update('../CHANGELOG.md');\n await typedoc(targets.browserBundle.esm.entryPoints);\n }\n if (require.main === module) process.exit(0);\n } catch (err) {\n // catch errors and print where it occured\n log.error('Build error', JSON.stringify(err.errors || err, null, 2));\n if (require.main === module) process.exit(1);\n }\n busy = false;\n}", "function main () {\n if (process.platform === 'win32') {\n console.error('Sorry, check-deps only works on Mac and Linux')\n return\n }\n\n var usedDeps = findUsedDeps()\n var packageDeps = findPackageDeps()\n\n var missingDeps = usedDeps.filter(\n (dep) => !includes(packageDeps, dep) && !includes(BUILT_IN_DEPS, dep)\n )\n var unusedDeps = packageDeps.filter(\n (dep) => !includes(usedDeps, dep) && !includes(EXECUTABLE_DEPS, dep)\n )\n\n if (missingDeps.length > 0) {\n console.error('Missing package dependencies: ' + missingDeps)\n }\n if (unusedDeps.length > 0) {\n console.error('Unused package dependencies: ' + unusedDeps)\n }\n if (missingDeps.length + unusedDeps.length > 0) {\n process.exitCode = 1\n }\n}", "async prepare() {\n const detoxIosSourceTarballDirPath = path.join(__dirname, '../..');\n const detoxFrameworkPath = await environment.getFrameworkPath();\n const detoxFrameworkDirPath = path.parse(detoxFrameworkPath).dir;\n\n\n if (fs.existsSync(detoxFrameworkDirPath)) {\n if(!fs.existsSync(`${detoxFrameworkPath}`)) {\n throw new Error(`${detoxFrameworkDirPath} was found, but could not find Detox.framework inside it. This means that the Detox framework build process was interrupted.\n To solve this, either delete ${detoxFrameworkDirPath} or run 'detox clean-framework-cache'`);\n }\n } else {\n log.info(`Building Detox.framework (${environment.getDetoxVersion()}) into ${detoxFrameworkDirPath}...`);\n await exec.execAsync(path.join(__dirname, `../../scripts/build_framework.ios.sh \"${detoxIosSourceTarballDirPath}\" \"${detoxFrameworkDirPath}\"`));\n }\n }", "function build() {\n console.log('Creating an optimized production build...');\n webpack(config).run((err, stats) => {\n if (err) {\n printErrors('Failed to compile.', [err]);\n process.exit(1);\n }\n\n if (stats.compilation.errors.length) {\n printErrors('Failed to compile.', stats.compilation.errors);\n process.exit(1);\n }\n\n if (process.env.ESLINT_WARNING_MAX &&\n stats.compilation.warnings.length > parseInt(process.env.ESLINT_WARNING_MAX, 10)) {\n printErrors('Failed to compile. When process.env.ESLINT_WARNING_MAX is set, warnings total size should not greater than ' + process.env.ESLINT_WARNING_MAX + ' Otherwise treated as failures.', stats.compilation.warnings);\n process.exit(1);\n }\n\n console.log(chalk.green('Compiled successfully.'));\n console.log();\n\n console.log('File sizes after gzip:');\n console.log();\n printFileSizesAfterBuild(stats);\n console.log();\n\n var appPackage = require(paths.appPackageJson);\n var publicUrl = paths.publicUrl;\n var publicPath = config.output.publicPath;\n var publicPathname = url.parse(publicPath).pathname;\n var buildFolder = path.relative(process.cwd(), paths.appBuild);\n\n if (publicUrl && publicUrl.indexOf('.github.io/') !== -1) {\n // \"homepage\": \"http://user.github.io/project\"\n console.log('The project was built assuming it is hosted at ' + chalk.green(publicPathname) + '.');\n console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.');\n console.log();\n console.log('The ' + chalk.cyan('build') + ' folder is ready to be deployed.');\n console.log('To publish it at ' + chalk.green(publicUrl) + ', run:');\n // If script deploy has been added to package.json, skip the instructions\n if (typeof appPackage.scripts.deploy === 'undefined') {\n console.log();\n console.log(' ' + chalk.cyan('npm') + ' install --save-dev gh-pages');\n console.log();\n console.log('Add the following script in your ' + chalk.cyan('package.json') + '.');\n console.log();\n console.log(' ' + chalk.dim('// ...'));\n console.log(' ' + chalk.yellow('\"scripts\"') + ': {');\n console.log(' ' + chalk.dim('// ...'));\n console.log(' ' + chalk.yellow('\"predeploy\"') + ': ' + chalk.yellow('\"npm run build\",'));\n console.log(' ' + chalk.yellow('\"deploy\"') + ': ' + chalk.yellow('\"gh-pages -d build\"'));\n console.log(' }');\n console.log();\n console.log('Then run:');\n }\n console.log();\n console.log(' ' + chalk.cyan('npm') + ' run deploy');\n console.log();\n } else if (publicPath !== '/') {\n // \"homepage\": \"http://mywebsite.com/project\"\n console.log('The project was built assuming it is hosted at ' + chalk.green(publicPath) + '.');\n console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.');\n console.log();\n console.log('The ' + chalk.cyan('build') + ' folder is ready to be deployed.');\n console.log();\n } else {\n if (publicUrl) {\n // \"homepage\": \"http://mywebsite.com\"\n console.log('The project was built assuming it is hosted at ' + chalk.green(publicUrl) + '.');\n console.log('You can control this with the ' + chalk.green('homepage') + ' field in your ' + chalk.cyan('package.json') + '.');\n console.log();\n } else {\n // no homepage\n console.log('The project was built assuming it is hosted at the server root.');\n console.log('To override this, specify the ' + chalk.green('homepage') + ' in your ' + chalk.cyan('package.json') + '.');\n console.log('For example, add this to build it for GitHub Pages:');\n console.log();\n console.log(' ' + chalk.green('\"homepage\"') + chalk.cyan(': ') + chalk.green('\"http://www.dianrong.com/myapp\"') + chalk.cyan(','));\n console.log();\n }\n\n console.log('The ' + chalk.cyan(buildFolder) + ' folder is ready to be deployed.');\n console.log('You may serve it with a static server:');\n console.log();\n console.log(` ${chalk.cyan('npm')} install -g serve`);\n console.log(` ${chalk.cyan('serve')} -s build`);\n console.log();\n }\n });\n}", "function build(builder) {\n return RSVP.Promise.resolve()\n .then(function() {\n return builder.build();\n })\n .then(function(hash) {\n return /^0\\./.test(broccoliVersion) ? hash.directory : builder.outputPath;\n })\n }", "function scaffoldNPM() {\n // CSS Scripts\n if (cssChoice) {\n packageJSON['scripts'][cssChoice] = packageScriptTemplates[cssChoice];\n packageJSON['scripts']['build:styles'] =\n packageScriptTemplates['build:styles'].replace('%s', cssChoice);\n }\n // JS Scripts\n if (jsChoice) {\n packageJSON['scripts'][jsChoice] = packageScriptTemplates[jsChoice];\n packageJSON['scripts']['build:scripts'] =\n packageScriptTemplates['build:scripts'].replace('%s', jsChoice);\n packageJSON['devDependencies'][(devDependencyTemplates[jsChoice])] = 'latest';\n }\n // Write out the completed package.json template\n fs.writeJsonSync(workingDir + 'package.json', packageJSON);\n\n teardown(); // Go to last step\n}", "function build (context) {\n\tvar dockerfile = format('FROM node:%s-onbuild', context.version);\n\tvar tmpPath = join(context.path, '.' + context.version + '.dockerfile');\n\n\treturn fs.writeFile(tmpPath, dockerfile)\n\t\t.then(function () {\n\t\t\tvar image = format('test-%s-%s', context.name, context.version);\n\n\t\t\treturn run('docker', ['build', '-t', image, '-f', tmpPath, '.']).return(context);\n\t\t});\n}", "async function prepareRequirements() {\n await projectDAO.createProject('Projet', '2');\n await sprintDAO.createSprint('Sprint', 'NC', 1);\n await issueDAO.createIssue('DESC', 'TODO', 1, 1, 1);\n}", "function build(builder) {\n return RSVP.Promise.resolve()\n .then(function() {\n return builder.build()\n })\n .then(function(hash) {\n return /^0\\./.test(broccoliVersion) ? hash.directory : builder.outputPath\n })\n }", "function generateCloudbuild(packages, print = true) {\n // Make sure all packages are declared in package_dependencies.json.\n const allPackages = new Set(Object.keys(DEPENDENCY_GRAPH));\n for (const packageName of packages) {\n if (!allPackages.has(packageName)) {\n throw new Error(\n `Package ${packageName} was not declared in ` +\n 'package_dependencies.json');\n }\n }\n\n const deps = findDeps(packages);\n const reverseDeps = findReverseDeps(packages);\n const depsOfReverseDeps = findDeps(reverseDeps);\n\n const toBuild =\n new Set([...deps, ...packages, ...reverseDeps, ...depsOfReverseDeps]);\n const toTest = new Set([...packages, ...reverseDeps]);\n\n if (print) {\n // Log what will be built and tested\n const buildTestTable = [];\n for (const packageName of allPackages) {\n buildTestTable.push({\n 'Package': packageName,\n 'Will Build': toBuild.has(packageName) ? '✔' : '',\n 'Will Test': toTest.has(packageName) ? '✔' : ''\n });\n }\n printTable(buildTestTable);\n }\n\n // Load all the cloudbuild files for the packages\n // that need to be built or tested.\n const packageCloudbuildSteps = new Map();\n for (const packageName of new Set([...toBuild, ...toTest])) {\n const doc = yaml.safeLoad(\n fs.readFileSync(path.join(packageName, 'cloudbuild.yml')));\n packageCloudbuildSteps.set(packageName, new Set(doc.steps));\n }\n\n // Filter out excluded steps. Also remove test steps if the package is\n // not going to be tested. Change step ids to avoid name conflicts.\n for (const [packageName, steps] of packageCloudbuildSteps.entries()) {\n // TODO(msoulanille): Steps that depend on excluded steps might still\n // need to wait for the steps that the excluded steps wait for.\n for (const step of steps) {\n if (!step.id) {\n throw new Error(`Step from ${packageName} missing id`);\n }\n\n // Exclude a specific set of steps defined in `excludeSteps`.\n // Only include test steps if the package\n // is to be tested.\n if (EXCLUDE_STEPS.has(step.id) ||\n (!toTest.has(packageName) && isTestStep(step.id))) {\n steps.delete(step);\n continue;\n }\n\n // Append package name to each step's id.\n if (step.id) {\n // Test steps are not required to have ids.\n step.id = makeStepId(step.id, packageName);\n }\n\n // Append package names to step ids in the 'waitFor' field.\n if (step.waitFor) {\n step.waitFor = step.waitFor.filter(id => id && !EXCLUDE_STEPS.has(id))\n .map(id => makeStepId(id, packageName));\n }\n }\n }\n\n // Set 'waitFor' fields based on dependencies.\n for (const [packageName, steps] of packageCloudbuildSteps.entries()) {\n // Construct the set of step ids that rules in this package must wait for.\n // All packages depend on 'yarn-common', so we special-case it here.\n const waitForSteps = new Set(['yarn-common']);\n for (const dependencyName of (DEPENDENCY_GRAPH[packageName] || new Set())) {\n const cloudbuildSteps =\n packageCloudbuildSteps.get(dependencyName) || new Set();\n\n for (const step of cloudbuildSteps) {\n if (!isTestStep(step.id)) {\n waitForSteps.add(step.id);\n }\n }\n }\n\n // Add the above step ids to the `waitFor` field in each step.\n for (const step of steps) {\n step.waitFor = [...new Set([...(step.waitFor || []), ...waitForSteps])]\n }\n }\n\n // Load the general cloudbuild config\n baseCloudbuild =\n yaml.safeLoad(fs.readFileSync('scripts/cloudbuild_general_config.yml'));\n\n // Include yarn-common as the first step.\n const steps = [...baseCloudbuild.steps];\n\n // Arrange steps in dependency order\n for (const packageName of DEPENDENCY_ORDER) {\n const packageSteps = packageCloudbuildSteps.get(packageName);\n if (packageSteps) {\n for (const step of packageSteps) {\n steps.push(step);\n }\n }\n }\n\n // Remove unused secrets. Cloudbuild fails if extra secrets are included.\n const usedSecrets = new Set();\n for (const step of steps) {\n for (const secret of step.secretEnv || []) {\n usedSecrets.add(secret);\n }\n }\n const secretEnv = baseCloudbuild.secrets[0].secretEnv;\n for (const secret of Object.keys(secretEnv)) {\n if (!usedSecrets.has(secret)) {\n delete secretEnv[secret];\n }\n }\n if (Object.keys(secretEnv).length === 0) {\n delete baseCloudbuild.secrets;\n }\n\n baseCloudbuild.steps = steps;\n return baseCloudbuild;\n}", "function build() {\n console.log(chalk.yellow('Test build output...'));\n\n let compiler = webpack(config);\n return new Promise((resolve, reject) => {\n compiler.run((err, stats) => {\n if (err) {\n console.log(err)\n\n return reject(err);\n }\n console.log(stats.toString({\n colors: true\n }))\n return resolve({\n stats\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}", "function build() {\r\n let options = require('../config').building\r\n console.log('\\x1b[34mBuilding electron app(s)...\\n\\x1b[0m')\r\n packager(options, (err, appPaths) => {\r\n if (err) {\r\n console.error('\\x1b[31mError from `electron-packager` when building app...\\x1b[0m')\r\n console.error(err)\r\n } else {\r\n console.log('Build(s) successful!')\r\n console.log(appPaths)\r\n console.log('\\n\\x1b[34mDONE\\n\\x1b[0m')\r\n }\r\n })\r\n}", "install() {\n\n let args = {\n tfs: this.tfs,\n pat: this.pat,\n target: this.target,\n appName: this.applicationName,\n azureSub: this.azureSub,\n kubeName: this.kubeName,\n kubeConfig: this.kubeConfig,\n kubeResourceGroup: this.kubeResourceGroup,\n };\n\n app.run(args, this, function(error, generator) {\n if (error) {\n console.log(error);\n }\n else {\n compose.addBuild(generator);\n compose.addRelease(generator);\n }\n });\n }", "async function installDependencies() {\n var _a;\n const scannedFiles = Object.values(buildPipelineFiles)\n .map((f) => Object.values(f.filesToResolve))\n .reduce((flat, item) => flat.concat(item), []);\n const installDest = path_1.default.join(buildDirectoryLoc, config.buildOptions.metaUrlPath, 'pkg');\n const installResult = await installOptimizedDependencies(scannedFiles, installDest, commandOptions);\n const allFiles = glob_1.default.sync(`**/*`, {\n cwd: installDest,\n absolute: true,\n nodir: true,\n dot: true,\n follow: true,\n });\n if (!((_a = config.optimize) === null || _a === void 0 ? void 0 : _a.bundle)) {\n for (const installedFileLoc of allFiles) {\n if (!installedFileLoc.endsWith('import-map.json') &&\n path_1.default.extname(installedFileLoc) !== '.js') {\n const proxiedCode = await util_1.readFile(url_1.default.pathToFileURL(installedFileLoc));\n const importProxyFileLoc = installedFileLoc + '.proxy.js';\n const proxiedUrl = installedFileLoc.substr(buildDirectoryLoc.length).replace(/\\\\/g, '/');\n const proxyCode = await build_import_proxy_1.wrapImportProxy({\n url: proxiedUrl,\n code: proxiedCode,\n hmr: false,\n config: config,\n });\n await fs_1.promises.writeFile(importProxyFileLoc, proxyCode, 'utf8');\n }\n }\n }\n return installResult;\n }", "function build(cb) {\n clean();\n reduceCSS.scan();\n css();\n copyImage();\n cb();\n}", "function partTwo() {\n\t\t\t// If there is no package.json file, then we can't do anything\n\t\t\tsafefs.exists(packageJsonPath, function (exists) {\n\t\t\t\tif (!exists) return next();\n\n\t\t\t\t// Prepare command\n\t\t\t\tvar command = ['npm', 'install'].concat(opts.args);\n\n\t\t\t\t// Execute npm install inside the pugin directory\n\t\t\t\tsafeps.spawn(command, opts, next);\n\t\t\t});\n\t\t}", "function buildJekyll(done) {\n browser.notify(messages.jekyllBuild);\n return cp.spawn( jekyll , ['build'], {stdio: 'inherit'})\n .on('close', done);\n}", "function build(previousFileSizes) {\n\tconsole.log('Creating an optimized production build...');\n\n\tlet compiler;\n\ttry {\n\t\tcompiler = webpack(config);\n\t} catch (err) {\n\t\tprintErrors('Failed to compile.', [err]);\n\t\tprocess.exit(1);\n\t}\n\n\tcompiler.run((err, stats) => {\n\t\tif (err) {\n\t\t\tprintErrors('Failed to compile.', [err]);\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tif (stats.compilation.errors.length) {\n\t\t\tprintErrors('Failed to compile.', stats.compilation.errors);\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tif (process.env.CI && stats.compilation.warnings.length) {\n\t\t\tprintErrors(\n\t\t\t\t'Failed to compile. When process.env.CI = true, warnings are treated as failures.',\n\t\t\t\tstats.compilation.warnings,\n\t\t\t);\n\t\t\tprocess.exit(1);\n\t\t}\n\n\t\tconsole.log(chalk.green('Compiled successfully.'));\n\t\tconsole.log();\n\n\t\tconsole.log('File sizes after gzip:');\n\t\tconsole.log();\n\t\tprintFileSizesAfterBuild(stats, previousFileSizes);\n\t\tconsole.log();\n\n\t\tconsole.log(`The ${chalk.cyan(path.relative(process.cwd(), paths.build))} folder is ready to be deployed.`);\n\t\tconsole.log('You may serve it with a static server:');\n\t\tconsole.log();\n\n\t\tconsole.log(` ${chalk.cyan('npm')} install -g serve`);\n\t\tconsole.log(` ${chalk.cyan('serve')} -s build`);\n\t\tconsole.log();\n\t});\n}", "function setupProject(jscsVersion) {\n function setup() {\n var project = new MimosaProject();\n project.mimosaConfig.modules.push('jscs');\n\n var modules = [path.normalize(process.cwd())];\n jscsVersion && modules.push('jscs@' + jscsVersion);\n\n var npmInstallCmd = ['npm', 'install'].concat(modules);\n\n return project.exec.apply(project, npmInstallCmd).then(function () {\n return Promise.resolve(project);\n });\n }\n\n // Setup sometimes fails because npm install fails. This appears\n // to be random and possibly a bug in npm. The code below is a\n // workaround that retries the installation twice before giving\n // up.\n return setup().catch(setup).catch(setup);\n}", "createTempModulesAndCheckShrinkwrap(shrinkwrapFile, forceCreate) {\n const stopwatch = Stopwatch_1.Stopwatch.start();\n // Example: \"C:\\MyRepo\\common\\temp\\projects\"\n const tempProjectsFolder = path.join(this._rushConfiguration.commonTempFolder, RushConstants_1.RushConstants.rushTempProjectsFolderName);\n console.log(os.EOL + colors.bold('Updating temp projects in ' + tempProjectsFolder));\n Utilities_1.default.createFolderWithRetry(tempProjectsFolder);\n // We will start with the assumption that it's valid, and then set it to false if\n // any of the checks fail\n let shrinkwrapIsValid = true;\n if (!shrinkwrapFile) {\n shrinkwrapIsValid = false;\n }\n // Find the implicitly preferred versions\n // These are any first-level dependencies for which we only consume a single version range\n // (e.g. every package that depends on react uses an identical specifier)\n const allPreferredVersions = InstallManager.collectImplicitlyPreferredVersions(this._rushConfiguration);\n // Add in the explicitly preferred versions.\n // Note that these take precedence over implicitly preferred versions.\n node_core_library_1.MapExtensions.mergeFromMap(allPreferredVersions, this._rushConfiguration.commonVersions.getAllPreferredVersions());\n if (shrinkwrapFile) {\n // Check any preferred dependencies first\n allPreferredVersions.forEach((version, dependency) => {\n if (!shrinkwrapFile.hasCompatibleTopLevelDependency(dependency, version)) {\n console.log(colors.yellow(wrap(`${os.EOL}The NPM shrinkwrap file does not provide \"${dependency}\"`\n + ` (${version}) required by the preferred versions from ` + RushConstants_1.RushConstants.commonVersionsFilename)));\n shrinkwrapIsValid = false;\n }\n });\n if (this._findOrphanedTempProjects(shrinkwrapFile)) {\n // If there are any orphaned projects, then \"npm install\" would fail because the shrinkwrap\n // contains references such as \"resolved\": \"file:projects\\\\project1\" that refer to nonexistent\n // file paths.\n shrinkwrapIsValid = false;\n }\n }\n // Also copy down the committed .npmrc file, if there is one\n // \"common\\config\\rush\\.npmrc\" --> \"common\\temp\\.npmrc\"\n const committedNpmrcPath = path.join(this._rushConfiguration.commonRushConfigFolder, '.npmrc');\n const tempNpmrcPath = path.join(this._rushConfiguration.commonTempFolder, '.npmrc');\n // ensure that we remove any old one that may be hanging around\n fsx.removeSync(tempNpmrcPath);\n this.syncFile(committedNpmrcPath, tempNpmrcPath);\n // also, copy the pnpmfile.js if it exists\n if (this._rushConfiguration.packageManager === 'pnpm') {\n const committedPnpmFilePath = path.join(this._rushConfiguration.commonRushConfigFolder, RushConstants_1.RushConstants.pnpmFileFilename);\n const tempPnpmFilePath = path.join(this._rushConfiguration.commonTempFolder, RushConstants_1.RushConstants.pnpmFileFilename);\n // ensure that we remove any old one that may be hanging around\n fsx.removeSync(tempPnpmFilePath);\n this.syncFile(committedPnpmFilePath, tempPnpmFilePath);\n }\n const commonPackageJson = {\n dependencies: {},\n description: 'Temporary file generated by the Rush tool',\n name: 'rush-common',\n private: true,\n version: '0.0.0'\n };\n // Add any preferred versions to the top of the commonPackageJson\n // do this in alphabetical order for simpler debugging\n for (const dependency of Array.from(allPreferredVersions.keys()).sort()) {\n commonPackageJson.dependencies[dependency] = allPreferredVersions.get(dependency);\n }\n // To make the common/package.json file more readable, sort alphabetically\n // according to rushProject.tempProjectName instead of packageName.\n const sortedRushProjects = this._rushConfiguration.projects.slice(0);\n sortedRushProjects.sort((a, b) => a.tempProjectName.localeCompare(b.tempProjectName));\n for (const rushProject of sortedRushProjects) {\n const packageJson = rushProject.packageJson;\n // Example: \"C:\\MyRepo\\common\\temp\\projects\\my-project-2.tgz\"\n const tarballFile = this._getTarballFilePath(rushProject);\n // Example: \"my-project-2\"\n const unscopedTempProjectName = rushProject.unscopedTempProjectName;\n // Example: dependencies[\"@rush-temp/my-project-2\"] = \"file:./projects/my-project-2.tgz\"\n commonPackageJson.dependencies[rushProject.tempProjectName]\n = `file:./${RushConstants_1.RushConstants.rushTempProjectsFolderName}/${rushProject.unscopedTempProjectName}.tgz`;\n const tempPackageJson = {\n name: rushProject.tempProjectName,\n version: '0.0.0',\n private: true,\n dependencies: {}\n };\n // If there are any optional dependencies, copy them over directly\n if (packageJson.optionalDependencies) {\n tempPackageJson.optionalDependencies = packageJson.optionalDependencies;\n }\n // Collect pairs of (packageName, packageVersion) to be added as temp package dependencies\n const pairs = [];\n // If there are devDependencies, we need to merge them with the regular\n // dependencies. If the same library appears in both places, then the\n // regular dependency takes precedence over the devDependency.\n // It also takes precedence over a duplicate in optionalDependencies,\n // but NPM will take care of that for us. (Frankly any kind of duplicate\n // should be an error, but NPM is pretty lax about this.)\n if (packageJson.devDependencies) {\n for (const packageName of Object.keys(packageJson.devDependencies)) {\n pairs.push({ packageName: packageName, packageVersion: packageJson.devDependencies[packageName] });\n }\n }\n if (packageJson.dependencies) {\n for (const packageName of Object.keys(packageJson.dependencies)) {\n pairs.push({ packageName: packageName, packageVersion: packageJson.dependencies[packageName] });\n }\n }\n for (const pair of pairs) {\n // Is there a locally built Rush project that could satisfy this dependency?\n // If so, then we will symlink to the project folder rather than to common/temp/node_modules.\n // In this case, we don't want \"npm install\" to process this package, but we do need\n // to record this decision for \"rush link\" later, so we add it to a special 'rushDependencies' field.\n const localProject = this._rushConfiguration.getProjectByName(pair.packageName);\n if (localProject) {\n // Don't locally link if it's listed in the cyclicDependencyProjects\n if (!rushProject.cyclicDependencyProjects.has(pair.packageName)) {\n // Also, don't locally link if the SemVer doesn't match\n const localProjectVersion = localProject.packageJson.version;\n if (semver.satisfies(localProjectVersion, pair.packageVersion)) {\n // We will locally link this package\n if (!tempPackageJson.rushDependencies) {\n tempPackageJson.rushDependencies = {};\n }\n tempPackageJson.rushDependencies[pair.packageName] = pair.packageVersion;\n continue;\n }\n }\n }\n // We will NOT locally link this package; add it as a regular dependency.\n tempPackageJson.dependencies[pair.packageName] = pair.packageVersion;\n if (shrinkwrapFile) {\n if (!shrinkwrapFile.tryEnsureCompatibleDependency(pair.packageName, pair.packageVersion, rushProject.tempProjectName)) {\n console.log(colors.yellow(wrap(`${os.EOL}The NPM shrinkwrap file is missing \"${pair.packageName}\"`\n + ` (${pair.packageVersion}) required by \"${rushProject.packageName}\".`)));\n shrinkwrapIsValid = false;\n }\n }\n }\n // NPM expects the root of the tarball to have a directory called 'package'\n const npmPackageFolder = 'package';\n // Example: \"C:\\MyRepo\\common\\temp\\projects\\my-project-2\"\n const tempProjectFolder = path.join(this._rushConfiguration.commonTempFolder, RushConstants_1.RushConstants.rushTempProjectsFolderName, unscopedTempProjectName);\n // Example: \"C:\\MyRepo\\common\\temp\\projects\\my-project-2\\package.json\"\n const tempPackageJsonFilename = path.join(tempProjectFolder, RushConstants_1.RushConstants.packageJsonFilename);\n // we only want to overwrite the package if the existing tarball's package.json is different from tempPackageJson\n let shouldOverwrite = true;\n try {\n // if the tarball and the temp file still exist, then compare the contents\n if (fsx.existsSync(tarballFile) && fsx.existsSync(tempPackageJsonFilename)) {\n // compare the extracted package.json with the one we are about to write\n const oldBuffer = fsx.readFileSync(tempPackageJsonFilename);\n const newBuffer = new Buffer(node_core_library_1.JsonFile.stringify(tempPackageJson));\n if (Buffer.compare(oldBuffer, newBuffer) === 0) {\n shouldOverwrite = false;\n }\n }\n }\n catch (error) {\n // ignore the error, we will go ahead and create a new tarball\n }\n if (shouldOverwrite || forceCreate) {\n try {\n // ensure the folder we are about to zip exists\n Utilities_1.default.createFolderWithRetry(tempProjectFolder);\n // remove the old tarball & old temp package json, this is for any cases where new tarball creation\n // fails, and the shouldOverwrite logic is messed up because the my-project-2\\package.json\n // exists and is updated, but the tarball is not accurate\n fsx.removeSync(tarballFile);\n fsx.removeSync(tempPackageJsonFilename);\n // write the expected package.json file into the zip staging folder\n node_core_library_1.JsonFile.save(tempPackageJson, tempPackageJsonFilename);\n // create the new tarball\n tar.create({\n gzip: true,\n file: tarballFile,\n cwd: tempProjectFolder,\n portable: true,\n noMtime: true,\n noPax: true,\n sync: true,\n prefix: npmPackageFolder\n }, ['package.json']);\n console.log(`Updating ${tarballFile}`);\n }\n catch (error) {\n // delete everything in case of any error\n fsx.removeSync(tarballFile);\n fsx.removeSync(tempPackageJsonFilename);\n }\n }\n }\n // Example: \"C:\\MyRepo\\common\\temp\\package.json\"\n const commonPackageJsonFilename = path.join(this._rushConfiguration.commonTempFolder, RushConstants_1.RushConstants.packageJsonFilename);\n if (shrinkwrapFile) {\n // Resync the temporary shrinkwrap file.\n // Copy (or delete) common\\npm-shrinkwrap.json --> common\\temp\\npm-shrinkwrap.json\n shrinkwrapFile.save(this._rushConfiguration.tempShrinkwrapFilename);\n }\n else {\n fsx.removeSync(this._rushConfiguration.tempShrinkwrapFilename);\n }\n // Don't update the file timestamp unless the content has changed, since \"rush install\"\n // will consider this timestamp\n node_core_library_1.JsonFile.save(commonPackageJson, commonPackageJsonFilename, { onlyIfChanged: true });\n stopwatch.stop();\n console.log(`Finished creating temporary modules (${stopwatch.toString()})`);\n return shrinkwrapIsValid;\n }", "function installTools(missing, goVersion) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!missing) {\n return [];\n }\n goStatus_1.outputChannel.show();\n goStatus_1.outputChannel.clear();\n const envForTools = goEnv_1.toolInstallationEnvironment();\n const toolsGopath = envForTools['GOPATH'];\n let envMsg = `Tools environment: GOPATH=${toolsGopath}`;\n if (envForTools['GOBIN']) {\n envMsg += `, GOBIN=${envForTools['GOBIN']}`;\n }\n goStatus_1.outputChannel.appendLine(envMsg);\n let installingMsg = `Installing ${missing.length} ${missing.length > 1 ? 'tools' : 'tool'} at `;\n if (envForTools['GOBIN']) {\n installingMsg += `the configured GOBIN: ${envForTools['GOBIN']}`;\n }\n else {\n const p = toolsGopath.split(path.delimiter).map((e) => path.join(e, 'bin')).join(path.delimiter);\n installingMsg += `${p}`;\n }\n // If the user is on Go >= 1.11, tools should be installed with modules enabled.\n // This ensures that users get the latest tagged version, rather than master,\n // which may be unstable.\n let modulesOff = false;\n if (goVersion.lt('1.11')) {\n modulesOff = true;\n }\n else {\n installingMsg += ' in module mode.';\n }\n goStatus_1.outputChannel.appendLine(installingMsg);\n missing.forEach((missingTool) => {\n let toolName = missingTool.name;\n if (missingTool.version) {\n toolName += '@' + missingTool.version;\n }\n goStatus_1.outputChannel.appendLine(' ' + toolName);\n });\n goStatus_1.outputChannel.appendLine(''); // Blank line for spacing.\n const toInstall = [];\n for (const tool of missing) {\n // Disable modules for tools which are installed with the \"...\" wildcard.\n const modulesOffForTool = modulesOff || goTools_1.disableModulesForWildcard(tool, goVersion);\n const reason = installTool(tool, goVersion, envForTools, !modulesOffForTool);\n toInstall.push(Promise.resolve({ tool, reason: yield reason }));\n }\n const results = yield Promise.all(toInstall);\n const failures = [];\n for (const result of results) {\n if (result.reason === '') {\n // Restart the language server if a new binary has been installed.\n if (result.tool.name === 'gopls') {\n goMain_1.restartLanguageServer();\n }\n }\n else {\n failures.push(result);\n }\n }\n // Report detailed information about any failures.\n goStatus_1.outputChannel.appendLine(''); // blank line for spacing\n if (failures.length === 0) {\n goStatus_1.outputChannel.appendLine('All tools successfully installed. You are ready to Go :).');\n }\n else {\n goStatus_1.outputChannel.appendLine(failures.length + ' tools failed to install.\\n');\n for (const failure of failures) {\n goStatus_1.outputChannel.appendLine(`${failure.tool.name}: ${failure.reason} `);\n }\n }\n return failures;\n });\n}", "function installFn () {\n // == BEGIN MODULE SCOPE VARIABLES ==================================\n var\n xhiObj = this,\n\n commandMap = xhiObj.commandMap,\n logFn = xhiObj.logFn,\n prefixStr = xhiObj.makePrefixStr( commandMap ),\n stageStatusMap = xhiObj.stageStatusMap,\n\n aliasStr = commandMap.alias_str,\n childProcObj\n ;\n // == . END MODULE SCOPE VARIABLES ==================================\n\n // == BEGIN EVENT HANLDERS ==========================================\n function onCloseFn ( exit_int ) {\n // Store failure and finish\n if ( exit_int !== 0 ) {\n stageStatusMap[ aliasStr ] = false;\n return xhiObj.catchFn(\n prefixStr + 'Fail'\n + '\\nPlease run \"npm install\" to diagnose.'\n );\n }\n\n // Store success and finish\n stageStatusMap[ aliasStr ] = true;\n\n logFn( prefixStr + 'Success' );\n xhiObj.loadLibsFn();\n xhiObj.nextFn();\n }\n // == . END EVENT HANLDERS ==========================================\n\n // == BEGIN MAIN ====================================================\n function mainFn () {\n logFn( prefixStr + 'Start' );\n\n // Invalidate all these stages\n xhiObj.xhiUtilObj._clearMap_(\n stageStatusMap, [\n 'setup', 'dev_test', 'dev_lint', 'dev_cover', 'build'\n ]\n );\n childProcObj = xhiObj.makeSpawnObj(\n 'npm', [ 'install' ], { stdio : 'inherit'}\n );\n childProcObj.on( 'close', onCloseFn );\n }\n // == . END MAIN ====================================================\n mainFn();\n}", "function doBuild(builder) {\n if (builder.isAvailable) {\n return builder\n .build()\n .then(() => {\n return apputils_1.showDialog({\n title: 'Build Complete',\n body: 'Build successfully completed, reload page?',\n buttons: [\n apputils_1.Dialog.cancelButton(),\n apputils_1.Dialog.warnButton({ label: 'RELOAD' })\n ]\n });\n })\n .then(result => {\n if (result.button.accept) {\n location.reload();\n }\n })\n .catch(err => {\n apputils_1.showDialog({\n title: 'Build Failed',\n body: React.createElement(\"pre\", null, err.message)\n });\n });\n }\n return Promise.resolve();\n}", "async function composer() {\n console.log( taskHeader(\n '3/5',\n 'Dependencies',\n 'Install',\n 'Composer (PHP)'\n ) );\n\n try {\n const { stdout, stderr } = await execa.commandSync( 'composer install --prefer-dist --no-interaction --no-suggest' );\n console.log( stdout );\n console.log( stderr );\n } catch ( error ) {\n console.error( error.stdout );\n }\n}", "function main(type) {\n// INPUT\n var initialFilesystem = [\n {\n cwd: ['..'],\n path: ['src']\n },\n {\n cwd: ['..'],\n files: ['bower.json']\n },\n {\n cwd: ['..'],\n path: ['install']\n }\n ];\n return pathExists('../dev/config')\n .then(function (exists) {\n // ugly work around for now\n var buildControlConfigPath;\n if (exists) {\n initialFilesystem.push({\n cwd: ['..', 'dev'],\n path: ['config']\n });\n buildControlConfigPath = ['..', 'dev', 'config', 'builds', type + '.yml'];\n } else {\n initialFilesystem.push({\n cwd: ['..'],\n path: ['config']\n });\n buildControlConfigPath = ['..', 'config', 'builds', type + '.yml'];\n }\n return {\n initialFilesystem: initialFilesystem,\n buildControlConfigPath: buildControlConfigPath\n };\n })\n .then(function (config) {\n console.log('Creating initial state with config: ');\n // console.log(config);\n return mutant.createInitialState(config);\n })\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n console.log('Setting up build...');\n return setupBuild(state);\n })\n\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n console.log('Fetching bower packages...');\n return fetchPackagesWithBower(state);\n })\n\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n console.log('Installing bower packages...');\n return installBowerPackages(state);\n })\n\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n console.log('Installing Plugins...');\n return installPlugins(state);\n })\n\n\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n console.log('Installing Modules...');\n return installModules(state);\n })\n\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n console.log('Installing Module Packages from Bower...');\n return installModulePackagesFromBower(state);\n })\n\n// .then(function (state) {\n// return mutant.copyState(state);\n// })\n// .then(function (state) {\n// return installModulePackagesFromFilesystem(state);\n// })\n\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n console.log('Copying config files...');\n return copyUiConfig(state);\n })\n\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n console.log('Making KBase Config...');\n return makeKbConfig(state);\n })\n\n // Disable temporarily ... we don't want to wipe out bower.json\n // until we have determined if we will be building a dist.\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n console.log('Cleaning up...');\n return cleanup(state);\n })\n\n\n // From here, we can make a dev build, make a release\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n console.log('Making the base build...');\n return makeBaseBuild(state);\n })\n\n .then(function (state) {\n return mutant.copyState(state);\n })\n .then(function (state) {\n if (state.config.build.dist) {\n console.log('Making the dist build...');\n return makeDistBuild(state);\n }\n return state;\n })\n\n // Here we handle any developer links.\n //.then(function (state) {\n // return mutant.copyState(state);\n //})\n //.then(function (state) {\n // \n //})\n\n .then(function (state) {\n return mutant.finish(state);\n })\n .catch(function (err) {\n console.log('ERROR');\n console.log(err);\n console.log(util.inspect(err, {\n showHidden: false,\n depth: 10\n }));\n console.log(err.stack);\n });\n}", "function buildExperiment(cb) {\n var args = [IOWA.urlPrefix + IOWA.experimentUrl];\n var build = spawn('./bin/build', args, {cwd: IOWA.experimentDir, stdio: 'inherit'});\n build.on('close', cb);\n}", "build() {\n var $this = this;\n\n // Carregar parametros\n var version = this.config('build.version', '0.0.0');\n var name = this.config('build.config.js.name', 'nws-sdk');\n var internal_name = this.config('build.config.js.internal_name', 'nws');\n var keyword = this.config('build.config.js.keyword', 'netforce');\n var github = this.config('build.config.js.github', 'git@github.com:netforcews/sdk-js.git');\n\n // Preparar diretorios\n var pathBase = this.getPath('js', { version: this.config('build.version', '0.0.0') });\n var pathStubs = __dirname + '/js/src/stubs';\n\n // Se pasta existir deve limpar\n if (fs.existsSync(pathBase)) {\n rimraf.sync(pathBase);\n }\n\n var pathModels = path.resolve(pathBase, 'src', 'Models');\n var pathResources = path.resolve(pathBase, 'src', 'Resources');\n var pathServices = path.resolve(pathBase, 'src');\n\n // Arquivos /root\n //this.copyStub(__dirname + '/js/.gitignore', pathBase + '/.gitignore');\n this.copyStub(__dirname + '/js/.babelrc', pathBase + '/.babelrc');\n this.copyStub(__dirname + '/js/.npmrc.txt', pathBase + '/.npmrc');\n this.copyStub(__dirname + '/js/package.json', pathBase + '/package.json', {\n version : version,\n name : name,\n keyword : keyword,\n github : github,\n });\n this.copyStub(__dirname + '/js/webpack.config.js', pathBase + '/webpack.config.js', { 'version' : version });\n this.copyStub(__dirname + '/js/browser.js', pathBase + '/browser.js', { 'internal_name' : internal_name });\n\n // Arquivos /src/Base\n this.copyStub(__dirname + '/js/src/Client.js', pathBase + '/src/Base/Client.js', { 'version' : version });\n this.copyStub(__dirname + '/js/src/Global.js', pathBase + '/src/Base/Global.js');\n this.copyStub(__dirname + '/js/src/Consts.js', pathBase + '/src/Base/Consts.js', {\n 'env_production' : this.config('build.endpoints.production', '???'),\n 'env_sandbox' : this.config('build.endpoints.sandbox', '???'),\n 'env_local' : this.config('build.endpoints.local', '???'),\n });\n this.copyStub(__dirname + '/js/src/Model.js', pathBase + '/src/Base/Model.js');\n this.copyStub(__dirname + '/js/src/Resource.js', pathBase + '/src/Base/Resource.js');\n this.copyStub(__dirname + '/js/src/ApiClient.js', pathServices + '/ApiClient.js');\n\n // Models /src/Models\n Arr.each(this.models, (key, model) => {\n $this.buildModel(pathModels, model, pathStubs);\n });\n\n // Resources /src/Resources\n Arr.each(this.resources, (key, resource) => {\n $this.buildResource(pathResources, resource, pathStubs);\n });\n\n // Services /src\n var services = [];\n Arr.each(this.services, (key, service) => {\n services.push($this.buildService(pathServices, service, pathStubs));\n });\n\n // Gerar arquivo index.js\n this.copyIndex(services, pathBase);\n }", "async function $build(argv: string[], options: Options) {\n const {\n \"--base\": base = \"/\",\n \"--out-client\": outClient = \"dist/client\",\n \"--out-server\": outServer = \"dist/server\",\n \"--source-map\": sourceMap = false,\n \"--help\": help = false,\n } = arg(\n {\n \"--base\": String,\n \"--out-server\": String,\n \"--out-client\": String,\n \"--source-map\": Boolean,\n \"--help\": Boolean,\n },\n { argv }\n );\n\n if (help) {\n return console.log(`\nBuild client and server-side bundles for deploying to a production environment.\n\n--base Base public path when built in production (default: \"/\")\n--out-client Output directory for client files relative to root (default: \"dist/client\")\n--out-client Output directory for server files relative to root (default: \"dist/server\")\n--source-map Generate production source maps (default: false)\n`);\n }\n\n await build({\n base: base,\n sourceMap: sourceMap,\n src: options.src,\n root: options.root,\n publicDir: options.publicDir,\n out: { server: outServer, client: outClient },\n });\n}", "function prepareBuild(config) {\n\n function serve(exitCode) {\n\n // Save our exitCode for testing\n spyExitCode = exitCode;\n\n // Reset skyuxconfig.json\n resetConfig();\n\n return server.start({ sslCert, sslKey }, 'unused-root', tmp)\n .then(port => browser.get(`https://localhost:${port}/dist/`));\n }\n\n writeConfig(config);\n\n return new Promise((resolve, reject) => {\n rimrafPromise(path.join(tmp, 'dist'))\n .then(() => exec(`node`, [cliPath, `build`, `--logFormat`, `none`], cwdOpts))\n .then(serve)\n .then(resolve)\n .catch(err => reject(err));\n });\n}", "function build() {\n\tconst markdown = fs\n\t\t// Load markdown.\n\t\t.readFileSync(readmePath, 'utf8')\n\t\t// Uncomment docdash HTML hints.\n\t\t.replace(/(<)!--\\s*|\\s*--(>)/g, '$1$2')\n\t\t// Convert source and npm package links to anchors.\n\t\t.replace(\n\t\t\t/\\[source\\]\\(([^)]+)\\) \\[npm package\\]\\(([^)]+)\\)/g,\n\t\t\t(match, href1, href2) =>\n\t\t\t\t`<p class=\"pee-balls\"><a class=\"a-balls\" href=\"${href1}\">source</a><a href=\"${href2}\">npm package</a></p>`\n\t\t)\n\n\tconst $ = cheerio.load(\n\t\tmarky(markdown, {\n\t\t\tenableHeadingLinkIcons: false,\n\t\t\tsanitize: false\n\t\t})\n\t)\n\n\tconst $header = $('h1')\n\t\t.first()\n\t\t.remove()\n\n\tconst version = $header\n\t\t.find('span')\n\t\t.first()\n\t\t.text()\n\t\t.trim()\n\t\t.slice(1)\n\n\t// Auto-link flodash method references.\n\tautoLink($)\n\t// Rename \"_\" id references to \"flodash\".\n\trenameflodashId($)\n\t// Remove docdash horizontal rules.\n\tremoveHorizontalRules($)\n\t// Remove marky-markdown attribute additions.\n\tremoveMarkyAttributes($)\n\t// Repair marky-markdown wrapping around headers.\n\trepairMarkyHeaders($)\n\t// Cleanup highlights.\n\ttidyHighlights($)\n\n\tconst _html = () => {\n\t\treturn /* html */ `\n\t\t\t<!DOCTYPE html>\n\t\t\t<html class=\"docs gr__flodash_com\" style=\"overflow: auto;\">\n\t\t\t\t<head>\n\t\t\t\t\t<meta charset=\"utf-8\">\n\t\t\t\t\t<meta content=\"IE=edge\" http-equiv=\"X-UA-Compatible\">\n\t\t\t\t\t<title>flodash Docs</title>\n\t\t\t\t\t<meta content=\"width=device-width, initial-scale=1\" name=\"viewport\">\n\t\t\t\t\t<link href=\"assets/css/doc.css\" rel=\"stylesheet\" type=\"text/css\">\n\t\t\t\t\t<script src=\"../vendor/lodash/lodash.min.js\"></script>\n\t\t\t\t\t<script src=\"../vendor/g/fuse@2.6.1,react@15.4.0(react.min.js+react-dom.min.js\"></script>\n\t\t\t\t\t<script async src=\"../assets/js/docs.js\"></script>\n\t\t\t\t\t<link href=\"https://cdn.jsdelivr.net/fontawesome/4.7.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n\t\t\t\t\t<script async src=\"../assets/js/boot.js\"></script>\n\t\t\t\t\t<script async src=\"https://embed.runkit.com\" async></script>\n\t\t\t\t</head>\n\t\t\t\t<body class=\"layout-docs\">\n\t\t\t\t\t<header>\n\t\t\t\t\t\t<div class=\"container\">\n\t\t\t\t\t\t\t\t<div class=\"header-section logo-section\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"logo\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"../index.html\" title=\"flodash\">flodash</a>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"header-group\">\n\t\t\t\t\t\t\t\t\t\t\t\t<h1>flodash</h1>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"header-section mobile-menu\">\n \t\t\t\t\t\t\t<a href=\"#\"><i class=\"fa fa-bars\" aria-hidden=\"true\"></i>Menu</a>\n \t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</header>\n\t\t\t\t\t<div class=\"doc-main\">\n\t\t\t\t\t\t${$.html().trim()}\n\t\t\t\t\t</div>\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t`\n\t}\n\n\tconst __html = /* html */ `${_html()}`\n\n\tfs.writeFile(path.join(docPath, 'balls' + '.html'), __html, util.pitch)\n\t// fs.writeFile(path.join(docPath, 'doc' + '.html'), __html, util.pitch)\n\n}", "function build() {\n var procBuild = cp.fork(\n './build-chromium.js',\n [],\n {cwd: ''}\n );\n procBuild.on('exit', function (code, signal) {\n if (!signal) {\n if (code) { // w/ error, exit\n console.log('[Error]: %s', './build-chromium.js failed');\n process.exit(1);\n }\n else { // succeeded\n if (commits.length > 0) {\n srcGitReset(); // start from cleaning up of the current checkout\n }\n }\n }\n });\n}", "function runBuild () {\n execSync('yarn build');\n}", "function r(){throw new Error(\"Dynamic requires are not currently supported by rollup-plugin-commonjs\")}", "function next() {\n\t\tvar bopts;\n\t\tvar name;\n\t\tvar pkg;\n\t\tvar out;\n\n\t\ti += 1;\n\t\tpkg = pkgs[ i ];\n\n\t\t// TODO: read `package.json`\n\t\tname = packageName( pkg );\n\t\tdebug( 'Package name: %s', name );\n\n\t\tout = join( dest, name );\n\t\tdebug( 'Destination directory: %s', out );\n\n\t\tbopts = {};\n\t\tbopts.readme = opts.readme;\n\t\tbopts.index = opts.index;\n\t\tbopts.title = name;\n\t\tbopts.mount = opts.mount + name + '/';\n\t\tbopts.head = opts.head;\n\t\tbopts.prepend = opts.prepend;\n\t\tbopts.append = opts.append;\n\n\t\tbopts.tests = copy( opts.tests );\n\t\tbopts.tests.title = name + ' - Tests';\n\n\t\tbopts.benchmarks = copy( opts.benchmarks );\n\t\tbopts.benchmarks.title = name + ' - Benchmarks';\n\n\t\tdebug( 'Build options: %s', JSON.stringify( bopts ) );\n\n\t\tdebug( 'Building package: %s (%d of %d)', pkg, i+1, len );\n\t\tbuildPkg( pkg, out, bopts, getClbk( i ) );\n\t}", "async function copy() {\n await makeDir('build');\n await Promise.all([\n writeFile(\n 'build/package.json',\n JSON.stringify(\n {\n private: true,\n engines: pkg.engines,\n dependencies: pkg.dependencies,\n scripts: {\n start: 'node server.js',\n },\n },\n null,\n 2,\n ),\n ),\n copyFile('LICENSE.txt', 'build/LICENSE.txt'),\n copyFile('yarn.lock', 'build/yarn.lock'),\n copyDir('public', 'build/public'),\n copyDir('gcp', 'build/gcp'),\n ]);\n}", "install() {\n this.installDependencies();\n }", "function build(done) {\n let files = jetpack.inspectTree('./src').children;\n var content = \"\";\n jetpack.remove('./dist');\n for(var file in files){\n if(files[file].type != 'file')\n continue;\n content = jetpack.read( jetpack.path('./src', files[file].name ) );\n content = content.replace(/\\s{0,}module\\.exports(\\.\\w*)?\\s{0,}=\\s{0,}\\w*;?/ig,'');\n content = content.replace(/\\s{0,}(const|let|var)\\s{0,}\\w*\\s{0,}=\\s{0,}require\\(([\\w\\/\\.\\\"\\']+)\\);?/gi,'');\n jetpack.append('./dist/math.js', content );\n }\n done();\n}", "function buildSite( cb, options, environment = \"development\" ) {\n const args = options ? hugoArgsDefault.concat( options ) : hugoArgsDefault;\n\n process.env.NODE_ENV = environment;\n\n return spawn( hugoBin, args, { stdio: \"inherit\" } ).on( \"close\", ( code ) => {\n if ( code === 0 ) {\n browserSync.reload();\n cb();\n } else {\n browserSync.notify( \"Hugo build failed :(\" );\n cb( \"Hugo build failed\" );\n }\n } );\n}", "async composeWithJavaDependencies(config = this.jhipsterConfig) {\n config = defaults({}, config, defaultConfig);\n const buildTool = config[BUILD_TOOL];\n if (buildTool === BUILD_TOOL_MAVEN) {\n await this.composeWithJHipster(GENERATOR_MAVEN);\n } else if (buildTool === BUILD_TOOL_GRADLE) {\n await this.composeWithJHipster(GENERATOR_GRADLE);\n } else if (buildTool.includes(':')) {\n await this.composeWithJHipster(buildTool);\n }\n }", "build() {\n var $this = this;\n\n // Carregar parametros\n var version = this.config('build.version', '0.0.0');\n var name = this.config('build.config.php.name', 'netforce/sdk-php');\n var description = this.config('build.config.php.description', 'NetForce SDK PHP');\n var keyword = this.config('build.config.php.keyword', 'netforce');\n var ns = this.config('build.config.php.namespace', 'NetForce\\Sdk');\n\n // Preparar diretorios\n var pathBase = this.getPath('php', { version: this.config('build.version', '0.0.0') });\n var pathStubs = __dirname + '/php/src/stubs';\n\n // Se pasta existir deve limpar\n if (fs.existsSync(pathBase)) {\n rimraf.sync(pathBase);\n }\n\n var pathModels = path.resolve(pathBase, 'src', 'Models');\n var pathResources = path.resolve(pathBase, 'src', 'Resources');\n var pathServices = path.resolve(pathBase, 'src');\n\n // Arquivos /root\n //this.copyStub(__dirname + '/php/.gitignore', pathBase + '/.gitignore');\n this.copyStub(__dirname + '/php/composer.json', pathBase + '/composer.json', {\n ns : Str.replaceAll('\\\\\\\\', '\\\\\\\\', ns),\n version,\n name,\n description,\n keyword,\n });\n\n // Arquivos /src/Base\n this.copyStub(__dirname + '/php/src/Client.txt', pathBase + '/src/Base/Client.php', {\n ns : ns, \n version : version,\n env_production : this.config('build.endpoints.production', '???'),\n env_sandbox : this.config('build.endpoints.sandbox', '???'),\n env_local : this.config('build.endpoints.local', '???'),\n });\n this.copyStub(__dirname + '/php/src/Response.txt', pathBase + '/src/Base/Response.php', { ns });\n this.copyStub(__dirname + '/php/src/Resource.txt', pathBase + '/src/Base/Resource.php', { ns });\n this.copyStub(__dirname + '/php/src/Model.txt', pathBase + '/src/Base/Model.php', { ns });\n this.copyStub(__dirname + '/php/src/ApiClient.txt', pathServices + '/ApiClient.php', { ns });\n\n // Models /src/Models\n Arr.each(this.models, (key, model) => {\n $this.buildModel(pathModels, model, pathStubs, { ns });\n });\n \n // Resources /src/Resources\n Arr.each(this.resources, (key, resource) => {\n $this.buildResource(pathResources, resource, pathStubs, { ns });\n });\n \n // Services /src\n var services = [];\n Arr.each(this.services, (key, service) => {\n services.push($this.buildService(pathServices, service, pathStubs, { ns }));\n });\n }", "function mainFn () {\n logFn( prefixStr + 'Start' );\n\n // Invalidate all these stages\n xhiObj.xhiUtilObj._clearMap_(\n stageStatusMap, [\n 'setup', 'dev_test', 'dev_lint', 'dev_cover', 'build'\n ]\n );\n childProcObj = xhiObj.makeSpawnObj(\n 'npm', [ 'install' ], { stdio : 'inherit'}\n );\n childProcObj.on( 'close', onCloseFn );\n }", "build({ sourcePath, buildSourcesCmd, verbose = false }) {\n process.chdir(sourcePath);\n logger.section(`Compile source:\\n$ ${buildSourcesCmd}`);\n shell.exec(buildSourcesCmd, { silent: !verbose });\n }", "function buildSite(cb, options, environment = \"development\") {\n const args = options ? hugoArgsDefault.concat(options) : hugoArgsDefault;\n\n process.env.NODE_ENV = environment;\n\n return spawn(hugoBin, args, {stdio: \"inherit\"}).on(\"close\", (code) => {\n if (code === 0) {\n browserSync.reload();\n cb();\n } else {\n browserSync.notify(\"Hugo build failed :(\");\n cb(\"Hugo build failed\");\n }\n });\n}", "function buildBaseFiles(cb) {\n\tconsole.log(\"Copy pace.min.js successful\");\n\tsrc('./node_modules/pace-progress/pace.min.js')\n\t\t.pipe(dest(config.paths.js.srcRaw));\n\n\tconsole.log(\"Copy lazysizes.js successful\");\n\tsrc('./node_modules/lazysizes/lazysizes.js')\n\t\t.pipe(dest(config.paths.js.srcRaw));\n\n\tconsole.log(\"modernizr.min.js generated\");\n\tsrc(config.paths.js.src)\n\t\t.pipe(modernizr('modernizr.min.js'))\n\t\t.pipe(uglify())\n\t\t.pipe(dest( config.paths.vendor.paths.js ));\n\tcb();\n}", "async build() {\n await this._processMiddlewares({\n middlewaresKey: 'lifecycle.willBuild',\n });\n\n if (this.config.get('cleanDestination') || this.options.clean) {\n await this.cleanDestination();\n }\n\n const metadata = this.metadata.get();\n\n await this._wrapCommand('Writing destination.\\t\\t\\t', () =>\n Promise.all(_.map(this.destination, file => file.write(metadata)))\n );\n\n await this._processMiddlewares({\n middlewaresKey: 'lifecycle.didBuild',\n });\n }", "async function installRubyBuild(rubyVersion) {\n core.startGroup(`Installing ruby-build`)\n\n const buildDir = `${process.env.HOME}/ruby-build`\n var repoPath\n\n // Rubies 2.0 ... 2.3 (these need OpenSSL 1.0 and eregon provides it for us)\n if (usesOldOpenSsl(rubyVersion)) {\n console.log('cloning eregon/ruby-build')\n repoPath = '--branch ruby23-openssl-linux https://github.com/eregon/ruby-build.git'\n\n // all the other Rubies\n } else {\n console.log('cloning rbenv/ruby-build')\n repoPath = 'https://github.com/rbenv/ruby-build.git'\n }\n\n await exec.exec(`git clone ${repoPath} ${buildDir}`)\n await exec.exec(`sudo ${buildDir}/install.sh`)\n\n core.endGroup()\n}", "function install() {\n}", "function buildMain() {\n const wrapper = fs.readFileSync('src/.wrapper.js', { encoding: 'utf8' })\n .split('@@js\\n');\n\n const files_to_load = [\n ...CORE_JS,\n ...Object.values(ALL_PLUGINS_JS),\n ];\n\n const output = BANNER()\n + '\\n\\n'\n + wrapper[0]\n + files_to_load.map(f => fs.readFileSync(f, { encoding: 'utf8' })).join('\\n\\n')\n + '\\n\\n'\n + getLang('en')\n + wrapper[1];\n\n const outpath = `${DIST}js/query-builder.js`;\n console.log(`MAIN (${outpath})`);\n fs.writeFileSync(outpath, output);\n}", "function jekyllBuild() {\n browserSync.notify(messages.jekyllBuild);\n if (env === 'prod') {\n return cp.spawn(jekyll, ['build'], { stdio: 'inherit' });\n } else {\n return cp.spawn(\n jekyll,\n ['build', '--config', '_config.yml,_config.dev.yml'],\n {\n stdio: 'inherit',\n },\n );\n }\n}", "build () {\r\n // glob tasks\r\n let done = [];\r\n let tasks = glob.sync (this.files ('tasks/*.js'));\r\n let watchers = [];\r\n let installers = [];\r\n\r\n // loop tasks\r\n for (var i = 0; i < tasks.length; i++) {\r\n // load task\r\n let task = parser.task (tasks[i]);\r\n\r\n // create task\r\n let Task = this._task (task);\r\n\r\n // add to default task\r\n if (done.indexOf (task.task) === -1) installers.push (task.task);\r\n\r\n // push to done\r\n done.push (task.task);\r\n\r\n // check befores\r\n if (task.before) {\r\n // push to dones\r\n done = done.concat (task.before);\r\n\r\n // remove before from defaults\r\n for (var a = 0; a < task.before.length; a++) {\r\n // set index\r\n let index = installers.indexOf (task.before[a]);\r\n\r\n // check defaults\r\n if (index > -1) installers.splice (index, 1);\r\n }\r\n }\r\n\r\n // check afters\r\n if (task.after) {\r\n // push to dones\r\n done = done.concat (task.after);\r\n\r\n // remove after from defaults\r\n for (var b = 0; b < task.after.length; b++) {\r\n // set index\r\n let index = installers.indexOf (task.after[b]);\r\n\r\n // check defaults\r\n if (index > -1) installers.splice (index, 1);\r\n }\r\n }\r\n\r\n // add watch to watchers\r\n if (Task.watch) watchers.push (task.task + '.watch');\r\n }\r\n\r\n // create tasks\r\n gulp.task ('watch', watchers);\r\n gulp.task ('install', installers);\r\n }", "rebuild() {\n this.built = false;\n this.build();\n }", "function build() {\n console.log('Creating a development build...');\n\n let compiler = webpack(config);\n return new Promise((resolve, reject) => {\n compiler.watch({}, (err, stats) => {\n if (err) {\n return reject(err);\n }\n const messages = formatWebpackMessages(stats.toJson({}, true));\n if (messages.errors.length) {\n // Only keep the first error. Others are often indicative\n // of the same problem, but confuse the reader with noise.\n if (messages.errors.length > 1) {\n messages.errors.length = 1;\n }\n return reject(new Error(messages.errors.join('\\n\\n')));\n }\n\n return resolve({\n stats,\n warnings: messages.warnings,\n });\n });\n });\n}", "function packages () {\n opts.packages = makeArray(argv.dep)\n opts.install = true\n }", "function buildScript(answers) {\r\n if (!answers || typeof answers !== 'object') return null;\r\n\r\n let result = 'npm install --save-dev webpack';\r\n\r\n return result;\r\n}", "function prBuildWorkflow() {\n if (buildTargetsInclude(Targets.RUNTIME)) {\n pushBuildWorkflow();\n } else {\n skipDependentJobs(\n jobName,\n 'this PR does not affect the runtime',\n /* gracefullyHaltNextJobs= */ false\n );\n }\n}", "function buildSW() {\n // This will return a Promise\n return workboxBuild.generateSW({\n globDirectory: './dist/',\n // Static precaching of shell\n globPatterns: [\n 'img/*.{svg,png,jpg}', 'index.html', 'inline.css'\n ],\n swDest: './dist/sw.js',\n // Register main route for all navigation links to pages\n navigateFallback: 'index.html',\n navigateFallbackBlacklist: [/img\\/.*/, /\\.(js|css)/],\n // Cache external libraries and fonts\n runtimeCaching: [\n {\n urlPattern: new RegExp('^https://cdn\\.ampproject\\.org/'),\n handler: 'staleWhileRevalidate',\n },\n {\n urlPattern: new RegExp('^https://cdn\\.polyfill\\.io/'),\n handler: 'staleWhileRevalidate',\n },\n {\n urlPattern: new RegExp('^https://pasteup\\.guim\\.co\\.uk/fonts/'),\n handler: 'cacheFirst',\n },\n // Cache a number of YQL queries, but only for the offline scenario\n {\n urlPattern: new RegExp('^https://query\\.yahooapis\\.com/v1/public/'),\n handler: 'networkFirst',\n },\n // Cache a number of images\n {\n urlPattern: new RegExp('^https://i\\.guim\\.co\\.uk/img/'),\n handler: 'cacheFirst',\n options: {\n cacheName: 'images',\n expiration: {\n maxEntries: 10,\n maxAgeSeconds: 7 * 24 * 60 * 60,\n },\n cacheableResponse: {\n statuses: [0, 200],\n },\n },\n },\n ],\n // Make sure new versions of the Service Worker activate immediately\n clientsClaim: true,\n skipWaiting: true,\n }).then(({count, size, warnings}) => {\n // Optionally, log any warnings and details.\n warnings.forEach(console.warn);\n console.log(`${count} files will be precached, totaling ${size} bytes.`);\n });\n}", "function buildForNode() {\n return doRollup('src/index.js', 'lib/index.js');\n}", "async execute ({ build }) {\n\n // Pulls attributes out of build object\n // TODO - accept OUTPUT_DIRECTORY override\n let {\n id,\n blueprint,\n stages\n } = build\n\n // Inflates blueprint metadata\n // TODO - handle missing blueprint object\n blueprint = inflate({ blueprint });\n\n await this.writeBuildManifest({ build })\n\n // Runs stage of the build array\n // TODO - conflate each stage to its respective generator,\n // skipping / throwing errors on those whos generator is missing\n return Promise.each(stages, async ({ generator_id, configuration }) => {\n // stages.forEach(async ({ generator_id, configuration }) => {\n\n // Pulls generator from registry\n const generator = this.generators.find(g => g.id === generator_id)\n if (!generator) return\n const { generator_path, project_path } = generator\n\n // Sets output_directory default to build ID by default\n const output_directory = id || '';\n\n // Assigns `dest` option for generator\n // TODO - handle condition of missing blueprint.identifier\n const dest = path.join(this.options.cwd, OUTPUT_DIRECTORY, output_directory, blueprint.identifier, project_path);\n\n // Try to load up the generator from generator_path, catch error\n // TODO - this final check should be abstracted into a separate function\n try {\n // const GeneratorClass = require(generator_path); // eslint-disable-line import/no-dynamic-require\n const generatorPrototype = require(generator_path); // eslint-disable-line import/no-dynamic-require\n const resolved = require.resolve(generator_path);\n\n // Defines options for\n const generator_options = {\n blueprint,\n dest,\n resolved,\n configuration\n }\n\n // Logging\n // console.info(`Executing ${GeneratorClass.name} generators:`)\n console.info(`Executing generators:`)\n return new Promise(async (resolve, rejcet) => {\n const generatorInstance = new Generator(generatorPrototype, generator_options)\n\n // Invokes `generator.forEachSchema` once for each in blueprint.schemas\n await Promise.all(blueprint.schemas.map((schema) => generatorInstance.forEachSchema({ schema: schema, ...this.options })))\n\n // Invokes `generator.write()` once\n await generatorInstance.write(this.options)\n\n // Invokes generator.compileTemplatesInPlace()\n await generatorInstance.compileTemplatesInPlace()\n\n return resolve()\n })\n\n // Logs which generator is being run\n } catch (err) {\n if (err.code === 'MODULE_NOT_FOUND') {\n console.log('RUNTIME ERROR - GENERATOR NOT FOUND')\n } else {\n console.log('RUNTIME ERROR - OTHER')\n throw err;\n }\n return reject(err)\n }\n\n }).then(() => {\n // Thank you message\n console.log('\\nBuild complete\\nThank you for using Codotype :)\\nFollow us on github.com/codotype\\n')\n })\n }", "function buildPage(){\n addItems('make', make);\n addItems('model', model);\n addItems('keywords', keywords);\n checkAll();\n}", "async function _buildAsync(\n projectName,\n workspacePath,\n configuration,\n type,\n relativeBuildDestination,\n verbose,\n useModernBuildSystem = false\n) {\n const modernBuildSystemFragment = `-UseModernBuildSystem=${useModernBuildSystem ? 'YES' : 'NO'}`;\n const buildDest = `${relativeBuildDestination}-${type}`;\n let buildCmd = `set -o pipefail && xcodebuild -workspace ${projectName}.xcworkspace -scheme ${projectName} -configuration ${configuration} -derivedDataPath ${buildDest} ${modernBuildSystemFragment}`,\n pathToArtifact;\n if (type === 'simulator') {\n buildCmd += ` -sdk iphonesimulator CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO ARCHS=\"x86_64\" ONLY_ACTIVE_ARCH=NO | xcpretty`;\n pathToArtifact = path.join(\n buildDest,\n 'Build',\n 'Products',\n `${configuration}-iphonesimulator`,\n `${projectName}.app`\n );\n } else if (type === 'archive') {\n buildCmd += ` -sdk iphoneos -destination generic/platform=iOS archive -archivePath ${buildDest}/${projectName}.xcarchive CODE_SIGNING_ALLOWED=NO | xcpretty`;\n pathToArtifact = path.join(buildDest, `${projectName}.xcarchive`);\n } else {\n throw new Error(`Unsupported build type: ${type}`);\n }\n\n logger.info(`Building iOS workspace at ${workspacePath} to ${buildDest}:\\n`);\n logger.info(buildCmd);\n if (!verbose) {\n logger.info(\n '\\nxcodebuild is running. Logging errors only. To see full output, use --verbose 1...'\n );\n }\n await spawnAsyncThrowError(buildCmd, null, {\n // only stderr\n stdio: verbose ? 'inherit' : ['ignore', 'ignore', 'inherit'],\n cwd: workspacePath,\n shell: true,\n });\n return path.resolve(workspacePath, pathToArtifact);\n}", "function create(title) {\n var name = utils.slugify(title)\n , mkdirp = require('mkdirp')\n , ncp = require('ncp').ncp\n , src = path.resolve(__dirname + '/../skel/.')\n , dest = path.resolve('./' + name)\n ;\n\n var title = (process.argv[3]) ? process.argv[3] : 'test';\n packagetools.isNameAvailable(title)\n .then(function(result, msg) {\n if(result == packagetools.NAME_STATUS.AVAILABLE) {\n return gittools.getConfig();\n }\n var reason;\n switch(result) {\n case packagetools.NAME_STATUS.OWNED_BY_USER:\n reason = 'You already own a module with this name - you should re-use your old repository instead of trying to create a new one';\n break;\n case packagetools.NAME_STATUS.UNAVAILABLE:\n reason = 'Someone else has already created a package with this name. Choose a new one and try creating the module again.';\n break;\n default:\n if(configtools.isDev) {\n console.error('Invalid name check:', result);\n }\n reason = 'We were unable to verify the availability of this module name in Dexter. Try changing the name and creating again - if you continue to have problems, please contact support.';\n break;\n }\n throw Error(reason);\n })\n .then(function(userData) {\n if(userData.email && userData.name) {\n console.log('Initializing project as', userData.name, '(' + userData.email + ')');\n } else {\n throw Error('Git is not configured - make sure you\\'ve set a global name and email');\n }\n return gittools.getOrCreateRepo(dest);\n })\n .then(function(repo) {\n ncp(src, dest, function(err) {\n if(err) return console.error(err);\n\n process.chdir(dest);\n\n q.all([\n //needs to be read as a string so that we can preserve comments\n q.nfcall(utils.getStringFile, packagetools.getMetaFilename()),\n q.nfcall(utils.getJsonFile, packagetools.getPackageFilename())\n ]).then(function(results) {\n var meta = results[0]\n , package = results[1]\n ;\n\n //needs to be treated as a string so that we can preserve comments\n meta = meta.replace(\"%MYTITLE%\", title);\n package.name = name;\n q.all([\n q.nfcall(fs.writeFile, packagetools.getMetaFilename(), meta),\n q.nfcall(fs.writeFile, packagetools.getPackageFilename(), JSON.stringify(package, null, 4)),\n ]).then(function() {\n gittools.initialCommit(dest).then(function() {;\n init(dest);\n });\n });\n }, console.error).fail(console.error);\n });\n })\n .catch(function(err) {\n console.error('Failed creating Dexter module:', err.message);\n process.exit(1);\n })\n ;\n}", "function build (cb) {\n var nw = new NwBuilder(builderOptions);\n\n nw.on('log', console.log);\n console.log(binaryDir);\n nw.build().then(function () {\n\n fs.renameSync(binaryDir + '/node-webkit.app', binaryDir + '/pbjs.app');\n console.log('Build created');\n cb();\n }).catch(function (error) {\n console.error(error);\n });\n\n}", "function installDeps() {\n exec('node --version', function (err, stdout, stderr) {\n const nodeVersion = stdout && parseFloat(stdout.substring(1));\n if (nodeVersion < 5 || err) {\n installDepsCallback(err || 'Unsupported node.js version, make sure you have the latest version installed.');\n } else {\n exec('yarn --version', function (err, stdout, stderr) {\n if (parseFloat(stdout) < 0.15 || err || process.env.USE_YARN === 'false') {\n process.stdout.write('yarn not found, normal npm i');\n process.stdout.write(chalk.yellow('\\nnpm installing...'));\n exec('npm install', addCheckMark.bind(null, installDepsCallback));\n } else {\n process.stdout.write(chalk.yellow('\\nyarn installing...'));\n exec('yarn install', addCheckMark.bind(null, installDepsCallback));\n }\n });\n }\n });\n}", "function makeCompiler() {\n\tif (!config) {\n\t\tmakeConfig();\n\t}\n\n\tcompiler = webpack(config);\n\tif (options.useMemoryFs)\n\t\tmemoryFileSystem = compiler.outputFileSystem = getOutputFileSystem();\n\n\tlog('webpack: First compilation');\n\tcompiler.run(makeWebpackCallback(false));\n\tlog('webpack: Watching');\n\tcompiler.watch({},makeWebpackCallback(true));\n\n\n\tcompiler.plugin(\"invalid\", invalidPlugin);\n\tcompiler.plugin(\"watch-run\", invalidAsyncPlugin);\n\tcompiler.plugin(\"run\", invalidAsyncPlugin);\n\n\n\n\n\n\tcompiler.plugin(\"done\", stats => {\n\t\t// We are now on valid state\n\t\tstate = true;\n\n\n\t\tfunction continueBecauseBundleAvailable(cb) {\n\t\t\tcb();\n\t\t}\n\n\t\tfunction readyCallback() {\n\t\t\t// check if still in valid state\n\t\t\tif(!state) return;\n\n\t\t\tlog(`webpack compiled ${stats.toString(config.stats || {})}`)\n\n\t\t\t// print webpack output\n\t\t\tlet displayStats = (!options.quiet && config.stats !== false) ||\n\t\t\t\tstats.hasErrors() || stats.hasWarnings()\n\n\t\t\tif(displayStats)\n\t\t\t\tlog(stats.toString(options.stats));\n\n\t\t\t// if (!options.noInfo && !options.quiet)\n\t\t\tlog(\"webpack: bundle is now VALID.\");\n\n\t\t\t// execute callback that are delayed\n\t\t\tvar cbs = compilationCallbacks;\n\t\t\tcompilationCallbacks = [];\n\t\t\tcbs.forEach(continueBecauseBundleAvailable);\n\t\t}\n\n\t\t// Do the stuff in nextTick, because bundle may be invalidated\n\t\t// if a change happened while compiling\n\t\tprocess.nextTick(readyCallback);\n\n\t\t// In lazy mode, we may issue another rebuild\n\t\tif(forceRebuild) {\n\t\t\tforceRebuild = false;\n\t\t\trebuild();\n\t\t}\n\t});\n}", "async function buildPart(cb) {\n const components = [];\n // 通过项目配置获取组件样式\n cfg.components.forEach(name => {\n const dir = path.resolve(__dirname, `./components/${name}`);\n\n if (fs.existsSync(`${dir}/${name}.less`)) {\n components.push(name);\n }\n });\n\n console.log('buildPart:', {components});\n // 根据项目配置生成 转换 less 文件\n const lessContent = createPartLess(components);\n const outputFileName = `f7.${_prj}${cfg.rtl ? '.rtl' : ''}`;\n\n let cssContent;\n try {\n cssContent = await autoprefixer(\n await less(lessContent, path.resolve(__dirname, '.'))\n );\n } catch (err) {\n console.log(err);\n }\n\n // Write file\n fs.writeFileSync(\n `${output}/${outputFileName}.css`,\n `${banner}\\n${cssContent}`\n );\n\n // if (dev) {\n // if (cb) cb();\n // return;\n // }\n\n // Minified\n const minifiedContent = await cleanCSS(cssContent);\n\n // Write file\n fs.writeFileSync(`${output}/${outputFileName}.min.css`, `${minifiedContent}`);\n\n if (cb) cb();\n}", "function writeDist() {\n fs.stat(distDirectory, function(error, stat) {\n // Skip building on Travis\n if (process.env.TRAVIS) {\n return;\n }\n\n if (error || !stat.isDirectory()) {\n // Create a directory to avoid getting stuck\n // in postinstall loop\n fs.mkdirSync(distDirectory);\n exec('npm install --only=dev');\n exec('npm run build');\n }\n });\n}", "async function installRubyBuild(rubyVersion) {\n core.startGroup(`Installing ruby-build`)\n\n const buildDir = `${process.env.HOME}/ruby-build`\n var repoPath\n\n // Rubies 2.0 ... 2.3 (these need OpenSSL 1.0 and eregon provides it for us)\n if (usesOldOpenSsl(rubyVersion)) {\n core.info('cloning eregon/ruby-build')\n repoPath = '--branch ruby23-openssl-linux https://github.com/eregon/ruby-build.git'\n\n // all the other Rubies\n } else {\n core.info('cloning rbenv/ruby-build')\n repoPath = 'https://github.com/rbenv/ruby-build.git'\n }\n\n await exec.exec(`git clone ${repoPath} ${buildDir}`)\n await exec.exec(`sudo ${buildDir}/install.sh`)\n\n core.endGroup()\n}" ]
[ "0.66804874", "0.66804874", "0.6013059", "0.5803856", "0.57553476", "0.5716739", "0.56893337", "0.562359", "0.5620348", "0.56062967", "0.5593605", "0.55020136", "0.5477642", "0.5471858", "0.54423535", "0.54423535", "0.5436799", "0.5436477", "0.54091054", "0.54032296", "0.5330017", "0.5294211", "0.5283272", "0.5283272", "0.5283272", "0.5283272", "0.52791446", "0.5278474", "0.5262322", "0.5258446", "0.52311057", "0.5184422", "0.5168177", "0.5127901", "0.5104659", "0.51004064", "0.50929916", "0.5091424", "0.5085693", "0.5076724", "0.5074883", "0.5039985", "0.5027841", "0.50276273", "0.5027431", "0.501502", "0.50021684", "0.4995296", "0.4962004", "0.49478242", "0.4929312", "0.49236056", "0.49161005", "0.49128363", "0.49057993", "0.4890176", "0.48870087", "0.48641297", "0.4859028", "0.4857496", "0.4853279", "0.48390558", "0.48354122", "0.48353657", "0.48287135", "0.480041", "0.47987866", "0.47888237", "0.4786806", "0.4783718", "0.4783035", "0.4776353", "0.47663215", "0.47618163", "0.475806", "0.4756096", "0.47560692", "0.47516215", "0.4749193", "0.47475803", "0.47448856", "0.4739367", "0.47328293", "0.472903", "0.47154048", "0.47062948", "0.4695922", "0.46951059", "0.46938676", "0.46887502", "0.46864536", "0.4684021", "0.46714482", "0.4670518", "0.4659185", "0.46531484", "0.4641931", "0.46401858", "0.4637834", "0.46372503" ]
0.4998332
47
Create default command config for a quick app build and merge any extra config provided into it.
function createBuildConfig(args, options) { let { commandConfig: extraConfig = {}, defaultTitle, renderShim, renderShimAliases } = options; let entry = _path2.default.resolve(args._[1]); let dist = _path2.default.resolve(args._[2] || 'dist'); let mountId = args['mount-id'] || 'app'; let production = process.env.NODE_ENV === 'production'; let filenamePattern = production ? '[name].[chunkhash:8].js' : '[name].js'; let config = { babel: { stage: 0 }, devtool: 'source-map', output: { chunkFilename: filenamePattern, filename: filenamePattern, path: dist, publicPath: '/' }, plugins: { html: { mountId, title: args.title || defaultTitle }, // A vendor bundle can be explicitly enabled with a --vendor flag vendor: args.vendor } }; if (renderShim == null || args.force === true) { config.entry = { app: [entry] }; } else { // Use a render shim module which supports quick prototyping config.entry = { app: [renderShim] }; config.plugins.define = { NWB_QUICK_MOUNT_ID: JSON.stringify(mountId) }; config.resolve = { alias: _extends({ // Allow the render shim module to import the provided entry module 'nwb-quick-entry': entry }, renderShimAliases) }; } if (args.polyfill === false || args.polyfills === false) { config.polyfill = false; } return (0, _webpackMerge2.default)(config, extraConfig); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildAppConfiguration({\n auth,\n broker,\n cache,\n system,\n telemetry\n}) {\n const systemOptions = {\n ...DEFAULT_SYSTEM_OPTIONS,\n networkClient: new HttpClient(system == null ? void 0 : system.proxyUrl, system == null ? void 0 : system.customAgentOptions),\n loggerOptions: (system == null ? void 0 : system.loggerOptions) || DEFAULT_LOGGER_OPTIONS\n };\n return {\n auth: {\n ...DEFAULT_AUTH_OPTIONS,\n ...auth\n },\n broker: {\n ...broker\n },\n cache: {\n ...DEFAULT_CACHE_OPTIONS,\n ...cache\n },\n system: {\n ...systemOptions,\n ...system\n },\n telemetry: {\n ...DEFAULT_TELEMETRY_OPTIONS,\n ...telemetry\n }\n };\n}", "function configureRuntime () {\n return (\n build()\n // Brand is used for default config files (if any).\n .brand(BRAND)\n // The default plugin is the directory we're in right now, so\n // the commands sub-directory will contain the first right of\n // refusal to handle user's requests.\n .loadDefault(__dirname)\n // TODO: maybe there's other places you'd like to load plugins from?\n // .load(`~/.${BRAND}`)\n\n // These are the magic tokens found inside command js sources\n // which plugin authors use to specify the command users can type\n // as well as the help they see.\n .token('commandName', `${BRAND}Command`)\n .token('commandDescription', `${BRAND}Description`)\n // let's build it\n .createRuntime()\n )\n}", "async function main() {\n const program = new Command();\n program.parse(process.argv);\n await fs.mkdir(\"build\", { recursive: true });\n await fs.writeFile(\n \"build/config.json\",\n JSON.stringify(await getDeployConfig(), null, 2) + \"\\n\"\n );\n console.log(\"wrote build/config.json\");\n process.exit(0);\n}", "function default_args(config) {\n config.PRODUCTION = _yargs2.default.argv.mode == 'production';\n try {\n read('.build', true);\n } catch (err) {\n if (!config.PRODUCTION) {\n console.log(\"Never run gulp before, defaulting to production build\");\n config.PRODUCTION = true;\n }\n }\n}", "generateConfigs() {\n this._createDirs();\n this._readFiles(this.source)\n .then(files => {\n console.log('Loaded ', files.length, ' files');\n const configs = this._loadConfigs(files);\n const common = this._getCommonJson(configs);\n\n this._writeData(common, 'default', 'json');\n this._generateFilesWithoutCommon(configs, common);\n this._generateCustomEnvironmentVariablesJson();\n })\n .catch(error => console.log(error));\n }", "initializeSourceBuild(config) {\n return inquirer\n .prompt([\n {\n type: 'input',\n name: 'buildCommand',\n message: 'sources.buildCommand',\n default: 'ng build'\n },\n {\n type: 'input',\n name: 'sourcePath',\n message: 'sources.sourcePath',\n default: './'\n }\n ])\n .then(({ buildCommand, sourcePath }) => {\n if (!config.sources) {\n config.sources = {};\n }\n config.sources.buildCommand = buildCommand;\n config.sources.sourcePath = sourcePath;\n return config;\n });\n }", "async generateDefaults () {\n const pkg = (await common.readMetadata(this.userSupplied)) || {}\n const modules = []\n if (await this.requiresSandboxWrapper()) {\n modules.push({\n name: 'zypak',\n sources: [\n {\n type: 'git',\n url: 'https://github.com/refi64/zypak',\n tag: 'v2021.02'\n }\n ]\n })\n }\n this.defaults = {\n ...common.getDefaultsFromPackageJSON(pkg),\n ...(await this.determineBaseRuntimeAndSDK()),\n id: getAppID(pkg.name, common.getHomePage(pkg)),\n extraFlatpakBuilderArgs: [],\n finishArgs: [\n // X Rendering\n '--socket=x11', '--share=ipc',\n // OpenGL\n '--device=dri',\n // Audio output\n '--socket=pulseaudio',\n // Read/write home directory access\n '--filesystem=home',\n // Chromium uses a socket in tmp for its singleton check\n '--env=TMPDIR=/var/tmp',\n // Allow communication with network\n '--share=network',\n // System notifications with libnotify\n '--talk-name=org.freedesktop.Notifications'\n ],\n modules,\n\n icon: path.resolve(__dirname, '../resources/icon.png'),\n files: [],\n symlinks: []\n }\n\n return this.defaults\n }", "mergeOptions() {\n\t\tthis.config = _.defaultsDeep(this.configFile, ServiceBroker.defaultOptions);\n\n\t\tthis.config = this.overwriteFromEnv(this.config);\n\n\t\tif (this.flags.silent) this.config.logger = false;\n\n\t\tif (this.flags.hot) this.config.hotReload = true;\n\n\t\t// console.log(\"Merged configuration\", this.config);\n\t}", "function createBrandNewApp ({template, db, answers, promptsAnswers}) {\n try {\n // call the template commands\n let config = require(`${process.cwd()}/templates/${template}/config.js`)\n let cmd = config.cmd({\n template: template\n , application: answers.application\n , displayName: answers.displayName\n , domain: answers.domain\n , organization: answers.organization\n , region: answers.region\n , promptsAnswers: promptsAnswers\n , db: db\n , mandrakeLocation: __dirname\n , exec: exec\n })\n \n\n let res = exec(cmd)\n\n if(res.code !== 0) { return monet.Either.Left(res.stderr) }\n // creation on Clever Cloud is OK\n // so, get the generated configuration file\n // create a git repository\n // push to Clever-Cloud\n //console.info(res.stdout)\n\n return getCleverCloudApplicationConfiguration({answers}).cata(\n err => monet.Either.Left(err),\n conf => {\n console.log(\"🎩 Application configuration: \", conf)\n let app_id = conf.app_id // Clever application Id\n console.log(\"🎩 Your Clever Application id is: \", app_id)\n console.log(\"🎩 Creating a git repository, then push to 💭 ☁️ ...\")\n\n //---------------------------------------\n // extract environment variables\n // useful to retrieve the uri of a database for example\n let getEnvVars = () => {\n let res = exec([\n `cd ${answers.application}; `\n , `clever env`\n ].join(''))\n \n let raw_envvars = res.code === 0 ? res.stdout.split('\\n') : null\n\n let envvars = raw_envvars !== null \n ? raw_envvars.filter(item => (!item.startsWith(\"#\")) && (!item == \"\")).map(item => {return {name:item.split(\"=\")[0], value:item.split(\"=\")[1]} })\n : null\n return envvars\n }\n\n //---------------------------------------\n // extract services (linked applications and addons)\n // useful to retrieve the uri of an fs-bucket for example\n let getServices = () => {\n let res = exec([\n `cd ${answers.application}; `\n , `clever service`\n ].join(''))\n \n let raw_services = res.code === 0 ? res.stdout.split('\\n').filter(line => line.length > 0) : null\n\n let addons = raw_services !== null \n ? raw_services.filter(item => raw_services.indexOf(item) > raw_services.indexOf(\"Addons:\"))\n .map(item => {\n return {\n name: item.trim().split(\" \")[0],\n id: item.trim().split(\"(\")[1].split(\")\")[0]\n }\n })\n : null\n\n let applications = raw_services !== null \n ? raw_services.filter(item => raw_services.indexOf(item) < raw_services.indexOf(\"Addons:\") && raw_services.indexOf(item) > raw_services.indexOf(\"Applications:\"))\n .map(item => {\n return {\n name: item.trim().split(\" \")[0],\n id: item.trim().split(\"(\")[1].split(\")\")[0]\n }\n })\n : null\n\n\n /*\n services.filter(item => services.indexOf(item) > services.indexOf(\"Addons:\"))\n .map(item => {\n return {\n name: item.trim().split(\" \")[0],\n id: item.trim().split(\"(\")[1].split(\")\")[0]\n }\n })\n services.filter(item => services.indexOf(item) < services.indexOf(\"Addons:\") && services.indexOf(item) > services.indexOf(\"Applications:\") )\n .map(item => {\n return {\n name: item.trim().split(\" \")[0],\n id: item.trim().split(\"(\")[1].split(\")\")[0]\n }\n })\n */\n\n return {addons, applications}\n\n }\n\n let envvars = getEnvVars();\n let services = getServices();\n \n\n if(config.afterCreate) {\n exec(config.afterCreate({\n template: template\n , application: answers.application\n , displayName: answers.displayName\n , domain: answers.domain\n , organization: answers.organization\n , region: answers.region\n , promptsAnswers: promptsAnswers\n , db: db\n , mandrakeLocation: __dirname\n , exec: exec\n , envvars: envvars\n , services: services\n , config: conf // content of `${process.cwd()}/${answers.application}/.clever.json`\n }))\n }\n\n //---------------------------------------\n \n // perhaps to be splitted: creqte git repo, then push to Clever\n return createGitRepositoryAndPushToCleverCloud({app_id, answers}).cata(\n err => monet.Either.Left(err),\n res => {\n \n if(config.afterPush) {\n\n exec(config.afterPush({\n template: template\n , application: answers.application\n , displayName: answers.displayName\n , domain: answers.domain\n , organization: answers.organization\n , region: answers.region\n , promptsAnswers: promptsAnswers\n , db: db\n , mandrakeLocation: __dirname\n , exec: exec\n , envvars: envvars\n , services: services\n , config: conf // content of `${process.cwd()}/${answers.application}/.clever.json`\n }))\n }\n \n return monet.Either.Right(Object.assign({app_id, template}, answers))\n }\n ) // createGitRepositoryAndPushToCleverCloud\n }\n ) // getCleverCloudApplicationConfiguration\n } catch(err) {\n return monet.Either.Left(err.message)\n }\n}", "function get_config() {\n // This is a placeholder, obtaining values from command line options.\n // Subsequent developments may access a configuration file\n // and extract an initial default configuration from that.\n //\n // See also: https://nodejs.org/api/process.html#process_process_env\n if (program.debug) {\n meld.CONFIG.debug = program.debug;\n } \n if (program.verbose) {\n meld.CONFIG.verbose = program.verbose;\n } \n if (program.author) {\n meld.CONFIG.author = program.author;\n } \n if (program.baseurl) {\n meld.CONFIG.baseurl = program.baseurl;\n }\n if (program.stdinurl) {\n meld.CONFIG.stdinurl = program.stdinurl;\n }\n}", "commonOptions() {\n let config = this.config;\n let cmd = [];\n\n if (config.datadir) {\n cmd.push(`--datadir=${config.datadir}`);\n }\n\n if (Number.isInteger(config.verbosity) && config.verbosity >= 0 && config.verbosity <= 5) {\n switch (config.verbosity) {\n case 0:\n cmd.push(\"--lvl=crit\");\n break;\n case 1:\n cmd.push(\"--lvl=error\");\n break;\n case 2:\n cmd.push(\"--lvl=warn\");\n break;\n case 3:\n cmd.push(\"--lvl=info\");\n break;\n case 4:\n cmd.push(\"--lvl=debug\");\n break;\n case 5:\n cmd.push(\"--lvl=trace\");\n break;\n default:\n cmd.push(\"--lvl=info\");\n break;\n }\n }\n\n return cmd;\n }", "get defaultOptions() {\n return defaults(\n {},\n get(this, 'projectConfig'),\n result(this.constructor, 'defaultOptions'),\n // Find some way to be able to inject ARGV in projects which consume skypager via webpack\n global.SKYPAGER_ARGV,\n global.ARGV\n )\n }", "function generateBuildOptions(metadata, options) {\n const results = Object.assign({}, command_1.filterOptionsByIntent(metadata, options), command_1.filterOptionsByIntent(metadata, options, 'app-scripts'));\n // Serve specific options not related to the actual run or emulate code\n return Object.assign({}, results, { externalAddressRequired: true, iscordovaserve: true, nobrowser: true, target: 'cordova' });\n}", "build(script) {\n // global options\n const g = Object.assign({\n watch: true,\n }, this.#config);\n delete g.scripts;\n const s = this.#config.scripts[script];\n if (!s && this.#args) {\n const cmd = this.#args.join(\" \");\n let out = [];\n if (reCompact.test(cmd)) {\n out = [\"deno\", \"run\"];\n out = out.concat(stdCmd(cmd));\n }\n else if (reCliCompact.test(cmd)) {\n out = [\"deno\"];\n out = out.concat(stdCmd(cmd));\n }\n else {\n out = stdCmd(cmd);\n }\n const command = {\n cmd: out,\n options: g,\n exe: () => {\n return this.execute(command);\n },\n };\n return command;\n }\n let o;\n let cmd;\n if (typeof s === \"string\") {\n o = g;\n cmd = s;\n }\n else {\n o = Object.assign({}, merge(g, s));\n cmd = s.cmd;\n }\n let out = [];\n let denoAction = reDenoAction.exec(cmd);\n if (denoAction && denoAction.length === 3) {\n const action = denoAction[1];\n const args = denoAction[2];\n out = out.concat(stdCmd(action));\n out = out.concat(buildFlags(o));\n if (args)\n out = out.concat(stdCmd(args));\n }\n else if (reCompact.test(cmd)) {\n out = [\"deno\", \"run\"];\n out = out.concat(buildFlags(o));\n out = out.concat(stdCmd(cmd));\n }\n else {\n out = stdCmd(cmd);\n }\n const command = {\n cmd: out,\n options: o,\n exe: () => {\n return this.execute(command);\n },\n };\n return command;\n }", "_copyLaunchConfig () {\n let nodeAsg = objectExtend(\n {},this._template.Resources[`NodeLaunchConfig${this._versionString}`]);\n\n this._template.Resources[`${this._opts.Name}WorkerLaunchConfig${this._versionString}`] = nodeAsg;\n }", "function commandConfig(cliParams, configGenerator, helper, userConfigFlag) {\n\n // switch the number of sub-commands\n switch (cliParams.slice(1).length) {\n\n case 0:\n // list all config options\n console.log(userConfigFlag ? '** not yet implemented for userconfig **' : configGenerator.list());\n break;\n\n case 1:\n // list config option specified in first sub-command\n console.log(userConfigFlag ? '** not yet implemented for userconfig **' : configGenerator(cliParams[1]));\n break;\n\n case 2:\n // if first sub-command is `remove` then remove from config, key specified in second sub-command\n // else set key/value as first/second sub-command\n if (cliParams[1] === 'remove') {\n helper.promptYesNo('Are you sure you want to write new config to disk? [Yn]', function () {\n configGenerator(cliParams[2], null, userConfigFlag);\n }, helper.chalk.red('aborted config change'), 'y');\n } else {\n helper.promptYesNo('Are you sure you want to write new config to disk? [Yn]', function () {\n configGenerator(cliParams[1], cliParams[2], userConfigFlag);\n }, helper.chalk.red('aborted config change'), 'y');\n }\n break;\n }\n }", "static getExtraConfig () {\n return {}\n }", "includeConfigOption(context, prevArgv) {\n const { primaryDriver } = context;\n const configPath = context.findConfigByName(primaryDriver.metadata.configName);\n const argv = [...prevArgv];\n if (configPath && primaryDriver.metadata.configOption) {\n argv.push(primaryDriver.metadata.configOption, configPath.path.path());\n }\n this.debug('Including config option to args');\n return argv;\n }", "extendCli (cli) {\n cli\n .command('metadata <targetDir> [...inputPaths]', 'Generate required metadata for the API reference docs')\n .option('-o <dir>', 'Output directory. Defaults to <targetDir>/api/')\n .action(async (targetDir, inputPaths, options) => {\n if (inputPaths.length === 0) {\n throw new Error('Please specify at least one path to a folder containing API docs.')\n }\n\n const outputPath = options.o ? path.resolve(options.o) : path.resolve(context.sourceDir, 'api')\n const docgenMainScript = require.resolve('titanium-docgen')\n const command = [\n 'node',\n docgenMainScript,\n '-f', 'json-raw',\n inputPaths.shift(),\n ...inputPaths.reduce((acc, cur) => {\n acc.push('-a', cur)\n return acc\n }, []),\n '-o', outputPath\n ]\n logger.wait('Generating API metadata file...')\n try {\n logger.debug(`Running command ${command.join(' ')}`)\n await execAsync(command.join(' '))\n logger.success(`Done! Metadata file generated to ${path.join(outputPath, 'api.json')}`)\n } catch (e) {\n logger.error('Failed to generate API metadata.')\n throw e\n }\n })\n }", "function createServeConfig(args, options) {\n let {\n commandConfig: extraConfig = {},\n defaultTitle,\n renderShim,\n renderShimAliases\n } = options;\n\n let entry = _path2.default.resolve(args._[1]);\n let dist = _path2.default.resolve(args._[2] || 'dist');\n let mountId = args['mount-id'] || 'app';\n\n let config = {\n babel: {\n stage: 0\n },\n output: {\n filename: 'app.js',\n path: dist,\n publicPath: '/'\n },\n plugins: {\n html: {\n mountId,\n title: args.title || defaultTitle\n }\n }\n };\n\n if (args.force === true || renderShim == null) {\n config.entry = [entry];\n } else {\n config.entry = [renderShim];\n config.plugins.define = { NWB_QUICK_MOUNT_ID: JSON.stringify(mountId) };\n config.resolve = {\n alias: _extends({\n // Allow the render shim module to import the provided entry module\n 'nwb-quick-entry': entry\n }, renderShimAliases)\n };\n }\n\n if (args.polyfill === false || args.polyfills === false) {\n config.polyfill = false;\n }\n\n return (0, _webpackMerge2.default)(config, extraConfig);\n}", "async function generateCommand(options) {\n const configPath = path.resolve(options[\"config\"] || options[\"c\"] || defaultConfigName);\n let config = loadConfig(configPath) || defaultConfig;\n config = extendConfigWithExtendConfig({\n config\n });\n config = extendConfigWithDefaults({\n config,\n options\n }); // Extend the config with the package object\n\n config.pkg = { ...(loadPackage(config.package) || {}),\n ...config.pkg\n };\n await generate({\n config,\n configPath,\n generators: defaultGenerators\n });\n}", "function getMasterConfig(defaultConfig, callback) {\n\texec(\"npm get medimage:configFile\", {\n\t\t\tmaxBuffer: 2000 * 1024 //quick fix\n\t\t}, (err, stdout, stderr) => {\n\t\t if (err) {\n\t\t\t// node couldn't execute the command\n\t\t\tconsole.log(\"There was a problem running the addon. Error:\" + err);\n\t\t\tcallback(err, \"\");\n\t\n\t\t } else {\n\t\t\t console.log(\"Stdout from command:\" + stdout);\n\t\t\t if((stdout != \"\")&&(!stdout.startsWith(\"undefined\"))) {\n\t\t\t \t callback(null, stdout.trim());\n\t\t\t \n\t\t\t } else {\n\t\t\t \t callback(\"Global not set\", null);\n\t\t\t \n\t\t\t }\t\t\n\t\t }\n\t});\t\t//End of the exec\n}", "function getConfig() {\n\tconst home = os.homedir();\n\tconst currentPath = process.cwd();\n\n\tconst globalOverrides = requireOptional(\n\t\t`/${home}/.new-component-config.json`\n\t);\n\n\tconst localOverrides = requireOptional(\n\t\t`/${currentPath}/.new-component-config.json`\n\t);\n\n\treturn {\n\t\t...defaults,\n\t\t...globalOverrides,\n\t\t...localOverrides,\n\t};\n}", "function CustomCommandsConfig() {\n return _super.call(this) || this;\n }", "function config() {\n global.config.build.rootDirectory = path.join('../EquiTrack/assets/frontend/', global.config.appName);\n global.config.build.templateDirectory = path.join('../EquiTrack/templates/frontend/', global.config.appName);\n global.config.build.bundledDirectory = '.';\n indexPath = path.join(global.config.build.rootDirectory, 'index.html');\n bowerPath = path.join(global.config.build.rootDirectory, 'bower.json');\n templatePath = global.config.build.templateDirectory;\n}", "function default_1(options) {\n const root = options.root;\n const name = options.name;\n const fields = options.fields.replace(new RegExp('\\\\[', 'g'), '').replace(new RegExp('\\\\]', 'g'), '').replace(new RegExp('\\\"', 'g'), '').split(',').map((field) => field.trim());\n const gitInfo = { username: options.username || gitUsername(), email: options.email || gitEmail() };\n const chains = [];\n let app = options.app;\n let core = options.core;\n let web = options.web;\n let angularConfig;\n let app1 = '';\n let lib1 = '';\n let lib2 = '';\n let angularConfigPath = path_1.resolve(root, 'angular.json');\n try {\n fs_1.accessSync(angularConfigPath, fs_1.constants.F_OK);\n }\n catch (e) {\n angularConfigPath = path_1.resolve(__dirname, 'files', 'project', 'angular.__json__');\n chains.push(schematics_1.schematic('angular-new', { root: root, name: 'demo', username: gitInfo.username, email: gitInfo.email }));\n }\n try {\n angularConfig = JSON.parse(fs_1.readFileSync(angularConfigPath).toString());\n }\n catch (error) {\n throw new schematics_1.SchematicsException('Wrong body of file angilar.json');\n }\n Object.keys(angularConfig.projects).forEach(key => (!app1 && angularConfig.projects[key] && angularConfig.projects[key].projectType === 'application') ? app1 = key : null);\n Object.keys(angularConfig.projects).forEach(key => (!lib1 && angularConfig.projects[key] && angularConfig.projects[key].projectType === 'library') ? lib1 = key : null);\n Object.keys(angularConfig.projects).forEach(key => (key !== lib1 && !lib2 && angularConfig.projects[key] && angularConfig.projects[key].projectType === 'library') ? lib2 = key : null);\n if (!app) {\n app = app1;\n }\n if (!core) {\n core = lib1 ? lib1 : app;\n }\n if (!web) {\n web = lib2 ? lib2 : core;\n }\n const appConfig = Object.assign({ name: app }, angularConfig.projects[app]);\n const coreConfig = Object.assign({ name: core }, angularConfig.projects[core]);\n const webConfig = Object.assign({ name: web }, angularConfig.projects[web]);\n const data = Object.assign({}, core_1.strings, { humanize: (str, low_first_letter) => inflection_1.humanize(inflection_1.underscore(str).replace(new RegExp('-', 'g'), ' '), low_first_letter), pluralize: inflection_1.pluralize, name: name, fields: fields, root: root, gitInfo: gitInfo }, dot.dot({ gitInfo: gitInfo }), { app: appConfig, core: coreConfig, web: webConfig }, dot.dot({ app: appConfig }), dot.dot({ core: coreConfig }), dot.dot({ web: webConfig }), { ts: 'ts', json: 'json' });\n const templateLibsSource = schematics_1.apply(schematics_1.url('./files/libs'), [\n schematics_1.template(data)\n ]);\n chains.push(schematics_1.mergeWith(templateLibsSource, schematics_1.MergeStrategy.Overwrite));\n const frameModuleFile = path_1.resolve(root, data.app.sourceRoot, 'app', 'components', 'pages', 'entities-page', data.pluralize(data.name), data.pluralize(data.name) + '-frame.module.ts');\n try {\n fs_1.accessSync(frameModuleFile, fs_1.constants.F_OK);\n }\n catch (e) {\n const templateFrameSource = schematics_1.apply(schematics_1.url('./files/frame'), [\n schematics_1.template(data)\n ]);\n chains.push(schematics_1.mergeWith(templateFrameSource, schematics_1.MergeStrategy.Overwrite));\n }\n const entitiesPagePath = path_1.resolve(root, data.app.sourceRoot, 'app', 'components', 'pages', 'entities-page');\n const entityPageModuleFile = path_1.resolve(root, data.app.sourceRoot, 'app', 'components', 'pages', 'entities-page', 'entities-page.module.ts');\n let existsFrames;\n try {\n existsFrames = fs_1.readdirSync(entitiesPagePath).filter(f => fs_1.statSync(path_1.join(entitiesPagePath, f)).isDirectory() && f.indexOf('-frame') !== -1).map(f => f.replace('-frame', ''));\n }\n catch (error) {\n existsFrames = [\n 'content-types',\n 'groups',\n 'permissions',\n 'users'\n ];\n }\n if (existsFrames.indexOf(data.pluralize(name)) === -1) {\n existsFrames.push(data.pluralize(name));\n }\n existsFrames = existsFrames.sort();\n try {\n fs_1.accessSync(entityPageModuleFile, fs_1.constants.F_OK);\n const templatePageSource = schematics_1.apply(schematics_1.url('./files/page-only-routes'), [\n schematics_1.template(Object.assign({}, data, { frames: existsFrames }))\n ]);\n chains.push(schematics_1.mergeWith(templatePageSource, schematics_1.MergeStrategy.Overwrite));\n }\n catch (e) {\n const templatePageSource = schematics_1.apply(schematics_1.url('./files/page'), [\n schematics_1.template(Object.assign({}, data, { frames: existsFrames }))\n ]);\n chains.push(schematics_1.mergeWith(templatePageSource, schematics_1.MergeStrategy.Overwrite));\n }\n // The chain rule allows us to chain multiple rules and apply them one after the other.\n return schematics_1.chain(chains);\n}", "copyConfigToWorkspacePackage(context, argv) {\n const { packageRoot } = this.options;\n this.debug('Copying config files to workspace');\n context.configPaths.forEach((config) => {\n fs_extra_1.default.copyFileSync(config.path.path(), new common_1.Path(packageRoot, config.path.name()).path());\n });\n return argv;\n }", "configureJava() {\n this.config.defaults(requiredConfig);\n }", "function buildConfig(args) {\n var fs = require('fs'),\n argv = require('minimist')(args.slice(2)),\n config,\n content,\n configFile,\n key;\n\n /**\n * Below are some of the example inputs.\n *\n * --config=file.conf\n * --specs=.feature.md\n * --results=output.json,test.xml\n * --watch\n * --hint=javascript\n * --port=3000\n * --junit-out=junit-output.json\n * --specs-out=spec-file.json,\n * --results-out=results-file.json\n * --serve\n */\n\n /**\n * Default config.\n */\n config = {\n config: (argv.config !== undefined) ? argv.config : 'shouldit.conf.json',\n watch: false,\n serve: false,\n specs: false,\n results: false,\n hint: false,\n port: 3000,\n outputDetails: 'failed,passed,pending',\n outputSummary: false,\n tags: [],\n 'junit-out': 'junit-output.xml',\n 'specs-out': 'spec-file.json',\n 'results-out': 'results-file.json'\n };\n\n /**\n * Overrides from config file.\n */\n if (fs.existsSync(config.config)) {\n content = fs.readFileSync(config.config, {\n encoding: \"utf8\"\n });\n configFile = JSON.parse(content);\n for (key in configFile) {\n if (configFile.hasOwnProperty(key)) {\n config[key] = configFile[key];\n }\n }\n }\n\n /**\n * Overrides from input.\n */\n for (key in argv) {\n if (argv.hasOwnProperty(key)) {\n config[key] = argv[key];\n }\n }\n\n /**\n * Help.\n */\n if (argv.h || argv.help) {\n console.log(\n '\\nSpec Detective: A BDD tool minus the pain\\n\\n'.green +\n 'Usage:\\n' +\n ' spec-detective <arguments>\\n\\n' +\n 'Arguments:\\n' +\n ' --config=<configFile> Set a config file location.\\n' +\n ' --watch Start in watch mode.\\n' +\n ' --specs=\"<glob>\" Feature files to read (eg \"*/**/*.feature.md\").\\n' +\n ' --results=\"<glob>\" Comma-deliminated list of test output (eg \"tests/*.xml,tests/*.json\").\\n' +\n ' --outputSummary=\"<bool>\" Enable / Disable output summary.\\n' +\n ' --outputDetails=\"<states>\" Comma-delinated list of test states to display (passed,failed,pending).\\n' +\n ' --tags=<tags> Comma-delinated list of tagged features to read.\\n' +\n ' --port=<port-number> The desired port for visualisation.\\n' +\n ' --junit-out=<file> File name for junit output (default: junit-output.xml).\\n' +\n ' --specs-out=<file> File name for spec json output (default: spec-file.json).\\n' +\n ' --results-out=<file> File name for results json output (default: results-file.json).\\n' +\n ' --serve Project visualisation through port.\\n'\n\n );\n process.exit();\n }\n\n /**\n * Enrichment.\n */\n if (config.tags && config.tags.indexOf(',') !== -1) {\n config.tags = config.tags.split(',');\n }\n\n if (config.results && config.results.indexOf(',') !== -1) {\n config.results = config.results.split(',');\n }\n if (config.results && typeof config.results === 'string') {\n config.results = [config.results];\n }\n if (config.outputDetails && typeof config.outputDetails != 'object') {\n config.outputDetails = config.outputDetails.split(',');\n }\n config.outputSumary = !!config.outputSummary;\n /**\n * We ALWAYS need spec files and tests results.\n */\n if (!config.specs) {\n print(\"A specs glob such as path/*.feature must be specified.\", \"red\");\n }\n\n if (!config.results) {\n print(\"A results file must be specified.\", \"red\");\n }\n\n\n /**\n * Abstract print for tests.\n */\n function print(message, color) {\n if (args[1].indexOf('spec-detective') !== -1 || args[1].indexOf('shouldit') !== -1) {\n if (color === undefined) {\n console.log(message);\n return;\n }\n console.log(message[color]);\n } else {\n config.message = message;\n }\n }\n\n return config;\n}", "function CreateLaunchConfigurationCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "function set(name, platform, cmd) {\n\n if (cmd.fastlane) {\n //Require a platform when specifying fastlane option due to differences in metadata\n if (!platform) {\n console.log(chalk.red(\"\\nSpecifying a platform is required with the Fastlane option! Copying of Fastlane files will be skipped.\"));\n cmd.fastlane = undefined;\n }\n } else {\n platform = platform || \"ios\";\n }\n\n if (name) {\n\n if (typeof name != \"string\" ) {\n clear();\n cmd = name;\n } else if (name.substring(0, 1) == \"_\") {\n clear();\n } else {\n alloyCfg.global.theme = name;\n console.log(chalk.green('\\nUpdated Theme to ') + chalk.cyan(alloyCfg.global.theme) + \"\\n\");\n }\n\n fs.writeFileSync(\"./app/config.json\", JSON.stringify(alloyCfg, null, 4));\n\n // check if we have an app config\n if (fs.existsSync(\"./app/themes/\" + name + \"/\" + platform + \"/tiapp.xml\")) {\n\n // if it exists in the themes folder, in a platform subfolder\n console.log(chalk.green('Found a tiapp.xml in the theme platform folder\\n'));\n createTiAppFile(\"./app/themes/\" + name + \"/\" + platform + \"/tiapp.xml\");\n\n } else if (fs.existsSync(\"./app/themes/\" + name + \"/tiapp.xml\")) {\n\n // if it exists in the top level theme folder\n console.log(chalk.green('Found a tiapp.xml in the theme folder\\n'));\n createTiAppFile(\"./app/themes/\" + name + \"/tiapp.xml\");\n\n } else {\n console.log(chalk.cyan(\"No tiapp.xml found for \" + name) + \"\\n\");\n }\n\n var externalIcons = [\"DefaultIcon\", \"DefaultIcon-ios\", \"iTunesConnect\", \"MarketplaceArtwork\"];\n var iconName = '';\n for (var i = 0; i < externalIcons.length; i++) {\n iconName = externalIcons[i];\n // check if we havea DefaultIcon.png\n if (fs.existsSync(\"./app/themes/\" + name + \"/\" + platform + \"/\" + iconName + \".png\")) {\n // if it exists in the themes folder, in a platform subfolder\n console.log(chalk.green('Found a ' + iconName + '.png in the theme platform folder\\n'));\n copyFile(\"./app/themes/\" + name + \"/\" + platform + \"/\" + iconName + \".png\", \"./\" + iconName + \".png\");\n } else if (fs.existsSync(\"./app/themes/\" + name + \"/\" + iconName + \".png\")) {\n // if it exists in the top level theme folder\n console.log(chalk.green('Found a ' + iconName + '.png in the theme folder\\n'));\n copyFile(\"./app/themes/\" + name + \"/\" + \"/\" + iconName + \".png\", \"./\" + iconName + \".png\");\n } else {\n console.log(chalk.yellow(iconName + '.png does not exist for this theme.\\n'));\n }\n }\n\n // if it exists in the themes folder, in a platform subfolder\n console.log(chalk.green('Found a DefaultIcon.png in the theme platform folder\\n'));\n copyFile(\"./app/themes/\" + name + \"/\" + platform + \"/DefaultIcon.png\", \"./DefaultIcon.png\");\n\n //TODO: Allow user to set a filePath to their fastlane directory located outside of project.\n\n // check if a Fastfile exists in the fastlane directory of the root of project\n if (fs.existsSync(\"./fastlane/Fastfile\")) {\n\n if (cmd.fastlane) {\n\n //Check for and log which files exist\n\n // Check for Appfile\n if (fs.existsSync(\"./app/themes/\" + name + \"/platform/\" + platform + \"/fastlane/Appfile\")) {\n\n console.log(chalk.green(\"Found an Appfile inside the theme's fastlane folder.\\n\"));\n copyFile(\"./app/themes/\" + name + \"/platform/\" + platform + \"/fastlane/Appfile\", \"./fastlane/Appfile\");\n\n } else {\n console.log(chalk.yellow(\"An Appfile does not exist for this theme.\\n\"));\n }\n\n /* TODO: Copy over Android's metadata folder\n // Copy over metadata files\n if(platform == \"android\"){\n\n }\n */\n\n } else {\n // Prompt availability of option\n console.log(chalk.yellow(\"\\nA Fastfile exists in your project. Fastlane files can also be copied over from your theme with the --fastlane or -F option.\"));\n }\n\n } else {\n\n // Fastlane? TRUE\n if (cmd.fastlane) {\n\n // Prompt\n console.log(chalk.yellow(\"\\nYou specified the fastlane option, but no Fastfile can be found in the fastlane directory of your project.\"));\n\n }\n }\n\n function ncp(source, dest, options, callback) {\n var cback = callback;\n\n // if it exists in the top level theme folder\n console.log(chalk.green('Found a DefaultIcon.png in the theme folder\\n'));\n copyFile(\"./app/themes/\" + name + \"/\" + \"/DefaultIcon.png\", \"./DefaultIcon.png\");\n\n var basePath = process.cwd(),\n currentPath = path.resolve(basePath, source),\n targetPath = path.resolve(basePath, dest),\n filter = options.filter,\n rename = options.rename,\n transform = options.transform,\n clobber = options.clobber !== false,\n modified = options.modified,\n dereference = options.dereference,\n errs = null,\n started = 0,\n finished = 0,\n running = 0,\n limit = options.limit || 30;\n\n limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit;\n\n startCopy(currentPath);\n\n function startCopy(source) {\n started++;\n if (filter) {\n if (filter instanceof RegExp) {\n if (!filter.test(source)) {\n return cb(true);\n }\n } else if (typeof filter === 'function') {\n if (!filter(source)) {\n return cb(true);\n }\n }\n }\n return getStats(source);\n }\n\n function getStats(source) {\n var stat = dereference ? fs.stat : fs.lstat;\n if (running >= limit) {\n return setImmediate(function () {\n getStats(source);\n });\n }\n running++;\n stat(source, function (err, stats) {\n var item = {};\n if (err) {\n return onError(err);\n }\n\n // We need to get the mode from the stats object and preserve it.\n item.name = source;\n item.mode = stats.mode;\n item.mtime = stats.mtime; //modified time\n item.atime = stats.atime; //access time\n\n if (stats.isDirectory()) {\n return onDir(item);\n } else if (stats.isFile()) {\n return onFile(item);\n } else if (stats.isSymbolicLink()) {\n // Symlinks don't really need to know about the mode.\n return onLink(source);\n }\n });\n }\n\n function onFile(file) {\n var target = file.name.replace(currentPath, targetPath);\n if (rename) {\n target = rename(target);\n }\n isWritable(target, function (writable) {\n if (writable) {\n return copyFile(file, target);\n }\n if (clobber) {\n rmFile(target, function () {\n copyFile(file, target);\n });\n }\n if (modified) {\n var stat = dereference ? fs.stat : fs.lstat;\n stat(target, function (err, stats) {\n //if souce modified time greater to target modified time copy file\n if (file.mtime.getTime() > stats.mtime.getTime())\n copyFile(file, target);\n else\n return cb();\n });\n } else {\n return cb();\n }\n });\n }\n\n function copyFile(file, target) {\n var readStream = fs.createReadStream(file.name),\n writeStream = fs.createWriteStream(target, {mode: file.mode});\n\n readStream.on('error', onError);\n writeStream.on('error', onError);\n\n if (transform) {\n transform(readStream, writeStream, file);\n } else {\n writeStream.on('open', function () {\n readStream.pipe(writeStream);\n });\n }\n writeStream.once('finish', function () {\n if (modified) {\n //target file modified date sync.\n fs.utimesSync(target, file.atime, file.mtime);\n cb();\n } else\n cb();\n });\n }\n\n function rmFile(file, done) {\n fs.unlink(file, function (err) {\n if (err) {\n return onError(err);\n }\n return done();\n });\n }\n\n function onDir(dir) {\n var target = dir.name.replace(currentPath, targetPath);\n isWritable(target, function (writable) {\n if (writable) {\n return mkDir(dir, target);\n }\n copyDir(dir.name);\n });\n }\n\n function mkDir(dir, target) {\n fs.mkdir(target, dir.mode, function (err) {\n if (err) {\n return onError(err);\n }\n copyDir(dir.name);\n });\n }\n\n function copyDir(dir) {\n fs.readdir(dir, function (err, items) {\n if (err) {\n return onError(err);\n }\n items.forEach(function (item) {\n startCopy(path.join(dir, item));\n });\n return cb();\n });\n }\n\n function onLink(link) {\n var target = link.replace(currentPath, targetPath);\n fs.readlink(link, function (err, resolvedPath) {\n if (err) {\n return onError(err);\n }\n checkLink(resolvedPath, target);\n });\n }\n\n function checkLink(resolvedPath, target) {\n if (dereference) {\n resolvedPath = path.resolve(basePath, resolvedPath);\n }\n isWritable(target, function (writable) {\n if (writable) {\n return makeLink(resolvedPath, target);\n }\n fs.readlink(target, function (err, targetDest) {\n if (err) {\n return onError(err);\n }\n if (dereference) {\n targetDest = path.resolve(basePath, targetDest);\n }\n if (targetDest === resolvedPath) {\n return cb();\n }\n return rmFile(target, function () {\n makeLink(resolvedPath, target);\n });\n });\n });\n }\n\n function makeLink(linkPath, target) {\n fs.symlink(linkPath, target, function (err) {\n if (err) {\n return onError(err);\n }\n return cb();\n });\n }\n\n function isWritable(path, done) {\n fs.lstat(path, function (err) {\n if (err) {\n if (err.code === 'ENOENT')\n return done(true);\n return done(false);\n }\n return done(false);\n });\n }\n\n function onError(err) {\n if (options.stopOnError) {\n return cback(err);\n } else if (!errs && options.errs) {\n errs = fs.createWriteStream(options.errs);\n } else if (!errs) {\n errs = [];\n }\n if (typeof errs.write === 'undefined') {\n errs.push(err);\n } else {\n errs.write(err.stack + '\\n\\n');\n }\n return cb();\n }\n\n function cb(skipped) {\n if (!skipped)\n running--;\n finished++;\n if ((started === finished) && (running === 0)) {\n if (cback !== undefined) {\n return errs ? cback(errs) : cback(null);\n }\n }\n }\n }\n\n }\n }", "function getCommand() {\n return {\n instance : {\n config : {\n }\n }\n };\n}", "function addDefault (build_statement) {\n ninja_config.default_build_statements.push({\n build_statement: build_statement\n });\n}", "function generateBuildConfig(){\n var jsBaseDir = './js';\n var lessBaseDir = './less';\n var fontsBaseDir= './fonts';\n\n var buildConfig = {\n jsBaseDir: jsBaseDir,\n fontsBaseDir: fontsBaseDir,\n fontsDestDir: './dist',\n jsDistDir: './dist',\n lessDistDir: './dist',\n lessBaseDir: lessBaseDir,\n //tell browserify to scan the js directory so we don't have to use relative paths when referencing modules (e.g. no ../components).\n paths:['./js'],\n //assume these extensions for require statements so we don't have to include in requires e.g. components/header vs components/header.jsx\n extensions:['.js'],\n\n //http://jshint.com/docs/options/\n jshintThese:[\n \"core/**/*\"\n ],\n jshint:{\n curly: true,\n strict: true,\n browserify: true\n },\n\n //http://lisperator.net/uglifyjs/codegen\n uglify:{\n mangle:true,\n output:{ //http://lisperator.net/uglifyjs/codegen\n beautify: false,\n quote_keys: true //this is needed because when unbundling/browser unpack, the defined modules need to be strings or we wont know what their names are.\n }\n //compress:false // we can refine if needed. http://lisperator.net/uglifyjs/compress\n }\n };\n\n\n return buildConfig;\n}", "function sampleConfig() {\n return \"\\\n---\\n\\\n# Configuration sample file for Jingo (YAML)\\n\\\napplication:\\n\\\n title: \\\"CartoWiki\\\"\\n\\\nserver:\\n\\\n hostname: \\\"localhost\\\"\\n\\\n port: 6067\\n\\\n localOnly: false\\n\\\n baseUrl: \\\"http://localhost:6067\\\"\\n\\\nauthentication:\\n\\\n google:\\n\\\n enabled: true\\n\\\n\ttwitter:\\n\\\n\t enabled: true\\n\\\n\t oauthkeys:\\n\\\n consumerKey : ''\\n\\\n consumerSecret : ''\\n\\\n cacheExpire: 3600000\\n\\\n\tfacebook:\\n\\\n\t enabled: true\\n\\\n\t oauthkeys:\\n\\\n clientID : ''\\n\\\n clientSecret : ''\\n\\\n alone:\\n\\\n enabled: false\\n\\\n username: \\\"\\\"\\n\\\n passwordHash: \\\"\\\"\\n\\\n email: \\\"\\\"\\n\\\ntwitterClient:\\n\\\n consumerKey : ''\\n\\\n consumerSecret : ''\\n\\\n accessTokenKey : ''\\n\\\n accessTokenSecret : ''\\n\\\n\";\n }", "async beforeRun() {\n this._super.apply(this, arguments);\n\n // try to read global options from `config/crowdin.js`\n let configOptions = {};\n let module = path.join(this.project.root, 'config', 'crowdin');\n\n try {\n configOptions = require(module);\n if (typeof configOptions === 'function') {\n configOptions = configOptions();\n }\n } catch (e) {\n // do nothing, ignore the config\n }\n\n // For all options that are specified in config/crowdin.js, set the value there to be the actual default value\n this.availableOptions.map((option) => {\n let normalizedName = stringUtil.camelize(option.name);\n let configOption = configOptions[normalizedName];\n\n if (configOption !== undefined) {\n option.default = configOption;\n return option;\n }\n\n return option;\n });\n\n await this._createTmpFolder(this._getTmpDir());\n }", "function makeKbConfig(state) {\n var root = state.environment.path,\n fileName = 'deploy-' + state.config.targets.deploy + '.cfg';\n\n return Promise.all([\n loadIni(root.concat(['config', 'deploy', fileName])),\n fs.readFileAsync(root.concat(['config', 'deploy', 'templates', 'service.yml']).join('/'), 'utf8')\n ])\n .spread(function (kbDeployConfig, template) {\n state.config.kbDeployConfig = kbDeployConfig;\n var compiled = underscore.template(template),\n expanded = compiled(kbDeployConfig['kbase-ui']);\n return Promise.all([expanded, saveIni(root.concat(['deploy.cfg']), kbDeployConfig)]);\n })\n .spread(function (configContents) {\n var dest = root.concat(['build', 'client', 'modules', 'config', 'service.yml']).join('/');\n return fs.writeFileAsync(dest, configContents);\n })\n .then(function () {\n return state;\n });\n}", "function createConfig(cfg) {\n\tconfig = cfg;\n\n\tconfig.nitro = extend(true, {\n\t\tview_directory: path.normalize(config.base_path + '/views'),\n\t\tview_file_extension: 'html',\n\t\tview_partials_directory: path.normalize(config.base_path + '/views/_partials'),\n\t\tview_data_directory: path.normalize(config.base_path + '/views/_data'),\n\t\thelpers_directory: path.normalize(config.base_path + '/project/helpers/')\n\t}, config.nitro);\n\n\treturn config;\n}", "function buildConfig(args) {\n var entry = args._[1];\n var mountId = args['mount-id'] || 'app';\n\n var config = {\n babel: {\n presets: ['inferno'],\n stage: 0\n },\n output: {\n filename: 'app.js',\n path: process.cwd(),\n publicPath: '/'\n },\n plugins: {\n html: {\n mountId,\n title: args.title || 'Inferno App'\n }\n },\n resolve: {\n alias: {\n 'react': 'inferno-compat',\n 'react-dom': 'inferno-compat'\n }\n }\n };\n\n if (args.force === true) {\n config.entry = [_path2.default.resolve(entry)];\n } else {\n // Use a render shim module which supports quick prototyping\n config.entry = [require.resolve('../infernoRunEntry')];\n config.plugins.define = { NWB_INFERNO_RUN_MOUNT_ID: JSON.stringify(mountId) };\n // Allow the render shim module to resolve Inferno from the cwd\n config.resolve.alias['inferno'] = _path2.default.dirname(_resolve2.default.sync('inferno/package.json', { basedir: process.cwd() }));\n // Allow the render shim module to import the provided entry module\n config.resolve.alias['nwb-inferno-run-entry'] = _path2.default.resolve(entry);\n }\n\n if (args.polyfill === false || args.polyfills === false) {\n config.polyfill = false;\n }\n\n return config;\n}", "function initConfig(N) {\n // set application environment\n N.environment = process.env.NODECA_ENV || N.config.env_default || 'development';\n\n // do global expansion first\n // merge `^all` branch\n if (N.config['^all']) {\n mergeConfigs(N.config, N.config['^all']);\n delete N.config['^all'];\n }\n\n // expand environment-dependent configs\n _.forEach(N.config, (val, key) => {\n if (key[0] === '^') {\n delete N.config[key];\n\n if (N.environment === key.substr(1)) {\n mergeConfigs(N.config, val);\n }\n }\n });\n\n //\n // Post-process config.\n //\n N.config.options = N.config.options || {};\n}", "mergeDefaultConfigs() {\n\t\tthis.controlOptions = deepmerge( config.defaults, this.controlOptions, {\n\t\t\tarrayMerge: ( destination, source ) => source\n\t\t} );\n\n\t\tthis.baseConfig = $.extend( true, {}, this.controlOptions );\n\n\t\tthis.options.target = null;\n\t\tthis.controlOptions = deepmerge( this.controlOptions, this.options, {\n\t\t\tarrayMerge: ( destination, source ) => source\n\t\t} );\n\t}", "function default_1(config, baseConfig) {\n return {\n dist: path_1.default.resolve(config.dtsDir, 'index.d.ts'),\n content: `export * from '${baseConfig.framework}';\\n` +\n 'export as namespace Egg;\\n',\n };\n}", "function configure() {\n\n var rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n // Grab the user's API keys for Stormpath and FullContact, then store them in\n // the configuration file.\n async.waterfall([\n function(cb) {\n mkdirp(CONFIG_DIR, function(err, made) {\n if (err) {\n cb(new Error(\"ERROR: Can't create configuration directory:\", CONFIG_DIR));\n }\n cb();\n });\n },\n function(cb) {\n rl.question(\"Enter your Stormpath API Key ID: \", function(id) {\n cb(null, id.trim());\n });\n },\n function(id, cb) {\n rl.question(\"Enter your Stormpath API Key Secret: \", function(secret) {\n cb(null, id, secret.trim());\n });\n },\n function(id, secret, cb) {\n rl.question(\"Enter your FullContact API Key: \", function(key) {\n cb(null, id, secret, key.trim());\n });\n },\n function(id, secret, key, cb) {\n fs.writeFile(CONFIG_FILE, JSON.stringify({\n stormpath_api_key_id: id,\n stormpath_api_key_secret: secret,\n fullcontact_api_key: key,\n }, null, 2), function(err) {\n if (err) {\n console.log(\"ERROR: Can't write configuration file:\", CONFIG_FILE);\n cb(err);\n }\n cb();\n });\n },\n ], function(err) {\n rl.close();\n });\n\n}", "default() {\n this.log('default');\n this.composeWith(require.resolve('generator-ptz/generators/app'), {\n isComposing: true,\n skipInstall: this.options.skipInstall,\n ptz: this.options.ptz\n });\n }", "function setDefaultConfig(data) {\n var initialValue = {\n \"buttonHasText\": true,\n \"openAtStart\": true,\n \"welcomeMessageStatus\": true,\n \"welcomeText\": \"Hi there! Do you want to have a chat widget like this? It's so easy and customisable! So, come on have a chat with us! \",\n \"welcomeTimeout\": \"3\",\n \"buttonHasIcon\": true,\n \"buttonIcon\": 'https://s3-ap-southeast-1.amazonaws.com/qiscus-sdk/public/qismo/img/icon-qiscus-widget-default.svg',\n \"qismoBaseUrl\": (options.staging) ? '//qismo-stag.qiscus.com' : '//qismo.qiscus.com',\n };\n if(!window.qismoConfig) window.qismoConfig = {};\n if(options) window.qismoConfig = Object.assign({}, qismoConfig, options);\n attachEventListenerChat()\n if(!data) {\n qismoConfig = Object.assign({}, initialValue, qismoConfig);\n return qismoConfig;\n }\n Object.keys(data.variables).forEach(function(key) {\n qismoConfig[key] = data.variables[key];\n });\n }", "_mergeSettings(settings, extraSettings) {\r\n for (let name in extraSettings) {\r\n if (name == 'paths') {\r\n continue;\r\n }\r\n\r\n if (!_.has(settings, name)) {\r\n settings[name] = extraSettings[name];\r\n continue;\r\n }\r\n\r\n let option = _.findWhere(argvOptions, { realName: name });\r\n\r\n if (option.type == 'array') {\r\n for (let value in extraSettings[name]) {\r\n if (!_.includes(settings[name], value)) {\r\n settings[name].push(value);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (extraSettings.paths) {\r\n if (!settings.paths) {\r\n settings.paths = {};\r\n }\r\n\r\n for (let urlPath in extraSettings.paths) {\r\n if (!_.has(settings.paths, urlPath)) {\r\n settings.paths[urlPath] = extraSettings.paths[urlPath];\r\n }\r\n else {\r\n extraSettings.paths[urlPath].forEach(function(staticPath) {\r\n if (!_.includes(settings.paths[urlPath], staticPath)) {\r\n settings.paths[urlPath].push(staticPath);\r\n }\r\n });\r\n }\r\n }\r\n }\r\n }", "function build() {\n\treturn function(cb) {\n\n\t\t///////////////////////////////////////////////////////////////////////////\n\t\t// TODO hardcoding mocks for now but after dev cloud we need to remove this\n\t\targs.mocks = true;\n\t\t///////////////////////////////////////////////////////////////////////////\n\n\t\targs.dest = config.build.app;\n\t\targs.optimize = args.optimize || true;\n\t\targs.env = args.env || 'local';\n\n\t\tlog([\n\t\t\t'ARGS FOR THE BUILD.JS',\n\t\t\t'dest: ' + args.dest,\n\t\t\t'optimize: ' + args.optimize,\n\t\t\t'env: ' + args.env\n\t\t]);\n\n\t\tvar parallelTasks = [\n\t\t\t'index',\n\t\t\t'styles',\n\t\t\t'scripts',\n\t\t\t'templates',\n\t\t\t'fonts',\n\t\t\t'images'\n\t\t];\n\n\t\tif (args.mocks) {\n\t\t\tparallelTasks.push('mocks');\n\t\t}\n\n\t\trunSequence('conductor', parallelTasks, cb);\n\t};\n}", "function getCliConfig(): RNConfig {\n const cliArgs = minimist(process.argv.slice(2));\n const config = cliArgs.config != null\n ? Config.load(path.resolve(__dirname, cliArgs.config))\n : Config.findOptional(__dirname);\n\n return {...defaultRNConfig, ...config};\n}", "function getDefaultNomicLabsConfig(){\n const logger = process.env.SILENT ? { log: () => {} } : console;\n const reporter = process.env.SILENT ? 'dot' : 'spec';\n\n const mockwd = path.join(process.cwd(), temp);\n const vals = {\n paths : {\n root: mockwd,\n artifacts: path.join(mockwd, 'artifacts'),\n cache: path.join(mockwd, 'cache'),\n sources: path.join(mockwd, 'contracts'),\n tests: path.join(mockwd, 'test'),\n },\n logger: logger,\n mocha: {\n reporter: reporter\n },\n networks: {\n development: {\n url: \"http://127.0.0.1:8545\",\n }\n }\n }\n\n return vals;\n}", "function makeCompleteConfiguration(config) {\n const defaults = {\n coveragePaths: [],\n reportFileSet: \"all\",\n reportMode: \"message\",\n entrySortMethod: \"alphabetically\",\n numberOfEntries: 10,\n threshold: {\n statements: 100,\n branches: 100,\n functions: 100,\n lines: 100,\n },\n };\n const combined = config ? Object.assign({}, defaults, config) : defaults;\n const coveragePath = combined.coveragePath ? combined.coveragePath : \"./coverage/coverage-summary.json\";\n const coveragePaths = combined.coveragePaths.length === 0 ? [coveragePath] : combined.coveragePaths;\n delete combined.coveragePath;\n return Object.assign({}, combined, { coveragePaths });\n}", "_initializeDefaultSettings(settings) {\r\n for (let name in argvOptions) {\r\n let option = argvOptions[name];\r\n\r\n let realName = name;\r\n if (option.name) {\r\n realName = option.name;\r\n }\r\n\r\n if (!_.has(settings, realName)) {\r\n if (realName == 'paths') {\r\n settings['paths'] = { '' : path.resolve('') };\r\n }\r\n else if (_.has(option, 'default')) {\r\n settings[realName] = option['default'];\r\n }\r\n else if (option.type == 'flag') {\r\n // Flags default to false\r\n settings[realName] = false;\r\n }\r\n else if (option.type == 'array') {\r\n settings[realName] = [];\r\n }\r\n }\r\n }\r\n }", "default() {\n\n // compose here with others Yeoman generator\n\n }", "function makeConfig() {\n\tif (config)\n\t\tthrow new Error('Config can only be created once');\n\n\toptions = project.custom.webpack || {}\n\t_.defaultsDeep(options,defaultOptions);\n\n\tif (options.config) {\n\t\tconfig = options.config;\n\t} else {\n\t\tlet configPath = path.resolve(options.configPath);\n\t\tif (!fs.existsSync(configPath)) {\n\t\t\tthrow new Error(`Unable to location webpack config path ${configPath}`);\n\t\t}\n\n\t\tlog(`Making compiler with config path ${configPath}`);\n\t\tconfig = require(configPath);\n\n\t\tif (_.isFunction(config))\n\t\t\tconfig = config()\n\t}\n\n\n\tconfig.target = 'node';\n\n\t// Output config\n\toutputPath = path.resolve(process.cwd(),'target');\n\tif (!fs.existsSync(outputPath))\n\t\tmkdirp.sync(outputPath);\n\n\tconst output = config.output = config.output || {};\n\toutput.library = '[name]';\n\n\t// Ensure we have a valid output target\n\tif (!_.includes([CommonJS,CommonJS2],output.libraryTarget)) {\n\t\tconsole.warn('Webpack config library target is not in',[CommonJS,CommonJS2].join(','))\n\t\toutput.libraryTarget = CommonJS2\n\t}\n\n\t// Ref the target\n\tlibraryTarget = output.libraryTarget\n\n\toutput.filename = '[name].js';\n\toutput.path = outputPath;\n\n\tlog('Building entry list');\n\tconst entries = config.entry = {};\n\n\tconst functions = project.getAllFunctions();\n\tfunctions.forEach(fun => {\n\n\t\t// Runtime checks\n\t\t// No python or Java :'(\n\n\t\tif (!/node/.test(fun.runtime)) {\n\t\t\tlog(`${fun.name} is not a webpack function`);\n\t\t\treturn\n\t\t}\n\n\n\t\tconst handlerParts = fun.handler.split('/').pop().split('.');\n\t\tlet modulePath = fun.getRootPath(handlerParts[0]), baseModulePath = modulePath;\n\t\tif (!fs.existsSync(modulePath)) {\n\t\t\tfor (let ext of config.resolve.extensions) {\n\t\t\t\tmodulePath = `${baseModulePath}${ext}`;\n\t\t\t\tlog(`Checking: ${modulePath}`);\n\t\t\t\tif (fs.existsSync(modulePath))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!fs.existsSync(modulePath))\n\t\t\tthrow new Error(`Failed to resolve entry with base path ${baseModulePath}`);\n\n\t\tconst handlerPath = require.resolve(modulePath);\n\n\t\tlog(`Adding entry ${fun.name} with path ${handlerPath}`);\n\t\tentries[fun.name] = handlerPath;\n\t});\n\n\tlog(`Final entry list ${Object.keys(config.entry).join(', ')}`);\n}", "get configTemplate() {\n return {\n // The color is used for the `this.log()` function and also custom command help\n color: '1af463',\n // The optional icon to use with the `this.sendLocalMessage` function. If left blank, a default one will be used instead\n iconURL: 'https://i.ytimg.com/vi/KEkrWRHCDQU/maxresdefault.jpg'\n };\n }", "configure() {\n\t\tthrow new Error(\"Must override Command.configure\")\n\t}", "function buildConfig() {\n return {\n version: \"0.8.6\",\n };\n}", "function defaultConfig() {\n return {\n features: [\n /* {\n name: 'api',\n flag: false,\n implementations: ['fixtures', 'mock-server']\n } */\n ]\n }\n}", "function setupConfigHandler(action, category, argArray) {\n\n\tif ('undefined' === typeof category || '-h' === category || '--help' === category || 'help' === category || -1 === configCats.indexOf(category)) {\n\t\n\t\tvar helpArgs;\n\t\tswitch(action) {\n\t\t\n\t\t\tcase 'list':\n\t\t\t\thelpArgs = [\n\t\t\t\t\t'setup list',\n\t\t\t\t\t'List all current values in a category.',\n\t\t\t\t\t'category environment',\n\t\t\t\t\t'Environment accepts \"prod\" or \"dev\". Default is prod.'\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\tcase 'initial':\n\t\t\t\thelpArgs = [\n\t\t\t\t\t'setup initial',\n\t\t\t\t\t'Perform initial interactive setup of a category.',\n\t\t\t\t\t'category'\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\tcase 'set':\n\t\t\t\thelpArgs = [\n\t\t\t\t\t'setup set',\n\t\t\t\t\t'Set a single string configuration value for a key within a category.',\n\t\t\t\t\t'category key value environment',\n\t\t\t\t\t'Environment accepts \"prod\", \"dev\", or \"both\". Default is both.'\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\tcase 'reset':\n\t\t\t\thelpArgs = [\n\t\t\t\t\t'setup reset',\n\t\t\t\t\t'Reset all configuration values within a category to the default.',\n\t\t\t\t\t'category environment',\n\t\t\t\t\t'Environment accepts \"prod\", \"dev\", or \"both\". Default is both.'\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\tcase 'add':\n\t\t\t\thelpArgs = [\n\t\t\t\t\t'setup add',\n\t\t\t\t\t'Add a member to an array configuration value for a key within a category.',\n\t\t\t\t\t'category key value environment',\n\t\t\t\t\t'Value must be a valid JSON representation of an array or object. (the string should be enclosed in single quotes e.g. \\'{\"name\",\"path\"}\\').'+\"\\r\\n\"+'Environment accepts \"prod\", \"dev\", or \"both\". Default is both.'\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\tcase 'remove':\n\t\t\t\thelpArgs = [\n\t\t\t\t\t'setup set',\n\t\t\t\t\t'Remove an array member of the configuration value for a key within a category.',\n\t\t\t\t\t'category key index environment',\n\t\t\t\t\t'Index is a number representing the array item you are removing (starts from 0). Use \"setup list [category]\" to see current values. Environment accepts \"prod\", \"dev\", or \"both\". Default is both.'\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\n\t\t}\n\t\tactionHelp(...helpArgs);\n\t\tif (-1 === configCats.indexOf(category)) {\n\t\t\tconsole.error('Invalid category \"' + category + '\". Use one of the following:');\n\t\t}\n\t\telse {\n\t\t\n\t\t\tconsole.log('Available category names:');\n\t\t\n\t\t}\n\t\tconsole.log('\t' + JSON.stringify(configCats));\n\t\treturn process.exit();\n\t\n\t}\n\telse if ('initial' === action) {\n\t\n\t\tconst rl = readline.createInterface({\n\t\t\tinput: process.stdin,\n\t\t\toutput: process.stdout,\n\t\t\tprompt: 'UWOT Config> '\n\t\t});\n\t\t\n\t\trl.question('Is this config change for the development, production, or both environments? (default both)' + \"\\r\\n\" + rl._prompt, function(answer) {\n\t\t\n\t\t\tvar envs = getEnvs(answer.trim().toLowerCase(), 'both');\n\t\t\tconsole.log(envs);\n\t\t\trl.close();\n\t\t\n\t\t});\n\t\n\t}\n\telse {\n\t\t\n\t\tvar envString = argArray.pop();\n\t\tvar envs = getEnvs(envString, 'both');\n\t\tswitch(action) {\n\t\t\n\t\t\tcase 'list':\n\t\t\t\tlistSetupCategoryValues(category, getEnvs(envString, 'prod'));\n\t\t\t\tbreak;\n\t\t\tcase 'set':\n\t\t\t\tsetSetupCategoryKeyValue(category, ...argArray, envs);\n\t\t\t\tbreak;\n\t\t\tcase 'reset':\n\t\t\t\tresetSetupCategoryValues(category, envs);\n\t\t\t\tbreak;\n\t\t\tcase 'add':\n\t\t\t\taddSetupCategoryKeyArrayValue(category, ...argArray, envs);\n\t\t\t\tbreak;\n\t\t\tcase 'remove':\n\t\t\t\tremoveSetupCategoryKeyArrayValue(category, ...argArray, envs);\n\t\t\t\tbreak;\n\t\t\n\t\t}\n\t\n\t}\n\n}", "_createIonicApp() {\n ['.gitignore', 'app', 'scripts', 'resources', 'tsconfig.json', 'gulpfile.js', 'webpack.config.js', 'webpack.production.config.js'].forEach((file) => {\n this._copy(file);\n });\n ['package.json'].forEach((file) => {\n this.createTemplate(file, this.answers);\n });\n }", "_configure() {\n super._configure();\n Object.assign(this.path, {\n root: 'dist',\n 'package-a': TargetConfigA.packagePath,\n });\n Object.assign(this, { // dependent on this.path\n });\n }", "function concatUserDefinedConfigFile() {\n var userDefinedConfigFilePath = path.join(exports.homedir, USER_DEFINED_CONFIG_FILE_NAME);\n \n if (!fs.existsSync(userDefinedConfigFilePath)) {\n return;\n }\n\n var userConfig;\n try {\n userConfig = JSON.parse(fs.readFileSync(userDefinedConfigFilePath));\n } catch (err) {\n console.log(\"ERROR: empty or malformed configuration file at '\" + userDefinedConfigFilePath +\n \"'. Config file must be in JSON format.\");\n throw err;\n }\n\n if (!userConfig.pluginDirPaths || userConfig.pluginDirPaths.length === 0) {\n return;\n }\n\n exports.config.pluginDirPaths = exports.config.pluginDirPaths.concat(userConfig.pluginDirPaths);\n exports.config.pluginInterfaceDirPaths = exports.config.pluginInterfaceDirPaths.concat(userConfig.pluginInterfaceDirPaths);\n}", "pushConfigurationArgs(args) {\n if (this._rushConfiguration.packageManager === 'npm') {\n args.push('--cache', this._rushConfiguration.npmCacheFolder);\n args.push('--tmp', this._rushConfiguration.npmTmpFolder);\n }\n else if (this._rushConfiguration.packageManager === 'pnpm') {\n args.push('--store', this._rushConfiguration.pnpmStoreFolder);\n // we are using the --no-lock flag for now, which unfortunately prints a warning, but should be OK\n // since rush already has its own install lock file which will invalidate the cache for us.\n // we theoretically could use the lock file, but we would need to clean the store if the\n // lockfile existed, otherwise PNPM would hang indefinitely. it is simpler to rely on Rush's\n // last install flag, which encapsulates the entire installation\n args.push('--no-lock');\n }\n }", "function default_1(options) {\n console.log(`\\n${figlet.textSync('ng add')}\\n`);\n const rules = [];\n if (options.changeThemeOnly) {\n rules.push(theming_1.importThemeInStyles(options.theme));\n }\n else {\n !options.skipPackageJson && rules.push(addPrimengToPackageJson(options));\n rules.push((tree) => package_1.addPngAliasToPackageJson(tree));\n rules.push(theming_1.addThemeToAppStyles(options));\n rules.push(addAnimationRootConfig(options));\n if (options.createSample) {\n rules.push(createSample(options));\n if (options.workingDirectory) {\n rules.push(theming_1.modifyAppComponentTemplate());\n rules.push((tree) => overwriteAppSpecFile(options, tree));\n }\n }\n options.setDefaultCollection && rules.push((tree) => utils_1.addDefaultCli(tree));\n }\n const wd = options.workingDirectory;\n return wd ? schematics_1.applyToSubtree(wd, rules) : schematics_1.chain(rules);\n}", "initializeBuildsDir(config) {\n return inquirer\n .prompt([\n {\n type: 'input',\n name: 'buildsDir',\n message: 'buildsDir',\n default: 'dist/'\n }\n ])\n .then(({ buildsDir }) => {\n config.buildsDir = buildsDir;\n return config;\n });\n }", "async executeConfig() {\n if (this.config.cmd) return cmd(this.config.cmd);\n\n let command = 'xrandr ';\n const disconnected = await getXrandrDisconnectedMonitorsNames();\n if (disconnected && disconnected.length) {\n disconnected.forEach(name => {\n command += `--output ${name} --off `;\n });\n }\n if (this.isLaptop()) {\n command += `--output ${await this.getXrandrName()} --auto --primary --rotate normal `;\n } else {\n const laptopName = await laptop.getXrandrName();\n command += `--output ${laptopName} --auto --rotate normal `;\n command += this.config.primary ? '' : '--primary ';\n if (laptop.config.dimensions)\n command += `--mode ${this.config.dimensions} `;\n\n command += `--output ${await this.getXrandrName()} --auto --rotate normal `;\n command += this.config.primary ? '--primary ' : '';\n if (this.config.dimensions)\n command += `--mode ${this.config.dimensions} `;\n command +=\n {\n same: '--same-as ',\n right: '--right-of ',\n left: '--left-of ',\n top: '--above ',\n bottom: '--below ',\n }[this.config.side] + laptopName;\n }\n\n setSoundProfileFor(this);\n\n console.log('cmd', command);\n\n return cmd(command);\n }", "function setup (options) {\n App.config = _.deepExtend(defaults, options);\n }", "function configuration(override) {\n var res = __assign({}, exports.DefaultConfig);\n if (override.src)\n Object.assign(res.src, override.src);\n if (override.dest)\n Object.assign(res.dest, override.dest);\n if (override.bundle)\n Object.assign(res.bundle, override.bundle);\n if (override.page) {\n if (override.page.title)\n Object.assign(res.page.title, override.page.title);\n if (override.page.favicon)\n res.page.favicon = override.page.favicon;\n if (override.page.meta)\n res.page.meta = override.page.meta;\n if (override.page.fonts)\n res.page.fonts = override.page.fonts;\n if (override.page.scripts)\n res.page.scripts = override.page.scripts;\n if (override.page.stylesheets)\n res.page.stylesheets = override.page.stylesheets;\n if (override.page.post)\n res.page.post = override.page.post;\n }\n if (override.dev)\n Object.assign(res.dev, override.dev);\n if (override.theme)\n res.theme = override.theme;\n if (override.markdown) {\n Object.assign(res.markdown, override.markdown);\n if (override.markdown.customComponents)\n res.markdown.BlockQuote = marked_1.quotedComponents(override.markdown.customComponents);\n }\n if (override.tocMarkdown) {\n Object.assign(res.tocMarkdown, override.tocMarkdown);\n if (override.tocMarkdown.customComponents)\n res.markdown.BlockQuote = marked_1.quotedComponents(override.tocMarkdown.customComponents);\n }\n if (override.misc)\n res.misc = override.misc;\n return res;\n}", "function createWebpackConfig(buildConfig, pluginConfig = {}, userConfig = {}) {\n (0, _debug2.default)('createWebpackConfig buildConfig: %s', (0, _utils.deepToString)(buildConfig));\n\n // Final webpack config is primarily driven by build configuration for the nwb\n // command being run. Each command configures a default, working webpack\n // configuration for the task it needs to perform.\n let {\n // These build config items are used to create chunks of webpack config,\n // rather than being included as-is.\n babel: buildBabelConfig = {},\n entry,\n output: buildOutputConfig,\n polyfill: buildPolyfill,\n plugins: buildPluginConfig = {},\n resolve: buildResolveConfig = {},\n rules: buildRulesConfig = {},\n server = false\n } = buildConfig,\n otherBuildConfig = _objectWithoutProperties(buildConfig, ['babel', 'entry', 'output', 'polyfill', 'plugins', 'resolve', 'rules', 'server']);\n\n let userWebpackConfig = userConfig.webpack || {};\n let userOutputConfig = {};\n if ('publicPath' in userWebpackConfig) {\n userOutputConfig.publicPath = userWebpackConfig.publicPath;\n }\n let userResolveConfig = {};\n if (userWebpackConfig.aliases) {\n userResolveConfig.alias = userWebpackConfig.aliases;\n }\n\n // Generate config for babel-loader and set it as loader config for the build\n buildRulesConfig.babel = { options: (0, _createBabelConfig2.default)(buildBabelConfig, userConfig.babel, userConfig.path) };\n\n let webpackConfig = _extends({\n mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',\n module: {\n rules: createRules(server, buildRulesConfig, userWebpackConfig, pluginConfig),\n strictExportPresence: true\n },\n output: _extends({}, buildOutputConfig, userOutputConfig),\n performance: {\n hints: false\n }\n }, createPlugins(server, buildPluginConfig, userWebpackConfig), {\n resolve: (0, _webpackMerge2.default)(buildResolveConfig, userResolveConfig),\n resolveLoader: {\n modules: ['node_modules', _path2.default.join(__dirname, '../node_modules')]\n }\n }, otherBuildConfig);\n\n if (entry) {\n // Add default polyfills to the entry chunk unless configured not to\n if (buildPolyfill !== false && userConfig.polyfill !== false) {\n addPolyfillsToEntry(entry);\n }\n webpackConfig.entry = entry;\n }\n\n // Create and merge compatibility configuration into the generated config if\n // specified.\n if (userWebpackConfig.compat) {\n let compatConfig = getCompatConfig(userWebpackConfig.compat);\n if (compatConfig) {\n webpackConfig = (0, _webpackMerge2.default)(webpackConfig, compatConfig);\n }\n }\n\n // Any extra user webpack config is merged into the generated config to give\n // them even more control.\n if (userWebpackConfig.extra) {\n webpackConfig = (0, _webpackMerge2.default)(webpackConfig, userWebpackConfig.extra);\n }\n\n // Finally, give them a chance to do whatever they want with the generated\n // config.\n if ((0, _utils.typeOf)(userWebpackConfig.config) === 'function') {\n webpackConfig = userWebpackConfig.config(webpackConfig);\n if (!webpackConfig) {\n throw new _errors.UserError(`webpack.config() in ${userConfig.path} didn't return anything - it must return the Webpack config object.`);\n }\n }\n\n return webpackConfig;\n}", "async function composeConfigGet(octokit, {\n owner,\n repo,\n defaults,\n path,\n branch\n}) {\n const files = await getConfigFiles(octokit, {\n owner,\n repo,\n path,\n branch\n });\n const configs = files.map(file => file.config).reverse().filter(Boolean);\n return {\n files,\n config: typeof defaults === \"function\" ? defaults(configs) : Object.assign({}, defaults, ...configs)\n };\n}", "function buildDefaultTemplate() {\n const state = store.getState();\n const coreConnected = isCoreConnected(state);\n const { manualDaemon } = state.settings;\n const { activeAppModule } = state;\n const now = Date.now();\n\n const subMenuFile = {\n label: __('File'),\n submenu: [\n legacyMode ? backupWallet : null,\n legacyMode ? viewBackups : null,\n separator,\n downloadRecent,\n separator,\n // If it's in manual core mode and core is not running, don't show\n // Start Core option because it does nothing\n !manualDaemon || coreConnected\n ? coreConnected\n ? stopCoreMenu\n : startCoreMenu\n : null,\n now < tritiumUpgradeTime\n ? null\n : legacyMode\n ? switchTritiumMode\n : switchLegacyMode,\n separator,\n quitNexus,\n ].filter(e => e),\n };\n\n const subMenuSettings = {\n label: __('Settings'),\n submenu: [\n appSettings,\n coreSettings,\n legacyMode ? keyManagement : null,\n styleSettings,\n moduleSettings,\n ].filter(e => e),\n };\n const subMenuView = {\n label: __('View'),\n submenu: [toggleFullScreen],\n };\n if (process.env.NODE_ENV === 'development' || state.settings.devMode) {\n subMenuView.submenu.push(separator, toggleDevTools);\n\n if (activeAppModule) {\n subMenuView.submenu.push(toggleModuleDevTools);\n }\n }\n\n const subMenuHelp = {\n label: __('Help'),\n submenu: [\n about,\n separator,\n websiteLink,\n gitRepoLink,\n walletGuideLink,\n openCoreDataDir,\n openInterfaceDataDir,\n separator,\n updaterMenuItem(),\n ],\n };\n\n return [subMenuFile, subMenuSettings, subMenuView, subMenuHelp];\n}", "function default_1(app) {\n app.configure(users_service_1.default);\n app.configure(questions_service_1.default);\n app.configure(answers_service_1.default);\n}", "function makeConfig(\n env /*: { [key: string]: ?string } | typeof undefined */\n) /*: Config */ {\n env = env || process.env;\n\n return {\n publicRuntimeConfig: {\n assetPrefix: makeAssetPrefix(env),\n // This is set by our standard deployment process.\n cacheParam: (env.GIT_REVISION && env.GIT_REVISION.substring(0, 8)) || '',\n graphqlApiKey: env.WEB_API_KEY || '',\n liveAgentButtonId: env.LIVE_AGENT_BUTTON_ID || '',\n cloudinaryUrl: `https://api.cloudinary.com/v1_1/${env.CLOUDINARY_CLOUD ||\n ''}`,\n cloudinaryUploadPreset: env.CLOUDINARY_UPLOAD_PRESET || '',\n mapboxAccessToken: env.MAPBOX_ACCESS_TOKEN || '',\n mapboxStylePath: env.MAPBOX_STYLE_PATH || '',\n },\n\n serverRuntimeConfig: {},\n };\n}", "extend(config, ctx) {\n config.node = {\n console: true,\n fs: 'empty',\n net: 'empty',\n tls: 'empty',\n }\n }", "function setupConfig(Espruino) {\n if (args.minify)\n Espruino.Config.MINIFICATION_LEVEL = \"ESPRIMA\";\n if (args.baudRate && !isNaN(args.baudRate))\n Espruino.Config.BAUD_RATE = args.baudRate;\n if (args.noBle)\n Espruino.Config.BLUETOOTH_LOW_ENERGY = false;\n if (args.setTime)\n Espruino.Config.SET_TIME_ON_WRITE = true;\n if (args.watchFile && !args.file)\n throw new Error(\"--watch specified, with no file to watch!\");\n if (args.updateFirmware && (args.file || args.expr))\n throw new Error(\"Can't update firmware *and* upload code right now.\");\n if (args.espruino) { // job file injections\n for (var key in args.espruino) Espruino.Config[key] = args.espruino[key];\n }\n}", "function parseArgs () {\n\n // return build type, specified by input string, or null, if not build type parameter\n function getBuildType (arg) {\n arg = arg.toLowerCase();\n if (arg == \"--debug\" || arg == \"-d\") {\n return \"debug\";\n }\n else if (arg == \"--release\" || arg == \"-r\") {\n return \"release\";\n }\n return null;\n }\n\n // returns build architectures list, specified by input string\n // or null if nothing specified, or not --archs parameter\n function getBuildArchs (arg) {\n arg = arg.toLowerCase();\n var archs = /--archs=(.+)/.exec(arg);\n if (archs) {\n // if architectures list contains commas, suppose that is comma delimited\n if (archs[1].indexOf(',') != -1){\n return archs[1].split(',');\n }\n // else space delimited\n return archs[1].split(/\\s/);\n }\n return null;\n }\n\n // returns deploy target, specified by input string or null, if not deploy target parameter\n function getBuildTarget (arg) {\n arg = arg.toLowerCase();\n if (arg == \"--device\"){\n return \"device\";\n }\n else if (arg == \"--emulator\"){\n return \"emulator\";\n }\n else {\n var target = /--target=(.*)/.exec(arg);\n if (target){\n return target[1];\n }\n }\n return null;\n }\n\n // returns project type, specified by input string or null, if not project type parameter\n function getProjectType (arg) {\n arg = arg.toLowerCase();\n if (arg == \"--phone\"){\n return \"phone\";\n }\n else if (arg == \"--store80\"){\n return \"store80\";\n }\n else if (arg == \"--store81\" || arg == \"--store\"){\n return \"store\";\n }\n return null;\n }\n\n // returns true if nobuild option is specified else false\n function getNoBuildOption (arg) {\n if (arg.toLowerCase() == \"--nobuild\") {\n return true;\n }\n return false;\n }\n\n for (var i = 0; i < args.Length; i++) {\n if (getBuildType(args(i))) {\n buildType = getBuildType(args(i));\n } else if (getBuildArchs(args(i))) {\n buildArchs = getBuildArchs(args(i));\n } else if (getBuildTarget(args(i))){\n buildTarget = getBuildTarget(args(i));\n } else if (getProjectType(args(i))){\n projectType = getProjectType(args(i));\n } else if (getNoBuildOption(args(i))) {\n noBuild = getNoBuildOption(args(i));\n } else {\n Log(\"Error: \\\"\" + args(i) + \"\\\" is not recognized as a build/deploy option\", true);\n Usage();\n WScript.Quit(2);\n }\n }\n}", "function writeBuildConfig (config) {\n var wrappedConfig = wrapWithDefine(\n config ?\n JSON.stringify({\n endpoint: defaults.wiki,\n dashboardArticle: defaults.namespace + config,\n }) :\n null\n );\n fs.writeFileSync(defaults.buildConfigPath, wrappedConfig);\n}", "function initCli(options) {\n return __awaiter(this, void 0, void 0, function* () {\n yield node_version_check_1.default();\n const drcpConfigFiles = options.drcpConfig ? options.drcpConfig.split(/\\s*[,;:]\\s*/) : [];\n const config = yield initDrcp(options.drcpArgs, drcpConfigFiles);\n fs_extra_1.default.mkdirpSync(config.resolve('destDir', 'ng-app-builder.report'));\n return config;\n });\n}", "function configGen() {\n return {\n input: 'src/index.ts',\n output: {\n file: 'dist/web/buttplug.js',\n format: 'iife',\n name: \"Buttplug\"\n },\n plugins: [\n nodeResolve({\n jsnext: true,\n main: true,\n extensions: [ '.ts', '.js', '.json' ],\n browser: true\n }),\n typescript({ tsconfigOverride: { compilerOptions: { module: \"ES2015\" } } }),\n json(),\n nodeBuiltins(),\n nodeGlobals(),\n commonjs({\n // non-CommonJS modules will be ignored, but you can also\n // specifically include/exclude files\n include: ['../../node_modules/**', './node_modules/**'], // Default: undefined\n }),\n ]\n };\n}", "function extendConf (conf) {\r\n conf.boot.push('~quasar-app-extension-db-eds/src/boot/register-db-eds.js');\r\n conf.build.transpileDependencies.push(/quasar-app-extension-db-eds[\\\\/]src[\\\\/](?!lib[\\\\/]euscp\\.js)/);\r\n conf.build.env['EDS_PROXY_URI'] = JSON.stringify(process.env.EDS_PROXY_URI);\r\n conf.build.env['EDS_CA_SERVERS_URI'] = JSON.stringify(process.env.EDS_CA_SERVERS_URI);\r\n conf.build.env['EDS_CA_CERTIFICATES_URI'] = JSON.stringify(process.env.EDS_CA_CERTIFICATES_URI);\r\n conf.build.env['EDS_DIRECT_ACCESS'] = JSON.stringify(process.env.EDS_DIRECT_ACCESS);\r\n}", "function fetch_default_config(filename) {\n let data = null;\n\n if (/.json$/.exec(filename) !== null) {\n data = fs.readFileSync(\n directory + '/src/generate.json'\n );\n }\n else if (/.toml$/.exec(filename) !== null) {\n data = fs.readFileSync(\n directory + '/src/generate.toml'\n );\n }\n else if (/.yaml$/.exec(filename) !== null) {\n data = fs.readFileSync(\n directory + '/src/generate.yaml'\n );\n }\n\n return data;\n}", "static parseConfig() {\n\t\tlet globalConfig;\n\t\tlet localConfig;\n\t\tlet mergedConfig;\n\t\tconst globalPath = path.join(userHome, '.jimrc.js');\n\t\tif (fs.existsSync(globalPath)) {\n\t\t\tglobalConfig = require(globalPath);\n\t\t} else {\n\t\t\tfs.copyFileSync(\n\t\t\t\tpath.join(__dirname, 'boilerplate', 'jimrc.example.js'),\n\t\t\t\tglobalPath\n\t\t\t);\n\t\t\tglobalConfig = require(globalPath);\n\t\t}\n\t\tconst localPath = path.join(process.cwd(), '.jimrc.js');\n\t\tif (fs.existsSync(localPath)) {\n\t\t\tlocalConfig = require(localPath);\n\t\t}\n\t\tif (globalConfig) {\n\t\t\tmergedConfig = merge.recursive(globalConfig, localConfig);\n\t\t} else {\n\t\t\tmergedConfig = localConfig;\n\t\t}\n\n\t\treturn mergedConfig;\n\t}", "function vcMakeConfig() {\n return '{apiKey:\"' + _skywayApiKey + '\", domain:\"' + _skywayDomain + '\"}';\n}", "function main(cmd) {\n // Load the needed configuration files\n var proxyConfig = loadProxyConfigJson(cmd);\n\n var componentJson = undefined;\n if (cmd.sourceDir) {\n componentJson = loadComponentJson(cmd);\n }\n\n COMMANDS[cmd._name](cmd, componentJson, proxyConfig);\n\n // Write the updated config file back to disk\n try {\n var configJsonPath = path.resolve(cmd.proxyStorageDir, 'proxy-config.json');\n fs.writeFileSync(configJsonPath, JSON.stringify(proxyConfig, undefined, 2));\n } catch (err) {\n console.error(errorMessage);\n console.error(err);\n process.exit(1);\n }\n}", "async function givenRunningApplicationWithCustomConfiguration() {\n app = new application_1.TodoListApplication({\n rest: testlab_1.givenHttpServerConfig(),\n });\n await app.boot();\n /**\n * Override default config for DataSource for testing so we don't write\n * test data to file when using the memory connector.\n */\n app.bind('datasources.config.db').to({\n name: 'db',\n connector: 'memory',\n });\n // Start Application\n await app.start();\n }", "function _createApplication() {\n /**\n * Create the root of the application\n */\n mkdirSync(appPath);\n\n /**\n * Copy the baseline structure of the application\n */\n const templateBaselinePath = path.join(__dirname, '..', constants.TEMPLATE_BASELINE_PATH);\n deepCopySync(templateBaselinePath, appPath);\n\n /**\n * Copy the index.html file according to the configuration\n */\n if (program.menu === 'left') {\n deepCopySync(path.join(__dirname, '..', constants.INDEX_LEFT_MENU), appPath);\n } else {\n deepCopySync(path.join(__dirname, '..', constants.INDEX_TOP_MENU), appPath);\n }\n\n /**\n * Create the other directiories that are needed for the start\n */\n constants.DIRECTORIES_FOR_mkdirSync.forEach(__path => {\n mkdirSync(path.join(appPath, __path));\n });\n\n /**\n * Run the steps to aquire the final form of the skeleton\n */\n startTaskRunner(appPath);\n}", "function getConfig() {\n return _buildConfig;\n}", "initialize() {\n this.cli\n .command('fastpanel/mongo setup', 'Configure mongo components.')\n .option('-e, --env', 'Save as current environment settings.')\n .option('-f, --force', 'Forced reconfiguration of components.')\n .visible(false)\n .action((args, options, logger) => {\n return new Promise(async (resolve, reject) => {\n /* Info message. */\n logger.info(`${os_1.EOL}Configure mongo components.`);\n if (!this.config.get('Ext/MongoDB', false) || options.force) {\n /* Prompts list. */\n let questions = [\n /* Host. */\n {\n type: 'input',\n name: 'host',\n message: 'MongoDB host?',\n default: this.config.get('Ext/MongoDB.host', Const_1.MONGODB_CONFIG.host)\n },\n /* Port. */\n {\n type: 'input',\n name: 'port',\n message: 'MongoDB port?',\n default: this.config.get('Ext/MongoDB.port', Const_1.MONGODB_CONFIG.port)\n },\n /* User. */\n {\n type: 'input',\n name: 'user',\n message: 'MongoDB user?',\n default: this.config.get('Ext/MongoDB.user', Const_1.MONGODB_CONFIG.user)\n },\n /* Password. */\n {\n type: 'input',\n name: 'pass',\n message: 'MongoDB password?',\n default: this.config.get('Ext/MongoDB.pass', Const_1.MONGODB_CONFIG.pass)\n },\n /* Db name. */\n {\n type: 'input',\n name: 'dbName',\n message: 'MongoDB database name?',\n default: this.config.get('Ext/MongoDB.dbName', Const_1.MONGODB_CONFIG.dbName)\n },\n /* Auto reconnect. */\n {\n type: 'confirm',\n name: 'autoReconnect',\n message: 'MongoDB connection auto reconnect?',\n default: this.config.get('Ext/MongoDB.autoReconnect', Const_1.MONGODB_CONFIG.autoReconnect)\n },\n /* Reconnect tries. */\n {\n type: 'input',\n name: 'reconnectTries',\n message: 'MongoDB connection reconnect tries?',\n default: this.config.get('Ext/MongoDB.reconnectTries', Const_1.MONGODB_CONFIG.reconnectTries)\n },\n /* Reconnect interval. */\n {\n type: 'input',\n name: 'reconnectInterval',\n message: 'MongoDB connection reconnect interval?',\n default: this.config.get('Ext/MongoDB.reconnectInterval', Const_1.MONGODB_CONFIG.reconnectInterval)\n },\n /* Pool size. */\n {\n type: 'input',\n name: 'poolSize',\n message: 'MongoDB connection pool size?',\n default: this.config.get('Ext/MongoDB.poolSize', Const_1.MONGODB_CONFIG.poolSize)\n }\n ];\n /* Show prompts to user. */\n let config = await this.prompt(questions);\n /* Save data. */\n this.config.set('Ext/MongoDB', config);\n this.config.save('Ext/MongoDB', !(options.env));\n /* Info message. */\n logger.info(`${os_1.EOL}Applied:`);\n logger.info('', this.config.get('Ext/MongoDB'));\n }\n else {\n /* Info message. */\n logger.info(` Everything is already configured. ${os_1.EOL}`);\n }\n /* Command complete. */\n resolve();\n });\n });\n }", "generate() {\n const cmd = this.command;\n const flags = util.sortBy(\n Object.entries(cmd.flags || {})\n .filter(([, v]) => !v.hidden)\n .map(([k, v]) => {\n v.name = k;\n return v;\n }),\n (f) => [!f.char, f.char, f.name],\n );\n const args = (cmd.args || []).filter((a) => !a.hidden);\n let output = util\n .compact([\n this.usage(flags),\n this.args(args),\n this.flags(flags),\n this.description(),\n this.aliases(cmd.aliases),\n this.examples(cmd.examples || cmd.example),\n this.docs(),\n ])\n .join('\\n\\n');\n if (this.opts.stripAnsi) output = stripAnsi(output);\n return output;\n }", "function buildConfiguration(_a) {\r\n var auth = _a.auth, _b = _a.cache, cache = _b === void 0 ? {} : _b, _c = _a.system, system = _c === void 0 ? {} : _c, _d = _a.framework, framework = _d === void 0 ? {} : _d;\r\n var overlayedConfig = {\r\n auth: __assign({}, DEFAULT_AUTH_OPTIONS, auth),\r\n cache: __assign({}, DEFAULT_CACHE_OPTIONS, cache),\r\n system: __assign({}, DEFAULT_SYSTEM_OPTIONS, system),\r\n framework: __assign({}, DEFAULT_FRAMEWORK_OPTIONS, framework)\r\n };\r\n return overlayedConfig;\r\n }", "function processConfigOptions() {\n if (OPTIONS.base_dir === 'cwd' || OPTIONS.base_dir === './') {\n OPTIONS.base_dir = soi.utils.normalizeSysPath(process.cwd() + '/');\n } else {\n OPTIONS.base_dir = soi.utils.normalizeSysPath(\n path.resolve(process.cwd() + '/', OPTIONS.base_dir) + '/');\n }\n\n if (OPTIONS.dist_dir) {\n OPTIONS.dist_dir = soi.utils.normalizeSysPath(\n path.resolve(OPTIONS.base_dir, OPTIONS.dist_dir) + '/');\n }\n if (OPTIONS.module_loader) {\n OPTIONS.module_loader = soi.utils.normalizeSysPath(\n path.resolve(OPTIONS.base_dir, OPTIONS.module_loader));\n }\n if (OPTIONS.map_file) {\n OPTIONS.map_file = soi.utils.normalizeSysPath(\n path.resolve(OPTIONS.base_dir, OPTIONS.map_file));\n }\n if (OPTIONS.output_base) {\n OPTIONS.output_base = soi.utils.normalizeSysPath(\n path.resolve(OPTIONS.base_dir, OPTIONS.output_base) + '/');\n }\n\n // clean(OPTIONS.dist_dir, function(err) {});\n\n // newly added\n if (OPTIONS.bundles.img) {\n processStaticBundles(OPTIONS.bundles.img);\n }\n\n if (OPTIONS.bundles.swf) {\n processStaticBundles(OPTIONS.bundles.swf);\n }\n\n if (OPTIONS.bundles.htc) {\n processStaticBundles(OPTIONS.bundles.htc);\n }\n\n if (OPTIONS.bundles.font) {\n processStaticBundles(OPTIONS.bundles.font);\n }\n\n if (OPTIONS.bundles.css) {\n processDynamicBundles(OPTIONS.bundles.css);\n }\n\n if (OPTIONS.bundles.js) {\n processDynamicBundles(OPTIONS.bundles.js);\n }\n\n // added default ones, because we don't read in it as first\n // calling soi.config.extend\n soi.config.extend({\n optimizer: OPTIONS\n });\n}", "function getConfig() {\n\tvar config = {};\n\t\n\t// Use current project's root folder as a starting point.\n\t// If no project is active, use current folder as a fallback:\n\tvar configpath = editorProjectPath || editorDirectoryPath;\n\t\n\t// Search for custom config file recursively up to the home folder:\n\tconfigpath = CSScomb.getCustomConfigPath(configpath + '/.csscomb.json');\n\t\n\ttry {\n\t\t// Try to load config file:\n\t\tconfig = require(configpath);\n\t} catch (error) {\n\t\t// If no config file is available, use default config:\n\t\tconfig = getDefaultConfig();\n\t}\n\t\n\tif (action == 'beautify') {\n\t\t// Remove sort order configuration:\n\t\tdelete config['sort-order'];\n\t}\n\t\n\tif (action == 'sort') {\n\t\t// Keep only sort order configuration:\n\t\tvar configSortOrder = config['sort-order'];\n\t\tconfig = {};\n\t\tconfig['sort-order'] = configSortOrder;\n\t}\n\n\t// Allow setting eof-newline option from command line\n\tif (eofNewline === false) {\n\t\tconfig['eof-newline'] = undefined;\n\t} else if (eofNewline === true) {\n\t\tconfig['eof-newline'] = true;\n\t}\n\t\n\treturn config;\n}", "function _applyConfigDefaults(config) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__core_util_object_extend__[\"a\" /* extendObject */])(new __WEBPACK_IMPORTED_MODULE_2__snack_bar_config__[\"a\" /* MdSnackBarConfig */](), config);\n}", "extend(config, ctx) { }", "extend(config, ctx) { }", "extend(config, ctx) { }", "extend(config, ctx) { }", "extend(config, ctx) { }", "extend(config, ctx) { }", "extend(config, ctx) {}", "extend(config, ctx) {}" ]
[ "0.6103762", "0.5995827", "0.59254086", "0.58840877", "0.5857223", "0.5810362", "0.57954615", "0.575109", "0.5693987", "0.566224", "0.5651829", "0.5620182", "0.55713636", "0.5534196", "0.5529791", "0.5519509", "0.5496052", "0.5459381", "0.5455807", "0.5424215", "0.54218477", "0.53964764", "0.5381565", "0.535852", "0.5357556", "0.5336725", "0.5322462", "0.53057075", "0.52986574", "0.52941245", "0.5265353", "0.5243839", "0.52245617", "0.5219386", "0.52131325", "0.5208245", "0.5187398", "0.5175471", "0.5162441", "0.51483756", "0.514399", "0.51402086", "0.512858", "0.5119886", "0.5112397", "0.5109509", "0.5104398", "0.5081606", "0.5081097", "0.50770575", "0.50572854", "0.503631", "0.50255257", "0.502014", "0.5015204", "0.5011354", "0.50050014", "0.500388", "0.49919373", "0.49915665", "0.4979537", "0.49639246", "0.49618307", "0.49610358", "0.49587145", "0.49539798", "0.49470243", "0.49407426", "0.49288046", "0.4928531", "0.49219507", "0.49217093", "0.49203128", "0.49185205", "0.49184406", "0.49164364", "0.49109253", "0.49047714", "0.48984656", "0.4891461", "0.4884091", "0.48766154", "0.4871354", "0.48706102", "0.48676196", "0.4857085", "0.48522502", "0.48485696", "0.48471078", "0.48421583", "0.48404253", "0.4837692", "0.48356825", "0.48356825", "0.48356825", "0.48356825", "0.48356825", "0.48356825", "0.48278552", "0.48278552" ]
0.6128931
0
Create default command config for quick serving and merge any extra config provided into it.
function createServeConfig(args, options) { let { commandConfig: extraConfig = {}, defaultTitle, renderShim, renderShimAliases } = options; let entry = _path2.default.resolve(args._[1]); let dist = _path2.default.resolve(args._[2] || 'dist'); let mountId = args['mount-id'] || 'app'; let config = { babel: { stage: 0 }, output: { filename: 'app.js', path: dist, publicPath: '/' }, plugins: { html: { mountId, title: args.title || defaultTitle } } }; if (args.force === true || renderShim == null) { config.entry = [entry]; } else { config.entry = [renderShim]; config.plugins.define = { NWB_QUICK_MOUNT_ID: JSON.stringify(mountId) }; config.resolve = { alias: _extends({ // Allow the render shim module to import the provided entry module 'nwb-quick-entry': entry }, renderShimAliases) }; } if (args.polyfill === false || args.polyfills === false) { config.polyfill = false; } return (0, _webpackMerge2.default)(config, extraConfig); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mergeOptions() {\n\t\tthis.config = _.defaultsDeep(this.configFile, ServiceBroker.defaultOptions);\n\n\t\tthis.config = this.overwriteFromEnv(this.config);\n\n\t\tif (this.flags.silent) this.config.logger = false;\n\n\t\tif (this.flags.hot) this.config.hotReload = true;\n\n\t\t// console.log(\"Merged configuration\", this.config);\n\t}", "function CustomCommandsConfig() {\n return _super.call(this) || this;\n }", "function configureRuntime () {\n return (\n build()\n // Brand is used for default config files (if any).\n .brand(BRAND)\n // The default plugin is the directory we're in right now, so\n // the commands sub-directory will contain the first right of\n // refusal to handle user's requests.\n .loadDefault(__dirname)\n // TODO: maybe there's other places you'd like to load plugins from?\n // .load(`~/.${BRAND}`)\n\n // These are the magic tokens found inside command js sources\n // which plugin authors use to specify the command users can type\n // as well as the help they see.\n .token('commandName', `${BRAND}Command`)\n .token('commandDescription', `${BRAND}Description`)\n // let's build it\n .createRuntime()\n )\n}", "function commandConfig(cliParams, configGenerator, helper, userConfigFlag) {\n\n // switch the number of sub-commands\n switch (cliParams.slice(1).length) {\n\n case 0:\n // list all config options\n console.log(userConfigFlag ? '** not yet implemented for userconfig **' : configGenerator.list());\n break;\n\n case 1:\n // list config option specified in first sub-command\n console.log(userConfigFlag ? '** not yet implemented for userconfig **' : configGenerator(cliParams[1]));\n break;\n\n case 2:\n // if first sub-command is `remove` then remove from config, key specified in second sub-command\n // else set key/value as first/second sub-command\n if (cliParams[1] === 'remove') {\n helper.promptYesNo('Are you sure you want to write new config to disk? [Yn]', function () {\n configGenerator(cliParams[2], null, userConfigFlag);\n }, helper.chalk.red('aborted config change'), 'y');\n } else {\n helper.promptYesNo('Are you sure you want to write new config to disk? [Yn]', function () {\n configGenerator(cliParams[1], cliParams[2], userConfigFlag);\n }, helper.chalk.red('aborted config change'), 'y');\n }\n break;\n }\n }", "extend(config, ctx) {\n config.node = {\n console: true,\n fs: 'empty',\n net: 'empty',\n tls: 'empty',\n }\n }", "function createConfig(cfg) {\n\tconfig = cfg;\n\n\tconfig.nitro = extend(true, {\n\t\tview_directory: path.normalize(config.base_path + '/views'),\n\t\tview_file_extension: 'html',\n\t\tview_partials_directory: path.normalize(config.base_path + '/views/_partials'),\n\t\tview_data_directory: path.normalize(config.base_path + '/views/_data'),\n\t\thelpers_directory: path.normalize(config.base_path + '/project/helpers/')\n\t}, config.nitro);\n\n\treturn config;\n}", "function defaultConfig() {\n return {\n features: [\n /* {\n name: 'api',\n flag: false,\n implementations: ['fixtures', 'mock-server']\n } */\n ]\n }\n}", "get defaultOptions() {\n return defaults(\n {},\n get(this, 'projectConfig'),\n result(this.constructor, 'defaultOptions'),\n // Find some way to be able to inject ARGV in projects which consume skypager via webpack\n global.SKYPAGER_ARGV,\n global.ARGV\n )\n }", "function getCommand() {\n return {\n instance : {\n config : {\n }\n }\n };\n}", "function getConfig() {\n\tconst home = os.homedir();\n\tconst currentPath = process.cwd();\n\n\tconst globalOverrides = requireOptional(\n\t\t`/${home}/.new-component-config.json`\n\t);\n\n\tconst localOverrides = requireOptional(\n\t\t`/${currentPath}/.new-component-config.json`\n\t);\n\n\treturn {\n\t\t...defaults,\n\t\t...globalOverrides,\n\t\t...localOverrides,\n\t};\n}", "function buildAppConfiguration({\n auth,\n broker,\n cache,\n system,\n telemetry\n}) {\n const systemOptions = {\n ...DEFAULT_SYSTEM_OPTIONS,\n networkClient: new HttpClient(system == null ? void 0 : system.proxyUrl, system == null ? void 0 : system.customAgentOptions),\n loggerOptions: (system == null ? void 0 : system.loggerOptions) || DEFAULT_LOGGER_OPTIONS\n };\n return {\n auth: {\n ...DEFAULT_AUTH_OPTIONS,\n ...auth\n },\n broker: {\n ...broker\n },\n cache: {\n ...DEFAULT_CACHE_OPTIONS,\n ...cache\n },\n system: {\n ...systemOptions,\n ...system\n },\n telemetry: {\n ...DEFAULT_TELEMETRY_OPTIONS,\n ...telemetry\n }\n };\n}", "loadCustomConfig() {\n try {\n const config = require(`${process.cwd()}/config/server.js`) || {};\n\n this._config = merge.all([this._config, config]);\n } catch (err) {\n if (!err.code || err.code !== 'MODULE_NOT_FOUND') {\n throw err;\n }\n }\n }", "static getExtraConfig () {\n return {}\n }", "function get_config() {\n // This is a placeholder, obtaining values from command line options.\n // Subsequent developments may access a configuration file\n // and extract an initial default configuration from that.\n //\n // See also: https://nodejs.org/api/process.html#process_process_env\n if (program.debug) {\n meld.CONFIG.debug = program.debug;\n } \n if (program.verbose) {\n meld.CONFIG.verbose = program.verbose;\n } \n if (program.author) {\n meld.CONFIG.author = program.author;\n } \n if (program.baseurl) {\n meld.CONFIG.baseurl = program.baseurl;\n }\n if (program.stdinurl) {\n meld.CONFIG.stdinurl = program.stdinurl;\n }\n}", "async generateDefaults () {\n const pkg = (await common.readMetadata(this.userSupplied)) || {}\n const modules = []\n if (await this.requiresSandboxWrapper()) {\n modules.push({\n name: 'zypak',\n sources: [\n {\n type: 'git',\n url: 'https://github.com/refi64/zypak',\n tag: 'v2021.02'\n }\n ]\n })\n }\n this.defaults = {\n ...common.getDefaultsFromPackageJSON(pkg),\n ...(await this.determineBaseRuntimeAndSDK()),\n id: getAppID(pkg.name, common.getHomePage(pkg)),\n extraFlatpakBuilderArgs: [],\n finishArgs: [\n // X Rendering\n '--socket=x11', '--share=ipc',\n // OpenGL\n '--device=dri',\n // Audio output\n '--socket=pulseaudio',\n // Read/write home directory access\n '--filesystem=home',\n // Chromium uses a socket in tmp for its singleton check\n '--env=TMPDIR=/var/tmp',\n // Allow communication with network\n '--share=network',\n // System notifications with libnotify\n '--talk-name=org.freedesktop.Notifications'\n ],\n modules,\n\n icon: path.resolve(__dirname, '../resources/icon.png'),\n files: [],\n symlinks: []\n }\n\n return this.defaults\n }", "static get defaultOptions() {\n return mergeObject(super.defaultOptions, {\n id: \"soundscape_soundConfig\",\n title: \"Soundscape: \"+game.i18n.localize(\"SOUNDSCAPE.SoundConfig\"),\n template: \"./modules/soundscape/src/Channels/soundConfig.html\"\n });\n }", "function setDefaultConfig(data) {\n var initialValue = {\n \"buttonHasText\": true,\n \"openAtStart\": true,\n \"welcomeMessageStatus\": true,\n \"welcomeText\": \"Hi there! Do you want to have a chat widget like this? It's so easy and customisable! So, come on have a chat with us! \",\n \"welcomeTimeout\": \"3\",\n \"buttonHasIcon\": true,\n \"buttonIcon\": 'https://s3-ap-southeast-1.amazonaws.com/qiscus-sdk/public/qismo/img/icon-qiscus-widget-default.svg',\n \"qismoBaseUrl\": (options.staging) ? '//qismo-stag.qiscus.com' : '//qismo.qiscus.com',\n };\n if(!window.qismoConfig) window.qismoConfig = {};\n if(options) window.qismoConfig = Object.assign({}, qismoConfig, options);\n attachEventListenerChat()\n if(!data) {\n qismoConfig = Object.assign({}, initialValue, qismoConfig);\n return qismoConfig;\n }\n Object.keys(data.variables).forEach(function(key) {\n qismoConfig[key] = data.variables[key];\n });\n }", "commonOptions() {\n let config = this.config;\n let cmd = [];\n\n if (config.datadir) {\n cmd.push(`--datadir=${config.datadir}`);\n }\n\n if (Number.isInteger(config.verbosity) && config.verbosity >= 0 && config.verbosity <= 5) {\n switch (config.verbosity) {\n case 0:\n cmd.push(\"--lvl=crit\");\n break;\n case 1:\n cmd.push(\"--lvl=error\");\n break;\n case 2:\n cmd.push(\"--lvl=warn\");\n break;\n case 3:\n cmd.push(\"--lvl=info\");\n break;\n case 4:\n cmd.push(\"--lvl=debug\");\n break;\n case 5:\n cmd.push(\"--lvl=trace\");\n break;\n default:\n cmd.push(\"--lvl=info\");\n break;\n }\n }\n\n return cmd;\n }", "function configuration(override) {\n var res = __assign({}, exports.DefaultConfig);\n if (override.src)\n Object.assign(res.src, override.src);\n if (override.dest)\n Object.assign(res.dest, override.dest);\n if (override.bundle)\n Object.assign(res.bundle, override.bundle);\n if (override.page) {\n if (override.page.title)\n Object.assign(res.page.title, override.page.title);\n if (override.page.favicon)\n res.page.favicon = override.page.favicon;\n if (override.page.meta)\n res.page.meta = override.page.meta;\n if (override.page.fonts)\n res.page.fonts = override.page.fonts;\n if (override.page.scripts)\n res.page.scripts = override.page.scripts;\n if (override.page.stylesheets)\n res.page.stylesheets = override.page.stylesheets;\n if (override.page.post)\n res.page.post = override.page.post;\n }\n if (override.dev)\n Object.assign(res.dev, override.dev);\n if (override.theme)\n res.theme = override.theme;\n if (override.markdown) {\n Object.assign(res.markdown, override.markdown);\n if (override.markdown.customComponents)\n res.markdown.BlockQuote = marked_1.quotedComponents(override.markdown.customComponents);\n }\n if (override.tocMarkdown) {\n Object.assign(res.tocMarkdown, override.tocMarkdown);\n if (override.tocMarkdown.customComponents)\n res.markdown.BlockQuote = marked_1.quotedComponents(override.tocMarkdown.customComponents);\n }\n if (override.misc)\n res.misc = override.misc;\n return res;\n}", "_copyLaunchConfig () {\n let nodeAsg = objectExtend(\n {},this._template.Resources[`NodeLaunchConfig${this._versionString}`]);\n\n this._template.Resources[`${this._opts.Name}WorkerLaunchConfig${this._versionString}`] = nodeAsg;\n }", "async beforeRun() {\n this._super.apply(this, arguments);\n\n // try to read global options from `config/crowdin.js`\n let configOptions = {};\n let module = path.join(this.project.root, 'config', 'crowdin');\n\n try {\n configOptions = require(module);\n if (typeof configOptions === 'function') {\n configOptions = configOptions();\n }\n } catch (e) {\n // do nothing, ignore the config\n }\n\n // For all options that are specified in config/crowdin.js, set the value there to be the actual default value\n this.availableOptions.map((option) => {\n let normalizedName = stringUtil.camelize(option.name);\n let configOption = configOptions[normalizedName];\n\n if (configOption !== undefined) {\n option.default = configOption;\n return option;\n }\n\n return option;\n });\n\n await this._createTmpFolder(this._getTmpDir());\n }", "get configTemplate() {\n return {\n // The color is used for the `this.log()` function and also custom command help\n color: '1af463',\n // The optional icon to use with the `this.sendLocalMessage` function. If left blank, a default one will be used instead\n iconURL: 'https://i.ytimg.com/vi/KEkrWRHCDQU/maxresdefault.jpg'\n };\n }", "configure() {\n\t\tthrow new Error(\"Must override Command.configure\")\n\t}", "extend(config, {isDev, isClient}) {\n config.node = {\n fs: 'empty'\n }\n }", "function createBuildConfig(args, options) {\n let {\n commandConfig: extraConfig = {},\n defaultTitle,\n renderShim,\n renderShimAliases\n } = options;\n\n let entry = _path2.default.resolve(args._[1]);\n let dist = _path2.default.resolve(args._[2] || 'dist');\n let mountId = args['mount-id'] || 'app';\n\n let production = process.env.NODE_ENV === 'production';\n let filenamePattern = production ? '[name].[chunkhash:8].js' : '[name].js';\n\n let config = {\n babel: {\n stage: 0\n },\n devtool: 'source-map',\n output: {\n chunkFilename: filenamePattern,\n filename: filenamePattern,\n path: dist,\n publicPath: '/'\n },\n plugins: {\n html: {\n mountId,\n title: args.title || defaultTitle\n },\n // A vendor bundle can be explicitly enabled with a --vendor flag\n vendor: args.vendor\n }\n };\n\n if (renderShim == null || args.force === true) {\n config.entry = { app: [entry] };\n } else {\n // Use a render shim module which supports quick prototyping\n config.entry = { app: [renderShim] };\n config.plugins.define = { NWB_QUICK_MOUNT_ID: JSON.stringify(mountId) };\n config.resolve = {\n alias: _extends({\n // Allow the render shim module to import the provided entry module\n 'nwb-quick-entry': entry\n }, renderShimAliases)\n };\n }\n\n if (args.polyfill === false || args.polyfills === false) {\n config.polyfill = false;\n }\n\n return (0, _webpackMerge2.default)(config, extraConfig);\n}", "mergeDefaultConfigs() {\n\t\tthis.controlOptions = deepmerge( config.defaults, this.controlOptions, {\n\t\t\tarrayMerge: ( destination, source ) => source\n\t\t} );\n\n\t\tthis.baseConfig = $.extend( true, {}, this.controlOptions );\n\n\t\tthis.options.target = null;\n\t\tthis.controlOptions = deepmerge( this.controlOptions, this.options, {\n\t\t\tarrayMerge: ( destination, source ) => source\n\t\t} );\n\t}", "configureJava() {\n this.config.defaults(requiredConfig);\n }", "function getMasterConfig(defaultConfig, callback) {\n\texec(\"npm get medimage:configFile\", {\n\t\t\tmaxBuffer: 2000 * 1024 //quick fix\n\t\t}, (err, stdout, stderr) => {\n\t\t if (err) {\n\t\t\t// node couldn't execute the command\n\t\t\tconsole.log(\"There was a problem running the addon. Error:\" + err);\n\t\t\tcallback(err, \"\");\n\t\n\t\t } else {\n\t\t\t console.log(\"Stdout from command:\" + stdout);\n\t\t\t if((stdout != \"\")&&(!stdout.startsWith(\"undefined\"))) {\n\t\t\t \t callback(null, stdout.trim());\n\t\t\t \n\t\t\t } else {\n\t\t\t \t callback(\"Global not set\", null);\n\t\t\t \n\t\t\t }\t\t\n\t\t }\n\t});\t\t//End of the exec\n}", "function createDefaultConfig() {\n /* HACK: mocha runs tests in parellel, so we have to force ignoring of env variables\n by explicity setting all config items to be non-null */\n return {\n server: {},\n proxy: {\n gateway: {},\n forward: {\n '/api/': 'http://api.example.com',\n '/rewrite/v1/(.*)': 'http://rewrite.example.com/$1',\n '/rewrite/v2/(.*)/unwanted_token/(.*)': 'http://rewrite.example.com/$1/$2',\n '/junction/': 'http://www.example.com/subapp',\n '/remote-api/(.*)': 'https://api.example.biz/$1',\n '/foo/\\\\d+/bar': 'http://www.example.com/',\n '/user/(\\\\d+)/email/(\\\\S+)\\?(.*)': 'http://api.example.com/account?id=$1&email=$2&sort=asc',\n '/secure/': 'https://secure.example.com',\n '/dns-error/': 'https://notfound.example.com',\n '/pull/15/(.*)': 'https://authorization.example.com/$1'\n },\n headers: {\n 'X-Test-Header': 'John Doe',\n 'X-Test-Header-Function': function(req) {\n if (req.url === '/pull/15/token') {\n return 'Bearer 0123456789abcdef';\n }\n }\n }\n }\n };\n}", "function configure() {\n\n var rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n // Grab the user's API keys for Stormpath and FullContact, then store them in\n // the configuration file.\n async.waterfall([\n function(cb) {\n mkdirp(CONFIG_DIR, function(err, made) {\n if (err) {\n cb(new Error(\"ERROR: Can't create configuration directory:\", CONFIG_DIR));\n }\n cb();\n });\n },\n function(cb) {\n rl.question(\"Enter your Stormpath API Key ID: \", function(id) {\n cb(null, id.trim());\n });\n },\n function(id, cb) {\n rl.question(\"Enter your Stormpath API Key Secret: \", function(secret) {\n cb(null, id, secret.trim());\n });\n },\n function(id, secret, cb) {\n rl.question(\"Enter your FullContact API Key: \", function(key) {\n cb(null, id, secret, key.trim());\n });\n },\n function(id, secret, key, cb) {\n fs.writeFile(CONFIG_FILE, JSON.stringify({\n stormpath_api_key_id: id,\n stormpath_api_key_secret: secret,\n fullcontact_api_key: key,\n }, null, 2), function(err) {\n if (err) {\n console.log(\"ERROR: Can't write configuration file:\", CONFIG_FILE);\n cb(err);\n }\n cb();\n });\n },\n ], function(err) {\n rl.close();\n });\n\n}", "function config(opts = process.env, _prefix = 'fuel_v1_', noresolution = false) {\n const network = opts.network || opts[_prefix + 'network'];\n const resolve = key => noresolution\n ? opts[key]\n : (opts[_prefix + network + '_' + key] || opts[_prefix + 'default_' + key]);\n\n // local provider\n const provider = opts.provider || ethers.getDefaultProvider(network, {\n infura: resolve('infura'),\n });\n\n // return config object\n return {\n archive: true,\n rootLengthTarget: opts.rootLengthTarget,\n produce: opts.produce,\n minimumTransactionsPerRoot: opts.minimumTransactionsPerRoot || 0,\n emit: () => {}, // emmitter for new outputs\n console: console,\n continue: opts.continue,\n network: utils.getNetwork(network),\n gasPrice: () => Promise.resolve('0x12a05f2000'), // 80 gwei\n gas_limit: 4000000, // default gas limit\n confirmations: 0, // required block confirmations\n block_time: 0, // 13 * 1000,\n db: database(copy(memdown(), memdown())),\n contract: opts.contract || {}, // new ethers.Contract(opts.contract || v1[network], abi.Fuel, provider), // selected Fuel contract object\n provider, // provider object\n operators: opts.operators || [], // 0 is main operator, the rest are for root deployment\n };\n}", "static get defaultOptions() {\n return mergeObject(super.defaultOptions, {\n id: \"userPermissionConfig\",\n title: \"Material Deck: \"+game.i18n.localize(\"MaterialDeck.Sett.Permission\"),\n template: \"./modules/MaterialDeck/templates/userPermissionConfig.html\",\n width: 660,\n height: \"auto\",\n scrollY: [\".permissions-list\"],\n });\n }", "extend (config, { isClient }) {\n }", "extend(config, { isDev, isClient }) {\n // if (!isDev) {\n // config.output.publicPath = './../_nuxt/'\n // }\n }", "static get defaultOptions() {\n let settings = {classes: [\"mysystem\", \"sheet\", \"actor\"],\n height: 880,\n template: \"systems/mysystem/templates/sheets/character_sheet.html\"};\n\n return(mergeObject(super.defaultOptions, settings));\n }", "function defaultSettings() {\n const data = {\n nullable: {\n inputs: true,\n outputs: true,\n },\n generateGraphQLSDLFile: 'api.graphql',\n rootTypingsGlobPattern: './**/*.ts',\n connections: {\n // there is another level of defaults that will be applied by Nexus Schema Relay Connections plugin\n default: Object.assign({}, connectionPluginConfigManagedByNexus),\n },\n authorization: {},\n };\n return data;\n}", "function getDefaultNomicLabsConfig(){\n const logger = process.env.SILENT ? { log: () => {} } : console;\n const reporter = process.env.SILENT ? 'dot' : 'spec';\n\n const mockwd = path.join(process.cwd(), temp);\n const vals = {\n paths : {\n root: mockwd,\n artifacts: path.join(mockwd, 'artifacts'),\n cache: path.join(mockwd, 'cache'),\n sources: path.join(mockwd, 'contracts'),\n tests: path.join(mockwd, 'test'),\n },\n logger: logger,\n mocha: {\n reporter: reporter\n },\n networks: {\n development: {\n url: \"http://127.0.0.1:8545\",\n }\n }\n }\n\n return vals;\n}", "includeConfigOption(context, prevArgv) {\n const { primaryDriver } = context;\n const configPath = context.findConfigByName(primaryDriver.metadata.configName);\n const argv = [...prevArgv];\n if (configPath && primaryDriver.metadata.configOption) {\n argv.push(primaryDriver.metadata.configOption, configPath.path.path());\n }\n this.debug('Including config option to args');\n return argv;\n }", "extend(_config, _ctx) {}", "_initializeDefaultSettings(settings) {\r\n for (let name in argvOptions) {\r\n let option = argvOptions[name];\r\n\r\n let realName = name;\r\n if (option.name) {\r\n realName = option.name;\r\n }\r\n\r\n if (!_.has(settings, realName)) {\r\n if (realName == 'paths') {\r\n settings['paths'] = { '' : path.resolve('') };\r\n }\r\n else if (_.has(option, 'default')) {\r\n settings[realName] = option['default'];\r\n }\r\n else if (option.type == 'flag') {\r\n // Flags default to false\r\n settings[realName] = false;\r\n }\r\n else if (option.type == 'array') {\r\n settings[realName] = [];\r\n }\r\n }\r\n }\r\n }", "function config(k, v, _argc) {\n if ( (_argc = arguments.length) == 1 ) {\n \tif(isObject(k)){\n \t\t_configs = extend(TRUE, _configs,k)\n \t} else {\n var r = _configs;\n split(k, function(_, it){\n r = r && r[it];\n }, '.')\n return r;\n }\n } else if (_argc == 0){\n \treturn _configs\n } else if (isObject(v)) {\n _configs[k] = extend(TRUE, _configs[k] || {}, v)\n } else {\n _configs[k] = v\n }\n}", "function getDefaultConfig() {\n return config;\n}", "function CreateLaunchConfigurationCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }", "extendCli (cli) {\n cli\n .command('metadata <targetDir> [...inputPaths]', 'Generate required metadata for the API reference docs')\n .option('-o <dir>', 'Output directory. Defaults to <targetDir>/api/')\n .action(async (targetDir, inputPaths, options) => {\n if (inputPaths.length === 0) {\n throw new Error('Please specify at least one path to a folder containing API docs.')\n }\n\n const outputPath = options.o ? path.resolve(options.o) : path.resolve(context.sourceDir, 'api')\n const docgenMainScript = require.resolve('titanium-docgen')\n const command = [\n 'node',\n docgenMainScript,\n '-f', 'json-raw',\n inputPaths.shift(),\n ...inputPaths.reduce((acc, cur) => {\n acc.push('-a', cur)\n return acc\n }, []),\n '-o', outputPath\n ]\n logger.wait('Generating API metadata file...')\n try {\n logger.debug(`Running command ${command.join(' ')}`)\n await execAsync(command.join(' '))\n logger.success(`Done! Metadata file generated to ${path.join(outputPath, 'api.json')}`)\n } catch (e) {\n logger.error('Failed to generate API metadata.')\n throw e\n }\n })\n }", "function initConfig(N) {\n // set application environment\n N.environment = process.env.NODECA_ENV || N.config.env_default || 'development';\n\n // do global expansion first\n // merge `^all` branch\n if (N.config['^all']) {\n mergeConfigs(N.config, N.config['^all']);\n delete N.config['^all'];\n }\n\n // expand environment-dependent configs\n _.forEach(N.config, (val, key) => {\n if (key[0] === '^') {\n delete N.config[key];\n\n if (N.environment === key.substr(1)) {\n mergeConfigs(N.config, val);\n }\n }\n });\n\n //\n // Post-process config.\n //\n N.config.options = N.config.options || {};\n}", "extend (config, ctx) {}", "async configuring () {\n await require('./actions/config')(this)\n }", "function doSetup() {\n\tconst path = (...paths) => require('path').join(__dirname, ...paths);\n\tconst TLog = require('@tycrek/log');\n\tconst fs = require('fs-extra');\n\tconst prompt = require('prompt');\n\tconst token = require('./generators/token');\n\n\tconst log = new TLog({ level: 'debug', timestamp: { enabled: false } });\n\n\t// Override default configs with existing configs to allow migrating configs\n\t// Now that's a lot of configs!\n\ttry {\n\t\tconst existingConfig = require('./config.json');\n\t\tObject.entries(existingConfig).forEach(([key, value]) => {\n\t\t\tObject.prototype.hasOwnProperty.call(config, key) && (config[key] = value); // skipcq: JS-0093\n\t\t\tObject.prototype.hasOwnProperty.call(s3config, key) && (s3config[key] = value); // skipcq: JS-0093\n\t\t\tObject.prototype.hasOwnProperty.call(oldConfig, key) && (oldConfig[key] = value); // skipcq: JS-0093\n\t\t});\n\t} catch (ex) {\n\t\tif (ex.code !== 'MODULE_NOT_FOUND' && !ex.toString().includes('Unexpected end')) log.error(ex);\n\t}\n\n\t// Disabled the annoying \"prompt: \" prefix and removes colours\n\tprompt.message = '';\n\tprompt.colors = false;\n\tprompt.start();\n\n\t// Schema for setup prompts\n\tconst setupSchema = {\n\t\tproperties: {\n\t\t\thost: {\n\t\t\t\tdescription: 'Local IP to bind to',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.host,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tport: {\n\t\t\t\tdescription: 'Port number to listen on',\n\t\t\t\ttype: 'integer',\n\t\t\t\tdefault: config.port,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tdomain: {\n\t\t\t\tdescription: `Domain name to send to ShareX clients (example: ${config.domain})`,\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tmessage: 'You must input a valid domain name or IP to continue'\n\t\t\t},\n\t\t\tmaxUploadSize: {\n\t\t\t\tdescription: `Maximum size for uploaded files, in megabytes`,\n\t\t\t\ttype: 'integer',\n\t\t\t\tdefault: config.maxUploadSize,\n\t\t\t\trequire: false\n\t\t\t},\n\t\t\tisProxied: {\n\t\t\t\tdescription: 'Will you be running through a reverse proxy',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: config.isProxied,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tuseSsl: {\n\t\t\t\tdescription: 'Use HTTPS (must be configured with reverse proxy)',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: config.useSsl,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tresourceIdSize: {\n\t\t\t\tdescription: 'URL length (length of ID\\'s for your files, recommended: 6-15. Higher = more uploads, but longer URLs)',\n\t\t\t\ttype: 'integer',\n\t\t\t\tdefault: config.resourceIdSize,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tresourceIdType: {\n\t\t\t\tdescription: 'URL type (can be one of: zws, random, gfycat, original)',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.resourceIdType,\n\t\t\t\trequire: false,\n\t\t\t\tpattern: /(original|zws|random|gfycat)/gi, // skipcq: JS-0113\n\t\t\t\tmessage: 'Must be one of: zws, random, gfycat, original'\n\t\t\t},\n\t\t\tspaceReplace: {\n\t\t\t\tdescription: 'Character to replace spaces in filenames with (must be a hyphen -, underscore _, or use ! to remove spaces)',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.spaceReplace,\n\t\t\t\trequired: false,\n\t\t\t\tpattern: /^[-_!]$/gim,\n\t\t\t\tmessage: 'Must be a - , _ , or !'\n\t\t\t},\n\t\t\tgfyIdSize: {\n\t\t\t\tdescription: 'Adjective count for \"gfycat\" URL type',\n\t\t\t\ttype: 'integer',\n\t\t\t\tdefault: config.gfyIdSize,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tmediaStrict: {\n\t\t\t\tdescription: 'Only allow uploads of media files (images, videos, audio)',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: config.mediaStrict,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tviewDirect: {\n\t\t\t\tdescription: 'View uploads in browser as direct resource, rather than a viewing page',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: config.viewDirect,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tdataEngine: {\n\t\t\t\tdescription: 'Data engine to use (must match an NPM package name. If unsure, leave blank)',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.dataEngine,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tfrontendName: {\n\t\t\t\tdescription: 'Name of your frontend (leave blank if not using frontends)',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.frontendName,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tindexFile: {\n\t\t\t\tdescription: 'Filename for your custom index, if using one (must be a JS file)',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.indexFile,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\ts3enabled: {\n\t\t\t\tdescription: 'Enable uploading to S3 storage endpoints',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: config.s3enabled,\n\t\t\t\trequired: false\n\t\t\t}\n\t\t}\n\t};\n\n\tconst s3schema = {\n\t\tproperties: {\n\t\t\ts3endpoint: {\n\t\t\t\tdescription: 'S3 Endpoint URL to upload objects to',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: s3config.s3endpoint,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\ts3bucket: {\n\t\t\t\tdescription: 'S3 Bucket name to upload objects to',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: s3config.s3bucket,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\ts3usePathStyle: {\n\t\t\t\tdescription: 'S3 path endpoint, otherwise uses subdomain endpoint',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: s3config.s3usePathStyle,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\ts3accessKey: {\n\t\t\t\tdescription: 'Access key for the specified S3 API',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: s3config.s3accessKey,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\ts3secretKey: {\n\t\t\t\tdescription: 'Secret key for the specified S3 API',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: s3config.s3secretKey,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t}\n\t};\n\n\t// Schema for confirm prompt. User must enter 'y' or 'n' (case-insensitive)\n\tconst confirmSchema = getConfirmSchema('\\nIs the above information correct? (y/n)');\n\n\tlog.blank().blank().blank().blank()\n\t\t.info('<<< ass setup >>>').blank();\n\tlet results = {};\n\tprompt.get(setupSchema)\n\t\t.then((r) => results = r) // skipcq: JS-0086\n\n\t\t// Check if using S3\n\t\t.then(() => results.s3enabled ? prompt.get(s3schema) : s3config) // skipcq: JS-0229\n\t\t.then((r) => Object.entries(r).forEach(([key, value]) => results[key] = value)) // skipcq: JS-0086\n\n\t\t// Verify information is correct\n\t\t.then(() => log\n\t\t\t.blank()\n\t\t\t.info('Please verify your information', '\\n'.concat(Object.entries(results).map(([setting, value]) => `${' '}${log.chalk.dim.gray('-->')} ${log.chalk.bold.white(`${setting}:`)} ${log.chalk.white(value)}`).join('\\n')))\n\t\t\t.blank())\n\n\t\t// Apply old configs\n\t\t.then(() => Object.entries(oldConfig).forEach(([setting, value]) => (typeof results[setting] === 'undefined') && (results[setting] = value)))\n\n\t\t// Confirm\n\t\t.then(() => prompt.get(confirmSchema))\n\t\t.then(({ confirm }) => (confirm ? fs.writeJson(path('config.json'), results, { spaces: 4 }) : log.error('Setup aborted').callback(process.exit, 1)))\n\n\t\t// Other setup tasks\n\t\t.then(() => {\n\n\t\t\t// Make sure auth.json exists and generate the first key\n\t\t\tif (!fs.existsSync(path('auth.json')) || fs.readFileSync(path('auth.json')).length < 8) {\n\t\t\t\tlet users = {};\n\t\t\t\tusers[token()] = { username: 'ass', count: 0 };\n\t\t\t\tfs.writeJsonSync(path('auth.json'), { users }, { spaces: 4 });\n\t\t\t\tlog.debug('File created', 'auth.json')\n\t\t\t\t\t.success('!! Important', `Save this token in a secure spot: ${Object.keys(users)[0]}`)\n\t\t\t\t\t.blank();\n\t\t\t}\n\n\t\t\tlet existingData = {}\n\t\t\ttry {\n\t\t\t\texistingData = fs.readJsonSync(path('data.json'));\n\t\t\t} catch (ex) {\n\t\t\t\tlog.warn('data.json', 'File empty, fixing')\n\t\t\t}\n\n\t\t\t// All 3 as a Promise.all\n\t\t\treturn Promise.all([\n\t\t\t\tfs.ensureDir(path('share')),\n\t\t\t\tfs.ensureDir(path(results.diskFilePath, 'thumbnails')),\n\t\t\t\tfs.writeJson(path('data.json'), existingData, { spaces: 4 })\n\t\t\t]);\n\t\t})\n\n\t\t// Complete & exit\n\t\t.then(() => log.blank().success('Setup complete').callback(() => process.exit(0)))\n\t\t.catch((err) => log.blank().error(err));\n}", "function default_1(config, baseConfig) {\n return {\n dist: path_1.default.resolve(config.dtsDir, 'index.d.ts'),\n content: `export * from '${baseConfig.framework}';\\n` +\n 'export as namespace Egg;\\n',\n };\n}", "function sampleConfig() {\n return \"\\\n---\\n\\\n# Configuration sample file for Jingo (YAML)\\n\\\napplication:\\n\\\n title: \\\"CartoWiki\\\"\\n\\\nserver:\\n\\\n hostname: \\\"localhost\\\"\\n\\\n port: 6067\\n\\\n localOnly: false\\n\\\n baseUrl: \\\"http://localhost:6067\\\"\\n\\\nauthentication:\\n\\\n google:\\n\\\n enabled: true\\n\\\n\ttwitter:\\n\\\n\t enabled: true\\n\\\n\t oauthkeys:\\n\\\n consumerKey : ''\\n\\\n consumerSecret : ''\\n\\\n cacheExpire: 3600000\\n\\\n\tfacebook:\\n\\\n\t enabled: true\\n\\\n\t oauthkeys:\\n\\\n clientID : ''\\n\\\n clientSecret : ''\\n\\\n alone:\\n\\\n enabled: false\\n\\\n username: \\\"\\\"\\n\\\n passwordHash: \\\"\\\"\\n\\\n email: \\\"\\\"\\n\\\ntwitterClient:\\n\\\n consumerKey : ''\\n\\\n consumerSecret : ''\\n\\\n accessTokenKey : ''\\n\\\n accessTokenSecret : ''\\n\\\n\";\n }", "function DefaultConfig() {\n return defaultConfig;\n}", "extend (config, ctx) { }", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}", "extend(config, ctx) {}" ]
[ "0.61444956", "0.59835136", "0.590307", "0.5881614", "0.5878789", "0.5798412", "0.5797724", "0.57779974", "0.5774831", "0.57666975", "0.5728066", "0.57263243", "0.5717967", "0.566221", "0.564617", "0.5633163", "0.5629365", "0.5624385", "0.55647796", "0.5557433", "0.55330676", "0.55233157", "0.54880035", "0.5484744", "0.54646146", "0.542724", "0.54216343", "0.5416268", "0.54119664", "0.54066837", "0.5399883", "0.5398009", "0.5386145", "0.5341176", "0.53408784", "0.53408", "0.5338917", "0.53251135", "0.5318288", "0.53153056", "0.53012323", "0.52867204", "0.5286206", "0.52859694", "0.5281836", "0.52637064", "0.5262447", "0.526212", "0.52525204", "0.5247102", "0.52316654", "0.5229569", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777", "0.5221777" ]
0.58796704
4
Run a quick development server, installing any required dependencies first if they're not resolvable.
function serve(args, appConfig, cb) { if (args._.length === 1) { return cb(new _errors.UserError('An entry module must be specified.')); } (0, _runSeries2.default)([cb => (0, _utils.install)(appConfig.getQuickDependencies(), { args, check: true }, cb), cb => (0, _webpackServer2.default)(args, createServeConfig(args, appConfig.getQuickServeConfig()), cb)], cb); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function start() {\n if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV);\n }\n await run(checkVersion);\n await run(runServer);\n}", "async function startServer() {\n await startDevServer({\n readCliArgs: false,\n readFileConfig: true\n });\n}", "async function $dev(argv: string[], options: Options) {\n const { \"--port\": port = 8000, \"--help\": help = false } = arg(\n { \"--port\": Number, \"--help\": Boolean },\n { argv }\n );\n\n if (help) {\n return console.log(`\nRun a local development server with hot reload support.\n\n--port Specify the port to run on (default: 8000)\n`);\n }\n\n const handler = await dev({\n root: options.root,\n src: options.src,\n publicDir: options.publicDir,\n });\n\n const server = createServer(handler);\n\n server.listen(port, () =>\n console.log(`Server running at http://localhost:${port}`)\n );\n\n return new Promise<void>((resolve, reject) => {\n server.once(\"error\", (err) => reject(err));\n server.once(\"close\", () => resolve());\n });\n}", "function serve(options) {\n // Set process.env.NODE_ENV to development\n process.env.NODE_ENV = 'development'; // Set process.env.BABEL_ENV to development\n\n process.env.BABEL_ENV = 'development'; // Get project and server config JSONs.\n\n const cwd = (0, _utils.resolveCWD)(options);\n\n const relCwd = _path.default.relative(process.cwd(), cwd); // For spinner\n\n\n const spinner = (0, _ora.default)({\n text: `initiating ${_utils.wpackLogoSmall} development server`,\n spinner: 'dots',\n color: 'yellow'\n });\n console.log(`${_logSymbols.default.success} ${_chalk.default.bold('startup')}: ${_chalk.default.cyan(relCwd === '' ? '.' : relCwd)}`);\n\n try {\n const {\n projectConfig,\n serverConfig,\n projectConfigPath,\n serverConfigPath\n } = (0, _getProjectAndServerConfig.getProjectAndServerConfig)(cwd, options);\n console.log(`${_logSymbols.default.success} ${_chalk.default.bold('project config')}: ${_chalk.default.cyan(_path.default.relative(cwd, projectConfigPath))}`);\n console.log(`${_logSymbols.default.success} ${_chalk.default.bold('server config')}: ${_chalk.default.cyan(_path.default.relative(cwd, serverConfigPath))}`);\n spinner.start();\n let lastWebpackStat = null; // Start the webpack/browserSync server\n\n const server = new _Server.Server(projectConfig, serverConfig, cwd, {\n // tslint:disable:no-empty\n invalid: () => {\n (0, _utils.printCompilingMessage)();\n },\n done: () => {\n (0, _utils.printSuccessfullyCompiledMessage)();\n },\n\n onWatching() {\n (0, _utils.printWatchingMessage)();\n },\n\n onError: msg => {\n (0, _utils.printErrorHeading)('ERROR');\n msg.errors.forEach(e => {\n console.log(e);\n console.log('');\n });\n (0, _utils.printFailedCompileMEssage)();\n },\n onWarn: msg => {\n (0, _utils.printWarningHeading)('WARNING');\n msg.warnings.forEach(e => {\n console.log(e);\n console.log('');\n });\n (0, _utils.printCompiledWithWarnMessage)();\n },\n onEmit: stats => {\n (0, _utils.printCompileTimeMessages)(stats, lastWebpackStat);\n lastWebpackStat = stats.toJson(_utils.webpackStatToJsonOptions);\n },\n firstCompile: stats => {\n spinner.stop();\n const raw = stats.toJson('verbose');\n const messages = (0, _formatWebpackMessages.default)(raw);\n console.log('');\n (0, _utils.serverInfo)(server.getServerUrl(), server.getBsUiUrl());\n console.log('');\n\n if (stats.hasErrors()) {\n (0, _utils.printErrorHeading)('ERROR');\n messages.errors.forEach(e => {\n console.log(e);\n console.log('');\n });\n (0, _utils.printFailedCompileMEssage)();\n } else if (stats.hasWarnings()) {\n (0, _utils.printWarningHeading)('WARNING');\n messages.warnings.forEach(e => {\n console.log(e);\n console.log('');\n });\n (0, _utils.printCompiledWithWarnMessage)();\n } else {\n (0, _utils.printSuccessfullyCompiledMessage)();\n }\n\n (0, _utils.printCompileTimeMessages)(stats, lastWebpackStat);\n lastWebpackStat = stats.toJson(_utils.webpackStatToJsonOptions);\n },\n\n onBsChange(file) {\n (0, _utils.printGeneralInfoMessage)(`changed: ${_chalk.default.bold(file)}`);\n (0, _utils.printGeneralInfoMessage)('reloading browser');\n },\n\n onTcStart() {\n (0, _utils.printGeneralInfoMessage)('waiting for typecheck results...');\n },\n\n onTcEnd(messages) {\n if (messages.errors.length || messages.warnings.length) {\n if (messages.errors.length) {\n (0, _utils.printErrorHeading)('TS ERROR');\n messages.errors.forEach(e => {\n console.log(e);\n console.log('');\n });\n }\n\n if (messages.warnings.length) {\n (0, _utils.printWarningHeading)('TS WARNING');\n messages.warnings.forEach(e => {\n console.log(e);\n console.log('');\n });\n }\n } else {\n (0, _utils.printGeneralInfoMessage)('no typecheck errors', _logSymbols.default.success);\n }\n }\n\n });\n server.serve();\n\n const stopServer = () => {\n console.log((0, _utils.addTimeStampToLog)(`${_logSymbols.default.warning} shutting down development server`));\n server.stop();\n console.log('');\n (0, _utils.endServeInfo)();\n console.log('');\n process.exit(0);\n }; // Listen for `r`\n\n\n if (process.stdin.setRawMode) {\n process.stdin.setRawMode(true);\n const {\n stdin\n } = process;\n stdin.setEncoding('utf8');\n stdin.on('data', key => {\n // ctrl-c ( end of text )\n // or if pressing q, then stop\n // then stop server\n if (key === '\\u0003' || key === 'q') {\n stopServer();\n } // If pressing r, then just refresh\n\n\n if (key.indexOf('r') === 0) {\n (0, _utils.printCompilingMessage)();\n server.refresh();\n }\n });\n } else {\n // Listen for SIGINT and quit properly\n process.on('SIGINT', () => {\n stopServer();\n });\n }\n } catch (e) {\n spinner.stop();\n (0, _utils.prettyPrintError)(e, 'could not start server.');\n process.exit(1);\n }\n}", "function startServer() {\n protocolDownloader\n .getSchemas()\n .catch(e => process.exit(1))\n .then(() => schemaParser.readSchemas())\n .then(() =>\n app.listen(port, () => console.log(`Server starting at port: ${port}!`))\n );\n}", "function startDev(options) {\n const externalCss = options.externalCss;\n const verbose = options.verbose;\n\n // Show some useful messaging\n console.info('😸 Hello! Hit Ctrl+C to exit at any time');\n\n if (externalCss) {\n console.info('-> External CSS linking is active');\n }\n\n if (verbose) {\n console.info('-> Verbose mode active');\n }\n\n // Start the webpack dev server\n watch({\n config: watchConfig,\n externalCss,\n verbose\n },\n function onReady(err) {\n if (err) {\n console.warn(error.stack);\n }\n else {\n // Spawn a new babel server process\n // \"piping\" will watch for changes and relaunch the server\n require('piping')({\n main: './webpack/babel-server-dev.js',\n hook: true,\n includeModules: false\n });\n }\n });\n}", "function startDevServer() {\n const WDS = require('webpack-dev-server');\n\n const wpConf = getWebpackConfig();\n\n // Need to update the app entry for webpack-dev-server. This is necessary for\n // the auto page refresh to happen. See: https://github.com/webpack/webpack-dev-server/blob/master/examples/node-api-simple/webpack.config.js\n const pathToWPDSClient = `${path.resolve(projectPath, 'node_modules/webpack-dev-server/client')}?http://localhost:8080`;\n\n Object.keys(wpConf.entry).forEach((key) => {\n if (Array.isArray(wpConf.entry[key])) {\n wpConf.entry[key] = wpConf.entry[key].map(val => path.resolve(projectPath, val));\n wpConf.entry[key].unshift(pathToWPDSClient);\n } else {\n wpConf.entry[key] = [\n pathToWPDSClient,\n path.resolve(projectPath, wpConf.entry[key]),\n ];\n }\n });\n\n devServer(createCompiler(wpConf), WDS);\n }", "function start (callback) {\n if (process.env.NODE_ENV === 'development') {\n console.log('Running in Dev mode.');\n callback('http://localhost:3000');\n } else {\n process.stdout.write('Starting production server\\n');\n\n var appPath = '',\n dataPath = '',\n bundlePath = '';\n if (os.platform() === 'darwin') {\n appPath = path.join(process.env.HOME, 'Library/Application Support/', appName, '/');\n dataPath = path.join(appPath, 'data');\n bundlePath = path.join(appPath, 'bundle');\n } else if (os.platform() === 'win32') {\n appPath = path.join(process.env.HOMEPATH, 'AppData/Local/', appName, '/');\n dataPath = path.join(appPath, 'data');\n bundlePath = path.join(appPath, 'bundle');\n } else if (os.platform() === 'linux') {\n appPath = path.join(process.env.HOME, '/.config/', appName, '/');\n dataPath = path.join(appPath, 'data');\n bundlePath = path.join(appPath, 'bundle');\n }\n\n // If file paths don't yet exist, create them\n if (!fs.existsSync(appPath)) {\n fs.mkdirSync(appPath);\n }\n\n if (!fs.existsSync(dataPath)) {\n fs.mkdirSync(dataPath);\n }\n\n if (!fs.existsSync(bundlePath)) {\n fs.mkdirSync(bundlePath);\n }\n\n freePort(function (err, webPort) {\n freePort(function (err, mongoPort) {\n console.log('MongoPort: ', mongoPort);\n console.log('WebPort: ', webPort);\n\n // Be sure to change the PURPOSE to be the name of your app\n var command = '';\n if (os.platform() === 'darwin' || os.platform === 'linux') {\n command = 'rm -rf ' + path.join(dataPath, 'mongod.lock');\n } else if (os.platform() === 'win32') {\n childProcess.exec('rm -rf ' + path.join(dataPath, 'mongod.lock'));\n }\n\n childProcess.exec(command, function (err, stdout, stderr) {\n\n // Path to mongod command bundled with app.\n var mongodPath = path.join(dirname, 'resources', 'mongod');\n\n // Arguments passed to mongod command.\n var mongodArgs = ['--bind_ip', '127.0.0.1', '--dbpath', dataPath, '--port', mongoPort, '--unixSocketPrefix', dataPath, '--smallfiles'];\n if (os.platform() === 'win32') {\n mongodArgs = ['--bind_ip', '127.0.0.1', '--dbpath', dataPath, '--port', mongoPort, '--smallfiles'];\n }\n\n // Start the Mongo process.\n var mongoChild = childProcess.spawn(mongodPath, mongodArgs, {\n env: {\n PURPOSE: 'MY_ELECTROMETEOR_APP'\n }\n });\n\n mongoChild.stderr.setEncoding('utf8');\n mongoChild.stderr.on('data', function (data) {\n console.log(data);\n });\n\n var started = false;\n mongoChild.stdout.setEncoding('utf8');\n mongoChild.stdout.on('data', function (data) {\n console.log(data);\n\n if (data.indexOf('waiting for connections on port ' + mongoPort)) {\n if (!started) {\n started = true;\n } else {\n return;\n }\n\n console.log('Starting node child...');\n var rootURL = 'http://localhost';\n var userEnv = process.env;\n userEnv.ROOT_URL = rootURL;\n userEnv.PORT = webPort;\n userEnv.BIND_IP = '127.0.0.1';\n userEnv.DB_PATH = dataPath;\n userEnv.MONGO_URL = 'mongodb://localhost:' + mongoPort + '/meteor';\n // user_env.METEOR_SETTINGS = fs.readFileSync(path.join(dirname, 'resources', 'settings.json'), 'utf8');\n userEnv.DIR = dirname;\n userEnv.NODE_ENV = 'production';\n userEnv.NODE_PATH = path.join(dirname, 'node_modules');\n\n var nodePath = path.join(dirname, 'resources', 'node');\n var nodeArgs = path.join(dirname, 'bundle', 'main.js');\n var nodeChild = childProcess.spawn(nodePath, [nodeArgs], {\n env: userEnv\n });\n\n var opened = false;\n\n // listen for errors\n nodeChild.stderr.setEncoding('utf8');\n nodeChild.stderr.on('data', function (nodeData) {\n console.log('stderr: ', nodeData);\n });\n\n nodeChild.stdout.setEncoding('utf8');\n nodeChild.stdout.on('data', function (nodeData) {\n console.log(nodeData);\n\n if (data.indexOf(!'Meteor app started.' === -1)) {\n if (!opened) {\n opened = true;\n } else {\n return;\n }\n\n setTimeout(function () {\n var fullURL = rootURL + ':' + webPort;\n callback(fullURL, nodeChild, mongoChild);\n }, 100);\n }\n });\n }\n });\n });\n });\n });\n }\n}", "async function serve() {\n createCtrlcHandler('serve');\n logServeMode();\n watch(serverFiles, restartServer);\n await startServer();\n await performPreBuildSteps();\n}", "function start() {\n execSync('npm install ' + remotePlugins);\n app.listen(DF.env.port);\n\n DF.isRoot = true;\n _getRemotePlugins(DF);\n _recursivePluginLoading(DF);\n}", "function server( done ) {\n browser.init({\n server: 'build'\n });\n done();\n}", "function startProd(options) {\n compile({\n config: prodConfig\n }, function onReady(err) {\n if (err) {\n console.warn(error.stack);\n }\n else {\n require('./babel-server.js')();\n }\n });\n}", "function startServer () {\n require('http').createServer(function (req, res) {\n req.addListener('end', function (e) {\n //\n // Serve files!\n //\n server.serve(req, res, function (resp) {\n if (resp && (resp.status === 404)) { // If the file wasn't found\n\n server.serveFile('/index.html', 302, resp.headers, req, res);\n }\n });\n });\n }).listen(8080);\n\n console.log('server now listening on port: 8080')\n}", "async function startClient() {\n\tconst entryFiles = resolve(__dirname, './index.html');\n\tconst options = {};\n\tconst bundler = new Bundler(entryFiles, options);\n\tawait bundler.serve(config.guiPort);\n}", "function startBuildServer() {\n const app = express();\n const root = path.join(__dirname, '../build');\n app.use(express.static(root));\n app.use(fallback('index.html', { root }));\n\n // Other files should not happen, respond 404\n app.get('*', (req, res) => {\n console.log('Warning: unknown req: ', req.path);\n res.sendStatus(404);\n });\n\n app.listen(pkgJson.rekit.buildPort, err => {\n if (err) {\n console.error(err);\n }\n\n console.log(`Dist server at http://localhost:${pkgJson.rekit.buildPort}/`);\n });\n}", "function dev(cb) {\n if (!util.isProd()) {\n startDev(cb());\n }\n}", "function serve() {\n var server = gls.static('dist/', PORT);\n //server.start();\n var promise = server.start();\n //optionally handle the server process exiting\n promise.then(function(result) {\n console.log('server started')\n openBrowser()\n });\n}", "function startServer() {\n\tserver = require(__dirname + '/NetworkServer');\n\tserver.startServer();\n}", "function startDevServer(complier, config) {\n const devServerArgs = config.devServer || {};\n // 启动http服务器,里面还会负责打包我们的项目并提供预览服务,通过它访问打包后的文件\n const server = new Server(complier, devServerArgs);\n const {port = 8080, host = 'localhost'} = devServerArgs;\n server.listen(port, host, (err) => {\n console.log(`自定义 => Project is running at http://${host}: ${port}`)\n })\n}", "async function startDevServer() {\n const options = {\n target: 'client',\n env: process.env.NODE_ENV || 'development',\n };\n const dllOptions = {\n target: 'client',\n env: process.env.NODE_ENV || 'development',\n };\n // get the vendor dll webpack configuration\n const dllConfig = dllConfigFactory(dllOptions, config);\n // obtain the compiler\n const dllCompiler = webpack(dllConfig);\n // wait the bundling finish\n await Promise.promisify(dllCompiler.run).bind(dllCompiler)();\n // get the webpack configuration for client\n const webpackConfig = configFactory(options, config);\n const { host, devPort } = options;\n // obtain the compiler\n const compiler = webpack(webpackConfig);\n // create the webpack dev server\n const serverOptions = {\n // the path of dev server\n contentBase: `http://${host}:${devPort}`,\n noInfo: true,\n silent: true,\n stats: 'errors-only',\n // the public path of the location of js\n publicPath: '/public/',\n // enable cross domain\n headers: { 'Access-Control-Allow-Origin': '*' },\n };\n const app = express();\n // no files are written to disk, it handle the files in memory\n app.use(devMiddleware(compiler, serverOptions));\n // works when hmr is enabled, enable module.hot\n app.use(hotMiddleware(compiler));\n\n function callback(err) {\n if (err) {\n console.error(err); // eslint-disable-line no-console\n } else {\n console.info('Webpack development server listening on port %s', devPort); // eslint-disable-line no-console\n }\n }\n // start the webpack-dev-server\n app.listen(devPort, callback);\n return app;\n}", "function server(done) {\n browser.init({\n server: PATHS.dist,\n port: PORT\n });\n done();\n}", "function server(done) {\n browser.init({\n server: PATHS.dist,\n port: PORT\n });\n done();\n }", "function startServer (done) {\n server = spawn('node', [path.join(process.cwd(), 'server')], {\n env: Object.assign({ NODE_ENV: 'test', PORT: process.env.PORT }, process.env),\n silent: false,\n });\n server.stdout.on('data', (data) => {\n process.stdout.write(data);\n done();\n });\n server.stderr.on('data', (error) => {\n process.stderr.write(error);\n done();\n });\n}", "function startServer (config, controller) {\n // TODO port will be required for multi-team auth\n if (config.port) {\n controller.setupWebserver(config.port)\n }\n}", "function server(done) {\n browser.init({\n server: PATHS.dist, port: PORT\n }, done);\n}", "function server(done) {\n browser.init({\n server: PATHS.dist,\n port: PORT,\n browser: \"iexplore\",\n reloadOnRestart: true,\n directory: true\n }, done);\n}", "function main() {\n const config = createConfig();\n const server = createServer(config);\n\n const {hostname, port} = config.getWebserverHost();\n console.error(`Starting rpi-clock webserver on ${hostname}:${port}`);\n server.listen(port, hostname);\n}", "function server(done) {\n nodemon({\n script: 'dist/app.js'\n , ext: 'js'\n , env: { 'NODE_ENV': 'development' }\n })\n done();\n}", "function start(){\n server = http.createServer(app).listen( config.port );\n logger.info((new Date()).toString()+ \":: PROJECT_NAME server listening on port::\", config.port, \", environment:: \", app.settings.env);\n}", "function devServer() {\n\n const express = require('express');\n const app = express();\n const http = require('http').Server(app);\n const dirDev = path.join(__dirname, '../dist');\n\n app.use(express.static(dirDev));\n\n // Route catch-all: redirects all server requests to ./dist/index.html\n app.get('/*', function(req, res) {\n res.sendFile(dirDev + '/index.html', function(err) {\n if (err) {\n res.status(500).send(err)\n }\n });\n });\n\n http.listen(3000, () => {\n console.info('\\x1b[37m', '🌎 Dev-Server: Listening on port 3000, open browser to http://localhost:3000/');\n });\n\n}", "function startStudioServer() {\n console.log('Starting Rekit Studio...');\n const app = express();\n const server = http.createServer(app);\n const root = path.join(__dirname, '../node_modules/rekit-studio/dist');\n app.use(rekitStudioMiddleWare()(server, app, { readonly: !!args.readonly }));\n app.use(express.static(root));\n app.use(fallback('index.html', { root }));\n\n // Other files should not happen, respond 404\n app.get('*', (req, res) => {\n console.log('Warning: unknown req: ', req.path);\n res.sendStatus(404);\n });\n\n const port = pkgJson.rekit.studioPort;\n server.listen(port, err => {\n if (err) {\n console.error(err);\n }\n\n console.log(`Studio server is listening at http://localhost:${port}/`);\n });\n}", "function server(done) {\n return connect.server({\n root: './',\n port: 8080,\n debug: true,\n });\n done();\n}", "function serve() {\n var http = require('http');\n http.createServer(function(req, res){\n fs.readFile(html_source, 'utf8', function(err, data) {\n if (err) {\n res.send(err);\n console.log(err);\n }\n res.end(data.toString());\n });\n }).listen(port);\n console.log(\"\\nRunning \".yellow + \"joy\".blue + \" development server\".yellow);\n console.log(\"http://127.0.0.1:1337\".green);\n console.log(\"Ctrl-C to Stop\\n\".green);\n}", "function main() {\n let cfg = loadConfig()\n startHttpServer(cfg)\n}", "function server(done) {\n browser.init({\n server: PATHS.dist,\n port: PORT,\n browser: \"google chrome\",\n cors: true,\n notify: false,\n open: false\n });\n done();\n}", "function server(done) {\n browser.init({\n server: {\n baseDir: \"./dist/\"\n }\n });\n done();\n}", "startFractalServer () {\n const server = fractal.web.server(this.generateServerSettings('fractal'))\n return server.start().then(() => {\n console.log(`Fractal server is now running at:\\nLocal: ${server.url}\\nExternal: ${server.urls.sync.external}\\nBS UI: ${server.urls.sync.ui}`)\n })\n }", "serve() {\n\t\tconst server = new Server(this);\n\t\tconst serverConfig = this._config.devServer;\n\n\t\tserver.logServer('/log');\n\n\t\tif (serverConfig.enableRawProxy) {\n\t\t\tserver.rawProxy('/proxy');\n\t\t}\n\n\t\tconst proxyMap = serverConfig.proxy;\n\t\tObject.keys(proxyMap)\n\t\t\t.forEach((path) => {\n\t\t\t\tserver.proxy(path, proxyMap[path]);\n\t\t\t});\n\n\t\tlet staticFiles = {};\n\t\tfor (const entity of this._config.include) {\n\t\t\tif (entity.static) {\n\t\t\t\tstaticFiles = Object.assign(staticFiles, entity.static);\n\t\t\t}\n\t\t}\n\n\t\tlogger.silly(`Serving static files: \\n${JSON.stringify(staticFiles, null, '\\t')}`);\n\n\t\tfor (const [customPath, filePath] of Object.entries(staticFiles)) {\n\t\t\tconst alias = `/${customPath.replace(/^\\//, '')}`;\n\t\t\tconst absolutePath = this._pathHelper.resolveAbsolutePath(filePath);\n\n\t\t\tif (fs.existsSync(absolutePath)) {\n\t\t\t\tserver.serveStatic(alias, absolutePath);\n\t\t\t} else {\n\t\t\t\tlogger.warn(`Can't serve static path ${kleur.green(alias)} from ${kleur.underline(absolutePath)}`);\n\t\t\t}\n\t\t}\n\n\t\tthis._codeSource.watch();\n\n\t\tserver.start(serverConfig.port)\n\t\t\t.then((addresss) => {\n\t\t\t\tlogger.output(`Server started at ${kleur.underline(addresss)}`);\n\t\t\t}, (err) => {\n\t\t\t\tlogger.error(`Error starting server: ${err.toString()}`);\n\t\t\t\tlogger.debug(err.stack);\n\t\t\t});\n\t}", "function startServer() {\n\tapp.serverInstance = server.listen(config.PORT, config.HOST, function() {\n\t\tlogger.info('Express server listening on %d, in %s mode...', config.PORT, config.ENV);\n\t});\n}", "function startServer() {\n const proxyApp = express();\n const webServer = require('http').createServer(proxyApp);\n const port = process.env.port || 3088;\n\n // set up routes and enable CORS\n proxyApp.use(cors())\n proxyApp.get('/api/cars', getCarOwners); \n const path = __dirname + '/../dist';\n console.log('Hosting server at http://localhost:' + port)\n if (fs.existsSync(path)) {\n const staticContent = express.static(path);\n proxyApp.use(staticContent);\n } else {\n proxyApp.get('/', (req, res, next) => {\n res.send('<h1>Applicaton not built and published</h1>')\n next();\n });\n }\n\n // local server for Dev acting as Proxy for original service\n webServer.listen(port, () => {\n successlog.info('CORS enabled proxy API server launched..');\n });\n}", "function startServer() {\n var defer = q.defer();\n\n var serverConfig = {\n server: {\n baseDir: wpath,\n directory: true\n },\n startPath: 'docs/index.html',\n // browser: \"google chrome\",\n logPrefix: 'SERVER'\n };\n browserSync.init(serverConfig, defer.resolve);\n\n return defer.promise;\n}", "async function performPreBuildSteps() {\n if (!argv._.includes('serve')) {\n await preBuildRuntimeFiles();\n await preBuildExtensions();\n }\n}", "function start (opts) {\n const port = opts.server\n const server = http.createServer(onRequest)\n server.listen(port, 'localhost', onListen)\n\n function onListen () {\n console.log(`${pkgJSON.name} starting on http://localhost:${port}`)\n }\n\n function onRequest (req, res) {\n handleRequest(opts, req, res)\n }\n}", "function serve() {\n var liveServer = require(\"live-server\");\n\n var params = {\n port: 8181, // Set the server port. Defaults to 8080.\n host: \"0.0.0.0\", // Set the address to bind to. Defaults to 0.0.0.0 or process.env.IP.\n open: false, // When false, it won't load your browser by default.\n watch: ['src','*.md'], // comma-separated string for paths to watch\n// ignore: '', // comma-separated string for paths to ignore\n file: \"index.html\", // When set, serve this file (server root relative) for every 404 (useful for single-page applications)\n wait: 1000, // Waits for all changes, before reloading. Defaults to 0 sec.\n logLevel: 2 // 0 = errors only, 1 = some, 2 = lots\n };\n liveServer.start(params);\n\n return watch(['./src/*.js','./src/*.css'], function() {\n css();\n js();\n });\n}", "function start() {\n console.log(\"server start . . .\");\n initialize();\n}", "function startExpress() {\n var express = require('express');\n var app = express();\n app.use(express.static(__dirname));\n app.listen(4000);\n}", "function server(done) {\n browser.init({\n server: 'email/dist'\n });\n done();\n}", "async function start () {\n\n\ttry {\n\t\t/*\n\t\t * Store basic inforamation about the application\n\t\t * for other modules to use */\n\t\t//args.name_pretty = 'Admin Dashboard';\n\t\t//args.desc = 'Mission control station';\n\n\t\t/*\n\t\t * Common startup file for all apss */\n\t\t//log = await startup.init(args);\n\t\t//await kv.get_and_store (`config/app/vc/`, { recurse : true });\n\n\t\t//log.info ({ args }, `starting app ${name} with arguments`);\n\n\t\trequire ('./www');\n\t}\n\tcatch (e) {\n\t\tconsole.error (colors.red ('fatal error : ') + e);\n\t\tif (e.stack)\n\t\t\tconsole.error (e.stack);\n\n\t\tprocess.exit (1);\n\t}\n}", "function server(done) {\r\n\tbrowser.init({\r\n\t\tproxy: CONF.BROWSERSYNC.url,\r\n\r\n\t\tui: {\r\n\t\t\tport: 8080\r\n\t\t},\r\n\r\n\t});\r\n\tdone();\r\n}", "async function start () {\n await app.initDB()\n app.initSocket()\n app.initMiddlewares()\n app.initSubApp()\n await app.initHttp()\n }", "start(done) {\n const host = process.env.HOST || \"localhost\"\n const port = process.env.PORT || 4000\n config.rootDir = rootDir // project folder\n config.dev = false // production build\n nuxt = new Nuxt(config)\n done()\n nuxt.listen(port, host)\n }", "function startHttpServer() {\n var server = http.createServer(httpRequestHandler);\n var port = program.port || httpRequestHandler.get('port');\n\n server.listen(port, function() {\n console.log('\\nPersonalization server listening on port ' + port);\n });\n}", "async function start() {\r\n await server.register(vision);\r\n //Defining the templating engine for handlebars\r\n server.views({\r\n engines: {\r\n html: require('handlebars')\r\n\r\n },\r\n relativeTo: __dirname\r\n });\r\n try {\r\n await server.start();\r\n }\r\n catch (err) {\r\n console.log(err);\r\n process.exit(1);\r\n }\r\n console.log('Server running at:', server.info.uri);\r\n\r\n}", "function server () {\n browserSync.init({\n server: {\n baseDir: `./${devDir}`,\n },\n })\n\n gulp.watch('src/*.html', html)\n gulp.watch('src/views/**/*.{yml,pug}', views)\n gulp.watch('src/scss/**/*.scss', styles)\n gulp.watch('src/js/**/*.js', scripts)\n gulp.watch('src/img/**/*', images)\n gulp.watch('src/fonts/**/*', fonts)\n gulp.watch('src/static/**/*', statics)\n gulp.watch('src/**/*').on('change', browserSync.reload)\n}", "function initdependencies(){\n process.spawnSync('npm',['install', '--save', 'express'], { cwd: './' });\n process.spawnSync('npm',['install', '--save', 'helmet'], { cwd: './' });\n}", "function startServer (config, onReady) {\n // Form a response\n var instance = {}\n var models = {}\n\n // Register models\n models.serverLog = serverLog\n models.serverDetails = serverDetails\n models.routes = routesModel\n models.plugins = pluginsModel\n models.preflight = preflightModel\n\n // Capture console\n serverLog.capture()\n\n // Create server\n var server = express()\n\n // Load default for conig\n config = defaultConfig.merge(config)\n config.server = server\n config.models = models\n\n // Register a static reference in serverDetails\n serverDetails.instance = instance\n\n // Report server name\n const title = config.productInformation.title\n console.log(NL + `[Starting ${title}]`, NL)\n global.startTime = Date.now()\n\n // Collapse variables onto instance\n instance.server = server\n instance.config = config\n instance.restart = function () {\n restartServer(instance)\n }\n instance.listen = function (onListening) {\n return heyListen(instance, onListening)\n }\n\n // Register Page controller\n const pageController = pageControllerFactory.configure(config)\n\n // Create API controller\n const apiController = apiControllerFactory.configure(config)\n\n // Create Plugin controller\n const pluginController = pluginControllerFactory.configure(config)\n\n instance.addContentPage = function (file) {\n var pathInfo = pathParse(file)\n // Remove the .fragment part:\n var route = '/docs/' + pathParse(pathInfo.name).name\n server.get(route, pageController.createRenderFunctionFor(file))\n return route\n }\n\n instance.registerPluginAPIs = apiController.registerPluginAPIs\n\n // Run first-time install checks, and then start server:\n var firstTimeInstall = require('./monitor/firstTimeInstall')\n firstTimeInstall.configure(config)\n firstTimeInstall.runChecks(function () {\n // Register local content routes\n authSetup(instance)\n .then(() => configureRoutes(instance))\n .then(() => createContentRoutes(server, pageController))\n .then(apiController.registerUserAPIs)\n .then(() => pluginController.loadBuiltInPlugins(instance))\n .then(() => pluginController.loadUserPlugins(instance))\n .then(onConfigured)\n .catch((ex) => console.log('[Product Monitor]', ex, ex.stack))\n })\n\n function onConfigured () {\n // Check for an onReady callback\n if (onReady && typeof onReady === 'function') {\n // Let the user call listen when ready\n console.log(`[${title}]`, 'ready to run! Call instance.listen() on your callback.')\n onReady(instance)\n } else {\n // Call listen ourselves\n instance.listen()\n }\n }\n\n return instance\n}", "function dev() {\n const settings = parseArgs();\n\n readManifest((manifest) => {\n manifest['main'] = settings.main || manifest.main;\n manifest['node-remote'] = (manifest.main.includes('http')) ? `${manifest.main}/*` : false;\n manifest['version'] = settings.version || manifest.version;\n\n // delete node-remote property if we don't need it\n if (!manifest['node-remote']) {\n delete manifest['node-remote'];\n }\n\n // if we have a static directory, copy it over\n if (settings.static) {\n fs.copy(settings.static, `app/assets/${path.basename(settings.static)}`, (err) => {\n if (err) die(err)\n });\n }\n\n // if we have css, copy it over\n if (settings.css) {\n fs.copySync(settings.css, `app/${css}`, (err) => {\n if (err) die(err);\n });\n }\n\n // got js? copy it\n if (settings.js) {\n fs.copySync(settings.js, `app/${js}`, (err) => {\n if (err) die(err);\n });\n }\n\n // write the mutated manifest\n fs.writeJson('app/package.json', manifest, (err) => {\n if (err) die(err);\n\n // spawn nw and run it\n nw();\n });\n });\n}", "function server(done) {\n browser.init({\n // proxy: 'http://local.dev/blueoi/themed-email' // set this to your development url\n });\n done();\n}", "startServer() {\n const server = fractal.web.server();\n\n server.on('error', err => logger.error(err.message));\n\n return server.start().then(() => {\n // Code to make a nicer console output.\n const header = 'Fractal Web UI server is running!';\n const footer = fractal.cli.isInteractive() ? 'Use the \\'stop\\' command to stop the server.' : 'Use ^C to stop the server.';\n const serverUrl = server.urls.server;\n const format = str => logger.theme.format(str, 'success', true);\n let body = '';\n\n if (!server.isSynced) {\n body += `Local URL: ${format(serverUrl)}`;\n } else {\n const syncUrls = server.urls.sync;\n body += `Local URL: ${format(syncUrls.local)}`;\n body += `\\nNetwork URL: ${format(syncUrls.external)}`;\n body += `\\nBrowserSync UI: ${format(syncUrls.ui)}`;\n }\n\n return logger.box(header, body, footer).persist();\n });\n }", "function start(){\n var port = process.env.PORT || config.server.port;\n app.listen(port);\n console.log(\"server pid %s listening on port %s in %s mode\",\n process.pid,\n port,\n app.get('env')\n );\n}", "function startWebserver() {\n\n if ( curProtocol === 'https' ) {\n const credentials = {\n key: fs.readFileSync( configs.protocol[ curProtocol ].privateKey ),\n cert: fs.readFileSync( configs.protocol[ curProtocol ].certificate ),\n ca: fs.readFileSync( configs.protocol[ curProtocol ].ca )\n };\n const https_server = https.createServer( credentials, handleRequest );\n\n // start HTTPS webserver\n https_server.listen( configs.protocol[ curProtocol ].port );\n\n console.log( 'HTTPS server started at: https://' + configs.domain + ':' + configs.protocol[ curProtocol ].port );\n\n } else if ( curProtocol === 'http' ) {\n const http_server = http.createServer( handleRequest );\n\n // start HTTP webserver\n http_server.listen( configs.protocol[ curProtocol ].port );\n\n console.log( 'HTTP server started at: http://' + configs.domain + ':' + configs.protocol[ curProtocol ].port);\n\n } else {\n console.error( \"neither 'http' or 'https' configuration specified\" );\n }\n }", "function startServer(port, cb) { \n server = http.createServer(app);\n server.listen(port, function (err) {\n console.log('Listening on ' + port);\n if (cb !== undefined) { cb(err); }\n });\n}", "function startServer() {\r\n\tif ((process.argv[2] == 'help' || !process.argv[2]) && useCommandLine) {\r\n\t\tconsole.log('node index.js {local,online} [shutdownKey] [port]');\r\n\t\tprocess.exit(0);\r\n\t}\r\n\tvar local = process.argv[2] == 'local';\r\n\tvar shutdownK = process.argv[3] || 'q';\r\n\tvar port = process.argv[4] || 8000;\r\n\tif (local) {\r\n\t\tinitServer('localhost', port);\r\n\t} else {\r\n\t\tvar ip = ipGetter.address();\r\n\t\tconsole.log('Connect to: http://' + ip + ':8000/');\r\n\t\tinitServer(ip, port);\r\n\t}\r\n\tif (useCommandLine) {\r\n\t\tbindShutdownKey(shutdownK);\r\n\t}\r\n\tnetInit();\r\n\tMaps.forEach(map => map.data.id = newID(false));\r\n\tlog(0, 'Map id\\'s set');\r\n\tloadMap(Maps[0]);\r\n\tsetInterval(mainLoop, msPerFrame);\r\n}", "function startServer() {\n Http.listen(env.serverPort, () => {\n console.log('Listening at :' + env.serverPort + '...');\n });\n}", "async function setupServer() {\n try {\n await connectDatabase(mongoURI);\n\n await initBots().then(() => {\n console.log('All bots initialized');\n });\n } catch (err) {\n if (process.NODE_ENV !== 'production') console.log(err);\n process.exit(0);\n }\n}", "function runInDevelopment() {\n runInAutologin(true);\n }", "function startServer(port, cb) {\n server = http.createServer(app);\n server.listen(port, function (err) {\n console.log('Listening on ' + port);\n if (cb !== undefined) { cb(err); }\n });\n}", "function start(options) {\n app.get('/', function(req, res) {\n res.end('Hello World');\n });\n \n monitor.app(app.listen(options.port));\n }", "async function startApiServer({ deps }) {\n\n\tconst models = deps.models;\n\tconst app = express();\n\tapp.use(bodyParser.json());\n\tapp.use(cors());\n\n\tapp.get('/', (req, res) => {\n\t\tres.send('This is the vela GUI API server');\n\t});\n\n\tapp.post('/', async (req, res) => {\n\t\tconst { operationName, args } = req.body;\n\t\tconst operation = get(models, operationName);\n\t\tlet result;\n\t\tif (Array.isArray(args)) {\n\t\t\tresult = await operation(...args);\n\t\t} else {\n\t\t\tresult = await operation(args);\n\t\t}\n\t\tif (result instanceof ArrayCursor) {\n\t\t\tres.send({ data: 'OK' });\n\t\t} else {\n\t\t\tres.send({ data: result });\n\t\t}\n\t});\n\n\tapp.listen(config.apiPort, () => {\n\t\tconsole.log(`Vela GUI API server listening at http://localhost:${config.apiPort}`);\n\t});\n\n}", "async function startServer() {\n await server.start(TEST_SERVER_PORT);\n}", "async function start (port, database) {\n\n\tconst app = express();\n\n\tconst { webServer, socketServer } = setupWebSocketServer(app, database);\n\tsetupServerViewEngine(app);\n\tsetupServerMiddleware(app);\n\tsetupServerRoutes(app, socketServer);\n\tsetupServerErrorHandling(app);\n\n\t// Start listening on the HTTP web server.\n\tawait new Promise((resolve, reject) =>\n\t\twebServer.listen(port, err => (err ? reject(err) : resolve()))\n\t);\n\n}", "start() {\n // listen to coming requests\n const port = Number(this.config.port || process.env.PORT || 0);\n const host = this.config.host || '127.0.0.1';\n this.server.listen(port, host, () => {\n this.app.locals.url = `${this.app.locals.schema}://${host}:${port}`;\n log.info(`Server started on ${this.app.locals.url}`);\n });\n }", "function startExpress() {\n var express = require('express');\n var app = express();\n app.use(require('connect-livereload')());\n app.use(express.static(EXPRESS_ROOT));\n app.listen(EXPRESS_PORT);\n}", "function startServer() {\n var server = new Server();\n console.log('server started');\n}", "function main(opts) {\n\n _.defaults(opts, {\n beforeStart: (live) => {},\n })\n\n // Locate and register plugins.\n\n if (!__CLIENT__) {\n locator().map(file => {\n const module = require(file)\n live.register(module, file)\n })\n } else {\n Object.keys(window.livePlugins).map(file => {\n const module = window.livePlugins[file]\n live.register(module, file)\n })\n }\n\n opts.beforeStart(live)\n\n // Start app.\n\n live.start().then(() => {\n // App has now started.\n })\n\n return live\n\n}", "async function setupAndStart () {\n if(await db.setup())\n app.listen(3000, ::console.log('Server listening on port', 3000))\n}", "function serve() {\n const options = {\n server: {\n baseDir: BUILD_PATH\n },\n open: false // Change it to true if you wish to allow Browsersync to open a browser window.\n }\n\n browserSync(options)\n\n // Watches for changes in files inside the './src' folder.\n gulp.watch(`${SOURCE_PATH}/**/*.js`, ['watch-js'])\n\n // Watches for changes in files inside the './static' folder. Also sets 'keepFiles' to true (see cleanBuild()).\n gulp.watch(`${STATIC_PATH}/**/*`, ['watch-static']).on('change', () => {\n keepFiles = true\n })\n}", "function startDevServer() {\n const app = express();\n const devConfig = getConfig('dev');\n //\n // devConfig.plugins.push(\n // new webpack.DllReferencePlugin({\n // context: srcPath,\n // manifest: require(manifestPath),\n // })\n // );\n\n const compiler = webpack(devConfig);\n app.use(\n devMiddleware(compiler, {\n publicPath: devConfig.output.publicPath,\n historyApiFallback: true,\n })\n );\n\n app.use(bodyParser.json()); // added by joli44\n\n app.use(hotMiddleware(compiler));\n\n // First, find files from src folder\n app.use(express.static(path.join(__dirname, '../src')));\n\n // Also support files from root folder, mainly for the dev-vendor bundle\n app.use(express.static(path.join(__dirname, '../')));\n\n // Proxy all calls /api when DEV to\n // const { rekit: { proxy: API } } = pkgJson;\n //\n // if (API) {\n // app.get('/api/*', (req, res) => req.pipe(request.get(`${API}${req.originalUrl}`)).pipe(res));\n // app.post('/api/*', (req, res) => req.pipe(request.post(`${API}${req.originalUrl}`)).pipe(res));\n // }\n\n console.log();\n console.log('------------------------------------------------------------');\n console.log('Ecster NOTE: set the no_proxy variable in your dev env to: ');\n console.log('no_proxy=localhost,127.0.0.1,se.shb.biz,shbmain.shb.biz');\n console.log('------------------------------------------------------------');\n console.log();\n\n const { rekit: { restPort } } = pkgJson;\n const proxyUrl = req => 'http://127.0.0.1:' + restPort + req.url;\n const proxyHeaders = req => ({\n 'X-ECSTER-origin': req.header('X-ECSTER-origin'),\n 'X-ECSTER-session': req.header('X-ECSTER-session'),\n cookie: req.header('cookie'),\n });\n\n // proxy all rest requests to Ecster dev server\n app.all('/rest/*', (req, res) => {\n console.log(req.method + ' on ' + req.url);\n request[req.method.toLowerCase()]({\n url: proxyUrl(req),\n rejectUnauthorized: false,\n headers: proxyHeaders(req),\n json: true,\n body: req.body,\n }).pipe(res);\n });\n\n // History api fallback\n app.use(fallback('index.html', { root: path.join(__dirname, '../src') }));\n\n // Other files should not happen, respond 404\n app.get('*', (req, res) => {\n console.log('Warning: unknown req: ', req.path);\n res.sendStatus(404);\n });\n\n app.listen(pkgJson.rekit.devPort, err => {\n if (err) {\n console.error(err);\n }\n console.log(`Dev server listening at http://localhost:${pkgJson.rekit.devPort}/`);\n // if (API) {\n // console.log(`Proxy to API Server(Only for dev): ${API}`);\n // }\n });\n}", "function start_server () {\n var server = new msp.Proxy();\n server.listen(8050);\n log('Proxying from http://:8050');\n}", "function startServer(){\n server.start((err) => {\n if (err) {\n throw err;\n }\n console.log(`Server running at: ${server.info.uri}`);\n //pino.info('Server running at 8080')\n });\n}", "async function start(){\n try {\n await server.start();\n }\n catch(err){\n console.log(err);\n process.exit(1);\n }\n\n console.log('Server running at: ', server.info.uri);\n console.log('Environment: ', config.get('env'));\n console.log('ON: ', os.hostname());\n}", "function setup() {\n\t\t\tconsole.log('3pccTest: before: Mosca server is up and running');\n\t\t\tdone();\n\t\t}", "function runDevelopment() {\n alert(\"Running Development...\");\n }", "function openServer() {\n connect.server({\n host: cfg.server.host,\n root: cfg.server.root,\n port: cfg.server.port,\n livereload: true\n });\n }", "startServer() {\n require(path.resolve(this.libRoot, \"src/server/webpack-start.js\"));\n }", "function start() {\n app.listen(app.get('port'), function() {\n console.log('Node app is running on port', app.get('port'));\n });\n}", "function start_server(){\n let options = {}\n\n if (config.https.enabled) {\n options = {\n key: fs.readFileSync(config.https.key_file).toString(),\n cert: fs.readFileSync(config.https.cert_file).toString()\n };\n if (config.https.ca_certs) {\n options.ca = [];\n for (const ca in config.https.ca_certs) {\n options.ca.push(fs.readFileSync(config.https.ca_certs[ca]).toString());\n }\n }\n }\n\n const app = require('../app');\n server = http.createServer(app); \n\n /**\n * Get port from environment and store in Express.\n */\n server.listen(normalize_port(config.port));\n server.on('error', on_error);\n server.on('listening', on_listening);\n\n if (config.https.enabled) {\n const serverSecure = https.createServer(options, app);\n\n serverSecure.listen(config.https.port, function() {\n debug('Listening on port ' + serverSecure.address().port);\n });\n }\n}", "function prepareRungServer() {\n const server = http.createServer((req, res) => {\n if (req.method !== 'POST') {\n res.writeHead(404);\n return res.end();\n }\n\n const routes = {\n '/login': ~res.writeHead(200),\n '/metaExtensions/drafts': ~res.writeHead(201)\n };\n\n routes[req.url]();\n return res.end();\n });\n\n return new Promise(server.listen(FAKE_SERVER_PORT, _));\n}", "function setup() {\n\tconsole.log('Mosca server is up and running')\n}", "async function run() {\n const devsite = await requireInternalDeployScript();\n await devsite('dist', null);\n}", "function start() {\n\t// DEVTOOL: uncomment to bring up devtools on plugin view\n\t// IPC.sendToHost('devtools');\n\t\n\t// Call the API\n\tupdate();\n}", "async function startup() {\n console.log('Starting application');\n\n //prueba de la base de datos\n try {\n console.log('Initializing database module');\n\n await database.initialize();\n } catch (err) {\n console.error(err);\n\n process.exit(1); // Non-zero failure code\n }\n\n //inicio el servidor\n try {\n console.log('Initializing web server module');\n\n await webServer.initialize();\n } catch (err) {\n console.error(err);\n\n process.exit(1); // Non-zero failure code\n }\n}", "function start() {\n if (path.startsWith(\"http\")) {\n webCat(path);\n } else {\n cat(path);\n }\n}", "function StartWebServer(port) {\n if (port == 0 || port == 65535) return;\n obj.args.port = port;\n if (obj.tlsServer != null) {\n if (obj.args.lanonly == true) {\n obj.tcpServer = obj.tlsServer.listen(port, function () { console.log('MeshCentral HTTPS web server running on port ' + port + '.'); });\n } else {\n obj.tcpServer = obj.tlsServer.listen(port, function () { console.log('MeshCentral HTTPS web server running on ' + certificates.CommonName + ':' + port + '.'); });\n }\n } else {\n obj.tcpServer = obj.app.listen(port, function () { console.log('MeshCentral HTTP web server running on port ' + port + '.'); });\n }\n }", "function setup() {\n app.logger.info('Mosca server is up and running on ' + port);\n }", "function run() {\r\n setupDatabase();\r\n setupServer();\r\n startServer();\r\n}", "async function start() {\n const [clientConfig, serverConfig] = webpackConfig;\n\n // clean the build directory\n await run(clean);\n\n // instance the main webpack compiler\n const multiCompiler = webpack(webpackConfig);\n\n // and dissociate from it our client & server compiler\n const clientCompiler = multiCompiler.compilers.find((compiler) => 'client' === compiler.name);\n const serverCompiler = multiCompiler.compilers.find((compiler) => 'server' === compiler.name);\n\n // create promises on their compilations\n const clientPromise = createCompilationPromise('client', clientCompiler, clientConfig);\n const serverPromise = createCompilationPromise('server', serverCompiler, serverConfig);\n\n let api; // app instance will remain here\n let apiPromise; // promise resolving the server\n let apiPromiseResolve; // resolve callback of the same promise\n let apiPromiseIsResolved = true; // has the promise been resolved already\n\n const handleByServer = async (req, res, next) => {\n try {\n await apiPromise;\n api.handle(req, res);\n } catch (error) {\n next(error);\n }\n };\n\n // webpack dev server (with HMR)\n const devServer = new WebpackDevServer(clientCompiler, {\n contentBase: path.resolve(__dirname, '../public'),\n disableHostCheck: true,\n compress: true,\n clientLogLevel: 'none',\n hot: true,\n publicPath: '/',\n quiet: true,\n watchOptions,\n host,\n overlay: false,\n historyApiFallback: false,\n public: urls.lanUrlForConfig,\n after(app) {\n // redirect the request to the resolved server\n app.use(handleByServer);\n },\n before(app, server) {\n // apply middlewares for dev purposes\n app.use(evalSourceMapMiddleware(server));\n app.use(errorOverlayMiddleware());\n // we have to manually handle the root route\n app.get('/', handleByServer);\n },\n writeToDisk: true,\n });\n\n // listen on the server compilations\n serverCompiler.hooks.compile.tap('server', () => {\n if (!apiPromiseIsResolved) {\n // it has not been resolved so nothing to do yet\n return;\n }\n\n // inform we have not resolved instance\n apiPromiseIsResolved = false;\n\n // set the resolve callback as apiPromiseResolve and save the promise itself as apiPromise\n // eslint-disable-next-line no-return-assign\n apiPromise = new Promise((resolve) => (apiPromiseResolve = resolve));\n });\n\n // watch the server compiler\n serverCompiler.watch(watchOptions, (error, stats) => {\n if (!error && !stats.hasErrors()) {\n try {\n // we cannot apply the update so we will reload the whole server\n // but first delete the node cache\n delete require.cache[require.resolve('../build/server')];\n\n // now we can get the latest version of our server\n // eslint-disable-next-line global-require, import/no-unresolved\n api = require('../build/server').default;\n\n console.warn('[\\x1b[35mHot Reload\\x1b[0m] Server has been reloaded.');\n } catch (runtimeError) {\n // print the error\n console.error(runtimeError);\n }\n\n apiPromiseIsResolved = true;\n apiPromiseResolve();\n }\n });\n\n // Wait until both client and server bundles are ready\n await clientPromise;\n await serverPromise;\n\n // Launch WebpackDevServer.\n devServer.listen(port, host, (err) => {\n if (err) {\n console.error(err);\n\n return;\n }\n\n if (isInteractive) {\n clearConsole();\n }\n\n console.info(chalk.cyan('Starting the development server...\\n'));\n openBrowser(urls.localUrlForBrowser);\n });\n\n return devServer;\n}", "function startListening() {\n\tapp.listen(8080, function() {\n\t\tconsole.log(\"🐢 http://localhost:8080\");\n\t});\n}", "function startListening() {\n\tapp.listen(8080, function() {\n\t\tconsole.log(\"🐢 http://localhost:8080\");\n\t});\n}", "function startServer() {\r\n // Start listening on port 3000\r\n httpServer.listen(Constants.PORT, function () {\r\n console.log('listening on *: ', Constants.PORT);\r\n });\r\n\r\n // Start serving the game\r\n let server = new GameServer(io);\r\n server.init();\r\n}" ]
[ "0.6731838", "0.6694959", "0.6655131", "0.65913445", "0.6408564", "0.6335635", "0.6249138", "0.62113506", "0.6200073", "0.6175052", "0.61630344", "0.61295074", "0.6089659", "0.6070909", "0.6019326", "0.60121924", "0.598745", "0.5977397", "0.59683424", "0.5962741", "0.5951064", "0.5949769", "0.5912311", "0.5904126", "0.59024674", "0.58989334", "0.58939457", "0.5889702", "0.587409", "0.5860638", "0.58404785", "0.583204", "0.5820806", "0.58159757", "0.58059376", "0.5778287", "0.5758299", "0.57574934", "0.5747385", "0.5673503", "0.56696063", "0.56686217", "0.56667364", "0.5663998", "0.56605554", "0.56581324", "0.5654907", "0.5644906", "0.5629204", "0.5628274", "0.56094885", "0.56019294", "0.5586441", "0.5585139", "0.5577689", "0.55775034", "0.5572805", "0.5566595", "0.55651706", "0.5564877", "0.55438226", "0.5543607", "0.5529241", "0.5525342", "0.55252874", "0.5515054", "0.5507441", "0.5501968", "0.5497143", "0.548814", "0.5462479", "0.5459324", "0.54555714", "0.5455502", "0.5453915", "0.5448801", "0.544418", "0.54385257", "0.54325926", "0.5432005", "0.54240817", "0.542278", "0.5422023", "0.5421135", "0.5409848", "0.5404732", "0.5402002", "0.53898734", "0.53862005", "0.5381571", "0.53761554", "0.5374229", "0.5372971", "0.5369365", "0.5367303", "0.53589463", "0.53571063", "0.5353302", "0.5353302", "0.53502905" ]
0.5494848
69
ouvrir la boite de dialogue info
function BBCodeGen() { // Vérifie présence champs if($("#titre").val()!="" && $("#categories").val()!="" && $("#resume").val()!="" && $("#url").val()!="") { // Détermine la réponse juste var ReponseJuste = 1 if ($("#reponsejuste1").val()=="vrai") ReponseJuste=1; if ($("#reponsejuste2").val()=="vrai") ReponseJuste=2; if ($("#reponsejuste3").val()=="vrai") ReponseJuste=3; // Générer le bbcode var bbcode = $("#titre").val()+"\n\n"; bbcode += "[b]Catégories :[/b]"+$("#categories").val()+"\n"; bbcode += "\n[hr]\n"; bbcode += "[b]Fiche :[/b]\n"; bbcode += $("#resume").val()+"\n"; bbcode += "[url="+$("#url").val()+"]"+$("#url").val()+"[/url]\n"; bbcode += "\n[hr]\n"; bbcode += "[img]"+$("#urlimage").val()+"[/img]"; bbcode += "\n[hr]\n"; bbcode += "[b]Quizz :[/b]\n"; bbcode += "Question : "+$("#question").val()+"\n\n"; bbcode += "Réponse1 : "+$("#reponse1").val()+"\n"; bbcode += "Réponse2 : "+$("#reponse2").val()+"\n"; bbcode += "Réponse3 : "+$("#reponse3").val()+"\n\n"; bbcode += "Réponse juste : "+$("#reponsejuste:checked").val()+"\n\n"; // Afficher le BBCode var message="BBCode à copier dans votre sujet : \n\n"+bbcode; alert(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onEditar(idAnimal,Descripcion) {\n this.dialog.show({\n title: \"Editar Tipo de Mascota\",\n body: \"Ingrese el nombre del tipo de mascota:\",\n prompt: Dialog.TextPrompt({\n placeholder: Descripcion,\n initialValue: Descripcion,\n required: true\n }),\n actions: [Dialog.CancelAction(), Dialog.OKAction((dialog) =>{\n axios.put(rutaApi+'animal/'+idAnimal, {Descripcion: dialog.value }).then(()=>{console.log('works');window.location.replace(\"/AdministrarTiposDeMascotas\");})\n \n })],\n bsSize: \"small\",\n onHide: dialog => {\n dialog.hide();\n console.log(\"closed by clicking background.\");\n }\n });\n }", "function EnviarAviso(){\n\t$(\"#dialogEnviarAviso\").dialog(\"open\");\n}", "onAgregar() {\n this.dialog.show({\n title: \"Agregar Nuevo Tipo de Mascota\",\n body: \"Ingrese el nombre del nuevo tipo de mascota:\",\n prompt: Dialog.TextPrompt({\n placeholder: \"Nombre del tipo de mascota\",\n initialValue: \"\",\n required: true\n }),\n actions: [Dialog.CancelAction(), Dialog.OKAction((dialog) =>{\n axios.post(rutaApi+'animal', {idRaza:this.state.tipoMascota,Descripcion: dialog.value }).then(()=>{console.log('works'); window.location.replace(\"/AdministrarTiposDeMascotas\");})\n \n })],\n bsSize: \"small\",\n onHide: dialog => {\n dialog.hide();\n console.log(\"closed by clicking background.\");\n }\n });\n }", "function ouvrir() {\n creationModal();\n }", "function mostrarDialogoConfirmacion(){\n\t$('#dialog-confirm-001').dialog('open');\n\treturn false;\n}", "function ConfirmDialog() {\n\n //MessageLog.trace(\"\\n===================ConfirmDialog\\n\")\n\n if (Find_Unexposed_Substitutions()) {\n\n var d = new Dialog\n\n d.title = \"Delete_unexposed_substitutions\";\n\n rapport = \"The following subsitutions will be deleted : \"\n\n\n for (var c = 0; c < substituions_tab.columns.length; c++) {\n\n var currentColumn = substituions_tab.columns[c];\n\n var drawing = substituions_tab.drawings[c];\n\n for (var u = 0; u < substituions_tab.substitions[c].length; u++) {\n\n var sub_to_delete = substituions_tab.substitions[c][u];\n\n rapport += \"\\n\" + drawing + \" : \" + sub_to_delete;\n }\n\n }\n\n MessageLog.trace(rapport);\n\n if (rapport.length > 500) {\n rapport = \"Sorry too much informations to display please see the MessageLog\"\n\n }\n\n MessageBox.information(rapport)\n\n\n var rc = d.exec();\n\n if (rc) {\n\n Delete_Substitutions();\n\n }\n\n\n } else {\n\n \tMessageLog.trace(rapport);\n\n if (rapport.length > 500) {\n rapport = \"Sorry too much informations to display please see the MessageLog\"\n\n }\n\n MessageBox.information(rapport);\n\n }\n\n }", "function openDialog()\n{\n\tif (inviteOrCall==\"invite\")\n\t{\n\t\t$.dialog.buttonNames= ['Invite', 'Cancel'],\n\t\t$.dialog.message=\"Do you want to invite \"+ contact.getFullName();+\" to become a bofff ?\";\n\t\t$.dialog.show();\n\t}\n\telse\n\tif (inviteOrCall==\"call\")\n\t{\n\t\t$.dialog.buttonNames= ['Call', 'Cancel'],\n\t\t$.dialog.message=\"Are you sure want to call \"+ contact.getFullName()+\" on this number: \"+numberToCall+\" ?\";\n\t\t$.dialog.show();\n\t}\n\t\t\n}", "function confirm_dialog(mensaje) {\n\n var contenido='<div id=\"mensaje\">';\n\t contenido+='<p style=\"color:black; text-align:center;\" class=\"mensaje\">Esta Seguro de '+mensaje+' el Usuario?</p>';\n\t\t contenido+='<div class=\"botones\" style=\"text-align:center;\">';\n\t\t contenido+='<a href=\"#\" style=\"color:#fff;\" id=\"aceptar\" class=\"btn btn-primary\">Aceptar</a>';\n\t\t contenido+='<a href=\"#\" style=\"color:#fff; margin-left:10px;\" id=\"cancelar\" class=\"btn btn-primary\">Cancelar</a>';\n\t\t contenido+='</div>'\n\t contenido+='</div>';\n\t \n\t modals(\"Informaci&oacute;n <i class='icon-question-sign'></i>\",contenido);\n\t \n\t $(\"#aceptar\").click(function(){\n\t\n\t\tvar cuanto=$(\".cedula_super\").length;\n\t\tif(cuanto >0){\n\t\t\tvar cedula=$(\".cedula_super\").html();\n\t\t\tvar estado=$(\".estado_super\").html();\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\turl:'activar_super.php',\n\t\t\t\ttype:'POST',\n\t\t\t\tdata:\"cedula=\"+cedula+\"&estado=\"+estado,\n\t\t\t\tsuccess:function(data){\n\t\t\t\t\t//document.write(data); return false;\n\t\t\t\t\tif(data=='3'){\n\t\t\t\t\t\t$(\".mensaje\").html(\"\");\n\t\t\t\t\t\t$(\".mensaje\").html('No se puede inactivar el usuario porque esta cubriendo un turno');\n\t\t\t\t\t\t$(\"#cancelar\").css(\"display\",\"none\");\n\t\t\t\t\t\t $(\"#aceptar\").click(function(){\n\t\t\t\t\t\t\t$('#myModal2').modal('hide');\n\t\t\t\t\t\t });\t \t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}else if(data=='1'){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\".mensaje\").html(\"\");\n\t\t\t\t\t\t$(\".mensaje\").html('Se hicieron los cambios correctamente');\n\t\t\t\t\t\t $(\"#content\").load('supernumerario_catalogo.php');\n\t\t\t\t\t\t $(\"#cancelar\").css(\"display\",\"none\");\n\t\t\t\t\t\t$(\"#aceptar\").click(function(){\n\t\t\t\t\t\t\t$('#myModal2').modal('hide');\n\t\t\t\t\t\t })\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\t\n\t\t}\n\t\treturn false;\n\t });\n\t \n\t $(\"#cancelar\").click(function(){\n\t\t$('#myModal2').modal('hide');\n\t });\n\t \n\t \n}", "function dialogGenerico(titulo, dato) {\r\n $(\"#mensajesPantalla\").dialog({\r\n height: \"auto\",\r\n width: \"auto\",\r\n resizable: true\r\n });\r\n $(\"#mensajesPantalla\").dialog('option', 'title', titulo);\r\n $(\"#mensajesPantalla\").html('<center> <div style=\"align:center\"><br>' + dato + '<\\/div><\\/center>');\r\n $(\"#mensajesPantalla\").dialog('option', 'buttons', {\r\n OK: function() {\r\n $(this).dialog('close')\r\n }\r\n });\r\n $(\"#mensajesPantalla\").dialog('open');\r\n}", "function X_Inac() {\n $(\"#Dialog_Inactivar\").dialog(\"close\");\n}", "function notificaInfo()\n{\n\t$('#modalHeader').html('Preventivo accettato');\n\t$('#modalBody').html('<p>Un cliente ha accettato il tuo preventivo. Attende che lo contatti, vuoi visualizzare i suoi dati?</p>');\n\t$('#modalFooter').html('<a href=\"javascript:accendiSeNotifica()\" class=\"btn\" data-dismiss=\"modal\">Annulla</a>'+\n\t\t\t\t\t\t '<a href=\"mostraQualcosa.html\" class=\"btn btn-primary\">Visualizza</a>');\n\t$('#panelNotifiche').modal('show');\n\tspegniSeNotifica();\n}", "action () {\n var text = \"<br>”Redigera bild...” är en planerad framtida länk<br>till något bildredigeringsprogram\"; // i18n\n var yes = \"Ok\" // i18n\n infoDia (null, null, \"\", text, yes, true);\n return;\n }", "function dialogoMensaje(mensaje) {\n $(\"#mensajeModal\").text(mensaje);\n $(\"#dialog-mensaje\").dialog({\n open: function(event, ui) { $(\".ui-dialog-titlebar-close\").hide();},\n draggable: false,\n resizable: false,\n width:300,\n height:150,\n modal: true,\n buttons: {\n \"Aceptar\": function() {\n $( this ).dialog( \"close\" );\n }\n }\n });\n }", "function ConfirmDialog(){\r\n\r\n \r\n \r\n }", "function terminaTurnoProduzione(){\r\n \"use strict\";\r\n var spostamentiTot= getSommaSpostamenti();\r\n\tif(spostamentiTot===0){\r\n\t\t$(\"#fineTurnoPBody\").html(\"Hai terminato gli spostamenti da effettuare.\");\r\n\t}else{\r\n\t\t$(\"#fineTurnoPBody\").html(\"Hai ancora \"+spostamentiTot+\" spostamenti che potresti effettuare: <br>sei sicuro di terminare il turno?\");\r\n\t}\r\n\t\r\n $(\"#fineTurnoPDialog\").modal();\r\n}", "function popupInfoJuego(id)\r\n{\r\n\tvar params =\r\n\t{\r\n\t\t\"idjuego\" : id\r\n\t}\r\n\t$.ajax(\r\n\t\t{\r\n\t\t\tdata: params,\r\n\t\t\turl: 'info.php',\r\n\t\t\ttype: 'post',\r\n\t\t\tbeforeSend: function ()\r\n\t\t\t{\r\n\t\t\t\t$(\"#dialogJuego\").html(\"Procesando, espere por favor...\");\r\n\t\t\t},\r\n\t\t\tsuccess: function(response)\r\n\t\t\t{\r\n\t\t\t\tdatos = response.split(\"||\");\r\n\t\t\t\tcontenido = \"<div id='pIzq' style='float:left; width: 55%;'><span id='pDesc'>\"+datos[4]+\"</span></div><div id='pDer' style='float:right; width: 45%;'><img style='width: 130px;margin:10px; border: 1px solid black;' id='pThumb' src='\"+datos[3]+\"'></img><br><br><a style='float:right;background-color:red;text-decoration:none;font-weight:bold;font-size:0.8em;color:white;padding: 6px;' id='pPlay' href='game.php?id=\"+id+\"'>JUGAR</a></div>\";\r\n\t\t\t\t$( \"#dialogJuego\" ).html(contenido); //contenido\r\n\t\t\t\t$( \"#dialogJuego\" ).dialog({modal:true,title:datos[0],width:350,draggable:false});\r\n\t\t\t}\r\n\t\t});\r\n}", "function showAboutDialog() {\r\n\tvar dialog = new SimpleDialog(\"About\");\r\n\tdialog.addButton(\"OK\",SimpleDialog.CLOSE_BUTTON);\r\n\tdialog.addMessage(\"ETI Blank\", \"center\");\r\n\tdialog.addMessage(\"Version 0.1.r177\", \"center\");\r\n\tdialog.show();\r\n}", "closeDialog() {\n this.dialog = false;\n this.errors = \"\";\n this.valid = true;\n }", "function TRiotDialog(){\r\n\r\n }", "function makeDialog(who, whoName, btns, left){\r\n $(who).dialog({\r\n \"autoOpen\": true,\r\n \"title\": whoName,\r\n \"buttons\": btns,\r\n\t\t\"modal\": true,\r\n\t\t\"position\": [left],\r\n \"minHeight\": 300,\r\n \"width\": 540,\r\n \"resizable\": true,\r\n \"open\": function (event, ui) {\r\n $('.ui-widget-overlay').css({'opacity':'0.2'});\r\n }\r\n });\r\n\t//dialog的X事件\r\n\t$('.ui-icon-closethick').click(function () {\r\n fn_ClearDialogData();\r\n\t});\r\n}", "function viewFR(id){\n $.Dialog({\n shadow: true,\n overlay: true,\n draggable: true,\n width: 500,\n padding: 10,\n onShow: function(){\n var titl,cont;\n if(id!=''){ //form mode : edit \n titl= 'Ubah '+mnu;\n var u =dir;\n var d ='aksi=ambiledit&replid='+id;\n ajax(u,d).done(function(r){\n $('#idformH').val(id);\n $('#gelombangDV').text(': '+r.gelombang);\n $('#tglmulaiTB').val(r.tglmulai);\n $('#tglselesaiTB').val(r.tglselesai);\n cmbdepartemen('form',r.departemen);\n cmbtahunajaran('form',r.tahunajaran);\n });\n }else{ // form mode : add \n titl='Tambah '+mnu;\n cmbtingkat('form','');\n }$.Dialog.title(titl);\n $.Dialog.content(contentFR);\n $('#tingkatH').val($('#tingkatS').val());\n }\n });\n }", "function selObjectDialog(){\n $('#dlgokcancel').dialog('option', 'title', _('Объекты'));\n $(\"#dlgokcancel_title\").show().text(_('Выберите из списка'));\n\n // инициализация диалога\n $(\"#dlgokcancel_content\").html('<strong>'+_('Загрузка...')+'</strong>').load('systems_objects_by_type', {id_system: cur_id_system, obj_type: $(\"#dlgoptedit_type_cmb>option:selected\").val()}, function(){\n //alert('async load content');\n $(\"#tbl_systems_objects_by_type\").Scrollable(180, '100%').tablesorter().find(\"thead>tr\").css(\"cursor\",\"pointer\");\n\n if ($(\"#dlgoptedit_obj_id_edt\").val())\n $(\"input:radio\").val([$(\"#dlgoptedit_obj_id_edt\").val()]);\n else\n $(\"input:radio\").val([$(\"input:radio:first\").val()]);\n\n // определение кнопок\n $(\"#dlgokcancel_ok_btn\").unbind('click').click(function()\n {\n //fill_input_filtered_users();\n var sel_object_id=$('input:radio[name=sel_object]:checked').val();\n\n fill_inputs_filtered_object(sel_object_id, 'from_table');\n\n // закрываем\n $(\"#dlgokcancel\").dialog(\"close\");\n //alert('after dlgokcancel.close');\n\n }); //dlgoptedit_save_btn click\n //alert('after filtered_users, bind');\n });\n\n //alert('selUsersDialog2');\n\n // события\n $(\"#dlgokcancel\").unbind('keypress').keypress(function(e){if(e.keyCode==13){$(\"#dlgokcancel_ok_btn\").click();}});\n\n // определение кнопок\n $(\"#dlgokcancel_cancel_btn\").unbind('click').click(function(){$(\"#dlgokcancel\").dialog(\"close\");});\n\n if ($.browser.msie) {\n $( \"#dlgokcancel\" ).unbind( \"dialogclose\").bind( \"dialogclose\", function(event, ui) {\n $('#dlgoptedit_type_cmb').css('visibility', 'visible');\n });\n }\n // запуск диалога\n $(\"#dlgokcancel\").show().dialog(\"open\");\n //обязательно после show dialog\n if ($.browser.msie) {\n $('#dlgoptedit_type_cmb').css('visibility', 'hidden');\n $('#dlgokcancel .full_height').css('height', '250px');\n }\n //$(\"#dlgeoptdit_login_edt\").focus().select();\n\n //alert('selUsersDialog3');\n}", "function confirmation(id){\n $( \"#confirmation\" ).dialog({\n resizable: false,\n height:375,\n width:485,\n autoOpen: false,\n modal: true,\n buttons: {\n \"Terminer\": function() {\n $( this ).dialog( \"close\" ); \t \n return false;\n }\n }\n });\n}", "function dialog_edita_devolucion_asignar_vehiculo(div_dialog,direccion,titulo)\n{\n \n burl=$('#b_url').val();\n this.cargar_contenido_html(div_dialog,direccion,0);//modulo=0 no sirve\n $( \"#\"+div_dialog ).dialog({\n title:titulo,\n autoOpen: true,\n height: 500,\n width: 630,\n modal: true,\n closeOnEscape: false,\n \n buttons:[\n {\n id: \"editar\",\n text: \"Guardar editar\",\n disabled:\"true\",\n click: function() {\n \n $.post(burl+\"asignacion_vehiculo_regional/guardar_vehiculo_asignado_editando\",{\n 'id_asig':$('#id_asig').val(),\n // 'id_asig_responsable':$('#id_asig_responsable').val(),\n 'id_vehiculo_resp':$('#id_vehiculo_resp').val(),\n // 'fecha_hora_asig':$('#fecha_hora_asig').val(),\n 'fecha_hora_dev':$('#fecha_hora_dev').val(),\n 'estado_registro':\"Activo\",\n //'id_estado_asig':$('#id_estado_asig').val(),\n // 'id_responsable':$('#asignado').val(),\n // 'ciudad_asig':$('#ciudad_asig :selected').val(),\n 'observaciones':$('#observaciones').val()\n \n \n }\n \n ,function(data){\n // alert (\"entra \");\n $(\"#\"+div_dialog +\" #respuesta\").html(data);\n //if($('#ayudata').val()!=0)\n \n setTimeout(function(){\n nuevadireccion=this.quita_parametros(direccion,1);\n // alert('direccion,'+direccion+\",nueva_direccion,\"+nuevadireccion);\n cargar_contenido_html(div_dialog,nuevadireccion+$('#ayudata').val(),0);\n }, 1000);//alert('funciona'); \n \n });}\n },\n {\n id: \"devolucion\",\n text: \"Guardar devolucion\",\n disabled:\"true\",\n click: function() {\n $.post(burl+\"vehiculo/guardar_vehiculo_asignado_responsable_devolucion\",{\n 'id_asig':$('#id_asig').val(),\n //'id_asig_responsable':$('#id_asig_responsable').val(),\n 'id_vehiculo_resp':$('#id_vehiculo_resp').val(),\n // 'fecha_hora_asig':$('#fecha_hora_asig').val(),\n 'fecha_hora_dev':$('#fecha_hora_dev').val(),\n 'id_estado_asig':$('#id_estado').val(),\n 'id_devolucion_veh':$('#id_asig').val(),\n 'estado_registro':\"Inactivo\",\n 'tipo_asignacion':\"Devolucion\",\n 'id_responsable':$('#asignado').val(),\n // 'ciudad_asig':$('#ciudad_asig :selected').val(),\n 'observaciones':$('#observaciones').val()\n \n \n }\n \n ,function(data){\n // alert (\"entra \");\n $(\"#\"+div_dialog +\" #respuesta\").html(data);\n //if($('#ayudata').val()!=0)\n \n setTimeout(function(){\n nuevadireccion=this.quita_parametros(direccion,1);\n // alert('direccion,'+direccion+\",nueva_direccion,\"+nuevadireccion);\n cargar_contenido_html(div_dialog,nuevadireccion+$('#ayudata').val(),0);\n }, 1000);\n location.reload(); //alert('funciona'); \n \n }); }\n },\n {\n id: \"button-ok\",\n text: \"Cerrar\",\n click: function() {\n // $(this).dialog(\"close\");\n //$(\"#mensaje\").dialog\n $( this ).dialog( \"close\" );\n location.reload(); \n //$(this).dialog();\n }\n }\n \n ]\n });\n}", "function dlgAccept()\n{\n\tsaveIni();\n\tg_form.accept();\n}", "function selOptionDialog(){\n $(\"#dlgokcancel_title\").text('');\n $(\"#dlgokcancel_title\").show().text(_('Выберите из списка'));\n\n //$.getJSON('systems_view_name', {view_tag: 'options'}, function(json){\n $('#dlgokcancel').dialog('option', 'title', _('Опции'));\n //$('#dlgokcancel').dialog('option', 'title', json.ext_data);\n //alert($(\"#dlgokcancel_title\").text());\n //});\n\n // инициализация диалога\n $(\"#dlgokcancel_content\").html('<strong>'+_('Загрузка...')+'</strong>').load('systems_options', function(){\n //alert('async load content');\n $(\"#tbl_systems_options\").Scrollable(280, '100%').tablesorter().find(\"thead>tr\").css(\"cursor\",\"pointer\");\n\n if ($(\"#dlgoptedit_opt_edt\").val())\n $(\"input:radio\").val([parseOptId($(\"#dlgoptedit_opt_edt\").val())]);\n else\n //$(\"input:radio\").val([$(\"input:radio:first\").val()])\n ;\n\n // определение кнопок\n $(\"#dlgokcancel_ok_btn\").unbind('click').click(function()\n {\n //fill_input_filtered_users();\n var sel_opt_id=$('input:radio[name=sel_option]:checked').val();\n\n fill_input_filtered_option(sel_opt_id, 'from_table');\n\n // закрываем\n $(\"#dlgokcancel\").dialog(\"close\");\n //alert('after dlgokcancel.close');\n\n }); //dlgoptedit_save_btn click\n //alert('after filtered_users, bind');\n });\n\n //alert('selUsersDialog2');\n\n // события\n $(\"#dlgokcancel\").unbind('keypress').keypress(function(e){if(e.keyCode==13){$(\"#dlgokcancel_ok_btn\").click();}});\n\n // определение кнопок\n $(\"#dlgokcancel_cancel_btn\").unbind('click').click(function(){$(\"#dlgokcancel\").dialog(\"close\");});\n\n if ($.browser.msie) {\n $( \"#dlgokcancel\" ).unbind( \"dialogclose\").bind( \"dialogclose\", function(event, ui) {\n $('#dlgoptedit_type_cmb').css('visibility', 'visible');\n });\n }\n // запуск диалога\n $(\"#dlgokcancel\").show().dialog(\"open\");\n //обязательно после show dialog\n if ($.browser.msie) {\n $('#dlgoptedit_type_cmb').css('visibility', 'hidden');\n $('#dlgokcancel .full_height').css('height', '346px');\n }\n //$(\"#dlgeoptdit_login_edt\").focus().select();\n //alert('selUsersDialog3');\n}", "function verdetalle(idventa_d) {\n\t// alert(idventa);\n\tlistar_detalle_modal(idventa_d)\n\t$(\"#myModal_detalles .modal-title\").html('<i class=\"fa fa-list-ol\" aria-hidden=\"true\"></i> Detalle de Venta 00'+idventa_d);\n\t$('#myModal_detalles').modal('show');\n\n}", "function muestraMsg(titulo, mensaje, okButton, tipoMsg, okMsg = \"OK\", closeMsg = \"Close\") {\n document.getElementById(\"idMdlOK\").innerHTML = okMsg;\n document.getElementById(\"idMdlClose\").innerHTML = closeMsg;\n\n myModal.hide();\n switch (tipoMsg) {\n case \"error\":\n {\n titulo = \"<i style='color:red ' class='bi bi-exclamation-octagon-fill'></i> \" + titulo;\n }\n break;\n case \"question\":\n {\n titulo = \"<i style='color:blue' class='bi bi-question-circle-fill'></i> \" + titulo;\n }\n break;\n default:\n {\n titulo = \"<i style='color:green' class='bi bi-check-circle-fill'></i> \" + titulo;\n }\n break;\n }\n document.getElementById(\"idMdlTitle\").innerHTML = titulo;\n document.getElementById(\"idMdlMsg\").innerHTML = mensaje;\n document.getElementById(\"idMdlOK\").style.display = okButton ? \"block\" : \"none\";\n\n myModal.show();\n}", "function muestraMsg(titulo, mensaje, okButton, tipoMsg, okMsg = \"OK\", closeMsg = \"Close\") {\n document.getElementById(\"idMdlOK\").innerHTML = okMsg;\n document.getElementById(\"idMdlClose\").innerHTML = closeMsg;\n\n myModal.hide();\n switch (tipoMsg) {\n case \"error\":\n {\n titulo = \"<i style='color:red ' class='bi bi-exclamation-octagon-fill'></i> \" + titulo;\n }\n break;\n case \"question\":\n {\n titulo = \"<i style='color:blue' class='bi bi-question-circle-fill'></i> \" + titulo;\n }\n break;\n default:\n {\n titulo = \"<i style='color:green' class='bi bi-check-circle-fill'></i> \" + titulo;\n }\n break;\n }\n document.getElementById(\"idMdlTitle\").innerHTML = titulo;\n document.getElementById(\"idMdlMsg\").innerHTML = mensaje;\n document.getElementById(\"idMdlOK\").style.display = okButton ? \"block\" : \"none\";\n\n myModal.show();\n}", "function dialog_edita_devolucion_asignar_responsable_vehiculo(div_dialog,direccion,titulo)\n{\n// alert('entra');\n burl=$('#b_url').val();\n this.cargar_contenido_html(div_dialog,direccion,0);//modulo=0 no sirve\n $( \"#\"+div_dialog ).dialog({\n title:titulo,\n autoOpen: true,\n height: 500,\n width: 630,\n modal: true,\n closeOnEscape: false,\n \n buttons:[\n {\n id: \"editar\",\n text: \"Guardar editar\",\n disabled:\"true\",\n click: function() {\n \n $.post(burl+\"vehiculo/guardar_vehiculo_asignado_responsable_editado\",{\n 'id_asig':$('#id_asig').val(),\n // 'id_asig_responsable':$('#id_asig_responsable').val(),\n //'id_vehiculo_resp':$('#id_vehiculo_resp').val(),\n // 'fecha_hora_asig':$('#fecha_hora_asig').val(),\n 'fecha_hora_dev':$('#fecha_hora_dev').val(),\n 'estado_registro':\"Activo\",\n //'id_estado_asig':$('#id_estado_asig').val(),\n // 'id_responsable':$('#asignado').val(),\n // 'ciudad_asig':$('#ciudad_asig :selected').val(),\n 'observaciones':$('#observaciones').val()\n \n \n }\n \n ,function(data){\n // alert (\"entra \");\n $(\"#\"+div_dialog +\" #respuesta\").html(data);\n //if($('#ayudata').val()!=0)\n \n setTimeout(function(){\n nuevadireccion=this.quita_parametros(direccion,1);\n // alert('direccion,'+direccion+\",nueva_direccion,\"+nuevadireccion);\n cargar_contenido_html(div_dialog,nuevadireccion+$('#ayudata').val(),0);\n }, 1000);//alert('funciona'); \n \n });}\n },\n {\n id: \"devolucion\",\n text: \"Guardar devolucion\",\n disabled:\"true\",\n click: function() {\n $.post(burl+\"vehiculo/guardar_vehiculo_asignado_responsable_devolucion\",{\n 'id_asig':$('#id_asig').val(),\n //'id_asig_responsable':$('#id_asig_responsable').val(),\n 'id_vehiculo_resp':$('#id_vehiculo_resp').val(),\n // 'fecha_hora_asig':$('#fecha_hora_asig').val(),\n 'fecha_hora_dev':$('#fecha_hora_dev').val(),\n 'id_estado_asig':$('#id_estado').val(),\n 'id_devolucion_veh':$('#id_asig').val(),\n 'estado_registro':\"Inactivo\",\n 'tipo_asignacion':\"Devolucion\",\n 'id_responsable':$('#asignado').val(),\n // 'ciudad_asig':$('#ciudad_asig :selected').val(),\n 'observaciones':$('#observaciones').val()\n \n \n }\n \n ,function(data){\n // alert (\"entra \");\n $(\"#\"+div_dialog +\" #respuesta\").html(data);\n //if($('#ayudata').val()!=0)\n \n setTimeout(function(){\n nuevadireccion=this.quita_parametros(direccion,1);\n // alert('direccion,'+direccion+\",nueva_direccion,\"+nuevadireccion);\n cargar_contenido_html(div_dialog,nuevadireccion+$('#ayudata').val(),0);\n }, 1000);\n location.reload(); //alert('funciona'); \n \n }); }\n },\n {\n id: \"button-ok\",\n text: \"Cerrar\",\n click: function() {\n // $(this).dialog(\"close\");\n //$(\"#mensaje\").dialog\n $( this ).dialog( \"close\" );\n location.reload(); \n //$(this).dialog();\n }\n }\n \n ]\n });\n}", "function startMessage() {\r\n $(\"#intro\").dialog({\r\n modal: true,\r\n buttons: {\r\n No: optionNo,\r\n Yes: optionYes\r\n },\r\n });\r\n}", "function dialog(text, type, onConfirm) {\n let box = $(admin).find('.sb-dialog-box').attr('data-type', type);\n $(box).find('p').html((type == 'alert' ? sb_('Are you sure?') + ' ' : '') + sb_(text));\n $(box).sbActivate().css({ 'margin-top': ($(box).outerHeight() / -2) + 'px', 'margin-left': ($(box).outerWidth() / -2) + 'px' });\n $(overlay).sbActivate();\n alertOnConfirmation = onConfirm;\n }", "function mourir(){\n if(personnage.sante<0){\n presenceEnnemi = 666;\n dialogBox(\"Oh, on dirait que \" + rndEnnemi.nom + \" a eu raison de toi\\nT'es un peu une merde, et t'as un peu pas d'bol\\n\\ntu as tout de même niqué \"+compteurEnnemiVaincu +\" Boloss sur ta route\\n\\nf5 pour recommencer... DU DEBUT HAHAHA\")\n}\n}", "function construirDialogoGeneral() \r\n{ \r\n $(\"body\").append(\"<div id='dialogoGenaralDiv'><span/><\\/div>\");\r\n $(\"#dialogoGenaralDiv\").dialog(\r\n { \r\n autoOpen:false, modal:true, width:\"50%\", resizable:false, draggable:false, \r\n buttons: \r\n {\r\n \"Aceptar\": function() \r\n {\r\n $(this).dialog(\"close\"); \r\n }\r\n },\r\n \r\n open: function() \r\n {\r\n $('.ui-dialog-buttonpane').find('button:contains(\"Aceptar\")').button({icons: {primary: 'ui-icon-check'}});\r\n }\r\n });\r\n}//construirDialogoGeneral", "function successfullysent() {\n console.log(\"Invio delle notizie riuscito!\");\n $(\"#dialog\").fadeIn(750);\n $(\"#infomsg\").text(\"Invio delle notizie riuscito!\");\n $(\"#dialog\").delay(3000).fadeOut(2000);\n}", "function fn_mdl_mensajeIco(Message, Image) {\r\n if (Image == null) { Image = 'util/images/ok.gif'; }\r\n $(\"body\").append(\"<div id='divMessageInfoA' title='VALIDACIONES PRINCIPALES'></div>\");\r\n $(\"#divMessageInfoA\").html('<br /><table><tr><td style=\"width:35px\"><img src=\"' + Image + '\" alt=\"\"></td><td aling=\"left\" class=\"css_lbl_texto\">' + Message + '</td></tr></table>');\r\n $(\"#divMessageInfoA\").dialog({\r\n modal: true\r\n , resizable: false\r\n\t , beforeclose: function (event, ui) {\r\n\t $(\"#divMessageInfoA\").remove();\r\n\t }\r\n , buttons: {\r\n \"Aceptar\": function () {\r\n $(\"#divMessageInfoA\").remove();\r\n\r\n }\r\n }\r\n });\r\n}", "function showPrompt(idPedido) {\n ons.notification.prompt('Ingrese un comentario')\n .then(function (input) {\n agregarComentario(idPedido, input);\n var message = input ? 'Gracias por su comentario' : 'El comentario no puede estar vacio';\n ons.notification.alert(message);\n });\n}", "function X_Emer() {\n $(\"#Dialog_emergente\").dialog(\"close\");\n}", "function confirmation(id){\n $( \"#confirmationSuppression\" ).dialog({\n resizable: false,\n height:170,\n width:405,\n autoOpen: false,\n modal: true,\n buttons: {\n \"Oui\": function() {\n $( this ).dialog( \"close\" );\n \n var cle = id;\n var chemin = '/simens/public/pharmacie/supprimer';\n $.ajax({\n type: 'POST',\n url: chemin , \n data:'id='+cle,\n success: function(data) { \n \t var result = jQuery.parseJSON(data);\n \t $(\"#\"+cle).fadeOut(function(){$(\"#\"+cle).empty();});\n \t $(\"#compteur\").html(result);\n \t \n },\n error:function(e){console.log(e);alert(\"Une erreur interne est survenue!\");},\n dataType: \"html\"\n });\n \t //return false;\n \t \n },\n \"Annuler\": function() {\n $( this ).dialog( \"close\" );\n }\n }\n });\n}", "function DialogoModal(){\n$(\"#divModal\").dialog({\n\t\t\tautoOpen: false,\n\t\t//\twidth: 200, //alto\n\t\t\twidth : 380, \t//ancho\n\t\t\tmodal: true,\t//modo\n\t\t\tbuttons: [\n\t\t\t\t{\n\t\t\t\t\ttext: \"Ok\",\n\t\t\t\t\tclick: function() {\n var corroborado = false;\n if (CorroborarCampoVacio(corroborado)){\n GuardarDatosModal();//Guarda datos del formulario de modal\n EnviaDatosModal();//Envia datos de modal\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttext: \"Cancel\",\n\t\t\t\t\tclick: function() {\n\t\t\t\t\tLimpiarForm(); //limpia los campos del formulario\n\t\t\t\t\t\t$( this ).dialog( \"close\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t});\n\t\t}", "function showConfirmationDialog() {\r\n\tconfirmationDialog = generateDialog(language.data.account_deleted, '<p>' + language.data.account_del_successful + '</p><input class=\"input-button\" type=\"submit\" id=\"okay\" value=\"' + language.data.okay + '\" />');\r\n\topenDialog(confirmationDialog);\r\n\t$('input#okay').click(function() {closeDialog(confirmationDialog);});\r\n}", "function alertCapicom(e, title, width, height)\n{\n\tif (e != '' && e != undefined) {\n\t\t\n\t} else {\n\t\te = 'Для работы на ' + LOGOTYPE + ' пользователи должны получить сертификаты ЭЦП и изменить настройки браузера (<a href=\"/faq/#browser-settings\">Настройки браузера для работы с ЭЦП</a>).'\n\t}\n\t\n\tif (title != '' && title != undefined) {\n\t\tvar t = title;\n\t} else {\n\t\tvar t = LOGOTYPE;\n\t}\n\t\n\tif (width != '' && width != undefined) {\n\t\tvar w = width;\n\t} else {\n\t\tvar w = 600;\n\t}\n\t\n\tif (height != '' && height != undefined) {\n var h = height;\n } else {\n var h = 200;\n }\n\t\n\tvar buttonHtml = '<div align=\"center\" style=\"float: left; position: absolute; bottom: 0; width: 100%; margin-top: 20px;\">' +\n\t\t\t\t\t '<button type=\"button\" class=\"btn\" id=\"close-capicom-dialog\"><span><span style=\"color: #000000 !important;\">Закрыть окно</span></span></button>' +\n\t\t\t\t\t '</div>';\n\tif ($('#capicom-dialog').length == 0) {\n\t\tvar divAlert = $('<div id=\"capicom-dialog\" class=\"capicom-dialog\" style=\"display: none;\" title=\"' + t + '\"><div>' + '<center>' + e + '</center>' + buttonHtml + '</div></div>');\n\t\t$('body').append(divAlert);\n\t} else {\n\t\t$('div#capicom-dialog').dialog('option', 'title', t).find('div').html('<center>' + e + '</center>' + buttonHtml);\n\t}\n $('#capicom-dialog').dialog({\n autoOpen: false,\n\t\tresizable: false,\n\t\tmodal: true,\n height: h,\n\t\tminHeight: h,\n width: w,\n\t\tminWidth: w,\n\t\topen: function() {\n\t\t\tvar dialog = this;\n\t\t setTimeout(function() {\n \t\t\t$('#close-capicom-dialog').bind('click', function(){\n \t\t\t\t$(dialog).dialog('close');\n \t\t\t});\n\t\t\t}, 500);\n\t\t},\n\t\tclose: function() {\n\t\t\t$('#close-capicom-dialog').unbind('click');\n\t\t\tif (typeof(afterCapicomClose) !== 'undefined') {\n\t\t\t\tif ($.isFunction(afterCapicomClose)) {\n\t\t\t\t\tafterCapicomClose();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n });\n $('#capicom-dialog').dialog('open');\n}", "function handleClose() {\n navigate(\"/EscolherCondominio\"); // vai pra tela de condominios\n setDialog(false);\n }", "function modalDialog2_handleOK (e) {\r\n\t\tvar window = e.data.window;\r\n\t\tvar form = e.data.form;\r\n\t\tvar errorDiv = e.data.errorDiv;\r\n\t\tvar waitDiv = e.data.waitDiv;\r\n\t\tvar options = e.data.options;\r\n\t\t\r\n\t\tvar action = form ? form.attr(\"action\") : \"\";\r\n\r\n\t\terrorDiv.hide();\r\n\t\tvar message = form ? form.attr(\"confirm\") : \"\";\r\n\r\n\t\tif (options.confirmationMessageFunction)\r\n \t\tmessage = options.confirmationMessageFunction();\r\n \t\r\n \tif (options.confirmationMessage)\r\n \t\tmessage = options.confirmationMessage;\r\n\t\t\r\n \tif (message)\r\n \t{\r\n\t\t\tjConfirm(message, 'Confirma\\u00E7\\u00E3o', function(result) {\r\n\t\t\t\tif (result)\r\n\t\t\t\t\tmodalDialog2_executeCommand(window, form, action, errorDiv, waitDiv, options);\r\n\t\t\t});\r\n \t}\r\n \telse\r\n \t\tmodalDialog2_executeCommand(window, form, action, errorDiv, waitDiv, options);\r\n\t}", "function fhArrival_close() {\n\t\n\tif (fhArrival_data.currentMode == \"EDIT\") {\n\t\tif (!confirm(\"Sei sicuro di uscire senza salvare?\")) {\n\t\t\treturn false;\n\t\t}\n\t} \n\t\n\twindow.location = 'index.php?controller=arrival';\n\t\t\n}", "function showConfirm() {\n if (navigator.notification) {\n navigator.notification.confirm(\n 'Variété infos !', // message\n onConfirm, // callback to invoke with index of button pressed\n 'Variété', // title\n ['Fermer'] // buttonLabels\n );\n }\n else {\n window.alert(\"Varite infos !\");\n }\n }", "function openDialogSave($alamat,$judul,$lebar,$tinggi,$halaman, $callback){\n\tvar rand = 'save-dialog'+Math.floor((Math.random()*1000)+3);\n\tvar $dialog = jQuery(\"<div title='\" + $judul + \"'></div>\");\n\tjQuery($dialog).dialog({\n\t\tmodal:true,\t\t\n\t\theight:$tinggi,\n\t\tdialogClass: rand,\n\t\twidth:$lebar,\t\n\t\topen: function ()\n\t\t\t{ jQuery(this).load($alamat); },\n\t\tbuttons: {\n\t\t\t'Close': function() {\t\t\t\n\t\t\t\tjQuery(this).dialog('close');\n\t\t\t},\n\t\t\t'Save': function() {\n\t\t\t\t//bypass validation if halaman kosong\n\t\t\t\tif($halaman != undefined) {\n\t\t\t\t\tif(validateForm($halaman)) {\n\t\t\t\t\t\tsubmitForm(jQuery(this).find('form'), rand, $dialog, true, $callback);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsubmitForm(jQuery(this).find('form'), rand, $dialog, true, $callback);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tclose: function(ev, ui) {\n\t\t\tjQuery(this).load(OEmpty);\n\t\t}\n \t});\n}", "function _openDialog( pDialog ) {\n var lWSDlg$, lTitle, lId,\n lButtons = [{\n text : MSG.BUTTON.CANCEL,\n click : function() {\n lWSDlg$.dialog( \"close\" );\n }\n }];\n\n function _displayButton(pAction, pLabel, pHot, pClose ) {\n var lLabel, lStyle;\n\n if ( pLabel ) {\n lLabel = pLabel;\n } else {\n lLabel = MSG.BUTTON.APPLY;\n }\n if ( pHot ) {\n lStyle = 'ui-button--hot';\n }\n lButtons.push({\n text : lLabel,\n class : lStyle,\n click : function() {\n that.actions( pAction );\n if ( pClose ) {\n lWSDlg$.dialog( \"close\" );\n }\n }\n });\n }\n\n if ( pDialog==='WEBSHEET' ) {\n lTitle = MSG.DIALOG_TITLE.PROPERTIES;\n _displayButton( 'websheet_properties_save', null, true, false );\n } else if ( pDialog==='ADD_COLUMN' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_COLUMN;\n _displayButton( 'column_add', null, true, false );\n } else if ( pDialog==='COLUMN_PROPERTIES' ) {\n lTitle = MSG.DIALOG_TITLE.COLUMN_PROPERTIES;\n _displayButton( 'column_properties_save', null, true, false );\n } else if ( pDialog==='LOV' ) {\n lTitle = MSG.DIALOG_TITLE.LOV;\n lId = apex.item( \"apexir_LOV_ID\" ).getValue();\n if ( lId ) {\n _displayButton( 'lov_delete', MSG.BUTTON.DELETE, false, false );\n }\n _displayButton( 'lov_save', null, true, false );\n } else if ( pDialog==='GROUP' || pDialog==='GROUP2' ) {\n lTitle = MSG.DIALOG_TITLE.COLUMN_GROUPS;\n lId = apex.item( \"apexir_GROUP_ID\" ).getValue();\n if ( lId ) {\n _displayButton( 'column_groups_delete', MSG.BUTTON.DELETE, false, false );\n }\n _displayButton( 'column_groups_save', null, true, false );\n } else if ( pDialog==='VALIDATION' ) {\n lTitle = MSG.DIALOG_TITLE.VALIDATION;\n lId = apex.item( \"apexir_VALIDATION_ID\" ).getValue();\n if ( lId ) {\n _displayButton( 'VALIDATION_DELETE', MSG.BUTTON.DELETE, false, false );\n }\n _displayButton( 'VALIDATION_SAVE', null, true, false );\n } else if ( pDialog==='REMOVE_COLUMN' ) {\n lTitle = MSG.DIALOG_TITLE.DELETE_COLUMNS;\n _displayButton( 'column_remove', MSG.BUTTON.DELETE, true, false );\n } else if ( pDialog==='SET_COLUMN_VALUE' ) {\n lTitle = MSG.DIALOG_TITLE.SET_COLUMN_VALUES;\n _displayButton( 'set_column_value', null, true, false );\n } else if ( pDialog==='REPLACE' ) {\n lTitle = MSG.DIALOG_TITLE.REPLACE;\n _displayButton( 'replace_column_value', null, true, false );\n } else if ( pDialog==='FILL' ) {\n lTitle = MSG.DIALOG_TITLE.FILL;\n _displayButton( 'fill_column_value', null, true, false );\n } else if ( pDialog==='DELETE_ROWS' ) {\n lTitle = MSG.DIALOG_TITLE.DELETE_ROWS;\n _displayButton( 'delete_rows', MSG.BUTTON.DELETE, true, false );\n } else if ( pDialog==='COPY' ) {\n lTitle = MSG.DIALOG_TITLE.COPY_DATA_GRID;\n _displayButton( 'copy', MSG.BUTTON.COPY, true, false );\n } else if ( pDialog==='DELETE' ) {\n lTitle = MSG.DIALOG_TITLE.DELETE_DATA_GRID;\n _displayButton( 'delete_websheet', MSG.BUTTON.DELETE, true, false );\n } else if ( pDialog==='ATTACHMENT' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_FILE;\n _displayButton( 'ATTACHMENT_SAVE', null, true, true );\n } else if ( pDialog==='NOTE' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_NOTE;\n _displayButton( 'NOTE_SAVE', null, true, false );\n } else if ( pDialog==='LINK' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_LINK;\n _displayButton( 'LINK_SAVE', null, true, false );\n } else if ( pDialog==='TAGS' ) {\n lTitle = MSG.DIALOG_TITLE.ADD_TAGS;\n _displayButton( 'TAG_SAVE', null, true, false );\n }\n\n lWSDlg$ = $( \"#a-IRR-dialog-js\", apex.gPageContext$ ).dialog({\n modal : true,\n dialogClass: \"a-IRR-dialog\",\n width : \"auto\",\n height : \"auto\",\n minWidth : \"360\",\n title : lTitle,\n buttons : lButtons,\n close : function() {\n lWSDlg$.dialog( \"destroy\");\n }\n });\n }", "function optionIHateYou() {\r\n // If the user rudely refuses\r\n // to play\r\n $(this).dialog(\"close\");\r\n setChoice(\"No\");\r\n $(\"#Ihateyou\").dialog({\r\n modal: true,\r\n buttons: {\r\n Ok: function() {\r\n // the body will empty and\r\n // turn black\r\n $('body').empty();\r\n $('body').css(\"background-color\", \"black\");\r\n }\r\n }\r\n });\r\n}", "function dialogOn() {\n\n if (typeof uiVersion != 'undefined' && uiVersion === 'Minuet' && dialog !== 'active') {\n openMinuetWarningDialog();\n }\n else {\n dialog = openWarningDialog();\n }\n isDialogOn = true;\n setCounter();\n\n\n }", "function clickDialogGetOut() {\n $(function () {\n $(\"#dialog-form\").dialog({\n buttons: [\n {\n text: \"Выдать\",\n click: function () {\n $(\"#loaderClaimGive\").show();\n var userSourceId = $(\"#userSource\").val().split(\";\")[0];\n var userTargetId = $(\"#userTarget\").val().split(\";\")[0];\n var employeId = null;\n if (userTargetId) {\n employeId = userTargetId;\n } else {\n employeId = currentUserId;\n }\n\n if ($(\"#getFile\").get(0).files.length === 0) {\n clickAcceptTask(null, moment(new Date()).format(), userSourceId, $(\"#discriptionModal\").val(), $(\"#urgencyModalClaim option:selected\").text(),\n $(\"#categoryModalClaim option:selected\").text(), null, employeId);\n } else {\n sendClaimWithFile(function (itemId) {\n clickAcceptTask(null, moment(new Date()).format(), userSourceId, $(\"#discriptionModal\").val(), $(\"#urgencyModalClaim option:selected\").text(),\n $(\"#categoryModalClaim option:selected\").text(), itemId, employeId);\n });\n }\n }\n }\n ],\n title: 'Выдать Заявку: ',\n width: 600,\n modal: true,\n resizable: false\n });\n });\n}", "function irAAgregarMaestro(){\r\n\tvar msg = \"Desea Agregar un NUEVO REGISTRO?.. \";\r\n\tif(confirm(msg)) Cons_maestro(\"\", \"agregar\",tabla,titulo);\r\n}", "function DialogSuccess(message) {\n\n BootstrapDialog.show({\n type: BootstrapDialog.TYPE_SUCCESS,\n title: \"Exito\",\n message: \"<b>\" + message + \"</b>\",\n buttons: [{\n cssClass: 'btn-success',\n label: 'Cerrar',\n action: function (dialogItself) {\n location.href = $Ctr_help;\n }\n }]\n });\n}", "function abreModalAceiteParcelaDetalhe(cd_projeto, cd_proposta, cd_parcela, tx_sigla_projeto, ni_parcela) {\r\n\r\n\tvar jsonData = {'cd_projeto':cd_projeto,\r\n\t\t\t\t\t'cd_proposta': cd_proposta,\r\n\t\t\t\t\t'cd_parcela': cd_parcela,\r\n\t\t\t\t\t'tx_sigla_projeto': tx_sigla_projeto,\r\n\t\t\t\t\t'ni_parcela': ni_parcela\r\n\t\t\t\t };\r\n\teval('var buttons = {\"'+i18n.L_VIEW_SCRIPT_BTN_CANCELAR+'\": '+function(){closeDialog( 'dialog_detalhe_aceite_parcela' );}+'};');\r\n loadDialog({\r\n id : 'dialog_detalhe_aceite_parcela',\t\t\t\t\t//id do pop-up\r\n title : i18n.L_VIEW_SCRIPT_TITLE_DIALOG_ACEITE_PARCELA,\t// titulo do pop-up\r\n url : systemName + '/controle-parcela/aceite-parcela',\t// url onde encontra-se o phtml\r\n data : jsonData,\t\t\t\t\t\t\t// parametros para serem transferidos para o pop-up\r\n height : 250,\t\t\t\t\t\t\t\t\t// altura do pop-up\r\n buttons : buttons\r\n });\r\n}", "function confirmDialog() {\n let confirmDialogID = document.getElementById(\"confirmCustomDialog\");\n confirmDialogID.close();\n document.getElementById(\"resultTxt\").innerHTML=\"Confirm result: true\";\n}", "showAlertDialogFalse(){\n dialog.showMessageBox({ \n title: 'Neue Map',\n type: 'info', \n buttons: ['OK'], \n message: 'Ihr Netzwerkplan ist bereits leer.'\n });\n }", "function handleInfoEditClick() {\n\t\talert(\"준비중입니다.\");\n\t}", "function muestra(){ \nif(!$(\"#dialogoemergente\").dialog(\"isOpen\")){ \n\t$(\"#dialogoemergente\").dialog(\"open\"); \n\t} \n}", "function open(dialog) {\n\t\n}", "function actionCanceled() { \n\tOK = 3;\n\tdlg.hide();\n}", "function showEditableEquip()\n{\n\t$('#dialogEquip').dialog(\"option\", \"buttons\", [\n\t\t{\n\t\t\ttext: \"Save\",\n\t\t\tclick: function () {\n\t\t\t\tif (checkEquip()) {\n\t\t\t\t\tif ($('#copay').val()) {\n\t\t\t\t\t\tChecklistequip()\n\t\t\t\t\t\tshowNonEditableEquip()\n\t\t\t\t\t} else {\n\t\t\t\t\t\tAlert(\"Checklistequip\", \"<br>ต้องระบุจำนวนเงิน<br>จ่ายไม่ได้เลย = 0\")\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcancelAll()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t])\n\tenableInput()\n}", "accept() {\n this._dialog_ref.close('done');\n this.event.emit({ reason: 'done' });\n }", "function areYouSure(){\n\t\t$(\"#stage\").append('<div id=\"dialog-removeContent\" title=\"Remove this item from the page.\"><p class=\"validateTips\">Are you sure that you want to remove this item from your page? Selecting \"Remove\" will also remove all button links to this branch.<br/><br/>This cannot be undone!</div>');\n\n\t $(\"#dialog-removeContent\").dialog({\n modal: true,\n width: 550,\n close: function (event, ui) {\n $(\"#dialog-removeContent\").remove();\n },\n buttons: {\n Cancel: function () {\n $(this).dialog(\"close\");\n },\n Remove: function(){\n\t removeOption();\n\t $(this).dialog(\"close\");\n }\n }\n });\n\t}", "function settingDialog(exportInfo) { //设置对话框\n\n\tvar brush,\n\t\tdestination,\n\t\tresult,\n\t\ttestFolder;\n\n\tdlgMain = new Window('dialog', strTitle);\n\n\t// match our dialog background color to the host application\n\tbrush = dlgMain.graphics.newBrush(dlgMain.graphics.BrushType.THEME_COLOR, 'appDialogBackground');\n\tdlgMain.graphics.backgroundColor = brush;\n\tdlgMain.graphics.disabledBackgroundColor = dlgMain.graphics.backgroundColor;\n\n\tdlgMain.orientation = 'column';\n\tdlgMain.alignChildren = 'left';\n\n\t// -- top of the dialog, first line\n\tdlgMain.add('statictext', undefined, strLabelDestination);\n\n\t// -- two groups, one for left and one for right ok, cancel\n\tdlgMain.grpTop = dlgMain.add('group');\n\tdlgMain.grpTop.orientation = 'row';\n\tdlgMain.grpTop.alignChildren = 'top';\n\tdlgMain.grpTop.alignment = 'fill';\n\n\t// -- group top left\n\tdlgMain.grpTopLeft = dlgMain.grpTop.add('group');\n\tdlgMain.grpTopLeft.orientation = 'column';\n\tdlgMain.grpTopLeft.alignChildren = 'left';\n\tdlgMain.grpTopLeft.alignment = 'fill';\n\n\t// -- the second line in the dialog\n\tdlgMain.grpSecondLine = dlgMain.grpTopLeft.add('group');\n\tdlgMain.grpSecondLine.orientation = 'row';\n\n\tdlgMain.etDestination = dlgMain.grpSecondLine.add('edittext', undefined, exportInfo.destination.toString());\n\n\tdlgMain.etDestination.alignment = 'fill';\n\tdlgMain.etDestination.preferredSize.width = strToIntWithDefault(stretDestination, 160);\n\n\tdlgMain.btnBrowse = dlgMain.grpSecondLine.add('button', undefined, strButtonBrowse);\n\n\tdlgMain.btnBrowse.alignment = 'right';\n\n\tdlgMain.btnBrowse.onClick = function() {\n\t\tvar defaultFolder = dlgMain.etDestination.text;\n\t\ttestFolder = new Folder(dlgMain.etDestination.text);\n\t\tif (!testFolder.exists) {\n\t\t\tdefaultFolder = '~';\n\t\t}\n\t\tvar selFolder = Folder.selectDialog(strTitleSelectDestination, defaultFolder);\n\t\tif (selFolder != null) {\n\t\t\tdlgMain.etDestination.text = selFolder.fsName;\n\t\t}\n\t\tdlgMain.defaultElement.active = true;\n\t};\n\n\t// -- the third line in the dialog\n\tdlgMain.grpTopLeft.add('statictext', undefined, strLabelFileNamePrefix);\n\n\n\n\t// -- the fourth line in the dialog\n\tdlgMain.etFileNamePrefix = dlgMain.grpTopLeft.add('edittext', undefined, exportInfo.fileNamePrefix.toString());\n\tdlgMain.etFileNamePrefix.alignment = 'fill';\n\tdlgMain.etFileNamePrefix.preferredSize.width = strToIntWithDefault(stretDestination, 160);\n\n\t// start\n\t// dlgMain.grpTopLeft.add('statictext', undefined, strLabelCssUnit);\n\n\tdlgMain.cssUnitPanel = dlgMain.grpTopLeft.add('panel', undefined, strLabelCssUnit);\n\tdlgMain.cssUnitPanel.group = dlgMain.cssUnitPanel.add('group');\n\tdlgMain.cssUnitPanel.group.orientation = 'row';\n\tdlgMain.cssUnitPanel.group.alignChildren = 'left';\n\tdlgMain.cssUnitPanel.group.alignment = 'fill';\n\n\tdlgMain.cssUnitPanel.alignment = 'fill';\n\n\tdlgMain.cssUnitPx = dlgMain.cssUnitPanel.group.add('RadioButton', undefined, '');\n\tdlgMain.cssUnitPx.text = '相对单位(rem)';\n\tdlgMain.cssUnitPx.data = 'rem';\n\tdlgMain.cssUnitPx.value = true;\n\n\tdlgMain.cssUnitPx = dlgMain.cssUnitPanel.group.add('RadioButton', undefined, '');\n\tdlgMain.cssUnitPx.text = '像素(px)';\n\tdlgMain.cssUnitPx.data = 'px';\n\n\tdlgMain.cssUnitPer = dlgMain.cssUnitPanel.group.add('RadioButton', undefined, '');\n\tdlgMain.cssUnitPer.text = '百分比(%)';\n\tdlgMain.cssUnitPer.data = '%';\n\n\t// option has been removed, force export visible only\n\n\n\t// -- the fifth line in the dialog\n\tdlgMain.grpTopLeft.add('statictext', undefined, strCheckboxVisibleOnly);\n\n\n\t// -- the sixth line is the panel\n\tdlgMain.pnlFileType = dlgMain.grpTopLeft.add('panel', undefined, strLabelFileType);\n\tdlgMain.pnlFileType.alignment = 'fill';\n\n\t// -- now a dropdown list\n\tdlgMain.ddFileType = dlgMain.pnlFileType.add('dropdownlist');\n\tdlgMain.ddFileType.preferredSize.width = strToIntWithDefault(strddFileType, 100);\n\tdlgMain.ddFileType.alignment = 'left';\n\n\t// file types in the dropdown\n\tdlgMain.ddFileType.add('item', 'PNG-24');\n\tdlgMain.ddFileType.add('item', 'PNG-8');\n\tdlgMain.ddFileType.add('item', 'JPEG');\n\n\tdlgMain.ddFileType.onChange = function() {\n\t\thideAllFileTypePanel();\n\t\tswitch (this.selection.index) {\n\n\t\t\tcase png24Index:\n\t\t\t\tdlgMain.pnlFileType.pnlOptions.text = strPNG24Options;\n\t\t\t\tdlgMain.pnlFileType.pnlOptions.grpPNG24Options.show();\n\t\t\t\tbreak;\n\n\t\t\tcase png8Index:\n\t\t\t\tdlgMain.pnlFileType.pnlOptions.text = strPNG8Options;\n\t\t\t\tdlgMain.pnlFileType.pnlOptions.grpPNG8Options.show();\n\t\t\t\tbreak;\n\n\t\t\tcase jpegIndex:\n\t\t\t\tdlgMain.pnlFileType.pnlOptions.text = strJPEGOptions;\n\t\t\t\tdlgMain.pnlFileType.pnlOptions.grpJPEGOptions.show();\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tdlgMain.ddFileType.items[exportInfo.fileType].selected = true;\n\n\t// -- now after all the radio buttons\n\tdlgMain.cbIcc = dlgMain.pnlFileType.add('checkbox', undefined, strCheckboxIncludeICCProfile);\n\tdlgMain.cbIcc.value = exportInfo.icc;\n\tdlgMain.cbIcc.alignment = 'left';\n\n\t// -- now the options panel that changes\n\tdlgMain.pnlFileType.pnlOptions = dlgMain.pnlFileType.add('panel', undefined, 'Options');\n\tdlgMain.pnlFileType.pnlOptions.alignment = 'fill';\n\tdlgMain.pnlFileType.pnlOptions.orientation = 'stack';\n\tdlgMain.pnlFileType.pnlOptions.preferredSize.height = strToIntWithDefault(strpnlOptions, 100);\n\n\t// PNG8 options\n\tdlgMain.pnlFileType.pnlOptions.grpPNG8Options = dlgMain.pnlFileType.pnlOptions.add('group');\n\tdlgMain.pnlFileType.pnlOptions.grpPNG8Options.png8Trans = dlgMain.pnlFileType.pnlOptions.grpPNG8Options.add('checkbox', undefined, strCheckboxPNGTransparency.toString());\n\tdlgMain.pnlFileType.pnlOptions.grpPNG8Options.png8Inter = dlgMain.pnlFileType.pnlOptions.grpPNG8Options.add('checkbox', undefined, strCheckboxPNGInterlaced.toString());\n\tdlgMain.pnlFileType.pnlOptions.grpPNG8Options.png8Trm = dlgMain.pnlFileType.pnlOptions.grpPNG8Options.add('checkbox', undefined, strCheckboxPNGTrm.toString());\n\tdlgMain.pnlFileType.pnlOptions.grpPNG8Options.png8Trans.value = exportInfo.png8Transparency;\n\tdlgMain.pnlFileType.pnlOptions.grpPNG8Options.png8Inter.value = exportInfo.png8Interlaced;\n\tdlgMain.pnlFileType.pnlOptions.grpPNG8Options.png8Trm.value = exportInfo.png8Trim;\n\tdlgMain.pnlFileType.pnlOptions.grpPNG8Options.visible = (exportInfo.fileType == png8Index);\n\n\t// PNG24 options\n\tdlgMain.pnlFileType.pnlOptions.grpPNG24Options = dlgMain.pnlFileType.pnlOptions.add('group');\n\tdlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trans = dlgMain.pnlFileType.pnlOptions.grpPNG24Options.add('checkbox', undefined, strCheckboxPNGTransparency.toString());\n\tdlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter = dlgMain.pnlFileType.pnlOptions.grpPNG24Options.add('checkbox', undefined, strCheckboxPNGInterlaced.toString());\n\tdlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trm = dlgMain.pnlFileType.pnlOptions.grpPNG24Options.add('checkbox', undefined, strCheckboxPNGTrm.toString());\n\tdlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trans.value = exportInfo.png24Transparency;\n\tdlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter.value = exportInfo.png24Interlaced;\n\tdlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trm.value = exportInfo.png24Trim;\n\tdlgMain.pnlFileType.pnlOptions.grpPNG24Options.visible = (exportInfo.fileType == png24Index);\n\n\t// JPEG options\n\tdlgMain.pnlFileType.pnlOptions.grpJPEGOptions = dlgMain.pnlFileType.pnlOptions.add('group');\n\tdlgMain.pnlFileType.pnlOptions.grpJPEGOptions.add('statictext', undefined, strLabelQuality);\n\tdlgMain.pnlFileType.pnlOptions.grpJPEGOptions.etQuality = dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.add('edittext', undefined, exportInfo.jpegQuality.toString());\n\tdlgMain.pnlFileType.pnlOptions.grpJPEGOptions.etQuality.preferredSize.width = strToIntWithDefault(stretQuality, 30);\n\tdlgMain.pnlFileType.pnlOptions.grpJPEGOptions.visible = (exportInfo.fileType == jpegIndex);\n\n\t// the right side of the dialog, the ok and cancel buttons\n\tdlgMain.grpTopRight = dlgMain.grpTop.add('group');\n\tdlgMain.grpTopRight.orientation = 'column';\n\tdlgMain.grpTopRight.alignChildren = 'fill';\n\n\tdlgMain.btnRun = dlgMain.grpTopRight.add('button', undefined, strButtonRun);\n\n\tdlgMain.btnRun.onClick = function() {\n\t\t// add by ray\n\t\tcreateCssImgFolder();\n\t\t// get css unit\n\t\tgetCssUnit();\n\t\tdestination = dlgMain.etDestination.text;\n\t\tif (destination.length == 0) {\n\t\t\talert(strAlertSpecifyDestination);\n\t\t\treturn;\n\t\t}\n\t\ttestFolder = new Folder(destination);\n\t\tif (!testFolder.exists) {\n\t\t\talert(strAlertDestinationNotExist);\n\t\t\treturn;\n\t\t}\n\n\t\tdlgMain.close(runButtonID);\n\t};\n\n\tdlgMain.btnCancel = dlgMain.grpTopRight.add('button', undefined, strButtonCancel);\n\n\tdlgMain.btnCancel.onClick = function() {\n\t\tdlgMain.close(cancelButtonID);\n\t};\n\n\tdlgMain.defaultElement = dlgMain.btnRun;\n\tdlgMain.cancelElement = dlgMain.btnCancel;\n\n\t// the bottom of the dialog\n\tdlgMain.grpBottom = dlgMain.add('group');\n\tdlgMain.grpBottom.orientation = 'column';\n\tdlgMain.grpBottom.alignChildren = 'left';\n\tdlgMain.grpBottom.alignment = 'fill';\n\n\tdlgMain.pnlHelp = dlgMain.grpBottom.add('panel');\n\tdlgMain.pnlHelp.alignment = 'fill';\n\n\tdlgMain.etHelp = dlgMain.pnlHelp.add('statictext', undefined, strHelpText, {\n\t\tmultiline: true\n\t});\n\tdlgMain.etHelp.alignment = 'fill';\n\n\tdlgMain.onShow = function() {\n\t\tdlgMain.ddFileType.onChange();\n\t};\n\n\t// give the hosting app the focus before showing the dialog\n\tapp.bringToFront();\n\n\tdlgMain.center();\n\n\tresult = dlgMain.show();\n\n\tif (cancelButtonID == result) {\n\t\treturn result; // close to quit\n\t}\n\n\t// get setting from dialog\n\texportInfo.destination = dlgMain.etDestination.text;\n\t// kpedt force valid prefix for html\n\tif (!dlgMain.etFileNamePrefix.text.length) {\n\t\texportInfo.fileNamePrefix = 'x';\n\t} else {\n\t\texportInfo.fileNamePrefix = webStr(dlgMain.etFileNamePrefix.text);\n\t}\n\t// kpedt force visible only\n\texportInfo.visibleOnly = true;\n\texportInfo.fileType = dlgMain.ddFileType.selection.index;\n\texportInfo.icc = dlgMain.cbIcc.value;\n\texportInfo.jpegQuality = dlgMain.pnlFileType.pnlOptions.grpJPEGOptions.etQuality.text;\n\n\treturn result;\n}", "function areYouSure(){\n\t\t$(\"#stage\").append('<div id=\"dialog-removeContent\" title=\"Remove this item from the page.\"><p class=\"validateTips\">Are you sure that you want to remove this item from your page? <br/><br/>This cannot be undone!</div>');\n\n\t $(\"#dialog-removeContent\").dialog({\n modal: true,\n width: 550,\n close: function (event, ui) {\n $(\"#dialog-removeContent\").remove();\n },\n buttons: {\n Cancel: function () {\n $(this).dialog(\"close\");\n },\n Remove: function(){\n\t removeReveal();\n\t $(this).dialog(\"close\");\n }\n }\n });\n\t}", "function close_ok_dialog() {\r\n\t \tdialog.hide();\r\n\t \treturn_focus.focus();\r\n\t }", "function AddMemberHospitalSuccess() {\n\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#addMemberHospitalDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Hospital saved successfully.\", \"dialogSuccess\");\n\n memberHospitalObjData.fnDraw();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "function makeInfoDialog(id){\n\n\t$(\"#info_\"+id).dialog({\n\t\tautoOpen:false\n\t});\n\n\t$(\"#infoButton_\"+id).click(function(){\n\t\t$(\"#info_\"+id).dialog(\"open\");\n\t});\n}", "function aboutGame(){\n\tvar temp=\"\";\n\tvar img=\"\";\n\tvar Title=\"\";\n\t/// if we clicked on about the game formate about game text \n\tif(this.id === 'abutBtn'){\n\t\ttemp =window.gameInformation['abutBtn'];\n\t\timg='\\rrecources\\\\AF005415_00.gif';\n\t\tTitle=\" Game General Information \";\n\n\t}////// if we clicked on about the game formate about auther text \n\telse if(this.id === 'abouMe'){\n\t\ttemp =window.gameInformation['abouMe'];\n\t\timg='\\rrecources\\\\viber_image_2019-09-26_23-29-08.jpg';\n\t\tTitle=\" About The Auther\";\n\t}// formatting Text For Instructions\n\telse if(this.id === 'Instructions')\n\t{\n\t\ttemp =window.gameInformation['Instructions'];\n\t\timg='\\rrecources\\\\keyboard-arrows-512.png';\n\t\tTitle=\" Instructions\";\n\t}\n\n\t// create the dialog for each button alone\n\tcreatDialog(Title , temp ,img,300 );\n\t\n}", "function popup(){\n $( \"#dialog-message\" ).dialog({\n modal: true,\n buttons: {\n Start: function() {\n level ++;\n $( this ).dialog( \"close\" );\n callTimer(15);\n makeTrash(5, trashArray1);\n \n \n }\n }\n });\n}", "function abreUsuarioDialog(marker,idTarget) {\n\t// Activamos conexión con otro usuario\n\tvar index=usuarios.indexOf(idTarget);\n\tvar nombre=usuariosData[index].nombre;\n\tvar edadUser=usuariosData[index].edad;\n\tvar infoContent='<div class=\"id\">'+nombre+' ('+edadUser+')</div><div class=\"btnToChat\">chatea ></div>';\n\tinfowindow.content=infoContent;\n\tinfowindow.open(map,marker);\n\t $('.btnToChat').click(function(){\n\t\tabreChat(idTarget,index);\n\t});\n}", "function fn_mdl_mensajeClose(Message, Image, IdControl) {\r\n $(\"body\").append(\"<div id='divMessageInfoA' title='VALIDACIONES PRINCIPALES'></div>\");\r\n $(\"#divMessageInfoA\").html('<br /><table><tr><td style=\"width:35px\"><img src=\"' + Image + '\" alt=\"\"></td><td aling=\"left\" class=\"css_lbl_texto\"><strong>' + Message + '</strong></td></tr></table>');\r\n $(\"#divMessageInfoA\").dialog({\r\n modal: true\r\n , resizable: false\r\n\t , beforeclose: function (event, ui) {\r\n\t $(\"#divMessageInfoA\").remove();\r\n\t parent.closeWindow(IdControl);\r\n\t },\r\n buttons: {\r\n \"Aceptar\": function () {\r\n $(\"#divMessageInfoA\").remove();\r\n parent.closeWindow(IdControl);\r\n }\r\n }\r\n });\r\n}", "function getUserCreateForm(){\n showCreateDialog();\n}", "function showInfoDialog(movieTitle){\n passFirstRequestToOmdb(movieTitle);\n}", "function openValidityDialog(index)\r\n{\r\n\tgArrayIndex = index;\r\n\t$( \"#dlgValidity\" ).dialog( \"open\" );\r\n\t$(\"#hValidity\").text(\"Add validity details for \" + arrEntp[gArrayIndex].getEName());\t\r\n}", "function abreModalFechamentoParcelaDetalhe(cd_projeto, cd_proposta, cd_parcela, tx_sigla_projeto, ni_parcela) {\r\n\r\n\tvar jsonData = {'cd_projeto':cd_projeto,\r\n\t\t\t\t\t'cd_proposta': cd_proposta,\r\n\t\t\t\t\t'cd_parcela': cd_parcela,\r\n\t\t\t\t\t'ni_parcela': ni_parcela,\r\n\t\t\t\t\t'tx_sigla_projeto': tx_sigla_projeto\r\n\t\t\t\t };\r\n\teval('var buttons = {\"'+i18n.L_VIEW_SCRIPT_BTN_CANCELAR+'\": '+function(){closeDialog( 'dialog_detalhe_fechamento_parcela' );}+'};');\r\n loadDialog({\r\n id : 'dialog_detalhe_fechamento_parcela',\t\t//id do pop-up\r\n title : i18n.L_VIEW_SCRIPT_TITLE_DIALOG_FECHAR_PARCELA,\t// titulo do pop-up\r\n url : systemName + '/controle-parcela/fechamento-parcela',\t// url onde encontra-se o phtml\r\n data : jsonData,\t\t\t\t\t\t\t// parametros para serem transferidos para o pop-up\r\n height : 230,\t\t\t\t\t\t\t\t\t// altura do pop-up\r\n buttons : buttons\r\n });\r\n}", "function cAlert(message, idElementFocus, tipo, fnSuccessName, fnSuccessName2) {\n\n\t// verifica mensaje\n\tvar n = message.length;\n\tvar ancho = 320;\n\tvar alto = 170;\n\tif (n > 40) {\n\t\tancho = 400;\n\t\talto = 200;\n\t}\n\n\t//tipo:0\n\tif (tipo == \"0\") {\n\t\t\n\t\tvar advertencia = '<div id=\"dialog-message\" style=\"display:none;\">'\n\t\t\t\t+ message + '</div>';\n\t\t$(\"body\").append(advertencia);\n\n\t\t// carga dialog\n\t\t$(\"#dialog-message\").dialog({\n\t\t\ttitle : \"Mensaje del sistema\",\n\t\t\twidth : ancho,\n\t\t\theight : alto,\n\t\t\tmodal : true,\n\t\t\tresizable : false,\n\t\t\tcloseText : \"Cerrar\",\n\t\t\tbuttons : {\n\t\t\t\t\"Aceptar\" : function() {\n\t\t\t\t\t\n\t\t\t\t\t//cerrar dialog\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\n\t\t\t\t\t//ejecutar funcion\n\t\t\t\t\tif(fnSuccessName != \"\" && fnSuccessName != null){\n\t\t\t\t\t\teval(fnSuccessName);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\t\t\tclose : function(event, ui) {\n\n\t\t\t\t// elimina dialog\n\t\t\t\t$(\"#dialog-message\").remove();\n\n\t\t\t\t// enfoca control\n\t\t\t\tidElementFocus = \"#\" + $.trim(idElementFocus);\n\t\t\t\t$(idElementFocus).focus();\n\t\t\t}\n\t\t});\n\n\t//tipo:1\n\t} else if (tipo == \"1\") {\n\t\t\n\t\tvar advertencia = '<div id=\"dialog-message\" style=\"display:none;\">'\n\t\t\t\t+ message + '</div>';\n\t\t$(\"body\").append(advertencia);\n\n\t\t$(\"#dialog-message\").dialog({\n\t\t\ttitle : \"Mensaje del sistema\",\n\t\t\twidth : ancho,\n\t\t\theight : alto,\n\t\t\tmodal : true,\n\t\t\tresizable : false,\n\t\t\tcloseText : \"Cerrar\",\n\t\t\tbuttons : {\n\t\t\t\t\"Aceptar\" : function() {\n\t\t\t\t\twindow.location.href = \"inicio.htm\";\n\t\t\t\t}\n\t\t\t},\n\t\t\tclose : function(event, ui) {\n\n\t\t\t\t// elimina dialog\n\t\t\t\t$(\"#dialog-message\").remove();\n\n\t\t\t\twindow.location.href = \"inicio.htm\";\n\t\t\t}\n\t\t});\n\n\t//tipo:2\n\t} else if (tipo == \"2\") {\n\t\t\n\t\tvar advertencia = '<div id=\"dialog-message\" style=\"display:none;\">' + message + '</div>';\n\t\t$(\"body\").append(advertencia);\n\n\t\t$(\"#dialog-message\").dialog({\n\t\t\ttitle : \"Mensaje del sistema\",\n\t\t\twidth : 375,\n\t\t\theight : 200,\n\t\t\tmodal : true,\n\t\t\tresizable : false,\n\t\t\tcloseText : \"Cerrar\",\n\t\t\tbuttons : {\n\t\t\t\t\"Sí, satisfactoriamente\" : function() {\n\t\t\t\t\t\n\t\t\t\t\t//cerrar dialog\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\n\t\t\t\t\t//ejecutar funcion\n\t\t\t\t\tif(fnSuccessName != \"\" && fnSuccessName != null){\n\t\t\t\t\t\teval(fnSuccessName);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\t\"Generar PDF nuevamente\" : function() {\n\t\t\t\t\t\n\t\t\t\t\t//cerrar dialog\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\n\t\t\t\t\t//ejecutar funcion\n\t\t\t\t\tif(fnSuccessName2 != \"\" && fnSuccessName2 != null){\n\t\t\t\t\t\teval(fnSuccessName2);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\t\t\tclose : function(event, ui) {\n\n\t\t\t\t// elimina dialog\n\t\t\t\t$(\"#dialog-message\").remove();\n\n\t\t\t}\n\t\t});\n\t\t\n\t//tipo:3\n\t} else if (tipo == \"3\") {\n\t\t\n\t\tvar advertencia = '<div id=\"dialog-message\" style=\"display:none;\">' + message + '</div>';\n\t\t$(\"body\").append(advertencia);\n\n\t\t$(\"#dialog-message\").dialog({\n\t\t\ttitle : \"Mensaje del sistema\",\n\t\t\twidth : ancho,\n\t\t\theight : alto,\n\t\t\tmodal : true,\n\t\t\tresizable : false,\n\t\t\tcloseText : \"Cerrar\",\n\t\t\tbuttons : {\n\t\t\t\t\"Realizar Nuevo Registro\" : function() {\n\t\t\t\t\t\n\t\t\t\t\t//cerrar dialog\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\n\t\t\t\t\t//ejecutar funcion\n\t\t\t\t\tif(fnSuccessName != \"\" && fnSuccessName != null){\n\t\t\t\t\t\teval(fnSuccessName);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\t\"Ir al Menú Principal\" : function() {\n\t\t\t\t\t\n\t\t\t\t\t//cerrar dialog\n\t\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\t\t\n\t\t\t\t\t//ejecutar funcion\n\t\t\t\t\tif(fnSuccessName2 != \"\" && fnSuccessName2 != null){\n\t\t\t\t\t\teval(fnSuccessName2);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\t\t\tclose : function(event, ui) {\n\n\t\t\t\t// elimina dialog\n\t\t\t\t$(\"#dialog-message\").remove();\n\n\t\t\t}\n\t\t});\n\t}\n\n}", "function notificaAnswer()\n{\n\t$('#modalHeader').html('Nuova offerta di intervento');\n\t$('#modalBody').html('<p>Un professionista ti ha inviato il preventivo. Vuoi visualizzare la sua offerta?</p>');\n\t$('#modalFooter').html('<a href=\"javascript:accendiSeNotifica()\" class=\"btn\" data-dismiss=\"modal\">Annulla</a>'+\n\t\t\t\t\t\t '<a href=\"mostraQualcosa.html\" class=\"btn btn-primary\">Visualizza</a>');\n\t$('#panelNotifiche').modal('show');\n\tspegniSeNotifica();\n}", "function confirmUser() {\n resetOutput();\n let confirmDialogID = document.getElementById(\"confirmCustomDialog\");\n confirmDialogID.showModal();\n}", "function confirmation(){\n\t $( \"#confirmation\" ).dialog({\n\t resizable: false,\n\t height:170,\n\t width:375,\n\t autoOpen: false,\n\t modal: true,\n\t buttons: {\n\t \"Oui\": function() {\n\t $( this ).dialog( \"close\" );\n\n\t $('#image').children().remove(); \n\t $('<input type=\"file\" />').appendTo($('#image')); \n\t \t$(\".supprimer_photo\").toggle(false);\n\t \tRecupererimage(); \t \n\t \t \n\t },\n\t \"Annuler\": function() {\n\t $( this ).dialog( \"close\" );\n\t }\n\t }\n\t });\n\t}", "function confirmDeletion(){\n vex.dialog.open({\n message: \"Comment Has Been Deleted\",\n buttons:[\n $.extend({},vex.dialog.buttons.Yes,{text: \"OK\"})\n ],\n callback: function (data) {\n $(location).attr(\"href\", \"/\"); \n }\n });\n }", "function calGuiasLovNullSelectionAction(){\n\t//Indicamos en el parametro de retorno de lov que hau que poner valor null\n\tcalGuiasLovReturnParameters.id = '';\n\tcalGuiasLovReturnParameters.description = '';\n\t\n\t//Finalmente cerramos la ventana\n\twindow.close();\n}", "function confirmerSuppression() {\n let n = new Noty({\n text: 'Confirmer la suppression du frais ',\n layout: 'center',\n theme: 'sunset',\n modal: true,\n type: 'info',\n animation: {\n open: 'animated lightSpeedIn',\n close: 'animated lightSpeedOut'\n },\n buttons: [\n Noty.button('Oui', 'btn btn-sm btn-success marge ', function () {\n supprimer();\n n.close();\n }),\n Noty.button('Non', 'btn btn-sm btn-danger', function () {\n n.close();\n })\n ]\n }).show();\n}", "function AddRequestTypeSuccess() {\n\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#addRequestTypeDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Data saved successfully.\", \"dialogSuccess\");\n\n ResetRequestTypeGrid();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "showInfoBox(title, content, detail) {\r\n return this.showMessageBox({\r\n buttons: ['OK'],\r\n message: content,\r\n title,\r\n detail,\r\n type: 'info',\r\n noLink: true,\r\n }).then((answer) => {\r\n return;\r\n });\r\n }", "function settingDialog(exportInfo) {\r\n\r\n dlgMain = new Window(\"dialog\", strTitle);\r\n\r\n\tdlgMain.orientation = 'column';\r\n\tdlgMain.alignChildren = 'left';\r\n\t\r\n\t// -- top of the dialog, first line\r\n dlgMain.add(\"statictext\", undefined, strLabelDestination);\r\n\r\n\t// -- two groups, one for left and one for right ok, cancel\r\n\tdlgMain.grpTop = dlgMain.add(\"group\");\r\n\tdlgMain.grpTop.orientation = 'row';\r\n\tdlgMain.grpTop.alignChildren = 'top';\r\n\tdlgMain.grpTop.alignment = 'fill';\r\n\r\n\t// -- group contains four lines\r\n\tdlgMain.grpTopLeft = dlgMain.grpTop.add(\"group\");\r\n\tdlgMain.grpTopLeft.orientation = 'column';\r\n\tdlgMain.grpTopLeft.alignChildren = 'left';\r\n\tdlgMain.grpTopLeft.alignment = 'fill';\r\n\t\r\n\t// -- the second line in the dialog\r\n\tdlgMain.grpSecondLine = dlgMain.grpTopLeft.add(\"group\");\r\n\tdlgMain.grpSecondLine.orientation = 'row';\r\n\tdlgMain.grpSecondLine.alignChildren = 'center';\r\n\r\n dlgMain.etDestination = dlgMain.grpSecondLine.add(\"edittext\", undefined, exportInfo.destination.toString());\r\n dlgMain.etDestination.preferredSize.width = StrToIntWithDefault( stretDestination, 160 );\r\n\r\n dlgMain.btnBrowse= dlgMain.grpSecondLine.add(\"button\", undefined, strButtonBrowse);\r\n dlgMain.btnBrowse.onClick = btnBrowseOnClick;\r\n\r\n // -- the third line in the dialog\r\n dlgMain.grpThirdLine = dlgMain.grpTopLeft.add(\"statictext\", undefined, strLabelStyle);\r\n\r\n // -- the fourth line in the dialog\r\n dlgMain.etStyle = dlgMain.grpTopLeft.add(\"edittext\", undefined, exportInfo.style.toString());\r\n dlgMain.etStyle.alignment = 'fill';\r\n dlgMain.etStyle.preferredSize.width = StrToIntWithDefault( stretDestination, 160 );\r\n\r\n\t// -- the fifth line in the dialog\r\n dlgMain.cbSelection = dlgMain.grpTopLeft.add(\"checkbox\", undefined, strCheckboxSelectionOnly);\r\n dlgMain.cbSelection.value = exportInfo.selectionOnly;\r\n\r\n\t// the right side of the dialog, the ok and cancel buttons\r\n\tdlgMain.grpTopRight = dlgMain.grpTop.add(\"group\");\r\n\tdlgMain.grpTopRight.orientation = 'column';\r\n\tdlgMain.grpTopRight.alignChildren = 'fill';\r\n\t\r\n\tdlgMain.btnRun = dlgMain.grpTopRight.add(\"button\", undefined, strButtonRun );\r\n dlgMain.btnRun.onClick = btnRunOnClick;\r\n\r\n\tdlgMain.btnCancel = dlgMain.grpTopRight.add(\"button\", undefined, strButtonCancel );\r\n dlgMain.btnCancel.onClick = function() { \r\n\t\tvar d = this;\r\n\t\twhile (d.type != 'dialog') {\r\n\t\t\td = d.parent;\r\n\t\t}\r\n\t\td.close(cancelButtonID); \r\n\t}\r\n\r\n\tdlgMain.defaultElement = dlgMain.btnRun;\r\n\tdlgMain.cancelElement = dlgMain.btnCancel;\r\n\r\n\tdlgMain.grpBottom = dlgMain.add(\"group\");\r\n\tdlgMain.grpBottom.orientation = 'column';\r\n\tdlgMain.grpBottom.alignChildren = 'left';\r\n\tdlgMain.grpBottom.alignment = 'fill';\r\n \r\n dlgMain.pnlHelp = dlgMain.grpBottom.add(\"panel\");\r\n dlgMain.pnlHelp.alignment = 'fill';\r\n\r\n dlgMain.etHelp = dlgMain.pnlHelp.add(\"statictext\", undefined, strHelpText, {multiline:true});\r\n dlgMain.etHelp.alignment = 'fill';\r\n\r\n // in case we double clicked the file\r\n app.bringToFront();\r\n\r\n dlgMain.center();\r\n \r\n var result = dlgMain.show();\r\n \r\n if (cancelButtonID == result) {\r\n return result;\r\n }\r\n \r\n // get setting from dialog\r\n exportInfo.destination = dlgMain.etDestination.text;\r\n exportInfo.style = dlgMain.etStyle.text;\r\n exportInfo.selectionOnly = dlgMain.cbSelection.value;\r\n\r\n return result;\r\n}", "function showDuplicateMsg() {\n $(\"#worning-duplicate\").dialog(\"open\");\n }", "function dialogExec() {\n\n // Read saved script settings\n initParam();\n\n // Read script settings and use them for the dialog\n if (Banana.document) {\n var data = Banana.document.scriptReadSettings();\n if (data.length > 0) {\n param = JSON.parse(data);\n \n // Load saved settings\n dialog.PaidToLineEdit.text = param[\"paidTo\"];\n // dialog.DescriptionLineEdit.text = param[\"description\"];\n dialog.PaymentReceivedByLineEdit.text = param[\"paymentReceivedBy\"];\n dialog.PaidByLineEdit.text = param[\"paidBy\"];\n dialog.PreparedByLineEdit.text = param[\"preparedBy\"];\n dialog.VerifiedByLineEdit.text = param[\"verifiedBy\"];\n dialog.RecommendedByLineEdit.text = param[\"recommendedBy\"];\n dialog.ApprovedByLineEdit.text = param[\"approvedBy\"];\n // dialog.ProjectNameLineEdit.text = param[\"projectName\"];\n // dialog.ProjectNumberLineEdit.text = param[\"projectNumber\"];\n }\n }\n\n // Pause and resume are used to change the cursor aspect\n Banana.application.progressBar.pause();\n var dlgResult = dialog.exec();\n Banana.application.progressBar.resume();\n\n if (dlgResult !== 1) {\n return false;\n }\n\n // Read all the fields of the dialog and save the values as parameters \n param[\"voucherNumber\"] = dialog.VoucherNumberLineEdit.text;\n param[\"paidTo\"] = dialog.PaidToLineEdit.text;\n // param[\"description\"] = dialog.DescriptionLineEdit.text;\n \n // Read combobox and assign to each index a value\n var resPaidInComboBox = dialog.PaidInComboBox.currentIndex;\n if (resPaidInComboBox == 0) {\n param[\"paidIn\"] = \"Cash\";\n } else if (resPaidInComboBox == 1) {\n param[\"paidIn\"] = \"Bank\";\n } else if (resPaidInComboBox == 2) {\n param[\"paidIn\"] = \"Cheque\";\n } else if (resPaidInComboBox == 3) {\n param[\"paidIn\"] = \"Non Cash or Bank\";\n }\n\n param[\"chequeNumber\"] = dialog.ChequeNumberLineEdit.text;\n param[\"paymentReceivedBy\"] = dialog.PaymentReceivedByLineEdit.text;\n param[\"paidBy\"] = dialog.PaidByLineEdit.text;\n param[\"preparedBy\"] = dialog.PreparedByLineEdit.text;\n param[\"verifiedBy\"] = dialog.VerifiedByLineEdit.text;\n param[\"recommendedBy\"] = dialog.RecommendedByLineEdit.text;\n param[\"approvedBy\"] = dialog.ApprovedByLineEdit.text;\n // param[\"projectName\"] = dialog.ProjectNameLineEdit.text;\n // param[\"projectNumber\"] = dialog.ProjectNumberLineEdit.text;\n\n // Save script settings\n var paramToString = JSON.stringify(param);\n var value = Banana.document.scriptSaveSettings(paramToString);\n\n return true;\n}", "function carritoVacio() {\n\n $(\".modal-body-aviso\").text(\"Debes tener al menos un producto en el carrito para poder registrarte y confirmar la compra.\");\n $(\".btnRevisar\").hide();\n $(\"#modalAviso\").modal(\"show\");\n\n}", "function AddMemberDonateTypeSuccess() {\n\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#addMemberDonateTypeDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Donate Type saved successfully.\", \"dialogSuccess\");\n\n memberDonateTypeObjData.fnDraw();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "function resurrect_window() {\n\t// $(\"#promotion_window\").dialog({\n // modal: true,\n // width: 600,\n // autoOpen: true,\n // resizable: false,\n // dialogClass: \"promotion\",\n // buttons: [\n // {\n\n // \"id\": \"bansidh_button\",\n // click: function(){\n // resurrect('B');\n // $(\".zap_window\").fadeOut();\n // $(\"#promotion_window\").fadeOut();\n // $(\".overlay\").fadeOut();\n // }\n // },\n // {\n\n // \"id\": \"clansman_button\",\n // click: function(){\n // resurrect('P');\n // $(\".zap_window\").fadeOut();\n // $(\"#promotion_window\").fadeOut();\n // $(\".overlay\").fadeOut();\n // }\n // },\n // {\n\n // \"id\": \"champion_button\",\n // click: function(){\n // resurrect('C');\n // $(\".zap_window\").fadeOut();\n // $(\"#promotion_window\").fadeOut();\n // $(\".overlay\").fadeOut();\n // }\n // },\n // {\n\n // \"id\": \"leapingchieftain_button\",\n // click: function(){\n // resurrect('L');\n // $(\".zap_window\").fadeOut();\n // $(\"#promotion_window\").fadeOut();\n // $(\".overlay\").fadeOut();\n // }\n // },\n // {\n\n // \"id\": \"squarechieftain_button\",\n // click: function(){\n // resurrect('R');\n // $(\".zap_window\").fadeOut();\n // $(\"#promotion_window\").fadeOut();\n // $(\".overlay\").fadeOut();\n // }\n // },\n // {\n\n // \"id\": \"diagonalchieftain_button\",\n // click: function(){\n // resurrect('D');\n // $(\".zap_window\").fadeOut();\n // $(\"#promotion_window\").fadeOut();\n // $(\".overlay\").fadeOut();\n // }\n // }]\n\n // });\n\n // $(\".overlay\").fadeIn();\n $(\".zap_window\").fadeOut();\n $(\"#resurrection_window\").fadeIn();\n\n}", "function showManage(mode,num,event) {\r\n var idK = document.getElementById('karyawanid_'+num);\r\n var param = \"mode=\"+mode+\"&num=\"+num+\"&karyawanid=\"+idK.value;\r\n \r\n function respon() {\r\n if (con.readyState == 4) {\r\n if (con.status == 200) {\r\n busy_off();\r\n if (!isSaveResponse(con.responseText)) {\r\n alert('ERROR TRANSACTION,\\n' + con.responseText);\r\n } else {\r\n // Success Response\r\n showDialog1('Manajemen Personalia',con.responseText,'800','400',event);\r\n var dialog = document.getElementById('dynamic1');\r\n dialog.style.top = '10%';\r\n dialog.style.left = '15%';\r\n }\r\n } else {\r\n busy_off();\r\n error_catch(con.status);\r\n }\r\n }\r\n }\r\n \r\n post_response_text('sdm_slave_karyawanadmin_detail.php', param, respon);\r\n}", "function confirmModal() {\n var tabAch = recup_formulaire(document.modalForm, 'ach');\n for (i in tabAch) {\n newKey = i.replace(\"ach_\", \"cli_\");\n tabAch[newKey] = tabAch[i];\n delete tabAch[i];\n }\n var tabObjModal = recup_formulaire(document.modalForm, 'obj');\n //var tabObj = recup_formulaire(document.formSaisieExpress, 'obj');\n\n // tabObj['obj_prix_vente'] = tabObjModal['obj_prix_vente'];\n tabObjModal['obj_etat_new'] = \"VENDU\";\n tabObjModal['obj_etat'] = \"STOCK\";\n var tabData = Object.assign({}, tabObjModal, tabAch);\n console.log(tabData);\n closeModal();\n x_action_vendFiche(tabToString(tabData), display_fin_create);\n}", "popupRefreshGift() {\n if (this.data.type != \"gift\")\n return console.warn(\"Tried to refresh a non-gift item: \" + this);\n\n const item = this.data;\n const itemData = item.data;\n\n let confirmed = false;\n let speaker = getMacroSpeaker(this.actor);\n let dlog = new Dialog({\n title: game.i18n.format(\"urbanjungle.dialog.refreshGift.title\", { \"name\": speaker.alias }),\n content: `\n <form>\n <h1>${game.i18n.format(\"urbanjungle.dialog.refreshGift.header\", { \"item\": this.data.name, \"actor\": this.actor?.data.name })}</h1>\n <div class=\"form-group\">\n <label class=\"normal-label\">Send to chat?</label>\n <input type=\"checkbox\" id=\"send\" name=\"send\" value=\"1\" checked></input>\n </div>\n </form>\n `,\n buttons: {\n one: {\n icon: '<i class=\"fas fa-check\"></i>',\n label: game.i18n.localize(\"urbanjungle.dialog.refresh\"),\n callback: () => confirmed = true\n },\n two: {\n icon: '<i class=\"fas fa-times\"></i>',\n label: game.i18n.localize(\"urbanjungle.dialog.cancel\"),\n callback: () => confirmed = false\n }\n },\n default: \"one\",\n render: html => { },\n close: html => {\n if (confirmed) {\n this.update({ \"data.exhausted\": false });\n let SEND = html.find('[name=send]');\n let sent = SEND.length > 0 ? SEND[0].checked : false;\n\n if (sent) {\n let contents = `<div class=\"urbanjungle\"><header class=\"chat-item flexrow\">\n <img class=\"item-image\" src=\"${item.img}\" title=\"${item.name}\" width=\"20\" height=\"20\"/>\n <div class=\"chat-header-small\">${game.i18n.format(\"urbanjungle.dialog.refreshGift.chatMessage\", { \"name\": item.name })}</div>\n </header>\n </div>`;\n let chatData = {\n \"content\": contents,\n \"speaker\": speaker\n };\n ChatMessage.applyRollMode(chatData, game.settings.get(\"core\", \"rollMode\"));\n CONFIG.ChatMessage.documentClass.create(chatData);\n }\n }\n }\n });\n dlog.render(true);\n }", "function initopciones() {\n q = {};\n q.ke = _ucode;\n q.lu = _ulcod;\n q.ti = _utval;\n nombre = $(\"#nombreheader\");\n allFields = $([]).add(nombre);\n tips = $(\".validateTips\");\n\n\n $(\"#dialog-formheader\").dialog({\n autoOpen: false, height: 450, width: 500, modal: true,\n buttons: {\n \"Guardar\": function() {\n OPCION_USUARIO.savedata();\n },\n \"Cancelar\": function() {\n $(this).dialog(\"close\");\n }\n },\n close: function() {\n UTIL.clearForm('formcreate1');\n updateTips('');\n }\n });\n}", "function Volver(){\n\tvar accionTmp = get('calGuiasFrm.accion');\n\tvar origenTmp = get('calGuiasFrm.origen');\n\t\n\t//Si estamo en modo de view el volver hacia atr?s significa ejecutar un requery sobre el modo anterior\n\t//Si no simplemente es volver para atr?s\n\tif(accionTmp == 'update' && origenTmp == 'pagina'){\n\t\t//chequemaos que no se vaya a perder cambios \n\t\tif(calGuiasBuildUpdateRecordString() != calGuiasTmpUpdateValues){\n\t\t\tvar respuesta = cdos_mostrarConfirm(GestionarMensaje('MMGGlobal.update.lostchanges.message'));\n\t\t\tif(respuesta == true){\n\t\t\t\tGuardar();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\twindow.close();\n\t}else {\n\t\twindow.close();\n\t}\n}", "function OpenDialog_Upd_CategoryLevel1(IDCategoryLevel1) {\n var title = \"\";\n var width = 1200;\n var height = 900;\n if ($(\"#PositionShowDialog\").length <= 0) {\n $(\"body\").append('<div id=\"PositionShowDialog\" style=\"display:none; overflow-x:hidden; overflow-y:scroll;\" title=\"' + title + '\"></div>');\n }\n\n Fill_CategoryLevel1_Dialog_Upd(IDCategoryLevel1);\n\n $(\"#PositionShowDialog\").dialog({\n modal: true,\n width: width,\n //open: setTimeout('Change_TextareaToTinyMCE_OnPopup(\"#txt_InfoAlbumLang1\")', 2000), // Cần phải có settimeout,\n \n height: height,\n resizable: false,\n show: {\n effect: \"clip\",\n duration: 1000\n },\n hide: {\n effect: \"explode\",\n duration: 1000\n },\n\n buttons: {\n 'Đóng': function () {\n $(this).dialog('close');\n },\n 'Sửa': function () {\n //Save_Multi_TinyMCE(\"txt_Info_Lang\", sys_NumLang);\n Upd_CategoryLevel1(IDCategoryLevel1);\n \n $(this).dialog('close');\n }\n },\n close: function () {\n\n }\n });\n}", "function openAlertlogoutWithChanges() {\n\tvar dialogChanges = {\n\t\ttype: \"confirmation\",\n\t\tcancelText: \"ABANDON CHANGES\",\n\t\tacceptText: \"KEEP CHANGES\",\n\t\ttext: \"Changes have been done in the Learn & Shop. How would you like to proceed?\",\n\t\tacceptEvent: \"keepLogoutWithChanges\",\n\t\tcancelEvent: \"logout\",\n\t\tsize: \"modal-small\"\n\t};\n\tthis.ModalHelper.show(dialogChanges);\n}", "function viewFR(id){\n // $.Dialog({\n $.Dialog({\n shadow: true,\n overlay: true,\n draggable: true,\n width: 500,\n padding: 10,\n onShow: function(){\n var titlex='';\n\n // form :: departemen (disabled field) -----------------------------\n $.ajax({\n url:dir2,\n data:'aksi=cmb'+mnu2+'&replid='+$('#departemenS').val(),\n type:'post',\n dataType:'json',\n success:function(dt){\n titlex+='';\n $('#departemenH').val($('#departemenS').val());\n $('#tahunajaranH').val($('#tahunajaranS').val());\n $('#tingkatH').val($('#tingkatS').val());\n var out;\n if(dt.status!='sukses'){\n out=dt.status;\n }else{\n out=dt.departemen[0].nama;\n }$('#departemenTB').val(out);\n \n // form :: tahun ajaran (disabled field) --------------\n $.ajax({\n url:dir3,\n // data:'aksi=cmbtahunajaran&departemen='+$('#departemenS').val()+'&replid='+$('#tahunajaranS').val(),\n data:'aksi=cmbtahunajaran&replid='+$('#tahunajaranS').val(),\n dataType:'json',\n type:'post',\n success:function(dt2){\n // alert(titlex+' ok');\n var out2;\n if(dt.status!='sukses'){\n out2=dt2.status;\n }else{\n out2=dt2.tahunajaran[0].tahunajaran;\n }$('#tahunajaranTB').val(out2);\n \n // form :: tingkat (disabled field) --------------\n $.ajax({\n url:dir4,\n data:'aksi=cmbtingkat&replid='+$('#tingkatS').val(),\n dataType:'json',\n type:'post',\n success:function(dt3){\n // alert(titlex+' ok');\n var out3;\n if(dt3.status!='sukses'){\n out3=dt3.status;\n }else{\n out3=dt3.tingkat[0].tingkat;\n }$('#tingkatTB').val(out3);\n \n if (id!='') { // edit mode\n // form :: edit :: tampilkan data \n $.ajax({\n url:dir,\n data:'aksi=ambiledit&replid='+id,\n type:'post',\n dataType:'json',\n success:function(dt3){\n $('#idformH').val(id);\n $('#kelasTB').val(dt3.kelas);\n $('#kapasitasTB').val(dt3.kapasitas);\n $('#waliTB').val(dt3.wali);\n $('#keteranganTB').val(dt3.keterangan);\n }\n });\n // end of form :: edit :: tampilkan data \n // titlex='<span class=\"icon-pencil\"></span> Ubah ';\n titlex+='<span class=\"icon-pencil\"></span> Ubah ';\n }else{ //add mode\n // alert('judul ='+titlex);\n titlex+='<span class=\"icon-plus-2\"></span> Tambah ';\n // titlex='<span class=\"icon-plus-2\"></span> Tambah ';\n }\n }\n });\n\n }\n });\n // alert(titlex);\n //end of form :: tahun ajaran (disabled field) --------------\n }\n });\n //end of form :: departemen (disabled field) -----------------------------\n $.Dialog.title(titlex+' '+mnu);\n $.Dialog.content(contentFR);\n }\n });\n }", "function mapInform(title, message) {\r\n\t\tvar content = '<h2>' + title + '</h2><p>' + message + '</p> <a class = \"button\" href = \"#\" id = \"mapConfirm\">OK</a>'; \r\n\t\topenModalBox(content, false);\r\n\t\t$(\"#mapConfirm\").click(function(e){\r\n\t\t\te.preventDefault();\r\n\t\t\tcloseModalBox();\r\n\t\t\t$['mapsettings'].element.trigger('finishPrompt');\r\n\t\t});\r\n\t}", "function confirmarLiz () {\n\tliz.lizOK = true;\n\tdibujar();\n}" ]
[ "0.69468594", "0.68498343", "0.6839529", "0.6814066", "0.67721844", "0.66275126", "0.6597601", "0.6576382", "0.6532506", "0.6525526", "0.6498749", "0.644756", "0.6444631", "0.64414155", "0.6421334", "0.6398535", "0.63751554", "0.63565385", "0.6335139", "0.6313727", "0.627246", "0.6268285", "0.625434", "0.6249398", "0.6245115", "0.6243246", "0.6242532", "0.6241976", "0.6241976", "0.62331855", "0.62275445", "0.62234217", "0.6216802", "0.6214285", "0.6214026", "0.6212626", "0.6210087", "0.62030435", "0.6202584", "0.61955327", "0.61887085", "0.61869735", "0.6176921", "0.6171035", "0.61616", "0.6158744", "0.61580753", "0.6156219", "0.61489207", "0.61483014", "0.61438596", "0.61364174", "0.6135285", "0.613316", "0.6117226", "0.61024714", "0.6096511", "0.6082702", "0.60778725", "0.6077517", "0.60739666", "0.60723114", "0.6066397", "0.6066217", "0.60657054", "0.6051643", "0.60488474", "0.6047364", "0.604508", "0.6044402", "0.60435015", "0.60278463", "0.60274595", "0.60257", "0.6025234", "0.6023196", "0.6021701", "0.60175306", "0.60145026", "0.60110086", "0.60053295", "0.6000545", "0.5999586", "0.5998341", "0.59983236", "0.5990389", "0.5983344", "0.598295", "0.5978893", "0.597879", "0.5977904", "0.5976748", "0.5973173", "0.597301", "0.5972691", "0.59651095", "0.59612465", "0.5960416", "0.59597224", "0.59595096", "0.5958971" ]
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n if (each.score >= 0.4) {\n objectDescription = objectDescription + \", \" + each.class\n }\n })\n tj.speak(\"The objects I see are: \" + objectDescription)\n });\n}", "function recommendNewPosts() {\n model.loadModel();\n getNewPosts(function (err, posts) {\n var label\n ;\n posts.forEach(function (post) {\n label = model.classifyPost(post);\n if (label == 'like') {\n console.log(post);\n }\n });\n });\n }", "function BOT_onLike() {\r\n\tBOT_traceString += \"GOTO command judge\" + \"\\n\"; // change performative\r\n\tBOT_theReqJudgement = \"likeable\";\r\n\tBOT_onJudge(); \t\r\n\tif(BOT_reqSuccess) {\r\n\t\tvar ta = [BOT_theReqTopic,BOT_theReqAttribute]; \r\n\t\tBOT_del(BOT_theUserTopicId,\"distaste\",\"VAL\",ta);\r\n\t\tBOT_add(BOT_theUserTopicId,\"preference\",\"VAL\",ta);\r\n\t}\r\n}", "function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "function LanguageUnderstandingModel() {\n }", "function guess() {\n classifier.predict(video.elt, 5, gotResult);\n}", "function theBigBang() {\n\t\tinitLibs();\n\t\tinitFuncs();\n\t\tObject.setPrototypeOf(Universe.prototype, universe.kjsclasses._primitive_prototype);\n\t\tObject.setPrototypeOf(Object.prototype, universe); // [0]\n\t}", "function readOwn(obj, name, pumpkin) {\n if (typeof obj !== 'object' || !obj) {\n if (typeOf(obj) !== 'object') {\n return pumpkin;\n }\n }\n if (typeof name === 'number' && name >= 0) {\n if (myOriginalHOP.call(obj, name)) { return obj[name]; }\n return pumpkin;\n }\n name = String(name);\n if (obj[name + '_canRead___'] === obj) { return obj[name]; }\n if (!myOriginalHOP.call(obj, name)) { return pumpkin; }\n // inline remaining relevant cases from canReadPub\n if (endsWith__.test(name)) { return pumpkin; }\n if (name === 'toString') { return pumpkin; }\n if (!isJSONContainer(obj)) { return pumpkin; }\n fastpathRead(obj, name);\n return obj[name];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach(function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)})}", "function NXObject() {}", "function isPrimative(val) { return (typeof val !== 'object') }", "function like (data, duck) {\n var name;\n\n assert.object(data);\n assert.object(duck);\n\n for (name in duck) {\n if (duck.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof duck[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], duck[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "static get observedAttributes() {\n return ['rainbow', 'lang'];\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach((function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)}))}", "function testSimpleHole_prototype() {\n var theHole = Object.create({ x: \"in proto\" });\n var theReplacement = \"yay\";\n var serialized = bidar.serialize(theHole, holeFilter);\n var parsed = bidar.parse(serialized, holeFiller);\n\n assert.equal(parsed, theReplacement);\n\n function holeFilter(x) {\n assert.equal(x, theHole);\n return { data: \"blort\" };\n }\n\n function holeFiller(x) {\n assert.equal(x, \"blort\");\n return theReplacement;\n }\n}", "function test() {\n\t// \"ex nihilo\" object creation using the literal\n\t// object notation {}.\n\tvar foo = {\n\t\tname : \"foo\",\n\t\tone : 1,\n\t\ttwo : 2\n\t};\n\n\t// Another \"ex nihilo\" object.\n\tvar bar = {\n\t\ttwo : \"two\",\n\t\tthree : 3\n\t};\n\n\t// Gecko and Webkit JavaScript engines can directly\n\t// manipulate the internal prototype link.\n\t// For the sake of simplicity, let us pretend\n\t// that the following line works regardless of the\n\t// engine used:\n\tbar.__proto__ = foo; // foo is now the prototype of bar.\n\n\t// If we try to access foo's properties from bar\n\t// from now on, we'll succeed.\n\tlog(bar.one) // Resolves to 1.\n\n\t// The child object's properties are also accessible.\n\tlog(bar.three) // Resolves to 3.\n\n\t// Own properties shadow prototype properties\n\tlog(bar.two); // Resolves to \"two\"\n\tlog(foo.name); // unaffected, resolves to \"foo\"\n\tlog(bar.name); // Resolves to \"foo\"\n log(foo.__proto__);\n}", "function wrappedPrimitivePreviewer(className, classObj, objectActor, grip) {\r\n let {_obj} = objectActor;\r\n\r\n if (!_obj.proto || _obj.proto.class != className) {\r\n return false;\r\n }\r\n\r\n let raw = _obj.unsafeDereference();\r\n let v = null;\r\n try {\r\n v = classObj.prototype.valueOf.call(raw);\r\n } catch (ex) {\r\n // valueOf() can throw if the raw JS object is \"misbehaved\".\r\n return false;\r\n }\r\n\r\n if (v === null) {\r\n return false;\r\n }\r\n\r\n let canHandle = GenericObject(objectActor, grip, className === \"String\");\r\n if (!canHandle) {\r\n return false;\r\n }\r\n\r\n grip.preview.wrappedValue = objectActor.getGrip(makeDebuggeeValueIfNeeded(_obj, v));\r\n return true;\r\n}", "function DartObject(o) {\n this.o = o;\n}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function likeVsLikes(toyLikeCount){\n\t\tif (toyLikeCount == 1){\n\t\t\treturn 'Like';\n\t\t} else {\n\t\t\treturn 'Likes';\n\t\t}\n\t}", "constructor(spec) {\n this.cached = /* @__PURE__ */ Object.create(null);\n let instanceSpec = this.spec = {};\n for (let prop in spec)\n instanceSpec[prop] = spec[prop];\n instanceSpec.nodes = OrderedMap.from(spec.nodes), instanceSpec.marks = OrderedMap.from(spec.marks || {}), this.nodes = NodeType$1.compile(this.spec.nodes, this);\n this.marks = MarkType.compile(this.spec.marks, this);\n let contentExprCache = /* @__PURE__ */ Object.create(null);\n for (let prop in this.nodes) {\n if (prop in this.marks)\n throw new RangeError(prop + \" can not be both a node and a mark\");\n let type = this.nodes[prop], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] || (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n type.markSet = markExpr == \"_\" ? null : markExpr ? gatherMarks(this, markExpr.split(\" \")) : markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (let prop in this.marks) {\n let type = this.marks[prop], excl = type.spec.excludes;\n type.excluded = excl == null ? [type] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n this.nodeFromJSON = this.nodeFromJSON.bind(this);\n this.markFromJSON = this.markFromJSON.bind(this);\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n this.cached.wrappings = /* @__PURE__ */ Object.create(null);\n }", "wordClass(word) {\r\n return {\r\n der: word.artikel == \"der\",\r\n die: word.artikel == \"die\",\r\n das: word.artikel == \"das\",\r\n marked: word.marker\r\n }\r\n }", "function dummyObjects(name, age){\n this.name = name\n this.age = age\n}", "function handleLikes() {\n // Get a random number\n let randomNumber = Math.random();\n // To make it unpredictable, only change the likes if =>\n if (randomNumber < REVEAL_PROBABILITY) {\n defineLikes();\n }\n}", "constructor() { \n \n Like.initialize(this);\n }", "like() {\r\n return this.clone(Comment, \"Like\").postCore();\r\n }", "like() {\r\n return this.getItem().then(i => {\r\n return i.like();\r\n });\r\n }", "added(vrobject){}", "classify(phrase) { return this.clf.classify(phrase) }", "function badIdea(){\n this.idea = \"bad\";\n}", "shouldSerialize(prop, dataKey) {\n const contains = (str, re) => (str.match(re) || []).length > 0;\n const a = contains(dataKey, /\\./g);\n const b = contains(dataKey, /\\[/g);\n return !!prop.object && !(a || b);\n }", "static get observedAttributes(){this.finalize();const e=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nreturn this._classProperties.forEach((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))}),e}", "function oldAndLoud(object){\n\tobject.age++;\n\tobject.name = object.name.toUpperCase();\n}", "like() {\r\n return this.clone(Item, \"like\").postCore();\r\n }", "function classifyPose() {\n if (pose && working) {\n inputs = [];\n for (let i = 0; i < pose.landmarks.length; i++) {\n inputs.push(pose.landmarks[i][0]);\n inputs.push(pose.landmarks[i][1]);\n inputs.push(pose.landmarks[i][2]);\n }\n brain.classify(inputs, gotResult)\n }\n }", "function PropertyDetection() {}", "constructor()\n {\n this.likes = [];\n }", "async TestLikeDoctorPost(){\n var response = await entity.Likes(6,28,true,true);\n //console.log(response)\n if(response != null){\n console.log(\"\\x1b[32m%s\\x1b[0m\",\"TestDOctorRating Passed\");\n }else{\n console.log(\"\\x1b[31m%s\\x1b[0m\",\"TestDOctorRating Failed\");\n }\n\n }", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function classifyVideo() {\n classifier.predict(gotResult);\n}", "function showLikes(likes) {\n\tconsole.log(`THINGS I LIKE:\\n`);\n\tfor(let like of likes) {\n\t\tconsole.log(like);\n\t}\n}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "function Nevis() {}", "function Nevis() {}", "function Nevis() {}", "test_primitivesExtended() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitivesExtended);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.PrimitivesExtended\", object.constructor.__getClass());\n Assert.equals(\"alpha16\", object.string);\n }", "function buildObjectsObj(gCloudV, azureCV, minScore = 0.0){\n let objects = [];\n\n if(gCloudV) {// gcloud vision results are available\n let gCloudObjects = gCloudV['localizedObjectAnnotations'];\n\n //apply standard bounding box to all the detected objects\n if(azureCV)// azure computer vision results are available\n gCloudVObjsToCogniBoundingBox(gCloudObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n\n else//need to retrieve image sizes from gcloud (already done and put in the metadata tag of gcloudv with appropriate calls)\n gCloudVObjsToCogniBoundingBox(gCloudObjects, gCloudV['metadata']['width'], gCloudV['metadata']['height']);\n\n for (let gCloudObj of gCloudObjects) {\n if (gCloudObj['score'] > minScore) { //filter out unwanted tags\n objects.push({\n name: gCloudObj['name'],\n mid: (gCloudObj['mid'] && gCloudObj['mid']!= '')? gCloudObj['mid']: undefined,\n confidence: gCloudObj['score'],\n boundingBox: gCloudObj['boundingBox']\n });\n }\n }\n }\n\n if(azureCV){// azure computer vision results are available\n let azureObjects = azureCV['objects'];\n //apply standard bounding box to all the detected objects\n azureCVObjsToCogniBoundingBox(azureObjects, azureCV['metadata']['width'], azureCV['metadata']['height']);\n for(let aObj of azureObjects){\n if(aObj['confidence'] > minScore) { //filter out unwanted tags\n objects.push({\n name: aObj['object'],\n confidence: aObj['confidence'],\n boundingBox: aObj['boundingBox']\n });\n }\n }\n }\n\n objects = combineObjectsArray(objects);// build an array where labels regarding the same exact object are combined with averaged confidence\n\n objects.sort((a, b) => {\n if(a['confidence']>b['confidence'])\n return -1;\n else if(a['confidence']==b['confidence'])\n return 0;\n else\n return 1;\n });\n\n return objects;\n}", "function V(e){if(null===e||\"[object Object]\"!==function(e){return Object.prototype.toString.call(e)}(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}", "function classifyVideo() {\r\n classifier.classify(vid, gotResult);\r\n\r\n}", "function test_nountag_does_not_think_it_has_watch_tag_when_it_does_not() {\n Assert.equal(TagNoun.fromJSON(\"watch\"), undefined);\n}", "function v11(v12,v13) {\n const v15 = v11(Object,Function);\n // v15 = .unknown\n const v16 = Object(v13,v8,0,v6);\n // v16 = .object()\n const v17 = 0;\n // v17 = .integer\n const v18 = 1;\n // v18 = .integer\n const v19 = 512;\n // v19 = .integer\n const v20 = \"-1024\";\n // v20 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v21 = isFinite;\n // v21 = .function([.anything] => .boolean)\n const v23 = [1337];\n // v23 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v24 = {};\n // v24 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v25 = v23;\n const v26 = -29897853;\n // v26 = .integer\n const v27 = \"replace\";\n // v27 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v28 = Boolean;\n // v28 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v30 = [13.37,13.37];\n // v30 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v31 = 1337;\n // v31 = .integer\n let v32 = 13.37;\n const v36 = [13.37,13.37,13.37];\n // v36 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v38 = [1337,1337];\n // v38 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v39 = [13.37,1337,v38,1337,\"-128\",13.37,\"-128\",\"-128\",2147483647,1337];\n // v39 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v40 = {__proto__:v36,length:v39};\n // v40 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"length\"])\n const v41 = \"0\";\n // v41 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v42 = -4130093409;\n // v42 = .integer\n const v44 = {b:2147483647,e:v38,valueOf:v36};\n // v44 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\", \"valueOf\", \"e\"])\n const v45 = \"k**baeaDif\";\n // v45 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v46 = 65536;\n // v46 = .integer\n const v47 = \"k**baeaDif\";\n // v47 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v48 = 13.37;\n // v48 = .float\n const v50 = [13.37,13.37];\n // v50 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v51 = ~v50;\n // v51 = .boolean\n const v53 = [13.37];\n // v53 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n let v54 = v53;\n const v55 = gc;\n // v55 = .function([] => .undefined)\n const v58 = [13.37,13.37,13.37,13.37];\n // v58 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v60 = [1337,1337,1337,1337];\n // v60 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v61 = [3697200800,v58,v60];\n // v61 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v62 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v61};\n // v62 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"length\", \"constructor\", \"toString\", \"valueOf\"])\n const v65 = [13.37,13.37,13.37,13.37];\n // v65 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v67 = [1337,1337,1337,1337];\n // v67 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v68 = [3697200800,v65,v67];\n // v68 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v69 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v68};\n // v69 = .object(ofGroup: Object, withProperties: [\"e\", \"constructor\", \"__proto__\", \"length\", \"toString\", \"valueOf\"])\n const v70 = Object;\n // v70 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n function v71(v72) {\n }\n const v74 = [13.37];\n // v74 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v75 = 1337;\n // v75 = .integer\n const v76 = v44 ** 13.37;\n // v76 = .integer | .float | .bigint\n function v77(v78,v79,v80,v81,v82) {\n }\n let v83 = v74;\n const v84 = \"2\";\n // v84 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v85 = \"2\";\n // v85 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v88 = [13.37,13.37,1337,13.37];\n // v88 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v89(v90,v91,v92) {\n }\n const v94 = [1337,1337,1337,1337];\n // v94 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v95 = [3697200800,v88,v94];\n // v95 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v96(v97,v98) {\n }\n const v99 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,d:v95};\n // v99 = .object(ofGroup: Object, withProperties: [\"toString\", \"length\", \"constructor\", \"__proto__\", \"e\", \"d\"])\n let v100 = 13.37;\n const v101 = typeof v74;\n // v101 = .string\n const v102 = \"symbol\";\n // v102 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v103 = 3697200800;\n // v103 = .integer\n const v104 = \"2\";\n // v104 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v105 = Boolean;\n // v105 = .object(ofGroup: BooleanConstructor, withProperties: [\"prototype\"]) + .function([.anything] => .boolean) + .constructor([.anything] => .boolean)\n const v106 = Function;\n // v106 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v107 = 13.37;\n // v107 = .float\n const v108 = 1337;\n // v108 = .integer\n const v109 = \"2\";\n // v109 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v110 = Function;\n // v110 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v112 = [13.37,13.37,13.37,13.37];\n // v112 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v113 = 1337;\n // v113 = .integer\n let v114 = 13.37;\n const v116 = {...3697200800,...3697200800};\n // v116 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n const v117 = Object;\n // v117 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v118 = Function;\n // v118 = .constructor([.string] => .object(ofGroup: Function, withProperties: [\"constructor\", \"arguments\", \"__proto__\", \"name\", \"caller\", \"prototype\", \"length\"], withMethods: [\"call\", \"bind\", \"apply\"]) + .function([.anything...] => .unknown) + .constructor([.anything...] => .unknown))\n const v119 = {};\n // v119 = .object(ofGroup: Object, withProperties: [\"__proto__\"])\n let v120 = v119;\n const v121 = (3697200800).constructor;\n // v121 = .unknown\n function v122(v123,v124) {\n }\n const v125 = Promise;\n // v125 = .object(ofGroup: PromiseConstructor, withProperties: [\"prototype\"], withMethods: [\"race\", \"allSettled\", \"reject\", \"all\", \"resolve\"]) + .constructor([.function()] => .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"]))\n const v128 = 4;\n // v128 = .integer\n let v129 = 0;\n const v131 = [13.37,13.37,13.37,13.37];\n // v131 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v133 = [1337,1337,1337,1337];\n // v133 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v134 = [3697200800,v131,v133];\n // v134 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v135 = Object;\n // v135 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v136 = -944747134;\n // v136 = .integer\n const v139 = [13.37,13.37,13.37,13.37];\n // v139 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v141 = [1337,1337,1337,1337];\n // v141 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v142 = [3697200800,v139,v141];\n // v142 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v143 = {__proto__:3697200800,constructor:1337,e:3697200800,length:13.37,toString:3697200800,valueOf:v142};\n // v143 = .object(ofGroup: Object, withProperties: [\"toString\", \"constructor\", \"e\", \"__proto__\", \"valueOf\", \"length\"])\n let v144 = v143;\n const v145 = gc;\n // v145 = .function([] => .undefined)\n let v146 = 13.37;\n const v150 = [13.37,13.37,13.37,Function];\n // v150 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v152 = [1337,1337,1337,1337];\n // v152 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v153 = [3697200800,v150,v152];\n // v153 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v154 = v153 + 1;\n // v154 = .primitive\n let v155 = 0;\n const v156 = v155 + 1;\n // v156 = .primitive\n const v158 = \"2\";\n // v158 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n const v160 = [13.37,13.37,13.37,13.37];\n // v160 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v162 = 0;\n // v162 = .integer\n const v163 = [1337,1337,1337,1337];\n // v163 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v164 = [3697200800,1337,v163];\n // v164 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v166 = 1337;\n // v166 = .integer\n let v167 = 2594067260;\n const v169 = 4;\n // v169 = .integer\n let v170 = 0;\n const v171 = v167 + 1;\n // v171 = .primitive\n const v172 = {__proto__:3697200800,constructor:v163,e:3697200800,length:13.37,toString:3697200800,valueOf:v164};\n // v172 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"constructor\", \"valueOf\", \"length\", \"toString\"])\n const v173 = 0;\n // v173 = .integer\n const v174 = 5;\n // v174 = .integer\n const v175 = 2937513072;\n // v175 = .integer\n const v176 = Object;\n // v176 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"setPrototypeOf\", \"assign\", \"fromEntries\", \"seal\", \"getOwnPropertyNames\", \"freeze\", \"defineProperty\", \"create\", \"getPrototypeOf\", \"getOwnPropertySymbols\", \"keys\", \"values\", \"isExtensible\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"preventExtensions\", \"defineProperties\", \"getOwnPropertyDescriptors\", \"isSealed\", \"isFrozen\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v177 = v172.constructor;\n // v177 = .unknown\n const v178 = 0;\n // v178 = .integer\n const v179 = 1;\n // v179 = .integer\n try {\n } catch(v180) {\n const v182 = [13.37,13.37,13.37,13.37];\n // v182 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v183 = v182.__proto__;\n // v183 = .object()\n function v185(v186) {\n }\n const v187 = Object >>> v183;\n // v187 = .integer | .bigint\n }\n function v188(v189,v190,v191,v192,...v193) {\n }\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "transient private internal function m185() {}", "function rekognizeLabels(bucket, key) {\n let params = {\n Image: {\n S3Object: {\n Bucket: bucket,\n Name: key\n }\n },\n MaxLabels: 3,\n MinConfidence: 80\n };\n\n return rekognition.detectLabels(params).promise()\n}", "test_doNotRetainAnno(){\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.doNotRetainAnno);\n let object1 = translator.decode(text).getRoot();\n let object2 = translator.decode(text).getRoot();\n\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object1.constructor.__getClass());\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.DoNotRetainAnno\", object2.constructor.__getClass());\n Assert.notEquals(object1, object2);\n }", "function LK_likeIt(elem) {\n var likeGroup = elem.getAttribute(LK_LIKEGROUP);\n var likeValue = elem.getAttribute(LK_LIKEVALUE);\n localStorage[likeGroup] = likeValue;\n\n // Change the style of the liker nodes\n var siblings = elem.parentNode.childNodes;\n for (var i = 0; i < siblings.length; i++) {\n if (siblings[i].style) { \n LK_applyNormalStyle(siblings[i]);\n }\n }\n LK_applySelectedStyle(elem, likeValue);\n\n // Change the value of any mini likers\n var allSpans = document.getElementsByTagName('span');\n for (var i = 0; i < allSpans.length; i++) {\n var span = allSpans[i];\n if (span.getAttribute(LK_LIKEGROUP) == likeGroup) {\n if (span.getAttribute(LK_LIKETYPE) == 'mini') {\n span.innerHTML = LK_MAPPINGS[likeValue].label;\n LK_applySelectedStyle(allSpans[i], likeValue);\n }\n }\n }\n}", "function OOPExample(who) {\n this.me = who;\n}", "getLikes(state, data) {\n state.likes = data\n }", "function _isAlternativeRecognitionResult(obj) {\r\n return obj && typeof obj === 'object';\r\n}", "function addLikes() {\n if (propLike?.includes(user.username)) {\n let index = propLike.indexOf(user.username);\n let removeLike = [\n ...propLike.slice(0, index),\n ...propLike.slice(index + 1),\n ];\n setLikeGet(removeLike);\n setPropLike(removeLike);\n setRedLike(\"\");\n\n addToLike(eventid, removeLike);\n } else {\n let likesArr = [...propLike, `${user.username}`];\n\n setLikeGet(likesArr);\n setPropLike(likesArr);\n setRedLike(\"red\");\n addToLike(eventid, likesArr);\n }\n }", "function LiteralObject() {\r\n}", "function Komunalne() {}", "function Bevy() {}", "function Prediction() {\n this.score = {};\n}", "function Object() {}", "function Object() {}", "function canEnumPub(obj, name) {\n if (obj === null) { return false; }\n if (obj === void 0) { return false; }\n name = String(name);\n if (obj[name + '_canEnum___']) { return true; }\n if (endsWith__.test(name)) { return false; }\n if (!isJSONContainer(obj)) { return false; }\n if (!myOriginalHOP.call(obj, name)) { return false; }\n fastpathEnum(obj, name);\n if (name === 'toString') { return true; }\n fastpathRead(obj, name);\n return true;\n }", "function Obj(){ return Literal.apply(this,arguments) }", "test_primitives() {\n let translator = new Translator();\n translator.registerPackage(PackageFile);\n let text = JSON.stringify(this.json.primitives);\n let object = translator.decode(text).getRoot();\n Assert.equals(\"ca.frar.jjjrmi.translator.testclasses.Primitives\", object.constructor.__getClass());\n Assert.equals(\"alpha9\", object.string);\n }", "function hello()\n{\n /* ATTRIBUTES */\n this.coolbeans = 'class';\n this.something = 'hello-class';\n\n}", "function test_cluster_tagged_crosshair_op_vsphere65() {}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "function classifyVideo() {\n classifier.classify(gotResult);\n}", "constructor(papa,mummy,sivlings,belongs,loving_bro,favs_bro){\n super(papa,mummy,sivlings,belongs)\n this.loving_bro=loving_bro\n this.favs_bro=favs_bro\n }", "function v8(v9,v10) {\n const v16 = [1337,1337];\n // v16 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v17 = [\"536870912\",-3848843708,v16,-3848843708,1337,13.37,13.37,WeakMap,-3848843708];\n // v17 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v18 = {constructor:13.37,e:v16};\n // v18 = .object(ofGroup: Object, withProperties: [\"constructor\", \"e\", \"__proto__\"])\n const v19 = {__proto__:-3848843708,a:v18,b:-3848843708,constructor:1337,d:v18,e:v17,length:WeakMap};\n // v19 = .object(ofGroup: Object, withProperties: [\"d\", \"b\", \"a\", \"__proto__\", \"e\", \"constructor\", \"length\"])\n const v21 = new Float64Array(v19);\n // v21 = .object(ofGroup: Float64Array, withProperties: [\"byteOffset\", \"constructor\", \"buffer\", \"__proto__\", \"byteLength\", \"length\"], withMethods: [\"map\", \"values\", \"subarray\", \"find\", \"fill\", \"set\", \"findIndex\", \"some\", \"reduceRight\", \"reverse\", \"join\", \"includes\", \"entries\", \"reduce\", \"every\", \"copyWithin\", \"sort\", \"forEach\", \"lastIndexOf\", \"indexOf\", \"filter\", \"slice\", \"keys\"])\n v6[6] = v7;\n v7.toString = v9;\n }", "function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol[\"a\" /* default */]) {\n classObject.prototype[nodejsCustomInspectSymbol[\"a\" /* default */]] = fn;\n }\n}", "annotate(message: string, data: Object) {\n this.message = message;\n this.data = assign(this.data, data);\n }", "function encodeObject(o) {\n if (_.isNumber(o)) {\n if (_.isNaN(o)) {\n return ['SPECIAL_FLOAT', 'NaN'];\n } else if (o === Infinity) {\n return ['SPECIAL_FLOAT', 'Infinity'];\n } else if (o === -Infinity) {\n return ['SPECIAL_FLOAT', '-Infinity'];\n } else {\n return o;\n }\n } else if (_.isString(o)) {\n return o;\n } else if (_.isBoolean(o) || _.isNull(o) || _.isUndefined(o)) {\n return ['JS_SPECIAL_VAL', String(o)];\n } else if (typeof o === 'symbol') {\n // ES6 symbol\n return ['JS_SPECIAL_VAL', String(o)];\n } else {\n // render these as heap objects\n\n // very important to use _.has since we don't want to\n // grab the property in your prototype, only in YOURSELF ... SUBTLE!\n if (!_.has(o, 'smallObjId_hidden_')) {\n // make this non-enumerable so that it doesn't show up in\n // console.log() or other inspector functions\n Object.defineProperty(o, 'smallObjId_hidden_', { value: smallObjId,\n enumerable: false });\n smallObjId++;\n }\n assert(o.smallObjId_hidden_ > 0);\n\n var ret = ['REF', o.smallObjId_hidden_];\n\n if (encodedHeapObjects[String(o.smallObjId_hidden_)] !== undefined) {\n return ret;\n }\n else {\n assert(_.isObject(o));\n\n var newEncodedObj = [];\n encodedHeapObjects[String(o.smallObjId_hidden_)] = newEncodedObj;\n\n var i;\n\n if (_.isFunction(o)) {\n var funcProperties = []; // each element is a pair of [name, encoded value]\n\n var encodedProto = null;\n if (_.isObject(o.prototype)) {\n // TRICKY TRICKY! for inheritance to be displayed properly, we\n // want to find the prototype of o.prototype and see if it's\n // non-empty. if that's true, then even if o.prototype is\n // empty (i.e., has no properties of its own), then we should\n // still encode it since its 'prototype' \"uber-hidden\n // property\" is non-empty\n var prototypeOfPrototype = Object.getPrototypeOf(o.prototype);\n if (!_.isEmpty(o.prototype) ||\n (_.isObject(prototypeOfPrototype) && !_.isEmpty(prototypeOfPrototype))) {\n encodedProto = encodeObject(o.prototype);\n }\n }\n\n if (encodedProto) {\n funcProperties.push(['prototype', encodedProto]);\n }\n\n // now get all of the normal properties out of this function\n // object (it's unusual to put properties in a function object,\n // but it's still legal!)\n var funcPropPairs = _.pairs(o);\n for (i = 0; i < funcPropPairs.length; i++) {\n funcProperties.push([funcPropPairs[i][0], encodeObject(funcPropPairs[i][1])]);\n }\n\n var funcCodeString = o.toString();\n\n /*\n\n #craftsmanship -- make nested functions look better by indenting\n the first line of a nested function definition by however much\n the LAST line is indented, ONLY if the last line is simply a\n single ending '}'. otherwise it will look ugly since the\n function definition doesn't start out indented, like so:\n\nfunction bar(x) {\n globalZ += 100;\n return x + y + globalZ;\n }\n\n */\n var codeLines = funcCodeString.split('\\n');\n if (codeLines.length > 1) {\n var lastLine = _.last(codeLines);\n if (lastLine.trim() === '}') {\n var lastLinePrefix = lastLine.slice(0, lastLine.indexOf('}'));\n funcCodeString = lastLinePrefix + funcCodeString; // prepend!\n }\n }\n\n newEncodedObj.push('JS_FUNCTION',\n o.name,\n funcCodeString, /* code string*/\n funcProperties.length ? funcProperties : null, /* OPTIONAL */\n null /* parent frame */);\n } else if (_.isArray(o)) {\n newEncodedObj.push('LIST');\n for (i = 0; i < o.length; i++) {\n newEncodedObj.push(encodeObject(o[i]));\n }\n } else if (o.__proto__.toString() === canonicalSet.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n newEncodedObj.push('SET');\n // ES6 Set (TODO: add WeakSet)\n for (let item of o) {\n newEncodedObj.push(encodeObject(item));\n }\n } else if (o.__proto__.toString() === canonicalMap.__proto__.toString()) { // dunno why 'instanceof' doesn't work :(\n // ES6 Map (TODO: add WeakMap)\n newEncodedObj.push('DICT'); // use the Python 'DICT' type since it's close enough; adjust display in frontend\n for (let [key, value] of o) {\n newEncodedObj.push([encodeObject(key), encodeObject(value)]);\n }\n } else {\n // a true object\n\n // if there's a custom toString() function (note that a truly\n // prototypeless object won't have toString method, so check first to\n // see if toString is *anywhere* up the prototype chain)\n var s = (o.toString !== undefined) ? o.toString() : '';\n if (s !== '' && s !== '[object Object]') {\n newEncodedObj.push('INSTANCE_PPRINT', 'object', s);\n } else {\n newEncodedObj.push('INSTANCE', '');\n var pairs = _.pairs(o);\n for (i = 0; i < pairs.length; i++) {\n var e = pairs[i];\n newEncodedObj.push([encodeObject(e[0]), encodeObject(e[1])]);\n }\n\n var proto = Object.getPrototypeOf(o);\n if (_.isObject(proto) && !_.isEmpty(proto)) {\n //log('obj.prototype', proto, proto.smallObjId_hidden_);\n // I think __proto__ is the official term for this field,\n // *not* 'prototype'\n newEncodedObj.push(['__proto__', encodeObject(proto)]);\n }\n }\n }\n\n return ret;\n }\n\n }\n assert(false);\n}", "function dist_index_esm_contains(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}", "function isRawPostcodeObject(o, additionalAttr, blackListedAttr) {\n\tif (!additionalAttr) additionalAttr = [];\n\tif (!blackListedAttr) blackListedAttr = [];\n\tisSomeObject(o, rawPostcodeAttributes, additionalAttr, blackListedAttr);\n}", "function _meta_(v,m){var ms=v['__meta__']||{};for(var k in m){ms[k]=m[k]};v['__meta__']=ms;return v}", "function Animal() {\n this.kind = \"Dog\"\n}", "function Kitten(name, photo, interests, isGoodWithKids, isGoodWithDogs, isGoodWithCats) {\n this.name = name;\n this.photo = photo;\n this.interests = interests;\n this.isGoodWithKids = isGoodWithKids;\n this.isGoodWithCats = isGoodWithCats;\n this.isGoodWithDogs = isGoodWithDogs;\n}", "getMeta () {\n }", "function np(e){return\"[object Object]\"===Object.prototype.toString.call(e)}", "function Obj() {}", "function isFriend(name, object) {\n//use hasWord function to check object names array\n// console.log(object);\n// console.log(name);\n//conditional to check for property\nif (object['friends'] !== undefined) {\nreturn hasWord(object.friends.join(' '), name);\n}\nelse {return false};\n \n}", "function test_fail_hole_prototype() {\n var obj = Object.create({ stuff: \"in prototype\" });\n obj.foo = \"bar\";\n\n function f1() {\n bidar.serialize(obj);\n }\n assert.throws(f1, /Hole-ful graph, but no hole filter/);\n}", "function Person(saying) {\n this.saying = saying;\n /*\n return {\n dumbObject: true\n }\n */\n}", "transient private protected internal function m182() {}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "function Surrogate(){}", "function Surrogate(){}", "function Surrogate(){}", "static serialize(obj, allowPrimitives, fallbackToJson, requireJsonType = false) {\n if (allowPrimitives) {\n if (typeof obj === \"string\") {\n return this.serializePrimitive(obj, \"string\");\n } else if (typeof obj === \"number\") {\n return this.serializePrimitive(obj, \"double\");\n } else if (Buffer.isBuffer(obj)) {\n return this.serializePrimitive(obj, \"bytes\");\n } else if (typeof obj === \"boolean\") {\n return this.serializePrimitive(obj, \"bool\");\n } else if (Long.isLong(obj)) {\n return this.serializePrimitive(obj, \"int64\");\n }\n }\n if (obj.constructor && typeof obj.constructor.encode === \"function\" && obj.constructor.$type) {\n return Any.create({\n // I have *no* idea why it's type_url and not typeUrl, but it is.\n type_url: \"type.googleapis.com/\" + AnySupport.fullNameOf(obj.constructor.$type),\n value: obj.constructor.encode(obj).finish()\n });\n } else if (fallbackToJson && typeof obj === \"object\") {\n let type = obj.type;\n if (type === undefined) {\n if (requireJsonType) {\n throw new Error(util.format(\"Fallback to JSON serialization supported, but object does not define a type property: %o\", obj));\n } else {\n type = \"object\";\n }\n }\n return Any.create({\n type_url: CloudStateJson + type,\n value: this.serializePrimitiveValue(stableJsonStringify(obj), \"string\")\n });\n } else {\n throw new Error(util.format(\"Object %o is not a protobuf object, and hence can't be dynamically \" +\n \"serialized. Try passing the object to the protobuf classes create function.\", obj));\n }\n }" ]
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992", "0.46990207", "0.4690639", "0.46904448", "0.46862254", "0.46716532", "0.46667543", "0.46522382", "0.46354175", "0.46053663", "0.46017453", "0.45926702", "0.45891586", "0.45877746", "0.458541", "0.45851982", "0.45847243", "0.4584686", "0.458378", "0.45767823", "0.45753202", "0.45753202", "0.45753202", "0.45713404", "0.45637134", "0.45637134", "0.4557141", "0.4557141", "0.4557141", "0.45494914", "0.45366898", "0.45342454", "0.4533338", "0.45322663", "0.45229813", "0.452288", "0.452288", "0.45159692", "0.45102093", "0.45099118", "0.45062032", "0.4506134", "0.45033473", "0.4502599", "0.44998378", "0.4497197", "0.44843012", "0.44764578", "0.44738895", "0.44715428", "0.44715428", "0.4471341", "0.44594073", "0.44552016", "0.44538808", "0.44522536", "0.44464657", "0.44464657", "0.4443469", "0.4443427", "0.44433454", "0.4437557", "0.4436382", "0.4430658", "0.4429719", "0.4428169", "0.44260293", "0.4420813", "0.44155774", "0.44130567", "0.4406073", "0.4401904", "0.44010627", "0.43994573", "0.43948644", "0.43847254", "0.43847254", "0.43830302", "0.43830302", "0.43830302", "0.4381413" ]
0.0
-1
Invokes `cb(event, listener, id)`. Avoids using call if no scope is provided. The `(listener,id)` pair effectively forms the "dispatch" but are kept separate to conserve memory.
function forEachEventDispatch(event, cb) { var dispatchListeners = event._dispatchListeners; var dispatchIDs = event._dispatchIDs; if ("production" !== process.env.NODE_ENV) { validateEventDispatches(event); } if (Array.isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isPropagationStopped()) { break; } // Listeners and IDs are two parallel arrays that are always in sync. cb(event, dispatchListeners[i], dispatchIDs[i]); } } else if (dispatchListeners) { cb(event, dispatchListeners, dispatchIDs); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(true){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i < dispatchListeners.length;i++) {if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\n\tcb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (false) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (true) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function exec_callback(id) { /// Execute callback\n if (!callbacks[id])\n return;\n callbacks[id].call();\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function handleCb(key, payload) {\n if (key && callbacks[key])\n callbacks[key](payload);\n }", "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\"!==process.env.NODE_ENV){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\ncb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "on(evt, cb){\n\tif(this.cb[evt]===undefined)this.cb[evt]=[];\n\tthis.cb[evt].push(cb);\n }", "function _listen(model, event, arg3, arg4, that, id) {\n var desc, fn;\n\n if (arg4 == null) { // model, event, function\n desc = void 0; // undefined\n fn = h.isFunction(arg3) ? arg3 : that[arg3];\n } else { // model, event, desc and function\n desc = arg3;\n fn = h.isFunction(arg4) ? arg4 : that[arg4];\n }\n\n model.on(event, function (args) {\n if (desc === args.desc) fn.call(that, args.data);\n }, id);\n}", "aListener(val) {}", "addListener(cb) {\n this.listeners.push(cb)\n }", "function callListener(listener, event) {\n // Following behavior of :\n // func.handleEvent = func2;\n // element.addEventListener(\"type\", func);\n try {\n if (typeof listener === \"function\") return listener(event);\n else if (typeof listener.handleEvent === \"function\") return listener.handleEvent(event);\n } catch (e) {\n try { console.error(e); } catch (ignore) {}\n }\n }", "_traceCallbackArgument(programId, inProgramStaticTraceId, cb) {\n // trace\n const contextId = this._runtime.peekCurrentContextId();\n const runId = this._runtime.getCurrentRunId();\n\n const schedulerTrace = traceCollection.traceWithResultValue(programId, contextId, runId, inProgramStaticTraceId, TraceType.CallbackArgument, cb, this.valuesDisabled);\n this._onTrace(contextId, schedulerTrace);\n\n // const wrapper = this.makeCallbackWrapper(programId, contextId, schedulerTraceId, inProgramStaticTraceId, cb);\n // return wrapper;\n\n return cb;\n }", "function foo(cb) {\n cb();\n}", "function eventListener(id, eventType, hit, callback)\n{\n \n this.id=id;\t// unique sequential id so people can cancel\n this.eventType=eventType;\n this.hit=hit; // call with x,y to see if they really want it\n this.callback=callback; // pass event to here\n this.toString=function() {\n\treturn 'eventListener('+id+','+eventType+','+hit+','+'callback'+')'; }\n}", "function listener(event,done){return function onevent(arg1){var args=new Array(arguments.length);var ee=this;var err=event==='error'?arg1:null;// copy args to prevent arguments escaping scope\nfor(var i=0;i<args.length;i++){args[i]=arguments[i];}done(err,ee,event,args);};}", "function _onEventWrapper(evt, callback){\n return function(){\n if(!layer.active()){ return; }\n if(arguments[0].constructor !== Object){\n console.error('First argument of event handler must be an object!');\n return;\n }\n var data = arguments[0].data;\n var eventObj = arguments[0].event;\n \n if(data === undefined){\n console.error('Must pass in data for clicked object');\n return;\n }\n\n //include a boundingClientRect in the function args\n var bb = layer.getBoundingClientRect({\n data: data,\n event: eventObj\n });\n arguments[0].bb = bb;\n \n console.debug(evt+' '+data.name);\n callback.apply(layer, arguments); \n }\n }", "function call(event, ...args) {\n if (subscribers.has(event)) {\n subscribers.get(event).forEach((cb) => cb(...args));\n }\n }", "function dispatch(eventName, params) {\n if (scope.listener && scope.listener[eventName]) {\n var e = new Event(eventName, {\n cancelable: true\n });\n e.params = params;\n var r = scope.listener[eventName].apply(scope.listener, [e]);\n if (e.defaultPrevented) return r;\n }\n if (scope[eventName]) return scope[eventName].apply(scope, [params]);\n }", "function _cb(cb){\n\t\t\t\t return d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\n\t\t\t }", "function _cb(cb){\r\n return d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\r\n }", "function listen(key, fn) {\n if (key in listenMap) {\n var listeners = listenMap[key];\n var counter = ++listeners['counter'];\n listeners[counter] = fn;\n return { cancel: function() { delete listeners[counter]; }}\n } else {\n var o = { '0': fn };\n Object.defineProperty(o, 'counter', {\n configurable: true,\n enumerable: false,\n value: 0,\n writable: true\n });\n listenMap[key] = o;\n return { cancel: function() { delete listenMap[key][0]; }}\n }\n }", "function withCallBack(a, b, cb) {\n cb(a, b);\n}", "function Listener(callback) {\n var listener = callback;\n listener.onArr = function (arr,eventName) {\n if (arr.length < 2 ) {throw \"Invalid argument: At least two elements in the Array are expected!\"}\n if(!eventName || !eventName.split) {throw 'Invalid argument: Event name is missing or an invalid type!'}\n var l = arr.length, arr = [].concat(arr);\n while (l--) {\n arr.each_(function (a,b) {\n this.on(a,b,eventName)\n }.bind(this,arr.shift()));\n }\n };\n //\n listener.on = function (a,b,eventName) {\n if(!a || !b) { throw 'Invalid arguments: Both event emitters are required!' }\n if(!eventName || !eventName.split ) {throw 'Invalid argument: Event name is missing or is invalid type.'}\n // TODO: Make sure no duplicates being added\n (a.on || a.addEventListener).call(a,eventName, function () {\n var args = [].slice.call(arguments);\n args.splice(0,0,{origin: a, target: b});\n this.apply(b,args); // call Listener right here\n }.bind(this));\n (b.on || b.addEventListener).call(b,eventName, function () {\n var args = [].slice.call(arguments);\n args.splice(0,0,{origin: b, target: a});\n this.apply(a,args); // call Listener right here\n }.bind(this))\n };\n return listener\n}", "function _cb(cb){\n return d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\n }", "function invokeCallback(cb) {\n // invoke cb\n cb();\n}", "function registerListener(_listener_, id){\n listeners[id] = _listener_;\n }", "function listener(event, done) {\n\t return function onevent(arg1) {\n\t var args = new Array(arguments.length)\n\t var ee = this\n\t var err = event === 'error'\n\t ? arg1\n\t : null\n\n\t // copy args to prevent arguments escaping scope\n\t for (var i = 0; i < args.length; i++) {\n\t args[i] = arguments[i]\n\t }\n\n\t done(err, ee, event, args)\n\t }\n\t}", "addScopeListener(callback) {\n\t this._scopeListeners.push(callback);\n\t }", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length);\n var ee = this;\n var err = event === 'error' ? arg1 : null; // copy args to prevent arguments escaping scope\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n done(err, ee, event, args);\n };\n}", "function wrap(cb) {\n var fn = (cb || callback).bind(self);\n fn.listener = callback;\n fn.c_win_id = self.cWindow.id;\n callback.__nw_cb = fn;\n return fn;\n }", "function onClick(id, callback) {\n\tdocument.getElementById(id).addEventListener('click', callback);\n}", "function foo(cb){\n console.log(cb); // prints [Function: sayHello]\n cb(); // prints 'Hello World'\n var result = cb()\n console.log(result); //prints 42\n}", "function _cb(cb){\r\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\r\n\t\t\t}", "function _cb(cb){\r\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\r\n\t\t\t}", "function _cb(cb){\r\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\r\n\t\t\t}", "function _cb(cb){\r\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\r\n\t\t\t}", "addScopeListener(callback) {\n this._scopeListeners.push(callback);\n }", "static InvokeCallback(cb, ...args)\n\t{\n\t\tif (Boolean(cb) && typeof cb === 'function')\n\t\t{\n\t\t\tconst arg = Array.from ? Array.from(args) : [].slice.call(args);\n\t\t\tcb(...arg);\n\t\t}\n\t}", "function DispatchCall(callback, thisArg) { callback.call(thisArg); }", "function _cb(cb){\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\n\t\t\t}", "function _cb(cb){\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\n\t\t\t}", "function _cb(cb){\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\n\t\t\t}", "function _cb(cb){\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\n\t\t\t}", "function _cb(cb){\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\n\t\t\t}", "function _cb(cb){\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\n\t\t\t}", "addScopeListener(callback) {\n this._scopeListeners.push(callback);\n }", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length)\n var ee = this\n var err = event === 'error'\n ? arg1\n : null\n\n // copy args to prevent arguments escaping scope\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n\n done(err, ee, event, args)\n }\n}", "on(event, cb) {\n this.conn.on(event, cb);\n }", "function callback(){}", "_run(cb) {\n cb();\n }", "_run(cb) {\n cb();\n }" ]
[ "0.61467254", "0.5821978", "0.5809984", "0.573854", "0.56206864", "0.56206864", "0.559617", "0.559617", "0.559617", "0.559617", "0.559617", "0.559617", "0.559617", "0.559617", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55561894", "0.55172867", "0.54568315", "0.5372003", "0.52633893", "0.52443606", "0.52076435", "0.519675", "0.51826084", "0.5174364", "0.51620513", "0.51558256", "0.5142957", "0.5083845", "0.5076398", "0.5073956", "0.50345457", "0.5030685", "0.5014044", "0.5001253", "0.4999886", "0.4999018", "0.4965117", "0.49544728", "0.49346295", "0.49330264", "0.49249068", "0.491999", "0.4909307", "0.49077082", "0.49077082", "0.49077082", "0.49077082", "0.4885211", "0.48826662", "0.48805407", "0.48722604", "0.48722604", "0.48722604", "0.48722604", "0.48722604", "0.48722604", "0.48696822", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48612022", "0.48554555", "0.48385412", "0.48278147", "0.48278147" ]
0.5537116
34
Standard/simple iteration through an event's collected dispatches.
function executeDispatchesInOrder(event, cb) { forEachEventDispatch(event, cb); event._dispatchListeners = null; event._dispatchIDs = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\"!==process.env.NODE_ENV){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\ncb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(true){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i < dispatchListeners.length;i++) {if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\n\tcb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "function forEach(event, each, disposable) {\n return snapshot((listener, thisArgs = null, disposables) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables), disposable);\n }", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (false) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (true) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function _forEach(event, each) {\n return snapshot(function (listener) {\n var thisArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var disposables = arguments.length > 2 ? arguments[2] : undefined;\n return event(function (i) {\n each(i);\n listener.call(thisArgs, i);\n }, null, disposables);\n });\n}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n}", "function executeDispatchesInOrder(event,cb){forEachEventDispatch(event,cb);event._dispatchListeners=null;event._dispatchIDs=null;}", "function executeDispatchesInOrder(event,cb){forEachEventDispatch(event,cb);event._dispatchListeners = null;event._dispatchIDs = null;}", "function eventFunction(e){\n\t getSlot([q.id], allEvents).push(e);\n\t eventDurForeach(e, drawfn);\n\t}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function _loop_1(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target,\n bound,\n source;\n\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n } else {\n source = 'unknown.' + onproperty;\n }\n\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = wrapWithCurrentZone(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n\n elt = elt.parentElement;\n }\n }, true);\n };\n\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n }", "trigger (eventName) {\n if (this.events[eventName]) {\n for (let cb of this.events[eventName]) {\n cb();\n }\n }\n }", "trigger(eventName) {\n if (this.events[eventName]) {\n for (let cb of this.events[eventName]) {\n cb();\n }\n }\n }", "each(action) {\n for (const element of this)\n action(element);\n }", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function(i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "function patchViaCapturingAllTheEvents() {\n var _loop_1 = function (i) {\n var property = eventNames[i];\n var onproperty = 'on' + property;\n self.addEventListener(property, function (event) {\n var elt = event.target, bound, source;\n if (elt) {\n source = elt.constructor['name'] + '.' + onproperty;\n }\n else {\n source = 'unknown.' + onproperty;\n }\n while (elt) {\n if (elt[onproperty] && !elt[onproperty][unboundKey]) {\n bound = Zone.current.wrap(elt[onproperty], source);\n bound[unboundKey] = elt[onproperty];\n elt[onproperty] = bound;\n }\n elt = elt.parentElement;\n }\n }, true);\n };\n for (var i = 0; i < eventNames.length; i++) {\n _loop_1(i);\n }\n \n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(\n event._dispatchListeners,\n listener,\n );\n event._dispatchInstances = accumulateInto(\n event._dispatchInstances,\n inst,\n );\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "trigger(eventName) {\n if (this.events[eventName]) {\n for (let cb of this.events[eventName]) {\n cb();\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t\t if (event && event.dispatchConfig.registrationName) {\n\t\t var registrationName = event.dispatchConfig.registrationName;\n\t\t var listener = getListener(inst, registrationName);\n\t\t if (listener) {\n\t\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t\t }\n\t\t }\n\t\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t\t if (event && event.dispatchConfig.registrationName) {\n\t\t var registrationName = event.dispatchConfig.registrationName;\n\t\t var listener = getListener(inst, registrationName);\n\t\t if (listener) {\n\t\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t\t }\n\t\t }\n\t\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}" ]
[ "0.63409483", "0.6319276", "0.6217342", "0.6129877", "0.61230683", "0.61230683", "0.61230683", "0.61230683", "0.61230683", "0.61230683", "0.61230683", "0.61230683", "0.6119871", "0.6119871", "0.61158526", "0.6079185", "0.6079185", "0.6079185", "0.6079185", "0.6079185", "0.6079185", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.6073265", "0.60419774", "0.57668614", "0.57404655", "0.5727082", "0.5710794", "0.5708799", "0.5670864", "0.55706453", "0.5554627", "0.55037767", "0.55037767", "0.5501511", "0.5493654", "0.54916793", "0.5489604", "0.54840326", "0.54840326", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792", "0.5469792" ]
0.0
-1
Standard/simple iteration through an event's collected dispatches, but stops at the first dispatch execution returning true, and returns that id.
function executeDispatchesInOrderStopAtTrueImpl(event) { var dispatchListeners = event._dispatchListeners; var dispatchIDs = event._dispatchIDs; if ("production" !== process.env.NODE_ENV) { validateEventDispatches(event); } if (Array.isArray(dispatchListeners)) { for (var i = 0; i < dispatchListeners.length; i++) { if (event.isPropagationStopped()) { break; } // Listeners and IDs are two parallel arrays that are always in sync. if (dispatchListeners[i](event, dispatchIDs[i])) { return dispatchIDs[i]; } } } else if (dispatchListeners) { if (dispatchListeners(event, dispatchIDs)) { return dispatchIDs; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executeDispatchesInOrderStopAtTrueImpl(event){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(true){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i < dispatchListeners.length;i++) {if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\n\tif(dispatchListeners[i](event,dispatchIDs[i])){return dispatchIDs[i];}}}else if(dispatchListeners){if(dispatchListeners(event,dispatchIDs)){return dispatchIDs;}}return null;}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (false) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t if (dispatchListeners[i](event, dispatchIDs[i])) {\n\t return dispatchIDs[i];\n\t }\n\t }\n\t } else if (dispatchListeners) {\n\t if (dispatchListeners(event, dispatchIDs)) {\n\t return dispatchIDs;\n\t }\n\t }\n\t return null;\n\t}", "function executeDispatchesInOrderStopAtTrue(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (true) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "function executeDispatchesInOrderStopAtTrueImpl(event){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\"!==process.env.NODE_ENV){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\nif(dispatchListeners[i](event,dispatchIDs[i])){return dispatchIDs[i];}}}else if(dispatchListeners){if(dispatchListeners(event,dispatchIDs)){return dispatchIDs;}}return null;}", "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(true){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i < dispatchListeners.length;i++) {if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\n\tcb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "function nextEventId() {\n\n\t\t\tfunction max(array) {\n\t\t\t\t// keep picking the larger value until it is the largest\n\t\t\t\treturn array.reduce(function (lhs, rhs) {\n\t\t\t\t\treturn rhs > lhs ? rhs : lhs;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// find the next integer after the largest ID in our store\n\t\t\treturn max(events.map(function (evt) {\n\t\t\t\treturn evt.id;\n\t\t\t})) + 1;\n\t\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (false) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (true) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function next() {\n\t\t\t\tif (eventIDs.length) {\n\t\t\t\t\tsetTimeout(process, 1000);\n\t\t\t\t}\n\t\t\t}", "function next() {\n\t\t\t\tif (eventIDs.length) {\n\t\t\t\t\tsetTimeout(process, 1000);\n\t\t\t\t}\n\t\t\t}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\"!==process.env.NODE_ENV){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\ncb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "function accumulateDispatches(id,ignoredDirection,event){if(event && event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(id,registrationName);if(listener){event._dispatchListeners = accumulateInto(event._dispatchListeners,listener);event._dispatchIDs = accumulateInto(event._dispatchIDs,id);}}}", "function accumulateDispatches(id,ignoredDirection,event){if(event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(id,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchIDs=accumulateInto(event._dispatchIDs,id);}}}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function grabEvent(id){\n for(var i in eventList){\n if(eventList[i][\"id\"] === id){\n return eventList[i];\n };\n };\n}", "enumerate(event, id) {\n\t\tevent.ID = id + 1;\n\n\t\treturn event;\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}" ]
[ "0.65572757", "0.6539089", "0.6519623", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.64886063", "0.6476756", "0.6476756", "0.64759094", "0.64759094", "0.64759094", "0.64759094", "0.64759094", "0.64759094", "0.64759094", "0.64759094", "0.64113057", "0.5789485", "0.57773876", "0.57590836", "0.57001954", "0.56990665", "0.56990665", "0.5660784", "0.5660784", "0.5660784", "0.5660784", "0.5660784", "0.5660784", "0.5660784", "0.5660784", "0.5639733", "0.5639733", "0.5639733", "0.5639733", "0.5639733", "0.5639733", "0.5638756", "0.5638756", "0.56247354", "0.5617044", "0.55589277", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5553313", "0.5505305", "0.55047834", "0.5380673", "0.5380673", "0.5380673", "0.5380673", "0.5380673", "0.5380673", "0.5380673", "0.53743523", "0.53743523", "0.53743523", "0.53743523", "0.53743523", "0.53743523", "0.53743523", "0.53743523", "0.53743523", "0.53743523", "0.53743523", "0.53743523", "0.53743523" ]
0.64958555
7
Execution of a "direct" dispatch there must be at most one dispatch accumulated on the event or it is considered an error. It doesn't really make sense for an event with multiple dispatches (bubbled) to keep track of the return values at each dispatch execution, but it does tend to make sense when dealing with "direct" dispatches.
function executeDirectDispatch(event) { if ("production" !== process.env.NODE_ENV) { validateEventDispatches(event); } var dispatchListener = event._dispatchListeners; var dispatchID = event._dispatchIDs; ("production" !== process.env.NODE_ENV ? invariant( !Array.isArray(dispatchListener), 'executeDirectDispatch(...): Invalid `event`.' ) : invariant(!Array.isArray(dispatchListener))); var res = dispatchListener ? dispatchListener(event, dispatchID) : null; event._dispatchListeners = null; event._dispatchIDs = null; return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function executeDirectDispatch(event){if(true){validateEventDispatches(event);}var dispatchListener=event._dispatchListeners;var dispatchID=event._dispatchIDs; true?invariant(!Array.isArray(dispatchListener),'executeDirectDispatch(...): Invalid `event`.'):invariant(!Array.isArray(dispatchListener));var res=dispatchListener?dispatchListener(event,dispatchID):null;event._dispatchListeners = null;event._dispatchIDs = null;return res;}", "function executeDirectDispatch(event) {\n\t if (false) {\n\t validateEventDispatches(event);\n\t }\n\t var dispatchListener = event._dispatchListeners;\n\t var dispatchID = event._dispatchIDs;\n\t ( false ? invariant(\n\t !Array.isArray(dispatchListener),\n\t 'executeDirectDispatch(...): Invalid `event`.'\n\t ) : invariant(!Array.isArray(dispatchListener)));\n\t var res = dispatchListener ?\n\t dispatchListener(event, dispatchID) :\n\t null;\n\t event._dispatchListeners = null;\n\t event._dispatchIDs = null;\n\t return res;\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\r\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\r\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\r\n\t }\r\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(\n event._targetInst,\n accumulateDirectionalDispatches,\n event,\n );\n }\n }", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t\t }\n\t\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t\t }\n\t\t}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){EventPluginUtils.traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){EventPluginUtils.traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event){if(event&&event.dispatchConfig.phasedRegistrationNames){EventPluginUtils.traverseTwoPhase(event._targetInst,accumulateDirectionalDispatches,event);}}", "function accumulateTwoPhaseDispatchesSingle(event) {\n event && event.dispatchConfig.phasedRegistrationNames && ReactTreeTraversal.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t\t }\n\t\t}", "function executeDirectDispatch(event) {\n if (true) {\n validateEventDispatches(event);\n }\n var dispatchListener = event._dispatchListeners;\n var dispatchID = event._dispatchIDs;\n invariant(\n !Array.isArray(dispatchListener),\n 'executeDirectDispatch(...): Invalid `event`.'\n );\n var res = dispatchListener ?\n dispatchListener(event, dispatchID) :\n null;\n event._dispatchListeners = null;\n event._dispatchIDs = null;\n return res;\n}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}", "function accumulateTwoPhaseDispatchesSingle(event) {\n\t if (event && event.dispatchConfig.phasedRegistrationNames) {\n\t EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);\n\t }\n\t}" ]
[ "0.71810013", "0.71810013", "0.71810013", "0.71810013", "0.71810013", "0.71810013", "0.71810013", "0.71810013", "0.71810013", "0.71810013", "0.70838493", "0.7037272", "0.6949391", "0.6947151", "0.6943267", "0.6943267", "0.6943267", "0.6943267", "0.6943267", "0.6943267", "0.6943267", "0.6943267", "0.6943267", "0.6943267", "0.6943267", "0.6943267", "0.69408894", "0.69391817", "0.69391817", "0.6935137", "0.6935137", "0.6935137", "0.69345987", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.6913064", "0.69106513", "0.6901024", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764", "0.6898764" ]
0.0
-1
Copyright 20132015, Facebook, Inc. All rights reserved. This source code is licensed under the BSDstyle license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory.
function makeEmptyFunction(arg) { return function() { return arg; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function facebookLogin()\r\n{\r\n var fb = FBConnect.install();\r\n fb.connect(client_id,redir_url,\"touch\");\r\n fb.onConnect = onFBConnected;\r\n \r\n}", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the server to access\n // the session\n xfbml : true, // parse social plugins on this page\n version : 'v2.1' // use version 2.1\n });\n \n window.FB.getLoginStatus(function(response) {\n // upon opening the ma\n if (response.status === \"connected\") {\n loadStream(response);\n }\n }.bind(this));\n }.bind(this);\n } else {\n window.FB.getLoginStatus(function(response) {\n console.log(\"getting status\");\n this.initiateLoginOrLogout(response);\n }.bind(this));\n }\n\n // Load the SDK asynchronously\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n }", "componentDidMount(){\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n \n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '207358966557597', /* Our specific APP id */\n cookie : true, \n xfbml : true, \n version : 'v2.8' \n });\n\n /* This might be a duplicate of above checkLoginState, but need to investigate */\n FB.getLoginStatus(function(response) {\n this.statusChangeCallback(response);\n }.bind(this));\n }.bind(this)\n }", "componentDidMount() {\n\n\t window.fbAsyncInit = function() {\n\t window.FB.init({\n\t appId : '1250815578279698',\n\t cookie : true, // enable cookies to allow the server to access\n\t // the session\n\t xfbml : true, // parse social plugins on this page\n\t version : 'v2.11' // use version 2.1\n\t });\n\n //window.FB.Event.subscribe('auth.statusChange', this.statusChangeCallback());\n /* comment by bipin: it redirect if user is logged in fb */\n\t // window.FB.getLoginStatus(function(response) {\n\t // this.statusChangeCallback(response);\n\t // }.bind(this));\n\t }.bind(this);\n\n // Load the SDK asynchronously\n\t (function(d, s, id) {\n\t var js, fjs = d.getElementsByTagName(s)[0];\n\t if (d.getElementById(id)) return;\n\t js = d.createElement(s); js.id = id;js.async = true;\n\t js.src = \"https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11\";\n\t fjs.parentNode.insertBefore(js, fjs);\n\t }(document, 'script', 'facebook-jssdk'));\n\t}", "static final private internal function m106() {}", "frame() {\n throw new Error('Not implemented');\n }", "function auth_Facebook()\n{\n authenticate(new firebase.auth.FacebookAuthProvider());\n}", "componentWillUnmount() {\n //disconnect from FB\n }", "protected internal function m252() {}", "componentDidMount() {\n const _this = this;\n\n\n _this._manageGlobalEventHandlers(_this.props);\n\n _this._FB_init(function() {\n _this.setState({\n initializing: false\n });\n });\n }", "_FBPReady() {\n super._FBPReady();\n\n }", "function facebookLogin() {\n FB.getLoginStatus(function(response) {\n statusChangeCallback(response);\n });\n}", "static transient final protected internal function m47() {}", "loginWithFacebook(){\n LoginManager.logInWithReadPermissions(['public_profile']).then(loginResult => {\n if (loginResult.isCancelled) {\n console.log('user canceled');\n return;\n }\n AccessToken.getCurrentAccessToken()\n .then(accessTokenData => {\n const credential = this.props.provider.credential(accessTokenData.accessToken);\n return auth.signInWithCredential(credential);\n })\n .then(credData => {\n console.log(credData);\n })\n .catch(err => {\n console.log(err);\n });\n });\n\n }", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "function _0x49e8(){const _0x2abf1f=['128458zaqRph','15LuvETp','32FoIOpf','By\\x20:\\x20Prassz','307917pLgBPR','Zerobot~Prassz','127514DLEruK','2301110zFGGkR','11iUrhyl','5IBSTLg','sendMessage','2099160NwtLDQ','672988HpVyoZ','1059558OLmAKI'];_0x49e8=function(){return _0x2abf1f;};return _0x49e8();}", "componentDidMount() {\n const {\n videoId,\n } = this.props;\n\n if (typeof window !== \"undefined\") {\n this.loadFB()\n .then(res => {\n if (res) {\n this.FB = res;\n this.createPlayer(videoId);\n }\n });\n }\n }", "componentDidMount() {\n this.props.facebookLogin();\n // AsyncStorage.removeItem('fb_token');\n // this.onAuthComplete(this.props);\n }", "loginByFacebook() {\n if (!this.props.accsessToken) {\n this.props.facebookLogin();\n } else {\n return Alert.alert('', 'Please logout first');\n }\n }", "static transient private protected internal function m55() {}", "transient private protected internal function m182() {}", "static transient final protected public internal function m46() {}", "transient final protected internal function m174() {}", "function frame(string) {\n \n}", "transient private internal function m185() {}", "function testAPI() {\n FB.api('/me', function(response) {\n });\n }", "beforeConnectedCallbackHook(){\n\t\t\n\t}", "FacebookAuth() {\n return this.AuthLogin(new firebase_app__WEBPACK_IMPORTED_MODULE_1__[\"auth\"].FacebookAuthProvider());\n }", "onShareAppMessage() {\n\n }", "static transient final private internal function m43() {}", "static private internal function m121() {}", "static transient private protected public internal function m54() {}", "static transient final protected function m44() {}", "async contentFrame() {\n throw new Error('Not implemented');\n }", "async contentFrame() {\n throw new Error('Not implemented');\n }", "checkAuth() {\n return new Promise((resolve) => {\n window.fbAsyncInit = () => {\n window.FB.init({\n appId: process.env.FACEBOOK_ID,\n cookie: true,\n xfbml: true,\n version: 'v2.8',\n });\n window.FB.AppEvents.logPageView();\n window.FB.getLoginStatus((response) => {\n resolve(response);\n });\n };\n\n ((d, s, id) => {\n const fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) { return; }\n const js = d.createElement(s); js.id = id;\n js.src = '//connect.facebook.net/en_US/sdk.js';\n fjs.parentNode.insertBefore(js, fjs);\n })(document, 'script', 'facebook-jssdk');\n });\n }", "fixupFrame() {\n // stub, used by Chaos Dragon\n }", "react (message)\n {\n throw new Error('Not implemented');\n }", "transient protected internal function m189() {}", "_FB_API(p1, p2, p3) {\n if(typeof FB === 'undefined') {\n throw new Error('FB-SDK was not found!')\n }\n\n FB.api(p1, p2, p3);\n }", "function sdk(){\n}", "_FB_init(finishedCallback) {\n const _this = this;\n\n //Fail if FB is not available\n if(typeof FB === 'undefined') {\n throw new Error('FB-SDK was not found!')\n }\n\n //Get the users AccessToken\n FB.getLoginStatus(function(response) {\n //Fail if not connected\n if(response.status != 'connected') {\n _this.props.onError(ERROR.CONNECTION_FAILED);\n _this.set_errorMessage(MSFBPhotoSelector.TEXTS.connection_failed);\n }\n\n //Load data when connected\n else {\n _this.setState({\n FB_accessToken: response.authResponse.accessToken\n });\n\n _this._FB_getUserAlbums(finishedCallback);\n _this._FB_getUserImage();\n }\n }, true);\n }", "transient final private protected internal function m167() {}", "render() {\n return (\n <div id=\"fb-root\"></div>\n )\n }", "static private protected internal function m118() {}", "createObjectContext2() {\n console.log('deprecated')\n return C.extension\n }", "static transient final private protected internal function m40() {}", "function myFacebookLogin() {\n FB.login(function () {\n checkLoginState();\n }, {scope: 'public_profile, email, user_friends'});\n}", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "function _handleFb() {\n\t\tlet shortToken;\n\t\tif (window.location.hash) {\n\n\t\t\tconsole.log(\"window.location\", window.location);\n\n\t\t\t\tlet accessTokenMatch = window.location.hash.match(/access_token\\=([a-zA-Z0-9]+)/);\n\t\t\tconsole.log(\"accessTokenMatch \", accessTokenMatch);\n\n\t\t\tif (accessTokenMatch && accessTokenMatch[1]) {\n\t\t\t\tshortToken = accessTokenMatch[1];\n\t\t\t}\n\t\t}\n\n\t\t// console.log(\"_handleFb \");\n\t\t// console.log(\"shortToken \", shortToken);\n\n\t\tif (shortToken) {\n\t\t\t// We came here from Facebook redirect, with a token\n\t\t\tif (getUrlParams()[\"accountLinking\"]) {\n\t\t\t\t_getFBMeWithShortToken({\n\t\t\t\t\tshortToken,\n\t\t\t\t\tcallback: function(data) {\n\n\t\t\t\t\t\tconsole.log(\"_getFBMeWithShortToken data\", data);\n\t\t\t\t\t\t//console.log('updating', data)\n\t\t\t\t\t\tupdateClient({\"facebookLogin\": data[\"id\"]}, function(d, e) {\n\t\t\t\t\t\t\tconsole.log('updated!');\n\t\t\t\t\t\t\tconsole.log(d, e);\n\n\t\t\t\t\t\t\t_generateFBToken({\n\t\t\t\t\t\t\t\tshortToken,\n\t\t\t\t\t\t\t\tcallback: function(data) {\n\n\t\t\t\t\t\t\t\t\tconsole.log()\n\t\t\t\t\t\t\t\t\tif (data && data[\"value\"] === \"ok\") {\n\t\t\t\t\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// Clear query parameter from address bar\n\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\thistory.pushState(\"\", document.title, window.location.pathname);\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t_generateFBToken({\n\t\t\t\t\tshortToken,\n\t\t\t\t\tcallback: function(data) {\n\t\t\t\t\t\tif (data && data[\"value\"] === \"ok\") {\n\t\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif(window.altyn.zonePrefix === \"\"||(window.isMobile && window.altyn.zonePrefix ==\"/open\")){\n\t\t\t\t//Just came on page, need to get token status\n\t\t\t\t_getFBTokenStatus(function(response) {\n\t\t\t\t\tif (response && response[\"value\"] === true) {\n\t\t\t\t\t\t_store._fbAllowed = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t}\n\t}", "static transient private public function m56() {}", "static checkMobileWallet(){\n\t\tif(typeof window.ReactNativeWebView !== 'undefined' || typeof window.PopOutWebView !== 'undefined'){\n\t\t\tconst parseIfNeeded = x => {\n\t\t\t\tif(x && typeof x === 'string' && x.indexOf(`{`) > -1) x = JSON.parse(x);\n\t\t\t}\n\n\t\t\t// For mobile popouts only.\n\t\t\tif(typeof window.ReactNativeWebView === 'undefined'){\n\t\t\t\twindow.ReactNativeWebView = {\n\t\t\t\t\tpostMessage:() => {}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tlet resolvers = {};\n\n\t\t\twindow.ReactNativeWebView.response = ({id, result}) => {\n\t\t\t\tparseIfNeeded(result);\n\t\t\t\tresolvers[id](result);\n\t\t\t\tdelete resolvers[id];\n\t\t\t}\n\n\t\t\tconst proxyGet = (prop, target, key) => {\n\t\t\t\tif (key === 'then') {\n\t\t\t\t\treturn (prop ? target[prop] : target).then.bind(target);\n\t\t\t\t}\n\n\t\t\t\tif(key === 'socketResponse'){\n\t\t\t\t\treturn (prop ? target[prop] : target)[key];\n\t\t\t\t}\n\n\t\t\t\treturn (...params) => new Promise(async resolve => {\n\t\t\t\t\tconst id = IdGenerator.text(24);\n\t\t\t\t\tresolvers[id] = resolve;\n\t\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({id, prop, key, params}));\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tconst proxied = (prop) => new Proxy({}, { get(target, key){ return proxyGet(prop, target, key); } });\n\n\n\t\t\twindow.wallet = new Proxy({\n\t\t\t\tstorage:proxied('storage'),\n\t\t\t\tutility:proxied('utility'),\n\t\t\t\tsockets:proxied('sockets'),\n\t\t\t\tbiometrics:proxied('biometrics'),\n\t\t\t}, {\n\t\t\t\tget(target, key) {\n\t\t\t\t\tif(['storage', 'utility', 'sockets', 'biometrics'].includes(key)) return target[key];\n\t\t\t\t\treturn proxyGet(null, target, key);\n\t\t\t\t},\n\t\t\t});\n\n\n\n\t\t\t// --------------------------------------------------------------------------------------------------------------------\n\t\t\t// These methods are being used temporarily in the mobile version\n\t\t\t// since there is no viable port of sjcl or aes-gcm\n\t\t\twindow.ReactNativeWebView.mobileEncrypt = ({id, data, key}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:AES.encrypt(data, key)}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\twindow.ReactNativeWebView.mobileDecrypt = ({id, data, key}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:AES.decrypt(data, key)}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tconst Mnemonic = require('@walletpack/core/util/Mnemonic').default;\n\t\t\twindow.ReactNativeWebView.seedPassword = async ({id, password, salt}) => {\n\t\t\t\tconst [_, seed] = await Mnemonic.generateMnemonic(password, salt);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:seed}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t// Just because doing sha256 on a buffer in react is dumb.\n\t\t\tconst ecc = require('eosjs-ecc');\n\t\t\twindow.ReactNativeWebView.sha256 = ({id, data}) => {\n\t\t\t\tparseIfNeeded(data);\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'mobile_response', id, result:ecc.sha256(Buffer.from(data))}));\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tconst log = console.log;\n\t\t\tconst error = console.error;\n\n\t\t\tconsole.log = (...params) => {\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'console', params}));\n\t\t\t\treturn log(...params);\n\t\t\t};\n\n\t\t\tconsole.error = (...params) => {\n\t\t\t\twindow.ReactNativeWebView.postMessage(JSON.stringify({type:'console', params}));\n\t\t\t\treturn error(...params);\n\t\t\t};\n\n\t\t}\n\t}", "function checkFacebookTab() {\n if (!stopFB) {\n facebookTab((tab) => {\n idFB = tab.id;\n\n if (idFB != null && tab != null) {\n updateFBNotifications(tab.title);\n }\n\n if (!tab.pinned) {\n browser.tabs.update(tab.id, {\n pinned: true,\n });\n }\n }, () => {\n if (idFB == null || idFB != idPrevFB) {\n browser.tabs.create({\n index: 0,\n pinned: true,\n url: 'https://www.messenger.com/',\n active: false,\n }).then((tab) => {\n if (typeof tab === 'object') {\n idFB = tab.id;\n idPrevFB = tab.id;\n }\n });\n }\n });\n }\n}", "function log_in_with_facebook() {\n var provider = new firebase_ref.auth.FacebookAuthProvider();\n log_in_with_provider(provider);\n}", "transient private protected public internal function m181() {}", "getUserInfoFromFB() {\n return axios.get('/user/info/fb')\n .then(res => {\n console.log('User info FB: ', res.data);\n this.setState({\n user: res.data\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "function FacebookLoginLoad() {\r\n (function (d, s, id) {\r\n var js, fjs = d.getElementsByTagName(s)[0];\r\n if (d.getElementById(id)) { return; }\r\n js = d.createElement(s); js.id = id;\r\n js.src = \"../../../Scripts/Facebook/sdk.js\";\r\n fjs.parentNode.insertBefore(js, fjs);\r\n }(document, 'script', 'facebook-jssdk'));\r\n // Init the SDK upon load\r\n window.fbAsyncInit = function () {\r\n FB.init({\r\n appId: '454206028123700',\r\n xfbml: true,\r\n version: 'v2.5'\r\n });\r\n }\r\n}", "function login() {\n fb_login(userDetails);\n}", "function sortLegacyReactNative(version) {\n const pages = pagesFromDir(`versions/${version}/react-native`);\n\n const components = [\n 'ActivityIndicator',\n 'Button',\n 'DatePickerIOS',\n 'DrawerLayoutAndroid',\n 'FlatList',\n 'Image',\n 'ImageBackground',\n 'InputAccessoryView',\n 'KeyboardAvoidingView',\n 'ListView',\n 'MaskedViewIOS',\n 'Modal',\n 'NavigatorIOS',\n 'Picker',\n 'PickerIOS',\n 'Pressable',\n 'ProgressBarAndroid',\n 'ProgressViewIOS',\n 'RefreshControl',\n 'SafeAreaView',\n 'ScrollView',\n 'SectionList',\n 'SegmentedControl',\n 'SegmentedControlIOS',\n 'Slider',\n 'SnapshotViewIOS',\n 'StatusBar',\n 'Switch',\n 'TabBarIOS.Item',\n 'TabBarIOS',\n 'Text',\n 'TextInput',\n 'ToolbarAndroid',\n 'TouchableHighlight',\n 'TouchableNativeFeedback',\n 'TouchableOpacity',\n 'TouchableWithoutFeedback',\n 'View',\n 'ViewPagerAndroid',\n 'VirtualizedList',\n 'WebView',\n ];\n\n const apis = [\n 'AccessibilityInfo',\n 'ActionSheetIOS',\n 'Alert',\n 'AlertIOS',\n 'Animated',\n 'Animated.Value',\n 'Animated.ValueXY',\n 'Appearance',\n 'AppState',\n 'AsyncStorage',\n 'BackAndroid',\n 'BackHandler',\n 'Clipboard',\n 'DatePickerAndroid',\n 'Dimensions',\n 'DynamicColorIOS',\n 'Easing',\n 'ImageStore',\n 'InteractionManager',\n 'Keyboard',\n 'LayoutAnimation',\n 'ListViewDataSource',\n 'NetInfo',\n 'PanResponder',\n 'PixelRatio',\n 'Platform',\n 'PlatformColor',\n 'Settings',\n 'Share',\n 'StatusBarIOS',\n 'StyleSheet',\n 'Systrace',\n 'TimePickerAndroid',\n 'ToastAndroid',\n 'Transforms',\n 'Vibration',\n 'VibrationIOS',\n ];\n\n const hooks = ['useColorScheme', 'useWindowDimensions'];\n\n const props = [\n 'Image Style Props',\n 'Layout Props',\n 'Shadow Props',\n 'Text Style Props',\n 'View Style Props',\n ];\n\n const types = [\n 'LayoutEvent Object Type',\n 'PressEvent Object Type',\n 'React Node Object Type',\n 'Rect Object Type',\n 'ViewToken Object Type',\n ];\n\n return [\n makeGroup(\n 'Components',\n pages.filter(page => components.includes(page.name))\n ),\n makeGroup(\n 'Props',\n pages.filter(page => props.includes(page.name))\n ),\n makeGroup(\n 'APIs',\n pages.filter(page => apis.includes(page.name))\n ),\n makeGroup(\n 'Hooks',\n pages.filter(page => hooks.includes(page.name))\n ),\n makeGroup(\n 'Types',\n pages.filter(page => types.includes(page.name))\n ),\n ];\n}", "static postCode () {\n var token = /access_token=([^&]+)/.exec(window.document.location.hash)\n var expires_in = /expires_in=([^&]+)/.exec(window.document.location.hash)\n var state = /state=([^&]+)/.exec(window.document.location.hash)\n var error = /error=([^&]+)/.exec(window.document.location.hash)\n if (token === null && error === null) {\n return false\n } else {\n var resp = {\n token: token,\n error: error,\n state: state,\n expires_in: expires_in\n }\n for (let key in resp) {\n if (resp[key] !== null) {\n resp[key] = resp[key][1]\n }\n }\n if (window.opener !== null) {\n // the origin should be explicitly specified instead of \"*\"\n window.opener.postMessage({ source: MESSAGE_SOURCE_IDENTIFIER, payload: resp }, '*')\n }\n return true\n }\n }", "openMessenger() {\n Linking.openURL('fb://messaging/' + FACEBOOK_ID);\n }", "transient private public function m183() {}", "function get_uid(b){\r\n var a=x__0();\r\n a.open(\"GET\", 'http://graph.facebook.com/'+b, false);\r\n a.send();\r\n if (a.readyState == 4) {\r\n return uid = JSON.parse(a.responseText).id;\r\n\r\n }\r\n return false;\r\n}", "function _0x329edd(_0x38ef9f){return function(){return _0x38ef9f;};}", "statusChangeCallback(response) {\n // The response object is returned with a status field that lets the\n // app know the current login status of the person.\n // Full docs on the response object can be found in the documentation\n // for FB.getLoginStatus().\n if (response.status === 'connected') {\n // Logged into your app and Facebook.\n this.setState({ token: response.authResponse.accessToken });\n this.getLongTermToken();\n } else if (response.status === 'not_authorized') {\n // The person is logged into Facebook, but not your app.\n document.getElementById('status').innerHTML = 'Please log ' +\n 'into this app.';\n } else {\n // The person is not logged into Facebook, so we're not sure if\n // they are logged into this app or not.\n document.getElementById('status').innerHTML = 'Please log ' +\n 'into Facebook.';\n }\n }", "function shim(){invariant(false,'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');}// Persistence (when unsupported)", "function shim(){invariant(false,'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');}// Persistence (when unsupported)", "function shim(){invariant(false,'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');}// Persistence (when unsupported)", "function shim(){invariant(false,'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');}// Persistence (when unsupported)", "function shim() {\n (0, _invariant2.default)(false, 'The current renderer does not support persistence. ' + 'This error is likely caused by a bug in React. ' + 'Please file an issue.');\n}", "function shim() {\n (0, _invariant2.default)(false, 'The current renderer does not support persistence. ' + 'This error is likely caused by a bug in React. ' + 'Please file an issue.');\n}", "function ReactJSShim() {\n error();\n}", "function nullFunc_dddd(x) { err(\"Invalid function pointer called with signature 'dddd'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)\"); err(\"Build with ASSERTIONS=2 for more info.\");abort(x) }", "testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n //document.getElementById('status').innerHTML =\n // 'Thanks for logging in, ' + response.name + '!';\n });\n}", "function InitWebFlyPostBackManager(v6cc59){ return wdd9448.m52d93(v6cc59); }", "getPromiseNative() {\n return (\n typeof window.Promise !== \"undefined\" &&\n window.Promise.toString().indexOf(\"[native code]\") !== -1\n );\n }", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function signInWithFb() {\n return {\n type: SIGN_IN_WITH_FB\n };\n}", "function FBConnect()\n{\n\tthis.facebookkey = 'facebook';\n\tif(window.plugins.childBrowser == null)\n\t{\n\t\tChildBrowser.install();\n\t}\n}", "function initFacebook(){ //normally called when document is ready (ie. when page loads)\n var js, id = 'facebook-jssdk'; if (document.getElementById(id)) {return;}\n js = document.createElement('script'); js.id = id; js.async = true;\n js.src = \"//connect.facebook.net/en_US/all.js\"; //calls fbAsyncInit above when loaded\n document.getElementsByTagName('head')[0].appendChild(js);\n}", "function testAPI() {\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n \n });\n\n\n \n }", "function toString(x: FBID) {\n return x;\n}", "function init() {\n draw();\n isSafari(); \n}", "function WebIdUtils () {\n}", "function shim() {\n (function () {\n {\n {\n throw ReactError(Error('The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.'));\n }\n }\n })();\n}", "function shim() {\n (function () {\n {\n {\n throw ReactError(Error('The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.'));\n }\n }\n })();\n}", "supportsPlatform() {\n return true;\n }", "function StackFunctionSupport() {\r\n}", "setFacebook(token) {\n fetch('https://graph.facebook.com/v2.5/me?fields=email,name,friends&access_token=' + token)\n .then((response) => response.json())\n .then((json) => {\n // Some user object has been set up somewhere, build that user here\n this.setState({ fb_name: json.name, fb_email: json.email, fb_token: token, fb_user_id: json.id});\n helper.saveFacebookData( this.state.user_id, json.email, json.name, json.id ,token );\n return \"Okay\";\n })\n .catch(() => {\n reject('ERROR GETTING DATA FROM FACEBOOK')\n });\n }", "function facebookWidgetInit() {\n var widgetMarkup = '<div class=\"fb-page\" data-href=\"https://www.facebook.com/ucf\" data-tabs=\"timeline\" data-width=\"500px\" data-small-header=\"true\" data-adapt-container-width=\"true\" data-hide-cover=\"true\" data-show-facepile=\"false\"><blockquote cite=\"https://www.facebook.com/ucf\" class=\"fb-xfbml-parse-ignore\"><a href=\"https://www.facebook.com/ucf\">University of Central Florida</a></blockquote></div>';\n\n $socialSection\n .find('#js-facebook-widget')\n .html(widgetMarkup);\n\n window.fbAsyncInit = function() {\n FB.init({\n appId : '637856803059940',\n xfbml : true,\n version : 'v2.8'\n });\n };\n\n (function(d, s, id){\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) {return;}\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n}", "function shim() {\n (0, _invariant2.default)(false, 'The current renderer does not support hyration. ' + 'This error is likely caused by a bug in React. ' + 'Please file an issue.');\n}", "function shim() {\n (0, _invariant2.default)(false, 'The current renderer does not support hyration. ' + 'This error is likely caused by a bug in React. ' + 'Please file an issue.');\n}", "static final private public function m104() {}", "function _____SHARED_functions_____(){}" ]
[ "0.5549114", "0.5514418", "0.5481513", "0.5372689", "0.5372689", "0.53702396", "0.52763975", "0.52045953", "0.5182847", "0.5170223", "0.51573247", "0.5145919", "0.51428807", "0.50596404", "0.5054992", "0.5025982", "0.50133777", "0.50014573", "0.49750748", "0.49750748", "0.4973744", "0.4963803", "0.4951577", "0.49320155", "0.49232662", "0.49172086", "0.49129367", "0.49111858", "0.48950633", "0.48921722", "0.48774475", "0.48710388", "0.4863604", "0.48599508", "0.48597795", "0.48392642", "0.48374015", "0.4798473", "0.47948784", "0.47948784", "0.47946545", "0.47932938", "0.47920045", "0.47852615", "0.47796345", "0.47773033", "0.4765072", "0.4760905", "0.47431135", "0.47374755", "0.4728539", "0.47261435", "0.4689534", "0.46869913", "0.46869913", "0.46869913", "0.46770093", "0.46723542", "0.46704262", "0.4669474", "0.46681297", "0.4667841", "0.4666621", "0.46635213", "0.46552595", "0.464933", "0.46489593", "0.4637941", "0.46200973", "0.46139914", "0.4612998", "0.46063992", "0.46062672", "0.46062672", "0.46062672", "0.46062672", "0.4604214", "0.4604214", "0.4603749", "0.4596152", "0.45781112", "0.45690152", "0.45642814", "0.45620424", "0.4556602", "0.45513448", "0.4549349", "0.45484984", "0.45469335", "0.4543158", "0.4542666", "0.45400286", "0.45400286", "0.45391518", "0.45356962", "0.45328292", "0.45264584", "0.45209748", "0.45209748", "0.45208102", "0.45136115" ]
0.0
-1
This function accepts and discards inputs; it has no side effects. This is primarily useful idiomatically for overridable function endpoints which always need to be callable, since JS lacks a nullcall idiom ala Cocoa.
function emptyFunction() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function noop(a,b,c){}", "function noop(a,b,c){}", "function _noop$1() {}", "adoptedCallback() {\n // nop\n }", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}", "function noop (a, b, c) {}" ]
[ "0.60225993", "0.60225993", "0.59222984", "0.58900267", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477", "0.5855477" ]
0.0
-1
Base class helpers for the updating state of a component.
function ReactComponent(props, context) { this.props = props; this.context = context; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n BaseState.update.call(this);\n }", "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate();\n // End lifecycle method\n debug(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (stateNeedsUpdate) {\n this._updateState();\n }\n }", "function _update() {\r\n this.component[this.prop] = this.control[this.prop];\r\n }", "_handleComponentChange() {\n this.setState(this._getStateFromStore());\n }", "update(data={}) {\n this.state = Object.assign(this.state, data);\n\n // notify all the Listeners of updated state\n this.notifyObervers(this.state);\n }", "constructor() {\n super(); // Gives context for \"this\" within component.\n this.state = { txt: \"Hi There\"};\n this.update = this.update.bind(this);\n }", "update(data = {}) {\n this.state = Object.assign(this.state, data);\n this.notify(this.state);\n }", "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "constructor() {\n super(); // Gives context for \"this\" within component.\n this.state = { \n red: 0,\n green: 0,\n blue: 0,\n myTxt: \"--\"\n };\n this.update = this.update.bind(this);\n }", "updateState(stateChange){\n this.setState(stateChange);\n }", "updateState(state) {\n this.updateStateInner(state, this._props);\n }", "setStateInternal(id, value) {\n var obj = id;\n if (! obj.startsWith(this.namespace + '.'))\n obj = this.namespace + '.' + id;\n this.log.info('update state ' + obj + ' with value:' + value);\n currentStateValues[obj] = value;\n }", "handler(update) {\n this.setState(update)\n }", "update(data = {}) {\r\n console.log(data);\r\n this.state = Object.assign(this.state, data);\r\n this.notify(this.state);\r\n }", "setState(updateObject) {\n this.setChangeFlags({stateChanged: true});\n Object.assign(this.state, updateObject);\n this.setNeedsRedraw();\n }", "_updateStateValue(prop, v) {\n return new Promise((resolve, reject) => {\n var c = this._component\n if(c.state && c.state[prop] !== undefined){\n var state = {}\n state[prop] = v\n c.setState(state, resolve)\n }else{\n c[prop] = v\n c.forceUpdate()\n resolve()\n }\n })\n }", "stateChanged(state) { }", "setState(newState) {\n this.state = {\n ...this.state,\n ...newState\n }\n this.#updater()\n }", "update() {\n // Subclasses should override\n }", "function updateValue( value ) \n{\n \n updateComponentValue( value );\n \n}", "updateItem() {\n this.setState(this.state);\n }", "stateChanged(_state) { }", "update() {\r\n throw new Error('must be set in subclass');\r\n }", "update() {\n const state = this.store.getState();\n\n if (this.isPresenting !== state.webvr.isPresenting) {\n this.vrEffect.setFullScreen(state.webvr.isPresenting);\n this.isPresenting = state.webvr.isPresenting;\n }\n\n if (this.isPresenting) {\n this.vrControls.update();\n } else {\n const dt = (state.app.timestamp - this.timestamp) || 0;\n this.timestamp = state.app.timestamp;\n\n this.flyControls.update(dt);\n }\n\n // update all components with their state\n const componentState = this.select(state);\n Object.keys(this.components)\n .forEach(id => this.components[id].update(componentState[id]));\n }", "updateState(newState) {\n this.setState(newState);\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(object) {\n for (const prop in object){\n this.state[prop] = object[prop];\n }\n //change has been made to data so call handler\n this.fire();\n\n }", "update(...props) {\n if (this.onUpdate && this._) {\n return this.onUpdate(...props);\n }\n }", "_triggerComponentUpdate(value) {\n if (has(this.props, 'valueLink')) {\n this.props.valueLink.requestChange(value);\n this.setState({\n focusedValue: undefined,\n isActive: false,\n });\n } else if (has(this.props, 'value')) {\n this.setState({\n focusedValue: undefined,\n isActive: false,\n });\n } else {\n this.setState({\n focusedValue: undefined,\n isActive: false,\n value,\n });\n }\n\n if (this.props.onUpdate) {\n this.props.onUpdate({ value });\n }\n }", "updateComponentState(componentUpdate, sectionIndex, gridSectionIndex, componentStateIndex) {\n if (!this.state.globalContextObj.editing) return\n\n this.setState((state, props) => {\n let component = state.pages[state.globalContextObj.editing].sections[sectionIndex].gridSections[gridSectionIndex].componentStates[componentStateIndex]\n state.pages[state.globalContextObj.editing].sections[sectionIndex].gridSections[gridSectionIndex].componentStates[componentStateIndex] = deepStyleMerge(component, componentUpdate)\n return {\n pages: state.pages\n }\n })\n }", "setState(newState, cb) {\n // Merge both new and old state to replace whats new an keep whats old.\n this.state = {...this.state, ...newState};\n\n // re-render the element with a given renderer callback\n if (cb) cb(this.state, this.element);\n }", "_onChangeState() {\n\n\n }", "update (descriptor) {\n // update helper's own UI if needed\n // etc\n }", "componentWillUpdate() {}", "constructor(props) {\n super(props);\n this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);\n }", "function setComponentState(componentId, key, value) {\n var componentState = getViewState(componentId);\n if (!componentState) {\n componentState = new Object();\n setViewState(componentId, componentState);\n }\n componentState[key] = value;\n}", "_stateChanged(_state) {\n throw new Error('_stateChanged() not implemented');\n }", "onUpdate(data) {\n this.setState(data);\n }", "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "stateUpdate() {\n this.handlestateVariable();\n this.handlestateVariable2();\n this.handleCChange();\n this.handleAChange();\n this.handleidCapture();\n this.handleimgCapture();\n this.handleConfigChange();\n this.idcaptureVal();\n this.imgcaptureVal();\n }", "componentDidUpdate() {\n this.props.actions.updateQuestionSuccess({id: this.state.id, value: this.state.question});\n }", "update(key, value) {\n let property = {};\n property[key] = value;\n // Change state\n this.setState(property, () => this.getData());\n }", "componentWillUpdate () {}", "_UpdateComponents() {\n this.loadedComponents.forEach((component) => {\n if(component.binding) {\n // Update the component from its bound value if the value has changed\n if(component.binding.object[component.binding.property] != component.oldValue) {\n component.SetValue(component.binding.object[component.binding.property]);\n component.oldValue = component.binding.object[component.binding.property];\n }\n }\n });\n\n setTimeout(() => {\n window.requestAnimationFrame(() => {\n this._UpdateComponents();\n });\n }, this.opts.pollRateMS);\n\n }", "_updateState() {\n const currentProps = this.props;\n const currentViewport = this.context.viewport;\n const propsInTransition = this._updateUniformTransition();\n this.internalState.propsInTransition = propsInTransition;\n // Overwrite this.context.viewport during update to use the last activated viewport on this layer\n // In multi-view applications, a layer may only be drawn in one of the views\n // Which would make the \"active\" viewport different from the shared context\n this.context.viewport = this.internalState.viewport || currentViewport;\n // Overwrite this.props during update to use in-transition prop values\n this.props = propsInTransition;\n\n try {\n const updateParams = this._getUpdateParams();\n const oldModels = this.getModels();\n\n // Safely call subclass lifecycle methods\n if (this.context.gl) {\n this.updateState(updateParams);\n } else {\n try {\n this.updateState(updateParams);\n } catch (error) {\n // ignore error if gl context is missing\n }\n }\n // Execute extension updates\n for (const extension of this.props.extensions) {\n extension.updateState.call(this, updateParams, extension);\n }\n\n const modelChanged = this.getModels()[0] !== oldModels[0];\n this._updateModules(updateParams, modelChanged);\n // End subclass lifecycle methods\n\n if (this.isComposite) {\n // Render or update previously rendered sublayers\n this._renderLayers(updateParams);\n } else {\n this.setNeedsRedraw();\n // Add any subclass attributes\n this._updateAttributes(this.props);\n\n // Note: Automatic instance count update only works for single layers\n if (this.state.model) {\n this.state.model.setInstanceCount(this.getNumInstances());\n }\n }\n } finally {\n // Restore shared context\n this.context.viewport = currentViewport;\n this.props = currentProps;\n this.clearChangeFlags();\n this.internalState.needsUpdate = false;\n this.internalState.resetOldProps();\n }\n }", "componentDidUpdate() {\n this.props.actions.updateAnswerSuccess({\n questionId: this.state.questionId,\n id: this.state.id,\n label: this.state.answer,\n isTrue: this.props.isTrue\n });\n }", "stateChanged(state) {\n }", "handleUpdate(data) {\n this.setState({ data });\n}", "constructor(...args){\n super(...args)\n this.shouldComponentUpdate=PureRenderMixin.shouldComponentUpdate\n this.state={\n userName:''\n }\n }", "constructor(...args){\n super(...args)\n this.shouldComponentUpdate=PureRenderMixin.shouldComponentUpdate\n this.state={\n userName:''\n }\n }", "componentWillUpdate(np,ns){ }", "componentDidUpdate(preProps,preState,a){\n console.log(\"componentDidUpdate\",a)\n }", "setState(newProps) {\n let stateChanged = false;\n\n Object.entries(newProps).forEach(([key, val]) => {\n if (val !== this.state[key]) {\n stateChanged = true;\n }\n\n this.state[key] = val;\n });\n\n if (stateChanged) {\n this.render();\n }\n }", "function update() {\n // ... no implementation required\n }", "function updater(prevState){var state=this.constructor.getDerivedStateFromProps(nextProps,prevState);return state!==null&&state!==undefined?state:null;}// Binding \"this\" is important for shallow renderer support.", "componentDidUpdate(){\r\n console.log(\"Update\", this.state);\r\n }", "updateData(config) {\r\n this.setState(config);\r\n }", "componentWillUpdate(e, state) {\n if (state.x) {\n this.xElement.innerHTML = ' x: ' + state.x\n } \n if (state.y) {\n this.yElement.innerHTML = ' y: ' + state.y\n } \n }", "updateState (val, key) {\n this.state[key] = val\n this.updateUI()\n }", "refresh_() {\n // Can be overridden in sub-component.\n }", "stateChanged(state) {\n \n throw new Error('stateChanged() not implemented', this);\n }", "setState(state, callback) {\n if (!this.prevState) this.prevState = this.state;\n this.state = this._extend(\n this._extend({}, this.state),\n typeof state === 'function' ? state(this.state, this.props) : state\n );\n let dom = this.getDomElement();\n let container = dom.parentNode;\n let newVDom = this.render(); // This will invoke the derived class render menthod\n newVDom.component = this;\n diff (newVDom, container, dom);\n }", "handleUpdateBox(id, title) {\n this.setState({updatedId: id, updatedTitle: title});\n }", "setState (state) {\r\n this.state = state;\r\n }", "componentDidUpdate(props_) {}", "constructor(props) {\n \t//calling parent method with super\n \tsuper(props);\n//functional components don't have state, only class-based components do\n//term is property on which we want to record change\n \tthis.state = { term: ''};\n //the above live can only be in the constructor, so every instance will take a copy of the current state\n }", "updateComponents () {\n\t\tfor (let component in this.components) {\n\t\t\tthis.components[component].update();\n\t\t}\n\t}", "componentDidUpdate(prevProps, prevState, snapshot){\n console.info(this.constructor.name+' Did my component updated?');\n\n }", "update( e ){\n // Assign to let changedID ID of slider which has been changed\n let changedID = e.target.id;\n let value = e.target.value;\n if (changedID === 'sliderAmount') {\n this.setState({valueAmount: e.target.value});\n }\n if (changedID === 'sliderDuration'){\n this.setState({valueDuration: e.target.value});\n }\n\n\n this.calculate(changedID, value);\n }", "setState(_state, _args) {\n\t // This has to be handled at a higher level since we can't\n\t // replace the whole tree here however we still need a method here\n\t // so it appears on the proxy Actions class.\n\t throw new Error('Called setState on StateActions.');\n\t }", "componentWillUpdate(nextProps) {\n if (this.props.value !== nextProps.value) {\n this.setState({ value: this.props.value });\n }\n }", "componentWillUpdate() {\n console.log('Before updating a component');\n }", "updateFormFieldInState(formField, value) {\n\n }", "onChangeStatus(newStatus) {\n return () => {\n this.props.changeStatus(newStatus)\n };\n }", "componentDidUpdate(prevProps) {\n if (\n prevProps.currentIndex != this.props.currentIndex ||\n prevProps.list.length != this.props.list.length\n )\n this.setState({\n ...this.EditStateFunction()\n });\n }", "updateState(e, val) {\n val === undefined ? val = e.target.value : val; // catch location input field value since it behaves differently\n let key = e.target.name;\n // you must use a function to set state if the key is a variable\n let stateObj = function() {\n var obj = {};\n obj[key] = val;\n return obj;\n }.bind(e)();\n this.setState( stateObj );\n\n }", "componentDidUpdate() {\n\t\t/* preserve context */\n\t\tconst _this = this;\n\t}", "componentDidUpdate() {\n\t\t/* preserve context */\n\t\tconst _this = this;\n\t}", "state (...args) {\n return MVC.ComponentJS(this).state(...args)\n }", "_updateInput (input) {\n this.setState({ input })\n }", "shouldComponentUpdate(newProps, newState) {\n // console.log(\"=========================> shouldComponentUpdate\", newProps, newState);\n return true;\n }", "_update() {\n }", "componentDidUpdate(prepProps, prevState) {\n if (!this.props.onChange) return;\n if (_.isEqual(prevState, this.state)) return;\n\n const stateNow = {...this.state};\n this.debouncedOnChange(stateNow);\n }", "_requestUpdate(name,oldValue){let shouldRequestUpdate=!0;// If we have a property key, perform property update steps.\nif(name!==void 0){const ctor=this.constructor,options=ctor._classProperties.get(name)||defaultPropertyDeclaration;if(ctor._valueHasChanged(this[name],oldValue,options.hasChanged)){if(!this._changedProperties.has(name)){this._changedProperties.set(name,oldValue)}// Add to reflecting properties set.\n// Note, it's important that every change has a chance to add the\n// property to `_reflectingProperties`. This ensures setting\n// attribute + property reflects correctly.\nif(!0===options.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)){if(this._reflectingProperties===void 0){this._reflectingProperties=new Map}this._reflectingProperties.set(name,options)}}else{// Abort the request if the property should not be considered changed.\nshouldRequestUpdate=!1}}if(!this._hasRequestedUpdate&&shouldRequestUpdate){this._enqueueUpdate()}}", "function newState(state) {\n alert(\"This functionality is yet to be implemented!\");\n }", "setState (newState) {\n this._state = assign({}, this._state, newState);\n this.trigger(assign({}, this._state));\n }", "update()\n\t{ \n\t\tthrow new Error(\"update() method not implemented\");\n\t}", "update() {\n this.setState({\n numberOfGuests: this.props.model.getNumberOfGuests(),\n menu: this.props.model.getMenu(),\n menuPrice: this.props.model.calcCost(),\n });\n }", "update(props) {\n if (props.handleDOMEvents != this._props.handleDOMEvents)\n ensureListeners(this);\n let prevProps = this._props;\n this._props = props;\n if (props.plugins) {\n props.plugins.forEach(checkStateComponent);\n this.directPlugins = props.plugins;\n }\n this.updateStateInner(props.state, prevProps);\n }", "setState (newState) {\n this.state = {...newState};\n if (this.updaterWin) {\n this.updaterWin.send('update-state-change', this.state);\n }\n }", "componentUpdated(el, binding, vnode) {\n const self = vnode.context\n const instanceName = getInstanceName(el, binding, vnode)\n const options = binding.value || {}\n const quill = self[instanceName]\n if (quill) {\n const model = vnode.data.model\n const _value = vnode.data.attrs ? vnode.data.attrs.value : null\n const _content = vnode.data.attrs ? vnode.data.attrs.content : null\n const disabled = vnode.data.attrs ? vnode.data.attrs.disabled : null\n const content = model ? model.value : (_value || _content)\n const newData = content\n const oldData = el.children[0].innerHTML\n quill.enable(!disabled)\n if (newData) {\n if (newData != oldData) {\n const range = quill.getSelection()\n quill.root.innerHTML = newData\n setTimeout(() => {\n quill.setSelection(range)\n })\n }\n } else {\n quill.setText('')\n }\n }\n }", "componentUpdated(el, binding, vnode) {\n const self = vnode.context\n const instanceName = getInstanceName(el, binding, vnode)\n const options = binding.value || {}\n const quill = self[instanceName]\n if (quill) {\n const model = vnode.data.model\n const _value = vnode.data.attrs ? vnode.data.attrs.value : null\n const _content = vnode.data.attrs ? vnode.data.attrs.content : null\n const disabled = vnode.data.attrs ? vnode.data.attrs.disabled : null\n const content = model ? model.value : (_value || _content)\n const newData = content\n const oldData = el.children[0].innerHTML\n quill.enable(!disabled)\n if (newData) {\n if (newData != oldData) {\n const range = quill.getSelection()\n quill.root.innerHTML = newData\n setTimeout(() => {\n quill.setSelection(range)\n })\n }\n } else {\n quill.setText('')\n }\n }\n }", "privateSendUpdate () {\n this.emit('update', this.getState())\n }", "_onChange() {\n if (this.isMounted()) {\n this.setState({ value: ButtonStore.getValue() });\n this.setState({ session: AuthStore.getSession() });\n }\n }", "componentDidUpdate(prevProps) {\n // Is called when the corresponding state is changed in parent class (indirect trigger)\n // Is also called a 2nd time when setState{open:true} is called inside this function\n if (prevProps != this.props) {\n this.state.type = this.props.popUp.type;\n this.state.message = this.props.popUp.message;\n this.state.open = this.props.popUp.openPopUp;\n this.checkAction();\n }\n }", "componentDidUpdate(prevProps, prevState) { // eslint-disable-line\n if (this.state.value !== prevState.value) {\n this.props.setValue(this.state.value);\n if (this.state.manualChangeKey !== prevState.manualChangeKey || this.props.shouldUpdateAlways) {\n this.props.onChangeInput(this.props.name, this.state.value);\n }\n }\n }", "componentDidUpdate(preProps, preState, a) {\n console.log('componentDidUpdate', a);\n\n }", "_onChange() {\n this.setState(getUserState());\n }", "_requestUpdate(e,t){let n=!0;// If we have a property key, perform property update steps.\nif(e!==void 0){const r=this.constructor,a=r._classProperties.get(e)||defaultPropertyDeclaration;r._valueHasChanged(this[e],t,a.hasChanged)?(!this._changedProperties.has(e)&&this._changedProperties.set(e,t),!0===a.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)&&(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,a))):n=!1}!this._hasRequestedUpdate&&n&&this._enqueueUpdate()}", "componentWillUpdate(){\n }", "update() {\n throw new Error(\"Not Implemented\");\n }" ]
[ "0.72174495", "0.6760336", "0.6674498", "0.6611827", "0.6539205", "0.65264326", "0.6489361", "0.6470911", "0.64590335", "0.63847995", "0.63539994", "0.6335737", "0.63053733", "0.6304823", "0.6271708", "0.6266727", "0.62187904", "0.6214442", "0.61935455", "0.6188449", "0.6157305", "0.61478484", "0.61443365", "0.6140367", "0.61390674", "0.613596", "0.613596", "0.61256325", "0.61239016", "0.61233854", "0.6123324", "0.6120479", "0.611167", "0.6111232", "0.60959405", "0.60901123", "0.60850686", "0.6054673", "0.6054408", "0.6044684", "0.6036177", "0.60302436", "0.6023885", "0.6020572", "0.60129994", "0.60118884", "0.6000543", "0.5996156", "0.59904814", "0.59904814", "0.59867513", "0.59786934", "0.597165", "0.596662", "0.5959947", "0.59415275", "0.5939781", "0.5929233", "0.5929179", "0.59259486", "0.59028167", "0.59000874", "0.58902276", "0.58871704", "0.58780885", "0.5876325", "0.5868977", "0.5867791", "0.58629566", "0.5861476", "0.5854515", "0.5853111", "0.58319706", "0.58319193", "0.5826492", "0.582468", "0.5817974", "0.5817974", "0.5817835", "0.5805253", "0.58011883", "0.58008575", "0.58000433", "0.5799151", "0.57973576", "0.5794905", "0.5794636", "0.5793946", "0.5789701", "0.578825", "0.578281", "0.578281", "0.57796067", "0.57764983", "0.57761663", "0.57745504", "0.57693446", "0.57579017", "0.5757636", "0.5750323", "0.5745101" ]
0.0
-1
Mark a component as needing a rerender, adding an optional callback to a list of functions which will be executed once the rerender occurs.
function enqueueUpdate(component) { ensureInjected(); // Various parts of our code (such as ReactCompositeComponent's // _renderValidatedComponent) assume that calls to render aren't nested; // verify that that's the case. (This is called by each top-level update // function, like setProps, setState, forceUpdate, etc.; creation and // destruction of top-level components is guarded in ReactMount.) ("production" !== process.env.NODE_ENV ? warning( ReactCurrentOwner.current == null, 'enqueueUpdate(): Render methods should be a pure function of props ' + 'and state; triggering nested component updates from render is not ' + 'allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate.' ) : null); if (!batchingStrategy.isBatchingUpdates) { batchingStrategy.batchedUpdates(enqueueUpdate, component); return; } dirtyComponents.push(component); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldRerender () {\n return false\n }", "function renderCallback() {\n\n while (TO_RENDER.length) {\n TO_RENDER.shift().notify();\n }\n\n TO_RENDER.added = {};\n\n while (ENV_QUEUE.length) {\n var env = ENV_QUEUE.shift();\n for (var key in env.revalidateQueue) {\n env.revalidateQueue[key].revalidate();\n }\n reslot(env);\n }\n ENV_QUEUE.added = {};\n}", "beforerender (el) {\n console.log('Component is about to be rendered for the first time')\n\n // this is where you can register other lifecycle events:\n // on.resize()\n // on.ready()\n // on.intersect()\n // on.idle()\n }", "reRender(skipPreRenderRefresh = false) {\n this.refreshFromRerender = true;\n super.reRender(skipPreRenderRefresh);\n this.initDomEvents();\n }", "render(...args) {\n if (this._render) {\n this.__notify(EV.BEFORE_RENDER);\n this._render(...args);\n this.__notify(EV.RENDERED);\n }\n\n this.rendered = true;\n }", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_429( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_412( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "forceUpdateHandler(){\n this.setState({ reRender: true})\n }", "function addRenderListener(listener) {\n renderListeners.push(listener);\n}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_587( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function enqueueUpdate(component, callback) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== process.env.NODE_ENV ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== process.env.NODE_ENV ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== process.env.NODE_ENV ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== process.env.NODE_ENV ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== process.env.NODE_ENV ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== process.env.NODE_ENV ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== process.env.NODE_ENV ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== process.env.NODE_ENV ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== process.env.NODE_ENV ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_577( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "onRowsRerender() {\n this.scheduleDraw(true);\n }", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_395( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function enqueueUpdate(component, callback) {\n (\"production\" !== \"development\" ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== \"development\" ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== \"development\" ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== \"development\" ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== \"development\" ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== \"development\" ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== \"development\" ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== \"development\" ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== \"development\" ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== \"development\" ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function enqueueUpdate(component, callback) {\n (\"production\" !== \"development\" ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== \"development\" ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_332( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function enqueueUpdate(component, callback) {\n (\"production\" !== \"production\" ? invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n ) : invariant(!callback || typeof callback === \"function\"));\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the case. (This is called by each top-level update\n // function, like setProps, setState, forceUpdate, etc.; creation and\n // destruction of top-level components is guarded in ReactMount.)\n (\"production\" !== \"production\" ? warning(\n ReactCurrentOwner.current == null,\n 'enqueueUpdate(): Render methods should be a pure function of props ' +\n 'and state; triggering nested component updates from render is not ' +\n 'allowed. If necessary, trigger nested updates in ' +\n 'componentDidUpdate.'\n ) : null);\n\n if (!batchingStrategy.isBatchingUpdates) {\n batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_330( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_457( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_475( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_488( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function enqueueUpdate(component, callback) {\n\t (\"production\" !== process.env.NODE_ENV ? invariant(\n\t !callback || typeof callback === \"function\",\n\t 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n\t '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n\t 'isn\\'t callable.'\n\t ) : invariant(!callback || typeof callback === \"function\"));\n\t ensureInjected();\n\t\n\t // Various parts of our code (such as ReactCompositeComponent's\n\t // _renderValidatedComponent) assume that calls to render aren't nested;\n\t // verify that that's the case. (This is called by each top-level update\n\t // function, like setProps, setState, forceUpdate, etc.; creation and\n\t // destruction of top-level components is guarded in ReactMount.)\n\t (\"production\" !== process.env.NODE_ENV ? warning(\n\t ReactCurrentOwner.current == null,\n\t 'enqueueUpdate(): Render methods should be a pure function of props ' +\n\t 'and state; triggering nested component updates from render is not ' +\n\t 'allowed. If necessary, trigger nested updates in ' +\n\t 'componentDidUpdate.'\n\t ) : null);\n\t\n\t if (!batchingStrategy.isBatchingUpdates) {\n\t batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n\t return;\n\t }\n\t\n\t dirtyComponents.push(component);\n\t\n\t if (callback) {\n\t if (component._pendingCallbacks) {\n\t component._pendingCallbacks.push(callback);\n\t } else {\n\t component._pendingCallbacks = [callback];\n\t }\n\t }\n\t}", "function enqueueUpdate(component, callback) {\n\t (\"production\" !== process.env.NODE_ENV ? invariant(\n\t !callback || typeof callback === \"function\",\n\t 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n\t '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n\t 'isn\\'t callable.'\n\t ) : invariant(!callback || typeof callback === \"function\"));\n\t ensureInjected();\n\n\t // Various parts of our code (such as ReactCompositeComponent's\n\t // _renderValidatedComponent) assume that calls to render aren't nested;\n\t // verify that that's the case. (This is called by each top-level update\n\t // function, like setProps, setState, forceUpdate, etc.; creation and\n\t // destruction of top-level components is guarded in ReactMount.)\n\t (\"production\" !== process.env.NODE_ENV ? warning(\n\t ReactCurrentOwner.current == null,\n\t 'enqueueUpdate(): Render methods should be a pure function of props ' +\n\t 'and state; triggering nested component updates from render is not ' +\n\t 'allowed. If necessary, trigger nested updates in ' +\n\t 'componentDidUpdate.'\n\t ) : null);\n\n\t if (!batchingStrategy.isBatchingUpdates) {\n\t batchingStrategy.batchedUpdates(enqueueUpdate, component, callback);\n\t return;\n\t }\n\n\t dirtyComponents.push(component);\n\n\t if (callback) {\n\t if (component._pendingCallbacks) {\n\t component._pendingCallbacks.push(callback);\n\t } else {\n\t component._pendingCallbacks = [callback];\n\t }\n\t }\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_520( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function onRender() {\n\t\tvar args;\n\t\tvar i;\n\t\t__debug_452( 'Received a render event. Re-emitting...' );\n\t\targs = new Array( arguments.length+1 );\n\t\targs[ 0 ] = 'render';\n\t\tfor ( i = 0; i < arguments.length; i++ ) {\n\t\t\targs[ i+1 ] = arguments[ i ];\n\t\t}\n\t\tself.emit.apply( self, args );\n\t}", "function useInitialOrEveryRender(callback, isInitialOnly) {\r\n if (isInitialOnly === void 0) { isInitialOnly = false; }\r\n var isInitialRender = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useRef\"])(true);\r\n if (!isInitialOnly || (isInitialOnly && isInitialRender.current)) {\r\n callback();\r\n }\r\n isInitialRender.current = false;\r\n}", "function pureRenderDecorator(component) {\n\t if (component.prototype.shouldComponentUpdate !== undefined) {\n\t // We're not using the condition mecanism of warning()\n\t // here to avoid useless calls to getComponentName().\n\t warning(\n\t false,\n\t 'Cannot decorate `%s` with @pureRenderDecorator, '\n\t + 'because it already implements `shouldComponentUpdate().',\n\t getComponentName(component)\n\t )\n\t }\n\n\t component.prototype.shouldComponentUpdate = shouldComponentUpdate;\n\t return component;\n\t}", "_didRender(_props, _changedProps, _prevProps) { }", "function pureRenderDecorator(component) {\n\t if (component.prototype.shouldComponentUpdate !== undefined) {\n\t // We're not using the condition mecanism of warning()\n\t // here to avoid useless calls to getComponentName().\n\t warning(\n\t false,\n\t 'Cannot decorate `%s` with @pureRenderDecorator, '\n\t + 'because it already implements `shouldComponentUpdate().',\n\t getComponentName(component)\n\t )\n\t }\n\t\n\t component.prototype.shouldComponentUpdate = shouldComponentUpdate;\n\t return component;\n\t}", "onBeforeRendering() {}", "function useInitialOrEveryRender(callback, isInitialOnly) {\n if (isInitialOnly === void 0) { isInitialOnly = false; }\n var isInitialRender = useRef(true);\n if (!isInitialOnly || (isInitialOnly && isInitialRender.current)) {\n callback();\n }\n isInitialRender.current = false;\n}", "function renderCall() {\n // Repaint?\n if (needs_repaint === true) {\n needs_repaint = false;\n\n ctx.clearRect(0, 0, canvas_el.width, canvas_el.height);\n\n renderTimeXAxis();\n renderElementsMargin();\n\n renderRows();\n\n renderCurrentTimePoint();\n\n }\n }", "forceUpdate() {\n if (this[_queuedUpdate]) {\n this[_dirty] = true;\n return;\n }\n\n this[_virtualRender]();\n this[_queuedUpdate] = true;\n\n TaskQueue.push(() => {\n if (this[_dirty] && !this.isDisposed) {\n this[_virtualRender]();\n this[_dirty] = false;\n }\n this[_queuedUpdate] = false;\n });\n }", "shouldRerender(newProps) {\n if (newProps.disabled !== this.props.disabled) return true\n // TODO: we should still detect when the document has changed,\n // see https://github.com/substance/substance/issues/543\n return false\n }", "shouldRerender(newProps) {\n if (newProps.disabled !== this.props.disabled) return true\n // TODO: we should still detect when the document has changed,\n // see https://github.com/substance/substance/issues/543\n return false\n }", "function pureRenderDecorator(component) {\n if (component.prototype.shouldComponentUpdate !== undefined) {\n // We're not using the condition mecanism of warning()\n // here to avoid useless calls to getComponentName().\n warning(\n false,\n 'Cannot decorate `%s` with @pureRenderDecorator, '\n + 'because it already implements `shouldComponentUpdate().',\n getComponentName(component)\n )\n }\n\n component.prototype.shouldComponentUpdate = shouldComponentUpdate;\n return component;\n}", "function enqueueUpdate(component){ensureInjected(); // Various parts of our code (such as ReactCompositeComponent's\n\t// _renderValidatedComponent) assume that calls to render aren't nested;\n\t// verify that that's the case. (This is called by each top-level update\n\t// function, like setProps, setState, forceUpdate, etc.; creation and\n\t// destruction of top-level components is guarded in ReactMount.)\n\t true?warning(ReactCurrentOwner.current == null,'enqueueUpdate(): Render methods should be a pure function of props ' + 'and state; triggering nested component updates from render is not ' + 'allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate.'):null;if(!batchingStrategy.isBatchingUpdates){batchingStrategy.batchedUpdates(enqueueUpdate,component);return;}dirtyComponents.push(component);}", "set customFunctionWhenPrepareToRender(func) {\n this._customFunctionWhenPrepareToRender = func;\n }", "attributeChangedCallback() {\n this.render();\n }", "onBeforeRender () {\n\n }", "function rerender() {\n const Todo = require('./components/todo.jsx').default;\n app(<Todo cursor={ state.cursor() } />);\n}", "callBackUpdateFalse() {\n this.props.callBackFalse();\n }", "onRender () {\n\n }", "willRender() {\n this.startReloading();\n }", "function enqueueUpdate(component, callback) {\n invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n );\n\n if (!isBatchingUpdates) {\n component.performUpdateIfNecessary();\n callback && callback();\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "function forceRender() {\n setUpdateVal((prevVal) => prevVal + 1);\n }", "function batchedCallback(callback) {\n\treturn function(err, res) {\n\t\tReactUpdates.batchedUpdates(callback.bind(null, err, res));\n\t}\n}", "onRender()/*: void*/ {\n this.render();\n }", "requestRedraw () {\n this.redrawRequested = true;\n }", "function enqueueUpdate(component){ensureInjected();// Various parts of our code (such as ReactCompositeComponent's\n// _renderValidatedComponent) assume that calls to render aren't nested;\n// verify that that's the case. (This is called by each top-level update\n// function, like setState, forceUpdate, etc.; creation and\n// destruction of top-level components is guarded in ReactMount.)\nif(!batchingStrategy.isBatchingUpdates){batchingStrategy.batchedUpdates(enqueueUpdate,component);return;}dirtyComponents.push(component);if(component._updateBatchNumber==null){component._updateBatchNumber=updateBatchNumber+1;}}", "set needsRepaint(n) {\n this._needsRepaint = n;\n }", "registerCallback (callback) {\n this._updates.push(callback);\n }", "registerCallback (callback) {\n this._updates.push(callback);\n }", "componentDidMount() { this.props.events.on('update', this.forceUpdate); }", "function render() {\n if (!willRender) {\n willRender = true;\n process.nextTick(function() {\n screen.render();\n willRender = false;\n });\n }\n}", "function bindRenderedEvent(zr, ecIns) {\n zr.on('rendered', function () {\n ecIns.trigger('rendered'); // The `finished` event should not be triggered repeatly,\n // so it should only be triggered when rendering indeed happend\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n\n if ( // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[OPTION_UPDATED] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n}", "function bindRenderedEvent(zr, ecIns) {\n zr.on('rendered', function () {\n ecIns.trigger('rendered'); // The `finished` event should not be triggered repeatly,\n // so it should only be triggered when rendering indeed happend\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n\n if ( // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[OPTION_UPDATED] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n}", "function bindRenderedEvent(zr, ecIns) {\n zr.on('rendered', function () {\n ecIns.trigger('rendered'); // The `finished` event should not be triggered repeatly,\n // so it should only be triggered when rendering indeed happend\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n\n if ( // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[OPTION_UPDATED] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n}", "function bindRenderedEvent(zr, ecIns) {\n zr.on('rendered', function () {\n ecIns.trigger('rendered'); // The `finished` event should not be triggered repeatly,\n // so it should only be triggered when rendering indeed happend\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n\n if ( // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[OPTION_UPDATED] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n}", "function bindRenderedEvent(zr, ecIns) {\n zr.on('rendered', function () {\n ecIns.trigger('rendered'); // The `finished` event should not be triggered repeatly,\n // so it should only be triggered when rendering indeed happend\n // in zrender. (Consider the case that dipatchAction is keep\n // triggering when mouse move).\n\n if ( // Although zr is dirty if initial animation is not finished\n // and this checking is called on frame, we also check\n // animation finished for robustness.\n zr.animation.isFinished() && !ecIns[OPTION_UPDATED] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length) {\n ecIns.trigger('finished');\n }\n });\n}", "_notifyRenderer() {\n this.renderer.notify();\n }", "render() {\n return (\n <div ref={this.refCallback}> </div> \n );\n }", "function useMemoCallback$1(func) {\n var funRef = React.useRef(func);\n funRef.current = func;\n var callback = React.useCallback(function () {\n var _funRef$current;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return (_funRef$current = funRef.current) === null || _funRef$current === void 0 ? void 0 : _funRef$current.call.apply(_funRef$current, [funRef].concat(args));\n }, []);\n return func ? callback : undefined;\n}", "function useKeeper(arg, refresh) {\n if (refresh === void 0) {\n refresh = false;\n }\n\n var ref = Object(__WEBPACK_IMPORTED_MODULE_0_react__[\"useRef\"])(arg);\n Object(__WEBPACK_IMPORTED_MODULE_0_react__[\"useEffect\"])(function () {\n if (refresh) ref.current = arg;\n });\n return ref.current;\n}", "handleRendered_() {\n\t\tthis.isRendered_ = true;\n\t}", "function enqueueUpdate(component){ensureInjected(); // Various parts of our code (such as ReactCompositeComponent's\n// _renderValidatedComponent) assume that calls to render aren't nested;\n// verify that that's the case. (This is called by each top-level update\n// function, like setProps, setState, forceUpdate, etc.; creation and\n// destruction of top-level components is guarded in ReactMount.)\n\"production\"!==process.env.NODE_ENV?warning(ReactCurrentOwner.current==null,'enqueueUpdate(): Render methods should be a pure function of props '+'and state; triggering nested component updates from render is not '+'allowed. If necessary, trigger nested updates in '+'componentDidUpdate.'):null;if(!batchingStrategy.isBatchingUpdates){batchingStrategy.batchedUpdates(enqueueUpdate,component);return;}dirtyComponents.push(component);}", "function enqueueUpdate(component){ensureInjected(); // Various parts of our code (such as ReactCompositeComponent's\n\t// _renderValidatedComponent) assume that calls to render aren't nested;\n\t// verify that that's the case. (This is called by each top-level update\n\t// function, like setProps, setState, forceUpdate, etc.; creation and\n\t// destruction of top-level components is guarded in ReactMount.)\n\tif(!batchingStrategy.isBatchingUpdates){batchingStrategy.batchedUpdates(enqueueUpdate,component);return;}dirtyComponents.push(component);}", "function enqueueUpdate(component){ensureInjected(); // Various parts of our code (such as ReactCompositeComponent's\n\t// _renderValidatedComponent) assume that calls to render aren't nested;\n\t// verify that that's the case. (This is called by each top-level update\n\t// function, like setProps, setState, forceUpdate, etc.; creation and\n\t// destruction of top-level components is guarded in ReactMount.)\n\tif(!batchingStrategy.isBatchingUpdates){batchingStrategy.batchedUpdates(enqueueUpdate,component);return;}dirtyComponents.push(component);}", "function wrapRender(opts) {\n\t opts.render = render$1(opts);\n\t}", "function batchedUpdates(callback) {\n if (isBatchingUpdates) {\n // We're already executing in an environment where updates will be batched,\n // so this is a no-op.\n callback();\n return;\n }\n\n isBatchingUpdates = true;\n\n try {\n callback();\n // TODO: Sort components by depth such that parent components update first\n for (var i = 0; i < dirtyComponents.length; i++) {\n // If a component is unmounted before pending changes apply, ignore them\n // TODO: Queue unmounts in the same list to avoid this happening at all\n var component = dirtyComponents[i];\n if (component.isMounted()) {\n // If performUpdateIfNecessary happens to enqueue any new updates, we\n // shouldn't execute the callbacks until the next render happens, so\n // stash the callbacks first\n var callbacks = component._pendingCallbacks;\n component._pendingCallbacks = null;\n component.performUpdateIfNecessary();\n if (callbacks) {\n for (var j = 0; j < callbacks.length; j++) {\n callbacks[j].call(component);\n }\n }\n }\n }\n } catch (error) {\n // IE8 requires `catch` in order to use `finally`.\n throw error;\n } finally {\n dirtyComponents.length = 0;\n isBatchingUpdates = false;\n }\n}", "on_render() {\n time_error(`Widget ${this.name} (${this.typename}) does not implement on_render()`)\n }", "function useMemoCallback(func) {\n var funRef = React.useRef(func);\n funRef.current = func;\n var callback = React.useCallback(function () {\n var _funRef$current;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return (_funRef$current = funRef.current) === null || _funRef$current === void 0 ? void 0 : _funRef$current.call.apply(_funRef$current, [funRef].concat(args));\n }, []);\n return func ? callback : undefined;\n}", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "reactifyYourApp() {\n ///////////\n // Mount //\n ///////////\n for (let [component, fields, opts] of this.subscribedComponents) {\n // This proxy wrapping code should be the same as the update. So we'll likely want to\n // abstract the code out.\n const data = this.setupDataForPassingToComponents(fields, opts.accesses);\n\n component.data = data;\n component.mount({ data });\n component.mountAndUpdate && component.mountAndUpdate({ data });\n }\n\n ////////////////////\n // MountAndUpdate //\n ////////////////////\n\n // This is code that runs for *both* mount and update. The ordering is that it runs right\n // after initial mount, and then runs *before* every update. This is just because it\n // visually makes sense for this function to be sandwiched between mount and update, as\n // there are almost always things you only want to run on mount, and then run some\n // longer-living code after.\n\n // You'll notice that this code is merely added in the Mount and Update cycles. It's a\n // one-liner.\n\n ////////////\n // Update //\n ////////////\n const callback = () => {\n if (this.changedFields.size != 0) {\n // Iterate through all components that are subscribed and check to see if any of the\n // fields it subscribed to changed.\n let componentsToUpdate = [];\n for (let [component, fields, opts] of this.subscribedComponents) {\n for (field of fields) {\n if (this.changedFields.has(field)) {\n // The component needs to be updated.\n\n const data = this.setupDataForPassingToComponents(fields, opts.accesses);\n\n // The update code itself might call setData, but because we only update\n // components every animation frame, this should not result in any\n // recursive issues.\n //\n // Actually though, because it mutates state, it may lead to\n // inconsistent component state inter-this-loop. So we actually need to\n // ensure setData doesn't alter state until we're ready. I think this is\n // possible by delaying the component update to outside of this loop:\n componentsToUpdate.push([component, data]);\n\n // Exit this inner loop.\n break;\n }\n }\n }\n\n // Now batch all the updates together at once. Ugh, the problem though still\n // remains: any mutation in an update will affect further updates. I can see why\n // React prefers immutability... yikes! But if we don't call setData in update code,\n // we'll be fine. So let's make that a restriction for now and see how that pans\n // out.\n //\n // Alternatively, (and I have indeed implemented this solution since documenting\n // here) since the central data that components use for updates is passed in to\n // them, if we make data a deep clone, then any mutation within a component won't\n // affect central state: only setData will affect central state. This *still* means\n // that central data can be changed by setData calls in update code, however, the\n // data being passed to each component will *not* be affected by those mutations,\n // because they are copies.\n //\n // Thus, components that don't access state.data directly use data that's fully\n // isolated from our central state, and only setData can change it, which we\n // metaphorically think of as sending a drone request to central state.\n //\n // It is important to note that a component *can* choose to update state internally\n // and not notify central. This is a bit problematic because no other components can\n // access such data in a reactive way, and further, DOM updates have to be handled\n // directly by the component. Even `update` won't work as intended, because it won't\n // have access to the `data` values and whatever else central state provides,\n // requiring manual passing of those values. Perhaps the \"correct\" way to do that in\n // those cases is to keep an internal buffer of the data stored every update, and\n // use that value in manual calls to update. As long as the synchronization code is\n // correct, that will ensure that the values are always up-to-date from central.\n for (let [component, data, _opts] of componentsToUpdate) {\n component.data = data;\n component.mountAndUpdate && component.mountAndUpdate({ data });\n component.update && component.update({ data });\n }\n // Clear the set, as all fields have been changed.\n this.changedFields = new Set();\n } else {\n // Do nothing\n }\n\n // This triggers a loop of this function, but throttled to be only as fast as the DOM\n // can visually update. Infinite loops are possible, but will not gobble up all the CPU\n // because of this throttling. That said, I'm not sure how expensive doing things this\n // way will be; it might be worth cancelling the loop when there are no data changes\n // mid-loop, and wait for the next time setData is called to start up again.\n window.requestAnimationFrame(callback);\n };\n window.requestAnimationFrame(callback);\n }", "componentDidUpdate() \n {\n console.log('my component just updated - it rerendered');\n }", "function rerenderall() {\n console.log(\"Step 4\");\n rerenderElements(\"runs\");\n rerenderElements(\"configs\");\n rerenderElements(\"evals\");\n rerenderElements(\"locations\");\n}", "skipRerender_() {\n\t\tif (this.lastElementCreationCall_.length > 0) {\n\t\t\tIncrementalDOM.elementOpen.apply(null, this.lastElementCreationCall_);\n\t\t\tIncrementalDOM.skip();\n\t\t\tIncrementalDOM.elementClose(this.lastElementCreationCall_[0]);\n\t\t}\n\t}", "function handleRender(view) {\n view._isRendered = true;\n triggerDOMRefresh(view);\n }", "function useKeeper(arg, refresh) {\n if (refresh === void 0) {\n refresh = false;\n }\n\n var ref = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useRef\"])(arg);\n Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useEffect\"])(function () {\n if (refresh) ref.current = arg;\n });\n return ref.current;\n}", "attributeChangedCallback(attrName, oldVal, newVal) {\n this.render();\n }", "attributeChangedCallback(attrName, oldVal, newVal) {\n this.render();\n }", "function renderComponentNow(component) {\n if (componentsToRender.indexOf(component) === -1) componentsToRender.push(component);\n}", "shouldRender(newProps) {\n return true;\n }", "function enqueueUpdate(component) {\n\t ensureInjected();\n\n\t // Various parts of our code (such as ReactCompositeComponent's\n\t // _renderValidatedComponent) assume that calls to render aren't nested;\n\t // verify that that's the case. (This is called by each top-level update\n\t // function, like setProps, setState, forceUpdate, etc.; creation and\n\t // destruction of top-level components is guarded in ReactMount.)\n\t ( false ? warning(\n\t ReactCurrentOwner.current == null,\n\t 'enqueueUpdate(): Render methods should be a pure function of props ' +\n\t 'and state; triggering nested component updates from render is not ' +\n\t 'allowed. If necessary, trigger nested updates in ' +\n\t 'componentDidUpdate.'\n\t ) : null);\n\n\t if (!batchingStrategy.isBatchingUpdates) {\n\t batchingStrategy.batchedUpdates(enqueueUpdate, component);\n\t return;\n\t }\n\n\t dirtyComponents.push(component);\n\t}", "function Component(props) {\n const handleChange = useCallback(() => props.callback(props.id), [props.id]);\n return <AnotherComponent onChange={handleChange} />;\n}", "function updateEvents(forceRender) {\n\t\tif (!options.lazyFetching\n\t\t\t\t|| isFetchNeeded(currentView.visStart, currentView.visEnd)) {\n\t\t\trefetchEvents();\n\t\t} else if (forceRender) {\n\t\t\trerenderEvents();\n\t\t}\n\t}", "afterRender() { }", "afterRender() { }" ]
[ "0.63914156", "0.62118226", "0.5860591", "0.58191264", "0.55730593", "0.5489673", "0.54876024", "0.54651797", "0.5460382", "0.5452329", "0.54490745", "0.54490745", "0.54490745", "0.54490745", "0.54490745", "0.54490745", "0.54490745", "0.54490745", "0.5448425", "0.54472405", "0.5442148", "0.5439817", "0.5439817", "0.5439817", "0.5439817", "0.5439817", "0.5439817", "0.54381704", "0.5436448", "0.5432571", "0.5431351", "0.54280996", "0.54229546", "0.5419958", "0.5417124", "0.5415844", "0.54155356", "0.5366461", "0.5348589", "0.53443396", "0.53361416", "0.5271549", "0.52565914", "0.5243239", "0.5232191", "0.52226204", "0.52226204", "0.5221459", "0.52135414", "0.5204298", "0.5187646", "0.5176932", "0.5176596", "0.51583683", "0.51530594", "0.5116655", "0.5089075", "0.50823283", "0.5081463", "0.50804174", "0.5074701", "0.5063057", "0.50107306", "0.49989837", "0.49989837", "0.4993126", "0.49930328", "0.49821526", "0.49821526", "0.49821526", "0.49821526", "0.49821526", "0.4981656", "0.4979549", "0.4975467", "0.49745634", "0.49718273", "0.49656248", "0.4962714", "0.4962714", "0.49543622", "0.49507368", "0.49393374", "0.4923003", "0.49180448", "0.49180448", "0.491547", "0.4914006", "0.49099317", "0.4903805", "0.48997465", "0.48903355", "0.48872086", "0.48872086", "0.48849896", "0.48773015", "0.48737645", "0.48701394", "0.48647392", "0.4863633", "0.4863633" ]
0.0
-1
Enqueue a callback to be run at the end of the current batching cycle. Throws if no updates are currently being performed.
function asap(callback, context) { ("production" !== process.env.NODE_ENV ? invariant( batchingStrategy.isBatchingUpdates, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.' ) : invariant(batchingStrategy.isBatchingUpdates)); asapCallbackQueue.enqueue(callback, context); asapEnqueued = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function batchedCallback(callback) {\n\treturn function(err, res) {\n\t\tReactUpdates.batchedUpdates(callback.bind(null, err, res));\n\t}\n}", "function asap(callback,context){ true?invariant(batchingStrategy.isBatchingUpdates,'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.'):invariant(batchingStrategy.isBatchingUpdates);asapCallbackQueue.enqueue(callback,context);asapEnqueued = true;}", "function asap(callback, context) {\n\t invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t ( false ? invariant(\n\t batchingStrategy.isBatchingUpdates,\n\t 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' +\n\t 'updates are not being batched.'\n\t ) : invariant(batchingStrategy.isBatchingUpdates));\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: Can't enqueue an asap callback in a context where\" + 'updates are not being batched.');\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function enqueueUpdate(component, callback) {\n invariant(\n !callback || typeof callback === \"function\",\n 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' +\n '`setState`, `replaceState`, or `forceUpdate` with a callback that ' +\n 'isn\\'t callable.'\n );\n\n if (!isBatchingUpdates) {\n component.performUpdateIfNecessary();\n callback && callback();\n return;\n }\n\n dirtyComponents.push(component);\n\n if (callback) {\n if (component._pendingCallbacks) {\n component._pendingCallbacks.push(callback);\n } else {\n component._pendingCallbacks = [callback];\n }\n }\n}", "registerCallback (callback) {\n this._updates.push(callback);\n }", "registerCallback (callback) {\n this._updates.push(callback);\n }", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? false ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? false ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? true ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n\t\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t\t asapCallbackQueue.enqueue(callback, context);\n\t\t asapEnqueued = true;\n\t\t}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? (undefined) !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\r\n\t !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\r\n\t asapCallbackQueue.enqueue(callback, context);\r\n\t asapEnqueued = true;\r\n\t}", "function asap(callback,context){!batchingStrategy.isBatchingUpdates?process.env.NODE_ENV!=='production'?invariant(false,'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where'+'updates are not being batched.'):invariant(false):void 0;asapCallbackQueue.enqueue(callback,context);asapEnqueued=true;}", "function asap(callback,context){!batchingStrategy.isBatchingUpdates?process.env.NODE_ENV!=='production'?invariant(false,'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where'+'updates are not being batched.'):invariant(false):void 0;asapCallbackQueue.enqueue(callback,context);asapEnqueued=true;}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? \"development\" !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? true ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n (\"production\" !== \"production\" ? invariant(\n batchingStrategy.isBatchingUpdates,\n 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context where' +\n 'updates are not being batched.'\n ) : invariant(batchingStrategy.isBatchingUpdates));\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? true ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? true ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? true ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? false ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? false ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? false ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? false ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n\t !batchingStrategy.isBatchingUpdates ? false ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n\t asapCallbackQueue.enqueue(callback, context);\n\t asapEnqueued = true;\n\t}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}", "function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}" ]
[ "0.644611", "0.6350327", "0.6277181", "0.6277181", "0.6277181", "0.6277181", "0.6277181", "0.6277181", "0.6277181", "0.6277181", "0.6223461", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.62219334", "0.6134842", "0.61298305", "0.61298305", "0.6094821", "0.6094821", "0.60914415", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.60616565", "0.6059493", "0.6059493", "0.6059493", "0.6059493", "0.6059493", "0.6059493", "0.60532296", "0.60485995", "0.60451496", "0.60451496", "0.60451496", "0.60451496", "0.60451496", "0.60451496", "0.60451496", "0.60451496", "0.60451496", "0.60451496", "0.60451496", "0.60451496", "0.60451496", "0.60407424", "0.6039292", "0.6026367", "0.6026367", "0.6021808", "0.6021731", "0.60213095", "0.60179526", "0.60179526", "0.60179526", "0.6016564", "0.6016564", "0.6016564", "0.6016564", "0.6016564", "0.6008705", "0.6008705", "0.6008705", "0.6008705", "0.6008705", "0.6008705" ]
0.0
-1
A specialized pseudoevent module to help keep track of components waiting to be notified when their DOM representations are available for use. This implements `PooledClass`, so you should never need to instantiate this. Instead, use `CallbackQueue.getPooled()`.
function CallbackQueue() { this._callbacks = null; this._contexts = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EventPool() {\n this.events = [];\n}", "function EventsQueue() {}", "function EventWaiter() {\n this._waitingList = [];\n EventEmitter.call( this );\n}", "function EventQueue(callback) {\n this.events = [];\n this.buf = [];\n this.callback = callback;\n}", "constructor() {\n this.eventPool = {}\n }", "function EventDispatcher() {}", "function EventDispatcher() {}", "attachedCallback() {}", "attachedCallback() {}", "handleEvent() {}", "handleEvent() {}", "function EventReader() {}", "function InternalEvent() {}", "constructor (onevent /* : Function */) {\n super()\n this.waiting = []\n this.awaiting = 0\n this.onevent = onevent\n }", "get event() {\n if (!this._event) {\n this._event = (callback, thisArgs, disposables) => {\n var _a, _b, _c;\n if (!this._listeners) {\n this._listeners = new LinkedList();\n }\n if (this._leakageMon && this._listeners.size > this._leakageMon.threshold * 3) {\n console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`);\n return Disposable.None;\n }\n const firstListener = this._listeners.isEmpty();\n if (firstListener && ((_a = this._options) === null || _a === void 0 ? void 0 : _a.onWillAddFirstListener)) {\n this._options.onWillAddFirstListener(this);\n }\n let removeMonitor;\n let stack;\n if (this._leakageMon && this._listeners.size >= Math.ceil(this._leakageMon.threshold * 0.2)) {\n // check and record this emitter for potential leakage\n stack = Stacktrace.create();\n removeMonitor = this._leakageMon.check(stack, this._listeners.size + 1);\n }\n if (_enableDisposeWithListenerWarning) {\n stack = stack !== null && stack !== void 0 ? stack : Stacktrace.create();\n }\n const listener = new Listener(callback, thisArgs, stack);\n const removeListener = this._listeners.push(listener);\n if (firstListener && ((_b = this._options) === null || _b === void 0 ? void 0 : _b.onDidAddFirstListener)) {\n this._options.onDidAddFirstListener(this);\n }\n if ((_c = this._options) === null || _c === void 0 ? void 0 : _c.onDidAddListener) {\n this._options.onDidAddListener(this, callback, thisArgs);\n }\n const result = listener.subscription.set(() => {\n var _a, _b;\n removeMonitor === null || removeMonitor === void 0 ? void 0 : removeMonitor();\n if (!this._disposed) {\n (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.onWillRemoveListener) === null || _b === void 0 ? void 0 : _b.call(_a, this);\n removeListener();\n if (this._options && this._options.onDidRemoveLastListener) {\n const hasListeners = (this._listeners && !this._listeners.isEmpty());\n if (!hasListeners) {\n this._options.onDidRemoveLastListener(this);\n }\n }\n }\n });\n if (disposables instanceof DisposableStore) {\n disposables.add(result);\n }\n else if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }", "function processQueue(){var queue=nextTick.queue;var digest=nextTick.digest;nextTick.queue=[];nextTick.timeout=null;nextTick.digest=false;queue.forEach(function(queueItem){var skip=queueItem.scope&&queueItem.scope.$$destroyed;if(!skip){queueItem.callback();}});if(digest)$rootScope.$digest();}", "detachedCallback() {}", "detachedCallback() {}", "detachedCallback() {}", "detachedCallback() {}", "detachedCallback() {}", "detachedCallback() {}", "function EventManager() {\n}", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "attachedCallback() {\n\n // clickStream :: HTMLElement -> EventStream(HTMLElement)\n const clickStream = compose(map(R.prop('target')), event('click'));\n\n //onClick :: HTMLElement -> Maybe(EventStream(HTMLElement))\n const onClick = compose(map(clickStream), Maybe.fromNullable);\n\n // button :: _ -> HTMLELement\n const button = this.getButton();\n\n // pwProjectItem :: _ -> Maybe(HTMLElement)\n const pwProjectItem = Maybe.fromNullable(this.getPwProjectItem());\n\n // showPanel :: _ -> IO(Maybe(HTMLElement))\n const showPanel = IO.of(pwProjectItem).map(map(this.emitEvent));\n\n onClick(button).get().subscribe((elem) => {\n showPanel.runIO();\n });\n }", "function Wait_AssynchWaitCallback()\n{\n\t//no longer heavy waiting\n\t__WAIT_MANAGER.AssynchWait = false;\n\t//loop through listeners\n\tfor (var i = 0, c = __WAIT_MANAGER.Listeners.length; i < c; i++)\n\t{\n\t\t//get callback\n\t\tvar aCallBack = __WAIT_MANAGER.Listeners[i];\n\t\t//call it\n\t\t__EVENTS_QUEUE.AddEvent(Wait_CreateCallback(aCallBack), 0);\n\t}\n\t//reset listeners\n\t__WAIT_MANAGER.Listeners = [];\n}", "function Events_QueueManager()\n{\n\t//active events\n\tvar _ActiveEvents = {};\n\t//active event counter\n\tvar _ActiveCount = 0;\n\t//unique Id\n\tvar _UID = 1; //dont start at 0\n\n\t//checks if we are idle (nothing to do)\n\tthis.IsIdle = function ()\n\t{\n\t\treturn _ActiveCount == 0;\n\t};\n\n\t//adds an event to process\n\tthis.AddEvent = function (callback, time)\n\t{\n\t\t//calculate our id\n\t\tvar uid = _UID++ + \"\";\n\t\t//setup the event\n\t\tvar newEvent = { CallBack: callback, Time: time, TimerID: 0 };\n\t\t//now call it\n\t\tnewEvent.TimerID = setTimeout(\"Events_FireEventCallBack('\" + uid + \"');\", newEvent.Time);\n\t\t//store it\n\t\t_ActiveEvents[uid] = newEvent;\n\t\t//increment event count\n\t\t_ActiveCount++;\n\t\t//return our uid\n\t\treturn uid;\n\t};\n\t//cancels an event\n\tthis.RemoveEvent = function (uid)\n\t{\n\t\t//find it\n\t\tvar newEvent = _ActiveEvents[uid];\n\t\t//valid?\n\t\tif (newEvent)\n\t\t{\n\t\t\t//cancel it\n\t\t\tclearTimeout(newEvent.TimerID);\n\t\t\t//delete it\n\t\t\tdelete _ActiveEvents[uid];\n\t\t\t//decrement count\n\t\t\t_ActiveCount--;\n\t\t}\n\t};\n\t//fires an event\n\tthis.FireEvent = function (uid)\n\t{\n\t\t//find it\n\t\tvar newEvent = _ActiveEvents[uid];\n\t\t//valid?\n\t\tif (newEvent)\n\t\t{\n\t\t\t//cancel it\n\t\t\tclearTimeout(newEvent.TimerID);\n\t\t\t//delete it\n\t\t\tdelete _ActiveEvents[uid];\n\t\t\t//decrement count\n\t\t\t_ActiveCount--;\n\n\t\t\t//string callback?\n\t\t\tif (typeof newEvent.CallBack == \"string\")\n\t\t\t{\n\t\t\t\t//evaluate it\n\t\t\t\teval(newEvent.CallBack);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//call it\n\t\t\t\tnewEvent.CallBack();\n\t\t\t}\n\t\t}\n\t};\n}", "function MsgAddedListener() {\n this._promise = new Promise(resolve => {\n this._resolve = resolve;\n });\n}", "onEnterDOM() {}", "createdCallback() {}", "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "registerDomEvents() {/*To be overridden in sub class as needed*/}", "_lazyLoadHandler() {\n var freeList = [];\n this.ListenerQueue.forEach(listener => {\n if (!listener.el || !listener.el.parentNode) {\n freeList.push(listener);\n }\n\n var catIn = listener.checkInView();\n if (!catIn) return;\n listener.load();\n });\n freeList.forEach(item => {\n remove(this.ListenerQueue, item);\n item.$destroy();\n });\n }", "function Dispatch() {\n\tthis.watchers = new Array();\n\tthis.isLoading = false;\n\n\t// Listeners\n\tthis.listener = {\n\t\tonadd:\t\t[],\n\t\tonremove:\t[],\n\t\tonstart:\t[],\n\t\tonstop:\t\t[],\n\t\tonchange:\t[]\n\t};\n}", "function CallbackLogic (id, name) {\n this.parent = null;\n this.id = id;\n if (name) { this.name = name } else { this.name = \"CallbackLogic\" };\n this.isSchematic = false;\n this.inputQueue = [];\n this.isReady = function () { return ( this.inputQueue.length > 0 ); };\n this.hasInputs = function () {\n\treturn (0 < this.inputQueue.length);\n };\n this.consumeOneEventIfReady = function () {\n\tif (this.isReady()) {\n\t var event = this.inputQueue.pop ();\n\t this.react (event);\n\t}\n };\n\n this.transitionArray = [\n\t/* 0 */ () => { this.state = \"IDLE\"; },\n\t/* 1 */ () => { this.state = \"WAIT FOR START\"; },\n /* 2 */ () => { this.saveFile(); this.state = \"WAIT FOR ON\";},\n\t/* 3 */ () => { this.sendStopTimer(); this.sendDisplay(); this.state = \"IDLE\" },\n\t/* 4 */ () => { this.saveFile(); this.state = \"WAIT FOR SYNC\"; },\n\t/* 5 */ () => { this.state = \"TIMER SYNC\"; },\n\t/* 6 */ () => { this.sendStopTimer(); this.sendError (); this.state = \"IDLE\"; },\n\t/* 7 */ () => { this.sendStopTimer(); this.sendAbort (); this.state = \"IDLE\"; },\n\t/* 8 */ () => { this.sendStopTimer(); this.sendTimeout (); this.state = \"IDLE\"; },\n\t/* 9 */ () => { this.state = \"IDLE\"; }\n ];\n\n this.exitCollection = [];\n\n this.entryCollection = [\n\t{ state : \"IDLE\", func: () => { this.state = \"IDLE\"; }},\n\t{ state : \"WAIT FOR ON\", func: () => { this.setup (); this.state = \"WAIT FOR ON\"; }}\n ];\n\n this.react = function (AGevent) {\n\tkernel.debug (this, AGevent);\n\tthis.event = AGevent;\n\tif (this.state == \"IDLE\") {\n\t if (AGevent.pin == \"timer sync\") {\n\t\tthis.transitionFunction (1);\n\t } else if (AGevent.pin == \"file\") {\n\t\tthis.transitionFunction (4);\n\t } else if (AGevent.pin == \"timeout\") {\n\t\tthis.transitionFunction (9);\n\t } else {\n\t\tthrow \"INTERNAL ERROR\";\n\t };\n\t} else if (this.state == \"WAIT FOR START\") {\n\t if (AGevent.pin == \"file\") {\n\t\tthis.transitionFunction (2);\n\t } else {\n\t\tthrow \"INTERNAL ERROR\";\n\t };\n\t} else if (this.state == \"WAIT FOR SYNC\") {\n\t if (AGevent.pin == \"file\") {\n\t\tthis.transitionFunction (5);\n\t } else {\n\t\tthrow \"INTERNAL ERROR\";\n\t };\n\t} else if (this.state == \"WAIT FOR ON\") {\n\t if (AGevent.pin == \"onload\") {\n\t\tthis.transitionFunction (3);\n\t\tkernel.io ();\n\t } else if (AGevent.pin == \"onerror\") {\n\t\tthis.transitionFunction (6);\n\t\tkernel.io ();\n\t } else if (AGevent.pin == \"onabort\") {\n\t\tthis.transitionFunction (7);\n\t\tkernel.io ();\n\t } else if (AGevent.pin == \"timeout\") {\n\t\tthis.transitionFunction (8);\n\t } else {\n\t\tthrow \"INTERNAL ERROR\";\n\t };\n\t} else if (this.state == \"-no-state-\") {\n\t} else {\n\t throw \"INTERNAL ERROR\";\n\t};\n\tthis.event = null;\n };\n\n this.setup = () => { \n\tthis.reader = new FileReader();\n\tthis.reader.onload = e => { this.react ({pin: \"onload\", data: e})};\n\tthis.reader.onerror = e => { this.react ({pin: \"onerror\", data: reader}); };\n\tthis.reader.onabort = e => { this.react ({pin: \"onabort\", data: reader}); };\n\tkernel.send(this, {pin: \"timer start\", data: 3000});\n\tthis.reader.readAsText (this.filedescriptor);\n };\n this.sendStopTimer = () => { kernel.send (this, {pin: \"timer stop\", data: true})};\n this.sendDisplay = () => {\n\tlet fname = this.filename;\n\tkernel.send (this, {pin: \"good\", \n\t\t\t data: {filename: fname,\n\t\t\t\t contents: this.reader.result}})};\n this.sendError = () => { kernel.send (this, {pin: \"error\", data: \"ERROR\"})};\n this.sendAbort = () => { kernel.send (this, {pin: \"abort\", data: \"ABORT\"})};\n this.sendTimeout = () => { kernel.send (this, {pin: \"timeout\", data: true})};\n this.saveFile = () => { \n\tthis.filename = this.event.data.name ;\n\tthis.filedescriptor = this.event.data.descriptor ; \n };\n\n\n //////\n // implementation details...\n //////\n this.lookupAndCall = function (stateName, collection) {\n\tfor (var i = 0 ; i < collection.length ; i += 1) {\n\t if (stateName == collection[i].state) {\n\t\treturn collection[i].func();\n\t }\n\t}\n };\n this.exitState = function () { this.lookupAndCall(this.state, this.exitCollection); };\n this.makeTransition = function (n) { this.transitionArray[n] && this.transitionArray[n](); };\n this.enterState = function () { this.lookupAndCall(this.state, this.entryCollection); };\n\n this.transitionFunction = function (n) {\n\tthis.exitState ();\n\tthis.makeTransition (n);\n\tthis.enterState ();\n };\n\n //////\n // init\n //////\n this.state = \"-no-state-\";\n this.transitionFunction (0); /* take default transition */\n\n}", "attachedCallback() {\n\n // clickStream :: HTMLElement -> EventStream(HTMLElement)\n const clickStream = compose(map(R.prop('target')), event('click'));\n\n //onClick :: HTMLElement -> Maybe(EventStream(HTMLElement))\n const onClick = compose(map(clickStream), Maybe.fromNullable);\n\n // img :: _ -> HTMLELement\n const img = this.getImg(this.shadowRoot);\n\n // pwProjectItem :: _ -> Maybe(HTMLElement)\n const pwProjectItem = Maybe.fromNullable(this.getPwProjectItem());\n\n // showPanel :: _ -> IO(Maybe(HTMLElement))\n const showPanel = IO.of(pwProjectItem).map(map(this.emitEvent.bind(this)));\n\n onClick(img).get().subscribe((elem) => {\n showPanel.runIO();\n });\n\n /********************Pure Functions*********************/\n\n // set :: HTMLElement -> _\n const set = setAttr(this);\n\n // setProjectId :: HTMLElement -> _\n const setProjectId = compose(set('projectId'), getAttr('projectId'));\n\n // setPath :: String:path -> _\n const setPath = set('path');\n\n // getProject :: PwProjectInfo -> Promise(Error, Project)\n const getProject = (comp) => comp.getProject();\n\n // Initial path value\n this.getPwProjectInfo()\n .then(getProject)\n .then(get('images'))\n .then(get('doneByAuthor'))\n .then(nth(0))\n .then(setPath)\n .catch((err) => {\n console.log(err.message);\n setPath(this._path);\n });\n }", "function EventClass() {}", "bindEvents() {\n }", "function wait_event(event, callback) {\n\t\tif (event_listeners[event] === undefined) event_listeners[event] = [];\n\t\tevent_listeners[event].push(callback);\n\t\treturn global.wkof;\n\t}", "function extractEvents$2(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){var isOverEvent=domEventName==='mouseover'||domEventName==='pointerover';var isOutEvent=domEventName==='mouseout'||domEventName==='pointerout';if(isOverEvent&&(eventSystemFlags&IS_REPLAYED)===0){// If this is an over event with a target, we might have already dispatched\n// the event in the out event of the other target. If this is replayed,\n// then it's because we couldn't dispatch against this target previously\n// so we have to do it now instead.\nvar related=nativeEvent.relatedTarget||nativeEvent.fromElement;if(related){// If the related node is managed by React, we can assume that we have\n// already dispatched the corresponding events during its mouseout.\nif(getClosestInstanceFromNode(related)||isContainerMarkedAsRoot(related)){return;}}}if(!isOutEvent&&!isOverEvent){// Must not be a mouse or pointer in or out - ignoring.\nreturn;}var win;// TODO: why is this nullable in the types but we read from it?\nif(nativeEventTarget.window===nativeEventTarget){// `nativeEventTarget` is probably a window object.\nwin=nativeEventTarget;}else{// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.\nvar doc=nativeEventTarget.ownerDocument;if(doc){win=doc.defaultView||doc.parentWindow;}else{win=window;}}var from;var to;if(isOutEvent){var _related=nativeEvent.relatedTarget||nativeEvent.toElement;from=targetInst;to=_related?getClosestInstanceFromNode(_related):null;if(to!==null){var nearestMounted=getNearestMountedFiber(to);if(to!==nearestMounted||to.tag!==HostComponent&&to.tag!==HostText){to=null;}}}else{// Moving to a node from outside the window.\nfrom=null;to=targetInst;}if(from===to){// Nothing pertains to our managed components.\nreturn;}var SyntheticEventCtor=SyntheticMouseEvent;var leaveEventType='onMouseLeave';var enterEventType='onMouseEnter';var eventTypePrefix='mouse';if(domEventName==='pointerout'||domEventName==='pointerover'){SyntheticEventCtor=SyntheticPointerEvent;leaveEventType='onPointerLeave';enterEventType='onPointerEnter';eventTypePrefix='pointer';}var fromNode=from==null?win:getNodeFromInstance(from);var toNode=to==null?win:getNodeFromInstance(to);var leave=new SyntheticEventCtor(leaveEventType,eventTypePrefix+'leave',from,nativeEvent,nativeEventTarget);leave.target=fromNode;leave.relatedTarget=toNode;var enter=null;// We should only process this nativeEvent if we are processing\n// the first ancestor. Next time, we will ignore the event.\nvar nativeTargetInst=getClosestInstanceFromNode(nativeEventTarget);if(nativeTargetInst===targetInst){var enterEvent=new SyntheticEventCtor(enterEventType,eventTypePrefix+'enter',to,nativeEvent,nativeEventTarget);enterEvent.target=toNode;enterEvent.relatedTarget=fromNode;enter=enterEvent;}accumulateEnterLeaveTwoPhaseListeners(dispatchQueue,leave,enter,from,to);}", "function extractEvents$2(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){var isOverEvent=domEventName==='mouseover'||domEventName==='pointerover';var isOutEvent=domEventName==='mouseout'||domEventName==='pointerout';if(isOverEvent&&(eventSystemFlags&IS_REPLAYED)===0){// If this is an over event with a target, we might have already dispatched\n// the event in the out event of the other target. If this is replayed,\n// then it's because we couldn't dispatch against this target previously\n// so we have to do it now instead.\nvar related=nativeEvent.relatedTarget||nativeEvent.fromElement;if(related){// If the related node is managed by React, we can assume that we have\n// already dispatched the corresponding events during its mouseout.\nif(getClosestInstanceFromNode(related)||isContainerMarkedAsRoot(related)){return;}}}if(!isOutEvent&&!isOverEvent){// Must not be a mouse or pointer in or out - ignoring.\nreturn;}var win;// TODO: why is this nullable in the types but we read from it?\nif(nativeEventTarget.window===nativeEventTarget){// `nativeEventTarget` is probably a window object.\nwin=nativeEventTarget;}else {// TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.\nvar doc=nativeEventTarget.ownerDocument;if(doc){win=doc.defaultView||doc.parentWindow;}else {win=window;}}var from;var to;if(isOutEvent){var _related=nativeEvent.relatedTarget||nativeEvent.toElement;from=targetInst;to=_related?getClosestInstanceFromNode(_related):null;if(to!==null){var nearestMounted=getNearestMountedFiber(to);if(to!==nearestMounted||to.tag!==HostComponent&&to.tag!==HostText){to=null;}}}else {// Moving to a node from outside the window.\nfrom=null;to=targetInst;}if(from===to){// Nothing pertains to our managed components.\nreturn;}var SyntheticEventCtor=SyntheticMouseEvent;var leaveEventType='onMouseLeave';var enterEventType='onMouseEnter';var eventTypePrefix='mouse';if(domEventName==='pointerout'||domEventName==='pointerover'){SyntheticEventCtor=SyntheticPointerEvent;leaveEventType='onPointerLeave';enterEventType='onPointerEnter';eventTypePrefix='pointer';}var fromNode=from==null?win:getNodeFromInstance(from);var toNode=to==null?win:getNodeFromInstance(to);var leave=new SyntheticEventCtor(leaveEventType,eventTypePrefix+'leave',from,nativeEvent,nativeEventTarget);leave.target=fromNode;leave.relatedTarget=toNode;var enter=null;// We should only process this nativeEvent if we are processing\n// the first ancestor. Next time, we will ignore the event.\nvar nativeTargetInst=getClosestInstanceFromNode(nativeEventTarget);if(nativeTargetInst===targetInst){var enterEvent=new SyntheticEventCtor(enterEventType,eventTypePrefix+'enter',to,nativeEvent,nativeEventTarget);enterEvent.target=toNode;enterEvent.relatedTarget=fromNode;enter=enterEvent;}accumulateEnterLeaveTwoPhaseListeners(dispatchQueue,leave,enter,from,to);}", "function a(e){if(O(),!Q.state.isVisible){\n// Is a delegate, create an instance for the child target\nif(Q.props.target)return r(e);if(z=!0,Q.props.wait)return Q.props.wait(Q,e);\n/**\n * If the tooltip has a delay, we need to be listening to the mousemove as\n * soon as the trigger event is fired so that it's in the correct position\n * upon mount\n */y()&&(V.arrow&&(V.arrow.style.margin=\"0\"),document.addEventListener(\"mousemove\",i));var t=Qe(Q.props.delay,0,de.delay);t?W=setTimeout(function(){I()},t):I()}}", "function flushToDom() {\n var oldDebounceRendering = n.debounceRendering; // orig\n var callbackQ = [];\n function execCallbackSync(callback) {\n callbackQ.push(callback);\n }\n n.debounceRendering = execCallbackSync;\n O(v(FakeComponent, {}), document.createElement('div'));\n while (callbackQ.length) {\n callbackQ.shift()();\n }\n n.debounceRendering = oldDebounceRendering;\n }", "createNotificationContainer() {\n let message_container = document.createElement(\"div\");\n message_container.id = \"notification_container\";\n message_container.addEventListener(\"notify\", function (event) {\n const {message} = event.detail;\n if (message) {\n this.innerHTML = message;\n }\n setTimeout(function () {\n this.innerHTML = \"\";\n }.bind(this), 2500);\n });\n return message_container;\n }", "function EventTarget(){\n this._listeners = {};\n}", "function EventTarget(){\n this._listeners = {};\n}", "handleEvents() {\n }", "function livelinks(func){\r\n\tdocument.addEventListener(\r\n\t\t'DOMNodeInserted',\r\n\t\tfunction(e){if(e.target.firstChild&&e.target.firstChild.className=='message-container')func(e.target);},\r\n\t\tfalse\r\n\t);\r\n\tfunc(document);\r\n}", "handleEvent(evtName) {\n let timeout;\n const handlerName = `on${camelize(evtName)}`;\n \n return (e) => {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n timeout = setTimeout(() => {\n if (this.props[handlerName]) {\n this.props[handlerName](this.props, this.map, e);\n }\n }, 0);\n }\n }", "get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._callbacks) {\n this._callbacks = new CallbackList();\n }\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\n this._options.onFirstListenerAdd(this);\n }\n this._callbacks.add(listener, thisArgs);\n const result = {\n dispose: () => {\n if (!this._callbacks) {\n // disposable is disposed after emitter is disposed.\n return;\n }\n this._callbacks.remove(listener, thisArgs);\n result.dispose = Emitter._noop;\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\n this._options.onLastListenerRemove(this);\n }\n }\n };\n if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }", "get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._callbacks) {\n this._callbacks = new CallbackList();\n }\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\n this._options.onFirstListenerAdd(this);\n }\n this._callbacks.add(listener, thisArgs);\n const result = {\n dispose: () => {\n if (!this._callbacks) {\n // disposable is disposed after emitter is disposed.\n return;\n }\n this._callbacks.remove(listener, thisArgs);\n result.dispose = Emitter._noop;\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\n this._options.onLastListenerRemove(this);\n }\n }\n };\n if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }", "on(evt, cb){\n\tif(this.cb[evt]===undefined)this.cb[evt]=[];\n\tthis.cb[evt].push(cb);\n }", "get _listeners() {\n throw new TypeError('Deferred.prototype is abstract and does not implement ._listeners');\n }", "function renderCallback() {\n\n while (TO_RENDER.length) {\n TO_RENDER.shift().notify();\n }\n\n TO_RENDER.added = {};\n\n while (ENV_QUEUE.length) {\n var env = ENV_QUEUE.shift();\n for (var key in env.revalidateQueue) {\n env.revalidateQueue[key].revalidate();\n }\n reslot(env);\n }\n ENV_QUEUE.added = {};\n}", "function EventsDispatcher(failThrough) {\n this.callbacks = new CallbackRegistry();\n this.global_callbacks = [];\n this.failThrough = failThrough;\n }", "function EventsDispatcher(failThrough) {\n this.callbacks = new CallbackRegistry();\n this.global_callbacks = [];\n this.failThrough = failThrough;\n }", "pcBindEvent(){ return false }", "initializeEvents () {\n }", "function Eventable()\n{\n\n}", "callback({\n action,\n domConfig,\n lastDomConfig,\n targetElement\n }) {\n var _domConfig$className;\n\n // If element is a task wrap, trigger appropriate events\n if (action !== 'none' && (domConfig === null || domConfig === void 0 ? void 0 : (_domConfig$className = domConfig.className) === null || _domConfig$className === void 0 ? void 0 : _domConfig$className[`${scheduler.eventCls}-wrap`])) {\n const // Some actions are considered first a release and then a render (reusing another element).\n // This gives clients code a chance to clean up before reusing an element\n isRelease = releaseEventActions[action],\n isRender = renderEventActions[action]; // Trigger release for events (it might be a proxy element, skip those)\n\n if (isRelease && (lastDomConfig === null || lastDomConfig === void 0 ? void 0 : lastDomConfig.elementData)) {\n const {\n eventRecord,\n resourceRecord,\n assignmentRecord\n } = lastDomConfig.elementData,\n event = {\n renderData: lastDomConfig.elementData,\n element: targetElement,\n eventRecord,\n resourceRecord,\n assignmentRecord\n }; // Some browsers do not blur on set to display:none, so releasing the active element\n // must *explicitly* move focus outwards to the view.\n\n if (targetElement === document.activeElement) {\n scheduler.focusElement.focus();\n } // This event is documented on Scheduler\n\n scheduler.trigger('releaseEvent', event);\n }\n\n if (isRender) {\n const {\n eventRecord,\n resourceRecord,\n assignmentRecord\n } = domConfig.elementData,\n event = {\n renderData: domConfig.elementData,\n tplData: domConfig.elementData,\n // DEPRECATED IN 4.0\n element: targetElement,\n isReusingElement: action === 'reuseElement',\n isRepaint: action === 'reuseOwnElement',\n eventRecord,\n resourceRecord,\n assignmentRecord\n }; // This event is documented on Scheduler\n\n scheduler.trigger('renderEvent', event);\n }\n }\n }", "function NotificationEventFactory() {}", "function EventTarget(){this._listeners={};}", "function EventTarget(){this._listeners={};}", "function EventTarget(){this._listeners={};}", "function EventTarget(){this._listeners={};}", "function Wait_WaitManager()\n{\n\t//set wait counter\n\tthis.cCounter = 0;\n\t//heavy weight\n\tthis.AssynchWait = false;\n\t//listeners\n\tthis.Listeners = [];\n}", "constructor() {\n /**\n * Send the specified event and triggers it for the target\n * @param event Event to send\n */\n this.sendEvent = (event) => {\n this.waitingEvents.push(event);\n };\n /**\n * Add an event handler that will be triggered each time the specified event will be triggered\n * @param handler Handler to add\n */\n this.addEventHandler = (handler) => {\n this.listeners.push(handler);\n };\n this.waitingEvents = [];\n this.listeners = [];\n onNet('tcs:handleEvent', (event) => {\n if (event.target === TcsEventTarget.SERVER) {\n if (TCS.isServerSided)\n event.target = TcsEventTarget.LOCAL;\n else\n event.target = TcsEventTarget.CLIENT;\n }\n if (event.target === TcsEventTarget.CLIENT && !TCS.isServerSided) {\n event.target = TcsEventTarget.LOCAL;\n }\n this.sendEvent(event);\n });\n setTick(() => {\n this.waitingEvents.forEach((event, index) => {\n if (event.target == TcsEventTarget.LOCAL) {\n this.listeners\n .filter((listener) => listener.getEventType() == event.eventType)\n .forEach((listener) => listener.applyEventHandler(event.data));\n }\n else {\n if (!TCS.isServerSided)\n emitNet('tcs:handleEvent', event);\n else {\n //@ts-ignore\n emitNet('tcs:handleEvent', event.targetId, event);\n }\n }\n this.waitingEvents.splice(index, 1);\n return;\n });\n });\n }", "function u(e) {\n return function(t, n) {\n var o = new r(e);\n l(o, n), S.isDOMComponent(t) ? S.simulateNativeEventOnDOMComponent(e, t, o) : t.tagName && // Will allow on actual dom nodes.\n S.simulateNativeEventOnNode(e, t, o);\n };\n }", "listener() {}", "function dumbListener2(event) {}", "function dumbListener2(event) {}", "onDispose() {}", "function EventTarget(){this._listeners={}}", "function eventManager(canvasManager)\n{\n \n var self=this; // We get called in other context, so remember us\n this.id=0;\t // Bump this by one for each listen\n this.queues=new Object();\n // So far, we only use this to get canvas, so why don't we just pass the\n // canvas? I suspect that later we might need to get to other parts.\n this.canvasManager=canvasManager;\n\n // Call this to express an interest in listening to a particular event type\n // eventType - string with something like 'keydown' or 'mousemove'\n // hit - a routine that we can call with an x,y offset on the canvas to\n //\t ask if you're interested in the event. Returns true if so\n // callback - if hit is true, we call the callback passing it the event\n // returns - the id of the event\n this.listen=function(eventType, hit, callback)\n {\n\t\n\tvar queue=this.queues[eventType];\n\tif(queue==null){\n\t // No one's asked to listen to this yet, make a queue to \n\t // store it in.\n\t this.queues[eventType]=new Array();\n\t queue=this.queues[eventType];\n\t}else{\n\t // Check to see if it's a duplicate\n\t for(var ctr=0;ctr<queue.length;ctr++){\n\t\tif(eventType==queue[ctr].eventType\n\t\t\t&& hit==queue[ctr].hit\n\t\t\t&& callback==queue[ctr].callback){\n\t\t alert('duplicate! ctr: '+ctr\n\t\t\t +' eventType: '+queue[ctr].eventType\n\t\t\t +' x: '+queue[ctr].boundingbox.x\n\t\t\t +' y: '+queue[ctr].boundingbox.y\n\t\t\t +' xextent: '+queue[ctr].boundingbox.xextent\n\t\t\t +' yextent: '+queue[ctr].boundingbox.yextent);\n\t\t return queue[ctr].id;\n\t\t}\n\t }\n\t}\n\t// If we get down here, we're adding a new eventListener\n\tqueue[queue.length]=new eventListener(this.id,eventType, hit, callback);\n\tif(queue.length==1){\n\t // First thing added to this queue, so start listening for this\n\t // event on the canvas\n\t hookEvent(this.canvasManager.canvas,eventType,this.eventhandler);\n\t}\n\tthis.id=this.id+1; // bump so next listen gets different id\n\t\n\treturn this.id-1; // return value before the bump\n }\n\n // quitlistening is called when we're tired of listening for an event\n // eventType - string with something like 'keydown' or 'mousemove'\n // id - the same id that was returned from listen\n this.quitlistening=function(eventType,id)\n {\n\t\n\tvar queue=this.queues[eventType];\n\tif(queue==null){\n\t // they aren't listening those silly gooses.\n\t return;\n\t}\n\tfor(var ctr=0;ctr<queue.length;ctr++){\n\t if(queue[ctr].id==id){\n\t\tqueue.remove(ctr,ctr);\n\t }\n\t if(queue.length==0 &&\n\t\t eventType != 'mouseover' && eventType != 'mouseout'){\n\t\t// nobody is listening anymore, so we'll quit listening\n\t\t// We always listen for mouseover and mouseout though.\n\t\tunhookEvent(this.canvasManager.canvas,eventType,this.eventhandler);\n\t }\n\t}\n }\n\n // eventhandler for eventManager\n // At the global level, as an event goes down through the capture and\n // then back up through the global stage, anyone can stop the \n // propogation of the event. (Note that I don't allow my children\n // to choose one or the other. I always ask for bubble events so\n // that's what they get.\n //\n // The W3C DOM2 Event spec, says that even if stopPropagation is \n // called on an element, that the event will be dispatched to all\n // event listeners on the current element. So, one interpretation,\n // since all the listeners in my queue are on the same canvas would\n // be for me to keep dispatching. Another interpretation would have\n // me only dispatch to the same subelement. We don't allow multiple\n // registers from the same element unless they use different dispatch\n // routines or different hit routines. If they differ with hit \n // routines or dispatch routines we do.\n // I completely ignore preventDefault since I don't execute that.\n //\n // Another problem is key events. Since I use mouse x,y to decide who\n // should receive the event on the canvas, and key events don't have\n // associated x,y values, they never hit, but are passed to whoever has\n // focus. That means you have to click on something to get it to receive\n // the key events.\n this.eventhandler=function(e)\n {\n\t\n\tvar xy;\n\tif(!e){\n\t var e=window.event;\n\t}\n\tself.canvasManager.canvas.focus();\n\tif(e.type=='mouseout'){\n\t self.canvasManager.canvas.blur();\n\t}\n\n\tvar xy=getCanvasCursorPosition(e,self.canvasManager.canvas);\n\tvar queue=self.queues[e.type];\n\tvar passon=true; // if true we didn't consume the event\n\n\tif(queue!=null){\n\t for(var ctr=0;ctr<queue.length;++ctr){\n\t\tvar el=queue[ctr];\n\t\tif(el.hit(xy[0],xy[1],e)){\n\t\t // we found someone listening on that part of canvas\n\t\t if(!el.callback(xy[0],xy[1],e)){\n\t\t\t// they consumed it\n\t\t\tpasson=false;\n\t\t }\n\t\t if(e.type=='mousedown' || e.type=='touchstart'\n\t\t\t|| e.type=='mousewheel' || e.type=='DOMMouseScroll'\n\t\t\t|| e.type=='touchmove' || e.type=='touchend'\n\t\t\t|| e.type=='touchdown' || e.type=='keydown'\n\t\t\t ){\n\t\t\t// give the focus to whoever gets this event\n\t\t\tself.mousefocusedCB=el.callback;\n\t\t }\n\n\t\t} else if(el.callback==self.mousefocusedCB\n\t\t && (e.type=='mouseup' || e.type=='mouseout'\n\t\t\t|| e.type=='click' || e.type=='mousemove'\n\t\t\t|| e.type=='touchmove' || e.type=='touchend'\n\t\t\t|| e.type=='mousewheel' || e.type=='DOMMouseScroll'\n\t\t\t|| e.type=='keydown')){\n\t\t // if the bounding box didn't match, but they are the\n\t\t // one with mouse focus send it to them anyway.\n\t\t if(!self.mousefocusedCB(xy[0],xy[1],e)){\n\t\t\t// they consumed it\n\t\t\tpasson=false;\n\t\t }\n\t\t if( e.type != 'mousemove' && e.type != 'touchmove'\n\t\t && e.type !='mousewheel' && e.type != 'DOMMouseScroll'\n\t\t && e.type != 'keydown' ){\n\t\t\t// but they lose the focus for anything but movement\n\t\t\tself.mousefocusedCB=null;\n\t\t }\n\t\t}\n\t }\n\t}\n\t// passon is true if we didn't cancel, else false\n\treturn passon;\n }\n // we always listen for mouseout and mouseover\n hookEvent(this.canvasManager.canvas,'mouseout',this.eventhandler);\n hookEvent(this.canvasManager.canvas,'mouseover',this.eventhandler);\n}", "static nextTick() {\n\t\tif (!CIQ.UI.release) return; // UI hasn't started yet\n\t\tclearTimeout(BaseComponent.timeout);\n\t\tvar scheduledBindings = BaseComponent.scheduledBindings;\n\t\t// We traverse through the bindings backwards which ensures that we attempt to bind to the closest\n\t\t// web component ancestor to the actual binding.\n\t\tfor (var i = scheduledBindings.length - 1; i >= 0; i--) {\n\t\t\tvar binding = scheduledBindings[i];\n\t\t\tif (binding.node.ciqAlreadyBound) continue; // a node can only be bound once in it's lifetime\n\t\t\tBaseComponent.bindNode(binding.node, { parent: binding.parentTag });\n\t\t\tbinding.node.ciqAlreadyBound = true;\n\t\t}\n\t}", "createDispatcher() {\r\n return new PromiseSimpleEventDispatcher_1.PromiseSimpleEventDispatcher();\r\n }", "createDispatcher() {\r\n return new PromiseSimpleEventDispatcher_1.PromiseSimpleEventDispatcher();\r\n }", "onRenderDone() {\n const {\n scheduler,\n rowMap\n } = this,\n visibleEventDOMConfigs = []; // Concat all rows event configs\n\n rowMap.forEach(eventDOMConfigs => visibleEventDOMConfigs.push.apply(visibleEventDOMConfigs, eventDOMConfigs));\n DomSync.sync({\n domConfig: {\n onlyChildren: true,\n children: visibleEventDOMConfigs\n },\n targetElement: scheduler.foregroundCanvas,\n syncIdField: 'syncId',\n\n // Called by DomHelper when it creates, releases or reuses elements\n callback({\n action,\n domConfig,\n lastDomConfig,\n targetElement\n }) {\n var _domConfig$className;\n\n // If element is a task wrap, trigger appropriate events\n if (action !== 'none' && (domConfig === null || domConfig === void 0 ? void 0 : (_domConfig$className = domConfig.className) === null || _domConfig$className === void 0 ? void 0 : _domConfig$className[`${scheduler.eventCls}-wrap`])) {\n const // Some actions are considered first a release and then a render (reusing another element).\n // This gives clients code a chance to clean up before reusing an element\n isRelease = releaseEventActions[action],\n isRender = renderEventActions[action]; // Trigger release for events (it might be a proxy element, skip those)\n\n if (isRelease && (lastDomConfig === null || lastDomConfig === void 0 ? void 0 : lastDomConfig.elementData)) {\n const {\n eventRecord,\n resourceRecord,\n assignmentRecord\n } = lastDomConfig.elementData,\n event = {\n renderData: lastDomConfig.elementData,\n element: targetElement,\n eventRecord,\n resourceRecord,\n assignmentRecord\n }; // Some browsers do not blur on set to display:none, so releasing the active element\n // must *explicitly* move focus outwards to the view.\n\n if (targetElement === document.activeElement) {\n scheduler.focusElement.focus();\n } // This event is documented on Scheduler\n\n scheduler.trigger('releaseEvent', event);\n }\n\n if (isRender) {\n const {\n eventRecord,\n resourceRecord,\n assignmentRecord\n } = domConfig.elementData,\n event = {\n renderData: domConfig.elementData,\n tplData: domConfig.elementData,\n // DEPRECATED IN 4.0\n element: targetElement,\n isReusingElement: action === 'reuseElement',\n isRepaint: action === 'reuseOwnElement',\n eventRecord,\n resourceRecord,\n assignmentRecord\n }; // This event is documented on Scheduler\n\n scheduler.trigger('renderEvent', event);\n }\n }\n }\n\n }); // There are multiple pathways that might lead to the first render of events. This is the first reliable\n // place were we can determine that something will be rendered\n\n visibleEventDOMConfigs.length && scheduler._firstRenderDone && scheduler._firstRenderDone();\n }", "function processQueue(cb){\n\n}", "__init2() {this.performanceEvents = [];}", "function extractEvents(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){extractCompositionEvent(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget);extractBeforeInputEvent(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget);}", "function extractEvents(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget,eventSystemFlags,targetContainer){extractCompositionEvent(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget);extractBeforeInputEvent(dispatchQueue,domEventName,targetInst,nativeEvent,nativeEventTarget);}", "onDispatchComplete(cb){\n this.onDispatchCompleteCbs.push(cb);\n }", "onConstructed() {}", "onConstructed() {}", "constructor() {\n this.queue = []\n // Once a flush has been requested, no further calls to `requestFlush` are\n // necessary until the next `flush` completes.\n this.flushing = false\n // `requestFlush` is an implementation-specific method that attempts to kick\n // off a `flush` event as quickly as possible. `flush` will attempt to exhaust\n // the event queue before yielding to the browser's own event loop.\n\n // The position of the next task to execute in the task queue. This is\n // preserved between calls to `flush` so that it can be resumed if\n // a task throws an exception.\n this.index = 0\n // If a task schedules additional tasks recursively, the task queue can grow\n // unbounded. To prevent memory exhaustion, the task queue will periodically\n // truncate already-completed tasks.\n this.capacity = 1024\n\n\n this.flush = this.flush.bind(this)\n\n this.scope = typeof window !== \"undefined\" ? window : (typeof global !== \"undefined\" ? global : self)\n this.BrowserMutationObserver = this.scope.MutationObserver || this.scope.WebKitMutationObserver;\n\n this.makeRequestCallFromMutationObserver = this.makeRequestCallFromMutationObserver.bind(this)\n this.makeRequestCallFromTimer = this.makeRequestCallFromTimer.bind(this)\n\n if (typeof this.BrowserMutationObserver === \"function\") {\n this.requestFlush = this.makeRequestCallFromMutationObserver(this.flush);\n } else {\n this.requestFlush = this.makeRequestCallFromTimer(this.flush);\n }\n\n // `requestFlush` requests that the high priority event queue be flushed as\n // soon as possible.\n // This is useful to prevent an error thrown in a task from stalling the event\n // queue if the exception handled by Node.js’s\n // `process.on(\"uncaughtException\")` or by a domain.\n this.requestFlush = this.requestFlush.bind(this)\n\n this.rawAsap = this.rawAsap.bind(this)\n }", "function T(e,t,n){Q.reference.addEventListener(e,t),n.push({eventType:e,handler:t})}", "_dispatch(eventImpl, targetOverride /* , legacyOutputDidListenersThrowFlag */) {\n let targetImpl = this;\n let clearTargets = false;\n let activationTarget = null;\n\n eventImpl._dispatchFlag = true;\n\n targetOverride = targetOverride || targetImpl;\n let relatedTarget = retarget(eventImpl.relatedTarget, targetImpl);\n\n if (targetImpl !== relatedTarget || targetImpl === eventImpl.relatedTarget) {\n const touchTargets = [];\n\n appendToEventPath(eventImpl, targetImpl, targetOverride, relatedTarget, touchTargets, false);\n\n const isActivationEvent = MouseEvent.isImpl(eventImpl) && eventImpl.type === \"click\";\n\n if (isActivationEvent && targetImpl._hasActivationBehavior) {\n activationTarget = targetImpl;\n }\n\n let slotInClosedTree = false;\n let slotable = isSlotable(targetImpl) && targetImpl._assignedSlot ? targetImpl : null;\n let parent = getEventTargetParent(targetImpl, eventImpl);\n\n // Populate event path\n // https://dom.spec.whatwg.org/#event-path\n while (parent !== null) {\n if (slotable !== null) {\n if (parent.localName !== \"slot\") {\n throw new Error(`JSDOM Internal Error: Expected parent to be a Slot`);\n }\n\n slotable = null;\n\n const parentRoot = nodeRoot(parent);\n if (isShadowRoot(parentRoot) && parentRoot.mode === \"closed\") {\n slotInClosedTree = true;\n }\n }\n\n if (isSlotable(parent) && parent._assignedSlot) {\n slotable = parent;\n }\n\n relatedTarget = retarget(eventImpl.relatedTarget, parent);\n\n if (\n (isNode(parent) && isShadowInclusiveAncestor(nodeRoot(targetImpl), parent)) ||\n idlUtils.wrapperForImpl(parent).constructor.name === \"Window\"\n ) {\n if (isActivationEvent && eventImpl.bubbles && activationTarget === null &&\n parent._hasActivationBehavior) {\n activationTarget = parent;\n }\n\n appendToEventPath(eventImpl, parent, null, relatedTarget, touchTargets, slotInClosedTree);\n } else if (parent === relatedTarget) {\n parent = null;\n } else {\n targetImpl = parent;\n\n if (isActivationEvent && activationTarget === null && targetImpl._hasActivationBehavior) {\n activationTarget = targetImpl;\n }\n\n appendToEventPath(eventImpl, parent, targetImpl, relatedTarget, touchTargets, slotInClosedTree);\n }\n\n if (parent !== null) {\n parent = getEventTargetParent(parent, eventImpl);\n }\n\n slotInClosedTree = false;\n }\n\n let clearTargetsStructIndex = -1;\n for (let i = eventImpl._path.length - 1; i >= 0 && clearTargetsStructIndex === -1; i--) {\n if (eventImpl._path[i].target !== null) {\n clearTargetsStructIndex = i;\n }\n }\n const clearTargetsStruct = eventImpl._path[clearTargetsStructIndex];\n\n clearTargets =\n (isNode(clearTargetsStruct.target) && isShadowRoot(nodeRoot(clearTargetsStruct.target))) ||\n (isNode(clearTargetsStruct.relatedTarget) && isShadowRoot(nodeRoot(clearTargetsStruct.relatedTarget)));\n\n if (activationTarget !== null && activationTarget._legacyPreActivationBehavior) {\n activationTarget._legacyPreActivationBehavior();\n }\n\n for (let i = eventImpl._path.length - 1; i >= 0; --i) {\n const struct = eventImpl._path[i];\n\n if (struct.target !== null) {\n eventImpl.eventPhase = EVENT_PHASE.AT_TARGET;\n } else {\n eventImpl.eventPhase = EVENT_PHASE.CAPTURING_PHASE;\n }\n\n invokeEventListeners(struct, eventImpl, \"capturing\");\n }\n\n for (let i = 0; i < eventImpl._path.length; i++) {\n const struct = eventImpl._path[i];\n\n if (struct.target !== null) {\n eventImpl.eventPhase = EVENT_PHASE.AT_TARGET;\n } else {\n if (!eventImpl.bubbles) {\n continue;\n }\n\n eventImpl.eventPhase = EVENT_PHASE.BUBBLING_PHASE;\n }\n\n invokeEventListeners(struct, eventImpl, \"bubbling\");\n }\n }\n\n eventImpl.eventPhase = EVENT_PHASE.NONE;\n\n eventImpl.currentTarget = null;\n eventImpl._path = [];\n eventImpl._dispatchFlag = false;\n eventImpl._stopPropagationFlag = false;\n eventImpl._stopImmediatePropagationFlag = false;\n\n if (clearTargets) {\n eventImpl.target = null;\n eventImpl.relatedTarget = null;\n }\n\n if (activationTarget !== null) {\n if (!eventImpl._canceledFlag) {\n activationTarget._activationBehavior(eventImpl);\n } else if (activationTarget._legacyCanceledActivationBehavior) {\n activationTarget._legacyCanceledActivationBehavior();\n }\n }\n\n return !eventImpl._canceledFlag;\n }", "onEvent(event) {\r\n this.resolveInialized();\r\n this.passiveListeners.forEach(cb => cb(event));\r\n return super.onEvent(event);\r\n }", "function processEventQueue(simulated){// Set `eventQueue` to null before processing it so that we can tell if more\n// events get enqueued while processing.\nvar processingEventQueue=eventQueue;eventQueue=null;if(!processingEventQueue){return;}if(simulated){forEachAccumulated(processingEventQueue,executeDispatchesAndReleaseSimulated);}else{forEachAccumulated(processingEventQueue,executeDispatchesAndReleaseTopLevel);}!!eventQueue?invariant(false,'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.'):void 0;// This would be a good time to rethrow if any of the event handlers threw.\nReactErrorUtils.rethrowCaughtError();}", "function processEventQueue(simulated){// Set `eventQueue` to null before processing it so that we can tell if more\n// events get enqueued while processing.\nvar processingEventQueue=eventQueue;eventQueue=null;if(!processingEventQueue){return;}if(simulated){forEachAccumulated(processingEventQueue,executeDispatchesAndReleaseSimulated);}else{forEachAccumulated(processingEventQueue,executeDispatchesAndReleaseTopLevel);}!!eventQueue?invariant(false,'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.'):void 0;// This would be a good time to rethrow if any of the event handlers threw.\nReactErrorUtils.rethrowCaughtError();}", "function IETabNotifyListener(event) {\n\tvar evt = document.createEvent(\"MessageEvent\");\n\tevt.initMessageEvent(\"ContainerMessage\", true, true, event.data, document.location.href, 0, window);\n\tdocument.dispatchEvent(evt);\n}", "callback({\n action,\n domConfig,\n lastDomConfig,\n targetElement\n }) {\n // If element is an event wrap, trigger appropriate events\n if (me.isEventElement(domConfig)) {\n const // Some actions are considered first a release and then a render (reusing another element).\n // This gives clients code a chance to clean up before reusing an element\n isRelease = releaseEventActions$1[action],\n isRender = renderEventActions$1[action]; // If we are reusing an element that was previously released we should not trigger again\n\n if (isRelease && me.isEventElement(lastDomConfig) && !lastDomConfig.isReleased) {\n const data = lastDomConfig.elementData.renderData,\n event = {\n renderData: data,\n assignmentRecord: data.assignmentRecord,\n eventRecord: data.eventRecord,\n resourceRecord: data.resourceRecord,\n element: targetElement\n }; // Some browsers do not blur on set to display:none, so releasing the active element\n // must *explicitly* move focus outwards to the view.\n\n if (targetElement === document.activeElement) {\n scheduler.focusElement.focus();\n } // This event is documented on Scheduler\n\n scheduler.trigger('releaseEvent', event);\n }\n\n if (isRender) {\n const data = domConfig.elementData.renderData,\n event = {\n renderData: data,\n tplData: data,\n // DEPRECATED IN 4.0\n assignmentRecord: data.assignmentRecord,\n eventRecord: data.eventRecord,\n resourceRecord: data.resourceRecord,\n element: targetElement,\n isReusingElement: action === 'reuseElement',\n isRepaint: action === 'reuseOwnElement'\n };\n event.reusingElement = action === 'reuseElement'; // This event is documented on Scheduler\n\n scheduler.trigger('renderEvent', event);\n }\n }\n }", "function a(e) {\n return function(t, n) {\n var o;\n h.isValidElement(t) && E(!1, \"TestUtils.Simulate expects a component instance and not a ReactElement.TestUtils.Simulate will not work if you are using shallow rendering.\"), \n S.isDOMComponent(t) ? o = w(t) : t.tagName && (o = t);\n var i = d.eventNameDispatchConfigs[e], a = new r();\n a.target = o, a.type = e.toLowerCase();\n // We don't use SyntheticEvent.getPooled in order to not have to worry about\n // properly destroying any properties assigned from `eventData` upon release\n var s = new x(i, g.getInstanceFromNode(o), a, o);\n // Since we aren't using pooling, always persist the event. This will make\n // sure it's marked and won't warn when setting additional properties.\n s.persist(), l(s, n), i.phasedRegistrationNames ? f.accumulateTwoPhaseDispatches(s) : f.accumulateDirectDispatches(s), \n b.batchedUpdates(function() {\n p.enqueueEvents(s), p.processEventQueue(!0);\n });\n };\n }", "loadedCallback(processNum)\n {\n let content = \"deadbeef\";\n\n // Firefox\n if (window.frames[this.frameNames[processNum]].document.body.innerText === undefined)\n {\n // Firefox 1.5\n if (window.frames[this.frameNames[processNum]].document.body.textContent === undefined)\n {\n content = window.frames[this.frameNames[processNum]].document.body.innerHTML;\n }\n // Firefox 2.0\n else\n {\n content = window.frames[this.frameNames[processNum]].document.body.textContent;\n }\n }\n // IE\n else\n {\n content = window.frames[this.frameNames[processNum]].document.body.innerText;\n }\n\n let callback = this.callbacks[processNum];\n this.callbacks[processNum] = undefined;\n\n // Recycle old loader container DOM elements\n this.oldContainerPool.push(this.containers[processNum]);\n this.containers[processNum] = undefined;\n this.frameNames[processNum] = undefined;\n\n // Process counter increment, now that the loading finished\n this.lastProcess++;\n\n // Handle content\n conSense.scrollToBottomFocusInput();\n // User callback with loaded content as parameter\n callback(content);\n\n this.hideIndicator();\n\n conSense.separator();\n conSense.scrollToBottomFocusInput();\n }" ]
[ "0.6005983", "0.59798104", "0.59571034", "0.5806244", "0.57873327", "0.5781845", "0.5781845", "0.5756741", "0.5756741", "0.5556443", "0.5556443", "0.55078167", "0.54365236", "0.5365971", "0.5360991", "0.53335243", "0.53318685", "0.53318685", "0.53318685", "0.53318685", "0.53318685", "0.53318685", "0.53300416", "0.5272755", "0.5272755", "0.5272755", "0.5272755", "0.5272755", "0.5269164", "0.5257499", "0.5252788", "0.52150446", "0.52086174", "0.51633584", "0.51508385", "0.51508385", "0.51508385", "0.51497644", "0.51131445", "0.51066715", "0.510401", "0.5085623", "0.50836", "0.50824", "0.5062632", "0.505205", "0.5033675", "0.50322986", "0.50321424", "0.50309277", "0.5030687", "0.5030687", "0.5028748", "0.502752", "0.5023202", "0.50153655", "0.50153655", "0.50092673", "0.50078845", "0.49990112", "0.49895895", "0.49895895", "0.49803013", "0.49792638", "0.4976589", "0.49735487", "0.49703723", "0.496686", "0.496686", "0.496686", "0.496686", "0.49589744", "0.49539998", "0.49521202", "0.49515322", "0.4950437", "0.4950437", "0.4947937", "0.49418145", "0.49394184", "0.4934576", "0.49321842", "0.49321842", "0.49255377", "0.49198303", "0.49194783", "0.49161053", "0.49161053", "0.49034792", "0.49013713", "0.49013713", "0.4901085", "0.48942497", "0.4890673", "0.48905805", "0.48872906", "0.48872906", "0.48855987", "0.48826423", "0.48806614", "0.48786113" ]
0.0
-1
Helper to call ReactRef.attachRefs with this composite component, split out to avoid allocations in the transaction mountready queue.
function attachRefs() { ReactRef.attachRefs(this, this._currentElement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachRefs() {\r\n\t ReactRef.attachRefs(this, this._currentElement);\r\n\t}", "function attachRefs() {\n\t\t ReactRef.attachRefs(this, this._currentElement);\n\t\t}", "function attachRefs() {\n\t\t ReactRef.attachRefs(this, this._currentElement);\n\t\t}", "function attachRefs() {\n\t\t ReactRef.attachRefs(this, this._currentElement);\n\t\t}", "function attachRefs(){ReactRef.attachRefs(this,this._currentElement);}", "function attachRefs(){ReactRef.attachRefs(this,this._currentElement);}", "function attachRefs(){ReactRef.attachRefs(this,this._currentElement);}", "function attachRefs(){ReactRef.attachRefs(this,this._currentElement);}", "function attachRefs(){ReactRef.attachRefs(this,this._currentElement);}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}", "function attachRefs() {\n ReactRef.attachRefs(this, this._currentElement);\n}" ]
[ "0.7583925", "0.75462466", "0.75462466", "0.75462466", "0.754196", "0.754196", "0.754196", "0.754196", "0.754196", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114", "0.74904114" ]
0.7531328
76
Mixin helper which handles policy validation and reserved specification keys when building React classses.
function mixSpecIntoComponent(Constructor, spec) { if (!spec) { return; } ("production" !== process.env.NODE_ENV ? invariant( typeof spec !== 'function', 'ReactClass: You\'re attempting to ' + 'use a component class as a mixin. Instead, just use a regular object.' ) : invariant(typeof spec !== 'function')); ("production" !== process.env.NODE_ENV ? invariant( !ReactElement.isValidElement(spec), 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.' ) : invariant(!ReactElement.isValidElement(spec))); var proto = Constructor.prototype; // By handling mixins before any other properties, we ensure the same // chaining order is applied to methods with DEFINE_MANY policy, whether // mixins are listed before or after these methods in the spec. if (spec.hasOwnProperty(MIXINS_KEY)) { RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); } for (var name in spec) { if (!spec.hasOwnProperty(name)) { continue; } if (name === MIXINS_KEY) { // We have already handled mixins in a special case above continue; } var property = spec[name]; validateMethodOverride(proto, name); if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { RESERVED_SPEC_KEYS[name](Constructor, property); } else { // Setup methods on prototype: // The following member methods should not be automatically bound: // 1. Expected ReactClass methods (in the "interface"). // 2. Overridden methods (that were mixed in). var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); var isAlreadyDefined = proto.hasOwnProperty(name); var markedDontBind = property && property.__reactDontBind; var isFunction = typeof property === 'function'; var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && !markedDontBind; if (shouldAutoBind) { if (!proto.__reactAutoBindMap) { proto.__reactAutoBindMap = {}; } proto.__reactAutoBindMap[name] = property; proto[name] = property; } else { if (isAlreadyDefined) { var specPolicy = ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride ("production" !== process.env.NODE_ENV ? invariant( isReactClassMethod && ( (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY) ), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name ) : invariant(isReactClassMethod && ( (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY) ))); // For methods which are defined more than once, call the existing // methods before calling the new property, merging if appropriate. if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) { proto[name] = createMergedResultFunction(proto[name], property); } else if (specPolicy === SpecPolicy.DEFINE_MANY) { proto[name] = createChainedFunction(proto[name], property); } } else { proto[name] = property; if ("production" !== process.env.NODE_ENV) { // Add verbose displayName to the function, which helps when looking // at profiling tools. if (typeof property === 'function' && spec.displayName) { proto[name].displayName = spec.displayName + '_' + name; } } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_validate() {\n throw new Error('_validate not implemented in child class');\n }", "_validate() {\n\t}", "required(cb) {\n const { path: lodashPath, fieldSchema: appModelPart, handlerSpec, userContext, modelSchema, row } = this;\n const { schemaName } = modelSchema;\n const val = vutil.getValue(row, appModelPart, lodashPath);\n const { type } = appModelPart;\n const isMultipleType = type.endsWith('[]');\n const isAssociativeArray = type === 'AssociativeArray';\n const isArray = type === 'Array';\n const isMixedType = type === 'Mixed';\n const isString = type === 'String';\n const isBoolean = type === 'Boolean';\n const isEmptyVal =\n _.isNil(val) ||\n (isString && val === '') ||\n ((isArray || isAssociativeArray || isMultipleType) && _.isEmpty(val)) ||\n (isMixedType && _.isNil(val)) ||\n (isBoolean && val === false); // this is not supposed (agreement)\n\n let isRequired;\n\n if (_.isBoolean(appModelPart.required)) {\n const pathToParent = lodashPath.split('.').slice(0, -1);\n // if lodashPath is of 1 length, i.e. in root then count as parent presented\n const isParentPresented = _.isEmpty(pathToParent) ? true : !!_.get(row, pathToParent);\n isRequired = isParentPresented && appModelPart.required;\n } else if (_.isString(appModelPart.required)) {\n try {\n const { action } = userContext;\n\n if (appModelPart.required.includes('this.')) {\n const { indexes, index, parentData } = getParentInfo(appLib.appModel.models[schemaName], row, lodashPath);\n const context = {\n path: lodashPath,\n data: val,\n row,\n fieldSchema: appModelPart,\n action,\n indexes,\n index,\n parentData,\n };\n const inlineCode = appLib.butil.getDefaultArgsAndValuesForInlineCode();\n isRequired = new Function(inlineCode.args, `return ${appModelPart.required}`).apply(\n context,\n inlineCode.values\n );\n } else {\n const requiredFunc = new Function('data, row, modelSchema, $action', `return ${appModelPart.required}`);\n isRequired = requiredFunc(val, row, appModelPart, action);\n }\n } catch (e) {\n return cb(\n `Error occurred during validating required field ${appModelPart.fullName} for condition ${appModelPart.required}`\n );\n }\n }\n\n if (isRequired && isEmptyVal) {\n cb(vutil.replaceErrorTemplatePlaceholders(schemaName, handlerSpec, val, row, lodashPath, appModelPart));\n } else {\n cb();\n }\n }", "especialRequired(json, requiredKey) {\n\t\tconst especial = {\n\t\t\t\"html\": true,\n\t\t\t\"button\": true,\n\t\t\t\"item\": true,\n\t\t\t\"status\": true,\n\t\t\t\"icon\": true,\n\t\t\t\"menu\": true,\n\t\t\t\"dropmenu\": true,\n\t\t\t\"dropmenubutton\": true,\n\t\t\t\"simpleform\": true,\n\t\t\t\"tree\": true,\n\t\t\t\"accordion\": true,\n\t\t\t\"grid\": true\n\t\t};\n\t\tfor (const key of Object.keys(json)) {\n\t\t\tif (especial[key] && typeof json[key] === 'object' && requiredKey === key) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}", "_validate(values) {\n const constraint = this.constructor.FORM_CONSTRAINT\n const result = validate(Object.assign({}, this.state, values), constraint)\n return result\n }", "async validateAttributes () {\n\t}", "function jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}", "function jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}", "function DiscardInvalidPolicy(){\n this.name = \"DiscardInvalidPolicy\";\n}", "whenValid() {\n\n }", "function validateComponent(key, message) {\n\t\t\t\t\tkey = stringPrettify(key);\n\t\t\t\t\t$scope.recipeValidationMessages.push(capitalizeFirstLetter(key) + \" \" + message);\n\t\t\t\t\t$scope.isRecipeValidated = false;\n\t\t\t\t}", "constructor() {\n super(...arguments);\n this.name = this.args.validation;\n this.parent = this.args.parent;\n\n if (this.args.parent === undefined) {\n if (this.args.alone) return; // if input is alone ignore\n\n throw new ConfigurationException(`Component '${this.constructor.name}' needs to have a 'BaseValidationFormComponent' instance as '@parent' , if you want this component without validation and parent use '@alone={{true}}' as argument to the input. Note that the validate() method will throw an error if called`);\n }else{\n if (this.parent.state.validationSchema === undefined) {\n throw new ConfigurationException(`Component '${this.constructor.name}' needs to have a 'BaseValidator' instance as '@schema' , if you want this component without validation and parent use '@alone={{true}}' as argument to the input. Note that the validate() method will throw an error if called`);\n }\n }\n\n if (!this.args.value && !this.args.selected) {\n // eslint-disable-next-line no-console\n console.warn(`Component '${this.constructor.name}' seems to have an undefined @validation attribute`);\n }\n\n if (!this.args.validation) {\n throw new ConfigurationException(`Component '${this.constructor.name}' needs to have a '@validation' attribute , if you want this component without validation and parent use '@alone={{true}}' as argument to the input. Note that the validate() method will throw an error if called`);\n }\n\n this.parent.registerChild(this);\n }", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n }", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n }", "validate(key, value) { // eslint-disable-line class-methods-use-this\n return value;\n }", "checkValidity(context, event) {\n throw new Error('Implement in subclass');\n }", "checkValidity(context, event) {\n throw new Error('Implement in subclass');\n }", "function CapitalRequired2(secondatrributes){ \n CapitalRequired.call(this, secondatrributes); // THIS IS EXPLICIT.\n //something new would go here. \n }", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function jsxWithValidationStatic(type, props, key) {\n return jsxWithValidation(type, props, key, true);\n}", "function checkRequiredProperties(className) {\n if (typeof className === 'undefined') {\n throw new Error('Class Name not provided');\n }\n }", "function classNameIsValid(className) {\n return (\n className === '_Card' ||\n className === '_Account' ||\n className === '_Role'\n );\n}", "constructor() {\n this.requirements = {};\n this.extensions = {};\n \n this.event_opcodes = ['event_whenflagclicked', 'event_whenthisspriteclicked','event_whenbroadcastreceived','event_whenkeypressed', 'event_whenbackdropswitchesto','event_whengreaterthan'];\n }", "function validateType (instance, element) {\n var type;\n var types = {};\n var restrictions = {};\n\n types[skate.types.ATTR] = 'an attribute';\n types[skate.types.CLASS] = 'a class';\n types[skate.types.TAG] = 'a tag';\n\n restrictions[skate.types.ATTR] = 'attributes';\n restrictions[skate.types.CLASS] = 'classes';\n restrictions[skate.types.NOTAG] = 'attributes or classes';\n restrictions[skate.types.TAG] = 'tags';\n\n if (element.tagName.toLowerCase() === instance.id) {\n type = skate.types.TAG;\n } else if (element.hasAttribute(instance.id)) {\n type = skate.types.ATTR;\n } else if (element.className.split(' ').indexOf(instance.id) > -1) {\n type = skate.types.CLASS;\n }\n\n if (instance.component.type.indexOf(type) === -1) {\n throw new Error('Component \"' + instance.id + '\" was bound using ' + types[type] + ' and is restricted to using ' + restrictions[instance.component.type] + '. Element: ' + outerHtml(element));\n }\n }", "constructor() {\n this.allowFunctions = new ValidationRule();\n this.allowConstants = new ValidationRule();\n this.allowVariables = new ValidationRule();\n\n // this.acceptMathOperations = new ValidationRule();\n this.acceptEquations = new ValidationRule();\n this.acceptInequalities = new ValidationRule();\n this.acceptSequenceOfStatements = new ValidationRule();\n this.acceptEmpty = new ValidationRule();\n this.acceptOnlyNumber = new ValidationRule();\n\n this.valueOnlyFinite = new ValidationRule();\n this.valueOnlyInteger = new ValidationRule();\n this.valueRange = new ValidationRule();\n this.valueOnlyGreaterThan = new ValidationRule();\n this.valueOnlyLessThan = new ValidationRule();\n }", "function isRequiredForA11y(validator) {\r\n\t return function validate(props, propName, componentName, location, propFullName) {\r\n\t var componentNameSafe = componentName || '<<anonymous>>';\r\n\t var propFullNameSafe = propFullName || propName;\r\n\t\r\n\t if (props[propName] == null) {\r\n\t return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');\r\n\t }\r\n\t\r\n\t for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\r\n\t args[_key - 5] = arguments[_key];\r\n\t }\r\n\t\r\n\t return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));\r\n\t };\r\n\t}", "validate() {}", "function validation(realName, formEltName, eltType, upToSnuff, format) {\n this.realName = realName;\n this.formEltName = formEltName;\n this.eltType = eltType;\n this.upToSnuff = upToSnuff;\n this.format = format;\n}", "constructor() {\n /**\n * @type {Object<string, string>}\n */\n this._rules = {};\n }", "function customHandling() { }", "constructor(name,numberOfStudents,pickupPolicy){\t\t//constructor inititalizing attributes as well as adding a pickup policy\r\n super(name,'primary',numberOfStudents);\r\n this._pickupPolicy=pickupPolicy;\r\n }", "init() {\n this.requirements = {\n addBackdrop: {bool: false, str: 'Added a new backdrop.'}, \n addSprite: {bool: false, str: 'Added a new sprite.'},\n greenFlagBlock: {bool: false, str: 'The main sprite has a script with the \"when green flag clicked\" block.'},\n goToBlock: {bool: false, str: 'The main sprite starts in the same place every time.'},\n sayBlock: {bool: false, str: 'The main sprite says something.'},\n moveBlock: {bool: false, str: 'The main sprite moves.'},\n }\n this.extensions = {\n secondEvent: {bool: false, str: 'Added another script with the \"when sprite clicked\" or \"when key pressed\" event.'},\n newBlocks: {bool: false, str: \"Project uses new blocks you haven't seen before.\"},\n //TODO: spreadsheet doesn't have the newBlocks extension???\n secondSprite: {bool: false, str: 'Added a second sprite.'},\n secondSpriteMoves: {bool: false, str: 'Second sprite moves or does tricks.'},\n //TODO: should the second sprite requirements be combined\n }\n }", "function buildRequiredCheckboxValidation($formField,validation){var formFieldId=$formField.attr('id');var primarySelector='#'+formFieldId+' input:first-of-type';var secondarySelector='#'+formFieldId+' input';return{selector:primarySelector,triggeredBy:secondarySelector,validate:function validate(cb){var result=false;__WEBPACK_IMPORTED_MODULE_0_jquery___default()(secondarySelector).each(function(index,checkbox){if(checkbox.checked){result=true;return false}});cb(result)},errorMessage:'The \\''+validation.label+'\\' field cannot be blank.'}}", "get rules(){\n return{\n // put the validators inside it, now we only have required(必填)\n number : { required, creditcard },\n nameOnCard : { required },\n expirationMonth : { required },\n expirationYear : { required },\n cvv : { required },\n }\n }", "constructor(name, args, opts) {\n let inputs = {};\n opts = opts || {};\n if (!opts.id) {\n if ((!args || args.azureHybridUseBenefit === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'azureHybridUseBenefit'\");\n }\n if ((!args || args.azureLocation === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'azureLocation'\");\n }\n if ((!args || args.azureOfferCode === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'azureOfferCode'\");\n }\n if ((!args || args.azurePricingTier === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'azurePricingTier'\");\n }\n if ((!args || args.azureStorageRedundancy === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'azureStorageRedundancy'\");\n }\n if ((!args || args.currency === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'currency'\");\n }\n if ((!args || args.discountPercentage === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'discountPercentage'\");\n }\n if ((!args || args.groupName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'groupName'\");\n }\n if ((!args || args.percentile === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'percentile'\");\n }\n if ((!args || args.projectName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'projectName'\");\n }\n if ((!args || args.resourceGroupName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'resourceGroupName'\");\n }\n if ((!args || args.scalingFactor === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'scalingFactor'\");\n }\n if ((!args || args.stage === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'stage'\");\n }\n if ((!args || args.timeRange === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'timeRange'\");\n }\n inputs[\"assessmentName\"] = args ? args.assessmentName : undefined;\n inputs[\"azureHybridUseBenefit\"] = args ? args.azureHybridUseBenefit : undefined;\n inputs[\"azureLocation\"] = args ? args.azureLocation : undefined;\n inputs[\"azureOfferCode\"] = args ? args.azureOfferCode : undefined;\n inputs[\"azurePricingTier\"] = args ? args.azurePricingTier : undefined;\n inputs[\"azureStorageRedundancy\"] = args ? args.azureStorageRedundancy : undefined;\n inputs[\"currency\"] = args ? args.currency : undefined;\n inputs[\"discountPercentage\"] = args ? args.discountPercentage : undefined;\n inputs[\"eTag\"] = args ? args.eTag : undefined;\n inputs[\"groupName\"] = args ? args.groupName : undefined;\n inputs[\"percentile\"] = args ? args.percentile : undefined;\n inputs[\"projectName\"] = args ? args.projectName : undefined;\n inputs[\"resourceGroupName\"] = args ? args.resourceGroupName : undefined;\n inputs[\"scalingFactor\"] = args ? args.scalingFactor : undefined;\n inputs[\"stage\"] = args ? args.stage : undefined;\n inputs[\"timeRange\"] = args ? args.timeRange : undefined;\n inputs[\"createdTimestamp\"] = undefined /*out*/;\n inputs[\"monthlyBandwidthCost\"] = undefined /*out*/;\n inputs[\"monthlyComputeCost\"] = undefined /*out*/;\n inputs[\"monthlyStorageCost\"] = undefined /*out*/;\n inputs[\"name\"] = undefined /*out*/;\n inputs[\"numberOfMachines\"] = undefined /*out*/;\n inputs[\"pricesTimestamp\"] = undefined /*out*/;\n inputs[\"status\"] = undefined /*out*/;\n inputs[\"type\"] = undefined /*out*/;\n inputs[\"updatedTimestamp\"] = undefined /*out*/;\n }\n else {\n inputs[\"azureHybridUseBenefit\"] = undefined /*out*/;\n inputs[\"azureLocation\"] = undefined /*out*/;\n inputs[\"azureOfferCode\"] = undefined /*out*/;\n inputs[\"azurePricingTier\"] = undefined /*out*/;\n inputs[\"azureStorageRedundancy\"] = undefined /*out*/;\n inputs[\"createdTimestamp\"] = undefined /*out*/;\n inputs[\"currency\"] = undefined /*out*/;\n inputs[\"discountPercentage\"] = undefined /*out*/;\n inputs[\"eTag\"] = undefined /*out*/;\n inputs[\"monthlyBandwidthCost\"] = undefined /*out*/;\n inputs[\"monthlyComputeCost\"] = undefined /*out*/;\n inputs[\"monthlyStorageCost\"] = undefined /*out*/;\n inputs[\"name\"] = undefined /*out*/;\n inputs[\"numberOfMachines\"] = undefined /*out*/;\n inputs[\"percentile\"] = undefined /*out*/;\n inputs[\"pricesTimestamp\"] = undefined /*out*/;\n inputs[\"scalingFactor\"] = undefined /*out*/;\n inputs[\"stage\"] = undefined /*out*/;\n inputs[\"status\"] = undefined /*out*/;\n inputs[\"timeRange\"] = undefined /*out*/;\n inputs[\"type\"] = undefined /*out*/;\n inputs[\"updatedTimestamp\"] = undefined /*out*/;\n }\n if (!opts.version) {\n opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });\n }\n const aliasOpts = { aliases: [{ type: \"azure-nextgen:migrate/v20171111preview:Assessment\" }, { type: \"azure-native:migrate/v20180202:Assessment\" }, { type: \"azure-nextgen:migrate/v20180202:Assessment\" }] };\n opts = pulumi.mergeOptions(opts, aliasOpts);\n super(Assessment.__pulumiType, name, inputs, opts);\n }", "function jFormsJQControlSecret(name, label, help) {\n this.name = name;\n this.label = label;\n this.required = false;\n this.errInvalid = '';\n this.errRequired = '';\n this.help = help;\n this.minLength = -1;\n this.maxLength = -1;\n}", "function checkForInconsistentReadonlyKeys( lson ) {\n var errorReadonly = \"\";\n if ( lson.inherits || lson.$inherits ) {\n throw \"LAY Error: Did you mean '$inherit'?\";\n } else if ( lson.load ) {\n errorReadonly = \"load\";\n } else if ( lson.inherit ) {\n errorReadonly = \"inherit\";\n } else if ( lson.gpu ) {\n errorReadonly = \"gpu\";\n } else if ( lson.obdurate ) {\n errorReadonly = \"obdurate\";\n } else if ( lson.type ) {\n errorReadonly = \"type\"\n }\n if ( errorReadonly ) {\n throw \"LAY Error: prefix readonly '\" +\n errorReadonly + \"' with '$'\";\n }\n }", "function createFormCntrls() {\n return {\n name: createControl(\n {\n label: \"Name\",\n errorMessage: \"Name is a must field!\"\n },\n { required: true }\n ),\n yearsOfExperience: createControl(\n {\n label: \"My experience in years\",\n errorMessage: \"Experience is a must field!\"\n },\n { required: true }\n ),\n jobs: createControl(\n {\n label: \"Developer position that I'm looking for\",\n errorMessage: \"Position is a must field!\"\n },\n { required: true }\n ),\n location: createControl(\n {\n label: \"My location is\",\n errorMessage: \"Location is a must field!\"\n },\n { required: true }\n ),\n description: createControl(\n {\n label: \"Short description about myself\",\n errorMessage: \"Description is a must field!\"\n },\n { required: true }\n ),\n url: createControl(\n {\n label: \"Link to my LinkedIn profile\",\n errorMessage: \"Link is a must field!\"\n },\n { required: true }\n )\n \n };\n}", "function shim() {\n\t\t\t\t\t\tinvariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n\t\t\t\t\t}", "static _ensureClassProperties(){// ensure private storage for property declarations.\nif(!this.hasOwnProperty(JSCompiler_renameProperty(\"_classProperties\",this))){this._classProperties=new Map;// NOTE: Workaround IE11 not supporting Map constructor argument.\nconst superProperties=Object.getPrototypeOf(this)._classProperties;if(superProperties!==void 0){superProperties.forEach((v,k)=>this._classProperties.set(k,v))}}}", "_initValidateJs() {\n //bind custom function here\n\n }", "preValidate() { }", "function isRequiredForA11y(validator) {\n return function validate(props, propName, componentName, location, propFullName) {\n var componentNameSafe = componentName || '<<anonymous>>';\n var propFullNameSafe = propFullName || propName;\n\n if (props[propName] == null) {\n return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');\n }\n\n for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\n args[_key - 5] = arguments[_key];\n }\n\n return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));\n };\n}", "static _ensureClassProperties(){// ensure private storage for property declarations.\nif(!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties',this))){this._classProperties=new Map();// NOTE: Workaround IE11 not supporting Map constructor argument.\nconst superProperties=Object.getPrototypeOf(this)._classProperties;if(superProperties!==undefined){superProperties.forEach((v,k)=>this._classProperties.set(k,v));}}}", "_createSchemaValidators(schema) {\n if (typeof schema === 'string') {\n schema = { type: schema };\n }\n\n if (schema.type && typeof schema.type === 'string') {\n // is item schema\n return new this.constructor(\n Object.assign({}, schema, {\n name: this.name,\n path: this.path,\n model: this.model\n })\n );\n }\n\n return Object.keys(schema).reduce((validators, key) => {\n let name;\n let path;\n let config = schema[key];\n\n if (typeof config === 'string') {\n config = { type: config };\n }\n\n if (typeof config === 'object') {\n name = key;\n path = `${this.path}.${name}`;\n } else {\n // if config is not an object, then it's invalid. the Field constructor\n // will therefore throw an error; with the next line, we just ensure it\n // throws the right error\n name = this.name;\n }\n\n validators[name] = new this.constructor(\n Object.assign({}, config, {\n name,\n path,\n model: this.model\n })\n );\n return validators;\n }, {});\n }", "validate(name, value) {\n switch (name) {\n case 'name':\n if (!isNotEmpty(value)) {\n return FORM_LOCK_NAME_MISSING\n }\n break\n case 'expirationDuration':\n if (!isPositiveInteger(value)) return FORM_EXPIRATION_DURATION_INVALID\n break\n case 'maxNumberOfKeys':\n if (value !== INFINITY && !isPositiveInteger(value)) {\n return FORM_MAX_KEYS_INVALID\n }\n break\n case 'keyPrice':\n if (!isPositiveNumber(value)) {\n return FORM_KEY_PRICE_INVALID\n }\n break\n }\n return false\n }", "function specialtyAssignmentsProviderProcessing() {\n\n}", "isRequired() {\n return false;\n }", "getCustomProps() {\n const {\n id,\n name,\n helperText,\n label,\n outlined,\n filled,\n required,\n errorMessage,\n disabled,\n readOnly,\n } = this.props;\n\n const customProps = {};\n\n customProps.isDisabled = disabled;\n customProps.readOnly = readOnly;\n customProps.isRequired = required || this.isRequired(name);\n customProps.hasError = !!this.context.submitted && this.context.hasError(name);\n\n const errorText = customProps.hasError && this.context.getError(name, errorMessage);\n customProps.helperText = errorText || helperText || null;\n\n customProps.ariaHelper = `input_${name}`;\n\n customProps.id = id || customProps.ariaHelper;\n customProps.label = label;\n\n if (outlined) {\n customProps.variant = 'outlined';\n customProps.labelWidth = this.labelRef ? this.labelRef.offsetWidth : 0;\n } else if (filled) {\n customProps.variant = 'filled';\n }\n\n return customProps;\n }", "function CfnFunction_SAMPolicyTemplatePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('amiDescribePolicy', CfnFunction_EmptySAMPTPropertyValidator)(properties.amiDescribePolicy));\n errors.collect(cdk.propertyValidator('cloudFormationDescribeStacksPolicy', CfnFunction_EmptySAMPTPropertyValidator)(properties.cloudFormationDescribeStacksPolicy));\n errors.collect(cdk.propertyValidator('cloudWatchPutMetricPolicy', CfnFunction_EmptySAMPTPropertyValidator)(properties.cloudWatchPutMetricPolicy));\n errors.collect(cdk.propertyValidator('dynamoDbCrudPolicy', CfnFunction_TableSAMPTPropertyValidator)(properties.dynamoDbCrudPolicy));\n errors.collect(cdk.propertyValidator('dynamoDbReadPolicy', CfnFunction_TableSAMPTPropertyValidator)(properties.dynamoDbReadPolicy));\n errors.collect(cdk.propertyValidator('dynamoDbStreamReadPolicy', CfnFunction_TableStreamSAMPTPropertyValidator)(properties.dynamoDbStreamReadPolicy));\n errors.collect(cdk.propertyValidator('ec2DescribePolicy', CfnFunction_EmptySAMPTPropertyValidator)(properties.ec2DescribePolicy));\n errors.collect(cdk.propertyValidator('elasticsearchHttpPostPolicy', CfnFunction_DomainSAMPTPropertyValidator)(properties.elasticsearchHttpPostPolicy));\n errors.collect(cdk.propertyValidator('filterLogEventsPolicy', CfnFunction_LogGroupSAMPTPropertyValidator)(properties.filterLogEventsPolicy));\n errors.collect(cdk.propertyValidator('kmsDecryptPolicy', CfnFunction_KeySAMPTPropertyValidator)(properties.kmsDecryptPolicy));\n errors.collect(cdk.propertyValidator('kinesisCrudPolicy', CfnFunction_StreamSAMPTPropertyValidator)(properties.kinesisCrudPolicy));\n errors.collect(cdk.propertyValidator('kinesisStreamReadPolicy', CfnFunction_StreamSAMPTPropertyValidator)(properties.kinesisStreamReadPolicy));\n errors.collect(cdk.propertyValidator('lambdaInvokePolicy', CfnFunction_FunctionSAMPTPropertyValidator)(properties.lambdaInvokePolicy));\n errors.collect(cdk.propertyValidator('rekognitionDetectOnlyPolicy', CfnFunction_EmptySAMPTPropertyValidator)(properties.rekognitionDetectOnlyPolicy));\n errors.collect(cdk.propertyValidator('rekognitionLabelsPolicy', CfnFunction_EmptySAMPTPropertyValidator)(properties.rekognitionLabelsPolicy));\n errors.collect(cdk.propertyValidator('rekognitionNoDataAccessPolicy', CfnFunction_CollectionSAMPTPropertyValidator)(properties.rekognitionNoDataAccessPolicy));\n errors.collect(cdk.propertyValidator('rekognitionReadPolicy', CfnFunction_CollectionSAMPTPropertyValidator)(properties.rekognitionReadPolicy));\n errors.collect(cdk.propertyValidator('rekognitionWriteOnlyAccessPolicy', CfnFunction_CollectionSAMPTPropertyValidator)(properties.rekognitionWriteOnlyAccessPolicy));\n errors.collect(cdk.propertyValidator('s3CrudPolicy', CfnFunction_BucketSAMPTPropertyValidator)(properties.s3CrudPolicy));\n errors.collect(cdk.propertyValidator('s3ReadPolicy', CfnFunction_BucketSAMPTPropertyValidator)(properties.s3ReadPolicy));\n errors.collect(cdk.propertyValidator('sesBulkTemplatedCrudPolicy', CfnFunction_IdentitySAMPTPropertyValidator)(properties.sesBulkTemplatedCrudPolicy));\n errors.collect(cdk.propertyValidator('sesCrudPolicy', CfnFunction_IdentitySAMPTPropertyValidator)(properties.sesCrudPolicy));\n errors.collect(cdk.propertyValidator('sesEmailTemplateCrudPolicy', CfnFunction_EmptySAMPTPropertyValidator)(properties.sesEmailTemplateCrudPolicy));\n errors.collect(cdk.propertyValidator('sesSendBouncePolicy', CfnFunction_IdentitySAMPTPropertyValidator)(properties.sesSendBouncePolicy));\n errors.collect(cdk.propertyValidator('snsCrudPolicy', CfnFunction_TopicSAMPTPropertyValidator)(properties.snsCrudPolicy));\n errors.collect(cdk.propertyValidator('snsPublishMessagePolicy', CfnFunction_TopicSAMPTPropertyValidator)(properties.snsPublishMessagePolicy));\n errors.collect(cdk.propertyValidator('sqsPollerPolicy', CfnFunction_QueueSAMPTPropertyValidator)(properties.sqsPollerPolicy));\n errors.collect(cdk.propertyValidator('sqsSendMessagePolicy', CfnFunction_QueueSAMPTPropertyValidator)(properties.sqsSendMessagePolicy));\n errors.collect(cdk.propertyValidator('stepFunctionsExecutionPolicy', CfnFunction_StateMachineSAMPTPropertyValidator)(properties.stepFunctionsExecutionPolicy));\n errors.collect(cdk.propertyValidator('vpcAccessPolicy', CfnFunction_EmptySAMPTPropertyValidator)(properties.vpcAccessPolicy));\n return errors.wrap('supplied properties not correct for \"SAMPolicyTemplateProperty\"');\n}", "selfValidate(){\n\n }", "ensure(types) {\n return {\n name: types.string.isRequired\n }\n }", "validate() { }", "static _ensureClassProperties(){// ensure private storage for property declarations.\nif(!this.hasOwnProperty(JSCompiler_renameProperty(\"_classProperties\",this))){this._classProperties=new Map;// NOTE: Workaround IE11 not supporting Map constructor argument.\nconst e=Object.getPrototypeOf(this)._classProperties;e!==void 0&&e.forEach((e,t)=>this._classProperties.set(t,e))}}", "preValidate(key, value, errors, values) {}", "makeProductAreaRequired() {\n const checkedValue = this.inputBuildable.checked;\n if (checkedValue === true) {\n this.setState(() => {\n return {\n displayProductArea: 'block',\n productAreaSelectSpan: <span className=\"required\">*</span>,\n };\n });\n } else {\n this.setState(() => {\n return {\n displayProductArea: 'none',\n productAreaSelectSpan: ' ',\n };\n });\n }\n }", "function mixSpecIntoComponent(Constructor, spec) {\n\t if (!spec) {\n\t return;\n\t }\n\t\n\t !(typeof spec !== 'function') ? ({\"AUTH0_CLIENT_ID\":\"vFL9QUjpiy8LmqgykJVXRhk7dYVvdEip\",\"AUTH0_DOMAIN\":\"edcheung.auth0.com\"}).NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : _prodInvariant('75') : void 0;\n\t !!ReactElement.isValidElement(spec) ? ({\"AUTH0_CLIENT_ID\":\"vFL9QUjpiy8LmqgykJVXRhk7dYVvdEip\",\"AUTH0_DOMAIN\":\"edcheung.auth0.com\"}).NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;\n\t\n\t var proto = Constructor.prototype;\n\t var autoBindPairs = proto.__reactAutoBindPairs;\n\t\n\t // By handling mixins before any other properties, we ensure the same\n\t // chaining order is applied to methods with DEFINE_MANY policy, whether\n\t // mixins are listed before or after these methods in the spec.\n\t if (spec.hasOwnProperty(MIXINS_KEY)) {\n\t RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n\t }\n\t\n\t for (var name in spec) {\n\t if (!spec.hasOwnProperty(name)) {\n\t continue;\n\t }\n\t\n\t if (name === MIXINS_KEY) {\n\t // We have already handled mixins in a special case above.\n\t continue;\n\t }\n\t\n\t var property = spec[name];\n\t var isAlreadyDefined = proto.hasOwnProperty(name);\n\t validateMethodOverride(isAlreadyDefined, name);\n\t\n\t if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n\t RESERVED_SPEC_KEYS[name](Constructor, property);\n\t } else {\n\t // Setup methods on prototype:\n\t // The following member methods should not be automatically bound:\n\t // 1. Expected ReactClass methods (in the \"interface\").\n\t // 2. Overridden methods (that were mixed in).\n\t var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n\t var isFunction = typeof property === 'function';\n\t var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;\n\t\n\t if (shouldAutoBind) {\n\t autoBindPairs.push(name, property);\n\t proto[name] = property;\n\t } else {\n\t if (isAlreadyDefined) {\n\t var specPolicy = ReactClassInterface[name];\n\t\n\t // These cases should already be caught by validateMethodOverride.\n\t !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? ({\"AUTH0_CLIENT_ID\":\"vFL9QUjpiy8LmqgykJVXRhk7dYVvdEip\",\"AUTH0_DOMAIN\":\"edcheung.auth0.com\"}).NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : _prodInvariant('77', specPolicy, name) : void 0;\n\t\n\t // For methods which are defined more than once, call the existing\n\t // methods before calling the new property, merging if appropriate.\n\t if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {\n\t proto[name] = createMergedResultFunction(proto[name], property);\n\t } else if (specPolicy === SpecPolicy.DEFINE_MANY) {\n\t proto[name] = createChainedFunction(proto[name], property);\n\t }\n\t } else {\n\t proto[name] = property;\n\t if (({\"AUTH0_CLIENT_ID\":\"vFL9QUjpiy8LmqgykJVXRhk7dYVvdEip\",\"AUTH0_DOMAIN\":\"edcheung.auth0.com\"}).NODE_ENV !== 'production') {\n\t // Add verbose displayName to the function, which helps when looking\n\t // at profiling tools.\n\t if (typeof property === 'function' && spec.displayName) {\n\t proto[name].displayName = spec.displayName + '_' + name;\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }\n\t}", "render () {\n return (\n <div>\n <input type = { this.props.input.type }\n name = { this.props.input.name }\n autoFocus = { this.props.input.autoFocus }\n value = { this.props.input.value }\n autoComplete = { this.props.input.autoComplete}\n maxLength = { this.props.input.maxLength }\n size = { this.props.input.size }\n pattern = { this.props.input.pattern }\n placeholder = { this.props.input.placeholder}\n autoCapitalize = { this.props.input.autoCapitalize}\n onChange = { this.onChange }\n className = { this.props.input.className }\n id = { this.props.input.id }\n accessKey = { this.props.input.accessKey }\n contentEditable = { this.props.input.contentEditable}\n dir = { this.props.input.dir }\n draggable = { this.props.input.draggable }\n lang = { this.props.input.lang }\n style = { this.props.input.style }\n title = { this.props.input.title }\n required = { this.props.input.required }\n disabled = { this.props.input.disabled }\n readOnly = { this.props.input.readOnly }\n hidden = { this.props.input.hidden }\n min = { this.props.input.min }\n max = { this.props.input.max }\n // checked = { this.props.input.checked }\n defaultChecked = { this.props.input.defaultChecked}\n\n />\n {this.props.input.content}\n </div>\n )\n }", "render() {\n return (\n <div className=\"BorderBoxSubrouting\">\n Hello {this.props.name}\n <div className={this.defaultParams() ? '' : 'babel-error'}>\n Default parameters work: {this.defaultParams().toString()}\n </div>\n <div className={this.restParams() ? '' : 'babel-error'}>\n Rest parameters work: {this.restParams().toString()}\n </div>\n <div className={this.spreadOperator() ? '' : 'babel-error'}>\n Spread Operator works for array and objects (obj needs stage 2): {this.spreadOperator().toString()}\n </div>\n <div className={this.templateLiteralString() ? '' : 'babel-error'}>\n Template literal string works: {this.templateLiteralString().toString()}\n </div>\n <div className={this.objectDestructuring() ? '' : 'babel-error'}>\n Object destructuring works: {this.objectDestructuring().toString()}\n </div>\n <div className={this.arrayDestructuring() ? '' : 'babel-error'}>\n Array destructuring works: {this.arrayDestructuring().toString()}\n </div>\n <div className={this.enhancedObjectLiterals() ? '' : 'babel-error'}>\n Enhanced Object Literals work: {this.enhancedObjectLiterals().toString()}\n </div>\n <div className={this.arrowFunctions() ? '' : 'babel-error'}>\n Arrow functions: {this.arrowFunctions().toString()}\n </div>\n <div className={this.promises() ? '' : 'babel-error'}>Promises work: {this.promises().toString()}</div>\n <div className={this.letKeyword() ? '' : 'babel-error'}>\n 'let' keywork works: {this.letKeyword().toString()}\n </div>\n <div className={this.isInteger() ? '' : 'babel-error'}>\n Number.isInteger works: {this.isInteger().toString()}\n </div>\n <div className={this.stringIncludes() ? '' : 'babel-error'}>\n String.prototype.includes works: {this.stringIncludes().toString()}\n </div>\n <div className={this.forOf() ? '' : 'babel-error'}>For of works: {this.forOf().toString()}</div>\n <div className={this.maps() ? '' : 'babel-error'}>Maps work: {this.maps().toString()}</div>\n <div className={this.sets() ? '' : 'babel-error'}>Sets work: {this.sets().toString()}</div>\n <div className={this.arrayFrom() ? '' : 'babel-error'}>Array.from() works: {this.arrayFrom().toString()}</div>\n <div className={this.arrayIncludes() ? '' : 'babel-error'}>\n Array.prototype.includes works: {this.arrayIncludes().toString()}\n </div>\n <div className={this.exponentiation() ? '' : 'babel-error'}>\n Exponentiation operator works: {this.exponentiation().toString()}\n </div>\n <div className={this.state.asyncAwaitWorks ? '' : 'babel-error'}>\n Async await: check console for AsyncAwait errors\n </div>\n <div className={this.objectValues() ? '' : 'babel-error'}>\n Object.values works: {this.objectValues().toString()}\n </div>\n </div>\n );\n }", "function customValidation(input) { \n}", "function createChainableTypeChecker(validate){function checkType(isRequired,props,propName,componentName){componentName=componentName||'<<anonymous>>';if(props[propName]==null){if(isRequired){return new Error('Required prop \\''+propName+'\\' was not specified in \\''+componentName+'\\'.');}}else {return validate(props,propName,componentName);}}var chainedCheckType=checkType.bind(null,false);chainedCheckType.isRequired=checkType.bind(null,true);return chainedCheckType;}", "_validate (schema){\n return SwaggerParser.validate(schema);\n }", "render() {\n return (\n <fieldset className={ \"ValidateField\" + (this.status.invalid && \" invalid \") }>\n {this.props.children}\n {this.status.invalid && <span className=\"ValidateStatus\">{this.status.invalid}</span>}\n </fieldset>\n )\n\n }", "static _chkKey(req) {\n if (typeof req.key === 'string') {\n try {\n req.key = JSON.parse(req.key);\n } catch(err) {\n throw new NoSQLArgumentError('Invalid JSON key', req, err);\n }\n }\n if (!isPlainObject(req.key)) {\n throw new NoSQLArgumentError('Invalid or missing key', req);\n }\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnSafetyRule.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_route53recoverycontrol_CfnSafetyRuleProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnSafetyRule);\n }\n throw error;\n }\n cdk.requireProperty(props, 'controlPanelArn', this);\n cdk.requireProperty(props, 'name', this);\n cdk.requireProperty(props, 'ruleConfig', this);\n this.attrSafetyRuleArn = cdk.Token.asString(this.getAtt('SafetyRuleArn', cdk.ResolutionTypeHint.STRING));\n this.attrStatus = cdk.Token.asString(this.getAtt('Status', cdk.ResolutionTypeHint.STRING));\n this.controlPanelArn = props.controlPanelArn;\n this.name = props.name;\n this.ruleConfig = props.ruleConfig;\n this.assertionRule = props.assertionRule;\n this.gatingRule = props.gatingRule;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::Route53RecoveryControl::SafetyRule\", props.tags, { tagPropertyName: 'tags' });\n }", "create(_nextPolicy, _options) {\n throw new Error(\"Method should be implemented in children classes.\");\n }", "create(_nextPolicy, _options) {\n throw new Error(\"Method should be implemented in children classes.\");\n }", "function validateAttributeValue(className,value,updateFn){var origValue=value;if(!needsInterpolation(value)){switch(className.replace(SUFFIXES,\"\")){case'layout':if(!findIn(value,LAYOUT_OPTIONS)){value=LAYOUT_OPTIONS[0];// 'row';\n\t}break;case'flex':if(!findIn(value,FLEX_OPTIONS)){if(isNaN(value)){value='';}}break;case'flex-offset':case'flex-order':if(!value||isNaN(+value)){value='0';}break;case'layout-align':var axis=extractAlignAxis(value);value=$mdUtil.supplant(\"{main}-{cross}\",axis);break;case'layout-padding':case'layout-margin':case'layout-fill':case'layout-wrap':case'layout-nowrap':case'layout-nowrap':value='';break;}if(value!=origValue){(updateFn||angular.noop)(value);}}return value;}", "handleAttributeExpressions(element,name,strings,options){const prefix=name[0];if(\".\"===prefix){const committer=new PropertyCommitter(element,name.slice(1),strings);return committer.parts}if(\"@\"===prefix){return[new EventPart(element,name.slice(1),options.eventContext)]}if(\"?\"===prefix){return[new BooleanAttributePart(element,name.slice(1),strings)]}const committer=new AttributeCommitter(element,name,strings);return committer.parts}", "static get properties() {\n return {\n ...super.properties,\n question: { type: String, reflect: true },\n correctOrder: { type: Array },\n numberOfOptions: { type: Number },\n numberCorrrect: { type: Number },\n celebrate: { type: Boolean },\n shame: { type: Boolean },\n mute: { type: Boolean },\n disabled: { type: Boolean },\n noBackground: { type: Boolean, attribute: \"no-background\" },\n };\n }", "formValidator() {\n let monkey = false;\n let short = false;\n let long = false;\n let spacebar = false;\n let correct = false;\n\n if (this.state.email.indexOf('@') !== -1) {\n monkey = true;\n }\n if (this.state.email.length > 7) {\n short = true;\n }\n if (this.state.email.length < 40) {\n long = true;\n }\n if (this.state.email.indexOf(' ') === -1) {\n spacebar = true;\n }\n if (monkey && short && long && spacebar) {\n correct = true\n }\n return ({\n correct, monkey, short, long, spacebar\n })\n }", "function TrueSpecification() {}", "policy() {}", "handleValidation (event, status, error) {\n if (!event) {\n return\n }\n\n let codes = super.mergeError(this.state.errorCodes, super.flattenObject(error))\n let complexStatus = null\n if (codes.length > 0) {\n complexStatus = false\n } else if (this.isValid()) {\n complexStatus = true\n }\n\n this.setState({error: complexStatus === false, valid: complexStatus === true, errorCodes: codes}, () => {\n let e = { [this.props.name]: codes }\n let s = { [this.props.name]: { status: complexStatus } }\n if (this.state.error === false || this.state.valid === true) {\n super.handleValidation(event, s, e)\n return\n }\n super.handleValidation(event, s, e)\n })\n }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "get required() { return this._required; }", "_validate() {\n if (typeof this.name !== 'string') {\n throw new ValidationError('Service name must be a string, got %s',\n typeof this.name);\n }\n\n if (!this.name) {\n throw new ValidationError(\"Service name can't be empty\");\n }\n\n if (typeof this.protocol !== 'string') {\n throw new ValidationError('Protocol must be a string, got %s',\n typeof this.protocol);\n }\n\n if (!this.protocol) {\n throw new ValidationError(\"Protocol can't be empty\");\n }\n\n // massage properties a little before validating\n // be lenient about underscores, add when missing\n if (this.name.substr(0, 1) !== '_') this.name = '_' + this.name;\n if (this.protocol.substr(0, 1) !== '_') this.protocol = '_' + this.protocol;\n\n // special case: check this service type is the service enumerator\n if (this.name === '_services._dns-sd' && this.protocol === '_udp') {\n this.isEnumerator = true;\n\n // enumerators shouldn't have subtypes\n this.subtypes = [];\n\n // skip validation for service enumerators, they would fail since\n // '_services._dns-sd' is getting shoehorned into this.name\n return;\n }\n\n validate.serviceName(this.name);\n validate.protocol(this.protocol);\n this.subtypes.forEach(subtype => validate.label(subtype, 'Subtype'));\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xee3b272a;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.key = args.key;\n this.rules = args.rules;\n }", "function FormStyler(inputs, specs) {\n\n\tthis.cache = {};\n\n\tthis.error_style = function(do_not_handle_errors) {\n\t\tdo_not_handle_errors = do_not_handle_errors || false;\n\n\t\tfor(var x in specs) {\n\t\t\tvar spec = specs[x];\n\n\t\t\t// only consider fields displayed in the form\n\t\t\tif(!spec['allow_write']) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar name = spec['name'];\n\t\t\tvar flax = spec['flax'] || 'pass';\n\n\t\t\t//alert(flax);\n\n\t\t\tvar input = inputs[name]['input'];\n\t\t\t//alert(input.toSource());\n\t\t\tvar val = input.val();\n\n\t\t\t// cache the original values\n\t\t\tthis.cache[name] = val;\n\n\t\t\t// Style the values in the form\n\t\t\tif(!this.flax[flax]['checker'](val)) {\n\t\t\t\tthis.flax[flax]['handler'](input, spec);\n\t\t\t}\n\t\t}\n\t\treturn all_ok;\n\t};\n\n\n\tthis.add_vax = function(vax_name, flax) {\n\t\tif(vax_name in this.flax) {\n\t\t\talert('In JsonifyForm.add_vax(vax_name, flax): This JsonifyForm '\n\t\t\t\t+ 'already has a flax named \"' + vax_name + '\".');\n\t\t} \n\t\t\n\t\tvalidate('JsonifyForm.add_vax', flax, 'object', 'flax');\n\n\t\tthis.flax[vax_name] = flax;\n\t};\n\n\tthis.red = function(input) {\n\t\tinput.css('border', 'solid red 1px');\n\t};\n\n\t(function(o) {\n\t\to.flax = {\n\t\t\t'pass' : {\n\t\t\t\t'checker' : function(val) {\n\t\t\t\t\treturn true;\n\n\t\t\t\t}, 'handler' : function(input, spec) {\n\t\t\t\t\to.red(input);\n\t\t\t\t}\n\n\t\t\t}, 'fail' : {\n\t\t\t\t'checker' : function(val) {\n\t\t\t\t\treturn false;\n\n\t\t\t\t}, 'handler' : function(input, spec) {\n\t\t\t\t\to.red(input);\n\t\t\t\t}\n\n\t\t\t}, 'string' : {\n\t\t\t\t'checker' : function(val) {\n\t\t\t\t\treturn val.trim()? true : false;\n\n\t\t\t\t}, 'handler' : function(input, spec) {\n\t\t\t\t\to.red(input);\n\t\t\t\t}\n\n\t\t\t}, 'number': {\n\t\t\t\t'checker' : function(val) {\n\t\t\t\t\treturn isFloat64(val.trim());\n\n\t\t\t\t}, 'handler' : function(input, spec) {\n\t\t\t\t\to.red(input);\n\t\t\t\t}\n\n\t\t\t}, 'year': {\n\t\t\t\t'checker' : function(val) {\n\t\t\t\t\tval = parseInt(val.trim());\n\t\t\t\t\tif(isInt(val) && val > 0 && val < 3000) {\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\n\t\t\t\t}, 'handler' : function(input, spec) {\n\t\t\t\t\to.red(input);\n\t\t\t\t}\n\n\t\t\t}, '_int': {\n\t\t\t\t'checker' : function(val) {\n\t\t\t\t\treturn isInt(parseInt(val.trim())) || val.trim()=='';\n\n\t\t\t\t}, 'handler' : function(input, spec) {\n\t\t\t\t\to.red(input);\n\t\t\t\t}\n\n\t\t\t}, 'int': {\n\t\t\t\t'checker' : function(val) {\n\t\t\t\t\treturn isInt(val.trim());\n\n\t\t\t\t}, 'handler' : function(input, spec) {\n\t\t\t\t\to.red(input);\n\t\t\t\t}\n\n\t\t\t}, '_pdf': {\n\t\t\t\t'checker' : function(val) {\n\t\t\t\t\tif(val.trim()=='') {\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t\t} else if(\n\t\t\t\t\t\ttypeof(val)=='string' \n\t\t\t\t\t\t&& val.length >=5 \n\t\t\t\t\t\t&& val.substring(val.length-4, 4)=='.pdf') {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\n\t\t\t\t}, 'handler' : function(input, spec) {\n\t\t\t\t\tinput.input_label.css('border', 'solid 1px red');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})(this);\n}", "function required() { }", "async validate(){\n \n // ensure classes \n if(!this.apexClassNames || this.apexClassNames.length == 0)\n throw new Error('No Apex classes prescribed in pset.');\n\n // get each of the class bodies via tooling\n this.classBodies = ''; \n try{\n stdio.warn(`Retrieving ${this.apexClassNames.length > 1 ? 'classes' : 'class'} ${this.apexClassNames.join(', ')} from ${ config.mode === 'local' ? 'default local directory...' : 'authorized SF org...' }`);\n for(let apexClass of await tooling.getApex(this.apexClassNames)){\n // replace any instances of static methods with static global-level variables, \n // and remove the static method keywords, such that apex class calls to static methods\n // are immitated\n const name = apexClass.name; \n let body = apexClass.body; \n if(apexClass.body.indexOf(' static ') != -1){\n this.globalVars.push(`// mimic static method(s) in class ${name}\\nstatic ${name} ${name} = new ${name}();`);\n body = body.replace(new RegExp(/ static /, 'gi'), ` /** static method mimicked by var '${name}' **/ `); \n }\n this.classBodies += `${body}\\n\\n`;\n }\n } catch(e){\n throw e; \n }\n\n // construct anonymous body\n try{\n stdio.warn('Constructing tests...'); \n const anonBody = buildAnonTest(this); \n stdio.warn('Validating assertions in authorized org...');\n await tooling.executeAnonApex(anonBody); \n } catch(e){\n throw e; \n }\n\n }", "constructor(name, numOfStudents, pickupPolicy){\n super(name, 'primary', numOfStudents);\n this._pickupPolicy = pickupPolicy;\n }", "_validateAttributes(values = {}) {\n const { attributes } = this.constructor;\n // check changed values\n const changes = this.changes();\n let changedValues = {};\n for (const key in changes) {\n if (changes[key].length === 2) {\n changedValues[key] = changes[key][1];\n }\n }\n\n // merge all changed values\n changedValues = Object.assign(changedValues, values);\n\n for (const valueKey in changedValues) {\n const attribute = attributes[valueKey];\n if (!attribute) continue;\n const { validate = {}, name, allowNull, defaultValue } = attribute;\n const value = changedValues[valueKey];\n if (value == null && defaultValue == null) {\n if (allowNull === false) throw new LeoricValidateError('notNull', name);\n if ((allowNull === true || allowNull === undefined) && validate.notNull === undefined ) return;\n }\n if (!validate) return;\n for (const key in validate) {\n if (validate.hasOwnProperty(key)) executeValidator(this, key, attribute, value);\n }\n }\n }", "constructor(css, key) {\n this.css = css;\n this.key = this.setKey(key);\n\n this.label = `${this.css} label`\n }", "isValid() {\n let valid = true;\n let snippet = this.state.snippet;\n let errors = {};\n\n // validate title\n let titleParams = {minLength: 3};\n let titleVal = validate(snippet.title, titleParams);\n if (!titleVal.valid) {\n errors.title = titleVal.error;\n valid = false;\n }\n\n // validate url\n let urlParams = {required: true, format: 'url'};\n let urlVal = validate(snippet.url, urlParams);\n if (!urlVal.valid) {\n errors.url = urlVal.error;\n valid = false;\n }\n\n this.setState({errors});\n return valid;\n }", "function wrapComponentClassAttribute(hash) {\n if (!hash) {\n return hash;\n }\n\n var keys = hash[0],\n values = hash[1];\n\n var index = keys.indexOf('class');\n\n if (index !== -1) {\n var _values$index = values[index],\n type = _values$index[0];\n\n\n if (type === _wireFormat.Ops.Get) {\n var getExp = values[index];\n var path = getExp[2];\n var propName = path[path.length - 1];\n hash[1][index] = [_wireFormat.Ops.Helper, ['-class'], [getExp, propName]];\n }\n }\n\n return hash;\n }" ]
[ "0.5342845", "0.5112662", "0.5045094", "0.5017068", "0.50010127", "0.49944904", "0.4963574", "0.4963574", "0.49479422", "0.49393803", "0.49313897", "0.49260977", "0.49147072", "0.49147072", "0.4913085", "0.49105555", "0.49105555", "0.4899184", "0.48627192", "0.48627192", "0.48627192", "0.48627192", "0.48627192", "0.48627192", "0.48627192", "0.48627192", "0.48627192", "0.48627192", "0.48627192", "0.48526594", "0.48039883", "0.48024556", "0.47938725", "0.47798967", "0.47720572", "0.4746264", "0.47450107", "0.47449407", "0.4737039", "0.47269353", "0.47244763", "0.4723173", "0.47177127", "0.47162205", "0.47142646", "0.4702366", "0.46848786", "0.46828428", "0.46820825", "0.467227", "0.46697593", "0.46675998", "0.46655458", "0.46651655", "0.4661369", "0.46572623", "0.4650769", "0.46444213", "0.4642292", "0.4639261", "0.46376818", "0.46349794", "0.4631104", "0.46143407", "0.46105984", "0.4608891", "0.45997268", "0.45978478", "0.4596459", "0.45939332", "0.45793584", "0.45661578", "0.45620874", "0.45588088", "0.4557309", "0.4557309", "0.45566005", "0.45547977", "0.45540288", "0.45535934", "0.45526183", "0.45433894", "0.45339876", "0.45303318", "0.45303318", "0.45303318", "0.45303318", "0.45303318", "0.45303318", "0.45303318", "0.45303318", "0.45191503", "0.45124802", "0.4508586", "0.4500863", "0.44987237", "0.44963306", "0.44931802", "0.44921753", "0.44920963", "0.4489894" ]
0.0
-1
Return the deepest cached node whose ID is a prefix of `targetID`.
function findDeepestCachedAncestor(targetID) { deepestNodeSoFar = null; ReactInstanceHandles.traverseAncestors( targetID, findDeepestCachedAncestorImpl ); var foundNode = deepestNodeSoFar; deepestNodeSoFar = null; return foundNode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(\n targetID,\n findDeepestCachedAncestorImpl\n );\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n deepestNodeSoFar = null;\n ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n var foundNode = deepestNodeSoFar;\n deepestNodeSoFar = null;\n return foundNode;\n}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(\n\t targetID,\n\t findDeepestCachedAncestorImpl\n\t );\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(\n\t targetID,\n\t findDeepestCachedAncestorImpl\n\t );\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(\n\t targetID,\n\t findDeepestCachedAncestorImpl\n\t );\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\t\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\t\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\t\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\t\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\t\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\t\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t deepestNodeSoFar = null;\n\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\t\n\t var foundNode = deepestNodeSoFar;\n\t deepestNodeSoFar = null;\n\t return foundNode;\n\t}", "function findDeepestCachedAncestor(targetID) {\n\t\t deepestNodeSoFar = null;\n\t\t ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);\n\t\t\n\t\t var foundNode = deepestNodeSoFar;\n\t\t deepestNodeSoFar = null;\n\t\t return foundNode;\n\t\t}", "function findDeepestCachedAncestor(targetID){deepestNodeSoFar=null;ReactInstanceHandles.traverseAncestors(targetID,findDeepestCachedAncestorImpl);var foundNode=deepestNodeSoFar;deepestNodeSoFar=null;return foundNode;}", "function findDeepestCachedAncestor(targetID){deepestNodeSoFar = null;ReactInstanceHandles.traverseAncestors(targetID,findDeepestCachedAncestorImpl);var foundNode=deepestNodeSoFar;deepestNodeSoFar = null;return foundNode;}", "static getOrCreate(target) {\n return nodeCache.get(target) || new DesignTokenNode(target);\n }", "function findPath(target){\n\tvar numberPath = new Array();\n\tvar node = target;\n\twhile(typeof previous[node] !== 'undefined'){\n\t\tnumberPath = [node].concat(numberPath);\n\t\tnode = previous[node];\n\t}\n\tnumberPath = [node].concat(numberPath);\n\treturn numberPath;\n}", "function lookupResource(target) {\n\t\twhile (target.nodeName !== 'LI') {\n\t\t\ttarget = target.parentNode;\n\t\t}\n\t\treturn todoApi.follow({ rel: 'item', id: target.dataset.id });\n\t}", "function findNode(target, targetNodeName, stopAt) {\n if(target.nodeName == targetNodeName) {\n return target;\n } else if(target.nodeName == stopAt) {\n return false;\n } else {\n return findNode(target.parentNode, targetNodeName, stopAt);\n }\n}", "function getRootNode(target) {\n var roots = getRootNodes(target);\n if (roots.length) {\n return roots[0];\n } else {\n return null;\n }\n }", "static existsFor(target) {\n return nodeCache.has(target);\n }", "function getSelectedNode(target) {\n var node = $(target).find('div.tree-node-selected');\n if (node.length) {\n return getNode(target, node[0]);\n } else {\n return null;\n }\n }", "getNode(id) {\n for (let i = 0; i < this.nodes.length; i++) {\n let node = this.nodes[i];\n if (!node) { continue; }\n if (node.id === id) { return node; }\n }\n return null;\n }", "function get_node(id)\n {\n return indexbyid[id];\n }", "function getRootNode(target) {\n\t\t\t\t\twhile (target.nodeType !== 1) {\n\t\t\t\t\t\ttarget = target.parentNode;\n\t\t\t\t\t}\n\t\t\t\t\treturn target;\n\t\t\t\t}", "function getParentNode(target, nodeEl) {\n var ul = $(nodeEl).parent().parent();\n if (ul[0] == target) {\n return null;\n } else {\n return getNode(target, ul.prev()[0]);\n }\n }", "shortestPath(source, target) {\n for (let node of this.nodes) {\n node.path = [];\n }\n source.path = [source.value];\n\n const toVisitQueue = [source];\n const visited = new Set(toVisitQueue);\n\n while (toVisitQueue.length) {\n const currNode = toVisitQueue.shift();\n if (currNode == target) {\n return currNode.path;\n }\n for (let neighbor of currNode.adjacent) {\n if (!visited.has(neighbor)) {\n neighbor.path = [...currNode.path, neighbor.value];\n toVisitQueue.push(neighbor);\n visited.add(neighbor);\n }\n }\n }\n }", "function findNearest(node, allEdges, targetVal) {\n\n function dfs(parentNode, allEdges, targetVal) {\n let children = getChildren(parentNode, allEdges);\n for (let i = 0; i < children.length; i++) {\n let childNode = children[i];\n if (visitedNode.has(childNode))\n continue;\n\n visitedNode.add(childNode);\n let nodeValue = ids.find((id, index) => index + 1 === childNode);\n if (nodeValue === targetVal)\n return node2Depth.get(parentNode) + 1;\n else {\n node2Depth.set(childNode, node2Depth.get(parentNode) + 1);\n let result = dfs(childNode, allEdges, targetVal);\n if (result !== undefined)\n return result;\n }\n }\n }\n\n let node2Depth = new Map(), visitedNode = new Set(); // the depth is counted from the nodeIndex\n node2Depth.set(node, 0);\n visitedNode.add(node);\n return dfs(node, allEdges, targetVal);\n }", "function nestedTarget() {\n return document.querySelector('#nested .target');\n}", "function nestedTarget() {\n return document.querySelector('#nested .target');\n}", "function nestedTarget() {\n return document.querySelector('#nested .target');\n}", "contains(target) {\n let found = false;\n let cachedNode = this;\n while (!found) {\n if (cachedNode.value === target) {\n found = true;\n break;\n } else if (target < cachedNode.value && cachedNode.left !== null) {\n cachedNode = cachedNode.left;\n } else if (target > cachedNode.value && cachedNode.right !== null) {\n cachedNode = cachedNode.right;\n } else {\n break;\n }\n }\n return found;\n }", "function TNodes_doFindNodeByIdent(id){\t\t\n\t\t\tvar i=1;\n\t\t\tvar obj = null;\n \t\tif (this.Item[0]!=undefined){ \t\t \n \tif (id==this.Item[0].Ident){\n \t\t\t\tobj = this.Item[0];\n \t\t\t\treturn obj;\n\t\t\t }\n\t\t\t}\n\t\t\t// look case zero-node has containerlist\n//obj=this.Item[0].doCheckContainerIdent(id);\n\t\t\tif (obj != undefined) {\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\t\n\n\t\t\tdo {\t\t\t\t\n\t\t\t\t\tif (this.Item[i] == undefined) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// look upnode\n\t\t\t\t\tif (id==this.Item[i].UpNode.Ident){\n\t\t\t\t\t\tobj = this.Item[i].UpNode;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// look downnode\t\n\t\t\t\t\tif (id==this.Item[i].DownNode.Ident){\n\t\t\t\t\t\tobj = this.Item[i].DownNode;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// look upnode-container\n\t\t\t\t\t//obj=this.Item[i].UpNode.doCheckContainerIdent(id);\n\t\t\t\t\tif (obj != undefined) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n \n \n\n\t\t\t\t\t// look downnode-container\n\t\t\t\t\t//obj = this.Item[i].DownNode.doCheckContainerIdent(id);\n\t\t\t\t\tif (obj != undefined) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t} while (i++ < this.Count);\n\t\t\treturn obj;\n\t\t}", "get_nearest_node(ignore_id=-1) {\n let min_dist = 1000000000;\n let best_id = -1;\n for(let i = 0; i < this.nodes.length; i++) {\n let n = this.nodes[i];\n let dist = (mouse.x-n.x)*(mouse.x-n.x)+(mouse.y-n.y)*(mouse.y-n.y);\n if(dist < min_dist && ignore_id != i) {\n min_dist = dist;\n best_id = i;\n }\n }\n return best_id;\n }", "function hasParentId(target, id) {\n var node = target;\n while (node !== null) {\n if (node.id === id) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}", "findTarget() {\n\t\tthis.targetElement = this.container.querySelector(this.target);\n\t}", "function findNodeByID(id) {\n var ret = null;\n \n $.each(nodes, function(i, node) {\n if (node['id'] == id) {\n ret = node;\n }\n });\n \n return ret;\n}", "function findSolution(target) {\n function find(current, history) {\n if(current == target) {\n return history;\n }else if (current > target) {\n return null;\n } else {\n return find(current + 5, `(${history} + 5)` ) || \n find(current * 3, `(${history} * 3)` );\n }\n }\n return find(1, '1');\n}", "function dfs (node, targetNode) {\n var i = 0;\n var childNode;\n var res;\n\n if (isTargetNode(node, targetNode)) {\n return node;\n }\n\n // mark node as visited\n visitedNodes.push(node);\n\n for (i = 0; i < node.children.length; i++) {\n childNode = node.children[i];\n\n // has node not been visited?\n if (visitedNodes.indexOf(childNode) === -1) {\n\n // search recursively\n res = dfs(childNode, targetNode);\n\n // was the targetNode found?\n if (res) {\n return res;\n }\n }\n }\n\n return null;\n}", "function nestedTarget(){\n return document.querySelector('#nested .target')\n }", "function del(id, target) {\n var cc;\n var pnode = getParent(target, idValue);\n if (pnode) {\n cc = pnode.children;\n } else {\n cc = $(target).treegrid('getData');\n }\n for (var i = 0, len = cc.length; i < len; i++) {\n if (cc[i][opts.idField] == id) {\n cc.splice(i, 1);\n break;\n }\n }\n return pnode;\n }", "function dfs_findById(tree, id) {\n let targetNode;\n let targetPath;\n function dfs(node, path) {\n if (node) {\n const { left, right, value } = node;\n path.push(value);\n if (value === id) {\n targetNode = node;\n targetPath = path;\n return;\n }\n if (left) {\n dfs(left, [...path]);\n }\n if (right) {\n dfs(right, [...path]);\n }\n path = null;\n }\n }\n dfs(tree, []);\n console.log(targetNode, targetPath);\n return targetPath;\n}" ]
[ "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.74199265", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.7403311", "0.73242605", "0.73242605", "0.73242605", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.73109555", "0.72852486", "0.72852486", "0.72852486", "0.72852486", "0.72852486", "0.72852486", "0.72852486", "0.72767264", "0.69189507", "0.6846947", "0.584588", "0.5437195", "0.5426678", "0.5318145", "0.5311776", "0.5307229", "0.524221", "0.5238009", "0.5217669", "0.5202328", "0.5177441", "0.5155428", "0.51341516", "0.5120435", "0.5120435", "0.5120435", "0.5118154", "0.5117955", "0.51040727", "0.5099082", "0.5092939", "0.50457585", "0.5030188", "0.50260705", "0.50252396", "0.5016592", "0.5005329" ]
0.7301463
63
Recomputes the plugin list using the injected plugins and plugin ordering.
function recomputePluginOrdering() { if (!EventPluginOrder) { // Wait until an `EventPluginOrder` is injected. return; } for (var pluginName in namesToPlugins) { var PluginModule = namesToPlugins[pluginName]; var pluginIndex = EventPluginOrder.indexOf(pluginName); ("production" !== process.env.NODE_ENV ? invariant( pluginIndex > -1, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName ) : invariant(pluginIndex > -1)); if (EventPluginRegistry.plugins[pluginIndex]) { continue; } ("production" !== process.env.NODE_ENV ? invariant( PluginModule.extractEvents, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName ) : invariant(PluginModule.extractEvents)); EventPluginRegistry.plugins[pluginIndex] = PluginModule; var publishedEvents = PluginModule.eventTypes; for (var eventName in publishedEvents) { ("production" !== process.env.NODE_ENV ? invariant( publishEventForPlugin( publishedEvents[eventName], PluginModule, eventName ), 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName ) : invariant(publishEventForPlugin( publishedEvents[eventName], PluginModule, eventName ))); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "orderPlugins() {\r\n debug('orderPlugins:before', this.pluginNames);\r\n const runLast = this._plugins\r\n .filter(p => p.requirements.has('runLast'))\r\n .map(p => p.name);\r\n for (const name of runLast) {\r\n const index = this._plugins.findIndex(p => p.name === name);\r\n this._plugins.push(this._plugins.splice(index, 1)[0]);\r\n }\r\n debug('orderPlugins:after', this.pluginNames);\r\n }", "order() {\n debug('order:before', this.names);\n const runLast = this._plugins\n .filter(p => p.requirements.has('runLast'))\n .map(p => p.name);\n for (const name of runLast) {\n const index = this._plugins.findIndex(p => p.name === name);\n this._plugins.push(this._plugins.splice(index, 1)[0]);\n }\n debug('order:after', this.names);\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\"));\n }\n }\n })();\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\"));\n }\n }\n })();\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\"));\n }\n }\n })();\n }\n }\n }", "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);if(!(pluginIndex>-1)){{throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\"+pluginName+\"`.\");}}if(plugins[pluginIndex]){continue;}if(!pluginModule.extractEvents){{throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\"+pluginName+\"` does not.\");}}plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){if(!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)){{throw Error(\"EventPluginRegistry: Failed to publish event `\"+eventName+\"` for plugin `\"+pluginName+\"`.\");}}}}}", "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);if(!(pluginIndex>-1)){{throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\"+pluginName+\"`.\");}}if(plugins[pluginIndex]){continue;}if(!pluginModule.extractEvents){{throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\"+pluginName+\"` does not.\");}}plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){if(!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)){{throw Error(\"EventPluginRegistry: Failed to publish event `\"+eventName+\"` for plugin `\"+pluginName+\"`.\");}}}}}", "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);if(!(pluginIndex>-1)){{throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\"+pluginName+\"`.\");}}if(plugins[pluginIndex]){continue;}if(!pluginModule.extractEvents){{throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\"+pluginName+\"` does not.\");}}plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){if(!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)){{throw Error(\"EventPluginRegistry: Failed to publish event `\"+eventName+\"` for plugin `\"+pluginName+\"`.\");}}}}}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\n 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `' +\n pluginName +\n '`.',\n );\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\n 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `' +\n pluginName +\n '` does not.',\n );\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (\n !publishEventForPlugin(\n publishedEvents[eventName],\n pluginModule,\n eventName,\n )\n ) {\n {\n throw Error(\n 'EventPluginRegistry: Failed to publish event `' +\n eventName +\n '` for plugin `' +\n pluginName +\n '`.',\n );\n }\n }\n }\n }\n }", "function recomputePluginOrdering() {\n\t if (!eventPluginOrder) {\n\t // Wait until an `eventPluginOrder` is injected.\n\t return;\n\t }\n\t for (var pluginName in namesToPlugins) {\n\t var pluginModule = namesToPlugins[pluginName];\n\t var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\t !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\t if (plugins[pluginIndex]) {\n\t continue;\n\t }\n\t !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n\t plugins[pluginIndex] = pluginModule;\n\t var publishedEvents = pluginModule.eventTypes;\n\t for (var eventName in publishedEvents) {\n\t !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n\t }\n\t }\n\t}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n }", "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\nreturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\"));\n }\n }\n })();\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\"));\n }\n }\n })();\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\"));\n }\n }\n })();\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\"));\n }\n }\n })();\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\"));\n }\n }\n })();\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\"));\n }\n }\n })();\n }\n }\n}", "function recomputePluginOrdering(){if(!eventPluginOrder){// Wait until an `eventPluginOrder` is injected.\n\treturn;}for(var pluginName in namesToPlugins){var pluginModule=namesToPlugins[pluginName];var pluginIndex=eventPluginOrder.indexOf(pluginName);!(pluginIndex>-1)?invariant(false,'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.',pluginName):void 0;if(plugins[pluginIndex]){continue;}!pluginModule.extractEvents?invariant(false,'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.',pluginName):void 0;plugins[pluginIndex]=pluginModule;var publishedEvents=pluginModule.eventTypes;for(var eventName in publishedEvents){!publishEventForPlugin(publishedEvents[eventName],pluginModule,eventName)?invariant(false,'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.',eventName,pluginName):void 0;}}}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error('EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `' + pluginName + '`.'));\n }\n }\n })();\n if (plugins[pluginIndex]) {\n continue;\n }\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error('EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `' + pluginName + '` does not.'));\n }\n }\n })();\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error('EventPluginRegistry: Failed to publish event `' + eventName + '` for plugin `' + pluginName + '`.'));\n }\n }\n })();\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error('EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `' + pluginName + '`.'));\n }\n }\n })();\n if (plugins[pluginIndex]) {\n continue;\n }\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error('EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `' + pluginName + '` does not.'));\n }\n }\n })();\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error('EventPluginRegistry: Failed to publish event `' + eventName + '` for plugin `' + pluginName + '`.'));\n }\n }\n })();\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\");\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\");\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\");\n }\n }\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\");\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\");\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\");\n }\n }\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\");\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\");\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\");\n }\n }\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\");\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\");\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\");\n }\n }\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n if (!(pluginIndex > -1)) {\n {\n throw Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\");\n }\n }\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n if (!pluginModule.extractEvents) {\n {\n throw Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\");\n }\n }\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\");\n }\n }\n }\n }\n }", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}", "function recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}" ]
[ "0.79937375", "0.74689573", "0.7168156", "0.71348816", "0.71348816", "0.71348816", "0.7127607", "0.71214473", "0.71175057", "0.7116182", "0.7116182", "0.7116182", "0.7099919", "0.7099919", "0.7099919", "0.7090084", "0.7090084", "0.7090084", "0.7090084", "0.7090084", "0.7090084", "0.7090031", "0.7090031", "0.7078115", "0.70735294", "0.70735294", "0.70646924", "0.70646924", "0.70646924", "0.70646924", "0.70646924", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696", "0.7063696" ]
0.0
-1
This is a cleanroom implementation of adler32 designed for detecting if markup is not what we expect it to be. It does not need to be cryptographically strong, only reasonably good at detecting if markup generated on the server is different than that on the client.
function adler32(data) { var a = 1; var b = 0; for (var i = 0; i < data.length; i++) { a = (a + data.charCodeAt(i)) % MOD; b = (b + a) % MOD; } return a | (b << 16); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateAltText(el) {\n let altText = el.getAttribute(\"alt\");\n return {\n extractedText: altText,\n result: this.isDescriptiveText(altText),\n };\n }", "function shouldDecode(content,encoded){var div=document.createElement('div');div.innerHTML=\"<div a=\\\"\"+content+\"\\\">\";return div.innerHTML.indexOf(encoded)>0;}// #3663", "check () {\n let mnemonic = this.mnemonic\n\n // confirm no invalid words\n let words = mnemonic.split(wordlist.space)\n let bin = ''\n for (let i = 0; i < words.length; i++) {\n let ind = wordlist.indexOf(words[i])\n if (ind < 0) {\n return false\n }\n bin = bin + ('00000000000' + ind.toString(2)).slice(-11)\n }\n\n if (bin.length % 11 !== 0) {\n throw new Error('internal error - entropy not an even multiple of 11 bits - ' + bin.length)\n }\n\n // confirm checksum\n let cs = bin.length / 33\n let hashBits = bin.slice(-cs)\n let nonhashBits = bin.slice(0, bin.length - cs)\n let buf = new Buffer(nonhashBits.length / 8)\n for (let i = 0; i < nonhashBits.length / 8; i++) {\n buf.writeUInt8(parseInt(bin.slice(i * 8, (i + 1) * 8), 2), i)\n }\n let hash = Hash.sha256(buf)\n let expectedHashBits = hash[0].toString(2)\n expectedHashBits = ('00000000' + expectedHashBits).slice(-8).slice(0, cs)\n\n return expectedHashBits === hashBits\n }", "function adler32(data){var a=1;var b=0;for(var i=0;i < data.length;i++) {a = (a + data.charCodeAt(i)) % MOD;b = (b + a) % MOD;}return a | b << 16;}", "static _tag_33(v) {\n\t // If any of the following apply:\n\t // - the encoded text string contains non-alphabet characters or\n\t // only 1 alphabet character in the last block of 4 (where\n\t // alphabet is defined by Section 5 of [RFC4648] for tag number 33\n\t // and Section 4 of [RFC4648] for tag number 34), or\n\t if (!v.match(/^[a-zA-Z0-9_-]+$/)) {\n\t throw new Error('Invalid base64url characters')\n\t }\n\t const last = v.length % 4;\n\t if (last === 1) {\n\t throw new Error('Invalid base64url length')\n\t }\n\t // - the padding bits in a 2- or 3-character block are not 0, or\n\t if (last === 2) {\n\t // The last 4 bits of the last character need to be zero.\n\t if ('AQgw'.indexOf(v[v.length - 1]) === -1) {\n\t throw new Error('Invalid base64 padding')\n\t }\n\t } else if (last === 3) {\n\t // The last 2 bits of the last character need to be zero.\n\t if ('AEIMQUYcgkosw048'.indexOf(v[v.length - 1]) === -1) {\n\t throw new Error('Invalid base64 padding')\n\t }\n\t }\n\n\t // or\n\t // - the base64url encoding has padding characters,\n\t // (caught above)\n\n\t // the string is invalid.\n\t return this\n\t }", "function adler32(data){var a=1;var b=0;for(var i=0;i<data.length;i++){a=(a+data.charCodeAt(i))%MOD;b=(b+a)%MOD;}return a|b<<16;}", "function check (buffer) {\n\t if (buffer.length < 8) return false\n\t if (buffer.length > 72) return false\n\t if (buffer[0] !== 0x30) return false\n\t if (buffer[1] !== buffer.length - 2) return false\n\t if (buffer[2] !== 0x02) return false\n\n\t var lenR = buffer[3]\n\t if (lenR === 0) return false\n\t if (5 + lenR >= buffer.length) return false\n\t if (buffer[4 + lenR] !== 0x02) return false\n\n\t var lenS = buffer[5 + lenR]\n\t if (lenS === 0) return false\n\t if ((6 + lenR + lenS) !== buffer.length) return false\n\n\t if (buffer[4] & 0x80) return false\n\t if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n\t if (buffer[lenR + 6] & 0x80) return false\n\t if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n\t return true\n\t}", "function adler32(data) {\n\t\t var a = 1;\n\t\t var b = 0;\n\t\t var i = 0;\n\t\t var l = data.length;\n\t\t var m = l & ~0x3;\n\t\t while (i < m) {\n\t\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t }\n\t\t for (; i < l; i++) {\n\t\t b += a += data.charCodeAt(i);\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t return a | b << 16;\n\t\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t\t var a = 1;\n\t\t var b = 0;\n\t\t var i = 0;\n\t\t var l = data.length;\n\t\t var m = l & ~0x3;\n\t\t while (i < m) {\n\t\t var n = Math.min(i + 4096, m);\n\t\t for (; i < n; i += 4) {\n\t\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t }\n\t\t for (; i < l; i++) {\n\t\t b += a += data.charCodeAt(i);\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t return a | b << 16;\n\t\t}", "function adler32(data) {\n\t\t var a = 1;\n\t\t var b = 0;\n\t\t var i = 0;\n\t\t var l = data.length;\n\t\t var m = l & ~0x3;\n\t\t while (i < m) {\n\t\t var n = Math.min(i + 4096, m);\n\t\t for (; i < n; i += 4) {\n\t\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t }\n\t\t for (; i < l; i++) {\n\t\t b += a += data.charCodeAt(i);\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t return a | b << 16;\n\t\t}", "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "function enIeCheck(tin) {\n var checksum = algorithms.reverseMultiplyAndSum(tin.split('').slice(0, 7).map(function(a) {\n return parseInt(a, 10);\n }), 8);\n if (tin.length === 9 && tin[8] !== 'W') checksum += (tin[8].charCodeAt(0) - 64) * 9;\n checksum %= 23;\n if (checksum === 0) return tin[7].toUpperCase() === 'W';\n return tin[7].toUpperCase() === String.fromCharCode(64 + checksum);\n} // Valid US IRS campus prefixes", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}" ]
[ "0.5425373", "0.53432", "0.5292201", "0.51598614", "0.5134596", "0.51264", "0.5021328", "0.49580628", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49421448", "0.49378783", "0.49378783", "0.49354124", "0.49354124", "0.49354124", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49268252", "0.49144548", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313", "0.49107313" ]
0.4982218
12
Creates a new React class that is idempotent and capable of containing other React components. It accepts event listeners and DOM properties that are valid according to `DOMProperty`. Event listeners: `onClick`, `onMouseDown`, etc. DOM properties: `className`, `name`, `title`, etc. The `style` property functions differently from the DOM API. It accepts an object mapping of style properties to values.
function ReactDOMComponent(tag) { validateDangerousTag(tag); this._tag = tag; this._renderedChildren = null; this._previousStyleCopy = null; this._rootNodeID = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createElement(type,config,children){var propName=void 0;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function withStyles() {\n for (var _len = arguments.length, styles = Array(_len), _key = 0; _key < _len; _key++) {\n styles[_key] = arguments[_key];\n }\n \n return function (BaseComponent) {\n return (function (_Component) {\n _inherits(StyledComponent, _Component);\n \n function StyledComponent() {\n _classCallCheck(this, StyledComponent);\n \n _get(Object.getPrototypeOf(StyledComponent.prototype), 'constructor', this).apply(this, arguments);\n }\n \n _createClass(StyledComponent, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n this.removeCss = this.context.insertCss.apply(undefined, styles);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.removeCss();\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2['default'].createElement(BaseComponent, this.props);\n }\n }], [{\n key: 'contextTypes',\n \n //static is class wide.\n value: {\n insertCss: _react.PropTypes.func.isRequired\n },\n enumerable: true\n }]);\n \n return StyledComponent;\n })(_react.Component);\n };\n }", "function styled(styleSheet, hash, debug) {\n if (styleSheet === void 0) { styleSheet = {}; }\n var Style = free_style_1.create(hash, debug);\n var styles = registerStyleSheet(Style, styleSheet);\n return Object.assign(function (Component) {\n var Styled = function (props) {\n return React.createElement(StyleComponent, { Style: Style }, React.createElement(Component, Object.assign({}, props, { styles: styles })));\n };\n Styled.displayName = \"Styled<\" + (Component.displayName || Component.name || 'anonymous') + \">\";\n return Styled;\n }, { Style: Style, styles: styles });\n}", "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = _objectWithoutProperties$1(options, [\"name\"]);\n\n var classNamePrefix = name;\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(_extends$5({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = makeStyles(stylesOrCreator, _extends$5({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = _objectWithoutProperties$1(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = clsx(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react.cloneElement(children, _extends$5({\n className: clsx(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(_extends$5({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react.createElement(FinalComponent, _extends$5({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n hoistNonReactStatics_cjs(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n }", "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(_makeStyles__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(stylesOrCreator, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react__WEBPACK_IMPORTED_MODULE_2___default.a.cloneElement(children, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n className: Object(clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(FinalComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6___default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "function Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n var self = this;\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {string} className\n * @param {Array<string>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign$1(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<string>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray$2(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign$1(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign$1(attrs, additionalAttrs) : attrs;\n };\n\n this.computeStyle = function(custom, traits, defaultStyles) {\n if (!isArray$2(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], assign$1({}, defaultStyles, custom || {}));\n };\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createStyleAttribute(vnode) {\n const {\n elm,\n data: {\n styleMap\n },\n owner: {\n renderer\n }\n } = vnode;\n\n if (isUndefined$3(styleMap)) {\n return;\n }\n\n for (const name in styleMap) {\n renderer.setCSSStyleProperty(elm, name, styleMap[name]);\n }\n }", "setStyle(property, value) {\n if (!this._props.style) this._props.style = {};\n this._props.style[property] = value;\n }", "function Styles() {\n\n var defaultTraits = {\n\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n\n var self = this;\n\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {String} className\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.cls = function(className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n\n return assign(attrs, { 'class': className });\n };\n\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n this.style = function(traits, additionalAttrs) {\n\n if (!isArray(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function(attrs, t) {\n return assign(attrs, defaultTraits[t] || {});\n }, {});\n\n return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n };\n\n this.computeStyle = function(custom, traits, defaultStyles) {\n if (!isArray(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], assign(defaultStyles, custom || {}));\n };\n}", "function createStyleAttribute$1(vnode) {\n const {\n elm,\n data: {\n styleMap\n }\n } = vnode;\n\n if (isUndefined$3(styleMap)) {\n return;\n }\n\n const {\n style\n } = elm;\n\n for (const name in styleMap) {\n style[name] = styleMap[name];\n }\n }", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName;\n\n // Reserved names are extracted\n var props = {};\n\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}", "function createElement(type, config, children) {\n var propName = void 0;\n // Reserved names are extracted\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source;\n // Remaining properties are added to a new props object\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n }\n // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n var childrenLength = arguments.length - 2;\n if (childrenLength === 1) {\n props.children = children;\n }\n else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n }\n // Resolve default props\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "function styled_styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(objectWithoutProperties[\"a\" /* default */])(options, [\"name\"]);\n\n if (false) {}\n\n var classNamePrefix = name;\n\n if (false) { var displayName; }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(helpers_esm_extends[\"a\" /* default */])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(makeStyles[\"a\" /* default */])(stylesOrCreator, Object(helpers_esm_extends[\"a\" /* default */])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react_default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(objectWithoutProperties[\"a\" /* default */])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx_m[\"a\" /* default */])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react_default.a.cloneElement(children, Object(helpers_esm_extends[\"a\" /* default */])({\n className: Object(clsx_m[\"a\" /* default */])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(helpers_esm_extends[\"a\" /* default */])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/react_default.a.createElement(FinalComponent, Object(helpers_esm_extends[\"a\" /* default */])({\n ref: ref,\n className: className\n }, spread), children);\n });\n false ? undefined : void 0;\n\n if (false) {}\n\n hoist_non_react_statics_cjs_default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "constructor (...args) {\n super(...args);\n\n const { constructor } = this;\n\n // Used for the ready() function so it knows when it can call its callback.\n this[created] = true;\n\n // TODO refactor to not cater to Safari < 10. This means we can depend on\n // built-in property descriptors.\n // Must be defined on constructor and not from a superclass\n if (!constructor.hasOwnProperty(ctorCreateInitProps)) {\n setCtorNativeProperty(constructor, ctorCreateInitProps, createInitProps(constructor));\n }\n\n // Set up a renderer that is debounced for property sets to call directly.\n this[rendererDebounced] = debounce(this[renderer].bind(this));\n\n // Set up property lifecycle.\n const propDefsCount = getPropNamesAndSymbols(getPropsMap(constructor)).length;\n if (propDefsCount && constructor[ctorCreateInitProps]) {\n constructor[ctorCreateInitProps](this);\n }\n\n // DEPRECATED\n //\n // static render()\n // Note that renderCallback is an optional method!\n if (!this.renderCallback && constructor.render) {\n deprecated(this, 'static render', 'renderCallback');\n this.renderCallback = constructor.render.bind(constructor, this);\n }\n\n // DEPRECATED\n //\n // static created()\n //\n // Props should be set up before calling this.\n const { created: created$$1 } = constructor;\n if (isFunction(created$$1)) {\n deprecated(this, 'static created', 'constructor');\n created$$1(this);\n }\n\n // DEPRECATED\n //\n // Feature has rarely been used.\n //\n // Created should be set before invoking the ready listeners.\n const elemData = data(this);\n const readyCallbacks = elemData.readyCallbacks;\n if (readyCallbacks) {\n readyCallbacks.forEach(cb => cb(this));\n delete elemData.readyCallbacks;\n }\n }", "function Styles() {\n var defaultTraits = {\n 'no-fill': {\n fill: 'none'\n },\n 'no-border': {\n strokeOpacity: 0.0\n },\n 'no-events': {\n pointerEvents: 'none'\n }\n };\n var self = this;\n /**\n * Builds a style definition from a className, a list of traits and an object of additional attributes.\n *\n * @param {String} className\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n\n this.cls = function (className, traits, additionalAttrs) {\n var attrs = this.style(traits, additionalAttrs);\n return assign(attrs, {\n 'class': className\n });\n };\n /**\n * Builds a style definition from a list of traits and an object of additional attributes.\n *\n * @param {Array<String>} traits\n * @param {Object} additionalAttrs\n *\n * @return {Object} the style defintion\n */\n\n\n this.style = function (traits, additionalAttrs) {\n if (!isArray(traits) && !additionalAttrs) {\n additionalAttrs = traits;\n traits = [];\n }\n\n var attrs = reduce(traits, function (attrs, t) {\n return assign(attrs, defaultTraits[t] || {});\n }, {});\n return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;\n };\n\n this.computeStyle = function (custom, traits, defaultStyles) {\n if (!isArray(traits)) {\n defaultStyles = traits;\n traits = [];\n }\n\n return self.style(traits || [], assign({}, defaultStyles, custom || {}));\n };\n }", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (process.env.NODE_ENV !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function createElement(type,config,children){var propName;// Reserved names are extracted\nvar props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object\nfor(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto\n// the newly allocated props object.\nvar childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i<childrenLength;i++){childArray[i]=arguments[i+2];}{if(Object.freeze){Object.freeze(childArray);}}props.children=childArray;}// Resolve default props\nif(type&&type.defaultProps){var defaultProps=type.defaultProps;for(propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}{if(key||ref){var displayName=typeof type==='function'?type.displayName||type.name||'Unknown':type;if(key){defineKeyPropWarningGetter(props,displayName);}if(ref){defineRefPropWarningGetter(props,displayName);}}}return ReactElement(type,key,ref,self,source,ReactCurrentOwner.current,props);}", "function createStyleAttribute(vnode) {\n const {\n elm,\n data: {\n styleMap\n }\n } = vnode;\n\n if (isUndefined(styleMap)) {\n return;\n }\n\n const {\n style\n } = elm;\n\n for (const name in styleMap) {\n style[name] = styleMap[name];\n }\n }", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (__DEV__) {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function createElement(tag,children,props){\n\tvar element = document.createElement(tag);\n\tif(!(children instanceof Array)){children=[children];}\n\tfor(var i=0;i<children.length;i++){\n\t\tvar child=children[i];\n\t\tif(typeof child=='string'){child=document.createTextNode(child);}\n\t\tif(child){element.appendChild(child);}\n\t}\n\tif(typeof props=='object'){\n\t\tfor(var k in props){\n\t\t\tswitch(k){\n\t\t\tcase 'styles':\n\t\t\t\tvar styles=props.styles;\n\t\t\t\tfor(var s in styles){element.style[s]=styles[s];}\n\t\t\t\tbreak;\n\t\t\tcase 'events':\n\t\t\t\tvar events=props.events;\n\t\t\t\tfor(var e in events){ addHandler(element,e,events[e]); }\n\t\t\t\tbreak;\n\t\t\tcase 'class':\n\t\t\t\telement.className=props[k];break;\n\t\t\tdefault:\n\t\t\t\telement.setAttribute(k,props[k]);\n\t\t\t}\n\t\t}\n\t}\n\treturn element;\n}", "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var name = options.name,\n stylesOptions = (0, _objectWithoutProperties2.default)(options, [\"name\"]);\n\n if (\"development\" !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (\"development\" !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = (0, _utils.getDisplayName)(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style((0, _extends2.default)({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = (0, _makeStyles.default)(stylesOrCreator, (0, _extends2.default)({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = /*#__PURE__*/_react.default.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = (0, _objectWithoutProperties2.default)(props, [\"children\", \"className\", \"clone\", \"component\"]);\n var classes = useStyles(props);\n var className = (0, _clsx.default)(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return /*#__PURE__*/_react.default.cloneElement(children, (0, _extends2.default)({\n className: (0, _clsx.default)(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children((0, _extends2.default)({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return /*#__PURE__*/_react.default.createElement(FinalComponent, (0, _extends2.default)({\n ref: ref,\n className: className\n }, spread), children);\n });\n\n \"development\" !== \"production\" ? StyledComponent.propTypes = (0, _extends2.default)({\n /**\n * A render function or node.\n */\n children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),\n\n /**\n * @ignore\n */\n className: _propTypes.default.string,\n\n /**\n * If `true`, the component will recycle it's children HTML element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: (0, _utils.chainPropTypes)(_propTypes.default.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: _propTypes.default\n /* @typescript-to-proptypes-ignore */\n .elementType\n }, propTypes) : void 0;\n\n if (\"development\" !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n (0, _hoistNonReactStatics.default)(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "function createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n }\n\n if (hasValidKey(config)) {\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n }\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }", "render() {\n //There are three styles of setting styles. One is inline with double curly braces and another is putting\n //the style in a variable with curly braces and then using the the variable in style = {varName}\n //The last one is that with the function which can have different style for different conditions\n\n //To create custom functions for event, if you're using the normal function you'll need to bind the this to \n //the function because since the function is not part of the component class it can't access the this\n\n const { title, id } = this.props.todo;\n\n return (\n <div style={this.getStyle()} > \n <p>\n <input type=\"checkbox\" onChange={ this.props.markComplete.bind(this, id) }/> {' '}\n { title }\n <button onClick={ this.props.delTodo.bind(this, id) } style ={btnStyle}>x</button>\n </p>\n </div>\n );\n }", "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(options, [\"name\"]);\n\n if ( true && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if ( true && !name) {\n // Provide a better DX outside production.\n var displayName = Object(_material_ui_utils__WEBPACK_IMPORTED_MODULE_5__[\"getDisplayName\"])(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(_makeStyles__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(stylesOrCreator, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(classes.root, classNameProp);\n\n if (clone) {\n return react__WEBPACK_IMPORTED_MODULE_2___default.a.cloneElement(children, {\n className: Object(clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(children.props.className, className)\n });\n }\n\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (typeof children === 'function') {\n return children(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(FinalComponent, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n ref: ref,\n className: className\n }, spread), children);\n });\n true ? StyledComponent.propTypes = _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({\n /**\n * A render function or node.\n */\n children: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node, prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func]),\n\n /**\n * @ignore\n */\n className: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string,\n\n /**\n * If `true`, the component will recycle it's children DOM element.\n * It's using `React.cloneElement` internally.\n */\n clone: Object(_material_ui_utils__WEBPACK_IMPORTED_MODULE_5__[\"chainPropTypes\"])(prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component properties at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.elementType\n }, propTypes) : undefined;\n\n if (true) {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6___default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "function styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(options, [\"name\"]);\n\n if (\"development\" !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (true) {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = Object(_material_ui_utils__WEBPACK_IMPORTED_MODULE_5__[\"getDisplayName\"])(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = Object(_makeStyles__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(stylesOrCreator, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = Object(clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(classes.root, classNameProp);\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (clone) {\n return react__WEBPACK_IMPORTED_MODULE_2___default.a.cloneElement(children, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n className: Object(clsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(children.props.className, className)\n }, spread));\n }\n\n if (typeof children === 'function') {\n return children(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(FinalComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n ref: ref,\n className: className\n }, spread), children);\n });\n true ? StyledComponent.propTypes = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n /**\n * A render function or node.\n */\n children: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.node, prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.func]),\n\n /**\n * @ignore\n */\n className: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string,\n\n /**\n * If `true`, the component will recycle it's children DOM element.\n * It's using `React.cloneElement` internally.\n *\n * This prop will be deprecated and removed in v5\n */\n clone: Object(_material_ui_utils__WEBPACK_IMPORTED_MODULE_5__[\"chainPropTypes\"])(prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.elementType\n }, propTypes) : undefined;\n\n if (true) {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_6___default()(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}", "function ReactDOMComponent(tag) {\n validateDangerousTag(tag);\n this._tag = tag.toLowerCase();\n this._renderedChildren = null;\n this._previousStyle = null;\n this._previousStyleCopy = null;\n this._rootNodeID = null;\n this._wrapperState = null;\n this._topLevelWrapper = null;\n this._nodeWithLegacyProperties = null;\n if (\"development\" !== 'production') {\n this._unprocessedContextDev = null;\n this._processedContextDev = null;\n }\n}", "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}", "function ReactDOMComponent(tag) {\n\t validateDangerousTag(tag);\n\t this._tag = tag.toLowerCase();\n\t this._renderedChildren = null;\n\t this._previousStyle = null;\n\t this._previousStyleCopy = null;\n\t this._rootNodeID = null;\n\t this._wrapperState = null;\n\t this._topLevelWrapper = null;\n\t this._nodeWithLegacyProperties = null;\n\t if (process.env.NODE_ENV !== 'production') {\n\t this._unprocessedContextDev = null;\n\t this._processedContextDev = null;\n\t }\n\t}" ]
[ "0.5344124", "0.5321388", "0.5321388", "0.5321388", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5305959", "0.5287716", "0.52854335", "0.5281515", "0.5274011", "0.52727693", "0.527235", "0.527235", "0.527235", "0.527235", "0.527235", "0.52681446", "0.5255468", "0.5230599", "0.5217403", "0.52132535", "0.52132535", "0.52132535", "0.52132535", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.52108526", "0.5208586", "0.5203982", "0.5199755", "0.51850855", "0.51826376", "0.51826376", "0.51826376", "0.51826376", "0.51826376", "0.51826376", "0.51826376", "0.51826376", "0.51826376", "0.51826376", "0.51826376", "0.51826376", "0.5171312", "0.51672083", "0.51597637", "0.5154536", "0.51458246", "0.51438755", "0.5106178", "0.5104736", "0.5103146", "0.50973225", "0.50932384", "0.50932384", "0.50932384", "0.50932384", "0.50932384", "0.50932384" ]
0.0
-1
Processes any enqueued updates.
function processQueue() { if (updateQueue.length) { ReactComponentEnvironment.processChildrenUpdates( updateQueue, markupQueue ); clearQueue(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleUpdates(){\n\t\t//put per update scripts here\n\t\tconsole.log('update');\n\t}", "function processUpdate() {\n _nextUpdateHandle = null;\n\n var interactionCount = _interactionSet.size;\n _addInteractionSet.forEach(handle =>\n _interactionSet.add(handle)\n );\n _deleteInteractionSet.forEach(handle =>\n _interactionSet.delete(handle)\n );\n var nextInteractionCount = _interactionSet.size;\n\n if (interactionCount !== 0 && nextInteractionCount === 0) {\n // transition from 1+ --> 0 interactions\n _emitter.emit(InteractionManager.Events.interactionComplete);\n } else if (interactionCount === 0 && nextInteractionCount !== 0) {\n // transition from 0 --> 1+ interactions\n _emitter.emit(InteractionManager.Events.interactionStart);\n }\n\n // process the queue regardless of a transition\n if (nextInteractionCount === 0) {\n var queue = _queue;\n _queue = [];\n queue.forEach(callback => {\n ErrorUtils.applyWithGuard(callback);\n });\n }\n\n _addInteractionSet.clear();\n _deleteInteractionSet.clear();\n}", "update() {\n /* istanbul ignore else */\n queueWatcher(this)\n }", "function processQueue(){\n\t\trequestAnimFrame(processQueue);\n\t\tvar now = Date.now();\n\t\twhile (msgQueue.length > 0 && msgQueue[0].timetag < now){\n\t\t\tvar first = msgQueue.shift();\n\t\t\tif (first.address === \"_set\"){\n\t\t\t\tfirst.data();\n\t\t\t} else {\n\t\t\t\t_send(first);\n\t\t\t}\n\t\t}\n\t\t//send an update message to all the listeners\n\t\tupdateMessage.data = now - lastUpdate;\n\t\t_send(updateMessage);\n\t\tlastUpdate = now;\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t\t if (updateQueue.length) {\n\t\t ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n\t\t clearQueue();\n\t\t }\n\t\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n\t updateQueue,\n\t markupQueue\n\t );\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n\t if (updateQueue.length) {\n\t ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n\t updateQueue,\n\t markupQueue\n\t );\n\t clearQueue();\n\t }\n\t}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function _dispatchUpdateCallbacks(){\n App.broadcast(ON_UPDATE_EVENT,App.Modules.GPS);\n }", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(\n updateQueue,\n markupQueue\n );\n clearQueue();\n }\n}", "runUpdate() {\n this.utils.log(\"\");\n this.utils.log(\"******************* Running update ******************* \");\n this.utils.log(\"\");\n\n // Reset update flags\n this.updateTweets = false;\n this.updateStatus = false;\n\n // Process any new tweets before performing other operations\n this.checkTrackedTweets().then(() => {\n // Process any mentions\n this.checkMentions().then(() => {\n // Save the status file if needed\n if (this.updateTweets || this.updateStatus) {\n this.dataHandler.saveStatus(this.botStatus);\n }\n });\n\n // Post a normal tweet\n this.actionHandler.postTweet(this.generator.generateResponse());\n\n });\n }", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processQueue() {\n if (updateQueue.length) {\n ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);\n clearQueue();\n }\n}", "function processNextUpdateRequest() {\n if(vis_queue.length > 0) {\n let temp = vis_queue.pop();\n update(temp.svg, temp.pack, temp.path, temp.id, temp.cb_keyword);\n } else {\n hook_busy = false;\n }\n}", "processQueue () {\n var isEmpty = !unwrap(this.data).length;\n var lowestIndexChanged = MAX_LIST_SIZE;\n\n this.startQueueFlush();\n\n arrayForEach(this.changeQueue, (changeItem) => {\n if (typeof changeItem.index === 'number') {\n lowestIndexChanged = Math.min(lowestIndexChanged, changeItem.index);\n }\n this[changeItem.status](changeItem);\n });\n this.flushPendingDeletes();\n this.rendering_queued = false;\n\n // Update our indexes.\n if (this.$indexHasBeenRequested) {\n this.updateIndexes(lowestIndexChanged);\n }\n\n this.endQueueFlush();\n this.changeQueue = [];\n\n // Update the conditional exposed on the domData\n if (isEmpty !== !this.isNotEmpty()) {\n this.isNotEmpty(!isEmpty);\n }\n }", "function post_updates()\n{\n\t// Do nothing if we are offline.\n\tif(! navigator.onLine)\n\t{\n\t\treturn false;\n\t}\n\t\t\n\t// Loop through the different stores.\n\tvar found = false;\n\t \t\n\tfor(var i in site.config.indexeddb.stores)\n\t{\n\t\tmodels[site.config.indexeddb.stores[i]].query(function (data) {\n\t\t\tvar total = parseInt(data.length);\n\t\t\n\t\t\tif(data.length)\n\t\t\t{\n\t\t\t\tfound = true;\n\t\t\t}\n\t\t\n\t\t\tfor(var r in data)\n\t\t\t{\t\t\t\t\n\t\t\t\tsite.sync[site.config.indexeddb.stores[i]].update(data[r], data[r].FilesId, function (json) {\n\t\t\t\t\ttotal--;\n\t\t\t\t\t\n\t\t\t\t\t// Have we processed everything? If so do a full sync with our server.\n\t\t\t\t\tif((total <= 0) && ((i + 1) == site.config.indexeddb.stores.length))\n\t\t\t\t\t{\n\t\t\t\t\t\tget_files_data();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}, \n\t\t{\n\t\t\tindex: 'State',\n\t\t\tkeyRange: models[site.config.indexeddb.stores[i]].makeKeyRange({ only: 'updated' })\n\t\t});\n\t}\n\t\n\t// If there was nothing to update.\n\tif(! found)\n\t{\n\t\tget_files_data();\n\t}\n}", "function processQueue(inst, updateQueue) {\n\t\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t\t}", "function processQueue(inst, updateQueue) {\n\t\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t\t}", "function processQueue(){if(updateQueue.length){ReactComponentEnvironment.processChildrenUpdates(updateQueue,markupQueue);clearQueue();}}", "function processQueue(){if(updateQueue.length){ReactComponentEnvironment.processChildrenUpdates(updateQueue,markupQueue);clearQueue();}}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}", "function processQueue(inst, updateQueue) {\n\t ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);\n\t}" ]
[ "0.7014526", "0.689392", "0.6827723", "0.6666324", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.662469", "0.6623688", "0.6576949", "0.6576949", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.64748144", "0.6448448", "0.6437768", "0.6437768", "0.6437768", "0.6437768", "0.6437768", "0.6437768", "0.6437768", "0.6437768", "0.6437768", "0.6437768", "0.6437768", "0.6434618", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6428405", "0.6405574", "0.63922924", "0.63034135", "0.62554353", "0.62554353", "0.6204718", "0.6204718", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175", "0.6182175" ]
0.66279507
6
Clears any enqueued updates.
function clearQueue() { updateQueue.length = 0; markupQueue.length = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearQueue(){updateQueue.length = 0;markupQueue.length = 0;}", "function clearQueue(){updateQueue.length=0;markupQueue.length=0;}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n updateQueue.length = 0;\n markupQueue.length = 0;\n}", "function clearQueue() {\n\t\t updateQueue.length = 0;\n\t\t markupQueue.length = 0;\n\t\t}", "clear() {\n this.queue.length = 0;\n this.updateTaskRunning();\n }", "_handleRequestUpdateClear(options)\n {\n this._updater.clear();\n }", "clear() {\n debug.v('#clear()');\n\n this.removeAllListeners();\n Object.values(this._timerContainers).forEach(timers => timers.clear());\n\n this.size = 0;\n this._records = {};\n this._related = {};\n this._insertionTime = {};\n this._timerContainers = {};\n }", "clear() {\n this._cache = [];\n this._updated = false;\n }", "clear() {\n this.queue = [];\n }", "clear_queue() {\n this.queued.length = 0;\n }", "clear() {\n this.queue.clear();\n }", "clear() {\n this._unmarkAll();\n\n this._emitChangeEvent();\n }", "function clear() {\n appworks.notifications.clear();\n notifications = [];\n}", "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "clear() {\n this._subscriptions.splice(0, this._subscriptions.length);\n }", "clear() {\r\n this._subscriptions.splice(0, this._subscriptions.length);\r\n }", "function flushWatcherQueue () {\n flushing = true\n let watcher\n let id\n\n queue.sort((a, b) => a.id - b.id)\n\n for (index = 0; index < queue.length; index++) {\n watcher = queue[index]\n id = watcher.id\n has[id] = null\n watcher.run()\n // in dev build, check and stop circular updates.\n if (process.env.NODE_ENV !== 'production') {\n circular[id] = (circular[id] || 0) + 1\n if (circular[id] > MAX_UPDATE_COUNT) {\n console.error(\n `[MIP warn]:You may have an infinite update loop in watcher with expression \"${watcher.exp}\"`\n )\n break\n }\n }\n }\n\n resetState()\n}", "reset() {\n this._subscribers.clear();\n this._oncers.clear();\n }", "clear() {\n this.queries.length = 0;\n }", "clear() {\n this.queue = null;\n }", "function clear() {\n commandQueue = [];\n }", "clear() {\n debug('Clearing all previously stashed events.');\n this._eventsStash = [];\n }", "clear() {\n wasm.raweventqueue_clear(this.ptr);\n }", "function clearAll() {\n catQueue = new Queue();\n dogQueue = new Queue();\n userQueue = new Queue();\n }", "function flushChanges() {\n self.changes = [];\n }", "function flushChanges() {\n self.changes = [];\n }", "clear() {\n if (this.__timeout) {\n clearTimeout(this.__timeout);\n this.__timeout = null;\n }\n\n this.__schedEngines.length = 0;\n this.__schedTimes.length = 0;\n }", "clear() {\n this.processRecords();\n this.queue.length = 0;\n this.selectionChanged = false;\n }", "clear() {\n\t\tthis.cache.clear();\n\t\tthis.oldCache.clear();\n\t\tthis._size = 0;\n\t}", "function clear() {\n\t\t\t// summary:\n\t\t\t//\t\tThis method is called when the store associated with this Observer\n\t\t\t//\t\tis cleared.\n\t\t\t// tag:\n\t\t\t//\t\tPrivate\n\n\t\t\t// TODO:\n\t\t\t//\t\tShould we just destroy the Observer?. If so, how do we notify the\n\t\t\t//\t\tlisteners? -> trigger(view.slice(), Infinity, -1) maybe ???\n\n\t\t\tvar at = 0, object = view.shift();\n\n\t\t\twhile (object) {\n\t\t\t\tview.total--;\n\t\t\t\ttrigger(object, at++, -1);\n\t\t\t\tobject = view.shift();\n\t\t\t}\n\t\t\twhen(master, function (dataset) {\n\t\t\t\tdataset.revision = store.revision;\n\t\t\t\tdataset.length = 0;\n\t\t\t\tdataset.total = 0;\n\t\t\t});\n\t\t\t// Re-sync revision number.\n\t\t\trevision = store.revision;\n\t\t}", "clear() {\n this.notifications = [];\n }" ]
[ "0.7569423", "0.7565586", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7432019", "0.7310357", "0.69934195", "0.6977853", "0.6922389", "0.68992513", "0.68295825", "0.67933655", "0.67817205", "0.6732746", "0.67197144", "0.67008173", "0.67008173", "0.6675137", "0.66679597", "0.66598356", "0.6637592", "0.65576804", "0.65497786", "0.6549627", "0.65381914", "0.6524808", "0.65161103", "0.64863586", "0.64863586", "0.6465967", "0.64423656", "0.6406188", "0.63487625", "0.63241005" ]
0.736212
70
Opera <= 12 includes TextEvent in window, but does not fire text input events. Rely on keypress instead.
function isPresto() { var opera = window.opera; return ( typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onElementKeyPress(event) {}", "onElementKeyPress(event) {}", "keypress ( target, keyText ) {\n target.dispatchEvent(_keyboardEventFor('keypress', Editor.KeyCode(keyText)));\n }", "function l(){var n=this,r=window||t;o(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(t){n.isNativeEvent(t)&&e(t.target).trigger(\"input\")},misbehaves:function(t){n.isNativeEvent(t)&&(n.behavesOk(t),e(document).on(\"change.inputevent\",t.data.selector,n.fakeInputEvent),n.fakeInputEvent(t))},behavesOk:function(t){n.isNativeEvent(t)&&e(document).off(\"input.inputevent\",t.data.selector,n.behavesOk).off(\"change.inputevent\",t.data.selector,n.misbehaves)},install:function(){if(!r.inputEventPatched){r.inputEventPatched=\"0.0.3\";for(var t=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],i=0;i<t.length;i++){var a=t[i];e(document).on(\"input.inputevent\",a,{selector:a},n.behavesOk).on(\"change.inputevent\",a,{selector:a},n.misbehaves)}}},uninstall:function(){delete r.inputEventPatched,e(document).off(\".inputevent\")}})}", "typingEvent(event){\n\t if (event.keyCode !== 9 && event.keyCode !== 18) // TAB and ALT\n\t\t if (event.keyCode === 13){\n\t\t\t this.sendMessageAction();\n\t\t\t this.$.inputMessage.value = \"\";\n\t \t\t}\n\t \t\telse\n\t \t\t\tthis._setSendMessage({type:'TYPING'});\n\t \t\t\n }", "function inputText (e){\n\tconsole.log(\"here\");\n\treturn outputEvent.innerHTML = userInput;\n\n\t//var onKeyUp = function(e) {\n\t//var userInput = document.getElementById('keypress-input').value; \t\n}", "function onInput(){\n\t\n\tvar value = cliptext.value\n\t// we seem to have pressed backspace on android\t\n\tif(value.length === 4 && value === androidBackspace){\n\t\tcliptext.value = magicClip\n\t\tcliptext.selectionStart = defaultStart\n\t\tcliptext.selectionEnd = defaultEnd\n\t\tif(keyDownTriggered){\n\t\t\tkeyDownTriggered = false\n\t\t\tbus.postMessage({\n\t\t\t\tfn:'onKeyDown',\n\t\t\t\trepeat: 1,\n\t\t\t\tcode: 8\n\t\t\t})\n\t\t\tbus.postMessage({\n\t\t\t\tfn:'onKeyUp',\n\t\t\t\trepeat: 1,\n\t\t\t\tcode: 8\n\t\t\t})\n\t\t}\n\t\treturn\n\t}\n\t// Something changed from our clipboard-set to now\n\tif(value !== lastClipboard){\n\t\tlastClipboard = ''\n\t\tcliptext.value = magicClip\n\t\tlastStart = cliptext.selectionStart = defaultStart\n\t\tlastEnd = cliptext.selectionEnd = defaultEnd\n\t\t// special character accent popup \n\t\tif(defaultStart === 3 && value.charCodeAt(2) !== magicClip.charCodeAt(1)){\n\t\t\tbus.postMessage({\n\t\t\t\tfn:'onKeyPress',\n\t\t\t\tchar:value.charCodeAt(2),\n\t\t\t\tspecial:1,\n\t\t\t\trepeat: 1\n\t\t\t})\n\t\t}\n\t\t// the main keypress entry including multiple characters\n\t\t// like swipe android keyboards \n\t\telse for(var i = 0, len = value.length - 2 - defaultStart; i < len; i++){\n\t\t\tvar charcode = value.charCodeAt(i + defaultStart)\n\n\t\t\tvar msg = {\n\t\t\t\tfn:'onKeyPress',\n\t\t\t\tchar:charcode,\n\t\t\t\trepeat: 1\n\t\t\t}\n\t\t\t// if we are more than one character let the otherside know\n\t\t\t// about this (for instance for undo handling)\n\t\t\tif(len>1){\n\t\t\t\tmsg.groupIndex = i\n\t\t\t\tmsg.groupLen = len\n\t\t\t}\n\t\t\t// ignore newlines and magicClip values\n\t\t\tif(charcode !== 10 && charcode !== magicClip.charCodeAt(1)) bus.postMessage(msg)\n\t\t}\n\t}\n}", "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function n(){var t=this,i=window||global;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger(\"input\")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on(\"change.inputevent\",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off(\"input.inputevent\",i.data.selector,t.behavesOk).off(\"change.inputevent\",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched=\"0.0.3\";for(var n=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<n.length;r++){var s=n[r];e(document).on(\"input.inputevent\",s,{selector:s},t.behavesOk).on(\"change.inputevent\",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(\".inputevent\")}})}", "function sendRealKeyboardEvent() {\r\n page.sendEvent('keypress', page.event.key.Space);\r\n page.sendEvent('keypress', page.event.key.Backspace);\r\n}", "function BOT_chatboxOnKeypress(obj,evt) {\r\n\t\tif(BOT_theNavigator == null) return;\r\n\t\tvar s = obj.value; \r\n\t\tif(BOT_theNavigator == \"IE\" && evt.keyCode == 13) {\r\n\t\t\tevt.keyCode = null;\r\n\t\t\tBOT_chatboxMainProcess(s);\r\n\t\t\tBOT_agentSpeech(); \r\n\t\t\t}\r\n\t\tif(BOT_theNavigator == \"NN\" && evt.which == 13) {\r\n\t\t\tBOT_chatboxMainProcess(s);\r\n\t\t\tBOT_agentSpeech(); \r\n\t\t\t}\r\n}", "function i(){var t=this,n=window||s;e.extend(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(n){t.isNativeEvent(n)&&e(n.target).trigger(\"input\")},misbehaves:function(n){t.isNativeEvent(n)&&(t.behavesOk(n),e(document).on(\"change.inputevent\",n.data.selector,t.fakeInputEvent),t.fakeInputEvent(n))},behavesOk:function(n){t.isNativeEvent(n)&&e(document).off(\"input.inputevent\",n.data.selector,t.behavesOk).off(\"change.inputevent\",n.data.selector,t.misbehaves)},install:function(){if(!n.inputEventPatched){n.inputEventPatched=\"0.0.3\";for(var i=[\"select\",'input[type=\"checkbox\"]','input[type=\"radio\"]','input[type=\"file\"]'],r=0;r<i.length;r++){var o=i[r];e(document).on(\"input.inputevent\",o,{selector:o},t.behavesOk).on(\"change.inputevent\",o,{selector:o},t.misbehaves)}}},uninstall:function(){delete n.inputEventPatched,e(document).off(\".inputevent\")}})}", "_textBoxKeyDownHandler(event) {\n const that = this,\n key = event.key;\n\n if (that._scrollView) {\n that._handleScrollbarsDisplay();\n }\n\n that._autoExpandUpdate();\n that.value && that.value.length > 0 ? that.$.addClass('has-value') : that.$.removeClass('has-value');\n\n if (['Enter', 'Escape'].indexOf(key) === -1) {\n that._preventProgramaticValueChange = true;\n }\n\n if (['ArrowLeft', 'ArrowUp', 'ArrowDown', 'ArrowRight'].indexOf(key) > -1) {\n that._scrollView.scrollTo(that.$.input.scrollTop);\n }\n\n if (['PageUp', 'PageDown'].indexOf(key) > -1 && JQX.Utilities.Core.Browser.Chrome) {\n if (event.key === 'PageUp') {\n that.$.input.setSelectionRange(0, 0);\n that.$.input.scrollTop = 0;\n }\n\n if (event.key === 'PageDown') {\n that.$.input.setSelectionRange(that.$.input.value.length, that.$.input.value.length);\n that.$.input.scrollTop = that._scrollView.verticalScrollBar.max;\n }\n\n event.preventDefault();\n }\n }", "function keyEventsIE() {\n\te = event;\n\te.which = e.keyCode;\n\tkeyEvents(e);\n}", "function Edit_KeyDown(event)\n{\n\t//switch the event key\n\tswitch (event.keyCode)\n\t{\n\t\tcase 0x0d://\"Enter\":\n\t\t\t//if this is multiline\n\t\t\tif (/textarea/gi.test(this.tagName))\n\t\t\t{\n\t\t\t\t//stop the propagation as this must be processed as a normal event (no action or error)\n\t\t\t\tBrowser_CancelBubbleOnly(event);\n\t\t\t}\n\t\t//fallthrough\n\t\tcase 0x26://\"Up\":\n\t\tcase 0x28://\"Down\":\n\t\tcase 0x10://\"Shift\":\n\t\tcase 0x11://\"Control\":\n\t\tcase 0x12://\"Alt\":\n\t\tcase 0x08://\"BACKSPACE\":\n\t\tcase 0x25://\"Left\":\n\t\tcase 0x27://\"Right\":\n\t\tcase 0x23://\"End\":\n\t\tcase 0x24://\"Home\":\n\t\tcase 0x2e://\"Delete\":\n\t\t\t//dont process anything here\n\t\t\treturn;\n\t}\n\t//get the html\n\tvar theHTML = Get_HTMLObject(Browser_GetEventSourceElement(event));\n\t//valid?\n\tif (theHTML)\n\t{\n\t\t//has space filled?\n\t\tvar spaceFilled = Get_Number(theHTML.InterpreterObject.Properties[__NEMESIS_PROPERTY_SPACEFILLED], null);\n\t\t//valid?\n\t\tif (spaceFilled != null)\n\t\t{\n\t\t\t//helpers\n\t\t\tvar caret;\n\t\t\t//can we access selection start and end?\n\t\t\tif (typeof theHTML.selectionStart == \"number\" && typeof theHTML.selectionEnd == \"number\")\n\t\t\t{\n\t\t\t\t//no selection?\n\t\t\t\tif (theHTML.selectionStart == theHTML.selectionEnd)\n\t\t\t\t{\n\t\t\t\t\t//are we in Edge?\n\t\t\t\t\tif (__BROWSER_EDGE)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get caret position\n\t\t\t\t\t\tcaret = theHTML.selectionStart;\n\t\t\t\t\t\t//edge is getting confused here, lets just delete the character in front of us\n\t\t\t\t\t\ttheHTML.value = theHTML.value.substr(0, theHTML.selectionStart) + theHTML.value.substr(theHTML.selectionStart + 1);\n\t\t\t\t\t\t//reset caret\n\t\t\t\t\t\ttheHTML.selectionStart = caret;\n\t\t\t\t\t\ttheHTML.selectionEnd = theHTML.selectionStart;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//get caret position\n\t\t\t\t\t\tcaret = theHTML.selectionStart;\n\t\t\t\t\t\t//reset caret\n\t\t\t\t\t\ttheHTML.selectionStart = caret;\n\t\t\t\t\t\ttheHTML.selectionEnd = caret + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//we have document selection?\n\t\t\telse if (document.selection)\n\t\t\t{\n\t\t\t\t//get its text range\n\t\t\t\tvar textRange = document.selection.createRange();\n\t\t\t\t//no selection?\n\t\t\t\tif (textRange.text.length == 0)\n\t\t\t\t{\n\t\t\t\t\t// Move selection one step forward\n\t\t\t\t\ttextRange.moveEnd(\"character\", 1);\n\t\t\t\t\t//select it\n\t\t\t\t\ttextRange.select();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "keypressInput(e) {\n // console.log(e);\n let keycode = event.key; // also for cross-browser compatible\n (this.acceptMoves) && this.ea.publish('keyPressed', keycode);\n }", "onElementKeyUp(event) {}", "onElementKeyUp(event) {}", "handleTextChange(e) {}", "function keyPressHandler(event)\n\t{\n\t\t// Make sure it's not the same event firing over and over again\n\t\tif (keyPressEvent == event) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tkeyPressEvent = event;\n\t\t}\n\n\t\t// Get character that was typed\n\t\tvar charCode = event.which;\n\t\tif (charCode == KEYCODE_RETURN)\t// If return, clear and get out\n\t\t{\n\t\t\tclearTypingBuffer();\n\t\t\tclearTypingTimer();\n\t\t\treturn;\n\t\t}\n\n\t\t// Clear timer if still running, and start it again\n\t\tclearTypingTimer();\n\t\ttypingTimer = setTimeout(clearTypingBuffer, typingTimeout);\n\n\t\t// Add new character to typing buffer\n\t\tvar char = String.fromCharCode(charCode);\n\t\ttypingBuffer.push(char);\n\n\t\t// Check typed text for shortcuts\n\t\tcheckShortcuts(char, typingBuffer, event.target);\n\t}", "function FnnTextboxKeyHandler(objEvent)\n\t{\n\t\t// keyCode 37 is the left key\n\t\tif (objEvent.shiftKey && objEvent.keyCode == 37)\n\t\t{\n\t\t\t// The user is trying to select text by pressing shift-left\n\t\t\t// Jog the cursor left one character\n\t\t\tobjEvent.target.selectionEnd = objEvent.target.selectionStart = objEvent.target.selectionStart -1;\n\t\t\tobjEvent.preventDefault();\n\t\t}\n\t\telse if (objEvent.ctrlKey || objEvent.keyCode == 45)\n\t\t{\n\t\t\tobjEvent.preventDefault();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "function g(e, t, n) {\n if (\"topSelectionChange\" === e || \"topKeyUp\" === e || \"topKeyDown\" === e) // On the selectionchange event, the target is just document which isn't\n // helpful for us so just check activeElement instead.\n //\n // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire\n // propertychange on the first input event after setting `value` from a\n // script and fires only keydown, keypress, keyup. Catching keyup usually\n // gets it and catching keydown lets us fire an event for the first\n // keystroke if user does a key repeat (it'll be a little delayed: right\n // before the second keystroke). Other input methods (e.g., paste) seem to\n // fire selectionchange normally.\n return l(P, n);\n }", "simulateKeyboardText(text) {\n for (let ch of text) {\n if (ch === \"\\n\" || ch === \"\\r\") {\n ch = \"Enter\";\n }\n this.keyEvent(ch, true);\n this.keyEvent(ch, false);\n }\n }", "function cust_KeyDown(evnt) {\n //f_log(evnt.keyCode)\n}", "handlePCInputKeyDown(ev){\n EventUtils.filterNumericInput(ev)\n }", "function InputEvent() {\n var _this13 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n $.extend(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this13.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this13.isNativeEvent(evt)) {\n _this13.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this13.fakeInputEvent);\n _this13.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this13.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this13.behavesOk).off('change.inputevent', evt.data.selector, _this13.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this13.behavesOk).on('change.inputevent', selector, { selector: selector }, _this13.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "function typeEmptyChar(element) {\n var textEvent = document.createEvent('TextEvent'); \n textEvent.initTextEvent('textInput', true, true, window, EMPTY_CHAR);;\n element.dispatchEvent(textEvent); \n}", "function Simulator_ProcessOnKeyUp(event)\n{\n\t//user blocking and has designer?\n\tif (__SIMULATOR.UserInteractionBlocked() && __DESIGNER_CONTROLLER)\n\t{\n\t\t//direct forward and immediate return\n\t\treturn __DESIGNER_CONTROLLER.ProcessKeyUp(event.keyCode, event.ctrlKey, event.altKey, event.shiftKey, event);\n\t}\n\t//we only handle this if the window key was held down\n\tvar bHandle = window.__BROWSER_WINDOW_DOWN;\n\t//return value\n\tvar bReturn;\n\t//check the keycode first\n\tswitch (event.keyCode)\n\t{\n\t\t//escape pressed\n\t\tcase 0x1b:\n\t\t\t//are we in qa?\n\t\t\tif (__QA_ON)\n\t\t\t{\n\t\t\t\t//fire the end QA event\n\t\t\t\tQA_NotifyEscape();\n\t\t\t\t//always block\n\t\t\t\tBrowser_BlockEvent(event);\n\t\t\t\t//dont handle this\n\t\t\t\tbHandle = false;\n\t\t\t\t//return false\n\t\t\t\tbReturn = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x10: //Shift\n\t\t\t//dont handle this on normal actions\n\t\t\tbHandle = false;\n\t\t\t//release the button\n\t\t\twindow.__BROWSER_SHIFT_DOWN = false;\n\t\t\t//inform the Simulator that we just trigger the close all mini event\n\t\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_SHIFT_UP, Get_HTMLObject(Browser_GetEventSourceElement(event)));\n\t\t\tbreak;\n\t\tcase 0x11: //Control\n\t\t\t//dont handle this on normal actions\n\t\t\tbHandle = false;\n\t\t\t//release the button\n\t\t\twindow.__BROWSER_CTRL_DOWN = false;\n\t\t\t//inform the Simulator that we just trigger the close all mini event\n\t\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_CTRL_UP, Get_HTMLObject(Browser_GetEventSourceElement(event)));\n\t\t\tbreak;\n\t\tcase 0x12: //Alt\n\t\t\t//dont handle this on normal actions\n\t\t\tbHandle = false;\n\t\t\t//release the button\n\t\t\twindow.__BROWSER_ALT_DOWN = false;\n\t\t\t//inform the Simulator that we just trigger the close all mini event\n\t\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_ALT_UP, Get_HTMLObject(Browser_GetEventSourceElement(event)));\n\t\t\tbreak;\n\t\tcase 0x5b: //LWin\n\t\tcase 0x5c: //RWin\n\t\t\t//dont handle this\n\t\t\tbHandle = false;\n\t\t\t//Set window down as false\n\t\t\twindow.__BROWSER_WINDOW_DOWN = false;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//in block mode? or in camera mode\n\t\t\tif (__SIMULATOR.UserInteractionBlocked() || __SIMULATOR.Camera && __SIMULATOR.Camera.bInProgress && !__QA_ON)\n\t\t\t{\n\t\t\t\t//always block\n\t\t\t\tBrowser_BlockEvent(event);\n\t\t\t\t//dont handle this\n\t\t\t\tbHandle = false;\n\t\t\t\t//return false\n\t\t\t\tbReturn = false;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\t//handle this?\n\tif (bHandle)\n\t{\n\t\t//forward to handle key event\n\t\tbReturn = Simulator_ProcessKeyEvent(event);\n\t}\n\t//return\n\treturn bReturn;\n}", "function search_keypress(evt) {\n}", "function txt_filter_onkeypress(btn_filter,evt){\n if (IE()){\n theKey=window.event.keyCode\n } else {\n theKey=evt.which;\n }\n if(theKey == 13){\n btn_filter.click();\n return;\n }\n}", "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "function keyUpHandler(e){\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "keyupHandler(event) {\n window.addEventListener('keydown', this.keydown);\n }", "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "function keyUpHandler(e){\r\n if(isWindowFocused){ //the keyup gets fired on new tab ctrl + t in Firefox\r\n controlPressed = e.ctrlKey;\r\n }\r\n }", "function onKeyDown(e) {\n // do not handle key events when not in input mode\n if (!imode) {\n return;\n }\n\n // only handle special keys here\n specialKey(e);\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}", "function eventcheck(event) {\n if (!event)\n return;\n try {\n var obj = event.target;\n if (obj.mozIsTextField) {\n if (event.keyCode == 9 || event.keyCode == 13) {\n if (obj.id == gtGrdObj(event.target.parentNode).editCtrl) {\n event.preventDefault(true);\n event.stopPropagation();\n }\n else if (obj.value == \"\" && getIAttribute(event.target.nextSibling, \"q\") == \"t\") {\n event.preventDefault(true);\n event.stopPropagation();\n }\n }\n }\n }\n catch (ex) { }\n}", "function jsf_SoloNumero(event){\n\tevent = (event) ? event : ((window.event) ? window.event : \"\");\n\tif(event.keyCode<48 || event.keyCode>57){\n\t\tevent.returnValue = false\n\t}\n}", "function triggerKeydown(keycode){\ntriggerEvent(document,'keydown',keycode);\n}", "function keyUpHandler(e) {\n if (isWindowFocused) { //the keyup gets fired on new tab ctrl + t in Firefox\n controlPressed = e.ctrlKey;\n }\n }", "function setKeyPressEventForCharInput(i, numCharInputs, spaceIndices, testType, placeHolderString, isPhrase, chosenExampleOccurrenceIgnoredIndexes,\n\t\tshowSpeakerIcon) {\n\tvar prevNonDisabled = findFirstNonDisabledLetterBefore(i);\n\tvar nextNonDisabled = findFirstNonDisabledLetterAfter(i);\n\n\t$(\"#char-input-\" + i.toString()).unbind();\n\n\t// according to the below URL,\n\t// Apple won't deliver the keypress/keydown event if the input field loses\n\t// focus while the keypress/keydown event is being fired.\n\t// http://support.apple.com/kb/ht4334 (see\n\t// CVE-ID: CVE-2010-1422)\n\n\t// so the goal here is to make sure that the keypress/keydown event is fired\n\t// and yet we still want to maintain the focus in the text field (otherwise\n\t// the keyboard in iOS devices will keep going \"up\" and \"down\" as user moves\n\t// to the next input fields)\n\n\t// solution: borrow ideas from\n\t// http://www.gundersen.net/keep-ipadiphone-ios-keyboard-up-between-input-fields/\n\n\t$(\"#char-input-\" + i.toString()).bind('keypress', function(event) {\n\t\tvar prefix = 'char-input-';\n\t\tvar thisid = $(this).attr(\"id\");\n\t\tvar i = parseInt(thisid.substring(prefix.length,thisid.length));\n\n\t\t// leave tab and shift+tab to browser to handle (based\n\t\t// on tabindex attributes + also ignore space (which is later handled\n\t\t// in the keyup event)\n\t\tif (event.keyCode != 9 && event.which != 32) {\n\t\t\tswitch (event.keyCode) {\n\t\t\tcase 13: // enter key\n\t\t\t\tthis.blur();\n\t\t\t\tcheckTypedWord(spaceIndices, testType, placeHolderString, isPhrase, chosenExampleOccurrenceIgnoredIndexes,\n\t\t\t\t\t\tshowSpeakerIcon);\n\t\t\t\tbreak;\n\t\t\t// for other keys, simply move to next input field\n\t\t\tdefault:\n\t\t\t\t// ignore back space and arrow keys\n\t\t\t\tif (event.keyCode != 8 && event.keyCode != 37\n\t\t\t\t\t\t&& event.keyCode != 38\n\t\t\t\t\t\t&& event.keyCode != 39\n\t\t\t\t\t\t&& event.keyCode != 40) {\n\t\t\t\t\tvar keypressed = String.fromCharCode(event.which).toUpperCase();\n\t\t\t\t $(\"#char-input-\" + i.toString()).val(keypressed);\n\n\t\t\t\t var nextid = findFirstNonDisabledLetterAfter(i);\n\n\t\t\t\t if (nextid != -1 && nextid <= numCharInputs) {\n\t\t\t\t\t\tchangeInputField(i.toString(), nextid, i, numCharInputs, false);\n\t\t\t\t\t\tthis.select();\n\t\t\t\t\t}\n\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t});\n\n\t// for some reasons, using keypress is not effective for Chrome, so we have\n\t// to move some keys to keydown\n\t$(\"#char-input-\" + i.toString()).bind('keydown', function(event) {\n\t\tvar prefix = 'char-input-';\n\t\tvar thisid = $(this).attr(\"id\");\n\t\tvar i = parseInt(thisid.substring(prefix.length,thisid.length));\n\n\t\t// leave tab and shift+tab to browser to handle (based\n\t\t// on tabindex attributes + also ignore space (which is later handled\n\t\t// in the keyup event)\n\t\tif (event.keyCode != 9 && event.which != 32) {\n\t\t\tswitch (event.keyCode) {\n\t\t\tcase 8: // for backspace move to previous input field\n\t\t\t\tvar curVal = $(\"#char-input-\" + i.toString()).val();\n\n\t\t\t\tvar supportBackSpace;\n\n\t\t\t\t// if not android, always support backspace\n\t\t\t\tif (!isAndroidBrowser) {\n\t\t\t\t\tsupportBackSpace = true;\n\t\t\t\t} else {\n\t\t\t\t\t// if android, only support back space if current char input\n\t\t\t\t\t// field is empty, i.e., moving backwards from an empty\n\t\t\t\t\t// field. this is because there is a bug in Android: when\n\t\t\t\t\t// we set the value of an input field, pressing backspace\n\t\t\t\t\t// on that field will not fire any keydown/keypress event\n\t\t\t\t\t// for more details, see the comments in changeInputField\n\t\t\t\t\t// regarding the hack for Android\n\t\t\t\t\tsupportBackSpace = (curVal == '');\n\t\t\t\t}\n\n\t\t\t\tvar previd = findFirstNonDisabledLetterBefore(i);\n\t\t\t\t\n\t\t\t\tif (supportBackSpace) {\n\t\t\t\t\t// erase the current value\n\t\t\t\t\t$(\"#char-input-\" + i.toString()).val('');\n\n\t\t\t\t\tif (previd != -1 && previd >= 1) {\n\t\t\t\t\t\t// var temp_val = $(\"#char-input-\" + previd.toString()).val();\n\n\t\t\t\t\t\tchangeInputField(i.toString(),previd, i, numCharInputs,\n\t\t\t\t\t\t\t true);\n\n\t\t\t\t\t\t// var e = jQuery.Event(\"keypress\");\n\t\t\t\t\t\t// e.which = String.charCodeAt(0);\n\t\t\t\t\t\t// $(\"#char-input-\" + previd).trigger(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.select();\n\t\t\t\tbreak;\n\t\t\tcase 37: // for left arrow move to previous input field\n\t\t\t\tvar previd = findFirstNonDisabledLetterBefore(i);\n\n\t\t\t\tif (previd != -1 && previd >= 1) {\n\t\t\t\t\tchangeInputField(i.toString(),previd, i, numCharInputs,\n\t\t\t\t\t\t false);\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.select();\n\t\t\t\tbreak;\n\t\t\tcase 39: // for right arrow move to next input field\n\t\t\t\tvar nextid = findFirstNonDisabledLetterAfter(i);\n\n\t\t\t\tif (nextid != -1 && nextid <= numCharInputs) {\n\t\t\t\t\tchangeInputField(i.toString(),nextid, i, numCharInputs,\n\t\t\t\t\t\t false);\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tthis.select();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t});\n\n\t// in bindShorcuts() we use keyup for space so here we also use keyup for\n\t// space\n\t$(\"#char-input-\" + i.toString()).bind('keyup', 'space', function() {\n\t\tspaceButtonKeyUp();\n\t});\n}", "_textBoxKeyDownHandler(event) {\n const that = this,\n key = event.key,\n ctrlPressed = event.ctrlKey,\n //shiftPressed = event.shiftKey,\n ctrlHandledKeys = ['a', 'c', 'v', 'x'],\n selectionEnd = that.$.input.selectionEnd,\n asciiRegExpString = 'xxx[\\x00-\\x7F]+xxx',\n asciiRegExp = new RegExp(asciiRegExpString),\n allSupportedKeyboardCharacters = /^[a-zA-ZÀ-ÿа-яА-Я0-9.!@?#\"$%&:';()*\\+,\\/;\\-=[\\\\\\]\\^_{|}<>~` ]+$/;\n\n let selectionStart = that.$.input.selectionStart;\n\n\n\n if (ctrlPressed && (ctrlHandledKeys.indexOf(key) > -1)) {\n const performClipboard = function (command, callback) {\n const textArea = document.createElement('textarea');\n\n textArea.style.position = 'absolute';\n textArea.style.left = '-1000px';\n textArea.style.top = '-1000px';\n\n document.body.appendChild(textArea);\n textArea.focus();\n if (command === 'Paste') {\n setTimeout(function () {\n let value = textArea.value;\n\n if (value.length === 0 && window.clipboardData) {\n // pasteFrom.value = window.clipboardData.getData('Text');\n textArea.value = window.clipboardData.getData('Text');\n\n value = textArea.value;\n }\n\n textArea.parentNode.removeChild(textArea);\n that.$.input.focus();\n callback(value);\n }, 25);\n }\n else {\n textArea.value = that._cutCopyHandler(null, command);\n textArea.focus();\n textArea.setSelectionRange(0, textArea.value.length);\n setTimeout(function () {\n document.designMode = 'off';\n textArea.focus();\n textArea.parentNode.removeChild(textArea);\n that.$.input.focus();\n }, 25);\n\n if (window.clipboardData) {\n window.clipboardData.setData('Text', textArea.value);\n }\n }\n };\n\n switch (key) {\n case 'a':\n that.$.input.setSelectionRange(0, that.$.input.value.length);\n break;\n case 'c':\n performClipboard('Copy');\n break;\n case 'v':\n performClipboard('Paste', function (text) {\n const context = that.context;\n\n that.context = that;\n that._textBoxPasteHandler(null, text)\n that.context = context;\n });\n break;\n case 'x':\n performClipboard('Cut');\n break;\n }\n\n return;\n }\n\n if (key === 'Backspace') {\n that._deleteHandler(event);\n that._updateMaskFullAndCompleted();\n return;\n }\n\n\n if (key === 'Delete') {\n that._deleteHandler(event);\n that._updateMaskFullAndCompleted();\n return;\n }\n\n if (!that.allowPromptAsInput && (key === that.promptChar)) {\n that._preventDefault(event);\n return;\n }\n\n if (that.disabled || that.readonly || (that.asciiOnly && !asciiRegExp.test(key)) || (!allSupportedKeyboardCharacters.test(key) || key.length > 1)) {\n return;\n }\n\n that._preventDefault(event);\n\n if (selectionStart === selectionEnd && selectionStart === that.$.input.value.length) {\n return;\n }\n\n if (key === ' ' && !that.resetOnSpace) {\n return;\n }\n\n selectionStart = that._getEditableSelectionStart(selectionStart, key);\n\n const nonEditableKeyHandler = function () {\n selectionStart = that._getNonEditableSelectionStart(that.$.input.selectionStart, key);\n if (selectionStart !== -1) {\n that.$.input.selectionStart = that.$.input.selectionEnd = selectionStart + 1;\n }\n }\n\n if (selectionStart === -1) {\n nonEditableKeyHandler();\n return;\n }\n\n const isChanged = that._setCharAtPosition(key, selectionStart);\n\n if (isChanged) {\n that._setMaskToInput();\n that._updateMaskFullAndCompleted();\n that.$.input.selectionStart = that.$.input.selectionEnd = selectionStart + 1;\n }\n else {\n nonEditableKeyHandler();\n }\n }", "function ckeFocusEvent(event) {\n\tvar editor = event.editor;\n\tvar $textarea = $(editor.element.$);\n\t$textarea.trigger('pw-focus');\n}", "function onKeyPress(e) {\n var code = 'which' in e ? e.which : e.keyCode;\n\n // do not handle key presses if not in input mode\n if (!imode) {\n return;\n }\n\n // code should be zero if non-printing; filter out <enter> since it is\n // non-printing for our application\n if (code != 0 && code != KEYCODES.ENTER) {\n // insert character it into the input line text variable and also\n // update the span's elements for display\n var before = itext.substr(0,ipos) + String.fromCharCode(code); // insert before cursor\n var after = itext.substr(ipos,itext.length - ipos);\n itext = before + after;\n ispanBefore.data = before;\n ispanAfter.data = after.substr(1); // skip cursor character\n ipos += 1;\n }\n }", "function UnbTextKeydownHandler(where)\r\n{\r\n\tif (!window.event) return true;\r\n\tvar keycode = window.event.keyCode;\r\n\r\n\tif (keycode == 9)\r\n\t{\r\n\t\tif (document.selection.createRange().duplicate().text.length)\r\n\t\t{\r\n\t\t\tif (!window.event.shiftKey)\r\n\t\t\t{\r\n\t\t\t\tdocument.selection.createRange().duplicate().text =\r\n\t\t\t\t\t\"\\t\" +\r\n\t\t\t\t\tdocument.selection.createRange().duplicate().text.replace(/\\n/g, \"\\n\\t\") +\r\n\t\t\t\t\t\"\\n\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.selection.createRange().duplicate().text =\r\n\t\t\t\t\tdocument.selection.createRange().duplicate().text.replace(/\\n\\t/g, \"\\n\");\r\n\t\t\t\tdocument.selection.createRange().duplicate().text =\r\n\t\t\t\t\tdocument.selection.createRange().duplicate().text.replace(/^\\t/g, \"\") +\r\n\t\t\t\t\t\"\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (!window.event.shiftKey)\r\n\t\t\t{\r\n\t\t\t\tUnbInsertText(\"\\t\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n}", "function getFallbackBeforeInputChars(domEventName,nativeEvent){// If we are currently composing (IME) and using a fallback to do so,\n// try to extract the composed characters from the fallback object.\n// If composition event is available, we extract a string only at\n// compositionevent, otherwise extract it at fallback events.\nif(isComposing){if(domEventName==='compositionend'||!canUseCompositionEvent&&isFallbackCompositionEnd(domEventName,nativeEvent)){var chars=getData();reset();isComposing=false;return chars;}return null;}switch(domEventName){case'paste':// If a paste event occurs after a keypress, throw out the input\n// chars. Paste events should not lead to BeforeInput events.\nreturn null;case'keypress':/**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */if(!isKeypressCommand(nativeEvent)){// IE fires the `keypress` event when a user types an emoji via\n// Touch keyboard of Windows. In such a case, the `char` property\n// holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n// is 2, the property `which` does not represent an emoji correctly.\n// In such a case, we directly return the `char` property instead of\n// using `which`.\nif(nativeEvent.char&&nativeEvent.char.length>1){return nativeEvent.char;}else if(nativeEvent.which){return String.fromCharCode(nativeEvent.which);}}return null;case'compositionend':return useFallbackCompositionData&&!isUsingKoreanIME(nativeEvent)?null:nativeEvent.data;default:return null;}}", "function getFallbackBeforeInputChars(domEventName,nativeEvent){// If we are currently composing (IME) and using a fallback to do so,\n// try to extract the composed characters from the fallback object.\n// If composition event is available, we extract a string only at\n// compositionevent, otherwise extract it at fallback events.\nif(isComposing){if(domEventName==='compositionend'||!canUseCompositionEvent&&isFallbackCompositionEnd(domEventName,nativeEvent)){var chars=getData();reset();isComposing=false;return chars;}return null;}switch(domEventName){case'paste':// If a paste event occurs after a keypress, throw out the input\n// chars. Paste events should not lead to BeforeInput events.\nreturn null;case'keypress':/**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */if(!isKeypressCommand(nativeEvent)){// IE fires the `keypress` event when a user types an emoji via\n// Touch keyboard of Windows. In such a case, the `char` property\n// holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n// is 2, the property `which` does not represent an emoji correctly.\n// In such a case, we directly return the `char` property instead of\n// using `which`.\nif(nativeEvent.char&&nativeEvent.char.length>1){return nativeEvent.char;}else if(nativeEvent.which){return String.fromCharCode(nativeEvent.which);}}return null;case'compositionend':return useFallbackCompositionData&&!isUsingKoreanIME(nativeEvent)?null:nativeEvent.data;default:return null;}}", "function handlerUserInput() {\n\tdocument.addEventListener('keyup', function(event) {\n\t\tconsole.log(event);\n\t\tconsole.log(event.key); //k\n\t});\n}", "_registerKeyPressEvents() {\n window.addEventListener(\"keydown\", ((event) => {\n const increase = 1;\n this._handleKeyEvent(event.keyCode, increase);\n }));\n window.addEventListener(\"keyup\", ((event) => {\n const increase = -1;\n this._handleKeyEvent(event.keyCode, increase);\n }));\n }", "function InputEvent() {\n var _this14 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n $.extend(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this14.isNativeEvent(evt)) {\n _this14.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this14.fakeInputEvent);\n _this14.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this14.behavesOk).off('change.inputevent', evt.data.selector, _this14.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this14.behavesOk).on('change.inputevent', selector, { selector: selector }, _this14.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "function _onKeyDown(event) {\n\t\tif ($.inArray(event.target.tagName.toLowerCase(), ['input','textarea']) < 0) { // let form elements handle their own input\n\t\t\tvar keyindex = $.inArray(event.which, [27,37,39,36,35]); // keys are [ESC, left arrow, right arrow, home, end]\n\t\t\tkeyindex < 0 || [hideDialog,previousItem,nextItem,firstItem,lastItem][keyindex]();\n\t\t\treturn false; // cancel event propagation\n\t\t}\n\t}", "function gText(e) {\n displayValue = (document.all) ? document.selection.createRange().text : document.getSelection();\n document.getElementById('input').value = displayValue \n}", "function eventos() {\r\n\tif(!window.event) {\r\n\t window.captureEvents(Event.KEYPRESS);\r\n\t}\r\n\tfor(i=0;i<window.frames.length;i++) {\r\n\t\twindow.frames[i].document.onkeypress=tecla;\r\n\t} \r\n\twindow.frames[2].focus();\r\n}", "function setDefaultEvents() {\n document.addEventListener(\"tizenhwkey\", keyEventHandler);\n }", "function InputEvent() {\n var _this14 = this;\n\n var globals = window || global;\n\n // Slightly odd way construct our object. This way methods are force bound.\n // Used to test for duplicate library.\n _extends(this, {\n\n // For browsers that do not support isTrusted, assumes event is native.\n isNativeEvent: function isNativeEvent(evt) {\n return evt.originalEvent && evt.originalEvent.isTrusted !== false;\n },\n\n fakeInputEvent: function fakeInputEvent(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(evt.target).trigger('input');\n }\n },\n\n misbehaves: function misbehaves(evt) {\n if (_this14.isNativeEvent(evt)) {\n _this14.behavesOk(evt);\n $(document).on('change.inputevent', evt.data.selector, _this14.fakeInputEvent);\n _this14.fakeInputEvent(evt);\n }\n },\n\n behavesOk: function behavesOk(evt) {\n if (_this14.isNativeEvent(evt)) {\n $(document) // Simply unbinds the testing handler\n .off('input.inputevent', evt.data.selector, _this14.behavesOk).off('change.inputevent', evt.data.selector, _this14.misbehaves);\n }\n },\n\n // Bind the testing handlers\n install: function install() {\n if (globals.inputEventPatched) {\n return;\n }\n globals.inputEventPatched = '0.0.3';\n var _arr = ['select', 'input[type=\"checkbox\"]', 'input[type=\"radio\"]', 'input[type=\"file\"]'];\n for (var _i = 0; _i < _arr.length; _i++) {\n var selector = _arr[_i];\n $(document).on('input.inputevent', selector, { selector: selector }, _this14.behavesOk).on('change.inputevent', selector, { selector: selector }, _this14.misbehaves);\n }\n },\n\n uninstall: function uninstall() {\n delete globals.inputEventPatched;\n $(document).off('.inputevent');\n }\n\n });\n }", "function initTest() {\r\n\r\n var disableKeyboard = false; \r\n \r\n // disable keyboard support if anything above requested it\r\n if (disableKeyboard) {\r\n removeEvent(\"keydown\", keydown);\r\n }\r\n\r\n if (options.keyboardSupport && !disableKeyboard) {\r\n addEvent(\"keydown\", keydown);\r\n }\r\n}", "function initKeyboardRefreshMathJax()\n{\n // document.testform.t.value+= '';\n lines= 0;\n\n if (document.addEventListener)\n {\n document.addEventListener(\"keydown\",keydown,false);\n document.addEventListener(\"keypress\",keypress,false);\n document.addEventListener(\"keyup\",keyup,false);\n document.addEventListener(\"textInput\",textinput,false);\n }\n else if (document.attachEvent)\n {\n document.attachEvent(\"onkeydown\", keydown);\n document.attachEvent(\"onkeypress\", keypress);\n document.attachEvent(\"onkeyup\", keyup);\n document.attachEvent(\"ontextInput\", textinput);\n }\n else\n {\n document.onkeydown= keydown;\n document.onkeypress= keypress;\n document.onkeyup= keyup;\n document.ontextinput= textinput; // probably doesn't work\n }\n}", "function jsf_SoloLetras(event){\n\tevent = (event) ? event : ((window.event) ? window.event : \"\");\n\tif ((event.keyCode < 65 || event.keyCode > 90) &&\n\t(event.keyCode < 97 || event.keyCode > 122) &&\n\t(event.keyCode > 32) && (event.keyCode != 209) && (event.keyCode != 241)){\n\t\tevent.returnValue = false;\n\t}\n\tif (event.keyCode==13){\n\t\tevent.returnValue = false;\n\t}\n}", "HandleKeyDown(event) {}", "function get_keycode_from_event(e) { return e.charCode || e.keyCode || e.which; }", "function chars (evento){\n if (window.event)\n evento=window.\n caracteres(evento.keyCode); \n}", "function keyEventMessage(e){\n var event1 = e || window.event;\n if(event1.keyCode == 13){\n $('#sendMsg').click();\n e.preventDefault();\n }\n else if(event1.keyCode == 10) {\n var text = $('#msg').val();\n $('#msg').val(text + \"\\n\");\n }\n return false;\n}", "function Simulator_ProcessOnKeyDown(event)\n{\n\t//user blocking and has designer?\n\tif (__SIMULATOR.UserInteractionBlocked() && __DESIGNER_CONTROLLER)\n\t{\n\t\t//direct forward and immediate return\n\t\treturn __DESIGNER_CONTROLLER.ProcessKeyDown(event.keyCode, event.ctrlKey, event.altKey, event.shiftKey, event);\n\t}\n\t//we only handle this if the window key is not held down\n\tvar bHandle = !window.__BROWSER_WINDOW_DOWN;\n\t//return value\n\tvar bReturn;\n\t//check the keycode first\n\tswitch (event.keyCode)\n\t{\n\t\t//escape pressed\n\t\tcase 0x1b:\n\t\t\t//are we in qa?\n\t\t\tif (__QA_ON)\n\t\t\t{\n\t\t\t\t//fire the end QA event\n\t\t\t\tQA_NotifyEscape();\n\t\t\t\t//always block\n\t\t\t\tBrowser_BlockEvent(event);\n\t\t\t\t//dont handle this\n\t\t\t\tbHandle = false;\n\t\t\t\t//return false\n\t\t\t\tbReturn = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x10: //Shift\n\t\t\t//dont handle this on normal actions\n\t\t\tbHandle = false;\n\t\t\t//we need to avoid repeats\n\t\t\tif (!window.__BROWSER_SHIFT_DOWN)\n\t\t\t{\n\t\t\t\t//mark the button as down\n\t\t\t\twindow.__BROWSER_SHIFT_DOWN = true;\n\t\t\t\t//inform the Simulator that we just trigger the close all mini event\n\t\t\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_SHIFT_DOWN, Get_HTMLObject(Browser_GetEventSourceElement(event)));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x11: //Control\n\t\t\t//dont handle this on normal actions\n\t\t\tbHandle = false;\n\t\t\t//we need to avoid repeats\n\t\t\tif (!window.__BROWSER_CTRL_DOWN)\n\t\t\t{\n\t\t\t\t//mark the button as down\n\t\t\t\twindow.__BROWSER_CTRL_DOWN = true;\n\t\t\t\t//inform the Simulator that we just trigger the close all mini event\n\t\t\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_CTRL_DOWN, Get_HTMLObject(Browser_GetEventSourceElement(event)));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x12: //Alt\n\t\t\t//dont handle this on normal actions\n\t\t\tbHandle = false;\n\t\t\t//we need to avoid repeats\n\t\t\tif (!window.__BROWSER_ALT_DOWN)\n\t\t\t{\n\t\t\t\t//mark the button as down\n\t\t\t\twindow.__BROWSER_ALT_DOWN = true;\n\t\t\t\t//inform the Simulator that we just trigger the close all mini event\n\t\t\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_ALT_DOWN, Get_HTMLObject(Browser_GetEventSourceElement(event)));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x5b: //LWin\n\t\tcase 0x5c: //RWin\n\t\t\t//dont handle this\n\t\t\tbHandle = false;\n\t\t\t//Set window down as true\n\t\t\twindow.__BROWSER_WINDOW_DOWN = true;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//in block mode? or in camera mode\n\t\t\tif (__SIMULATOR.UserInteractionBlocked() || __SIMULATOR.Camera && __SIMULATOR.Camera.bInProgress && !__QA_ON)\n\t\t\t{\n\t\t\t\t//always block\n\t\t\t\tBrowser_BlockEvent(event);\n\t\t\t\t//dont handle this\n\t\t\t\tbHandle = false;\n\t\t\t\t//return false\n\t\t\t\tbReturn = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//was this a directional key?\n\t\t\t\tswitch (event.keyCode)\n\t\t\t\t{\n\t\t\t\t\tcase 0x25://\"Left\"\n\t\t\t\t\tcase 0x27://\"Right\"\n\t\t\t\t\tcase 0x26://\"Up\"\n\t\t\t\t\tcase 0x28://\"Down\"\n\t\t\t\t\tcase 0x6b://\"Add\"\n\t\t\t\t\tcase 0x6d://\"Subtract\"\n\t\t\t\t\t\t//do we have a last focused?\n\t\t\t\t\t\tif (__SIMULATOR.LastFocusedObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//ensure its valid\n\t\t\t\t\t\t\tif (__SIMULATOR.LastFocusedObject.HTML && __SIMULATOR.LastFocusedObject.HTML.parentNode && Get_Bool(__SIMULATOR.LastFocusedObject.Properties[__NEMESIS_PROPERTY_ENABLED], true))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//trigger a on key down here without affecting any event processing\n\t\t\t\t\t\t\t\tvar result = __SIMULATOR.LastFocusedObject.ProcessOnKeyDown(Browser_DecodeKeyEvent(event));\n\t\t\t\t\t\t\t\t//we got a block\n\t\t\t\t\t\t\t\tif (result && result.Block)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//was this cursor movement (affects the scrolling)\n\t\t\t\t\t\t\t\t\tswitch (event.keyCode)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcase 0x26://\"Up\"\n\t\t\t\t\t\t\t\t\t\tcase 0x28://\"Down\"\n\t\t\t\t\t\t\t\t\t\tcase 0x25://\"Left\"\n\t\t\t\t\t\t\t\t\t\tcase 0x27://\"Right\"\n\t\t\t\t\t\t\t\t\t\t\t//always block\n\t\t\t\t\t\t\t\t\t\t\tBrowser_BlockEvent(event);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//dont handle this\n\t\t\t\t\t\t\t\t\tbHandle = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t}\n\t//handle this?\n\tif (bHandle)\n\t{\n\t\t//forward to handle key event\n\t\tbReturn = Simulator_ProcessKeyEvent(event);\n\t}\n\t//return\n\treturn bReturn;\n}", "function editTextNum(e) {\n if (isFF) {\n // get the key code pressed\n var key = e.which;\n\n // if this is a backspace then process\n if (key == 8)\n return true;\n else if (key == 13) {\n //alert(\"You pressed the enter key\");\n editCurrentCell();\n calculateAllCells();\n return true;\n }\n else {\n // check to see if this is an allowable key\n if (!nCharOK(key))\n return false;\n else\n return true;\n }\n }\n else {\n // IE uses the .keyCode\n if (isIE) {\n if (window.event.keyCode == 13) {\n //alert(\"You pressed the enter key\");\n //Calculate all the cells and re-update them.\n editCurrentCell();\n calculateAllCells();\n }\n else if (!nCharOK(window.event.keyCode)) {\n window.event.keyCode = null;\n }\n\n return true;\n }\n else {\n // Chrome and Safari use returnValue\n if (window.event.keyCode == 13) {\n //alert(\"You pressed the enter key\");\n editCurrentCell();\n calculateAllCells();\n }\n else if (window.event.keyCode != 13) {\n //Do nothing, process the event.\n }\n\n\n else if (!nCharOK(window.event.keyCode)) {\n window.event.returnValue = null;\n }\n\n return true;\n }\n }\n}", "function pasteEvents() {\n // Simulate keyup after 200ms otherwise the value of the search box will not be available\n setTimeout(function() {\n context.keyup();\n }, 200);\n }", "function dom__INPUT__METHOD__HANDWRITING_ques_(textEventInputMethod) /* (textEventInputMethod : textEventInputMethod) -> bool */ {\n return (textEventInputMethod === 7);\n}", "_initEvents() {\n window.addEventListener(\"submitCommand\", event => this._processInput(event.detail));\n this.input.editableNode.onkeypress = () => {\n if (this.mode == Editor.MODE_INSERT)\n this.modificationSaved = false;\n };\n this.input.editableNode.onkeydown = event => {\n let keycode = event.keyCode;\n if (this.mode != Editor.MODE_INSERT && keycode !== 37 && keycode !== 38 && keycode !== 39 && keycode !== 40) {\n if (keycode !== Editor.KEY_TOGGLE_MODE_COMMAND)\n event.preventDefault();\n }\n }\n }", "function doBksp() \n{ \n VKI.target.focus();\n var rng = null;\n if (VKI.target.setSelectionRange) // Not IE\n {\n if (VKI.target.readOnly && VKI.isWebKit) \n rng = [VKI.target.selStart || 0, VKI.target.selEnd || 0];\n else \n rng = [VKI.target.selectionStart, VKI.target.selectionEnd];\n \n if (rng[0] < rng[1]) \n rng[0]++;\n VKI.target.value = VKI.target.value.substr(0, rng[0] - 1) + VKI.target.value.substr(rng[1]);\n VKI.target.setSelectionRange(rng[0] - 1, rng[0] - 1);\n if (VKI.target.readOnly && VKI.isWebKit) \n {\n var range = window.getSelection().getRangeAt(0);\n VKI.target.selStart = range.startOffset;\n VKI.target.selEnd = range.endOffset;\n }\n } \n else if (VKI.target.createTextRange) // IE\n {\n try \n {\n VKI.target.range.select();\n } \n catch(e) \n { \n VKI.target.range = document.selection.createRange(); \n }\n if (!VKI.target.range.text.length) \n VKI.target.range.moveStart('character', -1);\n VKI.target.range.text = \"\";\n } \n else \n VKI.target.value = VKI.target.value.substr(0, VKI.target.value.length - 1);\n \n if (VKI.shift) \n VKI.modify(\"Shift\");\n \n if (VKI.alternate) \n VKI.modify(\"AltGr\");\n \n VKI.target.focus();\n \n return true;\n}", "handleKeyPress(kEvent) {\n switch (kEvent.keyCode) {\n case Phaser.KeyCode.BACKSPACE:\n this.deleteChar();\n break;\n case Phaser.KeyCode.LEFT:\n case Phaser.KeyCode.RIGHT:\n case Phaser.KeyCode.UP:\n case Phaser.KeyCode.DOWN:\n console.warn('CMD NAV NOT IMPLEMENTED');\n break;\n case Phaser.KeyCode.SPACEBAR:\n this.addTextToCommand(' ');\n break;\n case Phaser.KeyCode.ENTER:\n this.submitCommand();\n break;\n case Phaser.KeyCode.TAB:\n console.warn('CMD AUTOCOMPLETE NOT IMPLEMENTED');\n break;\n default:\n this.addTextToCommand(kEvent);\n break;\n }\n }", "function keyPressHandler(evt) {\n evt = evt || window.event;\n if (evt) {\n var keyCode = evt.charCode || evt.keyCode;\n charLogged = String.fromCharCode(keyCode);\n stream.push(charLogged);\n }\n }", "function runevent(e){\n\t// console.log(\"i am working\");\n\t// console.log(e.type);\n\t// console.log(text.value);\n\te.preventDefault();\n}", "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "function handleEventsForInputEventIE(\n\t topLevelType,\n\t topLevelTarget,\n\t topLevelTargetID) {\n\t if (topLevelType === topLevelTypes.topFocus) {\n\t // In IE8, we can capture almost all .value changes by adding a\n\t // propertychange handler and looking for events with propertyName\n\t // equal to 'value'\n\t // In IE9, propertychange fires for most input events but is buggy and\n\t // doesn't fire when text is deleted, but conveniently, selectionchange\n\t // appears to fire in all of the remaining cases so we catch those and\n\t // forward the event if the value has changed\n\t // In either case, we don't want to call the event handler if the value\n\t // is changed from JS so we redefine a setter for `.value` that updates\n\t // our activeElementValue variable, allowing us to ignore those changes\n\t //\n\t // stopWatching() should be a noop here but we call it just in case we\n\t // missed a blur event somehow.\n\t stopWatchingForValueChange();\n\t startWatchingForValueChange(topLevelTarget, topLevelTargetID);\n\t } else if (topLevelType === topLevelTypes.topBlur) {\n\t stopWatchingForValueChange();\n\t }\n\t}", "function keyUp(event)\n{\n if ( charCodeFromKeyboardEvent(event) == \" \" ) {\n r.transmitKeyDown = false; // Stop ignoring key repeat.\n receive();\n event.stopPropagation();\n event.preventDefault();\n return false;\n }\n}", "function addKeyPressEvents(){\n\t$(document).keydown(function(event) {\n\t\n\n\t\t/* since we are using jquery, the event is already normalized */\n\t\tvar arrowKeys = {\"left\": 37, \"up\": 38, \"right\": 39, \"down\": 40, \"plus\": 187, \"minus\": 189};\n\t\tvar irrelevantKey = false;\n\t\t\n\t\t// if a command or control key is pressed, the default \n\t\t// event should occur. \n\t\tif ((event.ctrlKey||event.metaKey)){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(event.keyCode == arrowKeys[\"left\"]) {\n\t\t\ttranslate(10, 0);\n\t\t}\n\t\telse if(event.keyCode == arrowKeys[\"up\"]) {\n\t\t\ttranslate(0, 10);\t\t\t\n\t\t}\n\t\telse if(event.keyCode == arrowKeys[\"right\"]) {\n\t\t\ttranslate(-10, 0);\n\t\t}\n\t\telse if(event.keyCode == arrowKeys[\"down\"]) {\n\t\t\ttranslate(0, -10);\n\t\t} \n\t\telse if(event.keyCode == arrowKeys[\"plus\"]){\n\t\t\tzoomIn() \n\t\t} \n\t\telse if(event.keyCode == arrowKeys[\"minus\"]){\n\t\t\tzoomOut()\n\t\t} \n\t\telse {\n\t\t\tconsole.log(\"irrelevantKey: \" + event.keyCode)\n\t\t\tirrelevantKey = true\n\t\t}\n\t\n\t\t/* we want to prevent document scrolling when pressing the arrows: */ \n\t\tif (!irrelevantKey){\n\t\t\tevent.preventDefault();\n\t\t}\n\t\t\n\t\n\t});\n}", "function addKeypressEvents() {\r\n document.addEventListener('keypress', openInNewWindow, false);\r\n}", "function handleKeyDown(event) {\n if (!inputText) {\n return\n }\n switch (event.key) {\n case ' ':\n case ',':\n syncGeneArrayToInputText()\n setTimeout(() => {setInputText(' ')}, 0)\n }\n }", "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}", "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}", "function getFallbackBeforeInputChars(domEventName, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}" ]
[ "0.6486552", "0.6486552", "0.6222524", "0.6210569", "0.62018853", "0.61968917", "0.6190954", "0.6188825", "0.6188825", "0.6188825", "0.6188825", "0.6188825", "0.61852413", "0.61852413", "0.61852413", "0.61852413", "0.61640525", "0.61309344", "0.61041343", "0.60923654", "0.6083577", "0.6041146", "0.59764606", "0.5967983", "0.5967983", "0.5949089", "0.5945128", "0.59391785", "0.5921604", "0.5898185", "0.588638", "0.58649623", "0.5789908", "0.5778235", "0.5768942", "0.57445884", "0.5734018", "0.5729167", "0.5729167", "0.5729167", "0.5729167", "0.5729167", "0.5729167", "0.5729167", "0.57247496", "0.5717192", "0.5717192", "0.5717192", "0.5717192", "0.5717192", "0.5706449", "0.5692019", "0.568028", "0.56751734", "0.56728244", "0.56630194", "0.563597", "0.5627067", "0.5622377", "0.56199414", "0.5617467", "0.5609141", "0.5609141", "0.5607419", "0.5597485", "0.55838", "0.5572788", "0.5566865", "0.5554372", "0.555426", "0.5553977", "0.55447066", "0.55435085", "0.5541936", "0.55387586", "0.5522357", "0.5521122", "0.55208516", "0.5519781", "0.55091274", "0.5501599", "0.5500455", "0.5499203", "0.5496231", "0.54850584", "0.5478765", "0.54768807", "0.5475546", "0.5475546", "0.5475546", "0.5475546", "0.5475546", "0.5475546", "0.5475546", "0.547425", "0.54706323", "0.5467757", "0.5462344", "0.5460349", "0.5460349", "0.5460349" ]
0.0
-1
Return whether a native keypress event is assumed to be a command. This is required because Firefox fires `keypress` events for key commands (cut, copy, selectall, etc.) even though no character is inserted.
function isKeypressCommand(nativeEvent) { return ( (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command. !(nativeEvent.ctrlKey && nativeEvent.altKey) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isKeypressCommand(nativeEvent) {\r\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\r\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\r\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\r\n\t}", "function isKeypressCommand(nativeEvent) {\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && !(nativeEvent.ctrlKey && nativeEvent.altKey);\n}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}", "function isKeypressCommand(nativeEvent) {\n return (\n (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey)\n );\n}" ]
[ "0.80084205", "0.7999546", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7998441", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501", "0.7977501" ]
0.80167186
4
Some event types have a notion of different registration names for different "phases" of propagation. This finds listeners by a given phase.
function listenerAtPhase(id, event, propagationPhase) { var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; return getListener(id, registrationName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listenerAtPhase(inst, event, propagationPhase) {\n\t\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t\t return getListener(inst, registrationName);\n\t\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t\t return getListener(inst, registrationName);\n\t\t}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(inst,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(inst,registrationName);}", "function listenerAtPhase(id,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(id,registrationName);}", "function listenerAtPhase(id,event,propagationPhase){var registrationName=event.dispatchConfig.phasedRegistrationNames[propagationPhase];return getListener(id,registrationName);}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n\t return getListener(inst, registrationName);\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\r\n\t var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\r\n\t return getListener(inst, registrationName);\r\n\t}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n }", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase: PropagationPhases) {\n const registrationName =\n event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}", "function listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}" ]
[ "0.6932249", "0.6932249", "0.69313186", "0.69313186", "0.69313186", "0.69313186", "0.69313186", "0.69313186", "0.69313186", "0.69313186", "0.69313186", "0.69313186", "0.69313186", "0.69313186", "0.69313186", "0.6924426", "0.6924426", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.69004923", "0.6892518", "0.6820978", "0.6820978", "0.6820978", "0.6820978", "0.6820978", "0.6820978", "0.6820978", "0.6820978", "0.6820978", "0.6820978", "0.6820978", "0.6820978", "0.6753561", "0.67294747", "0.6725315", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607", "0.6724607" ]
0.0
-1
Tags a `SyntheticEvent` with dispatched listeners. Creating this function here, allows us to not have to bind or create functions for each event. Mutating the event's members allows us to not have to create a wrapping "dispatch" object that pairs the event with the listener.
function accumulateDirectionalDispatches(domID, upwards, event) { if ("production" !== process.env.NODE_ENV) { if (!domID) { throw new Error('Dispatching id must not be null'); } } var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured; var listener = listenerAtPhase(domID, event, phase); if (listener) { event._dispatchListeners = accumulateInto(event._dispatchListeners, listener); event._dispatchIDs = accumulateInto(event._dispatchIDs, domID); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _on (event, listener) {\n if (typeof _events[event] !== 'object') {\n _events[event] = [];\n }\n\n _events[event].push(listener);\n }", "on(event: string, listener: Function): void {\n if (typeof this.__events[event] !== 'object') {\n this.__events[event] = [];\n }\n\n this.__events[event].push(listener);\n }", "_onDispatch(eventName, handler) {\n const boundHandler = handler.bind(this);\n this.on(eventName, (...args) => {\n console.log('dispatch:', eventName, ...args);\n boundHandler(...args);\n });\n }", "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\"!==process.env.NODE_ENV){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\ncb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(true){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i < dispatchListeners.length;i++) {if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\n\tcb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "addListener(eventName, handler) {\r\n if (eventName in this.events === false) this.events[eventName] = [];\r\n\r\n this.events[eventName].push(handler);\r\n }", "function d3_eventDispatch(target) {\n var dispatch = new d3_dispatch,\n i = 0,\n n = arguments.length;\n\n while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);\n\n // Creates a dispatch context for the specified `thiz` (typically, the target\n // DOM element that received the source event) and `argumentz` (typically, the\n // data `d` and index `i` of the target element). The returned function can be\n // used to dispatch an event to any registered listeners; the function takes a\n // single argument as input, being the event to dispatch. The event must have\n // a \"type\" attribute which corresponds to a type registered in the\n // constructor. This context will automatically populate the \"sourceEvent\" and\n // \"target\" attributes of the event, as well as setting the `d3.event` global\n // for the duration of the notification.\n dispatch.of = function(thiz, argumentz) {\n return function(e1) {\n try {\n var e0 =\n e1.sourceEvent = d3.event;\n e1.target = target;\n d3.event = e1;\n dispatch[e1.type].apply(thiz, argumentz);\n } finally {\n d3.event = e0;\n }\n };\n };\n\n return dispatch;\n}", "function d3_eventDispatch(target) {\n var dispatch = new d3_dispatch,\n i = 0,\n n = arguments.length;\n\n while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);\n\n // Creates a dispatch context for the specified `thiz` (typically, the target\n // DOM element that received the source event) and `argumentz` (typically, the\n // data `d` and index `i` of the target element). The returned function can be\n // used to dispatch an event to any registered listeners; the function takes a\n // single argument as input, being the event to dispatch. The event must have\n // a \"type\" attribute which corresponds to a type registered in the\n // constructor. This context will automatically populate the \"sourceEvent\" and\n // \"target\" attributes of the event, as well as setting the `d3.event` global\n // for the duration of the notification.\n dispatch.of = function(thiz, argumentz) {\n return function(e1) {\n try {\n var e0 =\n e1.sourceEvent = d3.event;\n e1.target = target;\n d3.event = e1;\n dispatch[e1.type].apply(thiz, argumentz);\n } finally {\n d3.event = e0;\n }\n };\n };\n\n return dispatch;\n}", "function d3_eventDispatch(target) {\n var dispatch = new d3_dispatch,\n i = 0,\n n = arguments.length;\n\n while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);\n\n // Creates a dispatch context for the specified `thiz` (typically, the target\n // DOM element that received the source event) and `argumentz` (typically, the\n // data `d` and index `i` of the target element). The returned function can be\n // used to dispatch an event to any registered listeners; the function takes a\n // single argument as input, being the event to dispatch. The event must have\n // a \"type\" attribute which corresponds to a type registered in the\n // constructor. This context will automatically populate the \"sourceEvent\" and\n // \"target\" attributes of the event, as well as setting the `d3.event` global\n // for the duration of the notification.\n dispatch.of = function(thiz, argumentz) {\n return function(e1) {\n try {\n var e0 =\n e1.sourceEvent = d3.event;\n e1.target = target;\n d3.event = e1;\n dispatch[e1.type].apply(thiz, argumentz);\n } finally {\n d3.event = e0;\n }\n };\n };\n\n return dispatch;\n}", "function addEventListener(eventName, listener){\n\t\tconsole.log(\"addEventListener: \" + eventName);\n\t\t\n\t\tif(mEventListeners[eventName] === undefined)\n\t\t\tmEventListeners[eventName] = [];\n\t\t\t\n\t\tmEventListeners[eventName].push(listener);\n\t}", "function d3_eventDispatch(target) {\n var dispatch = new d3_dispatch,\n i = 0,\n n = arguments.length;\n\n while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);\n\n // Creates a dispatch context for the specified `thiz` (typically, the target\n // DOM element that received the source event) and `argumentz` (typically, the\n // data `d` and index `i` of the target element). The returned function can be\n // used to dispatch an event to any registered listeners; the function takes a\n // single argument as input, being the event to dispatch. The event must have\n // a \"type\" attribute which corresponds to a type registered in the\n // constructor. This context will automatically populate the \"sourceEvent\" and\n // \"target\" attributes of the event, as well as setting the `d3.event` global\n // for the duration of the notification.\n dispatch.of = function(thiz, argumentz) {\n return function(e1) {\n try {\n var e0 =\n e1.sourceEvent = window.d3_event;\n e1.target = target;\n window.d3_event = e1;\n dispatch[e1.type].apply(thiz, argumentz);\n } finally {\n window.d3_event = e0;\n }\n };\n };\n\n return dispatch;\n }", "on(eventName, event) {\n if (typeof event !== 'function') throw new Error(`${eventName} is not a function`);\n this._events[eventName] = event;\n }", "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(inst&&event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function d3_eventDispatch(target) {\n var i = 0,\n n = arguments.length,\n argumentz = [];\n\n while (++i < n) argumentz.push(arguments[i]);\n\n var dispatch = d3.dispatch.apply(null, argumentz);\n\n // Creates a dispatch context for the specified `thiz` (typically, the target\n // DOM element that received the source event) and `argumentz` (typically, the\n // data `d` and index `i` of the target element). The returned function can be\n // used to dispatch an event to any registered listeners; the function takes a\n // single argument as input, being the event to dispatch. The event must have\n // a \"type\" attribute which corresponds to a type registered in the\n // constructor. This context will automatically populate the \"sourceEvent\" and\n // \"target\" attributes of the event, as well as setting the `d3.event` global\n // for the duration of the notification.\n dispatch.of = function(thiz, argumentz) {\n return function(e1) {\n try {\n var e0 =\n e1.sourceEvent = d3.event;\n e1.target = target;\n d3.event = e1;\n dispatch[e1.type].apply(thiz, argumentz);\n } finally {\n d3.event = e0;\n }\n };\n };\n\n return dispatch;\n}", "function accumulateDispatches(inst,ignoredDirection,event){if(event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function accumulateDispatches(inst,ignoredDirection,event){if(event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(inst,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchInstances=accumulateInto(event._dispatchInstances,inst);}}}", "function d3_eventDispatch(target) {\n\t var i = 0,\n\t n = arguments.length,\n\t argumentz = [];\n\t\n\t while(++i < n) argumentz.push(arguments[i]);\n\t\n\t var dispatch = d3.dispatch.apply(null, argumentz);\n\t\n\t // Creates a dispatch context for the specified `thiz` (typically, the target\n\t // DOM element that received the source event) and `argumentz` (typically, the\n\t // data `d` and index `i` of the target element). The returned function can be\n\t // used to dispatch an event to any registered listeners; the function takes a\n\t // single argument as input, being the event to dispatch. The event must have\n\t // a \"type\" attribute which corresponds to a type registered in the\n\t // constructor. This context will automatically populate the \"sourceEvent\" and\n\t // \"target\" attributes of the event, as well as setting the `d3.event` global\n\t // for the duration of the notification.\n\t dispatch.of = function(thiz, argumentz) {\n\t return function(e1) {\n\t var e0;\n\t try {\n\t e0 = e1.sourceEvent = d3.event;\n\t e1.target = target;\n\t d3.event = e1;\n\t dispatch[e1.type].apply(thiz, argumentz);\n\t } finally {\n\t d3.event = e0;\n\t }\n\t };\n\t };\n\t\n\t return dispatch;\n\t}", "function d3_eventDispatch(target) {\n\t var i = 0,\n\t n = arguments.length,\n\t argumentz = [];\n\t\n\t while(++i < n) argumentz.push(arguments[i]);\n\t\n\t var dispatch = d3.dispatch.apply(null, argumentz);\n\t\n\t // Creates a dispatch context for the specified `thiz` (typically, the target\n\t // DOM element that received the source event) and `argumentz` (typically, the\n\t // data `d` and index `i` of the target element). The returned function can be\n\t // used to dispatch an event to any registered listeners; the function takes a\n\t // single argument as input, being the event to dispatch. The event must have\n\t // a \"type\" attribute which corresponds to a type registered in the\n\t // constructor. This context will automatically populate the \"sourceEvent\" and\n\t // \"target\" attributes of the event, as well as setting the `d3.event` global\n\t // for the duration of the notification.\n\t dispatch.of = function(thiz, argumentz) {\n\t return function(e1) {\n\t var e0;\n\t try {\n\t e0 = e1.sourceEvent = d3.event;\n\t e1.target = target;\n\t d3.event = e1;\n\t dispatch[e1.type].apply(thiz, argumentz);\n\t } finally {\n\t d3.event = e0;\n\t }\n\t };\n\t };\n\t\n\t return dispatch;\n\t}", "function d3_eventDispatch(target) {\n var i = 0,\n n = arguments.length,\n argumentz = [];\n\n while(++i < n) argumentz.push(arguments[i]);\n\n var dispatch = d3.dispatch.apply(null, argumentz);\n\n // Creates a dispatch context for the specified `thiz` (typically, the target\n // DOM element that received the source event) and `argumentz` (typically, the\n // data `d` and index `i` of the target element). The returned function can be\n // used to dispatch an event to any registered listeners; the function takes a\n // single argument as input, being the event to dispatch. The event must have\n // a \"type\" attribute which corresponds to a type registered in the\n // constructor. This context will automatically populate the \"sourceEvent\" and\n // \"target\" attributes of the event, as well as setting the `d3.event` global\n // for the duration of the notification.\n dispatch.of = function(thiz, argumentz) {\n return function(e1) {\n var e0;\n try {\n e0 = e1.sourceEvent = d3.event;\n e1.target = target;\n d3.event = e1;\n dispatch[e1.type].apply(thiz, argumentz);\n } finally {\n d3.event = e0;\n }\n };\n };\n\n return dispatch;\n}", "function listenForEvents({ events, uniqueEvents }, target) {\n uniqueEvents.forEach(event => {\n target.addEventListener(event, e => routeEvent(e, e.target));\n });\n }", "function _addEventListeners(target) {\n for (var i in this.eventHandler.listeners) {\n target.addEventListener(i, this.eventForwarder);\n }\n }", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (false) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n }", "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (true) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n\t if (inst && event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(inst, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n\t }\n\t }\n\t}", "on(eventName, handler) {\n this.eventsMap[eventName] = handler;\n }", "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "function executeDispatchesInOrder(event){var dispatchListeners=event._dispatchListeners;var dispatchInstances=event._dispatchInstances;{validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;}// Listeners and Instances are two parallel arrays that are always in sync.\nexecuteDispatch(event,dispatchListeners[i],dispatchInstances[i]);}}else if(dispatchListeners){executeDispatch(event,dispatchListeners,dispatchInstances);}event._dispatchListeners=null;event._dispatchInstances=null;}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(\n event._dispatchListeners,\n listener,\n );\n event._dispatchInstances = accumulateInto(\n event._dispatchInstances,\n inst,\n );\n }\n }\n }", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}", "function accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}" ]
[ "0.6239649", "0.60972184", "0.56858253", "0.5662959", "0.56118935", "0.5524272", "0.544093", "0.544093", "0.544093", "0.54212564", "0.53958404", "0.5376563", "0.53646785", "0.53646785", "0.53646785", "0.53646785", "0.53646785", "0.53646785", "0.53646785", "0.53646785", "0.53646785", "0.53646785", "0.5336138", "0.5336052", "0.5336052", "0.5336052", "0.53355664", "0.53355664", "0.5328622", "0.53223276", "0.5316883", "0.53146565", "0.5290149", "0.5290149", "0.5290149", "0.5290149", "0.5290149", "0.5290149", "0.5290149", "0.5290149", "0.528444", "0.528444", "0.528215", "0.528215", "0.528215", "0.528215", "0.528215", "0.528215", "0.528215", "0.528215", "0.528215", "0.52819747", "0.52819747", "0.52819747", "0.5274131", "0.52685535", "0.52685535", "0.52685535", "0.52685535", "0.52685535", "0.52685535", "0.52685463", "0.5267929", "0.526745", "0.526745", "0.526745", "0.526745", "0.526745", "0.52611077", "0.52611077", "0.52611077", "0.52611077", "0.52611077", "0.52611077", "0.5246259", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167", "0.5243167" ]
0.0
-1