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
Function called to read a selected file.
readSelectedFile() { var fileReader = new FileReader(); var objFile = document.getElementById("fileInput").files[0]; if (!objFile) { alert("OBJ file not set!"); return; } fileReader.readAsText(objFile); fileReader.onloadend = function() { // alert(fileReader.result); var customObj = new CustomOBJ(shader, fileReader.result); _inputHandler.scene.addGeometry(customObj); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readFile(evt){\n\tvar files = evt.target.files;//Retrieve the files\n\tif (!files.length){//If there is no file\n\t\talert(\"NO FILE SELECTED! NOOOOOOOOOOO!\\n(select a file next time)\");\n\t\treturn;\n\t}\n\t\n\tvar file = files[0];//get the first of the selected files\n\tvar reader = new FileReader();//Initializes the file reading object\n\t\n\t//This function is called when the reader finishes loading\n\treader.onloadend = function(evt){\n\t\tif (evt.target.readyState == FileReader.DONE){\n\t\t\t//simply prints the entire read file to the webpage.\n\t\t\tdocument.getElementById('read_out').textContent = evt.target.result;\n\t\t}\n\t};\n\t\n\treader.readAsBinaryString(file);//read the entire file\n}", "function readSelectedFile(e) {\n var file = e.target.files[0];\n if (!file) {\n return;\n }\n\n var reader = new FileReader();\n reader.onload = function(e) {\n db = new SQL.Database(e.target.result);\n displayConversationsList();\n };\n reader.readAsBinaryString(file);\n}", "function handleFileSelect(evt){\n var f = evt.target.files[0]; // FileList object\n window.reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = (function(theFile){\n return function(e){\n editor.setData(e.target.result);\n evt.target.value = null; // allow reload\n };\n })(f);\n // Read file as text\n reader.readAsText(f);\n thisDoc = f.name;\n }", "function selectfiles(files) {\n\t\t// now switch to the viewer\n \t//switchToViewer();\n\t // .. and start the file reading\n\t //alert(files);\n read(files);\n\t}", "function handleFileSelect(evt) {\n\n var files = evt.target.files; // FileList object\n\n console.log(files);\n console.log(files[0]);\n\n var reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = function() {\n //console.log(reader.result);\n\n var fileContent =reader.result;\n\n parsearArchivo( fileContent );\n pintarLaberinto();\n //alert('termino de paresear');\n $('#ingresoPosicion').show();\n $('#contSolucion').hide();\n $('#solucion').html('');\n }\n\n reader.readAsText(files[0]);\n}", "function onFileSelect(event) {\n jQuery('#uploadHelp').text('The file \"' + event.target.files[0].name + '\" has been selected.');\n \n var reader = new FileReader();\n reader.onload = onReaderLoad;\n reader.readAsText(event.target.files[0]);\n}", "function open_file() {\n //get the hidden <input type=\"file\"> file loader element and force a click on it\n var loader = document.getElementById('file_loader_2');\n loader.click();\n\n //Now, as soon as the user selects the file, handle_files is calles automatically and we can work with the selected file\n}", "function fileReceived(e) {\n // if user clicks 'cancel' on file dialogue, the filelist might be zero\n if (typeof e === 'undefined' || e.target.files.length === 0) return null;\n const selectedFile = e.target.files[0];\n console.log(selectedFile)\n if (Constants.VALID_EXTENSIONS.indexOf(selectedFile.name.split('.').pop()) >= 0) {\n console.log(`Selected file: ${selectedFile.name}`)\n // when the file has been read in, it will trigger the on load reader event\n reader.readAsArrayBuffer(selectedFile);\n } else {\n alert(`The file extension ${selectedFile.name.split('.').pop()} is invalid, must be in ${Constants.VALID_EXTENSIONS}`);\n }\n }", "function handleFileSelect(evt) {\n var files = evt.target.files; // FileList object\n for (var i = 0, f; f = files[i]; i++) {\n var reader = new FileReader();\n reader.onload = (function (theFile) {\n return function (e) {\n processData(e.target.result); //\n };\n })(f);\n reader.readAsText(f); //read the file as text\n }\n $(\"#control\").hide();\n }", "function handleFileSelect(event){\n console.log(event.target)\n var file = event.target.files[0];\n console.log(file.name);\n if (file) {\n var reader = new FileReader();\n\n reader.onload = function(e){\n /** How to avoid using a global scope variable here? */\n var fileContent =e.target.result;\n }\n\n // Read the content of the file.\n reader.readAsText(file);\n }else{\n alert(\"Failed to load file\");\n }\n }", "function handleFileSelect() {\n // Check for the various File API support.\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n } else {\n alert('The File APIs are not fully supported in this browser.');\n }\n\n var f = event.target.files[0]; // FileList object\n var reader = new FileReader();\n\n reader.onload = function(event) {\n load_d3(event.target.result)\n };\n // Read in the file as a data URL.\n reader.readAsDataURL(f);\n}", "function loadFile() {\n dialog.showOpenDialog({ filters: [\n { name: 'txt', extensions: ['txt'] },\n ]}, function(filenames) {\n if(filenames === undefined) return;\n var filename = filenames[0];\n readFromFile(editor, filename);\n loadedfs = filename;\n })\n}", "function readSingleFile(e) {\n\tvar file = e.target.files[0];\n\tif (!file) {\n\t return;\n\t}\n\tvar reader = new FileReader();\n\treader.onload = function(e) {\n\t var contents = e.target.result;\n\t displayContents(contents);\n\t};\n\treader.readAsText(file);\n}", "function handleFileSelect(evt) {\n // These are the files\n var files = evt.target.files;\n // Load each one and trigger a callback\n for (var i = 0; i < files.length; i++) {\n var f = files[i];\n _main.default.File._load(f, callback);\n }\n }", "function readFile() {\n\t\tlet reader = new FileReader();\n\t\treader.addEventListener('loadend', () => {\n\t\t\tparseFile(reader.result);\n\t\t});\n\t\treader.readAsText(this.files[0]);\n\t}", "function onChangeFile(event) {\n var files = event.target.files;\n readFile(files);\n }", "function handleFiles(files) {\n // Check for the various File API support.\n if (window.FileReader) {\n // FileReader are supported.\n getAsText(files[0]);\n } else {\n alert('FileReader are not supported in this browser.');\n }\n}", "handleFileSelect(evt) {\n let files = evt.target.files;\n if (!files.length) {\n alert('No file select');\n return;\n }\n let file = files[0];\n let that = this;\n let reader = new FileReader();\n\n //Se asigna la función que se realiza al cargar el archivo\n reader.onload = function (e) {\n that.cargaJson(e.target.result);\n };\n reader.readAsText(file);\n }", "static readFile(evt, {path=null}){\n // must have file name\n if(!path){\n let err = \"No file name provided (path is null).\";\n IpcResponder.respond(evt, \"file-read\", {err});\n return;\n }\n\n // read file promise \n FileUtils.readFile(path)\n .then(str => {\n // got file contents \n // file name with forward slashes always\n let pathClean = path.replace(/\\\\/g, \"/\"); \n IpcResponder.respond(evt, \"file-read\", {path, pathClean, str});\n\n // update folder data\n FolderData.update({recentFilePaths: [path], lastFilePath: path});\n })\n .catch(err => {\n // error\n IpcResponder.respond(evt, \"file-read\", {err: err.message});\n });\n }", "handleTheFile(event) {\n event.preventDefault();\n if (this.inputFile.current.files[0] === undefined) { return; }\n\n // Confirm file extension and read the data as text\n console.log('Reading the file...');\n let fileName = this.inputFile.current.files[0].name;\n if (!fileName.endsWith('.asc')) {\n console.error('Error opening the file: Invalid file extension, .asc expected.');\n return;\n }\n let file = this.inputFile.current.files[0];\n let reader = new FileReader();\n reader.onload = (event) => {\n console.log('Done.');\n this.ParseTheData(event.target.result);\n }\n reader.onerror = () => {\n console.error('Error opening the file: Cannot read file.');\n return;\n }\n reader.readAsText(file);\n }", "function readSingleFile(e) {\n\tvar file = e.target.files[0];\n\tif(!file){\n\t\treturn;\n\t}\n\n\tvar reader = new FileReader();\n\treader.readAsText(file, \"UTF-8\");\n\treader.onload = function(e) {\n\t\tdrawer.upload(e.target.result.toString());\n\t};\n}", "function handleFiles(files) {\n // Check for the various File API support.\n if (window.FileReader) {\n\t // FileReader are supported.\n\t getAsText(files[0]);\n\t console.log('files: ' + files[0])\n } else {\n\t alert('FileReader are not supported in this browser.');\n }\n}", "function handleFiles1(files) {\n if (window.FileReader) {\n getAsText1(files[0]);\n } else {\n alert('FileReader are not supported in this browser.');\n }\n}", "fileSelected(event) {\n let reader = new FileReader();\n this.fileInput = event.target;\n let filename = event.target.value;\n let file = event.target.files[0];\n\n reader.onloadend = () => {\n this.setState({\n currentFile: file,\n currentFilename: filename\n });\n };\n\n reader.readAsDataURL(file);\n }", "function handleFileSelect(event) {\n // console.log('evt', evt.target.files);\n var files = event.target.files; // FileList object\n playFile(files[0]);\n}", "function handleFileSelect(e) {\n e.stopPropagation();\n e.preventDefault();\n\n var file = null;\n\n if (e.type === \"change\") {\n file = e.target.files[0];\n\n // change label text\n changeContent(file.name);\n\n } else if (e.type === \"drop\") {\n file = e.dataTransfer.files[0];\n\n // change drop area text\n changeContent(file.name);\n }\n\n //Validate input file\n if (fileValidator(file)){\n readContent(file);\n }\n }", "function handleFile(e) {\n var files;\n\n if (e.type === 'drop') {\n files = e.dataTransfer.files\n } else if (e.type === 'change') {\n files = e.target.files;\n }\n\n if (window.FileReader) {\n // FileReader is supported.\n readFile(files);\n } else {\n alertHandler.error('FileReader is not supported in this browser.');\n }\n }", "function getAndProcessData() { \n\t\tchooseFileSource();\n\t}", "function loadFile(e){\n if (!e) e = window.event;\n var target = (e.target || e.srcElement);\n \n $.get(\"text-file-management.php?request=loadFile&file=\"+target.firstChild.nodeValue, loadFileCallback);\n \n hideFilesDropdown();\n}", "function readFile(fileEntry) {\n // Get the file from the file entry\n fileEntry.file(function (file) { \n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n reader.onloadend = function() {\n console.log(\"Successful file read: \" + reader.result);\n document.getElementById('dataObj').innerHTML = reader.result;\n console.log(\"file path: \" + fileEntry.fullPath);\n };\n });\n }", "readin () {\n this.content = readFile(this.path);\n }", "function openFile() {\n // open file dialog for markdown file\n const files = dialog.showOpenDialog(mainWindow,{\n properties: ['openFile'],\n filters: [\n { name: 'markdown', extensions: ['md', 'markdown', 'txt'] },\n // { name: 'All Files', extensions: ['*'] }\n ]\n })\n // if no file found \n if(!files) return ;\n\n // if file found \n const file = files[0]\n const fileContect = fs.readFileSync(file).toString()\n console.log(fileContect)\n}", "function readFile(){\n var readFileName = \"i:\\\\schema\\\\ab-system\\\\convert\\\\test-views\\\\resttest.avw\";\n // Show filename on test .htm form.\n $('readFileDiv').innerHTML = readFileName;\n // Read file.\n var myReader = new AFM.ViewDef.Reader();\n myReader.readFile(readFileName);\n alert(\"File Contents: \\n\" + myReader.fileContents);\n}", "function file_read(file, callback=null) {\n $.ajax({\n url: file,\n success: callback\n });\n}", "function selectFile($files){\n \t File.upload($files);\n \t}", "function read_file(filename) {\n var file_data = data.load(filename);\n return file_data;\n}", "function fileSelected(data, evt) {\n /*jshint validthis: true */\n this.file = evt.target.files[0];\n if (this.file)\n this.filename(this.file.name);\n this.errorMessage('');\n }", "function handleFileSelect(evt) {\n // Get the file\n var files = evt.target.files; // FileList object\n\n // Call the parse method\n var xl2json = new ExcelToJSON();\n xl2json.parseExcel(files[0]);\n}", "function handleFile(e) {\n setLoadingState(\"Loading\")\n var file = e.target.files[0];\n let fileName = file.name.split(\" \").join(\"-\");\n console.log(fileName);\n var reader = new FileReader();\n reader.onload = function (event) { //on loading file.\n console.log(event.target.result);\n var unconverteFile = event.target.result;\n var convertedFile;\n switch (format) {\n case \"JSON\":\n convertedFile = jsonJSON(unconverteFile);\n fileName = fileName.substring(0, fileName.indexOf(\".json\"));\n break;\n case \"CSV\":\n convertedFile = csvJSON(unconverteFile);\n fileName = fileName.substring(0, fileName.indexOf(\".csv\"));\n break;\n case \"SSV\":\n convertedFile = ssvJSON(unconverteFile);\n fileName = fileName.substring(0, fileName.indexOf(\".csv\"));\n break\n default:\n convertedFile = jsonJSON(unconverteFile);\n }\n dispatchDeleteSel();\n dispatchLoad(convertedFile);\n setLoadingState(\"Loaded\");\n dispatchKeys(createKeys(convertedFile));\n dispatchLoadName(fileName);\n dispatchExtended(false);\n }\n reader.readAsText(file);\n }", "function readenhancer() {\n var f = document.getElementById('enhancer').files[0];\n\n $.mobile.loading().show();\n\n if (f) {\n if(f.name.match(\".csv\") || f.name.match(\".txt\")){\n\n getenhancer(f);\n }\n else{alert(\"input format error\")}\n\n } else {\n alert(\"Failed to load file\");\n }\n\n}", "function selectFile(evt) {\n\t\tvar last_file = {};\n\t\tif (context_element && (context_element.type == 2)) {\n\t\t\tlast_file = context_element;\n\t\t}\n\t\tcontext_element = getElProp(evt);\n\t\tif (context_element.type == 1) {\n\t\t\t// If select directory then open the directory\n\t\t\t// if index >= 0 then select subfolde, if index < 0 - then select up folder\n\t\t\tif (context_element.index >= 0) {\n\t\t\t\tgetDirContent(cur_path + context_element.name + '/');\n\t\t\t} else {\n\t\t\t\tvar\n\t\t\t\t\tpath = '',\n\t\t\t\t\ti\n\t\t\t\t;\n\t\t\t\tfor (i = dir_content.path.length + context_element.index; i >= 0; i--) {\n\t\t\t\t\tpath = dir_content.path[i] + '/' + path;\n\t\t\t\t}\n\t\t\t\tgetDirContent('/' + path);\n\t\t\t}\n\t\t} else if (context_element.type == 2) {\n\t\t\t// Іf select the file then highlight and execute the external functions with the file properties\n\t\t\thighlightFileItem(context_element.index);\n\t\t\t// If set the external function - then execute it\n\t\t\tif (on_select || on_dblselect) {\n\t\t\t\tvar file = dir_content.files[context_element.index];\n\t\t\t\t// Generate additional field\n\t\t\t\tfile.path = cur_path + file.name;\n\t\t\t\tfile.wwwPath = getURIEncPath(HTMLDecode(upload_path + cur_path + file.name));\n\t\t\t\t// If thumbnail exist, set the www path to him\n\t\t\t\tif (file.thumb && file.thumb !== '') {\n\t\t\t\t\tfile.wwwThumbPath = getURIEncPath(HTMLDecode(upload_path + file.thumb));\n\t\t\t\t}\n\t\t\t\tif (on_select) {\n\t\t\t\t\ton_select(file);\n\t\t\t\t}\n\t\t\t\t// If double click on file then chose them by on_dblselect() function\n\t\t\t\tif ( on_dblselect &&(last_file.index == context_element.index) && ((context_element.time - last_file.time) < dbclick_delay) ) {\n\t\t\t\t\ton_dblselect(file);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// No selections\n\t\t\t// Clean the highlight\n\t\t\thighlightFileItem();\n\t\t\t// Hide the tooltips\n\t\t\thideTooltips();\n\t\t\t// If set the external function - then execute it\n\t\t\tif (on_deselect) {\n\t\t\t\ton_deselect();\n\t\t\t}\n\t\t}\n\t}", "function handleFiles2(files) {\n if (window.FileReader) {\n getAsText2(files[0]);\n } else {\n alert('FileReader are not supported in this browser.');\n }\n}", "function doFileSelect(fileObj) {\n\n\t\t\tif (!(typeof fileObj.attr === 'string' || typeof fileObj.date === 'string' || typeof fileObj.dir === 'string' || typeof fileObj.ext === 'string' || typeof fileObj.fullpath === 'string' || typeof fileObj.mime === 'string' || typeof fileObj.height === 'string' || typeof fileObj.height === 'number' || typeof fileObj.name !== 'string' || typeof fileObj.size !== 'number' || typeof fileObj.type !== 'string' || typeof fileObj.width === 'string' || typeof fileObj.width === 'number')) {\n\n\t\t\t\t// debug the file selection settings (if debug is turned on and console is available)\n\t\t\t\tif (sys.debug) {\n\t\t\t\t\tconsole.log(fileObj);\n\t\t\t\t}\n\n\t\t\t\tdisplayDialog({\n\t\t\t\t\ttype: 'throw',\n\t\t\t\t\tstate: 'show',\n\t\t\t\t\tlabel: 'Oops! There was a problem',\n\t\t\t\t\tcontent: 'There was a problem reading file selection information.'\n\t\t\t\t});\n\n\t\t\t} else if (typeof tinyMCE !== 'undefined' && typeof tinyMCEPopup !== 'undefined') {\n\t\t\t\tvar win = tinyMCEPopup.getWindowArg('window'),\n\t\t\t\t\trelPath = fileObj.dir + fileObj.name;\n\n\t\t\t\t// insert information into the tinyMCE window\n\t\t\t\twin.document.getElementById(tinyMCEPopup.getWindowArg('input')).value = relPath;\n\n\t\t\t\t// for image browsers: update image dimensions\n\t\t\t\tif (win.ImageDialog) {\n\t\t\t\t\tif (win.ImageDialog.getImageData) {\n\t\t\t\t\t\twin.ImageDialog.getImageData();\n\t\t\t\t\t}\n\t\t\t\t\tif (win.ImageDialog.showPreviewImage) {\n\t\t\t\t\t\twin.ImageDialog.showPreviewImage(relPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// close popup window\n\t\t\t\ttinyMCEPopup.close();\n\n\t\t\t} else {\n\n\t\t\t\t// We are a standalone mode. What to do, is up to you...\n\t\t\t\tif (opts.callBack !== null) {\n\n\t\t\t\t\t// user passed a callback function\n\t\t\t\t\topts.callBack(fileObj);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// just do a simple throw\n\t\t\t\t\tdisplayDialog({\n\t\t\t\t\t\ttype: 'throw',\n\t\t\t\t\t\tstate: 'show',\n\t\t\t\t\t\tlabel: 'Standalone Mode Message',\n\t\t\t\t\t\tcontent: 'You selected' + (fileObj.dir + fileObj.name) + '<br />' + fileObj.fullpath\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "function handleFile(e) {\n var files;\n\n if (e.type === 'drop') {\n files = e.dataTransfer.files\n } else if (e.type === 'change') {\n files = e.target.files;\n }\n\n if (window.FileReader) {\n // FileReader is supported.\n readFile(files);\n } else {\n alertify.alert(\"<img src='/images/cancel.png' alt='Error'>Error!\", 'FileReader is not supported in this browser.');\n }\n }", "function read(path,method) {\n method = method || 'readAsText';\n return file(path).then(function(fileEntry) {\n return new Promise(function(resolve,reject){\n fileEntry.file(function(file){\n var reader = new FileReader();\n reader.onloadend = function(){\n resolve(this.result);\n };\n reader[method](file);\n },reject);\n });\n });\n }", "function readSingleFile(e) {\n // IF WE SELECTED THE FILE FROM BUTTON THEN HANDLE THIS WAY\n if(e.type == \"change\"){\n var file = e.target.files[0];\n if (!file) {\n return;\n }\n }\n else // ELSE, IT MUST BE FROM DRAG AND DROP, HANDLE THIS WAY\n {\n var file = e.dataTransfer.files[0];\n if(!file) {\n return;\n }\n }\n // CHECK IF THE FILE IS OF TYPE XLSX\n if(validateFileType(file)){\n var dragarea = document.getElementById('drag-and-drop');\n dragarea.classList.add('dropped');\n var reader = new FileReader();\n\n reader.readAsBinaryString(file);\n\n reader.onload = function(e) {\n var contents = e.target.result;\n loadExcel(contents);\n document.getElementById('small-hint').innerHTML = \"(\" + file.name + \")\";\n };\n }\n}", "function FileReader () {}", "function readSingleFile(evt) {\n\t\tconsole.log('READ File -> ' + evt.target.files[0]);\t\n\t\t//Retrieve the first (and only!) File from the FileList object\n\t\t\tvar f = evt.target.files[0]; \n\t\t\tif (f) {\n\t\t\t\tvar r = new FileReader();\n\t\t\t\tr.onload = function(e) { \n\t\t\t\tvar contents = e.target.result;\n\t\t\t\tvar obj = JSON.parse(contents);\n\n\t\t\t\t//console.log('LOAD data Canvas = ' + JSON.parse(obj).namecard);\t\t\n\t\t\t\tconsole.log('LOAD data Canvas = ' + obj.namecard);\t\t\n\t\t\t\t//location.href=\"bcard.php?product=\"+obj.namecard+\",\";\n\t\t\t\tif (obj.namecard == getNameproduct)\n\t\t\t\t\tcanvas.loadFromJSON(obj, canvas.renderAll.bind(canvas));\n\t\t\t\telse location.href=\"bcard.php?product=\"+obj.namecard + '&reloadpage=true';\n\t\t\t\t//canvas.loadFromJSON(contents, canvas.renderAll.bind(canvas));\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\tr.readAsText(f);\n\t\t\t\t$.fancybox.close( true );\n\t\t\t\t$(\"#fileloadtempl\").val('');\n\t\t\t\t\n\t\t\t\t \n\t\t\t} \n\t\t\telse { \n\t\t\t\talert(\"Failed to load file\");\n\t\t\t}\n\t\n\t\t}", "function readFromFile(fileName) {\n var pathToFile = cordova.file.dataDirectory + fileName;\n window.resolveLocalFileSystemURL(fileName, function (fileEntry) {\n var reader = new FileReader();\n readr.onloadend = function (e) {\n console.log(e);\n //console.log(JSON.parse(this.result)); \n //var srcData = fileLoadedEvent.target.result; \n };\n reader.readAsDataURL(e.target.files[0]);\n //reader.readAsText(file);\n }, errorHandler.bind(null, fileName));\n }", "function loadpresetfromfile(selectedfile){\n\tvar file = selectedfile.files[0];\n\tvar reader = new FileReader();\n\treader.onload = function(progressEvent){\n\t\tvar lines = this.result.split('\\n');\n\t\tloadpresetvalues(lines);\n\t};\n\treader.readAsText(file);\n}", "readSingleFile(ev) {\n //Retrieve the first (and only!) File from the FileList object\n if(this.has_csv) {\n this.headTableTarget.innerHTML = ``\n this.bodyTableTarget.innerHTML = ``\n } \n var f = ev.target.files[0];\n if (f) {\n var r = new FileReader();\n const this_controller = this\n r.onload = function (e) {\n var contents = e.target.result;\n this_controller.csv = contents\n this_controller.has_csv = true\n this_controller.csvToTable(this_controller.csv)\n }\n r.readAsText(f)\n } else {\n alert(\"Failed to load file\");\n }\n }", "function getAsText1(fileToRead) {\n var reader = new FileReader();\n\n reader.readAsText(fileToRead);\n\n reader.onload = loadHandler1;\n reader.onerror = errorHandler;\n}", "function readfile(){\n\tvar fileinput =\"\"\n\tvar fileswitch=\"\"\n\tfs.readFile(randfile, \"utf8\", function(error, data){\n\t\tif (error){\n\t\t\treturn console.log(\"error in the file reader\");\n\t\t}\n\t\tconsole.log(\"you are reading file\");\n\t\tdataArr = data.split(\",\");\n\t\tconsole.log(dataArr);\n\t\tfileswitch = dataArr[0];\n\t\tconsole.log(\"holder is \" + fileswitch);\n\t\tfileinput= dataArr[1];\n\t\tconsole.log(\"raw output is \"+fileinput);\n\t\tuserinput=fileinput.replace(/ /g, \"+\").replace(/\"/g, \"\");\n\t\tconsole.log(userinput);\n\t\tconsole.log(\"switcher is \" + switcher + \"and you are in the first if fileswitch is \" + fileswitch);\n\t\tswitcher = fileswitch;\n\t\tconsole.log(\"post replacement switcher \"+switcher);\n\t\tapiCalls();\n\t});\n}", "function readFile(inputFile) {\n var fr = new FileReader();\n fr.onload = function(e) {\n $(\"#hiddenFile\").val(e.target.result);\n };\n fr.readAsText(inputFile);\n}", "function readFile(print) {\n const ERR_MESS_READ = \"TODO: Trouble reading file.\";\n\n var i;\n\n todocl.dbx.filesDownload({\n path: todocl.path\n }).then(function (response) {\n var textBlob, reader;\n\n textBlob = response.fileBlob;\n reader = new FileReader();\n\n reader.addEventListener(\"loadend\", function () {\n var contents = reader.result;\n todocl.textArr = contents.split(NEW_LINE);\n\n setText(todocl.textArr,\n function (callBack) {\n if (callBack && print) {\n displayFile();\n }\n if (callBack) {\n\n }\n });\n });\n reader.readAsText(textBlob);\n }).catch(function (Error) {\n todocl.out.innerHTML = ERR_MESS_READ;\n });\n }", "async read(filepath) {\n try {\n return await this.reader(filepath, 'utf-8');\n } catch (error) {\n return undefined;\n }\n }", "function fileSelected(file) {\n // Clear file selection listeners\n const reportSelector = document.getElementById('report_file_input');\n reportSelector.removeEventListener('change', fileInputValueChanged);\n const dropArea = document.getElementById('drop_target');\n dropArea.removeEventListener('dragover', dragoverEvent);\n dropArea.removeEventListener('drop', dropEvent);\n document.getElementById('report_upload').hidden = true;\n document.getElementById('loading').hidden = false;\n document.getElementById('local_file').innerText = file.name;\n const fileReader = new FileReader();\n fileReader.addEventListener('load', () => {\n const statistics = JSON.parse(fileReader.result);\n document.getElementById('loading').hidden = true;\n document.getElementById('viewer').hidden = false;\n allStatistics = statistics;\n reloadStatistics();\n });\n fileReader.readAsText(file);\n}", "function readFile(filepath) {\n fs.readFile(filepath, 'utf-8', function (err, data) {\n if (err) {\n alert(\"An error ocurred reading the file :\" + err.message);\n return;\n }\n // Change how to handle the file content\n content = data;\n // console.log(\"The file content is : \" + data);\n document.getElementById(\"content-editor\").value = content;\n });\n}", "function read(path, method) {\n method = method || 'readAsText';\n return file(path).then(function (fileEntry) {\n return new Promise(function (resolve, reject) {\n fileEntry.file(function (file) {\n var reader = new FileReader();\n reader.onloadend = function () {\n resolve(this.result);\n };\n reader[method](file);\n }, reject);\n });\n });\n }", "function readRandomTxtFile() {\n // read the random.txt file\n fs.readFile('random.txt', 'utf8', function (error, data) {\n // If the code experiences any errors it will log the error to the console.\n if (error) {\n return console.log(error)\n }\n // split the text file data by commas and place into an array\n var dataArr = data.split(',')\n\n // assign command and query values based on the text file data\n userCommand = dataArr[0];\n userQuery = dataArr[1];\n // run the switch case with the given command\n runLiri(userCommand)\n })\n}", "function _readFile(evt) {\n //Retrieve the uploaded File\n const file = evt.target.files[0],\n fileReader = new FileReader();\n\n //callback once file loaded, the loaded file is in text format\n fileReader.onload = function(content) {\n\n // Step 1: convert the textfile to obtain HTML DOM object to access the info section\n let toHTMLDOM = convertToHTMLDOM(content);\n\n // Step 2: create a map for the bio obtained via DOM acceess\n fetchVCardData(toHTMLDOM);\n\n // branch to reset the page, when a second file is uploaded\n if (properties.container.childNodes.length > 0) {\n resetPage();\n }\n\n //Step 3: create the network\n createNetwork();\n }\n fileReader.readAsText(file);\n }", "function readSingleFile(e, callback) {\n var file = e.target.files[0];\n if (!file) {\n return;\n }\n var reader = new FileReader();\n reader.onload = function (e) {\n var contents = e.target.result;\n callback(contents)\n };\n reader.readAsText(file);\n}", "function readFileInfo(x){\n\tconsole.log(\"Cur \" + x + \" Tot \" + nrOfFiles);\n\tif (x >= nrOfFiles) {\n\t\tofferShare();\n\t\treturn;\n\t}\n\tvar f = files[x];\n\tvar reader = new FileReader();\n\t\treader.onloadend = function (e) {\n\t\t\tif(reader.readyState == FileReader.DONE){\n\t\t\t\tconsole.log(f.name);\n\t\t\t\tfmArray[x].stageLocalFile(f.name, f.type, reader.result);\n\t\t\t\treadFileInfo(x+1);\n\t\t\t}\n\t\t}; \n\t\treader.readAsArrayBuffer(f);\n}", "function processSelectedFile(filePath, requestingField) {\n $('#' + requestingField).val(filePath).trigger('change');\n}", "function FileReader() {}", "function fileGoClick() {\r\n originalText = '';\r\n\r\n var file = $('#inputFile')[0].files[0];\r\n\r\n if (file) {\r\n var reader = new FileReader();\r\n reader.readAsText(file, \"UTF-8\");\r\n reader.onload = function (evt) {\r\n originalText = evt.target.result;\r\n $('#render').html(originalText);\r\n getHuffmanCodes(originalText);\r\n calculateCompression();\r\n $('#results').css('visibility', 'visible');\r\n }\r\n reader.onerror = function (evt) {\r\n alert(\"Error reading file\");\r\n }\r\n }\r\n\r\n $('.modal-title').html(file['name']);\r\n $('#mod-date').html(file['lastModifiedDate']);\r\n}", "onFileSelected(event) {\n this.selectedFiles = event.target.files;\n }", "function parseFile(file) {\n\n if (window.File && window.FileReader && Window.FileList && window.Blob) {\n alert(\"File Reader APIs not up to date on current browser.\")\n return\n }\n \n //create file reader \n var reader = new FileReader()\n\n\n if(file.files && file.files[0]) {\n reader.onload = function (e) {\n parseInput(e.target.result)\n }\n\n reader.readAsText(file.files[0])\n }\n else {\n alert(\"Error reading file.\")\n }\n\n}", "function InFile() {\r\n}", "function selectFiles() {\n return File.openDialog(\"选择需要处理的png文件\", \"*.png\", true);\n}", "function selectFile(fileId) {\n console.log(\"fileId: \" + fileId);\n document.getElementById(fileId).click();\n}", "function readUploadedFile(){\n\tvar uploadedFile = document.getElementById(\"uploadFile\");\n}", "_read () {\n let { filename } = this\n return new Promise((resolve, reject) =>\n fs.readFile((filename), (err, content) => err ? reject(err) : resolve(content))\n ).then(JSON.parse)\n }", "function readFile(file,encodingType){\n var handler;\n\n document.getElementById(\"read_test_file_name\").innerText=file.name;\n alert(file.name);\n\n// document.getElementById(\"fileName\").textContent = file.name;\n\n// document.getElementById(\"fileSize\").textContent = file.size;\n\n\n\n var reader = new FileReader();\n\n// var encodeList = document.getElementById(\"encoding\");\n\n\n var encoding;\n if(encodingType==undefined)encoding=\"utf-8\";\n else encoding = encodingType;//encodeList.options[encodeList.selectedIndex].value;\n\n reader.readAsText(file, encoding);\n// reader.readAsArrayBuffer(file);\n// reader.readAsBinaryString(file);\n\n reader.onprogress = function ()\n {\n var display = document.getElementById(\"read_test\");\n display.innerText = \"읽는 중...\";\t\t// 읽은 파일\n }\n reader.onload = function(){\n var display = document.getElementById(\"read_test\");\n display.textContent = reader.result + \"\\nresult 길이 : \" + reader.result.length;\t\t// 읽은 파일\n alert(\"파일 로드 완료\");\n }\n reader.onerror = function(e){\n alert(\"읽기 오류:\" + e.target.error.code);\n return;\n }\n}", "function openFileOrDirectory() {\n dialog.showOpenDialog(win, { \n title: \"Select File(s)\", \n defaultPath: process.env.HOME,\n buttonLabel: \"Choose File(s)\", \n filters: \n [\n { \n name: 'All Files', \n extensions: ['*'] \n }\n ],\n properties: \n [\n \"openFile\", \n \"multiSelections\", \n \"showHiddenFiles\", \n \"openDirectory\"\n ]\n }).then(result => {\n selectedFiles = result.filePaths;\n win.webContents.send('picked-files', { selected: selectedFiles });\n }).catch(err => { \n console.log(err); \n });\n}", "file () {\n try {\n const file = this.currentFile()\n\n if (!file) throw createError({ code: 'ENOENT', message: 'No file selected' })\n return file\n } catch (e) {\n throw new Error(e)\n }\n }", "function handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n\n var files = evt.dataTransfer.files; // FileList object.\n\n // files is a FileList of File objects. List some properties.\n var output;\n for (var i = 0, f; f = files[i]; i++) {\n output=f.name;\n }\n document.getElementById('textarea').value = output;\n }", "function handleFile(file) {\n // Check for the various File API support.\n if (window.FileReader) {\n // FileReader are supported.\n var reader = new FileReader();\n reader.onload = loadHandler;\n reader.onerror = errorHandler;\n reader.readAsText(file)\n } else {\n alert('FileReader is not supported in this browser, so your uploaded user dataset cannot be read.');\n }\n }", "function _getDataFromFile(){\n\tvar fileData = _openFIle();\n\treturn fileData;\n}", "async function chooseFile() {\n // Pick a single file\n try {\n const file = await DocumentPicker.pick({\n type: [DocumentPicker.types.allFiles],\n });\n const path = await normalizePath(file.uri);\n const result = await RNFetchBlob.fs.readFile(path, \"base64\");\n uploadFileToFirebaseStorage(result, file, user);\n console.log(result);\n } catch (err) {\n if (DocumentPicker.isCancel(err)) {\n // User cancelled the picker, exit any dialogs or menus and move on\n } else {\n throw err;\n }\n }\n }", "function readText() {\n\n fs.readFile(\"random.txt\", \"utf8\", function (error, data) {\n var dataArr = data.split(\",\");\n\n // Calls switch case \n switcher(dataArr[0], dataArr[1]);\n });\n}", "function ReadTheFile() {\n\n // Confirm file extension and read the data as text\n console.log(\"Reading the file...\");\n filePath = document.getElementById('mapFile').value;\n if (!filePath.endsWith(\".asc\")) {\n throw \"Error opening the file: Invalid file extension, .asc expected.\";\n return;\n }\n\n let file = document.getElementById('mapFile').files[0];\n let reader = new FileReader();\n reader.onload = () => {\n dataString = event.target.result;\n console.log(\"Done.\");\n\n if (uploadToDb) {\n uploadToDb = false;\n WriteToDb();\n }\n else {\n AfterFileIsRead();\n }\n }\n reader.onerror = () => {\n throw \"Error opening the file: Cannot read file.\";\n return;\n }\n reader.readAsText(file);\n}", "read(filePath) {\n\t\t\tif (filePath === textureList) return []\n\t\t}", "function assignmentsFileSelected() {\n\tvar idx = assignmentsGetCurrentIdx();\n\tif (idx == -1) return;\n\t\n\tvar filesSelect = document.getElementById(\"filesSelect\");\n\tvar currentFile = filesSelect.options[filesSelect.selectedIndex].value;\n\t\n\tfor (var j=0; j<assignments[idx].files.length; j++) {\n\t\tif (assignments[idx].files[j].filename == currentFile) {\n\t\t\t//document.getElementById('fileName').value = assignments[idx].files[j].filename;\n\t\t\tvar span = document.getElementById('fileNameSpan');\n\t\t\twhile( span.firstChild ) {\n\t\t\t\tspan.removeChild( span.firstChild );\n\t\t\t}\n\t\t\tspan.appendChild( document.createTextNode(assignments[idx].files[j].filename) );\n\t\t\t\n\t\t\tdocument.getElementById('fileBinary').checked = assignments[idx].files[j].binary;\n\t\t\tdocument.getElementById('fileShow').checked = assignments[idx].files[j].show;\n\t\t}\n\t}\n\t\n\tdocument.getElementById('assignmentChangeMessage').style.display='none';\n\tdocument.getElementById('uploadFileWrapper').style.display='none';\n}", "function handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n\n // Get the FileList object that contains the list of files that were dropped\n var files = evt.dataTransfer.files;\n\n // this UI is only built for a single file so just dump the first one\n dumpFile(files[0]);\n }", "function handleFileSelect(evt) {\n var files = evt.target.files; // FileList object\n\n // Loop through the FileList and render image files as thumbnails.\n for (var i = 0, f; f = files[i]; i++) {\n\n // Only process image files.\n console.log(f.type);\n\n var reader = new FileReader();\n\n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(e) {\n doc.name = theFile.name ;\n\t doc.content = e.target.result;\n\t switchToPanel('adjust');\n\t document.getElementById('span_filename').innerHTML = doc.name;\n };\n })(f);\n\n // Read in the file as Text -utf-8.\n reader.readAsText(f);\n }\n}", "function f_select (ev) {\n\t\tif (!_allowed ('write','control'))\n\t\t\treturn false;\n\n\t\tvar _val = get_map_entry(ev);\n\t\tvar file = ev.target.files[0];\n\t\tvar reader = new FileReader();\n\t\tif (!file) {\n\t\t\teditor.focus();\n\t\t\treturn;\n\t\t}\n\n\t\treader.onload = function (f) {\n\t\t\tload_file(f, _val, file);\n\t\t};\n\t\treader.readAsText(file);\n\t}", "async openFile() {\n const fileNames = await this.openOpenFileDialog(\"Open Save File\");\n\n if (fileNames === undefined) {\n return;\n }\n\n const filePath = fileNames[0];\n await this.readSaveFile(filePath);\n }", "function readfile(path)\r\n{\r\n return fs.readFileSync(path,'UTF8',function(data,err)\r\n {\r\n if(err) throw err;\r\n return data\r\n });\r\n}", "openFile() {\n if (this.loadView.loadFileInput.files.length > 0) {\n var file = this.loadView.loadFileInput.files.item(0);\n var event = new CustomEvent(\"fileload\", { 'detail': file });\n document.dispatchEvent(event);\n }\n }", "async function chooseFile() {\n // Pick a single file\n try {\n const file = await DocumentPicker.pick({\n type: [DocumentPicker.types.allFiles],\n });\n const path = await normalizePath(file.uri);\n const result = await RNFetchBlob.fs.readFile(path, \"base64\");\n uploadFileToFirebaseStorage(result, file,user);\n console.log(result);\n } catch (err) {\n if (DocumentPicker.isCancel(err)) {\n // User cancelled the picker, exit any dialogs or menus and move on\n } else {\n throw err;\n }\n }\n }", "function getAsText2(fileToRead) {\n var reader = new FileReader();\n\n reader.readAsText(fileToRead);\n\n reader.onload = loadHandler2;\n reader.onerror = errorHandler;\n}", "function readFile(fileEntry) {\n\n // Get the file from the file entry\n fileEntry.file(function (file) {\n \n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n\n reader.onloadend = function() {\n\n console.log(\"Successful file read: \" + this.result);\n console.log(\"file path: \" + fileEntry.fullPath);\n\n };\n\n }, onError);\n}", "read() {\n return fs.readFileSync(this.filepath).toString();\n }", "openFiles() {\n this.hideViewer();\n this.clearFilters();\n const errors = document.getElementById('marot-errors');\n errors.innerHTML = '';\n const filesElt = document.getElementById('marot-file');\n const numFiles = filesElt.files.length;\n if (numFiles <= 0) {\n document.body.style.cursor = 'auto';\n errors.innerHTML = 'No files were selected';\n return;\n }\n let erroneousFile = '';\n try {\n const filesData = [];\n const fileNames = [];\n let filesRead = 0;\n for (let i = 0; i < numFiles; i++) {\n filesData.push('');\n const f = filesElt.files[i];\n fileNames.push(f.name);\n erroneousFile = f.name;\n const fr = new FileReader();\n fr.onload = (evt) => {\n erroneousFile = f.name;\n filesData[i] = fr.result;\n filesRead++;\n if (filesRead == numFiles) {\n if (typeof marotDataConverter == 'function') {\n for (let i = 0; i < filesData.length; i++) {\n filesData[i] = marotDataConverter(fileNames[i], filesData[i]);\n }\n }\n this.setData(filesData);\n }\n };\n fr.readAsText(f);\n }\n /**\n * Set the file field to empty so that re-picking the same file *will*\n * actually reload it.\n */\n filesElt.value = '';\n } catch (err) {\n let errString = err +\n (errnoeousFile ? ' (file with error: ' + erroneousFile + ')' : '');\n errors.innerHTML = errString;\n filesElt.value = '';\n }\n }", "function onFileSelected(files) {\n for(let file of files) {\n handleSelectedFile(file);\n }\n}", "function pickFile(action) {\n inquirer\n .prompt([\n {\n name: \"choice\",\n type: \"rawlist\",\n choices: info.directory_files,\n message: \"Which file would you like to work on?\"\n }\n ]).then(function(answer){\n //store users selection in \"file\" and send to run/view-Scores\n let file = answer.choice;\n if (action === \"view\") {\n viewScores(file);\n } else {\n runScores(file, \"one\");\n }\n })\n\n \n}", "function loadFile(filePath) {\n var result = null;\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", filePath, false);\n xmlhttp.send();\n if (xmlhttp.status==200) {\n result = xmlhttp.responseText;\n }\n return result;\n }", "read(file) {\n return this[FILES][file] || null;\n }", "function filesSelected(event) {\n processImport(event.target.files, 0);\n}" ]
[ "0.7307276", "0.72197986", "0.71588254", "0.71148825", "0.6770334", "0.6712162", "0.65847474", "0.6491801", "0.6486233", "0.64474523", "0.64361787", "0.6424571", "0.63902324", "0.6305965", "0.6283209", "0.62754637", "0.62336105", "0.62295175", "0.6210619", "0.618147", "0.61711663", "0.6137692", "0.6102037", "0.6094376", "0.60924524", "0.60913986", "0.60614324", "0.60320604", "0.603168", "0.6027187", "0.6024105", "0.6016508", "0.59974533", "0.5991056", "0.5985416", "0.59788275", "0.597841", "0.5977897", "0.5966649", "0.5958711", "0.5951474", "0.5940544", "0.5938735", "0.59282106", "0.5924503", "0.592177", "0.5915028", "0.5888332", "0.5887482", "0.5883898", "0.5881586", "0.58803713", "0.58802915", "0.5879607", "0.58766836", "0.5866505", "0.58449084", "0.58327883", "0.5812104", "0.579996", "0.5799442", "0.57716393", "0.5759036", "0.5731077", "0.5730483", "0.5727678", "0.57252735", "0.57231086", "0.5720681", "0.5716068", "0.570768", "0.57010514", "0.56991154", "0.56978583", "0.5691819", "0.5691754", "0.56840247", "0.56838375", "0.56834465", "0.568109", "0.5666041", "0.5663109", "0.5644242", "0.5642784", "0.5642511", "0.5640838", "0.56349576", "0.56333184", "0.5630819", "0.5624695", "0.5621686", "0.5614078", "0.5613967", "0.560266", "0.56016064", "0.5600315", "0.55853546", "0.55842245", "0.55818886", "0.55670357" ]
0.6013231
32
Function to calculate data from POST request
function calculateNum(firstNumber, operator, secondNumber) { if (operator === '+') { //.toFixed to round to 1 decimal point result = (firstNumber + secondNumber).toFixed(1); } else if (operator === '-') { result = (firstNumber - secondNumber).toFixed(1); } else if (operator === '*') { result = (firstNumber * secondNumber).toFixed(1); } else if (operator === '/') { result = (firstNumber / secondNumber).toFixed(1); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PostCalc(data){\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"https://stormy-lowlands-53016.herokuapp.com/quoteform\",\r\n contentType: \"application/json\",\r\n data: data,\r\n dataType: \"json\",\r\n success: function(res, status){\r\n if (status != \"success\") {\r\n console.log(\"Error loading response\");\r\n return;\r\n }\r\n ShowElevs(res.elevs);\r\n if (res.total !== \"\") {\r\n ShowTotals(res.subtotal, res.fee, res.total);\r\n }\r\n },\r\n error: function(result, status, err) {\r\n console.log(\"Error loading data\");\r\n return;\r\n }\r\n });\r\n}", "function add(calculation) {\n $.ajax({\n type: 'POST',\n url: '/calcadd',\n data: calculation,\n success: function(totalnumber) {\n console.log('post request successful!');\n\n }\n })\n}", "function calculator(){\n //object to POST\n calculate ={\n num1: $('#number1').val(),\n num2: $('#number2').val(),\n operator: operator\n }//end object to calculate\n console.log(calculate);\n //POST Route\n $.ajax({\n type: 'POST',\n url: '/calculated',\n data: calculate\n }).then(function(response){\n console.log('back from Post with', response)\n }).catch(function(err){\n alert('error calculating')\n })\n console.log('in calculate');\n //call to display calculation\n displayCalculation();\n displayPastCalculation();\n //empty values\n $('#number1').val('');\n $('#number2').val('');\n}//end calculator", "function calculateOnServer() {\n resetData();\n\n // Get the input-data from the client\n var x = $(\"#num1\").val();\n var y = $(\"#num2\").val();\n\n // Connect to internal server and get data from it\n $.ajax({\n\n // Get from the server the function 'sum' result. Function 'sum' recieves param a & param b.\n url: \"http://localhost:8080/sum?a=\" + x + \"&b=\" + y,\n type: \"GET\",\n success: function(server_response) {\n\n // If the call to the function \"get\" from the URl is succeful, put the data from the local server\n if (server_response != \"\") {\n $(\"#data\").append(server_response);\n }\n\n // If there is not response from the server, put \"not OK\" into the parameter id 'data'\n else {\n alert('Not OKay');\n }\n }\n });\n}", "function tddCalculator () {\n const username = $(\"#signup-username\").val();\n\n let bolusGET = $.ajax({\n type: 'GET',\n url: `/logs-bolus/${username}`,\n dataType: 'json',\n contentType: 'application/json'\n }),\n basalGET = $.ajax({\n type: 'GET',\n url: `/logs-basal/${username}`,\n dataType: 'json',\n contentType: 'application/json'\n })\n\n $.when(bolusGET, basalGET).done(function(bolus, basal) {\n console.log(bolus[0]);\n console.log(basal[0]);\n\n //Update average TDD per 24hrs on screen\n\n $('#user-dashboard').hide();\n $('#logs').show();\n }).fail(function (jqXHR, error, errorThrown) {\n console.log(jqXHR, error, errorThrown);\n });\n //TDD calculations?\n let tddBolus = bolus[0].reduce((acc, currentVal, currentIndex) => {\n console.log(acc, currentVal.bolusAmount);\n return acc + currentVal.bolusAmount;\n }, 0)\n console.log(tddBolus);\n let tddBasal = basal[0].reduce((acc, currentVal, currentIndex) => {\n console.log(acc, currentVal.insulinUnits);\n return acc + currentVal.insulinUnits;\n }, 0)\n console.log(tddBasal);\n}", "async calculate (req, res, next) {\n try {\n console.log(req.body)\n\n // make sure that the request has the necessary body items\n if (!req.body.bottlePrice) {\n throw new Error('Bottle price not found')\n }\n if (!req.body.bottleSize) {\n throw new Error('Bottle size not found')\n }\n if (!req.body.pourAmount) {\n throw new Error('Pour Amount not found')\n }\n if (!req.body.liquorCostPercentage) {\n throw new Error('Liquor cost percentage not found')\n }\n\n let beverageCost = 0\n\n if(req.body.bottleSize === 750){\n beverageCost = ((req.body.bottlePrice/25.4)*req.body.pourAmount)/(req.body.liquorCostPercentage/100)\n }else if(req.body.bottleSize === 1000){\n beverageCost = ((req.body.bottlePrice/33.8)*req.body.pourAmount)/(req.body.liquorCostPercentage/100)\n }else if(req.body.bottleSize === 1750){\n beverageCost = ((req.body.bottlePrice/59.2)*req.body.pourAmount)/(req.body.liquorCostPercentage/100)\n }\n beverageCost = Math.round(beverageCost*100)/100 // round to two decimal places\n\n res.json({\n beverageCost: beverageCost\n })\n\n }catch (e) {\n res.sendStatus(500)\n console.log('error! ', e)\n next(e)\n }\n }", "function postCalculations() {\n $.ajax({\n type: 'POST',\n url: '/calculate',\n data: equationObject,\n })\n .then((response) => {\n getUserHistory();\n })\n .catch((err) => {\n console.log(err);\n alert('Nope Wrong way');\n });\n}", "function getData()\n{\n\tlet data_1 = input_hours.value\n\tlet data_2 = input_minutes.value\n\n\tclearInputs() \n\n\n\tajaxPost(data_1, data_2) // Llamada a ajax post\n}", "function getComputation() {\n $.ajax({\n type: 'GET',\n url: '/math/',\n success: function (amount) {\n clearInfo();\n MathForm.total = amount;\n $('#x').val(MathForm.total);\n MathForm.x = '';\n },\n });\n}", "function Calc() {\n\n\n this.showThisInputFromTheControlPanel = function(i) {\n var regxSymbol = /[%|/|*|+|-|=|sqrt]/;\n var temp = $('#result').attr('value');\n\n if (temp == null \n || i.match(regxSymbol) != null\n || data.oneNumber == '') {\n temp = '';\n }\n\n $('#result').attr('value', temp + i);\n\n };\n this.clearData = function() {\n data.oneFieldReady = false;\n data.oneNumber = '';\n data.twoNumber = '';\n data.operation = '';\n\n };\n\n//method of sending request \n this.post = function() {\n\n var result = JSON.stringify(data);\n console.log(result);\n\n $.ajax({\n type: 'POST',\n url: '/calculate/calc/json',//TODO \n dataType: 'html',\n headers: {'Content-Type': 'application/json'},\n data: result,\n error: function(jqXHR, textStatus, errorThrown) {\n console.error(\"error : \" + textStatus);\n },\n success: function(data, textStatus, jqXHR) {\n console.log(\"return = \" + data);\n $('#result').attr('value', data);\n }\n });\n };\n\n\n//handle button presses to fill data\n this.processClickOnButton = function(i) {\n this.showThisInputFromTheControlPanel(i);\n //if the sign or point\n if ((data.oneNumber === \"\" && (i === \"+\" || i === \"-\"))\n || (data.oneNumber !== '' && i === '.' && !data.oneFieldReady)) {\n \n data.oneNumber += i;\n return;\n } else if ((data.operation !== \"\" && (data.twoNumber === \"\" && (i === \"+\" || i === \"-\")))\n || (data.twoNumber !== '' && i === '.')) {\n \n data.twoNumber += i;\n return;\n }\n\n //if number\n if (!isNaN(parseInt(i, 10))) {\n if (!data.oneFieldReady) {\n data.oneNumber += i;\n return;\n } else {\n data.twoNumber += i;\n return;\n }\n //if operator \n } else if (i !== '.') {\n if ((i === \"=\")) {\n this.post();\n this.clearData();\n return;\n }\n\n data.operation = i;\n data.oneFieldReady = true;\n }\n };\n\n//generate calculator\n this.generationCalc = function() {\n\n $('body').append('<div id=\"calc\"></div>');\n\n //the result field\n $('#calc').append('<div id=\"divResult\"></div>');\n $('#divResult').append('<input type=\"text\" id=\"result\">');\n\n\n $('#calc').append('<div id=\"controlPanel\"></div>');\n\n // bootons with numbers\n $('#controlPanel').append('<div id=\"numberButton\"></div>');\n for (var i = 9; i >= 0; i--) {\n $('<button/>', {\n 'id': 'bn' + i,\n 'onclick': 'calc.processClickOnButton(' + '\"' + i + '\"' + ')',\n text: i\n }).appendTo('#numberButton');\n }\n\n //button operations on numbers\n $('#controlPanel').append('<div id=\"operation\"></div>');\n var op = '% / * + - = . sqrt'.split(\" \");\n for (var i = 0; i < op.length; i++) {\n $('<button/>', {\n 'id': 'bn' + op[i],\n 'onclick': 'calc.processClickOnButton(' + '\"' + op[i] + '\"' + ')',\n text: op[i]\n }).appendTo('#operation');\n }\n\n };\n}", "function recalculateMetrics(refDataId, refIsQuery, targetDataId, targetIsQuery,\n\t\t\t threshold, matchedpoints, successfunction, errorfunction)\n{\n gReturnInfo = null;\n var requestString = gUrl;\n var formDataObject = new FormData();\n formDataObject.append('action', 'calculatemetrics');\n formDataObject.append('refdataid', refDataId);\n formDataObject.append('refisquery', refIsQuery);\n formDataObject.append('targetdataid', targetDataId);\n formDataObject.append('targetisquery', targetIsQuery);\n formDataObject.append('threshold', threshold);\n formDataObject.append('recalcflag','true');\n formDataObject.append('matchedpoints', JSON.stringify(matchedpoints));\n var request = new XMLHttpRequest();\n request.open(\"POST\", requestString, true);\n request.setRequestHeader(\"Content-type\", \"multipart/form-data\");\n // Register a handler to take care of the data on return\n request.onreadystatechange = function ()\n {\n if (request.readyState == 4)\n {\n var response = request.responseText;\n if ((request.status == 200) || (request.status == 201))\n {\n // If we get here, we got a complete valid HTTP response\n var response = request.responseText;\n gReturnInfo = JSON.parse(response);\n if (gReturnInfo.severity)\n {\n if (errorfunction)\n errorfunction();\n return;\n }\n if (successfunction)\n successfunction();\n } // end if 200/201 *\n else\n {\n alert(\"Error processing server request 'recalculateMetrics'\");\n console.log(response);\n }\n } // end if 4 \n }\n request.send(formDataObject);\n return true;\n}", "function postData() {\n \"use strict\";\n\n var response = [{name:'GOLDUD'},{name:'AUDUSD'},{name:'EURUSD'},{name:'GBPUSD'},{name:'NZDUSD'},{name:'USDCAD'},{name:'USDCHF'},{name:'USDJPY'},{name:'EURJPY'},{name:'GBPJPY'}];\n getDataRoot(response);\n }", "function calculationOutputs(event) {\n event.preventDefault();\n\n equationObject.input1 = $('.js-input1').val();\n equationObject.input2 = $('.js-input2').val();\n\n // AJAX handshake post data\n postCalculations();\n}", "async function getDateReqData(req) {\n // Retrieve POST data or request parameter data\n let date = {\n year: 0,\n month: 0,\n day: 0\n };\n\n let year = 0;\n let month = 0;\n let day = 0;\n\n // Test for and retrieve body data\n if (req.body.year || req.body.month || req.body.day) {\n year = req.body.year;\n month = req.body.month;\n day = req.body.day;\n }\n\n // Test for and retreive parameter data\n if (req.params['year'] || req.params['month'] || req.params['day']) {\n year = req.params['year'];\n month = req.params['month'];\n day = req.params['day']\n }\n\n // Convert request data to a Number and return date object\n return await validateDate({year: year, month: month, day: day});\n}", "function computeMath(event){\n console.log('in computeMath');\n //prevents page from refreshing on submit\n event.preventDefault();\n //pushes input field data to empty object\n objectToSend['numOne'] = $('#firstNum').val();\n objectToSend['numTwo'] = $('#secondNum').val();\n //AJAX to POST object to server\n $.ajax({\n type: 'POST',\n url: '/equations',\n data: objectToSend\n }).then(function (response){\n keepHistory();\n });\n //AJAX to get result of equation back from server\n //then append that data to the DOM\n $.ajax({\n type: 'GET',\n url: '/equations'\n }).then(function (response){\n let result = $('#result');\n result.empty();\n result.append(`${response[response.length-1]}`);\n });\n}", "handleSubmit(event){\n\tconst { num1, num2 } = this.state\n\tevent.preventDefault()\n\talert(`\n\t____Your numbers____\\n\n\n\tnum1 : ${num1}\n\tnum2: ${num2}\n\t`)\n const numbers = {\n num1: num1,\n num2: num2\n };\n axios.post(`http://localhost:8000/server/calculate?num1=20&num2=10`, {num1, num2}).then(\n res => {\n console.log(res.data);\n alert(res.data);\n }\n )\n}", "function sendCalculatorInfo() {\n console.log(\"here is the computation, \",calculationObject.calculation);\n $.ajax({\n type: \"POST\",\n url: \"/data\",\n data: calculationObject,\n success: function(data){\n clearVariables();\n result = data.result;\n console.log(\"here is the data back, \", result);\n appendResult();\n\n }\n });\n}", "function get_form_data() {\n var data = {};\n data[\"out\"] = $(\"#outcome-resp\").val();\n data[\"int\"] = $(\"#intervention-resp\").val();\n data[\"cmp\"] = $(\"#comparator-resp\").val();\n data[\"ans\"] = getCheckBoxSelection();\n data[\"res\"] = $(\"#reasoning-resp\").val();\n data[\"xml\"] = $(\"#reasoning-resp\").attr('xml_offsets');\n return data;\n}", "function obtenerDatosEntrada() {\n efectivo = Math.abs($('#pi-input-cash').val());\n tarjeta = Math.abs($('#pi-input-card').val());\n transferencia = Math.abs($('#pi-input-transfer').val());\n folioTransferencia = $('#pi-input-ref').val();\n subTotal = efectivo + tarjeta + transferencia;\n subTotal = parseFloat(subTotal.toFixed(2));\n solicitante_nacional = $('#pi-input-soli-nacional').val().trim();\n comentarios = $('#pi-comentarios').val().trim();\n\n //console.log('efectivo', efectivo);\n //console.log('tarjeta', tarjeta);\n //console.log('transferencia', transferencia);\n //console.log('folioTransferencia', folioTransferencia);\n //console.log('subtotal', subTotal);\n //console.log('total venta', data.order.total);\n //console.log('vuelto', vuelto);\n}", "function calculate(res,kva)\n{\n console.log(\"Doing Calculation with total: \" + kva);\n\n var result = 0.0;\n var denominator = Math.sqrt(3) * 600;\n var numerator = kva * 1.25;\n\n result = Math.round((numerator / denominator) * 10000) / 10;\n json = JSON.stringify(result);\n\n res.writeHead(200, {'content-type':'application/json', 'content-length':json.length});\n res.end(json);\n\n}// END function calculate", "function calculate(){}", "function handler(){\n let xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"http://localhost:3000/api/data\", true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");;\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n // JSON.parse does not evaluate the attacker's scripts.\n const resp = JSON.parse(xhr.responseText);\n const satToBitcoin = Number(resp.currentPrice);\n let valInput = document.getElementById('input').value;\n if(valInput.toString()[0] === '$') {\n valInput = parseFloat(valInput.toString().replace(/\\$|,/g, ''))\n valInput = Number(valInput);\n }\n\n const calc = valInput/ (satToBitcoin / 100000000)\n\n displayValue = `${calc.toFixed(2)} sats`\n\n document.getElementById('input').value = displayValue;\n //take price of input --> divide by price of bitcoin/100,000,000 \n }\n}\n xhr.send(null);\n}", "function calculate(call, callback) {\n let product = call.request;\n //A client sent a request to this service\n console.log('received product request');\n console.log(product);\n //we calculate the price and send it\n callback(null, {price: (product.unitPrice.price * product.quantity)});\n}", "function ManulComputeFee() {\n $.ajax({\n type: \"POST\",\n url: Manul_ComputeFeeURL + encodeURI($(\"#hid_CustomCategory_ForSetting\").val()) + \"&intervalNum=\" + encodeURI($(\"#EverUnReleaseNum_ForSetting\").val()) + \"&intervalDays=\" + encodeURI($(\"#IntervalDays_ForSetting\").val()) + \"&ActualWeight=\" + encodeURI($(\"#EverUnReleaseWeight_ForSetting\").val()),\n data: \"\",\n async: false,\n cache: false,\n beforeSend: function (XMLHttpRequest) {\n\n },\n success: function (msg) {\n $(\"#EverUnReleaseFee_ForSetting\").val(msg);\n $(\"#TotalFee_ForSetting\").val(msg);\n },\n complete: function (XMLHttpRequest, textStatus) {\n\n },\n error: function () {\n\n }\n });\n }", "function calculate(operand){\n const number1 = document.getElementById('number1').value;\n const number2 = document.getElementById('number2').value;\n\n const apiUrl = '/calc/' + operand + '/' + number1 + '/' + number2;\n getResultFromApi(apiUrl);\n\n}", "function serviceTotalAmount() {\n const theservice = $('#theservice').val()\n $.post('/get-total-amount', { theservice: theservice })\n .done(function(data) {\n console.log(data)\n $('#serviceprice').val(data)\n })\n}", "function postData(anotherObject) {\n console.log('in postData', anotherObject);\n \n $.ajax({\n url: \"/calculator\",\n method: \"POST\",\n data: anotherObject,\n \n }).then(function (response) {\n console.log('response from POST', response);\n getCalculatorData();\n $('#firstValue').val('');\n $('#secondValue').val('');\n operations.length = 0;\n \n }).catch( function( err ){\n console.log( err );\n alert( 'Unable to post anything at this time. Try again later.' );\n })\n}", "function postRequest() {\n // TODO\n}", "function getData()\n{\n\tlet data_1 = input_text_1.value\n\tlet data_2 = input_text_2.value\n\n\tclearInputs() \n\n\n\tajaxPost(data_1, data_2) // Llamada a ajax post\n}", "function handleRequest(request, response){\n // A small maths problem - Add the augend and the addend to get the sum\n sum = augend * addend;\n // Send user the server response \n response.end('Assignment One. Expected Sum of 6 + 3 is 9, Actual Sum returned by program is : ' + sum);\n \n // ASSIGNMENT\n // 1. Add a debug message which ouputs the sum of the simple equation above. Values are available in the augend, addend \n // and sum (global) variables\n // 2. Add a debug message which ouputs the current values of the augend addend and sum variables\n}", "function suma(req, res, next){\n const n1 = parseFloat(req.params.n1);\n const n2 = parseFloat(req.params.n2);\n res.send(`La suma es = ${n1 + n2}`);\n}", "function sumUpCalories() {\n\t\tgetPersonalMax();\n\t\t// Создаем экземпляр класса XMLHttpRequest\n\t\tlet request = new XMLHttpRequest();\n\t\t// Указываем путь до файла на сервере, который будет обрабатывать наш запрос \n\t\tlet url = \"proc/ad_sumupcalor.php\";\n\n\t\trequest.open(\"POST\", url, true);\n\t\trequest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t\trequest.addEventListener(\"readystatechange\", () => {\n\t\t\tif (request.readyState === 4 && request.status === 200) {\n\n\t\t\t\tlet calSumInfo = JSON.parse(request.responseText);\n\n\t\t\t\tfor (let i = 0; i < calSumInfo.length; i++) {\n\t\t\t\t\tcalorTotal = +calorTotal + +calSumInfo[i];\n\t\t\t\t}\n\n\t\t\t\tlet calorTotalOutput = Math.floor(calorTotal / 10);\n\t\t\t\tcalorOutputFill.style.height = calorTotalOutput + 'px';\n\t\t\t\tcalorOutputValue.textContent = calorTotal;\n\t\t\t\tcalorScaleColor(calorTotal, maxCalOutput.textContent);\n\t\t\t\tcalorTotal = 0;\n\t\t\t}\n\t\t});\n\t\trequest.send();\n\t}", "CalcVal(sec) {\r\n if(this.state.field1 && (this.state.field2 ||sec))\r\n {\r\n const response = fetch('MyCalc/CalcVal',{\r\n crossDomain:true,\r\n method: 'POST',\r\n headers: {'Content-Type':'application/json'},\r\n body: JSON.stringify({\r\n First:parseInt(this.state.field1),Sec:parseInt(this.state.field2),Operator:this.state.currentCount,Update:parseInt(this.state.index)\r\n })\r\n }).then(response => response.json())\r\n .then(data => this.setState({ result: data.resultCalc,forecasts:data.dataCalc, loading: data.dataCalc.length>0?false:true,index:-1 }));\r\n }\r\n \r\n }", "function retrieveData() {\n $.ajax({\n method: 'GET',\n url: '/calculate',\n success: function(response) {\n console.log('the calculated data returned is:', response);\n // answer = response.number;\n $('.display-screen-span').append('<span> = ' + response.number + '</span>');\n\n var output = '';\n for (var index = 0; index < response.history.length; index++) {\n output += '<p>' + response[index].history.inputOne + ' ' + response[index].history.operation + ' ' + response[index].history.inputTwo + ' = ' + response[index].history.answer + '</p>';\n }\n $('.history-screen').html(output);\n\n stage = 'third';\n operation = 'none';\n firstNumber = '';\n secondNumber = '';\n\n // run post request to add the answer to the history module\n // $.ajax({\n // method: 'POST',\n // url: '/calculate/answer',\n // data: {answer: answer},\n // success: function(response){\n // console.log('object sent as answer:', object);\n // console.log('response is:', response);\n\n // displayHistory();\n // },\n // error: function(error){\n // console.log('The \"/calculate/answer\" ajax post request failed with error: ', error);\n // }\n // });\n }\n });\n}", "function calculate() {\n var x = $('#x').val();\n var y = $('#y').val();\n $.ajax({\n method: 'POST',\n url: '/calculator',\n data: { x, y, operator }\n }).done(function (response) {\n if (response.result === null) {\n alert('Enter numbers before hitting operator!');\n }\n // Uses the result returned from the server and posts it to the DOM\n $('#result').text(\"Result = \" + response.result);\n }).fail(function (message) {\n console.log('error', message);\n })\n}", "function sageRequest(res, input) {\n console.log(\"request sent\");\n var answer = null;\n var calc = \"print latex(\" + input + \")\";\n request({\n \turl: \"http://aleph.sagemath.org/service\",\n \tmethod: \"POST\",\n form: { \"code\": calc }\n }, function (error, response, body) {\n \t if (!error && response.statusCode === 200) {\n \t var calculation = JSON.parse(body);\n \t answer = \"$$\" + calculation.stdout + \"$$\";\n console.log(answer);\n \t } else {\n \t console.log(body);\n \t console.log(error);\n \t console.log(response.statusCode);\n \t console.log(response.statusText);\n \t }\n });\n}", "function submitInfo() {\n event.preventDefault();\n var formData = $(this).serializeArray();\n console.log('serialized array', formData);\n createObject(formData);\n\n $.ajax({\n type: 'POST',\n url: '/math/' + MathForm.type,\n data: MathForm,\n success: getComputation,\n });\n}", "function postCalculator(problem) {\n $.ajax({\n type: 'POST',\n url: '/calculator',\n data: problem,\n success: function(data) {\n displaySolution(data);\n },\n error: function() {\n console.log('No response from server');\n }\n });\n}", "function gotData(data){\n\n\tif (data.with[0].content.total) newTotal = data.with[0].content.total;\n\telse newTotal = data.with[1].content.total;\n\n\tconsole.log(newTotal);\n}", "function calculate() {\r\n //---- FORM VALUES ----\r\n //variables: miles_driving, average_miles_per_gallon, cost_per_gallon, hotel_cost, snacks, other_costs\r\n //Estimate Distance\r\n var miles_driving = Number($(\"#miles_driving\").val()); //YOUR CODE HERE TO GET THE VALUE\r\n console.log(\"miles_driving \" + miles_driving);\r\n //MPG\r\n var average_miles_per_gallon = Number($(\"#average_miles_per_gallon\").val()); //YOUR CODE HERE TO GET THE VALUE\r\n console.log(\"average_miles_per_gallon \" + average_miles_per_gallon);\r\n //PPG\r\n var cost_per_gallon = Number($(\"#cost_per_gallon\").val()); //YOUR CODE HERE TO GET THE VALUE\r\n console.log(\"cost_per_gallon \" + cost_per_gallon);\r\n //Hotel\r\n var hotel_cost = Number($(\"#hotel_cost\").val());\r\n console.log(\"hotel_cost \" + hotel_cost);\r\n //Snacks\r\n var snacks_cost = Number($(\"#snacks_cost\").val());\r\n console.log(\"snacks_cost \" + snacks_cost);\r\n //other_costs\r\n var other_costs = Number($(\"#other_costs\").val());\r\n console.log(\"other_costs\" + other_costs);\r\n\r\n //----- CALCULATED VALUES -----\r\n //calculate: distance / mpg\r\n var number_of_gallons = miles_driving / average_miles_per_gallon; //YOUR CODE HERE TO GET THE VALUE\r\n console.log(\"number_of_gallons\" + number_of_gallons);\r\n //calculate: total_mileage_cost = estimate distance * ppg\r\n var total_mileage_cost = number_of_gallons * cost_per_gallon; //YOUR CODE HERE TO GET THE VALUE\r\n console.log(\"total_mileage_cost \" + total_mileage_cost);\r\n\r\n\r\n var sum = total_mileage_cost + hotel_cost + snacks_cost + other_costs;\r\n\r\n alert(\"$\" + sum);\r\n }", "function calcSum(){\n var sum = 0;\n for (var i = 0; i < data.length ; i++) {\n if (data[i].type === 'inc') {\n sum += parseInt(data[i].value);\n\n }else if (data[i].type === 'exp') {\n sum -= parseInt(data[i].value);\n }\n }\n return sum;\n}", "function getAjaxPetitionFee() {\n var url = \"ajax/ajax_fee_calculate.php\";\n var form = $('form[id!=form_arr]').attr('id');\n condit = Math.random();\n url = url + '?' + condit;\n $(\"input:hidden\").each(function() {\n url = url + '&' + $(this).attr(\"name\") + '=' + $(this).val();\n });\n $(\"input:text\").each(function() {\n url = url + '&' + $(this).attr(\"name\") + '=' + $(this).val();\n });\n $(\"input:checkbox:checked\").each(function() {\n url = url + '&' + $(this).attr(\"name\") + '=' + $(this).val();\n });\n $(\"input:radio:checked\").each(function() {\n url = url + '&' + $(this).attr(\"name\") + '=' + $(this).val();\n });\n $.get(url, function(data) {\n $(\"#FeeZone\").html(data);\n })\n}", "function getFormData () {\n var unitVal = $(\"#units\").val();\n var activationVal = $(\"#activation\").val();\n return {\"units\":unitVal,\"activation\":activationVal};\n}", "getReqPerTime() {\n let sum_time = 0.0\n let dif = 0.0\n for (let d = 0; d < this.state.data.length; d++) {\n dif = new Date(this.state.data[d].dt_end_log).getTime() - new Date(this.state.data[d].dt_Start_Log).getTime()\n sum_time += dif / 1000\n }\n \n return (sum_time / this.state.data.length)\n }", "function totalCatgExp(catg, user) {\n fetch('/totalCatgExp', {\n method: 'POST',\n body: JSON.stringify({ catg: catg, user: user })\n })\n .then(res => res.json())\n .then(res => {\n // console.log(res.totalCatgExp);\n if (res.totalCatgExp.amount__sum != null) {\n $('#amount' + catg).text(res.totalCatgExp.amount__sum);\n } else {\n $('#amount' + catg).text(0);\n }\n\n let a = $('#total-expenditure').text();\n let b = res.totalCatgExp.amount__sum * 100;\n let c = Math.round((b / a));\n\n if (a >= c) {\n $('#npercent' + catg).text(res.totalCatgExp.amount__sum);\n } else {\n $('#npercent' + catg).text(0);\n }\n })\n}", "function balanceTotal(){\n var request = new XMLHttpRequest();\n\n request.open('POST', 'https://blockchain.info/merchant/(key)/balance');\n\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\n request.onreadystatechange = function () {\n if (this.readyState === 4) {\n console.log('Status:', this.status);\n console.log('Headers:', this.getAllResponseHeaders());\n console.log('Body:', this.responseText);\n }\n };\n\n var body = \"password=(password)\";\n\n var totalDict = request.send(body);\n return totalDict[\"balance\"];\n}", "function postEvaluation(data, callback){\n $.ajax({\n type: \"POST\",\n url: getFinalURL(),\n data: data,\n success: function(result){\n callback(result);\n },\n dataType: \"json\"\n });\n}", "function newfinancingCalculator() {\n var loan_amount = document.getElementById('loan_amount').value;\n var age = parseInt(document.getElementById('age').value);\n\n var building = document.getElementsByName('property');\n var building_type;\n for(var i = 0; i < building.length; i++){\n if(building[i].checked){\n building_type = building[i].value;\n }\n }\n\n// var construction_status = document.getElementById('construction_type').value;\n var construction = document.getElementsByName('construction_status');\n var construction_status;\n for(var i = 0; i < construction.length; i++){\n if(construction[i].checked){\n construction_status = construction[i].value;\n }\n }\n\n// var lock_in_preference = document.getElementById('lock_in_preference').value;\n\n var lock_in = document.getElementsByName('lock_in');\n var lock_in_preference;\n for(var i = 0; i < lock_in.length; i++){\n if(lock_in[i].checked){\n lock_in_preference = lock_in[i].value;\n }\n }\n\n var loan_tenure;\n\n if (age < 21) {\n alert(\"You can't purchase a property yet!\");\n } else {\n if (String(building_type) == 'HDB') {\n loan_tenure = 60 - age;\n } else {\n loan_tenure = 65 - age;\n }\n\n\n var myNode = document.getElementById(\"root\");\n while (myNode.firstChild) {\n myNode.removeChild(myNode.firstChild);\n }\n\n var request = new XMLHttpRequest();\n\n const app = document.getElementById('root');\n\n\n request.open('GET', 'http://127.0.0.1:8000/api/bank_rates/?construction_status=' + String(construction_status) + '&property_type=' + String(building_type) + '&user_lock_in_preference=' + String(lock_in_preference) + '&min_loan_amount=' + parseInt(loan_amount) + '&max_loan_amount=' + parseInt(loan_amount), true);\n\n\n request.onload = function () {\n\n var data = JSON.parse(this.response);\n\n if (request.status >= 200 && request.status < 400) {\n data.slice(-5).forEach(bank => {\n var yearly = PMT(bank.interest_rates/100, loan_tenure, loan_amount);\n var yearly_monthly_interest_rate = PMT(bank.interest_rates/100/12, loan_tenure * 12, loan_amount);\n\n const columns = document.createElement('div');\n columns.setAttribute('class', 'col-md-4');\n\n const thumbnail = document.createElement('div');\n thumbnail.setAttribute('class', 'thumbnail');\n\n const image = document.createElement('img');\n image.src = bank.bank.bank_image;\n image.setAttribute('height', 250);\n image.setAttribute('width', 250);\n\n const type_of_rate = document.createElement('h3');\n type_of_rate.setAttribute('align', 'middle');\n type_of_rate.textContent = \"Interest Rate: \" + bank.interest_rates + \"% (\" + bank.loan_type.rate_type_name + \")\";\n\n const info_data = document.createElement('a');\n info_data.setAttribute('class', 'my-tool-tip');\n\n const info_icon = document.createElement('i');\n info_icon.setAttribute('class', 'glyphicon glyphicon-question-sign my-tool-tip');\n info_icon.setAttribute('data-toggle', 'tooltip');\n info_icon.setAttribute('data-placement', 'right');\n info_icon.setAttribute('title', bank.loan_type.rate_type_info);\n\n const monthly_interest = document.createElement('h3');\n monthly_interest.setAttribute('align', 'middle');\n monthly_interest.textContent = \"Monthly Installment: $\" + thousands_separators(yearly_monthly_interest_rate.toFixed(2));\n\n const button_display_div = document.createElement('div');\n button_display_div.setAttribute('align', 'center');\n\n const button = document.createElement('button');\n button.textContent = \"More Details\";\n button.setAttribute('class', 'btn btn-primary');\n button.setAttribute('data-target', '#modal' + String(bank.id));\n button.setAttribute('data-toggle', \"modal\");\n\n //Modal\n const modal_div = document.createElement('div');\n modal_div.setAttribute(\"class\", \"modal fade\");\n modal_div.setAttribute(\"id\", \"modal\" + String(bank.id));\n modal_div.setAttribute(\"role\", \"dialog\");\n\n const modal_dialog = document.createElement('div');\n modal_dialog.setAttribute(\"class\", \"modal-dialog\");\n\n const modal_content = document.createElement('div');\n modal_content.setAttribute(\"class\", \"modal-content\");\n\n const modal_header = document.createElement('div');\n modal_header.setAttribute(\"class\", \"modal-header\");\n\n const close_button = document.createElement('button');\n close_button.setAttribute(\"type\", \"button\");\n close_button.setAttribute(\"class\", \"close\");\n close_button.setAttribute(\"data-dismiss\", \"modal\");\n close_button.textContent = 'X';\n\n const modal_body = document.createElement('div');\n modal_body.setAttribute(\"class\", \"modal-body\");\n\n const modal_image_div = document.createElement('div');\n modal_image_div.setAttribute('align', 'middle');\n\n const modal_image = document.createElement('img');\n modal_image.src = bank.bank.bank_image;\n modal_image.setAttribute('height', 150);\n modal_image.setAttribute('width', 250);\n\n const modal_interest = document.createElement('h3');\n modal_interest.textContent = \"INTEREST RATE: \" + bank.interest_rates + \"(\" + bank.loan_type.rate_type_name + \")\";\n\n // Yearly Breakdown Div\n const yearly_breakdown_div = document.createElement('div');\n yearly_breakdown_div.setAttribute('class', 'row');\n\n // col-1\n const year1_column = document.createElement('div');\n year1_column.setAttribute('class', 'col-md-4');\n year1_column.setAttribute('align', 'middle');\n\n //col-1 details\n const year1_display = document.createElement('p');\n year1_display.textContent = \"Year 1\"\n\n const year1_interest = document.createElement('p');\n year1_interest.textContent = \"Interest Rate: \" + bank.interest_rates + \"%\";\n\n const year1_monthly_interest = document.createElement('p');\n year1_monthly_interest.textContent = \"Monthly Installment: $\" + thousands_separators(yearly_monthly_interest_rate.toFixed(2));\n\n // col-2\n const year2_column = document.createElement('div');\n year2_column.setAttribute('class', 'col-md-4');\n year2_column.setAttribute('align', 'middle');\n\n //col-1 details\n const year2_display = document.createElement('p');\n year2_display.textContent = \"Year 2\"\n\n const year2_interest = document.createElement('p');\n year2_interest.textContent = \"Interest Rate: \" + bank.interest_rates + \"%\";\n\n const year2_monthly_interest = document.createElement('p');\n year2_monthly_interest.textContent = \"Monthly Installment: $\" + thousands_separators(yearly_monthly_interest_rate.toFixed(2));\n\n // col-3\n const year3_column = document.createElement('div');\n year3_column.setAttribute('class', 'col-md-4');\n year3_column.setAttribute('align', 'middle');\n\n //col-1 details\n const year3_display = document.createElement('p');\n year3_display.textContent = \"Year 3\"\n\n const year3_interest = document.createElement('p');\n year3_interest.textContent = \"Interest Rate: \" + bank.interest_rates + \"%\";\n\n const year3_monthly_interest = document.createElement('p');\n year3_monthly_interest.textContent = \"Monthly Installment: $\" + thousands_separators(yearly_monthly_interest_rate.toFixed(2));\n\n const additional_info_div = document.createElement('div');\n additional_info_div.setAttribute('class', 'container');\n\n const lock_in_period_header = document.createElement('h3');\n lock_in_period_header.textContent = \"Lock In Period\";\n\n const lock_in_info = document.createElement('p');\n lock_in_info.textContent = bank.lock_in_period;\n\n const penalties_header = document.createElement('h3');\n penalties_header.textContent = 'Penalties';\n\n const penalties_info = document.createElement('p');\n penalties_info.textContent = bank.penalties;\n\n\n const subsidies_header = document.createElement('h3');\n subsidies_header.textContent = 'Subsidies';\n\n const subsidies_info = document.createElement('p');\n subsidies_info.textContent = bank.subsidies;\n\n const additional_fees_header = document.createElement('h3');\n additional_fees_header.textContent = 'Additional Fees';\n\n const additional_fees_info = document.createElement('p');\n additional_fees_info.textContent = bank.additional_fees;\n\n const modal_footer = document.createElement('div');\n modal_footer.setAttribute('class', \"modal-footer\");\n\n const apply_button = document.createElement('button');\n apply_button.setAttribute('class', \"btn btn-primary\");\n apply_button.setAttribute('onclick', \"location.href='https://dollarbackmortgage.com/contact-us/'\")\n apply_button.textContent = 'Apply';\n\n app.append(columns);\n columns.append(thumbnail);\n thumbnail.append(image);\n thumbnail.append(type_of_rate);\n type_of_rate.append(info_data);\n info_data.append(info_icon);\n thumbnail.append(monthly_interest);\n thumbnail.append(button_display_div);\n button_display_div.append(button);\n\n app.append(modal_div);\n modal_div.append(modal_dialog);\n modal_dialog.append(modal_content);\n modal_content.append(modal_header);\n modal_header.append(close_button);\n modal_content.append(modal_body);\n modal_body.append(modal_image_div);\n modal_image_div.append(modal_image);\n modal_image_div.append(modal_interest);\n modal_body.append(yearly_breakdown_div);\n yearly_breakdown_div.append(year1_column);\n year1_column.append(year1_display);\n year1_column.append(year1_interest);\n year1_column.append(year1_monthly_interest);\n yearly_breakdown_div.append(year2_column);\n year2_column.append(year2_display);\n year2_column.append(year2_interest);\n year2_column.append(year2_monthly_interest);\n yearly_breakdown_div.append(year3_column);\n year3_column.append(year3_display);\n year3_column.append(year3_interest);\n year3_column.append(year3_monthly_interest);\n modal_body.append(additional_info_div);\n additional_info_div.append(lock_in_period_header);\n additional_info_div.append(lock_in_info);\n additional_info_div.append(penalties_header);\n additional_info_div.append(penalties_info);\n additional_info_div.append(subsidies_header);\n additional_info_div.append(subsidies_info);\n additional_info_div.append(additional_fees_header);\n additional_info_div.append(additional_fees_info);\n modal_content.append(modal_footer);\n modal_footer.append(apply_button);\n\n });\n } else {\n console.log('error');\n }\n }\n\n request.send();\n bank_rates.style.display = \"block\";\n\n\n }\n}", "do_calculation( bunch_of_numerical_data)\n {\n var total = 0 ;\n bunch_of_numerical_data.forEach(element => {\n total += element\n });\n return total ;\n }", "function sendValues(type) {\n $.ajax({\n type: 'POST',\n url: '/type/' + type,\n data: input,\n success: getCalculation,\n });\n}", "onSubmitNewDay(state) {\n fetch('/API/myChallenge/' + this.props.idUser, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n carbohydrates: state.carbohydrates,\n fat: state.fat,\n fiber: state.fiber,\n protein: state.protein,\n kcals: state.kcals\n })\n });\n fetch('/API/myConsumption/' + this.props.idUser, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n carbohydrates: 0,\n fat: 0,\n fiber: 0,\n protein: 0,\n kcals: 0\n })\n }).then((res) => {\n return (res.json());\n })\n .then((w) => {\n\n })\n .catch((err) => console.log(err));\n\n this.setState(\n {\n carbohydrates: {total: state.carbohydrates, actual: 0},\n fat: {total: state.fat, actual: 0},\n fiber: {total: state.fiber, actual: 0},\n protein: {total: state.protein, actual: 0},\n kcals: {total: state.kcals, actual: 0},\n }\n )\n }", "static freightCalculation(obj) {\n return (dispatch, getState) => {\n dispatch(actionDispatch(ActionType.GET_FREIGHT_CALCULATION));\n if(!obj.isEditFromOrder){\n dispatch(actionDispatch(ActionType.SAVE_PLACED_ORDER_SUCCESS, obj));\n }\n \n\n const state = getState();\n const placedOrder = [...state.orderReducer.placedOrder];\n let scheme_desc = placedOrder[0].schemeItem.split(\n \",\"\n )[0];\n\n const products = placedOrder.map(item => {\n return {\n itemcode: item.itemCode,\n scheme_total: item.schemeTotal,\n qty: item.quantity,\n scheme_desc\n };\n });\n\n let form = new FormData();\n form.append(\"entity_no\", obj.selectedCustomer.ENTITY_NO);\n products.map((item, index) => {\n Object.entries(item).forEach(([key, value]) => {\n form.append(`product[${index}][${key}]`, value);\n });\n });\n\n post(\"/Calculatefreight\", form, state.authReducer.cookie)\n .then(response => {\n if (response.error) {\n throw response.error;\n }\n dispatch(\n actionDispatch(\n ActionType.GET_FREIGHT_CALCULATION_SUCCESS,\n response\n )\n );\n })\n .catch(error => {\n console.log(\"error\", error);\n dispatch(\n actionDispatch(\n ActionType.GET_FREIGHT_CALCULATION_FAIL,\n error\n )\n );\n });\n };\n }", "function calculatePlan()\n\t{\n\t\t// set data to object\n\t\tvar data = {\n\t\t\torigin: $('#origin').val(),\n\t\t\tdestiny: $('#destiny').val(),\n\t\t\tminutes: $('#minutes').val(),\n\t\t\tplan: $('#plan').val()\n\t\t}\n\n\t\t// Valid data\n\t\tif (data.origin == \"\" || data.destiny == \"\" || data.minutes == \"\" || data.plan == \"\")\n\t\t\treturn;\n\n\t\t// Send Request \n\t\t$.ajax({\n\t\t url: \"api/plan/calculate\",\n\t\t type: \"POST\",\n\t\t data: data,\n\t\t}).done(function(response) {\n\t\t\t// Init variables\n\t\t\tvar with_plan = \"Chamada não inclusa no Plano\";\n\t\t\tvar without_plan = \"-\";\n\n\t\t\t// Valid response\n\t\t\tif (typeof response.price !== 'undefined') {\n\t\t\t\twithout_plan = \"R$ \" + response.price;\n\t\t\t} else {\n\t\t\t\twith_plan = \"R$ \" + response.with_plan;\n\t\t\t\twithout_plan = \"R$ \" + response.without_plan;\n\t\t\t}\n\n\t\t\t// Set data in view\n\t\t\t$('.plan-result').text(with_plan);\n\t\t\t$('.without-plan-result').text(without_plan);\n\t\t});\n\t}", "function handlePost() {\r\n\t$.trace.error(\"inside handlePost method\");\r\n\tvar bodyStr = $.request.body ? $.request.body.asString() : undefined;\r\n\t$.trace.error(bodyStr);\r\n\t$.trace.error(\"-------------------------------------------------------------------------\");\r\n\tif (bodyStr === undefined) {\r\n\t\t$.trace.debug(\"so bodystr is undefined\");\r\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t\treturn {\r\n\t\t\t\"myResult\" : \"Missing BODY\"\r\n\t\t};\r\n\t}\r\n\tvar formData = JSON.parse(bodyStr);\r\n\tvar description = formData.DESCRIPTION;\r\n\t$.trace.debug(\"Reached description\" + description);\r\n\tif (description === null || description === '') {\r\n\t\t$.trace.error(\"so description is null or empty\");\r\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t\treturn {\r\n\t\t\t\"myResult\" : \"Missing description field\"\r\n\t\t};\r\n\t}\r\n\tvar latitude = formData.LATITUDE;\r\n\tif (latitude === null || latitude === '') {\r\n\t\t$.trace.error(\"so latitude is null or empty\");\r\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t\treturn {\r\n\t\t\t\"myResult\" : \"Missing latitude field\"\r\n\t\t};\r\n\t} else {\r\n\t\tlatitude = parseFloat(latitude);\r\n\t}\r\n\tvar longitude = formData.LONGITUDE;\r\n\tif (longitude === null || longitude === '') {\r\n\t\t$.trace.error(\"so longitude is null or empty\");\r\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t\treturn {\r\n\t\t\t\"myResult\" : \"Missing longitude field\"\r\n\t\t};\r\n\t} else {\r\n\t\tlongitude = parseFloat(longitude);\r\n\t}\r\n\t$.trace.error(\"so nothing failed so far\");\r\n\tvar taskId = formData.ID;\r\n\tvar locationId = formData.LOCATION_ID;\r\n\tlocationId = UTILS.checkNotEmptyAndNotNull(locationId) ? parseInt(locationId)\r\n\t\t\t: '';\r\n\tvar statusId = formData.STATUS_ID;\r\n\tstatusId = UTILS.checkNotEmptyAndNotNull(statusId) ? parseInt(statusId)\r\n\t\t\t: '';\r\n\tvar serviceTypeId = formData.SERVICE_TYPE_ID;\r\n\tserviceTypeId = UTILS.checkNotEmptyAndNotNull(serviceTypeId) ? parseInt(serviceTypeId)\r\n\t\t\t: '';\r\n\tvar customerId = formData.CUSTOMER_ID;\r\n\tcustomerId = UTILS.checkNotEmptyAndNotNull(customerId) ? parseInt(customerId)\r\n\t\t\t: 1;\r\n\tvar serviceCategoryId = formData.SERVICE_CATEGORY_ID;\r\n\tserviceCategoryId = UTILS.checkNotEmptyAndNotNull(serviceCategoryId) ? parseInt(serviceCategoryId)\r\n\t\t\t: '';\r\n\tvar taskRequestedDate = formData.TASK_REQUESTED_DATE;\r\n\ttaskRequestedDate = UTILS.checkNotEmptyAndNotNull(taskRequestedDate) ? new Date(Date.parse(taskRequestedDate)) : new Date(Date.now());\r\n\tvar country = formData.COUNTRY;\r\n\tvar streetName = formData.STREET_NAME;\r\n\tvar streetNum = formData.STREET_NUM;\r\n\tvar state = formData.STATE;\r\n\tvar region = formData.REGION;\r\n\tvar apartment = formData.APARTMENT;\r\n\tvar address = formData.ADDRESS;\r\n\t$.trace.error(address)\r\n\tvar resultSet;\r\n\tvar result = {\r\n\t\t\"ID\" : taskId,\r\n\t\t\"DESCRIPTION\" : description,\r\n\t\t\"STATUS_ID\" : statusId,\r\n\t\t\"SERVICE_TYPE_ID\" : serviceTypeId,\r\n\t\t\"CUSTOMER_ID\" : customerId,\r\n\t\t\"SERVICE_CATEGORY_ID\" : serviceCategoryId,\r\n\t\t\"TASK_REQUESTED_DATE\":taskRequestedDate,\r\n\t\t\"LOCATION_ID\" : locationId\r\n\t};\r\n\ttry {\r\n\t\t$.trace.error(\"about to save location\");\r\n\t\t$.trace.error(locationId);\r\n\t\t$.trace.error(\"---------------------------------------n\");\r\n\t\tvar conn = $.db.getConnection();\r\n\t\t// Insert Location\r\n\t\tif (locationId == null || locationId == '') {\r\n\t\t\t$.trace.error(\"save\");\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('SELECT \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::locationId\\\".NEXTVAL AS locationId from Dummy');\r\n\t\t\tresultSet = query.executeQuery();\r\n\t\t\t$.trace.error(\"sequence query executed\");\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tlocationId = resultSet.getInteger(1);\r\n\t\t\t\tresult.locationId = locationId;\r\n\t\t\t\t$.trace.error(locationId);\r\n\t\t\t\t$.trace.error(\"inside while next loop of location result\");\r\n\t\t\t}\r\n\t\t\t$.trace.error(\"outside while next loop\");\r\n\t\t\tvar query = conn\r\n\t\t\t\t\t.prepareStatement('INSERT INTO \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.Location\\\" VALUES(?,?,?,?,?,?,?,?,?,?,new ST_POINT('\r\n\t\t\t\t\t\t\t+ latitude + ',' + longitude + '))');\r\n\t\t\tquery.setInteger(1, locationId);\r\n\t\t\tquery.setString(2, country);\r\n\t\t\tquery.setString(3, streetName);\r\n\t\t\tquery.setString(4, streetNum);\r\n\t\t\tquery.setString(5, state);\r\n\t\t\tquery.setString(6, region);\r\n\t\t\tquery.setString(7, apartment);\r\n\t\t\tquery.setString(8, address);\r\n\t\t\tquery.setFloat(9, latitude);\r\n\t\t\tquery.setFloat(10, longitude);\r\n\t\t\t\r\n\t\t\tresultSet = query.executeUpdate();\r\n\t\t} else {\r\n\t\t\t$.trace.error(\"update\");\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('UPDATE \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.Location\\\" SET COUNTRY=?, STREET_NAME =?, STREET_NUM=?, STATE=?,REGION=?,APARTMENT=?,ADDRESS=?,LATITUDE=?,LONGITUDE=?,POINT=new ST_POINT('\r\n\t\t\t\t\t\t\t+ latitude + ',' + longitude + ') WHERE ID= ?');\r\n\t\t\tquery.setString(1, country);\r\n\t\t\tquery.setString(2, streetName);\r\n\t\t\tquery.setString(3, streetNum);\r\n\t\t\tquery.setString(4, state);\r\n\t\t\tquery.setString(5, region);\r\n\t\t\tquery.setString(6, apartment);\r\n\t\t\tquery.setString(7, address);\r\n\t\t\tquery.setFloat(8, latitude);\r\n\t\t\tquery.setFloat(9, longitude);\r\n\t\t\tquery.setInteger(10, locationId);\r\n\t\t\tresultSet = query.executeUpdate();\r\n\t\t}\r\n\r\n\t\t$.trace.error(\"saved location i guess\");\r\n\r\n\t\tif (statusId == '') {\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('SELECT ID FROM \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.TaskStatus\\\" WHERE STATUS=\\'Requested\\'');\r\n\t\t\tresultSet = query.executeQuery();\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tstatusId = resultSet.getInteger(1);\r\n\t\t\t\tresult.STATUS_ID = statusId;\r\n\t\t\t\t$.trace.error(statusId);\r\n\t\t\t\t$.trace.error(\"inside while next loop of statusId result\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (serviceTypeId == '') {\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('SELECT ID FROM \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.ServiceType\\\" WHERE TYPE=\\'Home Service\\'');\r\n\t\t\tresultSet = query.executeQuery();\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tserviceTypeId = resultSet.getInteger(1);\r\n\t\t\t\tresult.SERVICE_TYPE_ID = serviceTypeId;\r\n\t\t\t\t$.trace.error(serviceTypeId);\r\n\t\t\t\t$.trace.error(\"inside while next loop of serviceTypeId result\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (serviceCategoryId == '') {\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('SELECT ID FROM \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.ServiceCategory\\\" WHERE DESCRIPTION=\\'Default\\'');\r\n\t\t\tresultSet = query.executeQuery();\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tserviceCategoryId = resultSet.getInteger(1);\r\n\t\t\t\tresult.SERVICE_CATEGORY_ID = serviceCategoryId;\r\n\t\t\t\t$.trace.error(serviceCategoryId);\r\n\t\t\t\t$.trace.error(\"inside while next loop of serviceCategoryId result\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (taskId == null || taskId == '') {\r\n\t\t\t// Insert task\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('SELECT \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::taskId\\\".NEXTVAL AS taskId from Dummy');\r\n\t\t\tresultSet = query.executeQuery();\r\n\t\t\t$.trace.error(\"sequence query executed\");\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\ttaskId = resultSet.getInteger(1);\r\n\t\t\t\tresult.ID = taskId;\r\n\t\t\t\t$.trace.error(taskId);\r\n\t\t\t\t$.trace.error(\"inside while next loop of task ID result\");\r\n\t\t\t}\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('INSERT INTO \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.Task\\\" VALUES(?,?,?,?,?,?,?,?,now(),now())');\r\n\t\t\tquery.setInteger(1, taskId);\r\n\t\t\tquery.setString(2, description);\r\n\t\t\tquery.setInteger(3, statusId);\r\n\t\t\tquery.setInteger(4, locationId);\r\n\t\t\tquery.setInteger(5, serviceTypeId);\r\n\t\t\tquery.setInteger(6, customerId);\r\n\t\t\tquery.setInteger(7, serviceCategoryId);\r\n\t\t\tquery.setDate(8, taskRequestedDate);\r\n\t\t\tvar resultSet = query.executeUpdate();\r\n\t\t} else {\r\n\t\t\t$.trace.error(\"inside update task\");\r\n\t\t\t// Insert task\r\n\t\t\tquery = conn\r\n\t\t\t\t\t.prepareStatement('UPDATE \\\"SERVICE_MANAGEMENT_SYSTEM\\\".\\\"sms.data::SR.Task\\\" SET DESCRIPTION=?, STATUS_ID=?, LOCATION_ID=?, SERVICE_TYPE_ID=?, CUSTOMER_ID=?, SERVICE_CATEGORY_ID=?, TASK_REQUESTED_DATE=?, MODIFIED_DATE = now() WHERE ID=?');\r\n\t\t\tquery.setString(1, description);\r\n\t\t\tquery.setInteger(2, statusId);\r\n\t\t\tquery.setInteger(3, locationId);\r\n\t\t\tquery.setInteger(4, serviceTypeId);\r\n\t\t\tquery.setInteger(5, customerId);\r\n\t\t\tquery.setInteger(6, serviceCategoryId);\r\n\t\t\tquery.setDate(7, taskRequestedDate);\r\n\t\t\tquery.setInteger(8, taskId);\r\n\t\t\tvar resultSet = query.executeUpdate();\r\n\t\t\tresult.ID = taskId;\r\n\t\t\t$.trace.error(\"task update executed\");\r\n\t\t}\r\n\t\tconn.commit();\r\n\t} catch (err) {\r\n\t\t$.response.status = $.net.http.INTERNAL_SERVER_ERROR;\r\n\t\t$.response.setBody(err.message);\r\n\t\t$.trace.error(error.message);\r\n\t\treturn;\r\n\t} finally {\r\n\t\tconn.close();\r\n\t}\r\n\tresult.Status = \"POST success\";\r\n\t// Extract body insert data to DB and return results in JSON/other format\r\n\t$.response.status = $.net.http.CREATED;\r\n\t$.trace.debug(\"about to exti handle post method\");\r\n\treturn result;\r\n}", "function collectData() {\n \n var data = \"\";\n\n $input.each(function () {\n $this = $(this);\n // find the accestor of the input which is a div and contains class query\n $ancestor = $this.closest(\"div.query\");\n \n // if the ancestor is hide continue \n if ($ancestor.is(\".w3-hide\")) {\n return ;\n }\n \n // element == this\n\n var name = this.name; // get name of input\n var value = this.value; // get value of input\n\n //form a string of name and value to be used in the post request\n data += name + '=' + value + '&';\n\n });\n\n // return the post string to the call\n return data.substring(0, data.length - 1);\n\n\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 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}", "function _processRequestPOST(req, res){\n\t\t\n\t}", "function retrievePostData(request, callback){\n if(request.headers['content-type'] == 'application/x-www-form-urlencoded'){\n let body = '';\n request.on('data', chunk =>{\n body += chunk.toString();\n })\n request.on('end', ()=>{\n console.log(body);\n callback(parse(body));\n });\n }else{\n callback(null);\n }\n}", "function do_operation(req){\n\tvar values = (role == \"add\")? 0:1;\n\n\tfor(key in req.query){\n\t\tthenum = parseInt(req.query[key])\n\t\tif (role == \"add\")\n\t\t\tvalues += thenum\n\t\telse\n\t\t\tvalues = values * thenum\n\t}\n\n\treturn(values)\n}", "function solveMath(req) {\n var operand1 = req.query.operand1;\n var operand2 = req.query.operand2;\n var operation = req.query.operation;\n\n if (operation == \"+\") {\n var result = +operand1 + +operand2;\n\n }\n if (operation == \"-\") {\n var result = +operand1 - +operand2;\n\n }\n if (operation == \"*\") {\n var result = +operand1 * +operand2;\n\n }\n if (operation == \"/\") {\n var result = +operand1 / +operand2;\n\n }\n console.log(operation);\n console.log(operand2);\n console.log(operand1);\n console.log(result);\n // res.render('/results', () => {\n // answer: result \n // })\n return result;\n}", "function recupererValeur() {\n// execute the conversion using the \"convert\" endpoint:\n$.ajax({\n url: url,\n dataType: 'jsonp',\n\n success: function(res,status,req) {\n\n console.log(res.rates);\n console.log(status);\n var taux = res.rates\n , from = document.getElementById('from').value\n , to = document.getElementById('to').value\n , amount = document.getElementById('fromAmount').value\n\n var result = amount * taux[to] / taux[from]\n document.getElementById(\"toAmount\").value=result\n }\n})}", "function bodyReqinTransformerBrah( req, res, next ) {\n for( var keys in req.body ) {\n if( keys !== 'name' ) {\n req.body[keys] = parseFloat( req.body[keys] );\n }\n }\n next();\n}", "function loadTradingPostData() {\n jQuery.ajax({\n url: tradingPostURL,\n async: false,\n dataType: 'json',\n success: function (data, status, request) {\n\n for (var i = 0; i < data.length; i++) {\n commerceValue[data[i].id] = data[i].sells.unit_price;\n }\n\n for (var t = 1; t < 7; t++) {\n for (var i = 0; i < commerceItems[\"T\" + t].length; i++) {\n bagValue[\"T\" + t].push(commerceValue[commerceItems[\"T\" + t][i]]);\n }\n }\n\n ecto = commerceValue[commerceItems.ectoplasm] * 0.85;\n updateTier(6);\n }\n });\n}", "function getData() {\n return {\n ergReps: ergReps,\n bikeReps: bikeReps,\n repRate: repRate,\n totTime: totTime,\n Distance: Distance\n }\n }", "function calculateTotal() {\n const phoneTotal = getInputValue('phone') * 1219;\n const caseTotal = getInputValue('case') * 59;\n const subTotal = phoneTotal + caseTotal;\n console.log(subTotal);\n\n}", "function call_POST_API(employee, date, sale){\n $.ajax({\n url: apiURL,\n method: \"POST\",\n contentType: 'application/json',\n data: JSON.stringify({\n salesman: employee,\n amount: parseInt(sale),\n date: date\n }),\n success: function(obj){\n dataSalesPerMonth(obj);\n dataSalesPerEmployee(obj);\n dataSalesPerQuarter(obj);\n console.log(obj);\n drawLineChart(labelTotalSales, dataTotalSales);\n drawDoughnutChart(labelSingleSales, dataSingleSales);\n drawBarChart(labelQuarterSales, dataQuarterSales);\n location.reload();\n },\n error: function() {\n alert(\"errore\");\n }\n });\n}", "function processRequest(dataToParse) {\n //let body = dataToParse['data']; \n let responseJSON = filterJSONResponse(responseJSON);\n return (JSON.stringify(responseJSON, null, ' '));\n}", "function inrToUsdConvert(){\n\tvar xhttp= new XMLHttpRequest();\n\txhttp.onreadystatechange = function(){\n\t\tif(this.readyState == 4 && this.status == 200){\n\t\t\tvar apiData =JSON.parse(this.responseText);\n\t\t\tvar rupeeData = 0.0;\n\t\t\tvar newValue=0.0;\n\t\t\tvar updateAmount=0.0;\n\n\t\t\trupeeData=document.getElementById('rupees').value;\n\t\t\tnewValue=apiData.rates.USD;\n\t\t\tupdateAmount =rupeeData * newValue;\n\t\t\t\n\t\t\tdocument.getElementById('dollar').value = updateAmount;\t\t \n\t\t}\n\t};\n\txhttp.open(\"GET\",'https://api.fixer.io/latest?base=INR&symbols=USD',true);\n\txhttp.send();\n}", "function equate() {\n console.log('equate function');\n calcInput = $('#calcInput').val();\n num1 = parseFloat($('#calcInput').val());\n let stringOfNumbers = num1.toString()\n let remainder = calcInput.slice(stringOfNumbers.length, 20);\n console.log(remainder);\n operator = remainder.substr(0, 1);\n num2 = remainder.substr(1, 20);\n if (dataValue() === false) {\n return false;\n }\n $.ajax({\n method: 'POST',\n url: '/equate',\n data: {\n firstNumber: num1,\n operator: operator,\n secondNumber: num2\n }\n }).then(response => {\n console.log('equation response:', response);\n getHistory();\n })\n}// end equate", "function processData() {\n\tif (request.readyState == 4) {\n\t\tif (request.status == 200) {\n\t\t\tvar data = JSON.parse(request.responseText);\n\t\t\t/*\n\t\t\tif (data != null)\n\t\t\t alert(Object.keys(data).length);\n\t\t\t*/\n\t\t} else {\n\t\t\talert(\"Failed to get data: code = \"+request.status);\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/* --- place scraped data on page */\n\tvar df = \"\", dfc = \"\", dfc1 = \"\", dfc2 = \"\", crElemF = false;\n\n\t/* vars used in calculations */\n\t/* inc-st vars */\n\tvar dilShares = 0, sales = 0, ebit = 0, pretaxInc = 0, incTax = 0; \n\tvar depr = 0, intExp = 0;\n\t/* bs-st vars */\n\tvar cash = 0, ltInvCash = 0, stDebt = 0, ltDebt = 0, ltNoteR = 0;\n\t/* cf-st vars */\n\tvar ocf = 0, capex = 0;\n\tvar intcov = 0;\n\n\tfor (var key in data) {\n\t\t//alert(key+data[key]);\n\t\tif (key == \"header\") {\n\t\t\tdf = document.getElementById(\"output-header\");\n\t\t\tif (df.childElementCount == 0) {\n\t\t\t\tdfc1 = document.createElement(\"h1\");\n\t\t\t\tdf.appendChild(dfc1);\n\t\t\t\tdfc2 = document.createElement(\"h4\");\n\t\t\t\tdf.appendChild(dfc2);\n\n\t\t\t\tdfc = document.createElement(\"span\");\n\t\t\t\tdfc.setAttribute(\"class\",\"label-valuation\");\n\t\t\t\tdfc.innerHTML = \"Fair Value\";\n\t\t\t\tdf.appendChild(dfc);\n\t\t\t\tdfc = document.createElement(\"span\");\n\t\t\t\tdfc.setAttribute(\"class\",\"data-valuation\");\n\t\t\t\tdfc.setAttribute(\"id\",\"fval\");\n\t\t\t\tdf.appendChild(dfc);\n\t\t\t} else {\n\t\t\t\tdfc1 = df.getElementsByTagName(\"h1\")[0];\n\t\t\t\tdfc2 = df.getElementsByTagName(\"h4\")[0];\n\t\t\t}\n\n\t\t\tfor (var item in data[key]) {\n\t\t\t\tif (item == \"companyName\")\n\t\t\t\t\tdfc1.innerHTML = data[key][item];\n\t\t\t\telse if (item == \"tickerName\")\n\t\t\t\t\tdfc2.innerHTML = data[key][item];\n\t\t\t\telse if (item == \"exchangeName\")\n\t\t\t\t\tdfc2.innerHTML += \" \"+ data[key][item];\n\t\t\t}\n\t\t/* header elements done */\n\t\t} else if ((key == \"income-statement\")\n\t\t\t || (key == \"balance-sheet\") \n\t\t\t || (key == \"cash-flow\")) {\n\t\t\tdf = document.getElementById(key);\n\t\t\tif (df.childElementCount == 0) {\n\t\t\t\tcrElemF = true;\n\t\t\t\tdfc = document.createElement(\"h4\");\n\t\t\t\tdfc.innerHTML = key;\n\t\t\t\tdf.appendChild(dfc);\n\t\t\t} else {\n\t\t\t\tdfc = df.getElementsByTagName(\"h4\")[0];\n\t\t\t\tcrElemF = false;\n\t\t\t}\n\n\n\t\t\tvar i = 0, arr = \"\", val;\n\t\t\tvar ucf = 1; /* unit conversion factor,=1 for USD mil */\n\t\t\tfor (var item in data[key]) {\n\t\t\t\tif (crElemF) {\n\t\t\t\t\tdfc = document.createElement(\"div\");\n\t\t\t\t\tdfc.setAttribute(\"class\",\"line-item\");\n\t\t\t\t\tdf.appendChild(dfc);\n\t\t\t\t\tdfc1 = document.createElement(\"span\");\n\t\t\t\t\tdfc1.setAttribute(\"class\",\"label\");\n\t\t\t\t\tdfc.appendChild(dfc1);\n\t\t\t\t\tdfc2 = document.createElement(\"span\");\n\t\t\t\t\tdfc2.setAttribute(\"class\",\"data\");\n\t\t\t\t\tdfc.appendChild(dfc2);\n\t\t\t\t} else {\n\t\t\t\t\tdfc = df.getElementsByTagName(\"div\")[i++];\n\t\t\t\t\tarr = dfc.getElementsByTagName(\"span\");\n\t\t\t\t\tdfc1 = arr[0]; /* label */\n\t\t\t\t\tdfc2 = arr[1]; /* data */\n\t\t\t\t}\n\t\t\t\tdfc1.innerHTML = item;\n\t\t\t\tdfc2.innerHTML = val = data[key][item];\n\n\t\t\t \tif (item == \"Data Unit\") {\n\t\t\t\t\tdfc2.setAttribute(\"id\",key+\"-units\");\n\t\t\t\t\tif (val == \"USD Millions\")\n\t\t\t\t\t\tucf = 1;\n\t\t\t\t\telse if (val == \"USD Thousands\")\n\t\t\t\t\t\tucf = 0.001; /* convert to mil */\n\t\t\t\t}\n\n\t\t\t\t/* transfer values to vars used in calculations */\n\t\t\t\tif (key == \"income-statement\") { \n\t\t\t\t\tif (item == \"Sales/Revenue\")\n\t\t\t\t\t sales = ucf*(+val.replace(/[,()]/g,\"\"));\n\t\t\t\t\telse if (item == \"EBIT\")\n\t\t\t\t\t ebit = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t\t\telse if (item == \n\t\t\t\t\t \"Depreciation & Amortization Expense\")\n\t\t\t\t\t depr = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t \t\telse if (item == \"Interest Expense\")\n\t\t\t\t\t intExp = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t \t\telse if (item == \"Pretax Income\")\n\t\t\t\t\t pretaxInc = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t \t else if (item == \"Income Tax\")\n\t\t\t\t\t incTax = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t \t else if (item ==\n\t\t\t\t\t \"Diluted Shares Outstanding\")\n\t\t\t\t\t dilShares = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t\t} else if (key == \"balance-sheet\") {\n\t\t\t\t\tif (item == \"Cash & Short Term Investments\")\n\t\t\t\t\t cash = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t\t\telse if (item == \"Long-Term Note Receivable\")\n\t\t\t\t\t ltNoteR = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t\t\telse if (item ==\n\t\t\t\t\t \"Other Long-Term Investments\")\n\t\t\t\t\t ltInvCash = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t\t\telse if (item ==\n\t\t\t\t\t \"ST Debt & Current Portion LT Debt\")\n\t\t\t\t\t stDebt = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t\t\telse if (item == \"Long-Term Debt\")\n\t\t\t\t\t ltDebt = ucf*(+val.replace(/,/g,\"\"));\n\t\t\t\t} else if (key == \"cash-flow\") {\n\t\t\t \t\tif (item == \"Net Operating Cash Flow\")\n\t\t\t\t\t ocf = ucf*(+val.replace(/[,()]/g,\"\"));\n\t\t\t\t\telse if (item == \"Capital Expenditures\")\n\t\t\t\t\t capex = ucf*(+val.replace(/[,()]/g,\"\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* fin-data elements done */\n\t}\n\t/* all data elements done */\n\n\t/* --- derive info from data */\n\tsales_ps = sales/dilShares;\n\toe_ps = (ebit != 0) ? (ebit/dilShares) : ((pretaxInc+intExp)/dilShares);\n\tdepr_ps = depr/dilShares;\n\tcapex_ps = capex/dilShares;\n\teff_cash_ps = cash_ps = (cash+ltInvCash)/dilShares;\n\ttotdebt_ps = (stDebt+ltDebt-ltNoteR)/dilShares;\n\ttaxRate = incTax/pretaxInc;\n\tocf_ps = ocf/dilShares;\n\texc_eqcash_ps = Math.max((cash_ps - 0.05*sales_ps),0);\n\tintcov = ((ebit !=0) ? ebit : (pretaxInc+intExp))/intExp;\n\n\t/* display calculations */\n\tvar i = 0, arr, val_ps = 0;\n\tdf = document.getElementById(\"calculations\");\n\n\t/* sales p.s. */\n\tif (crElemF) crDisplayRow(\"calculations\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tarr[0].innerHTML = \"Sales p.s.\";\n\tarr[1].innerHTML = sales_ps.toFixed(2);\n\n\t/* Op.Earnings p.s. */\n\tif (crElemF) crDisplayRow(\"calculations\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tarr[0].innerHTML = \"Operating Earnings p.s.\";\n\tarr[1].innerHTML = oe_ps.toFixed(2);\n\n\t/* OCF p.s. */\n\tif (crElemF) crDisplayRow(\"calculations\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tarr[0].innerHTML = \"OCF p.s.\";\n\tarr[1].innerHTML = ocf_ps.toFixed(2);\n\n\t/* capex p.s. */\n\tif (crElemF) crDisplayRow(\"calculations\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tarr[0].innerHTML = \"Capex p.s.\";\n\tarr[1].innerHTML = capex_ps.toFixed(2);\n\n\t/* Depreciation p.s. */\n\tif (crElemF) crDisplayRow(\"calculations\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tarr[0].innerHTML = \"D&A p.s.\";\n\tarr[1].innerHTML = depr_ps.toFixed(2);\n\n\t/* Cash p.s. */\n\tif (crElemF) crDisplayRow(\"calculations\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tarr[0].innerHTML = \"Cash & ST Inv. p.s.\";\n\tarr[1].innerHTML = cash_ps.toFixed(2);\n\tarr[1].setAttribute(\"id\",\"cashps\");\n\n\t/* Total Debt p.s. */\n\tif (crElemF) crDisplayRow(\"calculations\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tarr[0].innerHTML = \"Total Debt p.s.\";\n\tarr[1].innerHTML = totdebt_ps.toFixed(2);\n\n\t/* display derived values */\n\ti = 0; df = document.getElementById(\"derived\");\n\t/* Tax Rate */\n\tif (crElemF) crDisplayRow(\"derived\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tarr[0].innerHTML = \"Tax Rate (%)\";\n\tarr[1].innerHTML = (100*taxRate).toFixed(2);\n\n\t/* Excess Cash in equity p.s. */\n\tif (crElemF) crDisplayRow(\"derived\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tarr[0].innerHTML = \"Excess cash in equity p.s.\";\n\tarr[1].innerHTML = exc_eqcash_ps.toFixed(2);\n\tarr[1].setAttribute(\"id\",\"exc-eqcashps\");\n\n\t/* Interest coverage */\n\tif (crElemF) crDisplayRow(\"derived\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tarr[0].innerHTML = \"Interest Coverage\";\n\tarr[1].innerHTML = intcov.toFixed(2);\n\t\n\t/* display valuations */\n\ti = 0; df = document.getElementById(\"valuation\");\n\t/* EB value display */\n\t/* Earnings discount */\n\tif (crElemF) crDisplayRow(\"valuation\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tif (crElemF) {\n\t\tarr[0].innerHTML = \"Earnings/OCF discount (%)\";\n\t\tdfc = document.createElement(\"input\");\n\t\tdfc.setAttribute(\"type\", \"text\");\n\t\tdfc.setAttribute(\"class\",\"input\");\n\t\tdfc.setAttribute(\"id\",\"earn-disc\");\n\t\tdfc.size = \"5\";\n\t\tdfc.defaultValue = \"0\";\n\t\tarr[1].appendChild(dfc);\n\t}\n\tdfc = document.getElementById(\"earn-disc\");\n\tdfc.value = dfc.defaultValue;\n\n\t/* Cash held abroad */\n\tif (crElemF) crDisplayRow(\"valuation\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tif (crElemF) {\n\t\tarr[0].innerHTML = \"Cash held abroad (%)\";\n\t\tdfc = document.createElement(\"input\");\n\t\tdfc.setAttribute(\"type\", \"text\");\n\t\tdfc.setAttribute(\"class\",\"input\");\n\t\tdfc.setAttribute(\"id\",\"cash-abroad\");\n\t\tdfc.size = \"5\";\n\t\tdfc.defaultValue = \"0\";\n\t\tdfc.onchange = function () {\n\t\t\tvar dfc = document.getElementById(\"cash-abroad\");\n\t\t\teff_cash_ps = (1-(+dfc.value/100)*taxRate)*cash_ps;\n\t\t\texc_eqcash_ps = Math.max((eff_cash_ps-0.05*sales_ps),0);\n\n\t\t\tvar dfc1 = document.getElementById(\"exc-eqcashps\");\n\t\t\tdfc1.innerHTML = exc_eqcash_ps.toFixed(2);\n\t\t}\n\t\tarr[1].appendChild(dfc);\n\t}\n\tdfc = document.getElementById(\"cash-abroad\");\n\tdfc.value = dfc.defaultValue;\n\n\t/* EB Value */\n\tif (crElemF) crDisplayRow(\"valuation\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tif (crElemF) {\n\t\tarr[0].innerHTML = \"EB Value p.s.\";\n\t\tarr[0].setAttribute(\"class\",\"label-valuation\");\n\t\tarr[1].setAttribute(\"id\",\"ebval\");\n\t\tarr[1].setAttribute(\"class\",\"data-valuation\");\n\t}\n\tval_ps = calcEBV();\n\tarr[1].innerHTML = val_ps.toFixed(2);\n\n\t/* DCF value display */\n\t/* OCF Growth Rate - Y1-Y5 */\n\tif (crElemF) crDisplayRow(\"valuation\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tif (crElemF) {\n\t\tarr[0].innerHTML = \"OCF Growth Rate Y1-Y5 (%)\";\n\t\tdfc = document.createElement(\"input\");\n\t\tdfc.setAttribute(\"type\", \"text\");\n\t\tdfc.setAttribute(\"class\",\"input\");\n\t\tdfc.setAttribute(\"id\",\"GR5y\");\n\t\tdfc.size = \"5\";\n\t\tdfc.defaultValue = \"3\";\n\t\tarr[1].appendChild(dfc);\n\t}\n\tdfc = document.getElementById(\"GR5y\");\n\tdfc.value = dfc.defaultValue;\n\n\t/* OCF Growth Rate - Y15-Y20 */\n\tif (crElemF) crDisplayRow(\"valuation\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tif (crElemF) {\n\t\tarr[0].innerHTML = \"OCF Growth Rate Y5-Y20 (%)\";\n\t\tdfc = document.createElement(\"input\");\n\t\tdfc.setAttribute(\"type\", \"text\");\n\t\tdfc.setAttribute(\"class\",\"input\");\n\t\tdfc.setAttribute(\"id\",\"GR15y\");\n\t\tdfc.size = \"5\";\n\t\tdfc.defaultValue = \"1.8\";\n\t\tarr[1].appendChild(dfc);\n\t}\n\tdfc = document.getElementById(\"GR15y\");\n\tdfc.value = dfc.defaultValue;\n\n\t/* Discount Rate */\n\tif (crElemF) crDisplayRow(\"valuation\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tif (crElemF) {\n\t\tarr[0].innerHTML = \"Discount Rate (%)\";\n\t\tdfc = document.createElement(\"input\");\n\t\tdfc.setAttribute(\"type\", \"text\");\n\t\tdfc.setAttribute(\"class\",\"input\");\n\t\tdfc.setAttribute(\"id\",\"disc-rate\");\n\t\tdfc.size = \"5\";\n\t\tdfc.defaultValue = \"10\";\n\t\tarr[1].appendChild(dfc);\n\t}\n\tdfc = document.getElementById(\"disc-rate\");\n\tdfc.value = dfc.defaultValue;\n\n\t/* DCF Value */\n\tif (crElemF) crDisplayRow(\"valuation\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tif (crElemF) {\n\t\tarr[0].innerHTML = \"DCF Value p.s.\";\n\t\tarr[0].setAttribute(\"class\",\"label-valuation\");\n\t\tarr[1].setAttribute(\"id\",\"dcfval\");\n\t\tarr[1].setAttribute(\"class\",\"data-valuation\");\n\t}\n\tval_ps = calcDCFV();\n\tarr[1].innerHTML = val_ps.toFixed(2);\n\t\n\t/* Calculate Value button */\n\tif (crElemF) crDisplayRow(\"valuation\");\n\tdfc = df.getElementsByTagName(\"div\")[i++];\n\tarr = dfc.getElementsByTagName(\"span\");\n\tif (crElemF) {\n\t\tarr[0].innerHTML = \"\";\n\t\tdfc = document.createElement(\"input\");\n\t\tdfc.setAttribute(\"type\", \"button\");\n\t\tdfc.value = \"Calculate\";\n\t\tdfc.onclick = function () {\n\t\t\tvar val_ps = calcEBV();\n\t\t\tvar dfc = document.getElementById(\"ebval\");\n\t\t\tdfc.innerHTML = val_ps.toFixed(2);\n\n\t\t\tval_ps = calcDCFV();\n\t\t\tdfc = document.getElementById(\"dcfval\");\n\t\t\tdfc.innerHTML = val_ps.toFixed(2);\n\n\t\t\tval_ps = calcFV();\n\t\t\tdfc = document.getElementById(\"fval\");\n\t\t\tdfc.innerHTML = val_ps.toFixed(2);\n\t\t}\n\t\tarr[1].appendChild(dfc);\n\t}\n\n\tdfc = document.getElementById(\"fval\");\n\tdfc.innerHTML = calcFV().toFixed(2);\n}", "function poundToInrConverter(){\n\tvar xhttp= new XMLHttpRequest();\n\txhttp.onreadystatechange = function(){\n\t\tif(this.readyState == 4 && this.status == 200){\n\t\t\tvar apiData =JSON.parse(this.responseText);\n\t\t\tvar poundData = 0.0;\n\t\t\tvar newValue=0.0;\n\t\t\tvar updateAmount=0.0;\n\n\t\t\tpoundData=document.getElementById('pounds').value;\n\t\t\tnewValue=apiData.rates.INR;\n\t\t\tupdateAmount =poundData*newValue;\n\t\t\t\n\t\t\tdocument.getElementById('rupees').value = updateAmount;\t\n\t\t}\n\t};\n\txhttp.open(\"GET\",'https://api.fixer.io/latest?base=GBP&symbols=INR',true);\n\txhttp.send();\n}", "function calcTotals() {\n var incomes = 0;\n var expenses = 0;\n var budget;\n // calculate total income\n data.allItems.inc.forEach(function(item) {\n incomes+= item.value;\n })\n //calculate total expenses\n data.allItems.exp.forEach(function(item) {\n expenses+= item.value;\n })\n //calculate total budget\n budget = incomes - expenses;\n // Put them in our data structure\n data.total.exp = expenses;\n data.total.inc = incomes;\n //Set Budget\n data.budget = budget;\n }", "function postRESTlet(datain) {\n\n}", "function calculateBasedMem() {\n\t//var theForm = document.forms[\"capacity_form\"];\n var qtyAppNode = document.getElementById('qtyAppNode').value;\n var appNodeMem = document.getElementById('memNodeSize').value;\n var memPodSize = document.getElementById('memPodSize').value;\n var totalAppNodeMem = appNodeMem * qtyAppNode;\n var totalPodPerMem = totalAppNodeMem / memPodSize;\n return totalPodPerMem;\n\t//display the result\n //document.getElementById('ccapacity').innerHTML = \"Total pod por Mem: \"+totalPodPerMem;\n}", "function calcular() {\n var c1 = $('#c1').val();\n var c2 = $('#c2').val();\n var constantes = {c1,c2};\n $.ajax({\n type: 'POST',\n url: '/PSO-classic/calculapso/',\n contentType: 'application/json; charset=utf-8',\n data: JSON.stringify({ \n indiv: JSON.stringify(indiv),\n objetivo: JSON.stringify(objetivo),\n constantes: JSON.stringify(constantes),\n }),\n success: function(response){\n console.log(response);\n //Atualizando lista de indivs\n indiv = response.slice()\n limparTela();\n plotTela(objetivo)\n }\n });\n}", "function startServerSideOperation () { // this is a lot of stuff - best to extract into a function and call the function where you want all this to happen\n // console.log( 'in startServerSideOperation' );\n // assemble object from input. don't have to set as new vars, can put the stuff after the = in inputObject, but looks cleaner to do it this way\n var firstNumber = $('#firstNum').val();\n var secondNumber = $('#secondNum').val();\n var mathOperation = doThis;\n\n var inputObject = {\n \"input1\": firstNumber,\n \"input2\": secondNumber,\n \"oper\": mathOperation\n }; // end inputObject\n\n // post to server with ajax;\n $.ajax({ // this is a method call to AJAX in jQuery that receives an object\n url: \"/pathPost\",\n type: \"POST\", // makes request to server, server posts this ajax call to above url using app.post. if type were GET, would make request to server, server would get this ajax call from above url.\n data: inputObject, // what gets sent to the server\n success: function(newData){ // represents response from server (calculation completed in server node module that gets passed in app.post as res.write or res.send)\n console.log(newData);\n // // if post is successful we've received back \"newData\"\n // // send \"newData\" to processResponse to do something with it (display to DOM)\n processResponse(newData);\n },\n statusCode: {\n 404: function(){\n alert('error connecting to server');\n } // end 404\n } // end statusCode\n }); // end AJAX request\n} // end startServerSideOperation function", "function getValues() {\n event.preventDefault();\n document.querySelector('.tripOutput').setAttribute('style','display:flex;');\n document.getElementById('image').src=\"https://flevix.com/wp-content/uploads/2020/01/Preloader.gif\";\n let location=document.getElementById('location').value;\n let travelStartDate=document.getElementById('travelStartDate').value;\n let travelEndDate=document.getElementById('travelEndDate').value;\n if(difBtDates(createDateObjectFromDate(travelStartDate),createDateObjectFromDate(travelEndDate))>=0){\n postData('http://localhost:8000/saveData',{location,travelStartDate,travelEndDate}).then(function(response){\n displayData(response)\n });\n }\n else {\n mbar.add('Return date cannot be less than start Date');\n document.getElementById('image').src='';\n document.querySelector('.tripOutput').setAttribute('style','display:none;');\n }\n console.log(location,travelStartDate,travelEndDate);\n}", "getFormData() {\n let data = this.$mainForm.serialize();\n data = `${data}&categories=${IndexAnimationsObj.category}&limit=50`;\n if (Map_Obj.latitude)\n data += `&latitude=${Map_Obj.latitude.toFixed(\n 3\n )}&longitude=${Map_Obj.longitude.toFixed(3)}`;\n return data;\n }", "function handlePostRequest(request, response){\n var data = \"\";\n \n // Collect all the data\n request.on(\"data\", (dataChunk) => data += dataChunk);\n\n // Parse the data to an object and use the object depending on the request\n request.on(\"end\", () => {\n var postObject = queryParser.parse(data);\n console.log(postObject);\n\n switch(request.url) {\n // Request from client to create a new route\n case \"/client/sendroute\": dbRoute.addRouteForBoat(postObject, response);\n break;\n // Save the gps location\n case \"/gps\": dbGps.recieveGpsLocation(postObject, response);\n break;\n // Do a arduino request for the calibration\n case \"/arduino/calibrate\": dbGps.calibrateLocation(postObject, response);\n break;\n }\n\n request.removeAllListeners();\n })\n}", "sum(){\n let t=data[0];\n var sum;\n for(x=0;x<t.length; x++){\n sum=sum+t[x];\n }\n return sum;\n }", "async function APIcall(requestInformation){\n\tconsole.log(requestInformation)\n\tconst response = await axios({\n\t\tmethod : 'post',\n\t\turl : 'https://api.daimler-mobility.com/internal/ocapi/v2/de/calculations',\n\t\tdata : {\n\t\t\t\"context\": \n\t\t\t{\n\t\t\t\t\"input\": \n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": \"customer_type\",\n\t\t\t\t\t\t\"value\": requestInformation.customer_group\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": \"calculation_type\",\n\t\t\t\t\t\t\"value\": \"leasing\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": \"deposit_amount\",\n\t\t\t\t\t\t\"value\": requestInformation.sonderzahlung + requestInformation.downpayment\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": \"period_months\",\n\t\t\t\t\t\t\"value\": requestInformation.laufzeit\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": \"total_mileage\",\n\t\t\t\t\t\t\"value\": (requestInformation.km*requestInformation.laufzeit)/12\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"caller\": \"cc\",\n\t\t\t\t\"market\": \"DE\",\n\t\t\t\t\"locale\": \"de_DE\"\n\t\t\t},\n\t\t\t\"vehicle\": \n\t\t\t{\n\t\t\t\t\"name\": requestInformation.name,\n\t\t\t\t\"prices\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": \"purchasePrice\",\n\t\t\t\t\t\t\"rawValue\": requestInformation.brutto_list_price_mitSonderausstattung\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"vehicleConfiguration\": {\n\t\t\t\t\t\"baumuster\": requestInformation.baumuster,\n\t\t\t\t\t\"modelYear\": requestInformation.modelYear,\n\t\t\t\t\t\"division\": \"pc\",\n\t\t\t\t\t\"brand\":\"mercedes-benz\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t})\n .then(res => res.data.output)\n\t\n\tconst collected_discount = requestInformation.collected_discount\n\tconst rate = response.rate\n\tconst aktion_str = response.containers.filter(item => item.id.includes('fullSummary'))[0].items.filter(item => item.id.includes('installment'))[0].disclaimer\n\tconst aktion = aktion_str === null ? \"null\" : aktion_str.substr(aktion_str.length-5)\n \n\tconsole.log(\"containers: \" + response.containers)\n\tconsole.log(\"str1 : \"+ aktion_str)\n//\tconsole.log(\"ding : \"+ leasing_product)\n\tWriteBackGoogleSheet (collected_discount,rate,aktion)\n}", "function handleSubmit(e) {\n e.preventDefault();\n const queryString = `http://localhost:4000/api/${query}`;\n axios.get(queryString)\n .then(res => {\n setPObj({\n pos: res.data.positive + buffer,\n neg: res.data.negative + buffer\n });\n console.log(res.data);\n })\n .catch(err => console.log(err));\n }", "function calculatePrice(fab_id, product_id){\n $('#product_price').html('');\n $('#product_og_price').html('');\n var _token = $(\"input[name='_token']\").val();\n $.ajax({\n url: \"/product/price/calculate\",\n type:'POST',\n data: {_token:_token, fab_id:fab_id, product_id:product_id},\n dataType: 'json',\n success:function(response){\n $('#product_price').append('MYR '+response.price);\n $('#product_og_price').append('MYR '+response.og_price);\n product_price = response.price;\n }\n });\n }", "calculate(id, value){\n\n //Fetching the Slider value for every change\n let {amount, duration}= this.getSlidervalue(id, value);\n \n \n //Make Http call for getting Data for given parameters\n this.getInterestAndAmount(amount,duration)\n .then(response => {\n if (response && response.data && response.data.monthlyPayment && response.data.nominalInterestRate) {\n //save results into state\n this.setState({monthlyInst: response.data.monthlyPayment.amount});\n this.setState({rateOfInterest: response.data.nominalInterestRate});\n } else {\n return null;\n }\n })\n .catch(error => {\n console.log(error);\n });\n \n \n\n\n }", "function convert_single_request(data, orig) {\n var obj = {};\n\n var t = orig.type;\n\n if (orig.cached) {\n obj.cached = 1;\n obj.sizecache = orig.size;\n } else {\n obj.size = orig.size;\n }\n\n if (!orig.url.startsWith(\"data:\"))\n obj.url = orig.url;\n\n obj.url_display = sanitize_url(orig.url);\n obj.code = orig.code;\n\n // add the request to one of lists\n if (t != \"Document\" && t != \"Script\" && t != \"Stylesheet\" &&\n t != \"Image\" && t != \"XHR\" && t != \"Font\") {\n obj.type = t;\n t = \"Other\";\n }\n var list = data.sections[t];\n if (!list) {\n data.sections[t] = [];\n list = data.sections[t];\n }\n list.push(obj);\n\n // update counts\n var names = [\"total\", t+\"count\"];\n for (const name of names) {\n var total = get_counters(data, name);\n// total[\"reqtotal\"] += 1;\n// total[\"kbtotal\"] += orig.size;\n if (orig.cached) {\n total[\"reqcached\"] += 1;\n total[\"kbcached\"] += orig.size;\n } else {\n total[\"reqtransf\"] += 1;\n total[\"kbtransf\"] += orig.size;\n }\n }\n\n}", "async function dataposted(url,temp, feelings){ /* Function to POST data */\n let fetchedData = await fetch(url, {\n method: 'POST', \n headers: {\n 'Content-Type': 'application/json; charset=UTF-8',\n },\n // Body data type must match \"Content-Type\" header\n \n body: JSON.stringify({\n date:newDate,\n temp:temp,\n feelings:feelings\n })\n })\n}", "function collectAnswer(){\n var onesD = Number($(\"td#onesD > span\").text());\n var tensD = Number($(\"td#tensD > span\").text()) *10;\n var hndsD = Number($(\"td#hndsD > span\").text()) *100;\n var thdsD = Number($(\"td#thdsD > span\").text()) *1000;\n var tthdsD = Number($(\"td#tthdsD > span\").text()) *10000;\n var hthdsD = Number($(\"td#hthdsD > span\").text()) *100000;\n var totalD = onesD+tensD+hndsD+thdsD+tthdsD+hthdsD;\n return{\n totalD: totalD\n };\n}", "_calculatePlayerArmor()\n {\n var armorClass = 0;\n var formData = new FormData();\n formData.append(\"item\", this.state.player.armor);\n const requestOptions = \n {\n method: 'POST',\n body: formData,\n }\n // fetch armor\n fetch('https://mi-linux.wlv.ac.uk/~2006100/ci3/index.php/Game/getItem', requestOptions)\n .then(res => res.json())\n .then(data => {\n // check to see if player has any item equiped in slot\n if(data !== undefined){\n const item = data[0];\n armorClass = Number(item.i_def);\n this._calculatePlayerOffhand(armorClass);\n }\n })\n .catch(console.log);\n }", "function getRate(request, response) {\n const mail_type = request.query.mail_type;\n const mail_weight = Number(request.query.weight);\n computeRate(response, mail_type, mail_weight);\n}", "function postPresentValue() {\n\n\tconst presentValueCalculator = $(\"#present-value-calculator\")\n\tconst weeklyPayment = presentValueCalculator.find(\"#weekly-payment\").val()\n\tconst weeks = presentValueCalculator.find(\"#weeks\").val()\n\tconst interestRate = presentValueCalculator.find(\"#interest-rate\").val()\n\n\tconst data = calculatePresentValue(weeklyPayment, weeks, interestRate)\n\n\tconst label1 = presentValueCalculator.find(\"#result-label-1\")\n\tconst label2 = presentValueCalculator.find(\"#result-label-2\")\n\tconst value1 = presentValueCalculator.find(\"#result-value-1\")\n\tconst value2 = presentValueCalculator.find(\"#result-value-2\")\n\n\tconst numIsValid = !isNaN(data.presentValue) && data.totalPayment != 0\n\n\tlabel1.html(numIsValid ? \"Total Payment\" : \"\")\n\tvalue1.html(numIsValid ? formatNumberIntoDollars(data.totalPayment) : \"\")\n\tlabel2.html(numIsValid ? \"Present Value\" : \"\")\n\tvalue2.html(numIsValid ? formatNumberIntoDollars(data.presentValue) : \"\")\n\n}", "function processData(input) {\n console.log(formatting(parseAndCompute(input), 3));\n}", "function Generatedata(){\n const zibvalue= zip.value\n const feelingsvalue=feelings.value\n\n gitWeatherApi(ApiUrl,zibvalue,ApiKey).then((res)=>{\n console.log(res);\n // make destructing object to filter data\n const{main:{temp},name:city,weather:[{description}]}=res\n const obsend={\n newdate,\n temp:Math.round(temp),\n city,\n description,\n feelingsvalue\n };\n postData(urlserver + '/add',obsend)\n fetchDataInUi()\n })\n}", "function getPostObject(state)\n{\n\nlet measurement_description = { \n type:state.type,\n key:getKey(),\n start_time:formatDate(state.start_time),\n end_time:formatDate(state.end_time),\n count:state.count,\n interval_sec:1,\n priority:state.priority,\n parameters:{\n target:state.target.substring(8),\n server:\"null\",\n direction:state.tcp_speed_test, \n }\n };\nlet job_description = {\n measurement_description,\n node_count:state.node_count,\n job_interval:state.job_interval\n}\n\nlet result={job_description, request_type:\"SCHEDULE_MEASUREMENT\" ,user_id:getKey(), };\n\nreturn result;\n}", "function sumData(data) {\n\n return data.reduce(sum);\n }", "function sendAddRequest() {\n\t// get the input HTML fields\n\tvar summand_field = document.getElementById( \"summand\" );\n\tvar addend_field = document.getElementById( \"addend\" );\n\n\t// parse the fields for the summand and addend\n\tvar summand = parseFloat( summand_field.value );\n\tvar addend = parseFloat( addend_field.value );\n\n\t// test that we have valid numbers\n\tif ( isNaN( summand ) || isNaN( addend ) ) {\n\t\talert( \"Both the summand and addend must be valid numbers.\" );\n\t\treturn;\n\t}\n\n\t// wrap the summand and addend as XAL doubles and send the request to the server\n\tmessage_session.sendRequest( \"add\", summand.to_xal_double(), addend.to_xal_double(), function( response ) {\n\t\tvar sum_elem = document.getElementById( \"binarysum\" );\t// get the output HTML field\n\t\tsum_elem.innerHTML = response.result.from_xal();\t\t// display the result\n\t} );\n}", "function tickers(){\n request(dataIndo, function(error, response, body){\n // handle errors if any\n if(error){\n console.log(error);\n } else {\n // parse json\n let data = JSON.parse(body);\n // get last price\n indo={\n meninggal : data[0].meninggal,\n sembuh : data[0].sembuh,\n positif : data[0].positif\n }\n }\n });\n\n request(dataProv, function(error, response, body){\n if(error){\n console.log(error);\n } else {\n let dataProv = JSON.parse(body);\n prov = (dataProv)\n //console.log(dataProv);\n }\n });\n}", "function inrToPoundConvert(){\n\tvar xhttp= new XMLHttpRequest();\n\txhttp.onreadystatechange = function(){\n\t\tif(this.readyState == 4 && this.status == 200){\n\t\t\tvar apiData =JSON.parse(this.responseText);\n\t\t\tvar indianData = 0.0;\n\t\t\tvar newValue=0.0;\n\t\t\tvar updateAmount = 0.0;\n\n\t\t\tindianData=document.getElementById('rupees').value;\n\t\t\tnewValue = apiData.rates.GBP;\n\t\t\tupdateAmount = indianData * newValue;\n\t\t\t\n\t\t\tdocument.getElementById('pounds').value = updateAmount;\t\n\t\t\t\n\t\t}\n\t};\n\txhttp.open(\"GET\",'https://api.fixer.io/latest?base=INR&symbols=GBP',true);\n\txhttp.send();\n}", "request_funds() {\n const fundForm = document.querySelector(\"#fund-form\");\n fundForm.addEventListener(\"submit\", function (e) {\n e.preventDefault();\n\n // get fund request form info\n const userName = fundForm[\"user-name\"].value;\n const userEmail = fundForm[\"user-email\"].value;\n const fundPurpose = fundForm[\"fund-purpose\"].value;\n const fundRequested = fundForm[\"fund-requested\"].value;\n //const fundBreakdown =\n });\n }", "function controllerSubmit(event) {\n event.preventDefault();\n const form = getObjectWithExpectedType(() => event.target, HTMLFormElement);\n const data = new FormData(form);\n console.log(data);\n const delta = Number(data.get('delta'));\n if (Number.isSafeInteger(delta) && delta > 0) {\n update(0, delta);\n draw();\n }\n }", "function calculate(req, res) {\n let op = req.params.op;\n let num1 = req.params.num1;\n let num2 = req.params.num2;\n console.log(req.params);\n let answer = \"\";\n let number = 0;\n console.log(req.params.op);\n if (op == \"NOT\") {\n console.log(\"Im in the not\");\n let bits = num1.split(\"\");\n for (let i = 0; i < bits.length; i++) {\n if (bits[i] == '1') {\n bits[i] = '0';\n } else {\n bits[i] = '1';\n }\n }\n let comb = bits.join(\"\");\n answer = comb;\n console.log(answer);\n } else if (op == \"OR\") {\n console.log(\"Im in or\");\n let bits1 = num1.split(\"\");\n let bits2 = num2.split(\"\");\n for (let i = 0; i < bits1.length; i++) {\n answer += bits1[i] | bits2[i];\n }\n } else if (op == \"AND\"){\n console.log(\"Im in and\");\n let bits1 = num1.split(\"\");\n let bits2 = num2.split(\"\");\n for (let i = 0; i < bits1.length; i++) {\n answer += bits1[i] & bits2[i];\n }\n }\n\n // Send the answer back to the user\n res.send(answer);\n}", "function calculoTotalesFinal(){\n var outer = ajaxCall(urlCalculoTotales,'GET', {codigo:$('#id-cabecera').val()});\n outer.then(function(res){\n res = JSON.parse(res);\n $('#total-ventas-final').val(res.precioTotal);\n });\n}" ]
[ "0.69649553", "0.6146883", "0.6086589", "0.58769006", "0.58691067", "0.5860629", "0.5857744", "0.5754083", "0.57466686", "0.5737391", "0.57179224", "0.56892616", "0.5679746", "0.56786704", "0.5670388", "0.56685823", "0.56661713", "0.5662497", "0.56557065", "0.5636636", "0.5606392", "0.55856526", "0.55790997", "0.5577765", "0.55661386", "0.55460083", "0.55403847", "0.5532166", "0.5527913", "0.55035067", "0.5486628", "0.54727286", "0.5471009", "0.54586774", "0.5431079", "0.5431042", "0.5430206", "0.54211766", "0.5420605", "0.54161936", "0.53992", "0.5397637", "0.53810817", "0.53516746", "0.53348976", "0.53305846", "0.5329019", "0.53265816", "0.5324674", "0.5322471", "0.53189564", "0.53182673", "0.53047353", "0.5292059", "0.52866447", "0.5279146", "0.52781475", "0.5246433", "0.5238083", "0.5236196", "0.52318364", "0.5231093", "0.5223461", "0.5221243", "0.5220457", "0.5212931", "0.5212868", "0.5205814", "0.52052534", "0.51971316", "0.51968676", "0.5194812", "0.51935273", "0.51784086", "0.5177138", "0.51581466", "0.5147589", "0.51448256", "0.5144774", "0.514477", "0.513285", "0.51319945", "0.51270115", "0.5126834", "0.5124359", "0.51227736", "0.5118368", "0.51173866", "0.5116579", "0.5114172", "0.5113695", "0.51095587", "0.51090074", "0.51065177", "0.510272", "0.5100976", "0.5097722", "0.50973415", "0.5093637", "0.5090919", "0.50908864" ]
0.0
-1
O(n) n: size of Queue
deQueue() { if (!this.En_stack.length) { throw new Error('Queue is empty') } while (this.En_stack.length != 1) { this.De_stack.push(this.En_stack.pop()) } let x = this.En_stack.pop() while (this.De_stack.length != 0) { this.En_stack.push(this.De_stack.pop()) } return x }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSize(){\n return queue.length;\n }", "size(){\n return this.queue.length;\n }", "queueSize() {\n return this.queue.length\n }", "size() {\n return this.queue.size();\n }", "TotalItemsInQueue(){\n return this._length;\n }", "get size() {\n return this._queue.size;\n }", "get fullQueueLength()\n {\n return this.insert - this.end;\n }", "get queueLength()\n {\n if (this.insert === this.end)\n {\n return 0;\n }\n else\n {//remove layer changes from queueLength as they don't take up a tick\n let _return = 0;\n const queue = this.queue;\n for (let i = this.end, insert = this.insert; i < insert; ++i )\n {\n if (queue[i].type < spriteY)//values above this are instant teleports\n {\n ++_return;\n }\n }\n return _return;\n }\n }", "get size() {\n return this._queue.size;\n }", "get size() {\n return this._queue.size;\n }", "length() {\n return this.queue.length\n}", "enqueue(val) {\n let newQueueNode = new Node(val);\n if(!this.front) {\n this.front = newQueueNode;\n this.back = newQueueNode;\n } else {\n newQueueNode.next = this.front;\n this.front = newQueueNode;\n }\n this.size++;\n return this.size;\n }", "function Queue(){var _1=[];var _2=0;this.getSize=function(){return _1.length-_2;};this.isEmpty=function(){return (_1.length==0);};this.enqueue=function(_3){_1.push(_3);};this.dequeue=function(){var _4=undefined;if(_1.length){_4=_1[_2];if(++_2*2>=_1.length){_1=_1.slice(_2);_2=0;}}return _4;};this.getOldestElement=function(){var _5=undefined;if(_1.length){_5=_1[_2];}return _5;};}", "enqueue(val) {\n let newNode = new Node(val); // create new node\n\n if (this.front === null) { // if queue is empty\n this.front = newNode; // HEAD\n this.back = newNode; // TAIL\n\n } else { // queue not empty\n this.back.next = newNode;\n this.back = newNode;\n }\n\n this.length++;\n\n return this.length;\n }", "function size() {\r\n var counter = 0;\r\n for (var i = 0; i < this.PriorityQueueContents.length; i++) {\r\n counter += this.PriorityQueueContents[i].ids.length;\r\n }\r\n return counter;\r\n }", "get size() {\n return this.#queue.length;\n }", "length () {\n return this.queue.length - 1\n }", "function Queue() {\n this.elements = [];\n\n // isEmpty :: () -> Boolean\n this.isEmpty = () => !length(this.elements);\n // put :: (String, Int) -> ()\n this.put = (element, priority) => {\n this.elements[0] && this.elements[0].priority > priority\n ? this.elements = [{element, priority}, ...this.elements]\n : this.elements = [...this.elements, {element, priority}];\n }\n // get :: () -> String\n this.get = () => {\n let [{element}, ...elements] = this.elements;\n this.elements = elements;\n return element;\n }\n}", "function Queue(){var a=[],b=0;this.getLength=function(){return a.length-b};this.isEmpty=function(){return 0==a.length};this.enqueue=function(b){a.push(b)};this.dequeue=function(){if(0!=a.length){var c=a[b];2*++b>=a.length&&(a=a.slice(b),b=0);return c}};this.peek=function(){return 0<a.length?a[b]:void 0}}", "enqueue (value) {\n if (this.checkOverflow()) return\n if (this.checkEmpty()) {\n this.front += 1\n this.rear += 1\n } else {\n if (this.rear === this.maxLength) {\n this.rear = 1\n } else this.rear += 1\n }\n this.queue[this.rear] = value\n }", "enque(ele) {\n if (this.rear == this.capacity - 1) {\n console.log(\"Queue is full\");\n return;\n }\n if (this.front == -1) {\n this.front++;\n\n\n\n }\n this.items[++this.rear] = ele;\n this.Size++;\n }", "size() {\r\n\t\treturn this.heap.length;\r\n\t}", "size() {\r\n\t\treturn this.heap.length;\r\n\t}", "size() {\n\t\treturn this.heap.length;\n\t}", "function Queue(){\n this.first = undefined;\n this.last = undefined;\n this.size = 0;\n }", "size() {\n return this.tail - this.head;\n }", "function CircularQueue(n)\n{\n this.circular=new Array(n);\n for(i=0;i<n;i++)\n this.circular[i]=undefined;\n this.freeIndex=0;\n this.deleteIndex=-1;\n this.elements=0;\n}", "function solve(queue) {\n const n = queue.size();\n if (n <= 1) return queue;\n for (let i = 0; i < n - 1; ++i) {\n let top = queue.popFront();\n for (let j = 0; j < n - 1; ++j) {\n const e = queue.popFront();\n if (top > e) {\n queue.pushBack(e);\n } else {\n queue.pushBack(top);\n top = e;\n }\n }\n queue.pushBack(top);\n }\n return queue;\n}", "get enqueue_size(){\n return this.resolved_promises.length\n }", "function Queue(){\n\n // initialise the queue and offset\n var queue = [];\n var offset = 0;\n\n // Returns the length of the queue.\n this.getLength = function(){\n return (queue.length - offset);\n }\n\n // Returns true if the queue is empty, and false otherwise.\n this.isEmpty = function(){\n return (queue.length == 0);\n }\n\n // Returns true if all values are the same\n this.isEquivalent = function(){\n\tlet value = queue[offset];\n\tfor (let item = offset; item < offset + queue.length; item++){\n\t\tif (queue[item] !== queue[offset])\n\t\t\treturn false;\n\t}\n\treturn true;\n }\n \n /* Enqueues the specified item. The parameter is:\n *\n * item - the item to enqueue\n */\n this.enqueue = function(item){\n queue.push(item);\n }\n\n /* Dequeues an item and returns it. If the queue is empty, the value\n * 'undefined' is returned.\n */\n this.dequeue = function(){\n\n // if the queue is empty, return immediately\n if (queue.length == 0) return undefined;\n\n // store the item at the front of the queue\n var item = queue[offset];\n\n // increment the offset and remove the free space if necessary\n if (++ offset * 2 >= queue.length){\n queue = queue.slice(offset);\n offset = 0;\n }\n\n // return the dequeued item\n return item;\n\n }\n\n /* Returns the item at the front of the queue (without dequeuing it). If the\n * queue is empty then undefined is returned.\n */\n this.peek = function(){\n return (queue.length > 0 ? queue[offset] : undefined);\n }\n\n}", "function Queue() {\n this._oldestIndex = 1;\n this._newestIndex = 1;\n this._storage = {};\n}", "queueIsFull() {\n return this.queue.length >= this.maxSize\n }", "get length() {\n return this.queue.length;\n }", "size(){\n return this.rear-this.front + 1;\n }", "function queue(){\n this.tail = 1;//index starts at 1\n this.head = 1;\n this.itemList = {};\n //return the size of the queue\n this.size = function(){\n return this.head - this.tail;\n }\n //Check if the queue is empty\n this.empty = function(){\n return this.size() <= 0 ? 1 : 0;\n }\n //push an item into the beginning of the queue\n this.push = function(item){\n this.itemList[this.head] = item;\n this.head++;\n return;\n }\n //return the item at the end of the queue and remove it from the queue\n this.pull = function(){\n if (this.empty()){\n return null;\n }\n var result;\n result = this.itemList[this.tail];\n delete this.itemList[this.tail];\n this.tail++;\n return result\n }\n //empty the queue\n this.init = function(){\n while (!this.empty()){\n this.pull;\n }\n return;\n }\n}", "size() {\n return Math.abs(this.tail - this.head);\n }", "function Queue() {\n this.els = new Array();\n this.head = 0;\n this.size = 0;\n}", "function aQ(queue){\n\tthis.queue = queue;\n\tthis.enqueue = enqueue;\n\tthis.dequeue = dequeue;\n\tthis.front = front;\n\tthis.contains = contains;\n\tthis.isEmpty = isEmpty;\n\n\tthis.size = size;\n}", "get dequeue_size(){\n return this.resolvers.length\n }", "get length() {\n return _classPrivateFieldGet(this, _queue).length + _classPrivateFieldGet(this, _pending);\n }", "enqueue(item) {\n this.queue.push(item);\n this.size += 1;\n }", "function runQueue() {\n let newQueue = new Queue\n\n oddNumbers.forEach(num => newQueue.enqueue(num))\n newQueue.dequeue() \n newQueue.peek()\n newQueue.length() \n newQueue.dequeue() \n\n\n\n console.log(newQueue)\n \n}", "function size() {\n return n;\n }", "function showQueueLength(q) {\n const queueNumber = document.querySelector(\".queue-number span\");\n queueNumber.textContent = q.length;\n\n const bar = document.querySelector(\".inner_bar\");\n bar.style.width = q.length + \"0px\";\n}", "function Queue() {\n this.length = 0;\n}", "enqueue(val) {\n let newNode = new Node(val);\n if (!this.first) {\n this.first = newNode;\n this.last = newNode;\n } else {\n this.last.next = newNode;\n this.last = newNode;\n }\n return ++this.size;\n }", "function Queue() {\n var collection = [];\n this.print = function() {\n console.log(collection);\n };\n \n this.enqueue = function(elem) {\n // pushes elem to tail of queue\n return collection.push(elem);\n };\n\n this.dequeue = function() {\n // removes and returns front elem\n return collection.shift();\n };\n\n this.front = function() {\n // lets us see front element\n return collection[0];\n };\n\n this.size = function() {\n // shows the queue length\n return collection.length;\n };\n\n this.isEmpty = function() {\n // check if queue is empty\n return collection.length === 0;\n };\n}", "function getQueueLength(pub){\n\n var pubItem = document.getElementById(pub);\n\n if (pubItem.classList.contains('short-queue')){\n return 1;\n }\n else if(pubItem.classList.contains('medium-queue')){\n return 2;\n }\n else if(pubItem.classList.contains('long-queue')){\n return 3;\n }\n else{\n return 5;\n }\n}", "enqueue(value){\n const newNode = new Node(value);\n //if queue is empty\n if (this.size === 0) {\n this.first = newNode;\n this.last = newNode;\n // add current first pointer to new first(new node), and make new node new first\n } else {\n this.last.next = newNode;\n this.last = newNode;\n }\n //add 1 to size\n this.size++;\n\n return this;\n }", "enqueue(value) {\n // Create a new node to store the value\n let node = new _Node(value);\n\n // If the node is the first to be added\n if (this.first === null) {\n this.first = node;\n this.size++;\n }\n\n // Shift existing node in last to the next position in queue\n if (this.last) {\n this.last.next = node;\n }\n\n // Make the new node last\n this.last = node;\n this.size++;\n }", "function size() {\n\t return n;\n\t }", "function queue(nMax)\n{\n this.queuefront = 0;\n this.queueback = 0;\n this.queuemax = nMax;\n this.queuesize = 0;\n this.elements = new Array(nMax);\n this.reset = qReset;\n this.max = qMax;\n this.empty = qEmpty;\n this.size = qSize;\n this.front = qFront;\n this.push = qPush;\n this.pop = qPop;\n}", "enqueue(\n element // Time Complexity O(1)\n ) {\n if (this.isEmpty()) {\n this.list.push(element);\n } else {\n let added = false;\n for (let i = 0; i < this.list.length; i++) {\n if (element[1] < this.list[i][1]) {\n // Checking priorities\n this.list.splice(i, 0, element);\n added = true;\n break;\n }\n }\n if (!added) {\n this.list.push(element);\n }\n }\n }", "function Queue() {\n this.tail = [];\n this.head = [];\n this.offset = 0;\n}", "function getQueuePart(node, size) {\n\tvar context = node.context();\n\tvar part = [];\n\tif (size) {\n\t\tif (context.object_queue.length >= size) {\n\t\t\tfor (var i = 0; i < size; i++) {\n\t\t\t\tpart.push(context.object_queue.shift());\n\t\t\t}\n\t\t} else {\n\t\t\tvar ql = context.object_queue.length;\n\t\t\tfor (var i = 0; i < ql; i++) {\n\t\t\t\tpart.push(context.object_queue.shift());\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif (context.object_queue.length >= node.pagesize) {\n\t\t\tfor (var i = 0; i < node.pagesize; i++) {\n\t\t\t\tpart.push(context.object_queue.shift());\n\t\t\t}\n\t\t} else {\n\t\t\tvar size = context.object_queue.length;\n\t\t\tfor (var i = 0; i < size; i++) {\n\t\t\t\tpart.push(context.object_queue.shift());\n\t\t\t}\n\t\t}\n\t}\n\treturn part;\n}", "enqueue(number) {\n return this.queue.push(number)\n}", "function Queue() {\n this.size = 0;\n this.inStack = new Stack();\n this.outStack = new Stack();\n}", "length() {\n const queueLen = this.queue.length;\n debug(`\\nLOG: There are total ${queueLen} data in the queue`);\n return queueLen;\n }", "function Queue(maxLen){\n\n // initialise the queue and offset\n var queue = [];\n var offset = 0;\n var maxLength = (typeof maxLen !== 'undefined' ? maxLen : 100000);\n\n // Returns the length of the queue.\n this.getLength = function(){\n return (queue.length - offset);\n }\n\n // Returns true if the queue is empty, and false otherwise.\n this.isEmpty = function(){\n return (queue.length == 0);\n }\n\n /* Enqueues the specified item. The parameter is:\n *\n * item - the item to enqueue\n */\n this.enqueue = function(item){\n queue.push(item);\n if(queue.length > maxLength) {\n this.dequeue(); //get rid of older images\n }\n }\n\n /* Dequeues an item and returns it. If the queue is empty, the value\n * 'undefined' is returned.\n */\n this.dequeue = function(){\n\n // if the queue is empty, return immediately\n if (queue.length == 0) return undefined;\n\n // store the item at the front of the queue\n var item = queue[offset];\n\n // increment the offset and remove the free space if necessary\n if (++ offset * 2 >= queue.length){\n queue = queue.slice(offset);\n offset = 0;\n }\n\n // return the dequeued item\n return item;\n\n }\n\n /* Returns the item at the front of the queue (without dequeuing it). If the\n * queue is empty then undefined is returned.\n */\n this.peek = function(){\n return (queue.length > 0 ? queue[offset] : undefined);\n }\n\n this.find = function(item) {\n for(var i = 0; i < queue.length; i++) {\n if(item == queue[i]) {\n return i;\n }\n }\n return -1;\n }\n\n}", "enqueue(value) {\n if (!this.queueIsFull()) {\n this.queue.push(value)\n }\n }", "function Queue(){\n\tvar item = [];\n\tthis.enqueue = function(element){\n\t\titem.push(element);\n\t};\n\tthis.dequeue = function(){\n\t\titem.shift();\n\t};\n\tthis.front = function(){\n\t\treturn item[0];\n\t};\n\tthis.isEmpty = function(){\n\t\treturn item.length == 0;\n\t};\n\tthis.clear = function(){\n\t\titem = [];\n\t};\n\tthis.size = function(){\n\t\treturn item.length;\n\t};\n\tthis.print = function(){\n\t\tconsole.log(item.toString());\n\t};\n}", "function PriorityQueue() {\n this.heap = [];\n this.size = 0;\n}", "add(value){\n\n this.qLength++;\n\n //as Queue is collection of nodes, create a new node\n //also it's implementation is in FIFO so the new node is to be added at last node\n\n const newNode = {\n before:this.last,\n after:null,\n value:value,\n }\n\n //check if the Queue is empty and then set the new node as first node\n\n if(this.last ===null){\n this.first = newNode;\n } else{ /* if the Queue is not empty then set the after pointer of the last node\n to the new node */\n this.last.after = newNode;\n }\n // set the last pointer to the new node\n this.last = newNode;\n\n }", "function OrderedQueue() {\n this._index = 0;\n this._items = [];\n}", "function OrderedQueue() {\n this._index = 0;\n this._items = [];\n}", "size() {\n if (this.isEmpty()){\n return 0;\n }\n\n var size = 1;\n var runner = this.head;\n while (runner.next != null) {\n runner = runner.next;\n size ++;\n }\n return size;\n }", "deque() {\n if (this.front == -1) {\n console.log(\"Queue is empty\");\n return null;\n }\n var ele = this.items[this.front++];\n this.Size--;\n if (this.front > this.rear) {\n this.front = this.rear = -1;\n }\n return ele;\n }", "function Queue(){\n\tvar count = 0;\n\tvar head = null;\n\tvar tail = null;\n\n\tthis.GetCount = function(){\n \treturn count;\n\t}\n\n\tthis.Enqueue = function (data) {\n\t\tvar node = {\n\t \tdata: data,\n\t \tnext: head\n\t\t};\n\n\t\tif (head === null) {\n\t \ttail = node;\n\t\t}\n\n\t\thead = node;\n\n\t\tcount++;\n\t}\n\n\n\tthis.Dequeue = function () {\n\t\tif (count === 0) {\n\t \treturn 'empty';\n\t\t}\n\t\telse {\n\t \tvar dq = tail.data;\n\t \tvar current = head;\n\t \tvar previous = null;\n\n\t \twhile (current.next) {\n\t \tprevious = current;\n\t \tcurrent = current.next;\n\t \t}\n\n\t \tif (count > 1) {\n\t \tprevious.next = null;\n\n\t \ttail = previous;\n\t \t}\n\t \telse {\n\t \thead = null;\n\t \ttail = null;\n\t \t}\n\n\t \tcount--;\n\t\t}\n\t \treturn dq;\n\t}\n\n}", "push(element) {\n const oldBack = this._back;\n let newBack = oldBack;\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n }", "push(element) {\n const oldBack = this._back;\n let newBack = oldBack;\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n }", "function Queue() {\n this.elements = [];\n}", "MyQueue(capacity) {\n this.capacity = capacity;\n var items = new items(capacity);\n }", "sizeBy(options) {\n // eslint-disable-next-line unicorn/no-fn-reference-in-iterator\n return this._queue.filter(options).length;\n }", "dequeue() {\n this.size -= 1;\n return this.queue.shift();\n }", "dequeue() {\n\t\tif ( this.size() >= 1 ) {\n\t\t\tlet nextUp = this._storage[this._start];\n\t\t\tdelete this._storage[this._start];\n\n\t\t\tif ( this._start == this._end ) {\n\t\t\t\tthis._start = this._end = -1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._start++;\n\t\t\t}\n\t\t\treturn nextUp;\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Queue is Empty!\");\n\t\t\treturn false;\n\t\t}\n\t}", "size() {\n let len = 0;\n let runner = this.head;\n\n while (runner) {\n len += 1;\n runner = runner.next;\n }\n return len;\n }", "add(element) {\n if (this.isEmpty()) {\n this.queue.push(element);\n this.length += 1;\n } else {\n let len = this.length ++;\n for (let i = 0; i < len; i++) {\n let curr_tile = this.queue[i];\n if (element.getValue() < curr_tile.getValue() ||\n (element.equals(curr_tile) && element.diagonalDistance(this.goalTile) < curr_tile.diagonalDistance(this.goalTile))) {\n this.queue.splice(i, 0, element);\n return;\n }\n }\n this.queue.push(element);\n }\n }", "sizeBy(options) {\n return this._queue.filter(options).length;\n }", "function Queue(){\n this.queue = [];\n}", "enqueue(element, priority){\n var newElement = new QueueEntry(element, priority);\n var valueExists = false; \n\n for(var i = 0; i < this.items.length; i++){\n if(this.items[i].priority > newElement.priority) {\n this.items.splice(i, 0, newElement);\n valueExists = true; \n break; \n }\n }\n if(!valueExists){\n this.items.push(newElement);\n }\n }", "function Queue( MAX ) {\r\n Writable.call( this, {\r\n objectMode: true,\r\n decodeStrings: false,\r\n } );\r\n this.queue = [];\r\n this.MAX = MAX || MAX_ELEMENTS;\r\n}", "size () {\n if (!this.head) {\n return 0 \n }\n\n let current = this.head;\n let count = 0; \n\n while(current) {\n count++\n current = current.next\n }\n\n return count\n }", "dequeue() {\n if (!this.first) return null;\n\n let current = this.first;\n if (this.first === this.last) this.last = null;\n this.first = this.first.next;\n this.size--;\n return current.val;\n }", "push(val){\n let newNode = new Node(val)\n if (this.size === 0){\n this.first = newNode;\n this.last = newNode\n }\n else{\n let oldFirst = this.first;\n this.first = newNode;\n newNode.next = oldFirst;\n }\n return ++this.size; // this.size++; // return this.size\n }", "dequeue() {\n if (!this.first) return null;\n const temp = this.first;\n if (this.first === this.last) {\n this.first = null;\n }\n this.first = this.first.next;\n this.size -= 1;\n return temp.val;\n }", "size() {\n let current = this.head;\n let counter = 0;\n while (current) {\n counter++;\n current = current.next;\n }\n return counter;\n }", "enqueue(val){\n let newNode = new NodeQ(val)\n if(this.head === null){\n this.head = newNode\n this.tail = newNode\n } else {\n let currentTail = this.tail\n currentTail.next = newNode\n this.tail = newNode\n }\n this.length++\n return newNode\n\n}", "bfs(startingNode) {\n let visited = {}\n\n for (let key of this.AdjList.keys()) {\n visited[key] = false\n }\n\n let queue = new Queue()\n visited[startingNode] = true\n queue.enqueue(startingNode)\n\n while (!queue.isEmpty()) {\n let queueElement = queue.dequeue()\n\n console.log(queueElement)\n\n let adjList = this.AdjList.get(queueElement)\n for (let i = 0; i < adjList.length; i++) {\n let newElement = adjList[i]\n if (!visited[newElement]) {\n visited[newElement] = true\n queue.enqueue(newElement)\n }\n }\n }\n }", "dequeue() {\n if (!this.first) throw new Error(\"Cannot dequeue! Queue is empty\");\n let removed = this.first;\n // only one item in queue: remove it and set last to be null\n if (this.first === this.last) {\n this.last = null;\n }\n // set first to be what came after first, which will be null if queue has only one item\n this.first = this.first.next;\n this.size -= 1;\n return removed.val;\n }", "function minimumBribes(queue) {\n let chaotic = false\n var bribes = 0\n for (let i = 0; i < queue.length; i++) {\n //someone bribed over 2 times\n if (queue[i] - (i+1) > 2) { chaotic = true }\n for (let j = queue[i] - 2; j < i; j++) {\n if (queue[j] > queue[i]) { bribes++ }\n }\n }\n if(chaotic === true){\n console.log(\"Too chaotic\")\n } else {\n console.log(bribes)\n }\n}", "function showQueue(queueData) {\n // show queue number\n document.querySelector(\"#queue-number\").textContent = queueData.length;\n}", "compareQueues(queue2) {\n\n }", "enqueue(element) {\n if (this.maxSize){\n if(this.rear+1 == this.maxSize){\n throw Error ('The queue is overflowing.');\n }\n }\n this.rear +=1;\n this.queue[this.rear] =element;\n }", "observeQueue() {\n setInterval(() => {\n console.log('queueSize: ' + queueHandler.size());\n console.log('5s have passed');\n this.processQueue();\n }, 5000)\n }", "function Queue(){\n this.arr = [];\n }", "enqueue(values) {\n values.forEach(v => {\n this.queue.binaryTree.push(v);\n this.queue.siftUp(this.queue.size() - 1);\n });\n }", "function Queue() {\n\tthis.arr = [];\n\tthis.head = function() {\n\t\treturn this.arr[0];\n\t};\n\tthis.dequeue = function() {\n\t\tif (this.arr.length == 0) {\n\t\t\treturn \"Queue underflow!\";\n\t\t} else {\n\t\t\treturn this.arr.shift();\n\t\t}\n\t};\n\tthis.enqueue = function(o) {\n\t\tthis.arr.push(o);\n\t};\n\tthis.isEmpty = function() {\n\t\t\treturn this.arr.length == 0;\n\t};\n}", "function h$Queue() {\n var b = { b: [], n: null };\n this._blocks = 1;\n this._first = b;\n this._fp = 0;\n this._last = b;\n this._lp = 0;\n}", "function h$Queue() {\n var b = { b: [], n: null };\n this._blocks = 1;\n this._first = b;\n this._fp = 0;\n this._last = b;\n this._lp = 0;\n}", "function h$Queue() {\n var b = { b: [], n: null };\n this._blocks = 1;\n this._first = b;\n this._fp = 0;\n this._last = b;\n this._lp = 0;\n}", "function h$Queue() {\n var b = { b: [], n: null };\n this._blocks = 1;\n this._first = b;\n this._fp = 0;\n this._last = b;\n this._lp = 0;\n}" ]
[ "0.73047346", "0.68975836", "0.6850611", "0.67753685", "0.67177117", "0.67029214", "0.6701284", "0.66809857", "0.6664896", "0.6664896", "0.6573936", "0.656145", "0.65551335", "0.65366787", "0.6456364", "0.6452665", "0.6430783", "0.63523483", "0.6328634", "0.63236105", "0.6281921", "0.627046", "0.627046", "0.626484", "0.6242715", "0.62339973", "0.6195736", "0.61857563", "0.61444664", "0.6117919", "0.6086987", "0.60632795", "0.60450774", "0.60387594", "0.6016486", "0.6013173", "0.5987103", "0.5976334", "0.597258", "0.59719175", "0.59711015", "0.5967445", "0.5953442", "0.59406924", "0.5932303", "0.590914", "0.5907798", "0.58966744", "0.589034", "0.5880523", "0.58615446", "0.5860158", "0.58520496", "0.58485675", "0.58433723", "0.58274764", "0.5822362", "0.5790747", "0.5786002", "0.5744535", "0.57391864", "0.57376057", "0.5734313", "0.5733539", "0.5733539", "0.57305866", "0.5725478", "0.5720168", "0.5715158", "0.5715158", "0.5701523", "0.5697875", "0.5690715", "0.56797785", "0.5673668", "0.56718177", "0.5653751", "0.56495976", "0.5639089", "0.5628663", "0.56239456", "0.56218654", "0.5616361", "0.5614172", "0.5610509", "0.5610382", "0.5609297", "0.560884", "0.56078935", "0.5594819", "0.55907965", "0.55821455", "0.55751127", "0.5573746", "0.5571403", "0.5568117", "0.5563587", "0.55628055", "0.55628055", "0.55628055", "0.55628055" ]
0.0
-1
TODO: Add cell blinking here NOTE: Mb. to implement blinking just draw blinking romb on top of the cell ?
draw(ctx, x, y, cell_width, cell_height) { for (let h = 0; h < this.height; h++) { // each odd line is 1 cell shorter for (let w = 0; w < this.width - (h & 1); w++) { let index = (h * this.width - (~~(h / 2))) + w; if (this.cells[index].playerId != 0) { this.playersCells[this.cells[index].playerId].add(index); } // NOTE: It can probably be a static method this.cells[index].draw(ctx, x + w * cell_width + ((h % 2) * cell_width / 2), y + h * cell_height - (h * (cell_height / 2)), cell_width, cell_height ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "blink() {\n let xEyes = 20;\n let yEyes = 50;\n let sEyes = 1.0;\n\n if (this.sleep === true) {\n fill(255, 255, 255);\n\n rect(\n this.x + 125 * sEyes,\n this.y + 130 * sEyes,\n xEyes * sEyes,\n yEyes * sEyes\n );\n rect(\n this.x + 55 * sEyes,\n this.y + 130 * sEyes,\n xEyes * sEyes,\n yEyes * sEyes\n );\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}", "function okBlink() {\n context.fillStyle = \"green\";\n context.fill();\n setTimeout(() => {\n context.fillStyle = \"black\";\n context.fill();\n }, 150);\n}", "function modifyCellDisplay(cell) {\n if (cell.live) {\n // + 0.75 and + 0.5 to keep in line with grid line shifts\n ctx.fillRect(cell.x + 0.75, cell.y + 0.5, 10, 10);\n } else {\n ctx.clearRect(cell.x + 0.75, cell.y + 0.5, 9.5, 9.5);\n }\n}", "update() {\n let xpos = 0, ypos = 0;\n let i;\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.ctx.strokeStyle = \"#E0E0E0\";\n for (i = 0; i < this.cols*this.rows; i++) {\n if (i % this.cols === 0 && i !== 0) {\n ypos += this.cellSize;\n xpos = 0;\n }\n if (this.engine.getCellStateFromIndex(i) === 1) {\n this.ctx.fillRect(xpos, ypos, this.cellSize, this.cellSize);\n }\n if (this.cellSize > 5) {\n this.ctx.strokeRect(xpos, ypos, this.cellSize, this.cellSize);\n }\n xpos += this.cellSize;\n }\n }", "function drawCell(i,j){\n if( (i+j)%2==0 ) {\n ctx.fillStyle = (\"#8ECC39\"); //dark green\n }else{\n ctx.fillStyle = \"#A7D948\"; //light green\n }\n ctx.fillRect(cellSize*i, cellSize*j, cellSize, cellSize);\n}", "blink() {\n this.movingAllowed = false;\n const xDisappear = -303;\n const yDisappear = -303;\n this.x = xDisappear;\n this.y = yDisappear;\n setTimeout(function() {\n this.x = this.startX;\n this.y = this.startY;\n setTimeout(function() {\n this.x = xDisappear;\n this.y = yDisappear;\n }.bind(this), 500)\n setTimeout(function() {\n setTimeout(function() {\n this.x = this.startX;\n this.y = this.startY;\n this.movingAllowed = true;\n }.bind(this), 500)\n }.bind(this), 500)\n }.bind(this), 1000);\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 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 }", "function redrawBorad(){\n ctx.clearRect(startPointX,startPointY, 500, 500);\n gameBoard.showBoard();\n ctx.linewitdh = 1;\n drawTable();\n}", "renderLiveCells() {\n for (const [, cell] of this.liveCells) {\n this.context.beginPath();\n const posX = cell[0] * this.cellSize;\n const posY = cell[1] * this.cellSize;\n this.context.fillStyle = this.playersColors[cell[2]] || cell[2] || 'blue';\n this.context.fillRect(posX, posY, this.cellSize, this.cellSize);\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}", "function cellDraw() {\n if (pencilBtn.classList.contains(\"active\")) {\n cell = document.querySelectorAll(\".content\");\n for (let i = 0; i < cell.length; i++) {\n console.log(cell[i]);\n cell[i].addEventListener(\"mouseenter\", (e) => {\n e.target.style.backgroundColor = \"black\";\n });\n }\n } else if (rgbBtn.classList.contains(\"active\")) {\n cell = document.querySelectorAll(\".content\");\n for (let i = 0; i < cell.length; i++) {\n console.log(cell[i]);\n cell[i].addEventListener(\"mouseenter\", (e) => {\n e.target.style.backgroundColor =\n \"#\" + Math.floor(Math.random() * 16777215).toString(16);\n });\n }\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}", "draw() {\n requestAnimationFrame(() => {\n const ctx = this.#canvas.getContext('2d');\n ctx.fillStyle = this.#style.color;\n for (let x = 0; x < this.#width; x += 1) {\n for (let y = 0; y < this.#height; y += 1) {\n if (this.cell(x, y) === alive) {\n ctx.fillRect(\n x * this.#style.size,\n y * this.#style.size,\n this.#style.size,\n this.#style.size);\n }\n else {\n ctx.clearRect(\n x * this.#style.size,\n y * this.#style.size,\n this.#style.size,\n this.#style.size);\n }\n }\n }\n });\n }", "blink(text) {\n if ((text.alpha === 1)) {\n if (this.tick === 45) {\n text.setAlpha(0);\n this.tick = 0;\n }\n }\n else {\n if (this.tick === 30) {\n text.setAlpha(1);\n this.tick = 0;\n }\n }\n }", "function blinkText(){\n if(!blink){\n context.font =\"30px menuFont\";\n context.fillStyle = \"white\";\n context.fillText(\"Press Enter\", canvas.width/2-70, canvas.height/2+60);\n blink = true;\n }\n else if(blink){\n context.fillStyle = \"black\";\n context.fillRect(canvas.width/2-80, canvas.height/2+33, 200, 35);\n blink = false;\n }\n}", "hoverCell() {\n if (this.hoverCol === null && this.hoverRow === null) return;\n this.context.beginPath();\n const posX = this.hoverCol * this.cellSize;\n const posY = this.hoverRow * this.cellSize;\n this.context.strokeStyle = this.hoverColor;\n this.context.strokeRect(posX, posY, this.cellSize, this.cellSize);\n }", "function paint_cell(x, y, num)\n\t{\t\n\t\tvar gc_colors = [\"#1BCFC3\", \"#1BCFC3\" , \"#1BCFC3\"];\n\t\tctx.fillStyle = gc_colors[num % 3];\n\t\tctx.fillRect(x*cell_w, y*cell_w, cell_w, cell_w);\n\t\tctx.strokeStyle = gc_colors[num % 3];\n\t\tctx.strokeRect(x*cell_w, y*cell_w, cell_w, cell_w);\n\t}", "draw(){\n fill(this.color);\n if(this.winner){\n if(this.winner_toggle % 3 == 0){\n fill('YELLOW');\n }\n this.winner_toggle += 1;\n }\n stroke(this.color);\n rect(this.r*CELL_SIZE, this.c*CELL_SIZE, \n CELL_SIZE, CELL_SIZE);\n }", "function paint_cell(x, y)\n {\n ctx.fillStyle = \"white\";\n ctx.fillRect(x*cw, y*cw, cw, cw);\n ctx.strokeStyle = \"blue\";\n ctx.strokeRect(x*cw, y*cw, cw, cw);\n }", "function draw() {\n\tif (rowRemoved && soundIsOn) {\n\t\trowPopAudio.play()\n\t\trowRemoved = false\n\t}\n\tfor (let y = 0; y < playField.length; y++) {\n\t\tfor (let x = 0; x < playField[y].length; x++) {\n\t\t\tif (playField[y][x] === 1) {\n\t\t\t\tmainCellArr[y][x].style.opacity = '1'\n\t\t\t} else if (playField[y][x] === 2) {\n\t\t\t\tmainCellArr[y][x].style.opacity = '1'\n\t\t\t} else {\n\t\t\t\tmainCellArr[y][x].style.opacity = '0.25'\n\t\t\t}\n\t\t}\n\t}\n}", "function drawCell(col, row, fill){\r\n\tif (fill){\r\n\t\tcontext.fillStyle = B_COLOR;\r\n\t\tcontext.fillRect(col*CELL_SIZE, row*CELL_SIZE, CELL_SIZE, CELL_SIZE);\r\n\t}else context.strokeRect(col*CELL_SIZE, row*CELL_SIZE, CELL_SIZE, CELL_SIZE);\r\n}", "draw() {\n if (this.isAlive) {\n fill(color(200, 0, 200));\n } else {\n fill(color(240));\n }\n noStroke();\n rect(this.column * this.size + 1, this.row * this.size + 1, this.size - 1, this.size - 1);\n }", "function paint(cell) {\n cell.addEventListener('mouseover', () => {\n cell.style.backgroundColor = '#ff5733';\n });\n}", "function colourCell( obj )\r\n\t{\r\n\t\tobj.origColor=obj.style.backgroundColor;\r\n\t\tobj.style.backgroundColor = '#E2EBF3';\r\n\t\tobj.style.cursor = \"pointer\";\r\n\t\tobj.style.border = \"solid 1px #A9B7C6\";\r\n\t}", "function paint_cell(x, y, color) {\n ctx.fillStyle = color;\n ctx.fillRect(x * cw, y * cw, cw, cw);\n ctx.strokeStyle = \"white\";\n ctx.strokeRect(x * cw, y * cw, cw, cw);\n }", "function paintCell(evt){\n changeBackgroundColor(evt.target, brushColor);\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 blink(element){\n element.animate({ borderWidth: \"2px\", margin: \"10px\" }, 'fast' )\n .animate({ borderWidth: \"0px\", margin: \"12px\" }, 'fast' )\n .animate({ borderWidth: \"2px\", margin: \"10px\" }, 'fast' )\n .animate({ borderWidth: \"0px\", margin: \"12px\" }, 'fast' )\n .animate({ borderWidth: \"2px\", margin: \"10px\" }, 'fast' )\n .animate({ borderWidth: \"0px\", margin: \"12px\" }, 'fast' )\n .animate({ borderWidth: \"2px\", margin: \"10px\" }, 'fast' )\n .animate({ borderWidth: \"0px\", margin: \"12px\" }, 'fast' )\n .animate({ borderWidth: \"2px\", margin: \"10px\" }, 'fast' )\n .animate({ borderWidth: \"0px\", margin: \"12px\" }, 'fast' )\n}", "function paintCell(x, y, color)\n\t{\n\t\tcanvas.context.fillStyle = color;\n\t\tcanvas.context.fillRect(x*cw, y*cw, cw, cw);\n\t\tcanvas.context.strokeStyle = \"white\";\n\t\tcanvas.context.strokeRect(x*cw, y*cw, cw, cw);\n\t}", "step() {\n let cells = this.board.tick();\n this.drawCells(cells);\n }", "function drawBoard() {\n $(\"#board\").html('');\n for (var i = 0; i < board.length; i++) {\n var rowDiv;\n if (i % DIM == 0) {\n rowDiv = $(\"<div>\").attr(\"id\", getRowId(i)).addClass(\"row\").appendTo(\"#board\");\n }\n\n $('<div/>')\n .attr(\"id\", getCellId(board[i]))\n .addClass(\"btn btn-primary\")\n .text(board[i])\n .appendTo(rowDiv)\n .css(\"width\", WIDTH).css(\"height\", HEIGHT)\n .on(\"click\", notifyClick);\n }\n\n // Hide the empty cell.\n $(\"#cell-0\").invisible();\n }", "function paint_cell(x, y, color)\r\n\t{\r\n\t\tctx.fillStyle = color;\r\n\t\tctx.fillRect(x*cw, y*cw, cw, cw);\r\n\t\tctx.strokeStyle = \"white\";\r\n\t\tctx.strokeRect(x*cw, y*cw, cw, cw);\r\n\t}", "onRowsRerender() {\n this.scheduleDraw(true);\n }", "function blink(color, reps) {\n for (var i = 0; i < reps+1; i++) {\n setTimeout(function(){\n document.getElementById(\"theBody\").style.backgroundColor = color;\n }, 200 * i - 100);\n setTimeout(function(){\n document.getElementById(\"theBody\").style.backgroundColor = \"#ffffff\";\n }, 200 * i);\n };\n}", "function blink(){\n // Setup of a random selektor\n let startID = Math.floor((Math.random() * 100) + 1);\n // Selekting random star\n let selection = document.querySelector( \"#\" + setStargazer[\"generateItemClass\"] + \"-\"+ startID);\n // Adding blink-classs to selektion\n selection.classList.add(setStargazer[\"setMorphClass\"]);\n setTimeout(function(){ \n // Removing Blink-class after timeout\n selection.classList.remove(setStargazer[\"setMorphClass\"]);\n }, setStargazer[\"setMorphSpeed\"]/2);\n }", "function draw_etch() {\n display.fill(0, 1, display.getWidth(), display.getHeight() - 5, \"white\", \"white\", ' ');\n for (var i = 0; i < etch.getWidth(); i++) {\n for (var j = 0; j < etch.getHeight(); j++) {\n if (etch.isMark(i, j) === 1) {\n display.fill(padLeft + i, padTop + j, 1, 1, \"black\", \"green\", 'X');\n } else {\n display.fill(padLeft + i, padTop + j, 1, 1, \"black\", \"green\", ' ');\n }\n }\n }\n}", "function drawNext(x, y, color) {\r\n var cell = getCell(x, y);\r\n if (color === undefined) {\r\n cell.style.background = \"\";\r\n removeFunctions(cell);\r\n } else {\r\n cell.style.background = color;\r\n addFunctionOnClick(cell, x, y, moveRobot);\r\n }\r\n}", "function handleCell(e) {\n //this.style.backgroundColor = colour;\n this.innerHTML = fill;\n}", "function shadeCellUnderCursor(e){\n ctx.save();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n var closestCell;\n var cellChanged = false;\n for (var i = 0; i < gridArray.length; i++) {\n cell = gridArray[i];\n if ((e.clientX + ((fullScreenWidth - currentScreenWidth) / 2) - 60 > cell.x && e.clientX + ((fullScreenWidth - currentScreenWidth) / 2) - 60 < (cell.x + 50)) && (e.clientY - 35 > cell.y && e.clientY - 35 < (cell.y + 50))) {\n if (closestCell != cell) {\n \n closestCell = cell;\n cellChanged = true;\n }\n }\n }\n ctx.fillStyle = \"rgba(50, 50, 50, 0.5)\";\n if (cellChanged == true) {\n ctx.fillRect(closestCell.x, closestCell.y, 50, 50);\n cellChanged = false;\n }\n drawBoard('dodgerblue', 'black', \"rgb(200, 200, 200)\");\n ctx.restore(); \n}", "function errorBlink() {\n context.fillStyle = \"red\";\n context.fill();\n setTimeout(() => {\n context.fillStyle = \"black\";\n context.fill();\n }, 150);\n}", "function blink() {\n var body = document.getElementById('body');\n var colors = ['#F88', '#FF8', '#8F8', '#8FF', '#88F', '#F8F'];\n for (let i = 0; i <= 17; i++) {\n setTimeout(function() {body.style.backgroundColor = colors[i % colors.length];}, i*100);\n }\n setTimeout(function() {body.style.backgroundColor = 'white';}, 1800);\n}", "updateUI() {\n this.clear();\n this.context.beginPath();\n let cells = this.automaton.cells;\n for(let x = 0; x < cells.length; x++) {\n for(let y = 0; y < cells[x].length; y++) {\n if(cells[x][y]) {\n this.context.fillRect(x*this.cellSize, y*this.cellSize, this.cellSize, this.cellSize);\n }\n }\n }\n this.context.stroke();\n }", "function draw() {\n background(0);\n b1.display();\n b2.display();\n b3.display();\n b4.display();\n b5.display();\n b6.display();\n b7.display();\n b8.display();\n b9.display();\n b10.display();\n}", "function drawGhost(x, y, gColor){\n fill(gColor);//fill Blinky with red\n noStroke();//make no parts of Blinky have outlines\n rect(x, y, 100, 60);//Blinky body base\n ellipse(x+50, y, 100, 100);//Blinky body head\n stroke(255);//white stroke color for Blinky eyeballs\n strokeWeight(4);//give him BIG eyeballs\n fill(71, 96, 255);//fill Blinky eyes with a beautiufl blue\n ellipse(x+25, y, eyeSize, eyeSize);//Blinky's left eye\n //translate(50, 0);//take the same code for left eye, duplicate it over for right eye\n ellipse(x+75, y, eyeSize, eyeSize);\n }", "function drawMain() {\n\n fillBlack();\n blinkInterval = setInterval(blinkText, 500);\n logoInterval = setInterval(logoLoop, 250);\n}", "function blink() {\n light.toggle();\n }", "function drawCells() {\n\n for(var i = 0; i < cols; i++) {\n\n const cell = document.createElement('div');\n\n if (state[i] == 1){\n cell.setAttribute(\"style\", \"background-color: black; width: 8px; height: 8px; float: left;\");\n }\n else {\n cell.setAttribute(\"style\", \"width: 8px; height: 8px; float: left;\");\n }\n\n document.body.appendChild(cell);\n }\n\n findNewState()\n}", "function draw(){\n\tvar i;\n\tgrab(\"nextb\").style.display = grab(\"prevb\").style.display = \"none\"; /* a table reset */\n\tflashlighton = 0;\n\thideall();\n\trmblocks();\n\tend_time = 1050;\n\tfor(i=0; i<dontfills.length; i++) if(dontfills[i].e > end_time) end_time = dontfills[i].e;\n\tif(cursched >= schedules.length) cursched = 0;\n\tvar sch = schedules[cursched];\n\tif(sch && sch.length) for(i=0; i<sch.length; i++) if(sch[i].e > end_time) end_time = sch[i].e;\n\tfor(i=0; i<dontfills.length; i++){\n\t\tif (!dontfills[i].c)\n\t\t\tdontfills[i].block = block(dontfills[i].d, dontfills[i].s, dontfills[i].e, dontfill_color, dontfills[i].n);\n\t\telse\n\t\t\tdontfills[i].block = block(dontfills[i].d, dontfills[i].s, dontfills[i].e, dontfills[i].c, dontfills[i].n);\n\t\tdontfills[i].block.style.zIndex = 2;\n\t\tdontfills[i].block.onclick = function(ev){ rmdontfill(ev, this); };\n\t}\n\tif(sch && sch.length) {\n\t\tfor(i=0; i<sch.length; i++){\n\t\t\tif(!sch[i].t) continue;\n\t\t\tvar a = block(sch[i].d, sch[i].s, sch[i].e, sch[i].c, sch[i].t);\n\t\t\tif(sch[i].phantom) a.style.opacity = 0.6;\n\t\t}\n\t\tgrab(\"counter\").innerHTML = (cursched+1).toString() + \"/\" + schedules.length;\n\t}\n\tgrab(\"start_time\").innerHTML = toclock(start_time);\n\tgrab(\"end_time\").innerHTML = toclock(end_time);\n\tswitch(state){\n\tcase \"blank\":\n\t\tgrab(\"state\").innerHTML = \"blank\";\n\t\tgrab(\"state\").style.color = \"black\";\n\t\treturn;\n\tcase \"unbound\":\n\t\tgrab(\"state\").innerHTML = \"unbound- make to bind.\";\n\t\tgrab(\"state\").style.color = \"coral\";\n\t\treturn;\n\tcase \"bound\":\n\t\tgrab(\"state\").innerHTML = \"bound\";\n\t\tgrab(\"state\").style.color = \"royalblue\";\n\t\treturn;\n\tdefault: tantrum();\n\t}\n}", "function b2Draw()\r\n{\r\n}", "function paint() {\n\t$('.cell').hover(function() {\n\t\t$(this).css('background-color', 'hsl(0, 0%, 90%)');\n});\n}", "function ksfCanvas_blinkButton(btn)\n{\n\tvar resetBackColor = $(btn).css('background-color');\n\tvar resetColor = $(btn).css('color');\n\t$(btn).animate(\n\t\t{\n\t\t\t\"background-color\": \"#FF8500\",\n\t\t\t\"color\": \"#fff\"\n\t\t}, 200, function()\n\t\t{\n\t\t\t$(btn).animate(\n\t\t\t{\n\t\t\t \"background-color\": resetBackColor,\n\t\t\t \"color\": resetColor\n\t\t\t}, 800);\n\t\t} );\n}", "function draw() {\n background(204, 231, 227)\n checkState();\n}", "function blink(currentColour) {\n currentColour.fadeOut(100).fadeIn(100);\n}", "function paint_cell(x, y, paintColor) {\n ctx.fillStyle = paintColor;\n ctx.fillRect(x * cw, y * cw, cw, cw);\n ctx.strokeStyle = \"white\";\n ctx.strokeRect(x * cw, y * cw, cw, cw);\n}", "function fillCell(e) {\n // calculate cell location\n var cx = ~~(e.offsetX / state.size);\n var cy = ~~(e.offsetY / state.size);\n\n if (state.mode == \"draw\" && state.canvasDrawn) {\n // fill the cell\n ctx.fillStyle = state.color;\n ctxResized.fillStyle = state.color;\n ctx.fillRect(cx * state.size, cy * state.size, state.size, state.size);\n ctxResized.fillRect(cx, cy, 1, 1);\n } else if (state.mode == \"erase\" && state.canvasDrawn) {\n // erase the cell\n if (state.hasBg) {\n ctx.fillStyle = state.colorBg;\n ctxResized.fillStyle = state.colorBg;\n ctx.fillRect(cx * state.size, cy * state.size, state.size, state.size);\n ctxResized.fillRect(cx, cy, 1, 1);\n } else {\n ctx.clearRect(cx * state.size, cy * state.size, state.size, state.size);\n ctxResized.clearRect(cx, cy, 1, 1);\n }\n }\n }", "function paint_cell(x, y, color) {\n\t\tctx.fillStyle = color;\n\t\tctx.fillRect(x * cellWidth, y * cellWidth, cellWidth, cellWidth);\n\t\tctx.strokeStyle = 'white';\n\t\tctx.strokeRect(x * cellWidth, y * cellWidth, cellWidth, cellWidth);\n\t}", "function blink(selector){\n $(selector).animate({opacity:0}, 50, \"linear\", function(){\n $(this).delay(700);\n $(this).animate({opacity:1}, 50, function(){\n blink(this);\n });\n $(this).delay(700);\n });\n}", "function shading() {\n var $cells = $('.grid-cell');\n $cells.each(function () {\n if ((columns % 2) == 0) {\n if ((Math.floor($i / columns) + $i) % 2 == 1) $(this).addClass('black')\n else $(this).addClass('white');\n $i++;\n } else {\n if (($i % 2) == 1) $(this).addClass('black')\n else $(this).addClass('white');\n $i++;\n }\n\n });\n $i = 0;\n }", "function paintCell(x, y) {\n /* This is a helper function to paint one cell white with a black border.\n * TODO 3: implement paintCell\n * Hints: use the fillStyle, fillRect, strokeStyle, strokeRect canvas functions. Remember that each cell has length cellwidth\n */\n\n ctx.fillStyle = \"white\";\n ctx.fillRect(x*cellwidth, y*cellwidth, cellwidth, cellwidth);\n ctx.strokeStyle = \"black\";\n ctx.strokeRect(x*cellwidth, y*cellwidth, cellwidth, cellwidth);\n }", "function repeat(){\n blinkingPartners\n .attr('r',\".1vh\")\n .style('opacity',1)\n .transition()\n .duration(2000)\n .ease(d3.easeLinear)\n .attr('r',\"2.5vh\")\n .style('opacity',0)\n .on(\"end\", repeat)\n \n }", "function blinkChecker() {\n const blinkers = mt.querySelectorAll('.blink');\n for (let i = 0; i < blinkers.length; i++) {\n const cell = blinkers[i];\n const sample = data.getParentGroupForAbsolutePath(cell.id)\n .samples[cell.id.toLowerCase()];\n if (sample && SampleUtils.statusChangedRecently(sample,\n conf.blinkIfNewStatusThresholdMillis)) {\n cell.className = cell.className.replace(/blink blink-\\w+/, '');\n }\n }\n} // blinkChecker", "step() {\n // const currentIndex = this.currentBufferIndex;\n // const nextIndex = this.currentBufferIndex === 0 ? 1 : 0;\n\n // animate\n const currentBuffer = this.cells[this.currentBufferIndex];\n const backBuffer = this.cells[this.currentBufferIndex === 0 ? 1 : 0];\n\n // console.log('current', currentBuffer);\n // console.log('back', backBuffer);\n\n // See if we have a nieghbor that can infect this cell and change its color:\n\n function hasInfectiousNeighbor(height, width) {\n const nextValue = (currentBuffer[height][width] + 1) % MODULO;\n // See visual rep below:\n // We are not interested in comparing X with diagonal values, only cardinal values.\n\n // WEST\n if (width > 2) {\n if (currentBuffer[height][width - 2] === nextValue) {\n return true;\n }\n }\n // NORTH\n if (height > 1) {\n if (currentBuffer[height - 1][width] === nextValue) {\n return true;\n }\n }\n // EAST\n if (width < this.width - 2) {\n if (currentBuffer[height][width + 2] === nextValue) {\n return true;\n }\n }\n // SOUTH\n if (height < this.height - 1) {\n if (currentBuffer[height + 1][width] === nextValue) {\n return true;\n }\n }\n }\n\n for (let height = 0; height < this.height; height++) {\n for (let width = 0; width < this.width; width++) {\n if (hasInfectiousNeighbor.call(this, height, width)) {\n backBuffer[height][width] =\n (currentBuffer[height][width] + 1) % MODULO;\n } else {\n backBuffer[height][width] = currentBuffer[height][width];\n }\n }\n }\n\n this.currentBufferIndex = this.currentBufferIndex === 0 ? 1 : 0;\n }", "function timerBlinker() {\n $scope.redCountdown = !$scope.redCountdown;\n $scope.blinker = setTimeout(timerBlinker, 100 * $scope.time.seconds);\n }", "function updateGraphics() {\n ui.cellColorAlive = $(\"input[name=colorAliveCellHexagon]\").val();\n ui.cellColorDead = $(\"input[name=colorDeadCellHexagon]\").val();\n ui.cellColorStroke = $(\"input[name=colorOutlineHexagon\").val(); \n ui.draw();\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}", "draw () {\n for (var column = 0; column < this.numberOfColumns; column ++) {\n for (var row = 0; row < this.numberOfRows; row++) {\n this.cells[column][row].draw();\n }\n }\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 tabCell() {\n\tremoveHighlight(TABLE);\t\n\tif (CELL) {\n\t\thighlightCell(CELL);\n\t}\n}", "function mark_visited_cell( rx, ry) // wraps in x,y ifn.\n{\n console.log( \"(p5 mark_visited_cell \", rx, ry, \" )\" );\n let pix_ob = grid_to_pix( rx, ry );\n let ctx = g_p5_cnv.canvas.getContext( '2d' ); // get html toolbox to draw. \n\t\n\tctx.fillStyle = \"#cbaf87\";\t\n\tctx.fillRect(pix_ob.x, pix_ob.y,\n g_grid.cell_size - 1, g_grid.cell_size - 1);\n\n console.log( \"end (marked_visited_cell)\" );\n}", "function changeStyle(cell)\n\t{\n\t\tcell.style.backgroundColor=\"gold\";\n\t\tcell.style.border=\"solid\";\n\t}", "function paintCell(x, y, color){\n\t\t\n\t\tctx.fillStyle = color;\n\t\tctx.fillRect(x * cellWidth, y * cellWidth, cellWidth, cellWidth);\n\t\tif(color == foodColor){\n\t\t\tctx.strokeStyle = borderCell;\t\n\t\t}else {\n\t\t\tctx.strokeStyle = background;\n\t\t}\n\t\t\n\t\tctx.strokeRect(x * cellWidth, y * cellWidth, cellWidth, cellWidth);\n\t}", "function blink(blinkText) {\n\tTweenLite.to(blinkText, 0.3, {\n\t\tautoAlpha: 0,\n\t\tdelay: 1,\n\t\tonComplete: function() {\n\t\t\tTweenLite.to(blinkText, 0.3, {\n\t\t\t\tautoAlpha: 1,\n\t\t\t\tdelay: 0.3,\n\t\t\t\tonComplete: blink,\n\t\t\t\tonCompleteParams : [blinkText]\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t});\n}", "function drawBoard() {\n\n // Get rid of old blocks\n $(\".barrier\").remove();\n\n // Draw new ones\n for(var i = 0; i < rows; i++) {\n var curr = (i + currentRow) % board.length; // which row to draw\n\n // Draw board row on gameboard.\n for(var j = 0; j < cols; j++) {\n if (board[curr][j] == 1) {\n drawBlock(i, j, true)\n }\n }\n }\n }", "function drawBricks() {\n for(c = 0; c < brickColumn; c++) {\n for(r = 0; r < brickRow; r++) {\n if(bricks[c][r].status == 1) {\n var brickX = (r*(brickWidth+brickSpace))+30;\n var brickY = (c*(brickHeight+brickSpace))+30;\n bricks[c][r].x = brickX;\n bricks[c][r].y = brickY;\n pen.beginPath();\n pen.rect(brickX, brickY, brickWidth, brickHeight);\n pen.fillStyle = \"#8A2BE2\";\n pen.fill();\n pen.closePath();\n }\n }\n }\n}", "function colorMe(now, event) {\n\tif(event.which != 1 && !now) {\n\t\treturn\n\t}\n\n\t// Draw the square\n\tevent.target.classList.replace(event.target.classList[1], document.querySelector(\"div.current-brush\").classList[1]);\n\n\tlet currentCoord = getCoords(event.target.id);\n\tif(lastCoord.length == 0) {\n\t\tlastCoord = currentCoord;\n\t}\n\n\tif(!disableLines && (Math.abs(lastCoord[0] - currentCoord[0]) > 1 || Math.abs(lastCoord[1] - currentCoord[1]) > 1)) {\n\t\t// Jumping occurred. Let's draw a line between the 2 points.\n\t\tconsole.log(\"Jump of \" + distance(currentCoord, lastCoord).toFixed(2) + \" squares occurred.\");\n\t\tlet line = calcLine(lastCoord[0], lastCoord[1], currentCoord[0], currentCoord[1]);\n\t\tline.shift();\n\n\t\tfor(coord of line) {\n\t\t\tsquare = document.getElementById(\"sq\" + getNum(coord));\n\t\t\tsquare.classList.replace(square.classList[1], document.querySelector(\"div.current-brush\").classList[1]);\n\t\t}\n\t}\n\n\tlastCoord = currentCoord;\n}", "bumpCell(x, y) {\n let { cellData } = this.state;\n const { cells, rows } = this.props;\n\n this.setColors(x, y, colors.yellow);\n\n for (let i = 0; i < cells; i++) {\n const index = i + y * cells;\n cellData[index]++;\n this.fibCheck(i, y);\n }\n\n for (let i = 0; i < rows; i++) {\n const index = x + i * cells;\n // Don't increment twice\n if (i !== y) {\n cellData[index]++;\n this.fibCheck(x, i);\n }\n }\n // Put this back in if it causes problems\n // this.setState({ cellData });\n this.setState({});\n // Set the colors back\n setTimeout(() => {\n this.setColors(x, y, colors.white);\n this.setState({});\n }, 500);\n }", "function draw() {\n background(0);\n checkState();\n}", "function flip_cells() {\n var cell_changes = window.cell_changes;\n for(var i = 0; i < cell_changes.length; i++) {\n var cell = cell_changes[i];\n var r = cell[0], \n c = cell[1],\n bg = cell[2],\n fg = cell[3],\n ord = cell[4];\n //draw the bg\n buffer_ctx.drawImage(bg_image, (bg*W), 0, W, H, (c*W), (r*H), W, H);\n //draw the fg\n buffer_ctx.drawImage(char_images[fg], ((ord%16)*W), (parseInt(ord / 16, 10)*H), W, H, (c*W), (r*H), W, H);\n }\n screen_ctx.drawImage(buffer, 0, 0);\n}", "drawCell(p, x, y, cellX, cellY, cellW, cellH) {\n\n\n\t\tif (this.selectedCell && this.selectedCell[0] === x && this.selectedCell[1] === y) {\n\t\t\tp.strokeWeight(2)\n\t\t\tp.stroke(\"red\")\n\t\t}\n\t\telse {\n\t\t\tp.strokeWeight(1)\n\t\t\tp.stroke(0, 0, 0, .2)\n\t\t}\n\n\t\tlet val = this.gameOfLifeGrid.get(x, y)\n\n\t\tp.fill(0, 0, (1 - val)*100, 1)\n\t\tp.rect(cellX, cellY, cellW, cellH)\n\n\n\t\tlet em = this.emojiGrid.get(x, y)\n\t\tp.textSize(24);\n\t\tp.text(em, cellX, cellY + 0.8*cellH)\n\n\t}", "function blink(t, d)\r\n{\r\n return ((t % d) < d/2);\r\n}", "function markCell(cell, color) {\n cell.style.background = color;\n}", "function drawNextTetro() {\n\tntCellsArr.forEach((row) => {\n\t\trow.forEach((cell) => {\n\t\t\tcell.style.opacity = '0.25'\n\t\t})\n\t})\n\tfor (let y = 0; y < nextTetro.shape.length; y++) {\n\t\tfor (let x = 0; x < nextTetro.shape[y].length; x++) {\n\t\t\tif (nextTetro.shape[y][x] === 1) {\n\t\t\t\tntCellsArr[y][x].style.opacity = 1\n\t\t\t} else {\n\t\t\t\tntCellsArr[y][x].style.opacity = '0.25'\n\t\t\t}\n\t\t}\n\t}\n}", "function blink(outputelemnt) {\n let x = true;\n setInterval(() => {\n if (x) {\n document.getElementById(outputelemnt).style.visibility = \"visible\";\n x = false;\n } else {\n document.getElementById(outputelemnt).style.visibility = \"hidden\";\n x = true;\n }\n }, 2000);\n}", "draw() {\n const { width, height, radius, animate, generation, onCellClick } = this.props;\n const svg = select(this.base);\n \n //create blur filter the first time the board is drawn\n if (!document.getElementById(GOOEY_FILTER_ID)) {\n addSVGFilter(svg, animate);\n }\n\n //set filter stdDev according to radius; disable if not animating\n const stdDev = animate ? radius * 0.75 : 0;\n document.getElementById(\"blurFilter\").setAttribute(\"stdDeviation\", `${stdDev}`);\n \n //create grid markers\n drawGrid(svg, width, height, radius);\n\n //remove dead cells if animation is ongoing\n const data = animate ? generation.filter(cell => cell.life) : generation.slice();\n drawCells(svg, width, height, radius, data, onCellClick);\n }", "function blinkEyes() {\n eyes.forEach(function(eye) {\n eye.blink();\n });\n setTimeout(function() {\n eyes.forEach(function(eye) {\n eye.blink();\n });\n }, 75);\n}", "function runAnimation() {\n\t // Draw a straight line\n\t bsBackground.draw({\n\t points: [0, height / 2 - 40, width, height / 3]\n\t });\n\n\t // Draw a straight line\n\t bsBackground.draw({\n\t points: [50, height / 3 - 40, width, height / 3]\n\t });\n\n\n\t // Draw another straight line\n\t bsBackground.draw({\n\t points: [width, height / 2, 0, height / 1.5 - 40]\n\t });\n\n\t // Draw a curve generated using 20 random points\n\t bsBackground.draw({\n\t inkAmount: 3,\n\t frames: 100,\n\t size: 200,\n\t splashing: true,\n\t points: 20\n\t });\n\t}", "function CameraCommand_Laser_BlinkBorder(elapsed)\n{\n\t//add elapsed time to ours\n\tthis.ElapsedTimeAvailable += elapsed;\n\t//reached max?\n\tif (this.ElapsedTimeAvailable >= this.HighlightTime)\n\t{\n\t\t//remove the laser points\n\t\tfor (var i = 0, c = this.LaserPoints.length; i < c; i++)\n\t\t{\n\t\t\t//remove it from the body\n\t\t\tdocument.body.removeChild(this.LaserPoints[i]);\n\t\t}\n\t\t//finished\n\t\tthis.State = __CAMERA_CMD_STATE_FINISHED;\n\t}\n\telse\n\t{\n\t\t//divide elapsed time by blink speed\n\t\tvar bBlink = Math.floor(this.ElapsedTimeAvailable / this.Blinks);\n\t\t//adjust display of laser according to whether its odd or even\n\t\tthis.LaserPoints[0].style.display = bBlink % 2 == 0 ? \"block\" : \"none\";\n\t}\n}", "function setCellLED(column, row, colour)\n{\n var key = row * 8 + column;\n\n pendingLEDs[key] = colour;\n}", "function drawCell(red, green, blue) {\r\n // open cell with specified hexadecimal triplet background color\r\n var color = '#' + red + green + blue;\r\n if (color == \"#000066\") color = \"#000000\";\r\n s += '<TD BGCOLOR=\"' + color + '\" style=\"height:12px;width:12px;\" >';\r\n // print transparent image (use any height and width)\r\n s += '<IMG ' + ((document.all) ? \"\" : \"src='place.gif'\") + ' HEIGHT=12 WIDTH=12>';\r\n // close table cell\r\n s += '</TD>';\r\n}", "function drawMouseHighlight(){\n if (gameOver) return;\n let cellNum = getCellByCoords(mouse.x, mouse.y);\n let cellCoords = getCellCoords(cellNum);\n\n if (tttboard[cellNum] == BLANK ) {\n ctx.fillStyle = 'rgba(255, 255, 255, 0.3)';\n ctx.fillRect(cellCoords.x,cellCoords.y,cell,cell);\n\n ctx.save();\n\n ctx.strokeStyle = 'rgba(255, 255, 255, 0.8)';\n ctx.translate(cellCoords.x + cell / 2, cellCoords.y + cell / 2);\n\n if (currentPlayer == X){\n drawX();\n }else {\n drawO();\n }\n\n ctx.restore();\n }else {\n ctx.fillStyle = 'rgba(255, 0, 0, 0.3)';\n ctx.fillRect(cellCoords.x,cellCoords.y,cell,cell);\n }\n\n\n }", "function blinkingText() {\r\n if ($(\"#start-game-btn\").hasClass(\"dark-green\")) {\r\n $(\"#start-game-btn\").removeClass(\"dark-green\").addClass(\"off-white\");\r\n }\r\n else {\r\n $(\"#start-game-btn\").removeClass(\"off-white\").addClass(\"dark-green\");\r\n }\r\n }", "function drawBricks() {\n\t\tbricks.forEach(row => {\n\t\t\trow.forEach(brick => {\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.rect(brick.x, brick.y, brick.w, brick.h);\n\n\t\t\t\tbrick.color = brick.color ? brick.color : getRandomColor();\n\t\t\t\tctx.fillStyle = brick.visible ? brick.color : 'transparent';\n\t\t\t\tctx.fill();\n\t\t\t\tctx.closePath()\n\t\t\t});\n\t\t});\n\t}", "function render() {\n board.forEach(function(move, index) {\n if (move === 1) {\n move = 'x';\n } if (move === -1) {\n move = 'o';\n }\n cells[index].textContent = move;\n cells[index].style.background = colors[cells];\n });\n}", "growCell() {\n if( this.cellSize < this.MAX_SIZE) {\n this.cellSize += this.GROWTH_RATE;\n }\n this.ctx.strokeStyle = this.color;\n this.ctx.beginPath();\n this.ctx.arc( this.x, this.y, this.cellSize, 0, 2*Math.PI );\n this.ctx.stroke();\n this.ctx.closePath();\n }", "function drawBricks() {\n bricks.forEach((column) => {\n column.forEach((brick) => {\n ctx.beginPath();\n ctx.rect(brick.x, brick.y, brick.w, brick.h);\n ctx.fillStyle = brick.visible ? \"#1175a8\" : \"transparent\";\n ctx.fill();\n ctx.closePath();\n });\n });\n}", "function pressSpaceBlink() {\n let count = 10;\n count--;\n if (count % 2 == 1) {\n ctx.font = \"25px Roboto Mono\";\n ctx.fillStyle = '#D7DF01';\n ctx.fillText(\"PRESS 'SPACE' TO START\", play.width / 2, play.height / 2);\n }\n }", "function dimRow(row, dimmed) {\r\n for (var i = 0; i < matchTable.rows[row].cells.length; i++) {\r\n if (i != columnIndex(CLOSE)) {\r\n matchTable.rows[row].cells[i].style.opacity = dimmed ? 0.2 : 1;\r\n matchTable.rows[row].cells[i].style.textDecoration = dimmed ? 'line-through' : '';\r\n }\r\n } \r\n}" ]
[ "0.776315", "0.776315", "0.70141566", "0.652586", "0.6525523", "0.64824927", "0.6404919", "0.63628644", "0.63618344", "0.63287187", "0.63277745", "0.6284515", "0.62171656", "0.6211982", "0.6193682", "0.61887103", "0.61699414", "0.61637944", "0.6159809", "0.6157624", "0.6131973", "0.61285967", "0.6119081", "0.61160237", "0.6105984", "0.60732394", "0.60521454", "0.6033942", "0.60188776", "0.60142964", "0.5986113", "0.59577465", "0.5953102", "0.59422266", "0.59415984", "0.5940754", "0.5931441", "0.59168893", "0.59126145", "0.589602", "0.58907145", "0.58843505", "0.5868419", "0.584893", "0.584517", "0.583704", "0.5836776", "0.58365875", "0.58345187", "0.5828505", "0.58237654", "0.5810158", "0.5808521", "0.58034796", "0.57991093", "0.57989", "0.5797203", "0.57969385", "0.5777653", "0.57741326", "0.5768309", "0.5766286", "0.57593924", "0.57578295", "0.575395", "0.57415605", "0.5740825", "0.5732531", "0.5731922", "0.57294756", "0.57131493", "0.57107365", "0.57052946", "0.5705052", "0.5704024", "0.570187", "0.56993204", "0.5698208", "0.56886303", "0.56886226", "0.56833386", "0.5679658", "0.56753016", "0.5674297", "0.5672559", "0.5670156", "0.5670134", "0.56688625", "0.56667435", "0.56642336", "0.5657039", "0.5656038", "0.5650407", "0.56452525", "0.56341046", "0.56251425", "0.5619179", "0.5618952", "0.56149477", "0.56118846", "0.5609008" ]
0.0
-1
Adding a zero if the number is less than 10
function zeroLeft(num) { return num <= 10 ? `0${num}` : num }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addZero(number) {\n if (number<10) {\n return '0' + number;\n }\n return number\n }", "function addZero(num) {\n if (num < 10) {\n return `0${num}`\n } else {\n return num;\n }\n }", "function addZero(num) {\n if (num < 10) {\n return `0${num}`;\n } else {\n return num;\n }\n }", "function addZero(value) {\n if (value < 10) {\n return value = '0' + value;\n } else {\n return value;\n }\n }", "function addZero(no)\n{\n if(no >= 10){\n return no;\n }else{\n return \"0\".no;\n }\n}", "function addZeroToNumber(number){\n if(number < 10) {\n return '0' + number;\n }\n return number;\n }", "function addZero(num) {\n if (num >= 0 && num < 10) {\n return `0${num}`;\n }\n return num;\n }", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(i) {\n\t// check if the number is less than 10\n\tif(i < 10) {\n\t\t// add a zero in front if less than 10\n\t\ti = \"0\" + i\n\t}\n\t// send back the new value of i\n\treturn i\n}", "function addZero(number) {\n if (number < 10) {\n return '0' + number;\n } else {\n return number;\n }\n }", "function addZeroIfNeeded(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(number) {\r\n if(number < 10) {\r\n number = '0' + number;\r\n }\r\n return number;\r\n}", "function isLessThanTen(value) {\n if (value < 10) {\n return \"0\" + value;\n } else {\n return value;\n }\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(num) {\n if (num <= 9) return `0${num}`;\n return num;\n}", "function addZero (number) {\r\n if(number < 10) {\r\n return \"0\" + number;\r\n }\r\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(x) {\n if(x < 10 && x[0] !== '0') return '0' + x;\n else return x\n }", "function addZero(int) {\n if (int < 10) {\n return `0${int}`\n }\n return `${int}`\n }", "function addLeadingZero(i) {\n if (i<10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addzero(i){\n if(i<10){\n i=\"0\"+i;\n}\nreturn i;\n}", "function addLeadingZero(num) {\n if (num < 10) {\n return \"0\" + num;\n } else {\n return num;\n }\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(num) {\n if (num < 10) {\n return \"0\" + num;\n } else {\n return num;\n }\n }", "function addZero(num) {\n if (num < 10) {\n num = \"0\" + num;\n }\n return num;\n }", "function addZero(i) \n{\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(tDigit) {\n\tif (tDigit < 10){ \t\t// if the number is less than 10\n\t tDigit = \"0\" + tDigit; // add a string zero (converts number to string)\n\t}\n\treturn tDigit; // pass the value of tDigit back to the statement\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(numero) {\r\n if(numero < 10) {\r\n numero = '0' + numero;\r\n }\r\n return numero;\r\n }", "function addZero (val){\n\treturn (val <= 9) ? (\"0\" + val) : val;\n}", "function addZero (val){\n\treturn (val <= 9) ? (\"0\" + val) : val;\n}", "function addZero(i) {\n\t\tif (i < 10) {\n\t\t\ti = '0' + i;\n\t\t}\n\t\treturn i;\n\t}", "function numberWithLeadingZeros(value) {\n return (value < 10 ? '0' : '') +value;\n}", "function numberWithLeadingZeros(value) {\n return (value < 10 ? '0' : '') +value;\n}", "function addZero(i) {\n\tif (i < 10) {\n\t i = \"0\" + i;\n\t}\n\treturn i;\n}", "function addZero(time) {\n if (time < 10) {\n time = '0' + time;\n }\n return time;\n}", "function addZero(i)\n{\n if(i < 10)\n {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i)\n{\n\tif (i < 10)\n\t{\n\t\ti = \"0\" + i;\n\t}\n\treturn i;\n}", "function addZero(n){\n return n < 10 ? '0' + n : n;\n}", "function addLeadingZero(num) {\n\treturn (num <= 9) ? (\"0\" + num) : num;\n}", "function appendZeroes(number) {\n if (number <= 9) {\n return \"0\" + number;\n }\n return number\n}", "function addLeadingZeros(number) {\n if (number < 10) {\n return \"0\" + number;\n }\n return number;\n}", "function addZero(i){\n\tvar text = i;\n\tif(text < 10)\n\t\ttext = \"0\" + text;\n\t\n\treturn text;\n}", "function zero(n){\n if(n<10){return \"0\"+n;}\n return n;\n}", "addZero(int){\n return (int < 10) ? `0${int}` : int;\n }", "function addLeadingZero (n) {\n if(n <= 9) {\n return '0'+ n; \n } else {\n return '' + n; \n }\n}", "function addZero(n) {\n return (n < 0 || n > 9 ? \"\" : \"0\") + n;\n}", "function addZero(number){\r\n return(parseInt(number, 10) < 10 ? '0' : '') + number;\r\n}", "function addZero(n){\n return n<10? '0'+n:''+n;\n}", "function addZero(num) {\n return (parseInt(num, 10) < 10 ? '0' : '') + num;\n}", "function zeroIt(a) { return( a < 10 ? \"0\"+a : a ); }", "function AddZero(num) {\n return (num >= 0 && num < 10) ? \"0\" + num : num + \"\";\n }", "function aggiungiZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function numChecker(num) {\n if(num <10){\n return \"0\" + num;\n }\n return num;\n}", "function addZero(input) {\n if (input < 10) {\n input = \"0\" + input.toString();\n }\n return input;\n}", "leadingZero(number) {\n return number < 10 ? '0' + number : number;\n }", "leadingZero(num) {\n return num < 10 ? `0${num}` : num;\n }", "function add_zero(i) {\n\t\treturn (i < 10) ? (i = \"0\" + i) : i;\n\t}", "function addZeroBefore(number, digits) {\n\t\tvar numDig = digits-String(number).length;\n\t\tif (numDig<=0) {\n\t\t\treturn String(number);\n\t\t}\n\t\tnumDig = Math.pow(10, numDig);\n\t\tvar stringDig = String(numDig).substring(1);\n\t\treturn stringDig + String(number);\n\t}", "function add(num){\n return num<10? \"0\"+num:num;\n }", "function appendZero(num) {\n\t\t\tif (num < 10) {\n\t\t\t\treturn \"0\" + num;\n\t\t\t}\n\t\t\treturn num;\n\t\t}", "function addZero (n) {\n return (parseInt(n, 10) < 10 ? '0' : '') + n\n}", "function addLeadingZero(num) {\r\n var numStr = (num < 10) ? (\"0\" + num) : \"\" + num;\r\n return numStr;\r\n}", "function addLeadingZero(num) {\r\n var numStr = (num < 10) ? (\"0\" + num) : \"\" + num;\r\n return numStr;\r\n}", "function addZero(n) {\r\n return (parseInt(n, 10) < 10 ? '0': '') + n;\r\n}", "function zeroFill(i){\n\n //check if the i is more or equal to than 10, if so just return the same int.\n if(i>=10){\n return i;\n }\n\n //if less than 10, then zero fill.\n if(i<10){\n\n //add a 0 to the string and return it.\n return 0 + i.toString();\n }\n}", "function appendLeadingZeroes(n){\n if(n <= 9){\n return \"0\" + n;\n }\n return n\n}", "function addZeroNumber (val) {\n // convert integers to string, to measure their lenght\n let valString = val.toString();\n // if .lenght is less than two, it means the number is in the single digits\n if (valString.length < 2) {\n return \"0\" + valString;\n } else {\n return valString;\n }\n}", "function fatebondLimitTen(input) {\n\tvar output = 0;\n\tif(input > 10) {\n\t\toutput = 10;\n\t} else if(input < -10) {\n\t\toutput = -10;\n\t} else {\n\t\toutput = input;\n\t}\n\treturn output;\n}", "function zeroCheck(value) {\n return value < 10 ? ('0' + value) : value;\n}", "function format(num){ return (num < 10)? '0'+num: num}", "function addZero(time){\n return (time < 10 ? \"0\" : \"\") + time;\n}", "function appendZero(number) {\n\treturn number < 10 ? \"0\" + number : number;\n}", "function leadingzero (number) {\n return (number < 10) ? '0' + number : number;\n}", "function addTen(value) {\n\treturn value + 10;\n}", "function addZero(n) {\n return(parseInt(n, 10) < 10 ? '0' : '') + n;\n}", "function closestMultipleOf10(num) {\n \n\n \n\n var m=num.toString()\n var k=m.split(\"\")\n var c=0\n for(var i=0;i<k.length;i++)\n {\n \t c=k[i]\n }\n if(k[i]<5)\n {\n \tparseInt(k[i]=\"0\")\n }\n\n return parseInt(k)\n\n\n \t\n }", "function leadingZero(time){\n \n if (time<=9){\n time = \"0\" + time;\n }\n return time;\n}", "function zerolead(value) {\n\treturn (value < 10) ? '0' + value : value;\n}", "function zerolead(value) {\n\treturn (value < 10) ? '0' + value : value;\n}", "function zeroAEsquerda(num) {\n return num >= 10 ? num : `0${num}`;\n}", "function addZero(n){\n return (parseInt(n,10)< 10 ? '0' : '') +n;\n }", "function leadingZero(time) {\r\n if (time<=9) {\r\n time = '0' + time; \r\n }\r\n return time;\r\n}", "function under10(num) {\n return num < 10;\n}", "function fillZeros(num) {\n if (num < 10) {\n num = \"0\" + num.toString();\n } else {\n num.toString();\n }\n return num;\n}", "function addLeadingZero(n) {\r\n\t\t\tn = parseInt(n, 10);\r\n\t\t return (n < 10) ? (\"0\" + n) : n;\r\n\t\t}", "function leadingZero(time) {\r\n if (time < 10) {\r\n time = '0' + time;\r\n }\r\n return time;\r\n}", "function aumentar_cero(num){\r\n if (num < 10) {\r\n num = \"0\" + num;\r\n }\r\n return num;\r\n}", "function aumentar_cero(num){\r\n if (num < 10) {\r\n num = \"0\" + num;\r\n }\r\n return num;\r\n}", "function aumentar_cero(num){\r\n if (num < 10) {\r\n num = \"0\" + num;\r\n }\r\n return num;\r\n}" ]
[ "0.770386", "0.7475157", "0.74721533", "0.7466644", "0.74605685", "0.7413686", "0.7412882", "0.7394637", "0.73832804", "0.7357868", "0.73475516", "0.7332866", "0.73273766", "0.72686684", "0.723557", "0.7235376", "0.7228067", "0.7202425", "0.7189479", "0.71804345", "0.71731997", "0.71612644", "0.7150013", "0.71482354", "0.71482354", "0.71482354", "0.71482354", "0.7140805", "0.7140805", "0.7140805", "0.7132756", "0.7126455", "0.7124209", "0.7121322", "0.7114412", "0.7114412", "0.7114412", "0.7114412", "0.71130097", "0.7105429", "0.7105429", "0.7100058", "0.70817554", "0.70817554", "0.70586944", "0.7047323", "0.7042771", "0.7038627", "0.70368063", "0.6995358", "0.69949424", "0.69916093", "0.69739074", "0.6960271", "0.69594026", "0.6948972", "0.69424206", "0.6930121", "0.6921989", "0.69107836", "0.69091874", "0.6908251", "0.6907507", "0.6890678", "0.6877869", "0.68578815", "0.68375015", "0.6836575", "0.6831287", "0.6810452", "0.6805594", "0.67973185", "0.67942846", "0.67942846", "0.6792223", "0.6773926", "0.6772729", "0.67625463", "0.67438495", "0.674337", "0.67314464", "0.6719526", "0.6704381", "0.66996384", "0.6694468", "0.6693362", "0.6679081", "0.667829", "0.6660801", "0.6660801", "0.6645904", "0.6639981", "0.6637429", "0.66245675", "0.66126394", "0.6591932", "0.6586038", "0.65605354", "0.65605354", "0.65605354" ]
0.65663683
97
value is of the form path.to.json.category
sortNestedItems(value) { let isAsc = true; if (value === this.state.sorting.sortOn) isAsc = !this.state.sorting.sortAsc; const nested = value.split("."); function compare(a, b) { let x = a; let y = b; // find the correct leaf in the json to compare for (let i = 0; i < nested.length; i++) { x = x[nested[i]]; y = y[nested[i]]; } if (typeof x === "string") { x = x.toLowerCase(); } if (typeof y === "string") { y = y.toLowerCase(); } return (x < y ? -1 : x > y ? 1 : 0) * (isAsc ? 1 : -1) } this.setState({ items: this.state.data.sort(compare), sorting: { sortOn: value, sortAsc: isAsc } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getShortValue(category, value){\n for(let jsonCategory of json.jsonArray){\n if(jsonCategory.key === category){\n for(let item of jsonCategory.value){\n if(item.value === value){\n return item.key;\n }\n }\n }\n }\n }", "function chooseCategory(input) {\n\t var category = data[input];\n\t return category;\n\t }", "getSelectedCategory(category) {\n axios\n .get(`${apiBaseUrl}/entries?category=${encodeURIComponent(category)}`)\n .then(res => {\n\n this.selectedCategory = res.data.entries;\n this.show = true;\n })\n .catch(error =>\n console.error(\"Can't get the Categories\", error)\n );\n }", "function loadBasedOnCategory(value) {\r\n\t$('#disease,#toxin').val('').trigger(\"chosen:updated\");\r\n\t$.getJSON('http://pollutantapi-aaroncheng.rhcloud.com/category/getDiseases/' + value,function(data) {\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tvar api_data = [],\r\n\t\t\t\tcount\t=\t1;\r\n\t\t\tif( data.hasOwnProperty('diseases') )\r\n\t\t\t\tfor(var i in data.diseases) {\r\n\t\t\t\t\tapi_data.push( { type:'disease', name:data.diseases[i]['name'], id:count++, color:'#1f77b4' } );\r\n\t\t\t}\r\n\t\t\t$(\".current-status\").html('<i>Diseases linked to '+value+' </i>');\r\n\t\t\tupdateCanvas(api_data);\r\n\t\t\t\r\n\t\t} catch(e) {\r\n\t\t\tconsole.log(e.message);\r\n\t\t}\r\n\t});\r\n}", "categ(state,data)\n {\n return state.category=data\n }", "function _get_category(resource_text) {\n\n\t\t\tfor (var key_cat in browser_conf_json.categories) {\n\t\t\t\tif (browser_conf_json.categories.hasOwnProperty(key_cat)) {\n\t\t\t\t\tvar re = new RegExp(browser_conf_json.categories[key_cat][\"rule\"]);\n\t\t\t\t\tif (resource_text.match(re)) {return key_cat;}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}", "get type() {\n\t\treturn \"category\";\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "getcategory(state){\n return state.category\n }", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "async getCategorybyId (id) {\n const response = await fetch(`http://jservice.io/api/category?id=${id}`)\n const json = await response.json()\n return json\n }", "handleCategory(event) {\n let category = event.target.innerHTML\n dispatch(fetchCategory(category))\n }", "getCategoryDrinks(category) {\n return apiClient.get(`/drinks/${category.name}`);\n }", "function ListHierarchyCategoryValues(szLibraryId, szCategoryId, szSecurityCode)\n{\n try\n {\n var szCmd = Utilities.formatString(\n \"https://api-dot-ao-docs.appspot.com/_ah/api/category/v1/libraries/%s/categories/%s/allvalueshierarchy?securityCode=%s\",\n szLibraryId, szCategoryId, szSecurityCode);\n var pResult = UrlFetchApp.fetch(szCmd);\n //\n if (pResult.getResponseCode() != 0xc8)\n throw Utilities.formatString(\"IDD_RESPONSE_CODE_%d\", pResult.getResponseCode());\n //\n //process result content\n return JSON.parse(pResult.getContentString());\n }\n catch (e)\n {\n Logger.log(e.message);\n throw e;\n }\n}", "function loadCategory(catUrl)\r\n{\r\n var getCategory = new XMLHttpRequest();\r\n getCategory.onreadystatechange = function() {\r\n if (this.readyState == 4) {\r\n var catData = JSON.parse(this.responseText);\r\n console.log(catData.categoryName);\r\n $('#category').val(catData.categoryName);\r\n populateSubCategory(catData.categoryName);\r\n }\r\n };\r\n\r\n getCategory.open(\"GET\", catUrl, true);\r\n getCategory.send();\r\n}", "get category() {\n const value = Number(this.getAttribute('category'))\n if (!Number.isNaN(value)) {\n return value\n } else {\n return ''\n }\n }", "function handleCategoryChange() {\n var newResponseCategory = $(this).val();\n getResponses(newResponseCategory);\n }", "function GetCategory(categoryId) {\n const [category, setCategory] = useState('');\n const url = \"/api/categories/\"+categoryId;\n useEffect(() => {\n const requestCategory = async () => {\n const response = await fetch(url);\n const { data } = await response.json();\n const att = await data.attributes;\n const cat = await att.category;\n setCategory(cat);\n };\n requestCategory();\n }, []);\n\n return category;\n}", "function InsertCategoryValue(szSecurityCode, pJSONData)\n{\n try\n {\n var szCmd = Utilities.formatString(\n \"https://api-dot-ao-docs.appspot.com/_ah/api/category/v1?securityCode=%s\", szSecurityCode);\n var pOptions =\n {\n \"method\": \"put\",\n \"payload\": pJSONData\n };\n var pResult = UrlFetchApp.fetch(szCmd, pOptions);\n var szCategoryId = null;\n //\n if (pResult.getResponseCode() != 0xc8)\n throw Utilities.formatString(\"IDD_RESPONSE_CODE_%d\", pResult.getResponseCode());\n //\n return JSON.parse(pResult.getContentString());\n }\n catch (e)\n {\n Logger.log(e.message);\n throw e;\n }\n}", "getCategory(slug) {\n /**\n * This is what your API endpoint might look like:\n *\n * https://example.com/api/shop/categories/power-tools.json\n *\n * where:\n * - power-tools = slug\n */\n // return this.http.get<Category>(`https://example.com/api/shop/categories/${slug}.json`);\n // return this.http.post<Product[]>(this.APIURL+'getcategory',{\n // slug\n // }).pipe(map((response: any) => response.data));\n // This is for demonstration purposes only. Remove it and use the code above.\n return Object(_fake_server__WEBPACK_IMPORTED_MODULE_6__[\"getShopCategory\"])(slug);\n }", "function ListChildCategoryValues(szLibraryId, szCategoryId, szParentCategoryValue, szSecurityCode)\n{\n try\n {\n var szUrl = Utilities.formatString(\n \"https://api-dot-ao-docs.appspot.com/_ah/api/category/v1/libraries/%s/categories/%s/values?securityCode=%s\",\n szLibraryId, szCategoryId, szSecurityCode);\n var pSuccess = UrlFetchApp.fetch(szUrl);\n //\n if (pSuccess.getResponseCode() != 0xc8)\n throw Utilities.formatString(\"IDD_RESPONSE_CODE_%d\", pResult.getResponseCode());\n //\n return JSON.parse(pSuccess.getContentText());\n }\n catch (e)\n {\n Logger.log(e.message);\n throw e;\n }\n}", "function formCategories (callback){\n\t\n\tvar result = {\"http_code\":200,\"http_message\":\"Ok, Success\",\"status\":1,\"categories\":[{\"CategoryId\":271,\"positionNo\":30,\"CategoryName\":\"Building Material\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_271.png\",\"childCategory\":[{\"CategoryId\":277,\"positionNo\":1,\"CategoryName\":\"Blocks\",\"ParentCategory\":271},{\"CategoryId\":278,\"positionNo\":2,\"CategoryName\":\"Bricks\",\"ParentCategory\":271},{\"CategoryId\":279,\"positionNo\":3,\"CategoryName\":\"Cement\",\"ParentCategory\":271},{\"CategoryId\":280,\"positionNo\":4,\"CategoryName\":\"Coarse Aggregate and Stones\",\"ParentCategory\":271},{\"CategoryId\":281,\"positionNo\":5,\"CategoryName\":\"Ready Mix Concrete and Mortar\",\"ParentCategory\":271},{\"CategoryId\":282,\"positionNo\":6,\"CategoryName\":\"TMT Steel\",\"ParentCategory\":271},{\"CategoryId\":283,\"positionNo\":7,\"CategoryName\":\"Sand\",\"ParentCategory\":271},{\"CategoryId\":304,\"positionNo\":8,\"CategoryName\":\"Cinder\",\"ParentCategory\":271},{\"CategoryId\":403,\"positionNo\":9,\"CategoryName\":\"Consumable\",\"ParentCategory\":271},{\"CategoryId\":404,\"positionNo\":10,\"CategoryName\":\"Structural Steel\",\"ParentCategory\":271,\"childCategory\":[{\"CategoryId\":405,\"positionNo\":1,\"CategoryName\":\"ISA Angle\",\"ParentCategory\":404},{\"CategoryId\":406,\"positionNo\":2,\"CategoryName\":\"ISMC Channel\",\"ParentCategory\":404},{\"CategoryId\":407,\"positionNo\":3,\"CategoryName\":\"ISMC Beams\",\"ParentCategory\":404},{\"CategoryId\":408,\"positionNo\":4,\"CategoryName\":\"MS Rods\",\"ParentCategory\":404},{\"CategoryId\":409,\"positionNo\":5,\"CategoryName\":\"MS Plates\",\"ParentCategory\":404},{\"CategoryId\":410,\"positionNo\":6,\"CategoryName\":\"Stud Rods\",\"ParentCategory\":404}]}]},{\"CategoryId\":272,\"positionNo\":31,\"CategoryName\":\"Electrical\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_272.png\",\"childCategory\":[{\"CategoryId\":284,\"positionNo\":1,\"CategoryName\":\"Cables and Wires\",\"ParentCategory\":272},{\"CategoryId\":285,\"positionNo\":2,\"CategoryName\":\"Circuit Breakers and Distribution Boards\",\"ParentCategory\":272},{\"CategoryId\":286,\"positionNo\":3,\"CategoryName\":\"Lights and Bulbs\",\"ParentCategory\":272},{\"CategoryId\":299,\"positionNo\":4,\"CategoryName\":\"Light Fittings\",\"ParentCategory\":272},{\"CategoryId\":287,\"positionNo\":5,\"CategoryName\":\"Switches and Accessories\",\"ParentCategory\":272},{\"CategoryId\":297,\"positionNo\":6,\"CategoryName\":\"Electrical Appliances\",\"ParentCategory\":272},{\"CategoryId\":311,\"positionNo\":7,\"CategoryName\":\"Electrical Accessories\",\"ParentCategory\":272},{\"CategoryId\":394,\"positionNo\":8,\"CategoryName\":\"Conduits\",\"ParentCategory\":272},{\"CategoryId\":396,\"positionNo\":10,\"CategoryName\":\"Power Backup Systems\",\"ParentCategory\":272},{\"CategoryId\":397,\"positionNo\":11,\"CategoryName\":\"Home Automation\",\"ParentCategory\":272}]},{\"CategoryId\":273,\"positionNo\":32,\"CategoryName\":\"Plumbing\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_273.png\",\"childCategory\":[{\"CategoryId\":288,\"positionNo\":1,\"CategoryName\":\"Consumables\",\"ParentCategory\":273},{\"CategoryId\":289,\"positionNo\":2,\"CategoryName\":\"Pipes and Fittings\",\"ParentCategory\":273},{\"CategoryId\":290,\"positionNo\":3,\"CategoryName\":\"Valves and Accessories\",\"ParentCategory\":273},{\"CategoryId\":291,\"positionNo\":4,\"CategoryName\":\"Water Tanks\",\"ParentCategory\":273},{\"CategoryId\":324,\"positionNo\":5,\"CategoryName\":\"Solvent\",\"ParentCategory\":273}]},{\"CategoryId\":305,\"positionNo\":33,\"CategoryName\":\"Kitchen\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_305.png\",\"childCategory\":[{\"CategoryId\":315,\"positionNo\":1,\"CategoryName\":\"Chimneys & Hobs\",\"ParentCategory\":305},{\"CategoryId\":319,\"positionNo\":4,\"CategoryName\":\"Kitchen Sinks and Faucets\",\"ParentCategory\":305},{\"CategoryId\":320,\"positionNo\":5,\"CategoryName\":\"Kitchen Accessories\",\"ParentCategory\":305},{\"CategoryId\":321,\"positionNo\":6,\"CategoryName\":\"Kitchen Storage\",\"ParentCategory\":305},{\"CategoryId\":323,\"positionNo\":8,\"CategoryName\":\"Wine Coolers and Cabinets\",\"ParentCategory\":305},{\"CategoryId\":325,\"positionNo\":9,\"CategoryName\":\"Food Waste Disposer\",\"ParentCategory\":305},{\"CategoryId\":327,\"positionNo\":10,\"CategoryName\":\"Kitchen Appliances\",\"ParentCategory\":305},{\"CategoryId\":328,\"positionNo\":11,\"CategoryName\":\"Kitchen Hardware\",\"ParentCategory\":305},{\"CategoryId\":402,\"positionNo\":12,\"CategoryName\":\"Modular Kitchen\",\"ParentCategory\":305}]},{\"CategoryId\":306,\"positionNo\":37,\"CategoryName\":\"Tools and Spares\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_306.png\",\"childCategory\":[{\"CategoryId\":307,\"positionNo\":1,\"CategoryName\":\"Plumbing Tools\",\"ParentCategory\":306},{\"CategoryId\":308,\"positionNo\":2,\"CategoryName\":\"Carpentry Tools\",\"ParentCategory\":306},{\"CategoryId\":309,\"positionNo\":3,\"CategoryName\":\"Flooring Tools\",\"ParentCategory\":306},{\"CategoryId\":310,\"positionNo\":4,\"CategoryName\":\"Gardening Tools\",\"ParentCategory\":306}]},{\"CategoryId\":312,\"positionNo\":38,\"CategoryName\":\"Construction Equipment\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_312.png\",\"childCategory\":[{\"CategoryId\":313,\"positionNo\":1,\"CategoryName\":\"Tools\",\"ParentCategory\":312}]},{\"CategoryId\":314,\"positionNo\":39,\"CategoryName\":\"Solutions\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_314.png\",\"childCategory\":[{\"CategoryId\":318,\"positionNo\":1,\"CategoryName\":\"Solar Products\",\"ParentCategory\":314},{\"CategoryId\":329,\"positionNo\":2,\"CategoryName\":\"Water Proofing Products\",\"ParentCategory\":314},{\"CategoryId\":330,\"positionNo\":3,\"CategoryName\":\"Fire and Safety Products\",\"ParentCategory\":314}]},{\"CategoryId\":332,\"positionNo\":40,\"CategoryName\":\"Bathroom\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_332.png\",\"childCategory\":[{\"CategoryId\":340,\"positionNo\":1,\"CategoryName\":\"Bathroom Faucets\",\"ParentCategory\":332},{\"CategoryId\":341,\"positionNo\":2,\"CategoryName\":\"Commodes\",\"ParentCategory\":332},{\"CategoryId\":342,\"positionNo\":3,\"CategoryName\":\"Wash Basins\",\"ParentCategory\":332},{\"CategoryId\":343,\"positionNo\":4,\"CategoryName\":\"Showers\",\"ParentCategory\":332},{\"CategoryId\":344,\"positionNo\":5,\"CategoryName\":\"Wellness\",\"ParentCategory\":332},{\"CategoryId\":345,\"positionNo\":6,\"CategoryName\":\"Bathroom Accessories\",\"ParentCategory\":332}]},{\"CategoryId\":333,\"positionNo\":41,\"CategoryName\":\"Walls and Flooring\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_333.png\",\"childCategory\":[{\"CategoryId\":346,\"positionNo\":1,\"CategoryName\":\"Tiles\",\"ParentCategory\":333},{\"CategoryId\":347,\"positionNo\":2,\"CategoryName\":\"Granite\",\"ParentCategory\":333},{\"CategoryId\":348,\"positionNo\":3,\"CategoryName\":\"Marble\",\"ParentCategory\":333},{\"CategoryId\":349,\"positionNo\":4,\"CategoryName\":\"Wooden Flooring\",\"ParentCategory\":333},{\"CategoryId\":351,\"positionNo\":6,\"CategoryName\":\"Outdoor Flooring\",\"ParentCategory\":333}]},{\"CategoryId\":334,\"positionNo\":42,\"CategoryName\":\"Carpentry\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_334.png\",\"childCategory\":[{\"CategoryId\":353,\"positionNo\":1,\"CategoryName\":\"Plywood\",\"ParentCategory\":334},{\"CategoryId\":354,\"positionNo\":2,\"CategoryName\":\"MDF Board\",\"ParentCategory\":334},{\"CategoryId\":355,\"positionNo\":3,\"CategoryName\":\"Blockboard\",\"ParentCategory\":334},{\"CategoryId\":357,\"positionNo\":5,\"CategoryName\":\"Laminate\",\"ParentCategory\":334},{\"CategoryId\":358,\"positionNo\":6,\"CategoryName\":\"Veneer\",\"ParentCategory\":334},{\"CategoryId\":362,\"positionNo\":10,\"CategoryName\":\"Adhesive\",\"ParentCategory\":334}]},{\"CategoryId\":335,\"positionNo\":43,\"CategoryName\":\"Doors and Windows\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_335.png\",\"childCategory\":[{\"CategoryId\":363,\"positionNo\":1,\"CategoryName\":\"Flush Door\",\"ParentCategory\":335},{\"CategoryId\":364,\"positionNo\":2,\"CategoryName\":\"Skin Door\",\"ParentCategory\":335},{\"CategoryId\":365,\"positionNo\":3,\"CategoryName\":\"Membrane Door\",\"ParentCategory\":335},{\"CategoryId\":366,\"positionNo\":4,\"CategoryName\":\"Micro Coated Door\",\"ParentCategory\":335},{\"CategoryId\":368,\"positionNo\":6,\"CategoryName\":\"Solid Wood Door\",\"ParentCategory\":335},{\"CategoryId\":369,\"positionNo\":7,\"CategoryName\":\"UPVC Products\",\"ParentCategory\":335},{\"CategoryId\":370,\"positionNo\":8,\"CategoryName\":\"Window Blinds\",\"ParentCategory\":335},{\"CategoryId\":399,\"positionNo\":10,\"CategoryName\":\"Veneer Door\",\"ParentCategory\":335}]},{\"CategoryId\":336,\"positionNo\":44,\"CategoryName\":\"Hardware\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_336.png\",\"childCategory\":[{\"CategoryId\":372,\"positionNo\":1,\"CategoryName\":\"Fittings\",\"ParentCategory\":336},{\"CategoryId\":373,\"positionNo\":2,\"CategoryName\":\"Accessories\",\"ParentCategory\":336},{\"CategoryId\":374,\"positionNo\":3,\"CategoryName\":\"Sliding Solutions\",\"ParentCategory\":336},{\"CategoryId\":375,\"positionNo\":4,\"CategoryName\":\"Locks\",\"ParentCategory\":336},{\"CategoryId\":376,\"positionNo\":5,\"CategoryName\":\"Consumables\",\"ParentCategory\":336},{\"CategoryId\":411,\"positionNo\":6,\"CategoryName\":\"Curtain Fittings\",\"ParentCategory\":336}]},{\"CategoryId\":337,\"positionNo\":45,\"CategoryName\":\"Paints\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_337.png\",\"childCategory\":[{\"CategoryId\":377,\"positionNo\":1,\"CategoryName\":\"Wall Putty\",\"ParentCategory\":337},{\"CategoryId\":378,\"positionNo\":2,\"CategoryName\":\"Stainers\",\"ParentCategory\":337},{\"CategoryId\":379,\"positionNo\":3,\"CategoryName\":\"Wood Finishes\",\"ParentCategory\":337},{\"CategoryId\":380,\"positionNo\":4,\"CategoryName\":\"Emulsion\",\"ParentCategory\":337},{\"CategoryId\":381,\"positionNo\":5,\"CategoryName\":\"Primer\",\"ParentCategory\":337},{\"CategoryId\":382,\"positionNo\":6,\"CategoryName\":\"Enamel\",\"ParentCategory\":337},{\"CategoryId\":383,\"positionNo\":7,\"CategoryName\":\"Distemper\",\"ParentCategory\":337},{\"CategoryId\":384,\"positionNo\":8,\"CategoryName\":\"Fillers\",\"ParentCategory\":337},{\"CategoryId\":385,\"positionNo\":9,\"CategoryName\":\"Melamyne\",\"ParentCategory\":337},{\"CategoryId\":386,\"positionNo\":10,\"CategoryName\":\"Painting Consumables\",\"ParentCategory\":337},{\"CategoryId\":387,\"positionNo\":11,\"CategoryName\":\"Painting Accessories\",\"ParentCategory\":337}]},{\"CategoryId\":338,\"positionNo\":46,\"CategoryName\":\"Garden\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_338.png\",\"childCategory\":[{\"CategoryId\":389,\"positionNo\":2,\"CategoryName\":\"Pots and Planters\",\"ParentCategory\":338}]},{\"CategoryId\":339,\"positionNo\":47,\"CategoryName\":\"Roofing\",\"ParentCategory\":2,\"icon_image\":\"http://www.msupply.com/media/mobile_icons/category_339.png\",\"childCategory\":[{\"CategoryId\":392,\"positionNo\":1,\"CategoryName\":\"Clay Roofing\",\"ParentCategory\":339}]}]};\n\n\tvar categories = [];\n\tvar subCategories = [];\n\tvar emptyCategory;\n\t\n\tif(result !== null){\n\t\tvar catgry = result.categories;\n\t\t\n\t\tfor(var i=0; i<catgry.length; i++){\n\t\t\temptyCategory = {\"mainCategory\":\"\", \"subCategories\":[]};\n\t\t\tfor(var j=0; j<catgry[i].childCategory.length; j++){\n\t\t\t\tsubCategories.push(catgry[i].childCategory[j].CategoryName);\n\t\t\t}\n\t\t\temptyCategory.mainCategory = catgry[i].CategoryName;\n\t\t\temptyCategory.subCategories = subCategories;\n\t\t\tcategories.push(emptyCategory);\n\t\t\tsubCategories = [];\n\t\t}\n\t}\n\treturn callback(categories);\n}", "function categoryArray(data, value, array) {\r\n for (var i = 0, iLen=data.length; i<iLen; i++) {\r\n if(data[i].category === value) {\r\n array.push(data[i]);\r\n }\r\n }\r\n }", "get category() {\n\t\treturn this.__category;\n\t}", "function findCategory(category) {\n return originals[category]\n}", "lookupChar(char, category){\n for (let item of json.jsonArray){\n if(item.key === category){\n for(let character of item.value){\n if(character.key === char){\n return character.value;\n }\n }\n }\n }\n }", "function transformResponseCategory(json) {\n var parsedCategory = json;\n var transformed = JSON.stringify({\n id: parsedCategory.id,\n name: parsedCategory.name\n });\n return transformed;\n}", "function InsertChildCategoryValue(szLibraryId, szCategoryId, szCategoryValueName, szSecurityCode, szDataValue)\n{\n try\n {\n var szUrl = Utilities.formatString(\n \"https://api-dot-ao-docs.appspot.com/_ah/api/category/v1/libraries/%s/categories/%s/values?categoryValueName=%s&securityCode=%s\",\n szLibraryId, szCategoryId, szDataValue, szSecurityCode);\n var pAPayLoad =\n {\n \"name\": szDataValue,\n \"value\": szDataValue\n };\n var pAOptions =\n {\n \"method\": \"PUT\",\n \"payload\": pAPayLoad\n };\n var pSuccess = UrlFetchApp.fetch(szUrl, pAOptions);\n //\n if (pSuccess.getResponseCode() != 0xc8)\n throw Utilities.formatString(\"IDD_RESPONSE_CODE_%d\", pResult.getResponseCode());\n //\n return true;\n }\n catch (e)\n {\n Logger.log(e.message);\n throw e;\n }\n}", "function addCategory(category) {\n// var db = ScriptDb.getMyDb(); \n var db = ParseDb.getMyDb(applicationId, restApiKey, \"list\");\n \n if (category == null) {\n return 0; \n }\n \n // if (db.query({type: \"list#categories\"}).getSize() == 0) {\n \n if (PropertiesService.getScriptProperties().getProperty(\"categories\") == null) {\n var id = db.save({type: \"categories\", list: [category]}).getId(); \n PropertiesService.getScriptProperties().setProperty(\"categories\", id);\n return 1;\n }\n var categories = db.load(PropertiesService.getScriptProperties().getProperty(\"categories\"));\n for (var i = 0 ; i<categories.list.length ; i++) {\n if (categories.list[i] == category) {\n return 0;\n }\n }\n categories.list.push(category);\n categories.list = categories.list.sort();\n db.save(categories);\n return 1;\n}", "function filterJSON(cat) {\n filterParam = cat.toLowerCase();\n // reset search input field\n $('#searchTxt').val('');\n\n if (cat.toLowerCase() === \"all\") {\n filteredObjects = jsonObjects;\n } else {\n filteredObjects = [];\n\n $.each(jsonObjects, function(i, item) {\n // for each category\n var isPartOfCategory = false;\n\n $.each(item.categories, function(c, category) {\n if (category.name.toLowerCase() === cat.toLowerCase()) {\n isPartOfCategory = true;\n }\n });\n\n if (isPartOfCategory) {\n filteredObjects.push(item);\n }\n });\n }\n\n //set the URL accordingly\n setURLParameter();\n setCategoryActive(filterParam);\n}", "getCategoriesPathFromRootArray(category){\n return category.path_from_root.map(( category ) => category.name);\n }", "async function getcategaries() {\n const response = await fetch(\"http://localhost:8000/api/categaries\");\n const body = await response.json();\n console.log(\"response from api : \", body);\n setCategories(\n body.plantCategories.map(({ category, id }) => ({\n label: category,\n value: id,\n }))\n );\n }", "function addCategory(category) {\n query.categories.push(category);\n}", "getCategoryNumber(category){\n for(let i = 0; i < json.jsonArray.length; i++){\n if(json.jsonArray[i].key === category){\n return i;\n }\n }\n }", "function getCategoryID(data){\n\tconst category = data.categories.items.map((item, index) => item.id);\n\tcategory.sort();\n\tvar string;\n\tvar cat;\n\tfor(var i=0; i < category.length; i++){\n\t\tif (category[i].indexOf('_') > -1){\n\t\t\tstring = category[i];\n\t\t\tcat = string.replace(\"_\", \"-\");\n\t\t} else {\n\t\t\tcat = category[i];\n\t\t}\n\t\t$(\"#mood\").append(`<option>${cat}</option>`);\n\t}\n\t\n\t//spotifyUserId = JSON.parse(sessionStorage.spotifyUserId);\n\n}", "function readCategories(filePath)\r\n{\r\n let categories = {};\r\n let srcCategories = fs.readFileSync(filePath, 'utf-8');\r\n srcCategories = srcCategories.toString().split('|||||');\r\n\r\n // Re-index subcategories by their main category\r\n srcCategories.forEach(function(category, index) {\r\n if (category) {\r\n category = JSON.parse(category);\r\n if (/no/i.test(category.name)) {\r\n categories.nmg = category;\r\n } else {\r\n categories.mg = category;\r\n }\r\n }\r\n });\r\n\r\n return categories;\r\n}", "function createCategory(logger, line) {\n logger.debug('category=' + line);\n\n var MINIMUM_FIELDS_LENGTH = 3;\n var arr = line.split('^');\n if (arr.length !== MINIMUM_FIELDS_LENGTH) {\n throw new Error('The RPC returned data but the category was missing elements: ' + line);\n }\n\n var category = {\n ien: arr[1],\n categoryName: arr[2]\n };\n\n logger.debug({category: category});\n return category;\n}", "function getJSON(url, selectedCategory) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", url, true);\n req.send();\n req.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200)\n {\n var jsonData = JSON.parse(this.responseText);\n //if data retreival is successful, call \"parseJSON\" function \n parseJSON(jsonData, selectedCategory);\n }\n };\n}", "function getCategoryFromPage() {\n var pathComponents = window.location.pathname.split('/');\n return pathComponents[1];\n}", "category () {\n if (this.categoryId) {\n return BacklogItemCategories.findOne(this.categoryId)\n }\n }", "function addCategory() {\n\tif ( $('#catName').val()==='') {\n\t\treturn;\n\t}\n\n\tvar pnode = $('#tree1').tree('getSelectedNode');\n\tvar parentName;\n\tvar catid;\n\tvar rootid = \"00000000-0000-0000-0000-000000000000\"\n\t\t\n\t/* Assigning parent based on selected node, if any, otherwise parent is root*/\n\tif (pnode == false)\t{\n\t\tparentName=rootid;\n\t} else\t{\n\t\tparentName=pnode['id'];\n\t}\n\t\n\t\n /*Tree node description*/\t\n\tvar newNode= {\n\t\t\t\tname:$('#catName').val(),\n\t\t\t\tparentid:parentName //$('#tree1').tree('getNodeByName',$('#catName').val()).parent,\t\n\t}\n\t\t\n\t/*sending node data to server*/\n\t$.ajax({\n\t\turl : openke.global.Common.getRestURLPrefix()+\"/concepts/category\",\n\t\ttype : \"POST\",\n\t\tcontentType: \"application/json; charset=utf-8\",\n\t\tdata : JSON.stringify(newNode),\n\t\tdataType : \"JSON\",\n\t\tsuccess: function(data) {\n\t\t\t\t// get the UID from the result\n\t\t\t\n\t\t\t\tnewNode.id = data.concept.id;\n\t\t\t\t\n\t\t\t\t// Add node in UI(Front End)\n\t\t\t\t$('#tree1').tree( 'appendNode', newNode, pnode );\n\t\t\t\t$('#catName').val(''); //Reset text\n\t\t\t},\n\t\terror: function (jqXHR, textStatus, errorThrown) {\n\t\t\t// TODO\n\t\t}\n\t\n\t});\n}", "function category(state = [], action) {\n const {name, path} = action;\n\n switch (action.type) {\n case ADD_INITIAL_STATE_CATEGORIES:\n return state.concat({\n name: name,\n path: path\n });\n default:\n return state;\n }\n}", "function ajaxForAccessory(url) {\n $.ajax({url: url, success: function (result) {\n var data = result;\n switch (data.CategoryId) {\n case '1':\n car.src = data.Path;\n break;\n case '2':\n frontWheel.src = data.Path;\n backWheel.src = data.Path;\n break;\n case '3':\n spoiler.src = data.Path;\n break;\n case '4':\n storage.src = data.Path;\n break;\n }\n }});\n }", "function retrieveJSON(category, searchText){\n $.ajax({\n url:\"http://www.mattbowytz.com/simple_api.json?data=\" + category,\n type:\"GET\",\n dataType:\"json\"\n })\n .done(function(json){\n var substringMatches = [];\n json.data.programming.forEach(function(entry){\n entry = entry.toLowerCase();\n if(searchText.length > 0 && entry.startsWith(searchText.toLowerCase())){\n substringMatches.push(entry);\n $(\".dropdown-content\").append(\"<a href=\\\"#\\\">\" + entry + \"</a>\");\n }\n });\n json.data.interests.forEach(function(entry){\n entry = entry.toLowerCase();\n if(searchText.length > 0 && entry.startsWith(searchText.toLowerCase())){\n substringMatches.push(entry);\n $(\".dropdown-content\").append(\"<a href=\\\"#\\\">\" + entry + \"</a>\");\n }\n });\n })\n .fail(function(xhr, status, error){\n console.log('ERROR: ' + error);\n });\n }", "function displayCategory(input) {\n document.getElementById(\"category\").innerHTML = `For $${input[0].value} in the category <i>${input[0].category.title}</i>, the question is...`\n}", "function get_sell_category(category) {\n\tvar div = document.getElementById(\"sell_users_properties\");\n\thr.open(\"POST\", \"/sell/get_sell_category\", true);\n\thr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\thr.onreadystatechange = function() {\n\t\tif(hr.readyState == 4) {\n\t\t\tif(hr.status == 200) {\n\t\t\t\tdiv.innerHTML = hr.responseText;\n\t\t\t\t}\n\t\t\t}\n\t}\n\tvar t = \"category=\"+category+\"&val=1\";\n\thr.send(t);\n}", "function searchKey(inpVal) {\r\n document.querySelector(\".cat-list\").remove();\r\n fetch(`https://cataas.com/api/cats?tags=${inpVal}`, {\r\n method: \"GET\"\r\n })\r\n .then((data) => {\r\n return data.json();\r\n })\r\n .then((cats) => loadCats(cats));\r\n}", "function categoryEndpoints(err, httpResponse, body){\n //\n console.log(\"accesstoken = \", accessToken);\n var finalData = body.replace(/\\\\/g, \"\");\n var categoryResults = JSON.parse(finalData).results;\n //async.each(categoryResults, saveCategory, function(err){});\n for (var i = categoryResults.length - 1; i >= 0; i--) {\n if (categoryResults[i].hasOwnProperty('numberFormat')){\n var info = {categoryguid: categoryResults[i].guid, numberguid: categoryResults[i].numberFormat.guid};\n testArray[categoryResults[i].name] = testArray[categoryResults[i].name] || [];\n testArray[categoryResults[i].name] = info; //Is named after the category and has category GUID and numberFormat GUID attributes\n categories[categoryResults[i].path] = categoryResults[i].guid; //Is named after the path and has category GUID key value pair\n console.log(\"guid = \", categories[categoryResults[i].path]);\n \n categoryAttributesEndpoint(categoryResults[i].guid);\n }\n else{\n //make the check in the convert json function to replace empty values\n console.log(\"No Number Format for \", categoryResults[i].name);\n var info = {categoryguid: categoryResults[i].guid, numberguid: 'FXH05VWW5CV4N6MNGHDF'}; \n }\n }; /* END categoriesEndpoint FOR LOOP */\n numberFormatsEndpoint();\n}", "function identifyCategory(e) {\n // declare variables\n let chosenRadius = '0';\n let chosenCategory = '0';\n // simple conditional to match the DOM element to the api ID\n if (e.id == 'jsCatTrending') {\n // chosenRadius = '6000';\n extractNeededData(trending.response.venues);\n\n } else if (e.id == 'jsCatParks') {\n chosenRadius = '2000';\n chosenCategory = '4bf58dd8d48988d163941735';\n createSearchRequestURI(chosenRadius, chosenCategory);\n\n } else if (e.id == 'jsCatBeaches') {\n chosenRadius = '2000';\n chosenCategory = '4bf58dd8d48988d1e2941735';\n createSearchRequestURI(chosenRadius, chosenCategory);\n\n } else if (e.id == 'jsCatLookouts') {\n chosenRadius = '2000';\n chosenCategory = '4bf58dd8d48988d165941735';\n createSearchRequestURI(chosenRadius, chosenCategory);\n }\n else if (e.id == 'jsCatTrending') {\n extractNeededData(trending.response.venues);\n }\n}", "function decodeCategory(objMetar) {\n var category = ''\n if (objMetar.data[0].flight_category) {\n var category = 'Airfield is currently '\n switch(objMetar.data[0].flight_category) {\n case 'VFR':\n category += 'VFR. ';\n break;\n case 'MVFR':\n category += 'Marginal VFR. '\n break;\n case 'IFR':\n category += 'IFR. '\n case 'LIFR':\n category += 'Low IFR. '\n }\n return category;\n }\n}", "function addCategory(data) {\n console.log(` Adding category: ${data.name}`);\n Categories.insert(data);\n}", "setData(category, body){\n (body.name) ? category.name = body.name : null;\n (body.desc) ? category.desc = body.desc : null;\n (body.max) ? category.max = body.max : null;\n return category\n }", "[consts.CATEGORY_ADD](state, catObj) {\n let insCategoryObj = {\n id: catObj[\"id\"],\n pid: catObj[\"pid\"],\n dt: catObj[\"dt\"],\n idleaf: catObj[\"idleaf\"],\n kwrds: catObj[\"keyWords\"][\"keyWords\"],\n kwrdson: catObj[\"keyWords\"][\"keyWordsSelfOn\"],\n orderby: catObj[\"order\"][\"orderby\"],\n auto_numerate: catObj[\"order\"][\"autoNumerate\"],\n user_fields_on: catObj[\"userFields\"][\"userFieldsOn\"],\n uflds: catObj[\"uflds\"],\n num: parseInt(catObj[\"num\"]),\n chkd: false\n };\n for (let itm in catObj[\"names\"])\n insCategoryObj[\"name_\" + itm] = catObj[\"names\"][itm].name;\n\n //Categories add 1\n state.itemsCount++;\n\n //Set leaf id if it is root category\n if (catObj[\"pid\"] == -1) state.idLeaf = catObj[\"idleaf\"];\n\n Vue.set(state.list, state.list.length, insCategoryObj);\n }", "function callbackT411Cats(error,response,body)\n{\n\tif(!error && response.statusCode == 200)\n\t{\n\t\tvar jsonResult = JSON.parse(body);\n\n\t\tvar ids = Object.keys(jsonResult); // Get all ids\n\t\tids.forEach( function(idCat) {\n\t\t\tif(typeof jsonResult[idCat] != 'object' || jsonResult[idCat].name == undefined)\n\t\t\t\treturn;\n\t\t\tvar currentCat = {id:idCat,name: jsonResult[idCat].name,pid:jsonResult[idCat].pid};\n\t\t\tT411Categories.push(currentCat);\n\n\t\t\tvar idChilds = Object.keys(jsonResult[idCat]['cats']); // Get childs ids\n\t\t\tidChilds.forEach( function(idChildCat) {\n\t\t\t\tif(typeof jsonResult[idCat]['cats'][idChildCat] != 'object' || jsonResult[idCat]['cats'][idChildCat].name == undefined)\n\t\t\t\t\treturn;\n\t\t\t\tvar currentChildCat = {\n\t\t\t\t\t'id':idChildCat,\n\t\t\t\t\t'name': jsonResult[idCat]['cats'][idChildCat].name,\n\t\t\t\t\t'pid':jsonResult[idCat]['cats'][idChildCat].pid\n\t\t\t\t};\n\t\t\t\tT411Categories.push(currentChildCat);\n\t\t\t});\n\t\t});\n\t\t_logger.debug(\"Got \"+T411Categories.length+\" categories from T411 !\");\n\n\t\tT411Categories.forEach(function(category)\n\t\t\t\t{\n\t\t\t\t\tif(category.name == _T411_CatTVShow.name)\n\t\t\t\t\t\t_T411_CatTVShow.value = category.id;\n\n\t\t\t\t\tif(category.name == _T411_CatFilms.name)\n\t\t\t\t\t\t_T411_CatFilms.value = category.id;\n\n\t\t\t\t});\n\n\t\tgetT411Terms();\n\t}\n}", "getAllPossible(category){\n let res = [];\n for (let item of json.jsonArray){\n if(item.key === category){\n for(let character of item.value){\n res.push(character);\n }\n }\n }\n return res;\n }", "function loadSubCategory(subcatUrl)\r\n{\r\n var getSubCategory = new XMLHttpRequest();\r\n getSubCategory.onreadystatechange = function() {\r\n if (this.readyState == 4) {\r\n var subcatData = JSON.parse(this.responseText);\r\n console.log(subcatData.subcategoryName);\r\n $('#subcategory').val(subcatData.subcategoryName);\r\n }\r\n };\r\n\r\n getSubCategory.open(\"GET\", subcatUrl, true);\r\n getSubCategory.send();\r\n}", "function checkCategory(){\n let urlParams = new URLSearchParams(window.location.search);\n let category = urlParams.get(\"category\");\n if (category != null){\n return category\n }\n else{\n return \"\"\n }\n}", "function loadCategory(category_list){\n\t\t\n\t\t$.each(category_list, function(index,category) {\n\t\t\t$(\"#itemCategory\").append(\n\t\t $(\"<option class='dynamic-option'></option>\").val(category.category_id).html(category.name)\n\t\t );\n\t\t});\t\n\t}", "function getCategory(id) {\n $.get(\"/api/categories/\" + id, function (data) {\n if (data) {\n name.text(data.name);\n desc.text(data.description);\n }\n });\n }", "function setCategory(cat) {\n\tcategory = cat;\n\tdisplayPic(1);\n}", "function getCategories() {\n\t// JSON file is called here\n\t$.getJSON(\"/api/categories/\", categories => {\n\t\t$.each(categories, (index, category) => {\n\t\t\tif (category.Category == \"Acupuncture\") {\n\t\t\t\t// List items that are new are added here\n\t\t\t\t$(\"#categoryList\").append(\n\t\t\t\t\t$(\"<a />\")\n\t\t\t\t\t\t.html(category.Category + \" <span class='badge badge-success'>New!</span>\")\n\t\t\t\t\t\t.attr(\"class\", \"dropdown-item\")\n\t\t\t\t\t\t.attr(\"href\", \"#\")\n\t\t\t\t\t\t// Click event added to the anchor\n\t\t\t\t\t\t.on(\"click\", e => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$(\"#catNameHeading\").show();\n\t\t\t\t\t\t\t$(\"#categoryName\").text(category.Category);\n\t\t\t\t\t\t\tgetServices(category.Value);\n\t\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// List items are dynamically populated here\n\t\t\t\t$(\"#categoryList\").append(\n\t\t\t\t\t$(\"<a />\")\n\t\t\t\t\t\t.text(category.Category)\n\t\t\t\t\t\t.attr(\"class\", \"dropdown-item\")\n\t\t\t\t\t\t.attr(\"href\", \"#\")\n\t\t\t\t\t\t.on(\"click\", e => {\n\t\t\t\t\t\t\t// Click event added to the anchor\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$(\"#catNameHeading\").show();\n\t\t\t\t\t\t\t$(\"#categoryName\").text(category.Category);\n\t\t\t\t\t\t\tgetServices(category.Value);\n\t\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t});\n}", "async addCategory(name) {\n const res = await fetch(`/categories`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ name }),\n });\n if (res.ok) return;\n else throw new Error(\"Something went wrong\");\n }", "function createCategory(title,val) {\n\n //remove the # from color to pass the query parameters in url\n let color = val.slice( 1 );\n\n $.get('/ajax/createCategory?title='+title+'&color='+color,function (data) {\n\n $('#categorySelect').empty().append('<option value=\"\" selected disabled >'+Lang.get(\"labels.frontend.calendar.chooseCategory\")+'</option>');\n\n $.each(data,function (index,category) {\n $('#categorySelect').append('<option value=\"'+category.id+'\" style=\"color:'+category.color+'\">&#xf192 '+category.title+'</option>');\n });\n displayNewCatGroup();\n\n });\n}", "function Category(data) {\n \n if (!data) {\n throw 'Invalid data for Category';\n }\n \n this.id = data.Id;\n this.name = data.Name;\n \n }", "function listCategoriesOnPage() {\n categories = JSON.parse(JSONtext);\n for (i = 0; i < categories.length; i++) {\n if (categories[i].category == \"Daily\") {\n createAndReturnCategoryDivElement(i, dailyElement);\n }\n if (categories[i].category == \"Fruit & vegetable\") {\n createAndReturnCategoryDivElement(i, fruitVegetableElement);\n }\n if (categories[i].category == \"Meat\") {\n createAndReturnCategoryDivElement(i, meatElement);\n }\n if (categories[i].category == \"Seafood\") {\n createAndReturnCategoryDivElement(i, seafoodElement);\n }\n if (categories[i].category == \"Household & cleaning\") {\n createAndReturnCategoryDivElement(i, houseElement);\n }\n if (categories[i].category == \"Breakfast & cereal\") {\n createAndReturnCategoryDivElement(i, breakfastElement);\n }\n if (categories[i].category == \"Bakery\") {\n createAndReturnCategoryDivElement(i, bakeryElement);\n }\n if (categories[i].category == \"Frozen food\") {\n createAndReturnCategoryDivElement(i, frozenElement);\n }\n if (categories[i].category == \"Snacks Crisps\") {\n createAndReturnCategoryDivElement(i, snacksElement);\n }\n if (categories[i].category == \"Beverages Soda\") {\n createAndReturnCategoryDivElement(i, beveragesElement);\n }\n if (categories[i].category == \"Pasta & rice\") {\n createAndReturnCategoryDivElement(i, pastaElement);\n }\n }\n}", "function getCategoryObject(str) {\n\n var ans = GAME.categories.filter(function(elem,index){\n return GAME.categories[index].idName == str;});\n return ans[0];\n}", "function getCategoryList(){\n $.getJSON(\"json/food.json\",function(data){\n //console.log(data);\n var list = data.data.food_spu_tags;\n countShipping(data.data.poi_info.shipping_fee);\n $.each(list,function(index,val){\n var el = document.createElement(\"div\");\n el.classList.add(\"menu-category-item\");\n var name = val.name, \n icon = val.icon;\n var str = `${icon ? `<img class=\"menu-category-icon\" src=${icon}>`:''}\n ${name}`;\n el.innerHTML = str;\n $(el).data(\"menu\",val);\n $(\".menu-category\").append($(el));\n //init first menu category & menu list\n if(index === 0){\n el.classList.add(\"active-item\");\n getMenuList(val);\n }\n })\n })\n }", "function addCategory(cat, data){\r\n //set auto color if no color defined\r\n cat.color=cat.color || colorService.getColor(Object.keys($scope.categories).length);\r\n //$scope.categories.push(cat);\r\n //$scope.chartOptions.dimensions[cat.name]=cat;\r\n //$scope.chartOptions.data=$scope.chartOptions.data.concat(data);\r\n graphManager.add(cat, data);\r\n }", "function setCategory(category) {\r\n\t\t\tvar textElem = $('<span>' + category + '</span>');\r\n\t\t\t$(textElem).appendTo(self.bbgCss.jq.category);\r\n\t\t}", "function getCategory()\n{\n\tvar category = new Array([111,'server'], [222,'switcher'], [333,'storage'], [444,'workstation']);\n\treturn category;\n}", "get categoryMapping() {\n let categoryMapping = {};\n this.domain.forEach(d => {\n this.currentCategories.forEach(f => {\n if (f.categories.includes(d.toString())) {\n categoryMapping[d] = f.name;\n }\n });\n });\n return categoryMapping;\n }", "async function createCategory() {\n const url = \"/api/produktkategorier\"\n const category ={name: categoryNameField.value}\n const JSONCat = JSON.stringify(category)\n\n fetch(url,{\n method: \"POST\",\n body: JSONCat,\n headers:{'Content-Type':'application/json'}\n })\n populateCategoryDropDown();\n categoryNameField.value = \"\";\n}", "processCategory() {\n this.setState('processing');\n\n this.patchUsage();\n\n this.getCategoryInfo($('#category-input').val()).then(() => {\n\n }).fail(error => {\n this.setState('initial');\n\n /** structured error comes back as a string, otherwise we don't know what happened */\n if (typeof error === 'string') {\n this.writeMessage(error);\n } else {\n this.writeMessage($.i18n('api-error-unknown', 'Wikidata'));\n }\n });\n }", "function selectCategory (category) {\n postsObj = {}\n\n // goes to correct category firebase database endpoint\n refPath = category\n dbRef = database.ref(refPath)\n\n // reads data from endpoint collection, sets it on the posts object\n dbRef.on('value', function (snapshot) {\n snapshot.forEach(function (post) {\n var postKey = post.key\n var postData = post.val()\n postsObj[postKey] = postData\n })\n\n Cookies.set('category', category)\n\n // renders page once data has been gathered\n selectedCategory = category\n\n renderPage()\n })\n }", "function onAddCategoryClickHandler(e) {\n // Prevent submission\n e.preventDefault();\n\n // Validate fields\n var addCategoryForm = document.getElementById(\"add-category-form\");\n if(!addCategoryForm.reportValidity()) {\n return;\n }\n\n // Package the data into an object\n var name = $(\"input[name='category-name']\").val();\n var description = $(\"textarea[name='category-description']\").val();\n\n var categoryInfo = {\n \"name\": name,\n \"description\": description\n };\n\n console.log(\"categoryInfo: \" + categoryInfo);\n\n // Send request\n apiCall(\n \"/category\",\n \"POST\",\n JSON.stringify(categoryInfo),\n onAddCategorySuccess,\n onError\n )\n}", "function getSubCategoryList(category){\n\t\t\n\t\t$.ajax({\n\t\t\turl:\"http://localhost:8080/flipkart/webapi/category/getSubCategoryList/\"+category,\n\t\t\ttype:\"POST\",\n\t\t\tcache:false,\n\t\t\tcontentType:false,\n\t\t\tprocessData: false,\n\t success : function(data){\n\t \t\n\t \tif(data)\n\t \t{\n\t \t\tloadSubCategory(data);\n\t \t}\n\t \t\n\t \telse\n\t \t\talert(\"failed to get Sub Categories\");\n\t },\n\t \n\t error : function(data){\n\t \talert(\"failed to get Sub Categories !\");\n\t }\n\t \n\t\t});\n\t}", "function putCategories(request, response, next) {\n categories.put()\n .then(data => {\n response.status(200).json(data);\n });\n}", "function getCategoryIcon(value) {\n if (value.category === \"chores\") {\n return (\n <LocalLaundryServiceIcon style={{ color: CategoryColors[\"chores\"] }} />\n );\n } else if (value.category === \"school\") {\n return <SchoolIcon style={{ color: CategoryColors[\"school\"] }} />;\n } else if (value.category === \"self-care\") {\n return <FavoriteIcon style={{ color: CategoryColors[\"self-care\"] }} />;\n } else if (value.category === \"social\") {\n return <GroupIcon style={{ color: CategoryColors[\"social\"] }} />;\n } else if (value.category === \"work\") {\n return <WorkIcon style={{ color: CategoryColors[\"work\"] }} />;\n } else {\n // other\n return <HelpIcon style={{ color: CategoryColors[\"other\"] }} />;\n }\n}", "getValueInPath(json, path) {\n const pathElements = this.pathUtilService.toPathArray(path);\n let value = json;\n pathElements.forEach(pathElement => {\n value = value[pathElement];\n if (!value) {\n throw new Error(`\"${pathElement}\" of given path not defined in given json`);\n }\n });\n return value;\n }", "function updateCategoryDetails(e){\n e.preventDefault();\n\n var categoryFormData = JSON.parse(queryStringToJsonString($(\"#admin-view-category\").serialize()));\n var categoryObj = {};\n for(var key in categoryFormData){\n categoryObj[key] = decodeURIComponent(categoryFormData[key]);\n }\n\n updateDetails(\"PUT\", baseURL + \"Category\", JSON.stringify(categoryObj), \"Task Category\", \"categoryViewForm\");\n}", "function get_cat(e){\"forum\"==e||\"fjb\"==e?($(\".select-category\").addClass(\"show\"),$.ajax({url:\"/misc/get_categories_search/\"+e,success:function(e){var t=location.href.match(/forumchoice(\\[\\])*=([^&]+)/),s=\"\";t&&(s=t[2]);var a=\"\";for(var o in e)s==e[o].forum_id?(a=\"selected\",$(\"#search_category\").parent().find(\".customSelectInner\").text(e[o].name)):a=\"\",$(\"#search_category\").append('<option data-child-list=\"'+e[o].child_list+'\" value=\"'+e[o].forum_id+'\" '+a+\">\"+e[o].name+\"</option>\")}})):$(\".select-category\").removeClass(\"show\")}", "function getAssetValue(value) {\n if (_typeof(value) === 'object' && value.url) {\n return value.url;\n }\n\n return value;\n}", "function getCatCategory() {\n\tvar categories = \"\";\n\tvar listValues = getCategoryValues([\"catVinRouge\", \"catVinBlanc\", \"catVinGrappa\", \"catVinMousseuxRose\", \"catVinPineau\", \"catVinAromatise\"]);\n\tif (listValues != \"\")\n\t\tcategories = \"(@tpcategorie==(\" + listValues + \"))\";\n\t\n\treturn categories;\n}", "function getCategories(){\n\n var output = '';\n\n var arr = new Array();\n \n $.getJSON(datasource,function(data){ \n \n $.each(data.questions, function(i,question){\n\n if (jQuery.inArray(question.category, arr) === -1) { \n output += '<li category=\"'+ question.category + '\"><a href=\"listings.html?category=' + question.category + '\">' + question.category + '</a></li>';\n arr.push(question.category);\n }\n });\n $(\"#listItem\").append(output).listview(\"refresh\");\n });\n\n \n }", "getCategories(item, itemIsCategories = false) {\n const taxonomyValue = itemIsCategories ? item : item.data['categories'];\n let response = [];\n\n switch (typeof taxonomyValue) {\n case 'string':\n response = [taxonomyValue];\n break;\n case 'object':\n response = taxonomyValue;\n break;\n }\n\n return response;\n }", "function whatCategory(num, cat) {\n for(var i = 0; i < cat.categories.length; i++) {\n if(cat.categories[i].id === num) {\n return cat.categories[i].name\n }\n }\n}", "getData(category){\n let data = [];\n let subcategories = [];\n let count = this.getCount(category);\n let types = this.getAllPossible(category);\n \n types.forEach((type) => {\n subcategories.push(type.value);\n });\n\n data.push(subcategories);\n data.push(count);\n\n return data;\n }", "function addCategory(category) {\n categories[category] = []\n originals[category] = []\n}", "function visitCats(cat) {\n\tvar count = cat.item_count;\n\t\n\t// depth first visit\n\tfor (subcat in cat.categories) {\n\t count += visitCats(cat.categories[subcat]);\n\t}\n\n\tcat.items.sort(sort_fn);\n\n\tif (cat.hasOwnProperty(\"entry\")) {\n\t cat.entry.label = ucc_str + \" (\" + count + \" items)\";\n\t}\n\t\n\tvar filename = filename_from_cat_id(cat.id);\n\n\tLaunchBar.log(\"Writing file \" + filename);\n\tFile.writeJSON(cat.items, filename, {prettyPrint: false});\n\n\treturn count;\n }", "function compileCategories() {\n var url = \"https://www.eventbriteapi.com/v3/categories/?token=\" + TOKEN;\n var request = new XMLHttpRequest();\n \n // When the request is completed, map the categories to the hashmap\n request.onreadystatechange = function(data) {\n if (request.readyState == 4) {\n if (request.status == 200) {\n var data = request.responseText;\n var obj = $.parseJSON(data);\n \n $.each(obj.categories, function(i, item) {\n gCategories[item.id] = item.short_name;\n }); \n } else {\n console.log('Error', request.status)\n }\n }\n }\n \n // Perform a GET request to the API url\n request.open('GET', url, true);\n request.send(); \n}", "function categoryAttributesEndpoint(categoryguid){\n request.get({\n headers: {\n 'content-type': 'application/json',\n 'arena_session_id': accessToken\n },\n url: 'https://api.arenasolutions.com/v1/items/categories/O6Q9E4RX3O7H0JV2CS8H/attributes/',//categoryguid\n body: JSON.stringify({\n \"email\": email,\n \"password\": password,\n \"workspaceId\": workspace\n })\n }, function(err, httpResponse, body) {\n var catAttResults = JSON.parse(body).results;\n console.log(\"category Attributes Endpoint RESULTS = \", catAttResults);\n\n });\n}", "function CategoryMultiLevel(category, count) {\n if (category.idParentCategory == null || category.idParentCategory == \"\") {\n $scope.categoryDocuments.push(category);\n } else {\n if ($scope.categoryDocuments.indexOf(category) == -1) {\n count++;\n for (i = 1; i <= count; i++) {\n category.title = \"– \" + category.title;\n }\n $scope.categoryDocuments.push(category);\n angular.forEach($scope.tempCategoryDocuments, function (value, index) {\n if (value.idParentCategory == category.id) {\n CategoryMultiLevel(value, count);\n }\n });\n }\n }\n }", "onChangeCategory(e) {\n\t\tthis.props.onChangeCategory(e.target.value);\n\t}", "function getCategory(content) {\n var category = '';\n // var url = /(\\w+):\\/\\/([\\w.]+)(\\.craigslist\\.org)\\/(\\w+)(\\/index\\.rss)/;\n var url = /(\\w+):\\/\\/([\\w.]+)(\\.craigslist\\.org)\\/search\\/(\\w+)(\\?&srchType=A)/;\n var result = content.match(url);\n if(result != null) {\n category = result[4];\n }\n return category;\n}", "async store({request, response}){\n const data = request.body;\n let cat = null;\n\n if(data.name.length && data.status)\n cat = await Categoria.create(data)\n\n return response.json({\"category\": cat})\n }", "function getCategoryDetails(){\n var categoryId = document.getElementById(\"categoryViewSelect\").value;\n\n var method = \"GET\";\n var url = baseURL + \"Category/\" + categoryId;\n var httpRequest = createHttpRequest(method, url);\n\n httpRequest.onreadystatechange = function(){\n if (httpRequest.readyState == 4 && httpRequest.status == 200) {\n var httpResponse = JSON.parse(httpRequest.response);\n var categoryForm = document.getElementById(\"admin-view-category\");\n\n // Fill User form with data\n for(var key in httpResponse){\n //Ignore any other invalid key\n if(typeof categoryForm[key] === 'undefined' || !categoryForm[key]){\n continue;\n }\n // Assign all other values\n categoryForm[key].value = httpResponse[key];\n }\n\n }\n }\n httpRequest.onerror = onError;\n sendHttpRequest(httpRequest, method, url, \"application/json\", null);\n}", "async function getCategory() {\r\n let request = {\r\n method: 'GET',\r\n redirect: 'follow'\r\n }\r\n\r\n if (token === \"\" || typeof token === 'undefined') {\r\n addAgentMessage(\"Sorry I cannot perform that. Please login first!\")\r\n return;\r\n }\r\n\r\n const serverReturn = await fetch(ENDPOINT_URL + '/categories', request);\r\n\r\n if (!serverReturn.ok) {\r\n addAgentMessage(\"There was a problem accessing the list of categories. Please try again!\");\r\n return;\r\n }\r\n\r\n const serverResponse = await serverReturn.json()\r\n\r\n let categories = serverResponse.categories;\r\n\r\n // comma separated; using 'and' to give the assistant a more of human personality \r\n let message = \"We offer products for \" + categories.length + \" total categories: \\n\"\r\n message += categories.splice(0, categories.length - 1).join(', ') + \", and \" + categories[0] + \".\"\r\n addAgentMessage(message);\r\n\r\n\r\n }", "async readCategories() {\n let response = await fetch(url + 'get/categories');\n let data = await response.json();\n return data\n }" ]
[ "0.64768255", "0.5988071", "0.5664285", "0.5654446", "0.5547312", "0.5484582", "0.54593056", "0.54411334", "0.54411334", "0.54411334", "0.54411334", "0.5439875", "0.54299915", "0.5400216", "0.5386971", "0.53820866", "0.53815806", "0.5352957", "0.5350109", "0.5346274", "0.53445566", "0.5305828", "0.5292458", "0.52912366", "0.52670985", "0.5247165", "0.5246405", "0.52402246", "0.52271533", "0.5222049", "0.5216115", "0.51991427", "0.5188554", "0.5183148", "0.5176592", "0.51741713", "0.51705945", "0.5157481", "0.515687", "0.51432484", "0.5140741", "0.51393723", "0.510629", "0.50961876", "0.50835353", "0.5062953", "0.50476974", "0.5044247", "0.5042146", "0.50222206", "0.50183016", "0.5017599", "0.50110066", "0.5003669", "0.50016147", "0.4996803", "0.49909756", "0.49823797", "0.4982065", "0.4980527", "0.49763304", "0.49703178", "0.49697536", "0.49674234", "0.49665153", "0.49646047", "0.49566698", "0.49549398", "0.49540812", "0.49427322", "0.494222", "0.49392897", "0.4938883", "0.49352115", "0.49287692", "0.49149817", "0.49131852", "0.4901355", "0.48972222", "0.48932478", "0.48800185", "0.48796883", "0.48777336", "0.48705307", "0.4864186", "0.48590752", "0.48567176", "0.48504376", "0.48460144", "0.48434564", "0.48264608", "0.48264202", "0.48261675", "0.4824514", "0.48227617", "0.48208386", "0.4820783", "0.48157492", "0.48152912", "0.48133492", "0.48082808" ]
0.0
-1
Shape_From_File is a versatile standalone Shape that imports all its arrays' data from an .obj 3D model file.
constructor( filename ) { super( "position", "normal", "texture_coord" ); // Begin downloading the mesh. Once that completes, return // control to our parse_into_mesh function. this.load_file( filename ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadObj(name, file)\n{\n let obj_info = ObjectPool[name].ObjectInfo;\n if (obj_info == null) return null;\n\n if (file == null)\n {\n obj_info.positions = [];\n obj_info.indices = [];\n obj_info.textureCoordinates = [];\n obj_info.textureIndices = [];\n obj_info.vertexNormals = [];\n obj_info.normalIndices = [];\n return null;\n }\n\n let strs = (file.name).split(\".\");\n if (strs[1] !== \"obj\") return null;\n\n let reader = new FileReader();\n\n reader.onload = function () {\n let res = objStrAna(this.result);\n let lines = res.split('=');\n let objInfo = {\n verPosition : [],\n texPosition : [],\n norPosition : [],\n indicesForVer : [],\n indicesForTex : [],\n indicesForNor : []\n };\n for (let id in lines){\n let line = lines[id];\n let items = line.split(' ');\n switch (items[0]){\n case 'v' :\n objInfo.verPosition.push(parseFloat(items[1]));\n objInfo.verPosition.push(parseFloat(items[2]));\n objInfo.verPosition.push(parseFloat(items[3]));\n break;\n\n case 'vt' :\n objInfo.texPosition.push(parseFloat(items[1]));\n objInfo.texPosition.push(parseFloat(items[2]));\n //objInfo.texPosition.push(parseFloat(items[3]));\n break;\n\n case 'vn' :\n objInfo.norPosition.push(parseFloat(items[1]));\n objInfo.norPosition.push(parseFloat(items[2]));\n objInfo.norPosition.push(parseFloat(items[3]));\n break;\n\n case 'f' :\n for (let i=1; i<=3; i++) {\n let iitems = items[i].split('\\/');\n objInfo.indicesForVer.push(parseInt(iitems[0]) - 1);\n if (iitems[1].length > 0)\n objInfo.indicesForTex.push(parseInt(iitems[1]) - 1);\n if (iitems[2].length > 0)\n objInfo.indicesForNor.push(parseInt(iitems[2]) - 1);\n }\n\n break;\n\n default :\n let list = [];\n for (let i=1; i<items.length; i++){\n list.push(items[i]);\n }\n if (items[0] === '') break;\n objInfo[items[0]] = list;\n break;\n\n }\n\n }\n\n let maxVer = [-1000000.0, -1000000.0, -1000000.0];\n let minVer = [1000000.0, 1000000.0, 1000000.0];\n for (let id in objInfo.verPosition){\n let item = objInfo.verPosition[id];\n if (maxVer[id%3] < item) maxVer[id%3] = item;\n if (minVer[id%3] > item) minVer[id%3] = item;\n }\n let delta = 0;\n for (let i=0; i<3; i++){\n if (maxVer[i] - minVer[i] > delta){\n delta = maxVer[i] - minVer[i];\n }\n }\n\n for (let id in objInfo.verPosition){\n let item = objInfo.verPosition[id];\n objInfo.verPosition[id] = item / delta;\n }\n\n obj_info.positions = objInfo.verPosition;\n obj_info.indices = objInfo.indicesForVer;\n obj_info.textureCoordinates = objInfo.texPosition;\n obj_info.textureIndices = objInfo.indicesForTex;\n obj_info.vertexNormals = objInfo.norPosition;\n obj_info.normalIndices = objInfo.indicesForNor;\n\n refreshItemInObjectPool(name);\n };\n\n reader.readAsText(file);\n\n return file;\n}", "function loadOBJ(data) {\n var lines = data.split(\"\\n\");\n // 1-based indexing\n var vs = [new vector_1[\"default\"](0, 0, 0)];\n var triangles = [];\n var _loop_1 = function (line) {\n var parts = line.split(\" \");\n var keyword = parts[0];\n var args = parts.slice(1);\n switch (keyword) {\n case \"v\": {\n var f = args.map(function (a) { return parseFloat(a); });\n var v = new vector_1[\"default\"](f[0], f[1], f[2]);\n vs.push(v);\n break;\n }\n case \"f\": {\n var fvs_1 = [];\n args.forEach(function (arg, i) {\n var vertex = (arg + \"//\").split(\"/\");\n fvs_1[i] = parseIndex(vertex[0], vs.length);\n });\n for (var i = 1; i < fvs_1.length - 1; i++) {\n var i1 = 0;\n var i2 = i;\n var i3 = i + 1;\n var t = new triangle_1[\"default\"](vs[fvs_1[i1]], vs[fvs_1[i2]], vs[fvs_1[i3]]);\n triangles.push(t);\n }\n }\n }\n };\n for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {\n var line = lines_1[_i];\n _loop_1(line);\n }\n return new mesh_1[\"default\"](triangles);\n}", "readSelectedFile() {\n var fileReader = new FileReader();\n var objFile = document.getElementById(\"fileInput\").files[0];\n\n if (!objFile) {\n alert(\"OBJ file not set!\");\n return;\n }\n\n fileReader.readAsText(objFile);\n fileReader.onloadend = function() {\n // alert(fileReader.result);\n var customObj = new CustomOBJ(shader, fileReader.result);\n _inputHandler.scene.addGeometry(customObj);\n }\n }", "function shapeFromOBJ(fname) {\n fullname = fname;\n if (fname.substring(fname.length-4,fname.length) != '.obj') {\n fullname = fullname.concat('.obj');\n }\n // remember, a user of the webpage doesn't want JS to open a local file, but one hosted somewhere online (assumed to be in the current directory on my page if not specified). Assumed: any url would start with http\n if (fname.substring(0,4) != 'http') {\n var loc = window.location.pathname; \n var dir = loc.substring(0, loc.lastIndexOf('/'));\n fullname = dir.concat('/'.concat(fullname));\n }\n\n return jQuery.get(fullname, function(data) {\n var text = data.toString();\n var lines = text.split('\\n');\n var vertices = [];\n var faces = [];\n // adds vertices and faces, and ignores all else for now\n for( i=0; i<lines.length; i++ ){\n var words = lines[i].split(/[ ,]+/); //regexp for any num of commas/spaces\n var firstLetter = words[0][0];\n if (firstLetter == 'v' || firstLetter == 'V') {\n var vect = [];\n for( j=1;j<words.length;j++ ){\n vect[j-1] = parseFloat(words[j]); \n }\n vertices.push(vect);\n } else if (firstLetter == 'f' || firstLetter == 'F') {\n var fac = [];\n for( j=1;j<words.length;j++ ){\n fac[j-1] = parseInt(words[j]); \n }\n faces.push(fac);\n }\n };\n var out = new Shape(vertices, faces);\n alert('inner:'+out.V);\n return out;\n });\n}", "function loadFile(file) {\r\n\tlet ext = file['name'].split('.').pop();\r\n\tlet reader = new FileReader();\r\n\r\n\tswitch (ext) {\r\n\t\tcase 'STL':\r\n\t\tcase 'stl':\r\n\t\t\tlet loaderSTL = new THREE.STLLoader();\r\n\t\t\treader.onload = () => {\r\n\t\t\t\tlet geometry = new THREE.STLLoader().parse(reader.result);\r\n\t\t\t\tgeometry.sourceType = 'stl';\r\n\t\t\t\tvar material = new THREE.MeshStandardMaterial();\r\n\t\t\t\tvar mesh = new THREE.Mesh(geometry, material);\r\n\t\t\t\taddObjToScene(mesh, file['name']);\r\n\t\t\t};\r\n\t\t\treader.readAsText(file);\r\n\t\t\tbreak;\r\n\t\tcase 'JSON':\r\n\t\tcase 'TJS':\r\n\t\tcase 'tjs':\r\n\t\tcase 'json':\r\n\t\t\treader.onload = () => {\r\n\t\t\t\tlet contents = reader.result;\r\n\t\t\t\tif (contents.indexOf('postMessage') !== -1) {\r\n\t\t\t\t\tvar blob = new Blob([contents], { type: 'text/javascript' });\r\n\t\t\t\t\tvar url = URL.createObjectURL(blob);\r\n\r\n\t\t\t\t\tvar worker = new Worker(url);\r\n\r\n\t\t\t\t\tworker.onmessage = function(event) {\r\n\t\t\t\t\t\tevent.data.metadata = { version: 2 };\r\n\t\t\t\t\t\thandleJSON(event.data, file['name']);\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tworker.postMessage(Date.now());\r\n\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar data;\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdata = JSON.parse(contents);\r\n\t\t\t\t} catch (error) {\r\n\t\t\t\t\talert(error);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\thandleJSON(data, file['name']);\r\n\t\t\t};\r\n\t\t\treader.readAsText(file);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\talert('format not supported');\r\n\t}\r\n}", "function import3dObjSync(config) {\n var scale = config.scale || 1;\n var xRot = config.xRot || null;\n var yRot = config.yRot || null;\n var zRot = config.zRot || null;\n\n var vertex = [],\n faces = [],\n uvs = [];\n var re = /\\s+/;\n\n var minx, miny, minz, maxx, maxy, maxz;\n minx = miny = minz = maxx = maxy = maxz = 0;\n\n var data = getOBJFileSync(config);\n if (data == false) {\n return;\n }\n var lines = data.split(\"\\n\");\n\n for (let i = 0, imax=lines.length; i < imax; i++) {\n let line = lines[i].split(re);\n switch (line[0]) {\n case \"v\":\n var x = parseFloat(line[1]) * scale,\n y = parseFloat(line[2]) * scale,\n z = parseFloat(line[3]) * scale;\n vertex.push({\n x: x,\n y: y,\n z: z\n });\n if (x < minx) {\n minx = x\n } else {\n if (x > maxx) {\n maxx = x\n }\n }\n if (y < miny) {\n miny = y\n } else {\n if (y > maxy) {\n maxy = y\n }\n }\n if (z < minz) {\n minz = z\n } else {\n if (z > maxz) {\n maxz = z\n }\n }\n break;\n case \"vt\":\n var u = parseFloat(line[1]),\n v = parseFloat(line[2]);\n uvs.push([u, v]);\n break;\n case \"f\":\n line.splice(0, 1);\n var vertices = [],\n uvcoords = [];\n for (var j = 0, vindex, vps; j < line.length; j++) {\n vindex = line[config.reorder ? line.length - j - 1 : j];\n if (vindex.length !== 0) {\n vps = vindex.split(\"/\");\n vertices.push(parseInt(vps[0]) - 1);\n if (vps.length > 1 && vindex.indexOf(\"//\") === -1) {\n var uv = parseInt(vps[1]) - 1;\n if (uvs.length > uv) {\n uvcoords.push(uvs[uv][0], uvs[uv][1])\n }\n }\n }\n }\n faces.push(vertices);\n if (uvcoords.length !== 0) {\n poly.uvs = uvcoords\n }\n break\n }\n }\n if (config.center) {\n var cdispx = (minx + maxx) / 2,\n cdispy = (miny + maxy) / 2,\n cdispz = (minz + maxz) / 2;\n for (var i = 0; i < vertex.length; i++) {\n vertex[i].x -= cdispx;\n vertex[i].y -= cdispy;\n vertex[i].z -= cdispz\n }\n }\n if (config.scaleTo) {\n var sizex = maxx - minx,\n sizey = maxy - miny,\n sizez = maxz - minz;\n var scalefactor = 0;\n if (sizey > sizex) {\n if (sizez > sizey) {\n scalefactor = 1 / (sizez / config.scaleTo)\n } else {\n scalefactor = 1 / (sizey / config.scaleTo)\n }\n } else {\n if (sizez > sizex) {\n scalefactor = 1 / (sizez / config.scaleTo)\n } else {\n scalefactor = 1 / (sizex / config.scaleTo)\n }\n }\n for (let i = 0, imax=vertex.length; i < imax; i++) {\n vertex[i].x *= scalefactor;\n vertex[i].y *= scalefactor;\n vertex[i].z *= scalefactor\n }\n }\n rotateZ3D(zRot, vertex, true);\n rotateY3D(yRot, vertex, true);\n rotateX3D(xRot, vertex, true);\n\n return {\n points: vertex,\n polygons: faces\n }\n }", "function loadProgram(objFile) {\n new OBJLoader().load(objFile, obj => {\n let mesh = obj.children[0];\n\n mesh.geometry = new THREE.Geometry().fromBufferGeometry(mesh.geometry);\n mesh.geometry.mergeVertices();\n mesh.geometry.normalize();\n mesh.geometry.computeVertexNormals(true);\n\n mesh.material = new THREE.MeshPhongMaterial({\n color: 0x444444\n });\n mesh.material.side = THREE.DoubleSide;\n\n // Add to global to debug\n data.program = new Program(space, mesh, params);;\n });\n }", "function onReadOBJFile(fileString, so, gl, scale, reverse) {\n var objDoc = new OBJDoc(so.filePath); // Create a OBJDoc object\n objDoc.defaultColor = so.color;\n var result = objDoc.parse(fileString, scale, reverse); // Parse the file\n if (!result) {\n so.objDoc = null; so.drawingInfo = null;\n console.log(\"OBJ file parsing error.\");\n return;\n }\n so.objDoc = objDoc;\n}", "function readOBJ(path) {\n\tconsole.log(\"Reading OBJ file: \" + path);\n\tvar obj = new Mesh();\n\tvar req = new XMLHttpRequest();\n\treq.open('GET', path, false);\n\t\n\treq.send(null);\n\tobj.load(req.response);\n\tobj.computeNormals();\n\tconsole.log(\"OBJ file successfully loaded (nbV: \" + obj.nbV() + \", nbF: \" + obj.nbF() + \")\");\n\t\n\treturn obj;\n}", "function onReadOBJFile(fileString, fileName, gl, o, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse);\n if (!result) {\n g_objDoc = null; g_drawingInfo = null;\n console.log(\"OBJ file parsing error.\");\n return;\n }\n g_objDoc = objDoc;\n}", "function onReadOBJFile(fileString, fileName, gl, o, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse);\n if (!result) {\n g_objDoc = null; g_drawingInfo = null;\n console.log(\"OBJ file parsing error.\");\n return;\n }\n g_objDoc = objDoc;\n}", "function onReadOBJFile(fileString, fileName, gl, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse);\n if (!result) {\n g_objDoc = null; g_drawingInfo = null;\n console.log(\"OBJ file parsing error.\");\n return;\n }\n g_objDoc = objDoc;\n}", "function onReadOBJFile(fileString, fileName, gl, o, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse);\n if (!result) {\n g_objDoc = null;\n g_drawingInfo = null;\n console.log(\"OBJ file parsing error.\");\n return;\n }\n g_objDoc = objDoc;\n}", "constructor(filename) {\n super(\"position\", \"normal\", \"texture_coord\");\n // Begin downloading the mesh. Once that completes, return\n // control to our parse_into_mesh function.\n this.load_file(filename);\n }", "function OBJReader () {}", "function load(parsedData) {\n \n var newShape;\n var array = [];\n for (var i = 0; i < parsedData.length; i++){\n //if line\n if (parsedData[i].type == \"line\") {\n newShape = new lineShape(parsedData[i].colour,parsedData[i].startPos,parsedData[i].endPos);\n array.push(newShape);\n //if rectangle\n } else if (parsedData[i].type == \"rect\") {\n newShape = new rectShape(parsedData[i].colour,parsedData[i].startPos,parsedData[i].endPos);\n array.push(newShape);\n //square\n } else if (parsedData[i].type == \"square\") {\n newShape = new squareShape(parsedData[i].colour,parsedData[i].startPos,parsedData[i].endPos);\n array.push(newShape);\n //if circle\n } else if (parsedData[i].type == \"circ\") {\n newShape = new circShape(parsedData[i].colour,parsedData[i].startPos,parsedData[i].endPos);\n array.push(newShape);\n //if ellipse\n } else if (parsedData[i].type == \"ellip\") {\n newShape = new ellipShape(parsedData[i].colour,parsedData[i].startPos,parsedData[i].endPos);\n array.push(newShape);\n //if freehand\n } else if (parsedData[i].type == \"freehand\") {\n newShape = new freehandShape(parsedData[i].colour,parsedData[i].startPos);\n newShape.addArray(parsedData[i].posArray);\n array.push(newShape);\n //grouped shape\n } else if (parsedData[i].type == \"group\") {\n var loadedShapes = [];\n loadedShapes = load(parsedData[i].shapeArray);\n newShape = new groupShape(loadedShapes[0],loadedShapes[1]);\n array.push(newShape);\n }\n }\n \n return array;\n \n}", "function onReadOBJFile(fileString, fileName, gl, scale, reverse) {\n\tvar objDoc = new OBJDoc(fileName);\t// Create a OBJDoc object\n\tvar result = objDoc.parse(fileString, scale, reverse);\t// Parse the file\n\t\n\tif (!result) {\n\t\tg_objDoc \t\t= null; \n\t\tg_drawingInfo \t= null;\n\t\tconsole.log(\"OBJ file parsing error.\");\n\t\treturn;\n\t\t}\n\t\t\n\tg_objDoc = objDoc;\n}", "function Shape (vertices, faces) {\n\t// typeof(array)='object' in JS\n\tif (typeof(vertices[0])=='object'){\n\t\tthis.V = vertices;\n\t} else {\n\t\tthis.V = [];\n\t\tfor (i=0; i<vertices.length; i+=3){\n\t\t\tthis.V.push(vertices.slice(i,i+3));\n\t\t}\n\t} if (typeof(faces[0])=='object'){\n\t\tthis.F = faces;\n\t} else {\n\t\tthis.F = [];\n\t\tfor (i=0;i<faces.length;i+=3){\n\t\t\tthis.F.push(faces.slice(i,i+3));\n\t\t}\n\t}\n}", "function handleStlFile(files) {\n\tfile = files[0]\n\n\twindow.stl_reader = {};\n\n\tif (file) {\n\t\t// check if file is stl file\n\t\tvar fileName = file.name;\n\t\tif (fileName.substring(fileName.length - 4,fileName.length) === \".stl\") {\n\t\t\t// read as text -> if file starts with solid, it is ascii format otherwise it is binary\n\t\t\tvar reader = new FileReader();\n\n\t\t\treader.readAsText(file, \"UTF-8\");\n\n\t\t\treader.onload = function (evt) {\n\t\t\t\t// remove previous solid if any\n\t\t\t\tremovePrevious();\n\n\n\t\t\t\t// initialize three.js geometry to put all faces in\n\t\t\t\twindow.stl_reader.geometry = new THREE.Geometry();\n\n\t\t\t\t// lines is an object that is used like a hash to save which line connects which two faces.\n\t\t\t\t// lines[vertex 1, vertex 2] = [face 1, face 2]\n\t\t\t\twindow.stl_reader.lines = {};\n\n\t\t\t\t// vertices is an object that is used like a hash, saving normals of faces including the vertex.\n\t\t\t\t// Up to two normals is saved since if there is more than one normal, it is a regular vertex.\n\t\t\t\t// vertices[vertex index] = [normal, normal]\n\t\t\t\twindow.stl_reader.vertices = {};\n\n\t\t\t\twindow.stl_reader.addFaceToLine = function(lines, line, currFace) {\n\t\t\t\t\tif (lines[line]) {\n\t\t\t\t\t\tlines[line].push(currFace);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlines[line] = [currFace];\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t// function that populates the lines object\n\t\t\t\twindow.stl_reader.lineHandle = function(lines, currFace, vertIndex) {\n\t\t\t\t\tvar line = [vertIndex[0],vertIndex[1]].sort();\n\t\t\t\t\twindow.stl_reader.addFaceToLine(lines, line, currFace);\n\n\t\t\t\t\tvar line = [vertIndex[1],vertIndex[2]].sort();\n\t\t\t\t\twindow.stl_reader.addFaceToLine(lines, line, currFace);\n\n\t\t\t\t\tvar line = [vertIndex[0],vertIndex[2]].sort();\n\t\t\t\t\twindow.stl_reader.addFaceToLine(lines, line, currFace);\n\t\t\t\t};\n\n\t\t\t\t// function that populates the vertices object\n\t\t\t\twindow.stl_reader.addNormalToVertices = function (vertexIndex, currFaceNormal) {\n\t\t\t\t\tvar vertices = window.stl_reader.vertices;\n\n\t\t\t\t\tif (vertices[vertexIndex]) {\n\t\t\t\t\t\tif (vertices[vertexIndex].length < 2) {\n\t\t\t\t\t\t\tif (!isSameVectorOrVertex(vertices[vertexIndex][0], currFaceNormal)) {\n\t\t\t\t\t\t\t\tvertices[vertexIndex].push(currFaceNormal);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvertices[vertexIndex] = [currFaceNormal];\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t// Function that checks if vertex is already in the geometry. If not, adds vertex to the geometry.\n\t\t\t\t// Returns the three.js vertex index in the geometry vertex array.\n\t\t\t\twindow.stl_reader.vertexHandle = function(split, vert, geometry) {\n\t\t\t\t\tvar vertIndex = -1;\n\n\t\t\t\t\tvar identifier = split.join(\",\");\n\t\t\t\t\tif (window.stl_reader.previousVertices[identifier]) {\n\t\t\t\t\t\tvertIndex = window.stl_reader.previousVertices[identifier];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (vertIndex === -1) {\n\t\t\t\t\t\tvertIndex = geometry.vertices.push(vert);\n\t\t\t\t\t\twindow.stl_reader.previousVertices[identifier] = vertIndex;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn vertIndex;\n\t\t\t\t};\n\n\t\t\t\twindow.stl_reader.vertIndex = new Array(3);\n\t\t\t\twindow.stl_reader.previousVertices = {};\n\n\t\t\t\tif (evt.target.result.substr(0,5) === \"solid\") {\n\t\t\t\t\tasciiHandle(evt);\n\t\t\t\t} else {\n\t\t\t\t\tbinaryHandle(evt);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treader.onerror = function (evt) {\n\t\t\t\tconsole.log(\"error reading file\")\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"file is not an stl file\")\n\t\t}\n\t}\n}", "function setupMesh(filename) {\n myMesh = new TriMesh()\n myPromise = asyncGetFile(filename)\n myPromise.then((retrievedText)=>{\n myMesh.loadFromOBJ(retrievedText)\n console.log(\"Yay! got the file\")})\n .catch( (reason) =>{\n console.log(\"Handle rejected promise ('+reason+') here.\")\n })\n}", "function loadObject(json){\n\n\t// create an array with x-,y- and z-coordinates for each vertex (x1,y1,z1,x2,y2,z2,...)\n\tlet vertices = [];\n\tfor(let i = 0; i < json.x.length; i++){\n\t\tvertices.push(json.x[i], json.y[i], json.z[i]);\n\t}\n\n\t// create array to store the vertex indices\n\t// indices can only be stored for triangles\n\t// if not given, a polygon of more than 3 vertices needs to be cut in triangles\n\tlet indices = [];\n\tfor(let j = 0; j < json.vertex_indices.length; j++){\n\t\t//TODO: Flächen dürfen momentan nur aus drei oder vier Punkten bestehen\n\t\tif(json.vertex_indices[j].length == 4){\n\t\t\tindices.push(json.vertex_indices[j][0], json.vertex_indices[j][1], json.vertex_indices[j][2]);\n\t\t\tindices.push(json.vertex_indices[j][2], json.vertex_indices[j][3], json.vertex_indices[j][0]);\n\t\t}\n\t\telse if(json.vertex_indices[j].length == 3){\n\t\t\tindices.push(json.vertex_indices[j][0], json.vertex_indices[j][1], json.vertex_indices[j][2]);\n\t\t}\n\t}\n\n\t// create a geometry and add the vertices and vertex indices\n\tlet geometry = new THREE.BufferGeometry();\n\tgeometry.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3));\n\tgeometry.setIndex(indices);\n\n\t// create a material with the set color\n\tlet material = new THREE.MeshBasicMaterial({color: Undefiniert, side: THREE.DoubleSide, transparent: true, opacity: 0.5});\n\n\t// create the object with material and geometry\n\tlet object = new THREE.Mesh( geometry, material );\n\n\t// render only in visible\n\tobject.frustumCulled = true;\n\n\t// save object id\n\tobject.name = json.objID;\n\n\t// save object class\n\tlet userData = [];\n\tuserData.push(json.objClass);\n\tobject.userData = userData;\n\n // update color\n updateColor(object);\n\n\t// add object to clickable list\n\tclickable.push(object);\n\n\t// add object to scene\n\tscene.add(object);\n\n}", "function onReadOBJFile(fileString, fileName, scale, reverse) {\n var objDoc = new OBJDoc(fileName); // Create a OBJDoc object\n var result = objDoc.parse(fileString, scale, reverse);\n\n if (!result) {\n g_objDoc = null;\n g_drawingInfo = null;\n console.log(\"OBJ file parsing error\");\n } else {\n g_objDoc = objDoc;\n }\n }", "function parseObj( model, lines ) {\n // OBJ allows a face to specify an index for a vertex (in the above example),\n // but it also allows you to specify a custom combination of vertex, UV\n // coordinate, and vertex normal. So, \"3/4/3\" would mean, \"use vertex 3 with\n // UV coordinate 4 and vertex normal 3\". In WebGL, every vertex with different\n // parameters must be a different vertex, so loadedVerts is used to\n // temporarily store the parsed vertices, normals, etc., and indexedVerts is\n // used to map a specific combination (keyed on, for example, the string\n // \"3/4/3\"), to the actual index of the newly created vertex in the final\n // object.\n var loadedVerts = {'v' : [],\n 'vt' : [],\n 'vn' : []};\n var indexedVerts = {};\n\n for (var line = 0; line < lines.length; ++line) {\n // Each line is a separate object (vertex, face, vertex normal, etc)\n // For each line, split it into tokens on whitespace. The first token\n // describes the type.\n var tokens = lines[line].trim().split(/\\b\\s+/);\n\n if (tokens.length > 0) {\n if (tokens[0] === 'v' || tokens[0] === 'vn') {\n // Check if this line describes a vertex or vertex normal.\n // It will have three numeric parameters.\n var vertex = new p5.Vector(parseFloat(tokens[1]),\n parseFloat(tokens[2]),\n parseFloat(tokens[3]));\n loadedVerts[tokens[0]].push(vertex);\n } else if (tokens[0] === 'vt') {\n // Check if this line describes a texture coordinate.\n // It will have two numeric parameters.\n var texVertex = [parseFloat(tokens[1]), parseFloat(tokens[2])];\n loadedVerts[tokens[0]].push(texVertex);\n } else if (tokens[0] === 'f') {\n // Check if this line describes a face.\n // OBJ faces can have more than three points. Triangulate points.\n for (var tri = 3; tri < tokens.length; ++tri) {\n var face = [];\n\n var vertexTokens = [1, tri - 1, tri];\n\n for (var tokenInd = 0; tokenInd < vertexTokens.length; ++tokenInd) {\n // Now, convert the given token into an index\n var vertString = tokens[vertexTokens[tokenInd]];\n var vertIndex = 0;\n\n // TODO: Faces can technically use negative numbers to refer to the\n // previous nth vertex. I haven't seen this used in practice, but\n // it might be good to implement this in the future.\n\n if (indexedVerts[vertString] !== undefined) {\n vertIndex = indexedVerts[vertString];\n } else {\n var vertParts = vertString.split('/');\n for (var i = 0; i < vertParts.length; i++) {\n vertParts[i] = parseInt(vertParts[i]) - 1;\n }\n\n vertIndex = indexedVerts[vertString] = model.vertices.length;\n model.vertices.push(loadedVerts.v[vertParts[0]].copy());\n if (loadedVerts.vt[vertParts[1]]) {\n model.uvs.push(loadedVerts.vt[vertParts[1]].slice());\n } else {\n model.uvs.push([0, 0]);\n }\n\n if (loadedVerts.vn[vertParts[2]]) {\n model.vertexNormals.push(loadedVerts.vn[vertParts[2]].copy());\n }\n }\n\n face.push(vertIndex);\n }\n\n model.faces.push(face);\n }\n }\n }\n }\n // If the model doesn't have normals, compute the normals\n if(model.vertexNormals.length === 0) {\n model.computeNormals();\n }\n\n return model;\n}", "function parseFile(evt){\n let files = evt.target.files; // FileList object\n if(files.length === 0){ //if no files\n return;\n }\n let f = files[0];\n\n let pointsArray = [];\n fileFaces = [];\n let reader = new FileReader();\n reader.onload = (function(theFile) {\n return function(e) {\n let contents = atob(e.target.result.split(\"base64,\")[1]);\n contents = contents.split(/\\n/); //split contents into lines\n if(contents[0].replace(/\\s+/, \"\") === \"\"){ //if first line is blank\n contents.shift(); //delete it\n }\n if(contents[0].replace(/\\s+/, \"\") !== \"ply\"){ //if first line does not contain \"ply\"\n console.log(\"No Ply: \" + contents[0]); //do nothing with the file\n return;\n }\n\n let i = 1;\n let numVerts = 0;\n let numFaces = 0;\n\n while(contents[i].indexOf(\"end_header\") === -1){ //while we haven't hit the end of the header\n if(contents[i].indexOf(\"element vertex\") !== -1){ //if this line indicates # vertices\n let idx = contents[i].indexOf(\"element vertex\");\n numVerts = parseInt(contents[i].substring(idx+14)); //parse # of vertices\n } else if(contents[i].indexOf(\"element face\") !== -1){ //if this line indicates # of faces\n let idx = contents[i].indexOf(\"element face\");\n numFaces = parseInt(contents[i].substring(idx+12)); //parse # of faces\n }\n i++;\n }\n i++; //increment to line just after end_header\n let left = vec4(Number.MAX_VALUE, 0.0, 0.0, 0.0);\n let right = vec4(Number.MIN_VALUE, 0.0, 0.0, 0.0);\n let top = vec4(0.0, Number.MIN_VALUE, 0.0, 0.0);\n let bottom = vec4(0.0, Number.MAX_VALUE, 0.0, 0.0);\n let minZ = vec4(0.0, 0.0, Number.MAX_VALUE, 0.0);\n let maxZ = vec4(0.0, 0.0, Number.MIN_VALUE, 0.0); //initialize extents to easily-overridden values\n\n let j = 0;\n for(j = 0; j < numVerts; j++){ //for each vertex\n while(contents[i].replace(/\\s+/, \"\") === \"\"){ //ignore empty lines\n i++;\n }\n let points = contents[i].split(/\\s+/); //split along spaces\n if(points[0].replace(/\\s+/, \"\") === \"\"){ //ignore empty first element\n points.shift();\n }\n let x = parseFloat(points[0]);\n let y = parseFloat(points[1]);\n let z = parseFloat(points[2]);\n let thisPoint = vec4(x, y, z, 1.0);\n\n if(x < left[0]){ //if x is further left\n left = thisPoint;\n }\n if(x > right[0]){ //if x is further right\n right = thisPoint;\n }\n if(y < bottom[1]){ //if y is lower\n bottom = thisPoint;\n }\n if(y > top[1]){ //if y is higher\n top = thisPoint;\n }\n if(z < minZ[2]){ //if Z is further\n minZ = thisPoint;\n }\n if(z > maxZ[2]){ //if Z is closer\n maxZ = thisPoint;\n }\n pointsArray.push(thisPoint);\n i++;\n }\n\n let divisor = Math.max(right[0]-left[0], top[1]-bottom[1], maxZ[2]-minZ[2]) / 2; //calculate largest dimension\n let shiftX = (-(right[0] - (right[0]-left[0])/2))/divisor; //X axis translation to center at origin\n let shiftY = (-(top[1] - (top[1]-bottom[1])/2))/divisor; //Y axis translation to center at origin\n let shiftZ = (-(maxZ[2] - (maxZ[2]-minZ[2])/2))/divisor; //Z axis translation to center at origin\n for(j = 0; j < numFaces; j++){ //for each face\n while(contents[i].replace(/\\s+/, \"\") === \"\"){ //ignore empty lines\n i++;\n }\n let verts = contents[i].split(/\\s+/);\n if(verts[0].replace(/\\s+/, \"\") === \"\"){ //if empty first element\n verts.shift();\n }\n let vertLen = parseInt(verts[0]); //parse # vertices\n verts.shift();\n\n for(let k = 0; k < vertLen; k++){ //for # of vertices\n let currVert = pointsArray[verts[k]];\n fileFaces.push(vec4(currVert[0]/divisor + shiftX, currVert[1]/divisor + shiftY, currVert[2]/divisor + shiftZ, 1.0));\n //shift vertex so whole object is centered on origin and [-1, 1], push to face\n }\n i++;\n }\n let rightBB = right[0]/divisor + shiftX;\n let topBB = top[1]/divisor + shiftY;\n let maxZBB = maxZ[2]/divisor + shiftZ;\n\n //back face\n fileBB = generateBB(rightBB, topBB, maxZBB);\n\n fileUploaded = true;\n if(shapeArray.length === 3){ //if another file is already loaded\n shapeArray.pop(); //get rid of it\n }\n shapeArray.push(fileFaces); //push this file to shape array\n fileFlatNormal = fNormals(shapeArray[2]); //calculate flat normals\n fileGNormal = gNormals(shapeArray[2]); //calculate gouraud normals\n generateLines(); //regenerate lines to account fo new bounding box\n };\n })(f);\n reader.readAsDataURL(f);\n}", "function loadOBJ(objName, file, material, scale, xOff, yOff, zOff, xRot, yRot, zRot) {\r\n var onProgress = function(query) {\r\n if ( query.lengthComputable ) {\r\n var percentComplete = query.loaded / query.total * 100;\r\n console.log( Math.round(percentComplete, 2) + '% downloaded' );\r\n }\r\n };\r\n var onError = function() {\r\n console.log('Failed to load ' + file);\r\n };\r\n var loader = new THREE.OBJLoader();\r\n loader.load(file, function(object) {\r\n object.traverse(function(child) {\r\n if (child instanceof THREE.Mesh) {\r\n child.material = material;\r\n }\r\n });\r\n object.position.set(xOff,yOff,zOff);\r\n object.rotation.x= xRot;\r\n object.rotation.y = yRot;\r\n object.rotation.z = zRot;\r\n object.scale.set(scale,scale,scale);\r\n object.name = objName;\r\n scene.add(object);\r\n\r\n }, onProgress, onError);\r\n}", "function loadOBJ(objName, file, material, scale, xOff, yOff, zOff, xRot, yRot, zRot) {\r\n var onProgress = function(query) {\r\n if ( query.lengthComputable ) {\r\n var percentComplete = query.loaded / query.total * 100;\r\n console.log( Math.round(percentComplete, 2) + '% downloaded' );\r\n }\r\n };\r\n var onError = function() {\r\n console.log('Failed to load ' + file);\r\n };\r\n var loader = new THREE.OBJLoader();\r\n loader.load(file, function(object) {\r\n object.traverse(function(child) {\r\n if (child instanceof THREE.Mesh) {\r\n child.material = material;\r\n }\r\n });\r\n object.position.set(xOff,yOff,zOff);\r\n object.rotation.x= xRot;\r\n object.rotation.y = yRot;\r\n object.rotation.z = zRot;\r\n object.scale.set(scale,scale,scale);\r\n object.name = objName;\r\n scene.add(object);\r\n\r\n }, onProgress, onError);\r\n}", "function openFile(file) {\n\tlet input = file.target;\n\toutput = document.getElementById('output');\n\tlet preview = document.getElementById('imagepreview');\n\tlet canvas = document.getElementById('canvas');\n\tlet context = canvas.getContext('2d');\n\tlet ctx = preview.getContext('2d');\n\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\tctx.clearRect(0, 0, preview.width, preview.height);\n let reader = new FileReader();\n reader.onload = function(){\n\t\t//reset state from previously loaded image\n\t\tlet dataURL = reader.result;\n\t\toutput.src = dataURL;\n\t\tobjNormals = [];\n\t\tobjVertices = [];\n\t\tobjFaces = [];\n\t\tobjMtl = [];\n\t};\n\tlet nameArr = input.files[0].name.split(\".\");\n\tfileName = nameArr[0];\n\treader.readAsDataURL(input.files[0]);\n\toutput.onload = function(){\n\t\tcanvasPosX = 0;\n\t\tcanvasPosY = 0;\n\t\tcanvasWidth = output.width;\n\t\tcanvasHeight = output.height;\n\t\tpreview.width = canvasWidth;\n\t\tpreview.height = canvasHeight;\n\t\tctx.drawImage(output, canvasPosX, canvasPosY);\n\t\tdocument.getElementById('convert').disabled = false;\n\t\tdocument.getElementById('save').disabled = true;\n\t\tdocument.getElementById('save-label').innerHTML = \"Ready to convert\";\n\t}\n }", "loadObjects (state, file) {\n const loader = new FileLoader(file)\n loader.loadSync()\n Vue.set(state, file, loader.objects)\n }", "function ModelShape(id,shape,shapeUV,posFunction,vtxFunction){this.shapeID=id;this._shape=shape;this._shapeUV=shapeUV;this._positionFunction=posFunction;this._vertexFunction=vtxFunction;}", "function Model(name){\n\tTHREE.Object3D.apply(this, arguments);\n\tvar object = this,\n\t\tloader = new THREE.JSONLoader(),\n\t\tmesh;\n\n\tloader.load(\"./models/\"+name+\"/\"+name+\".js\", function (geometry, materials) {\n\t\t\tmesh = new THREE.Mesh(geometry, new THREE.MeshFaceMaterial( materials ));\n\t\t\tobject.add(mesh);\n\t\t}, \"models/\"+name+\"/\");\n\n\tthis.base = { position : {x:0,y:0,z:0}, rotation : {x:0,y:0,z:0} };\n\tthis.relative = { position : {x:0,y:0,z:0}, rotation : {x:0,y:0,z:0} };\n}", "function fbx_mesh()\n{\n\tthis.id;\n\tthis.model_id;\n\tthis.vertices = new Array();\n\tthis.polygons = new Array();\n\tthis.uvs = new Array();\n\tthis.color = new v4(1.0,1.0,1.0,1.0);\n\tthis.locTrans = new v3(0,0,0);\n\tthis.locRot = new v3(0,0,0);\n\tthis.locScale = new v3(1,1,1);\n\tthis.vertexPosBuffer;\n\tthis.vertexColBuffer;\n\tthis.vertexNormBuffer;\n\tthis.vertexUVBuffer;\n\tthis.material;\n}", "function parseObj(model, lines) {\n // OBJ allows a face to specify an index for a vertex (in the above example),\n // but it also allows you to specify a custom combination of vertex, UV\n // coordinate, and vertex normal. So, \"3/4/3\" would mean, \"use vertex 3 with\n // UV coordinate 4 and vertex normal 3\". In WebGL, every vertex with different\n // parameters must be a different vertex, so loadedVerts is used to\n // temporarily store the parsed vertices, normals, etc., and indexedVerts is\n // used to map a specific combination (keyed on, for example, the string\n // \"3/4/3\"), to the actual index of the newly created vertex in the final\n // object.\n var loadedVerts = {\n v: [],\n vt: [],\n vn: []\n };\n\n var indexedVerts = {};\n\n for (var line = 0; line < lines.length; ++line) {\n // Each line is a separate object (vertex, face, vertex normal, etc)\n // For each line, split it into tokens on whitespace. The first token\n // describes the type.\n var tokens = lines[line].trim().split(/\\b\\s+/);\n\n if (tokens.length > 0) {\n if (tokens[0] === 'v' || tokens[0] === 'vn') {\n // Check if this line describes a vertex or vertex normal.\n // It will have three numeric parameters.\n var vertex = new _main.default.Vector(\n parseFloat(tokens[1]),\n parseFloat(tokens[2]),\n parseFloat(tokens[3])\n );\n\n loadedVerts[tokens[0]].push(vertex);\n } else if (tokens[0] === 'vt') {\n // Check if this line describes a texture coordinate.\n // It will have two numeric parameters.\n var texVertex = [parseFloat(tokens[1]), parseFloat(tokens[2])];\n loadedVerts[tokens[0]].push(texVertex);\n } else if (tokens[0] === 'f') {\n // Check if this line describes a face.\n // OBJ faces can have more than three points. Triangulate points.\n for (var tri = 3; tri < tokens.length; ++tri) {\n var face = [];\n\n var vertexTokens = [1, tri - 1, tri];\n\n for (var tokenInd = 0; tokenInd < vertexTokens.length; ++tokenInd) {\n // Now, convert the given token into an index\n var vertString = tokens[vertexTokens[tokenInd]];\n var vertIndex = 0;\n\n // TODO: Faces can technically use negative numbers to refer to the\n // previous nth vertex. I haven't seen this used in practice, but\n // it might be good to implement this in the future.\n\n if (indexedVerts[vertString] !== undefined) {\n vertIndex = indexedVerts[vertString];\n } else {\n var vertParts = vertString.split('/');\n for (var i = 0; i < vertParts.length; i++) {\n vertParts[i] = parseInt(vertParts[i]) - 1;\n }\n\n vertIndex = indexedVerts[vertString] = model.vertices.length;\n model.vertices.push(loadedVerts.v[vertParts[0]].copy());\n if (loadedVerts.vt[vertParts[1]]) {\n model.uvs.push(loadedVerts.vt[vertParts[1]].slice());\n } else {\n model.uvs.push([0, 0]);\n }\n\n if (loadedVerts.vn[vertParts[2]]) {\n model.vertexNormals.push(loadedVerts.vn[vertParts[2]].copy());\n }\n }\n\n face.push(vertIndex);\n }\n\n if (face[0] !== face[1] && face[0] !== face[2] && face[1] !== face[2]) {\n model.faces.push(face);\n }\n }\n }\n }\n }\n // If the model doesn't have normals, compute the normals\n if (model.vertexNormals.length === 0) {\n model.computeNormals();\n }\n\n return model;\n }", "function setupMesh(filename) {\n //Your code here\n myMesh = new TriMesh();\n myPromise = asyncGetFile(filename);\n myPromise.then((retrievedText) => {\n myMesh.loadFromOBJ(retrievedText);\n })\n .catch(\n (reason) => {\n console.log('Handle rejected promise (' + reason + ') here.');\n });\n}", "function readMesh(file){\n return new Promise((res, rej)=>{\n var mesh = {}\n readFile(file, parseObj) //file.name\n .then((obj_str)=>{\n mesh = obj_str\n prefix = file.split('/')[0]\n return readFile(prefix+'/'+obj_str[\"mtl\"], parseMaterial)\n })\n .then((obj_str2)=>{\n mesh[\"materials\"] = obj_str2\n\n for (const property in mesh[\"materials\"]){\n if(mesh[\"materials\"][property].image !== undefined){\n var t = mesh[\"materials\"][property].image\n mesh[\"materials\"][property].image = file.split(\"/\")[0] + \"/\" + t\n var c = 2\n }\n }\n\n // costruisco mesh\n var temp = new GL_Mesh(mesh[\"vertices\"],mesh[\"texcoord\"],mesh[\"normals\"],\n mesh[\"faces\"],mesh[\"materials\"],mesh[\"gl\"],mesh[\"mode\"])\n\n res(temp)\n })\n })\n}", "function createModel(data) {\r\n\r\n // Define the vertices for the cube.\r\n // Each line represents one vertex \r\n // (x, y, z, u, v)\r\n var vertices = new Float32Array([ \r\n -1.0, -1.0, 1.0, 0.0, 1.0,\r\n 1.0, -1.0, 1.0, 1.0, 1.0,\r\n 1.0, 1.0, 1.0, 1.0, 0.0,\r\n -1.0, 1.0, 1.0, 0.0, 0.0,\r\n\r\n -1.0, -1.0, -1.0, 1.0, 1.0,\r\n -1.0, 1.0, -1.0, 1.0, 0.0,\r\n 1.0, 1.0, -1.0, 0.0, 0.0,\r\n 1.0, -1.0, -1.0, 0.0, 1.0,\r\n\r\n -1.0, 1.0, -1.0, 0.0, 0.0,\r\n -1.0, 1.0, 1.0, 0.0, 1.0,\r\n 1.0, 1.0, 1.0, 1.0, 1.0,\r\n 1.0, 1.0, -1.0, 1.0, 0.0,\r\n\r\n -1.0, -1.0, -1.0, 0.0, 1.0,\r\n 1.0, -1.0, -1.0, 1.0, 1.0,\r\n 1.0, -1.0, 1.0, 1.0, 0.0,\r\n -1.0, -1.0, 1.0, 0.0, 0.0,\r\n\r\n 1.0, -1.0, -1.0, 1.0, 1.0,\r\n 1.0, 1.0, -1.0, 1.0, 0.0,\r\n 1.0, 1.0, 1.0, 0.0, 0.0,\r\n 1.0, -1.0, 1.0, 0.0, 1.0,\r\n\r\n -1.0, -1.0, -1.0, 0.0, 1.0,\r\n -1.0, -1.0, 1.0, 1.0, 1.0,\r\n -1.0, 1.0, 1.0, 1.0, 0.0,\r\n -1.0, 1.0, -1.0, 0.0, 0.0\r\n ]);\r\n\r\n // Define indices for the cube.\r\n // Each line represents one triangle and\r\n // each two lines represent one face of the cube.\r\n var indices = new Uint16Array([\r\n 0, 1, 2,\r\n 2, 3, 0,\r\n\r\n 4, 5, 6,\r\n 6, 7, 4,\r\n\r\n 8, 9, 10,\r\n 10, 11, 8,\r\n\r\n 12, 13, 14,\r\n 14, 15, 12,\r\n\r\n 16, 17, 18,\r\n 18, 19, 16,\r\n\r\n 20, 21, 22,\r\n 22, 23, 20\r\n ]);\r\n\r\n var gl = data.context;\r\n\r\n // store vertices in a buffer\r\n var vertexBufferObject = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBufferObject);\r\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\r\n\r\n // store indices in a buffer\r\n var indexBufferObject = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBufferObject);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);\r\n\r\n // tell shader program where to find the vertex data\r\n var vertexAttribLoc = gl.getAttribLocation(data.pShader, \"aPosition\");\r\n var vertexAttribLocUV = gl.getAttribLocation(data.pShader, \"aUV\");\r\n gl.enableVertexAttribArray(vertexAttribLoc);\r\n gl.enableVertexAttribArray(vertexAttribLocUV);\r\n gl.vertexAttribPointer(vertexAttribLoc, 3, gl.FLOAT, false, 5*4, 0);\r\n gl.vertexAttribPointer(vertexAttribLocUV, 2, gl.FLOAT, false, 5*4, 3*4);\r\n }", "async importPointCloudToPrimitive(uri, options) {\n const basePath = uri.substring(0, uri.lastIndexOf('/')) + '/'; // location of model file as basePath\n const defaultOptions = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].createDefaultGltfOptions();\n if (options && options.files) {\n for (let fileName in options.files) {\n const fileExtension = _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getExtension(fileName);\n if (fileExtension === 'gltf' || fileExtension === 'glb') {\n return await this.__loadFromArrayBuffer(options.files[fileName], defaultOptions, basePath, options).catch((err) => {\n console.log('this.__loadFromArrayBuffer error', err);\n });\n }\n }\n }\n const arrayBuffer = await _misc_DataUtil__WEBPACK_IMPORTED_MODULE_0__[\"default\"].fetchArrayBuffer(uri);\n return this.__decodeDracoDirect(arrayBuffer, options);\n }", "function loadGeometry(animalPath, num) {\n\n var path = './jsModels/' + animalPath + '.js';\n console.log(path);\n var loader = new THREE.JSONLoader();\n THREE.Loader.Handlers.add( /\\.dds$/i, new THREE.DDSLoader() );\n\n loader.load(path, function(g) {\n g.name = animalPath;\n animalGeo[num] = g;\n loadedGeo(num);\n }, onProgress, onError);\n}", "function wa_ImportStlFile(filedata,filename,fProgress,fFail,fDone){\n let basename=filename.toLowerCase().replace(\".stl\",\"\")\n\n //console.log(\"FILEDATA JS PUOLELLA=\"+JSON.stringify(filedata))\n stlModelData[basename]=JSON.parse(wasm_convertStlData(filedata,basename))\n fDone(basename,{\n vertex_filename:basename+\"_vertexes.bin\",\n normal_filename:basename+\"_normals.bin\",\n index_filename:basename+\"_indexes.bin\"\n })\n}", "function addObj(name, x, y, z, Scale) {\n THREE.Loader.Handlers.add(/\\.dds$/i, new THREE.DDSLoader());\n var mtlLoader = new THREE.MTLLoader();\n mtlLoader.setPath('models/');\n mtlLoader.load((name + '.mtl'), function (materials) {\n materials.preload();\n var objLoader = new THREE.OBJLoader();\n objLoader.setMaterials(materials);\n objLoader.setPath('models/');\n objLoader.load((name + '.obj'), function (object) {\n object.position.x = x;\n object.position.y = y;\n object.position.z = z;\n object.scale.x = object.scale.y = object.scale.z = Scale;\n if (name == \"WoodenCabinObj\")\n house = object\n scene.add(object);\n });\n });\n}", "function Shape(oa){\n\t\t// debug('\\n SHAPE - START');\n\t\toa = oa || {};\n\t\tthis.objtype = 'shape';\n\n\t\t// common settings\n\t\tthis.name = oa.name || 'Shape';\n\t\tthis.path = isval(oa.path)? new Path(oa.path) : rectPathFromMaxes(false);\n\t\tthis.visible = isval(oa.visible)? oa.visible : true;\n\t\tthis.xlock = oa.xlock || false;\n\t\tthis.ylock = oa.ylock || false;\n\t\tthis.wlock = oa.wlock || false;\n\t\tthis.hlock = oa.hlock || false;\n\t\tthis.ratiolock = oa.ratiolock || false;\n\n\t\t// debug(' SHAPE - END\\n');\n\t}", "function loadFile(filename) {\n\t//$('#loadingAnimation').show();\t\t\t\t\t\t// show loading animation\n\tvar loader = new THREE.STLLoader();\n\tloader.addEventListener('load', function(event) {\n\t\tvar geometry = event.content;\n\t\tvar material = new THREE.MeshPhongMaterial( { ambient: objectShadowColor, color: objectColor, specular: objectReflectionColor, shininess: 50 } );\n\t\tmodel = new THREE.Mesh(geometry, material);\n\t\tmodel.scale.set(scale, scale, scale);\t\t\t\t// scale to fit\n\t\tTHREE.GeometryUtils.center(geometry);\t\t\t\t// rotate around center (http://stackoverflow.com/a/13587723/1167783)\n\t\tmodel.castShadow = true;\n\t\tmodel.receiveShadow = true;\n\t\tscene.add(model);\n\t});\n\tloader.load('models/' + filename);\t\t// load it!\n\t\n\t//$('#loadingAnimation').hide();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// when done, hide the animation\n\t$('#modelFilename').text(filename.toUpperCase());\t\t\t\t\t\t\t\t\t\t\t\t\t\t// change filename\n\t$('#download').attr('href', 'models/' + filename);\t\t\t\t\t\t\t\t\t\t\t\t\t// download link\n\t$('#download').text('download (' + filesJSON[whichModel].filesize + ')');\t\t// show file size in download link\n\t$('#permalink').attr('href', 'gallery.php#' + filename);\t\t\t\t\t\t\t\t\t\t// change permalink\n}", "function runExampleFile(file) {\n var relPath = path.relative(__dirname, file);\n\n if (!relPath.startsWith('.'))\n relPath = './' + relPath;\n\n var example = require(relPath);\n console.log(\"GO!\");\n var shapes = example();\n console.log(\"SHAPES\", shapes);\n// var faces = shapes.faces();\n var faces = shapes.map(shape => shape.faces ? shape.faces() : [shape])\n .reduce((a, b) => a.concat(b));\n console.log(\"faces\", faces);\n var meshes = faces.map(face => mesh(face, 0.02, 20, true));\n console.log(\"done\");\n\n return JSON.stringify(meshes, replacer);\n}", "function createModelsWithObj(modelDescription, materialsDictionary, out) {\n\n //return value is an object\n //property name comes forom the model's name.\n\n var modelDictionary = {};\n var numberModels = 0;\n\n //All array indexes are empty because OBJ indexes start at 1\n //Arrays of values are usually common throughout all files\n\n var allVertices = [[]];\n var allColors = null;\n var allNormals = [[]];\n var avrNormals = null;\n var allTextureCoords = [[]];\n \n //instance\n //Model being defined, Objs can define more then one model\n var currentModel = null;\n\n //If state is active\n var smoothShading = false;\n var materialName = null;\n var colorIndex = 0;\n\n //Collecting data for scratch var\n var startLineIndexes = new Array(3);\n var endLineIndexes = new Array(3);\n var vector = new loadingObj_vector3();\n var vertexIndexes = new Array(3);\n\n //Lines segments --- allowing normal vectors to be created\n var create_visible_normals = false;\n\n function colorsFromMaterials() {\n var material, name, number_colors, index;\n if (Object.keys(materialsDictionary).length > 0) {\n number_colors = Object.keys(materialsDictionary).length;\n all_colors = new Array(number_colors);\n for (name in materialsDictionary) {\n material = materialsDictionary[name];\n if (material.hasOwnProperty('Kd')) {\n index = material.index;\n all_colors[index] = material.Kd;\n }\n }\n\n }\n }\n\n function parsingPoints(sp) {\n var index;\n\n if (currentModel.points === null) {\n currentModel.points = new PointsData();\n currentModel.points.material = materialsDictionary[materialName];\n }\n\n //Aquires the indexes of the vertices that define the point(s)\n index = sp.getWord();\n while (index) {\n //Add a point to model def\n currentModel.points.vertices.push(index);\n currentModel.points.colors.push(colorIndex);\n \n index = sp.getWord();\n }\n }\n \n function parsingLines(sp) {\n if (currentModel.lines === null) {\n currentModel.lines = new LinesData();\n currentModel.lines.material = materialsDictionary[materialName];\n }\n\n // Get indexes of vertices that define point/points\n sp.getIndexes(startLineIndexes);\n while (sp.getIndexes(endLineIndexes)) {\n // Adds a line to the model def\n currentModel.lines.vertices.push(startLineIndexes[0]);\n currentModel.lines.vertices.push(endLineIndexes[0]);\n currentModel.lines.colors.push(colorIndex);\n currentModel.lines.colors.push(colorIndex);\n if (startLineIndexes[1] !== null && startLineIndexes[1] >= 0) {\n currentModel.lines.texture.push(startLineIndexes[1]);\n currentModel.lines.texture.push(endLineIndexes);\n }\n\n startLineIndexes[0] = endLineIndexes[0];\n startLineIndexes[1] = endLineIndexes[1];\n }\n }\n\n function parsingFaces(sp) {\n var indexList, numberTriangles, triangles, n, edge1, edge2, normal, normalIndex;\n\n if(currentModel.triangles === null) {\n currentModel.triangles = new TrianglesData();\n currentModel.triangles.material = materialsDictionary[materialName];\n }\n\n triangles = currentModel.triangles;\n\n //indexes of vertices that define the face\n indexList = [];\n while (sp.getIndexes(vertexIndexes)) {\n indexList.push(vertexIndexes.slice());\n }\n\n //Creates triangles for faces\n numberTriangles = indexList.length - 2;\n n = 1;\n while (n <= numberTriangles) {\n triangles.vertices.push(indexList[0][0]);\n triangles.vertices.push(indexList[n][0]);\n triangles.vertices.push(indexList[n + 1]);\n\n triangles.colors.push(colorIndex);\n triangels.color.push(colorIndex);\n triangles.colors.push(colorIndex);\n\n if (indexList[0][1] > -1) {\n triangles.textures.push(indexList[0][1]);\n triangles.textures.push(indexList[n][1]);\n triangles.textures.push(indexList[n + 1][1]);\n }\n\n\n // The normal vectors are set:\n // If normal vectors are included in the OBJ file: use the file data\n // If normal vectors not in OBJ data:\n // the flat_normal is set to the calculated face normal.\n // the smooth_normals is set to an average normal if smoothing is on.\n\n if(indexList[0][2] === -1) {\n\n // There was no normal vector in the OBJ file; calculate a normal vector\n // using a counter-clockwise vertex winding.\n // Only calculate one normal for faces with more than 3 vertices\n \n if (n === 1) {\n edge1 = vector.createFrom2Points(allVertices[indexList[0][0]], allVertices[indexList[n][0]]);\n edge2 = vector.createFrom2Points(allVertices[indexList[n][0]], allVertices[indexList[n + 1][0]]);\n normal = new Float32Array(3);\n vector.crossProduct(normal, edge1, edge2);\n vector.normalize(normal);\n\n allNormals.push(normal);\n normalIndex = allNormals.length -1;\n }\n\n triangles.flat_normal.push(normalIndex);\n triangles.flat_normal.push(normalIndex);\n triangles.flat_normal.push(normalIndex);\n\n if (smoothShading) {\n //indexes point to vertex so average normal vector can be accessed at another point\n triangles.smooth.normals.push(-indexList[0][0]);\n triangles.smooth.normals.push(-indexList[n][0]);\n triangles.smooth.normals.push(-indexList[n + 1][0]);\n } else {\n triangles.smooth.normals.push(normalIndex);\n triangles.smooth.normals.push(normalIndex);\n triangles.smooth.normals.push(normalIndex);\n }\n\n } else {\n // Use normal vector from the obj file\n triangles.flat_normal.push(indexList[0][2]);\n triangles.flat_normal.push(indexList[n][2]);\n triangles.flat_normal.push(indexList[n + 1][2]);\n\n triangles.smooth_normal.push(indexList[0][2]);\n triangles.smooth_normal.push(indexList[n][2]);\n triangles.smooth_normal.push(indexList[n + 1][2]);\n }\n n += 1 //for more then one triangle\n }\n }\n\n function ParsingObjLines() {\n var sp, lines, whichLine, command, modelName, currentModelFile, vertices, x, y, z, dotPosition, dx, dy, dz, u, v, coords, normal;\n\n //Creating StringParser\n sp = new StringParser();\n\n //breaks up the input into different lines of text\n lines = modelDescription.split('\\n');\n\n //vertices are broken into sections, this is for each model, face indexes for vertices are global for the vertex list. TODO Keep a single list of vertices for all models.\n vertices = [];\n\n //OBJ vertices are indexed starting at the number one, remember that it is not 0\n verticess.push([]); //empty vertex for [0]\n\n for (whichLine = 0; whichLine < lines.length; whichLine += 1) {\n sp.init(lines[whichLine]);\n command = sp.getWord();\n\n if (command) {\n switch (command) {\n case '#':\n break; \n\n case 'mtllib': //save material data filename for later\n currentMaterialFiles = sp.getWord();\n //Removing the filename extention\n dotPosition = currentMaterialFiles.lastIndexOf('.');\n if (dotPosition > 0) {\n currentMaterialFiles = currentMaterialFiles.substr(0, dotPosition);\n }\n break;\n }\n }\n }\n }\n}", "load(file) {\n this._loading = file;\n\n // Read file and split into lines\n const map = {};\n\n const content = fs.readFileSync(file, 'ascii');\n const lines = content.split(/[\\r\\n]+/);\n\n lines.forEach(line => {\n // Clean up whitespace/comments, and split into fields\n const fields = line.replace(/\\s*#.*|^\\s*|\\s*$/g, '').split(/\\s+/);\n map[fields.shift()] = fields;\n });\n\n this.define(map);\n\n this._loading = null;\n }", "constructor(data) {\n // Use empty object when no data are provided\n data = data || {};\n\n /** @type {String} Shape ID can be one of OTZSILJ */\n this.id = data.id || Shape.randomId;\n\n /** @type {Number} Shape orientation */\n this.orientation = data.orientation || 0;\n\n /** @type {Number} Shape's horizontal position */\n this.x = data.x || 0;\n\n /** @type {Number} Shape's vertical position */\n this.y = data.y || 0;\n }", "function loadModels() {\n\n //inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\"); // read in the triangle data\n var data = ' [\\n' +\n // player\n ' {\"material\": {\"diffuse\": [0.6,0.3,0.0]}, \\n' +\n ' \"vertices\": [[0.5,0.8,0.02],[0.52,0.8,0.02],[0.52,0.82,0.02],[0.5,0.82,0.02],[0.5,0.8,0.01],[0.52,0.8,0.01],[0.52,0.82,0.01],[0.5,0.82,0.01]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // robot\n ' {\"material\": {\"diffuse\": [0.6,0.6,0.6]}, \\n' +\n ' \"vertices\": [[0.7,0.7,0.02],[0.73,0.7,0.02],[0.73,0.73,0.02],[0.7,0.73,0.02],[0.7,0.7,0.008],[0.73,0.7,0.008],[0.73,0.73,0.008],[0.7,0.73,0.008]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // robot\n ' {\"material\": {\"diffuse\": [0.6,0.6,0.6]}, \\n' +\n ' \"vertices\": [[0.7,0.7,0.02],[0.73,0.7,0.02],[0.73,0.73,0.02],[0.7,0.73,0.02],[0.7,0.7,0.008],[0.73,0.7,0.008],[0.73,0.73,0.008],[0.7,0.73,0.008]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // robot\n ' {\"material\": {\"diffuse\": [0.6,0.6,0.6]}, \\n' +\n ' \"vertices\": [[0.7,0.7,0.02],[0.73,0.7,0.02],[0.73,0.73,0.02],[0.7,0.73,0.02],[0.7,0.7,0.008],[0.73,0.7,0.008],[0.73,0.73,0.008],[0.7,0.73,0.008]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // robot\n ' {\"material\": {\"diffuse\": [0.6,0.6,0.6]}, \\n' +\n ' \"vertices\": [[0.7,0.7,0.02],[0.73,0.7,0.02],[0.73,0.73,0.02],[0.7,0.73,0.02],[0.7,0.7,0.008],[0.73,0.7,0.008],[0.73,0.73,0.008],[0.7,0.73,0.008]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // player's bullet\n ' {\"material\": {\"diffuse\": [0.8,0.6,0]}, \\n' +\n ' \"vertices\": [[0.501,0.801,0.0182],[0.509,0.801,0.0182],[0.509,0.809,0.0182],[0.501,0.809,0.0182],[0.501,0.801,0.019],[0.509,0.801,0.019],[0.501,0.809,0.019],[0.501,0.809,0.019]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // robot's bullet\n ' {\"material\": {\"diffuse\": [1.0,1.0,0.5]}, \\n' +\n ' \"vertices\": [[0.711,0.711,0.0182],[0.719,0.711,0.0182],[0.719,0.719,0.0182],[0.711,0.719,0.0182],[0.711,0.711,0.019],[0.719,0.711,0.019],[0.719,0.719,0.019],[0.711,0.719,0.019]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // robot's bullet\n ' {\"material\": {\"diffuse\": [1.0,1.0,0.5]}, \\n' +\n ' \"vertices\": [[0.711,0.711,0.0182],[0.719,0.711,0.0182],[0.719,0.719,0.0182],[0.711,0.719,0.0182],[0.711,0.711,0.019],[0.719,0.711,0.019],[0.719,0.719,0.019],[0.711,0.719,0.019]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // robot's bullet\n ' {\"material\": {\"diffuse\": [1.0,1.0,0.5]}, \\n' +\n ' \"vertices\": [[0.711,0.711,0.0182],[0.719,0.711,0.0182],[0.719,0.719,0.0182],[0.711,0.719,0.0182],[0.711,0.711,0.019],[0.719,0.711,0.019],[0.719,0.719,0.019],[0.711,0.719,0.019]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // robot's bullet\n ' {\"material\": {\"diffuse\": [1.0,1.0,0.5]}, \\n' +\n ' \"vertices\": [[0.711,0.711,0.0182],[0.719,0.711,0.0182],[0.719,0.719,0.0182],[0.711,0.719,0.0182],[0.711,0.711,0.019],[0.719,0.711,0.019],[0.719,0.719,0.019],[0.711,0.719,0.019]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // right wall\n ' {\"material\": {\"diffuse\": [0.0,0.0,0.6]}, \\n' +\n ' \"vertices\": [[0.01, 0.01, 0],[0.03, 0.01, 0],[0.03,0.99,0],[0.01,0.99,0],[0.01, 0.01, 0.02],[0.03, 0.01, 0.02],[0.03,0.99,0.02],[0.01,0.99,0.02]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // left wall\n ' {\"material\": {\"diffuse\": [0.0,0.0,0.6]}, \\n' +\n ' \"vertices\": [[0.97,0.01,0],[0.99,0.01,0],[0.99,0.99,0],[0.97,0.99,0],[0.97,0.01,0.02],[0.99,0.01,0.02],[0.99,0.99,0.02],[0.97,0.99,0.02]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // top wall\n ' {\"material\": {\"diffuse\": [0.0,0.0,0.6]}, \\n' +\n ' \"vertices\": [[0.01,0.97,0],[0.99,0.97,0],[0.99,0.99,0],[0.01,0.99,0],[0.01,0.97,0.02],[0.99,0.97,0.02],[0.99,0.99,0.02],[0.01,0.99,0.02]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // bottom right wall\n ' {\"material\": {\"diffuse\": [0.0,0.0,0.6]}, \\n' +\n ' \"vertices\": [[0.01,0.01,0],[0.3,0.01,0],[0.3,0.03,0],[0.01,0.03,0],[0.01,0.01,0.02],[0.3,0.01,0.02],[0.3,0.03,0.02],[0.01,0.03,0.02]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // bottom left wall\n ' {\"material\": {\"diffuse\": [0.0,0.0,0.6]}, \\n' +\n ' \"vertices\": [[0.7,0.01,0],[0.99,0.01,0],[0.99,0.03,0],[0.7,0.03,0],[0.7,0.01,0.02],[0.99,0.01,0.02],[0.99,0.03,0.02],[0.7,0.03,0.02]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // middle horizontal wall\n ' {\"material\": {\"diffuse\": [0.0,0.0,0.6]}, \\n' +\n ' \"vertices\": [[0.2,0.48,0],[0.8,0.48,0],[0.8,0.52,0],[0.2,0.52,0],[0.2,0.48,0.02],[0.8,0.48,0.02],[0.8,0.52,0.02],[0.2,0.52,0.02]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // left inner wall\n ' {\"material\": {\"diffuse\": [0.0,0.0,0.6]}, \\n' +\n ' \"vertices\": [[0.78,0.35,0],[0.8,0.35,0],[0.8,0.65,0],[0.78,0.65,0],[0.78,0.35,0.02],[0.8,0.35,0.02],[0.8,0.65,0.02],[0.78,0.65,0.02]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] },\\n' +\n // right inner wall\n ' {\"material\": {\"diffuse\": [0.0,0.0,0.6]}, \\n' +\n ' \"vertices\": [[0.2,0.35,0],[0.22,0.35,0],[0.22,0.65,0],[0.2,0.65,0],[0.2,0.35,0.02],[0.22,0.35,0.02],[0.22,0.65,0.02],[0.2,0.65,0.02]],\\n' +\n ' \"triangles\": [[0,1,2],[2,3,0],[4,5,6],[6,7,4],[3,2,6],[6,7,3],[5,1,0],[0,4,5],[1,5,6],[6,2,1],[0,3,7],[7,4,0]] }\\n' +\n ']';\n\n inputTriangles = JSON.parse(data);\n\n try {\n if (inputTriangles == String.null)\n throw \"Unable to load triangles file!\";\n else {\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var vtxToAdd; // vtx coords to add to the coord array\n var normToAdd; // vtx normal to add to the coord array\n var triToAdd; // tri indices to add to the index array\n var maxCorner = vec3.fromValues(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE); // bbox corner\n var minCorner = vec3.fromValues(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE); // other corner\n \n // process each triangle set to load webgl vertex and triangle buffers\n numTriangleSets = inputTriangles.length; // remember how many tri sets\n for (var whichSet=0; whichSet<numTriangleSets; whichSet++) { // for each tri set\n transformMatrix.push(mat4.create());\n\n // set up hilighting, modeling translation and rotation\n inputTriangles[whichSet].center = vec3.fromValues(0,0,0); // center point of tri set\n inputTriangles[whichSet].on = false; // not highlighted\n inputTriangles[whichSet].translation = vec3.fromValues(0,0,0); // no translation\n inputTriangles[whichSet].xAxis = vec3.fromValues(1,0,0); // model X axis\n inputTriangles[whichSet].yAxis = vec3.fromValues(0,1,0); // model Y axis \n\n // set up the vertex and normal arrays, define model center and axes\n inputTriangles[whichSet].glVertices = []; // flat coord list for webgl\n var numVerts = inputTriangles[whichSet].vertices.length; // num vertices in tri set\n for (whichSetVert=0; whichSetVert<numVerts; whichSetVert++) { // verts in set\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert]; // get vertex to add\n inputTriangles[whichSet].glVertices.push(vtxToAdd[0],vtxToAdd[1],vtxToAdd[2]); // put coords in set coord list\n vec3.max(maxCorner,maxCorner,vtxToAdd); // update world bounding box corner maxima\n vec3.min(minCorner,minCorner,vtxToAdd); // update world bounding box corner minima\n vec3.add(inputTriangles[whichSet].center,inputTriangles[whichSet].center,vtxToAdd); // add to ctr sum\n } // end for vertices in set\n vec3.scale(inputTriangles[whichSet].center,inputTriangles[whichSet].center,1/numVerts); // avg ctr sum\n\n // send the vertex coords and normals to webGL\n vertexBuffers[whichSet] = gl.createBuffer(); // init empty webgl set vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].glVertices),gl.STATIC_DRAW); // data in\n \n // set up the triangle index array, adjusting indices across sets\n inputTriangles[whichSet].glTriangles = []; // flat index list for webgl\n triSetSizes[whichSet] = inputTriangles[whichSet].triangles.length; // number of tris in this set\n for (whichSetTri=0; whichSetTri<triSetSizes[whichSet]; whichSetTri++) {\n triToAdd = inputTriangles[whichSet].triangles[whichSetTri]; // get tri to add\n inputTriangles[whichSet].glTriangles.push(triToAdd[0],triToAdd[1],triToAdd[2]); // put indices in set list\n } // end for triangles in set\n\n // send the triangle indices to webGL\n triangleBuffers.push(gl.createBuffer()); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(inputTriangles[whichSet].glTriangles),gl.STATIC_DRAW); // data in\n\n } // end for each triangle set \n \tvar temp = vec3.create();\n \tviewDelta = vec3.length(vec3.subtract(temp,maxCorner,minCorner)) / 100; // set global\n\n } // end if triangle file loaded\n\n // move robots to different positions\n var temp = mat4.create();\n mat4.fromTranslation(temp,vec3.fromValues(-0.5,-0.6,0));\n mat4.multiply(transformMatrix[2],transformMatrix[2],temp);\n mat4.multiply(transformMatrix[7],transformMatrix[7],temp);\n\n var temp = mat4.create();\n mat4.fromTranslation(temp,vec3.fromValues(-0.4,0.1,0));\n mat4.multiply(transformMatrix[3],transformMatrix[3],temp);\n mat4.multiply(transformMatrix[8],transformMatrix[8],temp);\n\n var temp = mat4.create();\n mat4.fromTranslation(temp,vec3.fromValues(-0.1,-0.4,0));\n mat4.multiply(transformMatrix[4],transformMatrix[4],temp);\n mat4.multiply(transformMatrix[9],transformMatrix[9],temp);\n\n\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end load models", "function Shape3(){}", "async load (filePath) {\n console.log(`Deserializing from ${filePath}`)\n this.data = this.formatStrategy.deserialize(\n await fs.readFile(filePath, 'utf-8')\n )\n }", "function objFunc(data) {\n\n //parse color set for list of vertex\n if (data.substr(0,7) == \"usemtl \") {\n\n //sets current color array from material list object\n currentBufferMaterial = data.slice(7);\n currentDiffuseColor = materialList[currentBufferMaterial] \n //takes the current color array and adds it to the vertex color array \n //does it for each vertex that has been added\n //this is because obj files give off vertex -> color -> faces in that order\n //this matches the position and color together \n \n \n// for (var i = 0; i < currentVertexCount; i++){\n// vertexDiffuseColor = vertexDiffuseColor.concat(currentDiffuseColor);\n// }\n// \n// currentVertexCount = 0; //resets counter \n \n \n } //parses vertexs\n else if (data.substr(0,2) == \"v \") {\n indexSpace1 = data.indexOf(\" \",2);\n indexSpace2 = data.indexOf(\" \",indexSpace1 + 1);\n\n buffer_vertexPositions.push(parseFloat(data.substring(2, indexSpace1)));\n buffer_vertexPositions.push(parseFloat(data.substring(indexSpace1 + 1, indexSpace2)));\n buffer_vertexPositions.push(parseFloat(data.substring(indexSpace2 + 1)));\n \n // currentVertexCount++;\n \n \n } //parse normals\n else if (data.substr(0,3) == \"vn \") {\n \n //vertex normals are given per vertx in face\n //this means either 3 or 4 will be given per set of vertx on a face\n //because we are using flat faces they are all the same\n \n indexSpace1 = data.indexOf(\" \",3);\n indexSpace2 = data.indexOf(\" \",indexSpace1 + 1);\n\n buffer_vertexNormals.push(parseFloat(data.substring(3, indexSpace1)));\n buffer_vertexNormals.push(parseFloat(data.substring(indexSpace1 + 1, indexSpace2)));\n buffer_vertexNormals.push(parseFloat(data.substring(indexSpace2 + 1)));\n \n \n \n\n } //parse textures\n else if (data.substr(0,3) == \"vt \") {\n \n indexSpace1 = data.indexOf(\" \",3);\n// indexSpace2 = data.indexOf(\" \",indexSpace1 + 1);\n\n buffer_vertexColors.push(parseFloat(data.substring(3, indexSpace1)));\n buffer_vertexColors.push(parseFloat(data.substring(indexSpace1 + 1)));\n \n \n \n\n }//parse indices\n else if (data.substr(0,2) == \"f \") {\n \n var triSet = data.substring(2).split(\" \");\n for (var j = 0; j < 3; j++) {\n var triSubset = triSet[j].split(\"/\"); \n vertexPositions.push(buffer_vertexPositions[ 3 * (parseInt(triSubset[0])-1) ]);\n vertexPositions.push(buffer_vertexPositions[ 3 * (parseInt(triSubset[0])-1) + 1 ]);\n vertexPositions.push(buffer_vertexPositions[ 3 * (parseInt(triSubset[0])-1) + 2 ]);\n vertexNormals.push(buffer_vertexNormals[ 3 * (parseInt(triSubset[2])-1) ]);\n vertexNormals.push(buffer_vertexNormals[ 3 * (parseInt(triSubset[2])-1) + 1 ]);\n vertexNormals.push(buffer_vertexNormals[ 3 * (parseInt(triSubset[2])-1) + 2 ]);\n vertexColors.push(buffer_vertexColors[ 2 * (parseInt(triSubset[1])-1) ]);\n vertexColors.push(buffer_vertexColors[ 2 * (parseInt(triSubset[1])-1) + 1 ]);\n \n vertexDiffuseColor.push(currentDiffuseColor[0]);\n vertexDiffuseColor.push(currentDiffuseColor[1]);\n vertexDiffuseColor.push(currentDiffuseColor[2]);\n }\n vertexIndices.push(3 * faceIndex);\n vertexIndices.push(3 * faceIndex + 1);\n vertexIndices.push(3 * faceIndex + 2);\n \n \n //for Quads we need to add extra face\n //if \n // f 1 2 3 4\n // we need 1, 2, 3 and 1, 3, 4\n \n if (triSet.length == 4 ) {\n for (var j = 0; j < 4; j++) {\n if (j == 1) continue;\n var triSubset = triSet[j].split(\"/\"); \n vertexPositions.push(buffer_vertexPositions[ 3 * (parseInt(triSubset[0])-1) ]);\n vertexPositions.push(buffer_vertexPositions[ 3 * (parseInt(triSubset[0])-1) + 1 ]);\n vertexPositions.push(buffer_vertexPositions[ 3 * (parseInt(triSubset[0])-1) + 2 ]);\n vertexNormals.push(buffer_vertexNormals[ 3 * (parseInt(triSubset[2])-1) ]);\n vertexNormals.push(buffer_vertexNormals[ 3 * (parseInt(triSubset[2])-1) + 1 ]);\n vertexNormals.push(buffer_vertexNormals[ 3 * (parseInt(triSubset[2])-1) + 2 ]);\n vertexColors.push(buffer_vertexColors[ 2 * (parseInt(triSubset[1])-1) ]);\n vertexColors.push(buffer_vertexColors[ 2 * (parseInt(triSubset[1])-1) + 1 ]);\n \n vertexDiffuseColor.push(currentDiffuseColor[0]);\n vertexDiffuseColor.push(currentDiffuseColor[1]);\n vertexDiffuseColor.push(currentDiffuseColor[2]);\n }\n vertexIndices.push(3 * faceIndex);\n vertexIndices.push(3 * faceIndex + 1);\n vertexIndices.push(3 * faceIndex + 2);\n vertexDiffuseColor.concat(currentDiffuseColor);\n }\n\n \n\n //All faces are orderd by vertex normal index order\n //as why stated in the \"vn\" section need to check for 3 or 4 vn\n\n } \n \n}", "function ShpRecordClass(type) {\n var hasBounds = ShpType.hasBounds(type),\n hasParts = ShpType.isMultiPartType(type),\n hasZ = ShpType.isZType(type),\n hasM = ShpType.isMType(type),\n singlePoint = !hasBounds,\n mzRangeBytes = singlePoint ? 0 : 16,\n constructor, proto;\n\n // @bin is a BinArray set to the first data byte of a shape record\n constructor = function ShapeRecord(bin, bytes) {\n var pos = bin.position();\n this.id = bin.bigEndian().readUint32();\n this.type = bin.littleEndian().skipBytes(4).readUint32();\n if (this.type === 0 || type === 0) {\n return getNullRecord(this.id);\n }\n if (bytes > 0 !== true || (this.type != type && this.type !== 0)) {\n error(\"Unable to read a shape -- .shp file may be corrupted\");\n }\n this.byteLength = bytes; // bin.readUint32() * 2 + 8; // bytes in content section + 8 header bytes\n if (singlePoint) {\n this.pointCount = 1;\n this.partCount = 1;\n } else {\n bin.skipBytes(32); // skip bbox\n this.partCount = hasParts ? bin.readUint32() : 1;\n this.pointCount = bin.readUint32();\n }\n this._data = function() {\n return bin.position(pos);\n };\n };\n\n // base prototype has methods shared by all Shapefile types except NULL type\n // (Type-specific methods are mixed in below)\n var baseProto = {\n // return offset of [x, y] point data in the record\n _xypos: function() {\n var offs = 12; // skip header & record type\n if (!singlePoint) offs += 4; // skip point count\n if (hasBounds) offs += 32;\n if (hasParts) offs += 4 * this.partCount + 4; // skip part count & index\n return offs;\n },\n\n readCoords: function() {\n if (this.pointCount === 0) return null;\n var partSizes = this.readPartSizes(),\n xy = this._data().skipBytes(this._xypos());\n\n return partSizes.map(function(pointCount) {\n return xy.readFloat64Array(pointCount * 2);\n });\n },\n\n readXY: function() {\n if (this.pointCount === 0) return new Float64Array(0);\n return this._data().skipBytes(this._xypos()).readFloat64Array(this.pointCount * 2);\n },\n\n readPoints: function() {\n var xy = this.readXY(),\n zz = hasZ ? this.readZ() : null,\n mm = hasM && this.hasM() ? this.readM() : null,\n points = [], p;\n\n for (var i=0, n=xy.length / 2; i<n; i++) {\n p = [xy[i*2], xy[i*2+1]];\n if (zz) p.push(zz[i]);\n if (mm) p.push(mm[i]);\n points.push(p);\n }\n return points;\n },\n\n // Return an array of point counts in each part\n // Parts containing zero points are skipped (Shapefiles with zero-point\n // parts are out-of-spec but exist in the wild).\n readPartSizes: function() {\n var sizes = [];\n var partLen, startId, bin;\n if (this.pointCount === 0) {\n // no parts\n } else if (this.partCount == 1) {\n // single-part type or multi-part type with one part\n sizes.push(this.pointCount);\n } else {\n // more than one part\n startId = 0;\n bin = this._data().skipBytes(56); // skip to second entry in part index\n for (var i=0, n=this.partCount; i<n; i++) {\n partLen = (i < n - 1 ? bin.readUint32() : this.pointCount) - startId;\n if (partLen > 0) {\n sizes.push(partLen);\n startId += partLen;\n }\n }\n }\n return sizes;\n }\n };\n\n var singlePointProto = {\n read: function() {\n var n = 2;\n if (hasZ) n++;\n if (this.hasM()) n++;\n return this._data().skipBytes(12).readFloat64Array(n);\n },\n\n stream: function(sink) {\n var src = this._data().skipBytes(12);\n sink.addPoint(src.readFloat64(), src.readFloat64());\n sink.endPath();\n }\n };\n\n var multiCoordProto = {\n readBounds: function() {\n return this._data().skipBytes(12).readFloat64Array(4);\n },\n\n stream: function(sink) {\n var sizes = this.readPartSizes(),\n xy = this.readXY(),\n i = 0, j = 0, n;\n while (i < sizes.length) {\n n = sizes[i];\n while (n-- > 0) {\n sink.addPoint(xy[j++], xy[j++]);\n }\n sink.endPath();\n i++;\n }\n if (xy.length != j) error('Counting error');\n },\n\n // TODO: consider switching to this simpler functino\n stream2: function(sink) {\n var sizes = this.readPartSizes(),\n bin = this._data().skipBytes(this._xypos()),\n i = 0, n;\n while (i < sizes.length) {\n n = sizes[i];\n while (n-- > 0) {\n sink.addPoint(bin.readFloat64(), bin.readFloat64());\n }\n sink.endPath();\n i++;\n }\n },\n\n read: function() {\n var parts = [],\n sizes = this.readPartSizes(),\n points = this.readPoints();\n for (var i=0, n = sizes.length - 1; i<n; i++) {\n parts.push(points.splice(0, sizes[i]));\n }\n parts.push(points);\n return parts;\n }\n };\n\n var mProto = {\n _mpos: function() {\n var pos = this._xypos() + this.pointCount * 16;\n if (hasZ) {\n pos += this.pointCount * 8 + mzRangeBytes;\n }\n return pos;\n },\n\n readMBounds: function() {\n return this.hasM() ? this._data().skipBytes(this._mpos()).readFloat64Array(2) : null;\n },\n\n // TODO: group into parts, like readCoords()\n readM: function() {\n return this.hasM() ? this._data().skipBytes(this._mpos() + mzRangeBytes).readFloat64Array(this.pointCount) : null;\n },\n\n // Test if this record contains M data\n // (according to the Shapefile spec, M data is optional in a record)\n //\n hasM: function() {\n var bytesWithoutM = this._mpos(),\n bytesWithM = bytesWithoutM + this.pointCount * 8 + mzRangeBytes;\n if (this.byteLength == bytesWithoutM) {\n return false;\n } else if (this.byteLength == bytesWithM) {\n return true;\n } else {\n error(\"#hasM() Counting error\");\n }\n }\n };\n\n var zProto = {\n _zpos: function() {\n return this._xypos() + this.pointCount * 16;\n },\n\n readZBounds: function() {\n return this._data().skipBytes(this._zpos()).readFloat64Array(2);\n },\n\n // TODO: group into parts, like readCoords()\n readZ: function() {\n return this._data().skipBytes(this._zpos() + mzRangeBytes).readFloat64Array(this.pointCount);\n }\n };\n\n if (type === 0) {\n proto = {};\n } else if (singlePoint) {\n proto = Object.assign(baseProto, singlePointProto);\n } else {\n proto = Object.assign(baseProto, multiCoordProto);\n }\n if (hasZ) Object.assign(proto, zProto);\n if (hasM) Object.assign(proto, mProto);\n\n constructor.prototype = proto;\n proto.constructor = constructor;\n return constructor;\n }", "function Object_3D_JSON(){ \n\n // instantiate a loader\n this._loader = new THREE.JSONLoader();\n \n\n \n}", "function loadModels() {\n try {\n if (inputTriangles == String.null)\n throw \"Unable to load triangles file!\";\n else {\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var vtxToAdd; // vtx coords to add to the coord array\n var normToAdd; // vtx normal to add to the coord array\n var triToAdd; // tri indices to add to the index array\n var maxCorner = vec3.fromValues(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE); // bbox corner\n var minCorner = vec3.fromValues(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE); // other corner\n \n // process each triangle set to load webgl vertex and triangle buffers\n for (var whichSet=0; whichSet<inputTriangles.length; whichSet++) { // for each tri set\n // set up hilighting, modeling translation and rotation\n inputTriangles[whichSet].center = vec3.fromValues(0,0,0); // center point of tri set\n inputTriangles[whichSet].on = false; // not highlighted\n inputTriangles[whichSet].translation = vec3.fromValues(0,0,0); // no translation\n inputTriangles[whichSet].xAxis = vec3.fromValues(1,0,0); // model X axis\n inputTriangles[whichSet].yAxis = vec3.fromValues(0,1,0); // model Y axis \n\n // set up the vertex and normal arrays, define model center and axes\n inputTriangles[whichSet].glVertices = []; // flat coord list for webgl\n inputTriangles[whichSet].glNormals = []; // flat normal list for webgl\n inputTriangles[whichSet].imageReady = false; // whether its image is loaded or not\n var numVerts = inputTriangles[whichSet].vertices.length; // num vertices in tri set\n for (whichSetVert=0; whichSetVert<numVerts; whichSetVert++) { // verts in set\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert]; // get vertex to add\n normToAdd = inputTriangles[whichSet].normals[whichSetVert]; // get normal to add\n inputTriangles[whichSet].glVertices.push(vtxToAdd[0],vtxToAdd[1],vtxToAdd[2]); // put coords in set coord list\n inputTriangles[whichSet].glNormals.push(normToAdd[0],normToAdd[1],normToAdd[2]); // put normal in set coord list\n vec3.max(maxCorner,maxCorner,vtxToAdd); // update world bounding box corner maxima\n vec3.min(minCorner,minCorner,vtxToAdd); // update world bounding box corner minima\n vec3.add(inputTriangles[whichSet].center,inputTriangles[whichSet].center,vtxToAdd); // add to ctr sum\n } // end for vertices in set\n vec3.scale(inputTriangles[whichSet].center,inputTriangles[whichSet].center,1/numVerts); // avg ctr sum\n\n // send the vertex coords and normals to webGL\n vertexBuffers[whichSet] = gl.createBuffer(); // init empty webgl set vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].glVertices),gl.STATIC_DRAW); // data in\n normalBuffers[whichSet] = gl.createBuffer(); // init empty webgl set normal component buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].glNormals),gl.STATIC_DRAW); // data in\n\n\n // set up the triangle index array, adjusting indices across sets\n inputTriangles[whichSet].glTriangles = []; // flat index list for webgl\n triSetSizes[whichSet] = inputTriangles[whichSet].triangles.length; // number of tris in this set\n for (whichSetTri=0; whichSetTri<triSetSizes[whichSet]; whichSetTri++) {\n triToAdd = inputTriangles[whichSet].triangles[whichSetTri]; // get tri to add\n inputTriangles[whichSet].glTriangles.push(triToAdd[0],triToAdd[1],triToAdd[2]); // put indices in set list\n } // end for triangles in set\n\n // send the triangle indices to webGL\n triangleBuffers.push(gl.createBuffer()); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(inputTriangles[whichSet].glTriangles),gl.STATIC_DRAW); // data in\n\n } // end for each triangle set \n } // end if triangle file loaded\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end load models", "function ShpRecordClass(type) {\n var hasBounds = ShpType.hasBounds(type),\n hasParts = ShpType.isMultiPartType(type),\n hasZ = ShpType.isZType(type),\n hasM = ShpType.isMType(type),\n singlePoint = !hasBounds,\n mzRangeBytes = singlePoint ? 0 : 16,\n constructor;\n\n if (type === 0) {\n return NullRecord;\n }\n\n // @bin is a BinArray set to the first data byte of a shape record\n constructor = function ShapeRecord(bin, bytes) {\n var pos = bin.position();\n this.id = bin.bigEndian().readUint32();\n this.type = bin.littleEndian().skipBytes(4).readUint32();\n if (this.type === 0) {\n return new NullRecord();\n }\n if (bytes > 0 !== true || (this.type != type && this.type !== 0)) {\n error(\"Unable to read a shape -- .shp file may be corrupted\");\n }\n this.byteLength = bytes; // bin.readUint32() * 2 + 8; // bytes in content section + 8 header bytes\n if (singlePoint) {\n this.pointCount = 1;\n this.partCount = 1;\n } else {\n bin.skipBytes(32); // skip bbox\n this.partCount = hasParts ? bin.readUint32() : 1;\n this.pointCount = bin.readUint32();\n }\n this._data = function() {\n return bin.position(pos);\n };\n };\n\n // base prototype has methods shared by all Shapefile types except NULL type\n // (Type-specific methods are mixed in below)\n var proto = {\n // return offset of [x, y] point data in the record\n _xypos: function() {\n var offs = 12; // skip header & record type\n if (!singlePoint) offs += 4; // skip point count\n if (hasBounds) offs += 32;\n if (hasParts) offs += 4 * this.partCount + 4; // skip part count & index\n return offs;\n },\n\n readCoords: function() {\n if (this.pointCount === 0) return null;\n var partSizes = this.readPartSizes(),\n xy = this._data().skipBytes(this._xypos());\n\n return partSizes.map(function(pointCount) {\n return xy.readFloat64Array(pointCount * 2);\n });\n },\n\n readXY: function() {\n if (this.pointCount === 0) return new Float64Array(0);\n return this._data().skipBytes(this._xypos()).readFloat64Array(this.pointCount * 2);\n },\n\n readPoints: function() {\n var xy = this.readXY(),\n zz = hasZ ? this.readZ() : null,\n mm = hasM && this.hasM() ? this.readM() : null,\n points = [], p;\n\n for (var i=0, n=xy.length / 2; i<n; i++) {\n p = [xy[i*2], xy[i*2+1]];\n if (zz) p.push(zz[i]);\n if (mm) p.push(mm[i]);\n points.push(p);\n }\n return points;\n },\n\n // Return an array of point counts in each part\n // Parts containing zero points are skipped (Shapefiles with zero-point\n // parts are out-of-spec but exist in the wild).\n readPartSizes: function() {\n var sizes = [];\n var partLen, startId, bin;\n if (this.pointCount === 0) {\n // no parts\n } else if (this.partCount == 1) {\n // single-part type or multi-part type with one part\n sizes.push(this.pointCount);\n } else {\n // more than one part\n startId = 0;\n bin = this._data().skipBytes(56); // skip to second entry in part index\n for (var i=0, n=this.partCount; i<n; i++) {\n partLen = (i < n - 1 ? bin.readUint32() : this.pointCount) - startId;\n if (partLen > 0) {\n sizes.push(partLen);\n startId += partLen;\n }\n }\n }\n return sizes;\n }\n };\n\n var singlePointProto = {\n read: function() {\n var n = 2;\n if (hasZ) n++;\n if (this.hasM()) n++;\n return this._data().skipBytes(12).readFloat64Array(n);\n },\n\n stream: function(sink) {\n var src = this._data().skipBytes(12);\n sink.addPoint(src.readFloat64(), src.readFloat64());\n sink.endPath();\n }\n };\n\n var multiCoordProto = {\n readBounds: function() {\n return this._data().skipBytes(12).readFloat64Array(4);\n },\n\n stream: function(sink) {\n var sizes = this.readPartSizes(),\n xy = this.readXY(),\n i = 0, j = 0, n;\n while (i < sizes.length) {\n n = sizes[i];\n while (n-- > 0) {\n sink.addPoint(xy[j++], xy[j++]);\n }\n sink.endPath();\n i++;\n }\n if (xy.length != j) error('Counting error');\n },\n\n read: function() {\n var parts = [],\n sizes = this.readPartSizes(),\n points = this.readPoints();\n for (var i=0, n = sizes.length - 1; i<n; i++) {\n parts.push(points.splice(0, sizes[i]));\n }\n parts.push(points);\n return parts;\n }\n };\n\n var mProto = {\n _mpos: function() {\n var pos = this._xypos() + this.pointCount * 16;\n if (hasZ) {\n pos += this.pointCount * 8 + mzRangeBytes;\n }\n return pos;\n },\n\n readMBounds: function() {\n return this.hasM() ? this._data().skipBytes(this._mpos()).readFloat64Array(2) : null;\n },\n\n // TODO: group into parts, like readCoords()\n readM: function() {\n return this.hasM() ? this._data().skipBytes(this._mpos() + mzRangeBytes).readFloat64Array(this.pointCount) : null;\n },\n\n // Test if this record contains M data\n // (according to the Shapefile spec, M data is optional in a record)\n //\n hasM: function() {\n var bytesWithoutM = this._mpos(),\n bytesWithM = bytesWithoutM + this.pointCount * 8 + mzRangeBytes;\n if (this.byteLength == bytesWithoutM) {\n return false;\n } else if (this.byteLength == bytesWithM) {\n return true;\n } else {\n error(\"#hasM() Counting error\");\n }\n }\n };\n\n var zProto = {\n _zpos: function() {\n return this._xypos() + this.pointCount * 16;\n },\n\n readZBounds: function() {\n return this._data().skipBytes(this._zpos()).readFloat64Array(2);\n },\n\n // TODO: group into parts, like readCoords()\n readZ: function() {\n return this._data().skipBytes(this._zpos() + mzRangeBytes).readFloat64Array(this.pointCount);\n }\n };\n\n if (singlePoint) {\n utils.extend(proto, singlePointProto);\n } else {\n utils.extend(proto, multiCoordProto);\n }\n if (hasZ) utils.extend(proto, zProto);\n if (hasM) utils.extend(proto, mProto);\n\n constructor.prototype = proto;\n proto.constructor = constructor;\n return constructor;\n}", "function SceneFileParser(sceneFilePath, type) {\n if (type === \"XML\") {\n this.mScene = gEngine.ResourceMap.retrieveAsset(sceneFilePath);\n }\n if (type === \"JSON\") {\n var jsonString = gEngine.ResourceMap.retrieveAsset(sceneFilePath);\n var sceneInfo = JSON.parse(jsonString);\n this.mScene = sceneInfo;\n }\n if (type === \"SMALL\") {\n var jsonString = gEngine.ResourceMap.retrieveAsset(sceneFilePath);\n var sceneInfo = JSON.parse(jsonString);\n this.mScene = sceneInfo; \n }\n}", "function loadOBJ(fileName, material, label) {\n\tnumModelsExpected++;\n\tloadOBJAsMesh(fileName, function(mesh) { // callback function for non-blocking load\n\t\tmesh.computeFaceNormals();\n\t\tif(smoothShading) mesh.computeVertexNormals();\n\t\tmodels[label] = new THREE.Mesh(mesh, material);\n\t\tnumModelsLoaded++;\n\t}, function() {}, function() {});\n}", "loadModels()\n {\n this.inputTriangles = this.getJSONFile(this.INPUT_TRIANGLES_URL,\"triangles\"); // read in the triangle data\n\n try {\n if (this.inputTriangles == String.null)\n throw \"Unable to load triangles file!\";\n else {\n var currSet; // the current triangle set\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var vtxToAdd; // vtx coords to add to the vertices array\n var normToAdd; // vtx normal to add to the normal array\n var uvToAdd; // uv coords to add to the uv arry\n var triToAdd; // tri indices to add to the index array\n var maxCorner = vec3.fromValues(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE); // bbox corner\n var minCorner = vec3.fromValues(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE); // other corner\n\n // process each triangle set to load webgl vertex and triangle buffers\n this.numTriangleSets = this.inputTriangles.length; // remember how many tri sets\n for (var whichSet=0; whichSet<this.numTriangleSets; whichSet++) { // for each tri set\n currSet = this.inputTriangles[whichSet];\n\n // set up hilighting, modeling translation and rotation\n currSet.center = vec3.fromValues(0,0,0); // center point of tri set\n currSet.on = false; // not highlighted\n currSet.translation = vec3.fromValues(0,0,0); // no translation\n currSet.xAxis = vec3.fromValues(1,0,0); // model X axis\n currSet.yAxis = vec3.fromValues(0,1,0); // model Y axis\n\n // set up the vertex, normal and uv arrays, define model center and axes\n currSet.glVertices = []; // flat coord list for webgl\n currSet.glNormals = []; // flat normal list for webgl\n currSet.glUvs = []; // flat texture coord list for webgl\n var numVerts = currSet.vertices.length; // num vertices in tri set\n for (whichSetVert=0; whichSetVert<numVerts; whichSetVert++) { // verts in set\n vtxToAdd = currSet.vertices[whichSetVert]; // get vertex to add\n normToAdd = currSet.normals[whichSetVert]; // get normal to add\n uvToAdd = currSet.uvs[whichSetVert]; // get uv to add\n currSet.glVertices.push(vtxToAdd[0],vtxToAdd[1],vtxToAdd[2]); // put coords in set vertex list\n currSet.glNormals.push(normToAdd[0],normToAdd[1],normToAdd[2]); // put normal in set normal list\n currSet.glUvs.push(uvToAdd[0],uvToAdd[1]); // put uv in set uv list\n vec3.max(maxCorner,maxCorner,vtxToAdd); // update world bounding box corner maxima\n vec3.min(minCorner,minCorner,vtxToAdd); // update world bounding box corner minima\n vec3.add(currSet.center,currSet.center,vtxToAdd); // add to ctr sum\n } // end for vertices in set\n vec3.scale(currSet.center,currSet.center,1/numVerts); // avg ctr sum\n\n // send the vertex coords, normals and uvs to webGL; load texture\n this.vertexBuffers[whichSet] = this.gl.createBuffer(); // init empty webgl set vertex coord buffer\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.vertexBuffers[whichSet]); // activate that buffer\n this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(currSet.glVertices),this.gl.STATIC_DRAW); // data in\n this.normalBuffers[whichSet] = this.gl.createBuffer(); // init empty webgl set normal component buffer\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.normalBuffers[whichSet]); // activate that buffer\n this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(currSet.glNormals),this.gl.STATIC_DRAW); // data in\n this.uvBuffers[whichSet] = this.gl.createBuffer(); // init empty webgl set uv coord buffer\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.uvBuffers[whichSet]); // activate that buffer\n this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(currSet.glUvs),this.gl.STATIC_DRAW); // data in\n\n this.loadTexture(whichSet,currSet,currSet.material.texture); // load tri set's texture\n\n // set up the triangle index array, adjusting indices across sets\n currSet.glTriangles = []; // flat index list for webgl\n this.triSetSizes[whichSet] = currSet.triangles.length; // number of tris in this set\n for (whichSetTri=0; whichSetTri<this.triSetSizes[whichSet]; whichSetTri++)\n {\n triToAdd = currSet.triangles[whichSetTri]; // get tri to add\n currSet.glTriangles.push(triToAdd[0],triToAdd[1],triToAdd[2]); // put indices in set list\n } // end for triangles in set\n\n // send the triangle indices to webGL\n this.triangleBuffers.push(this.gl.createBuffer()); // init empty triangle index buffer\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.triangleBuffers[whichSet]); // activate that buffer\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(currSet.glTriangles),this.gl.STATIC_DRAW); // data in\n\n } // end for each triangle set\n\n this.inputSpheres = this.getJSONFile(this.INPUT_SPHERES_URL,\"spheres\"); // read in the sphere data\n\n if (this.inputSpheres == String.null)\n throw \"Unable to load spheres file!\";\n else {\n\n // init sphere highlighting, translation and rotation; update bbox\n var sphere; // current sphere\n var temp = vec3.create(); // an intermediate vec3\n var minXYZ = vec3.create(), maxXYZ = vec3.create(); // min/max xyz from sphere\n this.numSpheres = this.inputSpheres.length; // remember how many spheres\n for (var whichSphere=0; whichSphere<this.numSpheres; whichSphere++) {\n sphere = this.inputSpheres[whichSphere];\n sphere.on = false; // spheres begin without highlight\n sphere.translation = vec3.fromValues(0,0,0); // spheres begin without translation\n sphere.xAxis = vec3.fromValues(1,0,0); // sphere X axis\n sphere.yAxis = vec3.fromValues(0,1,0); // sphere Y axis\n sphere.center = vec3.fromValues(0,0,0); // sphere instance is at origin\n vec3.set(minXYZ,sphere.x-sphere.r,sphere.y-sphere.r,sphere.z-sphere.r);\n vec3.set(maxXYZ,sphere.x+sphere.r,sphere.y+sphere.r,sphere.z+sphere.r);\n vec3.min(minCorner,minCorner,minXYZ); // update world bbox min corner\n vec3.max(maxCorner,maxCorner,maxXYZ); // update world bbox max corner\n this.loadTexture(this.numTriangleSets+whichSphere,sphere,sphere.texture); // load the sphere's texture\n } // end for each sphere\n this.viewDelta = vec3.length(vec3.subtract(temp,maxCorner,minCorner)) / 100; // set global\n\n // make one sphere instance that will be reused, with 32 longitude steps\n var oneSphere = this.makeSphere(32);\n\n // send the sphere vertex coords and normals to webGL\n this.vertexBuffers.push(this.gl.createBuffer()); // init empty webgl sphere vertex coord buffer\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.vertexBuffers[this.vertexBuffers.length-1]); // activate that buffer\n this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(oneSphere.vertices),this.gl.STATIC_DRAW); // data in\n this.normalBuffers.push(this.gl.createBuffer()); // init empty webgl sphere vertex normal buffer\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.normalBuffers[this.normalBuffers.length-1]); // activate that buffer\n this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(oneSphere.normals),this.gl.STATIC_DRAW); // data in\n this.uvBuffers.push(this.gl.createBuffer()); // init empty webgl sphere vertex uv buffer\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.uvBuffers[this.uvBuffers.length-1]); // activate that buffer\n this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(oneSphere.uvs),this.gl.STATIC_DRAW); // data in\n\n this.triSetSizes.push(oneSphere.triangles.length);\n\n this.triangleBuffers.push(this.gl.createBuffer()); // init empty triangle index buffer\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.triangleBuffers[this.triangleBuffers.length-1]); // activate that buffer\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(oneSphere.triangles),this.gl.STATIC_DRAW); // data in\n }\n }\n }\n\n catch(e) {\n console.log(e);\n } // end catch\n }", "function parseObj(obj) {\n\tconst split = obj.split(\"\\n\");\n\n\tvar vertices = [];\n\tvar faces = [];\n\n\t// Parse line by line\n\tfor (line of split) {\n\n\t\t// Vertices\n\t\tif(line.substr(0, 1) == \"v\") {\n\t\t\tconst coords = line.substr(2).split(\" \");\n\t\t\tconst x = parseFloat(coords[0]);\n\t\t\tconst y = parseFloat(coords[1]);\n\t\t\tconst z = parseFloat(coords[2]);\n\n\t\t\tvertices.push({x: x, y: y, z: z});\n\t\t}\n\t\t// Faces\n\t\telse if(line.substr(0, 1) == \"f\") {\n\t\t\tconst indices = line.substr(2).split(\" \");\n\t\t\tconst v1 = parseFloat(indices[0]);\n\t\t\tconst v2 = parseFloat(indices[1]);\n\t\t\tconst v3 = parseFloat(indices[2]);\n\n\t\t\tfaces.push({v1: v1, v2: v2, v3: v3});\n\t\t}\n\t}\n\n\treturn { vertices: vertices, faces: faces };\n}", "function loadFile(file){\n\tlet fs = require('fs');\n\tlet content = fs.readFileSync(file);\n\tlet obj = JSON.parse(content);\n\treturn obj;\n}", "function OBJLoader(generateTangents) {\n\t// intializaiton;\n\tvar _vertices = [];\n\tvar _normals = [];\n\tvar _texCoords = [];\n\n\tvar _objects = [];\n\tvar _materials = new Map();\n\tvar _currentSmoothingGroup = 0;\n\tvar _materialName;\n\t\n\tvar _generateNormals = true;\n\tvar _genTangents = generateTangents || false;\n\t\n\n\t_objects.peekLast = new __WEBPACK_IMPORTED_MODULE_10__LoaderUtil__[\"a\" /* LoaderUtil */]().peekLast.bind(_objects);\n\t\n\t/**\n\t * Loads meshes from folder path, objFile and mtlFile name arguments.\n\t * \n\t * @param path - files folder path to search file in\n\t * @param objFile - name of .obj file\n\t * @param mtlFile - name of .mtl file \n\t */\n\tthis.load = function(path, objFile, mtlFile) {\n\t\tvar time = new Date();\n\t\tvar util = new __WEBPACK_IMPORTED_MODULE_10__LoaderUtil__[\"a\" /* LoaderUtil */];\n\t\tvar request = new XMLHttpRequest();\n\t\t\n\t\tif(mtlFile) {\n\t\t\t// loading mtl file\n\t\t\trequest.open('GET', './meshes/'+ path + mtlFile + '.mtl', true);\n\t\t\trequest.send(null);\n\t\t\t// TODO: Dangerous code!\n\t\t\twhile(!request.status == 4) {}\n\t\t\tvar mtl = request.responseText;\n\t\t\t\n\t\t\t// parsing .mtl\n\t\t\tif(!mtl) {\n\t\t\t\ttry {\t\t\t\t\t\t\n\t\t\t\t\tlet lines = mtl.split[\"\\r\\n\"];\t\t\t\t\t\t\n\t\t\t\t\tvar currentMtl = \"\";\n\t\t\t\t\t \n\t\t\t\t\tfor(var i = 0; i < lines.length; i++) {\n\t\t\t\t\t\tlet tokens = lines[i].split(\" \");\n\t\t\t\t\t\ttokens = util.removeEmptyStrings(tokens);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!tokens.length) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(tokens[0] == \"newmtl\") {\n\t\t\t\t\t\t\tlet material = new Material(tokens[1]);\n\t\t\t\t\t\t\tmaterials.set(tokens[1], material);\n\t\t\t\t\t\t\tcurrentMtl = tokens[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(tokens[0] == \"Kd\") {\n\t\t\t\t\t\t\tif(tokens.length > 1) {\n\t\t\t\t\t\t\t\tlet color = new __WEBPACK_IMPORTED_MODULE_3__math_vector_Vector3f__[\"a\" /* Vector3f */](+tokens[1], +tokens[2], +tokens[3]);\n\t\t\t\t\t\t\t\tmaterials.get(currentMtl).setColor(color);\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(tokens[0] == \"map_Kd\") {\n\t\t\t\t\t\t\tif(tokens.length > 1){\n\t\t\t\t\t\t\t\tmaterials.get(currentMtl).setDiffuseMap(new Texture2D(\"diffuseMap\", path + \"/\" + tokens[1]));\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(tokens[0] == \"map_Ks\") {\n\t\t\t\t\t\t\tif(tokens.length > 1){\n\t\t\t\t\t\t\t\tmaterials.get(currentMtl).setSpecularMap(new Texture2D(\"specularMap\", path + \"/\" + tokens[1]));\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(tokens[0] == \"map_bump\") {\n\t\t\t\t\t\t\tif(tokens.length > 1) {\n\t\t\t\t\t\t\t\tmaterials.get(currentMtl).setNormalMap(new Texture2D(\"normalMap\", path + \"/\" + tokens[1]));\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(tokens[0] == \"illum\") {\n\t\t\t\t\t\t\tif(tokens.length > 1)\n\t\t\t\t\t\t\t\tmaterials.get(currentMtl).setEmission(Float.valueOf(tokens[1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(tokens[0] == \"Ns\") {\n\t\t\t\t\t\t\tif(tokens.length > 1)\n\t\t\t\t\t\t\t\tmaterials.get(currentMtl).setShininess(Float.valueOf(tokens[1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmtlReader.close();\n\t\t\t\t} catch(error) {\n\t\t\t\t\tconsole.log(error.stack);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// loading .obj file\n\t\ttry {\n\t\t\t__webpack_require__(32)(\"./\"+ path + objFile + '.obj');\n\t\t\trequest.open('GET', './meshes/'+ path + objFile + '.obj', false);\n\t\t\trequest.send(null);\n\t\t\t// TODO: Dangerous code!\n\t\t\twhile(!request.status == 4) {}\n\t\t\t\n\t\t\tif(!request.status == 200) {\n\t\t\t\tthrow \"obj loading failed!\";\n\t\t\t}\n\t\t\tvar obj = request.responseText;\n\t\t\t\n\t\t\t// parsing obj\n\t\t\tif(!obj) {\n\t\t\t\tthrow \"obj file is empty!\";\n\t\t\t}\n\t\t\tlet lines = obj.split(\"\\r\\n\");\t\t\n\t\t\t\n\t\t\tfor(let i = 0; i < lines.length; i++) {\n\t\t\t\tlet tokens = lines[i].split(\" \");\n\t\t\t\ttokens = util.removeEmptyStrings(tokens);\n\t\t\t\t\n\t\t\t\tif(!tokens.length || tokens[0] == \"#\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tokens[0] == \"v\") {\n\t\t\t\t\t_vertices.push(\n\t\t\t\t\t\tnew __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](\n\t\t\t\t\t\t\tnew __WEBPACK_IMPORTED_MODULE_3__math_vector_Vector3f__[\"a\" /* Vector3f */](+tokens[1], +tokens[2], +tokens[3])\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tokens[0] == \"vn\") {\n\t\t\t\t\t_normals.push(\n\t\t\t\t\t\tnew __WEBPACK_IMPORTED_MODULE_3__math_vector_Vector3f__[\"a\" /* Vector3f */](+tokens[1], +tokens[2], +tokens[3])\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tokens[0] == \"vt\") {\n\t\t\t\t\t_texCoords.push(\n\t\t\t\t\t\tnew __WEBPACK_IMPORTED_MODULE_2__math_vector_Vector2f__[\"a\" /* Vector2f */](+tokens[1], +tokens[2])\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tokens[0] == \"o\") {\n\t\t\t\t\tlet object = new __WEBPACK_IMPORTED_MODULE_9__MeshObject__[\"a\" /* MeshObject */]();\n\t\t\t\t\tobject.setName(tokens[1]);\n\t\t\t\t\t_objects.push(new __WEBPACK_IMPORTED_MODULE_9__MeshObject__[\"a\" /* MeshObject */]());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tokens[0] == \"g\") {\n\t\t\t\t\tlet polygonGroup = new __WEBPACK_IMPORTED_MODULE_6__PolygonGroup__[\"a\" /* PolygonGroup */]();\t\n\t\t\t\t\tif (tokens.length > 1) {\n\t\t\t\t\t\tpolygonGroup.setName(tokens[1]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (_objects.length == 0) {\n\t\t\t\t\t\t_objects.push(new __WEBPACK_IMPORTED_MODULE_9__MeshObject__[\"a\" /* MeshObject */]());\n\t\t\t\t\t}\n\t\t\t\t\t_objects.peekLast().getPolygonGroups().push(polygonGroup);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tokens[0] == \"usemtl\") {\n\t\t\t\t\tlet polygon = new __WEBPACK_IMPORTED_MODULE_5__Polygon__[\"a\" /* Polygon */]();\n\t\t\t\t\t_materialName = tokens[1];\n\t\t\t\t\tpolygon.setMaterial(tokens[1]);\n\t\t\t\t\tif(_objects.peekLast().getPolygonGroups().length == 0) {\n\t\t\t\t\t\t_objects.peekLast().getPolygonGroups().push(new __WEBPACK_IMPORTED_MODULE_6__PolygonGroup__[\"a\" /* PolygonGroup */]());\n\t\t\t\t\t}\n\t\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getPolygons().push(polygon);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tokens[0] == \"s\") {\n\t\t\t\t\tif(_objects.peekLast().getPolygonGroups().length == 0) {\n\t\t\t\t\t\t_objects.peekLast().getPolygonGroups().push(new __WEBPACK_IMPORTED_MODULE_6__PolygonGroup__[\"a\" /* PolygonGroup */]());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(tokens[1] == \"off\" || tokens[1] == \"0\") {\n\t\t\t\t\t\t_currentSmoothingGroup = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().has(0)) {\n\t\t\t\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().set(_currentSmoothingGroup, new __WEBPACK_IMPORTED_MODULE_7__SmoothingGroup__[\"a\" /* SmoothingGroup */]());\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_currentSmoothingGroup = +tokens[1];\n\t\t\t\t\t\tif(!_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().has(_currentSmoothingGroup)) {\n\t\t\t\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().set(_currentSmoothingGroup, new __WEBPACK_IMPORTED_MODULE_7__SmoothingGroup__[\"a\" /* SmoothingGroup */]());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tokens[0] == \"f\") {\n\t\t\t\t\tif(_objects.peekLast().getPolygonGroups().length == 0) {\n\t\t\t\t\t\t_objects.peekLast().getPolygonGroups().push(new __WEBPACK_IMPORTED_MODULE_6__PolygonGroup__[\"a\" /* PolygonGroup */]());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().length == 0) {\n\t\t\t\t\t\t_currentSmoothingGroup = 1;\n\t\t\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().set(_currentSmoothingGroup, new __WEBPACK_IMPORTED_MODULE_7__SmoothingGroup__[\"a\" /* SmoothingGroup */]());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(_objects.peekLast().getPolygonGroups().peekLast().getPolygons().length == 0) {\n\t\t\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getPolygons().push(new __WEBPACK_IMPORTED_MODULE_5__Polygon__[\"a\" /* Polygon */]());\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif(tokens.length == 4) {\n\t\t\t\t\t\tparseTriangleFace(tokens);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(tokens.length == 5) {\n\t\t\t\t\t\tparseQuadFace(tokens);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t} catch(error) {\n\t\t\tconsole.log( err.stack );\n\t\t}\n\t\t\n\t\tif(_normals.length == 0 && _generateNormals) {\n\t\t\tfor(let i = 0; i < _objects.length; i++) {\n\t\t\t\tlet polygonGroups = _object[i].getPolygonGroups();\n\t\t\t\tfor(let j = 0; j < polygonGroups.length; j++) {\n\t\t\t\t\tlet keys = polygonGroups[j].keys();\n\t\t\t\t\tfor(let k = 0; k < keys.length; k++) {\n\t\t\t\t\t\tlet key = keys[k];\n\t\t\t\t\t\tif(frontface == Frontface.CW) {\n\t\t\t\t\t\t\tutil.generateNormalsCW(polygonGroups[j].getSmoothingGroups().get(key));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tutil.generateNormalsCCW(polygonGroups[j].getSmoothingGroups().get(key));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tvar meshes = [];\n\t\t\n\t\tfor(let i = 0; i < _objects.length; i++) {\n\t\t\tlet polygonGroups = _objects[i].getPolygonGroups();\n\t\t\tfor(let j = 0; j < polygonGroups.length; j++) {\n\t\t\t\tlet polygons = polygonGroups[j].getPolygons();\n\t\t\t\tfor(let k = 0; k < polygons.length; k++) {\n\t\t\t\t\tgeneratePolygon(polygonGroups[j].getSmoothingGroups(), polygons[k]);\n\t\t\t\t\tlet vao = convert(polygons[k]);\n\t\t\t\t\tmeshes.push(new __WEBPACK_IMPORTED_MODULE_1__primitive_Mesh__[\"a\" /* Mesh */](\"mesh\" + k, vao));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn meshes;\n\t}\n\t\n\tvar parseTriangleFace = function(tokens) {\n\t\t// vertex//normal\n\t\tif(tokens[1].includes(\"//\")) {\n\t\t\tlet vertexIndices = [\n\t\t\t\t+tokens[1].split(\"//\")[0] - 1,\n\t\t\t\t+tokens[2].split(\"//\")[0] - 1,\n\t\t\t\t+tokens[3].split(\"//\")[0] - 1\n\t\t\t];\n\t\t\t\n\t\t\tlet normalIndices = [\n\t\t\t\t+tokens[1].split(\"//\")[1] - 1,\n\t\t\t\t+tokens[2].split(\"//\")[1] - 1,\n\t\t\t\t+tokens[3].split(\"//\")[1] - 1\n\t\t\t];\n\t\t\t\n\t\t\tlet v0 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[0]].getPosition());\n\t\t\tlet v1 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[1]].getPosition());\n\t\t\tlet v2 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[2]].getPosition());\n\t\t\tv0.setNormal(_normals[normalIndices[0]]);\n\t\t\tv1.setNormal(_normals[normalIndices[1]]);\n\t\t\tv2.setNormal(_normals[normalIndices[2]]);\n\t\t\t\n\t\t\tif(_genTangents) {\n\t\t\t\tgenerateTangents(v0, v1, v2);\n\t\t\t}\n\t\t\t\n\t\t\taddToSmoothingGroup(\n\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().get(_currentSmoothingGroup),\n\t\t\t\tv0, v1, v2\n\t\t\t);\n\t\t\t\n\t\t} else if(tokens[1].includes(\"/\")) {\t\t\t\t// vertex/textureCoord/normal\n\t\t\t\n\t\t\tif(tokens[1].split(\"/\").length == 3) {\n\t\t\t\tlet vertexIndices = [\n\t\t\t\t\t+tokens[1].split(\"/\")[0] - 1,\n\t\t\t\t\t+tokens[2].split(\"/\")[0] - 1,\n\t\t\t\t\t+tokens[3].split(\"/\")[0] - 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tlet texCoordIndices = [\n\t\t\t\t\t+tokens[1].split(\"/\")[1] - 1,\n\t\t\t\t\t+tokens[2].split(\"/\")[1] - 1,\n\t\t\t\t\t+tokens[3].split(\"/\")[1] - 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tlet normalIndices = [\n\t\t\t\t\t+tokens[1].split(\"/\")[2] - 1,\n\t\t\t\t\t+tokens[2].split(\"/\")[2] - 1,\n\t\t\t\t\t+tokens[3].split(\"/\")[2] - 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tlet v0 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[0]].getPosition());\n\t\t\t\tlet v1 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[1]].getPosition());\n\t\t\t\tlet v2 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[2]].getPosition());\n\t\t\t\tv0.setNormal(_normals[normalIndices[0]]);\n\t\t\t\tv1.setNormal(_normals[normalIndices[1]]);\n\t\t\t\tv2.setNormal(_normals[normalIndices[2]]);\n\t\t\t\tv0.setTextureCoord(_texCoords[texCoordIndices[0]]);\n\t\t\t\tv1.setTextureCoord(_texCoords[texCoordIndices[1]]);\n\t\t\t\tv2.setTextureCoord(_texCoords[texCoordIndices[2]]);\n\t\t\t\t\n\t\t\t\tif(_genTangents) {\n\t\t\t\t\tgenerateTangents(v0, v1, v2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\taddToSmoothingGroup(\n\t\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().get(_currentSmoothingGroup),\n\t\t\t\t\tv0, v1, v2\n\t\t\t\t);\n\t\t\t\n\t\t\t} else {\t\t\t\t\t\t\t\t\t// vertex/textureCoord\n\t\t\t\tlet vertexIndices = [\n\t\t\t\t\t+tokens[1].split(\"/\")[0] - 1,\n\t\t\t\t\t+tokens[2].split(\"/\")[0] - 1,\n\t\t\t\t\t+tokens[3].split(\"/\")[0] - 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tlet texCoordIndices = [\n\t\t\t\t\t+tokens[1].split(\"/\")[1] - 1,\n\t\t\t\t\t+tokens[2].split(\"/\")[1] - 1,\n\t\t\t\t\t+tokens[3].split(\"/\")[1] - 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tlet v0 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[0]].getPosition());\n\t\t\t\tlet v1 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[1]].getPosition());\n\t\t\t\tlet v2 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[2]].getPosition());\n\t\t\t\tv0.setTextureCoord(_texCoords[texCoordIndices[0]]);\n\t\t\t\tv1.setTextureCoord(_texCoords[texCoordIndices[1]]);\n\t\t\t\tv2.setTextureCoord(_texCoords[texCoordIndices[2]]);\n\t\t\t\t\n\t\t\t\tif(_genTangents) {\n\t\t\t\t\tgenerateTangents(v0, v1, v2);\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\taddToSmoothingGroup(\n\t\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().get(_currentSmoothingGroup),\n\t\t\t\t\tv0, v1, v2\n\t\t\t\t);\n\t\t\t}\t\t\n\t\t} else {\t\t\t\t\t\t\t\t\t// vertex\n\t\t\t\n\t\t\tlet vertexIndices = [\n\t\t\t\t+tokens[1] - 1,\n\t\t\t\t+tokens[2] - 1,\n\t\t\t\t+tokens[3] - 1\n\t\t\t];\n\t\t\t\n\t\t\tlet v0 = _vertices[vertexIndices[0]];\n\t\t\tlet v1 = _vertices[vertexIndices[1]];\n\t\t\tlet v2 = _vertices[vertexIndices[2]];\n\t\t\t\n\t\t\tif(_genTangents) {\n\t\t\t\tgenerateTangents(v0, v1, v2);\n\t\t\t}\n\t\t\t\n\t\t\taddToSmoothingGroup(\n\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().get(_currentSmoothingGroup),\n\t\t\t\tv0, v1, v2\n\t\t\t);\n\t\t}\n\t}\n\t\n\tvar parseQuadFace = function(tokens) {\n\t\t// vertex//normal\n\t\tif(tokens[1].includes(\"//\")) {\n\t\t\t\n\t\t\tlet vertexIndices = [\n\t\t\t\t+tokens[1].split(\"//\")[0] - 1,\n\t\t\t\t+tokens[2].split(\"//\")[0] - 1,\n\t\t\t\t+tokens[3].split(\"//\")[0] - 1,\n\t\t\t\t+tokens[4].split(\"//\")[0] - 1\n\t\t\t];\n\t\t\t\n\t\t\tlet normalIndices = [\n\t\t\t\t+tokens[1].split(\"//\")[1] - 1,\n\t\t\t\t+tokens[2].split(\"//\")[1] - 1,\n\t\t\t\t+tokens[3].split(\"//\")[1] - 1,\n\t\t\t\t+tokens[4].split(\"//\")[1] - 1\n\t\t\t];\n\t\t\t\n\t\t\tlet v0 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[0]].getPosition());\n\t\t\tlet v1 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[1]].getPosition());\n\t\t\tlet v2 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[2]].getPosition());\n\t\t\tlet v3 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[3]].getPosition());\n\t\t\tv0.setNormal(_normals[normalIndices[0]]);\n\t\t\tv1.setNormal(_normals[normalIndices[1]]);\n\t\t\tv2.setNormal(_normals[normalIndices[2]]);\n\t\t\tv3.setNormal(_normals[normalIndices[3]]);\n\t\t\t\n\t\t\tif(_genTangents) {\n\t\t\t\tgenerateTangents(v0, v1, v2);\n\t\t\t\tgenerateTangents(v2, v1, v3);\n\t\t\t}\t\t\t\n\t\t\taddToSmoothingGroup(\n\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().get(_currentSmoothingGroup),\n\t\t\t\tv0, v1, v2, v3\n\t\t\t);\n\t\t}\n\t\t\n\t\telse if(tokens[1].includes(\"/\")) {\t\n\t\t\n\t\t\t// vertex/textureCoord/normal\n\t\t\tif(tokens[1].split(\"/\").length == 3) {\n\n\t\t\t\tlet vertexIndices = [\n\t\t\t\t\t+tokens[1].split(\"/\")[0] - 1,\n\t\t\t\t\t+tokens[2].split(\"/\")[0] - 1,\n\t\t\t\t\t+tokens[3].split(\"/\")[0] - 1,\n\t\t\t\t\t+tokens[4].split(\"/\")[0] - 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tlet texCoordIndices = [\n\t\t\t\t\t+tokens[1].split(\"/\")[1] - 1,\n\t\t\t\t\t+tokens[2].split(\"/\")[1] - 1,\n\t\t\t\t\t+tokens[3].split(\"/\")[1] - 1,\n\t\t\t\t\t+tokens[4].split(\"/\")[1] - 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tlet normalIndices = [\n\t\t\t\t\t+tokens[1].split(\"/\")[2] - 1,\n\t\t\t\t\t+tokens[2].split(\"/\")[2] - 1,\n\t\t\t\t\t+tokens[3].split(\"/\")[2] - 1,\n\t\t\t\t\t+tokens[4].split(\"/\")[2] - 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tlet v0 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[0]].getPosition());\n\t\t\t\tlet v1 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[1]].getPosition());\n\t\t\t\tlet v2 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[2]].getPosition());\n\t\t\t\tlet v3 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[3]].getPosition());\n\t\t\t\tv0.setNormal(_normals[normalIndices[0]]);\n\t\t\t\tv1.setNormal(_normals[normalIndices[1]]);\n\t\t\t\tv2.setNormal(_normals[normalIndices[2]]);\n\t\t\t\tv3.setNormal(_normals[normalIndices[3]]);\t\t\t\n\t\t\t\tv0.setTextureCoord(_texCoords[texCoordIndices[0]]);\n\t\t\t\tv1.setTextureCoord(_texCoords[texCoordIndices[1]]);\n\t\t\t\tv2.setTextureCoord(_texCoords[texCoordIndices[2]]);\n\t\t\t\tv3.setTextureCoord(_texCoords[texCoordIndices[3]]);\n\t\t\t\t\n\t\t\t\tif(_genTangents) {\n\t\t\t\t\tgenerateTangents(v0, v1, v2);\n\t\t\t\t\tgenerateTangents(v2, v1, v3);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\taddToSmoothingGroup(\n\t\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().get(_currentSmoothingGroup),\n\t\t\t\t\tv0, v1, v2, v3\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t// vertex/textureCoord\n\t\t\telse {\n\n\t\t\t\tlet vertexIndices = [\n\t\t\t\t\t+tokens[1].split(\"/\")[0] - 1,\n\t\t\t\t\t+tokens[2].split(\"/\")[0] - 1,\n\t\t\t\t\t+tokens[3].split(\"/\")[0] - 1,\n\t\t\t\t\t+tokens[4].split(\"/\")[0] - 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tlet texCoordIndices = [\n\t\t\t\t\t+tokens[1].split(\"/\")[1] - 1,\n\t\t\t\t\t+tokens[2].split(\"/\")[1] - 1,\n\t\t\t\t\t+tokens[3].split(\"/\")[1] - 1,\n\t\t\t\t\t+tokens[4].split(\"/\")[1] - 1\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tlet v0 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[0]].getPosition());\n\t\t\t\tlet v1 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[1]].getPosition());\n\t\t\t\tlet v2 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[2]].getPosition());\n\t\t\t\tlet v3 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[3]].getPosition());\n\t\t\t\tv0.setTextureCoord(_texCoords[texCoordIndices[0]]);\n\t\t\t\tv1.setTextureCoord(_texCoords[texCoordIndices[1]]);\n\t\t\t\tv2.setTextureCoord(_texCoords[texCoordIndices[2]]);\n\t\t\t\tv3.setTextureCoord(_texCoords[texCoordIndices[3]]);\n\t\t\t\t\n\t\t\t\tif(_genTangents) {\n\t\t\t\t\tgenerateTangents(v0, v1, v2);\n\t\t\t\t\tgenerateTangents(v2, v1, v3);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\taddToSmoothingGroup(\n\t\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().get(_currentSmoothingGroup),\n\t\t\t\t\tv0, v1, v2, v3\n\t\t\t\t);\n\t\t\t}\t\t\n\t\t}\n\t\n\t\t// vertex\n\t\telse {\n\t\t\t\n\t\t\tlet vertexIndices = [\n\t\t\t\t+tokens[1] - 1,\n\t\t\t\t+tokens[2] - 1,\n\t\t\t\t+tokens[3] - 1,\n\t\t\t\t+tokens[4] - 1\n\t\t\t];\n\t\t\t\n\t\t\tlet v0 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[0]].getPosition());\n\t\t\tlet v1 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[1]].getPosition());\n\t\t\tlet v2 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[2]].getPosition());\n\t\t\tlet v3 = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */](_vertices[vertexIndices[3]].getPosition());\n\t\t\tif(_genTangents) {\n\t\t\t\tgenerateTangents(v0, v1, v2);\n\t\t\t\tgenerateTangents(v2, v1, v3);\n\t\t\t}\n\t\t\t\n\t\t\taddToSmoothingGroup(\n\t\t\t\t_objects.peekLast().getPolygonGroups().peekLast().getSmoothingGroups().get(_currentSmoothingGroup),\n\t\t\t\tv0, v1, v2, v3\n\t\t\t);\n\t\t}\n\t}\n\t\n\tvar addToSmoothingGroup = function(smoothingGroup, v0, v1, v2, v3) {\n\t\tlet index0 = processVertex(smoothingGroup, v0);\n\t\tlet index1 = processVertex(smoothingGroup, v1);\n\t\tlet index2 = processVertex(smoothingGroup, v2);\n\t\t\n\t\tlet face0 = new __WEBPACK_IMPORTED_MODULE_8__Face__[\"a\" /* Face */]();\n\t\tface0.getIndices()[0] = index0;\n\t\tface0.getIndices()[1] = index1;\n\t\tface0.getIndices()[2] = index2;\n\t\tface0.setMaterial(_materialName);\n\t\tsmoothingGroup.getFaces().push(face0);\n\t\t// if v3 defined - add new face\n\t\tif(v3) {\n\t\t\tlet index3 = processVertex(smoothingGroup, v3);\n\t\t\t\n\t\t\tlet face1 = new __WEBPACK_IMPORTED_MODULE_8__Face__[\"a\" /* Face */]();\n\t\t\tface1.getIndices()[0] = index0;\n\t\t\tface1.getIndices()[1] = index2;\n\t\t\tface1.getIndices()[2] = index3;\n\t\t\tface1.setMaterial(_materialName);\n\t\t\t\n\t\t\tsmoothingGroup.getFaces().push(face1);\n\t\t}\n\n\t}\n\t\n\tlet processVertex = function(smoothingGroup, previousVertex) {\n\t\tif(smoothingGroup.getVertices().includes(previousVertex)) {\n\t\t\tlet index = smoothingGroup.getVertices().indexOf(previousVertex);\n\t\t\tlet nextVertex = smoothingGroup.getVertices()[index];\n\t\t\tif(!hasSameNormalAndTexture(previousVertex, nextVertex)) {\t\t\n\t\t\t\tif(nextVertex.getDublicateVertex() != null) {\n\t\t\t\t\treturn processVertex(smoothingGroup, nextVertex.getDublicateVertex());\n\t\t\t\t} else {\n\t\t\t\t\tlet newVertex = new __WEBPACK_IMPORTED_MODULE_4__Vertex__[\"a\" /* Vertex */]();\n\t\t\t\t\tnewVertex.setPos(previousVertex.getPosition());\n\t\t\t\t\tnewVertex.setNormal(previousVertex.getNormal());\n\t\t\t\t\tnewVertex.setTextureCoord(previousVertex.getTextureCoord());\n\t\t\t\t\tpreviousVertex.setDubilcateVertex(newVertex);\n\t\t\t\t\tsmoothingGroup.getVertices().push(newVertex);\n\t\t\t\t\treturn smoothingGroup.getVertices().indexOf(newVertex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsmoothingGroup.getVertices().push(previousVertex);\n\t\treturn smoothingGroup.getVertices().indexOf(previousVertex);\n\t}\n\t\n\tvar hasSameNormalAndTexture = function(v1, v2) {\n\t\treturn (v1.getNormal().equals(v2.getNormal()) && v1.getTextureCoord().equals(v2.getTextureCoord()));\n\t}\n\t\n\tvar generatePolygon = function(smoothingGroups, polygon) {\n\t\tfor(let key of smoothingGroups.keys()) {\n\t\t\tfor(let face of smoothingGroups.get(key).getFaces()) {\n\t\t\t\tif(face.getMaterial() == polygon.getMaterial()) {\n\t\t\t\t\tif(!polygon.getVertices().includes(smoothingGroups.get(key).getVertices()[face.getIndices()[0]])) {\n\t\t\t\t\t\tpolygon.getVertices().push(smoothingGroups.get(key).getVertices()[face.getIndices()[0]]);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!polygon.getVertices().includes(smoothingGroups.get(key).getVertices()[face.getIndices()[1]])) {\n\t\t\t\t\t\tpolygon.getVertices().push(smoothingGroups.get(key).getVertices()[face.getIndices()[1]]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!polygon.getVertices().includes(smoothingGroups.get(key).getVertices()[face.getIndices()[2]])) {\n\t\t\t\t\t\tpolygon.getVertices().push(smoothingGroups.get(key).getVertices()[face.getIndices()[2]]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tpolygon.getIndices().push(polygon.getVertices().indexOf(smoothingGroups.get(key).getVertices()[face.getIndices()[0]]));\n\t\t\t\t\tpolygon.getIndices().push(polygon.getVertices().indexOf(smoothingGroups.get(key).getVertices()[face.getIndices()[1]]));\n\t\t\t\t\tpolygon.getIndices().push(polygon.getVertices().indexOf(smoothingGroups.get(key).getVertices()[face.getIndices()[2]]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tvar generateTangents = function(v0, v1, v2) {\n\t\tlet delatPos1 = __WEBPACK_IMPORTED_MODULE_3__math_vector_Vector3f__[\"a\" /* Vector3f */].sub(v1.getPosition(), v0.getPosition());\n\t\tlet delatPos2 = __WEBPACK_IMPORTED_MODULE_3__math_vector_Vector3f__[\"a\" /* Vector3f */].sub(v2.getPosition(), v0.getPosition());\n\t\tlet uv0 = v0.getTextureCoord();\n\t\tlet uv1 = v1.getTextureCoord();\n\t\tlet uv2 = v2.getTextureCoord();\n\t\tlet deltaUv1 = __WEBPACK_IMPORTED_MODULE_2__math_vector_Vector2f__[\"a\" /* Vector2f */].sub(uv1, uv0);\n\t\tlet deltaUv2 = __WEBPACK_IMPORTED_MODULE_2__math_vector_Vector2f__[\"a\" /* Vector2f */].sub(uv2, uv0);\n\n\t\tlet r = 1.0 / (deltaUv1.x * deltaUv2.y - deltaUv1.y * deltaUv2.x);\n\t\tdelatPos1.scale(deltaUv2.y);\n\t\tdelatPos2.scale(deltaUv1.y);\n\t\tlet tangent = __WEBPACK_IMPORTED_MODULE_3__math_vector_Vector3f__[\"a\" /* Vector3f */].sub(delatPos1, delatPos2);\n\t\ttangent.scale(r);\n\t\tv0.setTangent(tangent);\n\t\tv1.setTangent(tangent);\n\t\tv2.setTangent(tangent);\n\t}\n\t\n\tvar convert = function(polygon) {\n\t\tlet indices = polygon.getIndices().slice();\n\t\tlet vertices = polygon.getVertices().slice();\n\t\tlet positions = [];\n\t\tlet normals = [];\n\t\tlet textureCoords = [];\n\t\t\n\t\tfor(let i = 0; i < vertices.length; i++) {\n\t\t\tpositions.push(vertices[i].getPosition().x);\n\t\t\tpositions.push(vertices[i].getPosition().y);\n\t\t\tpositions.push(vertices[i].getPosition().z);\n\t\t}\n\t\t\n\t\tfor(let i = 0; i < vertices.length; i++) {\n\t\t\tnormals.push(vertices[i].getNormal().x);\n\t\t\tnormals.push(vertices[i].getNormal().y);\n\t\t\tnormals.push(vertices[i].getNormal().z);\n\t\t}\n\t\t\n\t\tfor(let i = 0; i < vertices.length; i++) {\n\t\t\ttextureCoords.push(vertices[i].getTextureCoord().x);\n\t\t\ttextureCoords.push(1 - vertices[i].getTextureCoord().y);\n\t\t}\n\t\t\n\t\tlet tangents = null;\n\t\t\n\t\tlet vao = null;\n\t\t\n\t\tif(_genTangents) {\n\t\t\ttangents = vertices.forEach((vertex, index, arr) => {\n\t\t\t\tarr.splice(index, 1, vertex.getTangent().x, vertex.getTangent().y, vertex.getTangent().z);\n\t\t\t});\n\t\t\t\n\t\t\tvao = __WEBPACK_IMPORTED_MODULE_0__core_Loop__[\"b\" /* buffers */].createVAO(indices, positions, textureCoords, normals, tangents);\n\t\t} else {\n\t\t\tvao = __WEBPACK_IMPORTED_MODULE_0__core_Loop__[\"b\" /* buffers */].createVAO(indices, positions, textureCoords, normals);\t\n\t\t}\n\t\t\n\t\treturn vao;\n\t}\n\t\n\tthis.clean = function() {\n\t\t_vertices.length = 0;\n\t\t_normals.length = 0;\n\t\t_texCoords.length = 0;\n\t}\n}", "function loadFile(file){\n\t\tlet fs = require('fs');\n\t\tlet content = fs.readFileSync(file);\n\t\tlet obj = JSON.parse(content);\n\t\treturn obj;\n\t}", "function Object_3DClass(){ \n this._geometry = new THREE.BoxGeometry( 1, 1, 1 );\n this._material = new THREE.MeshBasicMaterial( { color: 0xff00ff } );\n this._mesh = new THREE.Mesh( this._geometry, this._material );\n}", "function OBJPartLoader(params) {\n this.fs = params.fs;\n this.debug = params.debug;\n this.meshPath = params.meshPath || 'part_objs/';\n this.objectLoadOptions = params.objectLoadOptions || {};\n this.objectLoader = params.objectLoader || new SimpleObjLoader();\n}", "function loadMesh(objName, func)\n{ \n var objLoader = new THREE.OBJLoader();\n objLoader.load('./geo/' + objName + '.obj', function(obj) {\n obj.traverse( function ( child ) {\n if ( child instanceof THREE.Mesh ) {\n func(child);\n }\n });\n });\n}", "function fileToObject(file) {\n return __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, file, { lastModified: file.lastModified, lastModifiedDate: file.lastModifiedDate, name: file.name, size: file.size, type: file.type, uid: file.uid, percent: 0, originFileObj: file });\n}", "function object3d() {\n this.uuid = \"\";\n this.name = \"\";\n return this;\n}", "function Shape(shapeObj) {\n this.x = shapeObj.x || 0; // Rect setup\n this.y = shapeObj.y || 0;\n this.w = shapeObj.w || 1;\n this.h = shapeObj.h || 1;\n this.color = shapeObj.color || '#000';\n }", "async load(path) {\n\n // Fetch the model file\n const response = await fetch(`/${this.path}/${path}`);\n\n // Parse the request as binary buffer\n const data = await response.arrayBuffer();\n\n // Parse the binary buffer to a buffer\n const buffer = Buffer.from(data);\n\n // Parse the buffer to mesh data\n const model = this.parse(buffer);\n\n // Return the model\n return model;\n }", "function setUpreload(world) {\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n var fileSelected = document.getElementById(\"txtfiletoread\");\n fileSelected.addEventListener(\n \"change\",\n function(e) {\n //Get the file object\n var fileTobeRead = fileSelected.files[0];\n //Initialize the FileReader object to read the 2file\n var fileReader = new FileReader();\n fileReader.onload = function(e) {\n var result = fileReader.result.split(/\\s+/);\n if (result.length % 6 != 0 || result.length < 18) {\n console.log(result);\n alert(\"Wrong data format or too few data entries\");\n }\n // re-setup the world\n world.renderer.setAnimationLoop(null);\n removeAllPoints(world);\n\n // add points\n for (var i = 0; i < result.length / 6; i++) {\n var new_point = new ControlPoint(\n parseInt(result[i * 6]),\n parseInt(result[i * 6 + 1]),\n parseInt(result[i * 6 + 2]),\n world\n );\n new_point.setOrient(\n parseInt(result[i * 6 + 3]),\n parseInt(result[i * 6 + 4]),\n parseInt(result[i * 6 + 5])\n );\n world.addObject(new_point.mesh);\n console.log(new_point);\n }\n\n // initial calculations\n drawCurves(params.CurveSegments);\n computeNormals(params.CurveSegments);\n computerTimeIncrements();\n drawRail(params.CurveSegments);\n world.renderer.setAnimationLoop(render);\n };\n fileReader.readAsText(fileTobeRead);\n },\n false\n );\n } else {\n alert(\"Files are not supported\");\n }\n}", "constructor() {\n // constructor(): Scenes begin by populating initial values like the Shapes and Materials they'll need.\n super();\n\n // ** Shapes **\n this.shapes = {\n axis: new defs.Axis_Arrows(),\n board: new defs.Capped_Cylinder(5, 100, [0, 1]),\n background: new defs.Square(),\n dart: new Shape_From_File('assets/dart.obj'),\n numbers: new Text_Line(3)\n };\n\n // ** Materials **\n this.materials = {\n phong: new Material(new defs.Phong_Shader(), {\n ambient: 0.5, color: hex_color(\"#ffffff\"),\n }),\n dart_texture: new Material(new defs.Textured_Phong(), {\n color: color(0, 0, 0, 1),\n ambient: 0.5, diffusivity: .5, specularity: .5, diffuseMap: 3, stupid: 4, texture: new Texture(\"assets/gold.jpg\")\n }),\n dartboard_texture: new Material(new defs.Textured_Phong(1), {\n color: color(0, 0, 0, 1),\n ambient: 1, diffusivity: .5, specularity: .5, texture: new Texture(\"assets/dartboard.png\")\n }),\n background_texture: new Material(new defs.Textured_Phong(1), {\n color: color(0, 0, 0, 1),\n ambient: 0.8, diffusivity: .5, specularity: .5, texture: new Texture(\"assets/background.png\")\n }),\n wall_texture: new Material(new defs.Textured_Phong(1), {\n color: color(0, 0, 0, 1),\n ambient: 0.8, diffusivity: .5, specularity: .5, texture: new Texture(\"assets/wall.png\")\n }),\n floor_texture: new Material(new defs.Textured_Phong(1), {\n color: color(0, 0, 0, 1),\n ambient: 0.8, diffusivity: .5, specularity: .5, texture: new Texture(\"assets/floor.jpg\")\n }),\n ceiling_texture: new Material(new defs.Textured_Phong(1), {\n color: color(0, 0, 0, 1),\n ambient: 0.8, diffusivity: .5, specularity: .5, texture: new Texture(\"assets/ceiling.jpg\")\n }),\n nums_texture: new Material(new defs.Textured_Phong(1), {\n ambient: 1, diffusivity: 0, specularity: 0, texture: new Texture(\"assets/numbers.png\")\n })\n };\n\n this.initial_camera_location = Mat4.look_at(vec3(0, 10, 20), vec3(0, 0, 0), vec3(0, 1, 0));\n this.spin_angle = 0;\n this.num_left = 3\n }", "function loadModels() {\n \n inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\"); // read in the triangle data\n\n try {\n if (inputTriangles == String.null)\n throw \"Unable to load triangles file!\";\n else {\n var whichSetVert; // index of vertex in current triangle set\n var whichSetTri; // index of triangle in current triangle set\n var vtxToAdd; // vtx coords to add to the coord array\n var normToAdd; // vtx normal to add to the coord array\n var texToAdd; // vtx texture to add to the texture array\n var uvToAdd; // uv coords to add to the uv arry\n var triToAdd; // tri indices to add to the index array\n var maxCorner = vec3.fromValues(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE); // bbox corner\n var minCorner = vec3.fromValues(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE); // other corner\n \n // process each triangle set to load webgl vertex and triangle buffers\n numTriangleSets = inputTriangles.length; // remember how many tri sets\n for (var whichSet=0; whichSet<numTriangleSets; whichSet++) { // for each tri set\n\n inputTriangles[whichSet].index = curInd;\n curInd++;\n \n // set up hilighting, modeling translation and rotation\n inputTriangles[whichSet].center = vec3.fromValues(0,0,0); // center point of tri set\n inputTriangles[whichSet].on = false; // not highlighted\n inputTriangles[whichSet].translation = vec3.fromValues(0,0,0); // no translation\n inputTriangles[whichSet].xAxis = vec3.fromValues(1,0,0); // model X axis\n inputTriangles[whichSet].yAxis = vec3.fromValues(0,1,0); // model Y axis\n inputTriangles[whichSet].longevity = 0;\n\n // set up the vertex and normal arrays, define model center and axes\n inputTriangles[whichSet].glVertices = []; // flat coord list for webgl\n inputTriangles[whichSet].glNormals = []; // flat normal list for webgl\n inputTriangles[whichSet].glTextures = []; // flat texture list for webgl\n var numVerts = inputTriangles[whichSet].vertices.length; // num vertices in tri set\n for (whichSetVert=0; whichSetVert<numVerts; whichSetVert++) { // verts in set\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert]; // get vertex to add\n normToAdd = inputTriangles[whichSet].normals[whichSetVert]; // get normal to add\n texToAdd = inputTriangles[whichSet].uvs[whichSetVert]; // get uv to add\n inputTriangles[whichSet].glVertices.push(vtxToAdd[0],vtxToAdd[1],vtxToAdd[2]); // put coords in set coord list\n inputTriangles[whichSet].glNormals.push(normToAdd[0],normToAdd[1],normToAdd[2]); // put normal in set coord list\n inputTriangles[whichSet].glTextures.push(texToAdd[0],texToAdd[1]); // put texture in set coord list\n vec3.max(maxCorner,maxCorner,vtxToAdd); // update world bounding box corner maxima\n vec3.min(minCorner,minCorner,vtxToAdd); // update world bounding box corner minima\n vec3.add(inputTriangles[whichSet].center,inputTriangles[whichSet].center,vtxToAdd); // add to ctr sum\n } // end for vertices in set\n vec3.scale(inputTriangles[whichSet].center,inputTriangles[whichSet].center,1/numVerts); // avg ctr sum\n\n // send the vertex coords and normals to webGL\n vertexBuffers[whichSet] = gl.createBuffer(); // init empty webgl set vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].glVertices),gl.STATIC_DRAW); // data in\n normalBuffers[whichSet] = gl.createBuffer(); // init empty webgl set normal component buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].glNormals),gl.STATIC_DRAW); // data in\n textureBuffers[whichSet] = gl.createBuffer(); // init empty webgl set texture component buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,textureBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].glTextures),gl.STATIC_DRAW); // data in\n \n // set up the triangle index array, adjusting indices across sets\n inputTriangles[whichSet].glTriangles = []; // flat index list for webgl\n triSetSizes[whichSet] = inputTriangles[whichSet].triangles.length; // number of tris in this set\n for (whichSetTri=0; whichSetTri<triSetSizes[whichSet]; whichSetTri++) {\n triToAdd = inputTriangles[whichSet].triangles[whichSetTri]; // get tri to add\n inputTriangles[whichSet].glTriangles.push(triToAdd[0],triToAdd[1],triToAdd[2]); // put indices in set list\n } // end for triangles in set\n\n // send the triangle indices to webGL\n triangleBuffers.push(gl.createBuffer()); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[whichSet]); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(inputTriangles[whichSet].glTriangles),gl.STATIC_DRAW); // data in\n\n } // end for each triangle set \n \n inputEllipsoids = getJSONFile(INPUT_ELLIPSOIDS_URL,\"ellipsoids\"); // read in the ellipsoids\n\n if (inputEllipsoids == String.null)\n throw \"Unable to load ellipsoids file!\";\n else {\n \n // init ellipsoid highlighting, translation and rotation; update bbox\n var ellipsoid; // current ellipsoid\n var ellipsoidModel; // current ellipsoid triangular model\n var temp = vec3.create(); // an intermediate vec3\n var minXYZ = vec3.create(), maxXYZ = vec3.create(); // min/max xyz from ellipsoid\n numEllipsoids = inputEllipsoids.length; // remember how many ellipsoids\n for (var whichEllipsoid=0; whichEllipsoid<numEllipsoids; whichEllipsoid++) {\n \n // set up various stats and transforms for this ellipsoid\n ellipsoid = inputEllipsoids[whichEllipsoid];\n ellipsoid.on = false; // ellipsoids begin without highlight\n ellipsoid.translation = vec3.fromValues(0,0,0); // ellipsoids begin without translation\n ellipsoid.xAxis = vec3.fromValues(1,0,0); // ellipsoid X axis\n ellipsoid.yAxis = vec3.fromValues(0,1,0); // ellipsoid Y axis \n ellipsoid.center = vec3.fromValues(ellipsoid.x,ellipsoid.y,ellipsoid.z); // locate ellipsoid ctr\n ellipsoid.longevity = 0;\n if (ellipsoid.tag == 'asteroid') {\n asteroids.push(ellipsoid);\n }\n if (ellipsoid.tag == 'highlight') {\n ellipsoid.translation = vec3.fromValues(station_centers[0][0], station_centers[0][1], station_centers[0][2]);\n highlight = ellipsoid;\n }\n if (ellipsoid.tag == 'station') {\n stations.push(ellipsoid);\n }\n if (ellipsoid.tag == 'moon') {\n ellipsoid.translation = vec3.fromValues(0, 0, 4);\n }\n ellipsoid.index = curInd;\n curInd++;\n\n vec3.set(minXYZ,ellipsoid.x-ellipsoid.a,ellipsoid.y-ellipsoid.b,ellipsoid.z-ellipsoid.c); \n vec3.set(maxXYZ,ellipsoid.x+ellipsoid.a,ellipsoid.y+ellipsoid.b,ellipsoid.z+ellipsoid.c); \n vec3.min(minCorner,minCorner,minXYZ); // update world bbox min corner\n vec3.max(maxCorner,maxCorner,maxXYZ); // update world bbox max corner\n\n // make the ellipsoid model\n ellipsoidModel = makeEllipsoid(ellipsoid,32);\n ellipsoid.glNormals = ellipsoidModel.normals;\n ellipsoid.glVertices = ellipsoidModel.vertices;\n ellipsoid.glTextures = ellipsoidModel.textures;\n ellipsoid.glTriangles = ellipsoidModel.triangles;\n \n // send the ellipsoid vertex coords and normals to webGL\n vertexBuffers.push(gl.createBuffer()); // init empty webgl ellipsoid vertex coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffers[vertexBuffers.length-1]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(ellipsoidModel.vertices),gl.STATIC_DRAW); // data in\n normalBuffers.push(gl.createBuffer()); // init empty webgl ellipsoid vertex normal buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,normalBuffers[normalBuffers.length-1]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(ellipsoidModel.normals),gl.STATIC_DRAW); // data in\n textureBuffers.push(gl.createBuffer()); // init empty webgl ellipsoid texture coord buffer\n gl.bindBuffer(gl.ARRAY_BUFFER,textureBuffers[textureBuffers.length-1]); // activate that buffer\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(ellipsoidModel.textures),gl.STATIC_DRAW); // data in\n \n triSetSizes.push(ellipsoidModel.triangles.length);\n \n // send the triangle indices to webGL\n triangleBuffers.push(gl.createBuffer()); // init empty triangle index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[triangleBuffers.length-1]); // activate that buffer\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(ellipsoidModel.triangles),gl.STATIC_DRAW); // data in\n } // end for each ellipsoid\n \n viewDelta = vec3.length(vec3.subtract(temp,maxCorner,minCorner)) / 100; // set global\n } // end if ellipsoid file loaded\n } // end if triangle file loaded\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end load models", "function loadTriangles() {\r\n inputTriangles = getJSONFile(INPUT_TRIANGLES_URL,\"triangles\");\r\n\r\n if (inputTriangles != String.null) { \r\n var whichSetVert; // index of vertex in current triangle set\r\n var whichSetTri; // index of triangle in current triangle set\r\n var vtxToAdd; // vtx coords to add to the coord array\r\n var triToAdd; // tri indices to add to the index array\r\n var vtxcToAdd;\r\n var vtxaToAdd;\r\n var vtxsToAdd;\r\n var vtxnToAdd;\r\n var vtxNormToAdd;\r\n var vtxLightToAdd;\r\n var view;\r\n var vtxHalfToAdd;\r\n\r\n // for each set of tris in the input file\r\n numTriangleSets = inputTriangles.length;\r\n for (var whichSet=0; whichSet<numTriangleSets; whichSet++) {\r\n centerTri[whichSet] = [0, 0, 0];\r\n // set up the vertex coord array\r\n inputTriangles[whichSet].coordArray = []; // create a list of coords for this tri set\r\n inputTriangles[whichSet].normArray = []; // create a list of coords for this tri set\r\n for (whichSetVert=0; whichSetVert<inputTriangles[whichSet].vertices.length; whichSetVert++) {\r\n vtxToAdd = inputTriangles[whichSet].vertices[whichSetVert];\r\n vtxcToAdd = inputTriangles[whichSet].material.diffuse;\r\n vtxaToAdd = inputTriangles[whichSet].material.ambient;\r\n vtxsToAdd = inputTriangles[whichSet].material.specular;\r\n vtxnToAdd = inputTriangles[whichSet].material.n;\r\n vtxNormToAdd = inputTriangles[whichSet].normals[whichSetVert];\r\n //new Vector(inputTriangles[whichSet].normals[whichSetVert].x, inputTriangles[whichSet].normals[whichSetVert].z, inputTriangles[whichSet].normals[whichSetVert].z);\r\n vtxLightToAdd = Vector.normalize(new Vector(light[0]-vtxToAdd[0], light[1]-vtxToAdd[1], light[2]-vtxToAdd[2]));\r\n view = Vector.normalize(new Vector(eye[0]-vtxToAdd[0], eye[1]-vtxToAdd[1], eye[2]-vtxToAdd[2]));\r\n vtxHalfToAdd = Vector.normalize(Vector.add(vtxLightToAdd, view));\r\n //push coord array\r\n inputTriangles[whichSet].coordArray.push(vtxToAdd[0],vtxToAdd[1],vtxToAdd[2]); //push vtx\r\n inputTriangles[whichSet].coordArray.push(vtxcToAdd[0],vtxcToAdd[1],vtxcToAdd[2]); //push diffuse\r\n inputTriangles[whichSet].coordArray.push(vtxaToAdd[0],vtxaToAdd[1],vtxaToAdd[2]); //push ambient\r\n inputTriangles[whichSet].coordArray.push(vtxsToAdd[0],vtxsToAdd[1],vtxsToAdd[2]); //push specular\r\n inputTriangles[whichSet].coordArray.push(vtxnToAdd); //push n\r\n //push norm array\r\n inputTriangles[whichSet].normArray.push(vtxNormToAdd[0],vtxNormToAdd[1],vtxNormToAdd[2]); //push norm\r\n inputTriangles[whichSet].normArray.push(vtxLightToAdd.x,vtxLightToAdd.y,vtxLightToAdd.z); //push light\r\n inputTriangles[whichSet].normArray.push(vtxHalfToAdd.x,vtxHalfToAdd.y,vtxHalfToAdd.z); //push half\r\n //collect vertex info for center\r\n centerTri[whichSet][0] += vtxToAdd[0];\r\n centerTri[whichSet][1] += vtxToAdd[1];\r\n centerTri[whichSet][2] += vtxToAdd[2];\r\n } // end for vertices in set\r\n //calculate center\r\n centerTri[whichSet][0] = centerTri[whichSet][0]/inputTriangles[whichSet].vertices.length;\r\n centerTri[whichSet][1] = centerTri[whichSet][1]/inputTriangles[whichSet].vertices.length;\r\n centerTri[whichSet][2] = centerTri[whichSet][2]/inputTriangles[whichSet].vertices.length;\r\n\r\n // send the vertex coords to webGL\r\n //console.log('TRI normArray', inputTriangles[whichSet].normArray);\r\n vertexBuffers[whichSet] = gl.createBuffer(); // init empty vertex coord buffer for current set\r\n gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffers[whichSet]); // activate that buffer\r\n gl.bufferData(gl.ARRAY_BUFFER,new Float32Array(inputTriangles[whichSet].coordArray),gl.STATIC_DRAW); // coords to that buffer\r\n\r\n //triangle norm array\r\n TriNormBuffer[whichSet] = gl.createBuffer(); //DID NOT normalize!\r\n gl.bindBuffer(gl.ARRAY_BUFFER, TriNormBuffer[whichSet]);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(inputTriangles[whichSet].normArray), gl.STATIC_DRAW);\r\n \r\n // set up the triangle index array, adjusting indices across sets\r\n inputTriangles[whichSet].indexArray = []; // create a list of tri indices for this tri set\r\n triSetSizes[whichSet] = inputTriangles[whichSet].triangles.length;\r\n for (whichSetTri=0; whichSetTri<triSetSizes[whichSet]; whichSetTri++) {\r\n triToAdd = inputTriangles[whichSet].triangles[whichSetTri];\r\n inputTriangles[whichSet].indexArray.push(triToAdd[0],triToAdd[1],triToAdd[2]);\r\n } // end for triangles in set\r\n\r\n // send the triangle indices to webGL\r\n triangleBuffers[whichSet] = gl.createBuffer(); // init empty triangle index buffer for current tri set\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[whichSet]); // activate that buffer\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,new Uint16Array(inputTriangles[whichSet].indexArray),gl.STATIC_DRAW); // indices to that buffer\r\n } // end for each triangle set \r\n } // end if triangles found\r\n} // end load triangles", "function readPgm(filename) {\n var _bytes = snarf(filename, \"binary\"); // Uint8Array\n var loc = 0;\n var { loc, word } = getAscii(_bytes, loc, true);\n if (word != \"P5\")\n\tthrow \"Bad magic: \" + word;\n var { loc, word } = getAscii(_bytes, loc);\n var width = parseInt(word);\n var { loc, word } = getAscii(_bytes, loc);\n var height = parseInt(word);\n var { loc, word } = getAscii(_bytes, loc);\n var maxval = parseInt(word);\n loc++;\n var T = TypedObject.uint8.array(width).array(height);\n var grid = new T;\n for ( var h=0 ; h < height ; h++ )\n\tfor ( var w=0 ; w < width ; w++ ) \n\t try { grid[h][w] = _bytes[loc+h*width+w]; } catch (e) { throw height + \" \" + width + \" \" + e + \" \" + h + \" \" + w }\n return { header: _bytes.subarray(0,loc), grid: grid, width: width, height: height, maxval: maxval };\n}", "function createObjectShip(name, ship) {\n\n // secondLoader.load(\"models/SpaceShips/\" + name + \"/\" + name + \".json\", (object: Object3D) => {\n // // this.mesh = new THREE.Mesh((<Mesh> object.children[0]).geometry, new THREE.MeshBasicMaterial({color: 0xFFFFFF}));\n // // {/*this.mesh.scale.set(.15, .15, .15);*/}\n // // {/*this.scene.add(this.mesh);*/}\n // // {/*resolve();*/}\n // });\n\n\n loader.load(\"models/SpaceShips/\" + name + \"/\" + name + \".json\", function (obj) {\n obj.children[0].name = params.ships.arrShips.length;\n obj.children[1].name = params.ships.arrShips.length;\n obj.children[2].name = params.ships.arrShips.length;\n obj.children[3].name = params.ships.arrShips.length;\n obj.children[4].name = params.ships.arrShips.length;\n obj.children[5].name = params.ships.arrShips.length;\n\n params.dataForSystem.scene.add(obj);\n\n\n params.ships.arrShips.push({ship, obj});\n\n // var loader = new THREE.LegacyJSONLoader();\n // loader.load( 'models/shuttle/shuttle.json', function ( geometry, materials ) {\n // var mesh = new THREE.Mesh( geometry, new THREE.MeshPhongMaterial( materials ) );\n // scene.add( mesh );\n // });\n\n // var loader = new THREE.ObjectLoader();\n // loader.load(\"models/shuttle/shuttle.json\",function ( obj ) {\n // // loader.load(\"models/starWars/star-wars-dogfight-webgl.json\",function ( obj ) {\n // scene.add( obj );\n // });\n });\n}", "function parse_OBJ_text( objText, convert_to_triangles )\n {\n // From: http://stackoverflow.com/questions/148901/is-there-a-better-way-to-do-optional-function-parameters-in-javascript\n if( typeof convert_to_triangles === \"undefined\" ) convert_to_triangles = true;\n \n /// Helper functions (strict mode requires us to put them at the top).\n // Parse a \"v\" line:\n function split_and_shift_float( objline )\n {\n var vals = objline.split(\" \");\n vals.shift();\n return vals.map( function( v ) { return parseFloat(v); } );\n }\n \n // Parse an \"f\" line:\n function split_and_shift_face_element_generator( face_property_index )\n {\n return function( face ) {\n var vals = face.split(\" \");\n vals.shift();\n return vals.map( function( val ) { return parseInt( val.split(\"/\")[ face_property_index ] )-1; } );\n };\n }\n \n // An assert-like function:\n function assert( x, msg ) { if( !x ) { console.log( msg ); alert( msg ); } }\n \n var obj = { 'vertex': {}, 'faceVertexIndices': {} };\n \n var matches = objText.match(/^v( -?(\\d+(\\.\\d*)?|\\.\\d+))+$/gm);\n if( matches ) obj.vertex.positions = matches.map( split_and_shift_float );\n \n matches = objText.match(/^vn( -?(\\d+(\\.\\d*)?|\\.\\d+))+$/gm);\n if( matches ) obj.vertex.normals = matches.map( split_and_shift_float );\n \n matches = objText.match(/^vt( -?(\\d+(\\.\\d*)?|\\.\\d+))+$/gm);\n if( matches ) obj.vertex.texCoords = matches.map( split_and_shift_float );\n \n // Convert quad faces to triangles inspired by:\n // http://www.alecjacobson.com/weblog/?p=1548\n // NOTE: This isn't general enough to handle faces with more than 4 vertices.\n if( convert_to_triangles )\n {\n matches = objText.match(/^f( \\d+(\\/\\d*){0,2}){3,4}$/gm);\n var num_facelines = matches.length;\n var facelines = matches.join(\"\\n\");\n facelines = facelines.replace(/^f ([0-9\\/]+) ([0-9\\/]+) ([0-9\\/]+) ([0-9\\/]+)$/gm, \"f $1 $2 $3\\nf $1 $3 $4\" );\n matches = facelines.match(/^f( \\d+(\\/\\d*){0,2}){3}$/gm);\n console.log( \"OBJUtils.parse_OBJ_text(): converted \" + ( matches.length - num_facelines ) + \" quad faces (out of \" + num_facelines + \") into triangles.\" );\n }\n else\n {\n matches = objText.match(/^f( \\d+(\\/\\d*){0,2})+$/gm);\n }\n if( matches )\n {\n obj.faceVertexIndices.positions = matches.map( split_and_shift_face_element_generator( 0 ) );\n \n // This is the first face's first vertex; we will test which\n // properties it has and assume all face vertices have the same properties.\n var test_face_vertex_data = matches[0].split(\" \")[1].split(\"/\");\n \n // Do we have texture coordinates?\n if( test_face_vertex_data.length >= 2 && test_face_vertex_data[1].length > 0 )\n {\n obj.faceVertexIndices.texCoords = matches.map( split_and_shift_face_element_generator( 1 ) );\n }\n \n // Do we have normals?\n if( test_face_vertex_data.length >= 3 && test_face_vertex_data[2].length > 0 )\n {\n obj.faceVertexIndices.normals = matches.map( split_and_shift_face_element_generator( 2 ) );\n }\n }\n \n return obj;\n }", "function Object3D()\n{\n\tthis.id = MathUtils.generateID();\n\tthis.name = \"\";\n\tthis.type = \"Object3D\";\n\t\n\t/**\n\t * Local position.\n\t */\n\tthis.position = new Vector3(0,0,0);\n\n\t/**\n\t * Local euler rotation.\n\t */\n\tthis.rotation = new Vector3(0,0,0);\n\n\t/**\n\t * Local scale.\n\t */\n\tthis.scale = new Vector3(1,1,1);\n\n\t/**\n\t * Indicates if the matrices should be automatically updated by the renderer.\n\t */\n\tthis.autoUpdateMatrix = true;\n\n\t/**\n\t * Indicates if the matrix needs to be updated.\n\t *\n\t * If a parent matrix is updated all children need to be updated as well.\n\t */\n\tthis.matrixNeedsUpdate = true;\n\n\t/**\n\t * Transformation matrix.\n\t */\n\tthis.transformationMatrix = new Matrix4();\n\n\t/** \n\t * World matrix to be used respecting the hierarchy of transformations.\n\t *\n\t * It is obtained by multiplying the parent matrix with the local transformation matrix.\n\t */\n\tthis.worldMatrix = new Matrix4();\n\n\t/**\n\t * Parent object3d element.\n\t *\n\t * The parent transformation is applied to its children.\n\t */\n\tthis.parent = null;\n\n\t/**\n\t * Children elements attached to this object.\n\t *\n\t * Children suffer the transformation applied to the parent object.\n\t */\n\tthis.children = [];\n}", "makeModel () {\n const y = -0.3\n const segment = this.size / this.lod;\n for (let i = -this.lod / 2; i < this.lod / 2; i++) {\n for (let j = -this.lod / 2; j < this.lod / 2; j++) {\n this.mesh = this.mesh.concat([\n segment * i, y, segment * j,\n segment * (i + 1), y, segment * j,\n segment * i, y, segment * (j + 1),\n segment * (i + 1), y, segment * j,\n segment * i, y, segment * (j + 1),\n segment * (i + 1), y, segment * (j + 1),\n ]);\n }\n }\n\n for (let i = 0; i < this.lod * this.lod * 6; i++) {\n this.normals = this.normals.concat([ 0.0, 1.0, 0.0 ]);\n }\n\n for (let i = 0; i < this.lod * this.lod; i++) {\n this.textureCoordinates = this.normals.concat([\n 0.0, 1.0,\n 0.0, 0.0,\n 1.0, 1.0,\n 1.0, 0.0,\n 0.0, 0.0,\n 1.0, 1.0,\n ])\n }\n\t}", "_createMesh() {\n var element = this._element;\n var w = element.calculatedWidth;\n var h = element.calculatedHeight;\n\n var r = this._rect;\n\n // Note that when creating a typed array, it's initialized to zeros.\n // Allocate memory for 4 vertices, 8 floats per vertex, 4 bytes per float.\n var vertexData = new ArrayBuffer(4 * 8 * 4);\n var vertexDataF32 = new Float32Array(vertexData);\n\n // Vertex layout is: PX, PY, PZ, NX, NY, NZ, U, V\n // Since the memory is zeroed, we will only set non-zero elements\n\n // POS: 0, 0, 0\n vertexDataF32[5] = 1; // NZ\n vertexDataF32[6] = r.x; // U\n vertexDataF32[7] = r.y; // V\n\n // POS: w, 0, 0\n vertexDataF32[8] = w; // PX\n vertexDataF32[13] = 1; // NZ\n vertexDataF32[14] = r.x + r.z; // U\n vertexDataF32[15] = r.y; // V\n\n // POS: w, h, 0\n vertexDataF32[16] = w; // PX\n vertexDataF32[17] = h; // PY\n vertexDataF32[21] = 1; // NZ\n vertexDataF32[22] = r.x + r.z; // U\n vertexDataF32[23] = r.y + r.w; // V\n\n // POS: 0, h, 0\n vertexDataF32[25] = h; // PY\n vertexDataF32[29] = 1; // NZ\n vertexDataF32[30] = r.x; // U\n vertexDataF32[31] = r.y + r.w; // V\n\n var vertexDesc = [\n { semantic: SEMANTIC_POSITION, components: 3, type: TYPE_FLOAT32 },\n { semantic: SEMANTIC_NORMAL, components: 3, type: TYPE_FLOAT32 },\n { semantic: SEMANTIC_TEXCOORD0, components: 2, type: TYPE_FLOAT32 }\n ];\n\n var device = this._system.app.graphicsDevice;\n var vertexFormat = new VertexFormat(device, vertexDesc);\n var vertexBuffer = new VertexBuffer(device, vertexFormat, 4, BUFFER_STATIC, vertexData);\n\n var mesh = new Mesh(device);\n mesh.vertexBuffer = vertexBuffer;\n mesh.primitive[0].type = PRIMITIVE_TRIFAN;\n mesh.primitive[0].base = 0;\n mesh.primitive[0].count = 4;\n mesh.primitive[0].indexed = false;\n mesh.aabb.setMinMax(Vec3.ZERO, new Vec3(w, h, 0));\n\n this._updateMesh(mesh);\n\n return mesh;\n }", "function geomFromOBJ(objcode) {\n\tlet lines = objcode.split(/\\r\\n|\\n/)\n let vertices = []\n let gvertices = []\n\tlet normals = []\n let gnormals = []\n\tlet texCoords = []\n\tlet gtexCoords = []\n\tlet memo = {}\n\tlet gindices = []\n\tlet indexcount=0;\n\tfor (let line of lines) {\n\t\tif (line.substring(0,2) == \"vn\") {\n\t\t\tlet match = line.match(/vn\\s+([0-9.e-]+)\\s+([0-9.e-]+)\\s+([0-9.e-]+)/)\n\t\t\tnormals.push([+match[1], +match[2], +match[3]])\n\t\t} else if (line.substring(0,2) == \"vt\") {\n let match = line.match(/vt\\s+([0-9.e-]+)\\s+([0-9.e-]+)/)\n texCoords.push([+match[1], +match[2]])\n\t\t} else if (line.substring(0,1) == \"v\") {\n let match = line.match(/v\\s+([0-9.e-]+)\\s+([0-9.e-]+)\\s+([0-9.e-]+)/)\n vertices.push([+match[1], +match[2], +match[3]])\n\t\t} else if (line.substring(0,1) == \"f\") {\n\t\t\tlet face = []\n\t\t\tlet match\n // this only works for v/vt/vn input\n\t\t\tlet regex = /([0-9]+)\\s*(\\/\\s*([0-9]*))?\\s*(\\/\\s*([0-9]*))?/g\n\t\t\twhile (match = regex.exec(line)) {\n let V = match[1]\n let T = match[3]\n let N = match[5]\n\t\t\t\tlet name = `${V}/${T}/${N}`\n\t\t\t\tlet id = memo[name]\n\t\t\t \tif (id == undefined) {\n\t\t\t\t\t// a new vertex/normal/texcoord combo, create a new entry for it\n\t\t\t\t\tid = indexcount;\n\t\t\t\t\tlet v = vertices[(+V)-1]\n gvertices.push(v[0], v[1], v[2])\n if (T && texCoords.length) {\n let vt = texCoords[(+T)-1]\n gtexCoords.push(vt[0], vt[1])\n }\n if (N && normals.length) {\n let vn = normals[(+N)-1]\n gnormals.push(vn[0], vn[1], vn[2])\n }\n\t\t\t\t\tmemo[name] = id;\n\t\t\t\t\tindexcount++;\n\t\t\t\t}\n\t\t\t\tif (face.length >= 3) {\n\t\t\t\t\t// triangle strip\n\t\t\t\t\t//face.push(face[face.length-1], face[face.length-2]);\n\t\t\t\t\t// triangle fan poly\n\t\t\t\t\tface.push(face[face.length-1], face[0]);\n\t\t\t\t}\n \t\t\t\tface.push(id);\n\t\t\t}\n\t\t\tfor (let id of face) {\n\t\t\t\tgindices.push(id);\n\t\t\t}\n\t\t} else {\n\t\t\t//console.log(\"ignored\", line)\n\t\t}\n\n }\n let geom = {\n vertices: new Float32Array(gvertices)\n }\n\tif (gnormals.length) geom.normals = new Float32Array(gnormals)\n\tif (gtexCoords.length) geom.texCoords = new Float32Array(gtexCoords)\n\tif (gindices.length) {\n geom.indices = new Uint32Array(gindices)\n }\n\treturn geom\n}", "loadFromFile(filename) {\n try {\n /* load using require as it can process both js and json */\n const data = requireUncached(filename);\n this.loadFromObject(data, filename);\n }\n catch (err) {\n if (err instanceof SchemaValidationError) {\n throw err;\n }\n throw new UserError(`Failed to load element metadata from \"${filename}\"`, err);\n }\n }", "function Shape( points ) {\n\n\tPath.call( this, points );\n\n\tthis.uuid = _Math.generateUUID();\n\n\tthis.type = 'Shape';\n\n\tthis.holes = [];\n\n}", "load(fileobject) {\n \n\t// Read returns a structure f\n\tbisgenericio.read(fileobject).then( (f) => {\n\t \n\t let obj = { };\n\t try { \n\t\tobj= JSON.parse(f.data);\n\t } catch(e) {\n\t\twebutil.createAlert(`Failed to parse input file ${f.filename}`,true);\n\t }\n \n\t let newvalues = {};\n\t newvalues.weight=obj.weight || 70.0;\n\t newvalues.height=obj.height || 1.70;\n\t newvalues.ismetric=obj.ismetric || false;\n\t this.setValues(newvalues);\n\n webutil.createAlert('Loaded from '+f.filename,false);\n \n\t}).catch( (e) => {\n webutil.createAlert(e,true);\n });\n \n }", "async import3dModel (engineData) {\n this._engine.displayLoadingUI();\n console.log('engineData on import ', engineData)\n let uniqueId = BABYLON.Tools.RandomId()\n if (isArray(engineData)) {\n for (let i = 0; i < engineData.length; i++) {\n let cuniqueId = BABYLON.Tools.RandomId()\n let pUniqueId\n if (Object.keys(this.objects).length !== 0) {\n pUniqueId = Object.keys(this.objects)[Object.keys(this.objects).length - 1]\n }\n else {\n pUniqueId = uniqueId\n this.objects[pUniqueId] = {}\n }\n \n this.objects[pUniqueId][cuniqueId] = engineData[i]\n await this.handleImport(engineData[i], [cuniqueId, pUniqueId])\n }\n }\n else {\n let pUniqueId\n if (Object.keys(this.objects).length !== 0) {\n pUniqueId = Object.keys(this.objects)[Object.keys(this.objects).length - 1]\n }\n else {\n pUniqueId = uniqueId\n this.objects[pUniqueId] = {}\n }\n \n this.electData.ComponentParts.push([engineData.name, engineData.name2d])\n\n this.objects[pUniqueId][uniqueId] = engineData\n await this.handleImport(engineData, [uniqueId, pUniqueId])\n }\n\n this._engine.hideLoadingUI();\n }", "loadFromFile(scenesFileLocation) {\n if (this.scenesFileLocation == null || this.scenesFileLocation == undefined) {\n console.warn(\"Warning! No scenesFileLocation file specified in config\")\n return\n }\n\n if (!fs.existsSync(this.scenesFileLocation)) {\n try {\n this.saveToFile()\n } catch (e) {\n console.error(e.message)\n console.warn(`Warning! Was not able to create scenes file at: ${this.scenesFileLocation}`)\n return\n }\n\n return\n }\n\n let scenesContent = []\n\n try {\n scenesContent = JSON.parse(fs.readFileSync(this.scenesFileLocation, 'utf8'));\n } catch (e) {\n console.error(e.message)\n console.warn(`Warning! Was not able to read contents of ${this.scenesFileLocation}`)\n return\n }\n\n for (const scene of scenesContent) {\n this.scenes.push(scene)\n }\n }", "function LoadMesh(Addr, obj){\n download(Addr)\n .then((mesh)=>{\n console.groupCollapsed(\"Receiving Mesh...\");\n console.log(\"Loading model: \"+ Addr);\n BindMesh(JSON.parse(mesh), obj);\n })\n .catch((err)=>{console.log(err);});\n}", "function readDataFile(fileText) {\n // Split the file text into individual lines\n var lines = fileText.split(/\\r\\n|\\r|\\n/);\n \n // Initialize some arrays to keep track of vertices, line \n // indices, and triangle indices\n var vertices = [];\n var linds = [];\n var trinds = [];\n \n // Loop through each line\n for( var i = 0; i < lines.length; ++i ) {\n // Split the line by whitespace\n var tokens = lines[i].split(\" \");\n \n // If there weren't 3 tokens on the line, we don't care about it\n if( tokens.length !== 3 ) {\n continue;\n }\n \n // If there were, we have a new vertex, update all arrays\n linds.push( linds.length );\n if( ((vertices.length / 3) + 1) % 4 !== 0 ) {\n trinds.push( vertices.length / 3 );\n }\n vertices.push( tokens[0], tokens[1], tokens[2] );\n }\n \n // Bind and set the data of the vbo\n gl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n vbo.length = vertices.length;\n \n // Bind and set the data of the lineIndices buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, lineIndices);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(linds), gl.STATIC_DRAW);\n lineIndices.length = linds.length;\n \n // Bind and set the data of the triangle Indices buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triIndices);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(trinds), gl.STATIC_DRAW);\n triIndices.length = trinds.length;\n \n // Finally, display the results of the computation\n display();\n}", "function processFile(){\n var file = document.querySelector(\"#myFile\").files[0] ;\n var reader = new FileReader() ;\n reader.readAsText(file) ;\n\n // only the when the file is loaded it can be analyzed\n reader.onload = function(event){\n var result = event.target.result ;\n var data = result.split(',') ;\n\n var width = parseInt(data[0]) ;\n var height = parseInt(data[1]) ;\n\n var table = new Float32Array(width*height*4) ;\n var p = 0 ;\n for (var i=2 ; i< data.length; i++){ // modify accordingly\n table[p++] = parseFloat( data[i]) ;\n }\n\n fcolor.data = table ;\n scolor.data = table ;\n }\n}", "constructor(canvas, scene, shapeType) {\n this.canvas = canvas;\n this.scene = scene;\n this.shapeType = shapeType;\n\n _inputHandler = this;\n\n // Mouse Events\n this.canvas.onmousemove = function(ev) { _inputHandler.click(ev) };\n this.canvas.onmousedown = function(ev) { _inputHandler.click(ev) };\n document.getElementById('objButton').onclick = function() {_inputHandler.readSelectedFile()};\n }", "function ShapefileTable(src, encoding) {\n var reader = new DbfReader(src, encoding),\n altered = false,\n table;\n\n function getTable() {\n if (!table) {\n // export DBF records on first table access\n table = new DataTable(reader.readRows());\n reader = null;\n src = null; // null out references to DBF data for g.c.\n }\n return table;\n }\n\n this.exportAsDbf = function(opts) {\n // export original dbf bytes if possible\n // (e.g. if the data attributes haven't changed)\n var useOriginal = !!reader && !altered && !opts.field_order && !opts.encoding;\n if (useOriginal) {\n try {\n // Maximum Buffer in current Node.js is 2GB\n // We fall back to import-export if getBuffer() fails.\n // This may produce a buffer that does not exceed the maximum size.\n return reader.getBuffer();\n } catch(e) {}\n }\n return Dbf.exportRecords(getTable().getRecords(), opts.encoding, opts.field_order);\n };\n\n this.getReadOnlyRecordAt = function(i) {\n return reader ? reader.readRow(i) : table.getReadOnlyRecordAt(i);\n };\n\n this.deleteField = function(f) {\n if (table) {\n table.deleteField(f);\n } else {\n altered = true;\n reader.deleteField(f);\n }\n };\n\n this.getRecords = function() {\n return getTable().getRecords();\n };\n\n this.getFields = function() {\n return reader ? reader.getFields() : table.getFields();\n };\n\n this.isEmpty = function() {\n return reader ? this.size() === 0 : table.isEmpty();\n };\n\n this.size = function() {\n return reader ? reader.size() : table.size();\n };\n }", "create(runChecks=false) {\n // TODO: use Float32Array instead of this, so that we can\n // construct directly from points read in from a file\n let delaunator = Delaunator.from(this.points);\n let graph = {\n _r_vertex: this.points,\n _triangles: delaunator.triangles,\n _halfedges: delaunator.halfedges\n };\n\n if (runChecks) {\n checkPointInequality(graph);\n checkTriangleInequality(graph);\n }\n \n graph = addGhostStructure(graph);\n graph.numBoundaryRegions = this.numBoundaryRegions;\n if (runChecks) {\n checkMeshConnectivity(graph);\n }\n\n return new TriangleMesh(graph);\n }", "open(file) {\n this.file = file;\n this.input = this.file.input;\n this.state = new State();\n this.state.init(this.options, this.file);\n }", "function Shape4(){}", "function Shape(){\n\n /**\n * Identifyer of the Shape.\n * @property {number} id\n */\n this.id = Shape.idCounter++;\n\n /**\n * The type of this shape. Must be set to an int > 0 by subclasses.\n * @property type\n * @type {Number}\n * @see Shape.types\n */\n this.type = 0;\n\n /**\n * The local bounding sphere radius of this shape.\n * @property {Number} boundingSphereRadius\n */\n this.boundingSphereRadius = 0;\n\n /**\n * Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled.\n * @property {boolean} collisionResponse\n */\n this.collisionResponse = true;\n\n /**\n * @property {Material} material\n */\n this.material = null;\n\n /**\n * @property {Body} body\n */\n this.body = null;\n}", "function Shape() {}", "loadFile(file, module, x, y) {\n var dsp_code;\n var reader = new FileReader();\n var ext = file.name.toString().split('.').pop();\n var filename = file.name.toString().split('.').shift();\n var type;\n if (ext == \"dsp\") {\n type = \"dsp\";\n reader.readAsText(file);\n }\n else if (ext == \"json\") {\n type = \"json\";\n reader.readAsText(file);\n }\n else if (ext == \"jfaust\") {\n type = \"jfaust\";\n reader.readAsText(file);\n }\n else if (ext == \".polydsp\") {\n type = \"poly\";\n reader.readAsText(file);\n }\n else {\n throw new Error(Utilitary.messageRessource.errorObjectNotFaustCompatible);\n }\n reader.onloadend = (e) => {\n dsp_code = \"process = vgroup(\\\"\" + filename + \"\\\",environment{\" + reader.result + \"}.process);\";\n if (!module) {\n if (type == \"dsp\") {\n this.compileFaust({ isMidi: false, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n this.compileFaust({ isMidi: true, name: filename, sourceCode: dsp_code, x: x, y: y, callback: (factory) => { this.createModule(factory); } });\n }\n }\n else {\n if (type == \"dsp\") {\n module.isMidi = false;\n module.update(filename, dsp_code);\n }\n else if (type == \"jfaust\") {\n Utilitary.currentScene.recallScene(reader.result);\n }\n else if (type == \"poly\") {\n module.isMidi = true;\n module.update(filename, dsp_code);\n }\n }\n };\n }", "function render3d() {\n\n createBezierCurves();\n\n // create all models\n var models = [];\n curves.forEach((c)=>{\n models.push(new BezierModel(c.vertices));\n });\n points = [];\n normals = [];\n colors = [];\n texCoordsArray = [];\n // build the main object\n buildObjects({objects:models});\n\n // load colors, points, and normals to buffer\n loadVertices(program);\n loadColors(program);\n loadNormals(program);\n loadTextureArray(program);\n\n}", "function MyTriangle(scene, x1, y1, z1, x2, y2, z2, x3, y3, z3, lS = 1, lT = 1) {\n\tCGFobject.call(this,scene);\n\tthis.x1 = x1; //x value of the 1st point of the triangle\n\tthis.y1 = y1; //y value of the 1st point of the triangle\n\tthis.z1 = z1; //z value of the 1st point of the triangle\n\tthis.x2 = x2; //x value of the 2nd point of the triangle\n\tthis.y2 = y2; //y value of the 2nd point of the triangle\n\tthis.z2 = z2; //z value of the 2nd point of the triangle\n\tthis.x3 = x3; //x value of the 3rd point of the triangle\n\tthis.y3 = y3; //y value of the 3rd point of the triangle\n\tthis.z3 = z3; //z value of the 3rd point of the triangle\n\tthis.lS = lS; //S direction scale factor for texture applying\n\tthis.lT = lT; //T direction scale factor for texture applying\n\tthis.initBuffers();\n}", "function readNonIndexedShape(shpFile, start, i) {\n var expectedId = i + 1, // Shapefile ids are 1-based\n offset = start,\n fileSize = shpFile.size(),\n shape = null,\n bin, recordId, recordType, isValidType;\n while (offset + 12 <= fileSize) {\n bin = shpFile.readToBinArray(offset, 12);\n recordId = bin.bigEndian().readUint32();\n recordType = bin.littleEndian().skipBytes(4).readUint32();\n isValidType = recordType == shpType || recordType === 0;\n if (!isValidType || recordId != expectedId && recordType === 0) {\n offset += 4; // keep scanning -- try next integer position\n continue;\n }\n shape = readShapeAtOffset(shpFile, offset);\n if (!shape) break; // probably ran into end of file\n shpOffset = offset + shape.byteLength; // update\n if (recordId == expectedId) break; // found an apparently valid shape\n if (recordId < expectedId) {\n message(\"Found a Shapefile record with the same id as a previous record (\" + shape.id + \") -- skipping.\");\n offset += shape.byteLength;\n } else {\n stop(\"Shapefile contains an out-of-sequence record. Possible data corruption -- bailing.\");\n }\n }\n if (shape && offset > start) {\n verbose(\"Skipped over \" + (offset - start) + \" non-data bytes in the .shp file.\");\n }\n return shape;\n }", "function File() {\n _classCallCheck(this, File);\n\n File.initialize(this);\n }", "function loadModel() {\n if (g.object.type === 'Group') {\n g.object.traverse( function ( child ) {\n if ( child.isMesh ) {\n child.material.map = g.mat.map;\n child.material.normalMap = g.mat.normalMap;\n //child.material.roughnessMap = g.mat.roughnessMap;\n //child.material.displacementMap = g.mat.displacementMap;\n child.material.normalMap = g.mat.normalMap;\n child.material.shininess = 2000;\n }\n } );\n }\n\t}", "function preLoad() {\n\tconst promises = [];\n\tusr_res = {};\n\tworkspace.getBlocksByType('b3js_create_mesh_from_file').forEach((b) => {\n\t\tconst key = 'mesh_' + b.getFieldValue('NAME');\n\t\tconst file_name = b.getInputTargetBlock('VALUE').getFieldValue('TEXT');\n\n\t\tif (file_name.indexOf('.obj') >= 0) {\n\t\t\tconst mtl = file_name.replace('.obj', '.mtl');\n\t\t\tpromises.push(new Promise((resolve, reject) => {\n\t\t\t\tnew THREE.MTLLoader().setResourcePath('./resources/')\n\t\t\t\t\t.load('./resources/' + mtl, (m) => {\n\t\t\t\t\t\tnew THREE.OBJLoader().setMaterials(m)\n\t\t\t\t\t\t\t.load('./resources/' + file_name, (obj) => resolve([key, obj]), undefined, reject);\n\t\t\t\t\t});\n\t\t\t}));\n\t\t}\n\t\telse if (file_name.indexOf('.dae') >= 0) {\n\t\t\tpromises.push(new Promise((resolve, reject) => {\n\t\t\t\tnew THREE.ColladaLoader()\n\t\t\t\t\t.load('./resources/' + file_name, (dae) => resolve([key, dae]), undefined, reject);\n\t\t\t}));\n\t\t}\n\t\telse if (file_name.indexOf('.gltf') >= 0 || file_name.indexOf('.glb') >= 0) {\n\t\t\tpromises.push(new Promise((resolve, reject) => {\n\t\t\t\tnew THREE.GLTFLoader()\n\t\t\t\t\t.load('./resources/' + file_name, (gltf) => resolve([key, gltf]), undefined, reject);\n\t\t\t}));\n\t\t}\n\t});\n\n\treturn promises;\n}" ]
[ "0.6393649", "0.61995274", "0.6167601", "0.5961024", "0.57780874", "0.55918825", "0.55484647", "0.5497059", "0.54948187", "0.5462454", "0.5462454", "0.54529166", "0.5452153", "0.53980356", "0.5369112", "0.52676165", "0.5253596", "0.5246909", "0.5221981", "0.5215817", "0.5201176", "0.5189193", "0.51767904", "0.51354086", "0.5132225", "0.5132225", "0.5057208", "0.50423443", "0.4991087", "0.4977137", "0.4962333", "0.4947053", "0.49456203", "0.49435407", "0.49377805", "0.49300295", "0.49288577", "0.48871064", "0.48654604", "0.48598173", "0.48526913", "0.4825441", "0.48126325", "0.48083657", "0.47922677", "0.479088", "0.4777562", "0.47723994", "0.47705257", "0.4763999", "0.4761171", "0.47431195", "0.47376838", "0.47189397", "0.47025722", "0.46903202", "0.46862307", "0.46821833", "0.46668398", "0.46658787", "0.46541637", "0.46324608", "0.46180266", "0.4612811", "0.46092746", "0.45962036", "0.45845672", "0.45840457", "0.45782846", "0.4562845", "0.4560135", "0.45464814", "0.4541569", "0.45401138", "0.4535658", "0.45311004", "0.45288485", "0.45263976", "0.4522486", "0.45111322", "0.45006844", "0.4494911", "0.4489605", "0.4488177", "0.4477229", "0.44725242", "0.44696563", "0.44531876", "0.44294545", "0.4424563", "0.44241032", "0.44239053", "0.4419406", "0.44157836", "0.4409169", "0.44013014", "0.4389754", "0.43820876", "0.43778366", "0.43753672" ]
0.5545399
7
Subclasses of Shader each store and manage a complete GPU program.
material() { // Materials here are minimal, without any settings. return {shader: this} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Shader()\n {\n var program_;\n var uniforms_;\n var attributes_;\n var samplerSlots_;\n }", "function initShaders() { \n \n Shader = (function() {\n \n var UNIFORM_SETTER = {};\n\n // Return the number of elements for GL type\n var getTypeLength = function(type) {\n\n switch(type) {\n case gl.FLOAT_MAT4:\n return 4*4;\n case gl.FLOAT_MAT3:\n return 3*3;\n case gl.FLOAT_MAT2:\n return 2*2;\n case gl.FLOAT_VEC4:\n case gl.INT_VEC4:\n case gl.BOOL_VEC4:\n return 4;\n case gl.FLOAT_VEC3:\n case gl.INT_VEC3:\n case gl.BOOL_VEC3:\n return 3;\n case gl.FLOAT_VEC2:\n case gl.INT_VEC2:\n case gl.BOOL_VEC2:\n return 2;\n default:\n return 1;\n }\n \n }\n\n // Map GL type to a uniform setter method\n UNIFORM_SETTER[gl.FIXED] = gl.uniform1i;\n UNIFORM_SETTER[gl.SHORT] = gl.uniform1i;\n UNIFORM_SETTER[gl.UNSIGNED_BYTE] = gl.uniform1i;\n UNIFORM_SETTER[gl.BYTE] = gl.uniform1i;\n UNIFORM_SETTER[gl.INT] = gl.uniform1i;\n UNIFORM_SETTER[gl.UNSIGNED_INT] = gl.uniform1i;\n UNIFORM_SETTER[gl.FLOAT] = gl.uniform1f;\n UNIFORM_SETTER[gl.SAMPLER_2D] = gl.uniform1i;\n\n UNIFORM_SETTER[gl.FLOAT_MAT4] = gl.uniformMatrix4fv;\n UNIFORM_SETTER[gl.FLOAT_MAT3] = gl.uniformMatrix3fv;\n UNIFORM_SETTER[gl.FLOAT_MAT2] = gl.uniformMatrix2fv;\n\n UNIFORM_SETTER[gl.FLOAT_VEC2] = gl.uniform2fv;\n UNIFORM_SETTER[gl.FLOAT_VEC3] = gl.uniform3fv;\n UNIFORM_SETTER[gl.FLOAT_VEC4] = gl.uniform4fv;\n UNIFORM_SETTER[gl.INT_VEC2] = gl.uniform2iv;\n UNIFORM_SETTER[gl.INT_VEC3] = gl.uniform3iv;\n UNIFORM_SETTER[gl.INT_VEC4] = gl.uniform4iv;\n UNIFORM_SETTER[gl.BOOL] = gl.uniform1i;\n UNIFORM_SETTER[gl.BOOL_VEC2] = gl.uniform2iv;\n UNIFORM_SETTER[gl.BOOL_VEC3] = gl.uniform3iv;\n UNIFORM_SETTER[gl.BOOL_VEC4] = gl.uniform4iv;\n\n var defaultShader = null; // Default shader program\n var programCache = {}; // Store of all loading shader programs\n\n \n // Get and Compile and fragment or vertex shader by ID.\n // (shader source is currently embeded within HTML file)\n function getShader(gl, id) {\n var shaderScript = doc.getElementById(id);\n if (!shaderScript) {\n return null;\n }\n\n var str = \"\";\n var k = shaderScript.firstChild;\n while (k) {\n if (k.nodeType == 3) {\n str += k.textContent;\n }\n k = k.nextSibling;\n }\n\n var shader;\n if (shaderScript.type == \"x-shader/x-fragment\") {\n shader = gl.createShader(gl.FRAGMENT_SHADER);\n } else if (shaderScript.type == \"x-shader/x-vertex\") {\n shader = gl.createShader(gl.VERTEX_SHADER);\n } else {\n return null;\n }\n\n gl.shaderSource(shader, str);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(shader));\n return null;\n }\n return shader;\n }\n \n // Shader data object\n // - program: GL Shader program\n // - meta: list of metadata about GL Shader program (uniform names/types)\n function createShaderObj(shaderProgram) {\n return {\n program: shaderProgram,\n meta: getShaderData(shaderProgram)\n };\n }\n \n\n // Create, load and link a GL shader program \n function loadShaderProgram(v,f) {\n \n v = \"Shaders/vpBasic.cg\" // ab: temp \n //f = \"fpXRAY.cg\";\n \n v = v.split(\".cg\").join(\"\");\n f = f.split(\".cg\").join(\"\");\n \n var name = v+\"+\"+f;\n \n if (programCache[name]) {\n return programCache[name];\n }\n \n var fragmentShader = getShader(gl, f);\n var vertexShader = getShader(gl, v);\n \n if (!fragmentShader || !vertexShader) {\n console.error(\"missing shader \"+ name)\n return null;\n }\n \n var shaderProgram = gl.createProgram();\n \n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n console.error(\"LINK_STATUS error\")\n return null;\n }\n \n var shaderObj = createShaderObj(shaderProgram); \n var attribute = shaderObj.meta.attribute;\n\n gl.useProgram(shaderProgram);\n\n gl.enableVertexAttribArray(attribute.aVertexPosition.location);\n gl.enableVertexAttribArray(attribute.aTextureCoord.location);\n \n gl.bindBuffer(gl.ARRAY_BUFFER, gl.box.vertexObject);\n gl.vertexAttribPointer(attribute.aVertexPosition.location, gl.box.vertexObject.itemSize, gl.FLOAT, false, 0, 0);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, gl.box.texCoordObject);\n gl.vertexAttribPointer(attribute.aTextureCoord.location, gl.box.texCoordObject.itemSize, gl.FLOAT, false, 0, 0);\n\n shaderProgram = createShaderObj(shaderProgram)\n programCache[name] = shaderProgram;\n \n if (!defaultShader) {\n defaultShader = shaderObj;\n }\n \n return shaderObj;\n }\n\n // Create shader program metadata (uniform names/types)\n var getShaderData = function(shader) {\n \n var meta = {uniforms:[], uniform:{}, attribute:{}};\n\n var keys = [],i;\n for (i in gl) {\n keys.push(i);\n }\n keys = keys.sort();\n\n var rgl = {}\n\n keys.forEach(function(key) {\n rgl[gl[key]] = key;\n })\n\n var info;\n var i = 0;\n var len = gl.getProgramParameter(shader, gl.ACTIVE_UNIFORMS)\n \n while (i<len) {\n \n info = gl.getActiveUniform(shader,i);\n meta.uniforms.push(info.name);\n meta.uniform[info.name] = {\n name: info.name,\n glType: info.type,\n type: rgl[info.type],\n length: getTypeLength(info.type),\n idx: i,\n location: gl.getUniformLocation(shader, info.name)\n };\n \n i++;\n }\n\n len = gl.getProgramParameter(shader, gl.ACTIVE_ATTRIBUTES)\n i = 0;\n while (i<len) {\n info = gl.getActiveAttrib(shader,i);\n meta.attribute[info.name] = {\n name: info.name,\n glType: info.type,\n type: rgl[info.type],\n length: getTypeLength(info.type),\n idx: i,\n location: gl.getAttribLocation(shader, info.name)\n };\n i++;\n }\n \n return meta;\n\n }\n\n // (createShader maps to this method)\n return function(v,f) {\n \n var glShader = loadShaderProgram(v,f) || defaultShader;\n \n var shaderValues = {\n alpha: 1\n };\n \n var self = this;\n \n // Create getter/setters for all uniforms and textures on Shader object\n glShader.meta.uniforms.forEach(function(name) {\n var uniform = glShader.meta.uniform[name];\n var len = uniform.length;\n var name = uniform.name;\n var vals = shaderValues;\n (name != \"uMVMatrix\" && name != \"uMVMatrix\")&&Object.defineProperty(self, uniform.name, {\n get: function() {\n return vals[name];\n },\n set: function(v) {\n if (v && v.length !== len) {\n v.length = len;\n }\n vals[name] = v;\n }\n }); \n });\n \n // Draw leaf node\n // (mv matrix, primary texture passed in)\n // [internal method]\n this.__draw = function(gl, mv, imageTexture) {\n \n var usetter = UNIFORM_SETTER;\n var meta = glShader.meta;\n var uniform = meta.uniform;\n var uniforms = meta.uniforms;\n var name, val, u, i = uniforms.length;\n \n // Change shader program if different from last draw\n //if (gl.currentShaderProgram !== glShader) {\n gl.currentShaderProgram = glShader;\n gl.useProgram(glShader.program);\n gl.uniformMatrix4fv(uniform.uPMatrix.location, false, gl.perspectiveMatrixArray);\n //}\n \n // set mv matrix\n gl.uniformMatrix4fv(uniform.uMVMatrix.location, false, mv);\n \n // add primary texture to shader values\n var vals = shaderValues;\n \n if (imageTexture) {\n vals.texture = imageTexture;\n }\n\n var textureSlot = 0;\n \n // Iterate over uniforms and textures setting values from JS to shader program\n while (i--) { \n name = uniforms[i];\n val = vals[name];\n u = uniform[name];\n \n if (val !== undefined && val !== null) {\n if (u.glType === gl.SAMPLER_2D) { // if texture\n gl.activeTexture(gl['TEXTURE'+textureSlot]);\n gl.bindTexture(gl.TEXTURE_2D, val);\n val = textureSlot++;\n }\n usetter[u.glType].apply(gl, [u.location, val]); // uses uniform setter map to set value\n }\n }\n \n // Draw call\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n \n }\n \n this.__getShaderProgram = function() {\n return glShader.program;\n }\n\n }\n\n })(gl);\n \n var defaultShader = new Shader(\"Shaders/vpBasic.cg\", \"Shaders/fpAlphaTexture.cg\");\n\n\n }", "function ShaderProgram() {\r\n A_CLASS;\r\n}", "setup() {\n if (this.compile()) {\n let shaderManager = GameManager.activeGame.getShaderManager();\n if (shaderManager) {\n shaderManager.useShader(this);\n } else {\n this._gl.useProgram(this._program);\n }\n\n // cache some script locations:\n this.cacheUniformLocations(Object.keys(this.uniforms));\n this.cacheAttributeLocations(Object.keys(this.attributes));\n } else {\n this._logger.error(\"Shader setup failed\");\n }\n }", "setup() {\n if (this.compile()) {\n let shaderManager = GameManager.activeGame.getShaderManager();\n if (shaderManager) {\n shaderManager.useShader(this);\n } else {\n this._gl.useProgram(this._program);\n }\n\n // cache some script locations:\n this.cacheUniformLocations(Object.keys(this.uniforms));\n this.cacheAttributeLocations(Object.keys(this.attributes));\n\n } else {\n debug.error(\"Shader setup failed\");\n }\n }", "constructor(vertexShaderPath, fragmentShaderPath) {\r\n // instance variables\r\n // Convention: all instance variables: mVariables\r\n this.mCompiledShader = null; // reference to the compiled shader in webgl context \r\n this.mVertexPositionRef = null; // reference to VertexPosition within the shader\r\n this.mPixelColorRef = null; // reference to the pixelColor uniform in the fragment shader\r\n this.mModelMatrixRef = null; // reference to model transform matrix in vertex shader\r\n this.mCameraMatrixRef = null; // reference to the View/Projection matrix in the vertex shader\r\n\r\n let gl = glSys.get();\r\n // \r\n // Step A: load and compile vertex and fragment shaders\r\n this.mVertexShader = compileShader(vertexShaderPath, gl.VERTEX_SHADER);\r\n this.mFragmentShader = compileShader(fragmentShaderPath, gl.FRAGMENT_SHADER);\r\n\r\n // Step B: Create and link the shaders into a program.\r\n this.mCompiledShader = gl.createProgram();\r\n gl.attachShader(this.mCompiledShader, this.mVertexShader);\r\n gl.attachShader(this.mCompiledShader, this.mFragmentShader);\r\n gl.linkProgram(this.mCompiledShader);\r\n\r\n // Step C: check for error\r\n if (!gl.getProgramParameter(this.mCompiledShader, gl.LINK_STATUS)) {\r\n throw new Error(\"Shader linking failed with [\" + vertexShaderPath + \" \" + fragmentShaderPath +\"].\");\r\n return null;\r\n }\r\n\r\n // Step D: Gets a reference to the aVertexPosition attribute within the shaders.\r\n this.mVertexPositionRef = gl.getAttribLocation(this.mCompiledShader, \"aVertexPosition\");\r\n\r\n // Step E: Gets references to the uniform variables\r\n this.mPixelColorRef = gl.getUniformLocation(this.mCompiledShader, \"uPixelColor\");\r\n this.mModelMatrixRef = gl.getUniformLocation(this.mCompiledShader, \"uModelXformMatrix\");\r\n this.mCameraMatrixRef = gl.getUniformLocation(this.mCompiledShader, \"uCameraXformMatrix\");\r\n }", "function Shader(name) {\n this._attributes = {}; //collection of keys\n this._uniforms = {};\n this._name = name;\n }", "constructor() {\n super();\n\n this._dirtyShader = true;\n\n // storage for texture and cubemap asset references\n this._assetReferences = {};\n\n this._activeParams = new Set();\n this._activeLightingParams = new Set();\n\n this.shaderOptBuilder = new StandardMaterialOptionsBuilder();\n\n this.reset();\n }", "function LGraphShader()\n{\n this.uninstantiable = true;\n this.clonable = false;\n this.addInput(\"albedo\",\"vec3\", {vec3:1, vec4:1});\n this.addInput(\"normal\",\"vec3\", {vec3:1, vec4:1}); // tangent space normal, if written\n this.addInput(\"emission\",\"vec3\", {vec3:1, vec4:1});\n this.addInput(\"specular\",\"float\", {float:1}); // specular power in 0..1 range\n this.addInput(\"gloss\",\"float\", {float:1});\n this.addInput(\"alpha\",\"float\", {float:1});\n this.addInput(\"alpha clip\",\"float\", {float:1});\n this.addInput(\"refraction\",\"float\", {float:1});\n this.addInput(\"vertex offset\",\"float\", {float:1});\n\n\n //inputs: [\"base color\",\"metallic\", \"specular\", \"roughness\", \"emissive color\", \"opacity\", \"opacitiy mask\", \"normal\", \"world position offset\", \"world displacement\", \"tesselation multiplier\", \"subsurface color\", \"ambient occlusion\", \"refraction\"],\n// this.properties = { color:\"#ffffff\",\n// gloss:4.0,\n// displacement_factor:1.0,\n// light_dir_x: 1.0,\n// light_dir_y: 1.0,\n// light_dir_z: 1.0\n// };\n\n// this.options = {\n// gloss:{step:0.01},\n// displacement_factor:{step:0.01},\n// light_dir_x:{min:-1, max:1, step:0.01},\n// light_dir_y:{min:-1, max:1, step:0.01},\n// light_dir_z:{min:-1, max:1, step:0.01}\n// };\n\n this.size = [125,250];\n this.shader_piece = ShaderConstructor;\n}", "constructor()\n\t{\n\t\t// Compile the shader program\n\t\tthis.prog = InitShaderProgram( modelVS, modelFS );\n\t\t// Get the ids of the uniform variables in the shaders\n\t\tthis.mvp = gl.getUniformLocation( this.prog, 'mvp' );\n\n\t\t// Get the ids of the vertex attributes in the shaders\n\t\tthis.vertPos = gl.getAttribLocation( this.prog, 'pos' );\n\n\t\tthis.txc = gl.getAttribLocation(this.prog,'txc');\n\n\n\n\t\tthis.mv_ = gl.getUniformLocation( this.prog, 'mv_' );\n\t\tthis.mv = gl.getAttribLocation( this.prog, 'mv' );\n\n\t\tthis.norm = gl.getUniformLocation( this.prog, 'norm' );\n\t\tthis.normals = gl.getAttribLocation( this.prog, 'normals' );\n\n\n\n\t\tthis.sampler = gl.getUniformLocation(this.prog,'tex');\n\n\t\tthis.swap = gl.getUniformLocation(this.prog,'swap');\n\n\t\tthis.toShow = gl.getUniformLocation(this.prog,'toShow');\n\n\n\t\tthis.x = gl.getUniformLocation(this.prog,'x');\n\t\tthis.y = gl.getUniformLocation(this.prog,'y');\n\t\tthis.z = gl.getUniformLocation(this.prog,'z');\n\t\tthis.shiny = gl.getUniformLocation(this.prog,'shiny');\n\n\t\tthis.vertbuffer = gl.createBuffer();\n\t\tthis.textureBuffer = gl.createBuffer();\n\t\tthis.normalBuffer = gl.createBuffer();\n\n\t}", "function register(Shader) {\n // Some build in shaders\n Shader['import'](__WEBPACK_IMPORTED_MODULE_0__source_compositor_coloradjust_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_1__source_compositor_blur_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_2__source_compositor_lum_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_3__source_compositor_lut_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_4__source_compositor_vignette_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_5__source_compositor_output_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_6__source_compositor_bright_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_7__source_compositor_downsample_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_8__source_compositor_upsample_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_9__source_compositor_hdr_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_10__source_compositor_lensflare_glsl_js__[\"a\" /* default */]);\n Shader['import'](__WEBPACK_IMPORTED_MODULE_11__source_compositor_blend_glsl_js__[\"a\" /* default */]);\n\n Shader['import'](__WEBPACK_IMPORTED_MODULE_12__source_compositor_fxaa_glsl_js__[\"a\" /* default */]);\n\n}", "create(id, vShader, fShader) {\n let shader = new Shader(vShader, fShader);\n this.shaders.set(id, shader);\n }", "bind() {\n if (this.renderer.currentProgram !== this.defaultShader.program) {\n this.useShader(this.defaultShader);\n }\n }", "function ShaderProgram(gl, vertex_src, fragment_src)\n{\n \n this.vertexShader = null;\n this.fragmentShader = null; \n this.attributeLocations = [];\n this.shaderProgram = null;\n this.gl = gl;\n\n this.getVertexShaderSourceCode = function()\n {\n return vertex_src;\n }\n this.getFragmentShaderSourceCode = function()\n {\n return fragment_src;\n }\n}", "getShaders() {\n return Object.assign({}, super.getShaders(), {\n // inject: https://github.com/uber/luma.gl/blob/master/docs/api-reference/shadertools/assemble-shaders.md\n inject: {\n 'vs:#decl': `\n uniform float coef;\n `,\n 'vs:#main-end': `\n if (coef > 0.0) {\n vec4 pct = vec4(segmentRatio);\n pct.a = step(coef, segmentRatio);\n vec4 colorA = instanceSourceColors;\n vec4 colorB = vec4(instanceTargetColors.r, instanceTargetColors.g, instanceTargetColors.b, 0.0);\n vec4 color = mix(colorA, colorB, pct) / 255.;\n vColor = color;\n }\n `,\n 'fs:#main-start': `\n if (vColor.a == 0.0) discard;\n `,\n },\n });\n }", "_processVertexShader(props = {}) {\n const {sourceTextures, targetTexture} = this.bindings[this.currentIndex];\n // @ts-ignore TODO - uniforms is not present\n const {vs, uniforms, targetTextureType, inject, samplerTextureMap} = updateForTextures({\n vs: props.vs,\n sourceTextureMap: sourceTextures,\n targetTextureVarying: this.targetTextureVarying,\n targetTexture\n });\n const combinedInject = combineInjects([props.inject || {}, inject]);\n this.targetTextureType = targetTextureType;\n this.samplerTextureMap = samplerTextureMap;\n const fs =\n props._fs ||\n getPassthroughFS({\n version: getShaderVersion(vs),\n input: this.targetTextureVarying,\n inputType: targetTextureType,\n output: FS_OUTPUT_VARIABLE\n });\n const modules =\n this.hasSourceTextures || this.targetTextureVarying\n ? [transformModule].concat(props.modules || [])\n : props.modules;\n return {vs, fs, modules, uniforms, inject: combinedInject};\n }", "constructor(gl, vsPath, fsPath, vsSource, fsSource, vsSubs, fsSubs) {\nvar a, i, j, k, ref, ref1, shprog, sz, u, vsfsStr;\nthis.gl = gl;\nthis.vsPath = vsPath;\nthis.fsPath = fsPath;\nthis.vsSource = vsSource;\nthis.fsSource = fsSource;\nthis.vsSubs = vsSubs;\nthis.fsSubs = fsSubs;\n//----------\nthis._prog = null; // WebGL program.\nthis._vs = null; // WebGL vertex shader.\nthis._fs = null; // WebGL fragment shader.\nthis._nUniforms = -1; // Number of uniforms.\nthis._uniforms = {}; // Uniform locations.\nthis._nAttributes = -1; // Number of attributes.\nthis._attributes = {}; // Attribute locations.\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Max Vert Uniforms: ${this.gl.getParameter(this.gl.MAX_VERTEX_UNIFORM_VECTORS)}`);\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Max Frag Uniforms: ${this.gl.getParameter(this.gl.MAX_FRAGMENT_UNIFORM_VECTORS)}`);\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Vert source: ${this.vsSource}`);\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: Frag source: ${this.fsSource}`);\n}\n// Load vertex and fragment shaders, performing substitutions if any.\nthis._vs = this._loadShader(this.vsPath, this.vsSource, this.vsSubs);\nthis._fs = this._loadShader(this.fsPath, this.fsSource, this.fsSubs);\n// Create and link the program\nshprog = this.gl.createProgram();\nif (this._vs && this._fs) {\nthis.gl.attachShader(shprog, this._vs);\nif (this._fs) {\nthis.gl.attachShader(shprog, this._fs);\n}\n// Keep Chrome happy\nthis.gl.bindAttribLocation(shprog, 0, \"BindPos\");\nthis.gl.linkProgram(shprog);\n}\nvsfsStr = `VrtxS=${this.vsPath} FragS=${this.fsPath}`;\nif (this.gl.getProgramParameter(shprog, this.gl.LINK_STATUS)) {\nif (typeof lggr.info === \"function\") {\nlggr.info(`Shader: Program using: ${vsfsStr} created`);\n}\nthis._prog = shprog;\n} else {\nlggr.warn(`Shader: Program using: ${vsfsStr} failed to link: ${this.gl.getProgramInfoLog(shprog)}`);\nthis.gl.deleteProgram(shprog);\nthis._vs = this._fs = null;\n}\nif (this._prog) {\n// Grab uniforms.\nthis._nUniforms = this.gl.getProgramParameter(this._prog, this.gl.ACTIVE_UNIFORMS);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${this._nUniforms} Uniform Variables used ####`);\n}\nsz = 0;\nfor (i = j = 0, ref = this._nUniforms; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {\nu = this.gl.getActiveUniform(this._prog, i);\nthis._uniforms[u.name] = this.gl.getUniformLocation(this._prog, u.name);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${u.name} size ${(this.gl.getActiveUniform(this._prog, i)).size}`);\n}\nsz += (this.gl.getActiveUniform(this._prog, i)).size;\n}\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${sz} Shader Uniforms used ####`);\n}\n// Grab attributes.\nthis._nAttributes = this.gl.getProgramParameter(this._prog, this.gl.ACTIVE_ATTRIBUTES);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${this._nAttributes} Active Attributes`);\n}\nfor (i = k = 0, ref1 = this._nAttributes; (0 <= ref1 ? k < ref1 : k > ref1); i = 0 <= ref1 ? ++k : --k) {\na = this.gl.getActiveAttrib(this._prog, i);\nthis._attributes[a.name] = this.gl.getAttribLocation(this._prog, a.name);\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`Shader: ${a.name}: ${this._attributes[a.name]}`);\n}\n}\n}\nthis.DO_CHECK_LOC_NAME = false;\n}", "init() {\n // Set up shader\n this.shader_loc =\n createProgram(gl, this.VERTEX_SHADER, this.FRAGMENT_SHADER);\n if (!this.shader_loc) {\n console.log(this.constructor.name +\n '.init() failed to create executable Shaders on the GPU.');\n return;\n }\n gl.program = this.shader_loc;\n\n this.vbo_loc = gl.createBuffer();\n if (!this.vbo_loc) {\n console.log(this.constructor.name +\n '.init() failed to create VBO in GPU.');\n return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vbo_loc);\n gl.bufferData(gl.ARRAY_BUFFER, this.vbo, gl.STATIC_DRAW);\n\n // Set up attributes\n this.attributes.forEach((attribute, i) => {\n attribute.location =\n gl.getAttribLocation(this.shader_loc, attribute.name);\n if (attribute.locaiton < 0) {\n console.log(this.constructor.name +\n '.init() Failed to get GPU location of ' +\n attribute.name);\n return;\n }\n });\n\n // Set up uniforms\n this.u_mvp_matrix_loc =\n gl.getUniformLocation(this.shader_loc, 'u_mvp_matrix_' + this.box_num);\n if (!this.u_mvp_matrix_loc) {\n console.log(this.constructor.name +\n '.init() failed to get GPU location for u_mvp_matrix_' + this.box_num + ' uniform');\n return;\n }\n\n // Set up texture for raytraced image\n if (this.box_num == 1) {\n this.u_texture_location = gl.createTexture();\n if (!this.u_texture_location) {\n console.log(this.constructor.name +\n '.init() failed to create the texture object');\n return;\n }\n\n this.u_sampler_location = gl.getUniformLocation(this.shader_loc, 'u_sampler_' + this.box_num);\n if (!this.u_sampler_location) {\n console.log(this.constructor.name +\n '.init() failed to get GPU location for u_sampler_' + this.box_num + ' uniform');\n return;\n }\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this.u_texture_location);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, g_scene.buffer.width, g_scene.buffer.height, 0, gl.RGB, gl.UNSIGNED_BYTE, g_scene.buffer.iBuf);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n }\n }", "function ShaderData()\n{\n this.vertexPositionAttribute = null;\n this.projectionMatrixUniform = null;\n this.modelViewMatrixUniform = null;\n this.shaderProgram = null;\n}", "constructor(webgl_manager, control_panel) {\n super(webgl_manager, control_panel);\n // Send a Triangle's vertices to the GPU's buffers:\n this.shapes = { triangle: new Minimal_Shape() };\n this.shader = new Basic_Shader();\n }", "render() {\n const canvas = this.canvas;\n const dataset = this.currentDataset;\n\n canvas.width = dataset.width;\n canvas.height = dataset.height;\n\n let ids = null;\n if (this.expressionAst) {\n const idsSet = new Set([]);\n const getIds = (node) => {\n if (typeof node === 'string') {\n // ids should not contain unary operators\n idsSet.add(node.replace(new RegExp(/[+-]/, 'g'), ''));\n }\n if (typeof node.lhs === 'string') {\n idsSet.add(node.lhs.replace(new RegExp(/[+-]/, 'g'), ''));\n } else if (typeof node.lhs === 'object') {\n getIds(node.lhs);\n }\n if (typeof node.rhs === 'string') {\n idsSet.add(node.rhs.replace(new RegExp(/[+-]/, 'g'), ''));\n } else if (typeof node.rhs === 'object') {\n getIds(node.rhs);\n }\n };\n getIds(this.expressionAst);\n ids = Array.from(idsSet);\n }\n\n let program = null;\n\n if (this.gl) {\n const gl = this.gl;\n gl.viewport(0, 0, dataset.width, dataset.height);\n\n if (this.expressionAst) {\n const vertexShaderSourceExpressionTemplate = `\n attribute vec2 a_position;\n attribute vec2 a_texCoord;\n uniform mat3 u_matrix;\n uniform vec2 u_resolution;\n varying vec2 v_texCoord;\n void main() {\n // apply transformation matrix\n vec2 position = (u_matrix * vec3(a_position, 1)).xy;\n // convert the rectangle from pixels to 0.0 to 1.0\n vec2 zeroToOne = position / u_resolution;\n // convert from 0->1 to 0->2\n vec2 zeroToTwo = zeroToOne * 2.0;\n // convert from 0->2 to -1->+1 (clipspace)\n vec2 clipSpace = zeroToTwo - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n // pass the texCoord to the fragment shader\n // The GPU will interpolate this value between points.\n v_texCoord = a_texCoord;\n }`;\n const expressionReducer = (node) => {\n if (typeof node === 'object') {\n if (node.op === '**') {\n // math power operator substitution\n return `pow(${expressionReducer(node.lhs)}, ${expressionReducer(node.rhs)})`;\n }\n if (node.fn) {\n return `(${node.fn}(${expressionReducer(node.lhs)}))`;\n }\n return `(${expressionReducer(node.lhs)} ${node.op} ${expressionReducer(node.rhs)})`;\n } else if (typeof node === 'string') {\n return `${node}_value`;\n }\n return `float(${node})`;\n };\n\n const compiledExpression = expressionReducer(this.expressionAst);\n\n // Definition of fragment shader\n const fragmentShaderSourceExpressionTemplate = `\n precision mediump float;\n // our texture\n uniform sampler2D u_textureScale;\n\n // add all required textures\n${ids.map(id => ` uniform sampler2D u_texture_${id};`).join('\\n')}\n\n uniform vec2 u_textureSize;\n uniform vec2 u_domain;\n uniform float u_noDataValue;\n uniform bool u_clampLow;\n uniform bool u_clampHigh;\n // the texCoords passed in from the vertex shader.\n varying vec2 v_texCoord;\n void main() {\n${ids.map(id => ` float ${id}_value = texture2D(u_texture_${id}, v_texCoord)[0];`).join('\\n')}\n float value = ${compiledExpression};\n\n if (value == u_noDataValue)\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1]))\n gl_FragColor = vec4(0, 0, 0, 0);\n else {\n float normalisedValue = (value - u_domain[0]) / (u_domain[1] - u_domain[0]);\n gl_FragColor = texture2D(u_textureScale, vec2(normalisedValue, 0));\n }\n }`;\n program = createProgram(gl, vertexShaderSource, fragmentShaderSourceExpressionTemplate);\n gl.useProgram(program);\n\n gl.uniform1i(gl.getUniformLocation(program, 'u_textureScale'), 0);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, this.textureScale);\n for (let i = 0; i < ids.length; ++i) {\n const location = i + 1;\n const id = ids[i];\n const ds = this.datasetCollection[id];\n if (!ds) {\n throw new Error(`No such dataset registered: '${id}'`);\n }\n gl.uniform1i(gl.getUniformLocation(program, `u_texture_${id}`), location);\n gl.activeTexture(gl[`TEXTURE${location}`]);\n gl.bindTexture(gl.TEXTURE_2D, ds.textureData);\n }\n } else {\n program = this.program;\n gl.useProgram(program);\n // set the images\n gl.uniform1i(gl.getUniformLocation(program, 'u_textureData'), 0);\n gl.uniform1i(gl.getUniformLocation(program, 'u_textureScale'), 1);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, dataset.textureData);\n gl.activeTexture(gl.TEXTURE1);\n gl.bindTexture(gl.TEXTURE_2D, this.textureScale);\n }\n const positionLocation = gl.getAttribLocation(program, 'a_position');\n const domainLocation = gl.getUniformLocation(program, 'u_domain');\n const displayRangeLocation = gl.getUniformLocation(\n program, 'u_display_range'\n );\n const applyDisplayRangeLocation = gl.getUniformLocation(\n program, 'u_apply_display_range'\n );\n const resolutionLocation = gl.getUniformLocation(program, 'u_resolution');\n const noDataValueLocation = gl.getUniformLocation(program, 'u_noDataValue');\n const clampLowLocation = gl.getUniformLocation(program, 'u_clampLow');\n const clampHighLocation = gl.getUniformLocation(program, 'u_clampHigh');\n const matrixLocation = gl.getUniformLocation(program, 'u_matrix');\n\n gl.uniform2f(resolutionLocation, canvas.width, canvas.height);\n gl.uniform2fv(domainLocation, this.domain);\n gl.uniform2fv(displayRangeLocation, this.displayRange);\n gl.uniform1i(applyDisplayRangeLocation, this.applyDisplayRange);\n gl.uniform1i(clampLowLocation, this.clampLow);\n gl.uniform1i(clampHighLocation, this.clampHigh);\n gl.uniform1f(noDataValueLocation, this.noDataValue);\n gl.uniformMatrix3fv(matrixLocation, false, this.matrix);\n\n const positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n gl.enableVertexAttribArray(positionLocation);\n gl.vertexAttribPointer(positionLocation, 2, gl.FLOAT, false, 0, 0);\n\n setRectangle(gl, 0, 0, canvas.width, canvas.height);\n\n // Draw the rectangle.\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n } else if (this.ctx) {\n const ctx = this.ctx;\n const w = canvas.width;\n const h = canvas.height;\n\n const imageData = ctx.createImageData(w, h);\n\n const trange = this.domain[1] - this.domain[0];\n const steps = this.colorScaleCanvas.width;\n const csImageData = this.colorScaleCanvas.getContext('2d').getImageData(0, 0, steps, 1).data;\n let alpha;\n\n const data = dataset.data;\n\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n const i = (y * w) + x;\n // TODO: Possible increase of performance through use of worker threads?\n\n let c = Math.floor(((data[i] - this.domain[0]) / trange) * (steps - 1));\n alpha = 255;\n if (c < 0) {\n c = 0;\n if (!this.clampLow) {\n alpha = 0;\n }\n } else if (c > 255) {\n c = 255;\n if (!this.clampHigh) {\n alpha = 0;\n }\n }\n // NaN values should be the only values that are not equal to itself\n if (data[i] === this.noDataValue || data[i] !== data[i]) {\n alpha = 0;\n } else if (this.applyDisplayRange\n && (data[i] < this.displayRange[0] || data[i] >= this.displayRange[1])) {\n alpha = 0;\n }\n\n const index = ((y * w) + x) * 4;\n imageData.data[index + 0] = csImageData[c * 4];\n imageData.data[index + 1] = csImageData[(c * 4) + 1];\n imageData.data[index + 2] = csImageData[(c * 4) + 2];\n imageData.data[index + 3] = Math.min(alpha, csImageData[(c * 4) + 3]);\n }\n }\n\n ctx.putImageData(imageData, 0, 0); // at coords 0,0\n }\n }", "install(gl, mesh, material) {\n this.mProgram = this.loadProgram(gl);\n this.mShaderArguments.clear();\n\n if (this.mProgram != null) {\n // Bind exported arguments\n let exportArgumentSize = this.mShaderExportArguments != null ? this.mShaderExportArguments.length : 0;\n for (let i = 0; i < exportArgumentSize; i++) {\n let argument = this.mShaderExportArguments[i];\n if (argument != null) {\n // Location argument in shader program\n switch (argument.mType) {\n case Shader.TYPE_ATTRIB: {\n console.log(\"[Shader] Attribute '\" + argument.mName + \"' install ...OK\");\n let location = gl.getAttribLocation(this.mProgram, argument.mName);\n this.mShaderArguments.set(argument.mName, location);\n } break;\n\n case Shader.TYPE_UNIFORM: {\n console.log(\"[Shader] Uniform '\" + argument.mName + \"' install ...OK\");\n let location = gl.getUniformLocation(this.mProgram, argument.mName);\n this.mShaderArguments.set(argument.mName, location);\n } break;\n }\n\n // Location argument binder\n let binder = argument.mBinder;\n if (binder == Shader.PRESET_MMAT\n || binder == Shader.PRESET_VMAT\n || binder == Shader.PRESET_PMAT\n || binder == Shader.PRESET_MVMAT\n || binder == Shader.PRESET_MVPMAT) {\n // Dynamic binding during rendering\n continue;\n } else {\n let locationBinder = null;\n locationBinder = mesh.getBinder(gl, binder);\n locationBinder = locationBinder == null ? material.getBinder(gl, binder) : locationBinder;\n if (locationBinder != null) {\n argument.mBinderValue = locationBinder;\n console.log(\"[Shader] argument '\" + argument.mName + \"' binding ...OK\");\n } else {\n argument.mBinderValue = null;\n console.error(\"[Shader] argument '\" + argument.mName + \"' binding ...failed\");\n }\n }\n\n\n }\n }\n }\n }", "function render() {\n // pass the uniforms once per frame\n // these are not passed elsewhere to ensure they are not\n // changed more than once per frame.\n // optimizations are left to the ComputeShader class\n mainShader.pass(data.settings);\n mainShader.pass(data.variables);\n mainShader.execute(data.cameraUniforms);\n }", "material() { return { shader: this } }", "function ShaderCache() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n gl = _ref.gl;\n\n _classCallCheck(this, ShaderCache);\n\n this.gl = gl;\n this.vertexShaders = {};\n this.fragmentShaders = {};\n }", "function Asset(shader)\n{\n if(!(shader instanceof ShaderProgram))\n {\n throw \"Engine: not a shader!\";\n }\n this.mShader = shader; \n\n \n}", "function add_passes_to_gpuProg(gpu_compute_prog, passes){\n gpu_compute_prog.add_pass(passes.velocity);\n gpu_compute_prog.add_pass(passes.position);\n gpu_compute_prog.add_pass(passes.excrete);\n gpu_compute_prog.add_pass(passes.excrete_a);\n gpu_compute_prog.add_pass(passes.render);\n gpu_compute_prog.add_pass(passes.output);\n }", "function setupShaders() {\n \n // define fragment shader in essl using es6 template strings\n // here you need to take care of color attibutes\n var fShaderCode = `#version 300 es\n precision highp float;\n\n out vec4 FragColor;\n in vec4 oColor;\n\n void main(void) {\n FragColor = oColor; // all fragments are white\n }\n `;\n \n // define vertex shader in essl using es6 template strings\n // have in/out for vertex colors \n var vShaderCode = `#version 300 es\n in vec3 vertexPosition;\n in vec3 vertexColor;\n\n out vec4 oColor;\n\n void main(void) {\n gl_Position = vec4(vertexPosition, 1.0); // use the untransformed position\n oColor = vec4(vertexColor, 1.0);\n }\n `;\n \n try {\n // console.log(\"fragment shader: \"+fShaderCode);\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n // console.log(\"vertex shader: \"+vShaderCode);\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n vertexPositionAttrib = gl.getAttribLocation(shaderProgram, \"vertexPosition\"); \n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\n // set up vertexColorAttrib from vertexColor\n vertexColorAttrib = gl.getAttribLocation(shaderProgram, \"vertexColor\"); \n gl.enableVertexAttribArray(vertexColorAttrib)\n\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "function setupShaders() {\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n \tprecision mediump float;\n\n \tvarying vec3 vColor;\n\n void main(void) {\n \t//gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); // all fragments are white\n gl_FragColor = vec4(vColor,1.0); // give the fragment that color\n }\n `;\n \n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 vertexPosition;\n attribute vec3 vertexColor;\n\n uniform mat4 uMVMatrix;\n uniform mat4 uPMatrix;\n\n varying vec3 vColor;\n\n void main(void) {\n gl_Position = uPMatrix * uMVMatrix * vec4(vertexPosition, 1.0); // use the untransformed position\n //gl_Position = vec4(vertexPosition, 1.0);\n vColor = vertexColor;\n }\n `;\n \n try {\n // console.log(\"fragment shader: \"+fShaderCode);\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n // console.log(\"vertex shader: \"+vShaderCode);\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n\n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n vertexPositionAttrib = gl.getAttribLocation(shaderProgram, \"vertexPosition\"); // get pointer to vertex shader input\n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\n console.log('before enable');\n vertexColorAttrib = gl.getAttribLocation(shaderProgram, \"vertexColor\");\n gl.enableVertexAttribArray(vertexColorAttrib);\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n mat4.identity(mvMatrix);\n mat4.identity(perspective);\n //mat4.perspective(pMatrix, 90*(3.14/180), 600/600, 0.5, 1.5);\n //mat4.lookAt(mvMatrix, eye, lookAt, lookUp);\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "function main(gl, program) {\n // use the webgl-utils library to create setters for all the uniforms and attributes in our shaders.\n // It enumerates all of the uniforms and attributes in the program, and creates utility functions to \n // allow \"setUniforms\" and \"setAttributes\" (below) to set the shader variables from a javascript object. \n // The objects have a key for each uniform or attribute, and a value containing the parameters for the\n // setter function\n //var uniformSetters = createUniformSetters(gl, program);\n //var attribSetters = createAttributeSetters(gl, program);\n // an indexed quad\n var arrays = {\n position: { numComponents: 3, data: [], },\n texcoord: { numComponents: 2, data: [], },\n normal: { numComponents: 3, data: [], },\n indices: { numComponents: 3, data: [], },\n };\n //Sets up quad to have 16 x 16 vertices\n for (var i = 0; i < 16; i++) {\n for (var j = 0; j < 16; j++) {\n arrays.position.data.push(i * (10 / 16), j * (10 / 16), 0);\n arrays.normal.data.push(0, 0, -1);\n arrays.texcoord.data.push(1 - (i / 16), 1 - (j / 16));\n }\n }\n for (var i = 0; i < 15; i++) {\n for (var j = 0; j < 15; j++) {\n arrays.indices.data.push(i + j * 16, i + j * 16 + 1, i + ((j + 1) * 16));\n arrays.indices.data.push(i + j * 16 + 1, (j + 1) * 16 + i, (j + 1) * 16 + i + 1);\n }\n }\n var center = [5, 5, 0];\n var scaleFactor = 20;\n var bufferInfo = createBufferInfoFromArrays(gl, arrays);\n function degToRad(d) {\n return d * Math.PI / 180;\n }\n var cameraAngleRadians = degToRad(0);\n var fieldOfViewRadians = degToRad(60);\n var cameraHeight = 50;\n var uniformsThatAreTheSameForAllObjects = {\n u_lightWorldPos: [50, 30, -100],\n u_viewInverse: mat4.create(),\n u_lightColor: [1, 1, 1, 1],\n u_ambient: [0.1, 0.1, 0.1, 0.1],\n //Added for green screen effect\n u_image0: gl.createTexture(),\n u_image1: gl.createTexture(),\n //Added for warble\n u_clock: 0.0\n };\n var uniformsThatAreComputedForEachObject = {\n u_worldViewProjection: mat4.create(),\n u_world: mat4.create(),\n u_worldInverseTranspose: mat4.create(),\n };\n var baseColor = rand(240);\n var objectState = {\n materialUniforms: {\n u_colorMult: chroma.hsv(rand(baseColor, baseColor + 120), 0.5, 1).gl(),\n //u_diffuse: texture,\n u_specular: [1, 1, 1, 1],\n u_shininess: 450,\n u_specularFactor: 0.75,\n }\n };\n // some variables we'll reuse below\n var projectionMatrix = mat4.create();\n var viewMatrix = mat4.create();\n var rotationMatrix = mat4.create();\n var matrix = mat4.create(); // a scratch matrix\n var invMatrix = mat4.create();\n var axisVector = vec3.create();\n //Creating our two textures\n var texture1 = gl.createTexture();\n var image1 = new Image();\n image1.src = \"resources/texture1.jpg\";\n image1.onload = function () {\n gl.bindTexture(gl.TEXTURE_2D, texture1);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image1);\n };\n var texture2 = gl.createTexture();\n var image2 = new Image();\n image2.src = \"resources/texture2.jpg\";\n image2.onload = function () {\n gl.bindTexture(gl.TEXTURE_2D, texture2);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image2);\n };\n uniformsThatAreTheSameForAllObjects.u_image0 = texture1;\n uniformsThatAreTheSameForAllObjects.u_image1 = texture2;\n requestAnimationFrame(drawScene);\n // Draw the scene.\n function drawScene(time) {\n time *= 0.001;\n //console.log(uniformsThatAreTheSameForAllObjects.u_clock);\n // measure time taken for the little stats meter\n stats.begin();\n // if the window changed size, reset the WebGL canvas size to match. The displayed size of the canvas\n // (determined by window size, layout, and your CSS) is separate from the size of the WebGL render buffers, \n // which you can control by setting canvas.width and canvas.height\n resizeCanvasToDisplaySize(canvas);\n // Set the viewport to match the canvas\n gl.viewport(0, 0, canvas.width, canvas.height);\n // Clear the canvas AND the depth buffer.\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n // Compute the projection matrix\n var aspect = canvas.clientWidth / canvas.clientHeight;\n mat4.perspective(projectionMatrix, fieldOfViewRadians, aspect, 1, 2000);\n // Compute the camera's matrix using look at.\n var cameraPosition = [0, 0, -200];\n var target = [0, 0, 0];\n var up = [0, 1, 0];\n var cameraMatrix = mat4.lookAt(uniformsThatAreTheSameForAllObjects.u_viewInverse, cameraPosition, target, up);\n // Make a view matrix from the camera matrix.\n mat4.invert(viewMatrix, cameraMatrix);\n // tell WebGL to use our shader program\n if (currentShader == 1) {\n gl.useProgram(program[0]);\n }\n else if (currentShader == 2) {\n gl.useProgram(program[1]);\n }\n else if (currentShader == 3) {\n gl.useProgram(program[2]);\n }\n else {\n gl.useProgram(program[3]);\n }\n if (currentShader == 1) {\n var uniformSetters = createUniformSetters(gl, program[0]);\n var attribSetters = createAttributeSetters(gl, program[0]);\n }\n else if (currentShader == 2) {\n var uniformSetters = createUniformSetters(gl, program[1]);\n var attribSetters = createAttributeSetters(gl, program[1]);\n }\n else if (currentShader == 3) {\n var uniformSetters = createUniformSetters(gl, program[2]);\n var attribSetters = createAttributeSetters(gl, program[2]);\n }\n else {\n uniformsThatAreTheSameForAllObjects.u_clock = clock;\n clock += 0.1;\n var uniformSetters = createUniformSetters(gl, program[3]);\n var attribSetters = createAttributeSetters(gl, program[3]);\n }\n // Setup all the needed attributes and buffers. \n setBuffersAndAttributes(gl, attribSetters, bufferInfo);\n // Set the uniforms that are the same for all objects. Unlike the attributes, each uniform setter\n // is different, depending on the type of the uniform variable. Look in webgl-util.js for the\n // implementation of setUniforms to see the details for specific types \n setUniforms(uniformSetters, uniformsThatAreTheSameForAllObjects);\n ///////////////////////////////////////////////////////\n // Compute the view matrix and corresponding other matrices for rendering.\n // first make a copy of our rotationMatrix\n mat4.copy(matrix, rotationMatrix);\n // adjust the rotation based on mouse activity. mouseAngles is set if user is dragging \n if (mouseAngles[0] !== 0 || mouseAngles[1] !== 0) {\n /*\n * only rotate around Y, use the second mouse value for scale. Leaving the old code from A3\n * here, commented out\n *\n // need an inverse world transform so we can find out what the world X axis for our first rotation is\n mat4.invert(invMatrix, matrix);\n // get the world X axis\n var xAxis = vec3.transformMat4(axisVector, vec3.fromValues(1,0,0), invMatrix);\n \n // rotate about the world X axis (the X parallel to the screen!)\n mat4.rotate(matrix, matrix, -mouseAngles[1], xAxis);\n */\n // now get the inverse world transform so we can find the world Y axis\n mat4.invert(invMatrix, matrix);\n // get the world Y axis\n var yAxis = vec3.transformMat4(axisVector, vec3.fromValues(0, 1, 0), invMatrix);\n // rotate about teh world Y axis\n mat4.rotate(matrix, matrix, mouseAngles[0], yAxis);\n // save the resulting matrix back to the cumulative rotation matrix \n mat4.copy(rotationMatrix, matrix);\n // use mouseAngles[1] to scale\n scaleFactor += mouseAngles[1];\n vec2.set(mouseAngles, 0, 0);\n }\n // add a translate and scale to the object World xform, so we have: R * T * S\n mat4.translate(matrix, rotationMatrix, [-center[0] * scaleFactor, -center[1] * scaleFactor,\n -center[2] * scaleFactor]);\n mat4.scale(matrix, matrix, [scaleFactor, scaleFactor, scaleFactor]);\n mat4.copy(uniformsThatAreComputedForEachObject.u_world, matrix);\n // get proj * view * world\n mat4.multiply(matrix, viewMatrix, uniformsThatAreComputedForEachObject.u_world);\n mat4.multiply(uniformsThatAreComputedForEachObject.u_worldViewProjection, projectionMatrix, matrix);\n // get worldInvTranspose. For an explaination of why we need this, for fixing the normals, see\n // http://www.unknownroad.com/rtfm/graphics/rt_normals.html\n mat4.transpose(uniformsThatAreComputedForEachObject.u_worldInverseTranspose, mat4.invert(matrix, uniformsThatAreComputedForEachObject.u_world));\n // Set the uniforms we just computed\n setUniforms(uniformSetters, uniformsThatAreComputedForEachObject);\n // Set the uniforms that are specific to the this object.\n setUniforms(uniformSetters, objectState.materialUniforms);\n // Draw the geometry. Everything is keyed to the \"\"\n gl.drawElements(gl.TRIANGLES, bufferInfo.numElements, gl.UNSIGNED_SHORT, 0);\n // stats meter\n stats.end();\n requestAnimationFrame(drawScene);\n }\n }", "function setupShaders() {\n \n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 aVertexPosition; // vertex position\n uniform mat4 upvmMatrix; // the project view model matrix\n\n void main(void) {\n \n // vertex position\n gl_Position = upvmMatrix * vec4(aVertexPosition, 1.0);\n }\n `;\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n precision mediump float; // set float to medium precision\n \n // material properties\n uniform vec3 uDiffuse; // the diffuse reflectivity\n \n void main(void) {\n gl_FragColor = vec4(uDiffuse, 1.0); \n }\n `;\n \n try {\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n \n // locate and enable vertex attributes\n vPosAttribLoc = gl.getAttribLocation(shaderProgram, \"aVertexPosition\"); // ptr to vertex pos attrib\n gl.enableVertexAttribArray(vPosAttribLoc); // connect attrib to array\n \n // locate vertex uniforms\n pvmMatrixULoc = gl.getUniformLocation(shaderProgram, \"upvmMatrix\"); // ptr to pvmmat\n \n // locate fragment uniforms\n colorULoc = gl.getUniformLocation(shaderProgram, \"uDiffuse\"); // ptr to diffuse\n\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "start() {\n this.renderer.state.setState(this.state);\n this.renderer.shader.bind(this.shader);\n if (WebGLSettings_1.WebGLSettings.CAN_UPLOAD_SAME_BUFFER) {\n // bind buffer #0, we don't need others\n this.renderer.geometry.bind(this.vaos[this.vertexCount]);\n }\n }", "contextChange() {\n var gl = this.renderer.gl;\n if (DisplaySettings_1.DisplaySettings.PREFER_ENV === DisplaySettings_1.DisplaySettings.ENV.WEBGL_LEGACY) {\n this.MAX_TEXTURES = 1;\n }\n else {\n // step 1: first check max textures the GPU can handle.\n this.MAX_TEXTURES = Math.min(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), WebGLSettings_1.WebGLSettings.SPRITE_MAX_TEXTURES);\n // step 2: check the maximum number of if statements the shader can have too..\n this.MAX_TEXTURES = WebGLSettings_1.WebGLSettings.checkMaxIfStatementsInShader(this.MAX_TEXTURES, gl);\n }\n // generate generateMultiTextureProgram, may be a better move?\n this.shader = WebGLSettings_1.WebGLSettings.generateMultiTextureShader(gl, this.MAX_TEXTURES);\n // we use the second shader as the first one depending on your browser may omit aTextureId\n // as it is not used by the shader so is optimized out.\n for (var i = 0; i < this.vaoMax; i++) {\n /* eslint-disable max-len */\n this.vaos[i] = new BatchGeometry_1.BatchGeometry();\n }\n }", "getProgram(parameters, material){\n \n let definePrefix = getDefinePrefix(parameters, material);\n\n if(this.programs.has(definePrefix)){\n return this.programs.get(definePrefix);\n }\n\n let vertexSource = material.getVertexShaderSource();\n vertexSource = definePrefix + vertexSource;\n\n let vertexShader = compileShader(vertexSource, gl.VERTEX_SHADER);\n\n let fragmentSource = material.getFragmentShaderSource();\n fragmentSource = definePrefix + fragmentSource;\n\n let fragmentShader = compileShader(fragmentSource, gl.FRAGMENT_SHADER);\n\n let program = new Program(vertexShader, fragmentShader);\n this.programs.set(definePrefix, program);\n\n return program;\n \n }", "createShaders() {\n const gl = this.gl\n\n this.vertexShader = this.createShader(gl.VERTEX_SHADER)\n this.fragmentShader = this.createShader(gl.FRAGMENT_SHADER)\n }", "constructor (canvas) {\n this.canvas = canvas;\n this._gl = WebGLUtils.setupWebGL(this.canvas);\n this._gl.clearColor(0.0, 0.0, 0.0, 1.0);\n this._program = WebGLUtils.Shaders.initFromSrc(\n this._gl, vshader, fshader\n );\n this._gl.enable(this._gl.DEPTH_TEST);\n this._gl.enable(this._gl.POLYGON_OFFSET_FILL);\n this._resize =\n WebGLUtils.genResizeFun(this.canvas, this._gl, (w,h, sd) => {\n if (this._camera)\n this._camera.ar = w/h;\n });\n\n /**\n * Fetch the pointers to attributes/uniforms\n * inside our shaders. Respectively:\n * - a_SOMETHING: attribute\n * - u_SOMETHING: uniform\n * - v_SOMETHING: varying (inside the\n * shader)\n */\n this._locations = WebGLUtils.Shaders.getLocations(this._gl, [\n 'a_Position', 'a_Normal',\n 'u_ModelMatrix', 'u_MvpMatrix', 'u_NormalMatrix',\n ]);\n\n this.adjustSize();\n }", "constructor() {\n\n\t\tsuper({\n\n\t\t\ttype: \"MeshTriplanarPhysicalMaterial\",\n\n\t\t\tdefines: { PHYSICAL: \"\" },\n\n\t\t\tuniforms: {\n\n\t\t\t\tmapY: new Uniform(null),\n\t\t\t\tmapZ: new Uniform(null),\n\n\t\t\t\tnormalMapY: new Uniform(null),\n\t\t\t\tnormalMapZ: new Uniform(null)\n\n\t\t\t},\n\n\t\t\tfragmentShader: fragment,\n\t\t\tvertexShader: vertex,\n\n\t\t\tlights: true,\n\t\t\tfog: true\n\n\t\t});\n\n\t\t// Clone uniforms to avoid conflicts with built-in materials.\n\t\tconst source = ShaderLib.physical.uniforms;\n\t\tconst target = this.uniforms;\n\n\t\tObject.keys(source).forEach(function(key) {\n\n\t\t\tconst value = source[key].value;\n\t\t\tconst uniform = new Uniform(value);\n\n\t\t\tObject.defineProperty(target, key, {\n\n\t\t\t\tvalue: (value === null) ? uniform : uniform.clone()\n\n\t\t\t});\n\n\t\t});\n\n\t\t/**\n\t\t * An environment map.\n\t\t *\n\t\t * @type {Texture}\n\t\t */\n\n\t\tthis.envMap = null;\n\n\t}", "function setupShaders() {\r\n \r\n // define fragment shader in essl using es6 template strings\r\n var fShaderCode = `\r\n precision mediump float;\r\n varying vec4 v_Color;\r\n void main(void) {\r\n gl_FragColor = v_Color; // all fragments are white\r\n }\r\n `;\r\n \r\n // define vertex shader in essl using es6 template strings\r\n var vShaderCode = `\r\n attribute vec3 vertexPosition;\r\n attribute vec3 diffuse;\r\n attribute vec3 ambient;\r\n attribute vec3 specular;\r\n varying vec4 v_Color;\r\n uniform mat4 uModelMatrix; // the model matrix\r\n uniform mat4 view; // the view matrix\r\n uniform mat4 projection;\r\n uniform mat4 modelMatrix;\r\n uniform mat4 viewMatrix;\r\n // Apply lighting effect\r\n attribute highp vec3 Norm;\r\n attribute highp vec3 Half;\r\n attribute highp vec3 Light;\r\n attribute highp float n;\r\n\r\n void main(void) {\r\n // position \r\n gl_Position = projection * view * uModelMatrix * vec4(vertexPosition, 1.0);\r\n //color\r\n float NdotL = dot(normalize(vec3(view * uModelMatrix * vec4(Norm, 0.0))), normalize(vec3(view * uModelMatrix * vec4(Light, 0.0))));\r\n float NdotH = dot(normalize(vec3(view * uModelMatrix * vec4(Norm, 0.0))), normalize(vec3(view * uModelMatrix * vec4(Half, 0.0))));\r\n float maxNdotL = max(NdotL, 0.0);\r\n float maxNdotH = max(NdotH, 0.0);\r\n v_Color = vec4(ambient, 1.0) + vec4(diffuse * maxNdotL, 1.0) + vec4(specular * pow(maxNdotH, n), 1.0);\r\n \r\n }\r\n `;\r\n \r\n try {\r\n // console.log(\"fragment shader: \"+fShaderCode);\r\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\r\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\r\n gl.compileShader(fShader); // compile the code for gpu execution\r\n\r\n // console.log(\"vertex shader: \"+vShaderCode);\r\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\r\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\r\n gl.compileShader(vShader); // compile the code for gpu execution\r\n \r\n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\r\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \r\n gl.deleteShader(fShader);\r\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\r\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \r\n gl.deleteShader(vShader);\r\n } else { // no compile errors\r\n var shaderProgram = gl.createProgram(); // create the single shader program\r\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\r\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\r\n gl.linkProgram(shaderProgram); // link program into gl context\r\n\r\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\r\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\r\n } else { // no shader program link errors\r\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\r\n vertexPositionAttrib = // get pointer to vertex shader input\r\n gl.getAttribLocation(shaderProgram, \"vertexPosition\"); \r\n modelMatrixULoc = gl.getUniformLocation(shaderProgram, \"uModelMatrix\"); // ptr to mmat\r\n view = gl.getUniformLocation(shaderProgram, \"view\"); // ptr to mmat\r\n projection = gl.getUniformLocation(shaderProgram, \"projection\"); // ptr to mmat\r\n\r\n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\r\n //color\r\n diffuse = gl.getAttribLocation(shaderProgram, 'diffuse');\r\n gl.enableVertexAttribArray(diffuse);\r\n ambient = gl.getAttribLocation(shaderProgram, 'ambient');\r\n gl.enableVertexAttribArray(ambient);\r\n specular = gl.getAttribLocation(shaderProgram, 'specular');\r\n gl.enableVertexAttribArray(specular);\r\n\r\n //vectors\r\n Norm = gl.getAttribLocation(shaderProgram, 'Norm');\r\n gl.enableVertexAttribArray(Norm);\r\n Light = gl.getAttribLocation(shaderProgram, 'Light');\r\n gl.enableVertexAttribArray(Light);\r\n Half = gl.getAttribLocation(shaderProgram, 'Half');\r\n gl.enableVertexAttribArray(Half);\r\n n = gl.getAttribLocation(shaderProgram, 'n');\r\n gl.enableVertexAttribArray(n);\r\n } // end if no shader program link errors\r\n } // end if no compile errors\r\n } // end try \r\n \r\n catch(e) {\r\n console.log(e);\r\n } // end catch\r\n} // end setup shaders", "function LGShaderContext() {\n //to store the code template\n this.vs_template = \"\";\n this.fs_template = \"\";\n\n //required so nodes now where to fetch the input data\n this.buffer_names = {\n uvs: \"v_coord\",\n };\n\n this.extra = {}; //to store custom info from the nodes (like if this shader supports a feature, etc)\n\n this._functions = {};\n this._uniforms = {};\n this._codeparts = {};\n this._uniform_value = null;\n }", "function setupSpriteShader(program){\r\n\tif(!use2D){\r\n\t\tprogram.aVertexPosition = ctx.getAttribLocation(program, \"aVertexPosition\");\r\n\t\tctx.enableVertexAttribArray(program.aVertexPosition);\r\n\t\t\r\n\t\tprogram.aTextureCoord = ctx.getAttribLocation(program, \"aTextureCoord\");\r\n\t\tctx.enableVertexAttribArray(program.aTextureCoord);\r\n\t\t\r\n\t\tprogram.attribCount = 2;\r\n\t\t\r\n\t\tprogram.uPMatrix = ctx.getUniformLocation(program, \"uPMatrix\");\r\n\t\tprogram.uMVMatrix = ctx.getUniformLocation(program, \"uMVMatrix\");\r\n\t\t\r\n\t\tprogram.frameOffset = ctx.getUniformLocation(program, \"frameOffset\");\r\n\t\tprogram.frameDims = ctx.getUniformLocation(program, \"frameDims\");\r\n\t\t\r\n\t\tprogram.tiles = ctx.getUniformLocation(program, \"tiles\");\r\n\t\tprogram.scroll = ctx.getUniformLocation(program, \"scroll\");\r\n\t\t\r\n\t\t//shaderProgram.alphaMap = ctx.getUniformLocation(shaderProgram, \"alphaMap\");\r\n\t\tprogram.multColor = ctx.getUniformLocation(program, \"multColor\");\r\n\t\tprogram.alpha = ctx.getUniformLocation(program, \"alpha\");\r\n\t}\r\n}", "init(vertexShaderName, fragmentShaderName, textureName1) {\n let vertexShaderSource = document.getElementById(vertexShaderName).innerHTML;\n let fragmentShaderSource = document.getElementById(fragmentShaderName).innerHTML;\n this.shaderProgram = createProgram(this.gl, vertexShaderSource, fragmentShaderSource);\n if (!this.shaderProgram) {\n console.log('Feil ved initialisering av shaderkoden.');\n } else {\n this.loadTexture(textureName1);\n }\n }", "constructor(_shader) {\n this.shader = _shader;\n // Creating vertex buffers.\n let vertices = new Float32Array([\n 1.0, 1.0, 0.0, // top right\n -1.0, 1.0, 0.0, // top left\n -1.0,-1.0, 0.0, // bottom left\n 1.0,-1.0, 0.0, // bottom right\n ]);\n let uvs = new Float32Array([\n 1.0, 0.0, \n 0.0, 0.0,\n 0.0, 1.0, \n 1.0, 1.0,\n ]);\n let indices = new Int8Array([\n 0,1,2,\n 0,2,3,\n ]);\n\n this.vertexBuffer = gl.createBuffer();\n this.uvBuffer = gl.createBuffer();\n this.indexBuffer = gl.createBuffer();\n\n // Create and bind new VAO\n this.vao = gl.createVertexArray();\n gl.bindVertexArray(this.vao);\n\n // Load indice data\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW, 0);\n\n // Load vertice data\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW, 0);\n let posLoc = this.shader.attribSpecs[\"a_Pos\"].location;\n gl.vertexAttribPointer(posLoc, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(posLoc);\n\n // Load UV data\n gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, uvs, gl.STATIC_DRAW, 0);\n let uvLoc = this.shader.attribSpecs[\"a_Texcoord\"].location;\n gl.vertexAttribPointer(uvLoc, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(uvLoc);\n\n gl.bindVertexArray(null);\n }", "function buildShader() {\n uniforms = {\n t: {value: 0.},\n mousePosition: {value: new THREE.Vector2(mouseX, mouseY)},\n planeSize: {value: new THREE.Vector2(0.5 / window.innerWidth,\n 0.5 / window.innerHeight)},\n aspectRatio: {value: window.innerHeight / window.innerWidth}\n };\n shaderMaterial = new THREE.ShaderMaterial({\n uniforms: uniforms,\n vertexShader: shaderSources['quad.vert'],\n fragmentShader: shaderSources['quad.frag']\n })\n}", "use() {\n gl.useProgram(this.program);\n }", "function LGraphShaderGraph() {\n //before inputs\n this.subgraph = new LiteGraph.LGraph();\n this.subgraph._subgraph_node = this;\n this.subgraph._is_subgraph = true;\n this.subgraph.filter = \"shader\";\n\n this.addInput(\"in\", \"texture\");\n this.addOutput(\"out\", \"texture\");\n this.properties = {\n width: 0,\n height: 0,\n alpha: false,\n precision:\n typeof LGraphTexture != \"undefined\" ? LGraphTexture.DEFAULT : 2,\n };\n\n var inputNode = this.subgraph.findNodesByType(\n \"shader::input/uniform\"\n )[0];\n inputNode.pos = [200, 300];\n\n var sampler = LiteGraph.createNode(\"shader::texture/sampler2D\");\n sampler.pos = [400, 300];\n this.subgraph.add(sampler);\n\n var outnode = LiteGraph.createNode(\"shader::output/fragcolor\");\n outnode.pos = [600, 300];\n this.subgraph.add(outnode);\n\n inputNode.connect(0, sampler);\n sampler.connect(0, outnode);\n\n this.size = [180, 60];\n this.redraw_on_mouse = true; //force redraw\n\n this._uniforms = {};\n this._shader = null;\n this._context = new LGShaderContext();\n this._context.vs_template =\n \"#define VERTEX\\n\" + GL.Shader.SCREEN_VERTEX_SHADER;\n this._context.fs_template = LGraphShaderGraph.template;\n }", "material() { return new class Material extends Overridable {}().replace({ shader: this }) }", "function GLShaderProgram() {\r\n\t// Name to identify this shader.\r\n\tthis.name = null;\r\n\r\n\t// Stores a reference to the shader program.\r\n\tthis.program = null;\r\n}", "function initShaders() {\n\tvar fragmentShader = getShader(gl, \"shader-fs\");\n\tvar vertexShader = getShader(gl, \"shader-vs\");\n\n\tvar shaderProgram = gl.createProgram();\n\tgl.attachShader(shaderProgram, vertexShader);\n\tgl.attachShader(shaderProgram, fragmentShader);\n\tgl.linkProgram(shaderProgram);\n\n\tif (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n\t\talert(\"Could not initialise shaders\");\n\t}\n\tgl.useProgram(shaderProgram);\n\n\tconst attrs = {\n\t\taVertexPosition: OBJ.Layout.POSITION.key,\n\t\taVertexNormal: OBJ.Layout.NORMAL.key,\n\t\taTextureCoord: OBJ.Layout.UV.key,\n\t\taDiffuse: OBJ.Layout.DIFFUSE.key,\n\t\taSpecular: OBJ.Layout.SPECULAR.key,\n\t\taSpecularExponent: OBJ.Layout.SPECULAR_EXPONENT.key\n\t};\n\n\tshaderProgram.attrIndices = {};\n\tfor (const attrName in attrs) {\n\t\tif (!attrs.hasOwnProperty(attrName)) {\n\t\t\tcontinue;\n\t\t}\n\t\tshaderProgram.attrIndices[attrName] = gl.getAttribLocation(shaderProgram, attrName);\n\t\tif (shaderProgram.attrIndices[attrName] != -1) {\n\t\t\tgl.enableVertexAttribArray(shaderProgram.attrIndices[attrName]);\n\t\t} else {\n\t\t\tconsole.warn(\n\t\t\t\t'Shader attribute \"' +\n\t\t\t\tattrName +\n\t\t\t\t'\" not found in shader. Is it undeclared or unused in the shader code?'\n\t\t\t);\n\t\t}\n\t}\n\n\tshaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n\tshaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\tshaderProgram.nMatrixUniform = gl.getUniformLocation(shaderProgram, \"uNMatrix\");\n\n\tshaderProgram.applyAttributePointers = function(model) {\n\t\tconst layout = model.mesh.vertexBuffer.layout;\n\t\tfor (const attrName in attrs) {\n\t\t\tif (!attrs.hasOwnProperty(attrName) || shaderProgram.attrIndices[attrName] == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst layoutKey = attrs[attrName];\n\t\t\tif (shaderProgram.attrIndices[attrName] != -1) {\n\t\t\t\tconst attr = layout[layoutKey];\n\t\t\t\tgl.vertexAttribPointer(\n\t\t\t\t\tshaderProgram.attrIndices[attrName],\n\t\t\t\t\tattr.size,\n\t\t\t\t\tgl[attr.type],\n\t\t\t\t\tattr.normalized,\n\t\t\t\t\tattr.stride,\n\t\t\t\t\tattr.offset\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n\treturn shaderProgram;\n}", "function UniformBuffer(engine,data,dynamic){this._engine=engine;this._noUBO=engine.webGLVersion===1;this._dynamic=dynamic;this._data=data||[];this._uniformLocations={};this._uniformSizes={};this._uniformLocationPointer=0;this._needSync=false;if(this._noUBO){this.updateMatrix3x3=this._updateMatrix3x3ForEffect;this.updateMatrix2x2=this._updateMatrix2x2ForEffect;this.updateFloat=this._updateFloatForEffect;this.updateFloat2=this._updateFloat2ForEffect;this.updateFloat3=this._updateFloat3ForEffect;this.updateFloat4=this._updateFloat4ForEffect;this.updateMatrix=this._updateMatrixForEffect;this.updateVector3=this._updateVector3ForEffect;this.updateVector4=this._updateVector4ForEffect;this.updateColor3=this._updateColor3ForEffect;this.updateColor4=this._updateColor4ForEffect;}else{this.updateMatrix3x3=this._updateMatrix3x3ForUniform;this.updateMatrix2x2=this._updateMatrix2x2ForUniform;this.updateFloat=this._updateFloatForUniform;this.updateFloat2=this._updateFloat2ForUniform;this.updateFloat3=this._updateFloat3ForUniform;this.updateFloat4=this._updateFloat4ForUniform;this.updateMatrix=this._updateMatrixForUniform;this.updateVector3=this._updateVector3ForUniform;this.updateVector4=this._updateVector4ForUniform;this.updateColor3=this._updateColor3ForUniform;this.updateColor4=this._updateColor4ForUniform;}}", "createProgram() {\n const vertexShader = this._compileShader(\n this.gl.VERTEX_SHADER,\n this.vertexShader\n );\n const fragmentShader = this._compileShader(\n this.gl.FRAGMENT_SHADER,\n this.fragmentShader\n );\n\n this.program = this.gl.createProgram();\n this.gl.attachShader(this.program, vertexShader);\n this.gl.attachShader(this.program, fragmentShader);\n this.gl.linkProgram(this.program);\n if (!this.gl.getProgramParameter(this.program, this.gl.LINK_STATUS)) {\n console.error(this.gl.getProgramInfoLog(this.program));\n }\n return this.program;\n }", "createProgram() {\n const gl = this.gl\n\n const program = gl.createProgram()\n gl.attachShader(program, this.vertexShader)\n gl.attachShader(program, this.fragmentShader)\n gl.linkProgram(program)\n\n const success = gl.getProgramParameter(program, gl.LINK_STATUS)\n if (success) {\n this.program = program\n gl.useProgram(program)\n } else {\n console.error(gl.getProgramInfoLog(program))\n gl.deleteProgram(program)\n }\n }", "function setFragmentShader( type ) {\n if ( type == CONSTANTS.STRIPE )\n fShader = $('#shader-fs-stripes');\n else if ( type == CONSTANTS.BRICK )\n fShader = $('#shader-fs-bricks');\n else\n fShader = $('#shader-fs-checkers');\n}", "function GPUComputeVar(variableName, computeFragmentShader, sizeX, sizeY, initialValueTexture, options) {\n // set size, value type (int/float), etc\n // attach callbacks with constructor?\n\n}", "constructor(uniforms, vertexShader, fragmentShader) {\n this.init(uniforms, vertexShader, fragmentShader)\n }", "function main() {\n\n // basically this function does setup that \"should\" only have to be done once,\n // while draw() does things that have to be repeated each time the canvas is\n // redrawn\n\n // retrieve <canvas> element\n var canvas = document.getElementById('theCanvas');\n\n // key handlers\n window.onkeypress = handleKeyPress;\n\n // get the rendering context for WebGL, using the utility from the teal book\n gl = getWebGLContext(canvas, false);\n if (!gl) {\n console.log('Failed to get the rendering context for WebGL');\n return;\n }\n\n // load and compile the shader pair, using utility from the teal book\n var vshaderSource = document.getElementById('vertexShader').textContent;\n var fshaderSource = document.getElementById('fragmentShader').textContent;\n if (!initShaders(gl, vshaderSource, fshaderSource)) {\n console.log('Failed to intialize shaders.');\n return;\n }\n\n // retain a handle to the shader program, then unbind it\n // (This looks odd, but the way initShaders works is that it \"binds\" the shader and\n // stores the handle in an extra property of the gl object. That's ok, but will really\n // mess things up when we have more than one shader pair.)\n shader = gl.program;\n gl.useProgram(null);\n\n // create model data\n var cube = makeCube();\n\n // buffer for vertex positions for triangles\n vertexBuffer = gl.createBuffer();\n if (!vertexBuffer) {\n\t console.log('Failed to create the buffer object');\n\t return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, cube.vertices, gl.STATIC_DRAW);\n\n // buffer for vertex colors\n vertexColorBuffer = gl.createBuffer();\n if (!vertexColorBuffer) {\n\t console.log('Failed to create the buffer object');\n\t return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, cube.colors, gl.STATIC_DRAW);\n\n\n // axes\n axisBuffer = gl.createBuffer();\n if (!axisBuffer) {\n\t console.log('Failed to create the buffer object');\n\t return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, axisBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, axisVertices, gl.STATIC_DRAW);\n\n // buffer for axis colors\n axisColorBuffer = gl.createBuffer();\n if (!axisColorBuffer) {\n\t console.log('Failed to create the buffer object');\n\t return;\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, axisColorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, axisColors, gl.STATIC_DRAW);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n // specify a fill color for clearing the framebuffer\n gl.clearColor(0.9, 0.9, 0.9, 1.0);\n\n gl.enable(gl.DEPTH_TEST);\n\n\n\n\n // define an animation loop\n var animate = function() {\n draw(theObject);\n // request that the browser calls animate() again \"as soon as it can\"\n requestAnimationFrame(animate, canvas);\n };\n\n // start drawing!\n animate();\n\n\n}", "getShader() {\n return this.shaderType;\n }", "function initWebGL() {\n /* Add default pointer */\n var pointers = [];\n pointers.push(new Pointer());\n /* Get webGL context */\n\n var webGL = canvas.getContext('webgl2', defualts.DRAWING_PARAMS);\n var isWebGL2 = !!webGL;\n if (!isWebGL2) webGL = canvas.getContext('webgl', defualts.DRAWING_PARAMS) || canvas.getContext('experimental-webgl', defualts.DRAWING_PARAMS);\n /* Get color formats */\n\n var colorFormats = getFormats();\n /* Case support adjustments */\n\n if (isMobile()) defualts.behavior.render_shaders = false;\n\n if (!colorFormats.supportLinearFiltering) {\n defualts.behavior.render_shaders = false;\n defualts.behavior.render_bloom = false;\n }\n /* Make our shaders and shader programs */\n\n\n var SHADER = {\n baseVertex: compileShader(webGL.VERTEX_SHADER, defualts.SHADER_SOURCE.vertex),\n clear: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.clear),\n color: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.color),\n background: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.background),\n display: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.display),\n displayBloom: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayBloom),\n displayShading: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayShading),\n displayBloomShading: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayBloomShading),\n bloomPreFilter: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomPreFilter),\n bloomBlur: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomBlur),\n bloomFinal: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomFinal),\n splat: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.splat),\n advectionManualFiltering: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.advectionManualFiltering),\n advection: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.advection),\n divergence: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.divergence),\n curl: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.curl),\n vorticity: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.vorticity),\n pressure: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.pressure),\n gradientSubtract: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.gradientSubtract)\n };\n var programs = formShaderPrograms(colorFormats.supportLinearFiltering);\n /* Worker Classes and Functions */\n\n /**\n * Is It Mobile?:\n * Detects whether or not a device is mobile by checking the user agent string\n *\n * @returns {boolean}\n */\n\n function isMobile() {\n return /Mobi|Android/i.test(navigator.userAgent);\n }\n /**\n * Get Formats:\n * Enable color extensions, linear filtering extensions, and return usable color formats RGBA,\n * RG (Red-Green), and R (Red).\n *\n * @returns {{formatRGBA: {internalFormat, format}, supportLinearFiltering: OES_texture_half_float_linear,\n * formatR: {internalFormat, format}, halfFloatTexType: *, formatRG: {internalFormat, format}}}\n */\n\n\n function getFormats() {\n /* Color Formats */\n var formatRGBA;\n var formatRG;\n var formatR;\n var halfFloat;\n var supportLinearFiltering;\n /* Enables webGL color extensions and get linear filtering extension*/\n\n if (isWebGL2) {\n webGL.getExtension('EXT_color_buffer_float');\n supportLinearFiltering = webGL.getExtension('OES_texture_float_linear');\n } else {\n halfFloat = webGL.getExtension('OES_texture_half_float');\n supportLinearFiltering = webGL.getExtension('OES_texture_half_float_linear');\n }\n\n var HALF_FLOAT_TEXTURE_TYPE = isWebGL2 ? webGL.HALF_FLOAT : halfFloat.HALF_FLOAT_OES;\n /* Set color to black for when color buffers are cleared */\n\n webGL.clearColor(0.0, 0.0, 0.0, 1.0);\n /* Retrieve color formats */\n\n if (isWebGL2) {\n formatRGBA = getSupportedFormat(webGL.RGBA16F, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatRG = getSupportedFormat(webGL.RG16F, webGL.RG, HALF_FLOAT_TEXTURE_TYPE);\n formatR = getSupportedFormat(webGL.R16F, webGL.RED, HALF_FLOAT_TEXTURE_TYPE);\n } else {\n formatRGBA = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatRG = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatR = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n }\n /** Get Supported Format\n * Using the specified internal format, we retrieve and return the desired color format to be\n * rendered with\n *\n * @param internalFormat: A GLenum that specifies the color components within the texture\n * @param format: Another GLenum that specifies the format of the texel data.\n * @returns {{internalFormat: *, format: *}|null|({internalFormat, format}|null)}\n */\n\n\n function getSupportedFormat(internalFormat, format, type) {\n var isSupportRenderTextureFormat;\n var texture = webGL.createTexture();\n /* Set texture parameters */\n\n webGL.bindTexture(webGL.TEXTURE_2D, texture);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_MIN_FILTER, webGL.NEAREST);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_MAG_FILTER, webGL.NEAREST);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_WRAP_S, webGL.CLAMP_TO_EDGE);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_WRAP_T, webGL.CLAMP_TO_EDGE);\n /* Specify a 2D texture image */\n\n webGL.texImage2D(webGL.TEXTURE_2D, 0, internalFormat, 4, 4, 0, format, type, null);\n /* Attach texture to frame buffer */\n\n var fbo = webGL.createFramebuffer();\n webGL.bindFramebuffer(webGL.FRAMEBUFFER, fbo);\n webGL.framebufferTexture2D(webGL.FRAMEBUFFER, webGL.COLOR_ATTACHMENT0, webGL.TEXTURE_2D, texture, 0);\n /* Check if current format is supported */\n\n var status = webGL.checkFramebufferStatus(webGL.FRAMEBUFFER);\n isSupportRenderTextureFormat = status === webGL.FRAMEBUFFER_COMPLETE;\n /* If not supported use fallback format, until we have no fallback */\n\n if (!isSupportRenderTextureFormat) {\n switch (internalFormat) {\n case webGL.R16F:\n return getSupportedFormat(webGL.RG16F, webGL.RG, type);\n\n case webGL.RG16F:\n return getSupportedFormat(webGL.RGBA16F, webGL.RGBA, type);\n\n default:\n return null;\n }\n }\n\n return {\n internalFormat: internalFormat,\n format: format\n };\n }\n\n return {\n formatRGBA: formatRGBA,\n formatRG: formatRG,\n formatR: formatR,\n halfFloatTexType: HALF_FLOAT_TEXTURE_TYPE,\n supportLinearFiltering: supportLinearFiltering\n };\n }\n /**\n * Compile Shader:\n * Makes a new webGL shader of type `type` using the provided GLSL source. The `type` is either of\n * `VERTEX_SHADER` or `FRAGMENT_SHADER`\n *\n * @param type: Passed to `createShader` to define the shader type\n * @param source: A GLSL source script, used to define the shader properties\n * @returns {WebGLShader}: A webGL shader of the parameterized type and source\n */\n\n\n function compileShader(type, source) {\n /* Create shader, link the source, and compile the GLSL*/\n var shader = webGL.createShader(type);\n webGL.shaderSource(shader, source);\n webGL.compileShader(shader);\n /* TODO: Finish error checking */\n\n if (!webGL.getShaderParameter(shader, webGL.COMPILE_STATUS)) throw webGL.getShaderInfoLog(shader);\n return shader;\n }\n /**\n * Form Shader Programs:\n * Assembles shaders into a webGl program we can use to write to our context\n *\n * @param supportLinearFiltering: A bool letting us know if we support linear filtering\n * @returns {{displayBloomProgram: GLProgram, vorticityProgram: GLProgram, displayShadingProgram: GLProgram,\n * displayBloomShadingProgram: GLProgram, gradientSubtractProgram: GLProgram, advectionProgram: GLProgram,\n * bloomBlurProgram: GLProgram, colorProgram: GLProgram, divergenceProgram: GLProgram, clearProgram: GLProgram,\n * splatProgram: GLProgram, displayProgram: GLProgram, bloomPreFilterProgram: GLProgram, curlProgram: GLProgram,\n * bloomFinalProgram: GLProgram, pressureProgram: GLProgram, backgroundProgram: GLProgram}}: Programs used to\n * render shaders\n *\n */\n\n\n function formShaderPrograms(supportLinearFiltering) {\n return {\n clearProgram: new GLProgram(SHADER.baseVertex, SHADER.clear, webGL),\n colorProgram: new GLProgram(SHADER.baseVertex, SHADER.color, webGL),\n backgroundProgram: new GLProgram(SHADER.baseVertex, SHADER.background, webGL),\n displayProgram: new GLProgram(SHADER.baseVertex, SHADER.display, webGL),\n displayBloomProgram: new GLProgram(SHADER.baseVertex, SHADER.displayBloom, webGL),\n displayShadingProgram: new GLProgram(SHADER.baseVertex, SHADER.displayShading, webGL),\n displayBloomShadingProgram: new GLProgram(SHADER.baseVertex, SHADER.displayBloomShading, webGL),\n bloomPreFilterProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomPreFilter, webGL),\n bloomBlurProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomBlur, webGL),\n bloomFinalProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomFinal, webGL),\n splatProgram: new GLProgram(SHADER.baseVertex, SHADER.splat, webGL),\n advectionProgram: new GLProgram(SHADER.baseVertex, supportLinearFiltering ? SHADER.advection : SHADER.advectionManualFiltering, webGL),\n divergenceProgram: new GLProgram(SHADER.baseVertex, SHADER.divergence, webGL),\n curlProgram: new GLProgram(SHADER.baseVertex, SHADER.curl, webGL),\n vorticityProgram: new GLProgram(SHADER.baseVertex, SHADER.vorticity, webGL),\n pressureProgram: new GLProgram(SHADER.baseVertex, SHADER.pressure, webGL),\n gradientSubtractProgram: new GLProgram(SHADER.baseVertex, SHADER.gradientSubtract, webGL)\n };\n }\n\n return {\n programs: programs,\n webGL: webGL,\n colorFormats: colorFormats,\n pointers: pointers\n };\n}", "function setupShaders() {\n __shaders.vertexShader_normal = document.getElementById(\"vertexShader_normal\").text;\n __shaders.fragmentShader_normal = document.getElementById(\"fragmentShader_normal\").text;\n}", "function Main() {\n\n MyGL.AssetsManager.getInstance().addGroup([\n //new MyGL.AssetData('standard_mat_bp_vshader', MyGL.AssetData.TEXT, './src/shaders/standard_material/phong-f/vert.glsl'),\n //new MyGL.AssetData('standard_mat_bp_fshader', MyGL.AssetData.TEXT, './src/shaders/standard_material/phong-f/frag.glsl'),\n //new MyGL.AssetData('standard_mat_bp_vshader_nt', MyGL.AssetData.TEXT, './src/shaders/standard_material/phong-f/vert_no_texture.glsl'),\n //new MyGL.AssetData('standard_mat_bp_fshader_nt', MyGL.AssetData.TEXT, './src/shaders/standard_material/phong-f/frag_no_texture.glsl'),\n new MyGL.AssetData('img_earth', MyGL.AssetData.IMAGE, './resource/earth.bmp'),\n new MyGL.AssetData('img_earth01', MyGL.AssetData.IMAGE, './resource/earth01.jpg'),\n new MyGL.AssetData('img_crate', MyGL.AssetData.IMAGE, './resource/crate.gif'),\n\n //new MyGL.AssetData('cube_mat_vshader', MyGL.AssetData.TEXT, './src/shaders/cube_material/base/vert.glsl'),\n //new MyGL.AssetData('cube_mat_fshader', MyGL.AssetData.TEXT, './src/shaders/cube_material/base/frag.glsl'),\n /*new AssetData('sky_n_x', AssetData.IMAGE, './resource/sky_n_x.jpg'),\n new AssetData('sky_n_y', AssetData.IMAGE, './resource/sky_n_y.jpg'),\n new AssetData('sky_n_z', AssetData.IMAGE, './resource/sky_n_z.jpg'),\n new AssetData('sky_p_x', AssetData.IMAGE, './resource/sky_p_x.jpg'),\n new AssetData('sky_p_y', AssetData.IMAGE, './resource/sky_p_y.jpg'),\n new AssetData('sky_p_z', AssetData.IMAGE, './resource/sky_p_z.jpg'),*/\n\n new MyGL.AssetData('cloudy_noon_nx', MyGL.AssetData.IMAGE, './resource/cloudy_noon_nx.jpg'),\n new MyGL.AssetData('cloudy_noon_ny', MyGL.AssetData.IMAGE, './resource/cloudy_noon_ny.jpg'),\n new MyGL.AssetData('cloudy_noon_nz', MyGL.AssetData.IMAGE, './resource/cloudy_noon_nz.jpg'),\n new MyGL.AssetData('cloudy_noon_px', MyGL.AssetData.IMAGE, './resource/cloudy_noon_px.jpg'),\n new MyGL.AssetData('cloudy_noon_py', MyGL.AssetData.IMAGE, './resource/cloudy_noon_py.jpg'),\n new MyGL.AssetData('cloudy_noon_pz', MyGL.AssetData.IMAGE, './resource/cloudy_noon_pz.jpg'),\n\n new MyGL.AssetData('land', MyGL.AssetData.IMAGE, './resource/land.png'),\n new MyGL.AssetData('grass', MyGL.AssetData.IMAGE, './resource/grass.png'),\n\n new MyGL.AssetData('drone', MyGL.AssetData.TEXT, './resource/drone.obj')\n //new AssetData('drone_diffuse', AssetData.IMAGE, './resource/drone_diffuse_01.png')\n ]);\n MyGL.AssetsManager.getInstance().addEventListener(MyGL.AssetsManager.GROUP_LOAD_COMPLETE, this.loadComplete, this);\n MyGL.AssetsManager.getInstance().load();\n}", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n env.batchId = 'a1'\n\n injectExtensions(env, scope)\n\n function all () {\n return true\n }\n\n emitAttributes(env, scope, args, program.attributes, all)\n emitUniforms(env, scope, args, program.uniforms, all)\n emitDraw(env, scope, scope, args)\n }", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n env.batchId = 'a1'\n\n injectExtensions(env, scope)\n\n function all () {\n return true\n }\n\n emitAttributes(env, scope, args, program.attributes, all)\n emitUniforms(env, scope, args, program.uniforms, all)\n emitDraw(env, scope, scope, args)\n }", "disableShader() {\n const gl = this._context;\n const meta = this._shaders.get(this._activeShader);\n if (!meta) {\n console.warn(`Trying to disable non-existing shader: ${this._activeShader}`);\n return;\n }\n\n const { layout } = meta;\n for (const { location } of layout.values()) {\n gl.disableVertexAttribArray(location);\n }\n }", "constructor({gl} = {}) {\n this.gl = gl;\n this.vertexShaders = {};\n this.fragmentShaders = {};\n }", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n\t env.batchId = 'a1';\n\t\n\t injectExtensions(env, scope);\n\t\n\t function all () {\n\t return true\n\t }\n\t\n\t emitAttributes(env, scope, args, program.attributes, all);\n\t emitUniforms(env, scope, args, program.uniforms, all);\n\t emitDraw(env, scope, scope, args);\n\t }", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n env.batchId = 'a1';\n\n injectExtensions(env, scope);\n\n function all () {\n return true\n }\n\n emitAttributes(env, scope, args, program.attributes, all);\n emitUniforms(env, scope, args, program.uniforms, all);\n emitDraw(env, scope, scope, args);\n }", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n env.batchId = 'a1';\n\n injectExtensions(env, scope);\n\n function all () {\n return true\n }\n\n emitAttributes(env, scope, args, program.attributes, all);\n emitUniforms(env, scope, args, program.uniforms, all);\n emitDraw(env, scope, scope, args);\n }", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n env.batchId = 'a1';\n\n injectExtensions(env, scope);\n\n function all () {\n return true\n }\n\n emitAttributes(env, scope, args, program.attributes, all);\n emitUniforms(env, scope, args, program.uniforms, all);\n emitDraw(env, scope, scope, args);\n }", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n env.batchId = 'a1';\n\n injectExtensions(env, scope);\n\n function all () {\n return true\n }\n\n emitAttributes(env, scope, args, program.attributes, all);\n emitUniforms(env, scope, args, program.uniforms, all);\n emitDraw(env, scope, scope, args);\n }", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n env.batchId = 'a1';\n\n injectExtensions(env, scope);\n\n function all () {\n return true\n }\n\n emitAttributes(env, scope, args, program.attributes, all);\n emitUniforms(env, scope, args, program.uniforms, all);\n emitDraw(env, scope, scope, args);\n }", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n env.batchId = 'a1';\n\n injectExtensions(env, scope);\n\n function all () {\n return true\n }\n\n emitAttributes(env, scope, args, program.attributes, all);\n emitUniforms(env, scope, args, program.uniforms, all);\n emitDraw(env, scope, scope, args);\n }", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n env.batchId = 'a1';\n\n injectExtensions(env, scope);\n\n function all () {\n return true\n }\n\n emitAttributes(env, scope, args, program.attributes, all);\n emitUniforms(env, scope, args, program.uniforms, all);\n emitDraw(env, scope, scope, args);\n }", "function emitBatchDynamicShaderBody (env, scope, args, program) {\n env.batchId = 'a1';\n\n injectExtensions(env, scope);\n\n function all () {\n return true\n }\n\n emitAttributes(env, scope, args, program.attributes, all);\n emitUniforms(env, scope, args, program.uniforms, all);\n emitDraw(env, scope, scope, args);\n }", "function initShaders() {\n var fragmentShader = getShader(gl, \"shader-fs\");\n var vertexShader = getShader(gl, \"shader-vs\");\n \n // Create the shader program\n shaderProgram = gl.createProgram();\n gl.attachShader(shaderProgram, vertexShader);\n gl.attachShader(shaderProgram, fragmentShader);\n gl.linkProgram(shaderProgram);\n \n // If creating the shader program failed, alert\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n alert(\"Unable to initialize the shader program.\");\n }\n \n // start using shading program for rendering\n gl.useProgram(shaderProgram);\n \n // store location of aVertexPosition variable defined in shader\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\n \n // turn on vertex position attribute at specified position\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\n\n // store location of aTextureCoord variable defined in shader\n shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoord\");\n\n // turn on vertex texture coordinates attribute at specified position\n gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\n\n // store location of uPMatrix variable defined in shader - projection matrix \n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n // store location of uMVMatrix variable defined in shader - model-view matrix \n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\n // store location of uSampler variable defined in shader\n shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\n}", "static load_shader(scriptid, attrs) {\n var script = document.getElementById(scriptid);\n var text = script.text;\n\n var ret = new ShaderProgram(undefined, undefined, undefined, [\"position\", \"normal\", \"uv\", \"color\", \"id\"]);\n\n var lowertext = text.toLowerCase();\n var vshader = text.slice(0, lowertext.search(\"//fragment\"));\n var fshader = text.slice(lowertext.search(\"//fragment\"), text.length);\n\n ret.vertexSource = vshader;\n ret.fragmentSource = fshader;\n ret.ready = true;\n\n ret.promise = new Promise(function(accept, reject) {\n accept(ret);\n });\n\n ret.then = function() {\n return this.promise.then.apply(this.promise, arguments);\n }\n\n return ret;\n }", "cacheGLUniformLocations() {\nvar ssuLoc, ssuaLoc;\n//----------------------\nssuLoc = (unm) => {\nreturn this.skinningShader.getUniformLocation(unm);\n};\nssuaLoc = function(uanm) {\nreturn ssuLoc(`${uanm}[0]`);\n};\nthis.uniformMVMat = ssuLoc(\"ModelViewMat\");\nthis.uniformMVPMat = ssuLoc(\"ModelViewProjMat\");\nif (this.DO_TRX_BONE_UNIFORMS) {\nif (!this.TEST_CPU_TRX_TO_MAT) {\nif (this.USE_TEXTURES) {\nthis.uniformSkelXformsWidth = ssuLoc(\"SkelXformsWidth\");\nthis.uniformSkelXformsHeight = ssuLoc(\"SkelXformsHeight\");\nthis.uniformSkelXforms = ssuLoc(\"SkelXforms\");\nif (this.DO_ARM_TWISTS) {\nthis.uniformBoneTwistWidth = ssuLoc(\"BoneTwistWidth\");\nthis.uniformBoneTwistHeight = ssuLoc(\"BoneTwistHeight\");\nthis.uniformBoneTwistData = ssuLoc(\"BoneTwistData\");\n}\n} else {\nthis.uniformSkelXforms = ssuaLoc(\"SkelXforms\");\nif (this.DO_ARM_TWISTS) {\nthis.uniformBoneTwistData = ssuaLoc(\"BoneTwistData\");\n}\n}\n} else {\nthis.uniformBones = ssuaLoc(\"Bones\");\n}\n} else {\nthis.uniformBones = ssuaLoc(\"Bones\");\n}\nthis.uniformMorphWeights = ssuLoc(\"MorphWeights\");\nreturn this.uniformTexture = ssuLoc(\"Texture\");\n}", "initBuffers() {\n var geometry = this.geometry;\n var dynamicOffset = 0;\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n * @private\n */\n this.indexBuffer = new Buffer_1.Buffer(WebGLSettings_1.WebGLSettings.createIndicesForQuads(this.size), true, true);\n geometry.addIndex(this.indexBuffer);\n this.dynamicStride = 0;\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n property.offset = dynamicOffset;\n dynamicOffset += property.size;\n this.dynamicStride += property.size;\n }\n var dynBuffer = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);\n this.dynamicData = new Float32Array(dynBuffer);\n this.dynamicDataUint32 = new Uint32Array(dynBuffer);\n this.dynamicBuffer = new Buffer_1.Buffer(this.dynamicData, false, false);\n // static //\n var staticOffset = 0;\n this.staticStride = 0;\n for (var i$1 = 0; i$1 < this.staticProperties.length; ++i$1) {\n var property$1 = this.staticProperties[i$1];\n property$1.offset = staticOffset;\n staticOffset += property$1.size;\n this.staticStride += property$1.size;\n }\n var statBuffer = new ArrayBuffer(this.size * this.staticStride * 4 * 4);\n this.staticData = new Float32Array(statBuffer);\n this.staticDataUint32 = new Uint32Array(statBuffer);\n this.staticBuffer = new Buffer_1.Buffer(this.staticData, true, false);\n for (var i$2 = 0; i$2 < this.dynamicProperties.length; ++i$2) {\n var property$2 = this.dynamicProperties[i$2];\n geometry.addAttribute(property$2.attributeName, this.dynamicBuffer, 0, property$2.type === WebGLSettings_1.WebGLSettings.TYPES.UNSIGNED_BYTE, property$2.type, this.dynamicStride * 4, property$2.offset * 4);\n }\n for (var i$3 = 0; i$3 < this.staticProperties.length; ++i$3) {\n var property$3 = this.staticProperties[i$3];\n geometry.addAttribute(property$3.attributeName, this.staticBuffer, 0, property$3.type === WebGLSettings_1.WebGLSettings.TYPES.UNSIGNED_BYTE, property$3.type, this.staticStride * 4, property$3.offset * 4);\n }\n }", "function setupterrianShaders(){\n var vertexShadert =loadShaderFromDOM(\"terrain-vs\");\n var fragmentShadert =loadShaderFromDOM(\"terrain-fs\");\n\n terrainProgram = gl.createProgram();\n gl.attachShader(terrainProgram, vertexShadert);\n gl.attachShader(terrainProgram, fragmentShadert);\n gl.linkProgram(terrainProgram);\n\n if (!gl.getProgramParameter(terrainProgram, gl.LINK_STATUS)){\n alert(\"Failed to setup terrainshaders\");\n }\n\n gl.useProgram(terrainProgram);\n\n terrainProgram.vertexNormalAttribute =gl.getAttribLocation(terrainProgram, \"aVertexNormalt\");\n console.log(\"Vex norm attrib: \", terrainProgram.vertexNormalAttribute);\n gl.enableVertexAttribArray(terrainProgram.vertexNormalAttribute);\n\n terrainProgram.vertexPositionAttribute = gl.getAttribLocation(terrainProgram, \"aVertexPositiont\");\n console.log(\"Vertex Position attrib: \", terrainProgram.vertexPositionAttribute);\n gl.enableVertexAttribArray(terrainProgram.vertexPositionAttribute);\n\n terrainProgram.textureCoordAttribute = gl.getAttribLocation(terrainProgram, \"aTexCoord\");\n gl.enableVertexAttribArray(terrainProgram.textureCoordAttribute);\n\n terrainProgram.mvMatrixUniform = gl.getUniformLocation(terrainProgram, \"uMVMatrixt\");\n terrainProgram.pMatrixUniform = gl.getUniformLocation(terrainProgram, \"uPMatrixt\");\n terrainProgram.nMatrixUniform = gl.getUniformLocation(terrainProgram, \"uNMatrixt\");\n terrainProgram.uniformLightPositionLoc = gl.getUniformLocation(terrainProgram, \"uLightPosition\"); \n terrainProgram.uniformAmbientLightColorLoc = gl.getUniformLocation(terrainProgram, \"uAmbientLightColor\"); \n terrainProgram.uniformDiffuseLightColorLoc = gl.getUniformLocation(terrainProgram, \"uDiffuseLightColor\");\n terrainProgram.uniformSpecularLightColorLoc = gl.getUniformLocation(terrainProgram, \"uSpecularLightColor\");\n terrainProgram.TextureSamplerUniform = gl.getUniformLocation(terrainProgram, \"uImage\");\n\n \n}", "function Shader(vertexSource, fragmentSource) {\n\t\t// Allow passing in the id of an HTML script tag with the source\n\n\n\t\tfunction followScriptTagById(id) {\n\t\t\tvar element = document.getElementById(id);\n\t\t\treturn element ? element.text : id;\n\t\t}\n\t\tvertexSource = followScriptTagById(vertexSource);\n\t\tfragmentSource = followScriptTagById(fragmentSource);\n\n\t\t// Headers are prepended to the sources to provide some automatic functionality.\n\t\tvar header = '\\\n uniform mat3 gl_NormalMatrix;\\\n uniform mat4 gl_ModelViewMatrix;\\\n uniform mat4 gl_ProjectionMatrix;\\\n uniform mat4 gl_ModelViewProjectionMatrix;\\\n uniform mat4 gl_ModelViewMatrixInverse;\\\n uniform mat4 gl_ProjectionMatrixInverse;\\\n uniform mat4 gl_ModelViewProjectionMatrixInverse;\\\n ';\n\t\tvar vertexHeader = header + '\\\n attribute vec4 gl_Vertex;\\\n attribute vec4 gl_TexCoord;\\\n attribute vec3 gl_Normal;\\\n attribute vec4 gl_Color;\\\n vec4 ftransform() {\\\n return gl_ModelViewProjectionMatrix * gl_Vertex;\\\n }\\\n ';\n\t\tvar fragmentHeader = '\\\n precision highp float;\\\n ' + header;\n\n\t\t// Check for the use of built-in matrices that require expensive matrix\n\t\t// multiplications to compute, and record these in `usedMatrices`.\n\t\tvar source = vertexSource + fragmentSource;\n\t\tvar usedMatrices = {};\n\t\tregexMap(/\\b(gl_[^;]*)\\b;/g, header, function(groups) {\n\t\t\tvar name = groups[1];\n\t\t\tif(source.indexOf(name) != -1) {\n\t\t\t\tvar capitalLetters = name.replace(/[a-z_]/g, '');\n\t\t\t\tusedMatrices[capitalLetters] = LIGHTGL_PREFIX + name;\n\t\t\t}\n\t\t});\n\t\tif(source.indexOf('ftransform') != -1) usedMatrices.MVPM = LIGHTGL_PREFIX + 'gl_ModelViewProjectionMatrix';\n\t\tthis.usedMatrices = usedMatrices;\n\n\t\t// The `gl_` prefix must be substituted for something else to avoid compile\n\t\t// errors, since it's a reserved prefix. This prefixes all reserved names with\n\t\t// `_`. The header is inserted after any extensions, since those must come\n\t\t// first.\n\n\n\t\tfunction fix(header, source) {\n\t\t\tvar replaced = {};\n\t\t\tvar match = /^((\\s*\\/\\/.*\\n|\\s*#extension.*\\n)+)\\^*$/.exec(source);\n\t\t\tsource = match ? match[1] + header + source.substr(match[1].length) : header + source;\n\t\t\tregexMap(/\\bgl_\\w+\\b/g, header, function(result) {\n\t\t\t\tif(!(result in replaced)) {\n\t\t\t\t\tsource = source.replace(new RegExp('\\\\b' + result + '\\\\b', 'g'), LIGHTGL_PREFIX + result);\n\t\t\t\t\treplaced[result] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn source;\n\t\t}\n\t\tvertexSource = fix(vertexHeader, vertexSource);\n\t\tfragmentSource = fix(fragmentHeader, fragmentSource);\n\n\t\t// Compile and link errors are thrown as strings.\n\n\n\t\tfunction compileSource(type, source) {\n\t\t\tvar shader = gl.createShader(type);\n\t\t\tgl.shaderSource(shader, source);\n\t\t\tgl.compileShader(shader);\n\t\t\tif(!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\t\t\tthrow 'compile error: ' + gl.getShaderInfoLog(shader);\n\t\t\t}\n\t\t\treturn shader;\n\t\t}\n\t\tthis.program = gl.createProgram();\n\t\tgl.attachShader(this.program, compileSource(gl.VERTEX_SHADER, vertexSource));\n\t\tgl.attachShader(this.program, compileSource(gl.FRAGMENT_SHADER, fragmentSource));\n\t\tgl.linkProgram(this.program);\n\t\tif(!gl.getProgramParameter(this.program, gl.LINK_STATUS)) {\n\t\t\tthrow 'link error: ' + gl.getProgramInfoLog(this.program);\n\t\t}\n\t\tthis.attributes = {};\n\t\tthis.uniformLocations = {};\n\n\t\t// Sampler uniforms need to be uploaded using `gl.uniform1i()` instead of `gl.uniform1f()`.\n\t\t// To do this automatically, we detect and remember all uniform samplers in the source code.\n\t\tvar isSampler = {};\n\t\tregexMap(/uniform\\s+sampler(1D|2D|3D|Cube)\\s+(\\w+)\\s*;/g, vertexSource + fragmentSource, function(groups) {\n\t\t\tisSampler[groups[2]] = 1;\n\t\t});\n\t\tthis.isSampler = isSampler;\n\t}", "enableShaderPass() {\n if(this.stacks.scenePasses.length && this.stacks.renderPasses.length === 0 && this.renderer.planes.length) {\n this.renderer.state.scenePassIndex = 0;\n this.renderer.bindFrameBuffer(this.stacks.scenePasses[0].target);\n }\n }", "constructor( webgl_manager, control_panel )\n { super( webgl_manager, control_panel );\n this.shapes = { triangle : new Minimal_Shape() }; // Send a Triangle's vertices to the GPU's buffers.\n this.shader = new Basic_Shader();\n }", "enableShaderPass() {\n if(this.stacks.scenePasses.length && this.stacks.renderPasses.length === 0 && this.renderer.planes.length) {\n this.renderer.state.scenePassIndex = 0;\n this.renderer.bindFrameBuffer(this.renderer.shaderPasses[this.stacks.scenePasses[0]].target);\n }\n }", "function Program (gl, vs, fs) {\n let program = gl.createProgram(vs, fs)\n\n gl.attachShader(program, vs)\n gl.attachShader(program, fs)\n gl.linkProgram(program)\n return program\n}", "finalizeGraphicsInitialization() {\n const error = this.programStatus.getProgramErrors();\n if (error) {\n if (error.detail) {\n console.warn(error.detail);\n }\n /** @type {Error & { view?: import(\"../view/view\").default}} */\n const err = new Error(\n \"Cannot create shader program: \" + error.message\n );\n err.view = this.unitView;\n throw err;\n }\n\n this.programInfo = createProgramInfoFromProgram(\n this.gl,\n this.programStatus.program\n );\n delete this.programStatus;\n\n if (this.domainUniforms.length) {\n this.domainUniformInfo = createUniformBlockInfo(\n this.gl,\n this.programInfo,\n \"Domains\"\n );\n }\n\n this.viewUniformInfo = createUniformBlockInfo(\n this.gl,\n this.programInfo,\n \"View\"\n );\n\n this.gl.useProgram(this.programInfo.program);\n\n this._setDatums();\n\n setUniforms(this.programInfo, {\n // left pos, left height, right pos, right height\n uSampleFacet: [0, 1, 0, 1],\n uTransitionOffset: 0.0,\n });\n }", "function initShaders() {\n\n var fragmentShader = getShader(\"shader-frag\", gl.FRAGMENT_SHADER);\n var vertexShader = getShader(\"shader-vert\", gl.VERTEX_SHADER);\n\n scene.shader = {};\n\n var program = gl.createProgram();\n scene.shader['default'] = program;\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n\n gl.linkProgram(program);\n\n program.vertexPositionAttribute = gl.getAttribLocation(program, \"aVertPosition\");\n\n program.texturePositionAttribute = gl.getAttribLocation(program, \"aTexPosition\");\n\n program.transformUniform = gl.getUniformLocation(program, \"uTransform\");\n program.samplerUniform = gl.getUniformLocation(program, \"sampler\");\n\n // it's the only one for now so we can use it immediately\n gl.useProgram(program);\n gl.enableVertexAttribArray(program.vertexPositionAttribute);\n gl.enableVertexAttribArray(program.texturePositionAttribute);\n}", "@autobind\n shaderLoad() {\n this.shadersLoaded++;\n\n if (this.shadersLoaded === 2) {\n this.loadColors();\n }\n }", "function setupShaders() {\r\n //console.log(\"SETTING UP SHADER FOR CUBE\\n\");\r\n vertexShader = loadShaderFromDOM(\"shader-vs\");\r\n fragmentShader = loadShaderFromDOM(\"shader-fs\");\r\n\r\n shaderProgram = gl.createProgram();\r\n gl.attachShader(shaderProgram, vertexShader);\r\n gl.attachShader(shaderProgram, fragmentShader);\r\n gl.linkProgram(shaderProgram);\r\n\r\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\r\n alert(\"Failed to setup shaders\");\r\n }\r\n\r\n gl.useProgram(shaderProgram);\r\n\r\n\r\n\r\n\r\n shaderProgram.texCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTexCoord\");\r\n //console.log(\"Tex coord attrib: \", shaderProgram.texCoordAttribute);\r\n gl.enableVertexAttribArray(shaderProgram.texCoordAttribute);\r\n\r\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\r\n //console.log(\"Vertex attrib: \", shaderProgram.vertexPositionAttribute);\r\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\r\n\r\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\r\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\r\n\r\n}", "function createShaderObj(shaderProgram) {\n return {\n program: shaderProgram,\n meta: getShaderData(shaderProgram)\n };\n }", "function addshader(gl, program, type, src) {\n var shader = gl.createShader(type);\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n if (! gl.getShaderParameter(shader, gl.COMPILE_STATUS))\n console.log(\"Cannot compile shader:\\n\\n\" + gl.getShaderInfoLog(shader));\n gl.attachShader(program, shader);\n}", "function addImmediateMode() {\n\t\tvar immediateMode = {\n\t\t\tmesh: new Mesh({\n\t\t\t\tcoords: true,\n\t\t\t\tcolors: true,\n\t\t\t\ttriangles: false\n\t\t\t}),\n\t\t\tmode: -1,\n\t\t\tcoord: [0, 0, 0, 0],\n\t\t\tcolor: [1, 1, 1, 1],\n\t\t\tpointSize: 1,\n\t\t\tshader: new Shader('\\\n uniform float pointSize;\\\n varying vec4 color;\\\n varying vec4 coord;\\\n void main() {\\\n color = gl_Color;\\\n coord = gl_TexCoord;\\\n gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\\\n gl_PointSize = pointSize;\\\n }\\\n ', '\\\n uniform sampler2D texture;\\\n uniform float pointSize;\\\n uniform bool useTexture;\\\n varying vec4 color;\\\n varying vec4 coord;\\\n void main() {\\\n gl_FragColor = color;\\\n if (useTexture) gl_FragColor *= texture2D(texture, coord.xy);\\\n }\\\n ')\n\t\t};\n\t\tgl.pointSize = function(pointSize) {\n\t\t\timmediateMode.shader.uniforms({\n\t\t\t\tpointSize: pointSize\n\t\t\t});\n\t\t};\n\t\tgl.begin = function(mode) {\n\t\t\tif(immediateMode.mode != -1) throw 'mismatched gl.begin() and gl.end() calls';\n\t\t\timmediateMode.mode = mode;\n\t\t\timmediateMode.mesh.colors = [];\n\t\t\timmediateMode.mesh.coords = [];\n\t\t\timmediateMode.mesh.vertices = [];\n\t\t};\n\t\tgl.color = function(r, g, b, a) {\n\t\t\timmediateMode.color = (arguments.length == 1) ? r.toArray().concat(1) : [r, g, b, a || 1];\n\t\t};\n\t\tgl.texCoord = function(s, t) {\n\t\t\timmediateMode.coord = (arguments.length == 1) ? s.toArray(2) : [s, t];\n\t\t};\n\t\tgl.vertex = function(x, y, z) {\n\t\t\timmediateMode.mesh.colors.push(immediateMode.color);\n\t\t\timmediateMode.mesh.coords.push(immediateMode.coord);\n\t\t\timmediateMode.mesh.vertices.push(arguments.length == 1 ? x.toArray() : [x, y, z]);\n\t\t};\n\t\tgl.end = function() {\n\t\t\tif(immediateMode.mode == -1) throw 'mismatched gl.begin() and gl.end() calls';\n\t\t\timmediateMode.mesh.compile();\n\t\t\timmediateMode.shader.uniforms({\n\t\t\t\tuseTexture: !! gl.getParameter(gl.TEXTURE_BINDING_2D)\n\t\t\t}).draw(immediateMode.mesh, immediateMode.mode);\n\t\t\timmediateMode.mode = -1;\n\t\t};\n\t}", "function linkShaders() {\n console.log(`*** INFO: Linking shaders... ***`);\n let program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error(`*** ERROR linking program ***`, gl.getProgramInfoLog(program));\n return;\n }\n console.log(`*** INFO: Validating program... ***`);\n gl.validateProgram(program);\n if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) {\n console.error(`*** ERROR validating program ***`, gl.getProgramInfoLog(program));\n return;\n }\n setupBuffers();\n linkAttributes(program);\n gl.useProgram(program);\n\n time_location = gl.getUniformLocation(program, `u_time`);\n resolution_location = gl.getUniformLocation(program, `u_resolution`);\n mouse_location = gl.getUniformLocation(program, `u_mouse`);\n colshift_location = gl.getUniformLocation(program, `u_colshift`);\n if (!started) {\n t0 = Date.now();\n }\n started = true;\n render(program); \n }", "constructor(){\n // 1D array, because it can be passed\n // to WebGL shader as is.\n this.data = new Float32Array(16);\n return this;\n }", "function initProgram() {\n // Compile shaders\n // Vertex Shader: simplest possible\n let vertShader = compileShader(gl, gl.VERTEX_SHADER,\n `#version 300 es\n precision mediump float;\n in vec4 aPosition;\n in vec4 aColor;\n out vec4 vColor;\n \n void main() {\n gl_Position = aPosition;\n gl_PointSize = 5.0; // make points visible\n vColor = aColor;\n }`\n );\n // Fragment Shader: simplest possible, chosen color is red for each point\n let fragShader = compileShader(gl, gl.FRAGMENT_SHADER,\n `#version 300 es\n precision mediump float;\n in vec4 vColor;\n out vec4 fragColor;\n void main() {\n fragColor = vColor;\n }`\n );\n\n // Link the shaders into a program and use them with the WebGL context\n let program = linkProgram(gl, vertShader, fragShader);\n gl.useProgram(program);\n \n // Get and save the position and color attribute indices\n program.aPosition = gl.getAttribLocation(program, 'aPosition'); // get the vertex shader attribute \"aPosition\"\n program.aColor = gl.getAttribLocation(program, 'aColor'); // get the vertex shader attribute \"aColor\"\n \n return program;\n}", "function setupShaders() {\n\n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 vertexPosition;\n attribute vec3 vertexNormal;\n attribute vec3 ambient;\n attribute vec3 diffuse;\n attribute vec3 specular;\n attribute float specularExponent;\n attribute float shapeNum;\n\n uniform vec3 eyePos;\n uniform vec3 lightPos;\n uniform vec3 lightColor;\n uniform mat4 projMatrix;\n uniform mat4 viewMatrix;\n uniform mat4 xformMatrix;\n uniform float currentShape;\n\n varying lowp vec4 vColor;\n\n void main(void) {\n vec3 N = normalize(vertexNormal); // normal vector\n vec3 L = normalize(lightPos - vertexPosition); // light vector\n vec3 V = normalize(eyePos - vertexPosition); // view vector\n vec3 H = normalize(L + V);\n \n vec3 color;\n for (int i = 0; i < 3; i++) {\n color[i] = ambient[i] * lightColor[0]; // ambient term\n color[i] += diffuse[i] * lightColor[1] * dot(N, L); // diffuse term\n color[i] += specular[i] * lightColor[2] * pow(dot(N, H), specularExponent); // specular term\n\n // Clamp color\n if (color[i] > 1.0) {\n color[i] = 1.0;\n } else if (color[i] < 0.0) {\n color[i] = 0.0;\n }\n }\n\n if (shapeNum == currentShape) {\n gl_Position = projMatrix * viewMatrix * xformMatrix * vec4(vertexPosition, 1.0); // use transform matrix\n } else {\n gl_Position = projMatrix * viewMatrix * mat4(1.0) * vec4(vertexPosition, 1.0); // use untransformed position\n }\n\n vColor = vec4(color, 1.0);\n }\n `;\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n varying lowp vec4 vColor;\n\n void main(void) {\n gl_FragColor = vColor;\n }\n `;\n \n try {\n // console.log(\"fragment shader: \"+fShaderCode);\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n // console.log(\"vertex shader: \"+vShaderCode);\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n\n // Setup attributes\n vertexPositionAttrib = gl.getAttribLocation(shaderProgram, \"vertexPosition\"); // get pointer to vertex shader input\n gl.enableVertexAttribArray(vertexPositionAttrib); // input to shader from array\n\n vertexNormalAttrib = gl.getAttribLocation(shaderProgram, \"vertexNormal\");\n gl.enableVertexAttribArray(vertexNormalAttrib);\n\n vertexAmbientAttrib = gl.getAttribLocation(shaderProgram, \"ambient\");\n gl.enableVertexAttribArray(vertexAmbientAttrib);\n\n vertexDiffuseAttrib = gl.getAttribLocation(shaderProgram, \"diffuse\");\n gl.enableVertexAttribArray(vertexDiffuseAttrib);\n\n vertexSpecularAttrib = gl.getAttribLocation(shaderProgram, \"specular\");\n gl.enableVertexAttribArray(vertexSpecularAttrib);\n\n vertexSpecExpAttrib = gl.getAttribLocation(shaderProgram, \"specularExponent\");\n gl.enableVertexAttribArray(vertexSpecExpAttrib);\n\n vertexShapeNumAttrib = gl.getAttribLocation(shaderProgram, \"shapeNum\");\n gl.enableVertexAttribArray(vertexShapeNumAttrib);\n\n // Setup uniforms\n eyePosUniform = gl.getUniformLocation(shaderProgram, 'eyePos');\n gl.uniform3fv(eyePosUniform, eye);\n\n mat4.perspective(projectionMatrix, glMatrix.toRadian(90), 1, 0.1, 100);\n projMatrixUniform = gl.getUniformLocation(shaderProgram, 'projMatrix');\n gl.uniformMatrix4fv(projMatrixUniform, gl.FALSE, projectionMatrix);\n \n var center = vec3.create();\n vec3.add(center, eye, lookAt);\n mat4.lookAt(viewMatrix, eye, center, upVector);\n viewMatrixUniform = gl.getUniformLocation(shaderProgram, 'viewMatrix');\n gl.uniformMatrix4fv(viewMatrixUniform, gl.FALSE, viewMatrix);\n\n // mat4.identity(transformMatrix);\n xformMatrixUniform = gl.getUniformLocation(shaderProgram, 'xformMatrix');\n gl.uniformMatrix4fv(xformMatrixUniform, gl.FALSE, transformMatrix);\n\n lightPosUniform = gl.getUniformLocation(shaderProgram, 'lightPos');\n gl.uniform3fv(lightPosUniform, lightPos);\n\n lightColorUniform = gl.getUniformLocation(shaderProgram, 'lightColor');\n gl.uniform3fv(lightColorUniform, lightColor);\n\n currentShapeUniform = gl.getUniformLocation(shaderProgram, 'currentShape');\n gl.uniform1f(currentShapeUniform, shapeNum);\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "function setupShaders() {\n \n // define vertex shader in essl using es6 template strings\n var vShaderCode = `\n attribute vec3 aVertexPosition; // vertex position\n \n uniform mat4 umMatrix; // the model matrix\n uniform mat4 upvmMatrix; // the project view model matrix\n\n uniform float xtranslate;\n uniform float ytranslate;\n uniform float ztranslate;\n \n varying vec3 vWorldPos; // interpolated world position of vertex\n\n void main(void) {\n \n vec4 vWorldPos4 = umMatrix * vec4(aVertexPosition, 1.0);\n vWorldPos = vec3(vWorldPos4.x,vWorldPos4.y,vWorldPos4.z);\n gl_Position = upvmMatrix * vec4(aVertexPosition[0] + xtranslate, aVertexPosition[1] + ytranslate, aVertexPosition[2] + ztranslate, 1.0);\n }\n `;\n \n // define fragment shader in essl using es6 template strings\n var fShaderCode = `\n precision mediump float; // set float to medium precision\n\n // eye location\n uniform vec3 uEyePosition; // the eye's position in world\n \n // light properties\n uniform vec3 uLightDiffuse; // the light's diffuse color\n uniform vec3 uLightPosition; // the light's position\n \n // material properties\n uniform vec3 uDiffuse; // the diffuse reflectivity\n\n // transparency\n uniform float uTransp;\n \n // geometry properties\n varying vec3 vWorldPos; // world xyz of fragment\n \n void main(void) {\n \n vec3 diffuse = uDiffuse*uLightDiffuse;\n \n vec3 colorOut = diffuse;\n gl_FragColor = vec4(colorOut, uTransp); \n }\n `;\n \n try {\n var fShader = gl.createShader(gl.FRAGMENT_SHADER); // create frag shader\n gl.shaderSource(fShader,fShaderCode); // attach code to shader\n gl.compileShader(fShader); // compile the code for gpu execution\n\n var vShader = gl.createShader(gl.VERTEX_SHADER); // create vertex shader\n gl.shaderSource(vShader,vShaderCode); // attach code to shader\n gl.compileShader(vShader); // compile the code for gpu execution\n \n if (!gl.getShaderParameter(fShader, gl.COMPILE_STATUS)) { // bad frag shader compile\n throw \"error during fragment shader compile: \" + gl.getShaderInfoLog(fShader); \n gl.deleteShader(fShader);\n } else if (!gl.getShaderParameter(vShader, gl.COMPILE_STATUS)) { // bad vertex shader compile\n throw \"error during vertex shader compile: \" + gl.getShaderInfoLog(vShader); \n gl.deleteShader(vShader);\n } else { // no compile errors\n var shaderProgram = gl.createProgram(); // create the single shader program\n gl.attachShader(shaderProgram, fShader); // put frag shader in program\n gl.attachShader(shaderProgram, vShader); // put vertex shader in program\n gl.linkProgram(shaderProgram); // link program into gl context\n\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) { // bad program link\n throw \"error during shader program linking: \" + gl.getProgramInfoLog(shaderProgram);\n } else { // no shader program link errors\n gl.useProgram(shaderProgram); // activate shader program (frag and vert)\n \n // locate and enable vertex attributes\n vPosAttribLoc = gl.getAttribLocation(shaderProgram, \"aVertexPosition\"); // ptr to vertex pos attrib\n gl.enableVertexAttribArray(vPosAttribLoc); // connect attrib to array\n \n // locate vertex uniforms\n mMatrixULoc = gl.getUniformLocation(shaderProgram, \"umMatrix\"); // ptr to mmat\n pvmMatrixULoc = gl.getUniformLocation(shaderProgram, \"upvmMatrix\"); // ptr to pvmmat\n \n // locate fragment uniforms\n var eyePositionULoc = gl.getUniformLocation(shaderProgram, \"uEyePosition\"); // ptr to eye position\n var lightDiffuseULoc = gl.getUniformLocation(shaderProgram, \"uLightDiffuse\"); // ptr to light diffuse\n var lightPositionULoc = gl.getUniformLocation(shaderProgram, \"uLightPosition\"); // ptr to light position\n diffuseULoc = gl.getUniformLocation(shaderProgram, \"uDiffuse\"); // ptr to diffuse\n transpULoc = gl.getUniformLocation(shaderProgram, \"uTransp\"); \n xTransULoc = gl.getUniformLocation(shaderProgram, \"xtranslate\"); \n yTransULoc = gl.getUniformLocation(shaderProgram, \"ytranslate\"); \n zTransULoc = gl.getUniformLocation(shaderProgram, \"ztranslate\"); \n \n // pass global constants into fragment uniforms\n gl.uniform3fv(eyePositionULoc,Eye); // pass in the eye's position\n gl.uniform3fv(lightDiffuseULoc,lightDiffuse); // pass in the light's diffuse emission\n gl.uniform3fv(lightPositionULoc,lightPosition); // pass in the light's position\n } // end if no shader program link errors\n } // end if no compile errors\n } // end try \n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setup shaders", "function Shader(gl, script) {\n\n // Now figure out what type of shader script we have, based on its MIME type.\n if (script.type === 'x-shader/x-fragment') {\n this.shader = gl.createShader(gl.FRAGMENT_SHADER);\n } else if (script.type === 'x-shader/x-vertex') {\n this.shader = gl.createShader(gl.VERTEX_SHADER);\n } else {\n (0, _error2.default)('Unknown shader type: ' + script.type);\n return;\n }\n\n // Send the source to the shader object.\n gl.shaderSource(this.shader, script.source);\n\n // Compile the shader program.\n gl.compileShader(this.shader);\n\n // See if it compiled successfully.\n if (!gl.getShaderParameter(this.shader, gl.COMPILE_STATUS)) {\n (0, _error2.default)('An error occurred compiling the shaders: ' + gl.getShaderInfoLog(this.shader));\n }\n}", "function initProgram() {\r\n // Compile shaders\r\n // Vertex Shader\r\n let vert_shader = compileShader(gl, gl.VERTEX_SHADER,\r\n `#version 300 es\r\n precision mediump float;\r\n\r\n // Matrices\r\n uniform mat4 uModelViewMatrix;\r\n uniform mat4 uProjectionMatrix;\r\n\r\n // Light Position\r\n const vec4 light = vec4(0, 0, 5, 1);\r\n\r\n // Attributes for the vertex (from VBOs)\r\n in vec4 aPosition;\r\n in vec3 aNormal;\r\n\r\n // Vectors (varying variables to vertex shader)\r\n out vec3 vNormalVector;\r\n out vec3 vLightVector;\r\n out vec3 vEyeVector;\r\n\r\n // Texture information\r\n out vec3 vTexCoord;\r\n\r\n void main() {\r\n vec4 P = uModelViewMatrix * aPosition;\r\n\r\n vNormalVector = mat3(uModelViewMatrix) * aNormal;\r\n vLightVector = light.w == 1.0 ? P.xyz - light.xyz : light.xyz;\r\n vEyeVector = -P.xyz;\r\n\r\n gl_Position = uProjectionMatrix * P;\r\n\r\n\t\t\tvTexCoord = aPosition.xyz;\r\n }`\r\n );\r\n // Fragment Shader - Phong Shading and Reflections\r\n let frag_shader = compileShader(gl, gl.FRAGMENT_SHADER,\r\n `#version 300 es\r\n precision mediump float;\r\n\r\n // Light and material properties\r\n const vec3 lightColor = vec3(1, 1, 1);\r\n const vec4 materialColor = vec4(0, 1, 0, 1);\r\n const float materialAmbient = 0.2;\r\n const float materialDiffuse = 0.5;\r\n const float materialSpecular = 0.3;\r\n const float materialShininess = 10.0;\r\n\r\n // Vectors (varying variables from vertex shader)\r\n in vec3 vNormalVector;\r\n in vec3 vLightVector;\r\n in vec3 vEyeVector;\r\n\r\n // Texture information\r\n uniform samplerCube uTexture;\r\n in vec3 vTexCoord;\r\n\r\n // Output color\r\n out vec4 fragColor;\r\n\r\n void main() {\r\n // Normalize vectors\r\n vec3 N = normalize(vNormalVector);\r\n vec3 L = normalize(vLightVector);\r\n vec3 E = normalize(vEyeVector);\r\n\r\n // Compute lighting\r\n float diffuse = dot(-L, N);\r\n float specular = 0.0;\r\n if (diffuse < 0.0) {\r\n diffuse = 0.0;\r\n } else {\r\n vec3 R = reflect(L, N);\r\n specular = pow(max(dot(R, E), 0.0), materialShininess);\r\n }\r\n \r\n // Object color combined from texture and material\r\n vec4 color = texture(uTexture, vTexCoord);\r\n\r\n // Compute final color\r\n fragColor.rgb = lightColor * (\r\n (materialAmbient + materialDiffuse * diffuse) * color.rgb +\r\n materialSpecular * specular);\r\n fragColor.a = 1.0;\r\n }`\r\n );\r\n\r\n // Link the shaders into a program and use them with the WebGL context\r\n let program = linkProgram(gl, vert_shader, frag_shader);\r\n gl.useProgram(program);\r\n \r\n // Get the attribute indices\r\n program.aPosition = gl.getAttribLocation(program, 'aPosition');\r\n program.aNormal = gl.getAttribLocation(program, 'aNormal');\r\n program.aTexCoord = gl.getAttribLocation(program, 'aTexCoord');\r\n\r\n // Get the uniform indices\r\n program.uModelViewMatrix = gl.getUniformLocation(program, 'uModelViewMatrix');\r\n program.uProjectionMatrix = gl.getUniformLocation(program, 'uProjectionMatrix');\r\n\r\n return program;\r\n}", "initGLSLBuffers() {\n var attributeBuffer = this.gl.createBuffer();\n var indexBuffer = this.gl.createBuffer();\n\n if (!attributeBuffer || !indexBuffer) {\n console.log(\"Failed to create buffers!\");\n return;\n }\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, attributeBuffer);\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n }", "function initShaders() {\r\n var fragmentShader = getShader(gl, \"shader-fs\");\r\n var vertexShader = getShader(gl, \"shader-vs\");\r\n\r\n // Create the shader program\r\n shaderProgram = gl.createProgram();\r\n gl.attachShader(shaderProgram, vertexShader);\r\n gl.attachShader(shaderProgram, fragmentShader);\r\n gl.linkProgram(shaderProgram);\r\n\r\n // If creating the shader program failed, alert\r\n if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\r\n alert(\"Unable to initialize the shader program.\");\r\n }\r\n\r\n // start using shading program for rendering\r\n gl.useProgram(shaderProgram);\r\n\r\n // store location of aVertexPosition variable defined in shader\r\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation(shaderProgram, \"aVertexPosition\");\r\n\r\n // turn on vertex position attribute at specified position\r\n gl.enableVertexAttribArray(shaderProgram.vertexPositionAttribute);\r\n\r\n // store location of aVertexNormal variable defined in shader\r\n shaderProgram.textureCoordAttribute = gl.getAttribLocation(shaderProgram, \"aTextureCoord\");\r\n\r\n // store location of aTextureCoord variable defined in shader\r\n gl.enableVertexAttribArray(shaderProgram.textureCoordAttribute);\r\n\r\n // store location of uPMatrix variable defined in shader - projection matrix\r\n shaderProgram.pMatrixUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\r\n // store location of uMVMatrix variable defined in shader - model-view matrix\r\n shaderProgram.mvMatrixUniform = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\r\n // store location of uSampler variable defined in shader\r\n shaderProgram.samplerUniform = gl.getUniformLocation(shaderProgram, \"uSampler\");\r\n}", "function Scene(gl) {\n\n // store the WebGL rendering context \n this.gl = gl; \n \n // create all required GPU programs from vertex and fragment shaders\n this.programs = {\n red : new Program(gl, \n shaders.getVertexShader('red'), \n shaders.getFragmentShader('red')\n ),\n\t\t\tgreen : new Program(gl, \n shaders.getVertexShader('green'), \n shaders.getFragmentShader('green')\n ),\n\t\t\tlila : new Program(gl, \n shaders.getVertexShader('lila'), \n shaders.getFragmentShader('lila')\n ),\n vertexColor : new Program(gl, \n shaders.getVertexShader('vertex_color'), \n shaders.getFragmentShader('vertex_color')\n ),\n\t\t\tuniColor : new Program(gl, \n shaders.getVertexShader('unicolor'), \n shaders.getFragmentShader('unicolor')\n ),\n\t\t\tvertexNormalCol : new Program(gl, \n shaders.getVertexShader('phong_vertex_color'), \n shaders.getFragmentShader('phong_vertex_color')\n ),\n\t\t\tvertexNormalPhong : new Program(gl, \n shaders.getVertexShader('phong_pervertex'), \n shaders.getFragmentShader('phong_pervertex')\n ),\n\t\t\tvertexNormalPixel : new Program(gl, \n shaders.getVertexShader('phong_perpixel'), \n shaders.getFragmentShader('phong_perpixel')\n ),\n\t\t\tearth : new Program(gl, \n shaders.getVertexShader('earth'), \n shaders.getFragmentShader('earth')\n ),\n\t\t\tcloud : new Program(gl, \n shaders.getVertexShader('cloud'), \n shaders.getFragmentShader('cloud')\n )\n };\n\n // create a camera mathematically\n this.camera = {\n eye : [0, 0.5, 10], // position in scene\n pov : [0, 0, 0], // focus point\n up : [0, 1, 0] // head orientation\n };\n\n // setup some matrices for mvp\n this.modelviewMatrix = mat4.create();\n this.viewMatrix = mat4.create();\n this.rotationMatrix = mat4.create();\n mat4.identity(this.rotationMatrix);\n this.projectionMatrix = mat4.create();\n\t\tthis.lightPos0 = [-10.0,0.0,-7.0,1.0];//[2.0,2.0,2.0,1.0];//[10.0, 12.5, 11.0, 1.0];\n \n\t\t// function to set material via application\n\t\tthis.setMaterial = function(prog, mat) {\n\t\t\tprog.use();\n\t\t\tprog.setUniform(\"material.ambient\", \"vec3\", mat.ambient);\n\t\t\tprog.setUniform(\"material.diffuse\", \"vec3\", mat.diffuse);\t\n\t\t\tprog.setUniform(\"material.specular\", \"vec3\", mat.specular);\t\n\t\t\tprog.setUniform(\"material.shininess\", \"float\", mat.shininess);\t\n\t\t};\n\t\t// function to set single light via application\n\t\tthis.setLight1 = function(prog, matL) {\n\t\t\tprog.use();\n\t\t\tprog.setUniform(\"light.position\",\"vec4\", matL.position);\n\t\t\tprog.setUniform(\"light.color\", \"vec3\", matL.color);\t\t\n\t\t\tprog.setUniform(\"light.type\", \"float\", matL.type);\n\t\t};\n\t\tthis.setLight2 = function(prog, matL0,matL1) {\n\t\t\tprog.use();\n\t\t\tprog.setUniform(\"light[0].position\",\"vec4\", matL0.position);\n\t\t\tprog.setUniform(\"light[0].color\", \"vec3\", matL0.color);\t\t\n\t\t\tprog.setUniform(\"light[0].type\", \"float\", matL0.type);\n\t\t\tprog.setUniform(\"light[1].position\",\"vec4\", matL1.position);\n\t\t\tprog.setUniform(\"light[1].color\", \"vec3\", matL1.color);\t\t\n\t\t\tprog.setUniform(\"light[1].type\", \"float\", matL1.type);\n\t\t};\n\t\t\n // the scene has an attribute 'drawOptions' that is used by \n // the HtmlController. Each attribute in this.drawOptions \n // automatically generates a corresponding checkbox in the UI.\n this.drawOptions = {\n 'Perspective Projection': false, \n 'Show Band Points' : false,\n\t\t\t'Show Band Wire' : false,\n\t\t\t'Show Band Solid' : false,\n\t\t\t'Show Band WireFrame' : false,\n 'Show Ellipsoid' : false,\n\t\t\t'Show Horn'\t\t : false,\n\t\t\t'Show Helicoid' : false,\n\t\t\t'Show Triangle' : false,\n\t\t\t'Show Cube' : false,\n\t\t\t'Show Sphere Colored'\t: false,\n\t\t\t'Show Sphere Phong'\t\t: false,\n\t\t\t'Show Sphere Pixel'\t\t: false,\n\t\t\t'Show Earth'\t\t\t: false,\n\t\t\t'Show Cloud'\t\t\t: false\n\t\t};\n\n /*\n * create objects for the scene\n */\n\n // create a Band object to be drawn in this scene\n this.bandPoints = new Band(gl, { height : 0.4, drawStyle : 'points' });\n\t\tthis.bandWire = new Band(gl, { height : 0.4, drawStyle : 'wire' });\n\t\tthis.bandSolid = new Band(gl, { height : 0.4, drawStyle : 'solid' });\n\t\tthis.bandWireframe = new Band(gl, { height : 0.4, drawStyle : 'wireframe' });\n\n // ELLIPSIOD: create a parametric surface function\n var ellipsoidFunc = function(u, v) {\n return [\n 0.5 * Math.sin(u) * Math.cos(v),\n 0.3 * Math.sin(u) * Math.sin(v),\n 0.9 * Math.cos(u)\n ];\n };\n // ELLIPSIOD: create a parametric surface to be drawn in this scene\n this.ellipsoid = new ParametricSurface(gl, ellipsoidFunc, {\n uMin : -Math.PI, uMax : Math.PI, uSegments : 50,\n vMin : -Math.PI, vMax : Math.PI, vSegments : 50,\n drawStyle: 'wireframe',\n\t\t\tsurfCol: [1.0,0.5,0.0,1.0]\n });\n\t\t\n\t\t// HORN: create a parametric surface function\n\t\t var hornFunc = function(u, v) {\n\t\t\t var a = 1.0;\n\t\t\t var b = 1.6;\n\t\t\t var c = 0.0;\n return [\n\t\t\t\t(a + u * Math.cos(v)) * Math.sin(b*Math.PI * u),\n\t\t\t\t((a + u * Math.cos(v)) * Math.cos(b*Math.PI * u)) + c * u,\n u * Math.sin(v)\n ];\n };\n // HORN: create a parametric surface to be drawn in this scene\n this.horn = new ParametricSurface(gl, hornFunc, {\n uMin : 0.01, uMax : 0.7, uSegments : 50,\n vMin : -Math.PI, vMax : Math.PI, vSegments : 50,\n drawStyle: 'wireframe',\n\t\t\tsurfCol: [1.0,0.0,1.0,1.0]\n });\n\t\t\n\t\t// HYPERBOLIC HELICOID: create a parametric surface function\n\t\t var hypHeliFunc = function(u, v) {\n\t\t\t var a = 2.5;\n\t\t\t var f = 1 + (Math.cosh(u)*Math.cosh(v));\n return [\n\t\t\t\tMath.sinh(v) * Math.cos(a * u) / f,\n\t\t\t\tMath.sinh(v) * Math.sin(a * u) / f,\n Math.cosh(v) * Math.sinh(u) / f,\n ];\n };\n // HYPERBOLIC HELICOID: create a parametric surface to be drawn in this scene\n this.hypHeli = new ParametricSurface(gl, hypHeliFunc, {\n puMin : -2.5, uMax : 2.5, uSegments : 70,\n vMin : -4.0, vMax : 4.0, vSegments : 30,\n drawStyle: 'wireframe',\n\t\t\tsurfCol: [0.0,0.8,0.0,1.0]\n });\n\t\t\n\t\t// create a Triangle object to be drawn in this scene\n this.triangle = new Triangle(gl);\n\t\t// create a Cube object to be drawn in this scene\n this.cube = new Cube(gl);\n\t\t\n\t\tthis.sphere = new Sphere(gl, {\n\t\t\tnumLatitudes : 60,\n\t\t\tnumLongitudes : 60,\n\t\t\tradius : 0.65\n\t\t});\n\t\t\n\t\tvar self = this;\n\t\tvar onLoaded = function() {\n\t\t\tself.draw();\n\t\t}\n\t\t\n\t\tthis.textures = {\n\t\t\tearthDay: new Texture(gl, {\n\t\t\t\tname\t: 'earthDay',\n\t\t\t\tpath\t: './textures/earth_day.jpg',\n\t\t\t\tonLoaded: onLoaded\n\t\t\t}),\n\t\t\tearthNight: new Texture(gl, {\n\t\t\t\tname\t: 'earthNight',\n\t\t\t\tpath\t: './textures/earth_night.jpg',\n\t\t\t\tonLoaded: onLoaded\n\t\t\t}),\n\t\t\tearthWater: new Texture(gl, {\n\t\t\t\tname\t: 'earthWater',\n\t\t\t\tpath\t: './textures/earth_water.jpg',\n\t\t\t\tonLoaded: onLoaded\n\t\t\t}),\n\t\t\tearthCloud: new Texture(gl, {\n\t\t\t\tname\t: 'earthCloud',\n\t\t\t\tpath\t: './textures/earth_cloud.jpg',\n\t\t\t\tonLoaded: onLoaded\n\t\t\t})\n\t\t}\n\t\t\n\t\tthis.sphereEarth = new Earth(gl, {\n\t\t\tnumLatitudes : 30,\n\t\t\tnumLongitudes : 30,\n\t\t\tradius : 0.9\n\t\t});\n\t\t\n\t\tthis.sphereCloud = new Cloud(gl, {\n\t\t\tnumLatitudes : 30,\n\t\t\tnumLongitudes : 30,\n\t\t\tradius : 0.905\n\t\t});\n\t\t\n }", "function initProgram() {\n const vertexShader = getShader('vertex-shader');\n const fragmentShader = getShader('fragment-shader');\n\n // Create a program\n program = gl.createProgram();\n // Attach the shaders to this program\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n gl.linkProgram(program);\n\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n console.error('Could not initialize shaders');\n }\n\n // Use this program instance\n gl.useProgram(program);\n // We attach the location of these shader values to the program instance\n // for easy access later in the code\n program.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');\n program.aBary = gl.getAttribLocation(program, 'bary');\n program.uModelT = gl.getUniformLocation (program, 'modelT');\n program.uViewT = gl.getUniformLocation (program, 'viewT');\n program.uProjT = gl.getUniformLocation (program, 'projT');\n }", "function initShaders(data) {\r\n var gl = data.context;\r\n\r\n data.pShader = gl.createProgram();\r\n\r\n data.vShader = gl.createShader(gl.VERTEX_SHADER);\r\n gl.shaderSource(data.vShader, getVertexShader());\r\n gl.compileShader(data.vShader);\r\n gl.attachShader(data.pShader, data.vShader);\r\n\r\n data.fShader = gl.createShader(gl.FRAGMENT_SHADER);\r\n gl.shaderSource(data.fShader, getFragmentShader());\r\n gl.compileShader(data.fShader);\r\n gl.attachShader(data.pShader, data.fShader);\r\n\r\n gl.linkProgram(data.pShader);\r\n\r\n gl.useProgram(data.pShader);\r\n }" ]
[ "0.6544732", "0.6399144", "0.6263623", "0.62421227", "0.6204842", "0.6131438", "0.6087413", "0.60684246", "0.6066637", "0.6058251", "0.59889334", "0.5921972", "0.5906805", "0.5886842", "0.58757406", "0.5850916", "0.5822142", "0.58117604", "0.5801057", "0.579585", "0.57882357", "0.5770475", "0.57620865", "0.5723209", "0.57216203", "0.5718698", "0.56903255", "0.5686071", "0.5685185", "0.5657192", "0.56564933", "0.56517005", "0.5650718", "0.5643851", "0.5636878", "0.56288195", "0.56283945", "0.5581982", "0.55608636", "0.55571836", "0.55446154", "0.55411625", "0.55346227", "0.552929", "0.5492488", "0.5465778", "0.54535395", "0.5451191", "0.5435992", "0.5431381", "0.54298085", "0.54275554", "0.54011464", "0.53927684", "0.53731716", "0.5368632", "0.5367259", "0.5365007", "0.53619576", "0.5361832", "0.5361832", "0.536018", "0.5357006", "0.53558594", "0.5352718", "0.5352718", "0.5352718", "0.5352718", "0.5352718", "0.5352718", "0.5352718", "0.5352718", "0.53421813", "0.5336972", "0.5336427", "0.5334307", "0.5333546", "0.5332404", "0.5325718", "0.5313146", "0.5308402", "0.5307418", "0.53072846", "0.53027743", "0.5302715", "0.52910876", "0.5287753", "0.5283585", "0.52702063", "0.52700555", "0.52682745", "0.52644414", "0.5261921", "0.5258572", "0.525693", "0.52481234", "0.5243697", "0.5243407", "0.5233674", "0.5231209", "0.52303296" ]
0.0
-1
Define how to synchronize our JavaScript's variables to the GPU's:
update_GPU(g_state, model_transform, material, gpu = this.g_addrs, gl = this.gl) { const proj_camera = g_state.projection_transform.times(g_state.camera_transform); // Send our matrices to the shader programs: gl.uniformMatrix4fv(gpu.model_transform_loc, false, Mat.flatten_2D_to_1D(model_transform.transposed())); gl.uniformMatrix4fv(gpu.projection_camera_transform_loc, false, Mat.flatten_2D_to_1D(proj_camera.transposed())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update_GPU( context, gpu_addresses, graphics_state, model_transform, material ) // Define how to synchronize our JavaScript's variables to the GPU's:\n { const [ P, C, M ] = [ graphics_state.projection_transform, graphics_state.camera_inverse, model_transform ],\n PCM = P.times( C ).times( M );\n context.uniformMatrix4fv( gpu_addresses.projection_camera_model_transform, false, Mat.flatten_2D_to_1D( PCM.transposed() ) );\n }", "function GPUComputeVar(variableName, computeFragmentShader, sizeX, sizeY, initialValueTexture, options) {\n // set size, value type (int/float), etc\n // attach callbacks with constructor?\n\n}", "sync() {\n\t\tthis._user_defined_southbound_volumes = this._direction_array[0];\n\t\tthis._user_defined_westbound_volumes = this._direction_array[1];\n\t\tthis._user_defined_northbound_volumes = this._direction_array[2];\n\t\tthis._user_defined_eastbound_volumes = this._direction_array[3];\n\t}", "sync() {\n\t\tthis._southbound_PCEs = this._PCE_array[0];\n\t\tthis._westbound_PCEs = this._PCE_array[1]; \n\t\tthis._northbound_PCEs = this._PCE_array[2];\n\t\tthis._eastbound_PCEs = this._PCE_array[3];\n\t}", "function sync() {\n \n}", "gpu() {\n\n }", "syncUniform(uniform) {\n let location = uniform._location;\n let value = uniform.value;\n let gl = this._gl;\n\n // depending on the uniform type, WebGL has different ways of synchronizing values\n // the values can either be a Float32Array or JS Array object\n switch (uniform.type) {\n case \"b\":\n case \"bool\": {\n gl.uniform1i(location, value ? 1 : 0);\n break;\n }\n case \"i\":\n case \"1i\": {\n gl.uniform1i(location, value);\n break;\n }\n case \"2i\": {\n gl.uniform2i(location, value[0], value[1]);\n break;\n }\n case \"3i\": {\n gl.uniform3i(location, value[0], value[1], value[2]);\n break;\n }\n case \"4i\": {\n gl.uniform4i(location, value[0], value[1], value[2], value[3]);\n break;\n }\n case \"f\":\n case \"1f\": {\n gl.uniform1f(location, value);\n break;\n }\n case \"2f\": {\n gl.uniform2f(location, value[0], value[1]);\n break;\n }\n case \"3f\": {\n gl.uniform3f(location, value[0], value[1], value[2]);\n break;\n }\n case \"4f\": {\n gl.uniform4f(location, value[0], value[1], value[2], value[3]);\n break;\n }\n case \"m2\":\n case \"mat2\": {\n // TODO: implement matrix2 transpose\n gl.uniformMatrix2fv(location, uniform.transpose, value);\n break;\n }\n case \"m3\":\n case \"mat3\": {\n // TODO: implement matrix3 transpose\n gl.uniformMatrix3fv(location, uniform.transpose, value);\n break;\n }\n case \"m4\":\n case \"mat4\": {\n // TODO: implement matrix4 transpose\n gl.uniformMatrix4fv(location, uniform.transpose, value);\n break;\n }\n case \"tex\": {\n if (!Utils.isTexture2D(uniform.value) || !uniform.value.isReady()) {\n this._logger.warn(\"Could not assign texture uniform because the texture isn't ready.\");\n break;\n }\n\n gl.activeTexture(gl[\"TEXTURE\" + this._textureCount]);\n\n let texture = uniform.value.getImageData()._glTextures[gl.id];\n\n // the texture was already sampled?\n if (!isObjectAssigned(texture)) {\n // TODO: do stuff here? :D\n }\n\n break;\n }\n default: {\n this._logger.warn(\"Unknown uniform type: \" + uniform.type);\n break;\n }\n }\n }", "function Sync() {\n\n}", "syncUniforms() {\n this._textureCount = 1;\n\n for (let key in this.uniforms) {\n this.syncUniform(this.uniforms[key]);\n }\n }", "function syncData() {}", "function __main__()\n{\n\tloop_ctr++;\n\tconsole.log('Update() ...'+loop_ctr);\n\t// Get Data from Analog Ports\n\tb.analogRead('P9_39', function(x){if(x.err == undefined) {D[0][0]= b2c.RND(x.value,3); D[0][1]='';\t} else { D[0][1]=x.err; }});\n\tb.analogRead('P9_40', function(x){if(x.err == undefined) {D[1][0]= b2c.RND(x.value,3); D[1][1]='';\t} else { D[1][1]=x.err; }});\n\tb.analogRead('P9_37', function(x){if(x.err == undefined) {D[2][0]= b2c.RND(x.value,3); D[2][1]='';\t} else { D[2][1]=x.err; }}); \n\tb.analogRead('P9_38', function(x){if(x.err == undefined) {D[3][0]= b2c.RND(x.value,3); D[3][1]='';\t} else { D[3][1]=x.err; }}); \n\tb.analogRead('P9_33', function(x){if(x.err == undefined) {D[4][0]= b2c.RND(x.value,3); D[4][1]='';\t} else { D[4][1]=x.err; }});\n\tb.analogRead('P9_36', function(x){if(x.err == undefined) {D[5][0]= b2c.RND(x.value,3); D[5][1]='';\t} else { D[5][1]=x.err; }});\n\tb.analogRead('P9_35', function(x){if(x.err == undefined) {D[6][0]= b2c.RND(x.value,3); D[6][1]='';\t} else { D[6][1]=x.err; }});\n\tconsole.log('D = '+D);\n\t\n\t// update the channels\n\tgat.SetChannel('an','analog0',D[0][0],b2c.RND((new Date()).valueOf()/1000,0),'');\n\tgat.SetChannel('an','analog1',D[1][0],b2c.RND((new Date()).valueOf()/1000,0),'');\n\tgat.SetChannel('an','analog2',D[2][0],b2c.RND((new Date()).valueOf()/1000,0),'');\n\tgat.SetChannel('an','analog3',D[3][0],b2c.RND((new Date()).valueOf()/1000,0),'');\n\tgat.SetChannel('an','analog4',D[4][0],b2c.RND((new Date()).valueOf()/1000,0),'');\n\tgat.SetChannel('an','analog5',D[5][0],b2c.RND((new Date()).valueOf()/1000,0),'');\n\tgat.SetChannel('an','analog6',D[6][0],b2c.RND((new Date()).valueOf()/1000,0),'');\n\t\n\t// push data to the cloud\n\tgat.publish()\n}", "syncUniforms() {\n this._textureCount = 1;\n\n for (let key in this.uniforms) {\n this.syncUniform(this.uniforms[key]);\n }\n }", "function Synchronized () {}", "function Synchronized () {}", "function Synchronized () {}", "update_GPU(context, gpu_addresses, program_state, model_transform, material) {\n // update_GPU(): Define how to synchronize our JavaScript's variables to the GPU's:\n const [P, C, M] = [\n program_state.projection_transform,\n program_state.camera_inverse,\n model_transform\n ],\n PCM = P.times(C).times(M);\n context.uniformMatrix4fv(\n gpu_addresses.projection_camera_model_transform,\n false,\n Mat.flatten_2D_to_1D(PCM.transposed())\n );\n context.uniform1f(\n gpu_addresses.animation_time,\n program_state.animation_time / 1000\n );\n }", "function SYNC() {}", "function SYNC() {}", "function SYNC() {}", "function SYNC() {}", "function setTensors() {\n const shape = [params.m, params.n];\n // Microscopic density\n state.n0 = fragment(num.ones(shape));\n state.nN = fragment(num.ones(shape));\n state.nS = fragment(num.ones(shape));\n state.nE = fragment(num.ones(shape));\n state.nW = fragment(num.ones(shape));\n state.nNE = fragment(num.ones(shape));\n state.nSE = fragment(num.ones(shape));\n state.nNW = fragment(num.ones(shape));\n state.nSW = fragment(num.ones(shape));\n // Macroscopic properties\n state.rho = fragment(num.ones(shape));\n state.ux = fragment(num.zeros(shape));\n state.uy = fragment(num.ones(shape).mult(params.u0));\n // Barriers\n barriers = fragment(num.zeros(shape));\n}", "function loadWebGL()\n{\n/*------------------------------------------------------------------------\n * defining the environments initial values \n *------------------------------------------------------------------------\n */\n env.running = false ;\n env.dt = 0.03 ;\n env.diffCoef = 0.001 ;\n env.C_m = 1. ;\n env.lx = 20 ;\n env.skip = 10 ;\n env.time = 0. ;\n\n \n env.allFloats = ['dt','diffCoef', 'lx' ] ; // uniform shared floats\n env.allInts = [] ; // uniform shared integers\n env.allTxtrs = [] ; // uniform shared textures\n \n // solver parameteres ................................................\n //env.width = 256 ;\n //env.height = 256 ;\n\n // display prameters .................................................\n env.colormap = 'rainbowHotSpring' ;\n env.dispWidth = 512 ;\n env.dispHeight = 512 ;\n\n env.canvas_1 = document.getElementById(\"canvas_1\") ;\n env.canvas_2 = document.getElementById(\"canvas_2\") ;\n env.canvas_1.width = env.dispWidth ;\n env.canvas_1.height = env.dispHeight ;\n\n/*------------------------------------------------------------------------\n * load the structure and process it\n *------------------------------------------------------------------------\n */\n env.mx = 16 ;\n env.my = 8 ;\n\n env.allInts = [...env.allInts, 'mx','my' ] ;\n\n env.structure = document.getElementById('structure') ;\n \n console.log('Compressing structure...') ;\n\n env.sparsePhase = new Abubu.SparseDataFromImage(env.structure, \n { channel : 'r', threshold : 0.01 } ) ;\n console.log('Done!') ;\n console.log('Compression ratio :', \n env.sparsePhase.getCompressionRatio() ) ;\n\n env.fphaseTxt = env.sparsePhase.full ;\n env.cphaseTxt = env.sparsePhase.sparse ;\n env.compMap = env.sparsePhase.compressionMap ;\n env.dcmpMap = env.sparsePhase.decompressionMap ;\n\n env.fullTexelIndex = env.sparsePhase.fullTexelIndex ;\n env.compressedTexelIndex = env.sparsePhase.compressedTexelIndex ;\n\n env.width = env.cphaseTxt.width ;\n env.height = env.cphaseTxt.height ;\n env.fwidth = env.fphaseTxt.width ; /* full-width */\n env.fheight = env.fphaseTxt.height ; /* full-height */\n\n/*-------------------------------------------------------------------------\n * coordinate texture (full) \n *-------------------------------------------------------------------------\n */\n env.full3dCrdt = new Abubu.Float32Texture(\n env.fwidth,\n env.fheight\n ) ;\n \n env.fullCoordinator = new Abubu.Solver({\n fragmentShader: source('fullCoordinator') ,\n uniforms : { \n mx : { type : 'f' , value : env.mx } ,\n my : { type : 'f' , value : env.my } ,\n } ,\n targets : { \n crdt : { location : 0, target : env.full3dCrdt } ,\n }\n } ) ;\n env.fullCoordinator.render() ;\n\n/*------------------------------------------------------------------------\n * compressedCoordinate\n *------------------------------------------------------------------------\n */\n env.compressed3dCrdt = new Abubu.Float32Texture( \n env.width, env.height ) ;\n\n env.compressedCoordinator = new Abubu.Solver({\n fragmentShader: source('compressedCoordinator') ,\n uniforms : { \n fullTexelIndex : { type : 't', value : env.fullTexelIndex } ,\n full3dCrdt : { type : 't', value : env.full3dCrdt } ,\n } ,\n targets : { \n compressed3dCrdt : { \n location : 0, target : env.compressed3dCrdt \n } ,\n }\n } ) ;\n\n env.compressedCoordinator.render() ;\n\n env.allTxtrs = [...env.allTxtrs, 'compressed3dCrdt' ] ; \n/*------------------------------------------------------------------------\n * zero-flux directionator \n *------------------------------------------------------------------------\n */\n env.dir0 = new Abubu.Uint32Texture( env.width, env.height ) ;\n env.dir1 = new Abubu.Uint32Texture( env.width, env.height ) ;\n\n env.idir0 = env.dir0 ;\n env.idir1 = env.dir1 ;\n\n env.directionator = new Abubu.Solver({\n fragmentShader : source('directionator') ,\n uniforms : {\n mx : { type : 'i' , value : env.mx } ,\n my : { type : 'i' , value : env.my } ,\n fullTexelIndex : { \n type : 't', value : env.fullTexelIndex \n } ,\n compressedTexelIndex : { \n type : 't', value : env.compressedTexelIndex\n } ,\n },\n targets: {\n odir0 : { location : 0, target : env.dir0 } ,\n odir1 : { location : 1, target : env.dir1 } ,\n }\n } ) ;\n env.directionator.render() ; \n\n env.allTxtrs = [...env.allTxtrs, 'idir0', 'idir1' ] ;\n\n/*------------------------------------------------------------------------\n * state variables for the psuedo-random generator\n *------------------------------------------------------------------------\n */\n // states for the random generator ...................................\n env.istate = new Uint32Array(env.width*env.height*4) ;\n env.imat = new Uint32Array(env.width*env.height*4) ;\n\n // preparing the initial states for each pixel .......................\n var p=0 ;\n var seed = 0 ;\n var tm = new Abubu.TinyMT({vmat: 0}) ;\n\n for(var j=0 ; j<env.height ; j++){\n for(var i=0 ; i<env.width ; i++){\n // mat1 mat2 seed \n tm.mat[0] = i ; tm.mat[1] = j ; tm.mat[3] = seed ;\n tm.init() ;\n\n for(var k=0 ; k<4 ; k++){\n env.istate[p] = tm.state[k] ; \n env.imat[p] = tm.mat[k] ; \n p++ ;\n }\n }\n }\n\n // first time-step random textures ...................................\n env.ftinymtState = new Abubu.Uint32Texture( env.width, env.height ,\n {data : env.istate ,pair : true } ) ;\n env.stinymtState = new Abubu.Uint32Texture( env.width, env.height ,\n {data : env.istate ,pair : true } ) ;\n \n // mat state for each point of the generator .........................\n env.tinymtMat = new Abubu.Uint32Texture( env.width, env.height ,\n {data : env.imat } ) ;\n\n // initialize random states back to the original values...............\n env.initStates = function(){\n env.ftinymtState.data = env.istate ;\n env.stinymtState.data = env.istate ;\n }\n/*------------------------------------------------------------------------\n * textures for time-stepping\n *------------------------------------------------------------------------\n */\n env.fcolors = [] ;\n env.scolors = [] ;\n\n for(var i=0; i<10; i++){\n env['fcolor'+i] = new Abubu.Float32Texture( \n env.width, env.height, { pairable : true } ) ;\n env['scolor'+i] = new Abubu.Float32Texture( \n env.width, env.height, { pairable : true } ) ;\n env.fcolors.push(env['fcolor'+i]) ;\n env.scolors.push(env['scolor'+i]) ;\n }\n env.fcolors = [ ...env.fcolors, env.ftinymtState ] ;\n env.scolors = [ ...env.scolors, env.stinymtState ] ;\n \n env.colors = [ ...env.fcolors, ...env.scolors ] ;\n\n/*------------------------------------------------------------------------\n * init solvers\n *------------------------------------------------------------------------\n */\n // init1 .............................................................\n class InitTargets1{\n constructor( colors ){\n for(let i=0; i<6 ; i++){\n this[\"ocolor\"+i] = {location : i, target: colors[i]} ;\n }\n }\n }\n env.finit1 = new Abubu.Solver({\n fragmentShader : source('init1') ,\n targets : new InitTargets1( env.fcolors ) ,\n } ) ;\n\n env.sinit1 = new Abubu.Solver({\n fragmentShader : source('init1') ,\n targets : new InitTargets1( env.scolors ) ,\n } ) ;\n\n\n // init2 .............................................................\n class InitTargets2{\n constructor( colors ){\n for ( let i = 0 ; i< 4 ; i++){\n let j=6+i ;\n this[\"ocolor\"+j] = { location : i, target : colors[j] } ;\n }\n }\n }\n\n env.finit2 = new Abubu.Solver({\n fragmentShader : source('init2') ,\n targets : new InitTargets2( env.fcolors ) ,\n } ) ;\n\n env.sinit2 = new Abubu.Solver({\n fragmentShader : source('init2') ,\n targets : new InitTargets2( env.scolors ) ,\n } ) ;\n\n\n/*------------------------------------------------------------------------\n * Common CompUniforms\n *------------------------------------------------------------------------\n */\n class CompUniforms{\n constructor( obj, floats, ints, txtrs){\n for(let i in floats ){\n let name = floats[i] ;\n this[name] = { type :'f', value : obj[name] } ;\n }\n for(let i in ints){\n let name = ints[i] ;\n this[name] = { type : 'i', value : obj[name] } ;\n }\n for(let i in txtrs){\n let name = txtrs[i] ;\n this[name] = { type : 't', value : obj[name] } ;\n }\n }\n }\n\n \n // comp1 .............................................................\n class Comp1Uniforms extends CompUniforms{\n constructor( _fc, _sc ){\n super(env, env.allFloats, env.allInts, env.allTxtrs ) ;\n for(let i =0 ; i <10 ; i++){\n this['icolor'+i] = { type: 't', value : _fc[i] } ;\n }\n this.in_tinymtState = { type : 't', value : _fc[_fc.length-1] } ;\n this.in_tinymtMat = { type : 't', value : env.tinymtMat };\n }\n }\n\n class Comp1Targets{\n constructor( _fc,_sc ){\n for(let i=0; i<6 ; i++){\n let j = i ;\n this['ocolor'+i] = {location : i, target : _sc[j] } ;\n }\n this.out_tinymtState\n = { location : 6 , target : _sc[_sc.length-1] } ;\n }\n }\n\n env.fcomp1 = new Abubu.Solver({\n fragmentShader : source('comp1') ,\n uniforms : new Comp1Uniforms(env.fcolors, env.scolors ) ,\n targets : new Comp1Targets( env.fcolors, env.scolors ) ,\n } ) ;\n\n env.scomp1 = new Abubu.Solver({\n fragmentShader : source('comp1') ,\n uniforms : new Comp1Uniforms(env.scolors, env.fcolors ) ,\n targets : new Comp1Targets( env.scolors, env.fcolors ) ,\n } ) ;\n\n // comp2 .............................................................\n class Comp2Uniforms extends CompUniforms{\n constructor( _fc, _sc ){\n super(env, env.allFloats, env.allInts, env.allTxtrs ) ;\n for(let i = 0 ; i < 6 ; i++){\n this['icolor'+i] = { type: 't', value : _sc[i] } ;\n }\n for(let i = 6 ; i < 10 ; i++){\n this['icolor'+i] = { type: 't', value : _fc[i] } ;\n }\n }\n }\n\n class Comp2Targets{\n constructor( _fc,_sc ){\n for(let i=0; i<4 ; i++){\n let j = i + 6 ;\n this['ocolor'+i] = {location : i, target : _sc[j] } ;\n }\n }\n }\n\n env.fcomp2 = new Abubu.Solver({\n fragmentShader : source('comp2') ,\n uniforms : new Comp2Uniforms(env.fcolors, env.scolors ) ,\n targets : new Comp2Targets( env.fcolors, env.scolors ) ,\n } ) ;\n\n env.scomp2 = new Abubu.Solver({\n fragmentShader : source('comp2') ,\n uniforms : new Comp2Uniforms(env.scolors, env.fcolors ) ,\n targets : new Comp2Targets( env.scolors, env.fcolors ) ,\n } ) ;\n\n/*------------------------------------------------------------------------\n * editors\n *------------------------------------------------------------------------\n */\n // comp1Editor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n env.comp1Editor = ace.edit(\"comp1Editor\") ;\n env.comp1Editor.setValue(source('comp1'));\n env.comp1Editor.clearSelection() ; \n env.comp1Editor.setTheme(\"ace/theme/tomorrow\");\n env.comp1Editor.getSession().setMode('ace/mode/glsl') ;\n env.comp1Editor.on( 'change', function(){\n var source = env.comp1Editor.getValue() ;\n if (source.length>12){\n env.fcomp1.fragmentShader = env.comp1Editor.getValue() ;\n env.scomp1.fragmentShader = env.comp1Editor.getValue() ;\n }\n } ) ;\n\n // Save comp1\n env.saveComp1 = new Abubu.TextWriter({filename: 'comp1.frag'}) ;\n env.saveComp1.onclick = function(){\n env.saveComp1.text = env.comp1Editor.getValue() ;\n }\n\n // Load comp1\n env.loadComp1 = new Abubu.TextReader() ;\n env.loadComp1.onload = function(){\n var result = env.loadComp1.result ;\n console.log(result) ;\n env.comp1Editor.setValue(result) ;\n env.comp1Editor.clearSelection() ;\n } ;\n\n // comp2Editor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n env.comp2Editor = ace.edit(\"comp2Editor\") ;\n env.comp2Editor.setValue(source('comp2'));\n env.comp2Editor.clearSelection() ; \n env.comp2Editor.setTheme(\"ace/theme/tomorrow\");\n env.comp2Editor.getSession().setMode('ace/mode/glsl') ;\n env.comp2Editor.on( 'change', function(){\n var source = env.comp2Editor.getValue() ;\n if (source.length>12){\n env.fcomp2.fragmentShader = env.comp2Editor.getValue() ;\n env.scomp2.fragmentShader = env.comp2Editor.getValue() ;\n }\n } ) ;\n\n // Save comp2\n env.saveComp2 = new Abubu.TextWriter({filename: 'comp2.frag'}) ;\n env.saveComp2.onclick = function(){\n env.saveComp2.text = env.comp2Editor.getValue() ;\n }\n\n // Load comp2\n env.loadComp2 = new Abubu.TextReader() ;\n env.loadComp2.onload = function(){\n var result = env.loadComp2.result ;\n console.log(result) ;\n env.comp2Editor.setValue(result) ;\n env.comp2Editor.clearSelection() ;\n } ;\n\n // init1Editor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n env.init1Editor = ace.edit(\"init1Editor\") ;\n env.init1Editor.setValue(source('init1'));\n env.init1Editor.clearSelection() ; \n env.init1Editor.setTheme(\"ace/theme/tomorrow\");\n env.init1Editor.getSession().setMode('ace/mode/glsl') ;\n env.init1Editor.on( 'change', function(){\n var source = env.init1Editor.getValue() ;\n if (source.length>12){\n env.finit1.fragmentShader = env.init1Editor.getValue() ;\n env.sinit1.fragmentShader = env.init1Editor.getValue() ;\n }\n } ) ;\n\n // Save init1\n env.saveInit1 = new Abubu.TextWriter({filename: 'init1.frag'}) ;\n env.saveInit1.onclick = function(){\n env.saveInit1.text = env.init1Editor.getValue() ;\n }\n\n // Load init1\n env.loadInit1 = new Abubu.TextReader() ;\n env.loadInit1.onload = function(){\n var result = env.loadInit1.result ;\n console.log(result) ;\n env.init1Editor.setValue(result) ;\n env.init1Editor.clearSelection() ;\n } ;\n\n // init2Editor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n env.init2Editor = ace.edit(\"init2Editor\") ;\n env.init2Editor.setValue(source('init2'));\n env.init2Editor.clearSelection() ; \n env.init2Editor.setTheme(\"ace/theme/tomorrow\");\n env.init2Editor.getSession().setMode('ace/mode/glsl') ;\n env.init2Editor.on( 'change', function(){\n var source = env.init2Editor.getValue() ;\n if (source.length>12){\n env.finit2.fragmentShader = env.init2Editor.getValue() ;\n env.sinit2.fragmentShader = env.init2Editor.getValue() ;\n }\n } ) ;\n\n // Save init2\n env.saveInit2 = new Abubu.TextWriter({filename: 'init2.frag'}) ;\n env.saveInit2.onclick = function(){\n env.saveInit2.text = env.init2Editor.getValue() ;\n }\n\n // Load init2\n env.loadInit2 = new Abubu.TextReader() ;\n env.loadInit2.onload = function(){\n var result = env.loadInit2.result ;\n console.log(result) ;\n env.init2Editor.setValue(result) ;\n env.init2Editor.clearSelection() ;\n } ;\n\n\n $(\".editor\").css('fontSize','10pt') ;\n\n env.toggleInitEditors = function(){\n $('#initEditors').fadeToggle() ;\n }\n\n env.toggleCompEditors = function(){\n $('#compEditors').fadeToggle() ;\n }\n\n/*------------------------------------------------------------------------\n * VRC\n *------------------------------------------------------------------------\n */\n // volume ray caster .................................................\n env.alphaCorrection = 0.61 ;\n env.structural_alpha = .04 ;\n env.noSteps = 150 ;\n env.lightShift = 1.2 ;\n\n env.vrc = new Abubu.VolumeRayCaster({\n target : env.fcolor0 ,//fphaseTxt,\n phaseField : env.fphaseTxt,\n compressionMap : env.compMap,\n canvas : canvas_1,\n channel : 'r' ,\n noSteps : env.noSteps,\n mx : env.mx,\n my : env.my ,\n pointLights : [// 3,3,3,\n // -3,-3,-3,\n 10,10,10,\n -10,-10,10,\n ],\n lightShift : env.lightShift , \n floodLights : [],\n threshold : 0. ,\n minValue : 0 ,\n maxValue : 3. ,\n alphaCorrection : env.alphaCorrection ,\n structural_alpha : env.structural_alpha ,\n colorbar : true ,\n unit : ''\n } ) ;\n\n env.colorplot = env.vrc ;\n env.colorplot.status = env.colorplot.addMessage('Paused!',0.5,0.1 , \n { \n font : \"14pt Times\" ,\n style: '#000000', \n align: \"left\"\n }\n ) ;\n env.colorplot.addMessage('Time = ',0.05,0.10 , \n { \n font : \"14pt Times\" ,\n style: \"#000000\", \n align: \"left\"\n }\n ) ;\n\n env.colorplot.time = env.colorplot.addMessage( '0.00 [ms]', 0.40,0.10 , \n { \n font : \"14pt Times\" ,\n style: \"#000000\", \n align: \"right\"\n }\n ) ;\n env.colorplot.stamp =env.colorplot.addMessage( 'Simulation by Abouzar Kaboudian @ CHAOS Lab ', 0.05,0.05 , \n { \n font : \"Italic 14pt Times\" ,\n style: \"#000000\", \n align: \"left\"\n }\n ) ;\n \n env.colorplot.initForeground() ;\n\n/*------------------------------------------------------------------------\n * normals\n *------------------------------------------------------------------------\n */ \n env.normals = new Abubu.Float32Texture( env.width, env.height);\n env.normalizer = new Abubu.Solver({\n fragmentShader : source( 'normals' ) ,\n uniforms : {\n mx : { type : 'i' , value : env.mx } ,\n my : { type : 'i' , value : env.my } ,\n fullTexelIndex : { \n type : 't', value : env.fullTexelIndex \n } ,\n compressedTexelIndex : { \n type : 't', value : env.compressedTexelIndex\n } ,\n } ,\n targets : { \n normals : { location : 0 , target : env.normals } ,\n }\n } ) ;\n env.normalizer.render() ;\n env.loaded = true ;\n \n/*------------------------------------------------------------------------\n * lighting information \n *------------------------------------------------------------------------\n */\n env.shininess = 10 ;\n env.clearColor = [0.9, 0.9, 0.9];\n env.lightColor = [1., 1.,1., 1.];\n env.lightAmbientTerm = 0.05 ;\n env.lightSpecularTerm = 0 ;\n env.lightDirection = [-0.19, 0.11, -.44];\n\n env.materialColor = [46/255. , 99/255. , 191/255., 1.];\n env.materialAmbientTerm = 1.9 ;\n env.materialSpecularTerm= .8 ;\n\n/*------------------------------------------------------------------------\n * new display \n *------------------------------------------------------------------------\n */\n env.voxelSize = 1.56 ;\n env.rotateX = 2.6 ; \n env.rotateY = 2.3 ;\n env.rotateZ = 1.8 ;\n\n env.modelMatrix = mat4.create() ;\n env.projectionMatrix= mat4.create() ; \n env.viewMatrix = mat4.create() ;\n env.normalMatrix = mat4.create() ;\n\n env.fov = 0.44 ;\n env.start = 0.01 ;\n env.end = 100 ;\n\n mat4.identity(env.projectionMatrix ) ;\n mat4.perspective(env.projectionMatrix, env.fov,1, env.start,env.end ) ;\n\n mat4.identity(env.modelMatrix) ;\n mat4.rotate( env.modelMatrix,env.modelMatrix, env.rotateX, [1,0,0] ) ;\n mat4.rotate( env.modelMatrix,env.modelMatrix, env.rotateY, [0,1,0] ) ;\n mat4.rotate( env.modelMatrix,env.modelMatrix, env.rotateZ, [0,0,1] ) ;\n\n\n mat4.identity(env.viewMatrix ) ;\n mat4.lookAt( env.viewMatrix , [0,0,-5],[0.,0.,0] ,[0,1,0]) ;\n\n mat4.multiply(env.normalMatrix, env.viewMatrix, env.modelMatrix ) ;\n mat4.invert( env.normalMatrix, env.normalMatrix ) ;\n mat4.transpose( env.normalMatrix, env.normalMatrix ) ;\n\n \n\n mat4.identity(env.viewMatrix ) ;\n mat4.lookAt( env.viewMatrix , [0,0,-5],[0.,0.,0] ,[0,1,0]) ;\n\n // controler .........................................................\n let controler = new Abubu.OrbitalCameraControl( env.viewMatrix , \n 5. , canvas_1 ) ;\n\n env.cvis = new Abubu.Solver({\n fragmentShader: source('cfrag' ) ,\n vertexShader : source('cvertex' ) ,\n uniforms : { \n noVoxels : { type : 'i', value : 36 } ,\n clrm : { type : 't', value : env.vrc.clrm.texture } ,\n compressed3dCrdt : { type : 't', value : env.compressed3dCrdt } ,\n normals : { type : 't', value : env.normals } ,\n icolor : { type : 't', value : env.fcolor0 } ,\n projectionMatrix : { type : 'mat4', \n value : env.projectionMatrix } ,\n modelMatrix : { type : 'mat4', \n value : env.modelMatrix } ,\n viewMatrix : { type : 'mat4', value : env.viewMatrix } ,\n normalMatrix : { type : 'mat4', value : env.normalMatrix} ,\n\n // light information .........................................\n shininess : { type : 'f', value : env.shininess } ,\n lightColor: { type : 'v4', value : env.lightColor} ,\n lightAmbientTerm : { type : 'f', value : env.lightAmbientTerm } ,\n lightSpecularTerm: { type : 'f', value : env.lightSpecularTerm} ,\n lightDirection : { type : 'v3', value : env.lightDirection } ,\n materialAmbientTerm : { type : 'f', value : env.materialAmbientTerm} , \n materialSpecularTerm: { type : 'f', value : env.materialSpecularTerm} ,\n voxelSize : { type : 'f' , value : env.voxelSize } ,\n } ,\n geometry : {},\n draw : new Abubu.DrawArraysInstanced( 'triangles', 0, 36, env.noVoxels) ,\n depthTest : true , /* this is important to properly \n test depth of voxels to ensure the correct\n ones are displayed on screen */\n canvas : canvas_1 , \n } ) ;\n \n \n env.setView= function(){\n Abubu.mat4.perspective(env.projectionMatrix, env.fov,1, env.start,env.end ) ;\n mat4.identity(env.modelMatrix) ;\n mat4.rotate( env.modelMatrix,env.modelMatrix, env.rotateX, [1,0,0] ) ;\n mat4.rotate( env.modelMatrix,env.modelMatrix, env.rotateY, [0,1,0] ) ;\n mat4.rotate( env.modelMatrix,env.modelMatrix, env.rotateZ, [0,0,1] ) ;\n\n \n mat4.multiply(env.normalMatrix, env.viewMatrix, env.modelMatrix ) ;\n mat4.invert( env.normalMatrix, env.normalMatrix ) ;\n mat4.transpose( env.normalMatrix, env.normalMatrix ) ;\n\n env.cvis.uniforms.modelMatrix.value = env.modelMatrix ;\n env.cvis.uniforms.projectionMatrix.value = env.projectionMatrix ;\n env.cvis.uniforms.normalMatrix.value = env.normalMatrix ;\n env.cvis.render() ;\n }\n \n env.setView() ;\n\n Object.defineProperty( env.cvis, 'noVoxels' ,{\n get : () => { return env.cvis.uniforms.noVoxels.value ; } ,\n set : (nv) =>{\n env.cvis.uniforms.noVoxels.value = nv ;\n env.cvis.draw.instanceCount = nv ;\n env.cvis.render() ;\n }\n } ) ;\n\n \n env.cvis.noVoxels = env.width*env.height ;\n env.cvis.render() ;\n\n/*------------------------------------------------------------------------\n * display \n *------------------------------------------------------------------------\n */\n\n // signal plot .......................................................\n env.signalplot = new Abubu.SignalPlot({\n noPltPoints : 1024,\n grid : 'on',\n nx : 5,\n ny : 6, \n xticks : { mode: 'auto', unit : 'ms', font : '11pt Times'} ,\n yticks : { mode: 'auto', unit : 'mv', font : '11pt Times'} ,\n canvas : env.canvas_2 \n } ) ;\n\n env.voltageSignal = env.signalplot.addSignal( env.fcolor6 ,{\n channel : 'r', \n minValue : -100 ,\n maxValue : 50 ,\n color :[0.5,0.,0.] ,\n restValue : -90 ,\n visible : true ,\n linewidth : 3,\n timeWindow: 1000 ,\n probePosition : [0.5,0.5] ,\n }) ;\n\n env.display = function(){\n controler.update() ;\n\n mat4.multiply( env.normalMatrix, \n env.viewMatrix, env.modelMatrix ) ;\n mat4.invert( env.normalMatrix, \n env.normalMatrix ) ;\n mat4.transpose( env.normalMatrix, \n env.normalMatrix ) ;\n\n env.cvis.uniforms.viewMatrix.value = env.viewMatrix ;\n env.cvis.uniforms.normalMatrix.value = env.normalMatrix ;\n\n\n //env.colorplot.time.text = env.time.toFixed(2) + ' [ms]' ;\n //env.colorplot.initForeground() ;\n //env.colorplot.render() ;\n env.cvis.render() ;\n env.cvis.render() ;\n env.signalplot.render() ;\n }\n\n\n // solve or pause simulations ........................................\n env.solveOrPause = function(){\n env.running = !env.running ;\n if (env.running){\n env.colorplot.status.text = 'Running...' ;\n }else{\n env.colorplot.status.text = 'Paused!' ;\n }\n } \n\n // initialize the solution using the solvers .........................\n env.init = function(){\n env.time = 0 ;\n env.signalplot.init(env.time) ;\n env.finit1.render() ;\n env.sinit1.render() ;\n env.finit2.render() ;\n env.sinit2.render() ;\n return ;\n }\n env.init() ;\n\n/*------------------------------------------------------------------------\n * createGui\n *------------------------------------------------------------------------\n */\n createGui() ;\n\n/*------------------------------------------------------------------------\n * rendering the program ;\n *------------------------------------------------------------------------\n */\n env.render = function(){\n if (env.running){\n for(var i=0; i<env.skip; i++){\n env.fcomp1.render() ;\n env.fcomp2.render() ;\n env.scomp1.render() ;\n env.scomp2.render() ;\n env.time += env.dt*2. ;\n env.signalplot.update(env.time) ;\n }\n }\n env.display() ;\n requestAnimationFrame(env.render) ;\n }\n\n/*------------------------------------------------------------------------\n * add environment to document\n *------------------------------------------------------------------------\n */\n document.env = env ;\n\n/*------------------------------------------------------------------------\n * render the webgl program\n *------------------------------------------------------------------------\n */\n env.render();\n\n}", "sync() {\n this._left = this._movement_array[0];\n this._through = this._movement_array[1];\n this._right = this._movement_array[2];\n }", "syncArray() {\n\t\tthis._direction_array[0] = this._user_defined_southbound_volumes;\n\t\tthis._direction_array[1] = this._user_defined_westbound_volumes;\n\t\tthis._direction_array[2] = this._user_defined_northbound_volumes;\n\t\tthis._direction_array[3] = this._user_defined_eastbound_volumes;\n\t}", "syncArray() {\n\t\tthis._PCE_array[0] = this._southbound_PCEs;\n\t\tthis._PCE_array[1] = this._westbound_PCEs; \n\t\tthis._PCE_array[2] = this._northbound_PCEs;\n\t\tthis._PCE_array[3] = this._eastbound_PCEs;\n\t}", "syncUniform(uniform) {\n let location = uniform._location;\n let value = uniform.value;\n let gl = this._gl;\n\n // depending on the uniform type, WebGL has different ways of synchronizing values\n // the values can either be a Float32Array or JS Array object\n switch (uniform.type) {\n case 'b':\n case 'bool':\n gl.uniform1i(location, value ? 1 : 0);\n break;\n case 'i':\n case '1i':\n gl.uniform1i(location, value);\n break;\n case '2i':\n gl.uniform2i(location, value[0], value[1]);\n break;\n case '3i':\n gl.uniform3i(location, value[0], value[1], value[2]);\n break;\n case '4i':\n gl.uniform4i(location, value[0], value[1], value[2], value[3]);\n break;\n case 'f':\n case '1f':\n gl.uniform1f(location, value);\n break;\n case '2f':\n gl.uniform2f(location, value[0], value[1]);\n break;\n case '3f':\n gl.uniform3f(location, value[0], value[1], value[2]);\n break;\n case '4f':\n gl.uniform4f(location, value[0], value[1], value[2], value[3]);\n break;\n case 'm2':\n case 'mat2':\n // TODO: implement matrix2 transpose\n gl.uniformMatrix2fv(location, uniform.transpose, value);\n break;\n case 'm3':\n case 'mat3':\n // TODO: implement matrix3 transpose\n gl.uniformMatrix3fv(location, uniform.transpose, value);\n break;\n case 'm4':\n case 'mat4':\n // TODO: implement matrix4 transpose\n gl.uniformMatrix4fv(location, uniform.transpose, value);\n break;\n case 'tex':\n if (!isTexture2D(uniform.value) || !uniform.value.isReady()) {\n debug.warn(\"Could not assign texture uniform because the texture isn't ready.\");\n break;\n }\n\n gl.activeTexture(gl[\"TEXTURE\" + this._textureCount]);\n\n let texture = uniform.value.getImageData()._glTextures[gl.id];\n\n // the texture was already sampled?\n if (!isObjectAssigned(texture)) {\n // TODO: do stuff here? :D\n }\n\n break;\n default:\n debug.warn(\"Unknown uniform type: \" + uniform.type);\n break;\n }\n }", "function lw() {\r\n var src1 = getRegisterVal(\"registerOne\");\r\n var src2 = getRegisterVal(\"registerTwo\");\r\n var offset = parseInt($(\"#immediate\").val());\r\n src2 = memory[src1 + offset];\r\n setRegisterVal(\"registerTwo\", src2);\r\n\r\n}", "function initMemVars()\n{\n params = [];\n varTable = {}; //delete and renew var table\n listElements = 0;\n currentFuncName = \"\";\n paramNumber = 0;\n numberMem = 1000;\n stringMem = 5000;\n boolMem = 8000;\n tmpNumMem = 10000;\n tmpBoolMem = 20000;\n}", "update_GPU(\n context,\n gpu_addresses,\n graphics_state,\n model_transform,\n material\n ) {\n // update_GPU(): Define how to synchronize our JavaScript's variables to the GPU's:\n const [P, C, M] = [\n graphics_state.projection_transform,\n graphics_state.camera_inverse,\n model_transform\n ],\n PCM = P.times(C).times(M);\n context.uniformMatrix4fv(\n gpu_addresses.projection_camera_model_transform,\n false,\n Mat.flatten_2D_to_1D(PCM.transposed())\n );\n }", "function updateVelocity(){\r\n\t// ---- ADVECT -------------------------------------------------------------------------------------\r\n\tadvectBuffer.material.uniforms.texInput.value = u.texA;\r\n\tadvectBuffer.material.uniforms.velocity.value = u.texA;\r\n\tadvectBuffer.material.uniforms.dissipation.value = 1.0;\r\n\trenderer.render(advectBuffer.scene, camera, u.texB, true);\t\r\n\tu.swap();\r\n\r\n\tadvectBuffer.material.uniforms.time += 1;\t\r\n\tadvectBuffer.material.uniforms.res.value.x = w();\r\n\tadvectBuffer.material.uniforms.res.value.y = h();\r\n\r\n\t// ---- DIFFUSE -------------------------------------------------------------------------------------\r\n\t// jacobiBuffer.material.uniforms.alpha.value = alpha1();\r\n\t// jacobiBuffer.material.uniforms.rBeta.value = beta1();\r\n\t// for (var i = 0; i < DIFFUSE_ITER_MAX; i++) {\r\n\t// \tjacobiBuffer.material.uniforms.texInput.value = u.texA;\r\n\t// \tjacobiBuffer.material.uniforms.b.value = u.texA;\r\n\t// \trenderer.render(jacobiBuffer.scene, camera, u.texB, true);\t\r\n\t// \tu.swap();\r\n\t// }\t\r\n\r\n\t// jacobiBuffer.material.uniforms.res.value.x = w();\r\n\t// jacobiBuffer.material.uniforms.res.value.y = h();\r\n\t\r\n\t// ---- APPLY FORCES -------------------------------------------------------------------------------------\r\n\tforceBuffer.material.uniforms.texInput.value = u.texA;\r\n\trenderer.render(forceBuffer.scene, camera, u.texB, true);\r\n\tu.swap();\r\n\r\n\t// ---- PROJECT -------------------------------------------------------------------------------------\r\n\t// * ---- COMPUTE PRESSURE \t\r\n\t// * - CALC. div(u)\r\n\tdivBuffer.uniforms.texInput.value = u.texA;\r\n\trenderer.render(divBuffer.scene, camera, div_u.texA, true);\r\n\r\n\t// * - SOLVE POISSONS FOR P\r\n\tjacobiBuffer.material.uniforms.alpha.value = alpha2();\r\n\tjacobiBuffer.material.uniforms.rBeta.value = 1.0/4.0;\r\n\tfor (var i = 0; i < PRESSURE_ITER_MAX; i++) {\r\n\t\tjacobiBuffer.material.uniforms.texInput.value = p.texA;\r\n\t\tjacobiBuffer.material.uniforms.b.value = div_u.texA;\r\n\t\trenderer.render(jacobiBuffer.scene, camera, p.texB, true);\t\r\n\t\tp.swap();\r\n\t}\t\r\n\t\r\n\t// * ---- SUBTRACT grad(p)\r\n\tgradBuffer.uniforms.texInput.value = u.texA;\r\n\tgradBuffer.uniforms.pressure.value = p.texA;\r\n\trenderer.render(gradBuffer.scene, camera, u.texB, true);\r\n\tu.swap();\r\n}", "function ms() {\n other_memory = current_input;\n console.log(other_memory);\n}", "function setup() { //this function executes once at the beginning.\n \n initial = createVector(0,0);\n \n frameRate(50);\n \n var canv = createCanvas(window.innerWidth*.95, window.innerHeight*.9);\n canv.parent(\"myCanvas\"); //<----delete this line to run on web editor\n \n massSlider = createSlider(.5,6,.5,.1);\n massSlider.parent(\"mySlider\"); //<----delete this one too\n \n universe = new Array(); //Array where the planets(entity objects) are gonna be stored\n}", "async run() {\n if (!this.executionInfos)\n throw new Error('ExecutionInfos is not loaded');\n if (!this.inputViews || !this.outputViews)\n throw new Error('getInputViews and getOutputViews must be called prior to run');\n if (!this.staticBuffer)\n throw new Error('StaticBuffer is not initialized');\n if (!this.dynamicBuffer)\n throw new Error('DynamicBuffer is not initialized');\n if (!this.metaBuffers)\n throw new Error('MetaBuffer is not initialized');\n if (!this.placeholderContext)\n throw new Error('PlaceholderContext is not initialized');\n if (!this.placeholderContext.isResolved)\n throw new Error(`Not all placeholders are resolved: ${this.placeholderContext}`);\n let staticBuffer = this.staticBuffer;\n let dynamicBuffer = this.dynamicBuffer;\n let metaBuffers = this.metaBuffers;\n if (webdnn_1.getConfiguration('DEBUG', false)) {\n let records = [];\n let totalElapsedTime = 0;\n for (let i = 0; i < this.executionInfos.length; i++) {\n let exec_info = this.executionInfos[i];\n let start = performance.now();\n await this.webgpuHandler.executeSinglePipelineState('descriptor.' + exec_info.entry_func_name, exec_info.threadgroups_per_grid, exec_info.threads_per_thread_group, [staticBuffer, dynamicBuffer, metaBuffers[i]], true);\n let elapsedTime = performance.now() - start;\n records.push({\n 'Kernel': exec_info.entry_func_name,\n 'Elapsed time [ms]': elapsedTime\n });\n totalElapsedTime += elapsedTime;\n }\n let summary = Array.from(Object.values(records.reduce((summary, record) => {\n if (!(record['Kernel'] in summary)) {\n summary[record['Kernel']] = {\n 'Kernel': record['Kernel'],\n 'Count': 0,\n 'Elapsed time [ms]': 0,\n };\n }\n summary[record['Kernel']]['Count']++;\n summary[record['Kernel']]['Elapsed time [ms]'] += record['Elapsed time [ms]'];\n return summary;\n }, {})));\n summary.forEach(record => record['Ratio [%]'] = (record['Elapsed time [ms]'] / totalElapsedTime).toFixed(2));\n console.table(records);\n console.table(summary);\n }\n else {\n let complete_promise = null;\n for (let i = 0; i < this.executionInfos.length; i++) {\n let exec_info = this.executionInfos[i];\n let is_last = i == this.executionInfos.length - 1;\n complete_promise = this.webgpuHandler.executeSinglePipelineState('descriptor.' + exec_info.entry_func_name, exec_info.threadgroups_per_grid, exec_info.threads_per_thread_group, [staticBuffer, dynamicBuffer, metaBuffers[i]], is_last);\n }\n return complete_promise; //wait to finish final kernel\n }\n // this._running = false;\n }", "cacheGLUniformLocations() {\nvar ssuLoc, ssuaLoc;\n//----------------------\nssuLoc = (unm) => {\nreturn this.skinningShader.getUniformLocation(unm);\n};\nssuaLoc = function(uanm) {\nreturn ssuLoc(`${uanm}[0]`);\n};\nthis.uniformMVMat = ssuLoc(\"ModelViewMat\");\nthis.uniformMVPMat = ssuLoc(\"ModelViewProjMat\");\nif (this.DO_TRX_BONE_UNIFORMS) {\nif (!this.TEST_CPU_TRX_TO_MAT) {\nif (this.USE_TEXTURES) {\nthis.uniformSkelXformsWidth = ssuLoc(\"SkelXformsWidth\");\nthis.uniformSkelXformsHeight = ssuLoc(\"SkelXformsHeight\");\nthis.uniformSkelXforms = ssuLoc(\"SkelXforms\");\nif (this.DO_ARM_TWISTS) {\nthis.uniformBoneTwistWidth = ssuLoc(\"BoneTwistWidth\");\nthis.uniformBoneTwistHeight = ssuLoc(\"BoneTwistHeight\");\nthis.uniformBoneTwistData = ssuLoc(\"BoneTwistData\");\n}\n} else {\nthis.uniformSkelXforms = ssuaLoc(\"SkelXforms\");\nif (this.DO_ARM_TWISTS) {\nthis.uniformBoneTwistData = ssuaLoc(\"BoneTwistData\");\n}\n}\n} else {\nthis.uniformBones = ssuaLoc(\"Bones\");\n}\n} else {\nthis.uniformBones = ssuaLoc(\"Bones\");\n}\nthis.uniformMorphWeights = ssuLoc(\"MorphWeights\");\nreturn this.uniformTexture = ssuLoc(\"Texture\");\n}", "function sw() {\r\n var src1 = getRegisterVal(\"registerOne\");\r\n var src2 = getRegisterVal(\"registerTwo\");\r\n var offset = parseInt($(\"#immediate\").val());\r\n var loc = src1 + offset;\r\n memory[loc] = src2;\r\n $(\"#m\" + loc).html(src2);\r\n}", "function post_sync()\n\t{\n\t\tvar data = os_ctx.getImageData(0, 0, BUFFER_X, BUFFER_Y).data;\n\t\t\n\t\tfor (var i = 0; i <BUFFER_X * BUFFER_Y * 4; i++)\n\t\t\tfb_data8[i] = data[i];\n\t}", "async syncData() {\n const promises = [];\n const keys = [];\n const indices = [];\n for (const key in this.history) {\n const valueArray = this.history[key];\n for (let i = 0; i < valueArray.length; ++i) {\n if (typeof valueArray[i] !== 'number') {\n const valueScalar = valueArray[i];\n promises.push(valueScalar.data());\n keys.push(key);\n indices.push(i);\n }\n }\n }\n const values = await Promise.all(promises);\n for (let n = 0; n < values.length; ++n) {\n const tensorToDispose = this.history[keys[n]][indices[n]];\n tensorToDispose.dispose();\n this.history[keys[n]][indices[n]] = values[n][0];\n }\n }", "function Initialize1(data) {\n // Make sure all variables in this thread are initialized only once.\n self.littleEndian = data.littleEndian;\n self.compressed = data.compressed;\n self.memoryBudget = data.memoryBudget;\n self.attributesData = data.attributesData;\n self.sceneData = data.sceneData;\n self.version = data.version;\n }", "function main() {\n\n initGui();\n\n window.uniformsInput = {\n time: { type: 'f', value: 0 }\n };\n\n var fboSize = 512;\n window.FBOC = new FBOCompositor(RENDERER, fboSize, SHADERS.passVert);\n FBOC.addPass('noisePass', SHADERS.noiseFrag, null);\n FBOC.getPass('noisePass').attachUniform(uniformsInput);\n\n window.grid = createVoxelGrid();\n SCENE.add(grid);\n\n CAMERA.position.set(-354.9, 241.9, 374.6);\n CAMERA.rotation.set(-0.573, -0.672, -0.382);\n\n // window.grid2 = createVoxelGrid();\n // grid2.rotateZ( Math.PI * 0.5 );\n // grid2.position.set( 256, 256, 0 );\n // SCENE.add( grid2 );\n //\n // window.grid3 = createVoxelGrid();\n // grid3.rotateX( Math.PI * 0.5 );\n // grid3.position.set( 0, 256, -256 );\n // SCENE.add( grid3 );\n\n window.hud = new HUD(RENDERER);\n}", "function storeUniformsLocation() {\n shaderUniforms[\"nEdgesCompatibility\"] = gpgpuUility.getUniformLocation(programCompatibility, \"nEdges\");\n shaderUniforms[\"nPointsCompatibility\"] = gpgpuUility.getUniformLocation(programCompatibility, \"nPoints\");\n shaderUniforms[\"threshold\"] = gpgpuUility.getUniformLocation(programCompatibility, \"threshold\");\n shaderUniforms[\"edgesCompatibility\"] = gpgpuUility.getUniformLocation(programCompatibility, \"edges\");\n\n shaderUniforms[\"nEdgesSubdivision\"] = gpgpuUility.getUniformLocation(programSubdivision, \"nEdges\");\n shaderUniforms[\"nPointsSubdivision\"] = gpgpuUility.getUniformLocation(programSubdivision, \"nPoints\");\n shaderUniforms[\"PSubdivision\"] = gpgpuUility.getUniformLocation(programSubdivision, \"P\");\n shaderUniforms[\"oldP\"] = gpgpuUility.getUniformLocation(programSubdivision, \"oldP\");\n shaderUniforms[\"edgesSubdivision\"] = gpgpuUility.getUniformLocation(programSubdivision, \"edges\");\n\n shaderUniforms[\"nEdgesUpdate\"] = gpgpuUility.getUniformLocation(programUpdate, \"nEdges\");\n shaderUniforms[\"nPointsUpdate\"] = gpgpuUility.getUniformLocation(programUpdate, \"nPoints\");\n shaderUniforms[\"PUpdate\"] = gpgpuUility.getUniformLocation(programUpdate, \"P\");\n shaderUniforms[\"K\"] = gpgpuUility.getUniformLocation(programUpdate, \"K\");\n shaderUniforms[\"S\"] = gpgpuUility.getUniformLocation(programUpdate, \"S\");\n shaderUniforms[\"edgesUpdate\"] = gpgpuUility.getUniformLocation(programUpdate, \"edges\");\n shaderUniforms[\"compatibility\"] = gpgpuUility.getUniformLocation(programUpdate, \"compatibility\");\n }", "updateAllVarCache() {\n const { delta: { varLastCalcIndex }, updateVariable } = this;\n updateVariable(varLastCalcIndex);\n }", "function main() {\n\t// Canvas vars\n\tcanvas = document.getElementById('canvas');\n\tctx = canvas.getContext('2d');\n\tcanvas.width = window.innerWidth - 20;\n\tcanvas.height = window.innerHeight - 30;\n\tcenter_w = canvas.width/2 - 5;\n\tcenter_h = canvas.height/2;\n\n\tcreateUI(ctx);\n\tlink2server();\n\tGAME_STATE = new GameState();\n\tRETICLE = new Reticle();\n\t//console.log(GAME_STATE.KM2PIX);\n\tsetInterval(mainLoop, REFRESH_RATE);\n\n\t/* TRIAL CODE \n\tvar v = new vec2d(1,2);\n\tvar v2 = new vec2d(2,3);\n\tconsole.log(v);\n\tconsole.log(v2);\n\tconsole.log(v.mult(2));\n\t//v2_ = v2.unit();\n\t//console.log(v2);\n\t//v2.addNum(1)\n\t//console.log(v2);\n\t//console.log(v2_);\n\t*/\n}", "function computeValues(){\n //Removes loading\n open();\n checkReady()\n\n}", "function update(a){a.vglUpdate&&a.vglUpdate()}", "function cpsSync(number1, number2, callback) {\n callback(number1 + number2);\n}", "function defineVars(){\n isFirstMove = true;\n isFinished = false;\n currColor = \"#ff0000\";\n initHex = 0xFF0000;\n numberMovement = n + 1;\n round = 0;\n side = 0;\n repCounter = 0;\n defineMatrix();\n}", "registerEnvGlobalPackedFuncs() {\n // Register the timer function to enable the time_evaluator.\n const perf = compact.getPeformance();\n // Helper function to time the finvoke\n const timeExecution = (finvoke, ctx, nstep, repeat, minRepeatMs) => __awaiter(this, void 0, void 0, function* () {\n finvoke(this.scalar(1, \"int32\"));\n yield ctx.sync();\n const result = [];\n let setupNumber = nstep;\n for (let i = 0; i < repeat; ++i) {\n let durationMs = 0.0;\n do {\n if (durationMs > 0.0) {\n setupNumber = Math.floor(Math.max(minRepeatMs / (durationMs / nstep) + 1, nstep * 1.618));\n }\n const tstart = perf.now();\n finvoke(this.scalar(setupNumber, \"int32\"));\n yield ctx.sync();\n const tend = perf.now();\n durationMs = tend - tstart;\n } while (durationMs < minRepeatMs);\n const speed = durationMs / setupNumber / 1000;\n result.push(speed);\n }\n const ret = new Float64Array(result.length);\n ret.set(result);\n return new Uint8Array(ret.buffer);\n });\n const addOne = (x) => __awaiter(this, void 0, void 0, function* () {\n yield new Promise(resolve => setTimeout(resolve, 100));\n return x + 1;\n });\n this.registerAsyncServerFunc(\"wasm.TimeExecution\", timeExecution);\n this.registerAsyncServerFunc(\"testing.asyncAddOne\", addOne);\n }", "async function buscarComponenetes(gpuMax, gpuMin, cpuMax, cpuMin) {\n\n await gpuMax.get().then((result) => { setInfoGPUmax(result.data()) }\n );\n\n await gpuMin.get().then((result) => { setInfoGPUmin(result.data()) }\n );\n\n await cpuMax.get().then((result) => { setInfoCPUmax(result.data()) }\n );\n\n await cpuMin.get().then((result) => { setInfoCPUmin(result.data()) }\n );\n }", "sync(){\n Region.sync();\n }", "upload(){\n this._compile();\n\n let buffer = new Float32Array(this._bufferData);\n\n exports.gl.bindBuffer(exports.gl.ARRAY_BUFFER, this._vbo);\n exports.gl.bufferData(exports.gl.ARRAY_BUFFER, buffer, exports.gl.STATIC_DRAW);\n exports.gl.bindBuffer(exports.gl.ARRAY_BUFFER, null);\n \n this._bufferData = null;\n }", "function refreshLocVariables(){\n\ttargetPoint = false;\n\ttempTin=false;\n\ttin=false;\n\tnearest=false;\n\tnearest_turf=false;\n\tbuffered=false;\n\tptsWithin=false;\n\tmyPoint=false;\n\tcoords_x = []; //define an array to store the lng coordinate\n\tcoords_y = []; //define an array to store the lat coordinate\n\tcoords_z = []; //define an array to store elev coordinate\n\tkeyLocLocation = false;\n}", "function ms() {\n this.otherMemory = this.currentInput;\n console.log(this.otherMemory);\n}", "update () {}", "async onReady() {\n \n await this.setObjectAsync('UV', {\n type: 'state',\n common: {\n name: 'UV',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_Max', {\n type: 'state',\n common: {\n name: 'UV_Max',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_Bewertung', {\n type: 'state',\n common: {\n name: 'UV_Bewertung',\n type: 'string',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time1', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time1',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time2', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time2',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time3', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time3',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time4', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time4',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time5', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time5',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n await this.setObjectAsync('UV_safe_exposure_time6', {\n type: 'state',\n common: {\n name: 'UV_safe_exposure_time6',\n type: 'number',\n role: 'info',\n read: true,\n write: true,\n },\n native: {},\n });\n\n \n this.subscribeStates('*');\n\n await this.setStateAsync('UV', { val: 0, ack: true });\n await this.setStateAsync('UV_Max', { val: 0, ack: true });\n\n\n if (!this.config.apikey || !this.config.lat || !this.config.lng) {\n this.log.info(\"Bitte füllen Sie alle Einstellungen aus.\"); \n } else {\n this.main();\n if (!this.config.interval || this.config.interval < 30){\n setInterval(() => this.main(), 1800000);\n } else {\n var interv = this.config.interval;\n interv = interv * 60000;\n setInterval(() => this.main(), interv); \n }\n }\n }", "function scryptCore() {\n var XY = [], V = [];\n\n if (typeof B === 'undefined') {\n onmessage = function(event) {\n var data = event.data;\n var N = data[0], r = data[1], p = data[2], B = data[3], i = data[4];\n\n var Bslice = [];\n arraycopy32(B, i * 128 * r, Bslice, 0, 128 * r);\n smix(Bslice, 0, r, N, V, XY);\n\n postMessage([i, Bslice]);\n };\n } else {\n for(var i = 0; i < p; i++) {\n smix(B, i * 128 * r, r, N, V, XY);\n }\n }\n\n function smix(B, Bi, r, N, V, XY) {\n var Xi = 0;\n var Yi = 128 * r;\n var i;\n\n arraycopy32(B, Bi, XY, Xi, Yi);\n\n for (i = 0; i < N; i++) {\n arraycopy32(XY, Xi, V, i * Yi, Yi);\n blockmix_salsa8(XY, Xi, Yi, r);\n }\n\n for (i = 0; i < N; i++) {\n var j = integerify(XY, Xi, r) & (N - 1);\n blockxor(V, j * Yi, XY, Xi, Yi);\n blockmix_salsa8(XY, Xi, Yi, r);\n }\n\n arraycopy32(XY, Xi, B, Bi, Yi);\n }\n\n function blockmix_salsa8(BY, Bi, Yi, r) {\n var X = [];\n var i;\n\n arraycopy32(BY, Bi + (2 * r - 1) * 64, X, 0, 64);\n\n for (i = 0; i < 2 * r; i++) {\n blockxor(BY, i * 64, X, 0, 64);\n salsa20_8(X);\n arraycopy32(X, 0, BY, Yi + (i * 64), 64);\n }\n\n for (i = 0; i < r; i++) {\n arraycopy32(BY, Yi + (i * 2) * 64, BY, Bi + (i * 64), 64);\n }\n\n for (i = 0; i < r; i++) {\n arraycopy32(BY, Yi + (i * 2 + 1) * 64, BY, Bi + (i + r) * 64, 64);\n }\n }\n\n function R(a, b) {\n return (a << b) | (a >>> (32 - b));\n }\n\n function salsa20_8(B) {\n var B32 = new Array(32);\n var x = new Array(32);\n var i;\n\n for (i = 0; i < 16; i++) {\n B32[i] = (B[i * 4 + 0] & 0xff) << 0;\n B32[i] |= (B[i * 4 + 1] & 0xff) << 8;\n B32[i] |= (B[i * 4 + 2] & 0xff) << 16;\n B32[i] |= (B[i * 4 + 3] & 0xff) << 24;\n }\n\n arraycopy(B32, 0, x, 0, 16);\n\n for (i = 8; i > 0; i -= 2) {\n x[ 4] ^= R(x[ 0]+x[12], 7); x[ 8] ^= R(x[ 4]+x[ 0], 9);\n x[12] ^= R(x[ 8]+x[ 4],13); x[ 0] ^= R(x[12]+x[ 8],18);\n x[ 9] ^= R(x[ 5]+x[ 1], 7); x[13] ^= R(x[ 9]+x[ 5], 9);\n x[ 1] ^= R(x[13]+x[ 9],13); x[ 5] ^= R(x[ 1]+x[13],18);\n x[14] ^= R(x[10]+x[ 6], 7); x[ 2] ^= R(x[14]+x[10], 9);\n x[ 6] ^= R(x[ 2]+x[14],13); x[10] ^= R(x[ 6]+x[ 2],18);\n x[ 3] ^= R(x[15]+x[11], 7); x[ 7] ^= R(x[ 3]+x[15], 9);\n x[11] ^= R(x[ 7]+x[ 3],13); x[15] ^= R(x[11]+x[ 7],18);\n x[ 1] ^= R(x[ 0]+x[ 3], 7); x[ 2] ^= R(x[ 1]+x[ 0], 9);\n x[ 3] ^= R(x[ 2]+x[ 1],13); x[ 0] ^= R(x[ 3]+x[ 2],18);\n x[ 6] ^= R(x[ 5]+x[ 4], 7); x[ 7] ^= R(x[ 6]+x[ 5], 9);\n x[ 4] ^= R(x[ 7]+x[ 6],13); x[ 5] ^= R(x[ 4]+x[ 7],18);\n x[11] ^= R(x[10]+x[ 9], 7); x[ 8] ^= R(x[11]+x[10], 9);\n x[ 9] ^= R(x[ 8]+x[11],13); x[10] ^= R(x[ 9]+x[ 8],18);\n x[12] ^= R(x[15]+x[14], 7); x[13] ^= R(x[12]+x[15], 9);\n x[14] ^= R(x[13]+x[12],13); x[15] ^= R(x[14]+x[13],18);\n }\n\n for (i = 0; i < 16; ++i) B32[i] = x[i] + B32[i];\n\n for (i = 0; i < 16; i++) {\n var bi = i * 4;\n B[bi + 0] = (B32[i] >> 0 & 0xff);\n B[bi + 1] = (B32[i] >> 8 & 0xff);\n B[bi + 2] = (B32[i] >> 16 & 0xff);\n B[bi + 3] = (B32[i] >> 24 & 0xff);\n }\n }\n\n function blockxor(S, Si, D, Di, len) {\n var i = len>>6;\n while (i--) {\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n D[Di++] ^= S[Si++]; D[Di++] ^= S[Si++];\n }\n }\n\n function integerify(B, bi, r) {\n var n;\n\n bi += (2 * r - 1) * 64;\n\n n = (B[bi + 0] & 0xff) << 0;\n n |= (B[bi + 1] & 0xff) << 8;\n n |= (B[bi + 2] & 0xff) << 16;\n n |= (B[bi + 3] & 0xff) << 24;\n\n return n;\n }\n\n function arraycopy(src, srcPos, dest, destPos, length) {\n while (length-- ){\n dest[destPos++] = src[srcPos++];\n }\n }\n\n function arraycopy32(src, srcPos, dest, destPos, length) {\n var i = length>>5;\n while(i--) {\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++]; dest[destPos++] = src[srcPos++];\n }\n }\n }", "toRawBytes() {\n if (this.context.deviceType != DeviceStrToEnum.cpu) {\n throw new Error(\"Can only synchronize copy for GPU array, use copyfrom instead.\");\n }\n const size = this.shape.reduce((a, b) => {\n return a * b;\n }, 1);\n const nbytes = this.dlDataType.numStorageBytes() * size;\n const stack = this.lib.getOrAllocCallStack();\n const tempOffset = stack.allocRawBytes(nbytes);\n const tempPtr = stack.ptrFromOffset(tempOffset);\n this.lib.checkCall(this.lib.exports.TVMArrayCopyToBytes(this.handle, tempPtr, nbytes));\n const ret = this.lib.memory.loadRawBytes(tempPtr, nbytes);\n this.lib.recycleCallStack(stack);\n return ret;\n }", "syncState() {\n }", "function setup() {\n\t// createCanvas(windowWidth, windowHeight);\n\t// background(0);\n\t/*\n\tvar r1 = 0;\n\tvar r2 = 0;\n\tvar r3 = 0;\n\tvar r4 = 0;\n\tfor(i = 0; i < 200; i++){\n\t\tt = String(1000+Math.floor(Math.random() * 4) + 1);\n\t\tswitch(t){\n\t\t\tcase(\"1001\"):\n\t\t\t\tr1++;\n\t\t\t\tbreak;\n\t\t\tcase(\"1002\"):\n\t\t\t\tr2++;\n\t\t\t\tbreak;\n\t\t\tcase(\"1003\"):\n\t\t\t\tr3++;\n\t\t\t\tbreak;\n\t\t\tcase(\"1004\"):\n\t\t\t\tr4++;\n\t\t\t\tbreak;\n\t\t}\n\n\t}\n\t\n\tconsole.log(\"r is \" + r1);\n\tconsole.log(\"r is \" + r2);\n\tconsole.log(\"r is \" + r3);\n\tconsole.log(\"r is \" + r4);\n\t*/\n\tdocument.getElementById(\"button\").disabled = false;\n\tstarted = false;\n\n\t//Connect attempts for continuing to query the wws server\n\tconnectAttempts = 0;\n\t//allows one to set banID by url, mostly unused\n\tvar newID = getQueryVariable(\"ban\")\n\tif(newID!=false){\n\t\tif(localDebug){\n\t\t\tconsole.log(\"new ban is \" + newID)\n\t\t}\n\t\tif(debugMode){\n\t\t\tsendMessage(sendban, uniqueName + \" new ban is \" + newID);\n\t\t}\n\t\tBAN_ID = newID;\n\t}\n\t//Get start time\n\tvar d = new Date();\n\tstartTime = d.getSeconds();\n\n\t//Sets samples loaded to 0\n\tloaded = 0;\n\t//Default value of 0\n\tcurSamp = \"0\";\n\t \n\n\troom = getUrlVars()[\"room\"];\n\t//Check whether a variable has been passed via reload function\n\tif(room>1000){\n\t\ttag_no = room;\n\t\t//login();\n\t}\n\n\tosc = new p5.Oscillator('sine');\n\n\t//REMOVE THIS for tag login\n\t//document.getElementById(\"attempted_login\").value = \"\";\n\n}", "function init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < __WEBPACK_IMPORTED_MODULE_9__constants_values__[\"a\" /* EPSLN */]) {\n return;\n }\n this.lat2 = this.lat2 || this.lat1;\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e = Math.sqrt(this.es);\n this.e0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_e0fn__[\"a\" /* default */])(this.es);\n this.e1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_e1fn__[\"a\" /* default */])(this.es);\n this.e2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_e2fn__[\"a\" /* default */])(this.es);\n this.e3 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_e3fn__[\"a\" /* default */])(this.es);\n\n this.sinphi = Math.sin(this.lat1);\n this.cosphi = Math.cos(this.lat1);\n\n this.ms1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_msfnz__[\"a\" /* default */])(this.e, this.sinphi, this.cosphi);\n this.ml1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, this.lat1);\n\n if (Math.abs(this.lat1 - this.lat2) < __WEBPACK_IMPORTED_MODULE_9__constants_values__[\"a\" /* EPSLN */]) {\n this.ns = this.sinphi;\n }\n else {\n this.sinphi = Math.sin(this.lat2);\n this.cosphi = Math.cos(this.lat2);\n this.ms2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_msfnz__[\"a\" /* default */])(this.e, this.sinphi, this.cosphi);\n this.ml2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, this.lat2);\n this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);\n }\n this.g = this.ml1 + this.ms1 / this.ns;\n this.ml0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, this.lat0);\n this.rh = this.a * (this.g - this.ml0);\n}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "update() {}", "function main() {\n new Thread(function() {\n while (1) {\n Thread.sleep(1);\n console.log('sharedGlobal = ' + sharedGlobal);\n }\n }).start();\n new Thread(function() {\n while (1) {\n Thread.sleep(1);\n sharedGlobal++;\n }\n }).start();\n}", "function createJs(sync) {\n var h0 = 0x67452301;\n var h1 = 0xEFCDAB89;\n var h2 = 0x98BADCFE;\n var h3 = 0x10325476;\n var h4 = 0xC3D2E1F0;\n // The first 64 bytes (16 words) is the data chunk\n var block, offset = 0, shift = 24;\n var totalLength = 0;\n if (sync) block = shared;\n else block = new Uint32Array(80);\n\n return { update: update, digest: digest };\n\n // The user gave us more data. Store it!\n function update(chunk) {\n if (typeof chunk === \"string\") return updateString(chunk);\n var length = chunk.length;\n totalLength += length * 8;\n for (var i = 0; i < length; i++) {\n write(chunk[i]);\n }\n }\n\n function updateString(string) {\n var length = string.length;\n totalLength += length * 8;\n for (var i = 0; i < length; i++) {\n write(string.charCodeAt(i));\n }\n }\n\n\n function write(byte) {\n block[offset] |= (byte & 0xff) << shift;\n if (shift) {\n shift -= 8;\n }\n else {\n offset++;\n shift = 24;\n }\n if (offset === 16) processBlock();\n }\n\n // No more data will come, pad the block, process and return the result.\n function digest() {\n // Pad\n write(0x80);\n if (offset > 14 || (offset === 14 && shift < 24)) {\n processBlock();\n }\n offset = 14;\n shift = 24;\n\n // 64-bit length big-endian\n write(0x00); // numbers this big aren't accurate in javascript anyway\n write(0x00); // ..So just hard-code to zero.\n write(totalLength > 0xffffffffff ? totalLength / 0x10000000000 : 0x00);\n write(totalLength > 0xffffffff ? totalLength / 0x100000000 : 0x00);\n for (var s = 24; s >= 0; s -= 8) {\n write(totalLength >> s);\n }\n\n // At this point one last processBlock() should trigger and we can pull out the result.\n return toHex(h0) +\n toHex(h1) +\n toHex(h2) +\n toHex(h3) +\n toHex(h4);\n }\n\n // We have a full block to process. Let's do it!\n function processBlock() {\n // Extend the sixteen 32-bit words into eighty 32-bit words:\n for (var i = 16; i < 80; i++) {\n var w = block[i - 3] ^ block[i - 8] ^ block[i - 14] ^ block[i - 16];\n block[i] = (w << 1) | (w >>> 31);\n }\n\n // log(block);\n\n // Initialize hash value for this chunk:\n var a = h0;\n var b = h1;\n var c = h2;\n var d = h3;\n var e = h4;\n var f, k;\n\n // Main loop:\n for (i = 0; i < 80; i++) {\n if (i < 20) {\n f = d ^ (b & (c ^ d));\n k = 0x5A827999;\n }\n else if (i < 40) {\n f = b ^ c ^ d;\n k = 0x6ED9EBA1;\n }\n else if (i < 60) {\n f = (b & c) | (d & (b | c));\n k = 0x8F1BBCDC;\n }\n else {\n f = b ^ c ^ d;\n k = 0xCA62C1D6;\n }\n var temp = (a << 5 | a >>> 27) + f + e + k + (block[i]|0);\n e = d;\n d = c;\n c = (b << 30 | b >>> 2);\n b = a;\n a = temp;\n }\n\n // Add this chunk's hash to result so far:\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n\n // The block is now reusable.\n offset = 0;\n for (i = 0; i < 16; i++) {\n block[i] = 0;\n }\n }\n\n function toHex(word) {\n var hex = \"\";\n for (var i = 28; i >= 0; i -= 4) {\n hex += ((word >> i) & 0xf).toString(16);\n }\n return hex;\n }\n\n}", "function createJs(sync) {\n var h0 = 0x67452301;\n var h1 = 0xEFCDAB89;\n var h2 = 0x98BADCFE;\n var h3 = 0x10325476;\n var h4 = 0xC3D2E1F0;\n // The first 64 bytes (16 words) is the data chunk\n var block, offset = 0, shift = 24;\n var totalLength = 0;\n if (sync) block = shared;\n else block = new Uint32Array(80);\n\n return { update: update, digest: digest };\n\n // The user gave us more data. Store it!\n function update(chunk) {\n if (typeof chunk === \"string\") return updateString(chunk);\n var length = chunk.length;\n totalLength += length * 8;\n for (var i = 0; i < length; i++) {\n write(chunk[i]);\n }\n }\n\n function updateString(string) {\n var length = string.length;\n totalLength += length * 8;\n for (var i = 0; i < length; i++) {\n write(string.charCodeAt(i));\n }\n }\n\n\n function write(byte) {\n block[offset] |= (byte & 0xff) << shift;\n if (shift) {\n shift -= 8;\n }\n else {\n offset++;\n shift = 24;\n }\n if (offset === 16) processBlock();\n }\n\n // No more data will come, pad the block, process and return the result.\n function digest() {\n // Pad\n write(0x80);\n if (offset > 14 || (offset === 14 && shift < 24)) {\n processBlock();\n }\n offset = 14;\n shift = 24;\n\n // 64-bit length big-endian\n write(0x00); // numbers this big aren't accurate in javascript anyway\n write(0x00); // ..So just hard-code to zero.\n write(totalLength > 0xffffffffff ? totalLength / 0x10000000000 : 0x00);\n write(totalLength > 0xffffffff ? totalLength / 0x100000000 : 0x00);\n for (var s = 24; s >= 0; s -= 8) {\n write(totalLength >> s);\n }\n\n // At this point one last processBlock() should trigger and we can pull out the result.\n return toHex(h0) +\n toHex(h1) +\n toHex(h2) +\n toHex(h3) +\n toHex(h4);\n }\n\n // We have a full block to process. Let's do it!\n function processBlock() {\n // Extend the sixteen 32-bit words into eighty 32-bit words:\n for (var i = 16; i < 80; i++) {\n var w = block[i - 3] ^ block[i - 8] ^ block[i - 14] ^ block[i - 16];\n block[i] = (w << 1) | (w >>> 31);\n }\n\n // log(block);\n\n // Initialize hash value for this chunk:\n var a = h0;\n var b = h1;\n var c = h2;\n var d = h3;\n var e = h4;\n var f, k;\n\n // Main loop:\n for (i = 0; i < 80; i++) {\n if (i < 20) {\n f = d ^ (b & (c ^ d));\n k = 0x5A827999;\n }\n else if (i < 40) {\n f = b ^ c ^ d;\n k = 0x6ED9EBA1;\n }\n else if (i < 60) {\n f = (b & c) | (d & (b | c));\n k = 0x8F1BBCDC;\n }\n else {\n f = b ^ c ^ d;\n k = 0xCA62C1D6;\n }\n var temp = (a << 5 | a >>> 27) + f + e + k + (block[i]|0);\n e = d;\n d = c;\n c = (b << 30 | b >>> 2);\n b = a;\n a = temp;\n }\n\n // Add this chunk's hash to result so far:\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n\n // The block is now reusable.\n offset = 0;\n for (i = 0; i < 16; i++) {\n block[i] = 0;\n }\n }\n\n function toHex(word) {\n var hex = \"\";\n for (var i = 28; i >= 0; i -= 4) {\n hex += ((word >> i) & 0xf).toString(16);\n }\n return hex;\n }\n\n}", "function createJs(sync) {\n var h0 = 0x67452301;\n var h1 = 0xEFCDAB89;\n var h2 = 0x98BADCFE;\n var h3 = 0x10325476;\n var h4 = 0xC3D2E1F0;\n // The first 64 bytes (16 words) is the data chunk\n var block, offset = 0, shift = 24;\n var totalLength = 0;\n if (sync) block = shared;\n else block = new Uint32Array(80);\n\n return { update: update, digest: digest };\n\n // The user gave us more data. Store it!\n function update(chunk) {\n if (typeof chunk === \"string\") return updateString(chunk);\n var length = chunk.length;\n totalLength += length * 8;\n for (var i = 0; i < length; i++) {\n write(chunk[i]);\n }\n }\n\n function updateString(string) {\n var length = string.length;\n totalLength += length * 8;\n for (var i = 0; i < length; i++) {\n write(string.charCodeAt(i));\n }\n }\n\n\n function write(byte) {\n block[offset] |= (byte & 0xff) << shift;\n if (shift) {\n shift -= 8;\n }\n else {\n offset++;\n shift = 24;\n }\n if (offset === 16) processBlock();\n }\n\n // No more data will come, pad the block, process and return the result.\n function digest() {\n // Pad\n write(0x80);\n if (offset > 14 || (offset === 14 && shift < 24)) {\n processBlock();\n }\n offset = 14;\n shift = 24;\n\n // 64-bit length big-endian\n write(0x00); // numbers this big aren't accurate in javascript anyway\n write(0x00); // ..So just hard-code to zero.\n write(totalLength > 0xffffffffff ? totalLength / 0x10000000000 : 0x00);\n write(totalLength > 0xffffffff ? totalLength / 0x100000000 : 0x00);\n for (var s = 24; s >= 0; s -= 8) {\n write(totalLength >> s);\n }\n\n // At this point one last processBlock() should trigger and we can pull out the result.\n return toHex(h0) +\n toHex(h1) +\n toHex(h2) +\n toHex(h3) +\n toHex(h4);\n }\n\n // We have a full block to process. Let's do it!\n function processBlock() {\n // Extend the sixteen 32-bit words into eighty 32-bit words:\n for (var i = 16; i < 80; i++) {\n var w = block[i - 3] ^ block[i - 8] ^ block[i - 14] ^ block[i - 16];\n block[i] = (w << 1) | (w >>> 31);\n }\n\n // log(block);\n\n // Initialize hash value for this chunk:\n var a = h0;\n var b = h1;\n var c = h2;\n var d = h3;\n var e = h4;\n var f, k;\n\n // Main loop:\n for (i = 0; i < 80; i++) {\n if (i < 20) {\n f = d ^ (b & (c ^ d));\n k = 0x5A827999;\n }\n else if (i < 40) {\n f = b ^ c ^ d;\n k = 0x6ED9EBA1;\n }\n else if (i < 60) {\n f = (b & c) | (d & (b | c));\n k = 0x8F1BBCDC;\n }\n else {\n f = b ^ c ^ d;\n k = 0xCA62C1D6;\n }\n var temp = (a << 5 | a >>> 27) + f + e + k + (block[i]|0);\n e = d;\n d = c;\n c = (b << 30 | b >>> 2);\n b = a;\n a = temp;\n }\n\n // Add this chunk's hash to result so far:\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n\n // The block is now reusable.\n offset = 0;\n for (i = 0; i < 16; i++) {\n block[i] = 0;\n }\n }\n\n function toHex(word) {\n var hex = \"\";\n for (var i = 28; i >= 0; i -= 4) {\n hex += ((word >> i) & 0xf).toString(16);\n }\n return hex;\n }\n\n}", "update(x0, y0, height, horizon, theta){\n this.worker.postMessage({\n cmd: 'set_params',\n\n x0,\n y0,\n height,\n horizon,\n theta\n });\n }", "setN(n) {\n this.n = n;\n\n // initialization like in the constructor\n this.coord = new Float32Array(this.n * this.m * 2);\n this.old_coord = new Float32Array(this.n * this.m * 2);\n this.color = new Float32Array(3 * this.m * this.n);\n\n this.initializeCoords();\n\n this.stress = new Float32Array(this.m * this.n);\n this.initializeStress();\n\n this.edges_per_node = new Array(this.m * this.n);\n this.initializeEdgesPerNode();\n\n this.edge_index = new Uint16Array((this.m * (this.n - 1) + this.n * (this.m - 1)) * 2);\n this.initializeEdgeIndex();\n\n this.node_index = new Uint16Array(this.n * this.m);\n this.initializeNodeIndex();\n\n this.locked_nodes = new Array();\n this.initializeLockedNodes();\n\n this.gl.deleteBuffer(this.index_buffer);\n this.gl.deleteBuffer(this.data_buffer);\n this.index_buffer = this.gl.createBuffer();\n this.data_buffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.index_buffer);\n let size;\n if (this.show_nodes == false) {\n size = this.edge_index.BYTES_PER_ELEMENT * this.edge_index.length;\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, size, this.gl.STATIC_DRAW);\n this.gl.bufferSubData(this.gl.ELEMENT_ARRAY_BUFFER, 0, this.edge_index);\n }\n else {\n size = this.node_index.BYTES_PER_ELEMENT * this.node_index.length;\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, size, this.gl.STATIC_DRAW);\n this.gl.bufferSubData(this.gl.ELEMENT_ARRAY_BUFFER, 0, this.node_index);\n }\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.data_buffer);\n size = this.coord.BYTES_PER_ELEMENT * this.coord.length + this.color.BYTES_PER_ELEMENT * this.color.length;\n this.gl.bufferData(this.gl.ARRAY_BUFFER, size, this.gl.STATIC_DRAW);\n this.gl.vertexAttribPointer(this.a_Position, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.vertexAttribPointer(this.a_FragColor, 3, this.gl.FLOAT, false, 0, this.coord.BYTES_PER_ELEMENT * this.coord.length);\n }", "_variablesChanged() {}", "initWebGPU(device) {\n const webGPUContext = new webgpu_1.WebGPUContext(this.memory, device);\n this.registerFunc(\"wasm.WebGPUDeviceAPI\", (name) => {\n return webGPUContext.getDeviceAPI(name);\n });\n this.registerFunc(\"wasm.WebGPUCreateShader\", (info, data) => {\n return webGPUContext.createShader(info, data);\n });\n this.registerAsyncServerFunc(\"wasm.WebGPUWaitForTasks\", () => __awaiter(this, void 0, void 0, function* () {\n yield webGPUContext.sync();\n }));\n this.lib.webGPUContext = webGPUContext;\n }", "function image_data_acquire() {\r\n\r\n}", "update_GPU( g_state, model_transform, material, gpu = this.g_addrs, gl = this.gl )\r\n { // First, send the matrices to the GPU, additionally cache-ing some products of them we know we'll need:\r\n this.update_matrices( g_state, model_transform, gpu, gl );\r\n gl.uniform1f ( gpu.animation_time_loc, g_state.animation_time / 1000 );\r\n\r\n if( g_state.gouraud === undefined ) { g_state.gouraud = g_state.color_normals = false; } // Keep the flags seen by the shader \r\n gl.uniform1i( gpu.GOURAUD_loc, g_state.gouraud ); // program up-to-date and make sure \r\n gl.uniform1i( gpu.COLOR_NORMALS_loc, g_state.color_normals ); // they are declared.\r\n\r\n gl.uniform4fv( gpu.shapeColor_loc, material.color ); // Send the desired shape-wide material qualities \r\n gl.uniform1f ( gpu.ambient_loc, material.ambient ); // to the graphics card, where they will tweak the\r\n gl.uniform1f ( gpu.diffusivity_loc, material.diffusivity ); // Phong lighting formula.\r\n gl.uniform1f ( gpu.specularity_loc, material.specularity );\r\n gl.uniform1f ( gpu.smoothness_loc, material.smoothness );\r\n\r\n if( material.texture ) // NOTE: To signal not to draw a texture, omit the texture parameter from Materials.\r\n { gpu.shader_attributes[\"tex_coord\"].enabled = true;\r\n gl.uniform1f ( gpu.USE_TEXTURE_loc, 1 );\r\n gl.bindTexture( gl.TEXTURE_2D, material.texture.id );\r\n }\r\n else { gl.uniform1f ( gpu.USE_TEXTURE_loc, 0 ); gpu.shader_attributes[\"tex_coord\"].enabled = false; }\r\n\r\n if( !g_state.lights.length ) return;\r\n var lightPositions_flattened = [], lightColors_flattened = [], lightAttenuations_flattened = [];\r\n for( var i = 0; i < 4 * g_state.lights.length; i++ )\r\n { lightPositions_flattened .push( g_state.lights[ Math.floor(i/4) ].position[i%4] );\r\n lightColors_flattened .push( g_state.lights[ Math.floor(i/4) ].color[i%4] );\r\n lightAttenuations_flattened[ Math.floor(i/4) ] = g_state.lights[ Math.floor(i/4) ].attenuation;\r\n }\r\n gl.uniform4fv( gpu.lightPosition_loc, lightPositions_flattened );\r\n gl.uniform4fv( gpu.lightColor_loc, lightColors_flattened );\r\n gl.uniform1fv( gpu.attenuation_factor_loc, lightAttenuations_flattened );\r\n }", "syncState(syncState) {\n\n if (!syncState || false === this.synchable) return\n\n if (!this.dataset) return\n\n var chr1 = this.genome.getChromosome(syncState.chr1Name),\n chr2 = this.genome.getChromosome(syncState.chr2Name),\n zoom = this.dataset.getZoomIndexForBinSize(syncState.binSize, \"BP\"),\n x = syncState.binX,\n y = syncState.binY,\n pixelSize = syncState.pixelSize\n\n if (!(chr1 && chr2)) {\n return // Can't be synched.\n }\n\n if (zoom === undefined) {\n // Get the closest zoom available and adjust pixel size. TODO -- cache this somehow\n zoom = this.findMatchingZoomIndex(syncState.binSize, this.dataset.bpResolutions)\n\n // Compute equivalent in basepairs / pixel\n pixelSize = (syncState.pixelSize / syncState.binSize) * this.dataset.bpResolutions[zoom]\n\n // Translate bins so that origin is unchanged in basepairs\n x = (syncState.binX / syncState.pixelSize) * pixelSize\n y = (syncState.binY / syncState.pixelSize) * pixelSize\n\n if (pixelSize > MAX_PIXEL_SIZE) {\n console.log(\"Cannot synch map \" + this.dataset.name + \" (resolution \" + syncState.binSize + \" not available)\")\n return\n }\n }\n\n\n const zoomChanged = (this.state.zoom !== zoom)\n const chrChanged = (this.state.chr1 !== chr1.index || this.state.chr2 !== chr2.index)\n this.state.chr1 = chr1.index\n this.state.chr2 = chr2.index\n this.state.zoom = zoom\n this.state.x = x\n this.state.y = y\n this.state.pixelSize = pixelSize\n\n let event = HICEvent(\"LocusChange\", {\n state: this.state,\n resolutionChanged: zoomChanged,\n chrChanged: chrChanged\n }, false)\n\n this.update(event)\n //this.eventBus.post(event);\n\n }", "setM(m) {\n this.m = m;\n\n // initialization like in the constructor\n this.coord = new Float32Array(this.n * this.m * 2);\n this.old_coord = new Float32Array(this.n * this.m * 2);\n this.color = new Float32Array(3 * this.m * this.n);\n\n this.initializeCoords();\n\n this.stress = new Float32Array(this.m * this.n);\n this.initializeStress();\n\n this.edges_per_node = new Array(this.m * this.n);\n this.initializeEdgesPerNode();\n\n this.edge_index = new Uint16Array((this.m * (this.n - 1) + this.n * (this.m - 1)) * 2);\n this.initializeEdgeIndex();\n\n this.node_index = new Uint16Array(this.n * this.m);\n this.initializeNodeIndex();\n\n this.locked_nodes = new Array();\n this.initializeLockedNodes();\n\n this.gl.deleteBuffer(this.index_buffer);\n this.gl.deleteBuffer(this.data_buffer);\n this.index_buffer = this.gl.createBuffer();\n this.data_buffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.index_buffer);\n let size;\n if (this.show_nodes == false) {\n size = this.edge_index.BYTES_PER_ELEMENT * this.edge_index.length;\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, size, this.gl.STATIC_DRAW);\n this.gl.bufferSubData(this.gl.ELEMENT_ARRAY_BUFFER, 0, this.edge_index);\n }\n else {\n size = this.node_index.BYTES_PER_ELEMENT * this.node_index.length;\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, size, this.gl.STATIC_DRAW);\n this.gl.bufferSubData(this.gl.ELEMENT_ARRAY_BUFFER, 0, this.node_index);\n }\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.data_buffer);\n size = this.coord.BYTES_PER_ELEMENT * this.coord.length + this.color.BYTES_PER_ELEMENT * this.color.length;\n this.gl.bufferData(this.gl.ARRAY_BUFFER, size, this.gl.STATIC_DRAW);\n this.gl.vertexAttribPointer(this.a_Position, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.vertexAttribPointer(this.a_FragColor, 3, this.gl.FLOAT, false, 0, this.coord.BYTES_PER_ELEMENT * this.coord.length);\n }", "recomputeLocals() {\n sceneryLog && sceneryLog.InputListener && sceneryLog.InputListener( 'MultiListener recomputeLocals' );\n sceneryLog && sceneryLog.InputListener && sceneryLog.push();\n\n for ( let i = 0; i < this._presses.length; i++ ) {\n this._presses[ i ].recomputeLocalPoint();\n }\n\n sceneryLog && sceneryLog.InputListener && sceneryLog.pop();\n }", "function setup() {\n frameRate(100); //number of times the function is called in a sec\n createCanvas(800, 500);\n values = new Array(width);\n for(let i=0; i<values.length; i++){\n values[i] = random(height);\n }\n}", "compute() {\n\n}", "function UniformBuffer(engine,data,dynamic){this._engine=engine;this._noUBO=engine.webGLVersion===1;this._dynamic=dynamic;this._data=data||[];this._uniformLocations={};this._uniformSizes={};this._uniformLocationPointer=0;this._needSync=false;if(this._noUBO){this.updateMatrix3x3=this._updateMatrix3x3ForEffect;this.updateMatrix2x2=this._updateMatrix2x2ForEffect;this.updateFloat=this._updateFloatForEffect;this.updateFloat2=this._updateFloat2ForEffect;this.updateFloat3=this._updateFloat3ForEffect;this.updateFloat4=this._updateFloat4ForEffect;this.updateMatrix=this._updateMatrixForEffect;this.updateVector3=this._updateVector3ForEffect;this.updateVector4=this._updateVector4ForEffect;this.updateColor3=this._updateColor3ForEffect;this.updateColor4=this._updateColor4ForEffect;}else{this.updateMatrix3x3=this._updateMatrix3x3ForUniform;this.updateMatrix2x2=this._updateMatrix2x2ForUniform;this.updateFloat=this._updateFloatForUniform;this.updateFloat2=this._updateFloat2ForUniform;this.updateFloat3=this._updateFloat3ForUniform;this.updateFloat4=this._updateFloat4ForUniform;this.updateMatrix=this._updateMatrixForUniform;this.updateVector3=this._updateVector3ForUniform;this.updateVector4=this._updateVector4ForUniform;this.updateColor3=this._updateColor3ForUniform;this.updateColor4=this._updateColor4ForUniform;}}", "function SimulationEngine() {\n\t\t\n\t}", "function update() {}", "_registerMasterListeners () {\n this.server.setListener('reduce', data => {\n let ip = data.sourceIP\n let layerName = data.layerName\n this.reduceCollector[ip] = data.result\n console.log('receive result from the worker')\n console.log(data.result)\n })\n // perform reduce & update\n\n // this.server.setListener(\"result\", data => {\n // let range2Update = this.workerInitRange[id]\n // Tensor.updateTensor1D(\n // this.processingTensor1D,\n // CifarSettrings.INPUT_TENSOR,\n // range2Update[0],\n // range2Update[1],\n // data\n // )\n // this.processingTensor1D\n // })\n }", "function _____SHARED_functions_____(){}", "function caml_register_global (n, v) { caml_global_data[n + 1] = v; }", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "function PositionSensorVRDevice() {\n}", "#refreshValues() {\n if (this.gamepad !== null) {\n const { gamepad } = this;\n this.throttle.value = RCTransmitter.#round(gamepad.axes[this.throttle.index], 5);\n this.yaw.value = RCTransmitter.#round(gamepad.axes[this.yaw.index], 5);\n this.pitch.value = RCTransmitter.#round(gamepad.axes[this.pitch.index], 5);\n this.roll.value = RCTransmitter.#round(gamepad.axes[this.roll.index], 5);\n /* eslint no-param-reassign: [\"error\", { \"props\": false }] */\n this.auxiliaries.forEach((aux) => {\n let value = 0;\n const { index } = aux;\n if (index >= 0) {\n if (aux.isButton) {\n if (index < gamepad.buttons.length) {\n value = gamepad.buttons[index].value;\n }\n } else if (index < gamepad.axes.length) {\n value = gamepad.axes[index];\n }\n }\n aux.value = value;\n });\n } else {\n this.#resetValues();\n }\n\n this.#notify();\n // The data is refreshed by the browser before next repaint\n window.requestAnimationFrame(this.#refreshValues.bind(this));\n }", "get value() {\n // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`\n return new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer;\n }", "function intercambiar() {\n const aux = vaso1;\n vaso1 = vaso2;\n vaso2 = aux;\n}", "constructor() {\nthis.xyzw = new Float32Array(4);\nthis.xyzw[3] = 1;\n}", "function script() {\n\n\tvar R; // Renderer\n\tvar M; // Context\n\n\tvar camera;\n\tvar f = 1000;\n\n\tvar light;\n\n\tvar touch;\n\tvar pointer;\n\n\tvar plan;\n\tvar first_blob;\n\n\t this.setup = function() {\n\n\t\tM = this.getContext();\n\n\t\tR = new Mobilizing.Renderer3D();\n\t\tM.addComponent(R);\n\n\t\tcamera = new Mobilizing.Camera();\n\t\tcamera.setFarPlane(f);\n\t\tR.addCamera(camera);\n\n light = new Mobilizing.Light();\n light.setIntensity(1.5);\n light.transform.setLocalPosition(-50,0,100);\n light.transform.setLocalRotation(45,0,0);\n R.addToCurrentScene(light);\n\n // Create touch event on mobilizing canvas\n touch = new Mobilizing.input.Touch({\"target\": R.canvas});\n M.addComponent(touch);\n touch.setup();//set it up\n touch.on();//active it\n\n // Add space\n plan = new Mobilizing.Mesh({primitive:\"plane\",\n width: 2,\n height: 3});\n //quad2.material.setWireframe(true);\n plan.transform.setLocalPosition(0,0,-5);\n plan.transform.setLocalRotation(0,0,0);\n R.addToCurrentScene(plan);\n\n // Set current user as a \"first blob\" (blue sphere, here)\n first_blob = new Mobilizing.Mesh({primitive:\"sphere\", radius: 0.05, material:\"phong\"});\n first_blob.transform.setLocalPosition(0,0,-5);\n first_blob.transform.setLocalRotation(90,0,0);\n first_blob.material.setColor(new Mobilizing.Color(1,.1,.2));\n R.addToCurrentScene(first_blob);\n\n pointer = new Mobilizing.Pointer();\n M.addComponent(pointer);\n pointer.add(touch);\n pointer.setup();\n pointer.on();\n\n\n\n\t};\n\t\t\n\tvar window_x_middle = window.innerWidth/2;\n\tvar window_y_middle = window.innerHeight/2;\n\n\tthis.update = function() {\n\t\t// r++;\n\t\t//console.log(pointer.getX());\n\t\tvar max_x_pointer = first_blob.transform.getLocalPositionX()+0.05;\n\t\tvar min_x_pointer = first_blob.transform.getLocalPositionX()-0.05;\n\t\tvar pointer_to_world_size_x = (pointer.getX()-window_x_middle)/1000;\n\t\tvar pointer_to_world_size_y = (pointer.getY()-window_y_middle)/1000;\n\t\t//console.log(pointer_to_world_size_y);\n\n\t\tif( max_x_pointer > pointer_to_world_size_x && min_x_pointer < pointer_to_world_size_x ) {\n\t\tfirst_blob.transform.setLocalPosition(pointer_to_world_size_x,-pointer_to_world_size_y, -5);\n\t\t}\n\n\t};\n\n\n}" ]
[ "0.61219585", "0.58250374", "0.57887506", "0.56426656", "0.5623802", "0.5604926", "0.5595574", "0.55708754", "0.55489856", "0.5495018", "0.54928696", "0.5488662", "0.5426509", "0.5426509", "0.5426509", "0.54008", "0.53613967", "0.53613967", "0.53613967", "0.53613967", "0.5335405", "0.53280586", "0.5322394", "0.53080773", "0.528974", "0.5287195", "0.5224926", "0.51931655", "0.5180474", "0.51715356", "0.51654994", "0.51627207", "0.5157", "0.51470834", "0.5115708", "0.5073572", "0.50624686", "0.50590485", "0.5058776", "0.5057495", "0.50453484", "0.502402", "0.5013935", "0.50117797", "0.5010652", "0.4993176", "0.49881762", "0.49810934", "0.49732292", "0.49598932", "0.4943642", "0.4928479", "0.49268785", "0.49266663", "0.49177945", "0.4915718", "0.48880535", "0.48855418", "0.48826706", "0.48820472", "0.48820472", "0.48820472", "0.48820472", "0.48820472", "0.48820472", "0.48820472", "0.48820472", "0.48820472", "0.48820055", "0.4876437", "0.4876437", "0.4876437", "0.48696434", "0.48680946", "0.48526728", "0.48385856", "0.4838001", "0.48350734", "0.48349643", "0.48310706", "0.48261368", "0.482192", "0.48159015", "0.4797615", "0.47967893", "0.47945866", "0.47854495", "0.47824344", "0.477616", "0.47735876", "0.47735876", "0.47735876", "0.47735876", "0.47735876", "0.47735876", "0.47735876", "0.47672406", "0.47627354", "0.47576043", "0.47541726", "0.47538024" ]
0.0
-1
Write a function `printNStop5(num)` that will print all the numbers from 0 to `num 1`. It should stop printing and end the first time it encounters a number that is multiple of 5, , except 0 (otherwise we wouldn't see anything). Examples: > printNStop5(5) 0 1 2 3 4 > printNStop5(15) 0 1 2 3 4
function printNStop5(num) { // your code here... }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highFive(num){ //print numbers less than 6 and if equals to 5 then print High Five!\n for(var i=0; i<num; i++){\n if(i == 5){// if num equals to 5, log below\n console.log(\"High Five!\");\n }\n else{//print i\n console.log(i);\n }\n }\n}", "function roundToNext5(num) {\n while (num % 5 !== 0) {\n num++\n }\n return num\n}", "function logAtMost5(n) {\n for (var i = 1; i <= Math.min(5, n); i++) {\n console.log(i);\n }\n}", "function logAtMost5(n) {\n\tfor (let i = 1; i <= Math.min(5, n); i++) {\n\t\tconsole.log(i);\n\t}\n}", "function logAtMost5(n) {\n for (var i = 1; i <= Math.min(5, n); i ++) {\n console.log(i);\n }\n}", "function highFive(num){\n     for(var i=0; i<num; i++){\n         if(i == 5){\n             console.log(\"High Five!\");\n         }\n         else{\n             console.log(i);\n         }\n     }\n }", "function highFive(num){\n     for(var i=0; i<num; i++){\n         if(i == 5){\n             console.log(\"High Five!\");\n         }\n         else{\n             console.log(i);\n         }\n     }\n }", "function logAtleast5Times(num) {\n const loopsCounter = Math.max(num, 5);\n for (let i = 0; i < loopsCounter; i++) {\n console.log(i);\n }\n for (let i = 0; i < loopsCounter; i++) {\n console.log(i);\n }\n for (let i = 0; i < loopsCounter; i++) {\n console.log(i);\n }\n}", "function skipFive () {\n for (i= 0; i <= 100; i++) {\n if (i % 5 === 0) {\n console.log(i);\n }\n }\n}", "function roundToNext5Multiple(num){\n return Math.ceil(num / 5) * 5;\n}", "function max5(n) {\n\tfor (let i = 0; i <= Math.max(5, n); i++) {\n\t\tconsole.log(i);\n\t}\n}", "function multipleOfFive(number) {\n if (verbose) {\n console.log('mulitpleOfFive() -> number', number);\n }\n return number % 5 === 0;\n}", "function logFive(sequence) {\n for (var i = 0; i < 5; i++) {\n if (!sequence.next()) {\n break;\n } else {\n console.log(sequence.current());\n }\n }\n}", "function roundToNext5(n) {\n // ...\n var quotient = Math.floor(n / 5);\n var remainder = n % 5;\n return(remainder == 0 ? n : quotient * 5 + 5);\n}", "function printAndCount(){\n\tvar counter = 0;\n\tvar printCount = 512;\n\n\twhile (printCount < 4097){\n\t\tif (printCount % 5 == 0) {\n\t\t\tconsole.log(printCount);\n\t\t\tcounter++;\n\t\t}\n\t\tprintCount++;\n\t}\n\tconsole.log(\"Total multiples of 5: \" +counter);\n}", "function twoFive(number, index) {\n \n let count2 = 0;\n let count5 = 0;\n switch (index) {\n case 0: \n for (let i = 1; i <= number; i ++) {\n let tmp = i;\n while (tmp % 2 == 0) {\n count2++;\n tmp = Math.floor(tmp / 2);\n }\n tmp = i;\n while (tmp % 5 == 0) {\n count5++;\n tmp = Math.floor(tmp / 5);\n }\n }\n break;\n case 1:\n for (let i = 1; i <= number; i +=2) {\n let tmp = i;\n while (tmp % 2 == 0) {\n count2++;\n tmp = Math.floor(tmp / 2);\n }\n tmp = i;\n while (tmp % 5 == 0) {\n count5++;\n tmp = Math.floor(tmp / 5);\n }\n }\n break;\n default:\n for (let i = 2; i <= number; i +=2) {\n let tmp = i;\n while (tmp % 2 == 0) {\n count2++;\n tmp = Math.floor(tmp / 2);\n }\n tmp = i;\n while (tmp % 5 == 0) {\n count5++;\n tmp = Math.floor(tmp / 5);\n }\n }\n }\n return [count2, count5];\n}", "function isFive(numFive) {\n return numFive === 5;\n }", "function timesFive(num) {\n\treturn num * 5;\n}", "function divisibleByFive(num) {\n\treturn !(num % 5);\n\t// return num % 5 == 0;\n}", "function divisibleByFive(num1) {\r\n\treturn (num1%5 === 0);\r\n}", "function timesFive(num){\n return num * 5;\n }", "function fiveAndGreaterOnly(numbers) {\n // your code here\n}", "function logFive(sequence){\n\n for(var i =0;i<5;i++){\n if(!sequence.next()){\n break;\n \n }\n console.log(sequence.current());\n }\n\n}", "function divisibleByFive(n) {\n var divByFive = n % 5 === 0;\n return divByFive;\n }", "function fiveNums(n1,n2,n3,n4,n5) {\n let erg = n1 / n2 / n3 / n4 / n5\n if (erg % 5 === 0) {\n alert (\"Lincoln!\")\n }\n}", "top(num = 7) {\n const sortable = this.getSortArray();\n const sizeOfNumber = Math.min(num, sortable.length);\n \n console.log(\"=====================\");\n console.log(\"Number <= Frequence\");\n console.log(\"=====================\");\n for (var idx = 0; idx < sizeOfNumber; idx++) {\n console.log((sortable[idx][0] + \" \").substring(0, 2) + \" <= \" + sortable[idx][1]);\n }\n }", "function printUpTo(x) {\n // your code here\n if (x > 0) {\n for (var num = 1; num < x; num++) {\n console.log(num);\n }\n }\n \n return false;\n}", "function lessThanFive(numArray) {\n let lessThan = [];\n let item = null;\n if (numArray.length === 0) {\n return '';\n }\n\n if (numArray[0] < 5) {\n let result = lessThanFive(numArray.slice(1));\n item = numArray[0];\n lessThan.push(item);\n\n if (result.length != 0) {\n result.forEach(num => lessThan.push(num));\n }\n } else lessThanFive(numArray.slice(1));\n\n return lessThan;\n}", "function timesFive (num) {\n return num * 5;\n}", "function five(n){\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n kk=n+1-i\r\n for(var k=1;k<i;k++){\r\n str=str+(kk)\r\n kk++\r\n }\r\n for(var j=i;j<=n;j++){\r\n str=str+(\"5\")\r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function Ejericio6For() {\n var numeroMultiplo = \"\";\n var resultado = 0;\n\n for (var i = 1; i <= 450; i++) {\n\n resultado = parseInt(i % 5);\n\n if (resultado === 0) {\n numeroMultiplo += \"Numero:\" + i + \"<br>\";\n }\n\n }\n\n $('#numerosMultiples').html(numeroMultiplo);\n\n}", "function timesFive(num) {\n return num * 5;\n}", "function timesFive(num) {\n return num * 5;\n}", "function timesFive(num) {\n return num * 5;\n}", "function timesFive(num) {\n return num * 5;\n}", "function timesFive(num) {\n return num * 5;\n}", "function timesFive(num) {\n return num * 5;\n}", "function timesFive(num) {\n return num * 5;\n}", "function max5(n) {\n\tfor (let i = 0; i <= Math.min(30, n); i++) {\n\t\tconsole.log(i);\n\t}\n}", "function timesFive(num) {\nreturn num * 5;\n}", "function round5(x)\n{\n return Math.ceil(x/5)*5;\n}", "function isMultipleOfFive(number){\n if(number%5 === 0){\n return true;\n } return false;\n}", "function timesFive(num) {\n return num * 5;\n}", "function fiveAndGreaterOnly2(num) {\n num = num.filter((x)=>{\n if (x % 2 == 0) {\n console.log(x);\n }\n })\n}", "function timesFive(num){\n return num*5;\n }", "function divisibleFive(num) {\n if(num % 5 === 0) {\n return true; \n } else {\n return false;\n }\n}", "function divisibleByFive(num1) {\n return num1%5===0?true:false\n}", "function fifth(v){\n var v = limiter(v,0,4);\n pitches[2] = afifth+treatfifth[v];\n if(DBUG) note(root);\n}", "function logFive(sequence)\n{\n sequence.take(function(x){console.log(x)}, 5)\n}", "function getClosestMultipleofFive(n) {\n if (n > 0)\n return Math.ceil(n / 5.0) * 5;\n else if (n < 0)\n return Math.floor(n / 5.0) * 5;\n else\n return 5\n}", "function fiveAndGreaterOnly(num) {\n num = num.filter((x)=>{\n if (x >= 5) {\n console.log(x);\n \n }\n })\n}", "function div5 (n1,n2,n3,n4,n5) {\n testNum = n1,n2,n3,n4,n5\n if (testNum%3 === 0){\n alert(\"Lincoln\")\n }\n}", "function dontGiveMeFive(start, end)\n{\n let i = start;\n let j = end;\n let num = 0;\n let result = [];\n\n while (i <= j) {\n if(i.toString().includes(\"5\")){\n i++;\n continue;\n } else{\n result.push(i);\n i++;\n }\n }\n\n return(result.length);\n}", "function threesFives(num){\n var addednum = 0;\n\n for (var i= 1; i < num; i++){\n if(i % 3 !== 0 && i % 5 !==0 ){\n addednum += i;\n }\n console.log(addednum)\n }\n return addednum\n}", "function divisibleByFive(n) {\n if(n % 5 == 0){\n return true\n }else\n return false\n\n }", "function isMultipleOfFive(input) {\n return input % 5 == 0; \n }", "function numbersLessThanFive(inputArray) {\n var outputArray = [];\n for (var i = 0; i < inputArray.length; i++) {\n if (inputArray[i] < 5) {\n outputArray.push(inputArray[i]);\n }\n }\n return outputArray;\n}", "function logFive2(sequence) {\n for (var i = 0; i < 5 && sequence !== undefined; i++) {\n console.log((sequence.head()));\n sequence = sequence.rest();\n }\n}", "function timesFive(n) {\n return n * 5;\n}", "function num(upto) { // 8\n for (var i = 0; i <= upto; i++){\n console.log(i);\n }\n}", "function fifth() {}", "function timesFive(num1){\n return num1 * 5;\n}", "function oddNum(num5){\n if ((num5 % 2) !== 0){\n console.log( num5 +\" \" +\"is an odd number\");\n }\n}", "function main (n) {\n for (let i = n - 1; i >= 0; i--) {\n console.log(' '.repeat(i).padEnd(n, '#'))\n }\n return ''\n}", "function inc5(n){\n return n + 5;\n}", "function logAtMost10(n) {\n for (var i = 1; i <= Math.min(n, 10); i++) {\n console.log(i);\n }\n}", "function fiveByFive() {\r\n if (!is5x5) {\r\n startUp();\r\n\r\n is5x5 = true;\r\n is10x10 = false;\r\n is15x15 = false;\r\n is20x20 = false;\r\n\r\n constructMaze(5, 5);\r\n }\r\n }", "function round5(x)\n{ return Math.round(x/5)*5; }", "function finder(num) { // num = 15\n let result = []; // 15, 12, 10, 9, 6, 5, 3\n while (num > 2) {\n if (num % 5 === 0) {\n result.push(num);\n num -= 1;\n } else if (num % 3 === 0) {\n result.push(num);\n num -= 1;\n } else {\n num -= 1;\n }\n }\n return result;\n}", "function kk(n){\r\n var num=1\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n for(var j=5;j>=1;j--){\r\n if(j>i){ \r\n str=str+(\" \") \r\n }\r\n else{\r\n \r\n str=str+(num++)\r\n \r\n } \r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function divisibleByFive(n) {\n if (n % 5 === 0) {\n return true;\n }\n return false;\n}", "function code(n){\r\n for(var i=1;i<=n;i++){\r\n var str=\"\"\r\n for(var j=1;j<=5;j++){\r\n if(j<=i){\r\n str=str+(j)\r\n }\r\n else{\r\n str=str+(\" \")\r\n } \r\n }\r\n for(var k=5;k>=1;k--){\r\n if(i>=k){\r\n str=str+(k)\r\n }\r\n else{\r\n str=str+(\" \")\r\n }\r\n }\r\n console.log(str)\r\n }\r\n \r\n }", "function divisibleBy5(array) {\n return array.find(num => num % 5 === 0);\n}", "function showNumbers(limit) {\n\n for(let jj=0; jj<=limit; jj++) {\n console.log(jj, (jj%2==0) ? \"EVEN\" : \"ODD\");\n }\n}", "function printSum1To5(){\n var sum = 0; \n for(var i=1; i<= 5; i++){\n sum = sum + i \n console.log(i,sum)\n }\n}", "function printAll(numbers) {\nfor (i = 0; i<=numbers; i++){\n console.log(i)\n}}", "function isMultipleOfFive(input) {\n return input % 5 === 0;\n}", "function showNumbers(limit) {\r\n for (i = 0; i <= limit; i++) {\r\n const message = (i % 2 === 0) ? \"EVEN\" : \"ODD\"\r\n console.log(i, message)\r\n }\r\n}", "function printTo(start, end) {\n\tvar i = start;\n\twhile(i <= 5280) {\n\t\tconsole.log(i);\n\t\ti++\n\t}\n}", "function printUpTo(x){\n // your code here\n\tif (x >= 0){\n \t\tfor(var i = 1; i <= x; i++) {\n \t\t\tconsole.log(i);\n\t\t}\n \t}\n\n \telse {\n \t\treturn false\n \t}\n}", "function PrintI(){\n var num = 2000;\n while(num < 5281){\n console.log(num);\n num++;\n }\n}", "function Sum3s5s(num) {\n\t//Use input 'num' as the upper limit, below which to find your multiples of 3's and 5's\n\tvar numArr = [];\n\n\tfor (var i = 0; i < num; i++) {\n\t\tif (i % 3 === 0 || i % 5 === 0) {\n\t\t\tnumArr.push(i);\n\t\t}\n\t}\n\n\treturn numArr.reduce(function(a,b) {return a+b;});\n}", "function multiplyBy5(number) {\n return num * 5\n}", "function greaterThanFive(arr) {\n const result = arr.filter(function(num){\n if (num >= 5) {\n return num;\n }});\n return result;\n}", "function printUpTo(x){\n // your code here\n}", "function printUpTo(x){\n // your code here\n}", "function sliceToFive(array) {\n return array.slice(0, 5)\n}", "function RangePrint3(end){\n for (var num = 0; num < end; num++){\n console.log(num)\n }\n}", "function greaterThanFive(number){\n if(number > 5){\n console.log(\"true\")\n }\n else{console.log(\"false\")}\n \n }", "function numberLogger(){\n for(let i = 1; i < 101; ++i){\n const three = i % 3;\n const five = i % 5;\n if(!three && !five){\n console.log(\"Jackpot!\");\n } else if(!three) {\n console.log(\"This is a multiple of 3\");\n } else if(!five){\n console.log(\"This is a multiple of 5\");\n } else {\n console.log(i);\n }\n }\n}", "function topFive(array){\n let result = array\n .sort((countA, countB) => (countA.count < countB.count ? 1 : -1))\n .slice(0,5);\n return result;\n}", "function printAndCount(i=512, max=1000, mult=5){\n // while(i < max){\n // if(i % mult === 0){\n // console.log(i)\n // }\n // i++;\n // }\n let sum=0\n for(i; i<max; i+=5)\n {\n console.log(i)\n sum++;\n }\n \nconsole.log(sum);\n}", "function notGood(num) {\n console.log(num) // console dot five here // or just num here\n}", "function loops5 () {\n console.log('#5b Logging 1 to 1000 with a for loop: ');\n for (var i = 0; i < 1001; i++) {\n console.log(i);\n }\n}", "function multiplesOf3and5(number) {\r\n let sum_total = 0;\r\n for (var i = 0; i < number; i++) {\r\n if (i % 3 == 0 || i % 5 == 0) {\r\n sum_total = sum_total + i;\r\n }\r\n }\r\n return console.log(sum_total);\r\n}", "function divisibleBy(lowerBound, upperBound) {\n for (var i = lowerBound; i <= upperBound; i++) {\n if (i % 5 == 0 && i % 3 == 0) console.log(i);\n }\n }", "function logUpTo(n) {\n for (var i = 1; i <= n; i++) {\n console.log(i);\n }\n}", "function trailing_zeros_factorial(n) {\n let result = 0;\n for (let i = 5; i <= n; i += 5) {\n let num = i;\n while (num % 5 === 0) {\n num /= 5;\n result++;\n }\n }\n return result;\n}", "function fPadToFive(number) {\n // for transit numbers\n if (!number.isNull) {\n var value = number.rawValue;\n if (value <= 99999) {\n value = (\"0000\" + value).slice(-5);\n number.rawValue = value;\n }\n }\n}", "function timesFive(numInp) {\r\n var result = numInp * 5;\r\n return result;\r\n}" ]
[ "0.67742056", "0.65540546", "0.65039474", "0.6465406", "0.64429015", "0.63577163", "0.63577163", "0.6232831", "0.6222594", "0.6050855", "0.59807324", "0.5877286", "0.5867348", "0.58585066", "0.5811957", "0.5754944", "0.5745096", "0.5730267", "0.572765", "0.56863695", "0.5645099", "0.5641263", "0.55639315", "0.5547825", "0.55353826", "0.5528553", "0.5512343", "0.55117077", "0.5509113", "0.5484742", "0.5478368", "0.54746497", "0.54746497", "0.54746497", "0.54746497", "0.54746497", "0.54746497", "0.54746497", "0.54580116", "0.54558414", "0.5452763", "0.5446603", "0.544195", "0.5394981", "0.53929216", "0.5366272", "0.5347545", "0.53354686", "0.5334422", "0.5306373", "0.52969944", "0.52924955", "0.5280543", "0.52695554", "0.5260465", "0.52291894", "0.5222764", "0.52152467", "0.5210742", "0.5210144", "0.5200205", "0.5196003", "0.5194131", "0.5182301", "0.51709634", "0.51684695", "0.51664823", "0.51638335", "0.51596", "0.5153247", "0.5151744", "0.51486236", "0.5143978", "0.5140796", "0.5139748", "0.51300883", "0.51072884", "0.5103596", "0.5102371", "0.51019466", "0.5099208", "0.5098833", "0.509419", "0.5087423", "0.5081905", "0.5081905", "0.50762355", "0.50602", "0.50586927", "0.50495714", "0.5048896", "0.50182307", "0.5017992", "0.5014915", "0.49999925", "0.49984825", "0.4994529", "0.49930686", "0.4992191", "0.49808967" ]
0.7633555
0
Watch on Property Changes
parseDurationProp(newValue) { this.innerDuration = newValue ? newValue : "2000ms"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "willWatchProperty(property) {\n this.beginObservingContentKey(property);\n }", "function notifyProperty(changes) {\n $.each(changes._watchers, function() {\n notifyCall(this);\n });\n }", "function watchPropsOn(el) {\n return new Proxy(el, {\n get(target, propKey, receiver) {\n //return Reflect.get(target, propKey, receiver);\n console.log('get', propKey);\n return el[propKey];\n },\n set(target, propKey, value, receiver) {\n console.log('set', propKey, value);\n target[propKey] = value;\n }\n });\n}", "get isWatching(){ return this._isWatching }", "track(source, propertyName) {\n if (watcher !== void 0) {\n watcher.watch(source, propertyName);\n }\n }", "watch() {\n }", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (const attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (const attr in val) {\n this.$set(this.$data[property], attr, val[attr]);\n }\n };\n}", "function initWatchVal(){}", "function initWatchVal(){}", "function makeWatcher(property) {\n return function (val, oldVal) {\n for (var attr in oldVal) {\n if (!Object.prototype.hasOwnProperty.call(val, attr)) {\n this.$delete(this.$data[property], attr);\n }\n }\n\n for (var _attr in val) {\n this.$set(this.$data[property], _attr, val[_attr]);\n }\n };\n}", "function propertyChangeHandler(key, newVal, oldVal) {\n\n }", "updated(changedProperties) {\n if (super.updated) {\n super.updated(changedProperties);\n }\n changedProperties.forEach((oldValue, propName) => {\n /* notify example\n // notify\n if (propName == 'format') {\n this.dispatchEvent(\n new CustomEvent(`${propName}-changed`, {\n detail: {\n value: this[propName],\n }\n })\n );\n }\n */\n /* observer example\n if (propName == 'activeNode') {\n this._activeNodeChanged(this[propName], oldValue);\n }\n */\n /* computed example\n if (['id', 'selected'].includes(propName)) {\n this.__selectedChanged(this.selected, this.id);\n }\n */\n });\n }", "function WatchPrimitiveProperties(vueInst, propertiesToTrack, handler) {\n var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var isHandled = false;\n\n function requestHandle() {\n if (!isHandled) {\n isHandled = true;\n vueInst.$nextTick(function () {\n isHandled = false;\n handler();\n });\n }\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = propertiesToTrack[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var prop = _step.value;\n vueInst.$watch(prop, requestHandle, {\n immediate: immediate\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}", "_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()}", "function WatchPrimitiveProperties(vueInst, propertiesToTrack, handler) {\n var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n var isHandled = false;\n\n function requestHandle() {\n if (!isHandled) {\n isHandled = true;\n vueInst.$nextTick(function () {\n isHandled = false;\n handler();\n });\n }\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = propertiesToTrack[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var prop = _step.value;\n\n vueInst.$watch(prop, requestHandle, { immediate: immediate });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}", "function WatchPrimitiveProperties(vueInst, propertiesToTrack, handler) {\n var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n var isHandled = false;\n\n function requestHandle() {\n if (!isHandled) {\n isHandled = true;\n vueInst.$nextTick(function () {\n isHandled = false;\n handler();\n });\n }\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = propertiesToTrack[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var prop = _step.value;\n\n vueInst.$watch(prop, requestHandle, { immediate: immediate });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}", "function WatchPrimitiveProperties(vueInst, propertiesToTrack, handler) {\n var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n var isHandled = false;\n\n function requestHandle() {\n if (!isHandled) {\n isHandled = true;\n vueInst.$nextTick(function () {\n isHandled = false;\n handler();\n });\n }\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = propertiesToTrack[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var prop = _step.value;\n\n vueInst.$watch(prop, requestHandle, { immediate: immediate });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}", "function WatchPrimitiveProperties(vueInst, propertiesToTrack, handler) {\n var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n var isHandled = false;\n\n function requestHandle() {\n if (!isHandled) {\n isHandled = true;\n vueInst.$nextTick(function () {\n isHandled = false;\n handler();\n });\n }\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = propertiesToTrack[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var prop = _step.value;\n\n vueInst.$watch(prop, requestHandle, { immediate: immediate });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}", "function WatchPrimitiveProperties(vueInst, propertiesToTrack, handler) {\n var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n var isHandled = false;\n\n function requestHandle() {\n if (!isHandled) {\n isHandled = true;\n vueInst.$nextTick(function () {\n isHandled = false;\n handler();\n });\n }\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = propertiesToTrack[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var prop = _step.value;\n\n vueInst.$watch(prop, requestHandle, { immediate: immediate });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}", "function track(property, thisArg){\n if(!(property in trackedProperties)){\n trackedProperties[property] = true;\n values[property] = model[property];\n Object.defineProperty(model, property, {\n get: function () { return values[property]; },\n set: function(newValue) {\n var oldValue = values[property];\n values[property] = newValue;\n getListeners(property).forEach(function(callback){\n callback.call(thisArg, newValue, oldValue);\n });\n }\n });\n }\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() {}", "updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n //console.log('changedProperties',propName,oldValue,this[propName]);\n if (propName === \"schema\") this._schemaChanged(this.schema, oldValue);\n if (propName === \"value\") this._valueChanged(this.value, oldValue);\n });\n }", "updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n if (propName == \"recording\") {\n if (this[propName]) {\n this.textState = \"stop\";\n this.iconState = \"av:stop\";\n } else {\n this.textState = \"Record\";\n this.iconState = \"av:play-arrow\";\n }\n // observer to act on the recording piece\n this.toggleRecording(this[propName], oldValue);\n }\n });\n }", "function _watchLocateEngineProperties(id, oldval, newval) {\n\t\tif (oldval !== newval) _serializeLocateEngines();\n\t\treturn newval;\n\t}", "updated(changedProperties) {\n }", "firstUpdated(changedProperties) {\n console.log('first updated', changedProperties);\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()}}", "_setv(changes, options) {\n // Extract attributes and options.\n const check_eq = options.check_eq;\n const changed = [];\n const changing = this._changing;\n this._changing = true;\n for (const [prop, value] of changes) {\n if (check_eq === false || !is_equal(prop.get_value(), value)) {\n prop.set_value(value);\n changed.push(prop);\n }\n }\n // Trigger all relevant attribute changes.\n if (changed.length > 0) {\n this._watchers = new WeakMap();\n this._pending = true;\n }\n for (const prop of changed) {\n prop.change.emit();\n }\n // You might be wondering why there's a `while` loop here. Changes can\n // be recursively nested within `\"change\"` events.\n if (changing)\n return;\n if (!options.no_change) {\n while (this._pending) {\n this._pending = false;\n this.change.emit();\n }\n }\n this._pending = false;\n this._changing = false;\n }", "function initWatchVal() {} // 16439", "updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n if (propName == \"recording\") {\n if (this[propName]) {\n this.textState = \"stop\";\n this.iconState = \"av:stop\";\n } else {\n this.textState = \"Record\";\n this.iconState = \"av:play-arrow\";\n } // observer to act on the recording piece\n\n\n this.toggleRecording(this[propName], oldValue);\n }\n });\n }", "function WatchPrimitiveProperties(\n vueInst,\n propertiesToTrack,\n handler,\n immediate = false\n) {\n let isHandled = false\n\n function requestHandle() {\n if (!isHandled) {\n isHandled = true\n vueInst.$nextTick(() => {\n isHandled = false\n handler()\n })\n }\n }\n\n for (let prop of propertiesToTrack) {\n vueInst.$watch(prop, requestHandle, { immediate })\n }\n}", "function PropertyDetection() {}", "function changed(change) {\n if (change.changeType === \"property\" && change.property === property) {\n fn(change);\n }\n }", "function test(store, prop, newObj, oldObj) {\n\t\t\t\tvar newVal = getProp(prop, newObj);\n\t\t\t\tvar oldVal = getProp(prop, oldObj);\n\t\t\t\tvar props, event;\n\n\t\t\t\tif (Keys.cmp(newVal, oldVal)) {\n\t\t\t\t\t// Notify all listeners, if any.\n\t\t\t\t\tspotters.trigger(prop, newObj, newVal, oldVal);\n\t\t\t\t\tif (store.eventable && !store.suppressEvents) {\n\t\t\t\t\t\tprops = {item: newObj, property: prop, newValue: newVal, oldValue: oldVal};\n\t\t\t\t\t\tevent = new Event(\"set\", {detail: props});\n\t\t\t\t\t\tstore.dispatchEvent(event);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function update() {\n var n, changed = false;\n for( n in _properties ) {\n changed |= _properties[n].update();\n }\n \n if( changed ) {\n self.valueChanged();\n } else {\n window.clearInterval( _interval );\n _interval = -1;\n }\n }", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}", "function startWatchingForValueChange(target,targetInst){activeElement=target;activeElementInst=targetInst;activeElement.attachEvent('onpropertychange',handlePropertyChange);}" ]
[ "0.75753605", "0.7223749", "0.70258075", "0.67753965", "0.66732794", "0.66078603", "0.65001184", "0.65001184", "0.65001184", "0.65001184", "0.65001184", "0.65001184", "0.6481428", "0.6481428", "0.6481428", "0.6481428", "0.6481428", "0.6470637", "0.6470637", "0.6454544", "0.64438623", "0.6391662", "0.63688695", "0.6364861", "0.63548577", "0.63548577", "0.63548577", "0.63548577", "0.63548577", "0.6330199", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6329051", "0.6301385", "0.62804526", "0.6280346", "0.62724876", "0.6271597", "0.6268435", "0.6263468", "0.62621224", "0.6249976", "0.62424904", "0.6223364", "0.6214164", "0.61649597", "0.6164097", "0.6160185", "0.6160185", "0.6160185", "0.6160185", "0.6160185", "0.6160185", "0.6160185", "0.6160185", "0.6160185", "0.6160185", "0.6160185", "0.6160185" ]
0.0
-1
Event Definitions Listen to Event Definitions Method Definitions Method initialize
async init() { return await this._init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initializeEvents () {\n }", "initialize() {\n this.listenTo(this.owner, {\n [converter_1.Converter.EVENT_BEGIN]: this.onBegin,\n [converter_1.Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration,\n [converter_1.Converter.EVENT_CREATE_SIGNATURE]: this.onDeclaration,\n [converter_1.Converter.EVENT_RESOLVE_BEGIN]: this.onBeginResolve,\n [converter_1.Converter.EVENT_RESOLVE]: this.onResolve,\n [converter_1.Converter.EVENT_RESOLVE_END]: this.onEndResolve,\n });\n }", "_initEvents(){\n this._eventInstances.forEach((list,i)=>{\n const hasTargets = list.length,\n isInitialised = this._eventInitialised[i]\n if (hasTargets&&!isInitialised) {\n this._body.addEventListener(this._eventNames[i],this._onEvent.bind(this,list,this._eventHandlers[i]))\n this._eventInitialised[i] = true\n }\n })\n }", "function init () {\n bindEventHandlers();\n}", "onInit() {\n this.__initEvents();\n }", "function init() {\n\t\tinitEvents();\n\t}", "function init() {\r\n bindEventListeners();\r\n }", "function initEventListener() { }", "function initEventListener() {\n \n }", "function _init() {\n addEvent();\n getData();\n }", "function init() {\n setupListeners();\n }", "function init () {\n\t\t//Get the unique [charity] userId so we know \n\t\t//which url to used for the server-side API\n\t\tvar userId = $('[data-event-config=\"userId\"]').val();\n\t\t\n\t\t//Initialise events collection\n\t\tfunction initCollection () {\n\t\t\tvar evts = new Evts({\n\t\t\t\tuserId: userId\n\t\t\t});\n\n\t\t\tinitFormView(evts);\n\t\t\tinitEventsBoard(evts);\n\t\t}\n\n\t\t//Initialise event form view\n\t\tfunction initFormView (evts) {\n\t\t\tvar $el = $('[data-event=\"configure\"]');\n\t\t\tnew EventForm({\n\t\t\t\tel: $el,\n\t\t\t\tcollection: evts\n\t\t\t});\n\t\t}\n\n\t\t//Initialise events board with persisted events\n\t\tfunction initEventsBoard (evts) {\n\t\t\tvar $el = $('[data-events-board]');\n\t\t\tnew EventBoard({\n\t\t\t\tel: $el,\n\t\t\t\tcollection: evts\n\t\t\t});\n\t\t}\n\n\t\t//Start up everything\n\t\tinitCollection();\n\t}", "function init() {\n loadDependencies();\n attachEventHandlers();\n}", "@autobind\n initEvents() {\n $(document).on('intro', this.triggerIntro);\n $(document).on('instructions', this.triggerInstructions);\n $(document).on('question', this.triggerQuestion);\n $(document).on('submit_query', this.triggerSubmitQuery);\n $(document).on('query_complete', this.triggerQueryComplete);\n $(document).on('bummer', this.triggerBummer);\n }", "function initEventHandler() {\n // initSortable();\n initFormEvents(fb);\n initListEvents(fb);\n}", "__initEvents() {\n if (this.__hasInitEvents) {\n return;\n }\n\n this.__hasInitEvents = true;\n this.$eventHub = eventCenter;\n let events = this.$rawBroadcastEvents;\n if (typeof events === 'function') {\n events = this.$rawBroadcastEvents = events();\n }\n this.__bindBroadcastEvents(events);\n }", "constructor() { \n \n Event.initialize(this);\n }", "function init() {\n id(\"scroll-btn\").addEventListener(\"click\", scrollDown);\n id(\"top-btn\").addEventListener(\"click\", topOfPage);\n id(\"home-btn\").addEventListener(\"click\", homeView);\n id(\"exp-btn\").addEventListener(\"click\", expView);\n id(\"resume-btn\").addEventListener(\"click\", resumeView);\n id(\"contact-btn\").addEventListener(\"click\", newContact);\n qs(\"#about span\").addEventListener(\"click\", newContact);\n qs(\"#contact form\").addEventListener(\"submit\", submitForm);\n qs(\"form\").addEventListener(\"input\", enableSubmit);\n }", "initialize(){\n this.loadListeners()\n }", "init(){\n this.addEvents(this.keys);\n }", "init () {\n const me = this;\n\n if (!me.eventsInitialized) {\n me.events.forEach(event => process.addListener(event, me.exec));\n\n me.eventsInitialized = true;\n }\n }", "function init() {\r\n contextListener();\r\n clickListener();\r\n keyupListener();\r\n resizeListener();\r\n }", "initEventListners() {\n this.engine.getSession().selection.on('changeCursor', () => this.updateCursorLabels());\n\n this.engine.getSession().on('change', (e) => {\n // console.log(e);\n\n // Make sure the editor has content before allowing submissions\n this.allowCodeSubmission = this.engine.getValue() !== '';\n this.enableRunButton(this.allowCodeSubmission);\n });\n }", "function init() {\n contextListener();\n clickListener();\n keyupListener();\n resizeListener();\n }", "init() {\n\t\tglobalApplication.events.document();\n\t\tglobalApplication.events.header();\n\t}", "initialise(){\n this._initialise(this._body)\n this._initEvents()\n this._dispatchOnInit()\n }", "function init() {\n contextListener();\n clickListener();\n keyupListener();\n resizeListener();\n }", "function initEvents(){\n\t\t\t\t\n\t\t//set navigation buttons events\n\t\tif(g_objNavWrapper){\n\t\t\t\n\t\t\tg_carousel.setScrollLeftButton(g_objButtonRight);\n\t\t\tg_carousel.setScrollRightButton(g_objButtonLeft);\n\t\t\t\n\t\t\tif(g_objButtonPlay)\n\t\t\t\tg_carousel.setPlayPauseButton(g_objButtonPlay);\n\t\t\t\n\t\t}\n\t\t\n\t\tg_objGallery.on(g_gallery.events.SIZE_CHANGE, onSizeChange);\n\t\tg_objGallery.on(g_gallery.events.GALLERY_BEFORE_REQUEST_ITEMS, onBeforeReqestItems);\n\t\t\n\t\t//on click events\n\t\tjQuery(g_objTileDesign).on(g_objTileDesign.events.TILE_CLICK, onTileClick);\n\t\t\n\t\t//init api\n\t\tg_objGallery.on(g_apiDefine.events.API_INIT_FUNCTIONS, initAPIFunctions);\n\t}", "init() {\n this.initDOMListeners();\n }", "function init() {\n // contextListener();\n clickListener();\n // keyupListener();\n // resizeListener();\n}", "ConnectEvents() {\n\n }", "function init() {\n fetchDetails();\n setEvents();\n }", "function event_initialise(){\n\tgcAddListener(capture_events_onCbusMessage);\n}", "function init() {\n _on(\"mouseenter\", _onMouseEnter);\n _on(\"focus\", _onMouseEnter);\n _on(\"mouseleave\", _onMouseLeave); \n _on(\"blur\", _onMouseLeave);\n }", "function init() {\n\n\t\t// Bind the editor elements to variables\n\t\tbindElements();\n\n\t\t// Create event listeners for keyup, mouseup, etc.\n\t\tcreateEventBindings();\n\t}", "function init(){\n calendarStart();\n loadTodos();\n addTodo();\n resizesTodoList();\n\n //Listens for resize event to calculate height of todo list.\n window.addEventListener('resize', resizesTodoList);\n \n //Listens for clicks on calendar days.\n document.querySelector('.calendar-container').addEventListener('click', event => {calendarDayClicked(event);});\n\n //Listens for events on todo list, for when to update number of todos in calendar.\n document.querySelector('.todoContainer').addEventListener('click', event => {todoClick(event);});\n }", "function init() {\n setDomEvents();\n }", "function initEvents () {\n\t\t\tif (config.type === \"simple\") {\n\t\t\t\tinitEventsSimple();\n\t\t\t}\n\t\t\telse if (config.type === \"panel\") {\n\t\t\t\tinitEventsPanel();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow \"Invalid showhide type specified: \\\"\" + config.type + \"\\\". Type must be \\\"simple\\\" or \\\"panel.\\\"\";\n\t\t\t}\n\n\t\t\t$(\"h2[data-open='true'] a\", $container).each(function(){\n\t\t\t\topenPanel($(this));\n\t\t\t});\n\t\t}", "function init(){\r\n\r\n\t\t//Adding listeners \r\n\t\tbtnSubmit.addEventListener('click' , handleSubmitClick);\r\n\t\tgroceryList.addEventListener('click' , handleListClick);\r\n\t\t//call to setup the page\r\n\t\tsetUp();\r\n\t}", "initialize() {\n this.listenTo(this.owner, {\n [events_1.RendererEvent.BEGIN]: this.onRenderBegin,\n [events_1.PageEvent.BEGIN]: this.onRendererBeginPage,\n });\n }", "_setupEvents () {\n this._events = {}\n this._setupResize()\n this._setupInput()\n\n // Loop through and add event listeners\n Object.keys(this._events).forEach(event => {\n if (this._events[event].disable) {\n // If the disable property exists, add prevent default to it\n this._events[event].disable.addEventListener(event, this._preventDefault, false)\n }\n this._events[event].context.addEventListener(event, this._events[event].event.bind(this), false)\n })\n }", "_initEvents() {\n Input._init(this, {\n joystick: true\n });\n }", "afterInitialisation() {\n // Forward initialization event to server\n this.eventBusMaster.on(MASTER_SLAVE_CHANNEL, 'initialized', data => this.eventBusMaster.emit(MASTER_SERVER_CHANNEL, 'init', data));\n // Forward \"gotoSlide\" events to slave\n this.eventBusMaster.on(MASTER_SERVER_CHANNEL, 'gotoSlide', data => this.eventBusMaster.emit(MASTER_SLAVE_CHANNEL, 'gotoSlide', data));\n // Forward \"showNotes\" events to slave\n this.eventBusMaster.on(MASTER_SLAVE_CHANNEL, 'sendNotesToMaster', data => this.eventBusMaster.emit(MASTER_SLAVE_CHANNEL, 'sendNotesToSlave', data));\n // Start listening on \"keyboardEvent\" on MASTER_SLAVE_CHANNEL\n this.eventBusMaster.on(MASTER_SLAVE_CHANNEL, 'keyboardEvent', this.onKeyboardEvent.bind(this));\n // Start listening on \"touchEvent\" on MASTER_SLAVE_CHANNEL\n this.eventBusMaster.on(MASTER_SLAVE_CHANNEL, 'touchEvent', this.onTouchEvent.bind(this));\n }", "function initializeEvents() {\n 'use strict';\n var thumbnails = getThumbnailsArray();\n thumbnails.forEach(addThumbClickHandler);\n}", "function initializeEvents() {\n 'use strict';\n var thumbnails = getThumbnailsArray();\n thumbnails.forEach(addThumbClickHandler);\n}", "_onInit(deviceId){\n\t\tthis._deviceId = deviceId\n\t\tthis._isInitialized = true\n\t\ttry {\n\t\t\tthis.dispatchEvent(new CustomEvent(ARKitWrapper.INIT_EVENT, {\n\t\t\t\tsource: this\n\t\t\t}))\n } catch(e) {\n console.error('INIT_EVENT event error', e)\n }\n\t}", "init() {\n this.initDomListeners()\n }", "_initListeners() {\n this._initResizeListener();\n this._initSwipe();\n }", "function init() {\n /**\n * Init Function to add event handlers\n */\n\n $('#nts1Proceed').click(handleNTS1Proceed);\n $('#oneTimeSubscription').click(handleNoteTypeSelect);\n $('#weeklySubscription').click(handleNoteTypeSelect);\n $('#monthlySubscription').click(handleNoteTypeSelect);\n $('#annualSubscription').click(handleNoteTypeSelect);\n}", "constructor(){\n this._events = {};\n }", "created() {\n this.__initEvents();\n }", "function init() {\r\n renderTodos(state);\r\n form.addEventListener('submit', addTodo);\r\n list.addEventListener('change', updateTodo);\r\n list.addEventListener('dblclick', editTodo);\r\n list.addEventListener('click', deleteTodo);\r\n clear.addEventListener('click', clearCompletes);\r\n}", "function registerEvents() {\n}", "function EventDispatcher() {\n this.initialize();\n }", "function init() {\n\t\tbindClickEventsToBulbs();\n\t\tgetBulbsInfo();\n\t\tupdateBulbsStatus();\n\t \t\n initDigitalWatch();\n updateDate(0);\n\n bindEvents();\n }", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}", "function Events() {}" ]
[ "0.77356625", "0.7563767", "0.7501507", "0.7449922", "0.74475837", "0.73630655", "0.7348723", "0.73107284", "0.730282", "0.71919733", "0.7097074", "0.703736", "0.7037233", "0.70316494", "0.69632155", "0.69270724", "0.6921078", "0.6875554", "0.6866332", "0.6851667", "0.6843116", "0.6826494", "0.68141425", "0.6813666", "0.6806559", "0.67633957", "0.6761798", "0.67265373", "0.6724435", "0.67051876", "0.6691068", "0.66721326", "0.6666846", "0.6658164", "0.66306996", "0.66299945", "0.66253763", "0.6610589", "0.6608817", "0.6595665", "0.65657556", "0.65615904", "0.6559985", "0.65487736", "0.65487736", "0.65405184", "0.65330887", "0.6526198", "0.6511292", "0.6510108", "0.65036666", "0.65020066", "0.64999175", "0.64935654", "0.6472281", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223", "0.6461223" ]
0.0
-1
set up dark mode toggle
function setDarkMode(on) { if (on) { darkModeToggleInput.checked = true document.documentElement.classList.add('dark') localStorage.theme = 'dark' document.getElementById('sun-icon').classList.add('hidden') document.getElementById('moon-icon').classList.remove('hidden') } else { darkModeToggleInput.checked = false document.documentElement.classList.remove('dark') localStorage.theme = 'light' document.getElementById('moon-icon').classList.add('hidden') document.getElementById('sun-icon').classList.remove('hidden') } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggle_dark_mode(){\n\t\t\tif($('body').attr('dark') === \"true\" || $('html').attr('dark') === \"true\"){\n\t\t\t\t$panel.go_dark('yt');\n\t\t\t}else{\n\t\t\t\t$panel.go_light('yt');\n\t\t\t}\n\n\t\t\tif(!mode_obs_attached){\n\t\t\t\t$utils.create_observer('body', toggle_dark_mode, [true, false, true, false]);\n\t\t\t\tmode_obs_attached = true;\n\t\t\t}\n\t\t}", "function lightDarkMode() {\n var trigger = $('.light-dark-btn'),\n container = $('.body-dark-mode-wrap'),\n container2 = $('.light-dark-mode-wrap');\n trigger.on('click', function(e) {\n e.preventDefault();\n container.toggleClass('dark-visible');\n container2.toggleClass('dark-visible');\n })\n }", "function darkMode() {\n document.getElementById('change-theme').innerText = 'Light Mode';\n document.documentElement.style.setProperty('--theme-color-1','white');\n document.documentElement.style.setProperty('--theme-color-2','black');\n document.documentElement.style.setProperty('--hover-value', 223);\n document.documentElement.style.setProperty('--active-value', 190);\n IslightMode = false;\n}", "static toggle() {\n if (this.isLight()) {\n this.dark()\n } else {\n this.light()\n }\n }", "function activityDark(){\n if(darkMode.checked){\n wrapper.classList.add('dark');\n }else{\n wrapper.classList.remove('dark');\n darkMode.checked = false;\n }\n}", "function setDarkMode() {\n let accessibleElements = \"a, body, button, h1, h2, h3, h4, h5, h6, .alert, .breadcrumb-item.active,\"\n + \".card-block, .card-header, .dropdown-menu, .fas, .list-group-item, .text-secondary\";\n \n if(Cookies.get('darkMode') == \"true\") {\n $(\"#dark-mode-toggle\").addClass(\"btn-success\");\n $(\"#dark-mode-toggle\").removeClass(\"btn-default\");\n $(\"#dark-mode-toggle\").text(ui_locales['Enabled'][Cookies.get('lang')]);\n\n $(accessibleElements).addClass(\"darkmode\");\n } else {\n $(\"#dark-mode-toggle\").addClass(\"btn-default\");\n $(\"#dark-mode-toggle\").removeClass(\"btn-success\");\n $(\"#dark-mode-toggle\").text(ui_locales['Disabled'][Cookies.get('lang')]);\n \n $(accessibleElements).removeClass(\"darkmode\");\n }\n}", "function darkOn() {\n cloudObject.div.classList.add('dark');\n cloudObject.body.classList.add('dark');\n cloudObject.form.classList.add('dark');\n }", "function darkModeThemeOn() {\n let darkModeON = document.getElementById('body-container');\n darkModeON.classList.toggle('theme-off');\n}", "function darkxlight() {\r\n var element = document.getElementById(\"darkxlight\");\r\n element.classList.toggle(\"dark\");\r\n }", "static dark() {\n window.localStorage.setItem('colorScheme', 'dark')\n this.#isDark = true;\n this.#applyScheme();\n }", "function darkMode(){\n nav.style.backgroundColor='rgb(0 0 0 / 50%)';\n textBox.style.backgroundColor='rgb(255 255 255 / 50%)';\n toggleIcon.children[0].textContent=\"Dark Mode\";\n toggleIcon.children[1].classList.replace(\"fa-sun\",\"fa-moon\");\n imageMode(\"dark\");\n}", "function toggleDarkLightMode(isDark) {\n nav.style.backgroundColor = isDark\n ? \"rgb(0 0 0 / 60%)\"\n : \"rgb(255 255 255 / 60%)\";\n toggleIcon.children[0].textContent = isDark ? \"Dark Mode\" : \"Light Mode\";\n isDark\n ? toggleIcon.children[1].classList.replace(\"fa-sun\", \"fa-moon\")\n : toggleIcon.children[1].classList.replace(\"fa-moon\", \"fa-sun\");\n}", "function lightMode() {\n document.getElementById('change-theme').innerText = 'Dark Mode';\n document.documentElement.style.setProperty('--theme-color-1','black');\n document.documentElement.style.setProperty('--theme-color-2','white');\n document.documentElement.style.setProperty('--hover-value', 32);\n document.documentElement.style.setProperty('--active-value', 65);\n IslightMode = true;\n}", "function darkxlight() {\r\n var element = document.getElementById(\"darkxlight\");\r\n element.classList.toggle(\"dark\");\r\n}", "function toggleDarkLight() {\n var body = document.getElementById(\"body\");\n var currentClass = body.className;\n body.className = currentClass == \"dark-mode\" ? \"light-mode\" : \"dark-mode\";\n}", "function setDarkScheme() { /* exported setDarkScheme */\n $(\"body\").removeClass(\"light\").addClass(\"dark\");\n $(\"#btnSettings\").attr(\"src\", AssetPaths.SETTINGS);\n}", "function toggleDarkMode() {\r\n document.body.classList.toggle(\"dark\")\r\n if (lightsOff == 1) {\r\n document.cookie = \"lights_off=0;max-age=259200;\"\r\n lightsOff = 0;\r\n } else {\r\n document.cookie = \"lights_off=1;max-age=259200;\"\r\n lightsOff = 1;\r\n }\r\n}", "function toggleDarkLightMode(mode){\n\n nav.style.backgroundColor = mode === \"dark\" ? 'rgb(0 0 0 / 50%)' : 'rgb(255 255 255 / 50%)';\n textBox.style.backgroundColor = mode === 'dark' ? 'rgb(255 255 255 / 50%)' : 'rgb(0 0 0 / 50%)';\n // toggleIcon.children[0].textContent = mode === 'dark' ? 'Dark Mode' : 'Light Mode';\n // mode ? toggleIcon.children[1].classList.replace('fa-sun','fa-moon')\n // :\n // toggleIcon.children[1].classList.replace('fa-moon','fa-sun'); ;\n if(mode === \"dark\")\n {\n darkIcon.classList.remove(\"reduce_opacity\");\n lightIcon.classList.add(\"reduce_opacity\");\n }\n else{\n darkIcon.classList.add(\"reduce_opacity\");\n lightIcon.classList.remove(\"reduce_opacity\");\n } \n\n imageMode(mode);\n\n \n \n}", "function changeMode(){ \n if(IslightMode)\n darkMode();\n else\n lightMode();\n}", "function switchtheme() {\r\n var element=document.body;\r\n element.classList.toggle(\"darkmode\");\r\n \r\n}", "function toggleDarkMode(element) {\n var darkModeStatus = getCookie(\"enableDarkMode\")\n if (darkModeStatus) {\n element.innerText = \"Dark Mode\"\n setCookie(\"enableDarkMode\",false)\n } else {\n element.innerText = \"Light Mode\"\n setCookie(\"enableDarkMode\",true)\n }\n refreshDarkMode()\n}", "function changeToDarkMode() {\n //body\n const body = document.getElementsByTagName(\"body\");\n body[0].classList.add(\"dark-mode\");\n body[0].classList.remove(\"light-mode\");\n //hashtags\n const hashtags = document.querySelectorAll(`.hashtag`);\n for (const tag of hashtags) {\n tag.classList.remove(\"light-mode\");\n tag.classList.add(\"dark-mode\")\n }\n //icons\n const icons = document.querySelectorAll(`.internal-link`);\n for (const icon of icons) {\n icon.classList.remove(\"light-mode\");\n icon.classList.add(\"dark-mode\")\n } \n}", "toggleDarkness() {\r\n if (this.state.darkness) {\r\n this.setAllVisible();\r\n this.setState({\r\n darkness: false\r\n })\r\n }\r\n else {\r\n this.checkVisible();\r\n this.setState({\r\n darkness: true\r\n })\r\n }\r\n }", "function ToggleDarkMode(forceDarkMode) {\n\t// if (forceDarkMode === null || forceDarkMode === undefined) {\n\t//forceDarkMode = false;\n\t// }\n\n\t//const userPrefersDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\n\t//const thisTheme = userPrefersDarkMode ? 'dark' : 'light';\n\n\tif (forceDarkMode == null) {\n\t\tforceDarkMode = true;\n\t}\n\n\tconst savedTheme = (localStorage.getItem('theme') == 'dark') ? 'dark' : 'light';\n\n\tvar lightModeIcon = document.getElementById(\"lightModeIcon\");\n\tvar darkModeIcon = document.getElementById(\"darkModeIcon\");\n\n\tif (forceDarkMode) {\n\t\tthisTheme = 'dark'; // the default when never saved is dark\n\t\tlightModeIcon.style.setProperty(\"display\", \"none\");\n\t\tdarkModeIcon.style.setProperty(\"display\", \"inline\");\n\t}\n\telse {\n\t\tthisTheme = 'light';\n\t\tlightModeIcon.style.setProperty(\"display\", \"inline\");\n\t\tdarkModeIcon.style.setProperty(\"display\", \"none\");\n }\n\tdocument.documentElement.style.setProperty(\"color-scheme\", thisTheme);\n\tlocalStorage.setItem('theme', thisTheme);\n\n\tdocument.body.classList.toggle(\"dark-theme\", forceDarkMode);\n\n\tToggleDarkModeItem('code', forceDarkMode);\n\tToggleDarkModeItem('pre', forceDarkMode);\n\tToggleDarkModeItem('nav', forceDarkMode);\n\tToggleDarkModeItem('table', forceDarkMode);\n\n\t//ToggleDarkModeItem('.highlighter-rouge', forceDarkMode);\n\tToggleDarkModeItem('.color-change', forceDarkMode);\n\tToggleDarkModeItem('.dropdown-content', forceDarkMode);\n\tToggleDarkModeItem('.logo-container', forceDarkMode);\n\tToggleDarkModeItem('.sidebar', forceDarkMode);\n\tToggleDarkModeItem('.authorbox', forceDarkMode); // class=\"authorbox\"\n\t// ToggleDarkModeItem('.active', forceDarkMode);\n\n\t//const divClasses = document.querySelectorAll('logo-container');\n\t//SafeToggleAll(divClasses, forceDarkMode);\n\n\t//if (!divClasses || divClasses === null || divClasses === undefined) {\n\t//\t// alert(\"No divClasses found! \");\n\t//}\n\t//else {\n\t//\tdivClasses.forEach(element => {\n\t//\t\tdivClasses.classList.toggle(\"dark-theme\", forceDarkMode);\n\t//\t});\n\t//}\n\t// set all custom <element> tages to dark mode\n\t// since the article element is customer (but does not have a dash in the name), we iterate all <element> tags:\n\t// see https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define (not used)\n\t//const articleClasses = document.querySelectorAll('article');\n\t//SafeToggleAll(articleClasses, forceDarkMode);\n\n\tToggleDarkModeItem('article', forceDarkMode);\n\n\t//if (!articleClasses || articleClasses === null || articleClasses === undefined) {\n\n\t//}\n\t//else {\n\t//\tarticleClasses.forEach(element => {\n\t//\t\telement.classList.toggle(\"dark-theme\", forceDarkMode);\n\t//\t});\n\t//}\n\n\t// const sidebarClasses = document.querySelectorAll('sidebar')\n\n\n\t// page should be in dark mode now\t\t\n}", "function toggleDarkness(){\n\t\n\tfor(var i=0; i<transformables.length; i++){\n\t\t$(transformables[i]).toggleClass(\"dark\");\n\t}\n}", "function switchTheme() {\n console.log('Dark mode switched');\n if (colors.darkMode.activated) {\n colors.darkMode.activated = false;\n colors.lightMode.activated = true;\n\n document.documentElement.style.setProperty(\n '--primaryColor',\n colors.lightMode.primaryColor\n );\n document.documentElement.style.setProperty(\n '--secondaryColor',\n colors.lightMode.secondaryColor\n );\n document.documentElement.style.setProperty(\n '--backgroundColor',\n colors.lightMode.backgroundColor\n );\n document.documentElement.style.setProperty(\n '--navbarColor',\n colors.lightMode.navbarColor\n );\n } else {\n colors.darkMode.activated = true;\n colors.lightMode.activated = false;\n\n document.documentElement.style.setProperty(\n '--primaryColor',\n colors.darkMode.primaryColor\n );\n document.documentElement.style.setProperty(\n '--secondaryColor',\n colors.darkMode.secondaryColor\n );\n document.documentElement.style.setProperty(\n '--backgroundColor',\n colors.darkMode.backgroundColor\n );\n document.documentElement.style.setProperty(\n '--navbarColor',\n colors.darkMode.navbarColor\n );\n }\n}", "function EnableDarknessTag() {}", "function setLightScheme() { /* exported setLightScheme */\n $(\"body\").removeClass(\"dark\").addClass(\"light\");\n $(\"#btnSettings\").attr(\"src\", AssetPaths.SETTINGS_LIGHT);\n}", "function enableDarkMode() {\n\n document.body.classList.remove('light-mode');\n // Adds the class to the body of the document.\n document.body.classList.add('dark-mode');\n // Sets darkModeState in localStorage to enabled\n localStorage.setItem('darkModeState', 'enabled');\n}", "function darkMode() {\n\n // Change current mode\n if (mode == \"dark\") {\n mode = \"light\";\n localStorage.setItem(\"mode\", \"light\");\n } else {\n\n mode = \"dark\";\n localStorage.setItem(\"mode\", \"dark\");\n }\n\n // Set new current mode\n setMode();\n\n}", "toggleDarKMode() {\n let body = document.querySelector(\"body\");\n body.classList.toggle(\"dark\");\n }", "function toggleMode() {\n let body = qs('body');\n let home = id('home');\n let dashboard = id('dashboard');\n let trophy = id('trophy');\n let logo = id('logo');\n let mode = id('mode');\n let help = id('help');\n if (isDarkMode) {\n body.classList.remove('dark-mode');\n home.src = \"img/awesome-home.png\";\n dashboard.src = \"img/material-dashboard.png\";\n trophy.src = \"img/ionic-md-trophy.png\";\n logo.src = \"img/draft-guru.png\";\n mode.src = \"img/awesome-cloud-moon.png\";\n help.src = \"img/ionic-ios-help-circle-outline.png\";\n } else {\n body.classList.add('dark-mode');\n home.src = \"img/awesome-home-dark.png\";\n dashboard.src = \"img/material-dashboard-dark.png\";\n trophy.src = \"img/ionic-md-trophy-dark.png\";\n logo.src = \"img/draft-guru-dark.png\";\n mode.src = \"img/awesome-sun.png\";\n help.src = \"img/ionic-ios-help-circle-outline-dark.png\";\n }\n isDarkMode = !isDarkMode;\n updateSound();\n }", "function DarkModeSwitchCheck() {\n if(localStorage.getItem(\"DarkMode\") === 'Enabled') {\n setDarkModeSwitch(true);\n } else {\n setDarkModeSwitch(false);\n }\n }", "function darkify() {\n $(\"body\").toggleClass(\"dark\");\n $(\"button\").toggleClass(\"dark-but\");\n $(\"a[href^='#']\").toggleClass(\"bib-link\");\n $(\"a[href^='#']\").toggleClass(\"dark-bib\");\n\n if ($(\"body\").hasClass(\"dark\")) {\n localStorage.setItem(\"dark\", \"true\");\n } else {\n localStorage.setItem(\"dark\", \"false\");\n }\n}", "function lightMode() {\n change(\n \"rgb(255 255 255 / 50%)\",\n \"rgb(0 0 0 / 50%)\",\n \"Light Mode\",\n \"fa-moon\",\n \"fa-sun\",\n \"img/undraw_proud_coder_light.svg\",\n \"img/undraw_feeling_proud_light.svg\",\n \"img/undraw_conceptual_idea_light.svg\"\n );\n \n}", "function updateDarkmode() {\n\t// Then toggle (add/remove) the .dark-theme class to the body\n\tlet darkmode = document.getElementById('darkmode').checked;\n\tif (darkmode) {\n\t\tlocalStorage.setItem(\"darkmode\", true);\n\t\tdarkmodeState = 'true';\n\t} else if (!darkmode) {\n\t\tlocalStorage.setItem(\"darkmode\", false);\n\t\tdarkmodeState = 'false';\n\t}\n\tdocument.body.classList.toggle('dark-theme');\n}", "function toggleDarkLight() {\r\n var body = document.getElementById(\"body\");\r\n var currentClass = body.className;\r\n body.className = currentClass == \"dark\" ? \"\" : \"dark\";\r\n}", "function toggleDarkTheme(shouldAdd) {\n document.body.classList.toggle(\"dark\", shouldAdd);\n}", "static light() {\n window.localStorage.setItem('colorScheme', 'light')\n this.#isDark = false;\n this.#applyScheme();\n }", "function checkDarkmode() {\n var darkmode = localStorage.getItem(\"darkmode\");\n if (darkmode == \"true\") {\n document.body.classList.toggle(\"dark-mode\");\n }\n}", "function toggleTheme() {\n if (localStorage.getItem('theme') === 'theme-dark') {\n setTheme('theme-light');\n setLabel('Light Mode');\n } else {\n setTheme('theme-dark');\n setLabel('Dark Mode');\n }\n}", "function toggleDarkTheme(shouldAdd) {\n document.body.classList.toggle('dark', shouldAdd);\n}", "function switchToDarkMode() {\n var darkModeStyleElement = document.getElementById(darkModeStylesNodeID);\n if (darkModeStyleElement == null) {\n var darkModeStyles = `\n body{color:#fff!important;}td,th{border:1px solid #222!important}a{color:#53c3ff!important}a:active,a:hover{color:#4aade3!important}h6{color:#BFBFBF!important}hr{border-bottom:1px solid #333!important}blockquote:before{color:#111!important}code{color:rgba(255,255,255,.75)!important}pre code{background-color:#000!important;color:#8C8C8C!important}kbd{color:#AAA!important;background-color:#030303!important;border:1px solid #333!important;border-bottom-color:#444!important;box-shadow:inset 0 -1px 0 #444!important}\n \n /* hljs */ .hljs{background:#1d1f21!important;color:#c5c8c6!important}.hljs span::selection,.hljs::selection{background:#373b41!important}.hljs span::-moz-selection,.hljs::-moz-selection{background:#373b41!important}.hljs-name,.hljs-title{color:#f0c674!important}.hljs-comment,.hljs-meta,.hljs-meta .hljs-keyword{color:#707880!important}.hljs-deletion,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol{color:#c66!important}.hljs-addition,.hljs-doctag,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-string{color:#b5bd68!important}.hljs-attribute,.hljs-code,.hljs-selector-id{color:#b294bb!important}.hljs-bullet,.hljs-keyword,.hljs-selector-tag,.hljs-tag{color:#81a2be!important}.hljs-subst,.hljs-template-tag,.hljs-template-variable,.hljs-variable{color:#8abeb7!important}.hljs-built_in,.hljs-builtin-name,.hljs-quote,.hljs-section,.hljs-selector-class,.hljs-type{color:#de935f!important}\n `;\n addStyleString(darkModeStyles, darkModeStylesNodeID);\n }\n}", "function darkOff() {\n cloudObject.div.classList.remove('dark');\n cloudObject.body.classList.remove('dark');\n cloudObject.form.classList.remove('dark');\n }", "async function toggle_theme()\n {\n if (is_using_dark_theme()) { apply_theme(\"light\"); }\n else { apply_theme(\"dark\"); }\n\n const configuration = await storage.load(storage.Key.Configuration);\n configuration.do_use_dark_theme = is_using_dark_theme();\n return storage.save(storage.Key.Configuration, configuration);\n }", "function modeToggle() {\r\n document.body.classList.toggle('darkMode');\r\n if (modeCurrent === \"lightMode\") {\r\n modeCurrent = \"darkMode\";\r\n document.getElementById('modeView').textContent = \"MODO DIURNO\";\r\n } else {\r\n modeCurrent = \"lightMode\";\r\n document.getElementById('modeView').textContent = \"MODO NOCTURNO\";\r\n }\r\n localStorage.setItem(\"modeCurrent\", modeCurrent);\r\n}", "function toggleTheme() {\n setTheme(theme === 'light' ? 'dark' : 'light');\n }", "function changeTheme(){\n if(DARK_MODE)\n $(\"body\").css(\"background-color\", \"#DCDCDC\");\n else\n $(\"body\").css(\"background-color\", \"#2e324c\");\n \n DARK_MODE = !DARK_MODE;\n}", "function toggleTheme() {\n $(\"#home\").toggleClass(\"is-dark\");\n //$(\"#home\").addClass(\"is-dark\");\n $(\"#about\").toggleClass(\"is-black\");\n //$(\"#about\").addClass(\"is-black\");\n //$(\"#blog\").removeClass(\"has-background-white-bis\");\n $(\"#blog\").toggleClass(\"is-dark\");\n $(\"#photos\").toggleClass(\"is-black\");\n $(\"article\").toggleClass(\"has-background-dark\");\n $(\".card-content\").toggleClass(\"text-color-invert\");\n $(\".content\").children(\"h4\").toggleClass(\"text-color-invert\");\n $(\".card\").toggleClass(\"has-background-dark\");\n $(\".tag\").toggleClass(\"is-dark\");\n}", "function switchToLightMode() {\n var darkModeStyleElement = document.getElementById(darkModeStylesNodeID);\n if (darkModeStyleElement != null) {\n darkModeStyleElement.parentElement.removeChild(darkModeStyleElement);\n }\n}", "function makeDark() {\n $(\"body\").addClass('make-dark');\n $(\"main\").addClass('make-dark');\n $(\".pmd-panel-headtext\").addClass('make-dark-01');\n $(\".pmd-w-library\").addClass('make-dark-02');\n $(\".pmd-banner\").addClass('make-dark-03');\n $(\".wName\").addClass('make-dark-01');\n $(\".pmd-hcolor-1\").addClass('make-dark-01');\n $(\".pmd-weather-desc\").addClass('make-weather-dark-01');\n $(\".pmd-username\").addClass('make-dark-01');\n $(\".pmd-dashboard\").addClass('make-dark-05');\n $(\".pmd-usermenu-lib-btn\").addClass('make-dark-01');\n $(\".pmd-banner-msg-01\").addClass('make-dark-07');\n $(\".pmd-tooltiptext\").addClass('make-dark-06');\n $(\".pmd-login\").addClass('make-dark-01');\n \n updateUserSettings(\"scenario\", \"dark\");\n }", "function darkMode() {\r\n\r\n if (!darkOn){\r\n console.log(\"Dark Mode On\");\r\n document.querySelector(\".container\").style.backgroundColor = \"black\";\r\n document.querySelector(\"button\").textContent = dark;\r\n \r\n let images = document.getElementsByClassName(\"neural_network\");\r\n for(let i = 0;i < images.length; i++){\r\n images[i].style.backgroundColor = \"#013220\";\r\n }\r\n\r\n darkOn = true;\r\n } else {\r\n console.log(\"Dark Mode Off\");\r\n document.querySelector(\".container\").style.backgroundColor = \"#c64756\";\r\n document.querySelector(\"button\").textContent = sunny;\r\n darkOn = false;\r\n\r\n let images = document.getElementsByClassName(\"neural_network\");\r\n for(let i = 0;i < images.length; i++){\r\n images[i].style.backgroundColor = \"\";\r\n }\r\n }\r\n}", "function btnDarkLightMode() {\n $(\".darkLightMode\").change(() => leerCheckboxDarkLightMode());\n}", "function toggleTheme() {\n document.documentElement.classList.toggle(\"dark-theme\");\n lupaImg.classList.toggle(\"invert\");\n for (let i = 0; i < clockImg.length; i++) {\n clockImg[i].classList.toggle(\"invert\");\n }\n}", "function toggleMode(event) {\n // Update the localStorage\n if (document.body.classList.value === 'light-theme') {\n localStorage.clear();\n localStorage.setItem('mode', 'dark-theme');\n localStorage.setItem('iconMode', 'fa-toggle-on');\n localStorage.setItem('iconText', 'Dark Mode');\n } else {\n localStorage.clear();\n localStorage.setItem('mode', 'light-theme');\n localStorage.setItem('iconMode', 'fa-toggle-off');\n localStorage.setItem('iconText', 'Light Mode');\n }\n // Update the display elements\n setSelectedTheme(localStorage.getItem('mode'), localStorage.getItem('iconMode'), localStorage.getItem('iconText'));\n}", "function changeMode(){\n if (currentTheme == \"light\") {\n document.body.classList.toggle(\"dark-mode\");\n var theme = document.body.classList.contains(\"dark-mode\") ? \"dark\" : \"light\";\n }else{\n document.body.classList.toggle(\"dark-mode\");\n var theme = document.body.classList.contains(\"dark-mode\") ? \"dark\" : \"light\";\n }\n\n localStorage.setItem(\"theme\", theme);\n}", "function disableDarkMode() {\n\n document.body.classList.remove('dark-mode');\n document.body.classList.add('light-mode');\n localStorage.setItem('darkModeState', 'disabled');\n}", "function dark() {\n if (document.body.className == \"light\") {\n document.body.classList.replace(\"light\", \"dark\")\n themeBTN.innerText = \"Light\"\n themeBTN.style.color = \"#F3F3F3\"\n } else {\n document.body.classList.replace(\"dark\", \"light\")\n themeBTN.innerText = \"Dark\"\n themeBTN.style.color = \"#000\"\n }\n}", "function darkMode() {\n $('#darkMode').hide()\n setTimeout(function () {\n $('#lightMode').fadeIn('50')\n }, 50)\n // Change background to Dark Color\n if ($('.main-container').hasClass('bg-light-slow')) {\n $('.main-container').removeClass('bg-light-slow')\n }\n $('.main-container').addClass('bg-dark-slow')\n\n if ($('#nav').hasClass('navbar-dark')) {\n $('#nav').removeClass('navbar-dark')\n }\n $('#nav').addClass('navbar-light bg-grey-slow')\n\n if ($('#searchBtn').hasClass('btn-outline-light')) {\n $('#searchBtn').removeClass('btn-outline-light')\n }\n $('#searchBtn').addClass('btn-outline-dark')\n\n if ($('#content-heading').hasClass('text-dark')) {\n $('#content-heading').removeClass('text-dark')\n }\n\n if ($('#user-icon').hasClass('text-white')) {\n $('#user-icon').removeClass('text-white')\n }\n $('#user-icon').addClass('text-dark')\n\n if ($('#home-icon').hasClass('text-white')) {\n $('#home-icon').removeClass('text-white')\n }\n $('#home-icon').addClass('text-dark')\n\n $('#body').css('background-image', 'none')\n}", "function darkModeBtn(args) {\n if(darkMode){\n if(largeTxt){\n var text = args.object;\n text.text = \"Disabled\"\n darkMode = false;\n application.setCssFileName(\"largeLight.css\");\n }\n else{\n var text = args.object;\n text.text = \"Disabled\"\n darkMode = false;\n application.setCssFileName(\"smallLight.css\");\n }\n }\n else{\n if(largeTxt){\n var text = args.object;\n text.text = \"Enabled\"\n darkMode = true;\n application.setCssFileName(\"app.css\");\n }\n else{\n var text = args.object;\n text.text = \"Enabled\"\n darkMode = true;\n application.setCssFileName(\"smallDark.css\");\n }\n }\n frameModule.topmost().navigate('settings/settings-page');\n}", "function darkMode() {\n switch (darkModeInput.checked) {\n case true:\n // html body color\n document.querySelector('body').style.backgroundColor = '#1C1026'\n // text title color\n for (let i = 0; i < titleColor.length; i++) {\n titleColor[i].style.color = 'white'\n }\n // text body color\n for (let i = 0; i < bodyColor.length; i++) {\n bodyColor[i].style.color = '#959595'\n }\n // dark mode icon\n darkModeIcon.innerHTML = '<i class=\"bi bi-moon\"></i>'\n // png elements color\n for (let i = 0; i < elementLogo.length; i++) {\n elementLogo[i].style.filter = 'initial'\n }\n // dark mode border\n for (let i = 0; i < darkBorder.length; i++) {\n darkBorder[i].style.backgroundColor = '#0F0717'\n }\n // bootstrap next and prev icon\n for (let i = 0; i < nextSlidesIcon.length; i++) {\n nextSlidesIcon[i].style.filter = 'initial'\n }\n for (let i = 0; i < prevSlidesIcon.length; i++) {\n prevSlidesIcon[i].style.filter = 'initial'\n }\n // bootstrap slides indicator\n for (let i = 0; i < slideIndicator.length; i++) {\n slideIndicator[i].style.backgroundColor = 'white'\n \n }\n\n break;\n \n \n case false:\n // html body color\n document.querySelector('body').style.backgroundColor = '#fdfdfd'\n // text title color\n for (let i = 0; i < titleColor.length; i++) {\n titleColor[i].style.color = '#3B4250'\n }\n // text body color\n for (let i = 0; i < bodyColor.length; i++) {\n bodyColor[i].style.color = '#8C92A3'\n }\n // dark mode icon\n darkModeIcon.innerHTML = '<i class=\"bi bi-sun\"></i>'\n // png elements color\n for (let i = 0; i < elementLogo.length; i++) {\n elementLogo[i].style.filter = 'invert(76%) sepia(23%) saturate(396%) hue-rotate(181deg) brightness(97%) contrast(94%)'\n }\n // dark mode border\n for (let i = 0; i < darkBorder.length; i++) {\n darkBorder[i].style.backgroundColor = 'white'\n }\n // bootstrap next and prev icon\n for (let i = 0; i < nextSlidesIcon.length; i++) {\n nextSlidesIcon[i].style.filter = 'invert(60%) sepia(14%) saturate(540%) hue-rotate(191deg) brightness(99%) contrast(91%)'\n }\n for (let i = 0; i < prevSlidesIcon.length; i++) {\n prevSlidesIcon[i].style.filter = 'invert(60%) sepia(14%) saturate(540%) hue-rotate(191deg) brightness(99%) contrast(91%)'\n }\n // bootstrap slides indicator\n for (let i = 0; i < slideIndicator.length; i++) {\n slideIndicator[i].style.backgroundColor = '#b7b7b7'\n \n }\n break;\n }\n}", "function DarkSwitch(){\n\t//Console Logging For Debugging\n\tconsole.log(RootDataSet.theme)\n\n\t//Changing Light Mode To Dark Mode\n\tif (RootDataSet.theme == \"undefined\" | RootDataSet.theme == \"\") {\n\t\twindow.RootDataSet.theme = \"dark\"\n\t\t//Setting Local Storage For The Future\n\t\tlocalStorage.setItem(\"Theme\", \"dark\")\n\t}else{\n\t\t//Changing Dark Mode To Light Mode\n\t\tif (RootDataSet.theme == \"dark\"){\n\t\t\twindow.RootDataSet.theme = \"\"\n\t\t\t//Removing Local Storage To Set to Light Mode\n\t\t\tlocalStorage.removeItem(\"Theme\")\n\t\t}else{\n\t\t\t//Hopefully This Never Happens\n\t\t\tconsole.log(`\n\t\t\t\tA Error Occured.\n\t\t\t\tBlame The Original Programmer.\n\t\t\t\tHe Can Be a Idiot\n\t\t\t`)\n\t\t}\n\t}\n}", "function toggleTheme() {\n if (localStorage.getItem('theme') === 'theme-dark'){\n setTheme('theme-light');\n alert('Activate Light Mode')\n } else {\n setTheme('theme-dark');\n alert('Activate Dark Mode')\n }\n}", "function switchButtons() {\n\t\t $darkThemeButton.toggleClass('hide');\n\t\t $lightThemeButton.toggleClass('hide');\n\t }", "function toggleTheme() {\r\n if (localStorage.getItem('theme') === 'theme_dark') {\r\n setTheme('theme_light');\r\n } else {\r\n setTheme('theme_dark');\r\n }\r\n}", "function switchTheme() {\n\n if (darkMode) {\n appBody.classList.add('dark')\n toggleThemeBtn.innerHTML = `<i class=\"far fa-moon\"></i>`\n } else {\n appBody.classList.remove('dark')\n toggleThemeBtn.innerHTML = `<i class=\"fas fa-sun\"></i>`\n }\n}", "function toggleTheme() {\n if (localStorage.getItem('theme') === 'theme-dark'){\n setTheme('theme-light');\n } else {\n setTheme('theme-dark');\n }\n setSwitchText();\n}", "function toggleTheme() {\n if (localStorage.getItem('theme') === 'theme-dark') {\n setTheme('theme-light');\n } else {\n setTheme('theme-dark');\n }\n}", "function toggleDarkMode() {\n var option = readCookie(\"darkmode\");\n var optionReverse = \"true\";\n var stylesheet = document.getElementById(\"sitestyle\");\n\n var styleName = \"/static/groundfloor/css/dark\";\n if (option === \"true\") {\n optionReverse = \"false\";\n styleName = \"/static/groundfloor/css/light\";\n }\n\n stylesheet.href = styleName + \".css\";\n createCookie(\"darkmode\", optionReverse);\n console.log(\"OPTION (SAVE): \" + optionReverse);\n}", "function switchLightDark() {\n const sunglassesButton = document.querySelector(\"#darkmode\");\n const containerEl = document.querySelector(\"#container\");\n const headerEl = document.querySelector(\"header\");\n const navTooltip = document.querySelectorAll(\"nav .tooltip\");\n const mainTooltip = document.querySelectorAll(\"main .tooltip\");\n sunglassesButton.addEventListener(\"click\", () => {\n containerEl.classList.toggle(\"activeSunglasses\");\n const activatedSunglasses = document.querySelector(\".activeSunglasses\");\n if (activatedSunglasses === null) {\n containerEl.style.backgroundColor = \"#fdfdfd\";\n headerEl.style.color = \"#363f4c\";\n navTooltip.forEach((tooltip) => {\n tooltip.style.backgroundColor = \"#fdfdfd\";\n tooltip.style.border = \"1px solid white\";\n });\n sunglassesButton.style.color = \"#202020\";\n mainTooltip.forEach((tooltip) => {\n tooltip.style.backgroundColor = \"#eed994\";\n tooltip.style.color = \"white\";\n tooltip.style.border = \"1px solid white\";\n });\n } else {\n containerEl.style.backgroundColor = \"#202020\";\n headerEl.style.color = \"#bcbcbc\";\n navTooltip.forEach((tooltip) => {\n tooltip.style.backgroundColor = \"#202020\";\n tooltip.style.border = \"none\";\n });\n sunglassesButton.style.color = \"pink\";\n mainTooltip.forEach((tooltip) => {\n tooltip.style.backgroundColor = \"#1C1C1C\";\n tooltip.style.color = \"#eed994\";\n tooltip.style.border = \"1px solid #eed994\";\n });\n }\n });\n}", "function toggleTheme() {\r\n if (localStorage.getItem('theme') === 'theme-dark') {\r\n setTheme('theme-light');\r\n } else {\r\n setTheme('theme-dark');\r\n }\r\n}", "toggleBackgroundColor(){\n if(this.props.windowStore.windowSettings.theme === \"dark\"){\n this.props.windowStore.windowSettings.theme = \"light\";\n } else {\n this.props.windowStore.windowSettings.theme = \"dark\";\n }\n }", "isDark() {\n return this.hasBackground ? !this.light : themeable.options.computed.isDark.call(this);\n }", "function toggleTheme(){\r\n if(localStorage.getItem(\"shala-theme\")!==null){\r\n if(localStorage.getItem(\"shala-theme\") === \"dark\"){\r\n $(\"body\").addClass(\"dark\");\r\n }\r\n else{\r\n $(\"body\").removeClass(\"dark\");\r\n }\r\n }\r\n updateIcon();\r\n}", "function toggleTheme() {\n if (localStorage.getItem('theme') === 'theme-dark'){\n setTheme('theme-light');\n } else {\n setTheme('theme-dark');\n }\n}", "static #applyScheme() {\n // Once done, we will the add or remove the \"dark\" class to the document.\n if (this.isDark()) {\n window.document.documentElement.classList.add('dark')\n } else {\n window.document.documentElement.classList.remove('dark')\n }\n }", "function checkTheme() {\n\tdarkModeToggle.addEventListener(\"change\", () => {\n\t\tsetTheme();\n\t});\n\tdarkModeToggle.checked = window.matchMedia(\n\t\t\"(prefers-color-scheme: dark)\"\n\t).matches;\n\tsetTheme(darkModeToggle.checked);\n}", "static #setSchemeFromBrowser() {\n this.#isDark = this.#getMedia().matches\n }", "function DarkMode() {\n const [theme, setTheme] = useState('dark');\n const toggleTheme = () => {\n if (theme === 'dark') {\n setTheme('light');\n } else {\n setTheme('dark');\n }\n }\n \n // Return the layout based on the current theme\n return (\n <ThemeProvider theme={theme === 'dark' ? darkTheme : lightTheme}>\n <>\n <GlobalStyles />\n <Toggle theme={theme} toggleTheme={toggleTheme} />\n </>\n </ThemeProvider>\n );\n}", "function onChangedSwitch() {\n if (localStorage.theme === Theme.LIGHT) {\n bodyRef.classList.replace(Theme.LIGHT, Theme.DARK);\n localStorage.setItem('theme', Theme.DARK);\n } else {\n bodyRef.classList.replace(Theme.DARK, Theme.LIGHT);\n localStorage.setItem('theme', Theme.LIGHT);\n }\n}", "function darkenize() {\n this.dark_theme_attribute = [\n {'type': 'background', 'value': 'background-color'}, \n {'type': 'text', 'value': 'color'}, \n {'type': 'border', 'value': 'border-bottom-color'}, \n {'type': 'border', 'value': 'border-top-color'}, \n {'type': 'border', 'value': 'border-left-color'}, \n {'type': 'border', 'value': 'border-right-color'}\n ];\n\n this.color_preset = {\n 'text': {'threshold': 1, 'control': 2, 'flag': 'lt'},\n 'background': {'threshold': 0.4, 'control': 0.2, 'flag': 'gt'},\n 'border': {'threshold': 0.3, 'control': 1.4, 'flag': 'gt'}\n };\n\n // svg?\n this.stop_elem = [\n 'meta',\n 'head',\n 'link',\n 'script',\n 'style',\n 'title',\n 'svg',\n 'pre',\n 'input'\n ];\n this.dynamic_coloring = false;\n // this.brightness_threshold = ;\n // this.brightness_control = ;\n}", "function is_using_dark_theme() { return localStorage.getItem(\"theme\") === \"dark\"; }", "function toggleTheme(){\n theme.addEventListener(\"click\", function(){\n root = document.documentElement;\n if(getComputedStyle(root, null).getPropertyValue(\"--header_bg\") == \"hsl(0, 0%, 100%)\"){\n root.style.setProperty(\"--header_bg\", \"hsl(209, 23%, 22%)\");\n root.style.setProperty(\"--body_bg\", \"hsl(207, 26%, 17%)\");\n root.style.setProperty(\"--text_col\", \"hsl(0, 0%, 100%)\");\n root.style.setProperty(\"--shadow\", \"hsl(210,17%,15%)\");\n root.style.setProperty(\"--info_text_col\", \"hsl(209, 9%, 91%)\");\n this.parentElement.innerHTML = \"<i class=\\\"fas fa-sun theme\\\"></i> White Mode\";\n }else{\n root.style.setProperty(\"--header_bg\", \"hsl(0, 0%, 100%)\");\n root.style.setProperty(\"--body_bg\", \"hsl(0, 0%, 98%)\");\n root.style.setProperty(\"--text_col\", \"hsl(200, 15%, 8%)\");\n root.style.setProperty(\"--shadow\", \"#f3f3f3\");\n root.style.setProperty(\"--info_text_col\", \"hsl(205, 23%, 22%)\");\n this.parentElement.innerHTML = \"<i class=\\\"far fa-moon theme\\\"></i> Dark Mode\";\n }\n theme = document.querySelector(\".theme\");\n toggleTheme();\n });\n}", "function toggleTheme() {\n\tlet d = document.documentElement,\n\t\t\tm = localStorage.getItem(\"theme\")\n\n\tif (m === 'dark') {\n\t\td.classList.add('theme-dark')\n\t} \n\n\tif (d.classList.contains(\"theme-dark\")) {\n\t\td.classList.remove(\"theme-dark\")\n\t\tlocalStorage.removeItem(\"theme\")\n\t} else {\n\t\td.classList.add(\"theme-dark\")\n\t\tlocalStorage.setItem(\"theme\", \"dark\")\n\t}\n}", "function carouselSwitchColorDark(element){\r\n element.style.color = 'black';\r\n element.style.transition = 'all 0.6s';\r\n element.style.textShadow = '';\r\n}", "function lightMode() {\n $('#lightMode').fadeOut(50)\n setTimeout(function () {\n $('#darkMode').fadeIn('50')\n }, 50)\n\n // Background photo for light mode\n $('#body').css('background-image', 'url(\"/../assets/hypnotize.png\")')\n\n if ($('.main-container').hasClass('bg-dark-slow')) {\n $('.main-container').removeClass('bg-dark-slow')\n }\n $('.main-container').addClass('bg-light-slow')\n\n if ($('#nav').hasClass('navbar-light bg-grey-slow')) {\n $('#nav').removeClass('navbar-light bg-grey-slow')\n }\n $('#nav').addClass('navbar-dark bg-dark-slow')\n\n if ($('#searchBtn').hasClass('btn-outline-dark')) {\n $('#searchBtn').removeClass('btn-outline-dark')\n }\n $('#searchBtn').addClass('btn-outline-light')\n $('#content-heading').addClass('text-dark')\n\n if ($('#user-icon').hasClass('text-dark')) {\n $('#user-icon').removeClass('text-dark')\n }\n $('#user-icon').addClass('text-white')\n\n if ($('#home-icon').hasClass('text-dark')) {\n $('#home-icon').removeClass('text-dark')\n }\n $('#home-icon').addClass('text-white')\n}", "function themeToggle() {\r\n var body = document.body\r\n var newClass = body.className == 'dark-mode' ? 'light-mode' : 'dark-mode'\r\n body.className = newClass\r\n var endDate = new Date();\r\n endDate.setFullYear(endDate.getFullYear() + 10);\r\n if ((mediaQuery.matches)){\r\n if(document.body.scrollTop > 80 || document.documentElement.scrollTop > 80) {\r\n $(\"#logo\").css(\"color\", \"rgb(255,44,90)\"); \r\n $(\"header\").css(\"box-shadow\",\"0% 0% 20% rgba(0,0,0)\");\r\n if (document.body.classList.contains(\"dark-mode\")) {\r\n $(\"header\").css(\"background\",\"rgb(13, 0, 3)\");\r\n $(\"#navigation a\").css(\"color\",\"#fff\");\r\n } else {\r\n $(\"#header\").css(\"background\",\"#fff\");\r\n $(\"#navigation a\").css(\"color\",\"#000\");\r\n } \r\n }else{\r\n $(\"#logo\").css(\"color\", \"transparent\");\r\n $(\"header\").css(\"background\",\"transparent\");\r\n $(\"header\").css(\"box-shadow\",\"0% 0% 0% rgba(0,0,0,0)\");\r\n if (document.body.classList.contains(\"dark-mode\")) {\r\n $(\"#navigation a\").css(\"color\",\"#fff\");\r\n } else {\r\n $(\"#navigation a\").css(\"color\",\"#fff\");\r\n } \r\n }\r\n }\r\n\r\n document.cookie = 'theme=' + (newClass == 'light-mode' ? 'light' : 'dark') +\r\n '; Expires=' + endDate + ';'\r\n console.log('Cookies are now: ' + document.cookie)\r\n }", "function applyNight() {\n\tdocument.documentElement.setAttribute(\"data-theme\", \"night\");\n\tlocalStorage.setItem(\"data-theme\", \"night\");\n\t$(document).find(\".toggler\").find(\".far\").removeClass(\"fa-sun\").removeClass(\"fa-star\").addClass(\"fa-moon\");\n\t$(document).find(\".navbar\").removeClass(\"navbar-light\").addClass(\"navbar-dark\");\n}", "function changeThemefrom(dark, htmlElement) {\r\n if (dark === true) {\r\n htmlElement.forEach((element) => element.classList.remove(\"light\"));\r\n htmlElement.forEach((element) => element.classList.add(\"dark\"));\r\n }\r\n if (dark === false) {\r\n htmlElement.forEach((element) => element.classList.remove(\"dark\"));\r\n htmlElement.forEach((element) => element.classList.add(\"light\"));\r\n }\r\n}", "function toggleTheme() {\n\n if (localStorage.getItem('theme') === 'theme-dark') {\n setTheme('theme-light');\n favicon.href = \"assets/images/0.png\";\n } else {\n setTheme('theme-dark');\n favicon.href = \"assets/images/1.png\";\n }\n}", "checkEnvironmentDarkModestatus(RoKAContainer) {\n let bodyBackgroundColour = window.getComputedStyle(document.body, null).getPropertyValue('background-color');\n let bodyBackgroundColourArray = bodyBackgroundColour.substring(4, bodyBackgroundColour.length - 1).replace(/ /g, '').split(',');\n let bodyBackgroundColourAverage = 0;\n for (let i = 0; i < 3; i += 1) {\n bodyBackgroundColourAverage = bodyBackgroundColourAverage + parseInt(bodyBackgroundColourArray[i], 10);\n }\n bodyBackgroundColourAverage = bodyBackgroundColourAverage / 3;\n if (bodyBackgroundColourAverage < 100) {\n RoKAContainer.classList.add(\"darkmode\");\n }\n else {\n RoKAContainer.classList.remove(\"darkmode\");\n }\n }", "function darkify(option) {\n const temp = document.getElementById(\"current-temp-data\");\n const description = document.getElementById(\"main-description\");\n const name = document.getElementById(\"city-name\");\n const conditions = document.getElementById(\"main-conditions\")\n\n if (option == \"dark\") {\n temp.classList.add(\"dark\");\n conditions.classList.add(\"dark\");\n name.classList.add(\"dark\");\n description.classList.add(\"dark\")\n } else {\n temp.classList.remove(\"dark\");\n conditions.classList.remove(\"dark\");\n name.classList.remove(\"dark\");\n description.classList.remove(\"dark\")\n }\n}", "function darkmode() {\n if (document.cookie == \"darkmode=true\") {\n document.body.classList.add(\"darkmode\");\n document.getElementsByTagName(\"input\")[0].classList.add(\"darkmode\");\n console.log(\"yep\");\n document.getElementsByTagName(\"input\")[1].classList.add(\"darkmode\");\n var lever = document.getElementsByClassName(\"lever\");\n for (let index = 0; index < lever.length; index++) {\n const element = lever[index];\n element.classList.add(\"darkmodeLever\");\n }\n } else {\n document.body.classList.remove(\"darkmode\");\n document.getElementsByTagName(\"input\")[0].classList.remove(\"darkmode\");\n document.getElementsByTagName(\"input\")[1].classList.remove(\"darkmode\");\n var lever = document.getElementsByClassName(\"lever\");\n for (let index = 0; index < lever.length; index++) {\n const element = lever[index];\n element.classList.remove(\"darkmodeLever\");\n }\n }\n}", "function switchTheme(e) {\n if (e.target.checked) {\n localStorage.setItem('theme', 'dark');\n document.documentElement.setAttribute('data-theme', 'dark');\n toggleSwitch.checked = true;\n } else {\n localStorage.setItem('theme', 'light');\n document.documentElement.setAttribute('data-theme', 'light');\n toggleSwitch.checked = false;\n }\n }", "function setSchwarz() {\n\n document.body.classList.add(\"dark-mode\");\n var buttons = document.getElementsByTagName('button');\n for (var i = 0; i < buttons.length; i++) {\n var button = buttons[i];\n button.classList.add(\"dark-mode\");\n }\n\n\n\n\n}", "function switchBackground(){\r\n document.body.classList.toggle(\"light-mode\");\r\n}", "function switch_theme() {\n console.log(\"Here\");\n const body = document.getElementById('Stage');\n\n if (body.classList.contains('t--light')) {\n body.classList.remove('t--light');\n body.classList.add('t--dark');\n } else {\n body.classList.remove('t--dark');\n body.classList.add('t--light');\n }\n}", "toggleTutorial() {\n if(this.wonGameStatus == false) {\n document.getElementById(\"dark-bg\").classList.toggle(\"d-none\");\n }\n }", "function setWeiss() {\n\n document.body.classList.remove(\"dark-mode\");\n var buttons = document.getElementsByTagName('button');\n for (var i = 0; i < buttons.length; i++) {\n var button = buttons[i];\n button.classList.remove(\"dark-mode\");\n }\n\n}", "activateDarkTheme() {\n this._reset();\n this.body.attr('data-leftbar-theme', 'dark');\n }" ]
[ "0.84616953", "0.8129085", "0.8016781", "0.79827464", "0.7975249", "0.7968222", "0.7950376", "0.78114796", "0.7756468", "0.7754838", "0.77537996", "0.77292204", "0.7726408", "0.77197534", "0.77127844", "0.76787525", "0.7653037", "0.7635363", "0.7607333", "0.759638", "0.7591043", "0.7569224", "0.7561003", "0.7543489", "0.7517206", "0.75119776", "0.75115377", "0.7501881", "0.74977326", "0.745899", "0.7455462", "0.7422074", "0.7390388", "0.73757845", "0.7315177", "0.7268831", "0.72420436", "0.7225594", "0.7220935", "0.72042704", "0.71876824", "0.7184064", "0.71748525", "0.7165314", "0.7156856", "0.71483916", "0.71079904", "0.7107573", "0.71035707", "0.70901", "0.7053679", "0.70499", "0.7046098", "0.7044245", "0.70323247", "0.7030221", "0.70281506", "0.7005059", "0.69942504", "0.6989267", "0.69879556", "0.698719", "0.69848925", "0.6982729", "0.69384825", "0.6907177", "0.690708", "0.6881685", "0.68755424", "0.6868787", "0.6867208", "0.6853746", "0.6829136", "0.682813", "0.6826589", "0.6808387", "0.67884743", "0.6788088", "0.67850614", "0.6773444", "0.6757279", "0.67505103", "0.6746314", "0.67233866", "0.67177093", "0.6705167", "0.6677388", "0.6658859", "0.66585404", "0.66413397", "0.6629324", "0.66275", "0.6623849", "0.66203535", "0.66196847", "0.66165966", "0.6603851", "0.6603144", "0.65928", "0.6591717" ]
0.8071145
2
Read file sync sugar.
function rfs(file) { return fs.readFileSync(path.join(__dirname, file), 'utf-8').replace(/\r\n/g, '\n'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readSync(description, options) {\n var file = vfile$7(description);\n file.contents = fs$a.readFileSync(path$9.resolve(file.cwd, file.path), options);\n return file\n}", "read() {\n return fs.readFileSync(this.filepath).toString();\n }", "function read(file) {\n var complete = fs.readFileSync(file, 'utf8')\n return complete\n}", "readFileTextSync() {\n\t\t\treturn ___R$$priv$project$rome$$internal$path$classes$AbsoluteFilePath_ts$fs.readFileSync(\n\t\t\t\tthis.join(),\n\t\t\t\t\"utf8\",\n\t\t\t);\n\t\t}", "_reading(path) {\n\t\tconst readResult = new Promise((resolve, reject) => {\n\t\t\tfs.stat(path, (error, file) => {\n\t\t\t\tresolve(file);\n\t\t\t\treject(error);\n\t\t\t});\n\t\t});\n\t\treturn readResult;\n\t}", "function readFileSync(archivo){\n\tvar data = fs.readFileSync(archivo);\n\tconsole.log(data.toString());\n}", "_read () {\n let { filename } = this\n return new Promise((resolve, reject) =>\n fs.readFile((filename), (err, content) => err ? reject(err) : resolve(content))\n ).then(JSON.parse)\n }", "async read(filepath) {\n try {\n return await this.reader(filepath, 'utf-8');\n } catch (error) {\n return undefined;\n }\n }", "readin () {\n this.content = readFile(this.path);\n }", "async readInternally() {\n const allFiles = await getPathsFromSpecs(this.pathSpecs);\n debug('Read files %o', allFiles);\n const promises = allFiles.map(async(file) => {\n const fileContent = await this.readFile(file);\n return {\n file,\n content: fileContent,\n };\n });\n return Promise.all(promises);\n\n }", "static readFile(evt, {path=null}){\n // must have file name\n if(!path){\n let err = \"No file name provided (path is null).\";\n IpcResponder.respond(evt, \"file-read\", {err});\n return;\n }\n\n // read file promise \n FileUtils.readFile(path)\n .then(str => {\n // got file contents \n // file name with forward slashes always\n let pathClean = path.replace(/\\\\/g, \"/\"); \n IpcResponder.respond(evt, \"file-read\", {path, pathClean, str});\n\n // update folder data\n FolderData.update({recentFilePaths: [path], lastFilePath: path});\n })\n .catch(err => {\n // error\n IpcResponder.respond(evt, \"file-read\", {err: err.message});\n });\n }", "async function read(name) {\n const data = await fs.readFile(name, 'binary')\n return new Buffer.from(data)\n}", "static async readFile(path) {\n return (await Util.promisify(Fs.readFile)(path)).toString('utf-8');\n }", "function readFileSync(url, options = {}) {\n url = Object(_file_aliases__WEBPACK_IMPORTED_MODULE_2__[\"resolvePath\"])(url);\n if (!_utils_globals__WEBPACK_IMPORTED_MODULE_0__[\"isBrowser\"] && _node_read_file_sync_node__WEBPACK_IMPORTED_MODULE_1__[\"readFileSync\"]) {\n return _node_read_file_sync_node__WEBPACK_IMPORTED_MODULE_1__[\"readFileSync\"](url, options);\n }\n return Object(_read_file_browser__WEBPACK_IMPORTED_MODULE_3__[\"readFileSyncBrowser\"])(url, options);\n}", "function ReadFile(path)\n{\n\treturn _fs.readFileSync(path, \"utf8\").toString();\n}", "function read(f)\n\t{\n\t\tt = fs.readFileSync(f, 'utf8', (err,txt) => {\n\t\t\tif (err) throw err;\n\t\t});\n\t\treturn t;\n\t}", "static readFile(path) {\n path = pathHelper.resolve(path);\n logger.debug('Checking data file: ' + path);\n\n return fs.readFileSync(path, 'utf8');\n }", "read() {\n return readFileAsync(\"db/db.json\", \"utf8\");\n }", "function readfile(path)\r\n{\r\n return fs.readFileSync(path,'UTF8',function(data,err)\r\n {\r\n if(err) throw err;\r\n return data\r\n });\r\n}", "function read(f)\n{\n t = fs.readFileSync(f, 'utf8', (err,txt) => {\n if (err) throw err;\n });\n return t;\n}", "async function readFile(path) {\n\treturn new Promise((resolve, reject) => {\n\t\tfs.readFile(path, 'utf8', function (err, data) {\n\t\t\tif (err) {\n\t\t\t\treject(err)\n\t\t\t}\n\t\t\tresolve(data)\n\t\t})\n\t})\n}", "function readFile(file_path) {\n return fs.readFileSync(file_path, 'utf8', function(err, data) { \n if (err) throw err;\n console.log(data);\n });\n}", "getContents() {\n return _fs.default.readFileSync(this.filePath, \"utf8\");\n }", "function readFiles() {\n return fs.readdirAsync(pathPrevDir);\n}", "async read() {\n if (this.options.refresh) return null;\n if (this.options.disable) return null;\n\n const cacheExists = await pathExists(this.options.filepath);\n if (cacheExists) {\n console.log('reading json...');\n const data = await readJson(this.options.filepath);\n return data;\n }\n\n return null;\n }", "function readFileAsync$2(path, options) {\n return new Promise((resolve, reject) => fs.readFile(path, options, (err, data) => {\n if (err) {\n reject(err);\n }\n resolve(data);\n }));\n}", "read() {\n return readFileAsync(\"./db/db.json\", \"utf8\");\n }", "read(path, cb) {\n\t\tconst promise = Path.normalizePath(path).then((path) => this.adapter.read(path));\n\n\t\tif (cb) {\n\t\t\tpromise.nodeify(cb);\n\t\t}\n\n\t\treturn promise;\n\t}", "readFile(path_to_file) {\n return new Promise((resolve, reject) => {\n let result = [],\n line_reader = readline.createInterface({\n input : fs.createReadStream(__dirname + path_to_file)\n })\n line_reader.on('line', (line) => {\n result.push(line)\n })\n line_reader.on('close', () => {\n resolve(result)\n })\n })\n }", "async readFile(fileName) {\n const bytes = await this.idb.get(fileName, this.store);\n return bytes;\n }", "async read (filepath, options = {}) {\n try {\n let buffer = await this._readFile(filepath, options);\n return buffer\n } catch (err) {\n return null\n }\n }", "read(offset, length, cb) {\n if (!this._fd) {\n return this._open((err) => {\n return err ? cb(err) : this.read(offset, length, cb);\n });\n }\n const buff = new Buffer(length);\n return fs.read(this._fd, buff, 0, length, offset, (err, bytes, buff) => {\n return cb(err, buff);\n });\n }", "read() {\r\n return new Promise((resolve, reject) => {\r\n fs.readFile(this.file, \"utf-8\", (err, data) => {\r\n if (err) {\r\n reject(err);\r\n }\r\n try {\r\n this.notes = JSON.parse(data);\r\n } catch (e) {\r\n return reject(e);\r\n }\r\n return resolve(this.notes);\r\n });\r\n });\r\n }", "function readFileText(name,callback){\n process.nextTick(function () {\n var content=fs.readFileSync(name)\n callback(content.toString())\n })\n}", "function read(path, offset, len, buf, fh, cb) {\n\tconsole.log(\"read(path, offset, len, buf, fh, cb)\");\n\tvar err = 0; // assume success\n\tlookup(connection, path, function(info) {\n\t\t\tvar file = info;\n\t\t\tvar maxBytes;\n\t\t\tvar data;\n\n\t\t\tswitch (file.type) {\n\t\t\tcase 'undefined':\n\t\t\terr = -2; // -ENOENT\n\t\t\tbreak;\n\n\t\t\tcase 'folder': // folder\n\t\t\terr = -1; // -EPERM\n\t\t\tbreak;\n\n\t\t\tcase 'file': // a string treated as ASCII characters\n\t\t\t\t\tconsole.log(info);\n\t\t\ttmp.tmpName(function (err, path) {\n\t\t\t\t\tif (err) cb(err);\n\t\t\t\t\tconnection.getFile(file.id, null, path, function (error) {\n\t\t\t\t\t\t\tif (error) cb(error);\n\t\t\t\t\t\t\tfs.open(path, \"r\", function (error, fd) {fs.read(fd, buf, 0, len, offset, cb);});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\tbreak;\n\t\t\t}\n\t\t\tcb(err);\n\t});\n}", "async function getFile(name) {\n return new Promise(res => {\n fs.readFile(name, 'utf-8', (err, result) => {\n res(result);\n });\n });\n}", "function read_file(path_to_file){\n var data = fs.readFileSync(path_to_file).toString();\n return data;\n}", "fileCall(path) {\n var fileStream = require('fs');\n var f = fileStream.readFileSync(path, 'utf8');\n return f;\n // var arr= f.split('');\n // return arr;\n }", "function readStream(path, options, callback) {\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n if (!callback) return readStream.bind(this, path, options);\n \n var entry, emit;\n \n getFS().root.getFile(path, {}, function (fileEntry) { \n entry = fileEntry;\n callback(null, { read: fileRead, abort: fileAbort });\n }, errorHandlerTodo);\n \n function fileRead(readCallback) {\n if (!file) {\n return readCallback();\n }\n if (emit) {\n return readCallback(new Error(\"Only one read at a time\"));\n }\n emit = callback;\n entry.file(function (file) {\n var reader = new FileReader();\n reader.onprogress = function() {\n console.log('progress:'+ reader.result.length);\n };\n });\n reader.readAsArrayBuffer(); \n }\n \n function fileAbort(callback) {\n file = null;\n callback();\n }\n \n function errorHandler(error) {\n console.log(\"FS Error:\"+error);\n callback(error);\n }\n}", "function do_read() {\n var buf = buffer.slice(offset, offset + length);\n libjs.readAsync(fd, buf, function (res) {\n if (res < 0)\n callback(Error(formatError(res, 'read')));\n else\n callback(null, res, buffer);\n });\n }", "function read_file(name){\n const fs = require('fs');\n if(!fs.existsSync(name))\n return(undefined);\n try {\n const data = fs.readFileSync(name, 'utf8')\n return(data);\n } catch (err) {\n console.error(err);\n return(undefined);\n }\n}", "function readFile() {\n return fs.readFileSync(fileName);\n}", "read() {}", "function loadSync(filename, encoding = 'utf8') {\n return fs.readFileSync(filename, encoding);\n}", "async function readFile(path: string) {\n return new Promise<string>((resolve, reject) => {\n fs.readFile(path, {encoding: 'utf-8'}, (err, data) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(data);\n });\n });\n}", "read() {\n return JSON.parse(\n new File(this.path).read()\n );\n }", "getReadStream(fileId, file){\n throw new Error('getReadStream is not implemented');\n }", "async read(...args) {\n //console.log('File.read', ...args);\n if (this.mode == 'w' || this.mode == 'a') {\n error = `can't read in ${this.mode == 'w' ? 'write' : 'append'}-only mode`;\n return undefined;\n }\n const fmt = args[0];\n let s = storage[this.key].slice(this.offset);\n if (fmt == 'a') {\n this.offset += s.length;\n return s;\n } else if (s.length == 0) {\n return null; // eof\n } else if (fmt == undefined || fmt == 'l' || fmt == 'L') {\n let i = s.indexOf('\\n');\n if (i != -1) {\n (fmt == 'L') ? i++ : this.offset++;\n s = s.slice(0, i);\n }\n this.offset += s.length;\n return s;\n } else if (fmt == 'n') {\n // TODO this needs a better parser: more formats, eat prefix\n let m = /^([ \\n]*)/.exec(s);\n if (m) {\n this.offset += m[0].length;\n s = s.slice(m[0].length)\n }\n m = /^([-]?[0-9]+(?:[.][0-9]+)?)/.exec(s);\n if (m == null)\n m = /^([-]?[.][0-9]+)/.exec(s);\n if (m == null) {\n error = 'not a number';\n return null;\n }\n s = m[0];\n this.offset += s.length;\n return parseFloat(s);\n } else if (typeof(fmt) == 'number') {\n // TODO \"bad argument #1 to 'read' (number has no integer representation)\"\n const n = parseInt(fmt);\n s = s.slice(0, n);\n this.offset += s.length;\n return s;\n } else {\n error = 'bad format specifier';\n return undefined;\n }\n // POSIX returns 0 but string is more useful\n }", "function getFileContents(filename){\r\n\t\r\n\tvar contents;\r\n\tcontents = fs.readFileSync(filename);\r\n\treturn contents;\r\n}", "readFile (filepath, callback) {\n let option = {encoding: this.encoding, flag: 'r'}\n fs.readFile(filepath, option, (err, data) => {\n callback(err, data)\n })\n }", "function readstat(path){\n return new Promise((resolve, reject)=>{\n fs.stat(path,(err, fileStat)=>{\n if(err){\n reject(err);\n }else{\n resolve(fileStat);\n }\n })\n })\n}", "function read$3(description, options, callback) {\n var file = vfile$6(description);\n\n if (!callback && typeof options === 'function') {\n callback = options;\n options = null;\n }\n\n if (!callback) {\n return new Promise(executor)\n }\n\n executor(resolve, callback);\n\n function resolve(result) {\n callback(null, result);\n }\n\n function executor(resolve, reject) {\n var fp;\n\n try {\n fp = path$8.resolve(file.cwd, file.path);\n } catch (error) {\n return reject(error)\n }\n\n fs$9.readFile(fp, options, done);\n\n function done(error, res) {\n if (error) {\n reject(error);\n } else {\n file.contents = res;\n resolve(file);\n }\n }\n }\n}", "async readFileIV(path){\n const isValid = await this.doesLocalPathExists(path);\n if(isValid){\n const isFile = await this.isLocalPathOfFile(path);\n if(isFile){\n let contents = Buffer.from(\"\");\n for await(let chunk of fs.createReadStream(path, { start: 0, end: 34, highWaterMark: 34, })){\n contents = Buffer.concat([contents, chunk]);\n }\n\n if(!contents){ return null; }\n if(contents.length === 0){ return null; }\n\n let readable = contents.toString();\n let regex = /\\(([^)]+)\\)/;\n let match = readable.match(regex);\n\n if(!match){ return null; }\n if(match.length < 1){ return null; }\n if(match[1].length < 32){ return null; } // 32 = len of hex, +2 for '(' hex ')'. < 32 for match\n\n return match[1];\n }\n }\n\n return null;\n }", "_read() {}", "_read() {}", "readFile() {\n return fileRead('db/db.json', 'utf8');\n }", "function readFile(filename, flag) {\n return new Promise(function (complete, reject) {\n fsx.readFile(filename, function (error, data) {\n if (error) {\n reject(error);\n return;\n }\n complete(data);\n });\n });\n}", "readall() {\n let obj = this.read();\n while (!this.done()) obj = this.read();\n return obj;\n }", "function read(path, offset, len, buf, fd, callback) {\n var file = files[fd];\n if (!file) return -EINVAL;\n var blob = file.blob;\n var length = Math.max(len, blob.length);\n blob.copy(buf, 0, offset, length);\n callback(length);\n }", "function readFileAsync (file, options) {\n return new Promise(function (resolve, reject) {\n fs.readFile(file, options, function (err, data) {\n if (err) {\n reject(err)\n } else {\n resolve(data)\n }\n })\n })\n}", "function Retrieval(id) {\n this._id = id;\n this._fullPath = getFilePath(this._id);\n\n fs.ReadStream.apply(this, [this._fullPath]);\n}", "async function readFile(...args) {\n const p = new Promise((resolve, reject) => {\n fs.readFile(...args, (err, data) => {\n if (err) {\n return reject(err);\n }\n resolve(data);\n });\n });\n return p;\n}", "async function readFile(...args) {\n const p = new Promise((resolve, reject) => {\n fs.readFile(...args, (err, data) => {\n if (err) {\n reject(err);\n }\n resolve(data);\n });\n });\n return p;\n}", "function createReaderSync()\n{\n return new FileReaderSync();\n}", "function readFile(filePath, fmt) {\n return new Promise((resolve, reject) =>\n fs.readFile(filePath, fmt || 'utf8', (err, results) =>\n err ? reject(err) : resolve(results))\n );\n}", "function readFile(file) {\n return fetch(file).then(function (response) {\n return response.text();\n });\n }", "function read() {\n fs.readFile(\"random.txt\", \"utf8\", function (err, data) {\n if (err) {\n return console.log(err);\n }\n console.log(data);\n song(data);\n });\n}", "function readFile( filename ){\n return fs.readFileSync( path.join(dbFolder(), filename)).toString();\n }", "function read_file(filepath, cb) {\n var param = { fsid: fsid, path: filepath };\n ajax(service_url.read, param, function(err, filecontent, textStatus, jqXHR) {\n if (err) return cb(err);\n if (jqXHR.status != 200) {\n var msg;\n switch (jqXHR.status) {\n case 404:\n msg = lang('s0035'); break;\n case 406:\n msg = lang('s0036'); break;\n case 400:\n msg = lang('s0037'); break;\n default:\n msg = 'Code ' + jqXHR.status +' -- '+ textStatus;\n }\n return cb(new Error(lang('s0038')+ ': '+ filepath+ ', '+ msg));\n }\n var mimetype = jqXHR.getResponseHeader('Content-Type');\n var uptime = jqXHR.getResponseHeader('uptime');\n cb(null, filecontent, uptime, mimetype);\n });\n }", "function file_read(file, callback=null) {\n $.ajax({\n url: file,\n success: callback\n });\n}", "async function readFiles() {\n let firstSentence = await promisifiedReadfile('./file.txt', 'utf-8')\n let secondSentence = await promisifiedReadfile('./file2.txt', 'utf-8')\n console.log(firstSentence, secondSentence)\n}", "read () {\n\t\tObject.assign(this, this.status()\n\t\t\t.reduce(\n\t\t\t\t(config, file) => file.exists ?\n\t\t\t\t\tObject.assign(readJsonOrReturnObject(file.path), config) :\n\t\t\t\t\tconfig,\n\t\t\t\t{}));\n\t}", "readFile(filePath) {\n return fs.readFileSync(path.resolve(filePath));\n }", "function readFile(path) {\n return new Promise((resolve, reject) => {\n fs.readFile(path, (error, data) => error ? reject(error) : resolve(data));\n })\n}", "read() {\n return readFileAsync(\"db/db.json\", \"utf8\"); // shows the notes from the database json file (db.json)\n }", "async readSaveFile(filePath) {\n // Read file\n const data = await fs2.readFileAsync(filePath);\n\n this.onDataChange(data);\n this.onPathChange(filePath);\n }", "function loadSync(filename, encoding = 'utf8') {\n return readFileSync(filename, encoding);\n}", "function read(path,method) {\n method = method || 'readAsText';\n return file(path).then(function(fileEntry) {\n return new Promise(function(resolve,reject){\n fileEntry.file(function(file){\n var reader = new FileReader();\n reader.onloadend = function(){\n resolve(this.result);\n };\n reader[method](file);\n },reject);\n });\n });\n }", "function readFile(file) {\n return fs.readFileSync(file, \"utf8\");\n}", "function readFile(fileEntry) {\n\n // Get the file from the file entry\n fileEntry.file(function (file) {\n \n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n\n reader.onloadend = function() {\n\n console.log(\"Successful file read: \" + this.result);\n console.log(\"file path: \" + fileEntry.fullPath);\n\n };\n\n }, onError);\n}", "async load() {\n try {\n this.buf = await fsPromises.readFile(this.path);\n } catch (err) {\n let newErr = new Error('Failed to read the file: ' + err.message);\n if (err.code) newErr.code = err.code;\n throw newErr;\n }\n }", "readFile(mfs, file) {\n try {\n return mfs.readFileSync(path.join(this.confClient.output.path, file), \"utf-8\")\n } catch (error) {}\n }", "static readFile(filepath, callback) {\n fs.readFile(filepath, function (err, data) {\n if (err)\n logger.warn(\"Error in reading file \", filepath, \" , error code: \", err.code, \", error message: \", err.message);\n callback(!err, data);\n }.bind(this));\n }", "function rFile (file) {\n fs.readFile(file, 'utf8', function (err, data) {\n if (err) {\n return console.log(err);\n }\n console.log(data);\n });\n}", "function readFile() {\n return new Promise((resolve, reject) => {\n fs.readFile(SOURCE, {\n encoding: 'utf-8'\n }, (err, data) => {\n if (err) {\n reject(err);\n // puts the callback given to the .catch in the Promise pending callbacks queue\n } else {\n resolve(data);\n // puts the callback given to the first .then, in the Promise pending callbacks queue\n }\n });\n });\n}", "function readFileFunction() {\n fs.readFile(name, 'utf8', (err, data) => {\n if (err) {\n // try to reading file up to maxTryCount\n tryCount++;\n if (tryCount >= attr.maxTryCount) {\n // error callback\n callback(true, null);\n clearInterval(tmrId);\n isReceiving = false;\n }\n return;\n }\n \n // Exception handling when json parsing\n var cbErr = false;\n try {\n var jsonData = JSON.parse(data); \n }\n catch (e) { \n cbErr = true; \n }\n\n // data callback\n callback(cbErr, jsonData);\n clearInterval(tmrId);\n\n // delete file\n /*\n fs.unlink(name, err => {\n if (err) throw err;\n });\n */\n\n isReceiving = false;\n }); \n }", "async function getFile(id) {\n var file = await db.readDataPromise('file', { id: id })\n return file[0];\n}", "function readFile(filename){\n return new Promise(function(resolve,reject){\n fs.readFile(filename,'utf8',function(err,data){\n err?reject(err):resolve(data);\n });\n })\n}", "function read(path, method) {\n method = method || 'readAsText';\n return file(path).then(function (fileEntry) {\n return new Promise(function (resolve, reject) {\n fileEntry.file(function (file) {\n var reader = new FileReader();\n reader.onloadend = function () {\n resolve(this.result);\n };\n reader[method](file);\n }, reject);\n });\n });\n }", "function readFile(file) {\n return new Promise((resolve, reject) => {\n let chunks = [];\n // Create a readable stream\n let readableStream = fs.createReadStream(file);\n \n readableStream.on('data', chunk => {\n chunks.push(chunk);\n });\n\n readableStream.on('error', err => {\n reject(err)\n })\n \n return readableStream.on('end', () => {\n resolve(chunks);\n });\n });\n}", "function readFile(fileEntry) {\n // Get the file from the file entry\n fileEntry.file(function (file) { \n // Create the reader\n var reader = new FileReader();\n reader.readAsText(file);\n reader.onloadend = function() {\n console.log(\"Successful file read: \" + reader.result);\n document.getElementById('dataObj').innerHTML = reader.result;\n console.log(\"file path: \" + fileEntry.fullPath);\n };\n });\n }", "readFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (evt) => {\n if(evt && evt.target) {\n resolve(evt.target.result);\n }\n reject();\n };\n reader.readAsDataURL(file);\n });\n }", "function read() {\n\tvar data = JSON.parse(fs.readFileSync('db/db.json', 'utf-8'));\n\treturn data;\n}", "readFromFile(fileName) {\n const fs = require(\"fs\");\n try {\n const data = fs.readFileSync(\"uploads/\" + fileName, \"utf8\");\n console.log(data);\n return data;\n } catch (err) {\n console.error(err);\n }\n }", "function readFile (fullpath){\n\tvar result=\"\";\n\t$.ajax({\n\t\turl: fullpath,\n\t\tasync: false,\n\t\tdataType: \"text\",\n\t\tsuccess: function (data) {\n\t\t\tresult = data;\n\t\t}\n\t});\n\treturn result;\n}", "function readFile (file) {\n var str = fs.readFileSync(file, 'utf-8');\n console.log(str);\n}", "_read () {}", "_read () {}", "_read () {}", "async readStreamCache () {\n\t\tconst mtime = this.monitorStatus.cacheMtime;\n\t\tif (this.cacheMtime == mtime) {\n\t\t\treturn;\n\t\t}\n\t\tconst files = await FsUtil.readDirectory (this.cacheDataPath);\n\t\tthis.items = files.filter ((file) => {\n\t\t\treturn (App.systemAgent.getUuidCommand (file) == SystemInterface.CommandId.StreamItem);\n\t\t});\n\t\tthis.itemChoices = [ ];\n\t\tthis.cacheMtime = mtime;\n\t}", "function read(target, relative, raw) {\n if (relative) {\n target = path(target);\n }\n return _fs2.default.readFileSync(target).toString();\n}" ]
[ "0.69490594", "0.6896892", "0.6763963", "0.67485386", "0.6700614", "0.6627718", "0.6594735", "0.6521301", "0.6518725", "0.6417753", "0.6417016", "0.64024264", "0.6371319", "0.63607115", "0.6340001", "0.62707806", "0.627049", "0.6213427", "0.61922956", "0.6188252", "0.61847955", "0.617798", "0.6166503", "0.6133078", "0.61253655", "0.6122558", "0.60910994", "0.6087591", "0.60807335", "0.6065756", "0.6050398", "0.6007703", "0.6006391", "0.5996937", "0.597254", "0.59722745", "0.59615475", "0.5954859", "0.5936479", "0.59211683", "0.59097874", "0.5906051", "0.588996", "0.58739674", "0.5868068", "0.5866533", "0.5866134", "0.5864692", "0.5862463", "0.58591026", "0.5857283", "0.5855489", "0.58492935", "0.5841541", "0.5841541", "0.5836238", "0.5826199", "0.5817152", "0.5811981", "0.58088315", "0.5806639", "0.5805532", "0.580347", "0.5796211", "0.5796093", "0.57751614", "0.5772373", "0.57695186", "0.5761627", "0.57601726", "0.57559025", "0.5736095", "0.5735207", "0.5728632", "0.5727112", "0.57234675", "0.57222927", "0.5714237", "0.57097363", "0.5701798", "0.56981564", "0.5697394", "0.56961423", "0.5680231", "0.5674753", "0.5673408", "0.5672803", "0.5668011", "0.56662387", "0.56640226", "0.56620127", "0.56501985", "0.56331325", "0.5626373", "0.5619487", "0.56194293", "0.56160027", "0.56160027", "0.56160027", "0.56080514", "0.56055087" ]
0.0
-1
get the schema from the input schema property
getSchema (input, build) { var parent = this.model.visual; // allow to specify the schema as an entry of // visuals object in the dashboard schema if (parent && parent !== this.model && isString(input)) { var schema = parent.getVisualSchema(input); if (schema) input = schema; } if (isString(input)) { return this.json(input).then(response => build(response.data)).catch(err => { warn(`Could not reach ${input}: ${err}`, err); }); } else return build(input); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "schema() {\n return this.field.schema;\n }", "get schema() {\r\n return this.i.schema;\r\n }", "get schema() {\n return this.config.schema;\n }", "get schemaInst(){\n let schemaInst = this.schemas.findOne({ \"jsonObject.properties.type.default\": { $eq: this.type } }).jsonObject;\n return schemaInst;\n }", "get convertedSchema() {\n let schema = {\n $schema: \"http://json-schema.org/schema#\",\n title: this.label,\n type: \"object\",\n required: [],\n properties: this.fieldsToSchema(this.fields),\n };\n return schema;\n }", "_getHaxJSONSchemaProperty(settings,target){return this.HAXWiring._getHaxJSONSchemaProperty(settings,target)}", "getSchema(keyRef) {\n let sch;\n while (typeof (sch = getSchEnv.call(this, keyRef)) == \"string\")\n keyRef = sch;\n if (sch === undefined) {\n const { schemaId } = this.opts;\n const root = new compile_1.SchemaEnv({ schema: {}, schemaId });\n sch = compile_1.resolveSchema.call(this, root, keyRef);\n if (!sch)\n return;\n this.refs[keyRef] = sch;\n }\n return (sch.validate || this._compileSchemaEnv(sch));\n }", "static _getRawSchema () {\n let schema = this.schema\n return schema\n }", "get schema() {\n return this.dialogSchema ? this.dialogSchema.schema : undefined;\n }", "static get schema() {\n return {};\n }", "function mapWithSchema(propertyName, schema, sourceValue) {\n\tvar schemaValue = schema[propertyName];\n\tif (schemaValue === Direct) {\n\t\treturn sourceValue;\n\t} else if (typeof schemaValue === 'function') {\n\t\treturn schemaValue.call(null, sourceValue);\n\t} else {\n\t\treturn schemaValue;\n\t}\n}", "function getSchema(schema, skipParsing) {\n return skipParsing ? schema : schemaParser.fromDomainSchema(schema);\n }", "get schema() { return this.config.content.esquemas[this.identificador].schemaName; }", "schema() { }", "function getSchemaProperty(schema, propName, defaultValue) {\n if (schema.hasOwnProperty(propName)) {\n return schema[propName];\n } else {\n return defaultValue;\n }\n}", "getSchemaXml() {\r\n return this.clone(SharePointQueryable, \"schemaxml\").get();\r\n }", "function getSchemaProperty(schema, propName, defaultValue) {\n if (Object.prototype.hasOwnProperty.call(schema, propName)) {\n return schema[propName];\n } else {\n return defaultValue;\n }\n}", "getHaxJSONSchema(type,haxProperties,target=this){return this.HAXWiring.getHaxJSONSchema(type,haxProperties,target)}", "function GetSchema()\r\n {\r\n try \r\n {\r\n var SchemaFile=FileSystem.OpenTextFile(GetCurrentFolder()+'Schema.json');\n var Schema=SchemaFile.ReadAll().replace(/export default /,'');\n SchemaFile.Close();\n return this.JSON.parse(Schema);\n }\r\n catch (e)\r\n {\r\n Log('GetSchema failed: '+e.name);\r\n }\r\n return;\r\n }", "function schema(schema_fn) {\n\t\treturn valid_schema(new schema_fn());\n\t}", "function traverseSchema(schema, path) {\n const ar = parsePath(path)\n let o = schema\n while (ar.length > 0) {\n const k = ar.shift()\n if (o && o._cvtProperties && o._cvtProperties[k]) {\n o = o._cvtProperties[k]\n } else {\n o = null\n break\n }\n }\n\n return o\n}", "function getSchema() { return messageSchema; }", "resolve(schema) {\n if (!schema) {\n return this\n }\n\n let path = this.get('reference').split('/').map(fragment => {\n return this._unescapeURIFragment(fragment)\n }).slice(1)\n\n let resolved\n if (schema instanceof Schema) {\n resolved = schema.getInSchema(path)\n }\n else if (\n schema instanceof Immutable.Record ||\n schema instanceof Immutable.Iterable\n ) {\n resolved = resolved.getIn(path)\n }\n else if (typeof schema === 'object') {\n resolved = path.reduce((resolution, fragment) => {\n if (typeof resolution === 'undefined') {\n return resolution\n }\n return resolution[fragment]\n }, schema)\n }\n\n\n if (!resolved) {\n return this\n }\n return this\n .set('resolved', true)\n .set('value', resolved)\n }", "get hostSchema() { return this.M._schema; }", "function isSingleProperty (schema) {\n\t if ('type' in schema) {\n\t return typeof schema.type === 'string';\n\t }\n\t return 'default' in schema;\n\t}", "createSchema() {\n this.schema = this.extensionManager.schema;\n }", "getSchemaTitle() {\n return this.schema.title || this.schema.description || this.schema.type\n }", "static get schema() {\n return {\n name: { type: 'string' },\n kit: { type: 'string' },\n }\n }", "setSchema(schema) {\n this.schema = schema;\n }", "setSchema(schema) {\n this.schema = schema;\n }", "function getSchema(callback) {\n fetch(questionsUrl)\n .then(response => response.json())\n .then(result => {\n schema = result;\n callback();\n })\n .catch((schema = []));\n}", "function isSingleProperty (schema) {\n if ('type' in schema) {\n return typeof schema.type === 'string';\n }\n return 'default' in schema;\n}", "function introspectionFromSchema(schema, options) {\n var optionsWithDefaults = _objectSpread({\n directiveIsRepeatable: true,\n schemaDescription: true\n }, options);\n\n var document = Object(_language_parser_mjs__WEBPACK_IMPORTED_MODULE_2__[\"parse\"])(Object(_getIntrospectionQuery_mjs__WEBPACK_IMPORTED_MODULE_4__[\"getIntrospectionQuery\"])(optionsWithDefaults));\n var result = Object(_execution_execute_mjs__WEBPACK_IMPORTED_MODULE_3__[\"execute\"])({\n schema: schema,\n document: document\n });\n !Object(_jsutils_isPromise_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(result) && !result.errors && result.data || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(0);\n return result.data;\n}", "function introspectionFromSchema(schema, options) {\n var optionsWithDefaults = _objectSpread({\n directiveIsRepeatable: true,\n schemaDescription: true\n }, options);\n\n var document = Object(_language_parser_mjs__WEBPACK_IMPORTED_MODULE_1__[\"parse\"])(Object(_getIntrospectionQuery_mjs__WEBPACK_IMPORTED_MODULE_3__[\"getIntrospectionQuery\"])(optionsWithDefaults));\n var result = Object(_execution_execute_mjs__WEBPACK_IMPORTED_MODULE_2__[\"executeSync\"])({\n schema: schema,\n document: document\n });\n !result.errors && result.data || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(0);\n return result.data;\n}", "function load_schema(typename) {\n var filename = SCHEMAS_DIR + '/' + typename + '.schema.json';\n return readJSONFile(filename).then(function (data) {\n return { filename: data.filename, schema: data.obj };\n });\n }", "function getSchema(request) {\n \n \n \n \n var fields = getFields(request).build();\n console.log(JSON.stringify(fields));\n console.log(fields.toString());\n //resetAuth();\n return { schema: fields };\n \n}", "function introspectionFromSchema(schema, options) {\n var optionsWithDefaults = _objectSpread({\n specifiedByUrl: true,\n directiveIsRepeatable: true,\n schemaDescription: true,\n inputValueDeprecation: true\n }, options);\n\n var document = (0, _parser.parse)((0, _getIntrospectionQuery.getIntrospectionQuery)(optionsWithDefaults));\n var result = (0, _execute.executeSync)({\n schema: schema,\n document: document\n });\n !result.errors && result.data || (0, _invariant.default)(0);\n return result.data;\n}", "function introspectionFromSchema(schema, options) {\n var optionsWithDefaults = _objectSpread({\n specifiedByUrl: true,\n directiveIsRepeatable: true,\n schemaDescription: true,\n inputValueDeprecation: true\n }, options);\n\n var document = (0, _parser.parse)((0, _getIntrospectionQuery.getIntrospectionQuery)(optionsWithDefaults));\n var result = (0, _execute.executeSync)({\n schema: schema,\n document: document\n });\n !result.errors && result.data || (0, _invariant.default)(0);\n return result.data;\n}", "static schema() {\n return null;\n }", "getSchemaConcept(resp) {\n const grpcRes = resp.getGetschemaconceptRes();\n return (grpcRes.hasNull()) ? null : this.conceptFactory.createConcept(grpcRes.getSchemaconcept());\n }", "function Schema_from_swagger(schema_content) {\n 'use strict';\n // use new\n\n this.resolve = (input_json_obj) => {\n //const schema = getSwaggerV2Schema(schema_content, '/default_endpoint')\n const schema = schema_content;\n const ok = schemaValidator(schema, input_json_obj);\n if (ok) {\n return input_json_obj;\n } else {\n throw new Error('mismatch: The constraint aspect of template failed');\n }\n };\n\n this.generate = (obj) => this.resolve(obj);\n}", "defineSchema() {\n\n }", "getElementsSchema(filename) {\n const config = this.getConfigFor(filename !== null && filename !== void 0 ? filename : \"inline\");\n const metaTable = config.getMetaTable();\n return metaTable.getJSONSchema();\n }", "getSchemas() {\n return {\n indices: this.getIndices(),\n mappings: this.getMappings()\n };\n }", "function introspectionFromSchema(schema, options) {\n var queryAST = Object(_language_parser__WEBPACK_IMPORTED_MODULE_3__[\"parse\"])(Object(_introspectionQuery__WEBPACK_IMPORTED_MODULE_1__[\"getIntrospectionQuery\"])(options));\n var result = Object(_execution_execute__WEBPACK_IMPORTED_MODULE_2__[\"execute\"])(schema, queryAST);\n !(!result.then && !result.errors && result.data) ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(0) : void 0;\n return result.data;\n}", "function grab () {\n var names = [].slice.call(arguments),\n complete = { schema: {} };\n\n names.forEach(function (name) {\n complete.path = [name],\n complete.schema = schema.properties[name];\n });\n return complete;\n}", "function subschemaBinding(prop){\n if (!this.schema || this.instance === undefined) return;\n var self = this\n , ret\n this.validate( function(schemas){\n ret = buildSubschema.call(self,schemas,prop);\n });\n return ret;\n}", "function getModelFromSchema(schema) {\n var data = {\n name: schema.id,\n schema: {}\n }\n\n var newSchema = {}\n var tmp = null\n _.each(schema.properties, function (v, propName) {\n if (v['$ref'] != null) {\n tmp = {\n type: Schema.ObjectId,\n ref: v['$ref']\n }\n } else {\n tmp = translateComplexType(v) //{}\n }\n newSchema[propName] = tmp\n })\n data.schema = new Schema(newSchema)\n return data\n}", "static get schema() {\n return {\n name: { type: 'string' },\n version: { type: 'string' },\n description: { type: 'string' },\n authors: { type: 'array' },\n }\n }", "getConfigurationSchema() {\n return configurationSchema;\n }", "static get schemaOptions () {\n return {}\n }", "function calcSchema( inSchema ) {\n var gbCols = cols.concat( aggCols );\n var gbs = new Schema( { columns: gbCols, columnMetadata: inSchema.columnMetadata } );\n\n return gbs;\n }", "static get jsonSchema () {\n return {\n type: 'object',\n required: ['name']\n };\n }", "validate (){\n const that = this;\n return this\n ._validate(this.swaggerInput)\n .then((dereferencedSchema) => {\n that.swaggerObject = dereferencedSchema;\n return that;\n });\n }", "_validate (schema){\n return SwaggerParser.validate(schema);\n }", "obtenerCampo(clave, entidad) {\n if(!entidad.customSchemas) return null;\n\n try {\n return entidad.customSchemas[this.schema][clave];\n }\n catch(error) { \n return undefined; \n }\n }", "resolve(schema) {\n if (!schema) {\n return this\n }\n\n let path = this.get('reference').split('/').map(fragment => {\n return this._unescapeURIFragment(fragment)\n }).slice(1)\n\n let resolved = schema.getInSchema(path)\n\n if (!resolved) {\n return this\n }\n return this\n .set('resolved', true)\n .set('value', resolved)\n }", "function loadTestSchema() {\n return urlGetObject(resolveUri(schemaUri, baseSchemaUri));\n}", "getHaxJSONSchemaType(inputMethod){return this.HAXWiring.getHaxJSONSchemaType(inputMethod)}", "function handlePropertyValue(schema, value, prop) {\n if (\n typeof value !== 'boolean' &&\n typeof value !== 'number' &&\n typeof value !== 'string'\n ) {\n return null\n }\n\n if (!handleProtocol(schema, value, prop)) {\n return null\n }\n\n if (schema.clobber.indexOf(prop) !== -1) {\n value = schema.clobberPrefix + value\n }\n\n return value\n}", "function resolveReference(ref, schema) {\n // 2 here is for #/\n var i, ref_path = ref.substr(2, ref.length),\n parts = ref_path.split(\"/\");\n for (i = 0; i < parts.length; i += 1) {\n schema = schema[parts[i]];\n }\n return schema;\n }", "function getSchema(version) {\n\n\t\tif (_.has(env.versions, version)) {\n\t\t\treturn env.versions[version];\n\t\t}\n\t\telse {\n\t\t\tvar v = Object.keys(env.versions).join(', ')\n\t\t\tthrow 'The requested API version ' + version + ' is not supported. Supported versions are ' + v;\n\t\t}\n\t}", "function isSchema(schema) {\n return Object(_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(schema, GraphQLSchema);\n}", "function isSchema(schema) {\n return Object(_jsutils_instanceOf_mjs__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(schema, GraphQLSchema);\n}", "function getSwaggerV2Schema(swagger_filecontent, swagger_pointname) {\n\n let swaggerjson = swagger_filecontent;\n // validate_data_static(swagger_pointname, ()=>'swagger_pointname missing: '+swagger_pointname);\n // let schema = lookupPathInJson(swaggerjson, ['paths', swagger_pointname, 'get', 'responses', '200', 'schema']);\n // let schema = swaggerjson.paths[swagger_pointname].get.responses['200'].schema;\n let schema = swaggerjson.paths[swagger_pointname].get.responses['200'].content['application/json'].schema;\n return schema;\n}", "function getObjectName(schemaProp) {\n var items = schemaProp.get('items');\n\n if (items) {\n return items.objectName;\n } else {\n return schemaProp.get('objectName');\n }\n}", "function parseSchema(subschema, out, fullPath) {\r\n subschema.eachPath(function (pathString, pathO) {\r\n\r\n var include = excludedPaths.indexOf(pathString) === -1;\r\n if (include && opt.includes != '*')\r\n include = includedPaths.indexOf(pathString) !== -1;\r\n\r\n if (include) {\r\n var type = getType(pathString, pathO.constructor.name);\r\n var defaultValue = false;\r\n //if( self.isInit(pathString) )\r\n defaultValue = self.get(pathString);\r\n\r\n function iterate(path, obj) {\r\n if (matches = path.match(/([^.]+)\\.(.*)/)) {\r\n var key = matches[1];\r\n if (!obj[key]) {\r\n // Humanize object title\r\n var sentenceCased = changeCase.sentenceCase(key);\r\n var titleCased = changeCase.titleCase(sentenceCased);\r\n obj[key] = {type: 'object', title: titleCased, properties: {}}\r\n }\r\n iterate(matches[2], obj[key].properties);\r\n } else {\r\n if (['string', 'date', 'boolean', 'number', 'object', 'image', 'gallery', 'geojson'].indexOf(type.type) >= 0) {\r\n obj[path] = {};\r\n if (_.isFunction(pathO.options.default)) {\r\n type.default = pathO.options.default();\r\n }\r\n if (defaultValue && opt.setDefaults) {\r\n pathO.options.default = defaultValue;\r\n if (type.type == 'date') {\r\n pathO.options.default = pathO.options.default.toISOString();\r\n }\r\n }\r\n // TODO: Check if fullpath is undefined. If it is, attach it to options\r\n if (fullPath) {\r\n pathO.arraypath = fullPath + '.' + pathString;\r\n }\r\n addCustomOptions(pathO);\r\n _.extend(obj[path], convertTypeOptions(type.type, pathO.options), type);\r\n } else if (type.type == 'array') {\r\n obj[path] = type;\r\n // Humanize array title\r\n var sentenceCased = changeCase.sentenceCase(path);\r\n var titleCased = changeCase.titleCase(sentenceCased);\r\n obj[path].title = titleCased;\r\n if (type.items.type == 'object') {\r\n // TODO: Pass to the the parseSchema the current path\r\n parseSchema(pathO.schema, obj[path].items.properties, pathO.path);\r\n } else {\r\n type = getType(pathString, pathO.caster.instance);\r\n\r\n if (_.isFunction(pathO.options.default)) {\r\n type.default = pathO.options.default();\r\n }\r\n if (defaultValue && opt.setDefaults) {\r\n pathO.options.default = defaultValue;\r\n if (type.type == 'date') {\r\n pathO.options.default = pathO.options.default.toISOString();\r\n }\r\n }\r\n _.extend(obj[path].items, convertTypeOptions(type.type, pathO.options.type[0]), type);\r\n\r\n }\r\n } else {\r\n console.log('unsupported type: ' + type.type);\r\n }\r\n }\r\n }\r\n\r\n iterate(pathString, out);\r\n }\r\n });\r\n }", "function loadTestSchema() {\n return eUtil.urlGetObject(eUtil.resolveUri(schemaUri, baseSchemaUri));\n}", "forPathArray(path) {\n return path\n .reduce((schema, pathEl) => {\n if (isNaN(pathEl) && pathEl !== '-') {\n return schema.properties[pathEl];\n }\n else {\n return schema.items;\n }\n }, this.schema);\n }", "get schema() {\n return this.makeSchema({\n // HACK: super should work. but schema is undefined on it\n // tslint:disable-next-line:no-any\n ...(super.schema || this.schema),\n mapWidth: {\n default: 32,\n min: 2,\n description: \"The width (in Tiles) for the game map to be \"\n + \"initialized to.\",\n },\n mapHeight: {\n default: 16,\n min: 2,\n description: \"The height (in Tiles) for the game map to be \"\n + \"initialized to.\",\n },\n });\n }", "function getDefinition(model, property){\n var item = model._definitions[property];\n if (item !== undefined){\n return typeof item === \"string\"\n ? model._definitions[item]\n : item;\n }\n}", "function isSchema(schema) {\n return Object(_jsutils_instanceOf__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(schema, GraphQLSchema);\n}", "getChildSchemas() {\n return self.gs\n .graphs.get(this.data.graphId)\n .selectAllWithType('RecordSchema')\n .filter(x => x.Base.SchemaRef == this.data.objectId);\n }", "function getObjectName(schemaProp) {\n\t var items = schemaProp.get('items');\n\t if (items) {\n\t return items.objectName;\n\t } else {\n\t return schemaProp.get('objectName');\n\t }\n\t }", "getSchemaXml() {\n return this.clone(ViewFields, \"schemaxml\")();\n }", "_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 }", "async function getTopLevelOneOfProperty(schema) {\n if (!schema.oneOf) {\n throw new Error('Schema does not have a requestBody oneOf property defined')\n }\n if (!(Array.isArray(schema.oneOf) && schema.oneOf.length > 0)) {\n throw new Error('Schema requestBody oneOf property is not an array')\n }\n // When a oneOf exists but the `type` differs, the case has historically\n // been that the alternate option is an array, where the first option\n // is the array as a property of the object. We need to ensure that the\n // first option listed is the most comprehensive and preferred option.\n const firstOneOfObject = schema.oneOf[0]\n const allOneOfAreObjects = schema.oneOf.every((elem) => elem.type === 'object')\n let required = firstOneOfObject.required || []\n let properties = firstOneOfObject.properties || {}\n\n // When all of the oneOf objects have the `type: object` we\n // need to display all of the parameters.\n // This merges all of the properties and required values.\n if (allOneOfAreObjects) {\n for (const each of schema.oneOf.slice(1)) {\n Object.assign(firstOneOfObject.properties, each.properties)\n required = firstOneOfObject.required.concat(each.required)\n }\n properties = firstOneOfObject.properties\n }\n return { properties, required }\n}", "convertSchemaToAjvFormat (schema) {\n if (schema === null) return\n\n if (schema.type === 'string') {\n schema.fjs_type = 'string'\n schema.type = ['string', 'object']\n } else if (\n Array.isArray(schema.type) &&\n schema.type.includes('string') &&\n !schema.type.includes('object')\n ) {\n schema.fjs_type = 'string'\n schema.type.push('object')\n }\n for (const property in schema) {\n if (typeof schema[property] === 'object') {\n this.convertSchemaToAjvFormat(schema[property])\n }\n }\n }", "postProcessgetHaxJSONSchema(schema) {\n schema.properties[\"__editThis\"] = {\n type: \"string\",\n component: {\n name: \"a\",\n properties: {\n id: \"cmstokenidtolockonto\",\n href: \"\",\n target: \"_blank\"\n },\n slot: \"Edit this view\"\n }\n };\n return schema;\n }", "function inferSchema(value){\n \n // we have no way of infering type names for objects\n // therefore we simply assign an incremental identifier to each new object we find\n const anonymousTypeName = anonymousTypeNameGenerator();\n\n // entry point of schema\n let rootType = Type.ObjectType(\"Root\");\n\n const queue = [];\n queue.push({path: [\"fields\", \"root\"], value:value});\n\n while(queue.length > 0){\n const descriptor = queue.pop();\n \n const type = inferType(descriptor.value);\n\n if(type.kind === \"SCALAR\"){\n // console.log(\"set in\", descriptor.path);\n rootType = rootType.setIn(descriptor.path, type);\n continue; \n }\n\n if(type.name === \"ListType\"){\n // console.log(\"set a list in\", descriptor.path);\n rootType = rootType.setIn(descriptor.path, type());\n const path = descriptor.path.concat(\"ofType\");\n\n // examine type of first item in list\n // TODO: examine more elements?\n queue.push({path:path, value: descriptor.value.get(0)});\n }\n\n if(type.name === \"ObjectType\"){\n // console.log(\"set an object in\", descriptor.path);\n const typeName = anonymousTypeName.next().value;\n rootType = rootType.setIn(descriptor.path, type(typeName));\n const path = descriptor.path.concat(\"fields\");\n const entries = descriptor.value.entries();\n // enumerate fields of Map\n for([fieldName, val] of entries){\n queue.push({path:path.concat(fieldName), value: val});\n } \n }\n }\n\n return rootType;\n}", "parseJSONSchema(json) {\r\n let type = json[\"@type\"];\r\n let i = type.indexOf(\"#\");\r\n if (i > 0)\r\n type = type.substring(0, i);\r\n let obj = this.createType(type);\r\n obj.parse(json);\r\n return obj;\r\n }", "function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it\nref // reference to resolve\n) {\n const p = this.opts.uriResolver.parse(ref);\n const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);\n let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined);\n // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests\n if (Object.keys(root.schema).length > 0 && refPath === baseId) {\n return getJsonPointer.call(this, p, root);\n }\n const id = (0, resolve_1.normalizeId)(refPath);\n const schOrRef = this.refs[id] || this.schemas[id];\n if (typeof schOrRef == \"string\") {\n const sch = resolveSchema.call(this, root, schOrRef);\n if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== \"object\")\n return;\n return getJsonPointer.call(this, p, sch);\n }\n if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== \"object\")\n return;\n if (!schOrRef.validate)\n compileSchema.call(this, schOrRef);\n if (id === (0, resolve_1.normalizeId)(ref)) {\n const { schema } = schOrRef;\n const { schemaId } = this.opts;\n const schId = schema[schemaId];\n if (schId)\n baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);\n return new SchemaEnv({ schema, schemaId, root, baseId });\n }\n return getJsonPointer.call(this, p, schOrRef);\n}", "static get jsonSchema() {\n return {\n type: \"object\",\n required: [\n \"user_id\",\n \"verified_by\",\n \"hospital\",\n \"address\",\n \"specialization\",\n \"license_number\",\n \"gender\",\n \"alt_email\",\n \"alt_phone\",\n ],\n\n properties: {\n id: { type: \"integer\" },\n user_id: { type: \"integer\" },\n verified_by: { type: \"integer\" },\n hospital: { type: \"string\", minLength: 1, maxLength: 255 },\n address: { type: \"string\", minLength: 1, maxLength: 255 },\n specialization: { type: \"string\", minLength: 1, maxLength: 255 },\n license_number: { type: \"string\", minLength: 1, maxLength: 255 },\n gender: { type: \"string\", minLength: 1, maxLength: 255 },\n alt_email: { type: \"string\", minLength: 3, maxLength: 255 },\n alt_phone: { type: \"string\", minLength: 11, maxLength: 11 },\n },\n };\n }", "function findDiscriminatorField(schema, options, property) {\n if (schema.properties?.[property]) {\n return schema.properties[property];\n }\n\n // I need to return early, so I can't .forEach, wish I could use a for-of loop!\n // eslint-disable-next-line no-plusplus\n for (let i = 0; i < options.length; i++) {\n const option = options[i];\n if (option.properties?.[property]) {\n return option.properties[property];\n }\n\n if (option.allOf?.[0]?.properties?.[property]) {\n return option.allOf[0].properties[property];\n }\n }\n\n return null;\n}", "function getSchemaValidator(ruleId, properties) {\n const $id = `rule/${ruleId}`;\n const cached = ajv$1.getSchema($id);\n if (cached) {\n return cached;\n }\n const schema = {\n $id,\n type: \"object\",\n additionalProperties: false,\n properties,\n };\n return ajv$1.compile(schema);\n}", "withSchema(schema) {\n return new QueryCreator({\n ...this.#props,\n executor: this.#props.executor.withPluginAtFront(new with_schema_plugin_js_1.WithSchemaPlugin(schema)),\n });\n }", "function validate(schema,obj){\n if (obj === undefined || !schema) return;\n var corr = schema.bind(obj)\n if (!corr.validate) return;\n var ret\n corr.once('error', function(err){ \n ret = err; \n });\n corr.validate();\n return ret;\n}", "function convertPatternProperties(schema) {\n\tschema['x-patternProperties'] = schema['patternProperties'];\n\tdelete schema['patternProperties'];\n\treturn schema;\n}", "parseJSONSchema(json) {\n let type = json[\"@type\"];\n let i = type.indexOf(\"://\");\n if (i > 0)\n type = type.substring(i + 3);\n i = type.indexOf(\"#\");\n if (i > 0)\n type = type.substring(0, i);\n switch (type) {\n case \"action-descriptor\":\n case \"https://\":\n return new ActionDescriptor(json);\n case \"realm-descriptor\":\n case \"https://realm...\":\n return new RealmDescriptor(json);\n case \"controller-descriptor\":\n case \"https://realm...\":\n return new RealmDescriptor(json);\n }\n throw new Error(\"unknown schema type: \" + type);\n }", "generateSchema() {\n const that = this;\n\n _.keys(this).forEach(function(k) {\n if (_.startsWith(k, '_')) {\n return;\n }\n\n // Normalize the type format\n that._schema[k] = normalizeType(that[k]);\n\n // Assign a default if needed\n if (isArray(that._schema[k].type)) {\n that[k] = that.getDefault(k) || [];\n } else {\n that[k] = that.getDefault(k);\n }\n });\n }", "static fromSchema(schema) {\n if (typeof schema === \"string\") {\n return AvroType.fromStringSchema(schema);\n }\n else if (Array.isArray(schema)) {\n return AvroType.fromArraySchema(schema);\n }\n else {\n return AvroType.fromObjectSchema(schema);\n }\n }", "static fromSchema(schema) {\n if (typeof schema === \"string\") {\n return AvroType.fromStringSchema(schema);\n }\n else if (Array.isArray(schema)) {\n return AvroType.fromArraySchema(schema);\n }\n else {\n return AvroType.fromObjectSchema(schema);\n }\n }", "function getCompilingSchema(schEnv) {\n for (const sch of this._compilations) {\n if (sameSchemaEnv(sch, schEnv))\n return sch;\n }\n}", "_bundle (schema){\n return SwaggerParser.bundle(schema);\n }", "static schema () {\n return {\n employeeNumber: joi.number().integer(),\n firstname: joi.string().alphanum().min(3).max(30).required(),\n lastname: joi.string().alphanum().min(3).max(30).required(),\n grade: joi.string().regex(/^[a-zA-Z0-9]{3}$/).required(),\n birthDate: joi.date().raw().required(),\n joinDate: joi.date().raw().required(),\n salary: joi.number().required(),\n email: joi.string().email()\n }\n }", "dynamic() {\n\t\tconst dynamicSchema = Object.keys(this.schema)\n\t\t\t.filter(key => this.field.includes(key))\n\t\t\t.reduce((obj, key) => {\n\t\t\t\tobj[key] = this.schema[key];\n\t\t\t\treturn obj;\n\t\t\t}, {});\n\t\t\t\n\t\tconst validate = Joi.object(dynamicSchema).validateAsync(this.fields);\n\t\treturn validate.then(() => {\n\t\t\treturn response({valid: true});\n\t\t}).catch(error => {\n\t\t\treturn response({invalid: true, message: joiError(error.toString())});\n\t\t})\n\t}", "get schemaConversion() {\n return (\n this.elementizer || {\n defaultSettings: {\n element: \"simple-fields-field\",\n errorProperty: \"errorMessage\",\n invalidProperty: \"invalid\",\n noWrap: true,\n attributes: {\n type: \"text\",\n },\n properties: {\n minLength: \"minlength\",\n maxLength: \"maxlength\",\n },\n },\n format: {\n radio: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"radio\",\n },\n properties: {\n options: \"options\",\n },\n child: {\n element: \"simple-fields-array-item\",\n noWrap: true,\n descriptionProperty: \"description\",\n properties: {\n previewBy: \"previewBy\",\n },\n },\n },\n },\n select: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"select\",\n },\n properties: {\n options: \"options\",\n items: \"itemsList\",\n },\n },\n },\n \"simple-picker\": {\n defaultSettings: {\n import: \"@lrnwebcomponents/simple-picker/simple-picker.js\",\n element: \"simple-picker\",\n attributes: {\n autofocus: true,\n justify: true,\n },\n properties: {\n options: \"options\",\n justify: \"justify\",\n },\n },\n },\n },\n type: {\n array: {\n defaultSettings: {\n element: \"simple-fields-array\",\n noWrap: true,\n descriptionProperty: \"description\",\n child: {\n element: \"simple-fields-array-item\",\n noWrap: true,\n descriptionProperty: \"description\",\n properties: {\n previewBy: \"previewBy\",\n sortable: true,\n },\n },\n },\n },\n boolean: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"checkbox\",\n value: false,\n },\n },\n },\n file: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"file\",\n },\n properties: {\n accepts: \"accepts\",\n },\n },\n },\n integer: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n step: 1,\n type: \"number\",\n },\n properties: {\n minimum: \"min\",\n maximum: \"max\",\n multipleOf: \"step\",\n },\n },\n },\n \"html-block\": {\n defaultSettings: {\n import:\n \"@lrnwebcomponents/simple-fields/lib/simple-fields-html-block.js\",\n element: \"simple-fields-html-block\",\n noWrap: true,\n attributes: {\n autofocus: false,\n required: false,\n },\n },\n },\n markup: {\n defaultSettings: {\n import:\n \"@lrnwebcomponents/simple-fields/lib/simple-fields-code.js\",\n element: \"simple-fields-code\",\n setValueProperty: \"editorValue\",\n noWrap: true,\n properties: {\n theme: \"theme\",\n },\n },\n format: {\n \"md-block\": {\n defaultSettings: {\n element: \"md-block\",\n setValueProperty: \"source\",\n noWrap: true,\n },\n },\n },\n },\n number: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n type: \"number\",\n attributes: {\n autofocus: true,\n type: \"number\",\n },\n properties: {\n minimum: \"min\",\n maximum: \"max\",\n multipleOf: \"step\",\n },\n },\n },\n object: {\n defaultSettings: {\n element: \"simple-fields-fieldset\",\n noWrap: true,\n },\n format: {\n tabs: {\n defaultSettings: {\n import:\n \"@lrnwebcomponents/simple-fields/lib/simple-fields-tabs.js\",\n element: \"simple-fields-tabs\",\n noWrap: true,\n child: {\n import:\n \"@lrnwebcomponents/simple-fields/lib/simple-fields-tab.js\",\n element: \"simple-fields-tab\",\n noWrap: true,\n labelSlot: \"label\",\n descriptionSlot: \"\",\n },\n properties: {\n layoutBreakpoint: \"layoutBreakpoint\",\n iconBreakpoint: \"iconBreakpoint\",\n sticky: \"sticky\",\n disableResponsive: this.disableResponsive,\n },\n },\n },\n collapse: {\n defaultSettings: {\n import:\n \"@lrnwebcomponents/a11y-collapse/lib/a11y-collapse-group.js\",\n element: \"a11y-collapse-group\",\n noWrap: true,\n child: {\n import: \"@lrnwebcomponents/a11y-collapse/a11y-collapse.js\",\n element: \"a11y-collapse\",\n noWrap: true,\n labelSlot: \"heading\",\n descriptionSlot: \"\",\n },\n attributes: {\n accordion: \"accordion\",\n },\n },\n },\n fields: {\n defaultSettings: {\n element: \"simple-fields\",\n noWrap: true,\n descriptionProperty: \"description\",\n properties: {\n schema: \"schema\",\n },\n },\n },\n },\n },\n string: {\n format: {\n alt: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n required: true,\n },\n },\n },\n color: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"color\",\n },\n },\n },\n colorpicker: {\n defaultSettings: {\n import:\n \"@lrnwebcomponents/simple-colors/lib/simple-colors-picker.js\",\n element: \"simple-colors-picker\",\n attributes: {\n autofocus: true,\n },\n },\n },\n combo: {\n defaultSettings: {\n import:\n \"@lrnwebcomponents/simple-fields/lib/simple-fields-combo.js\",\n element: \"simple-fields-combo\",\n noWrap: true,\n attributes: {\n autofocus: true,\n justify: true,\n },\n },\n properties: {\n autocomplete: \"autocomplete\",\n justify: \"justify\",\n },\n },\n date: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"date\",\n },\n },\n },\n \"date-time\": {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"datetime-local\",\n },\n },\n },\n date: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"date\",\n },\n },\n },\n email: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"email\",\n },\n },\n },\n fileupload: {\n defaultSettings: {\n import:\n \"@lrnwebcomponents/simple-fields/lib/simple-fields-upload.js\",\n element: \"simple-fields-upload\",\n noWrap: true,\n attributes: {\n autofocus: true,\n },\n },\n properties: {\n autocomplete: \"autocomplete\",\n },\n },\n iconpicker: {\n defaultSettings: {\n import:\n \"@lrnwebcomponents/simple-icon-picker/simple-icon-picker.js\",\n element: \"simple-icon-picker\",\n attributes: {\n autofocus: true,\n },\n properties: {\n options: \"icons\",\n exclude: \"exclude\",\n excludeSets: \"excludeSets\",\n includeSets: \"includeSets\",\n },\n },\n },\n month: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"month\",\n },\n },\n },\n textarea: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"textarea\",\n },\n },\n },\n time: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"time\",\n },\n },\n },\n uri: {\n defaultSettings: {\n element: \"simple-fields-field\",\n noWrap: true,\n attributes: {\n autofocus: true,\n type: \"file\",\n },\n },\n },\n url: {\n defaultSettings: {\n import:\n \"@lrnwebcomponents/simple-fields/lib/simple-fields-url-combo.js\",\n element: \"simple-fields-url-combo\",\n noWrap: true,\n attributes: {\n autofocus: true,\n justify: true,\n },\n properties: {\n autocomplete: \"autocomplete\",\n alwaysExpanded: \"alwaysExpanded\",\n displayAs: \"displayAs\",\n options: \"options\",\n },\n },\n },\n },\n },\n },\n }\n );\n }", "static get jsonSchema(){\n return {\n type: \"object\",\n required: [\"state_name\", \"country_id\"],\n properties: {\n id: { type: \"integer\" },\n state_name: { type:\"string\", minLength: 1, maxLength: 255},\n country_id: { type: \"integer\" }\n }\n }\n }", "function updateSchema() {\n var properties = {};\n var required = [];\n $scope.defaultValues = {};\n var schema = {\n type: \"object\",\n required: required,\n properties: properties\n };\n var inputClass = \"span12\";\n var labelClass = \"control-label\";\n //var inputClassArray = \"span11\";\n var inputClassArray = \"\";\n var labelClassArray = labelClass;\n var metaType = $scope.metaType;\n if (metaType) {\n var pidMetadata = Osgi.configuration.pidMetadata;\n var pid = metaType.id;\n schema[\"id\"] = pid;\n schema[\"name\"] = Core.pathGet(pidMetadata, [pid, \"name\"]) || metaType.name;\n schema[\"description\"] = Core.pathGet(pidMetadata, [pid, \"description\"]) || metaType.description;\n var disableHumanizeLabel = Core.pathGet(pidMetadata, [pid, \"schemaExtensions\", \"disableHumanizeLabel\"]);\n angular.forEach(metaType.attributes, function (attribute) {\n var id = attribute.id;\n if (isValidProperty(id)) {\n var key = encodeKey(id, pid);\n var typeName = asJsonSchemaType(attribute.typeName, attribute.id);\n var attributeProperties = {\n title: attribute.name,\n tooltip: attribute.description,\n 'input-attributes': {\n class: inputClass\n },\n 'label-attributes': {\n class: labelClass\n },\n type: typeName\n };\n if (disableHumanizeLabel) {\n attributeProperties.title = id;\n }\n if (attribute.typeName === \"char\") {\n attributeProperties[\"maxLength\"] = 1;\n attributeProperties[\"minLength\"] = 1;\n }\n var cardinality = attribute.cardinality;\n if (cardinality) {\n // lets clear the span on arrays to fix layout issues\n attributeProperties['input-attributes']['class'] = null;\n attributeProperties.type = \"array\";\n attributeProperties[\"items\"] = {\n 'input-attributes': {\n class: inputClassArray\n },\n 'label-attributes': {\n class: labelClassArray\n },\n \"type\": typeName\n };\n }\n if (attribute.required) {\n required.push(id);\n }\n var defaultValue = attribute.defaultValue;\n if (defaultValue) {\n if (angular.isArray(defaultValue) && defaultValue.length === 1) {\n defaultValue = defaultValue[0];\n }\n //attributeProperties[\"default\"] = defaultValue;\n // TODO convert to boolean / number?\n $scope.defaultValues[key] = defaultValue;\n }\n var optionLabels = attribute.optionLabels;\n var optionValues = attribute.optionValues;\n if (optionLabels && optionLabels.length && optionValues && optionValues.length) {\n var enumObject = {};\n for (var i = 0; i < optionLabels.length; i++) {\n var label = optionLabels[i];\n var value = optionValues[i];\n enumObject[value] = label;\n }\n $scope.selectValues[key] = enumObject;\n Core.pathSet(attributeProperties, ['input-element'], \"select\");\n Core.pathSet(attributeProperties, ['input-attributes', \"ng-options\"], \"key as value for (key, value) in selectValues.\" + key);\n }\n properties[key] = attributeProperties;\n }\n });\n // now lets override anything from the custom metadata\n var schemaExtensions = Core.pathGet(Osgi.configuration.pidMetadata, [pid, \"schemaExtensions\"]);\n if (schemaExtensions) {\n // now lets copy over the schema extensions\n overlayProperties(schema, schemaExtensions);\n }\n }\n // now add all the missing properties...\n var entity = {};\n angular.forEach($scope.configValues, function (value, rawKey) {\n if (isValidProperty(rawKey)) {\n var key = encodeKey(rawKey, pid);\n var attrValue = value;\n var attrType = \"string\";\n if (angular.isObject(value)) {\n attrValue = value.Value;\n attrType = asJsonSchemaType(value.Type, rawKey);\n }\n var property = properties[key];\n if (!property) {\n property = {\n 'input-attributes': {\n class: inputClass\n },\n 'label-attributes': {\n class: labelClass\n },\n type: attrType\n };\n properties[key] = property;\n if (rawKey == 'org.osgi.service.http.port') {\n properties[key]['input-attributes']['disabled'] = 'disabled';\n properties[key]['input-attributes']['title'] = 'Changing port of OSGi http service is not possible from Hawtio';\n }\n }\n else {\n var propertyType = property[\"type\"];\n if (\"array\" === propertyType) {\n if (!angular.isArray(attrValue)) {\n attrValue = attrValue ? attrValue.split(\",\") : [];\n }\n }\n }\n if (disableHumanizeLabel) {\n property.title = rawKey;\n }\n //comply with Forms.safeIdentifier in 'forms/js/formHelpers.ts'\n key = key.replace(/-/g, \"_\");\n entity[key] = attrValue;\n }\n });\n // add default values for missing values\n angular.forEach($scope.defaultValues, function (value, key) {\n var current = entity[key];\n if (!angular.isDefined(current)) {\n //log.info(\"updating entity \" + key + \" with default: \" + value + \" as was: \" + current);\n entity[key] = value;\n }\n });\n //log.info(\"default values: \" + angular.toJson($scope.defaultValues));\n $scope.entity = entity;\n $scope.schema = schema;\n $scope.fullSchema = schema;\n }", "function connect(schema) {\n _opts.url = schema + '.json';\n let _schema = {};\n _modelsPath = schema.replace('/_schemas', '/db/');\n\n if (h.isValidPath(schema + '.json')) {\n _schema.url = schema + '.json';\n _schema.content = require(_schema.url);\n _self._schema = _schema;\n if (_schema.content) {\n _self = loadCollections(_schema.content, _self);\n }\n\n return _self;\n } else {\n throw new Error(`The schema url:\n [${_opts.url}]\ndoes not seem to be valid. Recheck the path and try again`);\n }\n}" ]
[ "0.7211741", "0.711485", "0.69107157", "0.66971755", "0.6697095", "0.6539067", "0.65277135", "0.6463078", "0.632423", "0.63088834", "0.6304039", "0.6233824", "0.61852", "0.61667234", "0.60908985", "0.6089416", "0.6078091", "0.6016687", "0.6012065", "0.60017973", "0.59301436", "0.5864008", "0.5850684", "0.57706547", "0.57592493", "0.5741841", "0.57049793", "0.5694438", "0.5688247", "0.5688247", "0.56781435", "0.5670915", "0.56680757", "0.56638134", "0.56521887", "0.56443787", "0.56375474", "0.56375474", "0.56322175", "0.5582515", "0.5566555", "0.5565058", "0.5545507", "0.55412817", "0.5536565", "0.55295837", "0.55273515", "0.55095977", "0.55073357", "0.5493222", "0.5486018", "0.54347557", "0.54210645", "0.5417181", "0.5385768", "0.53855765", "0.5369189", "0.5353703", "0.53488857", "0.53215754", "0.53050846", "0.52992755", "0.5283003", "0.5283003", "0.5255885", "0.52402145", "0.52392846", "0.52367043", "0.5223287", "0.51975644", "0.519485", "0.5186749", "0.5176999", "0.51648337", "0.51624584", "0.5156784", "0.51560175", "0.51487714", "0.51463467", "0.5145835", "0.514449", "0.51274157", "0.51118207", "0.5106791", "0.50898755", "0.50828665", "0.50707716", "0.5069579", "0.5065123", "0.50474733", "0.50353456", "0.50353456", "0.50330496", "0.5029646", "0.50161815", "0.5013771", "0.49993885", "0.49992394", "0.4990372", "0.4982737" ]
0.61835736
13
build the visual component has the schema available
build () {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create () {\n const self = this\n\n self.applyPlugins('before-create', self)\n\n self.applyPluginsAsyncWaterfall('schema', self.options.schema, function(err, value) {\n if (err) {\n console.error('get schema failed ', err)\n return\n }\n\n self.applyPlugins('schema-loaded', value)\n\n if (value && value.length > 0) { // build from schema list\n self.buildControls(value)\n self.render()\n }\n })\n }", "getSchema (input, build) {\n var parent = this.model.visual;\n\n // allow to specify the schema as an entry of\n // visuals object in the dashboard schema\n if (parent && parent !== this.model && isString(input)) {\n var schema = parent.getVisualSchema(input);\n if (schema) input = schema;\n }\n\n if (isString(input)) {\n return this.json(input).then(response => build(response.data)).catch(err => {\n warn(`Could not reach ${input}: ${err}`, err);\n });\n }\n else return build(input);\n }", "function buildDatGui() {\n // dat.gui:\n guiProperties = new GUIProperties();\n gui = new dat.GUI();\n gui.width += 150;\n\n // assemble geometry types to build the geometry drop-down\n var geometryTypes = [];\n for (var type in geometries)\n geometryTypes.push( type );\n\n var generalFolder = gui.addFolder( CONSTANTS.GENERAL_PROPERTIES );\n var modelController = generalFolder.add(guiProperties, 'model', geometryTypes);\n modelController.onChange(function( type ) {\n // remove mesh, create new and add to scene\n createMesh( type );\n\n // re-build geometry folder with new properties\n removeFolder( gui, CONSTANTS.GEOMETRY_PROPERTIES );\n createGeometryFolder();\n });\n\n // assemble shader types to build the shader drop-down\n var shaderTypes = [ CONSTANTS.STRIPE, CONSTANTS.CHECKER, CONSTANTS.BRICK ];\n var shaderController = generalFolder.add(guiProperties, 'shader', shaderTypes);\n shaderController.onChange(function( type ) {\n // set the new material (global):\n setFragmentShader( type )\n createMaterial( type );\n\n // remove mesh, create new and add to scene\n createMesh( guiProperties.model );\n\n // re-build geometry folder with new properties\n removeFolder( gui, CONSTANTS.SHADER_PROPERTIES );\n createShaderFolder();\n\n removeFolder( gui, CONSTANTS.GEOMETRY_PROPERTIES );\n createGeometryFolder();\n });\n\n var meshFolder = gui.addFolder( CONSTANTS.MESH_PROPERTIES );\n meshFolder.add(guiProperties, 'scaleX', 0, 100).listen();\n meshFolder.add(guiProperties, 'scaleY', 0, 100).listen();\n meshFolder.add(guiProperties, 'scaleZ', 0, 100).listen();\n var scaleController = meshFolder.add(guiProperties, 'scale', 0, 100);\n scaleController.onChange(function(value) {\n guiProperties.scaleX = guiProperties.scaleY = guiProperties.scaleZ = value;\n });\n\n generalFolder.open();\n meshFolder.open();\n\n createShaderFolder();\n createGeometryFolder();\n}", "function buildUI(){\t\n\t\t\n\t\treturn;\n\t\t\n\t}", "function buildDOM(){\r\n $.logEvent('[dataVisualization.core.buildDOM]');\r\n \r\n var visualizationWrapperObj = $('<div />')\r\n .attr({\r\n 'class': 'data-visualization ' + dataVisualization.configuration.device,\r\n id: dataVisualization.configuration.visualizationWrapperId\r\n });\r\n \r\n var rowClassname;\r\n var rowObj;\r\n var columnObj;\r\n \r\n // Prepend the wrapper for the visualization functionality to #content for now\r\n // TODO: this will eventually be document.write to the space in the DOM where the JS resides inline\r\n $('#content').prepend(visualizationWrapperObj);\r\n \r\n // Create all necessary event handlers (now that the wrapper for the visualization functionality has been created, and attached to the DOM)\r\n eventHandlersInit();\r\n \r\n $.each(dataVisualization.configuration.data,function(nodeName,value){ \r\n if(nodeName == 'meta-data'){\r\n // Add the overriding CSS classname from the JSON\r\n visualizationWrapperObj.addClass(this.classname);\r\n \r\n dataVisualization.configuration.theme = this.classname;\r\n \r\n if(this['global-key']){\r\n var globalKeyObj = this;\r\n \r\n visualizationWrapperObj\r\n .append(\r\n $('<div />')\r\n .append(\r\n $('<h4 />')\r\n .html('Key')\r\n )\r\n .append(\r\n $('<ul />') \r\n .html(function(){\r\n var listElements = '';\r\n \r\n $.each(globalKeyObj.labels,function(index){\r\n listElements += '<li style=\"color:' + globalKeyObj.colors[index] + '\">' + globalKeyObj.labels[index] + '</li>';\r\n })\r\n \r\n return listElements;\r\n })\r\n )\r\n .attr('id','global-key')\r\n )\r\n }\r\n }\r\n else {\r\n rowClassname = 'data-row';\r\n rowClassname += ' ' + this['meta-data']['row-style'];\r\n \r\n // Add the first exception\r\n if(nodeName == 'row-1') {\r\n rowClassname += ' first';\r\n }\r\n \r\n // Add any themes to the row upon DOM creation/injection\r\n if(this['meta-data'].theme){\r\n rowClassname += ' theme ' + this['meta-data'].theme;\r\n }\r\n \r\n rowObj = $('<div />')\r\n .attr({\r\n 'class': rowClassname\r\n })\r\n \r\n // Add the row to the visualization wrapper\r\n visualizationWrapperObj.append(rowObj);\r\n \r\n // Add the row heading to the component (provided it exists in the JSON)\r\n if(this['meta-data'].heading){ \r\n var headingClass = 'heading';\r\n \r\n if(this['meta-data'].heading['render-inside']){\r\n headingClass += ' inside';\r\n }\r\n \r\n $('<h2 />')\r\n .attr('class',headingClass)\r\n .html(this['meta-data'].heading.text)\r\n .insertBefore(rowObj)\r\n .IF(this['meta-data'].heading['render-inside'])\r\n .prependTo(rowObj)\r\n .ENDIF()\r\n }\r\n else{\r\n rowObj.addClass('compressed');\r\n }\r\n \r\n $.each(this['columns'],function(indexInner,valueInner){\r\n // Bar graphs have an override value for small, medium or regular (largest) heights\r\n var additionalClassname = '';\r\n if(this.size){\r\n additionalClassname += (this.size != 'regular' ? ' ' + this.size : '');\r\n }\r\n \r\n // Bar graphs and scatter graphs have an additional property (svg-palette), to send light or dark values to the plugins, retrieve (and append) where necessary\r\n if(this['meta-data']['svg-palette']){\r\n additionalClassname += ' svg-palette-' + this['meta-data']['svg-palette'];\r\n }\r\n \r\n columnObj = $('<div />')\r\n .append(\r\n $('<div />')\r\n .append(\r\n $('<h2 />')\r\n .html($.capitalize({stringText: this.id}))\r\n )\r\n .append(\r\n $('<a />')\r\n .attr({\r\n 'class': 'reload disabled',\r\n href: '#'\r\n })\r\n .html('Re-load')\r\n )\r\n .append(\r\n $('<div />')\r\n .append(\r\n $('<h4 />')\r\n .html('Loading...')\r\n )\r\n .attr('class','overlay')\r\n )\r\n .append(\r\n $('<div />')\r\n .append(\r\n $('<div />')\r\n .attr({\r\n 'class': this['meta-data']['column-type'] + ' interactive' + additionalClassname,\r\n id: this.id\r\n })\r\n .data('interactive',this) // Add the retrieved JSON data to the interactive DOM element for later use when initializing the interactive functionality\r\n )\r\n .attr('class','inner')\r\n )\r\n .attr('class','module')\r\n )\r\n .attr('class',this['meta-data']['grid-column-type'])\r\n \r\n // Handle specific data attributes for Fusion maps\r\n if(this['meta-data']['column-type'] == 'fusion-map'){\r\n $('.interactive',columnObj)\r\n .append(\r\n $('<img />')\r\n .attr({\r\n 'class': 'mobile',\r\n src: this['mobile-image']\r\n })\r\n )\r\n .attr({\r\n \"data-bucket-colours\": this['meta-data']['bucket-colours'],\r\n \"data-bucket-ranges\": this['meta-data']['bucket-ranges'],\r\n \"data-latitude-origin\": this['meta-data']['latitude-origin'],\r\n \"data-longitude-origin\": this['meta-data']['longitude-origin'],\r\n \"data-zoom-level\": this['meta-data']['zoom-level']\r\n });\r\n }\r\n \r\n // Handle specific data attributes for Bar charts\r\n if(this['meta-data']['column-type'] == 'bar-graph'){\r\n $('.interactive',columnObj)\r\n .attr({\r\n \"data-orientation\": this.orientation\r\n });\r\n }\r\n \r\n // Add the column to the current row\r\n rowObj.append(columnObj);\r\n });\r\n }\r\n });\r\n \r\n // The data is now attached to each unique DOM element, so the global storage can now be removed\r\n dataVisualization.configuration.data = null;\r\n\r\n // Dynamically create the load sequence based on the results of the DOM injection\r\n createLoadSequence();\r\n }", "build() {\r\n this.defineComponents();\r\n this.render();\r\n this.initEventHandlers();\r\n }", "build() {\n const componentsRenderer =\n this.namespace().ComponentRenderer.new({ rootComponent: this })\n\n this.renderWith(componentsRenderer)\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}", "init (schema) {\n console.log('[Port] Initializing schema', schema)\n\n // Convert JS code to string\n if (schema.model.code && (typeof schema.model.code !== 'string')) {\n console.log('[Port] Convert code in schema to string')\n schema.model.code = schema.model.code.toString()\n }\n\n // Check for worker flag\n if (typeof schema.model.worker === 'undefined') {\n schema.model.worker = true\n }\n\n // Check if name is present, if not - get name from the file\n if (typeof schema.model.name === 'undefined') {\n // Two options here\n if (schema.model.url) {\n // 1. Get the name from the file name\n schema.model.name = schema.model.url.split('/').pop().split('.')[0]\n console.log('[Port] Use name from url: ', schema.model.name)\n } else if (schema.model.code) {\n // 2. Get the name from the url\n schema.model.name = schema.model.code.name\n console.log('[Port] Use name from code: ', schema.model.name)\n }\n }\n\n this.schema = clone(schema)\n\n if (this.params.portContainer) {\n console.log('[Port] Init port element')\n // Get layout name\n const layout = (this.schema.design && this.schema.design.layout) ? this.schema.design.layout : 'blocks'\n const portElement = htmlToElement(templates[layout])\n this.params.portContainer.appendChild(portElement)\n // Get input, output and model containers\n this.inputsContainer = portElement.querySelector('#inputs')\n this.outputsContainer = portElement.querySelector('#outputs')\n this.modelContainer = portElement.querySelector('#model')\n // Make run button active\n if (!this.schema.model.autorun) {\n let runButton = portElement.querySelector('#run')\n runButton.style.display = 'inline-block'\n runButton.onclick = () => {\n this.run()\n }\n }\n } else {\n this.inputsContainer = this.params.inputsContainer\n this.outputsContainer = this.params.outputsContainer\n this.modelContainer = this.params.modelContainer\n }\n\n // Init overlay\n this.inputsContainer.appendChild(this.overlay)\n\n console.log('[Port] Init inputs, outputs and model description')\n\n // Update model URL if needed\n if (this.schema.model.url && !this.schema.model.url.includes('/') && this.schemaUrl && this.schemaUrl.includes('/')) {\n let oldModelUrl = this.schema.model.url\n console.log(this.schemaUrl)\n this.schema.model.url = window.location.protocol + '//' + window.location.host + this.schemaUrl.split('/').slice(0, -1).join('/') + '/' + oldModelUrl\n console.log('[Port] Changed the old model URL to absolute one:', oldModelUrl, this.schema.model.url)\n }\n\n // Iniitialize model description\n if (this.modelContainer && this.schema.model) {\n if (this.schema.model.title) {\n let h = document.createElement('h4')\n h.className = 'port-title'\n h.innerText = this.schema.model.title\n this.modelContainer.appendChild(h)\n }\n if (this.schema.model.description) {\n let desc = document.createElement('p')\n desc.className = 'model-info'\n desc.innerText = this.schema.model.description + ' '\n let a = document.createElement('a')\n a.innerText = '→'\n a.href = this.schema.model.url\n desc.appendChild(a)\n this.modelContainer.appendChild(desc)\n }\n }\n\n // Initialize inputs\n this.schema.inputs.forEach((input, i) => {\n console.log(input)\n let element\n switch (input.type) {\n case 'int':\n case 'float':\n case 'string':\n element = new elements.InputElement(input)\n break\n case 'checkbox':\n element = new elements.CheckboxElement(input)\n break\n case 'range':\n element = new elements.RangeElement(input)\n window['M'].Range.init(element.inputElement)\n break\n case 'text':\n element = new elements.TextareaElement(input)\n break\n case 'select':\n case 'categorical':\n element = new elements.SelectElement(input)\n break\n case 'file':\n element = new elements.FileElement(input)\n break\n case 'image':\n element = new elements.ImageElement(input)\n break\n }\n\n if (input.onchange && !element.inputElement.onchange) {\n setTimeout(() => {\n this.output(input.onchange(element.getValue()))\n }, 0)\n }\n\n // Add onchange listener to original input element if model has autorun flag\n if (this.schema.model.autorun || input.reactive || input.onchange) {\n if (input.type === 'file') {\n element.cb = this\n } else {\n element.inputElement.onchange = () => {\n console.log('[Input] Change event')\n if (input.onchange) {\n this.output(input.onchange(element.getValue()))\n }\n if (this.schema.model.autorun || input.reactive) {\n this.run()\n }\n }\n }\n }\n\n // Add element to input object\n input.element = element\n this.inputsContainer.appendChild(element.element)\n })\n\n // Init Material framework\n var selectElements = document.querySelectorAll('select')\n window['M'].FormSelect.init(selectElements, {})\n\n // Init Model\n // ----------\n if (this.schema.model.type === 'py') {\n // Add loading indicator\n this._showOverlay()\n let script = document.createElement('script')\n script.src = 'https://pyodide.cdn.iodide.io/pyodide.js'\n script.onload = () => {\n window['M'].toast({html: 'Loaded: Python'})\n window['languagePluginLoader'].then(() => {\n fetch(this.schema.model.url)\n .then(res => res.text())\n .then(res => {\n console.log('[Port] Loaded python code:', res)\n this.pymodel = res\n // Here we filter only import part to know load python libs\n let imports = res.split('\\n').filter(str => (str.includes('import ')) && !(str.includes('#')) && !(str.includes(' js '))).join('\\n')\n console.log('Imports: ', imports)\n window['pyodide'].runPythonAsync(imports, () => {})\n .then((res) => {\n window['M'].toast({html: 'Loaded: Dependencies'})\n this._hideOverlay()\n })\n .catch((err) => {\n console.log(err)\n window['M'].toast({html: 'Error loading libs'})\n this._hideOverlay()\n })\n })\n .catch((err) => {\n console.log(err)\n window['M'].toast({html: 'Error loading python code'})\n this._hideOverlay()\n })\n })\n }\n document.head.appendChild(script)\n } else if (['function', 'class', 'async-init', 'async-function'].includes(this.schema.model.type)) {\n // Initialize worker with the model\n if (this.schema.model.worker) {\n this.worker = new Worker('./worker-temp.js')\n if (this.schema.model.url) {\n fetch(this.schema.model.url)\n .then(res => res.text())\n .then(res => {\n console.log('[Port] Loaded js code for worker')\n this.schema.model.code = res\n this.worker.postMessage(this.schema.model)\n })\n } else if (typeof this.schema.model.code !== 'undefined') {\n this.worker.postMessage(this.schema.model)\n } else {\n window['M'].toast({html: 'Error. No code provided'})\n }\n\n this.worker.onmessage = (e) => {\n this._hideOverlay()\n const data = e.data\n console.log('[Port] Response from worker:', data)\n if ((typeof data === 'object') && (data._status)) {\n switch (data._status) {\n case 'loaded':\n window['M'].toast({html: 'Loaded: JS model (in worker)'})\n break\n }\n } else {\n this.output(data)\n }\n }\n this.worker.onerror = (e) => {\n this._hideOverlay()\n window['M'].toast({html: e.message, classes: 'error-toast'})\n console.log('[Port] Error from worker:', e)\n }\n } else {\n // Initialize model in main window\n console.log('[Port] Init model in window')\n let script = document.createElement('script')\n script.src = this.schema.model.url\n script.onload = () => {\n window['M'].toast({html: 'Loaded: JS model'})\n this._hideOverlay()\n console.log('[Port] Loaded JS model in main window')\n\n // Initializing the model (same in worker)\n if (this.schema.model.type === 'class') {\n console.log('[Port] Init class')\n const modelClass = new window[this.schema.model.name]()\n this.modelFunc = (...a) => {\n return modelClass[this.schema.model.method || 'predict'](...a)\n }\n } else if (this.schema.model.type === 'async-init') {\n console.log('[Port] Init function with promise')\n window[this.schema.model.name]().then((m) => {\n console.log('[Port] Async init resolved: ', m)\n this.modelFunc = m\n })\n } else {\n console.log('[Port] Init function')\n this.modelFunc = window[this.schema.model.name]\n }\n }\n document.head.appendChild(script)\n }\n } else if (this.schema.model.type === 'tf') {\n // Initialize TF\n let script = document.createElement('script')\n script.src = 'dist/tf.min.js'\n script.onload = () => {\n console.log('[Port] Loaded TF.js')\n this._hideOverlay()\n window['tf'].loadLayersModel(this.schema.model.url).then(res => {\n console.log('[Port] Loaded Tensorflow model')\n })\n }\n document.head.appendChild(script)\n }\n\n // Init render\n // -----------\n if (this.schema.render && this.schema.render.url) {\n console.log('[Port] Init render in window')\n let script = document.createElement('script')\n script.src = this.schema.render.url\n script.onload = () => {\n window['M'].toast({html: 'Loaded: JS render'})\n console.log('[Port] Loaded JS render')\n\n // Initializing the render (same in worker)\n if (this.schema.render.type === 'class') {\n console.log('[Port] Init render as class')\n const renderClass = new window[this.schema.render.name]()\n this.renderFunc = (...a) => {\n return renderClass[this.schema.render.method || 'render'](...a)\n }\n } else if (this.schema.render.type === 'async-init') {\n console.log('[Port] Init render function with promise')\n window[this.schema.render.name]().then((m) => {\n console.log('[Port] Async rebder init resolved: ', m)\n this.renderFunc = m\n })\n } else {\n console.log('[Port] Init render as function')\n this.renderFunc = window[this.schema.render.name]\n }\n }\n document.head.appendChild(script)\n }\n }", "function buildUI() {\n getSavedOptions();\n if (validPointer(document.getElementById('xedx-main-div'))) {\n log('UI already installed!');\n return;\n }\n\n let parentDiv = document.querySelector(\"#mainContainer > div.content-wrapper > div.userlist-wrapper\");\n if (!validPointer(parent)) {setTimeout(buildUI, 500);}\n\n loadTableStyles();\n $(separator).insertBefore(parentDiv);\n $(xedx_main_div).insertBefore(parentDiv);\n\n installHandlers();\n setDefaultCheckboxes();\n hideDevOpts(!opt_devmode);\n indicateActive();\n log('UI installed.');\n }", "function buildUI(thisObj) {\n var win =\n thisObj instanceof Panel\n ? thisObj\n : new Window(\"palette\", \"example\", [0, 0, 150, 260], {\n resizeable: true\n });\n\n if (win != null) {\n var H = 25; // the height\n var W1 = 30; // the width\n var G = 5; // the gutter\n var x = G;\n var y = G;\n win.refresh_templates_button = win.add(\n \"button\",\n [x, y, x + W1 * 5, y + H],\n \"Refresh Templates\"\n );\n y += H + G;\n win.om_templates_ddl = win.add(\n \"dropdownlist\",\n [x, y, x + W1 * 5, y + H],\n SOM_meta.outputTemplates\n );\n win.om_templates_ddl.selection = 0;\n y += H + G;\n win.set_templates_button = win.add(\n \"button\",\n [x, y, x + W1 * 5, y + H],\n \"Set Output Template\"\n );\n y += H + G;\n win.help_button = win.add(\"button\", [x, y, x + W1 * 5, y + H], \"⚙/?\");\n win.help_button.graphics.font = \"dialog:17\";\n\n /**\n * This reads in all outputtemplates from the renderqueue\n *\n * @return {nothing}\n */\n win.refresh_templates_button.onClick = function() {\n get_templates();\n // now we set the dropdownlist\n win.om_templates_ddl.removeAll(); // remove the content of the ddl\n for (var i = 0; i < SOM_meta.outputTemplates.length; i++) {\n win.om_templates_ddl.add(\"item\", SOM_meta.outputTemplates[i]);\n }\n win.om_templates_ddl.selection = 0;\n }; // close refresh_templates_button\n\n win.om_templates_ddl.onChange = function() {\n SOM_meta.selectedTemplate =\n SOM_meta.outputTemplates[this.selection.index];\n };\n win.set_templates_button.onClick = function() {\n set_templates();\n };\n }\n return win;\n } // close buildUI", "function CDomPartsBuilder() {\n }", "build() {\n this.$node.append('label')\n .attr('for', 'ds')\n .text(Language.DATA_SET);\n // create select and update hash on property change\n this.$select = this.$node.append('select')\n .attr('id', 'ds')\n .classed('form-control', true)\n .on('change', () => {\n const selectedData = this.$select.selectAll('option')\n .filter((d, i) => i === this.$select.property('selectedIndex'))\n .data();\n AppContext.getInstance().hash.setProp(AppConstants.HASH_PROPS.DATASET, selectedData[0].key);\n AppContext.getInstance().hash.removeProp(AppConstants.HASH_PROPS.TIME_POINTS);\n AppContext.getInstance().hash.removeProp(AppConstants.HASH_PROPS.DETAIL_VIEW);\n AppContext.getInstance().hash.removeProp(AppConstants.HASH_PROPS.SELECTION);\n if (selectedData.length > 0) {\n GlobalEventHandler.getInstance().fire(AppConstants.EVENT_DATA_COLLECTION_SELECTED, selectedData[0].values);\n this.trackSelections(selectedData[0].values[0].item);\n }\n });\n }", "build() {\n // this.element = this.ce('div', {\n // class: 'table-responsive'\n // });\n // this.createLabel(this.element);\n\n // var tableClass = 'table ';\n // ['striped', 'bordered', 'hover', 'condensed'].forEach(function(prop) {\n // if (this.component[prop]) {\n // tableClass += `table-${prop} `;\n // }\n // }.bind(this));\n\n // var table = this.ce('table', {\n // class: tableClass\n // });\n\n // Build the body.\n // var tbody = this.ce('tbody');\n // this.inputs = [];\n\n // for (let i = 0; i < this.component.numRows; i++) {\n // var tr = this.ce('tr');\n // this.checks.push([]);\n // for (let j = 0; j < this.component.numCols; j++) {\n // var td = this.ce('td');\n // this.checks[i][j] = this.ce('input', {\n // type: 'checkbox'\n // });\n // this.addInput(this.checks[i][j], td);\n // tr.appendChild(td);\n // }\n // tbody.appendChild(tr);\n // }\n // table.appendChild(tbody);\n // this.element.appendChild(table);\n }", "_createLayout() {\n const that = this;\n\n that._items = [];\n\n if (typeof that.dataSource === 'string') {\n that.dataSource = JSON.parse(that.dataSource);\n }\n\n if (that.dataSource !== null && Array.isArray(that.dataSource)) {\n that.$.container.innerHTML = '';\n\n let fragment = document.createDocumentFragment(), item;\n\n for (let i = 0; i < that.dataSource.length; i++) {\n item = that._createItem(that.dataSource[i]);\n fragment.appendChild(item);\n }\n\n that._handleSplitterBars(fragment);\n return;\n }\n\n that._handleSplitterBars(that.$.container);\n }", "function buildObject ()\n //--------------------------------------------------------------------\n {\n aConfig.titleCollapse = true;\n //aConfig.title = getString(\"ait_search_window_result\");\n aConfig.collapsible = false;\n aConfig.border = false;\n aConfig.layout = 'fit';\n aConfig.region= 'center';\n aConfig.gridConfig = aConfig.gridConfig || {};\n m_aSearchParams = aConfig.searchParams;\n\n aConfig.plugins = [boc.ait.plugins.Customizable];\n\n // Create the result columns that are always shown\n var aResultColumns =\n [\n new Ext.grid.RowNumberer(),\n {\n id: \"idClass_lang\",\n header: getString(\"ait_search_result_type\"),\n sortable: true,\n dataIndex: \"idClass_lang\",\n width:40,\n fixed: true,\n renderer: renderIcon,\n name: 'idClass_lang'\n },\n {\n id: \"text\",\n header: getString(\"ait_search_result_name\"),\n sortable: true,\n dataIndex: \"text\",\n width: 75,\n renderer: that._renderName,\n name: \"text\"\n }\n ];\n\n\n var aFields = [];\n\n if (aConfig.showGlobalAttributes === true)\n {\n for (var i = 0; g_aSettings.searchData.global_attributes && i < g_aSettings.searchData.global_attributes.length;++i)\n {\n var aAttrParams = g_aSettings.searchData.global_attributes[i];\n // Ignore the Name column, as the name is already always shown by default anyway\n if (aAttrParams.attrName === \"NAME\")\n {\n continue;\n }\n\n var bShowColumn = true;\n for(var q=0; q<aResultColumns.length; ++q)\n {\n if (aResultColumns[q].id === \"attr_\"+aAttrParams.attrID)\n {\n bShowColumn = false;\n break;\n }\n }\n if(bShowColumn)\n {\n aResultColumns[aResultColumns.length] =\n {\n id: \"attr_\"+aAttrParams.attrID,\n header: aAttrParams.langName,\n sortable: true,\n renderer: renderAttribute,\n dataIndex: \"attr_\"+aAttrParams.attrID,\n name: \"attr_\"+aAttrParams.attrID\n };\n // Also add the id of the attribute to the fields for the store\n aFields[aFields.length] = \"attr_\"+aAttrParams.attrID;\n }\n }\n }\n else if (aConfig.showGlobalAttributes === undefined)\n {\n aResultColumns[aResultColumns.length] =\n {\n id: \"attr_description\",\n header: getString(\"ait_search_result_description\"),\n sortable: true,\n dataIndex: \"attr_description\",\n renderer: renderDescription,\n width: 100/*,\n name: \"description\"*/\n }\n }\n\n // If we were passed additional result columns, add them\n if (aConfig.additionalResultColumns)\n {\n aResultColumns = aResultColumns.concat(aConfig.additionalResultColumns);\n }\n\n\n\n // Array to hold the visualized fields of the result\n aFields = aFields.concat\n (\n [\n {name:'idClass'},\n {name:'idClass_lang'},\n {name:'text', type:'string'},\n {name:'classId'},\n {name:'_is_leaf'},\n {name:'iconUrl'},\n {name:'id'},\n {name:'modelId'},\n {name:'_parent'},\n {name:'artefactType'},\n {name:'editable'}\n ]\n );\n\n // If we were passed additional fields, add them\n if (aConfig.additionalFields)\n {\n aFields = aFields.concat (aConfig.additionalFields);\n }\n\n if (aConfig.showGlobalAttributes === undefined)\n {\n aFields[aFields.length] = {name:\"attr_description\"};\n }\n\n /**\n * BufferedJsonReader derives from Ext.data.JsonReader and allows to pass\n * a version value representing the current state of the underlying data\n * repository.\n * Version handling on server side is totally up to the user. The version\n * property should change whenever a record gets added or deleted on the server\n * side, so the store can be notified of changes between the previous and current\n * request. If the store notices a version change, it will fire the version change\n * event. Speaking of data integrity: If there are any selections pending,\n * the user can react to this event and cancel all pending selections.\n */\n\n var aReaderConfig =\n {\n root : 'payload.entries',\n totalProperty : 'payload.cnt',\n id : 'id',\n fields: aFields\n }\n var aReader = null;\n if (!g_aSettings.offline && aConfig.useLiveGrid)\n {\n aReader = new Ext.ux.grid.livegrid.JsonReader (aReaderConfig);\n }\n else\n {\n aReader = new Ext.data.JsonReader (aReaderConfig);\n }\n\n var aStoreConfig = null;\n\n if (!aConfig.resultData)\n {\n aStoreConfig =\n {\n autoLoad: true,\n //proxy: null,\n url: aConfig.searchParams.url,\n baseParams:\n {\n type: aConfig.searchParams.type,\n searchid: aConfig.searchParams.searchid,\n queryAServer: true,\n params: Ext.encode\n (\n aConfig.searchParams.params\n )\n },\n bufferSize : 60,\n sortInfo: {field:'text', direction: 'DESC'},\n reader: aReader\n };\n }\n else\n {\n aStoreConfig =\n {\n autoLoad:true,\n proxy : new Ext.data.MemoryProxy (aConfig.resultData),\n sortInfo: {field:'text', direction:'DESC'},\n reader: aReader\n }\n }\n\n aStoreConfig.destroy = true;\n\n\n if (!g_aSettings.offline && aConfig.useLiveGrid)\n {\n m_aStore = new Ext.ux.grid.livegrid.Store (aStoreConfig);\n }\n else\n {\n aStoreConfig.groupField = aConfig.groupField;\n m_aStore = new Ext.data.GroupingStore (aStoreConfig);\n }\n\n m_aStore.on(\"load\", function(aStore, aRecords)\n {\n that.fireEvent(\"load\", aStore, aRecords);\n if (!g_aSettings.offline && aConfig.useLiveGrid)\n {\n m_aStore.baseParams.queryAServer = false;\n }\n // Call the initialLoadCallback functionality\n if ((typeof aConfig.initialLoadCallback) === \"function\")\n {\n aConfig.initialLoadCallback.call(aConfig.scope || this);\n }\n }\n );\n\n m_aStore.on(\"loadexception\", function (aStore, aOptions, aResponse, eError)\n {\n try\n {\n if (!this.reader.jsonData)\n {\n return;\n }\n if (this.reader.jsonData.error)\n {\n showErrorBox (this.reader.jsonData.errString);\n\n return;\n }\n }\n finally\n {\n that.fireEvent (\"loadexception\", aStore, aOptions, aResponse, eError);\n\n // Call the initialLoadCallback functionality\n if ((typeof aConfig.initialLoadCallback) === \"function\")\n {\n aConfig.initialLoadCallback.call(aConfig.scope || this);\n }\n }\n }\n );\n\n\n var aViewConfig =\n {\n nearLimit : 20,\n forceFit: true,\n preserveCellWidths: true,\n loadMask :\n {\n msg : getString(\"ait_loading\")\n }\n };\n\n var aView = null;\n if (!g_aSettings.offline && aConfig.useLiveGrid)\n {\n aView = new Ext.ux.grid.livegrid.GridView (aViewConfig);\n }\n else if (aConfig.groupField)\n {\n aViewConfig.hideGroupedColumn = true;\n aViewConfig.enableNoGroups = true;\n aViewConfig.groupRenderer = function (aVal, aUnused, aRecord, nRowIndex, nColIndex, aDS)\n {\n return \"?\";\n }\n aView = new Ext.grid.GroupingView (aViewConfig);\n }\n else\n {\n aView = new Ext.grid.GridView (aViewConfig);\n }\n\n var aSM = aConfig.sm;\n\n if (!aConfig.sm)\n {\n var aSMConfig =\n {\n singleSelect: aConfig.singleSelect === true,\n listeners:\n {\n selectionchange : function (aSelModel)\n {\n that.fireEvent('selectionchange', that, aSelModel);\n }\n }\n };\n\n if (!g_aSettings.offline && aConfig.useLiveGrid)\n {\n aSM = new Ext.ux.grid.livegrid.RowSelectionModel (aSMConfig);\n }\n else\n {\n aSM = new Ext.grid.RowSelectionModel (aSMConfig);\n }\n }\n\n var aGridConfig =\n {\n columns:aResultColumns,\n stripeRows: true,\n //title: aConfig.title || \"\",\n maskDisabled: false,\n layout:'fit',\n autoWidth:true,\n autoHeight:aConfig.gridConfig.autoHeight,\n autoScroll:true,\n border:false,\n autoExpandColumn: 'text',\n store: m_aStore,\n view: aView,\n sm: aSM\n };\n\n\n\n aGridConfig.listeners = aConfig.gridConfig.listeners || {};\n\n /*\n Handler for the 'render' event of the grid\n Ensures that the result grid is displayed correctly\n \\param aGrid The rendered grid\n */\n //--------------------------------------------------------------------\n aGridConfig.listeners.render = aGridConfig.listeners.render || function (aGrid)\n //--------------------------------------------------------------------\n {\n try\n {\n aGrid.ownerCt.body.applyStyles(\"padding:0px;width:auto;\");\n aGrid.body.applyStyles(\"padding:0px;width:auto;\");\n Ext.get(aGrid.ownerCt.body.dom.parentNode).applyStyles(\"background-color:white;width:auto;\");\n aGrid.ownerCt.body.applyStyles(\"width:auto;\");\n\n // Workaround on IE6 to force the grid's size to be correctly recalculated\n //if (Ext.isIE6)\n //{\n aGrid.setWidth(1);\n //}\n }\n catch (aEx)\n {\n displayErrorMessage (aEx);\n }\n };\n\n aGridConfig.listeners.celldblclick = aGridConfig.listeners.celldblclick || function (aGrid, nRowIndex, nColIndex, aEvent)\n {\n var aStore = aGrid.getStore();\n // Get the clicked cell\n var aRecord = aStore.getAt (nRowIndex); // Get the Record\n var aCM = aGrid.getColumnModel();\n var sFieldName = aCM.getDataIndex(nColIndex);\n var aColumn = aCM.getColumnById(sFieldName);\n var aDefaultVal = aColumn.defaultValue;\n var aVal = aRecord.get(sFieldName);\n var aRenderer = aCM.getRenderer (nColIndex);\n showExtendedEditBox(aRenderer (aVal, {renderInSupportDialog: true}, aRecord), aCM.getColumnHeader(nColIndex), false);\n };\n\n /*\n Handler for the 'rowcontextmenu' event of the grid. Displays\n a context menu for the current row.\n\n \\param aGrid The grid on which the event was thrown\n \\param nRowIndex The index of the event throwing row\n \\param aEvt The thrown event\n */\n //--------------------------------------------------------------------\n aGridConfig.listeners.rowcontextmenu = aGridConfig.listeners.rowcontextmenu || function (aGrid, nRowIndex, aEvt)\n //--------------------------------------------------------------------\n {\n try\n {\n var aSelectionModel = aGrid.getSelectionModel();\n if (!aSelectionModel.isSelected (nRowIndex))\n {\n aSelectionModel.selectRow (nRowIndex);\n }\n m_aCtxMenu.setContext (aGrid.getSelectionModel().getSelections());\n // Get the actual menu from the mainmenu object\n var aMenu = m_aCtxMenu.menu;\n aMenu.showAt(aEvt.getXY());\n aEvt.stopEvent();\n }\n catch (aEx)\n {\n displayErrorMessage (aEx);\n }\n };\n\n if (!g_aSettings.offline && aConfig.useLiveGrid)\n {\n m_aResultGrid = new Ext.ux.grid.livegrid.GridPanel (aGridConfig);\n }\n else\n {\n m_aResultGrid = new Ext.grid.GridPanel (aGridConfig);\n }\n aConfig.items = m_aResultGrid;\n\n if (m_aSearchParams !== null && m_aSearchParams !== undefined)\n {\n for (var sAttrName in m_aSearchParams.params.attributes)\n {\n var sVal = m_aSearchParams.params.attributes[sAttrName];\n sVal = sVal.trim().replace(/\\*/g, \"\").replace(/\\\"/, \"\").replace(/\\'/, \"\");\n m_aSearchParams.params.attributes[sAttrName] = sVal;\n }\n }\n m_aResultGrid.on(\"cellclick\", aConfig.nameCellClick || function (aGrid, nRowIndex, nColIndex, aEvt )\n {\n var aRecord = aGrid.getStore().getAt(nRowIndex); // Get the Record\n\n //var aData = aRecord.get(sFieldName);\n var sFieldID = aGrid.getColumnModel().getColumnId(nColIndex);\n\n if (sFieldID === \"text\")\n {\n if (aRecord.get(\"artefactType\") === AIT_ARTEFACT_DIAGRAM)\n {\n g_aMain.getMainArea().openDiagram (aRecord.get(\"id\"), AIT_ARTEFACT_DIAGRAM);\n }\n else\n {\n g_aMain.getMainArea().openNotebook\n (\n aRecord.get(\"id\"),\n AIT_ARTEFACT_OBJECT,\n false,\n m_aSearchParams && m_aSearchParams.params && m_aSearchParams.params.attributes ? m_aSearchParams.params.attributes : null\n );\n }\n }\n }\n );\n\n m_aCtxMenu = new boc.ait.menu.Menu\n (\n {\n commands : [\n \"ait_menu_main_open_diagram\",\n \"ait_menu_main_open_model_editor\",\n \"ait_menu_main_open_notebook\",\n \"-\",\n \"ait_menu_main_used_in_models\",\n \"-\",\n {\n cmdId: \"ait_menu_main_views\",\n commands:\n [\n \"ait_menu_main_show_bia\"\n ]\n }\n ]\n }\n );\n m_aCtxMenu.getContext = function ()\n {\n return that.getGridControl().getSelectionModel().getSelections();\n }\n\n if (m_aSearchParams && m_aSearchParams.params && m_aSearchParams.params.attributes)\n {\n m_aCtxMenu.setParams ({highlightParams: m_aSearchParams.params.attributes});\n }\n }", "static createAndDisplay(parameters) {\n const dg = new SuiLayoutDialog(parameters);\n dg.display();\n }", "_schemaChanged() {\n //make sure the content is there first\n setTimeout(() => {\n let itemLabel = this.schema.items.itemLabel;\n if (this.schema && Array.isArray(this.schema.value)) {\n this.schema.value.forEach(val => {\n this.push(\"__headings\", val[itemLabel]);\n });\n }\n this.shadowRoot.querySelectorAll(\".item-fields\").forEach(item => {\n let index = item.getAttribute(\"data-index\"),\n propertyName = `${this.propertyPrefix}${this.propertyName}`,\n prefix = `${propertyName}.${index}`,\n //path = `${propertyName}.properties.${index}`,\n val = this.schema.value[index];\n //for each array item, request the fields frrom eco-json-schema-object\n this.dispatchEvent(\n new CustomEvent(\"build-fieldset\", {\n bubbles: false,\n cancelable: true,\n composed: true,\n detail: {\n container: item,\n path: propertyName,\n prefix: prefix,\n properties: this.schema.properties.map(prop => {\n let newprop = JSON.parse(JSON.stringify(prop));\n newprop.value = val[prop.name];\n return newprop;\n }),\n type: EcoJsonSchemaArray.tag,\n value: this.schema.value || []\n }\n })\n );\n });\n }, 0);\n }", "function _buildTable() {\n // _displayLoading(true);\n _addGradeRange();\n _renderSelects();\n var table = _setupDataTable(renderTable());\n renderFeatures();\n}", "render() {\n const container = make('div', [this.CSS.baseClass, this.CSS.container])\n this.container = container\n\n // Render the fields which are defined for this tool\n for (let key in this.fields) {\n const field = this.fields[key]\n if (field.input === false) continue\n this.renderInput(key, container)\n }\n\n return container\n }", "function buildVisualization(animationSpeed) {\r\n\t\taddDataProcess();\r\n \tbrunel.rebuild(animationSpeed);\r\n\t}", "function buildUI(thisObj) {\n try{\n var pal = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", \"Marker Maker\", [200, 200, 600, 500], {resizeable: true});\n var ui = \"group{orientation:'column', alignment:['fill','fill'],spacing:10,\\\n logoGroup: Group{alignment:['fill','top'],preferredSize:[200,17],\\\n logoImage: Image{preferredSize:[58,17], alignment:['left','bottom']},\\\n },\\\n mainGroup:Group{orientation:'column',alignment:['fill','top'],alignChildren:['fill','top'],\\\n mainText: StaticText {minimumSize:[160,50],alignment:['middle','top']},\\\n dynBtn: Button{preferredSize:[100,-1]},\\\n tvaMidBtn: Button{preferredSize:[100,-1]},\\\n tvaBtmBtn: Button{preferredSize:[100,-1]},\\\n hrGroupTop: Panel{orientation:'row', preferredSize:[200,-1]},\\\n removerBtn: Button{preferredSize:[100,-1]}\\\n }\\\n }\";\n pal.grp = pal.add(ui);\n pal.layout.layout(true);\n pal.layout.resize();\n pal.onResizing = pal.onResize = function () {this.layout.resize();}\n \n var logoBinary = [\"\\u0089PNG\\r\\n\\x1A\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x008\\x00\\x00\\x00\\x11\\b\\x06\\x00\\x00\\x00\\u0088%o\\u00E0\\x00\\x00\\x00\\x19tEXtSoftware\\x00Adobe ImageReadyq\\u00C9e<\\x00\\x00\\x03!iTXtXML:com.adobe.xmp\\x00\\x00\\x00\\x00\\x00<?xpacket begin=\\\"\\u00EF\\u00BB\\u00BF\\\" id=\\\"W5M0MpCehiHzreSzNTczkc9d\\\"?> <x:xmpmeta xmlns:x=\\\"adobe:ns:meta/\\\" x:xmptk=\\\"Adobe XMP Core 5.5-c021 79.154911, 2013/10/29-11:47:16 \\\"> <rdf:RDF xmlns:rdf=\\\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\\\"> <rdf:Description rdf:about=\\\"\\\" xmlns:xmp=\\\"http://ns.adobe.com/xap/1.0/\\\" xmlns:xmpMM=\\\"http://ns.adobe.com/xap/1.0/mm/\\\" xmlns:stRef=\\\"http://ns.adobe.com/xap/1.0/sType/ResourceRef#\\\" xmp:CreatorTool=\\\"Adobe Photoshop CC (Windows)\\\" xmpMM:InstanceID=\\\"xmp.iid:1343C5D9ED1C11E3BEB684BFE5DB83CE\\\" xmpMM:DocumentID=\\\"xmp.did:1343C5DAED1C11E3BEB684BFE5DB83CE\\\"> <xmpMM:DerivedFrom stRef:instanceID=\\\"xmp.iid:1343C5D7ED1C11E3BEB684BFE5DB83CE\\\" stRef:documentID=\\\"xmp.did:1343C5D8ED1C11E3BEB684BFE5DB83CE\\\"/> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end=\\\"r\\\"?>\\u00CE\\u00DD\\\"2\\x00\\x00\\x04\\u00A8IDATx\\u00DA\\u0094\\u0097\\tlTE\\x18\\u00C7\\u00DF\\u00B6]\\u00B0U\\u00A0h\\u00A9\\x07\\\"G\\x03\\x1E\\u0088G4\\u00E2E\\u00A1\\x01\\x1B1\\u00A2\\x10\\u00AB\\\"\\x06\\x05%x\\x11\\x15\\x15\\x11E\\t\\u00A8\\u00A4\\u0092\\x12\\x0EA0M\\x05\\u00AC\\nh\\u00B5x\\u00C4\\u00A21\\u0082G\\u00A0\\u008A&@\\x10\\x04#\\u00E0\\x19\\u0085bj\\u00B4\\u0096\\u00B6l\\u00F1\\u00FF\\u0099\\u00DF3\\u00C38[\\u00EA$\\u00BF}\\u00BB3o\\u00DE\\u009B\\u00EF\\u00FE6\\u00D1\\u00D8\\u00D4tq\\x14E\\x13E\\x17\\u00D1\\\"\\u00F6\\u008BN\\u00A2\\u00A7\\u00F8\\u0099\\u00B92\\u00B1-\\u00FA\\u00EF\\u00B8A\\f\\x15wDm\\u008Fk\\u00C4Hq\\u0097h\\n\\u00AC\\u009F/&\\u008B\\u0093E7\\u00E6\\u00EA\\u00C5nQ*v\\u0089\\x1Eb\\u009C\\u00C8\\x14\\u00F9\\\"+\\u00CD\\u00BB\\u00EC\\u00BCu\\\"[\\u00BC\\u0098\\u00A1\\u008F\\u00E1b\\u00B4\\u00D8(\\u00DE\\x17\\u00FD\\u00C5\\u00ADb\\u009F\\u00A8\\u00E5\\u00C6M\\u00DC\\u00E3\\u008FSP\\u008E\\u00AD\\u008F\\n\\u00AC\\u00E7\\u008A*\\u00F1\\u00A6(\\x16\\u00CD\\u0081{*xoR,\\u00E2=\\u00C6\\x1C\\u00D1Q\\u00EC\\x14\\u00BD\\u00C5\\tb\\u0096\\u0098!~\\x15\\u00A9\\x00\\u0087X{\\x02\\u00B9\\u00FE0-\\u00B4\\u008A\\u00F5X\\u00C9\\u00C6C\\u00E2F\\u00F1*\\u00BF\\u009F\\x15W\\u008Aw\\x10\\u00E4[\\u00E7p\\u00FFhI\\u00D4\\u0088\\x05b\\u00BC\\x18#\\u00FEDIv\\u00C8\\u008F\\u00C40q\\u009F\\u00C8\\x11\\r\\u00CE\\u00FE\\u00F7\\x10\\u00FC<\\u00B1\\u00C5\\x13\\u00FCkq\\u0081\\u00D8\\u00CA\\u00A1O\\x17\\x1F\\u008B\\u00E3E%\\u00D6\\r\\u008DB\\u00B1\\u0097\\u00BD\\u00CDYH~\\f\\u008B\\x0F\\u008B\\u00EF\\x1C\\u00E1\\u00E2\\u00B1V\\u00BC,\\x1E\\x14w;\\u00F3\\x1D\\u00D0\\u00FC*\\u00ACd\\u00EE\\u00B4Y\\u00FC\\u0080\\u00F6o\\x16\\x1F\\u00E0^\\u00B9\\x01\\u00CB\\x15\\u00E3\\u00BE[\\x02\\x075\\u00B7\\u009F)\\u00BA\\u008A\\u00BF\\u00C4\\u00A9\\u00E23\\u008C\\u00B1]\\u00E4\\u00A1Hw\\u00F4B\\u00A1\\u0083bo\\u00C9\\u00F0n8+M\\u00AC\\u00D9\\u00D8 N\\u00F2\\u00E6\\x0E#\\u00A4\\u008DF\\u00DC\\u00A9@\\u009C\\u00C1\\u00EF/X\\u00EB\\u00CC5\\u00C1\\u00F5*b\\u00F2\\x13\\u00F1U\\u00E0]\\u00E7\\u0088\\u00A5\\u00E2R\\u00F1;s\\u00E6~}\\u00C5\\u00BBP\\x1D\\u00D8\\u00F7\\u00A1\\u0098'>\\u008D'|\\x01M\\u00B83\\u00D3\\b8P\\u00FC\\x14\\u0098\\u00FF\\u008D\\x03}\\u0089\\x1B\\u00F6#Y|Nr\\u00B0\\u00989h\\u00F1@8\\u00D8xL\\u00DC/\\u00F6p\\u00E8\\u00C8s\\u00FB\\r\\u0084J\\u00AD\\u00A7\\u00CC8\\u00B1\\u0094\\u0088\\u00CB\\u00C5\\x04g}\\x11J}\\u00C0}\\u0098/\\u00E0\\u00F3h\\u00ED\\u0096\\u0080p\\u00F6\\u00C0\\u00F9\\u00DE\\u00BC%\\u00A2\\x11b\\u00A1x\\u008B8\\u00F9\\u0086\\u00B5i\\u00E2j\\u00B2\\u00AC\\u00AD\\x1D\\u00C7\\x01\\u00F2\\b\\u0089J\\u00E2\\u00F9\\u00C9\\u0080\\x15\\u008C\\u00B9\\x01e\\u00B6:W\\u00F3\\u0082r\\u0084\\u00BEP\\u00DCCb9b\\u00F8\\u00A9\\u00D6\\u00B4|\\x1B\\x1B\\u008B\\u0088\\u00ABal~\\u00DBK0\\x11\\u00961\\u00B7}& |\\u0084\\x15\\x0B\\u00D1\\u00FE\\x01\\u00AE\\u00FD\\x1D\\u00B7+EA\\u00E6\\u008EK(;9\\u00C4\\u00E5\\u00D1\\u00C6:\\u00F14\\x19\\u00D8\\x12\\u00CFM\\u00E2{\\u00FF\\u00A6\\u008C\\u00C0\\u00C65\\u00E2\\\"\\u0084\\u00AD&\\u00C3\\u00AD\\u00E4p\\u00BB\\u00B0p<r\\b\\u00F8\\x12\\u0094\\u0092\\x1D\\u00A8\\u0093\\u00DB\\t\\u00FC\\u00CD\\u00CC%yvD\\\"\\u0088\\u00EB\\u00A8\\x1D\\u00F8Q\\x0E\\u00DA\\u00DE1\\x1DC\\x1C&\\u00D1E\\u00ED\\x110\\\"6\\u00EE\\u00C5\\x02E\\u00A4\\u00FEk\\u00C9\\u00A4\\u00EB\\u009D\\u00B8\\u00C9'u\\u00DBZw\\x12\\u00C6%4\\r\\u00CBp\\u00DD\\u00D9\\u00EC?\\u00E4\\b\\u00D5\\u00C5\\u00F1 \\u00CB\\u00B2+p\\u00B9\\x05\\u00ECk\\u00EF\\x18K3r\\u00AC\\x18\\x10\\u00BA!\\u00AB\\u008D\\u00CDyh\\u00A6\\u00C5\\u0099\\u009B\\u0089R\\u00E6P\\u00D8S\\by\\u0080\\x03^G\\u0082\\u0088\\u0088\\u00BB8\\u00EB\\x0E\\u00C0\\u00DAY\\u00D4\\u00B5\\u00CEd\\u00D4\\u00A9Xt\\x1C\\u00F7\\u00D5\\u00A2\\u00D45d\\u00D9\\u00B6F?j\\u00F0i\\u0094\\x1BS\\u00D4\\u0089\\u00ED\\u00B5`\\x1C_V\\u00BB\\x1E\\x11\\u00B7\\u008B;\\u0089O\\x1B}\\u00B8\\u00A6\\u00A8Q\\x11\\u00B15\\x1Ew\\\\A\\u00CB5\\u00C6i\\u00BB\\x12\\bSO\\u00E6\\u009D\\u00C4!\\u00A7z\\u00EF\\x1D\\u008C\\u00DBN\\x0F\\u009C)\\u00E1|\\u00B7\\u00F7<E\\u00CD\\u00AD \\u00C3/\\u00FB?\\x16l!\\u00DB\\r\\u00E5@I\\u00E6:`\\u00D9\\u0088\\u0098,$\\u00E5[\\u00FC\\u00BCN\\u00BF\\x19a\\u00E1\\u0085d\\u00B6\\u008D\\u00B8f#k\\u00B3\\u00A8eV7wx\\u00EFm\\u00A4\\x0B\\u00D9I\\u00E9\\u00A9q\\u0084\\u008B\\u00B3h9\\x19\\u00FCqg_1}\\u00F4J\\x12\\u00CFQ\\x05\\u00EC\\u00C4CFz\\u00ED\\u00D5e\\u0094\\u00938!\\u00BD\\u0086k\\f$v\\u00E3QM\\x16\\u00B6\\x18\\\\\\u008C\\u00C5\\u00E2aq\\u00FB\\u009C\\u0098B\\u00D7\\u00F1\\u008A\\u00F7nS\\u00DC\\u00F5(\\u00A1\\u0080\\u00B6,I\\t\\x1AL\\u00FD\\u00EB\\u00E6\\u00ED\\u00A9\\u00A3\\u00BC\\u00AD\\u00C50\\u00FFv2\\u0099i\\u009A\\u00E0:\\\\\\u00B0\\u00C1\\u009B\\u00B7C/w\\u00BA\\u008Bi4\\u00C2{\\u00D3\\u00D4\\u00AD_X\\u00AB\\u00F0\\u00D6\\u00AC-\\\\M\\u00E2*\\n\\u00EC\\u00AD\\\",6!\\u00CCn\\u00EA\\u00DD\\x0B\\bY\\x17\\u00D8S\\u00C9\\u00F3\\u00AA\\\\\\x0B\\u009A\\u0080\\u00E7R\\u008FZ\\x11:\\u00C5\\u00A1\\u00CF&\\u00AE\\u00F6p\\u00CF$\\u00B4_\\u00E6<\\u00B4\\u0094\\u00BFV?\\u00E2:\\u00ABp\\u00E1\\x02:\\u0096\\u00EE\\u00D4\\u00D2\\u0083\\u0081\\x03\\u008D\\u00C6\\x15\\u00DF 9\\u00D5`\\u00BD\\x04\\u00FB\\x07\\u00D1 \\u00E4\\u00E2MCP\\u00F0\\u008E4\\x1DW\\u008A\\x04\\u00B8\\u0095\\u00B0\\u0099\\u009F\\u00D0\\u00FF\\u00C1+h\\u008B\\u0092\\u00DC\\x10\\u00FBz\\u0082\\u00DF\\u0099|o\\u00C6\\u00ED\\u00CA\\u00D3\\u00B8t\\t\\u00AE\\u0093O\\u00A3\\u00BD\\u009F&zJ\\x1A\\x0FqG\\x0FZ\\u00AC\\u009ENS^\\u008F\\u00B0\\u00A5|\\u00B7\\x10x\\u0089\\u00B2\\u0090\\u00DDF\\u0082l\\u00E0\\x19v\\u009D\\u00F0\\u00B7\\x00\\x03\\x00\\u0098\\x12CR\\u00C5\\u00A3\\u00F0\\u00D2\\x00\\x00\\x00\\x00IEND\\u00AEB`\\u0082\"];\n var logoFile = new File(new Folder(Folder.temp).fsName+\"/tempLogoImage.png\"); //temporary file for binary image\n logoFile.encoding = \"BINARY\";\n logoFile.open( \"w\" );\n logoFile.write( logoBinary );\n logoFile.close();\n \n pal.grp.logoGroup.logoImage.image = logoFile;\n \n //no longer need the temp file, remove it.\n logoFile.remove();\n \n pal.grp.mainGroup.mainText.text = \"Mark selected layers with\\nthe following text:\";\n \n // dynamic\n pal.grp.mainGroup.dynBtn.text = \"dynamic\";\n pal.grp.mainGroup.dynBtn.onClick = function () {setMarker (\"dynamic\")};\n \n // text middle align\n pal.grp.mainGroup.tvaMidBtn.text = \"textVAlign=.5\";\n pal.grp.mainGroup.tvaMidBtn.onClick = function () {setMarker (\"textVAlign=.5\")};\n \n // text bottom align\n pal.grp.mainGroup.tvaBtmBtn.text = \"textVAlign=1\";\n pal.grp.mainGroup.tvaBtmBtn.onClick = function () {setMarker (\"textVAlign=1\")};\n \n // marker remover button\n pal.grp.mainGroup.removerBtn.text = \"Remove markers\";\n pal.grp.mainGroup.removerBtn.onClick = removeMarkers;\n \n return pal;\n } catch(e) {\n alert(e.line+\"\\r\"+e.toString());\n }\n }", "function generateUI() {\n var modelToolBar = new ModelToolbar();\n mainParent.append(modelToolBar.ui);\n setLocation(mainParent, modelToolBar.ui, 'left', 'top');\n // modelToolBar.updateInputLength();\n\n var contextMenu = new ContextMenu();\n mainParent.append(contextMenu.ui);\n setPosition(contextMenu.ui, 100, 100)\n\n var surfaceMenu = new SurfaceMenu();\n mainParent.append(surfaceMenu.ui);\n setLocation(mainParent, surfaceMenu.ui, 'right', 'top', 0, modelToolBar.ui.height() + 5);\n\n\n var selectionBox = new SelectionBox(icons.select);\n mainParent.append(selectionBox.ui);\n setLocation(mainParent, selectionBox.ui, 'left', 'top', 0, modelToolBar.ui.height() + 5);\n\n // Fixing Context Menu Behaviour\n selectionBox.ui.on('mousedown', () => {\n stateManager.exitContextMenu();\n });\n\n surfaceMenu.ui.on('mousedown', () => {\n stateManager.exitContextMenu();\n });\n\n return {\n modelToolBar: modelToolBar,\n selectionBox: selectionBox,\n contextMenu: contextMenu,\n surfaceMenu: surfaceMenu\n }\n }", "buildResource() {\n // VCN\n const vcn_id = this.createInput('select', 'Virtual Cloud Network', `${this.id}_vcn_id`, '', (d, i, n) => this.resource.vcn_id = n[i].value)\n this.vcn_id = vcn_id.input\n this.append(this.core_tbody, vcn_id.row)\n // Service\n const service_name_data = {\n options: {\n All: 'All Services', \n OCI: 'Object Storage'\n }\n } \n const service_name = this.createInput('select', 'Service', `${this.id}_service_name`, '', (d, i, n) => this.resource.service_name = n[i].value, service_name_data)\n this.service_name = service_name.input\n this.append(this.core_tbody, service_name.row)\n // Route Table\n const route_table_id = this.createInput('select', 'Route Table', `${this.id}_route_table_id`, '', (d, i, n) => this.resource.route_table_id = n[i].value)\n this.route_table_id = route_table_id.input\n this.append(this.core_tbody, route_table_id.row)\n }", "ready() {\n super.ready();\n\n const that = this;\n\n that._id = that.getAttribute('id') || Math.round(Math.random() * 10000);\n\n that._cachedWidth = that.offsetWidth;\n that._cachedHeight = that.offsetHeight;\n\n that._coordinates = [];\n that._getDefaultCellValue();\n that._validateProperties();\n that._addInitialDimensions();\n\n if (that.type !== 'none') {\n that._addElementStructure();\n that._structureAdded = true;\n that._initializeElements(false);\n }\n\n that._getInitialFill();\n that._updateWidgetWidth();\n that._updateWidgetHeight();\n\n that._cachedWidth = that.offsetWidth;\n that._cachedHeight = that.offsetHeight;\n }", "setupSchema() {\n\t\tfor (const type in this.Definition) {\n\t\t\tif (this.Definition.hasOwnProperty(type)) {\n\t\t\t\t// console.log(type);\n\t\t\t\tconst typeDef = this.Definition[type];\n\t\t\t\tthis.Schema[type] = oas.compile(typeDef);\n\t\t\t}\n\t\t}\n\t\tfor (const type in this.precompiled) {\n\t\t\tif (this.precompiled.hasOwnProperty(type)) {\n\t\t\t\t// console.log(type);\n\t\t\t\tconst typeDef = this.precompiled[type];\n\t\t\t\tthis.Schema[type] = typeDef;\n\t\t\t}\n\t\t}\n\t}", "createSchema() {\n this.schema = this.extensionManager.schema;\n }", "function buildUI (thisObj ) {\n var H = 25; // the height\n var W = 30; // the width\n var G = 5; // the gutter\n var x = G;\n var y = G;\n var rownum = 1;\n var columnnum = 3;\n var gutternum = 2;\n var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'Connect With Path',[0,0,gutternum*G + W*columnnum,gutternum*G + H*rownum],{resizeable: true});\n if (win !== null) {\n\n // win.check_box = win.add('checkbox',[x,y,x+W*2,y + H],'check');\n // win.check_box.value = metaObject.setting1;\n win.do_it_button = win.add('button', [x ,y,x+W*3,y + H], 'connect them');\n // win.up_button = win.add('button', [x + W*5+ G,y,x + W*6,y + H], 'Up');\n\n // win.check_box.onClick = function (){\n // alert(\"check\");\n // };\n win.do_it_button.onClick = function () {\n connect_all_layers();\n };\n\n }\n return win;\n}", "buildResource() {\n // VCN\n const vcn_id = this.createInput('select', 'Virtual Cloud Network', `${this.id}_vcn_id`, '', (d, i, n) => {this.resource.vcn_id = n[i].value;})\n this.vcn_id = vcn_id.input\n this.append(this.core_tbody, vcn_id.row)\n // DRG\n const drg_id = this.createInput('select', 'Dynamic Routing Gateway', `${this.id}_drg_id`, '', (d, i, n) => {this.resource.drg_id = n[i].value})\n this.drg_id = drg_id.input\n this.append(this.core_tbody, drg_id.row)\n }", "function rd_Approximate_buildUI(thisObj)\r\n {\r\n var pal = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", rd_ApproximateData.scriptName, undefined, {resizeable:true});\r\n \r\n if (pal !== null)\r\n {\r\n var res = \r\n \"group { \\\r\n orientation:'column', alignment:['fill','top'], \\\r\n header: Group { \\\r\n alignment:['fill','top'], \\\r\n title: StaticText { text:'\" + rd_ApproximateData.scriptName + \"', alignment:['fill','center'] }, \\\r\n help: Button { text:'\" + rd_Approximate_localize(rd_ApproximateData.strHelp) +\"', maximumSize:[30,20], alignment:['right','center'] }, \\\r\n }, \\\r\n r1: Group { \\\r\n alignment:['fill','top'], \\\r\n proxyType: StaticText { text:'\" + rd_Approximate_localize(rd_ApproximateData.strType) + \"' }, \\\r\n proxyTypeList: DropDownList { properties:{items:\" + rd_Approximate_localize(rd_ApproximateData.strTypeOpts) + \"}, alignment:['fill','top'], preferredSize:[-1,20] }, \\\r\n }, \\\r\n r4: Group { \\\r\n alignment:['fill','top'], \\\r\n r4left: Group { \\\r\n orientation:'column', alignment:['fill','center'], \\\r\n r4top: Group { \\\r\n alignment:['fill','top'], \\\r\n rsTpl: StaticText { text:'\" + rd_Approximate_localize(rd_ApproximateData.strRSTemplate) + \"' }, \\\r\n rsTplList: DropDownList { alignment:['fill','top'], alignment:['fill','top'], preferredSize:[-1,20] }, \\\r\n }, \\\r\n r4btm: Group { \\\r\n alignment:['fill','top'], \\\r\n omTpl: StaticText { text:'\" + rd_Approximate_localize(rd_ApproximateData.strOMTemplate) + \"' }, \\\r\n omTplList: DropDownList { alignment:['fill','top'], alignment:['fill','top'], preferredSize:[-1,20] }, \\\r\n }, \\\r\n }, \\\r\n refresh: Button { text:'\" + rd_Approximate_localize(rd_ApproximateData.strRefresh) + \"', alignment:['right','center'], preferredSize:[-1,20] }, \\\r\n }, \\\r\n r5: Group { \\\r\n alignment:['fill','top'], \\\r\n outFolder: StaticText { text:'\" + rd_Approximate_localize(rd_ApproximateData.strOutFolder) + \"' }, \\\r\n outFolderName: EditText { text:'', characters:20, alignment:['fill','top'], preferredSize:[-1,20] }, \\\r\n outFolderBrowse: Button { text:'\" + rd_Approximate_localize(rd_ApproximateData.strOutFolderBrowse) + \"', alignment:['right','top'], preferredSize:[-1,20] }, \\\r\n }, \\\r\n r6: Group { \\\r\n alignment:['fill','top'], \\\r\n outName: StaticText { text:'\" + rd_Approximate_localize(rd_ApproximateData.strOutName) + \"' }, \\\r\n outNameTpl: EditText { text:'[compName]_[layerName].[fileExtension]', characters:20, alignment:['fill','top'], preferredSize:[-1,20] }, \\\r\n }, \\\r\n r7: Group { \\\r\n alignment:['fill','top'], \\\r\n filler: StaticText { text:'' }, \\\r\n proxyNameSameAsSource: Checkbox { text:'\" + rd_Approximate_localize( rd_ApproximateData.strUseSourceNameForProxy ) + \"' }, \\\r\n }, \\\r\n cmds: Group { \\\r\n alignment:['right','top'], \\\r\n unsetProxyBtn: Button { text:'\" + rd_Approximate_localize(rd_ApproximateData.strUnsetProxy) + \"', preferredSize:[-1,20] }, \\\r\n setProxyBtn: Button { text:'\" + rd_Approximate_localize(rd_ApproximateData.strSetProxy) + \"', preferredSize:[-1,20] }, \\\r\n }, \\\r\n }\";\r\n pal.grp = pal.add(res);\r\n \r\n pal.grp.r1.proxyType.preferredSize.width = \r\n pal.grp.r4.r4left.r4btm.omTpl.preferredSize.width = \r\n pal.grp.r5.outFolder.preferredSize.width = \r\n pal.grp.r6.outName.preferredSize.width = \r\n pal.grp.r7.filler.preferredSize.width = \r\n pal.grp.r4.r4left.r4top.rsTpl.preferredSize.width;\r\n \r\n pal.grp.r4.r4left.r4btm.margins.top -= 5;\r\n pal.grp.cmds.margins.top += 5;\r\n \r\n pal.layout.layout(true);\r\n pal.grp.minimumSize = pal.grp.size;\r\n pal.layout.resize();\r\n pal.onResizing = pal.onResize = function () {this.layout.resize();}\r\n \r\n pal.grp.r1.proxyTypeList.selection = 0;\r\n pal.grp.r1.proxyTypeList.onChange = function ()\r\n {\r\n var proxyType = this.selection.index;\r\n \r\n if ((proxyType === 0) || (proxyType === 4))\t// Still or Sequence\r\n {\r\n // Try to auto-match a Best Settings RS / Photoshop OM template\r\n var listItems = this.parent.parent.r4.r4left.r4top.rsTplList;\r\n for (var i=0; i<listItems.items.length; i++)\r\n {\r\n if (listItems.items[i].text === \"Best Settings\")\r\n {\r\n listItems.selection = i;\r\n break;\r\n }\r\n }\r\n \r\n listItems = this.parent.parent.r4.r4left.r4btm.omTplList;\r\n for (var i=0; i<listItems.items.length; i++)\r\n {\r\n if (listItems.items[i].text === \"Photoshop\")\r\n {\r\n listItems.selection = i;\r\n break;\r\n }\r\n }\r\n \r\n this.parent.parent.r6.outNameTpl.text = \"[compName]_[#####].[fileExtension]\";\r\n }\r\n else if (proxyType === 1)\t// Movie\r\n {\r\n // Try to auto-match a Draft Settings RS / Lossless with Alpha OM template\r\n var listItems = this.parent.parent.r4.r4left.r4top.rsTplList;\r\n for (var i=0; i<listItems.items.length; i++)\r\n {\r\n if (listItems.items[i].text === \"Draft Settings\")\r\n {\r\n listItems.selection = i;\r\n break;\r\n }\r\n }\r\n \r\n listItems = this.parent.parent.r4.r4left.r4btm.omTplList;\r\n for (var i=0; i<listItems.items.length; i++)\r\n {\r\n if (listItems.items[i].text === \"Lossless with Alpha\")\r\n {\r\n listItems.selection = i;\r\n break;\r\n }\r\n }\r\n \r\n this.parent.parent.r6.outNameTpl.text = \"[compName].[fileExtension]\";\r\n }\r\n \r\n // Using a proxy file name the same as source is appropriate only for Movie mode\r\n this.parent.parent.r7.proxyNameSameAsSource.enabled = (proxyType === 1);\r\n \r\n // Enable or disable controls as appropriate\r\n var enableCtrls = ((proxyType === 0) || (proxyType === 1) || (proxyType === 4));\r\n this.parent.parent.r4.enabled = this.parent.parent.r5.enabled = this.parent.parent.r6.enabled = enableCtrls;\t\t\t\t\t\r\n \r\n this.parent.parent.cmds.setProxyBtn.text = (proxyType === 2) ? rd_Approximate_localize(rd_ApproximateData.strSetProxyMore) : rd_Approximate_localize(rd_ApproximateData.strSetProxy);\r\n }\r\n \r\n pal.grp.r4.refresh.onClick = function ()\r\n {\r\n rd_Approximate_doRefreshTemplates(this.parent.parent.parent);\r\n }\r\n pal.grp.r5.outFolderBrowse.onClick = function ()\r\n {\r\n var defaultFolder = this.parent.outFolderName.text;\r\n if ((defaultFolder === \"\") && (app.project.file !== null))\r\n {\r\n // Default to the current folder of the project file, so it's easier to create a subfolder for proxies next to the project file.\r\n defaultFolder = app.project.file.path;\r\n }\r\n if ($.os.indexOf(\"Windows\") !== -1)\t\t\t\t// On Windows, escape backslashes first\r\n defaultFolder = defaultFolder.replace(\"\\\\\", \"\\\\\\\\\");\r\n \r\n var folder = Folder.selectDialog(\"Output To Folder\", defaultFolder);\r\n if (folder !== null)\r\n this.parent.outFolderName.text = folder.fsName;\r\n }\r\n \r\n pal.grp.r7.proxyNameSameAsSource.onClick = function ()\r\n {\r\n this.parent.parent.r6.outNameTpl.enabled = !this.value;\r\n }\r\n \r\n pal.grp.header.help.onClick = function () {alert(rd_ApproximateData.scriptTitle + \"\\n\" + rd_Approximate_localize(rd_ApproximateData.strHelpText), rd_ApproximateData.scriptName);}\r\n pal.grp.cmds.unsetProxyBtn.onClick = rd_Approximate_doUnsetProxy;\r\n pal.grp.cmds.setProxyBtn.onClick = rd_Approximate_doApproximate;\r\n \r\n pal.grp.cmds.margins.top += 5;\r\n }\r\n \r\n return pal;\r\n }", "init() {\n // Add label\n $sel.append('text.tk-atlas.text-menWomen')\n .text(d => `${d.key}'s`)\n\n const container = $sel.append('div.container')\n\n // Add svg for front pockets\n\t\t\t\tbrands = container.selectAll('.fit-brand')\n .data(d => d.values)\n .enter()\n .append('div.area-front')\n .attr('class', 'fit-brand visible')\n\n display = brands.append('div.display')\n let tooltip = brands.append('div.tooltip')\n\n $svg = display.append('svg.fit-canvas')\n const text = display.append('div.text')\n text.append('text.brand.tk-atlas').text(d => d.brand)\n text.append('text.style.tk-atlas').text(d => d.updatedStyle)\n\n let toolText = tooltip.append('div.tooltip-text')\n const dollars = d3.format(\"$.2f\")\n\n toolText.append('text.tk-atlas').text(d => d.name)\n toolText.append('text.tk-atlas').text(d => `${dollars(d.price)}`)\n toolText.append('text.tk-atlas').text(d => d.fabric)\n\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g.g-vis');\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "buildResource() {\n // VCN\n const vcn_id = this.createInput('select', 'Virtual Cloud Network', `${this.id}_vcn_id`, '', (d, i, n) => {this.resource.vcn_id = n[i].value; this.vcnChanged()})\n this.vcn_id = vcn_id.input\n this.append(this.core_tbody, vcn_id.row)\n // DRG\n const drg_id = this.createInput('select', 'Dynamic Routing Gateway', `${this.id}_drg_id`, '', (d, i, n) => {this.resource.drg_id = n[i].value; this.drgChanged()})\n this.drg_id = drg_id.input\n this.append(this.core_tbody, drg_id.row)\n // Advanced\n const advanced = this.createDetailsSection('Advanced', `${this.id}_advanced_details`)\n this.append(this.properties_contents, advanced.details)\n this.advanced_div = advanced.div\n const advanced_table = this.createTable('', `${this.id}_advanced`)\n this.advanced_tbody = advanced_table.tbody\n this.append(this.advanced_div, advanced_table.table)\n // VCN Route Table\n const route_table_id = this.createInput('select', 'VCN Route Table', `${this.id}_route_table_id`, '', (d, i, n) => {this.resource.route_table_id = n[i].value; this.redraw()})\n this.route_table_id = route_table_id.input\n this.append(this.advanced_tbody, route_table_id.row)\n // DRG Route Table\n const drg_route_table_id = this.createInput('select', 'DRG Route Table', `${this.id}_drg_route_table_id`, '', (d, i, n) => {this.resource.drg_route_table_id = n[i].value; this.redraw()})\n this.drg_route_table_id = drg_route_table_id.input\n this.append(this.advanced_tbody, drg_route_table_id.row)\n }", "function FormDesigner() {\n\t\t\tvar getJsObjectForProperty = function(container, property, value) {\n\t\t\t\tvar defaultValue = \"\";\n\t\t\t\tif(typeof value !== \"undefined\") {\n\t\t\t\t\tdefaultValue = value;\n\t\t\t\t} else if(typeof property[\"default\"] !== \"undefined\") {\n\t\t\t\t\tdefaultValue = property[\"default\"];\n\t\t\t\t}\n\t\t\t\tvar element;\n\t\t\t\tswitch(property[\"htmlFieldType\"]) {\n\t\t\t\t\tcase \"Hidden\": \n\t\t\t\t\t\telement = new HiddenElement(container, property[\"displayName\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MultiChoice\" :\n\t\t\t\t\t\telement = new MultiChoiceSelectElement(container, property[\"displayName\"], property[\"helpText\"], property[\"options\"], property[\"default\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"MultiText\":\n\t\t\t\t\t\telement = new MultiChoiceTextElement(container, property[\"displayName\"], property[\"helpText\"], property[\"default\"], property[\"placeholder\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Select\":\n\t\t\t\t\t\telement = new SelectElement(container, property[\"displayName\"], property[\"options\"], property[\"helpText\"]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"Editor\":\n\t\t\t\t\t\telement = new EditorElement(container, property[\"displayName\"], property[\"helpText\"], property[\"editorOptions\"]); /*the last argument should be editor options */\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"History\":\n\t\t\t\t\t\telement = new HistoryElement(container, property[\"displayName\"], true); \n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"TextElement\":\n\t\t\t\t\t\telement = new TextElement(container, property[\"displayName\"]); \n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"TextDisplay\":\n\t\t\t\t\t\telement = new TextDisplay(container, property[\"displayName\"]); \n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(defaultValue !== \"\") {\n\t\t\t\t\telement.setValue(defaultValue);\n\t\t\t\t}\n\t\t\t\treturn element;\n\t\t\t}\n\n\t\t\tvar drawEditableObject = function(container, metadata, object) {\n\t\t\t\tvar resultObject = {};\n\t\t\t\tresultObject = $.extend(true, {}, metadata); //make a deep copy\n\t\t\t\t\n\t\t\t\t//creating property div containers\n\t\t\t\tvar html = '<form class=\"form-horizontal\" role=\"form\" class=\"create-form\">';\n\t\t\t\t\thtml += '<div class=\"col-sm-offset-3 col-sm-9 response-container alert alert-dismissible\" role=\"alert\">'; \n\t\t\t\t\t\thtml += '<button type=\"button\" class=\"close\" data-dismiss=\"alert\"><span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span></button>';\n\t\t\t\t\t\thtml += '<span class=\"message\"></span>'\n\t\t\t\t\thtml += \"</div>\";\n\t\t\t\t\thtml += '<div class=\"form-container\">';\n\t\t\t\t\t\tfor(var i = 0; i < metadata[\"propertyOrder\"].length; i++) {\n\t\t\t\t\t\t\tvar propertyKey = metadata[\"propertyOrder\"][i];\n\t\t\t\t\t\t\tif(metadata[\"properties\"][propertyKey][\"htmlFieldType\"] != \"Hidden\") {\n\t\t\t\t\t\t\t\thtml += '<div class=\"form-group ' + propertyKey + \"-id\" + '\"></div>';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\thtml += '<div class=\"' + propertyKey + \"-id\" + '\"></div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//this gives us a space for the buttons/events\n\t\t\t\t\t\thtml += '<div class=\"col-sm-offset-3 col-sm-9 event-container\">'; \n\t\t\t\t\t\thtml += \"</div>\";\n\t\t\t\t\thtml += \"<br/><br/></div>\";\n\t\t\t\thtml += '</form>';\n\t\t\t\t$(container).html(html);\n\t\t\t\t\n\t\t\t\t//now add js elements to property div containers\n\t\t\t\tfor(property in resultObject[\"properties\"]) {\n\t\t\t\t\tvar propertyContainer = container + ' .' + property + \"-id\";\n\t\t\t\t\tresultObject[\"properties\"][property] = getJsObjectForProperty(propertyContainer, resultObject[\"properties\"][property], object[property]);\n\t\t\t\t}\n\t\t\t\tresultObject[\"metadata\"] = {};\n\t\t\t\tresultObject[\"metadata\"][\"properties\"] = metadata[\"properties\"];\n\t\t\t\t$(container + \" .response-container\").hide();\n\t\t\t\tresultObject[\"showError\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"success\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"warning\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-danger\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tresultObject[\"showWarning\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"success\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"error\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-warning\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t}\n\n\t\t\t\tresultObject[\"showSuccess\"] = function(message) {\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"warning\");\n\t\t\t\t\t$(container + \" .response-container\").removeClass(\"error\");\n\t\t\t\t\t$(container + \" .response-container\").addClass(\"alert-success\");\n\t\t\t\t\t$(container + \" .response-container span.message\").html(message);\n\t\t\t\t\t$(container + \" .response-container\").show();\n\t\t\t\t}\n\t\t\t\tresultObject[\"clearValues\"] = function() {\n\t\t\t\t\tfor(property in resultObject[\"properties\"]) {\n\t\t\t\t\t\tresultObject[\"properties\"][property].setValue(resultObject[\"metadata\"][\"properties\"][property][\"default\"]); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn resultObject;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdrawEditableObject : drawEditableObject\n\t\t\t}\n\t\t}", "function _buildElements() {\n\t\t\t_buildGroup(_settings.layout.left);\n\t\t\t_buildGroup(_settings.layout.right, -1);\n\t\t\t_buildGroup(_settings.layout.center);\n\t\t}", "_build(){\n\t\tthis._wrapper.classList.add('mvc-wrapper');\n\t\tif(this._parameters.stylised) this._wrapper.classList.add('mvc-stylised');\n\n\t\t/*\n\t\t *\tVolume Input\n\t\t */\n\t\tlet line = document.createElement('p');\n\n\t\tline.classList.add('mvc-volume-wrapper');\n\n\t\tthis._wrapper.appendChild(line);\n\n\t\tlet label = document.createElement('span');\n\n\t\tlabel.classList.add('mvc-label');\n\t\tlabel.innerHTML = this._translated().volume + ' (m<sup>3</sup>)';\n\t\tline.appendChild(label);\n\n\t\t/** @private */\n\t\tthis._volumeInput = document.createElement('input');\n\t\tthis._volumeInput.classList.add('mvc-volume-input');\n\t\tline.appendChild(this._volumeInput);\n\n\t\t/** @private */\n\t\tthis._quickValidator = document.createElement('button');\n\t\tthis._quickValidator.classList.add('mvc-volume-validate');\n\t\tthis._quickValidator.innerHTML = 'OK';\n\t\tline.appendChild(this._quickValidator);\n\n\t\t/*\n\t\t *\tSurface toggler\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-surface-toggler');\n\t\tthis._wrapper.appendChild(line);\n\n\t\t/** @private */\n\t\tthis._surfaceOption = document.createElement('a');\n\t\tthis._surfaceOption.classList.add('mvc-surface-enable');\n\t\tthis._surfaceOption.innerText = this._translated().surfaceOptionEnable;\n\t\tthis._surfaceOption.href = '';\n\t\tline.appendChild(this._surfaceOption);\n\n\t\t/*\n\t\t *\tSurface Input\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-hidden', 'mvc-surface-wrapper');\n\t\tthis._wrapper.appendChild(line);\n\n\t\tlabel = document.createElement('span');\n\t\tlabel.classList.add('mvc-label');\n\t\tlabel.innerHTML = this._translated().surface + ' (m<sup>2</sup>)';\n\t\tline.appendChild(label);\n\n\t\t/** @private */\n\t\tthis._surfaceInput = document.createElement('input');\n\t\tthis._surfaceInput.classList.add('mvc-surface-input');\n\t\tline.appendChild(this._surfaceInput);\n\n\t\t/*\n\t\t *\tRooms toggler\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-rooms-toggler', 'mvc-hidden');\n\t\tthis._wrapper.appendChild(line);\n\n\t\t/** @private */\n\t\tthis._roomsOption = document.createElement('a');\n\t\tthis._roomsOption.classList.add('mvc-rooms-enable');\n\t\tthis._roomsOption.innerText = this._translated().roomsOptionEnable;\n\t\tthis._roomsOption.href = '';\n\t\tline.appendChild(this._roomsOption);\n\n\t\t/*\n\t\t *\tRooms choice\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-rooms-wrapper', 'mvc-hidden');\n\t\tthis._wrapper.appendChild(line);\n\n\t\tconst roomsList = document.createElement('ul');\n\n\t\troomsList.classList.add('mvc-rooms');\n\t\tline.appendChild(roomsList);\n\n\t\t/** @private */\n\t\tthis._roomsCancel = [];\n\n\t\tObject.entries(this._rooms).forEach(([room, infos]) => {\n\t\t\tconst \tli = document.createElement('li'),\n\t\t\t\t\tspan = document.createElement('span'),\n\t\t\t\t\tcancel = document.createElement('p'),\n\t\t\t\t\tsurface = document.createElement('p');\n\n\t\t\tli.setAttribute('data-type', room);\n\t\t\tli.setAttribute('data-amount', '0');\n\t\t\tspan.innerText = this._translated()[room];\n\n\t\t\t//Create an img tag if needed\n\t\t\ttry{\n\t\t\t\tnew URL(infos.icon);\n\t\t\t\tconst icon = document.createElement('img');\n\n\t\t\t\ticon.src = infos.icon;\n\t\t\t\ticon.classList.add('mvc-rooms-icon');\n\t\t\t\tli.appendChild(icon);\n\t\t\t}catch(_){\n\t\t\t\tli.innerHTML = infos.icon;\n\t\t\t\tli.firstElementChild.classList.add('mvc-rooms-icon');\n\t\t\t}\n\n\t\t\tcancel.classList.add('mvc-rooms-cancel');\n\t\t\tcancel.innerText = 'x';\n\n\t\t\tsurface.classList.add('mvc-rooms-surface');\n\t\t\tsurface.innerText = '~' + infos.surface + 'm²';\n\n\t\t\tli.appendChild(span);\n\t\t\tli.appendChild(cancel);\n\t\t\tli.appendChild(surface);\n\t\t\troomsList.appendChild(li);\n\n\t\t\tthis._roomsCancel.push(cancel);\n\t\t});\n\n\t\t/** @private */\n\t\tthis._roomsList = Array.from(roomsList.children);\n\n\t\t/*\n\t\t *\tValidator\n\t\t */\n\t\tline = document.createElement('p');\n\t\tline.classList.add('mvc-validate', 'mvc-hidden');\n\t\tthis._wrapper.appendChild(line);\n\n\t\tthis._validator = document.createElement('button');\n\t\tthis._validator.innerText = this._translated().validateButton;\n\t\tline.appendChild(this._validator);\n\t\t\n\t}", "_rebuildForm() {\n //console.log(\"_rebuildForm\",this.value,this.schema);\n this._clearForm();\n if (this.schema) {\n let formProperties = this._getProperties(this.schema);\n formProperties.forEach(property => this._buildFormElement(property));\n }\n }", "buildControls (schemaList) {\n schemaList.forEach(schema => {\n const type = schema.$type\n let controlCls = controlReg.getControl(type)\n\n if (!controlCls) {\n console.error('no control type:' + type)\n } else {\n this.addControl(new controlCls(schema))\n }\n })\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}", "buildLayout(){\r\n this.phaseElement.id = \"rid-opacity\";\r\n\r\n this.sidebar.classList.add(\"sidebar\");\r\n \r\n this.turnImage.classList.add(\"player-img\")\r\n \r\n this.turnImageContainer.classList.add(\"player-img-container\");\r\n this.turnImageContainer.appendChild(this.turnImage);\r\n\r\n this.sidebar.append(this.turnImageContainer);\r\n\r\n this.renderPlayerImg();\r\n\r\n this.createTurnOrder();\r\n this.updateTurnOrder();\r\n\r\n this.createMap();\r\n this.sidebar.appendChild(this.btnContainer);\r\n this.gameWindowElement.append(this.sidebar);\r\n \r\n }", "async function makeVisualization(){\n {\n console.log(\"loading local data\");\n data = await getData('dataSelection.json');\n }\n console.log({ data });\n \n setupScales();\n setupAxes(group);\n drawBars(group);\n setupInput();\n }", "function buildDocDef()\n {\n prepareDocDef();\n // //\\\\ builds content\n methods.composeFrontPage();\n methods.composeSection1();\n methods.composeSection2();\n methods.composeSection3();\n methods.composeSection4();\n methods.composeSection5();\n methods.composeSection8();\n\n /*\n */\n methods.composeBottomPage();\n ddDef.content = ddCont;\n // \\\\// builds content\n }", "function createInitialLayout() {\n return {\n name: 'grid',\n boundingBox: presetBoundingBox,\n }\n}", "function renderVisuals() {\n\n // render only if report and visuals initialized\n if (!LayoutShowcaseState.layoutReport || !LayoutShowcaseState.layoutVisuals)\n return;\n\n // Get models. models contains enums that can be used\n const models = window['powerbi-client'].models;\n\n // Get embedContainer width and height\n let pageWidth = $('#embedContainer').width();\n let pageHeight = $('#embedContainer').height();\n\n // Calculating the overall width of the visuals in each row\n let visualsTotalWidth = pageWidth - (LayoutShowcaseConsts.margin * (LayoutShowcaseState.columns + 1));\n\n // Calculate the width of a single visual, according to the number of columns\n // For one and three columns visuals width will be a third of visuals total width\n let width = (LayoutShowcaseState.columns === ColumnsNumber.Two) ? (visualsTotalWidth / 2) : (visualsTotalWidth / 3);\n\n // For one column, set page width to visual's width with margins\n if (LayoutShowcaseState.columns === ColumnsNumber.One) {\n pageWidth = width + 2 * LayoutShowcaseConsts.margin;\n\n // Check if page width is smaller than minimum width and update accordingly\n if (pageWidth < LayoutShowcaseConsts.minPageWidth) {\n pageWidth = LayoutShowcaseConsts.minPageWidth;\n\n // Visuals width is set to fit minimum page width with margins on both sides\n width = LayoutShowcaseConsts.minPageWidth - 2 * LayoutShowcaseConsts.margin;\n }\n }\n\n // Set visuals height according to width - 9:16 ratio\n const height = width * (9 / 16);\n\n // Visuals starting point\n let x = LayoutShowcaseConsts.margin, y = LayoutShowcaseConsts.margin;\n\n // Filter the visuals list to display only the checked visuals\n let checkedVisuals = LayoutShowcaseState.layoutVisuals.filter(function (visual) { return visual.checked; });\n\n // Calculate the number of lines\n const lines = Math.ceil(checkedVisuals.length / LayoutShowcaseState.columns);\n\n // Calculate page height with margins\n pageHeight = Math.max(pageHeight, ((lines * height) + ((lines + 1) * LayoutShowcaseConsts.margin)));\n\n // Building visualsLayout object\n // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Custom-Layout\n let visualsLayout = {};\n for (let i = 0; i < checkedVisuals.length; i++) {\n visualsLayout[checkedVisuals[i].name] = {\n x: x,\n y: y,\n width: width,\n height: height,\n displayState: {\n\n // Change the selected visuals display mode to visible\n mode: models.VisualContainerDisplayMode.Visible\n }\n }\n\n // Calculating (x,y) position for the next visual\n x += width + LayoutShowcaseConsts.margin;\n if (x >= pageWidth) {\n x = LayoutShowcaseConsts.margin;\n y += height + LayoutShowcaseConsts.margin;\n }\n }\n\n // Building pagesLayout object\n let pagesLayout = {};\n pagesLayout[LayoutShowcaseState.layoutPageName] = {\n defaultLayout: {\n displayState: {\n\n // Default display mode for visuals is hidden\n mode: models.VisualContainerDisplayMode.Hidden\n }\n },\n visualsLayout: visualsLayout\n };\n\n // Building settings object\n let settings = {\n layoutType: models.LayoutType.Custom,\n customLayout: {\n pageSize: {\n type: models.PageSizeType.Custom,\n width: pageWidth - 10,\n height: pageHeight - 20\n },\n displayOption: models.DisplayOption.FitToPage,\n pagesLayout: pagesLayout\n }\n };\n\n // If pageWidth or pageHeight is changed, change display option to actual size to add scroll bar\n if (pageWidth !== $('#embedContainer').width() || pageHeight !== $('#embedContainer').height()) {\n settings.customLayout.displayOption = models.DisplayOption.ActualSize;\n }\n\n // Change page background to transparent on Two / Three columns configuration\n settings.background = (LayoutShowcaseState.columns === ColumnsNumber.One) ? models.BackgroundType.Default : models.BackgroundType.Transparent;\n\n // Call updateSettings with the new settings object\n LayoutShowcaseState.layoutReport.updateSettings(settings);\n}", "function buildUI() {\n setPageTitle();\n showMessageFormIfViewingSelf();\n fillMap();\n fetchLanguage();\n getInfo();\n// buildLanguageLinks();\n}", "_createLayout(){\n var tpl = doT.compile(\"<div class='bcd-far-configurator'></div><div class='bcd-far-filter'></div><div class='bcd-far-paginate'></div><div class='bcd-far-grid'></div>\");\n this.options.targetHtml.html(tpl);\n }", "createUI(layout) {\n let attr = Object.assign({\n width: 20, height: 10,\n }, layout);\n return this.CreateFormWindow(this.title, attr);\n }", "function buildUI (thisObj ) {\r var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'FSS Fake Parallax',[0,0,150,260],{resizeable: true});\r\r if (win !== null) {\rvar red = win.graphics.newPen (win.graphics.PenType.SOLID_COLOR, [1, 0.1, 0.1],1);\rvar green = win.graphics.newPen (win.graphics.PenType.SOLID_COLOR, [0.1, 1, 0.1],1);\r\r var H = 25; // the height\r var W = 30; // the width\r var G = 5; // the gutter\r var x = G;\r var y = G;\r\r // win.check_box = win.add('checkbox',[x,y,x+W*2,y + H],'check');\r // win.check_box.value = metaObject.setting1;\r\r win.select_json_button = win.add('button',[x ,y,x+W*5,y + H], 'read json');\r x+=(W*5)+G;\r win.read_label = win.add('statictext',[x ,y,x+W*5,y + H],'NO JSON');\r win.read_label.graphics.foregroundColor = red;\r x=G;\r y+=H+G;\r win.do_it_button = win.add('button', [x ,y,x+W*5,y + H], 'simple import');\r x=G;\r y+=H+G;\r win.regen_it_button = win.add('button', [x ,y,x+W*5,y + H], 'regenerate');\r x=G;\r y+=H+G;\r win.prepare_logo_button = win.add('button', [x ,y,x+W*5,y + H], 'prepare logo');\r\r // win.up_button = win.add('button', [x + W*5+ G,y,x + W*6,y + H], 'Up'); \r\r // win.check_box.onClick = function (){\r // alert(\"check\");\r // };\r //\r //\r win.select_json_button.addEventListener (\"click\", function (k) {\r /**\r * if you hold alt you can clear the the json and all that stuff\r * \r */\r if (k.altKey) {\r mpo2ae.images_folder_flat = null;\r mpo2ae.json = null;\r mpo2ae.allfolders.length = 0;\r mpo2ae.pre_articles.length = 0;\r mpo2ae.articles.length = 0;\r win.read_label.text = 'NO JSON';\r win.read_label.graphics.foregroundColor = red;\r }else{\r\r\r\r// win.select_json_button.onClick = function () {\r /**\r * Why is this in here?\r * Because we can make changed to the GUI from the function\r * makeing some overview for the JSON and stuff like that\r *\r */\r mpo2ae.project = app.project;\r var presets = mpo2ae.settings.comp.layerpresets;\r var jsonFile = File.openDialog(\"Select a JSON file to import.\", \"*.*\",false);\r // var path = ((new File($.fileName)).path);\r if (jsonFile !== null) {\r mpo2ae.images_folder_flat = jsonFile.parent;\r\r var textLines = [];\r jsonFile.open(\"r\", \"TEXT\", \"????\");\r while (!jsonFile.eof){\r textLines[textLines.length] = jsonFile.readln();\r }\r jsonFile.close();\r var str = textLines.join(\"\");\r var reg = new RegExp(\"\\n|\\r\",\"g\");\r str.replace (reg, \" \");\r // var reghack = new RegExp('\"@a','g');\r // str.replace(reghack, '\"a');\r mpo2ae.json = eval(\"(\" + str + \")\"); // evaluate the JSON code\r if(mpo2ae.json !==null){\r // alert('JSON file import worked fine');\r // alert(mpo2ae.json);\r win.read_label.text = 'YES JSON';\r win.read_label.graphics.foregroundColor = green;\r mpo2ae.pre_articles = mpo2ae.json.seite.artikel;\r//~ $.write(mpo2ae.pre_articles.toSource());\r /**\r * This is only cheking if ther are some folders already there\r * \r */\r // var allfolders = [];\r if(mpo2ae.pre_articles.length > 0){\r var projItems = mpo2ae.project.items;\r for(var f = 1; f <= projItems.length;f++){\r if (projItems[f] instanceof FolderItem){\r // alert(projItems[f]);\r mpo2ae.allfolders.push(projItems[f]);\r }\r } // end folder loop\r\r for(var i = 0; i < mpo2ae.pre_articles.length;i++){\r var article = mpo2ae.pre_articles[i];\r var artfolder = null;\r var artimages = [];\r var artnr = null;\r var artprice = null;\r var arttxt = null;\r var artname = null;\r var artdiscr = null;\r var artbrand = null;\r var artfootage = [];\r var artgroup = null;\r if(article.hasOwnProperty('artikelInformation')){\r ainfo = article.artikelInformation;\r if(ainfo.hasOwnProperty('iArtikelNr')){\r // artnr = ainfo.iArtikelNr;\r // ------------ loop all folders per article ------------\r if(mpo2ae.allfolders !== null){\r for(var ff = 0; ff < mpo2ae.allfolders.length;ff++){\r if(mpo2ae.allfolders[ff].name == ainfo.iArtikelNr){\r artfolder = mpo2ae.allfolders[ff];\r break;\r }\r } // close ff loop\r } // close folder null check\r // ------------ end loop all folders per article ------------\r\r // if(artfolder === null){\r // artfolder = mpo2ae.project.items.addFolder(ainfo.iArtikelNr.toString());\r // } // close artfolder null\r }// close iArtikelNr check\r\r if(ainfo.hasOwnProperty('iHersteller')){\r artbrand = ainfo.iHersteller;\r }\r if(ainfo.hasOwnProperty('iGruppenFarbe')){\r artgroup = ainfo.iGruppenFarbe;\r }\r } // close artikelInformation check\r\r if(article.hasOwnProperty('preis')){\r artprice = article.preis;\r }\r if(article.hasOwnProperty('textPlatzieren')){\r if(article.textPlatzieren.hasOwnProperty('artikelBezeichnung')){\r artname = article.textPlatzieren.artikelBezeichnung;\r }\r if(article.textPlatzieren.hasOwnProperty('artikelBeschreibung')){\r artdiscr = article.textPlatzieren.artikelBeschreibung;\r }\r if(article.textPlatzieren.hasOwnProperty('artikelText')){\r arttxt = article.textPlatzieren.artikelText;\r }\r\r if(article.textPlatzieren.hasOwnProperty('artikelNr')){\r artnr = article.textPlatzieren.artikelNr;\r }\r }\r\r// ------------ this is start folder creation and image import ------------\r if(artfolder !== null){\r var imgpath = null;\r if(article.hasOwnProperty('bild')){\r if( Object.prototype.toString.call( article.bild ) === '[object Array]' ) {\r // article.bild is an array\r // lets loop it\r // \r for(var j =0;j < article.bild.length;j++){\r\r if(article.bild[j].hasOwnProperty('attributes')){\r imgpath = article.bild[j].attributes.href.substring(8);\r artimages.push(imgpath);\r alert(imgpath);\r return;\r }// article bild is an Array attributes close\r } // close J Loop\r }else{\r // now this is an error in the JSON\r // the property 'bild' comes as Array OR Object\r // we need to fix that\r if(article.bild.hasOwnProperty('attributes')){\r artimages.push(article.bild.attributes.href.substring(8));\r alert(imgpath);\r return;\r } // article bild is an object attributes close\r\r }// close Object.prototype.toString.call( article.bild )\r\r // alert( mpo2ae.images_folder_flat.fullName + \"\\n\" + artimages);\r // for(var ig = 0; ig < artimages.length;ig++){\r\r // var a_img = File( mpo2ae.images_folder_flat.fsName + \"/\" + artimages[ig]);\r // if(a_img.exists){\r // var footageitem = mpo2ae.project.importFile(new ImportOptions(File(a_img)));\r // footageitem.parentFolder = artfolder;\r // artfootage.push(footageitem);\r // }else{\r // artfootage.push(null);\r // } // close else image does not exist on HD\r // } // end of ig loop artimages\r }else{\r // artile has no property 'bild'\r $.writeln('There are no images on article ' + ainfo.iArtikelNr);\r // alert('There are no images on article ' + ainfo.iArtikelNr);\r }\r }else{\r // it was not possible to create folders\r // neither from the names nor did they exist\r // alert('Error creating folder for import');\r }\r// ------------ end of folder creation an image import ------------\r // var curComp = mpo2ae.project.items.addComp(\r // mpo2ae.settings.projectname + \" \" + ainfo.iArtikelNr,\r // mpo2ae.settings.comp.width,\r // mpo2ae.settings.comp.height,\r // mpo2ae.settings.comp.pixelAspect,\r // mpo2ae.settings.comp.duration,\r // mpo2ae.settings.comp.frameRate);\r // curComp.parentFolder = artfolder;\r\r // now we got all info togther and everything is checked\r // we create an cleaned object with the props we need\r // for later usage\r var art = new Article();\r art.nr = artnr;\r art.folder = artfolder;\r // art.images = artimages;\r // var regdash = new RegExp(\"--\",\"g\");\r art.price = regdashes(artprice);// artprice.replace(regdash,\"\\u2013\");\r art.txt = arttxt;\r art.name = artname;\r art.discr = artdiscr;\r art.brand = artbrand;\r art.footage = artfootage;\r art.group = artgroup;\r mpo2ae.articles.push(art);\r } // end article loop\r\r\r }else{\r alert('No articles in JSON');\r }\r }else{\r alert('JSON is null');\r }\r}else{\r\r alert('File is null');\r}\r } // end else not alt\r // };\r }); // end of eventListener\r\r win.do_it_button.onClick = function () {\r simple_import();\r alert('done');\r };\r\r win.regen_it_button.onClick = function () {\r // simple_import();\r if((app.project.selection < 1) && (!(app.project.selection[0] instanceof CompItem ))){\r alert('Please select your template composition');\r return;\r }\r regenerate_from_template(app.project.selection[0]);\r\r\r };\r\r win.prepare_logo_button.onClick = function () {\r prepare_selected_logo();\r };\r }\r return win;\r}", "initDOM(){\n /* init Common DOM elements */\n let columnElements = [\n { 'name': 'color', 'text': 'Color Table', 'button': true },\n { 'name': 'shape', 'text': 'Shape Table', 'button': true },\n { 'name': 'visuals', 'text': 'Other Visuals', 'button': false },\n ];\n super.initDOM(columnElements);\n\n let self = this;\n /* First, we update the three tables used for visualization handling within\n * the graph */\n this.updateColorTable();\n this.updateShapeTable();\n this.updateVisualsTable();\n\n /* A modal component is used by the user to select colors and shapes used\n * for the display of points */\n let container = d3.select('.targetmineGraphDisplayer')\n .append('div')\n .attr('id', 'modal')\n .attr('class', 'modal')\n .append('div')\n .attr('id', 'modal-content')\n .attr('class', 'modal-content')\n ;\n /* add title to the modal */\n let content = d3.select('.targetmineGraphDisplayer').select('#modal-content');\n content.append('h3')\n .attr('id', 'modal-title')\n .attr('class', 'modal-title')\n ;\n /* In order to a color/shape to be applied, two different levels of selection\n * have to be specified. These are refered to as 'column' and 'value'. Here\n * we add the components required for user selection */\n content.append('label')\n .attr('class', 'modal-item modal-label')\n .text('Category:')\n ;\n let colSelect = content.append('select')\n .attr('class', 'modal-item modal-select')\n .attr('id','modal-column-select')\n ;\n content.append('label')\n .attr('class', 'modal-item modal-label')\n .text('Value:')\n ;\n content.append('select')\n .attr('class', 'modal-item modal-select')\n .attr('id', 'modal-value-select')\n ;\n /* 'column' options are fixed */\n let opts = this._data.columns.reduce((prev, curr, i) => {\n if( typeof(self._data[0][curr]) === 'string' ) prev.push(curr);\n return prev;\n },[]);\n colSelect.selectAll('option')\n .data(opts)\n .enter().append('option')\n .attr('value', d => d)\n .text(d => d)\n ;\n /* but each time a new column is selected, the options in the 'value' select\n * need to be updated */\n d3.select('#modal-column-select')//.selectAll('option')\n .on('change', function(e){\n let values = [...new Set(self._data.map(pa => pa[e.target.value]))];\n self.updateSelectOptions('#modal-value-select', values);\n })\n .dispatch('change') // make sure to initially update the values\n ;\n\n // /* The space for the color/shape input elements */\n content.append('div')\n .attr('id', 'modal-input')\n .attr('class', 'modal-content')\n .style('grid-column', 'span 3')\n ;\n /* OK and Cancel buttons */\n content.append('button')\n .attr('class', 'modal-item modal-button')\n .attr('id','modal-ok')\n .text('OK')\n ;\n content.append('button')\n .attr('class', 'modal-item modal-button')\n .attr('id', 'modal-cancel')\n .style('grid-column', '3')\n .text('Cancel')\n ;\n\n /* bind functionality to Righ-column interface elements */\n d3.select('#color-add').on('click', function(){ self.modalDisplay('color') });\n d3.select('#shape-add').on('click', function(){ self.modalDisplay('shape'); });\n d3.select('#modal-ok').on('click', function(){ self.modalOK(); });\n d3.select('#modal-cancel').on('click', function(){ d3.select('#modal').style('display', 'none'); });\n }", "defineSchema() {\n\n }", "function CreateDiagram() {\r\n // alert(document.documentElement('.dx-scrollable-content'));\r\n // viewModel.width1(document.getElementById('sv').clientWidth);\r\n xmlhttp = new XMLHttpRequest();\r\n xmlhttp.open('POST', 'http://bgcsolutions.mine.nu/bgcws.asmx', true);\r\n var sr = '<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><GetApartmentReadings_mobile xmlns=\"http://tempuri.org/\"><aBuildingID>' + BID + '</aBuildingID><aUSerName>' + USERNAME + '</aUSerName><aPassword>' + PASSWORD + '</aPassword></GetApartmentReadings_mobile></soap:Body></soap:Envelope>';\r\n xmlhttp.onreadystatechange = function () {\r\n if (xmlhttp.readyState == 4) {\r\n if (xmlhttp.status == 200) {\r\n try{\r\n doc = xmlhttp.responseXML;\r\n xmlreponse = doc.getElementsByTagName(\"GetApartmentReadings_mobileResult\")[0].textContent;\r\n parsed = JSON.parse(xmlreponse);\r\n tables = parsed.toString().split('Table');\r\n var diagram = '';\r\n numBuildings = tables[1].replace(/\\\"/g, \"\").split('},{');\r\n if (numBuildings.length > 1) {\r\n tabs += \"<table style='border-bottom:2px solid #42556F; font-size:12px; font-family:Calibri; background-color:#CCD0D7; border-collapse:separate; border-spacing:3px;' id='tabsTable' ><tr>\";\r\n for (g = 0; g < numBuildings.length; g++) {\r\n var backcolor = g == 0 ? '#B4BAC5' : '#CCD0D7';\r\n tabs += \"<td style='border-radius:6px; border-left:2px solid #42556F; border-top:2px solid #42556F; border-right:2px solid #42556F;padding:5px; cursor:pointer; background-color:\" + backcolor + \";' id='tabs_\" + g + \"'>\" + numBuildings[g].split(',')[6].split(' : ')[1] + \"</td>\";\r\n }\r\n tabs += \"</tr></table>\";\r\n }\r\n items = tables[1].replace(/\\\"/g, \"\").split(',');\r\n floors = items[1].split(' : ')[1];\r\n apts = items[2].split(' : ')[1];\r\n startNum = items[7].split(' : ')[1].split('}')[0];\r\n readings = tables[2].replace(/\\\"/g, \"\").split(',');\r\n newNumber = new Array();\r\n floors2 = tables[2].replace(/\\\"/g, \"\").split('},{');\r\n for (e = 0; e < floors2.length; e++) {\r\n whatNumber = floors2[e].split(',')[9].split(' : ')[1];\r\n newNumber[e] = whatNumber;\r\n }\r\n createTable(items, floors, apts, readings, newNumber, startNum);\r\n viewModel.MultipleTabs(tabs);\r\n if (tabs != '') {\r\n var cells = document.getElementById(\"tabsTable\").getElementsByTagName(\"td\");\r\n for (i = 0; i < cells.length; i++) {\r\n $(\"#tabs_\" + i).click(function () { changeContent(tables); });\r\n }\r\n }\r\n getReadings();\r\n viewModel.loadPanelVisible(false);\r\n if ($('#myDiv').children().width() <= $(window).width())\r\n $('#myDiv').width($(window).width());\r\n else\r\n $('#myDiv').width($('#myDiv').children().width());\r\n }\r\n catch (err) {\r\n DevExpress.ui.dialog.alert(err, 'Page Error:');\r\n viewModel.loadPanelVisible(false);\r\n }\r\n } \r\n } \r\n }\r\n xmlhttp.setRequestHeader(\"SOAPAction\", \"http://tempuri.org/GetApartmentReadings_mobile\");\r\n xmlhttp.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');\r\n xmlhttp.send(sr);\r\n }", "init() {\n // Add label\n $sel.append('text')\n .text(d => `${d.key}`)\n\n const container = $sel.append('div.container')\n\n // Add svg for front pockets\n\t\t\t\t$svgFront = container.append('svg.area-front');\n\t\t\t\tconst $gFront = $svgFront.append('g');\n\n\t\t\t\t// setup viz group\n\t\t\t\t$visFront = $gFront.append('g.g-vis');\n\n // Add svg for back pockets\n $svgBack = container.append('svg.area-back');\n const $gBack = $svgBack.append('g');\n\n // setup viz group\n $visBack = $gBack.append('g.g-vis');\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function _constructComponents() {\r\n\t//having a set root element allows us to make queries\r\n\t//and resultant styling safe and much faster.\r\n\t//var elOuterParent = _rootDiv;\r\n\t//document.getElementById(_rootID);\r\n\tvar builder = new WidgetBuilder();\r\n\t_debugger.log(\"building html scaffolding.\"); //#\r\n\t_el = builder.construct(CSS_PREFIX, _manips);\r\n\t\r\n\t//todo: do we need to \"wait\" for these? Is there any initialization problem\r\n\t//that prevents them from being constructed to no effect?\r\n\t\r\n\t_debugger.log(\"building slideMotion.\"); //#\r\n\t_slideMotion = new SlideMotion();\r\n\tthis.slideMotion = _slideMotion; //# debugging only\r\n\t\r\n\t_debugger.log(\"building slideLogic.\"); //#\r\n\t_slideLogic = new SlideLogic(_slideMotion);\r\n\t_animator = _slideLogic;\r\n\t\r\n\t_debugger.log(\"building Event Manager.\"); //#\r\n\t_evtMgr = new EvtMgr(_behavior, _animator);\r\n\t_debugger.log(\"building Scaler.\"); //#\r\n\t_deviceWrangler = new DeviceWrangler();\r\n\t_scaler = new Scaler(_outerParent, _evtMgr, _animator);\r\n}", "setupUI() {\n\n hdxAV.algOptions.innerHTML = '';\n\t\n hdxAVCP.add(\"undiscovered\", visualSettings.undiscovered);\n hdxAVCP.add(\"visiting\", visualSettings.visiting);\n hdxAVCP.add(\"discarded\", visualSettings.discarded);\n for (let i = 0; i < this.categories.length; i++) {\n hdxAVCP.add(this.categories[i].name,\n this.categories[i].visualSettings);\n }\n }", "function generateSchemaView (node, display_keys, edit, callback) {\n \n collection.getKeys(node.collection, function(keys) {\n\t\t\n\t\tif(keys) {\n\n\t\t\tvar data = {};\n\t\t\tvar display_keys_arr = [];\n var keys_html = \"\";\n var html = \"\";\n\n\n\t\t\t// RENDERS visible fields selector\n\t\t\tkeys_html += '<option value=\"*\">all fields (*)</option>';\n\t\t\tfor (var i = 0; i < keys.sorted.length; i++) {\n keys_html += '<option value=\"' + keys.sorted[i] + '\">' + keys.sorted[i] + '</option>';\n\t\t\t}\n\t\t\t\n\t\t\t// if all field \"*\" is not set\n\t\t\tif (display_keys != \"*\") {\n\t\t\t\n\t\t\t\t// if default keys are set, then we build knockout template using only those keys\n\t\t\t\tif (node.views.default_keys != null) {\n\t\t\t\t\tkeys.sorted = node.views.default_keys; \n\t\t\t\t}\n\n\t\t\t\t// if display_field are set, then we build knockout template using only those keys (override default keys)\n\t\t\t\tif (display_keys != null) {\n\t\t\t\t\tkeys.sorted = display_keys.split(\",\"); \n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\thtml += ''\n\n\t\t\t\t+ '<div>'\n\t\t\t\t+ '\t<table>'\n\t\t\t\t+ '\t\t<thead>'\n\t\t\t\t+ '\t\t\t<tr>';\n\n\t\t\thtml += '\t\t\t<th id=\"vcc\" data-bind=\"click: sort\">[count]</th>'\n\n // we put thumbnails first\n var thumb_cell = '';\n\t\t\t//for (key in data) {\n\t\t\t\t//if(key.indexOf(\"thumbnail_html\") != -1) {\n //html += '\t\t\t<th id=\"thumbnail_html\">thumbnail_html</th>';\n //thumb_cell = '\t\t\t\t<td><div class=\"data-container\" data-bind=\"html: thumbnail_html\"></div></td>';\n //delete data[key];\n //}\n\t\t\t//}\n\n\t\t\t\n\t\t\t// RENDERS table headers (sort)\n\t\t\tfor (var i = 0; i < keys.sorted.length; i++) {\n\t\t\t\t\thtml += '\t\t\t<th id=\"' + keys.sorted[i] + '\" data-bind=\"click: sort\">' + keys.sorted[i] + '</th>'\n\t\t\t}\n\n\t\t\thtml += '\t\t\t</tr>'\n\t\t\t\t+ '\t\t</thead>'\n\t\t\t\t+ '\t\t<tbody data-bind=\"foreach: collection\">'\n\t\t\t\t+ '\t\t\t<tr>';\n\n\t\t\t// RENDERS data cells\n\t\t\thtml += '\t\t\t\t<td data-bind=\"text: vcc\"></td>'\n html += thumb_cell;\n \n\t\t\tfor (var i = 0; i < keys.sorted.length; i++) {\n\t\t\t\tif (keys.keys[keys.sorted[i]] && keys.keys[keys.sorted[i]].type == 'array') {\n html += ' <td class=\"array\">' \n\t\t\t\t\t\t//html += '\t\t\t\t<div class=\"data-container\" data-bind=\"foreach: $root.keyValueList($data[\\''+key+'\\'])\">'\n\t\t\t\t\t\thtml += '\t\t\t\t<div class=\"data-container\" data-bind=\"inline: '+ keys.sorted[i] +'\">'\n // html += ' <div data-bind=\"html:$root.keyValue($data)\"></div>'\n html += ' </div>'\n\t\t\t\t\t\thtml += ' </td>'\n\n } else {\n // we render \"_html\" fields as html (for example thumbnails)\n if (keys.sorted[i].indexOf(\"_html\") !== -1)\n html += '\t\t\t\t<td><div class=\"data-container\" data-bind=\"html: '+ keys.sorted[i] +'\"></div></td>';\n else\n html += '\t\t\t\t<td><div class=\"data-container\" data-field=\"' + keys.sorted[i] +'\" data-bind=\"inline: '+ keys.sorted[i] +',attr:{\\'data-id\\':$data._id}\"></div></td>';\n }\n\t\t\t\t\t\n\t\t\t}\n\n\t\t\thtml += '\t\t\t</tr>'\n\t\t\t\t+ '\t\t</tbody>'\n\t\t\t\t+ '\t</table>'\n\t\t\t\t+ '</div>';\n\n\n\t\t\tcallback(keys_html, html);\n\t\t} else {\n\t\t\tcallback(\"<h3>dynamice view creation failed!</h3> Maybe collection is empty?</br>\" + node.collection);\n\t\t}\n\t});\n}", "function createVis() {\n // Create event handler\n var gridSearch = new gridsearch(\"grid-search\",n_letters,8);\n\n var dropSearch = new dropdown(\"drop-search\",nameID);\n\n legendDraw();\n\n\n}", "function OLD_build_dialog(xmldoc, sfw_host, ref)\n {\n var docel = xmldoc.documentElement;\n \n var schema;\n if (!(schema=xmldoc.selectSingleNode(\"*/schema\")))\n if (!(schema=xmldoc.selectSingleNode(\"*/*[@type='form' | @type='record']/schema\")))\n schema = xmldoc.selectSingleNode(\"*/*/schema\");\n \n if (!schema)\n {\n console.error(\"Can't find schema necessary for building a form.\");\n return null;\n }\n\n var host = addEl(\"div\", sfw_host);\n\n var result = schema.parentNode;\n var datanode = null;\n if (result==xmldoc.documentElement)\n datanode = result.selectSingleNode(\"*[@rndx=1]/*[1]\");\n else\n {\n var nodename = schema.getAttribute(\"name\");\n datanode = result.selectSingleNode(nodename);\n }\n\n if (datanode)\n {\n datanode.setAttribute(\"make_node_dialog\", \"true\");\n xslo.transformFill(host, datanode);\n datanode.removeAttribute(\"make_node_dialog\");\n }\n else\n {\n result.setAttribute(\"make_dialog\", \"true\");\n xslo.transformFill(host, result);\n result.removeAttribute(\"make_dialog\");\n }\n \n var form = host.getElementsByTagName(\"form\")[0];\n if (form)\n {\n form.style.visible = \"hidden\";\n \n function finish()\n {\n form.className = \"dialog Schema\";\n position_dialog(form,ref);\n form.style.visible = \"visible\";\n \n focus_on_first_field(form);\n }\n\n if (\"custom_form_setup\" in window)\n custom_form_setup(form, finish);\n else\n finish();\n }\n else\n {\n console.error(\"The build_dialog transform failed to make a form.\");\n remove_from_parent(host);\n }\n\n return form;\n }", "schema() { }", "function initialize() {\n\t\t\n\t\tsvg = scope.selection.append(\"svg\").attr(\"id\", scope.id).style(\"overflow\", \"visible\").attr(\"class\", \"vizuly\");\n\t\tbackground = svg.append(\"rect\").attr(\"class\", \"vz-background\");\n\t\tdefs = vizuly2.util.getDefs(viz);\n\t\tplot = svg.append('g');\n\t\t\n\t\tscope.dispatch.apply('initialized', viz);\n\t}", "function createUI(){\n\n /**\n * @class DocumentMobileApp\n */\n enyo.kind(\n /** @lends DocumentMobileApp.prototype */\n {\n name: 'DocumentMobileApp',\n kind: enyo.Control,\n layoutKind: 'FittableRowsLayout',\n\n create: function(){\n this.inherited(arguments);\n renderTemplateDiv();\n this.processGETParameters();\n },\n\n published: {\n searchWord: '',\n checkedEntities: [],\n lang: 'en'\n },\n\n components: [\n { kind: 'Panels', name: 'panels', fit: true, arrangerKind: 'CollapsingArranger', components: [\n {\n kind: 'LeftPanel',\n name: 'leftPanel',\n classes: 'leftPanel',\n searchFunction: 'search',\n bookmarkFunction: 'createBookmark',\n popupBookmarkFunction: 'popupBookmark'\n },\n {\n kind: 'MiddlePanel',\n name: 'middlePanel',\n mainSearchFunction: 'search',\n openDocFunction: 'openDoc',\n documentsCountClass: 'documentsMobileCount',\n moreDocumentsFunction: 'moreDocuments'\n },\n {\n kind: 'RightPanel',\n name: 'rightPanel',\n closeParentFunction: 'searchShow'\n }\n ]},\n { kind: 'ClosablePopup', name: 'bookmarkPopup', classes: 'bookmarkMobilePopup', closeButtonClasses: 'popupCloseButton' }\n ],\n\n /**\n * This function processes GET parameters. If it finds 'search' or\n * 'entity', it fires a search and open the document if there is the\n * 'openPreview' parameter.\n\t\t\t\t * @method processGETParameters\n */\n processGETParameters: function(){\n // Search\n this.search(GetURLParameter('search')[0], GetURLParameter('entity'));\n // Open Document\n var openPreview = GetURLParameter('openPreview')[0];\n if(!isEmpty(openPreview)){\n this.openDoc(openPreview);\n }\n },\n\n /**\n * This function returns whether the window width is mobile size or not.\n\t\t\t\t * @method isMobileSize\n * @return {Boolean} true, if the screen size is maximum 800 pixels, otherwise false\n */\n isMobileSize: function(){\n return jQuery(window).width() <= 800;\n },\n\n /**\n\t\t\t\t * This function shows the middle panel.\n\t\t\t\t * @method searchShow\n\t\t\t\t */\n searchShow: function(){\n this.$.panels.setIndex(1);\n },\n\n /**\n\t\t\t\t * This function shows the left panel.\n\t\t\t\t * @method entityShow\n\t\t\t\t */\n entityShow: function(){\n this.$.panels.setIndex(0);\n },\n\n /**\n * This function opens a document in the preview panel.\n * If the screen size is small, it shows the right panel only.\n\t\t\t\t * @method openDoc\n * @param {String} documentURI the document URI to be opened\n */\n openDoc: function(documentURI, type){\n if(this.isMobileSize()){\n this.$.panels.setIndex(2);\n }\n this.$.rightPanel.openDoc(documentURI);\n this.$.middlePanel.$.documents.sendDocListAnnotation(documentURI, type, 'true');\n },\n\t\t\t\t\n /**\n * This function updates the 'open' buttons (e.g. the\n * 'entities button' in the middle).\n\t\t\t\t * @method updateButtons\n */\n updateButtons: function(){\n if(!this.isMobileSize()){\n this.$.leftPanel.hideDocsButton();\n this.$.middlePanel.hideEntitiesButton();\n this.$.rightPanel.hideBackButton();\n } else {\n this.$.leftPanel.showDocsButton();\n this.$.middlePanel.showEntitiesButton();\n this.$.rightPanel.showBackButton();\n }\n },\n\n /**\n * This function is called when the screen size is changing or\n * the user rotates the device. This function sets the actual panel\n\t\t\t\t * according to the screen size, updates the buttons, and changes\n\t\t\t\t * the position of the bookmark popup.\n\t\t\t\t * @method reflow\n */\n reflow: function() {\n this.inherited(arguments);\n if(!isEmpty(this.$.bookmarkPopup.getContent())){\n this.changeBMPopupPosition();\n }\n if(this.isMobileSize()){\n // If the 3. panel is the active, it means that the user's\n // keyboard appears on the mobile device -> we have to do nothing\n if(this.$.panels.getIndex() !== 2){\n this.$.panels.setIndex(1); \n }\n } else {\n this.$.panels.setIndex(0);\n }\n this.updateButtons();\n },\n\n /**\n * This function creates and saves a bookmark. It contains the\n * search word, the unchecked entities and the opened document.\n\t\t\t\t * @method createBookmark\n */\n createBookmark: function(){\n if(!isEmpty(this.searchWord)){\n // Cut characters after '?'\n var location = window.location.href;\n var parametersIndex = location.indexOf('?');\n if(parametersIndex !== -1){\n location = location.substr(0, parametersIndex);\n }\n // Search word\n var url = location + '?search=' + this.searchWord;\n // Unchecked entities\n var entities = this.getCheckedEntities();\n for(var i=0;i<entities.length;i++){\n if(!isEmpty(entities[i].id)){\n url += '&entity=' + entities[i].id;\n } else {\n url += '&entity=' + entities[i];\n }\n }\n // Preview document\n var documentURL = this.$.rightPanel.getDocumentURI();\n if(!isEmpty(documentURL)){\n url += '&openPreview=' + documentURL;\n }\n\n var title = 'Fusepool';\n this.$.middlePanel.saveBookmark(url, title);\n } else {\n this.$.middlePanel.saveBookmark();\n }\n },\n\n /**\n * This function shows a message in the bookmark popup.\n\t\t\t\t * @method popupBookmark\n * @param {String} message the message what the function shows\n */\n popupBookmark: function(message){\n this.$.bookmarkPopup.show();\n this.$.bookmarkPopup.setContent(message);\n this.changeBMPopupPosition();\n },\n\n /**\n * This function calculates the position of the popup to be \n * displayed in the middle of the screen.\n\t\t\t\t * @method changeBMPopupPosition\n */\n changeBMPopupPosition: function(){\n var margin = 30;\n var newWidth = jQuery('#' + this.$.middlePanel.getId()).width() - margin;\n var windowWidth = jQuery(document).width();\n var newLeft = (windowWidth - newWidth) / 2;\n \n this.$.bookmarkPopup.updateWidth(newWidth, margin);\n this.$.bookmarkPopup.applyStyle('left', newLeft + 'px');\n },\n\n /**\n * This function calls the ajax search if the search word is not empty.\n\t\t\t\t * @method search\n * @param {String} searchWord the search word\n * @param {Array} checkedEntities the unchecked entities on the left side\n */\n search: function(searchWord, checkedEntities){\n this.cleanPreviewBox();\n this.searchWord = searchWord;\n\t\t\t\t\tcreateCookie('lastSearch',searchWord,30);\n this.checkedEntities = checkedEntities;\n if(!isEmpty(searchWord)){\n this.$.middlePanel.startSearching();\n this.$.middlePanel.updateInput(this.searchWord);\n\n this.sendSearchRequest(searchWord, checkedEntities, 'processSearchResponse');\n }\n },\n\n /**\n * This function sends an ajax request for searching.\n\t\t\t\t * @method sendSearchRequest\n * @param {String} searchWord the search word\n * @param {String} checkedEntities the checked entities on the left side\n * @param {String} responseFunction the name of the response function\n * @param {Number} offset the offset of the documents (e.g. offset = 10 --> documents in 10-20)\n */\n sendSearchRequest: function(searchWord, checkedEntities, responseFunction, offset){\n var main = this;\n var url = this.createSearchURL(searchWord, checkedEntities, offset);\n var store = rdfstore.create();\n store.load('remote', url, function(success) {\n main[responseFunction](success, store);\n });\n },\n\n /**\n * This function creates the search URL for the query.\n\t\t\t\t * @method createSearchURL\n * @param {String} searchWord the search word\n * @param {Array} checkedEntities the checked entities\n * @param {Number} offset offset of the query\n * @return {String} the search url\n */\n createSearchURL: function(searchWord, checkedEntities, offset){\n\t\t\t\t\n\t\t\t\t\t// var labelPattern = /^.*'label:'.*$/;\n\t\t\t\t\t// if(labelPattern.test(searchWord)) {\n\t\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t// var predictedLabelPattern = /^.*'predicted label:'.*$/;\n\t\t\t\t\t// if(predictedLabelPattern.test(searchWord)) {\n\t\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t\n var url = CONSTANTS.SEARCH_URL;\n if(isEmpty(offset)){\n offset = 0;\n }\n url += '?search='+searchWord;\n if(checkedEntities.length > 0){\n url += this.getCheckedEntitiesURL(checkedEntities);\n }\n url += '&offset='+offset+'&maxFacets='+readCookie('maxFacets')+'&items='+readCookie('items');\n return url;\n },\n\n /**\n * This function send a request for more documents.\n\t\t\t\t * @method moreDocuments\n * @param {Number} offset the offset (offset = 10 --> document in 10-20)\n */\n moreDocuments: function(offset){\n this.sendSearchRequest(this.searchWord, this.checkedEntities, 'processMoreResponse', offset);\n },\n\n /**\n * This function runs after getting the response from the ajax\n\t\t\t\t * more search. It calls the document updater function.\n\t\t\t\t * @method processMoreResponse\n * @param {Boolean} success the search query was success or not\n * @param {Object} rdf the response rdf object\n */\n processMoreResponse: function(success, rdf){\n var documents = this.createDocumentList(rdf);\n this.$.middlePanel.addMoreDocuments(documents);\n },\n\n /**\n * This function creates a URL fraction that represents\n\t\t\t\t * the checked entities.\n\t\t\t\t * @method getCheckedEntitiesURL\n * @param {Array} checkedEntities the original checked entities\n * @return {String} built URL fraction\n */\n getCheckedEntitiesURL: function(checkedEntities){\n var result = '';\n for(var i=0;i<checkedEntities.length;i++){\n if(!isEmpty(checkedEntities[i].id)){\n result += '&subject=' + checkedEntities[i].id;\n } else {\n result += '&subject=' + checkedEntities[i];\n }\n }\n return result;\n },\n\n /**\n * This function runs after the ajax search is getting finished.\n\t\t\t\t * It calls the entity list updater and the document updater functions.\n\t\t\t\t * @method processSearchResponse\n * @param {Boolean} success state of the search query\n * @param {Object} rdf the response rdf object\n */\n processSearchResponse: function(success, rdf){\n\t\t\t\t\tif(success) {\n\t\t\t\t\t\tthis.updateEntityList(rdf, this.searchWord);\n\t\t\t\t\t\tthis.updateDocumentList(rdf);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.$.middlePanel.$.documents.updateList([], this.searchWord);\n\t\t\t\t\t\tthis.$.middlePanel.updateCounts(0);\n\t\t\t\t\t}\n\t\t\t\t},\n\n /**\n * This function groups and sorts the entities and updates\n\t\t\t\t * the entity list on the left side.\n\t\t\t\t * @method updateEntityList\n * @param {Object} rdf the rdf object\n * @param {String} searchWord the search word\n */\n updateEntityList: function(rdf, searchWord){\n var checkedEntities = this.checkedEntitiesFromRdf(rdf);\n var categories = this.getCategories(rdf);\n\n var groupVars = _.groupBy(categories, function(val){ return val.value; });\n var sortedGroup = _.sortBy(groupVars, function(val){ return -val.length; });\n\n var dictionaries = [];\n for(var i=0;i<sortedGroup.length;i++){\n // One category\n var category = sortedGroup[i];\n if(category.length > 0){\n var categoryText = replaceAll(category[0].value, '_', ' ');\n var categoryName = categoryText.substr(categoryText.lastIndexOf('/')+1);\n\n var entities = [];\n for(var j=0;j<category.length;j++){\n this.deteleLaterEntities(sortedGroup, category[j].entity, i);\n // Entity\n var entityId = category[j].entityId;\n var entityText = replaceAll(category[j].entity + '', '_', ' ');\n var entityName = entityText.substr(entityText.lastIndexOf('/')+1);\n\n var entity = {id: entityId, text:entityName };\n if(!this.containsEntity(entities, entity)){\n entities.push(entity);\n }\n }\n dictionaries.push({ name: categoryName, entities: entities });\n }\n }\n var dictionaryObject = { searchWord: searchWord, checkedEntities: checkedEntities, dictionaries: dictionaries };\n this.$.leftPanel.updateDictionaries(dictionaryObject);\n },\n\n /**\n * This function searches for dictionary categories in an rdf object.\n\t\t\t\t * @method getCategories\n * @param {Object} rdf the rdf object that contains the categories\n * @return {Array} the categories array with the entities\n */\n getCategories: function(rdf){\n var categories = [];\n var query = 'SELECT * { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity';\n query += ' OPTIONAL { ?id <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n\t\t\t\t\t\t\t\tif(!isEmpty(row.type)) {\n\t\t\t\t\t\t\t\t\tif(row.type.value.indexOf('#') === -1){\n\t\t\t\t\t\t\t\t\t\tcategories.push({entityId: row.id.value, entity: row.entity.value, value: row.type.value});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n }\n }\n });\n return categories;\n },\n\n /**\n * This function searches for the checked entities in an rdf object\n\t\t\t\t * and returns the array of it.\n\t\t\t\t * @method checkedEntitiesFromRdf\n * @param {Object} rdf the rdf object\n * @return {Array} the checked entity list\n */\n checkedEntitiesFromRdf: function(rdf){\n var main = this;\n var checkedEntities = [];\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#subject> ?id';\n query += ' OPTIONAL { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n if(!isEmpty(row.entity)){ \n var entity = {id: row.id.value, text: row.entity.value};\n if(!main.containsEntity(checkedEntities, entity)){\n checkedEntities.push(entity);\n }\n }\n }\n }\n });\n return checkedEntities;\n },\n\n /**\n * This function decides whether an entity list contains an entity or not.\n\t\t\t\t * @method containsEntity\n * @param {Array} entities array of the entities\n * @param {String} entity the entity\n * @return {Boolean} true if the list contains the entity, false otherwise\n */\n containsEntity: function(entities, entity){\n for(var i=0;i<entities.length;i++){\n if(entities[i].id === entity.id || entities[i].text.toUpperCase() === entity.text.toUpperCase()){\n return true;\n }\n }\n return false;\n },\n\n /**\n * This function deletes every entity from an array that equals\n * a given entity (after a given index).\n\t\t\t\t * @method deteleLaterEntities\n * @param {Array} array the array\n * @param {String} entity the checked entity\n * @param {Number} fromIndex the start index in the array\n */\n deteleLaterEntities: function(array, entity, fromIndex){\n for(var i=fromIndex+1;i<array.length;i++){\n var category = array[i];\n for(var j=0;j<category.length;j++){\n if(category[j].entity === entity){\n array[i].splice(j, 1);\n j--;\n }\n }\n }\n },\n\n /**\n * This function updates the document list in the middle.\n\t\t\t\t * @method updateDocumentList\n * @param {Object} rdf the rdf object that contains the new document list\n */\n updateDocumentList: function(rdf){\n var count = this.getDocumentsCount(rdf);\n this.$.middlePanel.$.documents.updateCounts(count);\n\t\t\t\t\tif(count>0) {\n\t\t\t\t\t\tvar documents = this.createDocumentList(rdf);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar documents = [];\n\t\t\t\t\t}\n this.$.middlePanel.updateDocuments(documents);\n },\n\n /**\n * This function deletes the content from the preview panel.\n\t\t\t\t * @method cleanPreviewBox\n */\n cleanPreviewBox: function(){\n this.$.rightPanel.clean();\n },\n\n /**\n * This function returns the count of documents in an rdf object.\n\t\t\t\t * @method getDocumentsCount\n * @param {Object} rdf the rdf object\n * @return {Number} count of documents\n */\n getDocumentsCount: function(rdf){\n var result = 0;\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#contentsCount> ?o }';\n rdf.execute(query, function(success, results) {\n if (success) {\n result = results[0].o.value;\n }\n });\n return result;\n },\n\n /**\n\t\t\t\t * This function creates an ordered document list from the rdf object.\n\t\t\t\t * @method createDocumentList\n * @param {Object} rdf the rdf object\n * @return {Array} array of containing documents\n */\n createDocumentList: function(rdf){\n\t\t\t\t\tvar documents = [];\n\t\t\t\t\tvar main = this;\n\t\t\t\t\tvar hits = [];\n\n\t\t\t\t\trdf.rdf.setPrefix(\"ecs\",\"http://fusepool.eu/ontologies/ecs#\");\n\t\t\t\t\trdf.rdf.setPrefix(\"rdf\",\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\");\n\t\t\t\t\tvar graph;\n\t\t\t\t\trdf.graph(function(success, things){graph = things;});\n\t\t\t\t\tvar triples = graph.match(null, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"ecs:contents\")), null).toArray();\n\t\t\t\t\tvar current = triples[0].object;\n\n\t\t\t\t\twhile(!current.equals(rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:nil\")))){\n\t\t\t\t\t\tvar hit = graph.match(current, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:first\")), null).toArray()[0].object;\n\t\t\t\t\t\thits.push(hit.nominalValue);\n\t\t\t\t\t\tcurrent = graph.match(current, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:rest\")), null).toArray()[0].object;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar querylist = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ';\n\t\t\t\t\tquerylist += 'SELECT * {';\n\t\t\t\t\tquerylist += ' ?url <http://purl.org/dc/terms/abstract> ?content .';\n\t\t\t\t\tquerylist += ' { ?url <http://purl.org/dc/terms/title> ?title .';\n\t\t\t\t\tquerylist += ' filter ( lang(?title) = \"en\")';\n\t\t\t\t\tquerylist += ' } UNION { ';\n\t\t\t\t\tquerylist += ' ?url <http://purl.org/dc/terms/title> ?title .';\n\t\t\t\t\tquerylist += ' filter ( lang(?title) = \"\")';\n\t\t\t\t\tquerylist += ' }'\n\t\t\t\t\tquerylist += ' ?url <http://fusepool.eu/ontologies/ecs#textPreview> ?preview .';\n\t\t\t\t\t// querylist += ' ?url <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?dtype .';\t// X branch\n\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?dtype }';\n\t\t\t\t\tquerylist += '}';\n\n\t\t\t\t\t/* This is the tentative to iterate the list at the API level to have it in ORDER \n\t\t\t\t\t\tvar triples = graph.match(null, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"ecs:contents\")), null).toArray();\n\t\t\t\t\t\tvar hit = graph.match(triples[0].object, store.rdf.createNamedNode(store.rdf.resolve(\"rdf:rest\")), null).toArray();\n\t\t\t\t\t*/\n\n\t\t\t\t\trdf.execute(querylist, function(success, results) {\n\t\t\t\t\t\tif (success) {\n\t\t\t\t\t\t\tfor(var rank=0; rank<hits.length; rank++){\n\t\t\t\t\t\t\t\tfor(var i=0; i<results.length; i++){\n\t\t\t\t\t\t\t\t\tvar row = results[i];\n\t\t\t\t\t\t\t\t\tif(row.url.value!=hits[rank]) {\n\t\t\t\t\t\t\t\t\t\t/*if(row.url.value!=hits[rank] || \n\t\t\t\t\t\t\t\t\t\trow.dtype.value.indexOf(\"ecs\") != -1 || \n\t\t\t\t\t\t\t\t\t\trow.dtype.value.indexOf(\"owl#A\") != -1 ){ */\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// if(!isEmpty(row.content) && (isEmpty(row.title) || isEmpty(row.title.lang) || row.title.lang + '' === main.lang)){\n\t\t\t\t\t\t\t\t\t// var content = row.content.value;\n\t\t\t\t\t\t\t\t\tvar content;\n\t\t\t\t\t\t\t\t\tif(isEmpty(row.content)) {\n\t\t\t\t\t\t\t\t\t\tcontent = row.preview.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tcontent = row.content.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvar title = 'Title not found';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.title)){\n\t\t\t\t\t\t\t\t\t\ttitle = row.title.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tvar dtype = 'Type not found';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.dtype)){\n\t\t\t\t\t\t\t\t\t\tdtype = row.dtype.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(!main.containsDocument(documents, content, title, row.url.value)){\n\t\t\t\t\t\t\t\t\t\tdocuments.push({url: row.url.value, shortContent: content, title: title, type: dtype});\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\treturn documents;\n },\n\n /**\n * This function decides whether a document list contains\n\t\t\t\t * a document with a specific content and title or not.\n\t\t\t\t * @method containsDocument\n * @param {Array} documents the list of documents\n * @param {String} content content of the other document\n * @param {String} title title of the other document\n * @return {Boolean} true, if the list contains, false otherwise\n */\n containsDocument: function(documents, content, title, url){\n for(var i=0;i<documents.length;i++){\n if(documents[i].url === url || (documents[i].shortContent === content && documents[i].title === title)){\n return true;\n }\n }\n return false;\n }\n\n });\n }", "function buildUI() {\n showForms();\n const config = {removePlugins: [ 'Heading', 'List' ]};\n ClassicEditor.create(document.getElementById('message-input'), config );\n fetchAboutMe();\n}", "function createMainView() {\n $mainpageContent = $('<div class=\"vis-gl-main-wrap\">');\n\n // get User Element Column ID\n var paramStr = VIS.context.getWindowContext($self.windowNo, \"AD_Column_ID\", true);\n if (paramStr == \"\") {\n VIS.ADialog.error(\"VIS_DimensionColNotSelected\", true, \"\", \"\");\n return false;\n }\n\n // get User Element Column Name\n var columnName = VIS.dataContext.getJSONRecord(\"GlJournall/ColumnName\", paramStr);\n\n // Row 1\n $formWrap = $('<div class=\"vis-gl-form-wrap\">');\n $formDataRow = $('<div class=\"vis-gl-form-row\">');\n\n $formData = $('<div class=\"vis-gl-form-col\">');\n $lblUserElement = $('<label>' + VIS.Msg.translate(ctx, columnName) + '</label>');\n $formData.append($lblUserElement);\n\n $formDataR = $('<div class=\"vis-gl-form-col2\">');\n var valueInfo = VIS.MLookupFactory.getMLookUp(ctx, $self.windowNo, VIS.Utility.Util.getValueOfString(paramStr), VIS.DisplayType.Search);\n $infoUserElement = new VIS.Controls.VTextBoxButton(columnName, false, false, true, VIS.DisplayType.Search, valueInfo);\n $formDataR.append($('<div>').append($infoUserElement).append($infoUserElement.getControl()).append($infoUserElement.getBtn(0)));\n\n $formDataRow.append($formData).append($formDataR);\n $formWrap.append($formDataRow);\n\n //Action \n $actionPanel = $('<div class=\"VIS_buttons-wrap .vis-gl-buttons-wrap\">');\n\n $buttons = $('<div class=\"pull-right\">');\n $btnOk = $('<span class=\"btn vis-gl-buttons-wrap-span\">' + VIS.Msg.translate(ctx, \"VIS_OK\") + '</span>');\n $btnCancel = $('<span class=\"btn vis-gl-buttons-wrap-span\">' + VIS.Msg.translate(ctx, \"Cancel\") + '</span>');\n $buttons.append($btnOk).append($btnCancel);\n $actionPanel.append($buttons);\n $mainpageContent.append($formWrap).append($actionPanel);\n $root.append($mainpageContent).append($bsyDiv);\n }", "function init() {\n this.bindElements();\n this.buildDynamicHtmlComponents();\n\n this.model = DiagramService.get();\n this.bindEvents();\n\n return this;\n }", "function buildUI() {\n loadNavigation();\n setPageTitle();\n fetchBlobstoreUrlAndShowMessageForm();\n showMessageFormIfViewingSelf();\n fetchMessages(\"\");\n addListnerForInfiniteScroll();\n fetchAboutMe();\n initMap();\n addButtonEventForDelete();\n}", "function setupUI() {\n //Form controls\n createElement(\"frm\", \"US Census layer controls:\");\n createP(); // spacer\n uiBoss.radio = createRadio();\n\n uiBoss.radio.option(\"sex\", \"Sex\");\n uiBoss.radio.option(\"race\", \"Race / Ethnicity\");\n uiBoss.radio.option(\"incRace\", \"Median Income by Race\");\n\n uiBoss.radio.changed(updateViz);\n\n createP(); // spacer\n uiBoss.checkbox1 = createCheckbox(\"Show state name\");\n uiBoss.checkbox1.changed(updateViz);\n\n createP(); // spacer\n uiBoss.checkbox2 = createCheckbox(\"Show median housing value\");\n uiBoss.checkbox2.changed(updateViz);\n}", "start() {\n return this.api.getSchema().then(openapi_schema => {\n fieldsRegistrator.registerAllFieldsComponents();\n this.initModels();\n this.initViews();\n this.mountApplication();\n }).catch(error => {\n debugger;\n throw new Error(error);\n });\n }", "generateLayoutData() {\n // This class is base class, can be called with this method.\n return {\n id: this.id,\n className: this.constructor.name,\n prop: map2json(this.prop),\n layout: {\n width: this.ui.width,\n height: this.ui.height,\n left: this.ui.left,\n top: this.ui.top,\n hidden: this.ui.hidden,\n }\n };\n }", "renderTable() {\n if (!this.hasSetupRender()) {\n return;\n }\n\n // Iterate through each found schema\n // Each of them will be a table\n this.parsedData.forEach((schemaData, i) => {\n const tbl = document.createElement('table');\n tbl.className = `${this.classNamespace}__table`;\n\n // Caption\n const tblCaption = document.createElement('caption');\n const tblCaptionText = document.createTextNode(`Generated ${this.schemaName} Schema Table #${i + 1}`);\n tblCaption.appendChild(tblCaptionText);\n\n // Table Head\n const tblHead = document.createElement('thead');\n const tblHeadRow = document.createElement('tr');\n const tblHeadTh1 = document.createElement('th');\n const tblHeadTh2 = document.createElement('th');\n const tblHeadTh1Text = document.createTextNode('itemprop');\n const tblHeadTh2Text = document.createTextNode('value');\n tblHeadTh1.appendChild(tblHeadTh1Text);\n tblHeadTh2.appendChild(tblHeadTh2Text);\n tblHeadRow.appendChild(tblHeadTh1);\n tblHeadRow.appendChild(tblHeadTh2);\n tblHead.appendChild(tblHeadRow);\n\n const tblBody = document.createElement('tbody');\n\n generateTableBody(tblBody, schemaData);\n\n // put the <caption> <thead> <tbody> in the <table>\n tbl.appendChild(tblCaption);\n tbl.appendChild(tblHead);\n tbl.appendChild(tblBody);\n // appends <table> into container\n this.containerEl.appendChild(tbl);\n // sets the border attribute of tbl to 0;\n tbl.setAttribute('border', '0');\n });\n\n // Close table btn\n const closeBtn = document.createElement('button');\n closeBtn.setAttribute('aria-label', 'Close');\n closeBtn.setAttribute('type', 'button');\n closeBtn.className = 'schema-parser__close';\n this.containerEl.appendChild(closeBtn);\n // Add close handler\n closeBtn.addEventListener('click', this.handleClose.bind(this));\n }", "_initializeComponent() {\n //Heade\n this.elements.header = document.createElement(\"div\");\n this.elements.title = document.createElement(\"span\");\n this.elements.range = document.createElement(\"span\");\n\n this.elements.header.className = \"chart-header\";\n this.elements.title.className = \"chart-title\";\n this.elements.range.className = \"chart-range\";\n\n this.elements.header.appendChild(this.elements.title);\n this.elements.header.appendChild(this.elements.range);\n\n //Tooltip\n this.elements.tooltip = document.createElement(\"div\");\n this.elements.date = document.createElement(\"span\");\n this.elements.values = document.createElement(\"div\");\n\n this.elements.tooltip.className = \"chart-tooltip\";\n this.elements.date.className = \"chart-tooltip-date\";\n this.elements.values.className = \"chart-tooltip-values\";\n\n this.elements.tooltip.appendChild(this.elements.date);\n this.elements.tooltip.appendChild(this.elements.values);\n\n //Render\n this.elements.render = document.createElement(\"div\");\n this.elements.chart = document.createElement(\"canvas\");\n this.elements.layout = document.createElement(\"canvas\");\n\n this.elements.render.className = \"chart-render\";\n this.elements.chart.className = \"chart-render-chart\";\n this.elements.layout.className = \"chart-render-layout\";\n\n this.elements.render.appendChild(this.elements.chart);\n this.elements.render.appendChild(this.elements.layout);\n\n //Preview\n this.elements.control = document.createElement(\"div\");\n this.elements.preview = document.createElement(\"canvas\");\n this.elements.select = document.createElement(\"div\");\n this.elements.draggerLeft = document.createElement(\"div\");\n this.elements.draggerRight = document.createElement(\"div\");\n this.elements.coverLeft = document.createElement(\"div\");\n this.elements.coverRight = document.createElement(\"div\");\n\n this.elements.control.className = \"chart-control\";\n this.elements.preview.className = \"chart-preview\";\n this.elements.select.className = \"chart-select\";\n this.elements.draggerLeft.className = \"chart-dragger chart-dragger-left\";\n this.elements.draggerRight.className = \"chart-dragger chart-dragger-right\";\n this.elements.coverLeft.className = \"chart-cover chart-cover-left\";\n this.elements.coverRight.className = \"chart-cover chart-cover-right\";\n\n this.elements.control.appendChild(this.elements.preview);\n this.elements.control.appendChild(this.elements.coverLeft);\n this.elements.control.appendChild(this.elements.select);\n this.elements.select.appendChild(this.elements.draggerLeft);\n this.elements.select.appendChild(this.elements.draggerRight);\n this.elements.control.appendChild(this.elements.coverRight);\n\n //Graph buttons container\n this.elements.graphs = document.createElement(\"div\");\n\n this.elements.graphs.className = \"chart-graphs\";\n\n //Main container\n this.elements.container.className += \" chart-container\";\n\n this.elements.container.appendChild(this.elements.header);\n this.elements.container.appendChild(this.elements.tooltip);\n this.elements.container.appendChild(this.elements.render);\n this.elements.container.appendChild(this.elements.control);\n this.elements.container.appendChild(this.elements.graphs);\n }", "buildUI() {\n this.node.innerHTML = '<input type=\"text\" spellcheck=\"false\"></input>';\n this.textInputNode = this.node.getElementsByTagName('input')[0];\n this.setFocusableNode(this.textInputNode);\n this.setMaxLength(this.maxLength);\n }", "function fillInstanceUI(d, expanded, indicatorText){\n var classesString = ( d.class.length>0)?\"\":\"! NO CLASS !\";\n each(d.class, function (obj) {\n classesString += getNameFromCollection(obj, Oclasses)+\", \";\n });\n classesString = classesString.substr(0, classesString.length-2);\n\n var lContainerContents = ui.SimpleText({text: d.name,textClass: \"basicTextInGraph\",vertMargin: 5});\n if (expanded){ //if an item is expanded\n if (!indicatorText){ // if data properties are loaded\n var dataProps = [{left: \"отсутствуют\", right: \"\"}];\n if (containsInObj(d, \"dataProps\") && d.dataProps.length>0) {\n dataProps = [];\n each(d.dataProps, function (d) { dataProps.push({left: getNameFromCollection(d.id,dataTypeProperties), right: d.val});});\n }\n var text = ui.StructuredText({nameTextClass: \"paragraphHeaderGraph\", valTextClass: \"basicTextInGraph\",\n struct_text: [{name: \"Свойства:\", val: dataProps}],\n percent_leftright: 50, indentBetweenLeftAndRight: 0, horIndent: 15, vertMargin: 3});\n lContainerContents.vertMargin = 3;\n lContainerContents = ui.LayoutContainer1(\n {upperText: lContainerContents, lowerText: text, lineFill: d.color, lineSize: 2, vertMargin: 6});\n } else { //if data properties are not loaded and indicator should be placed\n var indicatorSize = 25, margin = {top: 8, bottom: 0, left: 0, right: 0};\n lContainerContents = ui.LayoutContainer1({\n lineFill: d.color,\n upperText: ui.SimpleText({text: d.name, textClass: \"basicTextInGraph\", vertMargin: 5}),\n lowerText: {\n height: function () { return indicatorSize + margin.top + margin.bottom; },\n render: function (parent, x, y, width) {\n d.dataIndicator.status(indicatorText);\n d.dataIndicator.ui = Indicator.create(parent, {size: indicatorSize,\n position: vector(x + margin.left + indicatorSize / 2, y + margin.top + indicatorSize / 2),\n maxWidth: Math.max(0, width - margin.left - margin.right - indicatorSize / 2)});\n updateIndicatorUI(d.dataIndicator);\n d.dataIndicator.ui.run();\n }\n }\n });\n }\n }\n\n var toRet = ui.NiceRoundRectangle({uText: classesString,\n lContainer: lContainerContents, color: d.color, marginX: (expanded)?0:20, marginXTop: 20, marginY: 5, borderSize: 2,\n classUpperText: \"headersInGraph\"\n });\n return toRet;\n }", "function CreateVisField(fieldName){\n//Decide what type of visualisation the user wants to use (in this specific div). \n\tvar vis = d3.select(\"#\" + fieldName);\n\t\t\t\t\t\t\t\n\tvar upperbar = vis.append(\"div\")\n\t\t\t\t\t .attr(\"class\" , \"upperVisBox\")\n\t\t\t\t\t .attr(\"float\" , \"left\")\n\t\t\t\t\t .attr(\"id\" , \"upperbar\");\n\n //Add close button to upperbar:\n var closeButton = upperbar.append(\"button\")\n .attr(\"class\", \"closeButton\")\n .attr(\"id\", \"close_\" + fieldName)\n .attr(\"onclick\" , \"changeListenerFunction(\"+ \"'\"+ fieldName + \"'\"+ \")\");\n\n var closeLabel = upperbar.append(\"label\")\n .attr(\"for\", \"close_\" + fieldName)\n .attr(\"class\", \"fa fa-times closeLabel\")\n .attr(\"style\", \"font-size: 20px;\");\n\n\t//define ('hardcode') the possible visualisations:\t\n let select = upperbar.append(\"select\")\n\t\t\t\t\t\t .attr(\"id\" , \"selector\" + fieldName)\t\t\t\t \n\t\t\t\t\t\t .attr(\"class\" , \"selectorUI\")\n\t\t\t\t\t\t .attr(\"onchange\" , \"OnChangeSelect(\"+ \"'\" + fieldName + \"'\" +\")\");\n\t\n //Must be defined again as we define it here as a DOM element!\n var selector = document.getElementById(\"selector\" + fieldName);\n visualisations.forEach(function(d){\n let newOption = document.createElement(\"option\");\n newOption.text = d;\n selector.add(newOption);\n });\n\n //set invisible option:\t\t\t\t\t\n select.append(\"option\")\n\t .attr(\"selected\" , \"true\")\n\t .attr(\"hidden\" , \"true\")\n\t .text(\"Choose a visualisation\");\t\t\n\t\t\t\n}", "function createUI(){\n /**\n * @class DocumentApp\n */\n enyo.kind(\n /** @lends DocumentApp.prototype */\n {\n name: 'DocumentApp',\n kind: enyo.Control,\n\n /**\n * When the component is being created it renders the\n\t\t\t\t * template for the document preview, and calling functions\n\t\t\t\t * that process cookie and GET parameters.\n\t\t\t\t * @method create\n */\n create: function(){\n this.inherited(arguments);\n renderTemplateDiv();\n\t\t\t\t\tthis.processCookieValues();\n this.processGETParameters();\n },\n\n /**\n * After the rendering the program calculates and sets the\n * position of the bookmark popup and the size of the preview box.\n\t\t\t\t * @method rendered\n */\n rendered: function(){\n this.inherited(arguments);\n this.previewOriginHeight = jQuery('#' + this.$.previewBox.getOpenDocId()).height();\n this.changeBMPopupPosition();\n\t\t\t\t\tthis.initDraggers();\n },\n\n published: {\n searchWord: '',\n checkedEntities: [],\n lang: 'en'\n },\n\n components: [\n {\n kind: 'TopMessageBox',\n name: 'topMessageBox',\n classes: 'topMessageBox'\n },\n {\n tag: 'div',\n classes: 'docApp',\n name: 'docApp',\n components: [\n { name: 'Toolbar', classes: 'toolbar', components: [\n { name: 'ToolbarCenter', classes: 'toolbarCenter', components: [\n {\n\t\t\t\t\t\t\t\t\t\t\tname: 'mainLogo',\n\t\t\t\t\t\t\t\t\t\t\tclasses: 'mainLogo',\n\t\t\t\t\t\t\t\t\t\t\tontap: 'clickLogo'\n },\n {\n\t\t\t\t\t\t\t\t\t\t\tkind: 'SearchBox',\n\t\t\t\t\t\t\t\t\t\t\tname: 'searchBox',\n\t\t\t\t\t\t\t\t\t\t\tplaceholder: 'Search in documents',\n\t\t\t\t\t\t\t\t\t\t\tbuttonClass: 'searchButton',\n\t\t\t\t\t\t\t\t\t\t\tbuttonContent: 'OK',\n\t\t\t\t\t\t\t\t\t\t\tsearchIconClass: 'searchImage',\n\t\t\t\t\t\t\t\t\t\t\tparentSeachFunction: 'search'\n },\n\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\tname: 'toolbarIcons',\n\t\t\t\t\t\t\t\t\t\t\tclasses: 'toolbarIcons',\n\t\t\t\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t\t\t\t{kind: 'Group', classes: 'viewTypeToggleButtons', onActivate: \"onViewTypeToggle\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'docListViewButton', classes: 'docListViewButton' },\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Document list view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'entityListViewButton', classes: 'entityListViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Entity list view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'locationViewButton', classes: 'locationViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"LocationMapper\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'landscapeViewButton', classes: 'landscapeViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Landscape view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'nGraphViewButton', classes: 'nGraphViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Network graph view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t{kind: 'onyx.MenuDecorator', name: 'styleSettingsSelect', classes: 'styleSettingsSelect', onSelect: 'selectCss', components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'brushButton', classes: 'brushButton' },\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Style settings\", classes: 'menuItemTooltip', active: false },\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Menu\", name: 'styleSettingsMenu', classes: 'styleSettingsMenu', components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"Default\", name: \"firstswim\", classes: \"stylePickerItem\", value: 'firstswim'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"High contrast\", name: \"contrast\", classes: \"stylePickerItem\", value: 'contrast'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"Orange\", name: \"beer\", classes: \"stylePickerItem\", value: 'beer'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"Clear\", name: \"clear\", classes: \"stylePickerItem\", value: 'clear'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", ontap: 'login', name: 'loginButton', classes: 'loginButton loggedOut' },\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Login\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t\t\t\t/*,\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'bookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'Bookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\tbuttonClass: 'bookmarkButton',\n\t\t\t\t\t\t\t\t\t\t\t\t\tparentTapFunction: 'createBookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\tparentPopupFunction: 'popupBookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\twarningPopupClass: 'bookmarkPopup',\n\t\t\t\t\t\t\t\t\t\t\t\t\twarningPopupContent: '<br/>Your browser doesn\\'t support add bookmark via Javascript.<br/><br/>Please insert this URL manually:<br/><br/>'\n\t\t\t\t\t\t\t\t\t\t\t\t} */\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tkind: 'LoginPopup',\n\t\t\t\t\t\t\t\t\t\t\tname: 'loginPopup',\n\t\t\t\t\t\t\t\t\t\t\tclasses: 'loginPopup'\n\t\t\t\t\t\t\t\t\t\t}\n ]}\n ]},\n { kind: 'ClosablePopup', name: 'bookmarkPopup', classes: 'bookmarkPopup', popupClasses: 'bookmarkPopupDiv', closeButtonClasses: 'popupCloseButton' },\n {\n kind: 'PreviewBox',\n name: 'previewBox',\n classes: 'previewBox',\n previewBoxMainTitle: 'Preview',\n previewBoxMainTitleClass: 'previewBoxMainTitle'\n }\n ]\n }\n ],\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function calls the 'initViewType' function which\n\t\t\t\t * sets the view type based on cookie values and calls the\n\t\t\t\t * 'setCss' function too.\n\t\t\t\t * @method processCookieValues\n\t\t\t\t */\n\t\t\t\tprocessCookieValues: function() {\n\t\t\t\t\tthis.initViewType();\n\t\t\t\t\tthis.setCss(readCookie('css'));\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function runs when the user selects a stylesheet.\n\t\t\t\t * It calls the 'setCss' function with the proper value.\n\t\t\t\t * @method selectCss\n\t\t\t\t */\n\t\t\t\tselectCss: function(inSender, inEvent) {\n\t\t\t\t\tthis.setCss(inEvent.originator.value);\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function changes the stylesheet behind the page and \n\t\t\t\t * places a cookie.\n\t\t\t\t * @method setCss\n\t\t\t\t */\n\t\t\t\tsetCss: function(cssName) {\n\t\t\t\t\t$(\"#mainCss\").attr(\"href\", CONSTANTS.STYLE_PATH + cssName + \".css\");\n\t\t\t\t\tcreateCookie('css', cssName, 30);\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function initializes the view type at the beginning\n\t\t\t\t * using the 'viewType' cookie value by setting up the toggle \n\t\t\t\t * buttons and calling the 'createViewType' function with the\n\t\t\t\t * proper parameter value.\n\t\t\t\t * @method initViewType\n\t\t\t\t */\n\t\t\t\tinitViewType: function() {\n\t\t\t\t\tswitch(readCookie('viewType')) {\n\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\tthis.$.docListViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tthis.$.entityListViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'locationViewer':\n\t\t\t\t\t\t\tthis.$.locationViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'landscape':\n\t\t\t\t\t\t\tthis.$.landscapeViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\tthis.$.nGraphViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthis.$.docListViewButton.setActive(true);\n\t\t\t\t\t}\n\t\t\t\t\tthis.createViewType(readCookie('viewType'));\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function runs after changing the view type.\n\t\t\t\t * First, it checks whether it is really a change or\n\t\t\t\t * the same as the current one. If it has to be changed,\n\t\t\t\t * it calls the toggle functions, sets the cookie value\n\t\t\t\t * and fires a search using the current search term.\n\t\t\t\t * @method toggleViewType\n\t\t\t\t */\n\t\t\t\ttoggleViewType: function(viewType) {\n\t\t\t\t\tif(readCookie('viewType') != viewType) {\n\t\t\t\t\t\tthis.destroyCurrentViewType(viewType);\n\t\t\t\t\t\tcreateCookie('viewType', viewType, 30);\n\t\t\t\t\t\tthis.createViewType(viewType);\n\t\t\t\t\t\tthis.search(this.searchWord);\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 * This function initializes every components after changing \n\t\t\t\t * view type. It creates both panels and draggers.\n\t\t\t\t * @method createViewType\n\t\t\t\t */\n\t\t\t\tcreateViewType: function(viewType) {\n\t\t\t\t\tswitch(viewType) {\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DictionaryController',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenClasses: 'dictionaryListOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseClasses: 'dictionaryListClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenScrollerClass: 'dictionaryListScrollOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseScrollerClass: 'dictionaryListScrollClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tentityCheckboxClass: 'dictionaryCheckbox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchFunction: 'search',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'dictionaries',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdictionaryTitle: 'Entities',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'dictionariesMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tshowDetailsFunction: 'displayDetails'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DetailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'detailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'detailsBox enyo-unselectable',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdetailsMainTitle: 'Details',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmainTitleClass: 'detailsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'detailsScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'detailsTitle'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'firstDocDragger', classes: 'firstDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tkind: 'DocumentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'documents',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocFunction: 'openDoc',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocEvent: 'ontap',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'documentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'documentListScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'documentsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassifyFinishFunction: 'processClassifyResponse',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleContent: 'Documents ',\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocumentsCountClass: 'documentsCount',\n\t\t\t\t\t\t\t\t\t\t\t\t\tnoDataLabel: 'No data available',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreButtonClass: 'moreButton',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreDocumentsFunction: 'moreDocuments'\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'secondDocDragger', classes: 'secondDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.render();\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'entityList':\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DictionaryController',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenClasses: 'dictionaryListOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseClasses: 'dictionaryListClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenScrollerClass: 'dictionaryListScrollOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseScrollerClass: 'dictionaryListScrollClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tentityCheckboxClass: 'dictionaryCheckbox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchFunction: 'search',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'dictionaries',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdictionaryTitle: 'Organizations',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'dictionariesMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tshowDetailsFunction: 'displayDetails'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DetailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'detailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'detailsBox enyo-unselectable',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdetailsMainTitle: 'Details',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmainTitleClass: 'detailsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'detailsScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'detailsTitle'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'firstDocDragger', classes: 'firstDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tkind: 'DocumentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'documents',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocFunction: 'openDoc',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocEvent: 'ontap',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'documentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'documentListScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'documentsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassifyFinishFunction: 'processClassifyResponse',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleContent: 'People ',\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocumentsCountClass: 'documentsCount',\n\t\t\t\t\t\t\t\t\t\t\t\t\tnoDataLabel: 'No data available',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreButtonClass: 'moreButton',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreDocumentsFunction: 'moreDocuments'\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'secondDocDragger', classes: 'secondDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'locationViewer':\n\t\t\t\t\t\t\tthis.createComponent({\n\t\t\t\t\t\t\t\tkind: 'LocationViewer',\n\t\t\t\t\t\t\t\tname: 'locationViewer',\n\t\t\t\t\t\t\t\tclasses: 'locationViewerPanel',\n\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\ttitleClass: 'locationViewerMainTitle',\n\t\t\t\t\t\t\t\ttitleContent: 'Location viewer ',\n\t\t\t\t\t\t\t\tnoDataLabel: 'No data available'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'landscape':\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\n\t\t\t\t\t\t\t\t\tkind: 'Landscape',\n\t\t\t\t\t\t\t\t\tname: 'landscape',\n\t\t\t\t\t\t\t\t\tclasses: 'landscapePanel',\n\t\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\t\ttitleClass: 'landscapeMainTitle',\n\t\t\t\t\t\t\t\t\ttitleContent: 'Landscape '\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\tthis.createComponent({\n\t\t\t\t\t\t\t\tkind: 'NGraph',\n\t\t\t\t\t\t\t\tname: 'nGraph',\n\t\t\t\t\t\t\t\topenDocFunction: 'openDoc',\n\t\t\t\t\t\t\t\topenDocEvent: 'ontap',\n\t\t\t\t\t\t\t\tclasses: 'nGraphPanel',\n\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\ttitleClass: 'nGraphMainTitle',\n\t\t\t\t\t\t\t\ttitleContent: 'Network graph ',\n\t\t\t\t\t\t\t\tnoDataLabel: 'No data available'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'nGraphDragger', classes: 'nGraphDragger verticalDragger' });\n\t\t\t\t\t\t\tthis.render();\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/**\n\t\t\t\t * This function handles view type toggling by calling the\n\t\t\t\t * toggle function with the proper parameter.\n\t\t\t\t * @method onViewTypeToggle\n\t\t\t\t */\n\t\t\t\tonViewTypeToggle: function(inSender, inEvent) {\n\t\t\t\t\tif (inEvent.originator.getActive()) {\n\t\t\t\t\t\t//var selected = inEvent.originator.indexInContainer();\n\t\t\t\t\t\tswitch(inEvent.originator.name) {\n\t\t\t\t\t\t\tcase 'docListViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('documentList');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'entityListViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('entityList');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'locationViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('locationViewer');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'landscapeViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('landscape');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'nGraphViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('nGraph');\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\t\n\t\t\t\t/**\n\t\t\t\t * This function destroys every components of the current view type\n\t\t\t\t * in case it's not the same as the new view type.\n\t\t\t\t * @method destroyCurrentViewType\n\t\t\t\t */\n\t\t\t\tdestroyCurrentViewType: function(newType) {\n\t\t\t\t\tswitch (readCookie('viewType')) {\n\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\tthis.$.nGraph.destroy();\n\t\t\t\t\t\t\tthis.$.nGraphDragger.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'documentList':\t\n\t\t\t\t\t\tcase 'entityList':\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.$.leftDesktopCol.destroy();\n\t\t\t\t\t\t\tthis.$.firstDocDragger.destroy();\n\t\t\t\t\t\t\tthis.$.documents.destroy();\n\t\t\t\t\t\t\tthis.$.secondDocDragger.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'landscape':\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.$.landscape.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'locationViewer':\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.$.locationViewer.destroy();\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/**\n\t\t\t\t * This function initializes all the draggers that the page contains.\n\t\t\t\t * It uses jQuery 'draggable'.\n\t\t\t\t * @method initDraggers\n\t\t\t\t */\n\t\t\t\tinitDraggers: function() {\n\t\t\t\t\tif($('.firstDocDragger').length > 0) {\n\t\t\t\t\t\t$('.firstDocDragger').draggable({\n\t\t\t\t\t\t\taxis: \"x\",\n\t\t\t\t\t\t\tdrag: function( event, ui ) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar docListCalcWidth = parseInt($('.previewBox').css('left'), 10) - ((ui.position.left - 10 ) + 30);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif( ui.position.left > 80 && docListCalcWidth > 160 ) {\n\t\t\t\t\t\t\t\t\t$('.leftDesktopCol').css('width', ( ui.position.left - 10 )+'px');\n\t\t\t\t\t\t\t\t\t$('.documentList').css('left', ( ui.position.left + 10 )+'px');\n\t\t\t\t\t\t\t\t\t$('.documentList').css('width', docListCalcWidth+'px');\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\tevent.type = 'mouseup';\n\t\t\t\t\t\t\t\t\t$('.firstDocDragger').trigger(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif($('.secondDocDragger').length > 0) {\n\t\t\t\t\t\t$('.secondDocDragger').draggable({\n\t\t\t\t\t\t\taxis: \"x\",\n\t\t\t\t\t\t\tdrag: function( event, ui ) {\n\t\t\t\t\t\t\t\tvar docListCalcWidth = ui.position.left - ($('.leftDesktopCol').width() + 20);\n\t\t\t\t\t\t\t\tif( ($(document).width() - ui.position.left ) > 80 && docListCalcWidth > 160 ) {\n\t\t\t\t\t\t\t\t\t$('.documentList').css('width', docListCalcWidth + 'px');\n\t\t\t\t\t\t\t\t\t$('.previewBox').css('left', ( ui.position.left + 10 )+'px');\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\tevent.type = 'mouseup';\n\t\t\t\t\t\t\t\t\t$('.secondDocDragger').trigger(event);\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\tif($('.nGraphDragger').length > 0) {\n\t\t\t\t\t\tvar main = this;\n\t\t\t\t\t\t$('.nGraphDragger').draggable({\n\t\t\t\t\t\t\taxis: \"x\",\n\t\t\t\t\t\t\tdrag: function( event, ui ) {\n\t\t\t\t\t\t\t\tvar nGraphCalcWidth = ui.position.left - 10;\n\t\t\t\t\t\t\t\tif( ($(document).width() - ui.position.left ) > 80 && nGraphCalcWidth > 160 ) {\n\t\t\t\t\t\t\t\t\t$('.nGraphDiv').css('width', nGraphCalcWidth + 'px');\n\t\t\t\t\t\t\t\t\t$('.previewBox').css('left', ( ui.position.left + 10 )+'px');\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\tevent.type = 'mouseup';\n\t\t\t\t\t\t\t\t\t$('.nGraphDragger').trigger(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmain.$.nGraph.onDivResize();\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\n /**\n * This function is called, when the user clicks on the login button.\n * It displays the login popup window.\n\t\t\t\t * @method login\n */\n login: function(){\n this.$.loginPopup.showLogin();\n },\n\n /**\n * This function is called when the user clicks on the logo.\n * It navigates to the Fusepool main site.\n\t\t\t\t * @method clickLogo\n */\n clickLogo: function(){\n window.open(CONSTANTS.FUSEPOOL_MAIN_URL);\n },\n\n /**\n * This function processes GET parameters. If it finds 'search' or\n * 'entity', it fires a search and open the document if there is the\n * 'openPreview' parameter.\n\t\t\t\t * @method processGETParameters\n */\n processGETParameters: function(){\n // Search\n this.search(GetURLParameter('search')[0], GetURLParameter('entity'));\n // Open Document\n var openPreview = GetURLParameter('openPreview')[0];\n if(!isEmpty(openPreview)){\n this.openDoc(openPreview);\n }\n },\n\n /**\n * This function calculates the position of the previewed document\n * and opens the document on the right.\n\t\t\t\t * @method openDoc\n * @param {String} docURI the URI of the clicked document\n * @param {Object} inEvent mouse over on a short document event\n */\n openDoc: function(docURI, inEvent){\n if(!isEmpty(inEvent)){\n var topMessage = jQuery('#' + this.$.topMessageBox.getId());\n var topMessageVisible = topMessage.is(':visible');\n var topMessageHeight = 0;\n if(topMessageVisible){\n topMessageHeight = topMessage.outerHeight();\n alert(topMessageHeight);\n }\n }\n this.$.previewBox.openDoc(docURI);\n },\n\t\t\t\t\n /**\n * This function queries the Annostore for a single annotation - only for testing purposes.\n\t\t\t\t * @method getAnnotation\n * @param {String} annotationIRI identifier of the annotation\n */\n\t\t\t\tgetAnnotation: function(annotationIRI){\n\t\t\t\t\tvar request = new enyo.Ajax({\n\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\turl: CONSTANTS.ANNOTATION_URL+'?iri='+annotationIRI,\n\t\t\t\t\t\thandleAs: 'text',\n\t\t\t\t\t\theaders: { Accept : 'application/rdf+xml', 'Content-Type' : 'application/x-www-form-urlencoded'},\n\t\t\t\t\t\tpublished: { timeout: 60000 }\n\t\t\t\t\t});\n\t\t\t\t\trequest.go();\n\t\t\t\t\trequest.error(this, function(){\n\t\t\t\t\t\tconsole.log(\"error\");\n\t\t\t\t\t});\n\t\t\t\t\trequest.response(this, function(inSender, inResponse) {\n\t\t\t\t\t\t// console.log(\"success: \"+inResponse);\n\t\t\t\t\t});\n },\n\n /**\n * This function creates and saves a bookmark, which contains the\n * search word, the unchecked entities and the opened document.\n\t\t\t\t * @method createBookmark\n */\n createBookmark: function(){\n if(!isEmpty(this.searchWord)){\n // Cut characters after '?'\n var location = window.location.href;\n var parametersIndex = location.indexOf('?');\n if(parametersIndex !== -1){\n location = location.substr(0, parametersIndex);\n }\n // Search word\n var url = location + '?search=' + this.searchWord;\n // Unchecked entities\n var entities = this.getCheckedEntities();\n for(var i=0;i<entities.length;i++){\n if(!isEmpty(entities[i].id)){\n url += '&entity=' + entities[i].id;\n } else {\n url += '&entity=' + entities[i];\n }\n }\n // Preview document\n var documentURL = this.$.previewBox.getDocumentURI();\n if(!isEmpty(documentURL)){\n url += '&openPreview=' + documentURL;\n }\n\n var title = 'Fusepool';\n this.$.bookmark.saveBookmark(url, title);\n } else {\n this.$.bookmark.saveBookmark(url, title);\n }\n },\n\n /**\n * This function shows a message in a popup.\n\t\t\t\t * @method popupBookmark\n * @param {String} message the message\n */\n popupBookmark: function(message){\n this.$.bookmarkPopup.show();\n this.$.bookmarkPopup.setContent(message);\n this.changeBMPopupPosition();\n },\n\n /**\n * This function calculates the position of the popup to be \n * displayed horizontally in the center, vertically on the top.\n\t\t\t\t * @method changeBMPopupPosition\n */\n changeBMPopupPosition: function(){\n if(!isEmpty(this.$.bookmarkPopup.getContent())){\n var jQBookmark = jQuery('#' + this.$.bookmarkPopup.getId());\n var popupWidth = jQBookmark.outerWidth();\n var windowWidth = jQuery('#' + this.getId()).width();\n var newLeft = (windowWidth - popupWidth) / 2;\n this.$.bookmarkPopup.applyStyle('left', newLeft + 'px');\n }\n },\n\n /**\n * This function is called when the screen size is changing.\n * This function calls the bookmark popup changer function and the\n * preview box size changer function.\n\t\t\t\t * @method resizeHandler\n */\n resizeHandler: function() {\n this.inherited(arguments);\n this.changeBMPopupPosition();\n },\n\n /**\n * This function reduces the preview box height if there isn't enough\n * place for that. It sets the default height for the box otherwise.\n\t\t\t\t * @method changePreviewBoxSize\n */\n changePreviewBoxSize: function(){\n var windowHeight = jQuery(window).height();\n var newHeight = windowHeight - 110;\n\n if(newHeight < this.previewOriginHeight){\n this.$.previewBox.changeHeight(newHeight);\n } else {\n this.$.previewBox.changeHeight(this.previewOriginHeight);\n }\n },\n\n /**\n * This function calls the ajax search if the search word is not empty.\n\t\t\t\t * @method search\n * @param {String} searchWord the search word\n * @param {Array} checkedEntities the checked entities on the left side\n */\n search: function(searchWord, checkedEntities){\n\t\t\t\t\tcheckedEntities = typeof checkedEntities !== 'undefined' ? checkedEntities : [];\n this.searchWord = searchWord;\n\t\t\t\t\tcreateCookie('lastSearch',searchWord,30);\n this.checkedEntities = checkedEntities;\n if(!isEmpty(searchWord)){\n\t\t\t\t\t\tthis.cleanPreviewBox();\n\t\t\t\t\t\tswitch(readCookie('viewType')) {\n\t\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\t\tthis.$.documents.startLoading();\n\t\t\t\t\t\t\t\tthis.sendSearchRequest(searchWord, checkedEntities, 'processSearchResponse');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\t\tthis.$.nGraph.newGraph();\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'landscape':\n\t\t\t\t\t\t\t\tthis.$.landscape.startLoading();\n\t\t\t\t\t\t\t\tthis.sendSearchRequest(searchWord, [], 'processSearchResponse');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'locationViewer':\n\t\t\t\t\t\t\t\tthis.$.locationViewer.search(searchWord);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n this.$.searchBox.updateInput(this.searchWord);\n }\n },\n\n /**\n * This function sends an ajax request for searching.\n\t\t\t\t * @method sendSearchRequest\n * @param {String} searchWord the search word\n * @param {String} checkedEntities the checked entities on the left side\n * @param {String} responseFunction the name of the response function\n * @param {Number} offset the offset of the documents (e.g. offset = 10 --> documents in 10-20)\n */\n sendSearchRequest: function(searchWord, checkedEntities, responseFunction, offset){\n var main = this;\n var url = this.createSearchURL(searchWord, checkedEntities, offset);\n var store = rdfstore.create();\n store.load('remote', url, function(success) {\n main[responseFunction](success, store);\n });\n },\n\n /**\n * This function creates the search URL for the query.\n\t\t\t\t * @method createSearchURL\n * @param {String} searchWord the search word\n * @param {Array} checkedEntities the checked entities\n * @param {Number} offset offset of the query\n * @return {String} the search url\n */\n createSearchURL: function(searchWord, checkedEntities, offset){\n\t\t\t\t\t\n\t\t\t\t\t// var labelPattern = /^.*'label:'.*$/;\n\t\t\t\t\t// if(labelPattern.test(searchWord)) {\n\t\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t// var predictedLabelPattern = /^.*'predicted label:'.*$/;\n\t\t\t\t\t// if(predictedLabelPattern.test(searchWord)) {\n\t\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t\n\t\t\t\t\tif(readCookie('viewType') == \"entityList\") {\n\t\t\t\t\t\tvar url = CONSTANTS.ENTITY_SEARCH_URL;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar url = CONSTANTS.SEARCH_URL;\n\t\t\t\t\t}\n if(isEmpty(offset)){\n offset = 0;\n }\n url += '?search='+searchWord;\n if(checkedEntities.length > 0){\n url += this.getCheckedEntitiesURL(checkedEntities);\n }\n url += '&offset='+offset+'&maxFacets='+readCookie('maxFacets')+'&items='+readCookie('items');\n return url;\n },\n\n /**\n * This function sends a request for more documents.\n\t\t\t\t * @method moreDocuments\n * @param {Number} offset the offset of the document (e.g. offset = 10 -> documents 10-20)\n */\n moreDocuments: function(offset){\n this.sendSearchRequest(this.searchWord, this.checkedEntities, 'processMoreResponse', offset);\n },\n\n /**\n * This function runs after the ajax more search is done.\n * This function calls the document updater function.\n\t\t\t\t * @method processMoreResponse\n * @param {Boolean} success status of the search query\n * @param {Object} rdf the response rdf object\n */\n processMoreResponse: function(success, rdf){\n var documents = this.createDocumentList(rdf);\n this.$.documents.addMoreDocuments(documents);\n },\n\n /**\n * This function creates a URL fraction that represents\n\t\t\t\t * the checked entities.\n\t\t\t\t * @method getCheckedEntitiesURL\n * @param {Array} checkedEntities the original checked entities\n * @return {String} built URL fraction\n */\n getCheckedEntitiesURL: function(checkedEntities){\n var result = '';\n for(var i=0;i<checkedEntities.length;i++){\n if(checkedEntities[i].typeFacet){ \n result += '&type=' + replaceAll(checkedEntities[i].id, '#', '%23');\n } else {\n result += '&subject=' + checkedEntities[i].id;\n }\n }\n return result;\n },\n\n /**\n * This function runs after the ajax search is done. It calls\n * the entity list updater and the document updater functions.\n\t\t\t\t * @method processSearchResponse\n * @param {Boolean} success status of the search query\n * @param {Object} rdf the response rdf object\n */\n processSearchResponse: function(success, rdf){\n if(success) {\n\t\t\t\t\t\tswitch(readCookie('viewType')) {\n\t\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\t\tthis.updateEntityList(rdf, this.searchWord);\n\t\t\t\t\t\t\t\tthis.updateDocumentList(rdf);\n\t\t\t\t\t\t\t\tthis.cleanDetailsBox();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'landscape':\n\t\t\t\t\t\t\t\tFusePool.Landscaping.doSearch();\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\telse {\n\t\t\t\t\t\tthis.$.documents.updateList([], this.searchWord, this.checkedEntities);\n\t\t\t\t\t\tthis.$.documents.documentsCount = 0;\n\t\t\t\t\t\tthis.$.documents.updateCounts();\n\t\t\t\t\t}\n\t\t\t\t},\n\n /**\n * This function is called after a successful classification.\n\t\t\t\t * @method processClassifyResponse\n * @param {Object} rdf the rdf response of the request\n * @param {String} searchWord the search word\n */\n processClassifyResponse: function(rdf, searchWord){\n this.updateEntityList(rdf, searchWord);\n this.updateClassifiedDocList(rdf);\n },\n\n /**\n * This function updates the document list after classification\n\t\t\t\t * to have the correct order.\n\t\t\t\t * @method updateClassifiedDocList\n * @param {Object} rdf the RDF object\n */\n updateClassifiedDocList: function(rdf){\n var documents = this.createClassifiedDocList(rdf);\n this.$.documents.updateList(documents, this.searchWord);\n this.$.documents.documentsCount = this.getDocumentsCount(rdf);\n this.$.documents.updateCounts();\n },\n\n /**\n * This function creates a document list after classification.\n\t\t\t\t * @method createClassifiedDocList\n * @param {Object} rdf the RDF object\n * @return {Array} the created document list\n */\n createClassifiedDocList: function(rdf){\n var documents = [];\n var main = this;\n\n var query = 'SELECT * { ?url <http://fusepool.eu/ontologies/ecs#textPreview> ?preview';\n query += ' OPTIONAL { ?url <http://purl.org/dc/terms/title> ?title }';\n query += ' OPTIONAL { ?url <http://purl.org/dc/terms/abstract> ?content }';\n query += ' OPTIONAL { ?url <http://www.w3.org/2001/XMLSchema#double> ?orderVal }';\n query += '}';\n query += ' ORDER BY DESC(?orderVal)';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n if(!isEmpty(row.content) && (isEmpty(row.title) || isEmpty(row.title.lang) || row.title.lang + '' === main.lang)){\n var content = row.content.value;\n var title = '';\n if(!isEmpty(row.title)){\n title = row.title.value;\n }\n if(!main.containsDocument(documents, content, title, row.url.value)){\n documents.push({url: row.url.value, shortContent: content, title: title});\n }\n }\n }\n }\n });\n return documents;\n },\n\n /**\n * This function groups and sorts the entities and updates\n\t\t\t\t * the entity list on the left side.\n\t\t\t\t * @method updateEntityList\n * @param {Object} rdf the rdf object which contains the new entity list\n * @param {String} searchWord the search word\n */\n updateEntityList: function(rdf, searchWord){\n // The checked facets and type facets\n var checkedEntities = this.getCheckedEntities(rdf);\n\n // The facet and the type facet list\n var categories = this.getEntities(rdf);\n\n var groupVars = _.groupBy(categories, function(val){ return val.value; });\n var sortedGroup = _.sortBy(groupVars, function(val){ return -val.length; });\n\n var dictionaries = [];\n for(var i=0;i<sortedGroup.length;i++){\n // One category\n var category = sortedGroup[i];\n if(category.length > 0){\n var categoryText = replaceAll(category[0].value, '_', ' ');\n var categoryName = categoryText.substr(categoryText.lastIndexOf('/')+1);\n\n var entities = [];\n for(var j=0;j<category.length;j++){\n this.deteleLaterEntities(sortedGroup, category[j].entity, i);\n // Entity\n var entityId = category[j].entityId;\n var entityText = replaceAll(category[j].entity + '', '_', ' ');\n var entityName = entityText.substr(entityText.lastIndexOf('/')+1);\n entityName = entityName.substr(entityName.lastIndexOf('#')+1);\n var entityCount = category[j].count;\n var typeFacet = category[j].typeFacet;\n\n var entity = {id: entityId, text:entityName, count: entityCount, typeFacet: typeFacet};\n if(!this.containsEntity(entities, entity)){\n entities.push(entity);\n }\n }\n dictionaries.push({ name: categoryName, entities: entities });\n }\n }\n var dictionaryObject = { searchWord: searchWord, checkedEntities: checkedEntities, dictionaries: dictionaries };\n this.$.dictionaries.updateLists(dictionaryObject);\n },\n\n /**\n * This function searches for dictionary categories in an rdf object.\n\t\t\t\t * @method getEntities\n * @param {Object} rdf the rdf object\n * @return {Array} the categories array with the entities\n */\n getEntities: function(rdf){\n var entities = [];\n entities = this.getFacets(rdf);\n entities = entities.concat(this.getTypeFacets(rdf));\n return entities;\n },\n\n /**\n * This function searches for dictionary categories in an rdf object.\n\t\t\t\t * @method getCheckedEntities\n * @param {Object} rdf the rdf object\n * @return {Array} the categories array with the entities\n */\n getCheckedEntities: function(rdf){\n var checkedEntities = [];\n var checkedEntities = this.checkedEntitiesFromRdf(rdf);\n checkedEntities = checkedEntities.concat(this.checkedTypeFacetsFromRdf(rdf));\n return checkedEntities;\n },\n\n /**\n * This function returns an array of type facets found in an RDF object.\n\t\t\t\t * @method getTypeFacets\n * @param {Object} rdf the RDF object which contains the type facets\n * @return {Array} the result array\n */\n getTypeFacets: function(rdf){\n var result = [];\n var query = 'SELECT * { ?v <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://fusepool.eu/ontologies/ecs#ContentStoreView>.';\n query += ' ?v <http://fusepool.eu/ontologies/ecs#typeFacet> ?f. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetCount> ?count. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetValue> ?id. ';\n\t\t\t\t\tquery += '\t\tOPTIONAL { { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"en\")';\n\t\t\t\t\tquery += ' } UNION { ';\n\t\t\t\t\tquery += ' ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"\")';\n\t\t\t\t\tquery += ' } } ';\n query += ' OPTIONAL { ?id <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n var entity = row.entity;\n if(isEmpty(entity)){\n entity = row.id.value;\n } else {\n entity = row.entity.value;\n }\n var type = row.type;\n if(isEmpty(type)){\n type = 'Facet types';\n } else {\n type = row.type.value;\n }\n result.push({entityId: row.id.value, entity: entity, value: type, count: row.count.value, typeFacet: true});\n }\n }\n });\n return result;\n },\n\n\t\t\t\t/**\n * This function returns an array of facets found in an RDF object.\n\t\t\t\t * @method getFacets\n * @param {Object} rdf the RDF object which contains the facets\n * @return {Array} the result array\n\t\t\t\t*/\n getFacets: function(rdf){\n var result = [];\n var query = 'SELECT * { ?v <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://fusepool.eu/ontologies/ecs#ContentStoreView>.';\n query += ' ?v <http://fusepool.eu/ontologies/ecs#facet> ?f. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetCount> ?count. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetValue> ?id. ';\n\t\t\t\t\tquery += '\t\tOPTIONAL { { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"en\")';\n\t\t\t\t\tquery += ' } UNION { ';\n\t\t\t\t\tquery += ' ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"\")';\n\t\t\t\t\tquery += ' } } ';\n query += ' OPTIONAL { ?id <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n\t\t\t\t\t\t\t\t// if(!isEmpty(row.entity)){ \t// X branch\n if(!isEmpty(row.entity) && !isEmpty(row.type)){\n var type = row.type.value;\n var categoryName = type.substring(type.lastIndexOf('#')+1);\n result.push({entityId: row.id.value, entity: row.entity.value, value: categoryName, count: row.count.value, typeFacet: false}); \n }\n }\n }\n });\n return result;\n },\n\n /**\n * This function searches for the checked entities in an RDF object and\n * returns them.\n\t\t\t\t * @method checkedEntitiesFromRdf\n * @param {Object} rdf the rdf object\n * @return {Array} the checked entity list\n */\n checkedEntitiesFromRdf: function(rdf){\n var main = this;\n var checkedEntities = [];\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#subject> ?id';\n query += ' OPTIONAL { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n if(!isEmpty(row.entity)){\n var entity = {id: row.id.value, text: row.entity.value, count: -1, typeFacet: false};\n if(!main.containsEntity(checkedEntities, entity)){\n checkedEntities.push(entity);\n }\n }\n }\n }\n });\n return checkedEntities;\n },\n\n /**\n * This function searches for the checked entities in an RDF object and\n * returns them.\n\t\t\t\t * @method checkedTypeFacetsFromRdf\n * @param {Object} rdf the rdf object\n * @return {Array} the checked entity list\n */\n checkedTypeFacetsFromRdf: function(rdf){\n var checkedTypes = [];\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#type> ?o }';\n rdf.execute(query, function(success, results) {\n for(var i=0;i<results.length;i++){\n var id = results[i].o.value;\n var text = id.substring(id.lastIndexOf('#')+1);\n text = text.substring(text.lastIndexOf('/')+1);\n var entity = {id: id, text: text, count: -1, typeFacet: true};\n checkedTypes.push(entity);\n }\n });\n return checkedTypes;\n },\n\n /**\n * This function decides whether an entity list contains an entity or not.\n\t\t\t\t * @method containsEntity\n * @param {Array} entities the array of the entities\n * @param {String} entity the entity\n * @return {Boolean} true, if the list contains the entity, false otherwise\n */\n containsEntity: function(entities, entity){\n for(var i=0;i<entities.length;i++){\n if(entities[i].id === entity.id || entities[i].text.toUpperCase() === entity.text.toUpperCase()){\n return true;\n }\n }\n return false;\n },\n\n /**\n * This function deletes every entity from an array that equals\n * a given entity (after a given index).\n\t\t\t\t * @method deteleLaterEntities\n * @param {Array} array the array\n * @param {String} entity the checked entity\n * @param {Number} fromIndex the start index in the array\n */\n deteleLaterEntities: function(array, entity, fromIndex){\n for(var i=fromIndex+1;i<array.length;i++){\n var category = array[i];\n for(var j=0;j<category.length;j++){\n if(category[j].entity === entity){\n array[i].splice(j, 1);\n j--;\n }\n }\n }\n },\n\n /**\n * This function updates the document list in the middle.\n\t\t\t\t * @method updateDocumentList\n * @param {Object} rdf the RDF object which contains the new document list\n */\n updateDocumentList: function(rdf){\n this.$.documents.documentsCount = this.getDocumentsCount(rdf);\n this.$.documents.updateCounts();\n\t\t\t\t\tif(this.$.documents.documentsCount>0) {\n\t\t\t\t\t\tvar documents = this.createDocumentList(rdf);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar documents = [];\n\t\t\t\t\t}\n\t\t\t\t\tthis.$.documents.updateList(documents, this.searchWord, this.checkedEntities);\n },\n\n /**\n * This function deletes the content from the Preview panel.\n\t\t\t\t * @method cleanPreviewBox\n */\n cleanPreviewBox: function(){\n this.$.previewBox.clean();\n },\n\t\t\t\t\n /**\n * This function deletes the content from the Details panel.\n\t\t\t\t * @method cleanDetailsBox\n */\n cleanDetailsBox: function(){\n this.$.detailsBox.clean();\n },\n\n /**\n * This function searches for the count of documents in an rdf object.\n\t\t\t\t * @method getDocumentsCount\n * @param {Object} rdf the rdf object, which contains the count of documents.\n * @return {Number} the count of documents\n */\n getDocumentsCount: function(rdf){\n var result = 0;\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#contentsCount> ?o }';\n rdf.execute(query, function(success, results) {\n if (success) {\n\t\t\t\t\t\t\tif(results.length > 0) {\n\t\t\t\t\t\t\t\tresult = results[0].o.value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n return result;\n },\n\n\t\t\t\t/**\n\t\t\t\t * This function creates an ordered list of documents from an rdf object.\n\t\t\t\t * @method createDocumentList\n\t\t\t\t * @param {Object} rdf the rdf object\n\t\t\t\t * @return {Array} the document list\n\t\t\t\t */\n\t\t\t\tcreateDocumentList: function(rdf){\n\t\t\t\t\tvar documents = [];\n\t\t\t\t\tvar main = this;\n\t\t\t\t\tvar hits = [];\n\n\t\t\t\t\trdf.rdf.setPrefix(\"ecs\",\"http://fusepool.eu/ontologies/ecs#\");\n\t\t\t\t\trdf.rdf.setPrefix(\"rdf\",\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\");\n\t\t\t\t\tvar graph;\n\t\t\t\t\trdf.graph(function(success, things){graph = things;});\n\t\t\t\t\tvar triples = graph.match(null, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"ecs:contents\")), null).toArray();\n\t\t\t\t\tvar current = triples[0].object;\n\n\t\t\t\t\twhile(!current.equals(rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:nil\")))){\n\t\t\t\t\t\tvar hit = graph.match(current, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:first\")), null).toArray()[0].object;\n\t\t\t\t\t\thits.push(hit.nominalValue);\n\t\t\t\t\t\tcurrent = graph.match(current, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:rest\")), null).toArray()[0].object;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(readCookie('viewType') == \"entityList\") {\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar querylist = 'PREFIX foaf: <http://xmlns.com/foaf/0.1/>' + \n\t\t\t\t\t\t'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>' + \n\t\t\t\t\t\t'SELECT ?url ?name ?addresslocality ?streetaddress ' + \n\t\t\t\t\t\t'WHERE { ' + \n\t\t\t\t\t\t\t'?url rdf:type foaf:Person . ' + \n\t\t\t\t\t\t\t'?url foaf:name ?name . ' + \n\t\t\t\t\t\t\t'?url <http://schema.org/address> ?addressURI . ' + \n\t\t\t\t\t\t\t'?addressURI <http://schema.org/addressLocality> ?addresslocality . ' + \n\t\t\t\t\t\t\t'?addressURI <http://schema.org/streetAddress> ?streetaddress ' + \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\tvar querylist = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ';\n\t\t\t\t\t\t\tquerylist += 'SELECT * {';\n\t\t\t\t\t\t\tquerylist += ' { ?url <http://purl.org/dc/terms/title> ?title . ';\n\t\t\t\t\t\t\tquerylist += ' filter ( lang(?title) = \"en\")';\n\t\t\t\t\t\t\tquerylist += ' } UNION { ';\n\t\t\t\t\t\t\tquerylist += ' ?url <http://purl.org/dc/terms/title> ?title . ';\n\t\t\t\t\t\t\tquerylist += ' filter ( lang(?title) = \"\")';\n\t\t\t\t\t\t\tquerylist += ' }';\n\t\t\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://purl.org/dc/terms/abstract> ?abst } . ';\n\t\t\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://fusepool.eu/ontologies/ecs#textPreview> ?preview } . ';\n\t\t\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?dtype } . ';\n\t\t\t\t\t\t\tquerylist += '}';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* This is the tentative to iterate the list at the API level to have it in ORDER \n\t\t\t\t\t\tvar triples = graph.match(null, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"ecs:contents\")), null).toArray();\n\t\t\t\t\t\tvar hit = graph.match(triples[0].object, store.rdf.createNamedNode(store.rdf.resolve(\"rdf:rest\")), null).toArray(); */\n\n\t\t\t\t\trdf.execute(querylist, function(success, results) {\n\t\t\t\t\t\tif (success) {\n\t\t\t\t\t\t\tfor(var rank=0; rank<hits.length; rank++){\n\t\t\t\t\t\t\t\tfor(var i=0; i<results.length; i++){\n\t\t\t\t\t\t\t\t\tvar row = results[i];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(row.url.value!=hits[rank]) {\n\t\t\t\t\t\t\t\t\t\t/*if(row.url.value!=hits[rank] || \n\t\t\t\t\t\t\t\t\t\trow.dtype.value.indexOf(\"ecs\") != -1 || \n\t\t\t\t\t\t\t\t\t\trow.dtype.value.indexOf(\"owl#A\") != -1 ){ */\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//// TITLE ////\n\t\t\t\t\t\t\t\t\tvar title = '[Unknown]';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.title)){\n\t\t\t\t\t\t\t\t\t\ttitle = row.title.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(!isEmpty(row.name)) {\n\t\t\t\t\t\t\t\t\t\ttitle = row.name.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//// SHORT CONTENT ////\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar shortContent = '';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.abst)) {\n\t\t\t\t\t\t\t\t\t\tshortContent = row.abst.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(!isEmpty(row.preview)) {\n\t\t\t\t\t\t\t\t\t\tshortContent = row.preview.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(!isEmpty(row.addresslocality) && !isEmpty(row.streetaddress)) {\n\t\t\t\t\t\t\t\t\t\tshortContent = row.addresslocality.value + ', ' + row.streetaddress.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tvar exclude = ['http://www.w3.org/1999/02/22-rdf-syntax-ns#type','http://purl.org/dc/terms/title'];\n\t\t\t\t\t\t\t\t\t\tshortContent = getAPropertyValue(rdf, row.url.value, exclude);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//// DOCTYPE ////\n\t\t\t\t\t\t\t\t\tvar dtype = '[Type not found]';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.dtype)){\n\t\t\t\t\t\t\t\t\t\tdtype = row.dtype.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(!main.containsDocument(documents, shortContent, title, row.url.value)){\n\t\t\t\t\t\t\t\t\t\tdocuments.push({url: row.url.value, shortContent: shortContent, title: title, type: dtype});\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\t\n\t\t\t\t\treturn documents;\n\t\t\t\t},\n\t\t\t\t\n /**\n * This function decides whether a document list contains\n\t\t\t\t * a document with a specific content and title or not.\n\t\t\t\t * @method containsDocument\n * @param {Array} documents the list of documents\n * @param {String} content content of the other document\n * @param {String} title title of the other document\n * @return {Boolean} true, if the list contains, false otherwise\n */\n containsDocument: function(documents, content, title, url){\n for(var i=0;i<documents.length;i++){\n if(documents[i].url === url || (documents[i].shortContent === content && documents[i].title === title)){\n return true;\n }\n }\n return false;\n },\n\n /**\n * This function calls the content updater function of the\n\t\t\t\t * details box.\n\t\t\t\t * [replaced with function 'displayDetails']\n\t\t\t\t * @method updateDetails\n * @param {String} title the title of the details\n * @param {Object} addressObject the address object\n */\n updateDetails: function(title, addressObject){\n this.$.detailsBox.updateDetails(title, addressObject);\n },\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function calls the display function of the\n\t\t\t\t * details box.\n\t\t\t\t * @method displayDetails\n\t\t\t\t * @param {Object} rdf rdf with the metadata of the entity\n\t\t\t\t */\n\t\t\t\tdisplayDetails: function(rdf){\n\t\t\t\t\tthis.$.detailsBox.displayDetails(rdf);\n\t\t\t\t}\n });\n }", "static build()\n\t{\n\t\tIndex.buildeNotifications();\n\t\tIndex.buildePersonalPanel();\n\t\tIndex.buildePageContent();\n\t\t\n\t\taddCollapseFunction();\n\t}", "constructor(structure, viewer, params) {\n super(structure, viewer, params);\n this.n = 0; // Subclass create sets value\n this.parameters = Object.assign({\n labelVisible: {\n type: 'boolean'\n },\n labelSize: {\n type: 'number', precision: 3, max: 10.0, min: 0.001\n },\n labelColor: {\n type: 'color'\n },\n labelFontFamily: {\n type: 'select',\n options: {\n 'sans-serif': 'sans-serif',\n 'monospace': 'monospace',\n 'serif': 'serif'\n },\n buffer: 'fontFamily'\n },\n labelFontStyle: {\n type: 'select',\n options: {\n 'normal': 'normal',\n 'italic': 'italic'\n },\n buffer: 'fontStyle'\n },\n labelFontWeight: {\n type: 'select',\n options: {\n 'normal': 'normal',\n 'bold': 'bold'\n },\n buffer: 'fontWeight'\n },\n labelsdf: {\n type: 'boolean', buffer: 'sdf'\n },\n labelXOffset: {\n type: 'number', precision: 1, max: 20, min: -20, buffer: 'xOffset'\n },\n labelYOffset: {\n type: 'number', precision: 1, max: 20, min: -20, buffer: 'yOffset'\n },\n labelZOffset: {\n type: 'number', precision: 1, max: 20, min: -20, buffer: 'zOffset'\n },\n labelAttachment: {\n type: 'select',\n options: {\n 'bottom-left': 'bottom-left',\n 'bottom-center': 'bottom-center',\n 'bottom-right': 'bottom-right',\n 'middle-left': 'middle-left',\n 'middle-center': 'middle-center',\n 'middle-right': 'middle-right',\n 'top-left': 'top-left',\n 'top-center': 'top-center',\n 'top-right': 'top-right'\n },\n rebuild: true\n },\n labelBorder: {\n type: 'boolean', buffer: 'showBorder'\n },\n labelBorderColor: {\n type: 'color', buffer: 'borderColor'\n },\n labelBorderWidth: {\n type: 'number', precision: 2, max: 0.3, min: 0, buffer: 'borderWidth'\n },\n labelBackground: {\n type: 'boolean', rebuild: true\n },\n labelBackgroundColor: {\n type: 'color', buffer: 'backgroundColor'\n },\n labelBackgroundMargin: {\n type: 'number', precision: 2, max: 2, min: 0, rebuild: true\n },\n labelBackgroundOpacity: {\n type: 'range', step: 0.01, max: 1, min: 0, buffer: 'backgroundOpacity'\n },\n labelFixedSize: {\n type: 'boolean', buffer: 'fixedSize'\n },\n lineOpacity: {\n type: 'range', min: 0.0, max: 1.0, step: 0.01\n },\n linewidth: {\n type: 'integer', max: 50, min: 1, buffer: true\n }\n }, this.parameters, {\n flatShaded: null\n });\n }", "function initializeComponent() {\n\n lblName.text(VIS.Msg.translate(VIS.Env.getCtx(), \"Name\"));\n lblDepartment.text(VIS.Msg.translate(VIS.Env.getCtx(), \"Department\"));\n lblEmployeeGrade.text(VIS.Msg.translate(VIS.Env.getCtx(), \"EmployeeGrade\"));\n lblDateOfBirth.text(VIS.Msg.translate(VIS.Env.getCtx(), \"DateOfBirth\"));\n lblBottomMsg.text(VIS.Msg.translate(VIS.Env.getCtx(), \"Bottom Message\"));\n\n $root = $(\"<div style='width: 100%; height: 100%; background-color: white;'>\");\n\n $btnPartial = $(\"<input class='VIS_Pref_btn-2' style='float: left;height: 38px;' type='button' value='SampleDialoge1'>\");\n $btnSample = $(\"<input class='VIS_Pref_btn-2' style='float: left;height: 38px;' type='button' value='SampleDialoge2'>\");\n $okBtn = $(\"<input class='VIS_Pref_btn-2' style=' margin-right: 3px;height: 38px;' type='button' value='Save'>\");\n $cancelBtn = $(\"<input class='VIS_Pref_btn-2' style=' margin-right: 15px ;width: 70px;height: 38px;' type='button' value='Clear'>\");\n\n //left side div\n leftSideDiv = $(\"<div style='float: left; margin-left: 0px;height: 95%;width:20%;margin-top: 1px;position: relative; background-color: #F1F1F1;'>\");\n leftSideBottomDiv = $(\"<div style='float: left; position: absolute; bottom: 0;height: 60px;width:100%; background-color: #F1F1F1'>\");\n \n bottumDiv = $(\"<div style='width: 100%; height: 60px; float: left; margin-bottom: 0px;'>\");\n\n var tble = $(\"<table style='width: 100%;'>\");\n //add table into div\n leftSideDiv.append(tble);\n\n var tr = $(\"<tr>\");\n var td = $(\"<td style='padding: 4px 15px 2px;'>\");\n\n tble.append(tr);\n tr.append(td);\n td.append(lblName.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(txtName.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 4px 15px 2px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(lblDepartment.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(cmbDepartment.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 4px 15px 2px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(lblEmployeeGrade.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(cmbEmployeeGrade.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n \n\n \n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 4px 15px 2px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(lblDateOfBirth.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n\n\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append(vdate.css(\"display\", \"inline-block\").css(\"width\", \"236px\").css(\"height\", \"30px\"));\n\n //add button to left bottom div\n leftSideBottomDiv.append($cancelBtn).append($okBtn);\n //then to left div\n leftSideDiv.append(leftSideBottomDiv);\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append($btnPartial);\n tr = $(\"<tr>\");\n td = $(\"<td style='padding: 0px 15px 0px;'>\");\n tble.append(tr);\n tr.append(td);\n td.append($btnSample);\n\n\n //Right Side Div Declaration\n rightSideDiv = $(\"<div style='float: right;width: 78%; height: 95%; margin-right: 15px;margin-top: 1px; border: 1px solid darkgray;'>\");\n //Bottom div\n bottumDiv.append(lblBottomMsg.css(\"display\", \"inline-block\").addClass(\"VIS_Pref_Label_Font\"));\n\n //add value to root\n $root.append(leftSideDiv).append(rightSideDiv).append(bottumDiv);\n\n //Event\n $okBtn.on(VIS.Events.onTouchStartOrClick, function () {\n saveEmployee();\n });\n\n $cancelBtn.on(VIS.Events.onTouchStartOrClick, function () {\n //if (confirm(\"wanna close this form?\")) {\n // $self.dispose();\n //}\n\n txtName.val(\"\");\n cmbEmployeeGrade.prop('selectedIndex', -1);\n cmbDepartment.prop('selectedIndex', -1);\n vdate.val(\"\");\n lblBottomMsg.text(\"Please Fill value to insert record.\");\n });\n\n $btnPartial.on(VIS.Events.onTouchStartOrClick, function () {\n \n\n });\n\n $btnSample.on(VIS.Events.onTouchStartOrClick, function () {\n var obj = new VAT.EmployeeFormByDialog($self.windowNo);\n obj.showDialoge();\n });\n\n\n // getDepartmentData();\n // getEmployeeGradeData();\n }", "function init(){\n var $ = go.GraphObject.make; // for conciseness in defining templates\n\n myDiagram =\n $(go.Diagram, \"myDiagramDiv\", // must name or refer to the DIV HTML element\n { allowDrop: true }); // must be true to accept drops from the Palette\n\n\n\n\n\n\n\n\n}", "createLayout() {\n // Iterate by component in the JSON\n for (let key of Object.keys(this.componetsJSON)) {\n let componetJSON = this.componetsJSON[key];\n\n // Itere by the positions of the componets\n for (let position of componetJSON.position) {\n\n if (componetJSON.type != \"background\") {\n // Create a new component and add the poiter to the object in the grid\n let component = new this.Component(componetJSON.name, position.x, position.y, componetJSON.width, componetJSON.height, componetJSON.door);\n\n for (let x = component.x; x < component.x + component.width; x++) {\n for (let y = component.y; y < component.y + component.height; y++) {\n if (this.gridLayout[x][y] != null) {\n console.error(\"There is alredy a component here.\" +\n \"\\nTry create: \" + key + \" on x: \" + x + \" y: \" + y +\n \"\\nTrying create: \", componetJSON.name +\n \"\\nExisting comopent: \", this.gridLayout[x][y]);\n } else {\n this.gridLayout[x][y] = component;\n }\n }\n }\n }\n }\n }\n }", "function initViz() {\n var containerDiv = document.getElementById(\"vizContainer\"),\n // define url to a Overview view from the Superstore workbook on my tableau dev site\n url = \"https://10ax.online.tableau.com/t/loicplaygrounddev353480/views/Superstore/Overview?:showAppBanner=false&:display_count=n&:showVizHome=n\";\n options = {\n hideTabs: true,\n onFirstInteractive: function () {\n var worksheets = getWorksheets(viz);\n // process all filters used on the dashboard initially and subscribe to any filtering event comming out of the dashboard to recompute the filters on the webpage.\n processFilters(worksheets);\n viz.addEventListener('filterchange', (filterEvent) => {\n var worksheets = getWorksheets(filterEvent.getViz());\n processFilters(worksheets);\n });\n viz.addEventListener(tableau.TableauEventName.MARKS_SELECTION, (marksEvent) => {\n var worksheets = getWorksheets(marksEvent.getViz());\n processFilters(worksheets);\n });\n }\n };\n\n viz = new tableau.Viz(containerDiv, url, options);\n}", "createBuilderHTMLStructure() {\n const that = this,\n context = that.context,\n filterBuilder = document.createElement('smart-filter-builder'),\n dataField = context.dataField,\n dataType = context.filterType === 'numeric' ? 'number' : context.filterType;\n\n that.filterBuilder = filterBuilder;\n filterBuilder.animation = context.animation;\n filterBuilder.disabled = context.disabled;\n filterBuilder.unfocusable = context.unfocusable;\n filterBuilder.value = ['and'];\n filterBuilder.fields = [{ label: dataField, dataField: dataField, dataType: dataType, filterOperations: that.filterBuilderOperations }];\n that.localizeFilterBuilder();\n context.$.mainContainer.appendChild(filterBuilder);\n\n if (dataType === 'string') {\n const caseSensitive = document.createElement('smart-check-box');\n\n caseSensitive.classList.add('case-sensitive');\n caseSensitive.innerHTML = 'Case sensitive';\n caseSensitive.animation = context.animation;\n caseSensitive.disabled = context.disabled;\n caseSensitive.unfocusable = context.unfocusable;\n caseSensitive.checked = false;\n that.caseSensitive = caseSensitive;\n context.$.mainContainer.appendChild(caseSensitive);\n }\n that.filterBuilderObject = { filters: [] };\n that.cachedFilter = { filterBuilder: ['and'], caseSensitive: false };\n }", "function WidgetBuilder() {\r\n}", "function createVisualization(sequenceArray) {\r\n\r\n // Basic setup of page elements.\r\n initializeBreadcrumbTrail();\r\n\r\n updateBreadcrumbs(sequenceArray;\r\n\r\n // // For efficiency, filter nodes to keep only those large enough to see.\r\n // var nodes = partition.nodes(json)\r\n // .filter(function(d) {\r\n // return (d.dx > 0.005); // 0.005 radians = 0.29 degrees\r\n // });\r\n\r\n // var path = vis.data([json]).selectAll(\"path\")\r\n // .data(nodes)\r\n // .enter().append(\"path\")\r\n // .attr(\"display\", function(d) { return d.depth ? null : \"none\"; })\r\n // .attr(\"d\", arc)\r\n // .attr(\"fill-rule\", \"evenodd\")\r\n // .style(\"fill\", function(d) { return colors(d.label); })\r\n // .style(\"opacity\", 1)\r\n // .on(\"mouseover\", mouseover)\r\n // .on(\"click\", click);\r\n\r\n // // Add the mouseleave handler to the bounding circle.\r\n // d3.select(el).select(\"#\"+ el.id + \"-container\").on(\"mouseleave\", mouseleave);\r\n\r\n // // Get total size of the tree = value of root node from partition.\r\n // totalSize = path.node().__data__.value;\r\n\r\n // drawLegend();\r\n // d3.select(el).select(\".sunburst-togglelegend\").on(\"click\", toggleLegend);\r\n\r\n }", "function initialDesign(viewer){ \n //create design model\n var greenBox = viewer.entities.add({\n name : '设计模型',\n polylineVolume : {\n positions : [new Cesium.Cartesian3.fromDegrees(-122.3892091861, 37.7738780081, -29.2504926276),\n new Cesium.Cartesian3.fromDegrees(-122.3892480337, 37.7754872048, -28.9870413317),\n new Cesium.Cartesian3.fromDegrees(-122.3881664472, 37.7754636487, -28.7960743653),\n new Cesium.Cartesian3.fromDegrees(-122.388121449, 37.773975726, -28.9640646892)],\n shape :[new Cesium.Cartesian2(-10, -10),\n new Cesium.Cartesian2(10, -10),\n new Cesium.Cartesian2(10, 10),\n new Cesium.Cartesian2(-10, 10)],\n cornerType : Cesium.CornerType.BEVELED,\n material : Cesium.Color.WHITE.withAlpha(0.5),\n outline : true,\n outlineColor : Cesium.Color.BLACK\n }\n });\n\n greenBox.show = false;\n\n //create region\n var iframe = document.getElementsByClassName('cesium-infoBox-iframe')[0];\n\n iframe.setAttribute('sandbox', 'allow-same-origin allow-scripts allow-popups allow-forms allow-modals'); \n\n var e = viewer.entities.add({\n polygon : {\n hierarchy : {\n positions : [new Cesium.Cartesian3.fromDegrees(-122.3897195868, 37.7761320483, -28.8083237172),\n new Cesium.Cartesian3.fromDegrees(-122.3894522363, 37.7730635703, -29.0436988295),\n new Cesium.Cartesian3.fromDegrees(-122.3877113228, 37.7734856854, -29.139382365),\n new Cesium.Cartesian3.fromDegrees(-122.3878530435, 37.7763023092, -29.0629695339)]\n },\n material : Cesium.Color.BLUE.withAlpha(0.5)\n },\n name:\"宗地编号CH43\",\n description: 'Loading <div class=\"cesium-infoBox-loading\"></div>',\n description: \n '<h2 style=\"font-size: 22px;\">宗地基本资讯</h2>'+\n '<table class=\"cesium-infoBox-defaultTable\"><tbody>' +\n '<link rel=\"stylesheet\" href=\"/Component/designPanel.css\" media=\"screen\">'+\n '<tr><th>宗地编号</th><td>' + \"CH43\" + '</td></tr>' +\n '<tr><th>宗地位置</th><td>' + \"福州市XX区XX路XX号\" + '</td></tr>' +\n '<tr><th>净用地面积(平方公米)</th><td>' + \"48.9096\" + '</td></tr>' +\n '<tr><th>土地用途及使用年限</th><td>' + \"商业40年\" + '</td></tr>' +\n '<tr><th>拍卖起叫价</th><td>' + \"楼面地价:3000元/平方米\" + '</td></tr>' +\n '<tr><th>竞买保证金(万元)</th><td>' + \"7300\" + '</td></tr>' +\n '<tr><th>拍卖出让时间</th><td>' + \"2018/07/02\" + '</td></tr>' +\n '<tr><th>持证准用面积(亩)及方式</th><td>' + \"48.9096指标证书\" + '</td></tr>' +\n '<tr><th>出让人</th><td>' + \"福州市国土资源局\" + '</td></tr>' +\n '</tbody></table>'+\n '<h2 style=\"font-size: 22px;text-align: right;\">显示模型 <label class=\"switch\" style=\"top: -24px;\"><input type=\"checkbox\" onclick=\"showDmodel()\"><span class=\"slider round\"></span></label></h2>'+\n '<div id=\"Checkbar\" style=\"position: fixed;visibility: visible;opacity: 0;transition:opacity 0.2s linear;\">'+\n '<a href=\"Source/SampleData/designModel.ifc\" download>'+\n '<button id=\"Mydownload\"\">导出模型</button>'+\n '</a>'+\n '<h2 style=\"font-size: 22px;\">项目模型基本资讯</h2>'+\n '<table class=\"cesium-infoBox-defaultTable\"><tbody>' +\n '<tr><th>项目名称</th><td>' + \"福州市建案A\" + '</td></tr>' +\n '<tr><th>业主方</th><td>' + \"公司B\" + '</td></tr>' +\n '<tr><th>设计方</th><td>' + \"单位C\" + '</td></tr>' +\n '<tr><th>上传作者</th><td>' + \"雷翔\" + '</td></tr>' +\n '<tr><th>上传时间</th><td>' + \"2019/04/06\" + '</td></tr>' +\n '</tbody></table>'+\n '<button id=\"Mybutton\" onclick=\"move()\">查验</button>'+\n '<h2 style=\"font-size: 22px;\">规则设计条件</h2>'+\n '<table class=\"cesium-infoBox-defaultTable\"><tbody>' +\n '<tr><th>设计容积率总建筑面积/容积率</th><td>' + \" \" + '</td></tr>' +\n '<tr><th>建筑密度</th><td>' + \" \" + '</td></tr>' +\n '<tr><th>建筑高度</th><td>' + \" \" + '</td></tr>' +\n '<tr><th>绿地率</th><td>' + \" \" + '</td></tr>' +\n '<tr><th>规划用地使用性质</th><td>' + \" \" + '</td></tr>' +\n '</tbody></table>'+\n '<br>'+\n '<div id=\"myProgress\"> <div id=\"myBar\">0%</div></div><br>'+\n '</div>'\n });\n\n //Infobox event add method\n viewer.infoBox.frame.addEventListener('load', function() {\n //\n // Now that the description is loaded, register a click listener inside\n // the document of the iframe.\n //\n\n viewer.infoBox.frame.contentDocument.greenBox = greenBox\n viewer.infoBox.frame.contentDocument.body.addEventListener('click', function(e) {\n //\n // The document body will be rewritten when the selectedEntity changes,\n // but this body listener will survive. Now it must determine if it was\n // one of the clickable buttons.\n //\n if(viewer.infoBox.frame.contentDocument.body.getElementsByClassName('script').length == 0)\n {\n // Create the element\n\n var script = document.createElement(\"script\");\n var script1 = document.createElement(\"script\");\n\n // Add script content\n\n script.innerHTML = \"function showDmodel(){egg = document.getElementsByTagName('input')[0].checked;if(!egg){document.greenBox.show = false;document.getElementById('Checkbar').style.position = 'fixed';document.getElementById('Checkbar').style.opacity = 0;}else{document.greenBox.show = true;document.getElementById('Checkbar').style.position = 'initial';document.getElementById('Checkbar').style.opacity = 1;}}\";\n\n script1.innerHTML ='function move(){var t=document.getElementById(\"myBar\"),e=10,n=setInterval(function(){e>=100?(clearInterval(n),document.querySelector(\"#Checkbar > table:nth-child(6) > tbody > tr:nth-child(1) > td\").innerText=\"符合\",document.querySelector(\"#Checkbar > table:nth-child(6) > tbody > tr:nth-child(2) > td\").innerText=\"符合\",document.querySelector(\"#Checkbar > table:nth-child(6) > tbody > tr:nth-child(3) > td\").innerText=\"符合\",document.querySelector(\"#Checkbar > table:nth-child(6) > tbody > tr:nth-child(4) > td\").innerText=\"违规\",document.querySelector(\"#Checkbar > table:nth-child(6) > tbody > tr:nth-child(5) > td\").innerText=\"符合\"):(e++,t.style.width=e+\"%\",t.innerHTML=1*e+\"%\")},10)}';\n \n viewer.infoBox.frame.contentDocument.body.appendChild(script)\n viewer.infoBox.frame.contentDocument.body.appendChild(script1)\n\n }\n }, false);\n }, false);\n\n //viewer.zoomTo(e)\n}", "function init() {\n var layout = getFromStorage();\n if (!layout) {\n layout = readDOMLayout();\n saveToStorage();\n return;\n }\n\n // Cycle through the layout making DOM reordering as necissary\n var i, col, DOMLayout;\n DOMLayout = readDOMLayout().slice(0, 4);// just the arrays\n layout = layout.slice(0, 4);// just the arrays\n for (i = 0;i < 4;i++) {\n col = document.getElementById(adfPrefix + 'column_' + (i + 1));\n adjustDOM(layout[i], DOMLayout[i], col);\n }\n }", "addDataVisuals () {\n }", "function SchemaInit(){\n\n // Per-manager logger.\n var logger = new bbop.logger();\n logger.DEBUG = true;\n function ll(str){ logger.kvetch(str); }\n\n // External meta-data.\n var sd = new amigo.data.server();\n var solr_server = sd.golr_base();\n var gconf = new bbop.golr.conf(amigo.data.golr);\n\n // Aliases.\n var each = bbop.core.each;\n var hashify = bbop.core.hashify;\n var get_keys = bbop.core.get_keys;\n var is_def = bbop.core.is_defined;\n var is_empty = bbop.core.is_empty;\n\n // Helper: dedupe a list...might be nice in core?\n function dedupe(list){\n\tvar retlist = [];\n\tif( list && list.length > 0 ){\n\t retlist = get_keys(hashify(list));\n\t}\n\treturn retlist;\n }\n\n // Helper: turn:\n // : {'string1': ['foo'], 'string2': ['foo', 'bar', 'foo'],}\n // Into:\n // : \"string1 (foo)<br />string2 (foo, bar)\"\n function sfuse(hash){\n\tvar retval = '';\n\n\tvar cache = [];\n\teach(hash,\n\t function(str, loc_list){\n\t\t var locs = dedupe(loc_list);\n\t\t cache.push( str + ' <small>[' + locs.join(', ') + ']</small>');\n\t });\n\tif( cache.length > 0 ){\n\t retval = cache.join('<br />');\t \n\t}\n \n\treturn retval;\n }\n\n function _recolor_table(tid){\n\tjQuery('table#' + tid + ' tr:even').attr('class', 'even_row');\n\tjQuery('table#' + tid + ' tr:odd').attr('class', 'odd_row');\n }\n\n //ll('');\n ll('SchemaInit start...');\n\n // // Make unnecessary things roll up.\n // amigo.ui.rollup([\"inf01\"]);\n\n var classes = gconf.get_classes_by_weight();\n\n // First, let's go through all of the fields and figure out their\n // capacities.\n\t //\n var field_cap_cache = {};\n var capacities = ['boost', 'result', 'filter'];\n each(classes,\n\t function(conf_class, ccindex){\n\t var personality = conf_class.id();\n\t \n\t each(capacities,\n\t\t function(capacity){\n\t\t var by_weights = conf_class.get_weights(capacity);\n\t\t each(by_weights,\n\t\t\t function(field){\n\t\t\t //var fid = field.id();\n\t\t\t var fid = field;\n\t\t\t if( ! is_def(field_cap_cache[fid]) ){\n\t\t\t\t field_cap_cache[fid] = {};\n\t\t\t }\n\t\t\t if( ! is_def(field_cap_cache[fid][capacity]) ){\n\t\t\t\t field_cap_cache[fid][capacity] = [];\n\t\t\t }\n\t\t\t field_cap_cache[fid][capacity].push(\n\t\t\t\t personality);\n\t\t\t });\n\t\t });\n\t });\n\n // Now cycle through the main schema and build up an object for\n // use in table building.\n var fields = {};\n each(classes,\n\t function(conf_class, ccindex){\n\t var personality = conf_class.id();\n\n\t var cfs = conf_class.get_fields();\n\t each(cfs,\n\t\t function(cf, cfindex){\n\t\t // If we haven't seen it before, go ahead and\n\t\t // add it.\n\t\t var cid = cf.id();\n\t\t if( ! bbop.core.is_defined( fields[cid]) ){\n\t\t\t fields[cid] = {\n\t\t\t personality: [],\n\t\t\t label: {},\n\t\t\t description: {},\n\t\t\t capacity: {},\n\t\t\t //required: \n\t\t\t multi: '???',\n\t\t\t id: cid\n\t\t\t };\n\t\t }\n\n\t\t // Personality is easy.\n\t\t fields[cid]['personality'].push(personality);\n\n\t\t // Multi is easy too since it must be uniform.\n\t\t if( cf.is_multi() ){\n\t\t\t fields[cid]['multi'] = 'yes';\n\t\t }else{\n\t\t\t fields[cid]['multi'] = 'no';\n\t\t }\n\t\t \n\t\t // Capacity not too bad since we already\n\t\t // did the work above.\n\t\t if( field_cap_cache[cid] && \n\t\t\t ! is_empty(field_cap_cache[cid]) ){\n\t\t\t fields[cid]['capacity'] = field_cap_cache[cid];\n\t\t }\n\t\t \n\t\t // Label and description are harder. First grab\n\t\t // raw versions, assert, then mark personality.\n\t\t // Label.\n\t\t var lbl = cf.display_name();\n\t\t if( ! is_def(fields[cid]['label'][lbl]) ){\n\t\t\t fields[cid]['label'][lbl] = [];\n\t\t }\n\t\t fields[cid]['label'][lbl].push(personality);\n\t\t // Description.\n\t\t var desc = cf.description();\n\t\t if( ! is_def(fields[cid]['description'][desc]) ){\n\t\t\t fields[cid]['description'][desc] = [];\n\t\t }\n\t\t fields[cid]['description'][desc].push(personality);\n\t\t });\n\t });\n\n // Generate a nice table head. \n var thead = new bbop.html.tag('thead');\n each(['id', 'multi', 'display label(s)', 'description(s)',\n\t 'in capacity', 'personalities'],\n\t function(title_item){\n\t thead.add_to('<th>' + title_item +\n\t\t\t '<img style=\"border: 0px;\" src=\"' +\n\t\t\t sd.image_base() + '/reorder.gif\" />' +\n\t\t\t '</th>');\n\t });\n\n // Now a nice body. Add some buttons, but keep them for later.\n var tbody = new bbop.html.tag('tbody');\n each(fields,\n\t function(fkey, fobj){\n\t var cache = [];\n\n\t // Unique.\n\t cache.push(fobj['id']);\n\t cache.push(fobj['multi']);\n\n\t // Label and description need to be handled carefully.\n\t cache.push( sfuse(fobj['label']) );\n\t cache.push( sfuse(fobj['description']) );\n\n\t // Careful handling.\n\t cache.push( sfuse(fobj['capacity']) );\n\n\t // Personality easily deduped.\n\t cache.push(dedupe(fobj['personality']).join(', '));\n\n\t // Assemble.\n\t var tr = '<tr><td>' + cache.join('</td><td>') + '</td></tr>';\n\t tbody.add_to(tr);\n\t });\n\n // Generate the table itself.\n var tbl_attrs = {\n\tgenerate_id: true\n };\n var tbl = new bbop.html.tag('table', tbl_attrs);\n tbl.add_to(thead);\n tbl.add_to(tbody);\n\n var filter_inject_id = 'schema_info_search_div';\n var target_id = 'schema_info_table_div';\n\n // Add the table to the DOM.\n jQuery('#' + target_id).empty();\n jQuery('#' + target_id).append(tbl.to_string());\n\n ///\n /// Sorting, coloring, etc.\n ///\n\n // Apply a first round of coloring.\n _recolor_table(tbl.get_id());\n\n // Apply the tablesorter to what we got.\n jQuery('#' + tbl.get_id()).tablesorter(); \n // Recolor on sort.\n jQuery('#' + tbl.get_id()).bind(\"sortEnd\",\n\t\t\t\t function(){ \n\t\t\t\t\t_recolor_table(tbl.get_id());\n\t\t\t\t });\n\n // Add filtering to table.\n var ft = new bbop.widget.filter_table(filter_inject_id, tbl.get_id(),\n\t\t\t\t\t sd.image_base() + '/waiting_ajax.gif',\n\t\t\t\t\t null, 'Filter:');\n \n ll('SchemaInit done.');\n}", "function Component_Visual() {\n Component_Visual.__super__.constructor.apply(this, arguments);\n }", "function calcSchema( inSchema ) {\n var gbCols = cols.concat( aggCols );\n var gbs = new Schema( { columns: gbCols, columnMetadata: inSchema.columnMetadata } );\n\n return gbs;\n }", "function buildDialog() {\n const dashboard = tableau.extensions.dashboardContent.dashboard;\n\n dashboard.worksheets.forEach(function (worksheet) {\n $(\"#selectWorksheet\").append(\"<option value='\" + worksheet.name + \"'>\" + worksheet.name + \"</option>\");\n }); \n\n var worksheetName = tableau.extensions.settings.get(\"selectWorksheet\");\n if (worksheetName != undefined) {\n $(\"#selectWorksheet\").val(worksheetName);\n columnsUpdate();\n } \n\n $('#selectWorksheet').on('change', '', function () {\n columnsUpdate();\n });\n $('#cancel').click(closeDialog);\n $('#save').click(saveButton);\n\n }", "initView () {\n // check if model run exists and run entity microdata is included in model run results\n if (!this.initRunEntity()) return // exit on error\n\n this.isPages = this.runEntity.RowCount > SMALL_PAGE_SIZE // disable pages for small microdata\n this.pageStart = 0\n this.pageSize = this.isPages ? SMALL_PAGE_SIZE : 0\n\n this.isNullable = true // entity always nullabale, value can be NULL\n this.isScalar = false // microdata never scalar, it always has at least one attribute\n\n // adjust controls\n this.pvc.rowColMode = !this.isScalar ? Pcvt.SPANS_AND_DIMS_PVT : Pcvt.NO_SPANS_NO_DIMS_PVT\n this.ctrl.isRowColModeToggle = !this.isScalar\n this.ctrl.isRowColControls = !this.isScalar\n this.pvKeyPos = []\n\n // default pivot table options\n let lc = this.uiLang || this.$q.lang.getLocale() || ''\n if (lc) {\n try {\n const cla = Intl.getCanonicalLocales(lc)\n lc = cla?.[0] || ''\n } catch (e) {\n lc = ''\n console.warn('Error: undefined canonical locale:', e)\n }\n }\n this.pvc.formatter = Pcvt.formatDefault({ isNullable: this.isNullable, locale: lc })\n this.pvc.cellClass = 'pv-cell-right' // numeric cell value style by default\n this.ctrl.formatOpts = void 0\n\n this.pvc.processValue = Pcvt.asIsPval // no value conversion required, only formatting\n\n // make dimensions:\n // [0] entity key dimension\n // [1, rank - 1] enum-based dimensions\n // [rank] measure attributes dimension: list of non-enum based attributes, e.g. int, double,... attributes\n this.attrCount = 0\n this.rank = 0\n this.dimProp = []\n\n // entity key dimension at [0] position: initially empty\n const fk = {\n name: KEY_DIM_NAME,\n label: (Mdf.descrOfDescrNote(this.entityText) || this.$t('Entity')) + ' ' + this.$t('keys'),\n enums: [],\n selection: [],\n singleSelection: {},\n filter: (val, update, abort) => {}\n }\n this.dimProp.push(fk)\n\n // measure attributes dimension\n const fa = {\n name: ATTR_DIM_NAME,\n label: Mdf.descrOfDescrNote(this.entityText) || this.$t('Attribute'),\n enums: [],\n options: [],\n selection: [],\n singleSelection: {},\n filter: (val, update, abort) => {}\n }\n const aEnums = []\n const aFmt = {} // formatters for built-in attributes\n let nPos = 0 // attribute position in microdata row\n\n for (const ea of this.entityText.EntityAttrTxt) {\n if (!Mdf.isNotEmptyEntityAttr(ea)) continue\n if (this.runEntity.Attr.findIndex(name => ea.Attr.Name === name) < 0) continue // skip: this attribute is not included in run microdata\n\n // find attribute type text\n const tTxt = Mdf.typeTextById(this.theModel, ea.Attr.TypeId)\n\n if (!Mdf.isBuiltIn(tTxt.Type)) { // enum based attribute: use it as dimension\n const f = {\n name: ea.Attr.Name || '',\n label: Mdf.descrOfDescrNote(ea) || ea.Attr.Name || '',\n enums: [],\n options: [],\n selection: [],\n singleSelection: {},\n filter: (val, update, abort) => {},\n attrPos: nPos++\n }\n\n const eLst = Array(tTxt.TypeEnumTxt.length)\n for (let j = 0; j < tTxt.TypeEnumTxt.length; j++) {\n const eId = tTxt.TypeEnumTxt[j].Enum.EnumId\n eLst[j] = {\n value: eId,\n name: tTxt.TypeEnumTxt[j].Enum.Name || eId.toString(),\n label: Mdf.enumDescrOrCodeById(tTxt, eId) || tTxt.TypeEnumTxt[j].Enum.Name || eId.toString()\n }\n }\n f.enums = Object.freeze(eLst)\n f.options = f.enums\n f.filter = Puih.makeFilter(f)\n\n this.dimProp.push(f)\n } else { // built-in attribute type: add to attributes measure dimension\n const aId = ea.Attr.AttrId\n\n aEnums.push({\n value: aId,\n name: ea.Attr.Name || aId.toString(),\n label: Mdf.descrOfDescrNote(ea) || ea.Attr.Name || '' || aId.toString(),\n attrPos: nPos++\n })\n\n // setup process value and format value handlers:\n // if parameter type is one of built-in then process and format value as float, int, boolen or string\n if (Mdf.isFloat(tTxt.Type)) {\n // this.pvc.processValue = Pcvt.asFloatPval\n aFmt[aId] = Pcvt.formatFloat({ isNullable: this.isNullable, locale: lc, isAllDecimal: true }) // show all deciamls for the float value\n this.pvc.cellClass = 'pv-cell-right' // numeric cell value style by default\n }\n if (Mdf.isInt(tTxt.Type)) {\n // this.pvc.processValue = Pcvt.asIntPval\n aFmt[aId] = Pcvt.formatInt({ isNullable: this.isNullable, locale: lc })\n this.pvc.cellClass = 'pv-cell-right' // numeric cell value style by default\n }\n if (Mdf.isBool(tTxt.Type)) {\n // this.pvc.processValue = Pcvt.asBoolPval\n aFmt[aId] = Pcvt.formatBool({})\n this.pvc.cellClass = 'pv-cell-center'\n }\n if (Mdf.isString(tTxt.Type)) {\n // this.pvc.processValue = Pcvt.asIsPval\n aFmt[aId] = Pcvt.formatDefault({ isNullable: this.isNullable, locale: lc })\n this.pvc.cellClass = 'pv-cell-left' // no process or format value required for string type\n }\n }\n }\n this.rank = this.dimProp.length\n this.attrCount = aEnums.length\n\n // if there are any attributes of built-in type then\n // append measure dimension to dimension list at [rank] position\n if (this.attrCount > 0) {\n fa.enums = Object.freeze(aEnums)\n fa.options = fa.enums\n fa.filter = Puih.makeFilter(fa)\n\n this.dimProp.push(fa) // measure attributes dimension at [rank] position\n }\n\n // setup formatter\n this.pvc.formatter = Pcvt.formatByKey({\n isNullable: this.isNullable,\n isByKey: true,\n isRawUse: true,\n isRawValue: false,\n locale: lc,\n formatter: aFmt\n })\n this.ctrl.formatOpts = this.pvc.formatter.options()\n this.pvc.dimItemKeys = Pcvt.dimItemKeys(ATTR_DIM_NAME)\n this.pvc.cellClass = 'pv-cell-right' // numeric cell value style by default\n this.pvc.processValue = Pcvt.asIsPval // no value conversion required, only formatting\n\n // read microdata rows, each row is { Key: integer, Attr:[{IsNull: false, Value: 19},...] }\n // array of attributes:\n // dimensions are enum-based attributes\n // meausre dimension values are values of built-in types attributes\n this.pvc.reader = (src) => {\n // no data to read: if source rows are empty or invalid return undefined reader\n if (!src || (src?.length || 0) <= 0) return void 0\n\n // entity key dimension is at [0] position\n // attribute id's: [1, rank - 1] enum based dimensions\n let dimPos = []\n if (this.rank > 1) {\n dimPos = Array(this.rank - 1)\n\n for (let k = 1; k < this.rank; k++) {\n dimPos[k - 1] = this.dimProp[k].attrPos\n }\n }\n\n // measure dimension at [rank] position: attribute id's are enum values of measure dimension\n const mIds = Array(this.attrCount)\n const attrPos = Array(this.attrCount)\n\n if (this.attrCount > 0) {\n let n = 0\n for (const e of this.dimProp[this.rank].enums) {\n mIds[n] = e.value\n attrPos[n++] = e.attrPos\n }\n }\n\n const srcLen = src.length\n let nSrc = 0\n let nAttr = -1 // after first read row must be nAttr = 0\n\n const rd = { // reader to return\n readRow: () => {\n nAttr++\n if (nAttr >= this.attrCount) {\n nAttr = 0\n nSrc++\n }\n return (nSrc < srcLen) ? (src[nSrc] || void 0) : void 0 // microdata row: key and array of enum-based attributes as dimensions and buit-in types attributes as values\n },\n readDim: {},\n readValue: (r) => {\n const a = r?.Attr || void 0\n const v = (a && !a[attrPos[nAttr]].IsNull) ? a[attrPos[nAttr]].Value : void 0 // measure value: built-in type attribute value\n return v\n }\n }\n\n // read entity key dimension\n rd.readDim[KEY_DIM_NAME] = (r) => r?.Key\n\n // read dimension item value: enum id for enum-based attributes\n for (let n = 1; n < this.rank; n++) {\n rd.readDim[this.dimProp[n].name] = (r) => {\n const a = r?.Attr || void 0\n const cv = (a && dimPos[n - 1] < a.length) ? a[dimPos[n - 1]] : void 0\n return (cv && !cv.IsNull) ? cv.Value : void 0\n }\n }\n\n // read measure dimension: attribute id\n rd.readDim[ATTR_DIM_NAME] = (r) => (nAttr < mIds.length ? mIds[nAttr] : void 0)\n\n return rd\n }\n }", "create(sOptions, dataContainer) {\n let origin = _.cloneDeep(this.configsDefault);\n let configs = _.merge(origin, sOptions);\n\n let {x, y, name, description, id, data: elements, connectSide, presentation, svgSelector, containerClass, callbackDragVertex, callbackDragConnection} = configs;\n\n let group = svgSelector.selectAll(`.${containerClass}`)\n .data(dataContainer)\n .enter().append(\"g\")\n .attr(\"transform\", `translate(${x}, ${y})`)\n .attr(\"id\", id)\n .style(\"pointer-events\", \"none\")\n .attr(\"class\", `${containerClass}`)\n .call(callbackDragVertex);\n\n let htmlContent = '';\n let countData = elements.length;\n for (let i = 0; i < countData; i++) {\n let data = elements[i];\n htmlContent += `\n <div class=\"property\" prop=\"${id}${CONNECT_KEY}${i}\" style=\"height: ${VERTEX_ATTR_SIZE.PROP_HEIGHT}px\">\n <label class=\"key\" id=\"${id}_${presentation.key}_${i}\" title=\"${data[presentation.keyTooltip] || \"No data to show\"}\">${data[presentation.key] || \"\"}</label><label> : </label>\n <label class=\"data\" id=\"${id}_${presentation.value}_${i}\" title=\"${data[presentation.valueTooltip] || \"No data to show\"}\">${data[presentation.value] || \"\"}</label>\n </div>`;\n }\n\n let vertexHeight = VERTEX_ATTR_SIZE.HEADER_HEIGHT + VERTEX_ATTR_SIZE.PROP_HEIGHT * countData;\n\n group.append(\"foreignObject\")\n .attr(\"width\", VERTEX_ATTR_SIZE.GROUP_WIDTH)\n .attr(\"height\", vertexHeight)\n .append(\"xhtml:div\")\n .attr(\"class\", \"vertex_content\")\n .html(`\n <p class=\"header_name\" id=\"${id}Name\" title=\"${description}\" \n style=\"height: ${VERTEX_ATTR_SIZE.HEADER_HEIGHT}px;\n background-color: ${this.colorHash.hex(name)};\n cursor: move; pointer-events: all\">${name}</p>\n <div class=\"vertex_data\" style=\"pointer-events: none\">\n ${htmlContent}\n </div>\n `);\n\n for (let i = 0; i < countData; i++) {\n // Input\n if (connectSide === CONNECT_SIDE.BOTH || connectSide === CONNECT_SIDE.LEFT)\n group.append(\"rect\")\n .attr(\"class\", \"drag_connect\")\n .attr(\"type\", TYPE_CONNECT.INPUT)\n .attr(\"prop\", `${id}${CONNECT_KEY}${i}`)\n .attr(\"pointer-events\", \"all\")\n .attr(\"width\", 12)\n .attr(\"height\", 25)\n .attr(\"x\", 1)\n .attr(\"y\", VERTEX_ATTR_SIZE.HEADER_HEIGHT + VERTEX_ATTR_SIZE.PROP_HEIGHT * i + 1)\n .style(\"fill\", this.colorHashConnection.hex(name))\n .call(callbackDragConnection);\n\n // Output\n if (connectSide === CONNECT_SIDE.BOTH || connectSide === CONNECT_SIDE.RIGHT)\n group.append(\"rect\")\n .attr(\"class\", \"drag_connect\")\n .attr(\"prop\", `${id}${CONNECT_KEY}${i}`)\n .attr(\"pointer-events\", \"all\")\n .attr(\"type\", TYPE_CONNECT.OUTPUT)\n .attr(\"width\", 12)\n .attr(\"height\", 25)\n .attr(\"x\", VERTEX_ATTR_SIZE.GROUP_WIDTH - (VERTEX_ATTR_SIZE.PROP_HEIGHT / 2))\n .attr(\"y\", VERTEX_ATTR_SIZE.HEADER_HEIGHT + VERTEX_ATTR_SIZE.PROP_HEIGHT * i + 1)\n .style(\"fill\", this.colorHashConnection.hex(name))\n .call(callbackDragConnection);\n }\n }", "build()\n\t{\n\t\t// get the data from the GET HTTP from the URL and build the page\n\t\tvar getParms = PageRender.readGetPrams();\n\t\tvar sorter;\n\t\tif (getParms.get(\"sort\") != null)\n\t\t{\n\t\t\tthis.sorter = getParms.get(\"sort\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.sorter = default_sorter;\n\t\t\tconsole.log(\"AcademicPublications.build did not find sorter, using default\");\n\t\t}\n\n\t\tvar filter;\n\t\tif (getParms.get(\"filter\") != null)\n\t\t{\n\t\t\tfilter = getParms.get(\"filter\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfilter = default_filter;\n\t\t\tconsole.log(\"AcademicPublications.build did not find filter, using default\");\n\t\t}\n\n\t\t// build the page itself\n\t\tthis.buildHeader(this.sorter, filter);\n\t\tthis.buildBody(this.sorter, filter);\n\n\t\taddCollapseFunction();\n\t}", "_build() {\n if ( typeof this._options.body === 'string' ) {\n this._body.innerHTML = this._options.body;\n }\n else if ( this._options.body instanceof Element ) {\n this._body.appendChild( this._options.body );\n }\n this._header.appendChild( this._title );\n this._header.appendChild( this._close );\n this._container.appendChild( this._header );\n this._container.appendChild( this._body );\n this._overlay.appendChild( this._container );\n document.body.appendChild( this._overlay );\n setTimeout( () => { this._overlay.classList.add( 'visible' ); }, 300 );\n }", "function GenericDescriptor(xml) {\n\n var _instance = this;\n /*******************************/\n //En función del XML rellenamos la información del control\n var xmlInfo = xml.find('GenericDescriptor');\n if (xmlInfo.length == 1) {\n var descriptor = $(xmlInfo[0]);\n _instance.Name = descriptor.attr(\"Name\");\n _instance.GetDesigner = new Designer.ControlDesigner(this.Name, '<div class=\"_ctrGrid\">' + descriptor.find('Designer').text() + '</div>');\n\n //Settings\n var settingsXML = descriptor.find('Settings');\n if (settingsXML.length == 1) {\n var settings = $(settingsXML[0]);\n /* Inizializamos todos los settings de este control. Sólo hace falta establecer aquellos que sean distintos a los valores por defecto.*/\n _instance.Settings = new Designer.ControlSettings();\n _instance.Settings.ResizeContainer = settings.find('ResizeContainer').text().toLowerCase() == 'true';\n /*es un flag para el diseñador. Indica si el control puede cambiar su tamaño. Valores posibles Enum.ResizeMode = { none: 0, all: 1, width: 2, height:3 }*/\n _instance.Settings.AllowResize = getResizeMode(settings.find('AllowResize').text());\n _instance.Settings.ResizeContent = settings.find('ResizeContent').text().toLowerCase() == 'true';\n _instance.Settings.IsContainer = settings.find('IsContainer').text().toLowerCase() == 'true';//determina si el control tiene una zona con controles hijos.\n _instance.Settings.IsComponent = settings.find('IsComponent').text().toLowerCase() == 'true';//determina si el control aparece en el diseñador, o bien aparece en la barra de componentes.\n _instance.Settings.PositionMode = getPositionMode(settings.find('PositionMode').text());\n }\n //***************************************\n\n //Properties\n this.Properties = new Array();\n var propertiesXML = descriptor.children('Properties');\n if (propertiesXML.length == 1) {\n propertiesXML.children('Property').each(function (i) {\n var property = $(this);\n if (property.attr(\"Behavior\")) {\n if (property.attr(\"Behavior\").toLowerCase() == \"size\") {\n _instance.Settings.HasSize = true;\n var nodeSize = property.children('PropertyType').children('DefaultValue');\n if (nodeSize.length == 1) {\n try {\n var sizeArr = nodeSize.text().split(',');\n _instance.ClientSize = new Designer.Size(sizeArr[0], sizeArr[1]);\n } catch (ex) {\n Designer.Model.EventManager.HandleMessage(\"Error estableciendo el tamaño inicial del control\", ex, Enum.MessageType.Error);\n }\n }\n } else if (property.attr(\"Behavior\").toLowerCase() == \"position\") {\n _instance.Settings.HasPosition = true; //se ha encontrado una propiedad posición\n _instance.Position = new Designer.Position(0, 0); //la posición no tiene valor por defecto.\n }\n\n } else {\n\n //Propiedad normal\n CreateProperty(_instance, property);\n }\n\n\n });\n }\n\n\n //Templates\n this.TemplateInfo = new Designer.TemplateInfo();\n var templateInfoXML = descriptor.children('TemplateInfo');\n if (templateInfoXML.length == 1) {\n BuildTemplateFrame(_instance.TemplateInfo, templateInfoXML);\n }\n //***************************************\n\n\n }\n\n function CreateProperty(parent, property) {\n var piNode = property.children('PropertyType');\n var propertyType = getPropertyEditor(piNode.attr(\"typeName\"), piNode.children('DefaultValue'));\n var htmlContent = piNode.children('HtmlContent');\n if (htmlContent != null && htmlContent.length == 1) {\n propertyType.HtmlContent = $(htmlContent).text();\n }\n\n\n $.each(piNode[0].attributes, function (i, attrib) {\n var name = attrib.name;\n var value = attrib.value;\n if (name != 'typeName') {\n propertyType[name] = value;\n }\n });\n /*propertyType.HasHtmlContent = piNode.attr(\"HasHtmlContent\");\n propertyType.RenderTarget = piNode.attr(\"RenderTarget\");\n propertyType.cssStyle = piNode.attr(\"cssStyle\");*/\n var newProperty = new Designer.ControlProperty(parent, property.attr(\"Name\"), propertyType, getCategoryEnum(property.attr(\"Category\")));\n newProperty.Description = property.attr(\"Description\") != null ? property.attr(\"Description\") : \"\";\n if (parent.Properties == null) { parent.Properties = new Array(); }\n\n\n var propertiesXML = piNode.children('Properties');\n if (propertiesXML.length == 1) {\n var valueType = new String(); //cadena auxiliar que me sirve para construir el tipo de datos que sera capaz de almacenar los valores para esta propiedad compuesta.\n propertyType.ReadOnly = true; // es una propiedad compuesta, luego el editor original es readOnly\n //OJO cuando un control genérico entra en este punto, significa que se trata de una propiedad compuesta de tipo custom.\n //El programa no conoce cual es el valor asociado a esta propiedad, tiene que construirlo on the fly.\n propertiesXML.children('Property').each(function (i) {\n var subProperty = $(this);\n var piSubNode = subProperty.children('PropertyType');\n var subPropertyType = getPropertyEditor(piSubNode.attr(\"typeName\"), piSubNode.children('DefaultValue'));\n if (valueType != null && valueType != '') {\n valueType += ', ';\n }\n valueType += \"\\\"\" + subProperty.attr(\"Name\") + \"\\\"\" + \":\" + JSON.stringify(subPropertyType.GetDefaultValue());\n //Propiedad interna a un propertyType\n CreateProperty(newProperty.PropertyType, subProperty);\n\n newProperty.PropertyType.GetDefaultValue = function () { return JSON.parse('{' + valueType + '}'); }\n });\n }\n parent.Properties.push(newProperty);\n\n\n }\n\n /*crea los objeto plantillas a partir de la información contenida en el XML */\n function BuildTemplateFrame(parent, node) {\n\n node.children('Directory').each(function (i) {\n var directoryXML = $(this);\n var tmp = new Designer.Directory();\n tmp.Name = getNode(directoryXML, \"Name\");\n tmp.Path = getNode(directoryXML, \"Path\");\n parent.AddFile(tmp);\n BuildTemplateFrame(tmp, directoryXML);\n\n });\n node.children('File').each(function (i) {\n var fileXML = $(this);\n var tmp = new Designer.File();\n tmp.Source = getNode(fileXML, \"Source\");\n tmp.Destination = getNode(fileXML, \"Destination\");\n parent.AddFile(tmp);\n\n });\n node.children('Template').each(function (i) {\n var templateXML = $(this);\n var tmp = new Designer.Template();\n tmp.Template = getNode(templateXML, \"Template\");\n tmp.Name = getNode(templateXML, \"Name\");\n tmp.Destination = getNode(templateXML, \"Destination\");\n parent.AddFile(tmp);\n });\n\n\n }\n /*******************************/\n\n //funcion auxiliar\n function getNode(parent, name, defaultValue) {\n var node = parent.children(name);\n if (node != null && node.length == 1) {\n return $(node).text();\n } else {\n return defaultValue ? defaultValue : '';\n }\n }\n\n /*Este metodo se ejecuta cuando se registra el descriptor del control en el diseñador */\n this.RegisterToolBox = function (tbInfo) {\n\n this.ToolBoxInfo = tbInfo;\n };\n\n\n this.onInit = function ($control) {\n\n\n }\n\n\n //TODO getCategory.. meter tantas como existan en el enum.\n\n /*Obtiene el valor de la propiedad AllowResize a partir del texto pasado como parámetro*/\n function getResizeMode(str) {\n\n if (str == 'all') {\n return Enum.ResizeMode.all;\n } else if (str == 'width') {\n return Enum.ResizeMode.width;\n } else if (str == 'height') {\n return Enum.ResizeMode.height;\n } else if (str == 'none') {\n return Enum.ResizeMode.none;\n } else {\n return Enum.ResizeMode.none;\n }\n }\n\n /*Obtiene el tipo enumerado PositionMode a partir de un string*/\n function getPositionMode(str) {\n\n if (str == 'Absolute') {\n return Enum.PositionMode.Absolute;\n } else if (str == 'FlowLayout') {\n return Enum.PositionMode.FlowLayout;\n } else {\n return Enum.PositionMode.Absolute;\n }\n }\n\n /*Obtiene el tipo enumerado Enum.Category a partir de un string*/\n function getCategoryEnum(str) {\n\n if (str == 'Style') {\n return Enum.Categories.Style;\n } else if (str == 'Data') {\n return Enum.Categories.Data;\n }\n else if (str == 'Control') {\n return Enum.Categories.Control;\n }\n else if (str == 'Settings') {\n return Enum.Categories.Settings;\n }\n else if (str == 'Editor') {\n return Enum.Categories.Editor;\n } else {\n return Enum.Categories.Style;\n }\n }\n\n /*Obtiene el editor a partir de los valores pasados como argumentos de la función.*/\n function getPropertyEditor(str, defaultValue, cssValue) {\n\n var valor = null;\n if (defaultValue == null || jQuery.trim(defaultValue.text()) == '') {\n\n } else {\n valor = defaultValue.text();\n }\n var cssValor = null;\n if (defaultValue == null || jQuery.trim(cssValue) == '') {\n\n } else {\n cssValor = cssValue;\n }\n\n if (str == 'Designer.PropertyTypes.NumericValue') {\n return new Designer.PropertyTypes.NumericValue(valor == null ? 0 : parseInt(valor), cssValor);\n }\n else if (str == 'Designer.PropertyTypes.StringValue') {\n return new Designer.PropertyTypes.StringValue(valor, cssValor);\n }\n else if (str == 'Designer.PropertyTypes.Size') {\n return new Designer.PropertyTypes.Size(valor);\n }\n else if (str == 'Designer.PropertyTypes.Position') {\n return new Designer.PropertyTypes.Position(valor);\n }\n else if (str == 'Designer.PropertyTypes.Borders') { //TODO no admite valor por defecto\n return new Designer.PropertyTypes.Borders(null);\n }\n else if (str == 'Designer.PropertyTypes.Border') { //admite valores por defecto. OJO\n return new Designer.PropertyTypes.Border(defaultValue);\n }\n else if (str == 'Designer.PropertyTypes.Paddings') { //admite la siguiente cadena 0,0,0,0\n return new Designer.PropertyTypes.Paddings(defaultValue);\n }\n else if (str == 'Designer.PropertyTypes.BoolValue') { //admite la siguiente cadena true o false\n return new Designer.PropertyTypes.BoolValue(defaultValue);\n }\n else if (str == 'Designer.PropertyTypes.Font') { //admite la siguiente cadena 0,0,0,0\n return new Designer.PropertyTypes.Font(defaultValue);\n }\n else if (str == 'Designer.PropertyTypes.FontFamilyType') {\n return new Designer.PropertyTypes.FontFamilyType(valor, cssValor);\n }\n else if (str == 'Designer.PropertyTypes.ListValue') {\n return new Designer.PropertyTypes.ListValue(defaultValue, null, null, cssValor); //TODO revisar...\n }\n else if (str == 'Designer.PropertyTypes.ColorType') {\n return new Designer.PropertyTypes.ColorType(valor, cssValor); //TODO revisar...\n }\n else if (str == 'Designer.PropertyTypes.ArrayValue') {\n return new Designer.PropertyTypes.ArrayValue(defaultValue, cssValor); //TODO revisar...\n }\n else if (str == 'Designer.PropertyTypes.UserType') {\n return new Designer.PropertyTypes.UserType(defaultValue, cssValor); //TODO revisar...\n }\n else {\n return eval(\"new \" + str + \"(defaultValue, cssValor);\");\n }\n\n }\n}", "function buildUI (thisObj) {\r \r// basic_ui.jsx\r\rvar win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'wihihihiggle',[0,0,260,120],{resizeable: true}); \r\rif (win != null) { \r\r// get the frequence and amplitude for quicker usage \rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"freq\")== true){\r var freqsetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"freq\");\r meta_wgl.freq = freqsetting;\r};\r\rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"amp\")== true){\r var ampsetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"amp\");\r meta_wgl.amp = ampsetting;\r};\r\rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"octaves\")== true){\r var octavessetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"octaves\");\r meta_wgl.octaves = octavessetting;\r};\r\rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"seed\")== true){\r var seedsetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"seed\");\r meta_wgl.seed = seedsetting;\r};\r\rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"amp_mult\")== true){\r var amp_multsetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"amp_mult\");\r meta_wgl.amp_mult = amp_multsetting;\r};\r\rif(app.settings.haveSetting(meta_wgl.settingsSectionName,\"loopTime\")== true){\r var loopTimesetting = app.settings.getSetting(meta_wgl.settingsSectionName,\"loopTime\");\r meta_wgl.loopTime = loopTimesetting;\r};\r\r\r\rvar advancedpanelsize = [10,95,250,350];\r\r\rwin.button_run_main_script = win.add('button', [35,5,250,35], 'Add wihihihiggle!'); \rwin.button_help = win .add('button',[10,5,30,35],'?');\rwin.checkbox_simple = win.add('checkbox', [ 10, 40,100, 60], 'simple?');\rwin.checkbox_usetemporal = win.add('checkbox', [ 10, 65,100, 85], 'temporal?');\rwin.checkbox_withcontroller = win.add('checkbox', [ 10, 90,100, 110], 'with ctrl?');\r\r\r\rwin.label_freq = win.add('statictext', [110,42,190,60], 'freq ------------------------'); \rwin.label_amp = win.add('statictext', [110,72,190,90], 'amp ------------------------'); \rwin.field_freq = win.add('edittext', [190,40,250,60], String(meta_wgl.freq)); \rwin.field_amp = win.add('edittext', [190,70,250,90], String(meta_wgl.amp)); \r\r\rwin.panel_advanced = win.add('group',advancedpanelsize , '');\r\rwin.label_octaves = win.panel_advanced.add('statictext', [10,5,180,25], 'octaves ------------------------'); \r\rwin.field_octaves = win.panel_advanced.add('edittext', [180,5,240,25], String(meta_wgl.octaves)); \r\rwin.label_amp_mult = win.panel_advanced.add('statictext', [10,35,180,55], 'amp_mult ------------------------'); \r\rwin.field_amp_mult = win.panel_advanced.add('edittext', [180,35,240,55], String(meta_wgl.amp_mult)); \r\rwin.checkbox_addtime = win.panel_advanced.add('checkbox', [ 10, 65,180, 85], 'add time expression -------');\r\rwin.field_time = win.panel_advanced.add('edittext', [180,65,240,85], meta_wgl.time_expr); \r\rwin.checkbox_addseed = win.panel_advanced.add('checkbox', [ 10, 95,180, 115], 'add random seed ---------');\r\rwin.field_seed = win.panel_advanced.add('edittext', [180,95,240,115], String(meta_wgl.seed)); \r\rwin.checkbox_addpstrz = win.panel_advanced.add('checkbox', [ 10, 125,180, 145], 'posterize time with fps ----');\r\rwin.field_pstrz_fps = win.panel_advanced.add('edittext', [180,125,240,145], String(meta_wgl.framesPerSecond)); \r\r\rwin.checkbox_addloop = win.panel_advanced.add('checkbox', [ 10, 155,180, 175], 'loop wiggle in seconds ----');\r\rwin.field_looptime = win.panel_advanced.add('edittext', [180,155,240,175], String(meta_wgl.loopTime));\r\r\rwin.field_ctrlname = win.panel_advanced.add('edittext',[110,185,200,205], meta_wgl.ctrlname );\r\rwin.button_select_ctrl = win.panel_advanced.add('button',[10, 185,105,205],'select controller');\r\rwin.checkbox_ctrlExists = win.panel_advanced.add('checkbox',[210,185,240,205],'');\r\rwin.button_reset = win.panel_advanced.add('button',[10,210,240,230],'reset 2 default');\r\rwin.label_freq.justify = 'left'; \rwin.label_amp.justify = 'left'; \rwin.label_octaves.justify = 'left'; \rwin.label_amp_mult.justify = 'left'; \r\rwin.field_freq .helpTip = helpTipStrings.freq;\rwin.label_freq .helpTip = helpTipStrings.freq;\rwin.checkbox_withcontroller .helpTip = helpTipStrings.withCtrl;\rwin.field_amp .helpTip = helpTipStrings.amp;\rwin.label_amp .helpTip = helpTipStrings.amp;\rwin.label_octaves .helpTip = helpTipStrings.octaves;\rwin.field_octaves .helpTip = helpTipStrings.octaves;\rwin.label_amp_mult .helpTip = helpTipStrings.amp_mult;\rwin.field_amp_mult .helpTip = helpTipStrings.amp_mult;\rwin.checkbox_addtime .helpTip = helpTipStrings.t;\rwin.field_time .helpTip = helpTipStrings.t;\rwin.checkbox_addseed .helpTip = helpTipStrings.seed;\rwin.field_seed .helpTip = helpTipStrings.seed;\rwin.checkbox_addpstrz .helpTip = helpTipStrings.framesPerSecond;\rwin.field_pstrz_fps .helpTip = helpTipStrings.framesPerSecond;\rwin.checkbox_addloop .helpTip = helpTipStrings.loopTime;\rwin.field_looptime .helpTip = helpTipStrings.loopTime;\rwin.field_ctrlname .helpTip = helpTipStrings.ctrlname;\rwin.button_select_ctrl .helpTip = helpTipStrings.button_select_ctrl;\rwin.checkbox_ctrlExists .helpTip = helpTipStrings.ctrlExists;\rwin.button_reset .helpTip = helpTipStrings.reset_button;\rwin.button_run_main_script .helpTip = helpTipStrings.runButton;\rwin.checkbox_simple .helpTip = helpTipStrings.simple;\rwin.checkbox_addloop .helpTip = helpTipStrings.addLoop;\rwin.checkbox_addpstrz .helpTip = helpTipStrings.addpstrz;\rwin.checkbox_addseed .helpTip = helpTipStrings.addseed;\rwin.checkbox_addtime .helpTip = helpTipStrings.addTime;\rwin.checkbox_usetemporal .helpTip = helpTipStrings.usetemporal;\rwin.button_help .helpTip = helpTipStrings.button_help;\r\r\r\r \r\rwin.checkbox_simple.value = meta_wgl.simple;\rwin.checkbox_withcontroller.value = meta_wgl.add_simple_ctrl;\rwin.checkbox_addloop.value = meta_wgl.addLoop;\rwin.checkbox_addpstrz.value = meta_wgl.addPosterizeTime;\rwin.checkbox_addseed.value = meta_wgl.addSeedRandom;\rwin.checkbox_addtime.value = meta_wgl.addTime;\rwin.checkbox_usetemporal.value = meta_wgl.addTemporal;\rwin.checkbox_ctrlExists.value = meta_wgl.ctrlExists;\r\rwin.panel_advanced.visible = false;\rwin.panel_advanced.enabled = false;\r \r\r\rwin.field_freq.justify = 'left'; \rwin.field_amp.justify = 'left'; \rwin.field_octaves.justify = 'left'; \rwin.field_seed.justify = 'left'; \rwin.field_time.justify = 'left'; \rwin.field_amp_mult.justify = 'left'; \rwin.field_looptime.justify = 'left'; \rwin.field_pstrz_fps.justify = 'left'; \rwin.field_ctrlname.justify = 'left';\r\r\r\r// ------------ the edit text fields ------------\r\rwin.field_freq.onChange = function (){\r\r if(this.text.length < 1){\r this.text = meta_wgl.freq;\r alert(errorStrings.novalue + meta_wgl.freq);\r }else{\r meta_wgl.freq = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"freq\",meta_wgl.freq);\r };\r};\r\r/**\r * This sets the amp field\r *\r */ \r\rwin.field_amp.onChange = function (){\r\r if(this.text.length < 1){\r this.text = meta_wgl.amp;\r alert(errorStrings.novalue + meta_wgl.amp);\r }else{\r meta_wgl.amp = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"amp\",meta_wgl.amp);\r };\r};\r\rwin.field_octaves.onChange = function () {\r if(this.text.length < 1){\r this.text = meta_wgl.octaves;\r alert(errorStrings.novalue + meta_wgl.octaves);\r }else{\r meta_wgl.octaves = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"octaves\",meta_wgl.octaves);\r };\r\r // meta_wgl.octaves = resetValIfNAN( parseFloat(this.text), meta_wgl.octaves, errorStrings.NAN + \" \" + meta_wgl.octaves);\r // this.text = meta_wgl.octaves;\r\r};\r\r\rwin.field_amp_mult.onChange = function () {\r if(this.text.length < 1){\r this.text = meta_wgl.amp_mult;\r alert(errorStrings.novalue + meta_wgl.amp_mult);\r }else{\r meta_wgl.amp_mult = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"amp_mult\",meta_wgl.amp_mult);\r };\r \r // meta_wgl.amp_mult = resetValIfNAN( parseFloat(this.text), meta_wgl.amp_mult, errorStrings.NAN + \" \" + meta_wgl.amp_mult);\r // this.text = meta_wgl.amp_mult;\r};\r\rwin.field_seed.onChange = function () {\r if(this.text.length < 1){\r this.text = meta_wgl.seed;\r alert(errorStrings.novalue + meta_wgl.seed);\r }else{\r meta_wgl.seed = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"seed\",meta_wgl.seed);\r };\r\r // meta_wgl.seed = resetValIfNAN( parseFloat(this.text), meta_wgl.seed, errorStrings.NAN + \" \" + meta_wgl.seed);\r // this.text = meta_wgl.seed;\r\r};\r\rwin.field_looptime.onChange = function () {\r if(this.text.length < 1){\r this.text = meta_wgl.loopTime;\r alert(errorStrings.novalue + meta_wgl.loopTime);\r }else{\r meta_wgl.loopTime = this.text;\r app.settings.saveSetting(meta_wgl.settingsSectionName,\"seed\",meta_wgl.loopTime);\r };\r\r // meta_wgl.loopTime = resetValIfNAN( parseFloat(this.text), meta_wgl.loopTime, errorStrings.NAN + \" \" + meta_wgl.loopTime);\r // this.text = meta_wgl.loopTime;\r\r};\r\rwin.field_time.onChange = function(){\r\r if(meta_wgl.addTime == true){\r meta_wgl.time_expr = this.text;\r }else if (meta_wgl.addTime == false) {\r meta_wgl.t = resetValIfNAN(parseFloat(this.text),meta_wgl.t,errorStrings.NAN + \" \"+ meta_wgl.t);\r };\r\r };\r\rwin.field_ctrlname.onChange = function(){\r\r if(this.text.length > 0){\r meta_wgl.ctrlname = this.text;\r }else{\r\r alert(\"Your controler needs a name.\\nI will reset it to the last entry'\"+meta_wgl.ctrlname+\"'\");\r this.text = meta_wgl.ctrlname;\r };\r };\r// ----------------------------------------------\r\r\r\rwin.button_run_main_script.onClick = function () {\r if(meta_wgl.debug == true) alert(meta_wgl.toSource());\r main_script(meta_wgl);\r};\r\rwin.button_help.onClick = function(){\rhelpDialog(meta_wgl.helpText,\"Help\");\r};\r\rwin.button_select_ctrl.onClick = function () {\r\r var curComp = app.project.activeItem;\r\r if (!curComp || !(curComp instanceof CompItem))\r {\r alert(\"Please select a Composition.\");\r return;\r };\r\r if (curComp.selectedLayers.length < 1) {\r alert(\"Please select a control layer\");\r return;\r };\r\r var ctrllayer = curComp.selectedLayers[0];\r if(ctrllayer == null){\r alert(\"There is an error with your controller.\\n Please try again\");\r return;\r };\r\r // taken from redefinerys scripting fundamentals\r // http://www.redefinery.com/ae/fundamentals/layers/\r // where would i be without it?\r // Checking for a light layer (as of After Effects 7.0)\rif (ctrllayer instanceof LightLayer){\r alert(\"Sorry buddy - this is a light layer.\\nLight layers cant hold a expression controller\");\r return;\r };\r\r// Checking for a camera layer (as of After Effects 7.0)\rif (ctrllayer instanceof CameraLayer){\r alert(\"Sorry buddy - this is a camera layer.\\camera layers cant hold a expression controller\");\r return;\r };\r\r // ------------ finally we can check for the controlers ------------\r\r meta_wgl.ctrllayer = ctrllayer;\r meta_wgl.ctrlname = ctrllayer.name;\r win.field_ctrlname.text = meta_wgl.ctrlname;\r meta_wgl.ctrlExists = true;\r win.checkbox_ctrlExists.value = meta_wgl.ctrlExists;\r\r\r\r};\r\r\rwin.checkbox_simple.onClick = function (){\r\r\r if(this.value == true){\r \r win.panel_advanced.visible = false;\r win.panel_advanced.enabled = false;\r win.checkbox_withcontroller.visible = true;\r win.bounds = [0,0,260,100];\r\r }else if (this.value == false){\r win.checkbox_withcontroller.visible = false;\r win.field_amp.notify();\r win.field_freq.notify();\r win.panel_advanced.visible = true;\r win.panel_advanced.enabled = true;\r\r win.bounds = [0,0,260,315];\r };\r\r meta_wgl.simple = this.value;\r\r };// end of simple checkbox function\rwin.checkbox_withcontroller.onClick = function(){meta_wgl.add_simple_ctrl = this.value};\rwin.checkbox_addloop.onClick = function(){ meta_wgl.addLoop = this.value; };\rwin.checkbox_addpstrz.onClick = function(){ meta_wgl.addPosterizeTime = this.value; };\rwin.checkbox_usetemporal.onClick = function(){ meta_wgl.addTemporal = this.value; };\rwin.checkbox_addseed.onClick = function(){ meta_wgl.addSeedRandom = this.value; };\rwin.checkbox_addtime.onClick = function(){\r\r if(this.value == true){\r win.field_time.text = meta_wgl.time_expr;\r meta_wgl.addTime = this.value;\r }else if(this.value == false){\r win.field_time.text = meta_wgl.t;\r meta_wgl.addTime = this.value;\r };\r};\r\rwin.checkbox_ctrlExists.onClick = function() {\r meta_wgl.ctrlExists = this.value;\r if(this.value == false){\r meta_wgl.ctrllayer = null;\r meta_wgl.ctrlname = meta_wgl.defaultctrlname;\r };\r\r};\r\rwin.button_reset.onClick = function(){\r\r\r meta_wgl.freq = meta_wgl.freq_def;\r win.field_freq.text = meta_wgl.freq_def; \r win.field_freq.notify();\r\r meta_wgl.amp = meta_wgl.amp_def;\r win.field_amp.text = meta_wgl.amp_def;\r win.field_amp.notify();\r\r meta_wgl.seed = meta_wgl.seed_def;\r win.field_seed.text = meta_wgl.seed_def;\r win.field_seed.notify();\r \r meta_wgl.octaves = meta_wgl.octaves_def;\r win.field_octaves.text = meta_wgl.octaves_def;\r win.field_octaves.notify();\r\r meta_wgl.amp_mult = meta_wgl.amp_mult_def;\r win.field_amp_mult.text = meta_wgl.amp_mult_def;\r win.field_amp_mult.notify();\r\r meta_wgl.t = meta_wgl.t_def;\r win.field_time.text = meta_wgl.default_time_expr;\r win.field_time.notify();\r\r meta_wgl.time_expr = meta_wgl.default_time_expr;\r meta_wgl.default_time_expr = \"time\";\r meta_wgl.framesPerSecond = meta_wgl.framesPerSecond_def;\r win.field_pstrz_fps.text = meta_wgl.framesPerSecond_def;\r win.field_pstrz_fps.notify();\r\r meta_wgl.loopTime = meta_wgl.loopTime_def;\r win.field_looptime.text = meta_wgl.loopTime_def;\r win.field_looptime.notify();\r\r\r };\r\r}; // end if if win != null \rreturn win \r}", "buildSchema() {\n if (!this.dbSchema) return this.schema;\n for (let tablename in this.dbSchema) {\n this.mapDbTableToGraphqlType(tablename);\n this.mapDbTableToGraphqlQuery(tablename);\n this.mapDbTableToGraphqlFirstOf(tablename);\n this.mapDbTableToGraphqlMutation(tablename);\n this.mapDbTableToGraphqlInput(tablename);\n }\n return this.schema;\n }", "function buildType(type) {\n\t switch (type.kind) {\n\t case _typeIntrospection.TypeKind.SCALAR:\n\t return buildScalarDef(type);\n\t case _typeIntrospection.TypeKind.OBJECT:\n\t return buildObjectDef(type);\n\t case _typeIntrospection.TypeKind.INTERFACE:\n\t return buildInterfaceDef(type);\n\t case _typeIntrospection.TypeKind.UNION:\n\t return buildUnionDef(type);\n\t case _typeIntrospection.TypeKind.ENUM:\n\t return buildEnumDef(type);\n\t case _typeIntrospection.TypeKind.INPUT_OBJECT:\n\t return buildInputObjectDef(type);\n\t default:\n\t throw new Error('Invalid or incomplete schema, unknown kind: ' + type.kind + '. Ensure ' + 'that a full introspection query is used in order to build a ' + 'client schema.');\n\t }\n\t }", "function initializeVisualization(createStaticElements) {\n d3.json(\"data/\" + global.dataset.file, function(data) {\n // Cache the dataset\n global.papers = data.papers;\n\n // Initialize some global parameters\n global.computeOldestLatestPublicationYears();\n global.computeMedianMaximalNormalizedCitationCountsPerYear();\n\n // Restore data from previous session\n sessionManager.loadPreviousSession();\n\n // If no seed papers, won't do anything\n algorithm.updateFringe();\n view.initializeView(createStaticElements);\n\n // setup autocomplete popup\n $('#dialog .typeahead').typeahead({\n hint: true,\n highlight: true,\n minLength: 3\n }, {\n name: 'titles',\n displayKey: 'value',\n source: substringMatcher(Object.keys(global.papers)\n .map(function(doi) {\n return global.papers[doi].title;\n }))\n });\n });\n}", "visibleSchema() {\n if (this.field.style !== 'table') {\n return this.schema;\n }\n const currentItem = this.items.find(item => item.open) || this.items[this.items.length - 1];\n const conditions = this.conditionalFields(currentItem?.schemaInput?.data || {});\n return this.schema.filter(\n field => conditions[field.name] !== false\n );\n }", "function addComponentConnectorElement(button, type) {\n const id = parseInt($(button).parents(\"tr\").find(\"td:nth-child(1)\").text());\n console.log(id);\n\n const name = $(button).parents(\"tr\").find(\"td:nth-child(2)\").text();\n console.log(name);\n\n const element = {\n id: id,\n name: name\n }\n\n if (type === \"component\") {\n const foundIndex = window.Diagrammer.architectureElements.components.findIndex(x => x.id === id);\n if (foundIndex < 0) {\n const fabricObj = addComponentToCanvas(element);\n element.fabricObj = fabricObj;\n window.Diagrammer.architectureElements.components.push(element);\n } else {\n window.Diagrammer.architectureElements.components[foundIndex].fabricObj.item(1).set({ text: name });\n window.Diagrammer.architectureElements.components[foundIndex].name = name;\n window.Diagrammer.stage.renderAll();\n }\n } else if (type === \"connector\") {\n const foundIndex = window.Diagrammer.architectureElements.connectors.findIndex(x => x.id === id);\n if (foundIndex < 0) {\n const fabricObj = addConnectorToCanvas(element);\n element.fabricObj = fabricObj;\n window.Diagrammer.architectureElements.connectors.push(element);\n } else {\n window.Diagrammer.architectureElements.connectors[foundIndex].fabricObj.item(1).set({ text: name });\n window.Diagrammer.architectureElements.connectors[foundIndex].name = name;\n window.Diagrammer.stage.renderAll();\n\n }\n }\n console.log(window.Diagrammer.architectureElements);\n\n}", "function updateSchema() {\n var properties = {};\n var required = [];\n $scope.defaultValues = {};\n var schema = {\n type: \"object\",\n required: required,\n properties: properties\n };\n var inputClass = \"span12\";\n var labelClass = \"control-label\";\n //var inputClassArray = \"span11\";\n var inputClassArray = \"\";\n var labelClassArray = labelClass;\n var metaType = $scope.metaType;\n if (metaType) {\n var pidMetadata = Osgi.configuration.pidMetadata;\n var pid = metaType.id;\n schema[\"id\"] = pid;\n schema[\"name\"] = Core.pathGet(pidMetadata, [pid, \"name\"]) || metaType.name;\n schema[\"description\"] = Core.pathGet(pidMetadata, [pid, \"description\"]) || metaType.description;\n var disableHumanizeLabel = Core.pathGet(pidMetadata, [pid, \"schemaExtensions\", \"disableHumanizeLabel\"]);\n angular.forEach(metaType.attributes, function (attribute) {\n var id = attribute.id;\n if (isValidProperty(id)) {\n var key = encodeKey(id, pid);\n var typeName = asJsonSchemaType(attribute.typeName, attribute.id);\n var attributeProperties = {\n title: attribute.name,\n tooltip: attribute.description,\n 'input-attributes': {\n class: inputClass\n },\n 'label-attributes': {\n class: labelClass\n },\n type: typeName\n };\n if (disableHumanizeLabel) {\n attributeProperties.title = id;\n }\n if (attribute.typeName === \"char\") {\n attributeProperties[\"maxLength\"] = 1;\n attributeProperties[\"minLength\"] = 1;\n }\n var cardinality = attribute.cardinality;\n if (cardinality) {\n // lets clear the span on arrays to fix layout issues\n attributeProperties['input-attributes']['class'] = null;\n attributeProperties.type = \"array\";\n attributeProperties[\"items\"] = {\n 'input-attributes': {\n class: inputClassArray\n },\n 'label-attributes': {\n class: labelClassArray\n },\n \"type\": typeName\n };\n }\n if (attribute.required) {\n required.push(id);\n }\n var defaultValue = attribute.defaultValue;\n if (defaultValue) {\n if (angular.isArray(defaultValue) && defaultValue.length === 1) {\n defaultValue = defaultValue[0];\n }\n //attributeProperties[\"default\"] = defaultValue;\n // TODO convert to boolean / number?\n $scope.defaultValues[key] = defaultValue;\n }\n var optionLabels = attribute.optionLabels;\n var optionValues = attribute.optionValues;\n if (optionLabels && optionLabels.length && optionValues && optionValues.length) {\n var enumObject = {};\n for (var i = 0; i < optionLabels.length; i++) {\n var label = optionLabels[i];\n var value = optionValues[i];\n enumObject[value] = label;\n }\n $scope.selectValues[key] = enumObject;\n Core.pathSet(attributeProperties, ['input-element'], \"select\");\n Core.pathSet(attributeProperties, ['input-attributes', \"ng-options\"], \"key as value for (key, value) in selectValues.\" + key);\n }\n properties[key] = attributeProperties;\n }\n });\n // now lets override anything from the custom metadata\n var schemaExtensions = Core.pathGet(Osgi.configuration.pidMetadata, [pid, \"schemaExtensions\"]);\n if (schemaExtensions) {\n // now lets copy over the schema extensions\n overlayProperties(schema, schemaExtensions);\n }\n }\n // now add all the missing properties...\n var entity = {};\n angular.forEach($scope.configValues, function (value, rawKey) {\n if (isValidProperty(rawKey)) {\n var key = encodeKey(rawKey, pid);\n var attrValue = value;\n var attrType = \"string\";\n if (angular.isObject(value)) {\n attrValue = value.Value;\n attrType = asJsonSchemaType(value.Type, rawKey);\n }\n var property = properties[key];\n if (!property) {\n property = {\n 'input-attributes': {\n class: inputClass\n },\n 'label-attributes': {\n class: labelClass\n },\n type: attrType\n };\n properties[key] = property;\n if (rawKey == 'org.osgi.service.http.port') {\n properties[key]['input-attributes']['disabled'] = 'disabled';\n properties[key]['input-attributes']['title'] = 'Changing port of OSGi http service is not possible from Hawtio';\n }\n }\n else {\n var propertyType = property[\"type\"];\n if (\"array\" === propertyType) {\n if (!angular.isArray(attrValue)) {\n attrValue = attrValue ? attrValue.split(\",\") : [];\n }\n }\n }\n if (disableHumanizeLabel) {\n property.title = rawKey;\n }\n //comply with Forms.safeIdentifier in 'forms/js/formHelpers.ts'\n key = key.replace(/-/g, \"_\");\n entity[key] = attrValue;\n }\n });\n // add default values for missing values\n angular.forEach($scope.defaultValues, function (value, key) {\n var current = entity[key];\n if (!angular.isDefined(current)) {\n //log.info(\"updating entity \" + key + \" with default: \" + value + \" as was: \" + current);\n entity[key] = value;\n }\n });\n //log.info(\"default values: \" + angular.toJson($scope.defaultValues));\n $scope.entity = entity;\n $scope.schema = schema;\n $scope.fullSchema = schema;\n }", "function _createBaseStyles() {\n _baseVisualization = $(\"<style />\", {\n id: \"alice-base-visualization\",\n type: \"text/css\",\n html: _visualizationBaseCSS\n });\n _baseVisualization.appendTo(\"head\");\n _baseStylesCreated = true;\n }" ]
[ "0.62277085", "0.6182751", "0.61573255", "0.60511625", "0.5991677", "0.5982153", "0.59122914", "0.5869149", "0.57165706", "0.56984925", "0.5617634", "0.56127393", "0.55971694", "0.5591458", "0.5529375", "0.55229986", "0.55040324", "0.55036443", "0.5486724", "0.54828155", "0.5464533", "0.54467064", "0.5437996", "0.5433659", "0.5432085", "0.5422063", "0.5421224", "0.54139704", "0.5412943", "0.54117775", "0.54028314", "0.53879416", "0.5383399", "0.53811765", "0.538031", "0.53792405", "0.53714764", "0.5370174", "0.5361172", "0.5358871", "0.5354464", "0.535357", "0.53371304", "0.53348744", "0.53287256", "0.5311133", "0.53070974", "0.5302274", "0.5300222", "0.5299302", "0.5298521", "0.52921146", "0.52895874", "0.5276959", "0.52756476", "0.526444", "0.525956", "0.5258772", "0.5245327", "0.5243274", "0.5240999", "0.5238164", "0.5238151", "0.523629", "0.5231008", "0.5230664", "0.5218612", "0.52126807", "0.52080226", "0.5205152", "0.51975846", "0.5194921", "0.5192719", "0.5189211", "0.51832074", "0.51829165", "0.51807827", "0.51741886", "0.51731855", "0.5171908", "0.516558", "0.5164598", "0.5163526", "0.51559454", "0.51474065", "0.51377153", "0.51338285", "0.51319957", "0.51289344", "0.5126832", "0.5123052", "0.5119876", "0.51130545", "0.51068014", "0.5103066", "0.51018304", "0.510135", "0.50992876", "0.50944394", "0.509392", "0.50887537" ]
0.0
-1
Create a rule instance.
function createRule(name, decl, options) { if (name === void 0) { name = 'unnamed'; } var jss = options.jss; var declCopy = cloneStyle(decl); var rule = jss.plugins.onCreateRule(name, declCopy, options); if (rule) return rule; // It is an at-rule and it has no instance. if (name[0] === '@') { false ? 0 : void 0; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static makeRule(options) {\n return new Rule(options.name, options.severity, options.selector ? Selector.parse(options.selector) : null, Rule.makePattern(options.pattern), options.lint || options.message, options.applies);\n }", "create(context) {\n freezeDeeply(context.options);\n freezeDeeply(context.settings);\n freezeDeeply(context.parserOptions);\n\n // freezeDeeply(context.languageOptions);\n\n return (typeof rule === \"function\" ? rule : rule.create)(context);\n }", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n }", "function Rule(ruleOption, ruleValue){\n this.ruleOption = ruleOption;\n this.ruleValue = ruleValue;\n}", "function createRule() {\n\t var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n\t var decl = arguments[1];\n\t var options = arguments[2];\n\t var jss = options.jss;\n\t\n\t var declCopy = (0, _cloneStyle2['default'])(decl);\n\t\n\t var rule = jss.plugins.onCreateRule(name, declCopy, options);\n\t if (rule) return rule;\n\t\n\t // It is an at-rule and it has no instance.\n\t if (name[0] === '@') {\n\t (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n\t }\n\t\n\t return new _StyleRule2['default'](name, declCopy, options);\n\t}", "function createRule() {\n\t var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n\t var decl = arguments[1];\n\t var options = arguments[2];\n\t var jss = options.jss;\n\n\t var declCopy = (0, _cloneStyle2['default'])(decl);\n\n\t var rule = jss.plugins.onCreateRule(name, declCopy, options);\n\t if (rule) return rule;\n\n\t // It is an at-rule and it has no instance.\n\t if (name[0] === '@') {\n\t (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n\t }\n\n\t return new _StyleRule2['default'](name, declCopy, options);\n\t}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n var declCopy = (0, _cloneStyle2['default'])(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "constructor() { \n \n RecordRule.initialize(this);\n }", "add(rule) { \n this.rules[rule.type] = rule \n rule.parser = this\n }", "function Rule(controller, condition, value) {\n this.init(controller, condition, value);\n }", "function Rule(input, output){\n\tthis.input = input;\n\tthis.output = output;\n}", "constructor(scope, id, props) {\n super(scope, id, { type: CfnRule.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_connect_CfnRuleProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnRule);\n }\n throw error;\n }\n cdk.requireProperty(props, 'actions', this);\n cdk.requireProperty(props, 'function', this);\n cdk.requireProperty(props, 'instanceArn', this);\n cdk.requireProperty(props, 'name', this);\n cdk.requireProperty(props, 'publishStatus', this);\n cdk.requireProperty(props, 'triggerEventSource', this);\n this.attrRuleArn = cdk.Token.asString(this.getAtt('RuleArn', cdk.ResolutionTypeHint.STRING));\n this.actions = props.actions;\n this.function = props.function;\n this.instanceArn = props.instanceArn;\n this.name = props.name;\n this.publishStatus = props.publishStatus;\n this.triggerEventSource = props.triggerEventSource;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::Connect::Rule\", props.tags, { tagPropertyName: 'tags' });\n }", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') ;\n\n return null;\n }", "function Rule(data) {\n var rules = document.getElementById('rules');\n this.node = document.getElementById('rule-template').cloneNode(true);\n this.node.id = 'rule' + (Rule.next_id++);\n this.node.rule = this;\n rules.appendChild(this.node);\n this.node.hidden = false;\n\n if (data) {\n this.getElement('matcher').value = data.matcher;\n this.getElement('match-param').value = data.match_param;\n this.getElement('action').value = data.action;\n this.getElement('action-js').value = data.action_js;\n this.getElement('enabled').checked = data.enabled;\n }\n\n this.getElement('enabled-label').htmlFor = this.getElement('enabled').id =\n this.node.id + '-enabled';\n\n this.render();\n\n this.getElement('matcher').onchange = storeRules;\n this.getElement('match-param').onkeyup = storeRules;\n this.getElement('action').onchange = storeRules;\n this.getElement('action-js').onkeyup = storeRules;\n this.getElement('enabled').onchange = storeRules;\n\n var rule = this;\n this.getElement('move-up').onclick = function() {\n var sib = rule.node.previousSibling;\n rule.node.parentNode.removeChild(rule.node);\n sib.parentNode.insertBefore(rule.node, sib);\n storeRules();\n };\n this.getElement('move-down').onclick = function() {\n var parentNode = rule.node.parentNode;\n var sib = rule.node.nextSibling.nextSibling;\n parentNode.removeChild(rule.node);\n if (sib) {\n parentNode.insertBefore(rule.node, sib);\n } else {\n parentNode.appendChild(rule.node);\n }\n storeRules();\n };\n this.getElement('remove').onclick = function() {\n rule.node.parentNode.removeChild(rule.node);\n storeRules();\n };\n storeRules();\n}", "function makeRule(pattern, style) {\n pattern.style = style;\n return pattern;\n}", "createRule(name, style, options) {\n options = {\n ...options,\n sheet: this,\n jss: this.options.jss,\n Renderer: this.options.Renderer\n }\n // Scope options overwrite instance options.\n if (options.named == null) options.named = this.options.named\n const rule = createRule(name, style, options)\n // Register conditional rule, it will stringify it's child rules properly.\n if (rule.type === 'conditional') {\n this.rules[rule.selector] = rule\n }\n // This is a rule which is a child of a condtional rule.\n // We need to register its class name only.\n else if (rule.options.parent && rule.options.parent.type === 'conditional') {\n // Only named rules should be referenced in `classes`.\n if (rule.options.named) this.classes[name] = rule.className\n }\n else {\n this.rules[rule.selector] = rule\n if (options.named) {\n this.rules[name] = rule\n this.classes[name] = rule.className\n }\n }\n options.jss.plugins.run(rule)\n return rule\n }", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) name = 'unnamed';\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n if (name[0] === '@') warning__default['default'](false, \"[JSS] Unknown rule \" + name);\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? undefined : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? undefined : void 0;\n }\n\n return null;\n}", "function Rule(rule_id) {\n this.target = $('#rule'+rule_id+'_target').val();\n this.pattern = $('#rule'+rule_id+'_pattern').val();\n}", "function Rule(prev, props) {\n this.prev = prev;\n this.props = props;\n this.context = null;\n}", "function Rule(opts) {\n if(!(this instanceof Rule)) {\n return new Rule(opts);\n }\n\n for(var k in opts) {\n this[k] = opts[k];\n }\n\n // reason constants\n this.reasons = Reason.reasons;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "addRule(rule) {\n if (!this.rules[rule.input]) this.rules[rule.input] = [];\n this.rules[rule.input].push(rule);\n }", "constructor() {\n this.rules = [];\n }", "constructor() {\n /**\n * @type {Object<string, string>}\n */\n this._rules = {};\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnReceiptRule.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_ses_CfnReceiptRuleProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnReceiptRule);\n }\n throw error;\n }\n cdk.requireProperty(props, 'rule', this);\n cdk.requireProperty(props, 'ruleSetName', this);\n this.rule = props.rule;\n this.ruleSetName = props.ruleSetName;\n this.after = props.after;\n }", "_parseRule(rule){\n\t\tvar _rule = {};\n\n\t\tif (_.isPlainObject(rule))\n\t\t\t_rule = rule;\n\t\telse {\n\t\t\tvar rule_segments = rule.split(';');\n\n\t\t\t//lets parse the rule\n\t\t\t_.each(rule_segments,function(rule_segment){\n\t\t\t\tvar segment = rule_segment.split('=');\n\n\t\t\t\tswitch(segment[0].toUpperCase()){\n\t\t\t\t\tcase 'FREQ':\n\t\t\t\t\t\t_rule.freq = segment[1].toUpperCase();\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'INTERVAL':\n\t\t\t\t\t\t_rule.interval = parseInt(segment[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'COUNT':\n\t\t\t\t\t\t_rule.count = parseInt(segment[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'DTSTART':\n\t\t\t\t\t\tthis.setStartDate(moment.utc(segment[1])); //must be utc string\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'UNTIL':\n\t\t\t\t\t\tthis.setEndDate(moment.utc(segment[1])); //must be utc string\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'BYDAY':\n\t\t\t\t\t\t_rule.days_of_week = _.filter(segment[1].split(','),function(day){ return day.length; });\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'BYMONTHDAY':\n\t\t\t\t\t\t_rule.day_of_month = parseInt(segment[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'BYMONTH':\n\t\t\t\t\t\t_rule.month = parseInt(segment[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'BYSETPOS':\n\t\t\t\t\t\t_rule.set_pos = parseInt(segment[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'WKST':\n\t\t\t\t\t\t_rule.start_of_week = segment[1];\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'EXDATE':\n\t\t\t\t\t\t_rule.exdate = _.map(segment[1].split(','),function(date){\n\t\t\t\t\t\t\tvar m = moment.unix(date/1000);\n\t\t\t\t\t\t\treturn m.isValid() ? m : date;\n\t\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}.bind(this));\n\t\t}\n\n\t\treturn _rule;\n\t}", "function Rule(controller, rule, callback, name) {\n this.controller = controller;\n this.rule = rule\n this.callback = callback;\n this.name = name;\n this._infix = null;\n\t\tthis.history = [];\n \n // Cached copy of the recent most score\n this.recentScore = 0;\n \n // TODO: these functions might be useful\n // this.isEnabled = true;\n // this.disable = function() { this.isEnabled = false; return this; }\n // this.enable = function() { this.isEnabled = true; return this; }\n // this.destroy = function() { this.controller._rules.remove(this); }\n\t\t\n\t\tthis.eval = function(terms) {\n var output = this._infix.clone();\n var operators = [];\n \n while(output.length > 0) {\n var token = output.shift();\n \n\t\t\t\tif(token == 'not') {\n\t\t\t\t\tvar a = operators.pop();\n\t\t\t\t\tvar c = this.controller.operators.Negate(isNaN(a) ? terms[a] : a);\n\t\t\t\t\t\n\t\t\t\t\toperators.push(c);\n\t\t\t\n } else if(token == 'or' || token == 'and') {\n var a = operators.pop();\n var b = operators.pop();\n var c = null;\n \n if( isNaN(a) && isNaN(terms[a])) {\n throw new Error(\"Unknown term '\" + a + \"'.\");\n break;\n }\n \n if( isNaN(b) && isNaN(terms[b])) {\n throw new Error(\"Unknown term '\" + b + \"'.\");\n break;\n }\n \n // Use lookup if the variable is not a number.\n a = isNaN(a) ? terms[a] : a;\n b = isNaN(b) ? terms[b] : b;\n \n // Execute Zadeh operators\n if(token == 'or') {\n c = this.controller.operators.Or(a, b);\n } else {\n c = this.controller.operators.And(a, b);\n }\n \n // Push back into stack for next iteration.\n operators.push(c);\n } else {\n operators.push(token);\n }\n }\n \n\t\t\tvar last = operators.last();\n\t\t\t\n\t\t\t// Just incase the rule only has one variable.\n\t\t\tif(isNaN(last)) {\n\t\t\t\tlast = terms[last];\n\t\t\t} \n\t\t\t\n\t\t\tthis.history.push(last);\n\n\t\t\t// Trim to some maximum size. These\n\t\t\t// values are used for debug drawing.\n\t\t\twhile(this.history.length > 80) {\n\t\t\t\tthis.history.shift();\n\t\t\t}\n\t\t\t\n\t\t\treturn last;\n\t\t};\n }", "function createRule(selector) {\n var index = styleSheet.cssRules.length;\n styleSheet.insertRule(selector + ' {}', index);\n return styleSheet.cssRules[index];\n}", "loadRule(ruleId, config, severity, options, parser, report) {\n const meta = config.getMetaTable();\n const rule = this.instantiateRule(ruleId, options);\n rule.name = ruleId;\n rule.init(parser, report, severity, meta);\n /* call setup callback if present */\n if (rule.setup) {\n rule.setup();\n }\n return rule;\n }", "function Rule () {\n this.continue = false;\n\tthis.filters = [];\n\tthis.modifiers = [];\n\tthis.codeLines = [];\n\n\tthis.match = function (item) {\n\t\treturn this.filters.every( function (filter) { return filter.match( item ); } );\n\t}\n\n\tthis.applyTo = function (item) {\n\t\tthis.modifiers.forEach( function (modifier) { modifier.applyTo( item ); } );\n\t}\n}", "makeRecurrence(rule) {\n const event = this.eventRecord,\n eventCopy = event.copy();\n let recurrence = event.recurrence;\n\n if (!rule && recurrence) {\n recurrence = recurrence.copy();\n } else {\n recurrence = new event.recurrenceModel({\n rule\n });\n } // bind cloned recurrence to the cloned event\n\n recurrence.timeSpan = eventCopy; // update cloned event w/ start date from the UI field\n\n eventCopy.setStartDate(this.values.startDate);\n recurrence.suspendTimeSpanNotifying();\n return recurrence;\n }", "function trigger() {\n let rule\n const ruleType = ruleTypes[this.measure]\n\n // Make sure units and measure is defined and not null\n if (this.units == null || !this.measure) {\n return this\n }\n\n // Error if we don't have a valid ruleType\n if (ruleType !== \"calendar\" && ruleType !== \"interval\") {\n throw new Error(`Invalid measure provided: ${this.measure}`)\n }\n\n // Create the rule\n if (ruleType === \"interval\") {\n if (!this.start) {\n throw new Error(\"Must have a start date set to set an interval!\")\n }\n\n rule = Interval.create(this.units, this.measure)\n }\n\n if (ruleType === \"calendar\") {\n rule = Calendar.create(this.units, this.measure)\n }\n\n // Remove the temporary rule data\n this.units = null\n this.measure = null\n\n if (rule.measure === \"weeksOfMonthByDay\" && !this.hasRule(\"daysOfWeek\")) {\n throw new Error(\"weeksOfMonthByDay must be combined with daysOfWeek\")\n }\n\n // Remove existing rule based on measure\n for (let i = 0; i < this.rules.length; i++) {\n if (this.rules[i].measure === rule.measure) {\n this.rules.splice(i, 1)\n }\n }\n\n this.rules.push(rule)\n return this\n}", "create(argv) {\n const resourceRule = argv.strategy_resource ?\n argv.strategy_resource : \"./resource/never\";\n\n return require(resourceRule);\n }", "function RuleOption(opt){\n\tthis.suffix = opt.suffix;\n\tthis.name = opt.name;\n\tthis.ruleType = opt.ruleType;\n\tthis.validate = opt.validate || function(vCtx){\n\t\treturn true\n\t};\n\t\n\truleOptions[this.suffix] = this;\n\truleOptions[this.name] = this;\t\n}", "get rule() {\n\t\treturn this.__rule;\n\t}", "get rule() {\n\t\treturn this.__rule;\n\t}", "function Pattern(name, listed, describe, rules) {\n this.name = name;\n this.listed = listed;\n this.describe = describe;\n this.rules = rules;\n }", "function FooRule() {\n}", "function Ruleset() {\n\n // Hold a tree of rules\n this.rules = [];\n }", "function Pattern(name, listed, describe, rules) {\r\n this.name = name;\r\n this.listed = listed;\r\n this.describe = describe;\r\n this.rules = rules;\r\n }", "addRule(name, def) {\r\n this.rules[name] = Renderer.convertTemplate(def);\r\n }", "rule(r) { return this.rules[r] }" ]
[ "0.68356055", "0.6653184", "0.65755916", "0.64988756", "0.6485865", "0.6473794", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.64504606", "0.6325255", "0.6288921", "0.6207557", "0.61734235", "0.6164909", "0.61511165", "0.5944397", "0.59429896", "0.594144", "0.5869456", "0.58078146", "0.58078146", "0.58069164", "0.57637817", "0.57637817", "0.5745211", "0.5697931", "0.56709", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.56105053", "0.5604279", "0.55647653", "0.55647653", "0.55647653", "0.5482269", "0.5382983", "0.5344111", "0.532091", "0.5300546", "0.5240227", "0.52255243", "0.52138007", "0.5211635", "0.5191994", "0.5189294", "0.513933", "0.51212615", "0.5121034", "0.5121034", "0.511343", "0.51128745", "0.5107809", "0.50966614", "0.50894946", "0.508892" ]
0.5770457
52
Converts a Rule to CSS string.
function toCss(selector, style, options) { if (options === void 0) { options = {}; } var result = ''; if (!style) return result; var _options = options, _options$indent = _options.indent, indent = _options$indent === void 0 ? 0 : _options$indent; var fallbacks = style.fallbacks; if (selector) indent++; // Apply fallbacks first. if (fallbacks) { // Array syntax {fallbacks: [{prop: value}]} if (Array.isArray(fallbacks)) { for (var index = 0; index < fallbacks.length; index++) { var fallback = fallbacks[index]; for (var prop in fallback) { var value = fallback[prop]; if (value != null) { if (result) result += '\n'; result += "" + indentStr(prop + ": " + toCssValue(value) + ";", indent); } } } } else { // Object syntax {fallbacks: {prop: value}} for (var _prop in fallbacks) { var _value = fallbacks[_prop]; if (_value != null) { if (result) result += '\n'; result += "" + indentStr(_prop + ": " + toCssValue(_value) + ";", indent); } } } } for (var _prop2 in style) { var _value2 = style[_prop2]; if (_value2 != null && _prop2 !== 'fallbacks') { if (result) result += '\n'; result += "" + indentStr(_prop2 + ": " + toCssValue(_value2) + ";", indent); } } // Allow empty style in this case, because properties will be added dynamically. if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined. if (!selector) return result; indent--; if (result) result = "\n" + result + "\n"; return indentStr(selector + " {" + result, indent) + indentStr('}', indent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toCSSDeclaration(prop, val) {\n var props = toCSSProps(prop);\n for (var i = 0, ii = props.length; i < ii; ++i) {\n props[i] += \": \"+val+\";\";\n }\n return props.join(\"\");\n }", "toString(): string {\n if (Array.isArray(this.style)) {\n let str = ''\n for (let index = 0; index < this.style.length; index++) {\n str += toCss(this.selector, this.style[index])\n if (this.style[index + 1]) str += '\\n'\n }\n return str\n }\n\n return toCss(this.selector, this.style)\n }", "function evaluateStyleRule(styleProperty_)\n{\n\treturn styleProperty_.name + \": \" + styleProperty_.value;\n}", "function cssToStr(cssProps){var statements=[];$.each(cssProps,function(name,val){if(val!=null){statements.push(name+':'+val);}});return statements.join(';');}", "function toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n }", "function toCss(selector, style, options) {\n if (options === void 0) options = {\n };\n var result = '';\n if (!style) return result;\n var _options = options, _options$indent = _options.indent, indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) for(var index = 0; index < fallbacks.length; index++){\n var fallback = fallbacks[index];\n for(var prop in fallback){\n var value = fallback[prop];\n if (value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n else // Object syntax {fallbacks: {prop: value}}\n for(var _prop in fallbacks){\n var _value = fallbacks[_prop];\n if (_value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n for(var _prop2 in style){\n var _value2 = style[_prop2];\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n}", "function toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += '\\n';\n result += indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += '\\n';\n result += indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n}", "function toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += '\\n';\n result += indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += '\\n';\n result += indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n}", "function toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += '\\n';\n result += indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += '\\n';\n result += indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n}", "function toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += '\\n';\n result += indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += '\\n';\n result += indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n}", "function toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n\n if (options.format === false) {\n indent = -Infinity;\n }\n\n var _getWhitespaceSymbols = getWhitespaceSymbols(options),\n linebreak = _getWhitespaceSymbols.linebreak,\n space = _getWhitespaceSymbols.space;\n\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += linebreak;\n result += indentStr(prop + \":\" + space + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += linebreak;\n result += indentStr(_prop + \":\" + space + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += linebreak;\n result += indentStr(_prop2 + \":\" + space + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\" + linebreak + result + linebreak;\n return indentStr(\"\" + selector + space + \"{\" + result, indent) + indentStr('}', indent);\n}", "stringifyRule(){\n\t\tvar rule = this.getRule(),\n\t\t\trule_str = [],\n\t\t\tstart_date = this.getStartDate(),\n\t\t\tend_date = this.getEndDate();\n\n\t\t_.each(rule,function(val,key){\n\t\t\tswitch(key){\n\t\t\t\tcase 'days_of_week':\n\t\t\t\t\tif (val.length)\n\t\t\t\t\t\trule_str.push('BYDAY='+val.join());\n\t\t\t\tbreak;\n\t\t\t\tcase 'exdate':\n\t\t\t\t\tif (val.length)\n\t\t\t\t\t\trule_str.push('EXDATE='+val.join());\n\t\t\t\tbreak;\n\t\t\t\tcase 'freq':\n\t\t\t\t\trule_str.push('FREQ='+val.toUpperCase());\n\t\t\t\tbreak;\n\t\t\t\tcase 'interval':\n\t\t\t\t\tif (val!==null)\n\t\t\t\t\t\trule_str.push('INTERVAL='+val);\n\t\t\t\tbreak;\n\t\t\t\tcase 'count':\n\t\t\t\t\tif (val!==null)\n\t\t\t\t\t\trule_str.push('COUNT='+val);\n\t\t\t\tbreak;\n\t\t\t\tcase 'day_of_month':\n\t\t\t\t\tif (val!==null)\n\t\t\t\t\t\trule_str.push('BYMONTHDAY='+val);\n\t\t\t\tbreak;\n\t\t\t\tcase 'month':\n\t\t\t\t\tif (val!==null)\n\t\t\t\t\t\trule_str.push('BYMONTH='+val);\n\t\t\t\tbreak;\n\t\t\t\tcase 'set_pos':\n\t\t\t\t\tif (val!==null)\n\t\t\t\t\t\trule_str.push('BYSETPOS='+val);\n\t\t\t\tbreak;\n\t\t\t\tcase 'start_of_week':\n\t\t\t\t\tif (val!==null)\n\t\t\t\t\t\trule_str.push('WKST='+val.toUpperCase());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\n\t\tif (start_date)\n\t\t\trule_str.push('DTSTART='+start_date.toISOString());\n\n\t\tif (end_date)\n\t\t\trule_str.push('UNTIL='+end_date.toISOString());\n\n\t\treturn rule_str.join(';');\n\t}", "function get_rendered_style(elm, css_rule_str){\n\tvar str_val = \"\";\n\tif(document.defaultView && document.defaultView.getComputedStyle){\n\t\tstr_val = document.defaultView.getComputedStyle(elm, \"\").getPropertyValue(css_rule_str);\n\t}\n\telse if(elm.currentStyle){\n // Catch errors for unsupported browsers (IE <= 5.0)\n try {\n css_rule_str = css_rule_str.replace(/\\-(\\w)/g,\n function (strMatch, p1) {\n return p1.toUpperCase();\n });\n str_val = elm.currentStyle[css_rule_str];\n }\n catch(e) { /* In this case, return \"\" */ }\n\t}\n\treturn str_val;\n}", "function cssToStr(cssProps) {\n var statements = [];\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n return statements.join(';');\n}", "function cssToStr(cssProps) {\n var statements = [];\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n return statements.join(';');\n}", "function cssToStr(cssProps) {\n var statements = [];\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n return statements.join(';');\n}", "function cssToStr(cssProps) {\n var statements = [];\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n return statements.join(';');\n}", "function cssToStr(cssProps) {\n var statements = [];\n\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n\n return statements.join(';');\n }", "function cssFor() {\n for (var _len7 = arguments.length, rules = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n rules[_key7] = arguments[_key7];\n }\n\n rules = (0, _clean2.default)(rules);\n return rules ? rules.map(function (r) {\n var style = { label: [] };\n build(style, { src: r }); // mutative! but worth it.\n return deconstructedStyleToCSS(hashify(style), deconstruct(style)).join('');\n }).join('') : '';\n}", "function cssFor() {\n for (var _len7 = arguments.length, rules = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n rules[_key7] = arguments[_key7];\n }\n\n rules = (0, _clean2.default)(rules);\n return rules ? rules.map(function (r) {\n var style = { label: [] };\n build(style, { src: r }); // mutative! but worth it.\n return deconstructedStyleToCSS(hashify(style), deconstruct(style)).join('');\n }).join('') : '';\n}", "function cssFor() {\n for (var _len7 = arguments.length, rules = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n rules[_key7] = arguments[_key7];\n }\n\n rules = (0, _clean2.default)(rules);\n return rules ? rules.map(function (r) {\n var style = { label: [] };\n build(style, { src: r }); // mutative! but worth it.\n return deconstructedStyleToCSS(hashify(style), deconstruct(style)).join('');\n }).join('') : '';\n}", "function cssFor() {\n for (var _len7 = arguments.length, rules = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n rules[_key7] = arguments[_key7];\n }\n\n rules = (0, _clean2.default)(rules);\n return rules ? rules.map(function (r) {\n var style = { label: [] };\n build(style, { src: r }); // mutative! but worth it.\n return deconstructedStyleToCSS(hashify(style), deconstruct(style)).join('');\n }).join('') : '';\n}", "function cssFor() {\n for (var _len7 = arguments.length, rules = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n rules[_key7] = arguments[_key7];\n }\n\n rules = (0, _clean2.default)(rules);\n return rules ? rules.map(function (r) {\n var style = { label: [] };\n build(style, { src: r }); // mutative! but worth it.\n return deconstructedStyleToCSS(hashify(style), deconstruct(style)).join('');\n }).join('') : '';\n}", "function cssFor() {\n for (var _len7 = arguments.length, rules = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n rules[_key7] = arguments[_key7];\n }\n\n rules = (0, _clean2.default)(rules);\n return rules ? rules.map(function (r) {\n var style = { label: [] };\n build(style, { src: r }); // mutative! but worth it.\n return deconstructedStyleToCSS(hashify(style), deconstruct(style)).join('');\n }).join('') : '';\n}", "function cssToStr(cssProps) {\n var statements = [];\n\n for (var name in cssProps) {\n var val = cssProps[name];\n\n if (val != null && val !== '') {\n statements.push(name + ':' + val);\n }\n }\n\n return statements.join(';');\n }", "function toDynamicRule(rule) {\n // media query, font face, etc can only be applied when rendering\n if (rule.type === 'atrule')\n return importantizeAtRule(rule);\n\n if (rule.type === 'rule') {\n const selectors = getDynamicSelectors(rule);\n if (selectors.length > 0)\n return importantizeRule(rule.clone({ selectors }));\n }\n\n // Ignore comments and anything else that's not a rule\n return null;\n}", "function getStyle(rule, prop) {\n\t try {\n\t return rule.style.getPropertyValue(prop);\n\t } catch (err) {\n\t // IE may throw if property is unknown.\n\t return '';\n\t }\n\t}", "function cssToStr(cssProps) {\n var statements = [];\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n return statements.join(';');\n}", "function cssFor() {\n for (var _len8 = arguments.length, rules = Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n rules[_key8] = arguments[_key8];\n }\n\n rules = (0, _clean2.default)(rules);\n return rules ? rules.map(function (r) {\n var style = { label: [] };\n build(style, { src: r }); // mutative! but worth it. \n return deconstructedStyleToCSS(hashify(style), deconstruct(style)).join('');\n }).join('') : '';\n}", "function buildRuleString(ruleId){\n let rule = allRules[ruleId];\n //console.log(rule);\n while(rule.match(/\\d+/g)){\n const otherRuleIds = rule.match(/\\d+/g);\n otherRuleIds.forEach(otherRuleId => rule = rule.replace(otherRuleId, allRules[otherRuleId]));\n }\n allRules[ruleId] = rule;\n return allRules[ruleId];\n}", "function cssToStr(cssProps) {\n var statements = [];\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n return statements.join(';');\n }", "function cssToStr(cssProps) {\n var statements = [];\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n return statements.join(';');\n }", "function cssToStr(cssProps) {\n var statements = [];\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n return statements.join(';');\n }", "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "function cssToStr(cssProps) {\n\t\tvar statements = [];\n\n\t\t$.each(cssProps, function(name, val) {\n\t\t\tif (val != null) {\n\t\t\t\tstatements.push(name + ':' + val);\n\t\t\t}\n\t\t});\n\n\t\treturn statements.join(';');\n\t}", "function format(rules) {\n return rules.map(formatRule).join(\"\\n\")\n}", "function getStyle(rule, prop) {\n try {\n return rule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "function getStyle(rule, prop) {\n try {\n return rule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "insertRule(rule, opts = this.opts) {\n\t\t// save so we know what to delete if this#deleteRule is called\n\t\tconst {cssRules: {length}} = this.DOMStyleElement.sheet;\n\t\tthis.rules.push(rule);\n\t\tthis.ruleLengthCache[rule.className] = [length, rule.numRules];\n\n\t\tconst cachedRule = this.getCachedRule(rule.hash);\n\n\t\t// TODO: make this kind of thing middleware?\n\t\tlet className;\n\t\tif (!cachedRule) {\n\t\t\tthis.keyedRules[rule.hash] = rule;\n\t\t\t// className = cachedRule.incSpec(rule.className);\n\t\t}\n\n\t\treturn rule.className;\n\t}", "getCssString() {\n const text = fs.readFileSync(\"./src/hero.css\", 'utf8');\n return (text.replace(/\\s+/g, ' '));\n }", "toString(options) {\n const {sheet} = this.options\n const link = sheet ? sheet.options.link : false\n const opts = link ? {...options, allowEmpty: true} : options\n return toCss(this.key, this.style, opts)\n }", "function addCSS(rule) {\r\n\tvar styleElement = document.createElement(\"style\");\r\n\tstyleElement.type = \"text/css\";\r\n\tif (typeof styleElement.styleSheet !== 'undefined')\r\n\t\tstyleElement.styleSheet.cssText = rule;\r\n\telse\r\n\t\tstyleElement.appendChild(document.createTextNode(rule));\r\n\tdocument.getElementsByTagName(\"head\")[0].appendChild(styleElement);\r\n\t}", "function getStyle(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "function getStyle(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "function ruleAsMarkdown(rule) {\n let markdown = `## Rule: ${asUrl(rule)}\\n\\n`;\n let targetEnumeration = \"\";\n if (hasPublic$1(rule)) {\n targetEnumeration += \"- Everyone\\n\";\n }\n if (hasAuthenticated$1(rule)) {\n targetEnumeration += \"- All authenticated agents\\n\";\n }\n if (hasCreator$1(rule)) {\n targetEnumeration += \"- The creator of this resource\\n\";\n }\n if (hasAnyClient$1(rule)) {\n targetEnumeration += \"- Users of any client application\\n\";\n }\n const targetAgents = getAgentAll$1(rule);\n if (targetAgents.length > 0) {\n targetEnumeration += \"- The following agents:\\n - \";\n targetEnumeration += `${targetAgents.join(\"\\n - \")}\\n`;\n }\n const targetGroups = getGroupAll(rule);\n if (targetGroups.length > 0) {\n targetEnumeration += \"- Members of the following groups:\\n - \";\n targetEnumeration += `${targetGroups.join(\"\\n - \")}\\n`;\n }\n const targetClients = getClientAll$1(rule);\n if (targetClients.length > 0) {\n targetEnumeration += \"- Users of the following client applications:\\n - \";\n targetEnumeration += `${targetClients.join(\"\\n - \")}\\n`;\n }\n markdown += targetEnumeration.length > 0 ? `This rule applies to:\\n${targetEnumeration}` : \"<empty>\\n\";\n return markdown;\n}", "function addCSS(rule) {\n\tvar styleElement = document.createElement(\"style\");\n\tstyleElement.type = \"text/css\";\n\tif (typeof styleElement.styleSheet !== 'undefined')\n\t\tstyleElement.styleSheet.cssText = rule;\n\telse\n\t\tstyleElement.appendChild(document.createTextNode(rule));\n\tdocument.getElementsByTagName(\"head\")[0].appendChild(styleElement);\n\t}", "function convertStylesToInline()\n{\n var stylestring = new String();\n for (var j = 0; j < document.styleSheets.length; j++)\n {\n\tvar intermediateString = '';\n\tvar rules = document.styleSheets[j].rules;\n\tvar rulesLength = rules.length;\n\t\n for (var i = 0; i < rulesLength; i++)\n {\n intermediateString += rules[i].selectorText + ' {' + rules[i].style.cssText + '}'\n }\n \n stylestring += intermediateString;\n }\n return(stylestring);\n}", "get cssText(){\n\t\tvar properties = [];\n\t\tfor (var i=0, length=this.length; i < length; ++i) {\n\t\t\tvar name = this[i];\n\t\t\tvar value = this.getPropertyValue(name);\n\t\t\tvar priority = this.getPropertyPriority(name);\n\t\t\tif (priority) {\n\t\t\t\tpriority = \" !\" + priority;\n\t\t\t}\n\t\t\tproperties[i] = name + \": \" + value + priority + \";\";\n\t\t}\n\t\treturn properties.join(\" \");\n\t}", "get cssText(){\n\t\tvar properties = [];\n\t\tfor (var i=0, length=this.length; i < length; ++i) {\n\t\t\tvar name = this[i];\n\t\t\tvar value = this.getPropertyValue(name);\n\t\t\tvar priority = this.getPropertyPriority(name);\n\t\t\tif (priority) {\n\t\t\t\tpriority = \" !\" + priority;\n\t\t\t}\n\t\t\tproperties[i] = name + \": \" + value + priority + \";\";\n\t\t}\n\t\treturn properties.join(\" \");\n\t}", "get cssText(){\n var properties = [];\n for (var i=0, length=this.length; i < length; ++i) {\n var name = this[i];\n var value = this.getPropertyValue(name);\n var priority = this.getPropertyPriority(name);\n if (priority) {\n priority = \" !\" + priority;\n }\n properties[i] = name + \": \" + value + priority + \";\";\n }\n return properties.join(\" \")\n }", "function thematic() {\n var options = this.options;\n var rule = repeat(options.rule, options.ruleRepetition);\n return options.ruleSpaces ? rule.split('').join(' ') : rule;\n}", "function cssToStr(cssProps) {\n var statements = [];\n\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n\n return statements.join(';');\n } // Given an object hash of HTML attribute names to values,", "function $EiDS$var$cssFor() {\n for (var _len7 = arguments.length, rules = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n rules[_key7] = arguments[_key7];\n }\n\n rules = (0, $EiDS$var$_clean2.default)(rules);\n return rules ? rules.map(function (r) {\n var style = {\n label: []\n };\n $EiDS$var$build(style, {\n src: r\n }); // mutative! but worth it.\n\n return $EiDS$var$deconstructedStyleToCSS($EiDS$var$hashify(style), $EiDS$var$deconstruct(style)).join('');\n }).join('') : '';\n}", "function getStyle(oElm, strCssRule) {\n var strValue = \"\";\n if (document.defaultView && document.defaultView.getComputedStyle) {\n strValue = document.defaultView.getComputedStyle(oElm, \"\").getPropertyValue(strCssRule);\n } else if (oElm.currentStyle) {\n strCssRule = strCssRule.replace(/\\-(\\w)/g, function(strMatch, p1) {\n return p1.toUpperCase();\n });\n strValue = oElm.currentStyle[strCssRule];\n }\n return strValue;\n}", "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n }", "get cssText() {\n var properties = [];\n for (var i = 0, length = this.length; i < length; ++i) {\n var name = this[i];\n var value = this.getPropertyValue(name);\n var priority = this.getPropertyPriority(name);\n if (priority) {\n priority = \" !\" + priority;\n }\n properties[i] = name + \": \" + value + priority + \";\";\n }\n return properties.join(\" \");\n }", "function getStyle(oElm, strCssRule) {\n\t\tvar strValue = \"\";\n\t\tif (document.defaultView && document.defaultView.getComputedStyle) {\n\t\t\tstrValue = document.defaultView.getComputedStyle(oElm, \"\").getPropertyValue(strCssRule);\n\t\t} else if (oElm.currentStyle) {\n\t\t\tstrCssRule = strCssRule.replace(/\\-(\\w)/g, function (strMatch, p1) {\n\t\t\t\treturn p1.toUpperCase();\n\t\t\t});\n\t\t\tstrValue = oElm.currentStyle[strCssRule];\n\t\t}\n\t\treturn strValue;\n\t}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n }", "function getStyle(oElm, strCssRule){\r\n var strValue = \"\";\r\n if(document.defaultView && document.defaultView.getComputedStyle){\r\n strValue = document.defaultView.getComputedStyle(oElm, \"\").getPropertyValue(strCssRule);\r\n }\r\n else if(oElm.currentStyle){\r\n strCssRule = strCssRule.replace(/\\-(\\w)/g, function (strMatch, p1){\r\n return p1.toUpperCase();\r\n });\r\n strValue = oElm.currentStyle[strCssRule];\r\n }\r\n return strValue;\r\n}", "function addStyle(rule)\r\n\t{\r\n\t\tif (!style)\r\n\t\t{\r\n\t\t\tstyle = document.createElement('style');\r\n\t\t\tstyle.setAttribute('type', 'text/css')\r\n\t\t\tstyle.setAttribute('id', 'style');\r\n\t\t\t\r\n\t\t\tvar head = document.head || document.getElementsByTagName('head')[0];\r\n\t\t\thead.appendChild(style);\r\n\t\t}\r\n\t\t\r\n\t\tstyle.appendChild(document.createTextNode(rule + \"\\n\"));\r\n\t}", "function linkRule(rule, cssRule) {\n\t rule.renderable = cssRule;\n\t if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n\t}", "function linkRule(rule, cssRule) {\n\t rule.renderable = cssRule;\n\t if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n\t}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}" ]
[ "0.6156099", "0.6117747", "0.5704", "0.5685539", "0.5682971", "0.564685", "0.5641924", "0.5641924", "0.5641924", "0.5641924", "0.56171066", "0.5599794", "0.5595651", "0.552418", "0.552418", "0.552418", "0.552418", "0.55205595", "0.5513249", "0.5513249", "0.5513249", "0.5513249", "0.5513249", "0.5513249", "0.5510726", "0.54907006", "0.5478531", "0.547788", "0.54744315", "0.5472954", "0.5472558", "0.5472558", "0.5472558", "0.5449633", "0.5449633", "0.5449633", "0.5449633", "0.5449633", "0.5449633", "0.5449633", "0.5449633", "0.5433809", "0.5426922", "0.54005307", "0.54005307", "0.5399648", "0.53812486", "0.53758043", "0.5353101", "0.53375477", "0.53375477", "0.53340507", "0.5329462", "0.5303", "0.5256695", "0.5256695", "0.5240126", "0.52341795", "0.5210617", "0.51789397", "0.5177258", "0.51753074", "0.5157826", "0.5151146", "0.5134694", "0.51315016", "0.5125498", "0.5125242", "0.5125242", "0.50868374", "0.50868374", "0.50868374", "0.50868374", "0.50868374", "0.50868374", "0.50868374", "0.50868374" ]
0.56349224
31
Rules registry for access by .get() method. It contains the same rule registered by name and by selector. Original styles object. Used to ensure correct rules order.
function RuleList(options) { this.map = {}; this.raw = {}; this.index = []; this.counter = 0; this.options = void 0; this.classes = void 0; this.keyframes = void 0; this.options = options; this.classes = options.classes; this.keyframes = options.keyframes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchStyleRules(ref) {\n var styleRules = ref.styleRules;\n var styleGroupName = ref.styleGroupName;\n var styleGroupPrefix = ref.styleGroupPrefix;\n\n var rule = styleRules.find(function (rule) { return styleGroupName === (styleGroupPrefix + \"_\" + (rule.id)); });\n var name;\n var priority = styleRules.length;\n var tgFilter;\n if (rule) {\n name = rule.name;\n priority = styleRules.findIndex(function (rule) { return styleGroupName === (styleGroupPrefix + \"_\" + (rule.id)); });\n tgFilter = makeFilter(rule); // create the Tangram filter for this style rule\n }\n return { name: name, tgFilter: tgFilter, priority: priority };\n }", "function getRulesForPage(currUrl) {\n // this will contain the combined set of evaluated rules to be applied to the page.\n // longer, more specific URLs get the priority for each selector and property\n var rules = {};\n var url_for_page = '';\n\n for (var url in elements.styles)\n {\n var subUrls = url.split(',');\n var len = subUrls.length;\n var isFound = false;\n\n for (var i = 0; i < len; i++)\n {\n if (currUrl.indexOf(subUrls[i].trim()) != -1) {\n isFound = true;\n break;\n }\n }\n\n if (isFound || url == \"*\")\n {\n if (url.length > url_for_page.length)\n url_for_page = url;\n \n // iterate over each selector in styles\n for (var selector in elements.styles[url]['_rules']) {\n\t\n // if no rule exists for selector, simply copy the rule\n if (rules[selector] == undefined)\n rules[selector] = cloneObject(elements.styles[url]['_rules'][selector]);\n\n // otherwise, iterate over each property\n else {\n for (var property in elements.styles[url]['_rules'][selector])\n {\n if (rules[selector][property] == undefined || url == url_for_page)\n rules[selector][property] = elements.styles[url]['_rules'][selector][property];\n }\n }\n }\n }\n }\n\n if (rules != undefined)\n return {\n rules: rules,\n url: url_for_page\n };\n else\n return {\n rules: null,\n url: null\n };\n}", "regenerateStyleSheet() {\n const rules = [];\n const name = this.constructor.name;\n //get the JSON object of CSS rules\n const userJSONStyles = this.styles();\n initStyleSheet(userJSONStyles, name, rules);\n injectStyles(rules);\n }", "regenerateStyleSheet() {\n const rules = [];\n const name = this.constructor.name;\n //get the JSON object of CSS rules\n const userJSONStyles = this.styles();\n initStyleSheet(userJSONStyles, name, rules);\n injectStyles(rules);\n }", "static getStyleInstances(selector, style) {\n let result = [];\n let ownStyle = {}, haveOwnStyle = false;\n\n for (let key of Object.keys(style)) {\n let value = style[key];\n let isProperValue = (typeof value === \"string\" || value instanceof String\n || typeof value === \"number\" || value instanceof Number\n || typeof value === \"function\");\n if (isProperValue) {\n ownStyle[key] = value;\n haveOwnStyle = true;\n } else {\n // Check that this actually is a valid subselector\n let firstChar = String(key).charAt(0);\n if (!ALLOWED_SELECTOR_STARTS.has(firstChar)) {\n // TODO: Log here?\n console.error(\"Unprocessable style key \", key);\n continue;\n }\n let subStyle = this.getStyleInstances(selector + key, value);\n result.push(...subStyle);\n }\n }\n\n if (haveOwnStyle) {\n result.unshift({selector: selector, style: ownStyle});\n }\n return result;\n }", "function getStyleBySelector(selector) {\n\n var sheets = document.styleSheets;\n var rules, imported, rule, style, s, r, i;\n var isIE = sheets[0].cssRules == undefined;\n\n for (s = sheets.length - 1; s >= 0; s--) {\n rules = isIE ? sheets[s].rules : sheets[s].cssRules;\n\n style = findStyle(rules, selector);\n if (style != null) {\n return style;\n }\n \n rules = isIE ? sheets[s].imports : rules;\n\n for (r = 0; r < rules.length; r++){\n\n var imported;\n if (rules[r].rules != undefined) {\n imported = rules[r].rules;\n\n } else if (rules[r].styleSheet != undefined) {\n imported = rules[r].styleSheet.cssRules;\n\n } else if (document.cookie != undefined && document.cookie.indexOf('mysmartgrid_cookiecontrol') >= 0) {\n window.location = '/webbrowser';\n\n } else {\n return null;\n }\n\n style = findStyle(imported, selector);\n if (style != null) {\n return style;\n }\n }\n }\n return null;\n}", "function getStyleObjectCss(element) {\n var sheets = document.styleSheets, o = {};\n for (var i in sheets) {\n try {\n if (typeof (sheets[i].cssRules) !== 'undefined') {\n var rules = sheets[i].rules || sheets[i].cssRules;\n for (var r in rules) {\n if (element.is(rules[r].selectorText)) {\n o = $.extend(o, css2json(rules[r].style), css2json(element.attr('style')));\n }\n }\n }\n } catch (e) {\n return;\n }\n\n }\n return o;\n }", "function parseRules() {\n\tqueries = {};\n\tvar sheets = document.styleSheets;\n\tvar rules;\n\tfor (var i = 0; i < sheets.length; i++) {\n\t\tif (sheets[i].disabled) {\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\trules = sheets[i].cssRules;\n\t\t}\n\t\tcatch(e) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (var j = 0; j < rules.length; j++) {\n\t\t\tparseRule(rules[j]);\n\t\t}\n\t}\n}", "function getStyleRules(prefix, names) {\n var result = {};\n for (var i = document.styleSheets.length; --i >= 0; ) {\n var ix, sheet = document.styleSheets[i];\n try {\n if (sheet.cssRules !== null) {\n for (ix = sheet.cssRules.length; --ix >= 0;) {\n var selector = sheet.cssRules[ix].selectorText;\n if (selector !== undefined && selector.startsWith(prefix)) {\n var name = selector.replace(prefix, '');\n if (names.indexOf(name) > -1)\n result[name] = sheet.cssRules[ix].style;\n }\n }\n }\n }\n catch(e) {} // stylesheets from other domains sometimes can't be examined, skip\n }\n return result;\n}", "function xGetCSSRules(ss) { return ss.rules ? ss.rules : ss.cssRules; }", "function listSelectors (rule) {\n rule.selectors.forEach((selector) => {\n var $selected = $(selector);\n $selected.each((i, elem) => {\n var $elem = $(elem);\n // identical selectors may appear multiple times\n if ($elem.data(selector)) {\n forEachFiltered.call($elem.data(selector).declarations, 'declaration', rule, mergeDeclarations);\n } else {\n $elem.data(selector, rule);\n }\n });\n // cache elements with style rules\n $styled = $styled.add($selected);\n });\n}", "function createRule(selector) {\n var index = styleSheet.cssRules.length;\n styleSheet.insertRule(selector + ' {}', index);\n return styleSheet.cssRules[index];\n}", "function stylize(cache, selector, styles, list, parent) {\n var _a = parseStyles(styles, !!selector), styleString = _a.styleString, nestedStyles = _a.nestedStyles, isUnique = _a.isUnique;\n var pid = styleString;\n if (selector.charCodeAt(0) === 64 /* @ */) {\n var rule = cache.add(new Rule(selector, parent ? undefined : styleString, cache.hash));\n // Nested styles support (e.g. `.foo > @media > .bar`).\n if (styleString && parent) {\n var style = rule.add(new Style(styleString, rule.hash, isUnique ? \"u\" + (++uniqueId).toString(36) : undefined));\n list.push([parent, style]);\n }\n for (var _i = 0, nestedStyles_1 = nestedStyles; _i < nestedStyles_1.length; _i++) {\n var _b = nestedStyles_1[_i], name = _b[0], value = _b[1];\n pid += name + stylize(rule, name, value, list, parent);\n }\n }\n else {\n var key = parent ? interpolate(selector, parent) : selector;\n if (styleString) {\n var style = cache.add(new Style(styleString, cache.hash, isUnique ? \"u\" + (++uniqueId).toString(36) : undefined));\n list.push([key, style]);\n }\n for (var _c = 0, nestedStyles_2 = nestedStyles; _c < nestedStyles_2.length; _c++) {\n var _d = nestedStyles_2[_c], name = _d[0], value = _d[1];\n pid += name + stylize(cache, name, value, list, key);\n }\n }\n return pid;\n}", "function stylize(cache, selector, styles, list, parent) {\n var _a = parseStyles(styles, !!selector), styleString = _a.styleString, nestedStyles = _a.nestedStyles, isUnique = _a.isUnique;\n var pid = styleString;\n if (selector.charCodeAt(0) === 64 /* @ */) {\n var rule = cache.add(new Rule(selector, parent ? undefined : styleString, cache.hash));\n // Nested styles support (e.g. `.foo > @media > .bar`).\n if (styleString && parent) {\n var style = rule.add(new Style(styleString, rule.hash, isUnique ? \"u\" + (++uniqueId).toString(36) : undefined));\n list.push([parent, style]);\n }\n for (var _i = 0, nestedStyles_1 = nestedStyles; _i < nestedStyles_1.length; _i++) {\n var _b = nestedStyles_1[_i], name = _b[0], value = _b[1];\n pid += name + stylize(rule, name, value, list, parent);\n }\n }\n else {\n var key = parent ? interpolate(selector, parent) : selector;\n if (styleString) {\n var style = cache.add(new Style(styleString, cache.hash, isUnique ? \"u\" + (++uniqueId).toString(36) : undefined));\n list.push([key, style]);\n }\n for (var _c = 0, nestedStyles_2 = nestedStyles; _c < nestedStyles_2.length; _c++) {\n var _d = nestedStyles_2[_c], name = _d[0], value = _d[1];\n pid += name + stylize(cache, name, value, list, key);\n }\n }\n return pid;\n}", "function getStyleRule (cssRules, selectorText) {\n let len = cssRules.length;\n let i;\n for (let j=0 ; j<len ; j++) {\n\ti = cssRules[j];\n\tif (i.selectorText == selectorText) {\n\t return(i);\n\t}\n }\n}", "createRule(name, style, options) {\n options = {\n ...options,\n sheet: this,\n jss: this.options.jss,\n Renderer: this.options.Renderer\n }\n // Scope options overwrite instance options.\n if (options.named == null) options.named = this.options.named\n const rule = createRule(name, style, options)\n // Register conditional rule, it will stringify it's child rules properly.\n if (rule.type === 'conditional') {\n this.rules[rule.selector] = rule\n }\n // This is a rule which is a child of a condtional rule.\n // We need to register its class name only.\n else if (rule.options.parent && rule.options.parent.type === 'conditional') {\n // Only named rules should be referenced in `classes`.\n if (rule.options.named) this.classes[name] = rule.className\n }\n else {\n this.rules[rule.selector] = rule\n if (options.named) {\n this.rules[name] = rule\n this.classes[name] = rule.className\n }\n }\n options.jss.plugins.run(rule)\n return rule\n }", "function getRules()\n{\n\treturn ruleObj;\n}", "readStyles(styles) {\n let add = Mark$1.none, remove = Mark$1.none;\n style:\n for (let i = 0; i < styles.length; i += 2) {\n for (let after = void 0; ; ) {\n let rule = this.parser.matchStyle(styles[i], styles[i + 1], this, after);\n if (!rule)\n continue style;\n if (rule.ignore)\n return null;\n if (rule.clearMark) {\n this.top.pendingMarks.forEach((m) => {\n if (rule.clearMark(m))\n remove = m.addToSet(remove);\n });\n } else {\n add = this.parser.schema.marks[rule.mark].create(rule.attrs).addToSet(add);\n }\n if (rule.consuming === false)\n after = rule;\n else\n break;\n }\n }\n return [add, remove];\n }", "function getCssRule(selector) {\n\t\tvar rule;\n\t\tfor (var i = 0; i < document.styleSheets.length && rule === undefined; i++) {\n\t\t\tvar css = document.styleSheets[i];\n\t\t\tvar rules = css.rules;\n\t\t\tif (rules) {\n\t\t\t\tfor (var j = 0; j < rules.length && rule === undefined; j++) {\n\t\t\t\t\tif (rules[j].selectorText && rules[j].selectorText === selector) rule = rules[j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!rule) {\n\t\t\tdocument.styleSheets[0].insertRule(selector + \" { }\", 1);\n\t\t\treturn getCssRule(selector);\n\t\t}\n\t\treturn rule;\n\t}", "function css(jqueryElement) {\n if (!jqueryElement || jqueryElement.length == 0) {\n throw \"Element is missing!\";\n }\n\n var sheets = document.styleSheets;\n var result = {};\n\n for (var i in sheets) {\n var rules = sheets[i].rules || sheets[i].cssRules;\n\n for (var rule in rules) {\n if (jqueryElement.is(rules[rule].selectorText)) { //matches to css selector (true)\n //result = $.extend(result, css2json(rules[rule].style), css2json(jqueryElement.attr('style')));\n result = $.extend(result, rules[rule].style, jqueryElement.attr('style'));\n }\n }\n }\n\n return result;\n}", "function getAllStyles() {\n var styles = _elm_lang$core$Native_List.Nil\n for (var value of stylesCache.values()) {\n styles = _elm_lang$core$Native_List.Cons(value, styles)\n }\n return styles\n }", "get styleSheet() {\n let styleSheet = this._styleSheet;\n const strings = this._strings;\n if (supportsAdoptingStyleSheets && styleSheet === void 0) {\n const cacheable = strings !== void 0 && strings.length === 1;\n if (cacheable) {\n styleSheet = cssTagCache.get(strings);\n }\n if (styleSheet === void 0) {\n (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(this.cssText);\n if (cacheable) {\n cssTagCache.set(strings, styleSheet);\n }\n }\n }\n return styleSheet;\n }", "function applyRule(rule, style) {\n var values = rule.values,\n names = rule.names;\n for (var ndx = 0; ndx < names.length; ++ndx) {\n style[names[ndx]] = values[ndx];\n }\n}", "_scopeSelectors(cssText, scopeSelector, hostSelector) {\n return processRules(cssText, (rule) => {\n let selector = rule.selector;\n let content = rule.content;\n if (rule.selector[0] != '@') {\n selector =\n this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);\n }\n else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||\n rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {\n content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);\n }\n else if (rule.selector.startsWith('@font-face')) {\n content = this._stripScopingSelectors(rule.content, scopeSelector, hostSelector);\n }\n return new CssRule(selector, content);\n });\n }", "_scopeSelectors(cssText, scopeSelector, hostSelector) {\n return processRules(cssText, (rule) => {\n let selector = rule.selector;\n let content = rule.content;\n if (rule.selector[0] != '@') {\n selector =\n this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);\n }\n else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||\n rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {\n content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);\n }\n else if (rule.selector.startsWith('@font-face')) {\n content = this._stripScopingSelectors(rule.content, scopeSelector, hostSelector);\n }\n return new CssRule(selector, content);\n });\n }", "_scopeSelectors(cssText, scopeSelector, hostSelector) {\n return processRules(cssText, (rule) => {\n let selector = rule.selector;\n let content = rule.content;\n if (rule.selector[0] != '@') {\n selector =\n this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);\n }\n else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||\n rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {\n content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);\n }\n return new CssRule(selector, content);\n });\n }", "_scopeSelectors(cssText, scopeSelector, hostSelector) {\n return processRules(cssText, (rule) => {\n let selector = rule.selector;\n let content = rule.content;\n if (rule.selector[0] != '@') {\n selector =\n this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);\n }\n else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||\n rule.selector.startsWith('@page') || rule.selector.startsWith('@document')) {\n content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);\n }\n return new CssRule(selector, content);\n });\n }", "function composeStylize(cache, pid, rulesList, stylesList, className, isStyle) {\n for (const { selector, style, isUnique } of stylesList) {\n const key = isStyle ? interpolate(selector, className) : selector;\n const id = isUnique\n ? `u\\0${(++uniqueId).toString(36)}`\n : `s\\0${pid}\\0${style}`;\n const item = new Style(style, id);\n item.add(new Selector(key, `k\\0${pid}\\0${key}`));\n cache.add(item);\n }\n for (const { selector, style, rules, styles } of rulesList) {\n const item = new Rule(selector, style, `r\\0${pid}\\0${selector}\\0${style}`);\n composeStylize(item, pid, rules, styles, className, isStyle);\n cache.add(item);\n }\n}", "function composeStylize(cache, pid, rulesList, stylesList, className, isStyle) {\n for (const { selector, style, isUnique } of stylesList) {\n const key = isStyle ? interpolate(selector, className) : selector;\n const id = isUnique\n ? `u\\0${(++uniqueId).toString(36)}`\n : `s\\0${pid}\\0${style}`;\n const item = new Style(style, id);\n item.add(new Selector(key, `k\\0${pid}\\0${key}`));\n cache.add(item);\n }\n for (const { selector, style, rules, styles } of rulesList) {\n const item = new Rule(selector, style, `r\\0${pid}\\0${selector}\\0${style}`);\n composeStylize(item, pid, rules, styles, className, isStyle);\n cache.add(item);\n }\n}", "function aCSS(r,def) {\n\tvar sss=document.styleSheets;\n\tif (sss){\n\t\tfor (var i = sss.length - 1; i >= 0; i--){\n\t\t\t/* Firefox will throw a SecurityError exception when accessing cssRules or \n\t\t\t * calling insertRule for a styleSheet from another domain! Check href==null \n\t\t\t * to avoid this. \n\t\t\t * If more than one CSS rule matches with same specificity, the last one wins. \n\t\t\t * So use the last stylesheet that is valid, and add to the end of the rules.\n\t\t\t */\n\t\t\tif (sss[i].href == null) {\n\t\t\t\tvar rules = (sss[i].cssRules || sss[i].rules); \n\t\t\t\tif (rules) {\n\t\t\t\t\tfor (var j=rules.length - 1; j>=0; j--) {\n\t\t\t\t\t\tvar rule = rules[j];\n\t\t\t\t\t\tif (rule.selectorText == r) {\n\t\t\t\t\t\t\t/* alert(\"at rule \" + j + \" sheet \" + i + \" deleting '\" + rule.selectorText + \"'\"); */\n\t\t\t\t\t\t\t/* Technically it's not even necessary to delete the old rule, since it'll get superceded by the later one,\n\t\t\t\t\t\t\t * but this helps avoid memory leaks at the expense of a bit more CPU.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tsss[i].deleteRule(j);\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\tvar pos = rules.length;\n\t\t\t\t\tif (sss[i].addRule){ /* IE + cHrome */\n\t\t\t\t\t\tsss[i].addRule(r,def,pos);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse if (sss[i].insertRule){ /* FF + Chrome + IE 9 */ \n\t\t\t\t\t\tsss[i].insertRule(r+'{'+def+'}',pos);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function composeStyles(container, selector, styles, isStyle, displayName) {\n var cache = new Cache(container.hash);\n var list = [];\n var pid = stylize(cache, selector, styles, list);\n var hash = \"f\" + cache.hash(pid);\n var id = displayName ? displayName + \"_\" + hash : hash;\n for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {\n var _a = list_1[_i], selector_1 = _a[0], style = _a[1];\n var key = isStyle ? interpolate(selector_1, \".\" + exports.escape(id)) : selector_1;\n style.add(new Selector(key, style.hash, undefined, pid));\n }\n return { cache: cache, pid: pid, id: id };\n}", "function composeStyles(container, selector, styles, isStyle, displayName) {\n var cache = new Cache(container.hash);\n var list = [];\n var pid = stylize(cache, selector, styles, list);\n var hash = \"f\" + cache.hash(pid);\n var id = displayName ? displayName + \"_\" + hash : hash;\n for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {\n var _a = list_1[_i], selector_1 = _a[0], style = _a[1];\n var key = isStyle ? interpolate(selector_1, \".\" + id) : selector_1;\n style.add(new Selector(key, style.hash, undefined, pid));\n }\n return { cache: cache, pid: pid, id: id };\n}", "function StyleRegistry(){\r\n this._collection = Object.create(null, {});\r\n}", "function addStyle(selector, rules){ return addPageStyle(selector, rules);}", "static get styles() {\n return styles;\n }", "function createCSSSelector( name, rules ){\n var style = document.createElement('style');\n style.type = 'text/css';\n document.getElementsByTagName('head')[0].appendChild(style);\n if ( !(style.sheet || {}).insertRule )\n (style.styleSheet || style.sheet).addRule(name, rules);\n else\n style.sheet.insertRule(name + \"{\" + rules + \"}\", 0);\n }", "function getDynamicStyles(styles) {\n\t var to = null;\n\t\n\t for (var key in styles) {\n\t var value = styles[key];\n\t var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\t\n\t if (type === 'function') {\n\t if (!to) to = {};\n\t to[key] = value;\n\t } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n\t var extracted = getDynamicStyles(value);\n\t if (extracted) {\n\t if (!to) to = {};\n\t to[key] = extracted;\n\t }\n\t }\n\t }\n\t\n\t return to;\n\t}", "function registerUserRule(container, selector, styles) {\n\t var _a = parseUserStyles(styles, false), properties = _a.properties, nestedStyles = _a.nestedStyles;\n\t // Throw when using properties and nested styles together in rule.\n\t if (properties.length && nestedStyles.length) {\n\t throw new TypeError(\"Registering a CSS rule can not use properties with nested styles\");\n\t }\n\t var styleString = stringifyProperties(properties);\n\t var rule = container.add(new Rule(selector, styleString, container.hash));\n\t for (var _i = 0, nestedStyles_2 = nestedStyles; _i < nestedStyles_2.length; _i++) {\n\t var _b = nestedStyles_2[_i], name_2 = _b[0], value = _b[1];\n\t registerUserRule(rule, name_2, value);\n\t }\n\t}", "function getStyles(el, arguments){\r\n var ret = {};\r\n total = arguments.length ;\r\n for (var n=0; n<total; n++ )\r\n ret[ arguments[n] ] = el.getStyle(arguments[n]); \r\n return ret;\r\n }", "function getDynamicStyles(styles) {\n var to = null;\n for(var key in styles){\n var value = styles[key];\n var type = typeof value;\n if (type === 'function') {\n if (!to) to = {\n };\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {\n };\n to[key] = extracted;\n }\n }\n }\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n }", "get styleSheet() {\n if (this._styleSheet === undefined) {\n // Note, if `adoptedStyleSheets` is supported then we assume CSSStyleSheet\n // is constructable.\n if (supportsAdoptingStyleSheets) {\n this._styleSheet = new CSSStyleSheet();\n this._styleSheet.replaceSync(this.cssText);\n }\n else {\n this._styleSheet = null;\n }\n }\n return this._styleSheet;\n }", "function jssGlobal() {\n function onCreateRule(name, styles, options) {\n if (!name) return null;\n\n if (name === at) {\n return new GlobalContainerRule(name, styles, options);\n }\n\n if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {\n return new GlobalPrefixedRule(name, styles, options);\n }\n\n var parent = options.parent;\n\n if (parent) {\n if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {\n options.scoped = false;\n }\n }\n\n if (!options.selector && options.scoped === false) {\n options.selector = name;\n }\n\n return null;\n }\n\n function onProcessRule(rule, sheet) {\n if (rule.type !== 'style' || !sheet) return;\n handleNestedGlobalContainerRule(rule, sheet);\n handlePrefixedGlobalRule(rule, sheet);\n }\n\n return {\n onCreateRule: onCreateRule,\n onProcessRule: onProcessRule\n };\n}", "function iterateStyleRules(argument) {\n if (typeof argument === 'string') {\n checkStyleExistence(styleDefinitions, argument);\n\n collectedStyles.push(styleDefinitions[argument]);\n return;\n }\n\n if (typeof argument === 'object') {\n Object.keys(argument).forEach(function(styleName) {\n checkStyleExistence(styleDefinitions, styleName);\n\n if (argument[styleName]) {\n collectedStyles.push(styleDefinitions[styleName])\n }\n })\n }\n }", "function addStyles(key, styles) {\n return setValAndReturnValue(stylesCache, key, styles)\n }", "function createOrderedCSSStyleSheet(sheet) {\n var groups = {};\n var selectors = {};\n /**\n * Hydrate approximate record from any existing rules in the sheet.\n */\n\n if (sheet != null) {\n var group;\n slice.call(sheet.cssRules).forEach(function (cssRule, i) {\n var cssText = cssRule.cssText; // Create record of existing selectors and rules\n\n if (cssText.indexOf('stylesheet-group') > -1) {\n group = decodeGroupRule(cssRule);\n groups[group] = {\n start: i,\n rules: [cssText]\n };\n } else {\n var selectorText = getSelectorText(cssText);\n\n if (selectorText != null) {\n selectors[selectorText] = true;\n groups[group].rules.push(cssText);\n }\n }\n });\n }\n\n function sheetInsert(sheet, group, text) {\n var orderedGroups = getOrderedGroups(groups);\n var groupIndex = orderedGroups.indexOf(group);\n var nextGroupIndex = groupIndex + 1;\n var nextGroup = orderedGroups[nextGroupIndex]; // Insert rule before the next group, or at the end of the stylesheet\n\n var position = nextGroup != null && groups[nextGroup].start != null ? groups[nextGroup].start : sheet.cssRules.length;\n var isInserted = insertRuleAt(sheet, text, position);\n\n if (isInserted) {\n // Set the starting index of the new group\n if (groups[group].start == null) {\n groups[group].start = position;\n } // Increment the starting index of all subsequent groups\n\n\n for (var i = nextGroupIndex; i < orderedGroups.length; i += 1) {\n var groupNumber = orderedGroups[i];\n var previousStart = groups[groupNumber].start;\n groups[groupNumber].start = previousStart + 1;\n }\n }\n\n return isInserted;\n }\n\n var OrderedCSSStyleSheet = {\n /**\n * The textContent of the style sheet.\n */\n getTextContent: function getTextContent() {\n return getOrderedGroups(groups).map(function (group) {\n var rules = groups[group].rules;\n return rules.join('\\n');\n }).join('\\n');\n },\n\n /**\n * Insert a rule into the style sheet\n */\n insert: function insert(cssText, groupValue) {\n var group = Number(groupValue); // Create a new group.\n\n if (groups[group] == null) {\n var markerRule = encodeGroupRule(group); // Create the internal record.\n\n groups[group] = {\n start: null,\n rules: [markerRule]\n }; // Update CSSOM.\n\n if (sheet != null) {\n sheetInsert(sheet, group, markerRule);\n }\n } // selectorText is more reliable than cssText for insertion checks. The\n // browser excludes vendor-prefixed properties and rewrites certain values\n // making cssText more likely to be different from what was inserted.\n\n\n var selectorText = getSelectorText(cssText);\n\n if (selectorText != null && selectors[selectorText] == null) {\n // Update the internal records.\n selectors[selectorText] = true;\n groups[group].rules.push(cssText); // Update CSSOM.\n\n if (sheet != null) {\n var isInserted = sheetInsert(sheet, group, cssText);\n\n if (!isInserted) {\n // Revert internal record change if a rule was rejected (e.g.,\n // unrecognized pseudo-selector)\n groups[group].rules.pop();\n }\n }\n }\n }\n };\n return OrderedCSSStyleSheet;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "getRules() {\n var _a;\n return Config.getRulesObject((_a = this.config.rules) !== null && _a !== void 0 ? _a : {});\n }", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}" ]
[ "0.6677653", "0.6382181", "0.62757814", "0.62757814", "0.62614083", "0.61745703", "0.61649346", "0.61246026", "0.6083649", "0.6043284", "0.6000803", "0.5933182", "0.59179467", "0.59179467", "0.5895582", "0.5849347", "0.5840084", "0.581443", "0.5791769", "0.5746269", "0.57212645", "0.56913733", "0.5679496", "0.56563735", "0.56563735", "0.56456673", "0.56456673", "0.5640952", "0.5640952", "0.56190336", "0.56109846", "0.5610822", "0.56034863", "0.5597676", "0.55952287", "0.5576761", "0.5569886", "0.55662644", "0.556254", "0.55520344", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5548857", "0.5542656", "0.5538563", "0.55362684", "0.55147105", "0.5497322", "0.54965305", "0.5494146", "0.5489141", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666", "0.54888666" ]
0.0
-1
Find attached sheet with an index higher than the passed one.
function findHigherSheet(registry, options) { for (var i = 0; i < registry.length; i++) { var sheet = registry[i]; if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) { return sheet; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n }", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n }", "function findHigherSheet(registry, options) {\n\t for (var i = 0; i < registry.length; i++) {\n\t var sheet = registry[i];\n\t if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n\t return sheet;\n\t }\n\t }\n\t return null;\n\t}", "function findHigherSheet(registry, options) {\n\t for (var i = 0; i < registry.length; i++) {\n\t var sheet = registry[i];\n\t if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n\t return sheet;\n\t }\n\t }\n\t return null;\n\t}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry1, options) {\n for(var i = 0; i < registry1.length; i++){\n var sheet = registry1[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) return sheet;\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n }", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n }", "function findHighestSheet(registry, options) {\n\t for (var i = registry.length - 1; i >= 0; i--) {\n\t var sheet = registry[i];\n\t if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n\t return sheet;\n\t }\n\t }\n\t return null;\n\t}", "function findHighestSheet(registry, options) {\n\t for (var i = registry.length - 1; i >= 0; i--) {\n\t var sheet = registry[i];\n\t if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n\t return sheet;\n\t }\n\t }\n\t return null;\n\t}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}" ]
[ "0.7568327", "0.7539894", "0.7499265", "0.7499265", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.74848413", "0.738147", "0.67756087", "0.6748597", "0.6692644", "0.6692644", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025", "0.66894025" ]
0.747529
63
Find attached sheet with the highest index.
function findHighestSheet(registry, options) { for (var i = registry.length - 1; i >= 0; i--) { var sheet = registry[i]; if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) { return sheet; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n }", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n }", "function findHighestSheet(registry, options) {\n\t for (var i = registry.length - 1; i >= 0; i--) {\n\t var sheet = registry[i];\n\t if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n\t return sheet;\n\t }\n\t }\n\t return null;\n\t}", "function findHighestSheet(registry, options) {\n\t for (var i = registry.length - 1; i >= 0; i--) {\n\t var sheet = registry[i];\n\t if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n\t return sheet;\n\t }\n\t }\n\t return null;\n\t}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHighestSheet(registry1, options) {\n for(var i = registry1.length - 1; i >= 0; i--){\n var sheet = registry1[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) return sheet;\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n }", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n }", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}", "function findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}" ]
[ "0.77357453", "0.7704632", "0.7696885", "0.7696885", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.7669926", "0.75003207", "0.7232852", "0.72099745", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7171825", "0.7168529", "0.7168529" ]
0.76521736
63
Find a comment with "jss" inside.
function findCommentNode(text) { var head = getHead(); for (var i = 0; i < head.childNodes.length; i++) { var node = head.childNodes[i]; if (node.nodeType === 8 && node.nodeValue.trim() === text) { return node; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "IsInComment (ss, nn)\r\n { let ii=-1, bb=0;\r\n do { ii=ss.indexOf(\"{\",ii+1); bb++; }\r\n while ((ii>=0)&&(ii<nn));\r\n ii=-1;\r\n do { ii=ss.indexOf(\"}\",ii+1); bb--; }\r\n while ((ii>=0)&&(ii<nn));\r\n return(bb);\r\n }", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n }", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}", "function findCommentNode(text) {\n var head = getHead();\n\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n\n return null;\n }", "function findCommentNode(text) {\n var head = getHead();\n for(var i = 0; i < head.childNodes.length; i++){\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) return node;\n }\n return null;\n}", "function findCommentNode(text) {\n\t var head = getHead();\n\t for (var i = 0; i < head.childNodes.length; i++) {\n\t var node = head.childNodes[i];\n\t if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "function findCommentNode(text) {\n\t var head = getHead();\n\t for (var i = 0; i < head.childNodes.length; i++) {\n\t var node = head.childNodes[i];\n\t if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "function getComment(comments, loc) {\n let matchingComment;\n const targetLineEnd = loc.end.line;\n for (const comment of comments) {\n const commentEnd = comment.loc.end.line;\n if (commentEnd === targetLineEnd - 1) {\n return comment.value;\n }\n }\n return matchingComment;\n }", "function getComment(html) {\n const commentStart = '<!--';\n const commentEnd = '-->';\n const regex = /^(eslint\\b|global\\s)/u;\n if (html.slice(0, commentStart.length) !== commentStart ||\n html.slice(-commentEnd.length) !== commentEnd) {\n return '';\n }\n const comment = html.slice(commentStart.length, -commentEnd.length);\n if (!regex.test(comment.trim())) {\n return '';\n }\n return comment;\n}", "findComment(cmntId) {\n\t\tlet found = null;\n\t\tfor(let i=0;i<this.posts.length;i++) {\n\t\t\tlet comments = this.posts[i].comments;\n\t\t\tfor(let j=0;j<comments.length;j++) {\n\t\t\t\tconsole.log(j);\n\t\t\t\tfound = this.findCommentRec(comments[j], cmntId);\n\t\t\t\tif(found != null) {\n\t\t\t\t\treturn found;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\tthis.reportCommentNotFound(cmntId);\n\t\treturn null;\n\t}", "getComment() {\n let eol = this._source.indexOf('\\n', this._index);\n\n while (eol !== -1 && this._source[eol + 1] === '#') {\n this._index = eol + 2;\n\n eol = this._source.indexOf('\\n', this._index);\n\n if (eol === -1) {\n break;\n }\n }\n\n if (eol === -1) {\n this._index = this._length;\n } else {\n this._index = eol + 1;\n }\n }", "get_comments() {\n let result = [];\n let regex_comments = /(#[^!].*)$/gm;\n let match;\n while (match = regex_comments.exec(this.content)) {\n if (match !== undefined) {\n if (match.length > 1) {\n result.push([match[1], match.index + this.offset]);\n }\n }\n }\n return result;\n }", "comment (ch) {\n if (ch !== '/') { return ch }\n var p = this.at;\n var second = this.lookahead();\n if (second === '/') {\n while (ch) {\n ch = this.next();\n if (ch === '\\n' || ch === '\\r') { break }\n }\n ch = this.next();\n } else if (second === '*') {\n while (ch) {\n ch = this.next();\n if (ch === '*' && this.lookahead() === '/') {\n this.next();\n break\n }\n }\n if (!ch) {\n this.error('Unclosed comment, starting at character ' + p);\n }\n this.next();\n return this.white()\n }\n return ch\n }", "skipCommentSingle (idx) {\n const len = this.size;\n const uson = this.input;\n const regex = USON.pattern.commentSingle;\n\n /* Find the end of the line */\n regex.lastIndex = idx;\n const match = regex.exec (uson);\n\n if (match === null) {\n return len;\n }\n\n idx = match.index;\n const chr = uson[idx];\n\n if (chr === '\\n') {\n ++idx;\n ++this.line;\n this.linePos = idx;\n }\n\n return idx;\n}", "function isPositionInComment(document, position) {\n const lineText = document.lineAt(position.line).text;\n const commentIndex = lineText.indexOf('//');\n if (commentIndex >= 0 && position.character > commentIndex) {\n const commentPosition = new vscode.Position(position.line, commentIndex);\n const isCommentInString = isPositionInString(document, commentPosition);\n return !isCommentInString;\n }\n return false;\n}", "function hasComment(input)\n{\n\treturn (input.indexOf(\"<!\") != -1);\n}", "function findNextUncommentedCharacter(\n sourceCode,\n character,\n fromIndex,\n commentNodes,\n backwards = false,\n) {\n let indexFound = false;\n let index;\n while (!indexFound) {\n if (backwards) {\n index = sourceCode.lastIndexOf(character, fromIndex);\n } else {\n index = sourceCode.indexOf(character, fromIndex);\n }\n indexFound =\n // eslint-disable-next-line no-loop-func\n commentNodes.filter(comment => {\n return (\n comment.location.startIndex <= index &&\n comment.location.endIndex - 1 >= index\n );\n }).length === 0;\n if (backwards) {\n fromIndex = index - 1;\n } else {\n fromIndex = index + 1;\n }\n }\n return index;\n}", "function comment() {\n return wrap('comment', and(\n literal('('),\n star(and(opt(fws), ccontent)),\n opt(fws),\n literal(')')\n )());\n }", "function comment() {\n return wrap('comment', and(\n literal('('),\n star(and(opt(fws), ccontent)),\n opt(fws),\n literal(')')\n )());\n }", "function comment() {\n return wrap('comment', and(\n literal('('),\n star(and(opt(fws), ccontent)),\n opt(fws),\n literal(')')\n )());\n }", "function comment() {\n return wrap('comment', and(\n literal('('),\n star(and(opt(fws), ccontent)),\n opt(fws),\n literal(')')\n )());\n }", "function inComment (stream, state) {\n if (stream.match(/^.*?#\\}/)) state.tokenize = tokenBase\n else stream.skipToEnd()\n return \"comment\";\n }", "function comment(){\n for (line ; line < linesLength ; line++){\n if (lines[line].substring(0, 15) === '***************') {\n line++;\n //console.log('Start of comment : ' + line);\n break;\n }\n }\n\n // Finding end of comment and Specie\n for (line ; line < linesLength ; line++){\n if (lines[line].substring(0, 15) === '***************') {\n // Specie name\n var deb = lines[line].indexOf('* ') + 2 ;\n var end = lines[line].lastIndexOf(' *');\n state.specie = lines[line].substring(deb,end);\n //console.log('Specie name : ' + state.specie);\n\n line++;\n //console.log('End of comment : ' + line);\n break;\n }\n }\n }", "skipCommentSingle (idx) {\n const len = this.size;\n const ucfg = this.input;\n const regex = USON.pattern.commentSingle;\n\n /* Find the end of the line */\n regex.lastIndex = idx;\n const match = regex.exec (ucfg);\n\n if (match === null) {\n return len;\n }\n\n idx = match.index;\n const chr = ucfg[idx];\n\n if (chr === '\\n') {\n ++idx;\n ++this.line;\n this.linePos = idx;\n }\n\n return idx;\n}", "function parseComment() {\n expect(\"-\");\n expect(\"-\");\n for (;;) {\n if (curChar > \">\")\n parseSafeChars();\n switch (curChar) {\n case \"\":\n error(\"missing comment close \\\"-->\\\"\");\n case \"-\":\n advance();\n if (tryChar(\"-\")) {\n expect(\">\");\n return;\n }\n break;\n case \"\\n\":\n case \"\\r\":\n case \"\\t\":\n advance();\n break;\n default:\n if (curChar < \" \")\n error(\"control character #x%1 not allowed\", formatCodePoint(curChar));\n advance();\n break;\n }\n }\n }", "skipCommentMulti (idx) {\n let depth = 1;\n const len = this.size;\n const uson = this.input;\n const regex = USON.pattern.commentMulti;\n\n while (true) {\n /* Find where the multiline comment ends */\n regex.lastIndex = idx;\n const match = regex.exec (uson);\n\n if (match === null) {\n return len;\n }\n\n idx = match.index;\n const chr = uson[idx];\n\n if (chr === '\\n') {\n ++idx;\n ++this.line;\n this.linePos = idx;\n continue;\n } else if (chr === '(') {\n /* Nested multiline comment */\n ++depth;\n } else if (chr === ')') {\n /* Multiline comment end */\n ++idx;\n --depth;\n\n if (depth === 0) {\n return idx;\n }\n\n continue;\n } else {\n /* Invalid character inside comment */\n return idx;\n }\n\n ++idx;\n }\n}", "isComment() {\n return this.char + this.peek() === \"/*\"\n }", "function getCommentContents (comment) {\n return comment.replace('/**', '')\n .replace('*/', '')\n .replace(/\\n\\s*\\* ?/g, '\\n')\n .replace(/\\r/g, '')\n }", "function findCommentNode(value, currentArr = commentsParent) {\r\n for (let i = 0; i < currentArr.length; i++) {\r\n if (currentArr[i].id == value) {\r\n return currentArr[i];\r\n }\r\n else if (currentArr[i].replies.length) {\r\n let component = findCommentNode(value, currentArr[i].replies)\r\n if (component?.id == value) {\r\n return component\r\n }\r\n else\r\n continue;\r\n }\r\n }\r\n}", "function skipComment () {\n i += 2;\n while (i < jsString.length && (curr() !== '\\n')) {\n i++;\n }\n }", "_findCommentEnd(ch, pos) {\n const next = this.input.charCodeAt(pos + 1);\n const isXmlLine = !this.state.inModule && ch !== 35;\n const blockCommentKind = !isXmlLine && (\n next === 42 ? \"#*\" :\n next === 37 ? \"#$\" :\n next === 35 && this.input.charCodeAt(this.state.pos + 2) === 35 && isNewline(this.input.charCodeAt(this.state.pos + 3)) ? \"###\" : false\n )\n if (blockCommentKind) {\n const meta = blockCommentMeta[blockCommentKind];\n let end = this.input.indexOf(meta.terminator, pos + meta.startLen);\n // TODO: make sure that ending `###` is alone on a line (and starts alone on a line)\n if (end === -1) this.raise(pos, \"Unterminated comment\");\n pos = end + meta.endLen;\n } else {\n lineBreakG.lastIndex = pos;\n const match = lineBreakG.exec(this.input)\n pos = match ? match.index : this.input.length;\n lineBreakG.lastIndex = 0; // reset lineBreakG\n }\n return pos;\n }", "function skipBlockComment () {\n i += 2;\n while (i < jsString.length && (curr() !== '*' || next() !== '/')) {\n i++;\n }\n i += 2;\n }", "skipCommentMulti (idx) {\n let depth = 1;\n const len = this.size;\n const ucfg = this.input;\n const regex = USON.pattern.commentMulti;\n\n while (true) {\n /* Find where the multiline comment ends */\n regex.lastIndex = idx;\n const match = regex.exec (ucfg);\n\n if (match === null) {\n return len;\n }\n\n idx = match.index;\n const chr = ucfg[idx];\n\n if (chr === '\\n') {\n ++idx;\n ++this.line;\n this.linePos = idx;\n continue;\n } else if (chr === '(') {\n /* Nested multiline comment */\n ++depth;\n } else if (chr === ')') {\n /* Multiline comment end */\n ++idx;\n --depth;\n\n if (depth === 0) {\n return idx;\n }\n\n continue;\n } else {\n /* Invalid character inside comment */\n return idx;\n }\n\n ++idx;\n }\n}", "function readComment(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.COMMENT,\n start,\n position,\n body.slice(start + 1, position),\n );\n}", "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Tok(_tokenKind__WEBPACK_IMPORTED_MODULE_1__[\"TokenKind\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.Token(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.Token(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new _ast_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Token\"](_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}", "function consumeComment(vm) {\n for (/* nop */; vm.i<=vm.maxIndex && !vm.error; vm.i++) {\n let c = vm.charAt(vm.i);\n if (c===\"\\n\" || c===\"\\r\" || vm.i===vm.maxIndex) {\n return;\n }\n }\n}" ]
[ "0.6377393", "0.6230793", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61737394", "0.61686164", "0.61218774", "0.6099007", "0.6099007", "0.5953445", "0.5804426", "0.56106836", "0.5599882", "0.555909", "0.54624504", "0.5418562", "0.5386353", "0.5373295", "0.5335431", "0.53333914", "0.53333914", "0.53333914", "0.53333914", "0.5319224", "0.5252772", "0.520821", "0.5200157", "0.5170543", "0.51609", "0.5141926", "0.51345456", "0.5126344", "0.5052841", "0.50267535", "0.501621", "0.500636", "0.499083", "0.49897578", "0.4975107", "0.4975107", "0.49420744", "0.49337643", "0.4910695" ]
0.61005807
64
Find a node before which we can insert the sheet.
function findPrevNode(options) { var registry$1 = registry.registry; if (registry$1.length > 0) { // Try to insert before the next higher sheet. var sheet = findHigherSheet(registry$1, options); if (sheet && sheet.renderer) { return { parent: sheet.renderer.element.parentNode, node: sheet.renderer.element }; } // Otherwise insert after the last attached. sheet = findHighestSheet(registry$1, options); if (sheet && sheet.renderer) { return { parent: sheet.renderer.element.parentNode, node: sheet.renderer.element.nextSibling }; } } // Try to find a comment placeholder if registry is empty. var insertionPoint = options.insertionPoint; if (insertionPoint && typeof insertionPoint === 'string') { var comment = findCommentNode(insertionPoint); if (comment) { return { parent: comment.parentNode, node: comment.nextSibling }; } // If user specifies an insertion point and it can't be found in the document - // bad specificity issues may appear. false ? 0 : void 0; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n }\n\n return false;\n }", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n false ? 0 : void 0;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n false ? undefined : void 0;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n false ? undefined : void 0;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : void 0;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry$1 = registry.registry;\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n if (sheet && sheet.renderer) return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry$1, options);\n if (sheet && sheet.renderer) return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n } // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n // If user specifies an insertion point and it can't be found in the document -\n warning__default['default'](false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\");\n }\n return false;\n}", "function findPrevNode(options) {\n var registry$1 = registry.registry;\n\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : 0;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry$1 = registry.registry;\n\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : 0;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry$1 = registry.registry;\n\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : 0;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry$1 = registry.registry;\n\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : undefined;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry$1 = registry.registry;\n\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : void 0;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n }", "function findPrevNode(options) {\n var registry$1 = registry.registry;\n\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : void 0;\n }\n\n return false;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element; // Otherwise insert after the last attached.\n\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling; // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n\t var registry = _sheets2['default'].registry;\n\t\n\t\n\t if (registry.length > 0) {\n\t // Try to insert before the next higher sheet.\n\t var sheet = findHigherSheet(registry, options);\n\t if (sheet) return sheet.renderer.element;\n\t\n\t // Otherwise insert after the last attached.\n\t sheet = findHighestSheet(registry, options);\n\t if (sheet) return sheet.renderer.element.nextElementSibling;\n\t }\n\t\n\t // Try to find a comment placeholder if registry is empty.\n\t var insertionPoint = options.insertionPoint;\n\t\n\t if (insertionPoint && typeof insertionPoint === 'string') {\n\t var comment = findCommentNode(insertionPoint);\n\t if (comment) return comment.nextSibling;\n\t // If user specifies an insertion point and it can't be found in the document -\n\t // bad specificity issues may appear.\n\t (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n\t }\n\t\n\t return null;\n\t}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findPrevNode(options) {\n\t var registry = _sheets2['default'].registry;\n\n\n\t if (registry.length > 0) {\n\t // Try to insert before the next higher sheet.\n\t var sheet = findHigherSheet(registry, options);\n\t if (sheet) return sheet.renderer.element;\n\n\t // Otherwise insert after the last attached.\n\t sheet = findHighestSheet(registry, options);\n\t if (sheet) return sheet.renderer.element.nextElementSibling;\n\t }\n\n\t // Try to find a comment placeholder if registry is empty.\n\t var insertionPoint = options.insertionPoint;\n\n\t if (insertionPoint && typeof insertionPoint === 'string') {\n\t var comment = findCommentNode(insertionPoint);\n\t if (comment) return comment.nextSibling;\n\t // If user specifies an insertion point and it can't be found in the document -\n\t // bad specificity issues may appear.\n\t (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n\t }\n\n\t return null;\n\t}", "function findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}", "function findNodeBefore(node, pos, test, base, state) {\n test = makeTest(test);\n if (!base) { base = exports.base; }\n var max;(function c(node, st, override) {\n if (node.start > pos) { return }\n var type = override || node.type;\n if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))\n { max = new Found(node, st); }\n base[type](node, st, c);\n })(node, state);\n return max\n}", "function findNodeBefore(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n var max\n ;(function c(node, st, override) {\n if (node.start > pos) { return }\n var type = override || node.type;\n if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))\n { max = new Found(node, st); }\n baseVisitor[type](node, st, c);\n })(node, state);\n return max\n }", "function findNodeBefore(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n var max\n ;(function c(node, st, override) {\n if (node.start > pos) { return }\n var type = override || node.type;\n if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))\n { max = new Found(node, st); }\n baseVisitor[type](node, st, c);\n })(node, state);\n return max\n }", "function findNodeBefore(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n var max\n ;(function c(node, st, override) {\n if (node.start > pos) { return }\n var type = override || node.type;\n if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))\n { max = new Found(node, st); }\n baseVisitor[type](node, st, c);\n })(node, state);\n return max\n}", "function topLevelNodeBefore(node, top) {\n while (!node.previousSibling && node.parentNode != top) {\n node = node.parentNode;\n }\n return topLevelNodeAt(node.previousSibling, top);\n }", "get nodeBefore() {\n let index = this.index(this.depth);\n let dOff = this.pos - this.path[this.path.length - 1];\n if (dOff)\n return this.parent.child(index).cut(0, dOff);\n return index == 0 ? null : this.parent.child(index - 1);\n }", "childBefore(pos) {\n if (pos == 0)\n return { node: null, index: 0, offset: 0 };\n let { index, offset } = this.content.findIndex(pos);\n if (offset < pos)\n return { node: this.content.child(index), index, offset };\n let node = this.content.child(index - 1);\n return { node, index: index - 1, offset: offset - node.nodeSize };\n }", "function topLevelNodeBefore(node, top) {\n while (!node.previousSibling && node.parentNode != top)\n node = node.parentNode;\n return topLevelNodeAt(node.previousSibling, top);\n }", "findFirstOverflowingNodeRange() {\n const foundNode = this.nodes.find((node) => {\n const rect = this.rectFilter.get(node);\n return rect.bottom > (this.rootRect.bottom - this.bottomSpace);\n });\n\n if (!foundNode || foundNode.nodeType === Node.TEXT_NODE || foundNode === this.firstNode) {\n return null;\n }\n const range = new Range();\n range.setStartBefore(foundNode);\n return range;\n }", "function hc_nodeinsertbeforenodeancestor() {\n var success;\n var doc;\n var newChild;\n var elementList;\n var employeeNode;\n var childList;\n var refChild;\n var insertedNode;\n doc = load(\"hc_staff\");\n newChild = doc.documentElement;\n\n elementList = doc.getElementsByTagName(\"p\");\n employeeNode = elementList.item(1);\n childList = employeeNode.childNodes;\n\n refChild = childList.item(0);\n \n\t{\n\t\tsuccess = false;\n\t\ttry {\n insertedNode = employeeNode.insertBefore(newChild,refChild);\n }\n\t\tcatch(ex) {\n success = (typeof(ex.code) != 'undefined' && ex.code == 3);\n\t\t}\n\t\tassertTrue(\"throw_HIERARCHY_REQUEST_ERR\",success);\n\t}\n\n}", "function before(node) {\n return new Point(magic).moveToBefore(node);\n}", "before(depth) {\n depth = this.resolveDepth(depth);\n if (!depth)\n throw new RangeError(\"There is no position before the top-level node\");\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1];\n }", "childBefore(pos) { return this.enterChild(-1, pos, -2 /* Side.Before */); }", "function getDefinedPredecessor(node) {\n\tlet index = 0;\n\tlet foundIndex = -1;\n\n\torderedItemsToDelete.forEach(itemDefinition => {\n\t\tlet ancestorArray = splitAncestors(itemDefinition.item);\n\t\tlet len = getValidatedAncestorsLength(ancestorArray);\n\t\tif (no(len)) return null;\n\t\tlet child = ancestorArray[len - 1];\n\t\tif (node.apiData.name == child) {\n\t\t\tfoundIndex = index - 1;\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t});\n\n\t//console.log(`DEBUG: Predecessor index of ${node.apiData.name} is ${foundIndex}`);\n\tif (foundIndex < 0) {\n\t\treturn null;\n\t}\n\n\treturn orderedItemsToDelete[foundIndex].item;\n}", "function getInlineElementBefore(root, position) {\n return getInlineElementBeforeAfter(root, position, false /*isAfter*/);\n}", "function cmdEditInsertBefore()\n{\n this.originalNode = viewer.currentNode;\n}", "function findFirstNodeAbove(node, callback) {\n let current = node;\n while (current.parent) {\n if (callback(current.parent)) {\n return current.parent;\n }\n else {\n current = current.parent;\n }\n }\n}", "function findAncestorOffsetKey(node){var searchNode=node;while(searchNode&&searchNode!==document.documentElement){var key=getSelectionOffsetKeyForNode(searchNode);if(key!=null){return key;}searchNode=searchNode.parentNode;}return null;}", "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "function precedingNode(node) {\n if (node.ownerElement)\n return node.ownerElement;\n if (null != node.previousSibling) {\n node = node.previousSibling;\n while (null != node.lastChild) {\n node = node.lastChild;\n }\n return node;\n }\n if (null != node.parentNode) {\n return node.parentNode;\n }\n return null;\n }", "insertBefore(item, key) {\n //start at list head\n let currNode = this.head;\n //if no head, list is empty\n if (!currNode) {\n return null;\n }\n //if the node containing the key is the head, use insertFirst\n if (currNode.value === key) {\n this.insertFirst(item);\n return;\n }\n //find the node with the key \n while((currNode.next.value !== key) & (currNode.next.next !== null)) {\n currNode = currNode.next;\n }\n\n if(currNode.next.value === key) {\n let tempNode = new _Node(item, currNode.next);\n currNode.next = tempNode;\n }\n else {\n console.log('item to insert before not found')\n return;\n }\n }", "insertBefore(data, ref) {\n let currNode = this.head\n\n while (currNode.next !== null) {\n if (currNode.next.value === ref) {\n let newNode = new _Node(data, currNode.next)\n currNode.next = newNode\n return\n } else {\n // Otherwise, keep looking \n\n currNode = currNode.next\n }\n }\n return null\n }", "insertBefore(newNode, referenceNode) {\n const that = this;\n\n if (!that.isCompleted) {\n const args = Array.prototype.slice.call(arguments, 2);\n return HTMLElement.prototype.insertBefore.apply(that, args.concat(Array.prototype.slice.call(arguments)));\n }\n\n if (!newNode || !referenceNode) {\n that.error(that.localize('invalidNode', { elementType: that.nodeName.toLowerCase(), method: 'insertBefore', node: 'newNode/referenceNode' }));\n return;\n }\n\n that.$.content.insertBefore(newNode, referenceNode);\n that._applyPosition();\n }", "insertBefore(node, referenceNode) {\n const that = this;\n\n if (!node) {\n that.error(that.localize('invalidNode', { elementType: that.nodeName.toLowerCase(), method: 'insertBefore', node: 'node' }));\n return\n }\n\n if (!that.isCompleted || node instanceof HTMLElement && node.classList.contains('jqx-resize-trigger-container')) {\n const args = Array.prototype.slice.call(arguments, 2);\n return HTMLElement.prototype.insertBefore.apply(that, args.concat(Array.prototype.slice.call(arguments)));\n }\n\n that.$.content.insertBefore(node, referenceNode || null);\n }", "function xFindBeforeByClassName( ele, clsName )\r\n{\r\n var re = new RegExp('\\\\b'+clsName+'\\\\b', 'i');\r\n return xWalkToFirst( ele, function(n){if(n.className.search(re) != -1)return n;} );\r\n}", "static findParent(node) {\n if (!(defaultElement === node.target)) {\n let parent = composedParent(node.target);\n\n while (parent !== null) {\n if (nodeCache.has(parent)) {\n return nodeCache.get(parent);\n }\n\n parent = composedParent(parent);\n }\n\n return DesignTokenNode.getOrCreate(defaultElement);\n }\n\n return null;\n }", "function findAncestorOffsetKey(node: Node): ?string {\n let searchNode = node;\n while (\n searchNode &&\n searchNode !== getCorrectDocumentFromNode(node).documentElement\n ) {\n const key = getSelectionOffsetKeyForNode(searchNode);\n if (key != null) {\n return key;\n }\n searchNode = searchNode.parentNode;\n }\n return null;\n}", "static findFirstParent(node, kindToMatch) {\n let current = node.parent;\n while (current) {\n if (current.kind === kindToMatch) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }", "insertBefore(el, referenceNode) {\n referenceNode.parentNode.insertBefore(el, referenceNode);\n }", "function Xml_GetPosition(objNode)\r\n{\r\n if(objNode)\r\n {\r\n return Xml_SelectNodes(\"preceding-sibling::*\",objNode).length;\r\n }\r\n \r\n return -1;\r\n}", "function getStartNode(){\n for(var i = 0; i < myDiagram.model.nodeDataArray.length; i++){\n var curNode = myDiagram.model.nodeDataArray[i];\n if(curNode.nodeType === nodeTypeStartNode\n && curNode.group === undefined){\n return curNode;\n }\n }\n}", "static findFirstChildNode(node, kindToMatch) {\n for (const child of node.getChildren()) {\n if (child.kind === kindToMatch) {\n return child;\n }\n const recursiveMatch = TypeScriptHelpers.findFirstChildNode(child, kindToMatch);\n if (recursiveMatch) {\n return recursiveMatch;\n }\n }\n return undefined;\n }", "matchBefore(expr) {\n let line = this.state.doc.lineAt(this.pos);\n let start = Math.max(line.from, this.pos - 250);\n let str = line.text.slice(start - line.from, this.pos - line.from);\n let found = str.search(ensureAnchor(expr, false));\n return found < 0 ? null : { from: start + found, to: this.pos, text: str.slice(found) };\n }", "insertNode(node) {\n if (node.isInline && this.needsBlock && !this.top.type) {\n let block = this.textblockFromContext();\n if (block)\n this.enterInner(block);\n }\n if (this.findPlace(node)) {\n this.closeExtra();\n let top = this.top;\n top.applyPending(node.type);\n if (top.match)\n top.match = top.match.matchType(node.type);\n let marks = top.activeMarks;\n for (let i = 0; i < node.marks.length; i++)\n if (!top.type || top.type.allowsMarkType(node.marks[i].type))\n marks = node.marks[i].addToSet(marks);\n top.content.push(node.mark(marks));\n return true;\n }\n return false;\n }", "function _containerInsertBefore(nodes) {\n return this._containerInsert(this.key, nodes);\n}" ]
[ "0.7421259", "0.74022955", "0.7398367", "0.7398367", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7362382", "0.7324045", "0.71163064", "0.708634", "0.708634", "0.708634", "0.70845336", "0.7047704", "0.7025153", "0.69866484", "0.697366", "0.6971335", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.69664556", "0.6950847", "0.69044346", "0.6440286", "0.6346086", "0.6346086", "0.6262793", "0.61978024", "0.6177073", "0.6148404", "0.6134343", "0.61057395", "0.6023345", "0.6009808", "0.5978279", "0.59568876", "0.5863003", "0.5816748", "0.5759784", "0.56883687", "0.5529551", "0.5518582", "0.5518582", "0.5499415", "0.54807204", "0.546649", "0.5465818", "0.54574686", "0.5428011", "0.541216", "0.54027605", "0.5399895", "0.5397036", "0.5363662", "0.5357297", "0.5350458", "0.53295815", "0.53235054" ]
0.7114585
23
Insert style element into the DOM.
function insertStyle(style, options) { var insertionPoint = options.insertionPoint; var nextNode = findPrevNode(options); if (nextNode !== false && nextNode.parent) { nextNode.parent.insertBefore(style, nextNode.node); return; } // Works with iframes and any node types. if (insertionPoint && typeof insertionPoint.nodeType === 'number') { // https://stackoverflow.com/questions/41328728/force-casting-in-flow var insertionPointElement = insertionPoint; var parentNode = insertionPointElement.parentNode; if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else false ? 0 : void 0; return; } getHead().appendChild(style); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertStyle(style) {\n var a=document.createElement(\"style\");\n a.innerHTML=style;\n document.head.appendChild(a);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else false ? 0 : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);\n return;\n }\n\n getHead().appendChild(style);\n }", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Insertion point is not in the DOM.') : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Insertion point is not in the DOM.') : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, '[JSS] Insertion point is not in the DOM.') : undefined;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else false ? undefined : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else false ? undefined : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);\n else warning__default['default'](false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, '[JSS] Insertion point is not in the DOM.') : 0;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, '[JSS] Insertion point is not in the DOM.') : 0;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, '[JSS] Insertion point is not in the DOM.') : 0;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else \"development\" !== \"production\" ? (0, _tinyWarning.default)(false, '[JSS] Insertion point is not in the DOM.') : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n }", "function insertStyle(style, options) {\n\t var insertionPoint = options.insertionPoint;\n\t\n\t var prevNode = findPrevNode(options);\n\t\n\t if (prevNode) {\n\t var parentNode = prevNode.parentNode;\n\t\n\t if (parentNode) parentNode.insertBefore(style, prevNode);\n\t return;\n\t }\n\t\n\t // Works with iframes and any node types.\n\t if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n\t // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n\t var insertionPointElement = insertionPoint;\n\t var _parentNode = insertionPointElement.parentNode;\n\t\n\t if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n\t return;\n\t }\n\t\n\t getHead().insertBefore(style, prevNode);\n\t}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}", "function insertStyle(style, options) {\n\t var insertionPoint = options.insertionPoint;\n\n\t var prevNode = findPrevNode(options);\n\n\t if (prevNode) {\n\t var parentNode = prevNode.parentNode;\n\n\t if (parentNode) parentNode.insertBefore(style, prevNode);\n\t return;\n\t }\n\n\t // Works with iframes and any node types.\n\t if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n\t // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n\t var insertionPointElement = insertionPoint;\n\t var _parentNode = insertionPointElement.parentNode;\n\n\t if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n\t return;\n\t }\n\n\t getHead().insertBefore(style, prevNode);\n\t}", "attachStyle(style) {\n\t\tlet componentName = this.getComponentName();\n\t\tlet node = document.createElement(\"style\");\n\t\tnode.id = componentName + \"-style\";\n\n\t\tif (node.styleSheet) {\n\t\t\tnode.styleSheet.cssText = style;\n\t\t} else {\n\t\t\tnode.appendChild(document.createTextNode(style));\n\t\t}\n\n\t\tdocument.getElementsByTagName('head')[0].appendChild(node);\n\t}", "function createStyleElement() {\n if (style_element) return;\n if ((style_element = $('#facebook-like-styles')[0])) return;\n style_element = $('<style id=\"facebook-like-styles\">' + stylesheet + '</style>').appendTo('head')[0];\n }", "setStyle(style) {\n\t\tif (this.element) {\n\t\t\tthis.element.style.cssText += style;\n\t\t\tthis.style += style;\n\t\t} else {\n\t\t\tthrow \"Add element with .add method first\";\n\t\t}\n\t}", "static add_style_to_document(ul) {\n let head = document.head || document.getElementsByTagName('head')[0];\n let style = document.createElement('style');\n head.appendChild(style);\n if (style.styleSheet) {\n style.styleSheet.cssText = get_init_style(ul.config[\"container_id\"]);\n }\n else {\n style.appendChild(document.createTextNode(get_init_style(ul.config[\"container_id\"])));\n }\n }", "function addStyle(style) {\r\nvar head = document.getElementsByTagName(\"HEAD\")[0];\r\nvar ele = head.appendChild(window.document.createElement( 'style' ));\r\nele.innerHTML = style;\r\nreturn ele;\r\n}", "function addStyle(string) {\n\tstyle.innerHTML += string;\n}", "function GM_addStyle(s) {\n\t\tvar formatstring = document.createElement('style');\n\t\tformatstring.type = 'text/css';\n\t\tformatstring.innerHTML = s;\n\t\tdocument.getElementsByTagName('head')[0].appendChild(formatstring);\n\t}", "function addStyle(element, style) {\r\n var elemStyle = element.style;\r\n var name;\r\n for (name in style) {\r\n elemStyle[name] = style[name];\r\n }\r\n }", "function ___$insertStyle(css) {\n if (!css) {\n return;\n }\n if (typeof window === 'undefined') {\n return;\n }\n\n var style = document.createElement('style');\n\n style.setAttribute('type', 'text/css');\n style.innerHTML = css;\n document.head.appendChild(style);\n\n return css;\n }", "function insertCss(css, css_id) {\n var style = document.createElement('STYLE');\n if (css_id) {\n style.id = css_id;\n }\n style.innerHTML = css;\n document.querySelector('head').appendChild(style);\n }", "function insert (css) {\n\t var head = document.getElementsByTagName('head')[0];\n\t var style = document.createElement('style');\n\t style.type = 'text/css';\n\t\n\t head.appendChild(style);\n\t\n\t if (style.styleSheet) {\n\t style.styleSheet.cssText = css;\n\t } else {\n\t style.appendChild(document.createTextNode(css));\n\t }\n\t}", "insertCss() { }", "function addStyle(aContent) {\r\n if (Array.isArray(aContent)) aContent = aContent.join(\"\\n\");\r\n var s = document.createElement(\"style\");\r\n s.type = \"text/css\";\r\n s.textContent = aContent;\r\n document.body.appendChild(s);\r\n}", "function ___$insertStyle(css) {\n if (!css) {\n return;\n }\n if (typeof window === 'undefined') {\n return;\n }\n\n var style = document.createElement('style');\n\n style.setAttribute('type', 'text/css');\n style.innerHTML = css;\n document.head.appendChild(style);\n\n return css;\n}", "function ___$insertStyle(css) {\n if (!css) {\n return;\n }\n if (typeof window === 'undefined') {\n return;\n }\n\n var style = document.createElement('style');\n\n style.setAttribute('type', 'text/css');\n style.innerHTML = css;\n document.head.appendChild(style);\n\n return css;\n}", "function _setStyle(selector, style) {\n\t\t\t\t$create('<style type=\"text/css\">' + selector + \" { \" + style + ' } </style>').appendTo(\"head\");\n\t\t\t}", "function addNewStyle(newStyle) {\r\n var styleElement = document.getElementById('styles_js');\r\n if (!styleElement) {\r\n styleElement = document.createElement('style');\r\n styleElement.type = 'text/css';\r\n styleElement.id = 'styles_js';\r\n document.getElementsByTagName('head')[0].appendChild(styleElement);\r\n }\r\n styleElement.appendChild(document.createTextNode(newStyle));\r\n}", "genStyleElement() {\n /* istanbul ignore if */\n if (typeof document === 'undefined') return;\n /* istanbul ignore next */\n\n this.styleEl = document.createElement('style');\n this.styleEl.type = 'text/css';\n this.styleEl.id = 'vuetify-theme-stylesheet';\n\n if (this.options.cspNonce) {\n this.styleEl.setAttribute('nonce', this.options.cspNonce);\n }\n\n document.head.appendChild(this.styleEl);\n }", "genStyleElement() {\n /* istanbul ignore if */\n if (typeof document === 'undefined') return;\n /* istanbul ignore next */\n\n this.styleEl = document.createElement('style');\n this.styleEl.type = 'text/css';\n this.styleEl.id = 'vuetify-theme-stylesheet';\n\n if (this.options.cspNonce) {\n this.styleEl.setAttribute('nonce', this.options.cspNonce);\n }\n\n document.head.appendChild(this.styleEl);\n }", "genStyleElement() {\n /* istanbul ignore if */\n if (typeof document === 'undefined') return;\n /* istanbul ignore next */\n\n this.styleEl = document.createElement('style');\n this.styleEl.type = 'text/css';\n this.styleEl.id = 'vuetify-theme-stylesheet';\n\n if (this.options.cspNonce) {\n this.styleEl.setAttribute('nonce', this.options.cspNonce);\n }\n\n document.head.appendChild(this.styleEl);\n }", "genStyleElement() {\n /* istanbul ignore if */\n if (typeof document === 'undefined') return;\n /* istanbul ignore next */\n\n this.styleEl = document.createElement('style');\n this.styleEl.type = 'text/css';\n this.styleEl.id = 'vuetify-theme-stylesheet';\n\n if (this.options.cspNonce) {\n this.styleEl.setAttribute('nonce', this.options.cspNonce);\n }\n\n document.head.appendChild(this.styleEl);\n }", "async addStyleTag(options) {\n const { url = null, path = null, content = null } = options;\n if (url !== null) {\n try {\n const context = await this.executionContext();\n return (await context.evaluateHandle(addStyleUrl, url)).asElement();\n }\n catch (error) {\n throw new Error(`Loading style from ${url} failed`);\n }\n }\n if (path !== null) {\n if (!environment_js_1.isNode) {\n throw new Error('Cannot pass a filepath to addStyleTag in the browser environment.');\n }\n const fs = await helper_js_1.helper.importFSModule();\n let contents = await fs.promises.readFile(path, 'utf8');\n contents += '/*# sourceURL=' + path.replace(/\\n/g, '') + '*/';\n const context = await this.executionContext();\n return (await context.evaluateHandle(addStyleContent, contents)).asElement();\n }\n if (content !== null) {\n const context = await this.executionContext();\n return (await context.evaluateHandle(addStyleContent, content)).asElement();\n }\n throw new Error('Provide an object with a `url`, `path` or `content` property');\n async function addStyleUrl(url) {\n const link = document.createElement('link');\n link.rel = 'stylesheet';\n link.href = url;\n const promise = new Promise((res, rej) => {\n link.onload = res;\n link.onerror = rej;\n });\n document.head.appendChild(link);\n await promise;\n return link;\n }\n async function addStyleContent(content) {\n const style = document.createElement('style');\n style.type = 'text/css';\n style.appendChild(document.createTextNode(content));\n const promise = new Promise((res, rej) => {\n style.onload = res;\n style.onerror = rej;\n });\n document.head.appendChild(style);\n await promise;\n return style;\n }\n }", "function add_style(css)\n {\n var head = document.getElementsByTagName(\"head\")[0];\n var style = document.createElement(\"style\");\n\n style.setAttribute(\"type\", \"text/css\");\n style.innerHTML = css;\n head.appendChild(style);\n }", "function insertStyles() {\n let head = document.getElementsByTagName('head')[0];\n let lastHeadElement = head.lastChild;\n let style = document.createElement('style');\n const styleArray = [];\n style.type = 'text/css';\n // Prism css\n styleArray.push('.token.comment,.token.prolog,.token.doctype,.token.cdata{color: slategray}.token.punctuation{color: #999}.namespace{opacity: .7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color: #905}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color: #690}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color: #a67f59;background: hsla(0, 0%, 100%, .5)}.token.atrule,.token.attr-value,.token.keyword{color: #07a}.token.function{color: #DD4A68}.token.regex,.token.important,.token.variable{color: #e90}.token.important,.token.bold{font-weight: bold}.token.italic{font-style: italic}.token.entity{cursor: help}');\n // Custom css to fix some layout problems because of the insertion of <code> element\n styleArray.push('pre>code{border-radius:initial;display:initial;line-height:initial;margin-left:initial;overflow-y:initial;padding:initial}code,tt{background:initial;border:initial}.refract-container .deletion pre.source {background-color: #fff1f2 !important;} .refract-container .addition pre.source { background-color: #e8ffe8;}');\n style.innerHTML = styleArray.join('');\n head.insertBefore(style, lastHeadElement);\n head = null;\n lastHeadElement = null;\n style = null;\n }", "function injectStyle() {\n const style = document.createElement('style');\n style.textContent = '.leethub_progress {pointer-events: none;width: 2.0em;height: 2.0em;border: 0.4em solid transparent;border-color: #eee;border-top-color: #3E67EC;border-radius: 50%;animation: loadingspin 1s linear infinite;} @keyframes loadingspin { 100% { transform: rotate(360deg) }}';\n document.head.append(style);\n}", "genStyleElement() {\n /* istanbul ignore if */\n if (typeof document === 'undefined') return;\n /* istanbul ignore next */\n\n const options = this.options || {};\n this.styleEl = document.createElement('style');\n this.styleEl.type = 'text/css';\n this.styleEl.id = 'vuetify-theme-stylesheet';\n\n if (options.cspNonce) {\n this.styleEl.setAttribute('nonce', options.cspNonce);\n }\n\n document.head.appendChild(this.styleEl);\n }", "function add_style(argument, idName) {\n\n if (document.querySelector('#'+idName) != null) {\n document.querySelector('#'+idName).remove();\n }\n let css = argument,\n head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n\n head.appendChild(style);\n\n style.type = 'text/css';\n style.id = idName;\n if (style.styleSheet){\n // This is required for IE8 and below.\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}", "function add_css() {\n\tvar style = element(\"style\");\n\tstyle.id = 'svelte-p8vizn-style';\n\tstyle.textContent = \".fa-svelte.svelte-p8vizn{width:1em;height:1em;overflow:visible;display:inline-block}\";\n\tappend(document.head, style);\n}", "addStyleString(str) {\n\t\tlet node = document.getElementById(\"codestream-style-tag\") || document.createElement(\"style\");\n\t\tnode.id = \"codestream-style-tag\";\n\t\tnode.innerHTML = str;\n\t\tdocument.body.appendChild(node);\n\t}", "function add_css$1() {\n \tvar style = element(\"style\");\n \tstyle.id = 'svelte-7fiviz-style';\n \tstyle.textContent = \"\";\n \tappend(document.head, style);\n }", "function insert(spec) {\n if (!inserted[spec.id]) {\n inserted[spec.id] = true;\n var deconstructed = deconstruct(spec.style);\n var rules = deconstructedStyleToCSS(spec.id, deconstructed);\n inserted[spec.id] = isBrowser ? true : rules;\n rules.forEach(function (cssRule) {\n return styleSheet.insert(cssRule);\n });\n }\n}", "function insert(spec) {\n if (!inserted[spec.id]) {\n inserted[spec.id] = true;\n var deconstructed = deconstruct(spec.style);\n var rules = deconstructedStyleToCSS(spec.id, deconstructed);\n inserted[spec.id] = isBrowser ? true : rules;\n rules.forEach(function (cssRule) {\n return styleSheet.insert(cssRule);\n });\n }\n}", "function insert(spec) {\n if (!inserted[spec.id]) {\n inserted[spec.id] = true;\n var deconstructed = deconstruct(spec.style);\n var rules = deconstructedStyleToCSS(spec.id, deconstructed);\n inserted[spec.id] = isBrowser ? true : rules;\n rules.forEach(function (cssRule) {\n return styleSheet.insert(cssRule);\n });\n }\n}", "function insert(spec) {\n if (!inserted[spec.id]) {\n inserted[spec.id] = true;\n var deconstructed = deconstruct(spec.style);\n var rules = deconstructedStyleToCSS(spec.id, deconstructed);\n inserted[spec.id] = isBrowser ? true : rules;\n rules.forEach(function (cssRule) {\n return styleSheet.insert(cssRule);\n });\n }\n}" ]
[ "0.7943686", "0.7706128", "0.7683789", "0.7653549", "0.7653549", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.76448977", "0.7643879", "0.7643879", "0.7629373", "0.76150787", "0.76150787", "0.76150787", "0.7595366", "0.7536278", "0.75156015", "0.7500204", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7471658", "0.7444184", "0.7295867", "0.71020305", "0.6984046", "0.6936764", "0.6880916", "0.67927295", "0.67919075", "0.67678654", "0.6749882", "0.6749287", "0.67194074", "0.66853875", "0.6675397", "0.66752243", "0.66752243", "0.6669646", "0.6668761", "0.6642893", "0.6642893", "0.6642893", "0.6642893", "0.66015124", "0.6600822", "0.6580898", "0.65705353", "0.65624464", "0.65442747", "0.6524595", "0.6509546", "0.6495154", "0.64934653", "0.64934653", "0.64934653", "0.64934653" ]
0.7644424
23
HTMLStyleElement needs fixing Will be empty if link: true option is not set, because it is only for use together with insertRule API.
function DomRenderer(sheet) { this.getPropertyValue = getPropertyValue; this.setProperty = setProperty; this.removeProperty = removeProperty; this.setSelector = setSelector; this.element = void 0; this.sheet = void 0; this.hasInsertedRules = false; this.cssRules = []; // There is no sheet when the renderer is used from a standalone StyleRule. if (sheet) registry.add(sheet); this.sheet = sheet; var _ref = this.sheet ? this.sheet.options : {}, media = _ref.media, meta = _ref.meta, element = _ref.element; this.element = element || createStyle(); this.element.setAttribute('data-jss', ''); if (media) this.element.setAttribute('media', media); if (meta) this.element.setAttribute('data-meta', meta); var nonce = getNonce(); if (nonce) this.element.setAttribute('nonce', nonce); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refuseStyle(refStyle) {\n var selectedTag = getSelectedNode(); // the selected node\n\n // if the selected node have attribute of \"style\" and it have unwanted style\n if (selectedTag && selectedTag.is(\"[style]\") && selectedTag.css(refStyle) != \"\") {\n var refValue = selectedTag.css(refStyle); // first get key of unwanted style\n\n selectedTag.css(refStyle, \"\"); // clear unwanted style\n\n var cleanStyle = selectedTag.attr(\"style\"); // cleaned style\n\n selectedTag.css(refStyle, refValue); // add unwanted style to the selected node again\n\n return cleanStyle; // print cleaned style\n }\n else\n return \"\";\n }", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n }", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n }", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n }", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n }", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__[\"isHTMLElement\"])(element) || !Object(_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__[\"isHTMLElement\"])(element) || !Object(_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__[\"isHTMLElement\"])(element) || !Object(_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!(0,_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_0__.isHTMLElement)(element) || !(0,_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_1__.default)(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function(name1) {\n var style = state.styles[name1] || {\n };\n var attributes = state.attributes[name1] || {\n };\n var element = state.elements[name1]; // arrow is optional + virtual elements\n if (!_instanceOfJs.isHTMLElement(element) || !_getNodeNameJsDefault.default(element)) return;\n // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function(name) {\n var value = attributes[name];\n if (value === false) element.removeAttribute(name);\n else element.setAttribute(name, value === true ? '' : value);\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__[\"isHTMLElement\"])(element) || !Object(_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__[\"isHTMLElement\"])(element) || !Object(_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!Object(_dom_utils_instanceOf_js__WEBPACK_IMPORTED_MODULE_1__[\"isHTMLElement\"])(element) || !Object(_dom_utils_getNodeName_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function removeStyleElement(element) {\n var _a, _b, _c, _d;\n const resources = (_a = element.elements) === null || _a === void 0 ? void 0 : _a.find(el => el.name === 'resources');\n const idxToBeRemoved = (_c = (_b = resources === null || resources === void 0 ? void 0 : resources.elements) === null || _b === void 0 ? void 0 : _b.findIndex(el => { var _a; return el.name === 'style' && ((_a = el.attributes) === null || _a === void 0 ? void 0 : _a.name) === STYLE_NAME; })) !== null && _c !== void 0 ? _c : -1;\n if (idxToBeRemoved !== -1) {\n // eslint-disable-next-line no-unused-expressions\n (_d = resources === null || resources === void 0 ? void 0 : resources.elements) === null || _d === void 0 ? void 0 : _d.splice(idxToBeRemoved, 1);\n }\n return element;\n}", "function fixStyle(css) {\n\n\tvar head, style;\n\thead = document.getElementsByTagName('head')[0];\n\tif (!head) { return; }\n\tstyle = document.createElement('style');\n\tstyle.type = 'text/css';\n\tstyle.innerHTML = css;\n\thead.appendChild(style);\n\n}", "function applyStyles(_ref){var state=_ref.state;Object.keys(state.elements).forEach(function(name){var style=state.styles[name]||{};var attributes=state.attributes[name]||{};var element=state.elements[name];// arrow is optional + virtual elements\nif(!isHTMLElement(element)||!getNodeName(element)){return;}// Flow doesn't support to extend this property, but it's the most\n// effective way to apply styles to an HTMLElement\n// $FlowFixMe[cannot-write]\nObject.assign(element.style,style);Object.keys(attributes).forEach(function(name){var value=attributes[name];if(value===false){element.removeAttribute(name);}else {element.setAttribute(name,value===true?'':value);}});});}", "function applyStyles(_ref){var state=_ref.state;Object.keys(state.elements).forEach(function(name){var style=state.styles[name]||{};var attributes=state.attributes[name]||{};var element=state.elements[name];// arrow is optional + virtual elements\nif(!isHTMLElement(element)||!getNodeName(element)){return;}// Flow doesn't support to extend this property, but it's the most\n// effective way to apply styles to an HTMLElement\n// $FlowFixMe[cannot-write]\nObject.assign(element.style,style);Object.keys(attributes).forEach(function(name){var value=attributes[name];if(value===false){element.removeAttribute(name);}else {element.setAttribute(name,value===true?'':value);}});});}", "applyStyleValues() {\n if (this._style) this._style.parseInlineStyle(this._inlineStyle);\n }", "restyleElement() {\n this._restyle_plugin();\n }", "get styleSheet(){return void 0===this._styleSheet&&(supportsAdoptingStyleSheets?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}", "function removeRules()\n\t{\n\t\tif(style)\n\t\t\tstyle.parentNode.removeChild(style);\n\t}", "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "adoptStyles(){const styles=this.constructor._styles;if(0===styles.length){return}// There are three separate cases here based on Shadow DOM support.\n// (1) shadowRoot polyfilled: use ShadyCSS\n// (2) shadowRoot.adoptedStyleSheets available: use it.\n// (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n// rendering\nif(window.ShadyCSS!==void 0&&!window.ShadyCSS.nativeShadow){window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map(s=>s.cssText),this.localName)}else if(supportsAdoptingStyleSheets){this.renderRoot.adoptedStyleSheets=styles.map(s=>s.styleSheet)}else{// This must be done after rendering so the actual style insertion is done\n// in `update`.\nthis._needsShimAdoptedStyleSheets=!0}}", "function $D2nT$var$applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!$wsKO$export$isHTMLElement(element) || !$B1zX$export$default(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}", "function deleteRelatedStyleRule(uid) {\n var id = 'plotly.js-style-' + uid;\n var style = document.getElementById(id);\n if (style) removeElement(style);\n}", "function applyStyle(element, style){\r\n\t\t\t\t Object.keys(style).forEach(function(key){\r\n\t\t\t\t element.style[key] = style[key];\r\n\t\t\t\t });\r\n\t\t\t\t}", "get hasStyle() {\n return this.style && this.style.trim() !== '';\n }", "adoptStyles(){const styles=this.constructor._styles;if(styles.length===0){return;}// There are three separate cases here based on Shadow DOM support.\n// (1) shadowRoot polyfilled: use ShadyCSS\n// (2) shadowRoot.adoptedStyleSheets available: use it\n// (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n// rendering\nif(window.ShadyCSS!==undefined&&!window.ShadyCSS.nativeShadow){window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map(s=>s.cssText),this.localName);}else if(supportsAdoptingStyleSheets){this.renderRoot.adoptedStyleSheets=styles.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);}else {// This must be done after rendering so the actual style insertion is done\n// in `update`.\nthis._needsShimAdoptedStyleSheets=true;}}", "function SafeStyle(){}", "function inline_stylesheet(link) {\n const style = document.createElement(\"style\");\n const css = [...link.sheet.cssRules].map(_ => _.cssText).join(\"\\n\");\n const text = document.createTextNode(css);\n style.appendChild(text);\n return style;\n }", "function normalize(style) {\n\t\tvar css,\n\t\t\trules = {},\n\t\t\ti = props.length,\n\t\t\tvalue;\n\n\t\tparseElem.innerHTML = '<div style=\"' + style + '\"></div>';\n\t\tcss = parseElem.childNodes[0].style;\n\t\twhile (i--) {\n\t\t\tif (value = css[props[i]])\n\t\t\t\trules[props[i]] = parse(value);\n\t\t}\n\n\t\treturn rules;\n\t}", "function _sanitizeStyle(value){value=String(value).trim();// Make sure it's actually a string.\nif(!value)return'';// Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n// reasoning behind this.\nvar urlMatch=value.match(URL_RE);if(urlMatch&&_sanitizeUrl(urlMatch[1])===urlMatch[1]||value.match(SAFE_STYLE_VALUE)&&hasBalancedQuotes(value)){return value;// Safe style values.\n}if(isDevMode()){console.warn(\"WARNING: sanitizing unsafe style value \"+value+\" (see http://g.co/ng/security#xss).\");}return'unsafe';}", "function applyStyle(e, style) {\n for (var k in style) {\n var v = style[k];\n if (k == \"text\") e.appendChild(document.createTextNode(v));else if (k == \"html\") e.innerHTML = v;else if (k == \"attributes\") {\n for (var a in v) {\n e[a] = v[a];\n }\n } else e.style[k] = v;\n }\n}", "function applyStyles$2(_ref){var state=_ref.state;Object.keys(state.elements).forEach(function(name){var style=state.styles[name]||{};var attributes=state.attributes[name]||{};var element=state.elements[name];// arrow is optional + virtual elements\nif(!isHTMLElement$1(element)||!getNodeName$1(element)){return;}// Flow doesn't support to extend this property, but it's the most\n// effective way to apply styles to an HTMLElement\n// $FlowFixMe[cannot-write]\nObject.assign(element.style,style);Object.keys(attributes).forEach(function(name){var value=attributes[name];if(value===false){element.removeAttribute(name);}else {element.setAttribute(name,value===true?'':value);}});});}", "function _cleanupStyles(target) {\n\t for (var n in this.properties) {\n\t target.style[n] = '';\n\t }\n\t }", "function assignStyle() {\n return upwardifiedMerge(function() { return this.style; });\n}", "adoptStyles(){const e=this.constructor._styles;0===e.length||(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow?supportsAdoptingStyleSheets?this.renderRoot.adoptedStyleSheets=e.map(e=>e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName));// There are three separate cases here based on Shadow DOM support.\n// (1) shadowRoot polyfilled: use ShadyCSS\n// (2) shadowRoot.adoptedStyleSheets available: use it.\n// (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n// rendering\n}", "function cleanStyles(e) {\n if (!e) return;\n\n\n // Remove any root styles, if we're able.\n if (typeof e.removeAttribute == 'function' && e.className != 'readability-styled') e.removeAttribute('style');\n\n // Go until there are no more child nodes\n var cur = e.firstChild;\n while (cur) {\n if (cur.nodeType == 1) {\n // Remove style attribute(s) :\n if (cur.className != \"readability-styled\") {\n cur.removeAttribute(\"style\");\n }\n cleanStyles(cur);\n }\n cur = cur.nextSibling;\n }\n}", "function removeFromElement(style, element) {\n var def = style._.definition,\n overrides = getOverrides(style),\n attributes = Utils.mix(def[\"attributes\"],\n (overrides[ element._4e_name()] || overrides[\"*\"] || {})[\"attributes\"]),\n styles = Utils.mix(def[\"styles\"],\n (overrides[ element._4e_name()] || overrides[\"*\"] || {})[\"styles\"]),\n // If the style is only about the element itself, we have to remove the element.\n removeEmpty = S.isEmptyObject(attributes) &&\n S.isEmptyObject(styles);\n\n // Remove definition attributes/style from the element.\n for (var attName in attributes) {\n if (attributes.hasOwnProperty(attName)) {\n // The 'class' element value must match (#1318).\n if (( attName == 'class' || style._.definition[\"fullMatch\"] )\n && element.attr(attName) != normalizeProperty(attName,\n attributes[ attName ]))\n continue;\n removeEmpty = removeEmpty || !!element._4e_hasAttribute(attName);\n element.removeAttr(attName);\n }\n }\n\n for (var styleName in styles) {\n if (styles.hasOwnProperty(styleName)) {\n // Full match style insist on having fully equivalence. (#5018)\n if (style._.definition[\"fullMatch\"]\n && element._4e_style(styleName)\n != normalizeProperty(styleName, styles[ styleName ], TRUE))\n continue;\n\n removeEmpty = removeEmpty || !!element._4e_style(styleName);\n //设置空即为:清除样式\n element._4e_style(styleName, \"\");\n }\n }\n\n //removeEmpty &&\n //始终检查\n removeNoAttribsElement(element);\n }", "adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (_lib_css_tag_js__WEBPACK_IMPORTED_MODULE_4__.supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "function removeCSSLink() {\n\n\t/*console.log(window.innerWidth)\n\tconsole.log(navigator.userAgent)\n\tconsole.log((/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)))*/\n\n\tif((window.innerWidth <= 425)) {\n\t\tlet salStyleLink = document.querySelector('#sal');\n\n\t\tif (salStyleLink) {\n\t\t\tsalStyleLink.remove();\n\t\t}\n\t}\n\n\twindow.addEventListener('resize', function() {\n\t\tif((window.innerWidth <= 425)) {\n\t\t\tlet salStyleLink = document.querySelector('#sal');\n\n\t\t\tif (salStyleLink) {\n\t\t\t\tsalStyleLink.remove();\n\t\t\t}\n\t\t} else {\n\n\t\t\tlet documentMainCSSLink = document.querySelector('#main'),\n\t\t\t\tdomSalStyleLink = document.querySelector('#sal'),\n\t\t\t\tsalStyleLink = '<link rel=\"stylesheet\" href=\"assets/css/sal.css\" id=\"sal\">';\n\n\t\t\tif (!domSalStyleLink) {\n\t\t\t\tdocumentMainCSSLink.insertAdjacentHTML('beforebegin', salStyleLink);\n\t\t\t}\n\t\t}\n\t});\n}", "function updateStyle(element, oldStyle, newStyle) {\r\n var elemStyle = element.style;\r\n var name;\r\n for (name in oldStyle) {\r\n if (!(name in newStyle)) {\r\n elemStyle[name] = '';\r\n }\r\n }\r\n for (name in newStyle) {\r\n if (oldStyle[name] !== newStyle[name]) {\r\n elemStyle[name] = newStyle[name];\r\n }\r\n }\r\n }", "adoptStyles() {\n const styles = this.constructor._uniqueStyles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it.\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "function _cleanupStyles(target) {\n for (var n in this.properties) {\n target.style[n] = '';\n }\n }", "function fixAbsRefRendering()\n{\t\n\tvar table = document.getElementById('prerendered');\n\tvar anchors = table.getElementsByTagName('a');\n\tfor (var i = 1; i < anchors.length; i++)\n\t{\n\t\tif(anchors[i].href !=\"\") \n\t\t{\t\t\n\t\t\tapplyAbsRefStyleCorrection(anchors[i]);\n\t\t\t\n\t\t}\n\t}\n}", "adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it.\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }", "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "checkOrCreateStyleElement() {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet');\n /* istanbul ignore next */\n\n if (this.styleEl) return true;\n this.genStyleElement(); // If doesn't have it, create it\n\n return Boolean(this.styleEl);\n }", "function addLinkStyle() {\n graph.links\n .selectAll('.linkPath')\n .style('fill', 'none')\n .style('stroke', 'darkgrey')\n .style('stroke-width', `${graph.style.links_size}px`)\n .style('font', `${graph.style.labels_size}px sans-serif`)\n }", "function style(id, attr, origVal, newVal, options, isPreview) {\n var standarizedOrigVal = origVal ? Helpers.getStandarizedValue(attr, origVal) : null;\n var standarizedNewVal = Helpers.getStandarizedValue(attr, newVal);\n\n // Add the rule (will use existing if already exists) and reapply all.\n Rules.add(id, attr, standarizedOrigVal, standarizedNewVal, options, isPreview);\n applyAll();\n }", "function fixCSSProps(element, suffix, attrs) {\n // no support for style in WebGL\n if (element.style == undefined)\n return;\n\n for (var i in attrs)\n {\n var value = element.style[attrs[i]];\n if (value !== undefined && value.length > 4 && value.substring(0, 4) == \"url(\")\n element.style[attrs[i]] = \"url(\" + value.substring(4, value.length - 1) + suffix + \")\";\n }\n }", "processStyle(style) {\n return this.constructor.processStyle(style)\n }", "function cleanupStyles(item) {\n var prop;\n var reactProps;\n if (item.props.style) {\n reactProps = {};\n for(prop in item.props.style) {\n reactProps[prop] = item._node.style[prop];\n }\n }\n item._node.removeAttribute('style');\n if (reactProps) {\n for(prop in reactProps) {\n item._node.style[prop] = reactProps[prop];\n }\n }\n if (item._prevStyles) {\n for(prop in item._prevStyles) {\n item._node.style[prop] = item._prevStyles[prop];\n }\n }\n}", "function resetOldStyles() {\n if (lastElem) {\n setStyleList(lastElem, lastElemStyle);\n lastElem = null;\n lastElemStyle = null;\n }\n}", "_updateStyles() {\n if (this.$element) {\n const cssText = createCssText(createDOMStyles(this.state, this.attributes));\n if (cssText !== this._lastCssText) {\n this.$element.style.cssText = cssText;\n this._lastCssText = cssText;\n }\n }\n }", "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "static updateStyle(el, style, adjustment) {\n if (!el || !el.style)\n return;\n const val = el.style[style];\n if (!val || val.length < 3)\n return;\n // only modify pixel values.\n if (val[val.length - 2] != \"p\")\n return;\n if (val[val.length - 1] != \"x\")\n return;\n const attrKey = \"data-hack-last-\" + style;\n const attr = el.getAttribute(attrKey);\n if (attr && attr == val)\n return;\n const intValue = parseInt(val, 10);\n if (isNaN(intValue) || !intValue)\n return;\n const newVal = `${intValue + adjustment}px`;\n el.setAttribute(attrKey, newVal);\n el.style[style] = newVal;\n }", "function createStyle(element, elementStyle) {\n\n if(element && elementStyle instanceof Object ){\n Object.keys(elementStyle).map(function (cssProp) {\n element.style[cssProp] = elementStyle[cssProp];\n });\n }\n\n}", "function IntObject_UpdateCSSStyleProperty()\n{\n\t//has fixed property?\n\tif (this.StyleProperties && this.StyleProperties.FixedPosition)\n\t{\n\t\t//unregister this as a fixed object\n\t\t__SIMULATOR.Interpreter.NotifyFixedObject(this.DataObject.Id, this, false);\n\t}\n\t//by default: no object is CSS Enabled\n\tthis.StyleProperties = false;\n\t//retrieve out css property\n\tvar strCSS = Get_String(this.Properties[__NEMESIS_PROPERTY_STYLE], null);\n\t//valid?\n\tif (strCSS != null)\n\t{\n\t\t//could have properties, convert into an object\n\t\tthis.StyleProperties = { cssText: \"\", Original: {}, Zoom: null };\n\t\t//split it\n\t\tstrCSS = strCSS.split(\";\");\n\t\t//now loop through all of them\n\t\tfor (var iCSS = 0, cCSS = strCSS.length; iCSS < cCSS; iCSS++)\n\t\t{\n\t\t\t//split this into key value pair\n\t\t\tvar pair = strCSS[iCSS].split(\":\");\n\t\t\t//valid?\n\t\t\tif (pair.length == 2)\n\t\t\t{\n\t\t\t\t//we want to make sure we trim the key\n\t\t\t\tpair[0] = pair[0].Trim();\n\t\t\t\t//store it\n\t\t\t\tthis.StyleProperties.Original[pair[0]] = pair[1];\n\t\t\t\t//switch on it\n\t\t\t\tswitch (pair[0].toLowerCase())\n\t\t\t\t{\n\t\t\t\t\tcase \"pointer-events\":\n\t\t\t\t\t\t//only process this if we arent in designer or if the value is not \"none\"\n\t\t\t\t\t\tif (!__DESIGNER_CONTROLLER || !/none/i.test(pair[1]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//add it to the css text\n\t\t\t\t\t\t\tthis.StyleProperties.cssText += pair[0] + \":\" + pair[1] + \";\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"zoom\":\n\t\t\t\t\t\t//add it to the css text\n\t\t\t\t\t\tthis.StyleProperties.cssText += pair[0] + \":\" + pair[1] + \";\";\n\t\t\t\t\t\t//but we also need to mark this as a valid zoom object\n\t\t\t\t\t\tthis.StyleProperties.Zoom = Zoom_Register(this, pair[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"content\":\n\t\t\t\t\t\t//replace all url(' with url(' plus host\n\t\t\t\t\t\tpair[1] = pair[1].replace(/url\\('(?!data:)/gi, \"url('\" + __HOST_LESSON_RESOURCES);\n\t\t\t\t\t\t//add it to the css text\n\t\t\t\t\t\tthis.StyleProperties.cssText += pair[0] + \":\" + pair[1] + \";\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t//add it to the css text\n\t\t\t\t\t\tthis.StyleProperties.cssText += pair[0] + \":\" + pair[1] + \";\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//has fixed?\n\t\tif (this.StyleProperties.Original[\"position\"] == \"fixed\")\n\t\t{\n\t\t\t//assume this is fixed\n\t\t\tvar bFixed = true;\n\t\t\t//loop through the parents\n\t\t\tfor (var parent = this.Parent; parent; parent = parent.Parent)\n\t\t\t{\n\t\t\t\t//this parent a real iframe?\n\t\t\t\tif (parent.IsRealIFrame)\n\t\t\t\t{\n\t\t\t\t\t//cannot be fixed\n\t\t\t\t\tbFixed = false;\n\t\t\t\t\t//end loop\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//still fixed?\n\t\t\tif (bFixed)\n\t\t\t{\n\t\t\t\t//create fixed position marker\n\t\t\t\tthis.StyleProperties.FixedPosition = true;\n\t\t\t\t//and register with the interpreter\n\t\t\t\t__SIMULATOR.Interpreter.NotifyFixedObject(this.DataObject.Id, this, true);\n\t\t\t}\n\t\t}\n\t\t//switch on its control type tag\n\t\tswitch (Get_String(this.Properties[__NEMESIS_PROPERTY_CONTROL_TYPE], \"\").toLowerCase())\n\t\t{\n\t\t\tcase \"iframe\":\n\t\t\tcase \"frame\":\n\t\t\tcase \"frameset\":\n\t\t\t\t//not the new iFrame?\n\t\t\t\tif (!Get_Bool(this.Properties[__NEMESIS_PROPERTY_CONTROL_TYPE_FORCED], false))\n\t\t\t\t{\n\t\t\t\t\t//no isolation?\n\t\t\t\t\tif (!this.StyleProperties.Original[\"isolation\"])\n\t\t\t\t\t{\n\t\t\t\t\t\t//force it\n\t\t\t\t\t\tthis.StyleProperties.cssText += \"isolation:isolate;\";\n\t\t\t\t\t}\n\t\t\t\t\t//this ie browser (Edge and IE)\n\t\t\t\t\tif (__BROWSER_TYPE == __BROWSER_IE)\n\t\t\t\t\t{\n\t\t\t\t\t\t//no opacity?\n\t\t\t\t\t\tif (!this.StyleProperties.Original[\"opacity\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//force it\n\t\t\t\t\t\t\tthis.StyleProperties.cssText += \"opacity:0.99;\";\n\t\t\t\t\t\t}\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\t//indicate that this is a real iframe\n\t\t\t\t\tthis.IsRealIFrame = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"html\":\n\t\t\t\t//get its parent object and check its tag\n\t\t\t\tswitch (this.Parent ? Get_String(this.Parent.Properties[__NEMESIS_PROPERTY_CONTROL_TYPE], \"\").toLowerCase() : \"\")\n\t\t\t\t{\n\t\t\t\t\tcase \"iframe\":\n\t\t\t\t\tcase \"frame\":\n\t\t\t\t\tcase \"frameset\":\n\t\t\t\t\t\t//not the new iFrame?\n\t\t\t\t\t\tif (!Get_Bool(this.Properties[__NEMESIS_PROPERTY_CONTROL_TYPE_FORCED], false))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//check if the parent has scrolling = no\n\t\t\t\t\t\t\tvar attributeScrollingNo = false;\n\t\t\t\t\t\t\t//obtain the parent's\n\t\t\t\t\t\t\tvar attributes = this.Parent.StyleProperties ? Get_String(this.Parent.Properties[__NEMESIS_PROPERTY_HTML_ATTRIBUTES], null) : null;\n\t\t\t\t\t\t\t//valid?\n\t\t\t\t\t\t\tif (attributes != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//parse attributes (lowercase it just in case);\n\t\t\t\t\t\t\t\tattributes = JSON.parse(attributes.toLowerCase());\n\t\t\t\t\t\t\t\t//check for scrolling\n\t\t\t\t\t\t\t\tattributeScrollingNo = !Get_Bool(attributes[\"scrolling\"], true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//we need to copy some properties into our parent\n\t\t\t\t\t\t\tvar properties = [\"overflow\", \"overflow-y\", \"overflow-x\"];\n\t\t\t\t\t\t\t//loop through properties\n\t\t\t\t\t\t\tfor (var i = properties.length; i--;)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//get property\n\t\t\t\t\t\t\t\tvar property = properties[i];\n\t\t\t\t\t\t\t\t//get our value\n\t\t\t\t\t\t\t\tvar ourValue = attributeScrollingNo ? \"hidden\" : this.StyleProperties.Original[property];\n\t\t\t\t\t\t\t\t//valid?\n\t\t\t\t\t\t\t\tif (ourValue)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//force on parent\n\t\t\t\t\t\t\t\t\tthis.Parent.StyleProperties.Original[property] = ourValue;\n\t\t\t\t\t\t\t\t\tthis.Parent.StyleProperties.cssText += property + \":\" + ourValue + \";\";\n\t\t\t\t\t\t\t\t\t//parent already loaded?\n\t\t\t\t\t\t\t\t\tif (this.Parent.HTML)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//switch on property\n\t\t\t\t\t\t\t\t\t\tswitch (property)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcase \"overflow\":\n\t\t\t\t\t\t\t\t\t\t\t\t//apply directly\n\t\t\t\t\t\t\t\t\t\t\t\tthis.Parent.HTML.style.overflow = ourValue;\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase \"overflow-x\":\n\t\t\t\t\t\t\t\t\t\t\t\t//apply directly\n\t\t\t\t\t\t\t\t\t\t\t\tthis.Parent.HTML.style.overflowX = ourValue;\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\tcase \"overflow-y\":\n\t\t\t\t\t\t\t\t\t\t\t\t//apply directly\n\t\t\t\t\t\t\t\t\t\t\t\tthis.Parent.HTML.style.overflowY = ourValue;\n\t\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\t//regardless of whatever we do to the parent, the HTML always have a forced overflow\n\t\t\t\t\t\t\tthis.StyleProperties.Original[\"overflow\"] = \"visible\";\n\t\t\t\t\t\t\tthis.StyleProperties.Original[\"overflow-x\"] = \"visible\";\n\t\t\t\t\t\t\tthis.StyleProperties.Original[\"overflow-y\"] = \"visible\";\n\t\t\t\t\t\t\tthis.StyleProperties.cssText += \"overflow:visible;overflow-x:visible;overflow-y:visible;\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "function force_insert_rule(selector, id, value, prefix, size) {\n\n if (isUndefined(size)) {\n if ($(\"body\").hasClass(\"yp-responsive-device-mode\")) {\n var frameW = iframe.width();\n var format = $(\".media-control\").attr(\"data-code\");\n size = '(' + format + ':' + frameW + 'px)';\n } else {\n size = 'desktop';\n }\n }\n\n var css = id;\n\n // Clean value\n value = value.replace(/\\s+?!important/g, '').replace(/\\;$/g, '');\n\n // Remove Style Without important.\n iframe.find(\".\" + get_id(selector) + '-' + id + '-style[data-size-mode=\"' + size + '\"]').remove();\n\n // Append Style Area If Not Have.\n if (the_editor_data().length <= 0) {\n iframeBody.append(\"<div class='yp-styles-area'></div>\");\n }\n\n // Checking.\n if (value == 'disable' || value == '' || value == 'undefined' || value === null) {\n\n return false;\n }\n\n // Append.\n if (get_id(selector) != '') {\n\n if (is_animate_creator() === true && id != 'position') {\n\n iframe.find(\".\" + get_id(body.attr(\"data-anim-scene\") + css)).remove();\n\n iframe.find(\".yp-anim-scenes .\" + body.attr('data-anim-scene') + \"\").append('<style data-rule=\"' + css + '\" class=\"style-' + body.attr(\"data-anim-scene\") + ' scenes-' + get_id(css) + '-style\">' + selector + '{' + css + ':' + value + prefix + ' !important}</style>');\n\n } else {\n\n // Responsive Settings\n var mediaBefore = create_media_query_before();\n var mediaAfter = create_media_query_after();\n\n if (isDefined(size) && body.hasClass((\"yp-animate-manager-active\")) && body.hasClass((\"yp-responsive-device-mode\"))) {\n mediaBefore = \"@media \" + size + \"{\";\n }\n\n the_editor_data().append('<style data-rule=\"' + css + '\" data-size-mode=\"' + size + '\" data-style=\"' + get_id(selector) + '\" class=\"' + get_id(selector) + '-' + id + '-style yp_current_styles\">' + mediaBefore + '' + '' + selector + '{' + css + ':' + value + prefix + ' !important}' + '' + mediaAfter + '</style>');\n\n resort_style_data_positions();\n\n }\n\n }\n\n\n }", "function noErrorStyles(element) {\r\n try{\r\n element.style.borderBottom = \"1px solid #000\";\r\n element.style.color = \"#000\";\r\n element.style.background = \"#fff\";\r\n } catch{}\r\n}", "refreshStyles() {\n\t\tthis.styleElement.replaceChildren( document.createTextNode( this.getStyles() ) );\n\t}", "function StyleSanitizeFn(){}", "function applyRule(rule, style) {\n var values = rule.values,\n names = rule.names;\n for (var ndx = 0; ndx < names.length; ++ndx) {\n style[names[ndx]] = values[ndx];\n }\n}", "function updateStyles() {\n styleElement.innerHTML = styles[0] + styles[1];\n}", "function normalizeStyleBinding (bindingStyle) {\r\n if (Array.isArray(bindingStyle)) {\r\n return toObject(bindingStyle)\r\n }\r\n if (typeof bindingStyle === 'string') {\r\n return parseStyleText(bindingStyle)\r\n }\r\n return bindingStyle\r\n}", "function styleNull() {\n this.style.removeProperty(name);\n }", "applyStyle(style, clearDirectFormatting) {\n clearDirectFormatting = isNullOrUndefined(clearDirectFormatting) ? false : clearDirectFormatting;\n if (clearDirectFormatting) {\n this.initComplexHistory('ApplyStyle');\n this.clearFormatting();\n }\n let styleObj = this.viewer.styles.findByName(style);\n if (styleObj !== undefined) {\n this.onApplyParagraphFormat('styleName', styleObj, false, true);\n }\n else {\n // tslint:disable-next-line:max-line-length\n this.viewer.owner.parser.parseStyle(JSON.parse(this.getCompleteStyles()), JSON.parse(this.viewer.preDefinedStyles.get(style)), this.viewer.styles);\n this.applyStyle(style);\n }\n if (this.editorHistory && this.editorHistory.currentHistoryInfo && this.editorHistory.currentHistoryInfo.action === 'ApplyStyle') {\n this.editorHistory.updateComplexHistory();\n }\n }", "function fixLineStyle(styleHost) {\n var style = styleHost.style;\n\n if (style) {\n style.stroke = style.stroke || style.fill;\n style.fill = null;\n }\n}", "_inlineStylesheet(cssLink) {\n return __awaiter(this, void 0, void 0, function* () {\n const stylesheetHref = dom5.getAttribute(cssLink, 'href');\n const resolvedImportUrl = this.bundler.analyzer.urlResolver.resolve(this.assignedBundle.url, stylesheetHref);\n if (resolvedImportUrl === undefined) {\n return;\n }\n if (this.bundler.excludes.some((e) => resolvedImportUrl === e ||\n resolvedImportUrl.startsWith(url_utils_1.ensureTrailingSlash(e)))) {\n return;\n }\n const stylesheetImport = // HACK(usergenic): clang-format workaround\n utils_1.find(this.document.getFeatures({ kind: 'html-style', imported: true, externalPackages: true }), (i) => i.document !== undefined &&\n i.document.url === resolvedImportUrl) ||\n utils_1.find(this.document.getFeatures({ kind: 'css-import', imported: true, externalPackages: true }), (i) => i.document !== undefined &&\n i.document.url === resolvedImportUrl);\n if (stylesheetImport === undefined ||\n stylesheetImport.document === undefined) {\n this.assignedBundle.bundle.missingImports.add(resolvedImportUrl);\n return;\n }\n const stylesheetContent = stylesheetImport.document.parsedDocument.contents;\n const media = dom5.getAttribute(cssLink, 'media');\n let newBaseUrl = this.assignedBundle.url;\n // If the css link we are about to inline is inside of a dom-module, the\n // new base URL must be calculated using the assetpath of the dom-module\n // if present, since Polymer will honor assetpath when resolving URLs in\n // `<style>` tags, even inside of `<template>` tags.\n const parentDomModule = parse5_utils_1.findAncestor(cssLink, dom5.predicates.hasTagName('dom-module'));\n if (!this.bundler.rewriteUrlsInTemplates && parentDomModule &&\n dom5.hasAttribute(parentDomModule, 'assetpath')) {\n const assetPath = (dom5.getAttribute(parentDomModule, 'assetpath') ||\n '');\n if (assetPath) {\n newBaseUrl =\n this.bundler.analyzer.urlResolver.resolve(newBaseUrl, assetPath);\n }\n }\n const resolvedStylesheetContent = this._rewriteCssTextBaseUrl(stylesheetContent, resolvedImportUrl, newBaseUrl);\n const styleNode = dom5.constructors.element('style');\n if (media) {\n dom5.setAttribute(styleNode, 'media', media);\n }\n dom5.replace(cssLink, styleNode);\n dom5.setTextContent(styleNode, resolvedStylesheetContent);\n // Record that the inlining took place.\n this.assignedBundle.bundle.inlinedStyles.add(resolvedImportUrl);\n return styleNode;\n });\n }", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n }", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n }", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n }", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n }", "function StyleSanitizeFn() { }", "function StyleSanitizeFn() { }", "function removeAndPrintInlineStyles(node){//f \n //console.log(node.getAttribute(\"style\"));\n if(node.getAttribute(\"style\")!=null){\n let properties = node2properties(node);\n let hash = object2hash(properties);\n let className = \"ERR\"; \n if(!(hash in classes)){\n //add\n classes[hash] = classNameCreator();\n }\n className = classes[hash];\n node.removeAttribute(\"style\"); //remove style.\n node.className = className;\n }\n for(let child of node.children){\n removeAndPrintInlineStyles(child);\n } \n\n}", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}", "function normalizeStyleBinding (bindingStyle) {\n if (Array.isArray(bindingStyle)) {\n return toObject(bindingStyle)\n }\n if (typeof bindingStyle === 'string') {\n return parseStyleText(bindingStyle)\n }\n return bindingStyle\n}" ]
[ "0.611398", "0.5965531", "0.5965531", "0.59208196", "0.59049255", "0.59049255", "0.59049255", "0.59049255", "0.58954066", "0.5891549", "0.57965904", "0.57965904", "0.57965904", "0.5789427", "0.5789427", "0.577838", "0.5775719", "0.5775719", "0.5775719", "0.5708784", "0.569079", "0.566244", "0.566244", "0.564197", "0.56366146", "0.5632386", "0.55992407", "0.55806714", "0.55806714", "0.55806714", "0.5563715", "0.55281436", "0.55216956", "0.5492905", "0.54767394", "0.54732215", "0.5463351", "0.5450749", "0.5446974", "0.5442714", "0.5433086", "0.5414028", "0.53764415", "0.53640795", "0.5363906", "0.53616065", "0.5358379", "0.535559", "0.5340884", "0.53365684", "0.53296727", "0.53225046", "0.53180295", "0.5278791", "0.5260124", "0.5260124", "0.5260124", "0.5260124", "0.5260124", "0.5254536", "0.525001", "0.5242977", "0.522465", "0.5217984", "0.5210132", "0.5195504", "0.5194494", "0.5194494", "0.5194494", "0.5194494", "0.51942176", "0.5188989", "0.5188464", "0.5186115", "0.51832724", "0.5182222", "0.51804787", "0.51756585", "0.5174697", "0.5169018", "0.51686954", "0.5167736", "0.5166684", "0.5159451", "0.51544255", "0.51544255", "0.51544255", "0.51544255", "0.5153841", "0.5153841", "0.51513654", "0.51491964", "0.51491964", "0.51491964", "0.51491964", "0.51491964", "0.51491964", "0.51491964", "0.51491964", "0.51491964", "0.51491964" ]
0.0
-1
Extracts a styles object with only props that contain function values.
function getDynamicStyles(styles) { var to = null; for (var key in styles) { var value = styles[key]; var type = typeof value; if (type === 'function') { if (!to) to = {}; to[key] = value; } else if (type === 'object' && value !== null && !Array.isArray(value)) { var extracted = getDynamicStyles(value); if (extracted) { if (!to) to = {}; to[key] = extracted; } } } return to; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractStyleParts() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n var objects = [];\n var stylesheet = _Stylesheet__WEBPACK_IMPORTED_MODULE_0__.Stylesheet.getInstance();\n function _processArgs(argsList) {\n for (var _i = 0, argsList_1 = argsList; _i < argsList_1.length; _i++) {\n var arg = argsList_1[_i];\n if (arg) {\n if (typeof arg === 'string') {\n if (arg.indexOf(' ') >= 0) {\n _processArgs(arg.split(' '));\n }\n else {\n var translatedArgs = stylesheet.argsFromClassName(arg);\n if (translatedArgs) {\n _processArgs(translatedArgs);\n }\n else {\n // Avoid adding the same class twice.\n if (classes.indexOf(arg) === -1) {\n classes.push(arg);\n }\n }\n }\n }\n else if (Array.isArray(arg)) {\n _processArgs(arg);\n }\n else if (typeof arg === 'object') {\n objects.push(arg);\n }\n }\n }\n }\n _processArgs(args);\n return {\n classes: classes,\n objects: objects,\n };\n}", "function extractStyleParts() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n var objects = [];\n var stylesheet = _Stylesheet__WEBPACK_IMPORTED_MODULE_0__.Stylesheet.getInstance();\n function _processArgs(argsList) {\n for (var _i = 0, argsList_1 = argsList; _i < argsList_1.length; _i++) {\n var arg = argsList_1[_i];\n if (arg) {\n if (typeof arg === 'string') {\n if (arg.indexOf(' ') >= 0) {\n _processArgs(arg.split(' '));\n }\n else {\n var translatedArgs = stylesheet.argsFromClassName(arg);\n if (translatedArgs) {\n _processArgs(translatedArgs);\n }\n else {\n // Avoid adding the same class twice.\n if (classes.indexOf(arg) === -1) {\n classes.push(arg);\n }\n }\n }\n }\n else if (Array.isArray(arg)) {\n _processArgs(arg);\n }\n else if (typeof arg === 'object') {\n objects.push(arg);\n }\n }\n }\n }\n _processArgs(args);\n return {\n classes: classes,\n objects: objects,\n };\n}", "function extractStyleParts() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n var objects = [];\n var stylesheet = __WEBPACK_IMPORTED_MODULE_0__Stylesheet__[\"b\" /* Stylesheet */].getInstance();\n function _processArgs(argsList) {\n for (var _i = 0, argsList_1 = argsList; _i < argsList_1.length; _i++) {\n var arg = argsList_1[_i];\n if (arg) {\n if (typeof arg === 'string') {\n if (arg.indexOf(' ') >= 0) {\n _processArgs(arg.split(' '));\n }\n else {\n var translatedArgs = stylesheet.argsFromClassName(arg);\n if (translatedArgs) {\n _processArgs(translatedArgs);\n }\n else {\n // Avoid adding the same class twice.\n if (classes.indexOf(arg) === -1) {\n classes.push(arg);\n }\n }\n }\n }\n else if (Array.isArray(arg)) {\n _processArgs(arg);\n }\n else if (typeof arg === 'object') {\n objects.push(arg);\n }\n }\n }\n }\n _processArgs(args);\n return {\n classes: classes,\n objects: objects\n };\n}", "function extractStyleParts() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n var objects = [];\n var stylesheet = _Stylesheet__WEBPACK_IMPORTED_MODULE_0__[\"Stylesheet\"].getInstance();\n function _processArgs(argsList) {\n for (var _i = 0, argsList_1 = argsList; _i < argsList_1.length; _i++) {\n var arg = argsList_1[_i];\n if (arg) {\n if (typeof arg === 'string') {\n if (arg.indexOf(' ') >= 0) {\n _processArgs(arg.split(' '));\n }\n else {\n var translatedArgs = stylesheet.argsFromClassName(arg);\n if (translatedArgs) {\n _processArgs(translatedArgs);\n }\n else {\n // Avoid adding the same class twice.\n if (classes.indexOf(arg) === -1) {\n classes.push(arg);\n }\n }\n }\n }\n else if (Array.isArray(arg)) {\n _processArgs(arg);\n }\n else if (typeof arg === 'object') {\n objects.push(arg);\n }\n }\n }\n }\n _processArgs(args);\n return {\n classes: classes,\n objects: objects\n };\n}", "function getDynamicStyles(styles) {\n var to = null;\n for(var key in styles){\n var value = styles[key];\n var type = typeof value;\n if (type === 'function') {\n if (!to) to = {\n };\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {\n };\n to[key] = extracted;\n }\n }\n }\n return to;\n}", "function extractStyleParts() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var classes = [];\n var objects = [];\n var stylesheet = Stylesheet_1.Stylesheet.getInstance();\n function _processArgs(argsList) {\n for (var _i = 0, argsList_1 = argsList; _i < argsList_1.length; _i++) {\n var arg = argsList_1[_i];\n if (arg) {\n if (typeof arg === 'string') {\n if (arg.indexOf(' ') >= 0) {\n _processArgs(arg.split(' '));\n }\n else {\n var translatedArgs = stylesheet.argsFromClassName(arg);\n if (translatedArgs) {\n _processArgs(translatedArgs);\n }\n else {\n // Avoid adding the same class twice.\n if (classes.indexOf(arg) === -1) {\n classes.push(arg);\n }\n }\n }\n }\n else if (Array.isArray(arg)) {\n _processArgs(arg);\n }\n else if (typeof arg === 'object') {\n objects.push(arg);\n }\n }\n }\n }\n _processArgs(args);\n return {\n classes: classes,\n objects: objects\n };\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n }", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n }", "function handleStyles(styles, props, theme, context) {\n let current\n const mappedArgs = []\n const nonGlamorClassNames = []\n for (let i = 0; i < styles.length; i++) {\n current = styles[i]\n if (typeof current === 'function') {\n const result = current(props, theme, context)\n if (typeof result === 'string') {\n processStringClass(result, mappedArgs, nonGlamorClassNames)\n } else {\n mappedArgs.push(result)\n }\n } else if (typeof current === 'string') {\n processStringClass(current, mappedArgs, nonGlamorClassNames)\n } else if (Array.isArray(current)) {\n const recursed = handleStyles(current, props, theme, context)\n mappedArgs.push(...recursed.mappedArgs)\n nonGlamorClassNames.push(...recursed.nonGlamorClassNames)\n } else {\n mappedArgs.push(current)\n }\n }\n return {mappedArgs, nonGlamorClassNames}\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n\t var to = null;\n\t\n\t for (var key in styles) {\n\t var value = styles[key];\n\t var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\t\n\t if (type === 'function') {\n\t if (!to) to = {};\n\t to[key] = value;\n\t } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n\t var extracted = getDynamicStyles(value);\n\t if (extracted) {\n\t if (!to) to = {};\n\t to[key] = extracted;\n\t }\n\t }\n\t }\n\t\n\t return to;\n\t}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}", "function separateStyles(stylesArray) {\n var aphroditeStyles = [];\n\n // Since determining if an Object is empty requires collecting all of its\n // keys, and we want the best performance in this code because we are in the\n // render path, we are going to do a little bookkeeping ourselves.\n var hasInlineStyles = false;\n var inlineStyles = {};\n\n // This is run on potentially every node in the tree when rendering, where\n // performance is critical. Normally we would prefer using `forEach`, but\n // old-fashioned for loops are faster so that's what we have chosen here.\n for (var i = 0; i < stylesArray.length; i++) {\n // eslint-disable-line no-plusplus\n var style = stylesArray[i];\n\n // If this style is falsey, we just want to disregard it. This allows for\n // syntax like:\n //\n // css(isFoo && styles.foo)\n if (style) {\n if ((0, _has2['default'])(style, '_name') && (0, _has2['default'])(style, '_definition')) {\n // This looks like a reference to an Aphrodite style object, so that's\n // where it goes.\n aphroditeStyles.push(style);\n } else {\n Object.assign(inlineStyles, style);\n hasInlineStyles = true;\n }\n }\n }\n\n return {\n aphroditeStyles: aphroditeStyles,\n hasInlineStyles: hasInlineStyles,\n inlineStyles: inlineStyles\n };\n}", "function getStyles(el, arguments){\r\n var ret = {};\r\n total = arguments.length ;\r\n for (var n=0; n<total; n++ )\r\n ret[ arguments[n] ] = el.getStyle(arguments[n]); \r\n return ret;\r\n }", "function flattenStyleValues(style) {\n return Object.keys(style).reduce(function (newStyle, key) {\n var val = style[key];\n if (Array.isArray(val)) {\n if (__WEBPACK_IMPORTED_MODULE_2_exenv___default.a.canUseDOM) {\n // For the **browser**, when faced with multiple values, we just take\n // the **last** one, which is the original passed in value before\n // prefixing. This _should_ work, because `inline-style-prefixer`\n // we're just passing through what would happen without ISP.\n\n val = val[val.length - 1].toString();\n } else {\n // For the **server**, we just concatenate things together and convert\n // the style object values into a hacked-up string of like `display:\n // \"-webkit-flex;display:flex\"` that will SSR render correctly to like\n // `\"display:-webkit-flex;display:flex\"` but would otherwise be\n // totally invalid values.\n\n // We convert keys to dash-case only for the serialize values and\n // leave the real key camel-cased so it's as expected to React and\n // other parts of the processing chain.\n val = val.join(';' + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__camel_case_props_to_dash_case__[\"b\" /* camelCaseToDashCase */])(key) + ':');\n }\n }\n\n newStyle[key] = val;\n return newStyle;\n }, {});\n}", "function concatStyleSetsWithProps(styleProps) {\n var allStyles = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n allStyles[_i - 1] = arguments[_i];\n }\n var result = [];\n for (var _a = 0, allStyles_1 = allStyles; _a < allStyles_1.length; _a++) {\n var styles = allStyles_1[_a];\n if (styles) {\n result.push(typeof styles === 'function' ? styles(styleProps) : styles);\n }\n }\n if (result.length === 1) {\n return result[0];\n }\n else if (result.length) {\n // cliffkoh: I cannot figure out how to avoid the cast to any here.\n // It is something to do with the use of Omit in IStyleSet.\n // It might not be necessary once Omit becomes part of lib.d.ts (when we remove our own Omit and rely on\n // the official version).\n return _concatStyleSets__WEBPACK_IMPORTED_MODULE_0__.concatStyleSets.apply(void 0, result);\n }\n return {};\n}", "function concatStyleSetsWithProps(styleProps) {\n var allStyles = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n allStyles[_i - 1] = arguments[_i];\n }\n var result = [];\n for (var _a = 0, allStyles_1 = allStyles; _a < allStyles_1.length; _a++) {\n var styles = allStyles_1[_a];\n if (styles) {\n result.push(typeof styles === 'function' ? styles(styleProps) : styles);\n }\n }\n if (result.length === 1) {\n return result[0];\n }\n else if (result.length) {\n // cliffkoh: I cannot figure out how to avoid the cast to any here.\n // It is something to do with the use of Omit in IStyleSet.\n // It might not be necessary once Omit becomes part of lib.d.ts (when we remove our own Omit and rely on\n // the official version).\n return _concatStyleSets__WEBPACK_IMPORTED_MODULE_0__.concatStyleSets.apply(void 0, result);\n }\n return {};\n}", "static getStyleInstances(selector, style) {\n let result = [];\n let ownStyle = {}, haveOwnStyle = false;\n\n for (let key of Object.keys(style)) {\n let value = style[key];\n let isProperValue = (typeof value === \"string\" || value instanceof String\n || typeof value === \"number\" || value instanceof Number\n || typeof value === \"function\");\n if (isProperValue) {\n ownStyle[key] = value;\n haveOwnStyle = true;\n } else {\n // Check that this actually is a valid subselector\n let firstChar = String(key).charAt(0);\n if (!ALLOWED_SELECTOR_STARTS.has(firstChar)) {\n // TODO: Log here?\n console.error(\"Unprocessable style key \", key);\n continue;\n }\n let subStyle = this.getStyleInstances(selector + key, value);\n result.push(...subStyle);\n }\n }\n\n if (haveOwnStyle) {\n result.unshift({selector: selector, style: ownStyle});\n }\n return result;\n }", "function filterStyleProperties(rule) {\n rule.declarations = _.filter(rule.declarations, function (dec) {\n return dec.value && dec.value.indexOf('var(--') > -1;\n });\n if (rule.declarations && rule.declarations.length) {\n return rule;\n }\n }", "makeStyles(requireFunc, components) {\n var styles = {};\n styles.__requireFunc = requireFunc;\n\n components.forEach(key => {\n styles[key] = true;\n });\n\n return styles;\n }", "function flattenStyleValues(style) {\n return Object.keys(style).reduce(function (newStyle, key) {\n var val = style[key];\n if (Array.isArray(val)) {\n if (exenv__WEBPACK_IMPORTED_MODULE_2___default.a.canUseDOM) {\n // For the **browser**, when faced with multiple values, we just take\n // the **last** one, which is the original passed in value before\n // prefixing. This _should_ work, because `inline-style-prefixer`\n // we're just passing through what would happen without ISP.\n\n val = val[val.length - 1].toString();\n } else {\n // For the **server**, we just concatenate things together and convert\n // the style object values into a hacked-up string of like `display:\n // \"-webkit-flex;display:flex\"` that will SSR render correctly to like\n // `\"display:-webkit-flex;display:flex\"` but would otherwise be\n // totally invalid values.\n\n // We convert keys to dash-case only for the serialize values and\n // leave the real key camel-cased so it's as expected to React and\n // other parts of the processing chain.\n val = val.join(';' + Object(_camel_case_props_to_dash_case__WEBPACK_IMPORTED_MODULE_5__[\"camelCaseToDashCase\"])(key) + ':');\n }\n }\n\n newStyle[key] = val;\n return newStyle;\n }, {});\n}", "function separateStyles(stylesArray) {\n var classNames = []; // Since determining if an Object is empty requires collecting all of its\n // keys, and we want the best performance in this code because we are in the\n // render path, we are going to do a little bookkeeping ourselves.\n\n var hasInlineStyles = false;\n var inlineStyles = {}; // This is run on potentially every node in the tree when rendering, where\n // performance is critical. Normally we would prefer using `forEach`, but\n // old-fashioned for loops are faster so that's what we have chosen here.\n\n for (var i = 0; i < stylesArray.length; i++) {\n // eslint-disable-line no-plusplus\n var style = stylesArray[i]; // If this style is falsy, we just want to disregard it. This allows for\n // syntax like:\n //\n // css(isFoo && styles.foo)\n\n if (style) {\n if (typeof style === 'string') {\n classNames.push(style);\n } else {\n Object.assign(inlineStyles, style);\n hasInlineStyles = true;\n }\n }\n }\n\n return {\n classNames: classNames,\n hasInlineStyles: hasInlineStyles,\n inlineStyles: inlineStyles\n };\n}", "getStyle(styleNames = []) {\n if (typeof styleNames === 'string') {\n styleNames = [styleNames];\n }\n\n if (typeof this.defaultStyles === 'undefined') {\n this.defaultStyles = {};\n }\n\n var styles = [];\n\n for (let i = 0; i < styleNames.length; i++) {\n if (typeof this.defaultStyles[styleNames[i]] !== 'undefined') {\n styles.push(this.defaultStyles[styleNames[i]]);\n }\n }\n\n for (let i = 0; i < styleNames.length; i++) {\n if (typeof this.props.formStyles[this.props.type] !== 'undefined') {\n if (typeof this.props.formStyles[this.props.type][styleNames[i]] !== 'undefined') {\n styles.push(this.props.formStyles[this.props.type][styleNames[i]]);\n }\n }\n }\n\n for (let i = 0; i < styleNames.length; i++) {\n if (typeof this.props.widgetStyles[styleNames[i]] !== 'undefined') {\n styles.push(this.props.widgetStyles[styleNames[i]]);\n }\n }\n\n return styles;\n }", "resolveStyles(props = {}) {\n const styles = {\n animationDuration: props.duration,\n borderColor: props.secondaryColor,\n borderTopColor: props.color,\n borderWidth: props.borderWidth,\n height: props.size,\n width: props.size,\n }\n const overrides = props.style || {}\n\n return {...styles, ...overrides}\n }", "function getStyleProps(injector) {\n return {\n id: STYLE_ELEMENT_ID,\n nonce: injector.nonce,\n textContent: injector.ruleTexts.join(\"\")\n };\n}", "function separateStyles(stylesArray) {\n var classNames = [];\n\n // Since determining if an Object is empty requires collecting all of its\n // keys, and we want the best performance in this code because we are in the\n // render path, we are going to do a little bookkeeping ourselves.\n var hasInlineStyles = false;\n var inlineStyles = {};\n\n // This is run on potentially every node in the tree when rendering, where\n // performance is critical. Normally we would prefer using `forEach`, but\n // old-fashioned for loops are faster so that's what we have chosen here.\n for (var i = 0; i < stylesArray.length; i++) {\n // eslint-disable-line no-plusplus\n var style = stylesArray[i];\n\n // If this style is falsy, we just want to disregard it. This allows for\n // syntax like:\n //\n // css(isFoo && styles.foo)\n if (style) {\n if (typeof style === 'string') {\n classNames.push(style);\n } else {\n Object.assign(inlineStyles, style);\n hasInlineStyles = true;\n }\n }\n }\n\n return {\n classNames: classNames,\n hasInlineStyles: hasInlineStyles,\n inlineStyles: inlineStyles\n };\n}", "function separateStyles(stylesArray) {\n var classNames = [];\n\n // Since determining if an Object is empty requires collecting all of its\n // keys, and we want the best performance in this code because we are in the\n // render path, we are going to do a little bookkeeping ourselves.\n var hasInlineStyles = false;\n var inlineStyles = {};\n\n // This is run on potentially every node in the tree when rendering, where\n // performance is critical. Normally we would prefer using `forEach`, but\n // old-fashioned for loops are faster so that's what we have chosen here.\n for (var i = 0; i < stylesArray.length; i++) {\n // eslint-disable-line no-plusplus\n var style = stylesArray[i];\n\n // If this style is falsy, we just want to disregard it. This allows for\n // syntax like:\n //\n // css(isFoo && styles.foo)\n if (style) {\n if (typeof style === 'string') {\n classNames.push(style);\n } else {\n Object.assign(inlineStyles, style);\n hasInlineStyles = true;\n }\n }\n }\n\n return {\n classNames: classNames,\n hasInlineStyles: hasInlineStyles,\n inlineStyles: inlineStyles\n };\n}", "function test_props( props, callback ) {\n for ( var i in props ) {\n if ( m_style[ props[i] ] !== undefined && ( !callback || callback( props[i], m ) ) ) {\n return true;\n }\n }\n }", "function test_props( props, callback ) {\n for ( var i in props ) {\n if ( m_style[ props[i] ] !== undefined && ( !callback || callback( props[i], m ) ) ) {\n return true;\n }\n }\n }", "addStyles(...styles) {\n styles.forEach(style => {\n // style: { styles: { key: requireFunc }, (include: [] | exclude: []) }\n var { styles, include, exclude } = style.styles ? style : { styles: style };\n var styleKeys = Object.keys(styles);\n\n if (include && exclude)\n throw new Error('Cannot define include and exclude');\n\n // include or exclude certain styles\n UI._addStyles(\n include && include.length ?\n styleKeys.filter(x => include.indexOf(x) !== -1) :\n exclude && exclude.length ?\n styleKeys.filter(x => exclude.indexOf(x) === -1) :\n styleKeys\n );\n });\n }", "function validStyles(styleAttr){\n\tvar result = '';\n\tvar styleArray = styleAttr.split(';');\n\tangular.forEach(styleArray, function(value){\n\t\tvar v = value.split(':');\n\t\tif(v.length == 2){\n\t\t\tvar key = trim(angular.lowercase(v[0]));\n\t\t\tvar value = trim(angular.lowercase(v[1]));\n\t\t\tif(\n\t\t\t\t(key === 'color' || key === 'background-color') && (\n\t\t\t\t\tvalue.match(/^rgb\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^rgba\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^hsl\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^hsla\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^#[0-9a-f]{3,6}$/i)\n\t\t\t\t\t|| value.match(/^[a-z]*$/i)\n\t\t\t\t)\n\t\t\t||\n\t\t\t\tkey === 'text-align' && (\n\t\t\t\t\tvalue === 'left'\n\t\t\t\t\t|| value === 'right'\n\t\t\t\t\t|| value === 'center'\n\t\t\t\t\t|| value === 'justify'\n\t\t\t\t)\n\t\t\t||\n key === 'text-decoration' && (\n value === 'underline'\n || value === 'line-through'\n )\n || \n key === 'font-weight' && (\n value === 'bold'\n )\n ||\n key === 'font-style' && (\n value === 'italic'\n )\n ||\n key === 'float' && (\n value === 'left'\n || value === 'right'\n || value === 'none'\n )\n ||\n key === 'vertical-align' && (\n value === 'baseline'\n || value === 'sub'\n || value === 'super'\n || value === 'test-top'\n || value === 'text-bottom'\n || value === 'middle'\n || value === 'top'\n || value === 'bottom'\n || value.match(/[0-9]*(px|em)/)\n || value.match(/[0-9]+?%/)\n )\n ||\n key === 'font-size' && (\n value === 'xx-small'\n || value === 'x-small'\n || value === 'small'\n || value === 'medium'\n || value === 'large'\n || value === 'x-large'\n || value === 'xx-large'\n || value === 'larger'\n || value === 'smaller'\n || value.match(/[0-9]*\\.?[0-9]*(px|em|rem|mm|q|cm|in|pt|pc|%)/)\n )\n\t\t\t||\n\t\t\t\t(key === 'width' || key === 'height') && (\n\t\t\t\t\tvalue.match(/[0-9\\.]*(px|em|rem|%)/)\n\t\t\t\t)\n\t\t\t|| // Reference #520\n\t\t\t\t(key === 'direction' && value.match(/^ltr|rtl|initial|inherit$/))\n\t\t\t) result += key + ': ' + value + ';';\n\t\t}\n\t});\n\treturn result;\n}", "function makeStyles(styleOrFunction) {\n // Create graph of inputs to map to output.\n var graph = new Map();\n return function (options) {\n if (options === void 0) { options = {}; }\n var theme = options.theme;\n var win = (0,_fluentui_react_window_provider__WEBPACK_IMPORTED_MODULE_0__.useWindow)();\n var contextualTheme = (0,_useTheme__WEBPACK_IMPORTED_MODULE_1__.useTheme)();\n theme = theme || contextualTheme;\n var renderer = _styleRenderers_mergeStylesRenderer__WEBPACK_IMPORTED_MODULE_2__.mergeStylesRenderer;\n var id = renderer.getId();\n var isStyleFunction = typeof styleOrFunction === 'function';\n var path = isStyleFunction ? [id, win, theme] : [id, win];\n var value = graphGet(graph, path);\n if (!value) {\n var styles = isStyleFunction ? styleOrFunction(theme) : styleOrFunction;\n value = _styleRenderers_mergeStylesRenderer__WEBPACK_IMPORTED_MODULE_2__.mergeStylesRenderer.renderStyles(styles, { targetWindow: win, rtl: !!theme.rtl });\n graphSet(graph, path, value);\n }\n return value;\n };\n}", "function makeStyles(styleOrFunction) {\n // Create graph of inputs to map to output.\n var graph = new Map();\n return function (options) {\n if (options === void 0) { options = {}; }\n var theme = options.theme;\n var win = (0,_fluentui_react_window_provider__WEBPACK_IMPORTED_MODULE_0__.useWindow)();\n var contextualTheme = (0,_useTheme__WEBPACK_IMPORTED_MODULE_1__.useTheme)();\n theme = theme || contextualTheme;\n var renderer = _styleRenderers_mergeStylesRenderer__WEBPACK_IMPORTED_MODULE_2__.mergeStylesRenderer;\n var id = renderer.getId();\n var isStyleFunction = typeof styleOrFunction === 'function';\n var path = isStyleFunction ? [id, win, theme] : [id, win];\n var value = graphGet(graph, path);\n if (!value) {\n var styles = isStyleFunction ? styleOrFunction(theme) : styleOrFunction;\n value = _styleRenderers_mergeStylesRenderer__WEBPACK_IMPORTED_MODULE_2__.mergeStylesRenderer.renderStyles(styles, { targetWindow: win, rtl: !!theme.rtl });\n graphSet(graph, path, value);\n }\n return value;\n };\n}", "function getStyle() {\n if (props.white) return styles.white;\n else if (props.red) return styles.red;\n else if (props.blue) return styles.blue;\n else if (props.green) return styles.green;\n else if (props.black) return styles.black;\n else {\n return styles.white;\n }\n }", "function validStyles(styleAttr){\n\tvar result = '';\n\tvar styleArray = styleAttr.split(';');\n\tangular.forEach(styleArray, function(value){\n\t\tvar v = value.split(':');\n\t\tif(v.length == 2){\n\t\t\tvar key = trim(angular.lowercase(v[0]));\n\t\t\tvar value = trim(angular.lowercase(v[1]));\n\t\t\tif(\n\t\t\t\t(key === 'color' || key === 'background-color') && (\n\t\t\t\t\tvalue.match(/^rgb\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^rgba\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^hsl\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^hsla\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^#[0-9a-f]{3,6}$/i)\n\t\t\t\t\t|| value.match(/^[a-z]*$/i)\n\t\t\t\t)\n\t\t\t||\n\t\t\t\tkey === 'text-align' && (\n\t\t\t\t\tvalue === 'left'\n\t\t\t\t\t|| value === 'right'\n\t\t\t\t\t|| value === 'center'\n\t\t\t\t\t|| value === 'justify'\n\t\t\t\t)\n\t\t\t||\n\t\t\t\tkey === 'float' && (\n\t\t\t\t\tvalue === 'left'\n\t\t\t\t\t|| value === 'right'\n\t\t\t\t\t|| value === 'none'\n\t\t\t\t)\n\t\t\t||\n\t\t\t\t(key === 'width' || key === 'height') && (\n\t\t\t\t\tvalue.match(/[0-9\\.]*(px|em|rem|%)/)\n\t\t\t\t)\n\t\t\t|| // Reference #520\n\t\t\t\t(key === 'direction' && value.match(/^ltr|rtl|initial|inherit$/))\n\t\t\t) result += key + ': ' + value + ';';\n\t\t}\n\t});\n\treturn result;\n}", "function getStyleObjectCss(element) {\n var sheets = document.styleSheets, o = {};\n for (var i in sheets) {\n try {\n if (typeof (sheets[i].cssRules) !== 'undefined') {\n var rules = sheets[i].rules || sheets[i].cssRules;\n for (var r in rules) {\n if (element.is(rules[r].selectorText)) {\n o = $.extend(o, css2json(rules[r].style), css2json(element.attr('style')));\n }\n }\n }\n } catch (e) {\n return;\n }\n\n }\n return o;\n }", "function a(t){return getComputedStyle(t)}", "function validStyles(styleAttr){\n\tvar result = '';\n\tvar styleArray = styleAttr.split(';');\n\tangular.forEach(styleArray, function(value){\n\t\tvar v = value.split(':');\n\t\tif(v.length == 2){\n\t\t\tvar key = trim(angular.lowercase(v[0]));\n\t\t\tvar value = trim(angular.lowercase(v[1]));\n\t\t\tif(\n\t\t\t\t(key === 'color' || key === 'background-color') && (\n\t\t\t\t\tvalue.match(/^rgb\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^rgba\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^hsl\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^hsla\\([0-9%,\\. ]*\\)$/i)\n\t\t\t\t\t|| value.match(/^#[0-9a-f]{3,6}$/i)\n\t\t\t\t\t|| value.match(/^[a-z]*$/i)\n\t\t\t\t)\n\t\t\t||\n\t\t\t\tkey === 'text-align' && (\n\t\t\t\t\tvalue === 'left'\n\t\t\t\t\t|| value === 'right'\n\t\t\t\t\t|| value === 'center'\n\t\t\t\t\t|| value === 'justify'\n\t\t\t\t)\n\t\t\t||\n\t\t\t\tkey === 'float' && (\n\t\t\t\t\tvalue === 'left'\n\t\t\t\t\t|| value === 'right'\n\t\t\t\t\t|| value === 'none'\n\t\t\t\t)\n\t\t\t||\n\t\t\t\t(key === 'width' || key === 'height') && (\n\t\t\t\t\tvalue.match(/[0-9\\.]*(px|em|rem|%)/)\n\t\t\t\t)\n\t\t\t) result += key + ': ' + value + ';';\n\t\t}\n\t});\n\treturn result;\n}", "function getStyles(container) {\n\t return container.values().map(function (style) { return style.getStyles(); }).join('');\n\t}", "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "function styleDetector(style, rule, isFallback) {\n for (var prop in style) {\n var value = style[prop];\n\n if (Array.isArray(value)) {\n // Check double arrays to avoid recursion.\n if (!Array.isArray(value[0])) {\n if (prop === 'fallbacks') {\n for (var index = 0; index < style.fallbacks.length; index++) {\n style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);\n }\n\n continue;\n }\n\n style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n style.fallbacks = styleDetector(style.fallbacks, rule, true);\n continue;\n }\n\n style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values\n\n if (!style[prop].length) delete style[prop];\n } // Maybe a computed value resulting in an empty string\n else if (style[prop] === '') delete style[prop];\n }\n\n return style;\n}", "function n(e){return getComputedStyle(e)}", "getFCCProps(props = this.props) {\n\n // get all the props that are not callbacks for the component's methods\n var FCCProps = {};\n for (const key in props) {\n if (props.hasOwnProperty(key)) {\n if (!((typeof props[key] === 'function') && (typeof this[key] === 'function'))) {\n FCCProps[key] = props[key];\n }\n }\n }\n\n FCCProps.theme = this.getFCCStyle(props)\n\n return FCCProps\n }", "processStyle(style) {\n return this.constructor.processStyle(style)\n }", "function s(e){return getComputedStyle(e)}" ]
[ "0.62761724", "0.62761724", "0.62759346", "0.6259358", "0.6161896", "0.6100022", "0.60847485", "0.60318816", "0.6022034", "0.6021987", "0.6020295", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.6004265", "0.5981759", "0.59310865", "0.5845017", "0.5810931", "0.5810931", "0.5803339", "0.57682186", "0.5758942", "0.57505983", "0.57067704", "0.56126463", "0.5601374", "0.55934477", "0.5545274", "0.5545274", "0.5540655", "0.5540655", "0.55221814", "0.55164534", "0.54940623", "0.54940623", "0.548833", "0.54425037", "0.54350203", "0.5426539", "0.5424659", "0.5420941", "0.53723764", "0.53723764", "0.53723764", "0.53582233", "0.5356764", "0.5345199", "0.53440726" ]
0.6068873
32
Returns a function which generates unique class names based on counters. When new generator function is created, rule counter is reset. We need to reset the rule counter for SSR for each request. It's inspired by
function createGenerateClassName() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$disableGloba = options.disableGlobal, disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba, _options$productionPr = options.productionPrefix, productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr, _options$seed = options.seed, seed = _options$seed === void 0 ? '' : _options$seed; var seedPrefix = seed === '' ? '' : "".concat(seed, "-"); var ruleCounter = 0; var getNextCounterId = function getNextCounterId() { ruleCounter += 1; if (false) {} return ruleCounter; }; return function (rule, styleSheet) { var name = styleSheet.options.name; // Is a global static MUI style? if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) { // We can use a shorthand class name, we never use the keys to style the components. if (pseudoClasses.indexOf(rule.key) !== -1) { return "Mui-".concat(rule.key); } var prefix = "".concat(seedPrefix).concat(name, "-").concat(rule.key); if (!styleSheet.options.theme[nested] || seed !== '') { return prefix; } return "".concat(prefix, "-").concat(getNextCounterId()); } if (true) { return "".concat(seedPrefix).concat(productionPrefix).concat(getNextCounterId()); } var suffix = "".concat(rule.key, "-").concat(getNextCounterId()); // Help with debuggability. if (styleSheet.options.classNamePrefix) { return "".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, "-").concat(suffix); } return "".concat(seedPrefix).concat(suffix); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGenerateClassName() {\n\t var ruleCounter = 0;\n\n\t if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined') {\n\t generatorCounter += 1;\n\n\t if (generatorCounter > 2) {\n\t // eslint-disable-next-line no-console\n\t console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n\t }\n\t }\n\n\t return function (rule, sheet) {\n\t ruleCounter += 1;\n\t process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0;\n\n\t if (process.env.NODE_ENV === 'production') {\n\t return 'c' + ruleCounter;\n\t }\n\n\t if (sheet && sheet.options.meta) {\n\t var meta = sheet.options.meta;\n\t // Sanitize the string as will be used in development to prefix the generated\n\t // class name.\n\t meta = meta.replace(new RegExp(/[!\"#$%&'()*+,./:; <=>?@[\\\\\\]^`{|}~]/g), '-');\n\n\t return meta + '-' + rule.key + '-' + ruleCounter;\n\t }\n\n\t return rule.key + '-' + ruleCounter;\n\t };\n\t}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === undefined ? false : _options$dangerouslyU;\n\n var escapeRegex = /([[\\].#*$><+~=|^:(),\"'`])/g;\n var ruleCounter = 0;\n\n if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined') {\n generatorCounter += 1;\n\n if (generatorCounter > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0;\n\n // Code branch the whole block at the expense of more code.\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet && styleSheet.options.meta) {\n var meta = styleSheet.options.meta;\n // Sanitize the string as will be used to prefix the generated class name.\n meta = meta.replace(escapeRegex, '-');\n\n if (meta.match(/^Mui/)) {\n return meta + '-' + rule.key;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n return meta + '-' + rule.key + '-' + ruleCounter;\n }\n }\n\n if (process.env.NODE_ENV === 'production') {\n return 'c' + ruleCounter;\n }\n\n return rule.key + '-' + ruleCounter;\n }\n\n if (process.env.NODE_ENV === 'production') {\n return 'c' + ruleCounter;\n }\n\n if (styleSheet && styleSheet.options.meta) {\n var _meta = styleSheet.options.meta;\n // Sanitize the string as will be used to prefix the generated class name.\n _meta = _meta.replace(escapeRegex, '-');\n\n return _meta + '-' + rule.key + '-' + ruleCounter;\n }\n\n return rule.key + '-' + ruleCounter;\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n false ? undefined : void 0;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (true) {\n return \"\".concat(productionPrefix).concat(seed).concat(ruleCounter);\n } // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n false ? undefined : void 0;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (true) {\n return \"\".concat(productionPrefix).concat(seed).concat(ruleCounter);\n } // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n false ? undefined : void 0;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (true) {\n return \"\".concat(productionPrefix).concat(seed).concat(ruleCounter);\n } // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n process.env.NODE_ENV !== \"production\" ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (process.env.NODE_ENV === 'production') {\n return \"\".concat(productionPrefix).concat(seed).concat(ruleCounter);\n } // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n false ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (true) {\n return \"\".concat(productionPrefix).concat(seed).concat(ruleCounter);\n } // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(seed).concat(ruleCounter);\n } // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : undefined;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (false) {} // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : undefined;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (false) {} // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : undefined;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (false) {} // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : undefined;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (false) {} // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : undefined;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (false) {} // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : undefined;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (false) {} // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n \"development\" !== \"production\" ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0;\n\n if (dangerouslyUseGlobalCSS && styleSheet && styleSheet.options.name) {\n return \"\".concat(safePrefix(styleSheet.options.name), \"-\").concat(rule.key);\n }\n\n if (\"development\" === 'production') {\n return \"\".concat(productionPrefix).concat(seed).concat(ruleCounter);\n } // Help with debuggability.\n\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n return \"\".concat(safePrefix(styleSheet.options.classNamePrefix), \"-\").concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(seed).concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (false) {}\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : undefined; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet) {\n if (styleSheet.options.name) {\n return \"\".concat(styleSheet.options.name, \"-\").concat(rule.key);\n }\n\n if (styleSheet.options.classNamePrefix && \"development\" !== 'production') {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (false) {}\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[nested] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n {\n return \"\".concat(seedPrefix).concat(productionPrefix).concat(getNextCounterId());\n }\n };\n }", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === undefined ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === undefined ? 'jss' : _options$productionPr;\n\n var escapeRegex = /([[\\].#*$><+~=|^:(),\"'`\\s])/g;\n var ruleCounter = 0;\n\n // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n // - You can get away with having multiple class name generators\n // by modifying the `productionPrefix`.\n if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined' && productionPrefix === 'jss') {\n generatorCounter += 1;\n\n if (generatorCounter > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0;\n\n // Code branch the whole block at the expense of more code.\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var prefix = styleSheet.options.classNamePrefix;\n // Sanitize the string as will be used to prefix the generated class name.\n prefix = prefix.replace(escapeRegex, '-');\n\n if (prefix.match(/^Mui/)) {\n return prefix + '-' + rule.key;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n return prefix + '-' + rule.key + '-' + ruleCounter;\n }\n }\n\n if (process.env.NODE_ENV === 'production') {\n return '' + productionPrefix + ruleCounter;\n }\n\n return rule.key + '-' + ruleCounter;\n }\n\n if (process.env.NODE_ENV === 'production') {\n return '' + productionPrefix + ruleCounter;\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = styleSheet.options.classNamePrefix;\n // Sanitize the string as will be used to prefix the generated class name.\n _prefix = _prefix.replace(escapeRegex, '-');\n\n return _prefix + '-' + rule.key + '-' + ruleCounter;\n }\n\n return rule.key + '-' + ruleCounter;\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === undefined ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === undefined ? 'jss' : _options$productionPr;\n\n var escapeRegex = /([[\\].#*$><+~=|^:(),\"'`\\s])/g;\n var ruleCounter = 0;\n\n // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n // - You can get away with having multiple class name generators\n // by modifying the `productionPrefix`.\n if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined' && productionPrefix === 'jss') {\n generatorCounter += 1;\n\n if (generatorCounter > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0;\n\n // Code branch the whole block at the expense of more code.\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var prefix = styleSheet.options.classNamePrefix;\n // Sanitize the string as will be used to prefix the generated class name.\n prefix = prefix.replace(escapeRegex, '-');\n\n if (prefix.match(/^Mui/)) {\n return prefix + '-' + rule.key;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n return prefix + '-' + rule.key + '-' + ruleCounter;\n }\n }\n\n if (process.env.NODE_ENV === 'production') {\n return '' + productionPrefix + ruleCounter;\n }\n\n return rule.key + '-' + ruleCounter;\n }\n\n if (process.env.NODE_ENV === 'production') {\n return '' + productionPrefix + ruleCounter;\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = styleSheet.options.classNamePrefix;\n // Sanitize the string as will be used to prefix the generated class name.\n _prefix = _prefix.replace(escapeRegex, '-');\n\n return _prefix + '-' + rule.key + '-' + ruleCounter;\n }\n\n return rule.key + '-' + ruleCounter;\n };\n}", "function createGenerateClassName() {\n\t var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\t var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n\t dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n\t _options$productionPr = options.productionPrefix,\n\t productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n\t var escapeRegex = /([[\\].#*$><+~=|^:(),\"'`\\s])/g;\n\t var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n\t // so the warning is only triggered in production.\n\t // - We expect a class name generator to be instantiated per new request on the server,\n\t // so the warning is only triggered client side.\n\t // - You can get away with having multiple class name generators\n\t // by modifying the `productionPrefix`.\n\t\n\t if ((\"production\") === 'production' && typeof window !== 'undefined' && productionPrefix === 'jss') {\n\t generatorCounter += 1;\n\t\n\t if (generatorCounter > 2) {\n\t // eslint-disable-next-line no-console\n\t console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n\t }\n\t }\n\t\n\t return function (rule, styleSheet) {\n\t ruleCounter += 1;\n\t false ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\t\n\t if (dangerouslyUseGlobalCSS) {\n\t if (styleSheet && styleSheet.options.classNamePrefix) {\n\t var prefix = styleSheet.options.classNamePrefix; // Sanitize the string as will be used to prefix the generated class name.\n\t\n\t prefix = prefix.replace(escapeRegex, '-');\n\t\n\t if (prefix.match(/^Mui/)) {\n\t return \"\".concat(prefix, \"-\").concat(rule.key);\n\t }\n\t\n\t if (false) {\n\t return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n\t }\n\t }\n\t\n\t if (true) {\n\t return \"\".concat(productionPrefix).concat(ruleCounter);\n\t }\n\t\n\t return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n\t }\n\t\n\t if (true) {\n\t return \"\".concat(productionPrefix).concat(ruleCounter);\n\t }\n\t\n\t if (styleSheet && styleSheet.options.classNamePrefix) {\n\t var _prefix = styleSheet.options.classNamePrefix; // Sanitize the string as will be used to prefix the generated class name.\n\t\n\t _prefix = _prefix.replace(escapeRegex, '-');\n\t return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n\t }\n\t\n\t return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n\t };\n\t}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (false) {\n global.__MUI_GENERATOR_COUNTER__ += 1;\n\n if (global.__MUI_GENERATOR_COUNTER__ > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n if (prefix.match(/^Mui/)) {\n return \"\".concat(prefix, \"-\").concat(rule.key);\n }\n\n if (true) {\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (false) {\n global.__MUI_GENERATOR_COUNTER__ += 1;\n\n if (global.__MUI_GENERATOR_COUNTER__ > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n if (prefix.match(/^Mui/)) {\n return \"\".concat(prefix, \"-\").concat(rule.key);\n }\n\n if (true) {\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (false) {\n global.__MUI_GENERATOR_COUNTER__ += 1;\n\n if (global.__MUI_GENERATOR_COUNTER__ > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet) {\n if (styleSheet.options.name) {\n return \"\".concat(styleSheet.options.name, \"-\").concat(rule.key);\n }\n\n if (styleSheet.options.classNamePrefix && \"development\" !== 'production') {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (false) {\n global.__MUI_GENERATOR_COUNTER__ += 1;\n\n if (global.__MUI_GENERATOR_COUNTER__ > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet) {\n if (styleSheet.options.name) {\n return \"\".concat(styleSheet.options.name, \"-\").concat(rule.key);\n }\n\n if (styleSheet.options.classNamePrefix && \"development\" !== 'production') {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (false) {\n global.__MUI_GENERATOR_COUNTER__ += 1;\n\n if (global.__MUI_GENERATOR_COUNTER__ > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet) {\n if (styleSheet.options.name) {\n return \"\".concat(styleSheet.options.name, \"-\").concat(rule.key);\n }\n\n if (styleSheet.options.classNamePrefix && \"development\" !== 'production') {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (false) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (\"production\" === 'production' && typeof window !== 'undefined') {\n global.__MUI_GENERATOR_COUNTER__ += 1;\n\n if (global.__MUI_GENERATOR_COUNTER__ > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n false ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet) {\n if (styleSheet.options.name) {\n return \"\".concat(styleSheet.options.name, \"-\").concat(rule.key);\n }\n\n if (styleSheet.options.classNamePrefix && \"production\" !== 'production') {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (true) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (true) {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (false) {}\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (true) {\n return \"\".concat(seedPrefix).concat(productionPrefix).concat(getNextCounterId());\n }\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n\n if (process.env.NODE_ENV !== 'production') {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[nested] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (process.env.NODE_ENV === 'production') {\n return \"\".concat(seedPrefix).concat(productionPrefix).concat(ruleCounter);\n }\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (false) {}\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (true) {\n return \"\".concat(seedPrefix).concat(productionPrefix).concat(getNextCounterId());\n }\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined') {\n global.__MUI_GENERATOR_COUNTER__ += 1;\n\n if (global.__MUI_GENERATOR_COUNTER__ > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n process.env.NODE_ENV !== \"production\" ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet) {\n if (styleSheet.options.name) {\n return \"\".concat(styleSheet.options.name, \"-\").concat(rule.key);\n }\n\n if (styleSheet.options.classNamePrefix && process.env.NODE_ENV !== 'production') {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (process.env.NODE_ENV === 'production') {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (process.env.NODE_ENV === 'production') {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? warning__WEBPACK_IMPORTED_MODULE_0___default()(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : undefined;\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_1__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n true ? warning__WEBPACK_IMPORTED_MODULE_0___default()(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : undefined;\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_1__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n return function (rule, styleSheet) {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(ruleCounter);\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(ruleCounter); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (process.env.NODE_ENV !== 'production') {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[nested] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (process.env.NODE_ENV === 'production') {\n return \"\".concat(seedPrefix).concat(productionPrefix).concat(getNextCounterId());\n }\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (\"development\" !== 'production') {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_nested.default] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (\"development\" === 'production') {\n return \"\".concat(seedPrefix).concat(productionPrefix).concat(getNextCounterId());\n }\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n };\n var _options$disableGloba = options.disableGlobal, disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba, _options$productionPr = options.productionPrefix, productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr, _options$seed = options.seed, seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n var getNextCounterId = function getNextCounterId1() {\n ruleCounter += 1;\n if (ruleCounter >= 10000000000) console.warn([\n 'Material-UI: You might have a memory leak.',\n 'The ruleCounter is not supposed to grow that much.'\n ].join(''));\n return ruleCounter;\n };\n return function(rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) return \"Mui-\".concat(rule.key);\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n if (!styleSheet.options.theme[_nestedDefault.default] || seed !== '') return prefix;\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n if (styleSheet.options.classNamePrefix) return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined') {\n global.__MUI_GENERATOR_COUNTER__ += 1;\n\n if (global.__MUI_GENERATOR_COUNTER__ > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n process.env.NODE_ENV !== \"production\" ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n if (prefix.match(/^Mui/)) {\n return \"\".concat(prefix, \"-\").concat(rule.key);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (process.env.NODE_ENV === 'production') {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (process.env.NODE_ENV === 'production') {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined') {\n global.__MUI_GENERATOR_COUNTER__ += 1;\n\n if (global.__MUI_GENERATOR_COUNTER__ > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n process.env.NODE_ENV !== \"production\" ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n if (prefix.match(/^Mui/)) {\n return \"\".concat(prefix, \"-\").concat(rule.key);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (process.env.NODE_ENV === 'production') {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (process.env.NODE_ENV === 'production') {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr;\n var ruleCounter = 0; // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n\n if (\"development\" === 'production' && typeof window !== 'undefined') {\n global.__MUI_GENERATOR_COUNTER__ += 1;\n\n if (global.__MUI_GENERATOR_COUNTER__ > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n \"development\" !== \"production\" ? (0, _warning.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0; // Code branch the whole block at the expense of more code.\n\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n if (prefix.match(/^Mui/)) {\n return \"\".concat(prefix, \"-\").concat(rule.key);\n }\n\n if (\"development\" !== 'production') {\n return \"\".concat(prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n }\n\n if (\"development\" === 'production') {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n if (\"development\" === 'production') {\n return \"\".concat(productionPrefix).concat(ruleCounter);\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = safePrefix(styleSheet.options.classNamePrefix);\n\n return \"\".concat(_prefix, \"-\").concat(rule.key, \"-\").concat(ruleCounter);\n }\n\n return \"\".concat(rule.key, \"-\").concat(ruleCounter);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__.default] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__.default] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__.default] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "generateId() {\n if (!this.constructor.generatedIdIndex) this.constructor.generatedIdIndex = 0;\n return '_generated' + this.$name + ++this.constructor.generatedIdIndex;\n }", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (true) {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[_ThemeProvider_nested__WEBPACK_IMPORTED_MODULE_0__[\"default\"]] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (false) {}\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}", "function generateClassName(str, rule, sheet) {\n if (sheet && sheet.options.meta) str += sheet.options.meta;\n\n var hash = (0, _murmurhash3_gc2['default'])(str);\n\n // There is no name if `jss.createRule(style)` was used.\n return rule.name ? rule.name + '-' + hash : hash;\n}", "function counterMaker() {\n let count = 0;\n return function counter() {\n count++;\n }\n}", "function uniquegen() {\n return '#btc-reg-' + uniquegen.counter++;\n }", "generateRuleId(){\n\n\treturn (\"R-\"+this.props.advertiserId+\"-\"+this.props.addId+\"-\"+Date.now());\n\t}", "function generateID() {\n let count = 0\n return () => {\n count++\n return count\n }\n}", "function getClassName(num) {\n return num % 2 ? \"counter color-one\" : \"counter color-two\";\n}", "function labelMaker(label) {\n // START\n let count = 0;\n return function(){\n return label+'-'+count++;\n };\n // END\n}", "getIdGenerator() {\n let lastId = 0;\n return function() {\n lastId += 1;\n return lastId;\n };\n }", "function reName() {\n\tvar counter = 65; //65 = ascii A\n\tvar shortClasses = {};\n\tObject.keys(minStruct).forEach((state) => {\n\t\tvar longClass = minStruct[state].newClass;\n\t\tif (!shortClasses[longClass]){\n\t\t\tshortClasses[longClass] = String.fromCharCode(counter);\n\t\t\tcounter++\n\t\t}\n\t});\n\t\n\t\n\tconsole.log(shortClasses);\n\t\n\n\tObject.keys(minStruct).forEach((state) => {\n\t\tvar shortClass = shortClasses[minStruct[state].newClass];\n\t\tminStruct[state].class=shortClass;\n\t\tminStruct[state].newClass=null;\n\t});\n\t\n\n\tconsole.log(\"new class count =\" +(counter-65));\n\treturn (counter-65);\n}", "uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }", "uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }", "uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }", "function Generator() {} // 80", "function labelMaker1(label) {\n // START\n let count = 0;\n return function(counter){\n if(!isNaN(counter))\n count = counter\n return label+'-'+count++;\n };\n // END\n}", "function generateUniqueName() {\n return uuid().replace(/-/g, '')\n .replace(/1/g, 'one')\n .replace(/2/g, 'two')\n .replace(/3/g, 'three')\n .replace(/4/g, 'four')\n .replace(/5/g, 'five')\n .replace(/6/g, 'six')\n .replace(/7/g, 'seven')\n .replace(/8/g, 'eight')\n .replace(/9/g, 'nine')\n .replace(/0/g, 'zero');\n}", "function generate() {\n\t\n\t var str = '';\n\t\n\t var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001);\n\t\n\t if (seconds === previousSeconds) {\n\t counter++;\n\t } else {\n\t counter = 0;\n\t previousSeconds = seconds;\n\t }\n\t\n\t str = str + encode(alphabet.lookup, version);\n\t str = str + encode(alphabet.lookup, clusterWorkerId);\n\t if (counter > 0) {\n\t str = str + encode(alphabet.lookup, counter);\n\t }\n\t str = str + encode(alphabet.lookup, seconds);\n\t\n\t return str;\n\t}", "function generate() {\n\t\n\t var str = '';\n\t\n\t var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001);\n\t\n\t if (seconds === previousSeconds) {\n\t counter++;\n\t } else {\n\t counter = 0;\n\t previousSeconds = seconds;\n\t }\n\t\n\t str = str + encode(alphabet.lookup, version);\n\t str = str + encode(alphabet.lookup, clusterWorkerId);\n\t if (counter > 0) {\n\t str = str + encode(alphabet.lookup, counter);\n\t }\n\t str = str + encode(alphabet.lookup, seconds);\n\t\n\t return str;\n\t}", "function createCounter(){\n var counter = 0;\n return function(){\n return ++counter;\n }\n}", "function GeneratorClass () {}", "function generate() {\n\n var str = '';\n\n var seconds = Math.round((Date.now() - REDUCE_TIME) * 0.01);\n\n if (seconds == previousSeconds) {\n counter++;\n } else {\n counter = 0;\n previousSeconds = seconds;\n }\n\n str = str + encode(alphabet.lookup, version);\n str = str + encode(alphabet.lookup, clusterWorkerId);\n if (counter > 0) {\n str = str + encode(alphabet.lookup, counter);\n }\n str = str + encode(alphabet.lookup, seconds);\n\n return str;\n}", "function generate() {\n\n var str = '';\n\n var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001);\n\n if (seconds === previousSeconds) {\n counter++;\n } else {\n counter = 0;\n previousSeconds = seconds;\n }\n\n str = str + encode(alphabet.lookup, version);\n str = str + encode(alphabet.lookup, clusterWorkerId);\n if (counter > 0) {\n str = str + encode(alphabet.lookup, counter);\n }\n str = str + encode(alphabet.lookup, seconds);\n\n return str;\n}", "function generate() {\n\n var str = '';\n\n var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001);\n\n if (seconds === previousSeconds) {\n counter++;\n } else {\n counter = 0;\n previousSeconds = seconds;\n }\n\n str = str + encode(alphabet.lookup, version);\n str = str + encode(alphabet.lookup, clusterWorkerId);\n if (counter > 0) {\n str = str + encode(alphabet.lookup, counter);\n }\n str = str + encode(alphabet.lookup, seconds);\n\n return str;\n}", "function makeCounter() {\n return function() {\n let counter = 0;\n counter += 1;\n return counter;\n };\n}", "function makeCounter() {\n var count = 0;\n return function() {\n var t = count;\n count = count + 1;\n return t;\n };\n}", "function generateId(type){\n if(idCount[type] === undefined) idCount[type] = 0;\n\n var count = idCount[type]++;\n return '$generated-' + type + '-' + count; \n }", "function uniqueGen(n, cache) {\n return cache[n] || (cache[n] = '#sug-reg-' + uniqueGen.counter++);\n }", "function makeCounter() {\n var currentCount = 1;\n\n function counter() {\n return currentCount++;\n }\n\n counter.set = function (value) {\n currentCount = value;\n };\n \n counter.reset = function () {\n currentCount = 1;\n };\n return counter;\n\n}", "function generate() {\r\n\r\n var str = '';\r\n\r\n var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001);\r\n\r\n if (seconds === previousSeconds) {\r\n counter++;\r\n } else {\r\n counter = 0;\r\n previousSeconds = seconds;\r\n }\r\n\r\n str = str + encode_1(alphabet_1.lookup, version);\r\n str = str + encode_1(alphabet_1.lookup, clusterWorkerId$1);\r\n if (counter > 0) {\r\n str = str + encode_1(alphabet_1.lookup, counter);\r\n }\r\n str = str + encode_1(alphabet_1.lookup, seconds);\r\n\r\n return str;\r\n}", "function createRequestId() {\n if (requestCount >= MAX_NUM_REQUESTS) {\n requestCount = 0;\n }\n return new Date().getTime() + '_' + (requestCount++);\n }", "function generate() {\r\n\r\n var str = '';\r\n\r\n var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001);\r\n\r\n if (seconds === previousSeconds) {\r\n counter++;\r\n } else {\r\n counter = 0;\r\n previousSeconds = seconds;\r\n }\r\n\r\n str = str + encode_1(alphabet_1.lookup, version);\r\n str = str + encode_1(alphabet_1.lookup, clusterWorkerId);\r\n if (counter > 0) {\r\n str = str + encode_1(alphabet_1.lookup, counter);\r\n }\r\n str = str + encode_1(alphabet_1.lookup, seconds);\r\n\r\n return str;\r\n }", "function Generator() {} // 84", "function nextInstanceName() {\n const result = `instance-${instanceCounter}`;\n instanceCounter++;\n return result;\n}", "function counterCreator(incrementBy){\n\tvar count = 0 ;\n\t\n\treturn function(){\n\t\t count+=incrementBy;\n\t\t return count;\n\t}\n}", "function toPartialClassName(param) {\n switch (param) {\n case 0 : \n return \"1/2\";\n case 1 : \n return \"1/3\";\n case 2 : \n return \"2/3\";\n case 3 : \n return \"1/4\";\n case 4 : \n return \"3/4\";\n case 5 : \n return \"1/5\";\n case 6 : \n return \"2/5\";\n case 7 : \n return \"3/5\";\n case 8 : \n return \"4/5\";\n case 9 : \n return \"1/6\";\n case 10 : \n return \"5/6\";\n \n }\n }", "function createCounter(start, step) {\n\n function* gen(start, step) {\n while (true) {\n yield start;\n start += step;\n }\n }\n\n var generate = gen(start, step);\n\n return function () {\n return generate.next().value;\n }\n\n}", "function generateUniqueClassCode() {\n var nextCode;\n\n return Classroom.find({}).select('signUpCode -_id').exec()\n .then(function(existingCodes) {\n\n var matchingCodes = [];\n do {\n nextCode = generateClassCode();\n matchingCodes = existingCodes.filter(function(existingCode) {\n return existingCode.signUpCode === nextCode;\n });\n } while (matchingCodes.length > 0);\n\n return nextCode;\n });\n}", "function generateMutateName_1() {\n\t//var not_mutate = total_for_mutate.filter(function(elem){ return already_mutate.indexOf(elem) < 0; });\n\tconsole.log(\"############### \" + total_for_mutate.length);\n\tif( !_.isEmpty(total_for_mutate) ) {\n\t\tvar seed = _.random(0, total_for_mutate.length - 1);\n\t\tvar random_mutate = total_for_mutate[seed].symbol;\n\t\tconsole.log(\"#### Random mutate: \" + random_mutate.name.name);\n\t\t//already_mutate.push(random_mutate);\n\t\t//set the iterate based on the number of references of the variable\n\t\tcntr_set.iterate = generateIterate(total_for_mutate[seed].ref);\n\n\t\treturn random_mutate;\n\t}\n\telse\n\t\treturn \"GENERATE_NO_NAME\";\n}", "function generateID (idx) {\n return ('jsrch_' + idx + '_' + new Date().getTime());\n }", "function counterFactory(value) {\n return {\n inc: function() {\n value += 1;\n return value;\n },\n dec: function() {\n value -= 1;\n return value;\n }\n }\n\n}", "nextId() {\n this.uniqueId = this.uniqueId || 0\n return this.uniqueId++\n}", "function tallyCounter() {\n let total = 0;\n\n return function count() {\n total++;\n return total;\n };\n}", "function gensymf(prefix) {\n var number = 0;\n return function () {\n number += 1;\n return prefix + number;\n };\n}", "function makeCounter() {\n let count = 0;\n\n return function() {\n return count++;\n };\n}", "toString() {\n return `${this.classString}: ${this.count}`;\n }" ]
[ "0.7918563", "0.698373", "0.69209784", "0.68974537", "0.68974537", "0.68974537", "0.6842054", "0.68130314", "0.67980975", "0.67830986", "0.67830986", "0.67830986", "0.67830986", "0.67830986", "0.67830986", "0.6740682", "0.6700402", "0.6678807", "0.6598167", "0.6598167", "0.6586245", "0.6486643", "0.6486643", "0.644993", "0.644993", "0.644993", "0.6396226", "0.6376011", "0.6375892", "0.63720655", "0.63556075", "0.6308562", "0.6308562", "0.63052064", "0.63052064", "0.63043404", "0.63043404", "0.63043404", "0.63043404", "0.63043404", "0.63043404", "0.62834793", "0.6262424", "0.6262394", "0.62603694", "0.62603694", "0.623943", "0.6191115", "0.6191115", "0.6191115", "0.61866647", "0.61615556", "0.61615556", "0.61615556", "0.61268973", "0.6063824", "0.5890889", "0.5802375", "0.57738906", "0.57216686", "0.56670946", "0.56670046", "0.56668854", "0.5647273", "0.5647273", "0.5647273", "0.56089276", "0.55985165", "0.5567682", "0.556681", "0.556681", "0.5562503", "0.5543419", "0.5533849", "0.55159545", "0.55159545", "0.5509246", "0.54805565", "0.5472956", "0.546983", "0.54410315", "0.54270595", "0.54138637", "0.53988814", "0.5373948", "0.53679717", "0.534487", "0.5333474", "0.5300678", "0.5298072", "0.52894884", "0.52872854", "0.52843136", "0.5276577", "0.5260059", "0.52558815", "0.52540386", "0.52448255" ]
0.6474656
25
Get a function to be used for $ref replacement.
function getReplaceRef(container, sheet) { return function (match, key) { var rule = container.getRule(key) || sheet && sheet.getRule(key); if (rule) { rule = rule; return rule.selector; } false ? 0 : void 0; return key; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fnref(name){\n return mkdat(\"fnref\", name);\n }", "function createRef() {\n var func = function setRef(node) {\n func.current = node;\n };\n return func;\n}", "function composeRef() {\n for (\n var _len = arguments.length, refs = new Array(_len), _key = 0;\n _key < _len;\n _key++\n ) {\n refs[_key] = arguments[_key];\n }\n\n return function(node) {\n refs.forEach(function(ref) {\n fillRef(ref, node);\n });\n };\n }", "function getReplaceRef(container) {\n\t return function (match, key) {\n\t var rule = container.getRule(key);\n\t if (rule) return rule.selector;\n\t (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n\t return key;\n\t };\n\t }", "function getReplaceRef(container) {\n\t return function (match, key) {\n\t var rule = container.getRule(key);\n\t if (rule) return rule.selector;\n\t (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n\t return key;\n\t };\n\t }", "function funcReplacer(match, id) {\n return functions[id];\n }", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n var refList = refs.filter(function (ref) {\n return ref;\n });\n if (refList.length <= 1) {\n return refList[0];\n }\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function getReplaceRef(container) {\n return function (match, name) {\n var rule = container.getRule(name);\n if (rule) return rule.selector;\n _get__('warning')(false, '[JSS] Could not find the referenced rule %s. \\r\\n%s', name, rule);\n return name;\n };\n }", "function getReplaceRef(container, sheet) {\n return function(match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n if (rule) return rule.selector;\n warning__default['default'](false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\");\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n return rule.selector;\n }\n\n false ? 0 : void 0;\n return key;\n };\n }", "function Fay$$readRef(ref,x){\n return ref.value;\n}", "function refReplacer() {\n const modelPaths = new Map();\n const paths = new Map();\n let init = null;\n\n return function(field, value) {\n // `this` points to parent object of given value - some object or array\n const pathPart = modelPaths.get(this) + (Array.isArray(this) ? `[${field}]` : `.${ field}`);\n\n // check if `objOrPath` has \"reference\"\n const isComplex = value === Object(value);\n if (isComplex) {\n modelPaths.set(value, pathPart);\n }\n \n const savedPath = paths.get(value) || '';\n if (!savedPath && isComplex) {\n const valuePath = pathPart.replace(/undefined\\.\\.?/,'');\n paths.set(value, valuePath);\n }\n\n const prefixPath = savedPath[0] === '[' ? '$' : '$.';\n let val = savedPath ? `$ref:${prefixPath}${savedPath}` : value;\n if (init === null) {\n init = value;\n } else if (val === init) {\n val = '$ref:$';\n }\n return val;\n };\n}", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n false ? undefined : void 0;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n false ? undefined : void 0;\n return key;\n };\n }", "function returnNewFunctionOf(functionToBeCopied,thisValue){\n return functionToBeCopied.bind(thisValue)\n}", "function getFunc() { return \"gate\"; }", "function ReferenceAggregateFn (reference) {\n this._ref = reference;\n }", "function returnNewFunctionOf(functionToBeCopied, thisValue){\n\treturn functionToBeCopied.bind(thisValue);\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : void 0;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : void 0;\n return key;\n };\n }", "function returnNewFunctionOf(functionToBeCopied, thisValue) {\n return functionToBeCopied.bind(thisValue);\n}", "function composeRef() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n return function (node) {\n refs.forEach(function (ref) {\n fillRef(ref, node);\n });\n };\n}", "function useConstant(fn) {\n var ref = __WEBPACK_IMPORTED_MODULE_0_react___default.a.useRef();\n\n if (!ref.current) {\n ref.current = {\n v: fn()\n };\n }\n\n return ref.current.v;\n}", "function Fn($1) { return function($2) { return Function_ ([$1, $2]); }; }", "function getFunction(ptr) {\n return wrapFunction(table.get(ptr), setargc);\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : undefined;\n return key;\n };\n }", "function myFnCall(fn) {\n return new Function('return ' + fn)();\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \" + key + \" in \" + (container.options.meta || container.toString()) + \".\") : undefined;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(false, \"[JSS] Could not find the referenced rule \" + key + \" in \" + (container.options.meta || container.toString()) + \".\") : undefined;\n return key;\n };\n }", "function composeRef$2() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n fillRef$2(ref, node);\n });\n };\n}", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_1__.default)(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : 0;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_1__.default)(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : 0;\n return key;\n };\n }", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_1__.default)(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : 0;\n return key;\n };\n }", "function getCFunc(ident) {\n try {\n var func = Module['_' + ident]; // closure exported function\n if (!func) func = eval('_' + ident); // explicit lookup\n } catch (e) {}\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n return func;\n }", "function ref(name) {\n return builder => {\n if (name === \"this\") {\n return _create_node__WEBPACK_IMPORTED_MODULE_0__[\"thisReference\"](builder.token(_read_token_builder__WEBPACK_IMPORTED_MODULE_1__[\"id\"](\"this\")));\n } else if (name.startsWith(\"@\")) {\n return _create_node__WEBPACK_IMPORTED_MODULE_0__[\"argReference\"](builder.token(_read_token_builder__WEBPACK_IMPORTED_MODULE_1__[\"arg\"](name)));\n } else {\n return _create_node__WEBPACK_IMPORTED_MODULE_0__[\"varReference\"](builder.token(_read_token_builder__WEBPACK_IMPORTED_MODULE_1__[\"id\"](name)));\n }\n };\n}", "function x(t){return\"function\"==typeof t?t:function(){return t}}", "function defaultResolveFn(source, args, _ref) {\n var fieldName = _ref.fieldName;\n\n // ensure source is a value for which property access is acceptable.\n if (typeof source !== 'number' && typeof source !== 'string' && source) {\n var property = source[fieldName];\n return typeof property === 'function' ? property.call(source) : property;\n }\n}", "function Fay$$writeRef(ref,x){\n ref.value = x;\n}", "function FixedValueGetter(value){\n return function(){return value};\n}", "function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : void 0;\n return key;\n };\n }" ]
[ "0.6649858", "0.64558005", "0.61212206", "0.60655695", "0.60655695", "0.60599333", "0.59819967", "0.5978643", "0.5965357", "0.5952257", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.5899973", "0.58624095", "0.58603877", "0.5857155", "0.58349156", "0.582107", "0.582107", "0.57546806", "0.572931", "0.5696955", "0.56897134", "0.56876874", "0.56876874", "0.56876874", "0.56876874", "0.56876874", "0.56876874", "0.56876874", "0.56876874", "0.56876874", "0.56876874", "0.56876874", "0.56876874", "0.56876874", "0.56651896", "0.56651896", "0.5648153", "0.5627278", "0.56212825", "0.5586324", "0.55839837", "0.5542479", "0.5542479", "0.5542479", "0.5542479", "0.5542479", "0.5542479", "0.5542479", "0.5542479", "0.5542479", "0.5542479", "0.5542479", "0.5542479", "0.5542479", "0.5533323", "0.5528513", "0.5528513", "0.5522178", "0.55213743", "0.55213743", "0.55213743", "0.5499294", "0.54707885", "0.5465891", "0.54640704", "0.5457569", "0.5456074", "0.5450386" ]
0.58362913
45
Clones the object and adds a camel cased property version.
function addCamelCasedVersion(obj) { var regExp = /(-[a-z])/g; var replace = function replace(str) { return str[1].toUpperCase(); }; var newObj = {}; for (var _key in obj) { newObj[_key] = obj[_key]; newObj[_key.replace(regExp, replace)] = obj[_key]; } return newObj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n }", "function addCamelCasedVersion(obj) {\n\t var regExp = /(-[a-z])/g;\n\t var replace = function replace(str) {\n\t return str[1].toUpperCase();\n\t };\n\t var newObj = {};\n\t for (var key in obj) {\n\t newObj[key] = obj[key];\n\t newObj[key.replace(regExp, replace)] = obj[key];\n\t }\n\t return newObj;\n\t}", "function addCamelCasedVersion(obj) {\n\t var regExp = /(-[a-z])/g;\n\t var replace = function replace(str) {\n\t return str[1].toUpperCase();\n\t };\n\t var newObj = {};\n\t for (var key in obj) {\n\t newObj[key] = obj[key];\n\t newObj[key.replace(regExp, replace)] = obj[key];\n\t }\n\t return newObj;\n\t}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n\n var newObj = {};\n\n for (var _key in obj) {\n newObj[_key] = obj[_key];\n newObj[_key.replace(regExp, replace)] = obj[_key];\n }\n\n return newObj;\n }", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace1(str) {\n return str[1].toUpperCase();\n };\n var newObj = {\n };\n for(var _key in obj){\n newObj[_key] = obj[_key];\n newObj[_key.replace(regExp, replace)] = obj[_key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n var newObj = {};\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n return newObj;\n}", "function addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n\n var newObj = {};\n\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n\n return newObj;\n}", "static initialize(obj, version) { \n obj['version'] = version;\n }", "function changePropertyName(){\r\nvar student = {name: \"David Aughan\", class: \"VI\", id: \"12\"};\r\nconsole.log(student)\r\nconsole.log (\"Show diferents properties: \\n Name: \" + student.name + \"\\n Class: \"+ student.class +\"\\n Id: \" + student.id)\r\ndelete student.name;\r\nstudent.fullname = \"Tony Stark\";\r\nconsole.log(\"Now has changed the property name. \\n Fullname: \" + student.fullname)\r\nconsole.log(student)\r\n}", "function changePropertyName(){\r\nvar student = {name: \"David Aughan\", class: \"VI\", id: \"12\"};\r\nconsole.log(student)\r\nconsole.log (\"Show diferents properties: \\n Name: \" + student.name + \"\\n Class: \"+ student.class +\"\\n Id: \" + student.id)\r\ndelete student.name;\r\nstudent.fullname = \"Tony Stark\";\r\nconsole.log(\"Now has changed the property name. \\n Fullname: \" + student.fullname)\r\nconsole.log(student)\r\n}", "toString() {\n return JSON.stringify(this.toJson({ preserveCase: true }));\n }", "toString() {\n return JSON.stringify(this.toJson({ preserveCase: true }));\n }", "toString() {\n return JSON.stringify(this.toJson({ preserveCase: true }));\n }", "newBasicProp(...args){\n let newProp = new BasicProperty(...args);\n this.addProperty(newProp);\n }", "toString() {\n return JSON.stringify(this.toJSON({ preserveCase: true }));\n }", "static classifyVersionProperty(propertyName, locked) {\n this._VER_PROPS[propertyName] = locked;\n }", "_generateVersion() {\n this.version = generateSha(this.disco._identities, this.disco._features);\n\n this._notifyVersionChanged();\n }", "function updateName(obj) {\n const obj2 = clone(obj);\n obj2.name = 'Nana'\n return obj2\n}", "function changePropertyName(obj, old, _new) {\n obj[_new] = obj[old];\n delete obj[old];\n}", "function property(version, model, prop) {\n\t\tif (typeof(version) === 'string' && _.has(env.versions, version)) {\n\t\t\tversion = env.versions[version];\n\t\t}\n\t\telse if (!_.isObject(version) || Array.isArray(version)) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn {\n\t\t\tversion: version,\n\t\t\tpath: model + '.properties.' + prop.replace(/\\./g, '.properties.')\n\t\t};\n\t}", "function newProperty(){\r\nvar student = {name: \"David Aughan\", class: \"VI\", id: \"12\"};\r\nconsole.log (\"Old diferents properties: \\n Name: \" + student.name + \"\\n Class: \"+ student.class +\"\\n Id: \" + student.id)\r\nstudent.city = \"Barcelona\";\r\nconsole.log (\"Add new property called city: \\n Name: \" + student.name + \"\\n Class: \"+ student.class +\"\\n Id: \" + student.id + \"\\n City: \" + student.city)\r\n}", "function makeCamelCase(obj, keys) {\n if (!obj) return undefined;\n var newObj = {};\n var keysToRename = keys ? keys : Object.keys(obj);\n keysToRename.forEach(function (key) {\n var _a;\n\n if (obj.hasOwnProperty(key)) {\n // change the key to camelcase.\n var camelCaseKey = key.charAt(0).toLowerCase() + key.substr(1);\n Object.assign(newObj, (_a = {}, _a[camelCaseKey] = obj[key], _a));\n }\n });\n return newObj;\n}", "static initialize(obj, version, title, license) { \n obj['version'] = version;\n obj['title'] = title;\n obj['license'] = license;\n }", "function appendProp(cls, name) {\n\n pushUnique(cls.__props__, name);\n }", "function VersionColumn(options) {\n return function (object, propertyName) {\n __1.getMetadataArgsStorage().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"version\",\n options: options || {}\n });\n };\n}", "function newProperty(){\r\nvar student = {name: \"David Aughan\", class: \"VI\", id: \"12\"};\r\nstudent.city = \"Barcelona\";\r\nconsole.log (\"Add new property called city: \\n City: \" + student.city)\r\n}", "_upgradeProperty(prop) {\n if (this.hasOwnProperty(prop)) {\n let value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }", "_upgradeProperty(prop) {\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }", "function renameKeyObject(obj) {\n obj['fullName'] = obj.name;\n delete obj.name;\n return console.log(obj.fullName);\n}", "function capitalizeType(product) {\n let productClone = { ...product };\n productClone.type = productClone.type.toUpperCase();\n return productClone;\n}", "function fcamelCase(all,letter){return letter.toUpperCase();}// Convert dashed to camelCase; used by the css and data modules", "setProperties(properties) {\n let copied = _.clone(properties)\n copied['UserPoolName'] = this.userPoolName()\n this.properties = copied\n }", "function addNewCheckoutPropertyNameToAllCustomCheckout(propertyName)\n{\n $.each(viewModel.product().Product.CheckoutPropertySettingsList(), function (i, mainElement)\n {\n mainElement.CheckoutPropertySettingKeys.push(new CheckoutPropertySettingKey(propertyName, \"\"));\n });\n}", "function addFullNameProp(obj) {\n var firstName = obj.firstName;\n var lastName = obj['lastName'];\n\n if (firstName && lastName) {\n obj['fullName'] = firstName + ' ' + lastName;\n }\n\n return obj;\n}", "addNewProperty() {\n var newID = 'new' + Date.now();\n this.properties.push(new Property({\n PropertyID: newID,\n Name: '',\n Type: 'String',\n Unit: '',\n DropDownID: '',\n Active: true,\n Order: this.properties.length\n }));\n return newID;\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}", "static getNewProperties() {\n return {};\n }", "toString() {\n return this.version;\n }", "function cssCamel(property) {\n\t\treturn property.replace(/-\\w/g, function (result) {\n\t\t\treturn result.charAt(1).toUpperCase();\n\t\t});\n\t}", "get name() {\n return this._name.toUpperCase();\n }", "get name() {\n return this._name.toUpperCase();\n }", "function addProperties(current, parent, name) {\n\n if (current.name == null) {\n current.name = name;\n }\n current.parent = parent;\n\n if (current.restVerbs) {\n if (current.restVerbs.indexOf('c') > -1) {\n current.createRoute = createRoute;\n }\n if (current.restVerbs.indexOf('r') > -1) {\n current.readRoute = readRoute;\n }\n if (current.restVerbs.indexOf('u') > -1) {\n current.updateRoute = updateRoute;\n }\n if (current.restVerbs.indexOf('d') > -1) {\n current.deleteRoute = deleteRoute;\n }\n } else {\n current.readRoute = readRoute;\n }\n\n return current;\n\n }", "function camelCase() {\n function onProcessStyle(style) {\n if (Array.isArray(style)) {\n // Handle rules like @font-face, which can have multiple styles in an array\n for (var index = 0; index < style.length; index++) {\n style[index] = convertCase(style[index]);\n }\n\n return style;\n }\n\n return convertCase(style);\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop.indexOf('--') === 0) {\n return value;\n }\n\n var hyphenatedProp = hyphenate_style_name(prop); // There was no camel case in place\n\n if (prop === hyphenatedProp) return value;\n rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.\n\n return null;\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}", "function restorePropertyCase( controlClass, properties ) {\n \n if ( $.isEmptyObject( properties ) ) {\n return properties;\n }\n \n // Build a map of properties available on the control.\n // This can be lossy, but it'd be bad practice to have two properties\n // on the same class that differ only in case.\n var mapLowerCaseToCamelCase = {};\n for ( var camelCaseName in controlClass.prototype ) {\n var lowerCaseName = camelCaseName.toLowerCase();\n mapLowerCaseToCamelCase[ lowerCaseName ] = camelCaseName;\n }\n \n var result = {};\n for ( var propertyName in properties ) {\n var camelCaseName = mapLowerCaseToCamelCase[ propertyName.toLowerCase() ];\n if ( camelCaseName ) {\n result[ camelCaseName ] = properties[ propertyName ];\n }\n }\n \n return result;\n }" ]
[ "0.7017152", "0.69527656", "0.69527656", "0.68966556", "0.68778366", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.68753433", "0.6828914", "0.5658942", "0.5224127", "0.5224127", "0.5133949", "0.5133949", "0.5133949", "0.5093539", "0.50846815", "0.5078138", "0.50640005", "0.50521106", "0.49896878", "0.498366", "0.49748603", "0.49044818", "0.48993894", "0.488448", "0.48652664", "0.48508546", "0.48488617", "0.48172987", "0.4812103", "0.47906834", "0.47683844", "0.47322217", "0.4725643", "0.4704291", "0.46582633", "0.46388394", "0.46388394", "0.46256846", "0.46200988", "0.46184152", "0.4614308", "0.4614308", "0.45890537", "0.45831916", "0.45786706" ]
0.67541724
62
Recursive deep style passing function
function iterate(prop, value, options) { if (value == null) return value; if (Array.isArray(value)) { for (var i = 0; i < value.length; i++) { value[i] = iterate(prop, value[i], options); } } else if (typeof value === 'object') { if (prop === 'fallbacks') { for (var innerProp in value) { value[innerProp] = iterate(innerProp, value[innerProp], options); } } else { for (var _innerProp in value) { value[_innerProp] = iterate(prop + "-" + _innerProp, value[_innerProp], options); } } // eslint-disable-next-line no-restricted-globals } else if (typeof value === 'number' && isNaN(value) === false) { var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px. if (unit && !(value === 0 && unit === px)) { return typeof unit === 'function' ? unit(value).toString() : "" + value + unit; } return value.toString(); } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recursiveFn(source, target, key) {\n if (isArray(source) || isObject$1(source)) {\n target = isPrimitive(target) ? isObject$1(source) ? {} : [] : target;\n for (var _key in source) {\n // $FlowFixMe: support computed key here\n setter(target, _key, recursiveFn(source[_key], target[_key], _key));\n // target[key] = recursiveFn(source[key], target[key], key);\n }\n return target;\n }\n return fn(source, target, key);\n }", "function recurse(structure, data, scope) {\n if (!structure || !structure.type) { return; }\n var i=0, l;\n\n // Process the types\n switch (structure.type)\n {\n case 'Program':\n scope = {};\n break;\n \n case 'Function':\n /*\n if we're already handling an outer function, keep the scope around\n */\n scope = (scope.args) ?\n scope :\n {args:{}};\n\n\n\n if (!scope.collectedArgs && \n structure.params &&\n structure.params.length > 0)\n {\n l = structure.params.length\n for (i=0; i<l; i++) {\n\n data['in'][structure.params[i]] = {\n name : structure.params[i],\n type : \"argument\",\n direction : \"in\",\n };\n\n scope.args[structure.params[i]] = true;\n }\n }\n scope.collectedArgs = true;\n\n if (structure.elements) {\n var el = structure.elements.length;\n for (i=0; i<el; i++) {\n recurse(structure.elements[i], data, scope);\n }\n \n }\n break;\n\n case 'FunctionCall':\n\n if (structure.name.name && scope.args[structure.name.name]) {\n if (data['in'][structure.name.name]) {\n delete data['in'][structure.name.name];\n }\n data['out'][structure.name.name] = {\n name : structure.name.name,\n type : \"callback\",\n direction : \"out\",\n };\n }\n \n if (structure.name.base) {\n recurse(structure.name.base, data, scope);\n }\n \n l = structure.arguments.length;\n for (i=0; i<l; i++) {\n recurse(structure.arguments[i], data, scope);\n }\n break;\n\n case \"VariableDeclaration\":\n recurse(structure.value, data, scope);\n break;\n\n case \"VariableStatement\":\n if (structure.declarations) {\n var dd = 0, dl = structure.declarations.length;\n for (dd; dd<dl; dd++) {\n recurse(structure.declarations[dd], data, scope);\n }\n }\n break;\n\n case 'PropertyAccess':\n if (structure.base) {\n recurse(structure.base, data, scope);\n }\n break;\n\n case 'ReturnStatement':\n data['out'][\"return\"] = {\n name : \"return\",\n type : \"return\",\n direction : \"out\",\n };\n\n if (structure.value) {\n recurse(structure.value, data, scope);\n }\n \n break;\n }\n\n if (structure.value && structure.value.type) {\n recurse(structure.value, data, scope);\n }\n\n // Continue down if there are more children elements\n if (structure.elements) {\n l=structure.elements.length;\n for (i=0; i<l; i++) {\n recurse(structure.elements[i], data, scope);\n }\n }\n}", "function recursiveFn(source, target, key) {\n if (isArray(source) || isObject$1(source)) {\n target = isPrimitive(target) ? isObject$1(source) ? {} : [] : target;\n for (var _key in source) {\n // $FlowFixMe: support computed key here\n setter(target, _key, recursiveFn(source[_key], target[_key], _key));\n // target[key] = recursiveFn(source[key], target[key], key);\n }\n return target;\n }\n return fn(source, target, key);\n }", "depthFirstForEach(cb) {\n console.log(this);\n cb(this.value);\n if (this.left !== null) this.left.depthFirstForEach(cb);\n if (this.right !== null) this.right.depthFirstForEach(cb);\n }", "depthFirstForEach(cb) {\n cb(this.value);\n if (this.left) this.left.depthFirstForEach(cb);\n if (this.right) this.right.depthFirstForEach(cb);\n }", "traverse(fn, skipSelf = false) {\n const me = this;\n\n if (!skipSelf) {\n fn.call(me, me);\n }\n if (me.isLoaded) me.children.forEach((child) => child.traverse(fn));\n }", "recurseThis(callback) {\n function insideFunction(array) {\n for (const el of array) {\n if (callback(el)) {\n return el;\n } else if (el[\"nested\"]?.length > 0) {\n var hi = insideFunction(el[\"nested\"]);\n if (hi) {\n return hi;\n }\n }\n }\n }\n return insideFunction(App.todos);\n }", "function recurse(value, fn, fnContinue) {\n\tfunction _recurse(value, fn, fnContinue, state) {\n\t\tvar error;\n\t\tif (state.objs.indexOf(value) !== -1) {\n\t\t\terror = new Error('Circular reference detected (' + state.path + ')');\n\t\t\terror.path = state.path;\n\t\t\tthrow error;\n\t\t}\n\t\tvar obj, key;\n\t\tif (fnContinue && fnContinue(value) === false) {\n\t\t\t// Skip value if necessary.\n\t\t\treturn value;\n\t\t} else if (_.isArray(value)) {\n\t\t\t// If value is an array, recurse.\n\t\t\treturn value.map(function(item, index) {\n\t\t\t\treturn _recurse(item, fn, fnContinue, {\n\t\t\t\t\tobjs: state.objs.concat([value]),\n\t\t\t\t\tpath: state.path + '[' + index + ']',\n\t\t\t\t});\n\t\t\t});\n\t\t} else if (_.isObject(value) && !Buffer.isBuffer(value)) {\n\t\t\t// If value is an object, recurse.\n\t\t\tobj = {};\n\t\t\tfor (key in value) {\n\t\t\t\tobj[key] = recurse(value[key], fn, fnContinue, {\n\t\t\t\t\tobjs: state.objs.concat([value]),\n\t\t\t\t\tpath: state.path + (/\\W/.test(key) ? '[\"' + key + '\"]' : '.' + key),\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn obj;\n\t\t} else {\n\t\t\t// Otherwise pass value into fn and return.\n\t\t\treturn fn(value);\n\t\t}\n\t}\n\treturn _recurse(value, fn, fnContinue, {\n\t\tobjs: [],\n\t\tpath: ''\n\t});\n}", "depthFirstForEach(cb) {\n\n }", "depthFirstForEach(cb) {\n function dfs(fn, node) {\n if (node) {\n if (fn) {\n fn(node.value);\n }\n dfs(fn, node.left);\n dfs(fn, node.right);\n }\n }\n dfs(cb, this);\n }", "function TypeRecursion() {}", "function postDepth(fun, ary) {\n return visit(partial(postDepth, fun), fun, ary);\n}", "traverse(fn) {\n fn(this)\n\n const children = this._children\n for (let i = 0, l = children.length; i < l; i++) {\n children[i].traverse(fn)\n }\n }", "function traverse(node, func) {\n\tfunc(node);//1\n\tfor (var key in node) { //2\n\t\tif (node.hasOwnProperty(key)) { //3\n\t\t\tvar child = node[key];\n\t\t\tif (typeof child === 'object' && child !== null) { //4\n\n\t\t\t\tif (Array.isArray(child)) {\n\t\t\t\t\tchild.forEach(function (node) { //5\n\t\t\t\t\t\ttraverse(node, func);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\ttraverse(child, func); //6\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "depthFirstTraversal(fn) {\n fn(this.value);\n\n if (this.left) {\n this.left.depthFirstTraversal(fn);\n }\n\n if (this.right) {\n this.right.depthFirstTraversal(fn);\n }\n }", "function walk(node, fn){\n\t\tvar previous = node.prev();\n\t\tif (!previous.length){\n\t\t\tprevious = node.parent();\n\t\t}\n\t\tvar oldContext = node.data('context'); // maintain contexts as a stack\n\t\tnode = fn(node);\n\t\tif (!node.length){\n\t\t\tprint('node replaced, backtracking');\n\t\t\tnode = previous;\n\t\t// } if (oldContext){\n\t\t// \tnode.data('context', oldContext);\n\t\t}\n\t\tvar child = node.children().first();\n\t\twhile(child.length){\n\t\t\tchild = walk(child, fn).next();\n\t\t}\n\t\treturn node;\n\t}", "traverse(fn, skipSelf = false) {\n const {\n children\n } = this;\n\n if (!skipSelf) {\n fn.call(this, this);\n } // Simply testing whether there is non-zero children length\n // is 10x faster than using this.isLoaded\n\n for (let i = 0, l = children && children.length; i < l; i++) {\n children[i].traverse(fn);\n }\n }", "function helper(node, visited, stack) {\n visited.add(node);\n if (deps[node] != undefined) {\n for (let i = 0; i < deps[node].length; i++) {\n let dep_node = deps[node][i];\n if (!visited.has(dep_node)) {\n helper(dep_node, visited, stack);\n }\n }\n }\n stack.push(node);\n}", "function recursive(node, state, funcs, base, override) {\n var visitor = funcs ? exports.make(funcs, base) : base;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}", "function traverseTree(fn, node, depth = 0) {\n return fn(\n node,\n // TODO: depth + 1 === maxDepth don't render children\n node.children.map(child =>\n traverseTree(child.value.render, child, depth + 1)\n ),\n depth\n );\n}", "function walkImpl(root, traversalStrategy, beforeFunc, afterFunc, context, collectResults) {\n return (function _walk(stack, value, key, parent) {\n if (isObject(value) && stack.indexOf(value) >= 0)\n throw new TypeError('A cycle was detected at ' + value);\n\n if (beforeFunc) {\n var result = beforeFunc.call(context, value, key, parent);\n if (result === stopWalk) return stopWalk;\n if (result === stopRecursion) return; // eslint-disable-line consistent-return\n }\n\n var subResults;\n var target = traversalStrategy(value);\n\n if (isObject(target) && Object.keys(target).length > 0) {\n // Collect results from subtrees in the same shape as the target.\n if (collectResults) subResults = Array.isArray(target) ? [] : {};\n\n var ok = each(target, function(obj, key) {\n var result = _walk(copyAndPush(stack, value), obj, key, value);\n if (result === stopWalk) return false;\n if (subResults) subResults[key] = result;\n });\n if (!ok) return stopWalk;\n }\n if (afterFunc) return afterFunc.call(context, value, key, parent, subResults);\n })([], root);\n}", "function recurse(biparser) { return function() {\n const [arg0, arg1] = arguments\n const isRecurseRoot = arg0 === undefined\n const recurseRoot = isRecurseRoot ? biparser : arg0\n if (isRecurseRoot) {\n const psLoop = new Object()\n Object.assign(psLoop, genParserSerializer(defer(biparser)(recurseRoot, psLoop)))\n const {parser, serializer} = psLoop\n this.pFunction(parser)\n this.sFunction(serializer)\n } else if (recurseRoot === biparser) {\n const psLoop = arg1\n // this.pFunction(function(x) { try { return psLoop.parser.bind(this)(x) } catch (e) { return e } })\n this.pFunction(function(x) { return psLoop.parser.bind(this)(x) })\n this.sFunction(function(x) { return psLoop.serializer.bind(this)(x) })\n } else {\n biparser.bind(this)(...arguments)\n }\n}}", "function recursive(node, state, funcs, baseVisitor, override) {\n var visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n }", "function recursive(node, state, funcs, baseVisitor, override) {\n var visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n }", "function recurse(node, context) {\n var result = generate(node, context);\n context.fixResult(result);\n return result;\n }", "function walkTheDOMRecursive(func,node,depth,returnedFromParent) {\n\t var root = node || window.document;\n\t returnedFromParent = func.call(root,depth++,returnedFromParent);\n\t node = root.firstChild;\n\t while(node) {\n\t walkTheDOMRecursive(func,node,depth,returnedFromParent);\n\t node = node.nextSibling;\n\t }\n\t}", "function recusion() {\n // some serious code\n recusion();\n}", "function recursive(node, state, funcs, baseVisitor, override) {\n var visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}", "function recursive(node, state, funcs, baseVisitor, override) {\n var visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}", "function traverseTwoPhase(inst, fn, arg) {\n\t\t var path = [];\n\t\t while (inst) {\n\t\t path.push(inst);\n\t\t inst = inst._hostParent;\n\t\t }\n\t\t var i;\n\t\t for (i = path.length; i-- > 0;) {\n\t\t fn(path[i], false, arg);\n\t\t }\n\t\t for (i = 0; i < path.length; i++) {\n\t\t fn(path[i], true, arg);\n\t\t }\n\t\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t\t var path = [];\n\t\t while (inst) {\n\t\t path.push(inst);\n\t\t inst = inst._hostParent;\n\t\t }\n\t\t var i;\n\t\t for (i = path.length; i-- > 0;) {\n\t\t fn(path[i], false, arg);\n\t\t }\n\t\t for (i = 0; i < path.length; i++) {\n\t\t fn(path[i], true, arg);\n\t\t }\n\t\t}", "function digDeep(val) {\n \tfor (var i = 0; i < val.childNodes.length; i++) {\n \t\t//check to see if childnode has getattrbute function at all ..use sub\n\n\n \t\t//if yout current level has a class name that matches param, then push val into the array\n \t\tif ($(val.childNodes[i]).hasClass(className)) {\n \t\t\tresults.push(val.childNodes[i]);\n \t\t\t\n \t\t}\n \t\t//if your current level has childnides then recurse\n \t\tif (val.childNodes[i].hasChildNodes) {\n \t\t\t\tdigDeep(val.childNodes[i])\n \t\t}\n \t};\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i = void 0;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = inst._nativeParent;\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], false, arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], true, arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function fnTraversal(root, node, preorder, postorder) {\n\t\tnode.childnodes.forEach((child, i) => { //iterate over next deep level\n\t\t\tpreorder(root, node, child, i) && fnTraversal(root, child, preorder, postorder); //preorder = cut/poda\n\t\t\tpostorder(root, node, child, i);\n\t\t});\n\t\treturn self;\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = inst._hostParent;\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], false, arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], true, arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = inst._hostParent;\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], false, arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], true, arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = inst._hostParent;\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], false, arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], true, arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = inst._hostParent;\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], false, arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], true, arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = inst._hostParent;\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], false, arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], true, arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = inst._hostParent;\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], false, arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], true, arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = inst._hostParent;\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], false, arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], true, arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i = void 0;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._nativeParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._nativeParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._nativeParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._nativeParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._nativeParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._nativeParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i = void 0;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i = void 0;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i = void 0;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "function addRecurse(...nums) {\n if (nums.length < 1) {\n return 0;\n }\n if (nums.length === 1) {\n return nums[0];\n }\n return nums[0] + addRecurse(...nums.slice(1));\n}", "depthFirstSearch(array) {\n // append the name/value to input array\n array.push(this.name);\n \n // call the function again on all children\n for (let child of this.children) {\n child.depthFirstSearch(array);\n }\n return array;\n }", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n\t var path = [];\n\t while (inst) {\n\t path.push(inst);\n\t inst = inst._hostParent;\n\t }\n\t var i;\n\t for (i = path.length; i-- > 0;) {\n\t fn(path[i], false, arg);\n\t }\n\t for (i = 0; i < path.length; i++) {\n\t fn(path[i], true, arg);\n\t }\n\t}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0; ) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n }", "traverseDF(fn) {\n //Same: Create an array for traversing with only the root\n const nodeToProcess = [this.root];\n //Same: as long as the array has something in it loop through it\n while (nodeToProcess.length) {\n //Same: Take out the first thing in the array\n const childToProcess = nodeToProcess.shift();\n //DIFFERENT: put all the children of the shifted data into the front of the array for processing in the same order as above.\n nodeToProcess.unshift(...childToProcess.children);\n //Same: recursion part, put shifted node into the argument function for processing.\n fn(childToProcess);\n }\n }", "$_fillRecursive(formData) {}", "function dfs(root){\r\n\r\n}", "function traverseTwoPhase(inst, fn, arg) {\n for (var path = []; inst; ) path.push(inst), inst = getParent(inst);\n var i;\n for (i = path.length; i-- > 0; ) fn(path[i], \"captured\", arg);\n for (i = 0; i < path.length; i++) fn(path[i], \"bubbled\", arg);\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}", "function traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}" ]
[ "0.6342486", "0.6328443", "0.62809575", "0.62358916", "0.6228957", "0.6204224", "0.6190323", "0.61421525", "0.6098036", "0.6086267", "0.6039732", "0.60050124", "0.60030663", "0.5989291", "0.59862334", "0.5977684", "0.59629154", "0.5935189", "0.59237915", "0.5901334", "0.5878166", "0.5876323", "0.5875471", "0.5875471", "0.5873521", "0.58005935", "0.57922596", "0.5784623", "0.5784623", "0.5760909", "0.5760909", "0.57571757", "0.5749213", "0.5749213", "0.574377", "0.5739371", "0.57371473", "0.57371473", "0.57371473", "0.57371473", "0.57371473", "0.57371473", "0.57368493", "0.57348263", "0.57348263", "0.57348263", "0.57348263", "0.57348263", "0.57348263", "0.57348263", "0.57320267", "0.5728392", "0.5728392", "0.5728392", "0.5728392", "0.5728392", "0.5728392", "0.57265395", "0.57265395", "0.57265395", "0.5725448", "0.5719719", "0.57099646", "0.57099646", "0.57099646", "0.57099646", "0.57099646", "0.57099646", "0.57099646", "0.57099646", "0.57099646", "0.57099646", "0.57099646", "0.57099646", "0.56998575", "0.5693216", "0.5678027", "0.5671911", "0.56654346", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223", "0.56388223" ]
0.0
-1
Add unit to numeric values.
function defaultUnit(options) { if (options === void 0) { options = {}; } var camelCasedOptions = addCamelCasedVersion(options); function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; for (var prop in style) { style[prop] = iterate(prop, style[prop], camelCasedOptions); } return style; } function onChangeValue(value, prop) { return iterate(prop, value, camelCasedOptions); } return { onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unit(i, units) {\n\t if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n\t return i;\n\t } else {\n\t return \"\" + i + units;\n\t }\n\t }", "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "function unit(i, units) {\r\n\t\tif ((typeof i === 'string') && (!i.match(/^[\\-0-9\\.]+$/))) {\r\n\t\t\treturn i;\r\n\t\t} else {\r\n\t\t\treturn '' + i + units;\r\n\t\t}\r\n\t}", "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "function unit(i, units) {\n if ((typeof i === \"string\") && (!i.match(/^[\\-0-9\\.]+$/))) {\n return i;\n } else {\n return \"\" + i + units;\n }\n }", "function units(num) {\n\treturn num*CELL_SIZE + UNIT_NAME;\n}", "function calculateUnitValue(i) {\n\tif (getUnit(i) === \"in\") return 1;\n\telse if (getUnit(i) === \"cm\") return .3937;\n\telse return 0;\n}", "static setUnitMetric(unit) {\n if (unit === 'm' || unit === 'metres') {\n return `&units=metric`;\n }\n return ``;\n }", "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "setUnits() {\n this.units = unitSystem.getUnits();\n }", "function convertUnits(value, currUnits, newUnits) {\n return UnitValue(value, currUnits).as(newUnits);\n}", "get unitFormatted() {\r\n\t\treturn this.count > 1 ? this.unit + 's' : this.unit;\r\n\t}", "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n }", "function ensureUnit(val) {\n return val + (Object(min_dash__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"])(val) ? 'px' : '');\n}", "function ensureUnit(val) {\n return val + (Object(min_dash__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(val) ? 'px' : '');\n}", "changeUnits(ev) {\n if(ev.target.getAttribute('value') === 'metric') this.unit = 0;\n else if(ev.target.getAttribute('value') === 'imperial') this.unit = 1;\n inputsRequired.forEach((input, i) => {\n input.label.innerHTML = (input.name + placeHolderTexts[i][this.unit === 0 ? 'metric' : 'imperial'])\n });\n }", "function getUnitValue(u) { return (u.value != undefined) ? u.value : u; }", "unitAdd() {\n this.modelUnits.push(this.__unitInstance());\n }", "moveThrough(units) {\n this.units = units;\n this.text.text = this.units.toString();\n }", "function updateUnit() {\n\t\tif (segments.length == 0) {\n\t\t\tthrow \"No segments supplied!\";\n\t\t}\n\t\tif (segments.length === 1) {\n\t\t\tweights = segments[0][1];\n\t\t} else {\n\t\t\tweights = EduMon.Math.sumOver(0, segments.length, function(i) {\n\t\t\t\treturn segments[i][1]\n\t\t\t});\n\t\t}\n\t\tunit = TAU / weights;\n\t}", "units() {\n return this.growRight('#Unit').match('#Unit$')\n }", "function formatUnit(unit) {\r\n\t\r\n\tvar isInt = parseInt(unit);\r\n\r\n\treturn isInt ? isInt : 0;\r\n}", "function parseUnit(n) {\n var unit = (0, _cssGetUnit2.default)(n);\n var value = parseFloat(n);\n return { unit: unit, value: value };\n }", "function appendUnit(apples) {\n if(apples.toString().indexOf(\"px\") < -1 && apples.toString().indexOf(\"%\") < -1) {\n return apples += \"px\";\n }\n }", "function parseUnit(val, output) {\n output = output || {};\n if (!type_5.isDefined(val)) {\n output.unit = undefined;\n output.value = undefined;\n }\n else if (type_5.isNumber(val)) {\n output.unit = undefined;\n output.value = val;\n }\n else {\n var match = resources_2.measureExpression.exec(val);\n var startString = match[1];\n var unitTypeString = match[2];\n output.unit = unitTypeString || undefined;\n output.value = startString ? parseFloat(startString) : undefined;\n }\n return output;\n }", "get units() {\n return this._units;\n }", "function setUnit(unit, quantity, value) {\n // name: string representing the unit name (eg: “meter”)\n // value: string representing the value of the unit in relation to SI unit (eg: “1.0”)\n var db = getDatabase();\n var res = \"\";\n db.transaction(function(tx) {\n var rs = tx.executeSql('INSERT OR REPLACE INTO units VALUES (?,?,?);', [unit, quantity, value]);\n //console.log(rs.rowsAffected)\n if (rs.rowsAffected > 0) {\n res = \"OK\";\n } else {\n res = \"Error\";\n }\n }\n );\n // The function returns “OK” if it was successful, or “Error” if it wasn't\n return res;\n}", "function add_zero(measure_unit) {\n let unit; //variable needed to store different data from the time object depending on function argument\n\n if (measure_unit == hours){\n unit = time.hours; //stores the hours\n } else if (measure_unit == minutes) {\n unit = time.minutes; //stores the minutes\n } else if (measure_unit == seconds) {\n unit = time.seconds; //stores the seconds\n }\n\n //function returns additional zero symbol if 'unit' variable value are less than 10\n return (unit < 10) ? measure_unit.innerText = '0' + unit : measure_unit.innerText = unit;\n }", "function toRau(num, unit) {\n return convert(num, unit, \"multipliedBy\");\n}", "setRightUnit(valueNew){let t=e.ValueConverter.toDimensionUnit(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"RightUnit\")),t!==this.__rightUnit&&(this.__rightUnit=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"RightUnit\"}),this.__processRightUnit())}", "configUnits(units) {\n this.units = '';\n if (units === 'm' || units === 'metric') {\n this.units = '&units=metric';\n }\n }", "static fromNumerical(numerical: numerical): AbstractNumericalUnit {\n const string_of_number = Number(numerical).toString();\n if (string_of_number === \"0\") {\n return new AbstractNumericalUnit(0, 0, null);\n }\n const index_of_decimal = [...string_of_number].findIndex((element) => element === \".\");\n const number_character_array = [...string_of_number.replace(\".\", \"\")];\n const length = number_character_array.length;\n const decimal_offset = (index_of_decimal === -1) ? length : index_of_decimal;\n\n let last_unit = null;\n for (let i = length - 1; i >= 0; i--) {\n const power = decimal_offset - i - 1;\n const value = Number(number_character_array[i]);\n if (value === 0) {\n continue;\n }\n last_unit = new AbstractNumericalUnit(power, value, last_unit);\n }\n // $FlowFixMe\n return last_unit;\n }", "function handleUnit(unit) {\n switch(unit) {\n case \"MT\":\n return \"Minutes\";\n case \"HT\":\n return \"Hours\";\n case \"D\":\n return \"Days\";\n case \"M\":\n return \" Months\";\n default:\n return \"\";\n }\n}", "convertUnits(input, output, units) {\n var indexOfInput = 0;\n var indexOfOutput = 0;\n var UNITS = units.getUnits();\n var STEP = units.getStep();\n\n for (var i = 0; i < UNITS.length; i++) {\n if (UNITS[i] === input.unit) {\n indexOfInput = i;\n }\n if (UNITS[i] === output.unit) {\n indexOfOutput = i;\n }\n }\n\n var diff = indexOfOutput - indexOfInput;\n\n if (diff === 0) {\n return input.value;\n } else {\n var coef = 10**(diff * STEP);\n var newvalue = input.value * coef;\n return newvalue;\n }\n }", "function getAdjustedUnitForNumber(ms) {\n return getAdjustedUnit(ms, function(unit) {\n return trunc(withPrecision(ms / unit.multiplier, 1));\n });\n }", "function em(value) {\n return unit * value;\n}", "function em(value) {\n return unit * value;\n}", "function em(value) {\n return unit * value;\n}", "function em(value) {\n return unit * value;\n}", "get unit () {\n\t\treturn this._unit;\n\t}", "function add(num){\n\tresults.value += num;\n}", "function format(value, units, includeValue) {\n var obj;\n\n if (typeof value === 'string') {\n includeValue = units;\n units = value;\n value = 1;\n }\n\n if (typeof value === 'object') {\n // treat it like a UCUM parse output\n obj = value;\n includeValue = units; // you would never provide units in this case, but you might provide includeValue\n } else {\n // parse it first\n obj = parse(value, units);\n }\n\n var units = Object.keys(obj.units);\n var metadata = obj.metadata;\n var numUnits = units.length;\n var numeratorUnits = [];\n var denominatorUnits = [];\n var printableUnits = \"\";\n\n units.forEach(function (unit, index) {\n var exponent = obj.units[unit];\n var absExponent = Math.abs(exponent);\n var printable = metadata[unit].printSymbols ? metadata[unit].printSymbols[0] : metadata[unit].names[0];\n var prefix = metadata[unit].prefix ? metadata[unit].prefix.printSymbols[0] : \"\";\n pUnit = prefix + printable;\n if (absExponent !== 1) {\n pUnit += \"<sup>\";\n pUnit += Math.abs(exponent);\n pUnit += \"</sup>\";\n }\n\n if (exponent > 0) {\n numeratorUnits.push(pUnit);\n } else {\n denominatorUnits.push(pUnit);\n }\n });\n\n if (numeratorUnits.length == 0) {\n printableUnits = \"1\";\n } else if (numeratorUnits.length > 0) {\n printableUnits = numeratorUnits.join(\"*\");\n }\n\n if (denominatorUnits.length > 0) {\n printableUnits += \"/\";\n }\n\n printableUnits += denominatorUnits.join(\"/\");\n\n if (includeValue) {\n printableUnits = obj.value + \" \" + printableUnits;\n }\n\n return printableUnits;\n}", "function register(key, nativeToUnitFactor, units, shortDescr, options) {\n if (map[key] === undefined)\n {\n\tmap[key] = new Object();\n\tlogger.debug(\"Creating new object for \" + key);\n };\n map[key].value = null; // FIXME: use undefined rather than null\n map[key].newValue = null;\n // choose 0 for strings\n map[key].nativeToUnitFactor = nativeToUnitFactor;\n // e.g. A, V, km/h, % ...\n map[key].units = units;\n map[key].shortDescr = shortDescr;\n // format and scale from raw value to unit-value with given precision\n map[key].formatted = function() {\n\tif (this.nativeToUnitFactor === 0) return this.value;\n\tvar scaledToIntPrecision = Number(this.value * this.nativeToUnitFactor / this.precision);\n\tvar div = 1 / this.precision;\n\t// TODO: use toFixed \n\t//return scaledToIntPrecision.toFixed(2);\n\treturn Math.floor(scaledToIntPrecision) / div;\n }\n map[key].formattedWithUnit = function() {\n\tif (this.units === \"s\")\n\t{\n\t // nativeToSIFactor must convert the value to SI i.e. seconds\n\t var timeInSecs = Math.round(this.value * this.nativeToUnitFactor);\n\t var durationStr = \"infinity\";\n\t if (timeInSecs >= 0) durationStr = formatSeconds(timeInSecs);\n\t return durationStr;\n\t}\n\telse if (this.nativeToUnitFactor === 0) return this.value;\n\telse return this.formatted() + \" \" + this.units;\n }\n // initialize defaults for optional parameters:\n map[key].description = \"\"; // default\n map[key].precision = 0.01; // default precision -2 digits after dot\n // TODO: map[key].on = []; and implement addListener, deleteListener\n map[key].on = null;\n // if values are read from register instead of the frequent value\n // updates, the values are in hexadecimal string format and may\n // have a different factor that needs to be applied to convert\n // to the same value as the frequent update. This is done by\n // fromHexStr and the inverse function by toHexStr\n map[key].fromHexStr = conv.hexToUint; // default\n map[key].toHexStr = null;\n // if options exist, overwrite specific option:\n if (options === undefined) return map[key];\n if (options['description'])\n {\n\tmap[key].description = options['description'];\n }\n // example: pure int ==> precision := 0; \n // 2 digits at the right of the decimal point ==> precision := -2\n if (options['precision'])\n {\n\tmap[key].precision = Math.pow(10, options['precision']);\n }\n if (options['formatter'])\n {\n\tmap[key].formatted = options['formatter'];\n }\n if (options['on'])\n {\n\tmap[key].on = options['on'];\n }\n if (options['fromHexStr'])\n {\n\tmap[key].fromHexStr = options['fromHexStr'];\n }\n if (options['toHexStr'])\n {\n\tmap[key].toHexStr = options['toHexStr'];\n }\n return map[key];\n}", "function adjustChartDisplayUnits(chartKey, baseUnit, scale, unitKind) {\n\tvar unit = (scale === 1000000000 ? 'G' : scale === 1000000 ? 'M' : scale === 1000 ? 'k' : '') + baseUnit;\n\td3.selectAll(chartKey +' .unit').text(unit);\n\tif ( unitKind !== undefined ) {\n\t\td3.selectAll(chartKey + ' .unit-kind').text(unitKind);\n\t}\n}", "set(n) {\n if (n === undefined) {\n return this // don't bother\n }\n if (typeof n === 'string') {\n n = parse(n).num\n }\n let m = this\n let res = m.map((val) => {\n let obj = parse(val)\n obj.num = n\n if (obj.num === null) {\n return val\n }\n let fmt = val.has('#Ordinal') ? 'Ordinal' : 'Cardinal'\n if (val.has('#TextValue')) {\n fmt = val.has('#Ordinal') ? 'TextOrdinal' : 'TextCardinal'\n }\n let str = format(obj, fmt)\n // add commas to number\n if (obj.hasComma && fmt === 'Cardinal') {\n str = Number(str).toLocaleString()\n }\n val = val.not('#Currency')\n val.replaceWith(str, { tags: true })\n // handle plural/singular unit\n // agreeUnits(agree, val, obj)\n return val\n })\n return new Numbers(res.document, res.pointer)\n }", "static fromNumerical(numerical ) {\n const string_of_number = Number(numerical).toString();\n if (string_of_number === \"0\") {\n return new this(0, 0, null);\n }\n const index_of_decimal = [...string_of_number].findIndex((element) => element === \".\");\n const number_character_array = [...string_of_number.replace(\".\", \"\")];\n const length = number_character_array.length;\n const decimal_offset = (index_of_decimal === -1) ? length : index_of_decimal;\n\n let last_unit = null;\n for (let i = length - 1; i >= 0; i--) {\n const power = decimal_offset - i - 1;\n const value = Number(number_character_array[i]);\n if (value === 0) {\n continue;\n }\n last_unit = new this(power, value, last_unit);\n }\n return last_unit;\n }", "function unitChange() {\n oldunits = units;\n if(document.getElementById('unit_SI').checked) {\n units = 'unit_SI';\n doseUnit = 'uSv/h';\n dosenorm = eps * 1e4 * 3600;\n lunit = cm;\n lunitname = 'cm';\n }\n else {\n units = 'unit_US';\n doseUnit = 'mrem/h';\n dosenorm = eps * 1e3 * 3600;\n lunit = inch;\n lunitname = 'inch';\n }\n\n // Update length unit\n var ltext = document.getElementsByClassName('lunit');\n for (var i = 0; i < ltext.length; i++) { \n ltext[i].innerHTML = lunitname;\n };\n\n // Update dose unit\n var dtext = document.getElementsByClassName('dunit');\n for (var i = 0; i < dtext.length; i++) {\n dtext[i].innerHTML = doseUnit;\n };\n\n autoConv = document.getElementById('autoConv').checked;\n if(autoConv) { // Covert length values according to the selected unit\n var linp = document.getElementsByClassName('inpL');\n var unitfactor;\n if(units=='unit_SI' && oldunits=='unit_US')\n unitfactor = inch/cm;\n else if(units=='unit_US' && oldunits=='unit_SI')\n unitfactor = cm/inch;\n else\n unitfactor = 1.0;\n for (var i = 0; i < linp.length; i++) {\n linp[i].value = (parseFloat(linp[i].value) * unitfactor).toFixed(2);\n };\n }\n updateAll();\n}", "function normalizeUnits(value) {\n return (value.match(/px|em|rem/)) ? value : value + 'px';\n}", "updateUnits(assetHolder, newUnits) {\n assetHolderToBalance.set(assetHolder, newUnits);\n recordPixelsAsAsset(newUnits, assetHolder);\n }", "function changeDistanceUnits(units){\n cachesearch = '';\n var results = $('#results');\n var dUnits = results.find('p.distance-units label');\n var distance = results.find('.distance');\n var unitsSpan = distance.find('.units');\n var valueSpan = distance.find('.value');\n \n dUnits.removeClass('unchecked');\n dUnits.filter(':not([units=\"'+units+'\"])').addClass('unchecked');\n \n switch (units){\n case 'km':\n \n\t\tunitsSpan.html(' '+thekm+' ');\n \n $.each(distance, function(i, val){\n // values are already in kms so just round to 2 decimal places.\n\t\t i++;\n\t\t val = $('#d_'+i+' .value').html();\n val = parseFloat(val);\n\t\t\n ///////////\t\t\n// $('#d_'+i+' .value').text((Math.round(val / milesToKm * 100) / 100));\n $('#d_'+i+' .value').text((Math.round(val * mile2km * 100) / 100));\n\t\t $('.radius-distance').html('km');\n//////////\n\t\t\n });\n\t\t\n break; \n \n case 'miles':\n\t\n unitsSpan.html(' '+themiles+' ');\n\n $.each(distance, function(i, val){\n // Values are in kms so convert to miles then round down to two decimal places.\n i++;\n\t\t val = $('#d_'+i+' .value').html();\n\t\t val = parseFloat(val);\n\t\t \n ////////////////////////////////\n// $('#d_'+i+' .value').text(Math.round((val * milesToKm) * 100) / 100);\n $('#d_'+i+' .value').text(Math.round(val * km2mile * 100)/100);\n\t\t\t $('.radius-distance').html('mi');\n///////////////////////////////\n });\n\t \n break;\n\n default:\n }\n }", "function change_by_one(value, direction){\n\n var number = value.replace(/[^-\\d\\.]/g, '');\n var unit = value.replace(number, '').trim();\n\n if(number == \"\") number = \"0\";\n if(unit == \"\") unit = \"px\"; \n\n var newvalue = \"\";\n\n if(direction == \"plus\")\n newvalue = Number(number) + 1; \n else newvalue = Number(number) - 1; \n\n console.log(newvalue + \"\" +unit);\n return newvalue+unit; \n\n alert(\"new value after click \"+ newvalue+unit);\n }", "function normalizeUnit(unit) {\n var normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\"\n }[unit.toLowerCase()];\n if (!normalized) throw new InvalidUnitError(unit);\n return normalized;\n} // this is a dumbed down version of fromObject() that runs about 60% faster", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "function normalizeUnit(unit) {\n var normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\"\n }[unit.toLowerCase()];\n if (!normalized) throw new InvalidUnitError(unit);\n return normalized;\n} // this is a dumbed down version of fromObject() that runs about 60% faster", "function normalizeUnit(unit) {\n var normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\"\n }[unit.toLowerCase()];\n if (!normalized) throw new InvalidUnitError(unit);\n return normalized;\n} // this is a dumbed down version of fromObject() that runs about 60% faster", "function normalizeUnit(unit) {\n var normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\"\n }[unit.toLowerCase()];\n if (!normalized) throw new InvalidUnitError(unit);\n return normalized;\n} // this is a dumbed down version of fromObject() that runs about 60% faster", "function add(value, incr) {\n var sum = value + incr;\n var str = incr.toString().split(\".\");\n if (str.length > 1) {\n var frac = str[1].length;\n sum = +sum.toFixed(frac);\n }\n\n return sum;\n }", "get_mult(units) {\n var mult = 0;\n if (units === 'minutes') {\n mult = 1;\n } else if (units === 'hours') {\n mult = 60;\n } else if (units === 'days') {\n mult = 60 * 24;\n } else if (units === 'months') {\n mult = 30 * 60 * 24;\n } else if (units === 'years') {\n mult = 365 * 60 * 24;\n } else {\n throw new TypeError;\n }\n return mult;\n }", "function normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\"\n }[unit.toLowerCase()];\n if (!normalized) throw new InvalidUnitError(unit);\n return normalized;\n} // this is a dumbed down version of fromObject() that runs about 60% faster", "function normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\"\n }[unit.toLowerCase()];\n if (!normalized) throw new InvalidUnitError(unit);\n return normalized;\n} // this is a dumbed down version of fromObject() that runs about 60% faster", "function normalizeUnit(unit) {\n var normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\"\n }[unit.toLowerCase()];\n if (!normalized) throw new InvalidUnitError(unit);\n return normalized;\n } // this is a dumbed down version of fromObject() that runs about 60% faster", "function unitFactory(name, valueStr, unitStr) {\n var dependencies = ['config', 'Unit', 'BigNumber'];\n return factory(name, dependencies, function (_ref) {\n var config = _ref.config,\n Unit = _ref.Unit,\n BigNumber = _ref.BigNumber;\n // Note that we can parse into number or BigNumber.\n // We do not parse into Fractions as that doesn't make sense: we would lose precision of the values\n // Therefore we dont use Unit.parse()\n var value = config.number === 'BigNumber' ? new BigNumber(valueStr) : parseFloat(valueStr);\n var unit = new Unit(value, unitStr);\n unit.fixPrefix = true;\n return unit;\n });\n} // helper function to create a factory function which creates a numeric constant,", "function multiplyAccordingToUnit(eleArray){\r\n\tif($productUnitTypeLength.find(':selected').data('abbr') == 'INCHES'){\r\n\t\t$.each(eleArray, (index, $item) => {\r\n\t\t\tmultiplyByFactor($item, 2.54);\r\n\t\t});\r\n\t}else if($productUnitTypeLength.find(':selected').data('abbr') == 'MILLIMETER'){\r\n\t\t$.each(eleArray, (index, $item) => {\r\n\t\t\tmultiplyByFactor($item, 0.1);\r\n\t\t});\r\n\t}\r\n}", "function addDigit(num){\n value = Number(value.toString() + num.toString());\n draw();\n}", "function convertUnit(from, to, value) {\n const transform = CONVERSION_TABLE[from][to];\n\n return transform(value);\n}", "function get_units() {\n switch(cookie['units'])\t{\n case \"mi\":\treturn \"Miles\"; break;\n case \"nm\":\treturn \"Naut.M\"; break;\n default:\treturn \"KM\"; break;\n }\n}", "static get unitsPerInch() {\n var rv = {};\n\n rv['pt']=72.0;\n rv['px']=96.0;\n rv['em']=6.0;\n return rv;\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 algebraUnit(num) {\n return [{ part: [], mult: num }];\n}", "function PropulsionUnit() {\n }", "function PropulsionUnit() {\n }", "function convertUnit(value, type, invert){\n \n if(value == \"\" || isNaN(value)) \n return value;\n \n // No conversion for degrees!\n if(type.slice(-1) == \"y\" && Globals.coordinateSystem == \"polar\")\n return value;\n \n // Alias length and time factors\n var l = Globals.lengthFactor;\n var t = Globals.timeFactor;\n \n // Apply length and time factors as necessary, otherwise return the value as is\n if(type == \"posx\" || type == \"posy\")\n return invert? value * (1.0/l) : value * l;\n else if(type== \"velx\" || type == \"vely\")\n return invert? value * (1.0/l)*t : value * l * (1.0/t);\n else if(type== \"accx\" || type == \"accy\")\n return invert? value * (1.0/l)*t*t : value * Globals.lengthFactor * (1.0/(t*t));\n else\n return value;\n}", "function unit (value) {\n\t return low.number(value) &&\n\t value >= 0.0 && value <= 1.0\n\t}", "toString() { return `${this.value || '?'} ${this.unit}`.trim() }", "setBottomUnit(valueNew){let t=e.ValueConverter.toDimensionUnit(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"BottomUnit\")),t!==this.__bottomUnit&&(this.__bottomUnit=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"BottomUnit\"}),this.__processBottomUnit())}", "function pluralize(value, unit) {\n if (value === 1) {\n unit = unit.slice(0, -1)\n }\n return value + ' ' + unit\n}", "function displayNumber(num){\n givenNumberValue.value += num;\n}", "function normalize(value, units) {\r\n\tswitch(units) {\r\n\t\tcase \"mi\":\r\n\t\t\treturn value * 1609;\r\n\t\tcase \"km\":\r\n\t\t\treturn value * 1000;\r\n\t\tcase \"ft\":\r\n\t\t\treturn value / 3.281;\r\n\t\tcase \"m\":\r\n\t\t\treturn value;\r\n\t}\r\n}", "function unitConversion(unit) {\n\t\tvar hexconv = unit.toString(16);\n\t\treturn hexconv.length == 1 ? '0' + hexconv : hexconv;\n\t\t}", "appendNumber(number){\n if (number === '.' && this.currentOperand.includes('.')) return\n this.currentOperand = this.currentOperand.toString() + number.toString()\n }", "setLeftUnit(valueNew){let t=e.ValueConverter.toDimensionUnit(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"LeftUnit\")),t!==this.__leftUnit&&(this.__leftUnit=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"LeftUnit\"}),this.__processLeftUnit())}", "function addUnitGroup(doc, unitGroup) {\n var parent = doc.getElementsByTagName(\"unitGroups\")[0];\n xmlAddUnitAndTree(doc, parent, unitGroup);\n}", "function getUnitToShift(){\n // valuto la label della unit corrente\n switch($scope.units[$scope.indexDefaultUnit].key){\n case 'hour':\n // appende il giorno corrente della settimana e il numero\n return 'day';\n break;\n case 'day':\n // appende la settimana del mese il numero del mese\n return 'week';\n break;\n case 'date':\n return 'month';\n break;\n case 'month':\n return 'month';\n break;\n default:\n return 'year';\n }\n return null;\n }", "get unit() {\n\t\treturn this.__unit;\n\t}", "function fixedUnit(str) {\n var unit = type.Unit.parse(str);\n unit.fixPrefix = true;\n return unit;\n } // Source: http://www.wikiwand.com/en/Physical_constant", "function YLightSensor_get_unit()\n { var json_val = this._getFixedAttr('unit');\n return (json_val == null ? Y_UNIT_INVALID : json_val);\n }", "function normalizeUnit(unit) {\n unit = toStr(unit);\n if (unitShorthandMap[unit]) return unitShorthandMap[unit];\n return unit.toLowerCase().replace(regEndS, '');\n }", "function splitUnit(property, hostValue) {\n if (utils.isNum(property)) {\n return property;\n }\n var returnVal = property;\n\n var _utils$splitValUnit = utils.splitValUnit(property);\n\n var value = _utils$splitValUnit.value;\n var unit = _utils$splitValUnit.unit;\n\n if (!isNaN(value)) {\n returnVal = value;\n if (unit) {\n hostValue.unit = unit;\n }\n }\n\n return returnVal;\n}" ]
[ "0.6622079", "0.65806407", "0.65806407", "0.65793705", "0.65624154", "0.65624154", "0.61946905", "0.60811275", "0.60735935", "0.60721624", "0.60721624", "0.60721624", "0.6060846", "0.6051657", "0.6045234", "0.60335", "0.6028815", "0.5936279", "0.59199363", "0.58140886", "0.58019567", "0.57971466", "0.5734148", "0.5702965", "0.568761", "0.56544805", "0.565347", "0.5637646", "0.56306833", "0.5613543", "0.5592494", "0.5531423", "0.55044097", "0.5482644", "0.5462617", "0.54312193", "0.5419475", "0.5417555", "0.5411047", "0.5404691", "0.5404691", "0.5397565", "0.5397565", "0.53841007", "0.5374413", "0.5369883", "0.5327462", "0.5326672", "0.53244764", "0.53233343", "0.5292872", "0.529198", "0.5285372", "0.52800727", "0.52363193", "0.52361125", "0.5230057", "0.5230057", "0.5230057", "0.5230057", "0.5230057", "0.5230057", "0.5230057", "0.5230057", "0.5230057", "0.5230057", "0.5218651", "0.5218651", "0.5218651", "0.5217227", "0.52008915", "0.51950544", "0.51950544", "0.5186865", "0.51742727", "0.5172038", "0.5165871", "0.51610494", "0.5148555", "0.51186323", "0.5118427", "0.5114782", "0.51123106", "0.51123106", "0.51080036", "0.5097151", "0.50964594", "0.5095294", "0.5090799", "0.5089537", "0.5075614", "0.5072201", "0.50720096", "0.5071133", "0.50605416", "0.50590485", "0.5048087", "0.50440323", "0.5043601", "0.5031607", "0.5027268" ]
0.0
-1
CONCATENATED MODULE: ./node_modules/jsspluginvendorprefixer/dist/jsspluginvendorprefixer.esm.js Add vendor prefix to a property name when needed.
function jssVendorPrefixer() { function onProcessRule(rule) { if (rule.type === 'keyframes') { var atRule = rule; atRule.at = supportedKeyframes(atRule.at); } } function prefixStyle(style) { for (var prop in style) { var value = style[prop]; if (prop === 'fallbacks' && Array.isArray(value)) { style[prop] = value.map(prefixStyle); continue; } var changeProp = false; var supportedProp = supportedProperty(prop); if (supportedProp && supportedProp !== prop) changeProp = true; var changeValue = false; var supportedValue$1 = supportedValue(supportedProp, toCssValue(value)); if (supportedValue$1 && supportedValue$1 !== value) changeValue = true; if (changeProp || changeValue) { if (changeProp) delete style[prop]; style[supportedProp || prop] = supportedValue$1 || value; } } return style; } function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; return prefixStyle(style); } function onChangeValue(value, prop) { return supportedValue(prop, toCssValue(value)) || value; } return { onProcessRule: onProcessRule, onProcessStyle: onProcessStyle, onChangeValue: onChangeValue }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vendorPropName(name){// shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;}// check for vendor prefixed names\nvar capName=name.charAt(0).toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "function vendorPropName(name){ // Shortcut for names that are not vendor prefixed\nif(name in emptyStyle){return name;} // Check for vendor prefixed names\nvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\r\n\tif(name in emptyStyle){return name;}// Check for vendor prefixed names\r\n\tvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "function vendorPropName(name){// Shortcut for names that are not vendor prefixed\n\tif(name in emptyStyle){return name;}// Check for vendor prefixed names\n\tvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "function vendorPropName(name){ // Shortcut for names that are not vendor prefixed\n\tif(name in emptyStyle){return name;} // Check for vendor prefixed names\n\tvar capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}", "function vendorPropName(name) {\n // shortcut for names that are not vendor prefixed\n if (name in emptyStyle) {\n return name;\n } // check for vendor prefixed names\n\n\n var capName = name.charAt(0).toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n\n if (name in emptyStyle) {\n return name;\n }\n }\n }", "function vendorPropName(name) {\n\n // Shortcut for names that are not vendor prefixed\n if (name in emptyStyle) {\n return name;\n }\n\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n if (name in emptyStyle) {\n return name;\n }\n }\n }", "function vendorPropName(name) {\r\n\r\n\t\t// shortcut for names that are not vendor prefixed\r\n\t\tif (name in emptyStyle) {\r\n\t\t\treturn name;\r\n\t\t}\r\n\r\n\t\t// check for vendor prefixed names\r\n\t\tvar capName = name.charAt(0).toUpperCase() + name.slice(1),\r\n\t\t\ti = cssPrefixes.length;\r\n\r\n\t\twhile (i--) {\r\n\t\t\tname = cssPrefixes[i] + capName;\r\n\t\t\tif (name in emptyStyle) {\r\n\t\t\t\treturn name;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function vendorPropName( name ) {\n\t\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName( name ) {\n\t\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName( name ) {\n\t\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName( name ) {\n\t\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName( name ) {\n\t\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName( name ) {\n\t\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName( name ) {\n\t\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName( name ) {\n\t\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName( name ) {\n\t\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName( name ) {\n\t\n\t\t// Shortcut for names that are not vendor prefixed\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t\n\t\t// Check for vendor prefixed names\n\t\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\t\ti = cssPrefixes.length;\n\t\n\t\twhile ( i-- ) {\n\t\t\tname = cssPrefixes[ i ] + capName;\n\t\t\tif ( name in emptyStyle ) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName( name ) { // 6256\n // 6257\n\t// Shortcut for names that are not vendor prefixed // 6258\n\tif ( name in emptyStyle ) { // 6259\n\t\treturn name; // 6260\n\t} // 6261\n // 6262\n\t// Check for vendor prefixed names // 6263\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ), // 6264\n\t\ti = cssPrefixes.length; // 6265\n // 6266\n\twhile ( i-- ) { // 6267\n\t\tname = cssPrefixes[ i ] + capName; // 6268\n\t\tif ( name in emptyStyle ) { // 6269\n\t\t\treturn name; // 6270\n\t\t} // 6271\n\t} // 6272\n} // 6273", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// check for vendor prefixed names\n\tvar capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName(name) {\n\n\t\t// shortcut for names that are not vendor prefixed\n\t\tif (name in emptyStyle) {\n\t\t\treturn name;\n\t\t}\n\n\t\t// check for vendor prefixed names\n\t\tvar capName = name.charAt(0).toUpperCase() + name.slice(1),\n\t\t i = cssPrefixes.length;\n\n\t\twhile (i--) {\n\t\t\tname = cssPrefixes[i] + capName;\n\t\t\tif (name in emptyStyle) {\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t}", "function vendorPropName(name) {\n\n // shortcut for names that are not vendor prefixed\n if (name in emptyStyle) {\n return name;\n }\n\n // check for vendor prefixed names\n var capName = name.charAt(0).toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n if (name in emptyStyle) {\n return name;\n }\n }\n }", "function vendorPropName(name) {\n\n // shortcut for names that are not vendor prefixed\n if (name in emptyStyle) {\n return name;\n }\n\n // check for vendor prefixed names\n var capName = name.charAt(0).toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n\n while (i--) {\n name = cssPrefixes[i] + capName;\n if (name in emptyStyle) {\n return name;\n }\n }\n }", "function vendorPropName( name ) {\n\n // shortcut for names that are not vendor prefixed\n if ( name in emptyStyle ) {\n return name;\n }\n\n // check for vendor prefixed names\n var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),\n i = cssPrefixes.length;\n\n while ( i-- ) {\n name = cssPrefixes[ i ] + capName;\n if ( name in emptyStyle ) {\n return name;\n }\n }\n }", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}", "function vendorPropName( name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}" ]
[ "0.6922334", "0.6854269", "0.68164325", "0.68155736", "0.6778338", "0.67690337", "0.67321265", "0.66789436", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.667647", "0.66751426", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.66624236", "0.6654289", "0.6643287", "0.6643287", "0.66360825", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743", "0.6631743" ]
0.0
-1
CONCATENATED MODULE: ./node_modules/jsspluginpropssort/dist/jsspluginpropssort.esm.js Sort props by length.
function jssPropsSort() { var sort = function sort(prop0, prop1) { if (prop0.length === prop1.length) { return prop0 > prop1 ? 1 : -1; } return prop0.length - prop1.length; }; return { onProcessStyle: function onProcessStyle(style, rule) { if (rule.type !== 'style') return style; var newStyle = {}; var props = Object.keys(style).sort(sort); for (var i = 0; i < props.length; i++) { newStyle[props[i]] = style[props[i]]; } return newStyle; } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jssPropsSort() {\n var sort = function sort1(prop0, prop1) {\n if (prop0.length === prop1.length) return prop0 > prop1 ? 1 : -1;\n return prop0.length - prop1.length;\n };\n return {\n onProcessStyle: function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n var newStyle = {\n };\n var props = Object.keys(style).sort(sort);\n for(var i = 0; i < props.length; i++)newStyle[props[i]] = style[props[i]];\n return newStyle;\n }\n };\n}", "function jssPropsSort() {\n var sort = function sort(prop0, prop1) {\n if (prop0.length === prop1.length) {\n return prop0 > prop1 ? 1 : -1;\n }\n\n return prop0.length - prop1.length;\n };\n\n return {\n onProcessStyle: function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n\n for (var i = 0; i < props.length; i++) {\n newStyle[props[i]] = style[props[i]];\n }\n\n return newStyle;\n }\n };\n }", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}", "function jssPropsSort() {\n\t function sort(prop0, prop1) {\n\t return prop0.length - prop1.length;\n\t }\n\t\n\t function onProcessStyle(style, rule) {\n\t if (rule.type !== 'style') return style;\n\t\n\t var newStyle = {};\n\t var props = Object.keys(style).sort(sort);\n\t for (var prop in props) {\n\t newStyle[props[prop]] = style[props[prop]];\n\t }\n\t return newStyle;\n\t }\n\t\n\t return { onProcessStyle: onProcessStyle };\n\t}", "function jssPropsSort() {\n\t function sort(prop0, prop1) {\n\t return prop0.length - prop1.length;\n\t }\n\n\t function onProcessStyle(style, rule) {\n\t if (rule.type !== 'style') return style;\n\n\t var newStyle = {};\n\t var props = Object.keys(style).sort(sort);\n\t for (var prop in props) {\n\t newStyle[props[prop]] = style[props[prop]];\n\t }\n\t return newStyle;\n\t }\n\n\t return { onProcessStyle: onProcessStyle };\n\t}", "function jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n }", "_dynamicSort(property) {\n let sortOrder = 1;\n\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n let result = (a['attributes'][property] < b['attributes'][property]) ? -1 :\n (a['attributes'][property] > b['attributes'][property]) ? 1 : 0;\n return result * sortOrder;\n };\n }", "function sortBy(prop){\r\n return function(a,b){\r\n if( a[prop] > b[prop]){\r\n return 1;\r\n }else if( a[prop] < b[prop] ){\r\n return -1;\r\n }\r\n return 0;\r\n }\r\n}", "dynamicSort(property) {\n var sortOrder = 1;\n //check for \"-\" operator and sort asc/desc depending on that\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a, b) {\n var result =\n a[property] < b[property] ? -1 : a[property] > b[property] ? 1 : 0;\n return result * sortOrder;\n };\n }", "function dynamicSort(property) {\r\n var sortOrder = 1;\r\n if (property[0] === \"-\") {\r\n sortOrder = -1;\r\n property = property.substr(1);\r\n }\r\n return function (a, b) {\r\n var result = (a[property] > b[property]) ? -1 : (a[property] < b[property]) ? 1 : 0;\r\n return result * sortOrder;\r\n }\r\n}", "function Sort() {}", "function dynamicSort(property) {\n var sortOrder = 1;\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a, b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n }", "function dynamicSort(property) {\n var sortOrder = 1;\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function(a, b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n }", "function dynamicSort(property) {\n var sortOrder = 1;\n if(property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n}", "function dynamicSort( property ) {\n var sortOrder = 1;\n if ( property[ 0 ] === \"-\" ) {\n sortOrder = -1;\n property = property.substr( 1 );\n }\n return function ( a, b ) {\n var result = ( a[ property ] < b[ property ] ) ? -1 : ( a[ property ] > b[ property ] ) ? 1 : 0;\n return result * sortOrder;\n };\n }", "function dynamicSort(property) {\n var sortOrder = 1;\n if(property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n}", "function dynamicSort(property) {\n var sortOrder = 1;\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a, b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n }\n}", "function dynamicSort(property) {\n var sortOrder = 1;\n if(property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function (a,b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n };\n}", "function dynamicSort(property) {\n\t var sortOrder = 1;\n\t if(property[0] === \"-\") {\n\t sortOrder = -1;\n\t property = property.substr(1);\n\t }\n\t return function (a,b) {\n\t var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n\t return result * sortOrder;\n\t }\n\t}", "function dynamicSort(property) {\n var sortOrder = 1;\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n return function(a, b) {\n var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;\n return result * sortOrder;\n };\n}", "function sortByProp(prop) {\n return (a, b) => {\n if (a[prop] > b[prop]) {\n return 1;\n }\n if (a[prop] < b[prop]) {\n return -1;\n }\n return 0;\n };\n}", "function sorterProdukter(prop) {\n return function (a, b) {\n if (a[prop] > b[prop]) {\n return 1;\n } else if (a[prop] < b[prop]) {\n return -1;\n }\n return 0;\n }\n}", "function sortByProperty(property){ \n return function(a,b){ \n if(a[property] < b[property]) \n return 1; \n else if(a[property] > b[property]) \n return -1; \n \n return 0; \n } \n }", "function sortByProperty(property){ \n return function(a,b){ \n if(a[property] < b[property]) \n return 1; \n else if(a[property] > b[property]) \n return -1; \n \n return 0; \n } \n }", "function sortByProperty(property){ \n return function(a,b){ \n if(a[property] < b[property]) \n return 1; \n else if(a[property] > b[property]) \n return -1; \n \n return 0; \n } \n }", "function sortByProperty(property){ \n return function(a,b){ \n if(a[property] > b[property]) \n return 1; \n else if(a[property] < b[property]) \n return -1; \n \n return 0; \n } \n}", "get overrideSorting() {}", "sort() {\n\t}", "sort() {\n\t}", "function GetSortOrder(prop) { \n return function(a, b) { \n if (a[prop] > b[prop]) { \n return 1; \n } else if (a[prop] < b[prop]) { \n return -1; \n } \n return 0; \n } \n }", "function normalizeOrder(props) {\n var l = props.length;\n for (var i = 0; i < l; i++) {\n var p = props[i], name = p[0], order = p[1];\n if (!_.isNumber(order) && !/^asc|^desc/i.test(order)) {\n ArgumentException(`The sort order '${order}' for '${name}' is not valid (it must be /^asc|^desc/i).`)\n }\n p[1] = _.isNumber(order) ? order : (/^asc/i.test(order) ? 1 : -1);\n }\n return props;\n}", "function dynamicSort(property) {\r\n var sortOrder = 1;\r\n if (property[0] === \"-\") {\r\n sortOrder = -1;\r\n property = property.substr(1);\r\n }\r\n\r\n return function(a, b) {\r\n if (sortOrder == -1) {\r\n return b[property].localeCompare(a[property]);\r\n } else {\r\n return a[property].localeCompare(b[property]);\r\n }\r\n }\r\n}", "function SortByProperty(a,b)\n\t{\n\t\treturn a[sortType] - b[sortType];\n\t}", "function sortPropFields(fields){\n var reqFields = [];\n var optFields = [];\n\n /** Compare by schema property 'lookup' meta-property, if available. */\n function sortSchemaLookupFunc(a,b){\n var aLookup = (a.props.schema && a.props.schema.lookup) || 750,\n bLookup = (b.props.schema && b.props.schema.lookup) || 750,\n res;\n\n if (typeof aLookup === 'number' && typeof bLookup === 'number') {\n //if (a.props.field === 'ch02_power_output' || b.props.field === 'ch02_power_output') console.log('X', aLookup - bLookup, a.props.field, b.props.field);\n res = aLookup - bLookup;\n }\n\n if (res !== 0) return res;\n else {\n return sortTitle(a,b);\n }\n }\n\n /** Compare by property title, alphabetically. */\n function sortTitle(a,b){\n if (typeof a.props.field === 'string' && typeof b.props.field === 'string'){\n if(a.props.field.toLowerCase() < b.props.field.toLowerCase()) return -1;\n if(a.props.field.toLowerCase() > b.props.field.toLowerCase()) return 1;\n }\n return 0;\n }\n\n _.forEach(fields, function(field){\n if (!field) return;\n if (field.props.required) {\n reqFields.push(field);\n } else {\n optFields.push(field);\n }\n });\n\n reqFields.sort(sortSchemaLookupFunc);\n optFields.sort(sortSchemaLookupFunc);\n\n return reqFields.concat(optFields);\n}", "function propertySort(itemsKey, sortPropertiesKey) {\n var cp = new _emberMetalComputed.ComputedProperty(function (key) {\n var _this5 = this;\n\n function didChange() {\n this.notifyPropertyChange(key);\n }\n\n var items = itemsKey === '@this' ? this : _emberMetalProperty_get.get(this, itemsKey);\n var sortProperties = _emberMetalProperty_get.get(this, sortPropertiesKey);\n\n if (items === null || typeof items !== 'object') {\n return _emberMetalCore.default.A();\n }\n\n // TODO: Ideally we'd only do this if things have changed\n if (cp._sortPropObservers) {\n cp._sortPropObservers.forEach(function (args) {\n return _emberMetalObserver.removeObserver.apply(null, args);\n });\n }\n\n cp._sortPropObservers = [];\n\n if (!_emberRuntimeUtils.isArray(sortProperties)) {\n return items;\n }\n\n // Normalize properties\n var normalizedSort = sortProperties.map(function (p) {\n var _p$split = p.split(':');\n\n var prop = _p$split[0];\n var direction = _p$split[1];\n\n direction = direction || 'asc';\n\n return [prop, direction];\n });\n\n // TODO: Ideally we'd only do this if things have changed\n // Add observers\n normalizedSort.forEach(function (prop) {\n var args = [_this5, itemsKey + '.@each.' + prop[0], didChange];\n cp._sortPropObservers.push(args);\n _emberMetalObserver.addObserver.apply(null, args);\n });\n\n return _emberMetalCore.default.A(items.slice().sort(function (itemA, itemB) {\n for (var i = 0; i < normalizedSort.length; ++i) {\n var _normalizedSort$i = normalizedSort[i];\n var prop = _normalizedSort$i[0];\n var direction = _normalizedSort$i[1];\n\n var result = _emberRuntimeCompare.default(_emberMetalProperty_get.get(itemA, prop), _emberMetalProperty_get.get(itemB, prop));\n if (result !== 0) {\n return direction === 'desc' ? -1 * result : result;\n }\n }\n\n return 0;\n }));\n });\n\n return cp.property(itemsKey + '.[]', sortPropertiesKey + '.[]').readOnly();\n }", "function dynamicSort(property) {\n var sortOrder = 1;\n if (property[0] === \"-\") {\n sortOrder = -1;\n property = property.substr(1);\n }\n\n return function(a, b) {\n if (sortOrder == -1) {\n return b[property].localeCompare(a[property]);\n } else {\n return a[property].localeCompare(b[property]);\n }\n }\n}", "sortByCount() {\n // For this function to work for sorting, I have\n // to store a reference to this so the context is not los\n var concordance = this;\n\n // A fancy way to sort each element\n // Compare the counts\n function sorter(a, b) {\n var diff = concordance.getCount(b) - concordance.getCount(a);\n return diff;\n }\n\n // Sort using the function above!\n this.keys.sort(sorter);\n }", "function propertySort(itemsKey, sortPropertiesKey) {\n var cp = new _emberMetal.ComputedProperty(function (key) {\n var _this4 = this;\n\n var sortProperties = (0, _emberMetal.get)(this, sortPropertiesKey);\n\n (true && !((0, _utils.isArray)(sortProperties) && sortProperties.every(function (s) {\n return typeof s === 'string';\n })) && (0, _emberDebug.assert)('The sort definition for \\'' + key + '\\' on ' + this + ' must be a function or an array of strings', (0, _utils.isArray)(sortProperties) && sortProperties.every(function (s) {\n return typeof s === 'string';\n })));\n\n\n // Add/remove property observers as required.\n var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new WeakMap());\n var activeObservers = activeObserversMap.get(this);\n\n if (activeObservers !== undefined) {\n activeObservers.forEach(function (args) {\n return _emberMetal.removeObserver.apply(undefined, args);\n });\n }\n\n function sortPropertyDidChange() {\n this.notifyPropertyChange(key);\n }\n\n var itemsKeyIsAtThis = itemsKey === '@this';\n var normalizedSortProperties = normalizeSortProperties(sortProperties);\n activeObservers = normalizedSortProperties.map(function (_ref) {\n var prop = _ref[0];\n\n var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop;\n (0, _emberMetal.addObserver)(_this4, path, sortPropertyDidChange);\n return [_this4, path, sortPropertyDidChange];\n });\n\n activeObserversMap.set(this, activeObservers);\n\n var items = itemsKeyIsAtThis ? this : (0, _emberMetal.get)(this, itemsKey);\n if (!(0, _utils.isArray)(items)) {\n return (0, _array.A)();\n }\n\n if (normalizedSortProperties.length === 0) {\n return (0, _array.A)(items.slice());\n } else {\n return sortByNormalizedSortProperties(items, normalizedSortProperties);\n }\n }, { dependentKeys: [sortPropertiesKey + '.[]'], readOnly: true });\n\n cp._activeObserverMap = undefined;\n\n return cp;\n }", "function propertySort(itemsKey, sortPropertiesKey) {\n var cp = new _emberMetal.ComputedProperty(function (key) {\n var _this4 = this;\n\n var sortProperties = (0, _emberMetal.get)(this, sortPropertiesKey);\n\n (true && !((0, _utils.isArray)(sortProperties) && sortProperties.every(function (s) {\n return typeof s === 'string';\n })) && (0, _emberDebug.assert)('The sort definition for \\'' + key + '\\' on ' + this + ' must be a function or an array of strings', (0, _utils.isArray)(sortProperties) && sortProperties.every(function (s) {\n return typeof s === 'string';\n })));\n\n\n // Add/remove property observers as required.\n var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new WeakMap());\n var activeObservers = activeObserversMap.get(this);\n\n if (activeObservers !== undefined) {\n activeObservers.forEach(function (args) {\n return _emberMetal.removeObserver.apply(undefined, args);\n });\n }\n\n function sortPropertyDidChange() {\n this.notifyPropertyChange(key);\n }\n\n var itemsKeyIsAtThis = itemsKey === '@this';\n var normalizedSortProperties = normalizeSortProperties(sortProperties);\n activeObservers = normalizedSortProperties.map(function (_ref) {\n var prop = _ref[0];\n\n var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop;\n (0, _emberMetal.addObserver)(_this4, path, sortPropertyDidChange);\n return [_this4, path, sortPropertyDidChange];\n });\n\n activeObserversMap.set(this, activeObservers);\n\n var items = itemsKeyIsAtThis ? this : (0, _emberMetal.get)(this, itemsKey);\n if (!(0, _utils.isArray)(items)) {\n return (0, _array.A)();\n }\n\n if (normalizedSortProperties.length === 0) {\n return (0, _array.A)(items.slice());\n } else {\n return sortByNormalizedSortProperties(items, normalizedSortProperties);\n }\n }, { dependentKeys: [sortPropertiesKey + '.[]'], readOnly: true });\n\n cp._activeObserverMap = undefined;\n\n return cp;\n }", "set sortNewest(value) {\n this._namedArgs.sort = \"newest\";\n }", "function sortProps(a,b){\n\tvar c = b.weight - a.weight;\n\treturn (c == 0) ? b.index - a.index : c;\n\t}", "function thesortcomparer (prop,updown) {\n return function (a, b) {\n var A = a[prop], B = b[prop];\n if(updown)\n return ((A < B) ? -1 : (A > B) ? +1 : 0);\n else\n return ((A < B) ? 1 : (A > B) ? -1 : 0);\n }\n}", "function propertySort(itemsKey, sortPropertiesKey) {\n var cp = new _emberMetal.ComputedProperty(function (key) {\n var _this4 = this;\n\n var sortProperties = (0, _emberMetal.get)(this, sortPropertiesKey);\n\n (true && !((0, _utils.isArray)(sortProperties) && sortProperties.every(function (s) {\n return typeof s === 'string';\n })) && (0, _emberDebug.assert)('The sort definition for \\'' + key + '\\' on ' + this + ' must be a function or an array of strings', (0, _utils.isArray)(sortProperties) && sortProperties.every(function (s) {\n return typeof s === 'string';\n })));\n\n\n // Add/remove property observers as required.\n var activeObserversMap = cp._activeObserverMap || (cp._activeObserverMap = new _emberMetal.WeakMap());\n var activeObservers = activeObserversMap.get(this);\n\n if (activeObservers !== undefined) {\n activeObservers.forEach(function (args) {\n return _emberMetal.removeObserver.apply(undefined, args);\n });\n }\n\n var itemsKeyIsAtThis = itemsKey === '@this';\n var items = itemsKeyIsAtThis ? this : (0, _emberMetal.get)(this, itemsKey);\n if (!(0, _utils.isArray)(items)) {\n return (0, _native_array.A)();\n }\n\n function sortPropertyDidChange() {\n this.notifyPropertyChange(key);\n }\n\n var normalizedSortProperties = normalizeSortProperties(sortProperties);\n activeObservers = normalizedSortProperties.map(function (_ref) {\n var prop = _ref[0];\n\n var path = itemsKeyIsAtThis ? '@each.' + prop : itemsKey + '.@each.' + prop;\n (0, _emberMetal.addObserver)(_this4, path, sortPropertyDidChange);\n return [_this4, path, sortPropertyDidChange];\n });\n\n activeObserversMap.set(this, activeObservers);\n\n return sortByNormalizedSortProperties(items, normalizedSortProperties);\n }, { dependentKeys: [sortPropertiesKey + '.[]'], readOnly: true });\n\n cp._activeObserverMap = undefined;\n\n return cp;\n }", "sort() {\n const ret = [].sort.apply(this, arguments);\n this._registerAtomic('$set', this);\n return ret;\n }" ]
[ "0.68015325", "0.67337644", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.6611086", "0.66063374", "0.65972155", "0.65752834", "0.6432381", "0.620705", "0.60976297", "0.60779995", "0.6066797", "0.6064156", "0.6051211", "0.60484487", "0.6047184", "0.6041863", "0.6034265", "0.60336477", "0.6023595", "0.60120076", "0.597672", "0.59021586", "0.5840784", "0.5840784", "0.5835561", "0.5830801", "0.58299243", "0.58182865", "0.58182865", "0.58022386", "0.57884276", "0.5787411", "0.5753475", "0.57301986", "0.57151055", "0.5714782", "0.57090056", "0.570728", "0.570728", "0.56960005", "0.56952494", "0.56851876", "0.56849974", "0.5677202" ]
0.67087615
25
Use the same logic as Bootstrap: and materialcomponentsweb
function getContrastText(background) { var contrastText = (0,colorManipulator/* getContrastRatio */.mi)(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary; if (false) { var contrast; } return contrastText; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "upgradeElements () {\n componentHandler.upgradeElements(this.$('[class*=\"mdl-js-\"]'))\n }", "setupComponents() {\n\t\tthis.contactBar = new ContactBar();\n\t\tthis.contactBar.setup();\n\n\t\tthis.modal = new Modal();\n\t\tthis.modal.setup();\n\n\t\tthis.accordion = new Accordion();\n\t\tthis.accordion.setup();\n\n\t\tthis.mediaGallery = new MediaGallery();\n\t\tthis.mediaGallery.setup();\n\t}", "init_() {\n // Add CSS marker that component upgrade is finished.\n // Useful, but beware flashes of unstyled content when relying on this.\n this.root_.dataset.mdlUpgraded = '';\n }", "function Fast_API_elementsExtraJS() {\n // screen (Fast_API) extra code\n /* mobilecarousel_4*/\n var mobilecarousel_4_options = {\n indicatorsListClass: \"ui-carousel-indicators\",\n showIndicator: true,\n showTitle: true,\n titleBuildIn: false,\n titleIsText: true,\n animationDuration: 250,\n useLegacyAnimation: false,\n enabled: true,\n }\n Apperyio.__registerComponent('mobilecarousel_4', new Apperyio.ApperyMobileCarouselComponent(\"Fast_API_mobilecarousel_4\", mobilecarousel_4_options));\n $(\"#Fast_API_mobilecarouselitem_5\").attr(\"reRender\", \"mobilecarousel_4\");\n $(\"#Fast_API_mobilecarouselitem_6\").attr(\"reRender\", \"mobilecarousel_4\");\n $(\"#Fast_API_mobilecarouselitem_7\").attr(\"reRender\", \"mobilecarousel_4\");\n }", "function materialSkinOCM_Init() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('body.material[data-slide-out-widget-area-style=\"slide-out-from-right\"]').length > 0) {\r\n\t\t\t\t\t\tOCM_materialWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tOCM_materialIconMarkup();\r\n\t\t\t\t\tmaterialSkinTransition();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$window.on('resize', OCM_materialSize);\r\n\t\t\t\t\t\r\n\t\t\t\t}", "bootstrap() { }", "componentDidMount() {\n let fabtn = document.querySelectorAll(\".fixed-action-btn\");\n M.FloatingActionButton.init(fabtn, {});\n\n let tooltips = document.querySelectorAll(\".tooltipped\");\n M.Tooltip.init(tooltips, {});\n }", "componentDidMount(){\n const currentMainWidth = window.innerWidth\n document.querySelector(\".App\").width=currentMainWidth\n const currentMainHeight = Math.round(currentMainWidth * (1318/1920))\n document.querySelector(\".App\").style.height = `${currentMainHeight}px`\n if(currentMainWidth<768){\n const inputs=document.querySelectorAll('.form-control-lg')\n const button=document.querySelectorAll('button')\n button[0].classList.add('button-small')\n inputs.forEach(element=>{\n element.classList.remove('form-control-lg')\n })\n }else{\n const inputs=document.querySelectorAll('.form-control')\n console.log(inputs)\n inputs.forEach(element=>{\n element.classList.add('form-control-lg')\n })\n const button=document.querySelectorAll('button')\n button[0].classList.remove('button-small')\n\n }\n }", "bootstrap( opts ) {\n let key = APP_STATES.get( 'BOOTSTRAP' )\n\n return <Bootstrap key={ key } state={ key } />\n }", "function initMaterialize() {\n $('.modal').modal({\n startingTop: '0%',\n endingTop: '5%',\n });\n $('.datepicker').datepicker({\n showDaysInNextAndPreviousMonths: true,\n maxDate: new Date(),\n });\n $('select').formSelect();\n $('.tooltipped').tooltip({\n position: 'top',\n });\n }", "getBootstrap() {\n return {};\n }", "fixMaterials() {\n const baseMaterial = this.getObjectByName('handle').material;\n\n baseMaterial.shininess = 15;\n\n this.refs.touchpad.material = baseMaterial.clone();\n this.refs.touchpad.material.name = 'touchpad-mat';\n\n this.refs.trigger.material = baseMaterial.clone();\n this.refs.trigger.material.name = 'trigger-mat';\n\n this.refs.menuBtn.material = baseMaterial.clone();\n this.refs.menuBtn.material.name = 'menu-mat';\n\n // squeeze-buttons are always handled as one\n this.refs.leftSqueezeBtn.material =\n this.refs.rightSqueezeBtn.material = baseMaterial.clone();\n this.refs.leftSqueezeBtn.material.name = 'squeeze-btn-mat';\n\n this.refs.led.material = new THREE.MeshPhongMaterial({\n name: 'led-mat',\n color: 0x888888,\n emissive: 0x00ff00,\n emissiveIntensity: 0.8\n });\n }", "function setup() {\n var tmp = get('skin');\n if (tmp && $.inArray(tmp, my_skins))\n change_skin(tmp);\n\n // 皮肤切换\n $(\"[data-skin]\").on('click', function (e) {\n if ($(this).hasClass('knob'))\n return;\n e.preventDefault();\n change_skin($(this).data('skin'));\n });\n\n // 布局切换\n $(\"[data-layout]\").on('click', function () {\n change_layout($(this).data('layout'));\n });\n\n // 切换子菜单显示和菜单小图标的显示\n $(\"[data-menu]\").on('click', function () {\n if ($(this).data(\"menu\") == 'show-submenu') {\n $(\"ul.sidebar-menu\").toggleClass(\"show-submenu\");\n } else {\n $(\".nav-addtabs\").toggleClass(\"disable-top-badge\");\n }\n });\n\n // 右侧控制栏切换\n $(\"[data-controlsidebar]\").on('click', function () {\n change_layout($(this).data('controlsidebar'));\n var slide = !AdminLTE.options.controlSidebarOptions.slide;\n AdminLTE.options.controlSidebarOptions.slide = slide;\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open');\n });\n\n // 右侧控制栏背景切换\n $(\"[data-sidebarskin='toggle']\").on('click', function () {\n var sidebar = $(\".control-sidebar\");\n if (sidebar.hasClass(\"control-sidebar-dark\")) {\n sidebar.removeClass(\"control-sidebar-dark\")\n sidebar.addClass(\"control-sidebar-light\")\n } else {\n sidebar.removeClass(\"control-sidebar-light\")\n sidebar.addClass(\"control-sidebar-dark\")\n }\n });\n\n // 菜单栏展开或收起\n $(\"[data-enable='expandOnHover']\").on('click', function () {\n $(this).attr('disabled', true);\n AdminLTE.pushMenu.expandOnHover();\n if (!$('body').hasClass('sidebar-collapse'))\n $(\"[data-layout='sidebar-collapse']\").click();\n });\n\n // 重设选项\n if ($('body').hasClass('fixed')) {\n $(\"[data-layout='fixed']\").attr('checked', 'checked');\n }\n if ($('body').hasClass('layout-boxed')) {\n $(\"[data-layout='layout-boxed']\").attr('checked', 'checked');\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $(\"[data-layout='sidebar-collapse']\").attr('checked', 'checked');\n }\n if ($('ul.sidebar-menu').hasClass('show-submenu')) {\n $(\"[data-menu='show-submenu']\").attr('checked', 'checked');\n }\n if ($('ul.nav-addtabs').hasClass('disable-top-badge')) {\n $(\"[data-menu='disable-top-badge']\").attr('checked', 'checked');\n }\n\n }", "function setup() {\n var tmp = get('skin');\n if (tmp && $.inArray(tmp, my_skins))\n change_skin(tmp);\n\n //Add the change skin listener\n $(\"[data-skin]\").on('click', function (e) {\n e.preventDefault();\n change_skin($(this).data('skin'));\n });\n\n //Add the layout manager\n $(\"[data-layout]\").on('click', function () {\n change_layout($(this).data('layout'));\n });\n\n $(\"[data-controlsidebar]\").on('click', function () {\n change_layout($(this).data('controlsidebar'));\n var slide = !AdminLTE.options.controlSidebarOptions.slide;\n AdminLTE.options.controlSidebarOptions.slide = slide;\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open');\n });\n\n $(\"[data-sidebarskin='toggle']\").on('click', function () {\n var sidebar = $(\".control-sidebar\");\n if (sidebar.hasClass(\"control-sidebar-dark\")) {\n sidebar.removeClass(\"control-sidebar-dark\")\n sidebar.addClass(\"control-sidebar-light\")\n } else {\n sidebar.removeClass(\"control-sidebar-light\")\n sidebar.addClass(\"control-sidebar-dark\")\n }\n });\n \n $(\"[data-enable='expandOnHover']\").on('click', function () {\n $(this).attr('disabled', true); \n AdminLTE.pushMenu.expandOnHover();\n if(!$('body').hasClass('sidebar-collapse'))\n $(\"[data-layout='sidebar-collapse']\").click();\n });\n \n // Reset options\n if($('body').hasClass('fixed')) {\n $(\"[data-layout='fixed']\").attr('checked', 'checked');\n }\n if($('body').hasClass('layout-boxed')) {\n $(\"[data-layout='layout-boxed']\").attr('checked', 'checked');\n }\n if($('body').hasClass('sidebar-collapse')) {\n $(\"[data-layout='sidebar-collapse']\").attr('checked', 'checked');\n }\n \n }", "initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}", "_generateComponents (){\n this._generateJumpButtons();\n }", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "function App() {\n return (\n <div class=\"container p-3 my-3\">\n \n <header class=\"row bg-success p-3\">\n <Componente1/> \n </header>\n\n <nav class=\"navbar navbar-expand-lg navbar-dark row bg-danger\">\n <Componente2/> \n </nav>\n\n <nav class=\"col-md bg-primaary\">\n <Componente4/> \n </nav>\n \n <nav class=\"row bg-dark p-3\">\n <Componente3/> \n </nav>\n\n \n\n </div>\n );\n}", "function initToolbarBootstrapBindings() {\n var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier',\n 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',\n 'Times New Roman', 'Verdana'\n ],\n fontTarget = $('[title=Font]').siblings('.dropdown-menu');\n $.each(fonts, function(idx, fontName) {\n fontTarget.append($('<li><a data-edit=\"fontName ' + fontName + '\" style=\"font-family:\\'' + fontName + '\\'\">' + fontName + '</a></li>'));\n });\n $('a[title]').tooltip({\n container: 'body'\n });\n $('.dropdown-menu input').click(function() {\n return false;\n })\n .change(function() {\n $(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');\n })\n .keydown('esc', function() {\n this.value = '';\n $(this).change();\n });\n\n $('[data-role=magic-overlay]').each(function() {\n var overlay = $(this),\n target = $(overlay.data('target'));\n overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());\n });\n\n if (\"onwebkitspeechchange\" in document.createElement(\"input\")) {\n var editorOffset = $('#remarks').offset();\n\n $('.voiceBtn').css('position', 'absolute').offset({\n top: editorOffset.top,\n left: editorOffset.left + $('#remarks').innerWidth() - 35\n });\n } else {\n $('.voiceBtn').hide();\n }\n }", "function setup() {\n var tmp = get('skin');\n if (tmp && $.inArray(tmp, my_skins))\n change_skin(tmp);\n\n //Add the change skin listener\n $(\"[data-skin]\").on('click', function (e) {\n if($(this).hasClass('knob'))\n return;\n e.preventDefault();\n change_skin($(this).data('skin'));\n });\n\n //Add the layout manager\n $(\"[data-layout]\").on('click', function () {\n change_layout($(this).data('layout'));\n });\n\n $(\"[data-controlsidebar]\").on('click', function () {\n change_layout($(this).data('controlsidebar'));\n var slide = !AdminLTE.options.controlSidebarOptions.slide;\n AdminLTE.options.controlSidebarOptions.slide = slide;\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open');\n });\n\n $(\"[data-sidebarskin='toggle']\").on('click', function () {\n var sidebar = $(\".control-sidebar\");\n if (sidebar.hasClass(\"control-sidebar-dark\")) {\n sidebar.removeClass(\"control-sidebar-dark\")\n sidebar.addClass(\"control-sidebar-light\")\n } else {\n sidebar.removeClass(\"control-sidebar-light\")\n sidebar.addClass(\"control-sidebar-dark\")\n }\n });\n\n $(\"[data-enable='expandOnHover']\").on('click', function () {\n $(this).attr('disabled', true);\n AdminLTE.pushMenu.expandOnHover();\n if (!$('body').hasClass('sidebar-collapse'))\n $(\"[data-layout='sidebar-collapse']\").click();\n });\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $(\"[data-layout='fixed']\").attr('checked', 'checked');\n }\n if ($('body').hasClass('layout-boxed')) {\n $(\"[data-layout='layout-boxed']\").attr('checked', 'checked');\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $(\"[data-layout='sidebar-collapse']\").attr('checked', 'checked');\n }\n\n }", "function setup() {\n var tmp = get('skin');\n if (tmp && $.inArray(tmp, my_skins))\n change_skin(tmp);\n\n //Add the change skin listener\n $(\"[data-skin]\").on('click', function (e) {\n e.preventDefault();\n change_skin($(this).data('skin'));\n });\n\n //Add the layout manager\n $(\"[data-layout]\").on('click', function () {\n change_layout($(this).data('layout'));\n });\n\n $(\"[data-controlsidebar]\").on('click', function () {\n change_layout($(this).data('controlsidebar'));\n var slide = !AdminLTE.options.controlSidebarOptions.slide;\n AdminLTE.options.controlSidebarOptions.slide = slide;\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open');\n });\n\n $(\"[data-sidebarskin='toggle']\").on('click', function () {\n var sidebar = $(\".control-sidebar\");\n if (sidebar.hasClass(\"control-sidebar-dark\")) {\n sidebar.removeClass(\"control-sidebar-dark\")\n sidebar.addClass(\"control-sidebar-light\")\n } else {\n sidebar.removeClass(\"control-sidebar-light\")\n sidebar.addClass(\"control-sidebar-dark\")\n }\n });\n\n $(\"[data-enable='expandOnHover']\").on('click', function () {\n $(this).attr('disabled', true);\n AdminLTE.pushMenu.expandOnHover();\n if (!$('body').hasClass('sidebar-collapse'))\n $(\"[data-layout='sidebar-collapse']\").click();\n });\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $(\"[data-layout='fixed']\").attr('checked', 'checked');\n }\n if ($('body').hasClass('layout-boxed')) {\n $(\"[data-layout='layout-boxed']\").attr('checked', 'checked');\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $(\"[data-layout='sidebar-collapse']\").attr('checked', 'checked');\n }\n\n }", "function setup() {\n var tmp = get('skin');\n if (tmp && $.inArray(tmp, my_skins))\n change_skin(tmp);\n\n //Add the change skin listener\n $(\"[data-skin]\").on('click', function (e) {\n e.preventDefault();\n change_skin($(this).data('skin'));\n });\n\n //Add the layout manager\n $(\"[data-layout]\").on('click', function () {\n change_layout($(this).data('layout'));\n });\n\n $(\"[data-controlsidebar]\").on('click', function () {\n change_layout($(this).data('controlsidebar'));\n var slide = !AdminLTE.options.controlSidebarOptions.slide;\n AdminLTE.options.controlSidebarOptions.slide = slide;\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open');\n });\n\n $(\"[data-sidebarskin='toggle']\").on('click', function () {\n var sidebar = $(\".control-sidebar\");\n if (sidebar.hasClass(\"control-sidebar-dark\")) {\n sidebar.removeClass(\"control-sidebar-dark\")\n sidebar.addClass(\"control-sidebar-light\")\n } else {\n sidebar.removeClass(\"control-sidebar-light\")\n sidebar.addClass(\"control-sidebar-dark\")\n }\n });\n\n $(\"[data-enable='expandOnHover']\").on('click', function () {\n $(this).attr('disabled', true);\n AdminLTE.pushMenu.expandOnHover();\n if (!$('body').hasClass('sidebar-collapse'))\n $(\"[data-layout='sidebar-collapse']\").click();\n });\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $(\"[data-layout='fixed']\").attr('checked', 'checked');\n }\n if ($('body').hasClass('layout-boxed')) {\n $(\"[data-layout='layout-boxed']\").attr('checked', 'checked');\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $(\"[data-layout='sidebar-collapse']\").attr('checked', 'checked');\n }\n\n }", "function component() {\n var element = document.createElement('div');\n var btn = document.createElement('button');\n var br = document.createElement('br');\n\n btn.innerHTML = 'clikcME';\n element.innerHTML = _.join(['Hello', 'webpack'], ' ');\n element.appendChild(br);\n element.appendChild(btn);\n // btn.onclick = Print.bind(null,'click');\n /*element.classList.add('test');\n btn.innerHTML = 'clickMe';\n\n element.appendChild(btn);*/\n\n return element;\n}", "function BootstrapOptions() { }", "function BootstrapOptions() { }", "_injectLibraryDependingOnDriver() {\n switch (this.props.driver) {\n case 'fontawesome':\n {\n const fontawesomeElm = document.querySelector('link#s-fontawesome');\n if (fontawesomeElm) return;\n const linkFontawesomeElm = document.createElement('link');\n linkFontawesomeElm.setAttribute('id', 'fontawesome');\n linkFontawesomeElm.setAttribute('rel', 'stylesheet');\n linkFontawesomeElm.setAttribute('href', this.props.fontawesomeCssUrl);\n linkFontawesomeElm.setAttribute('integrity', this.props.fontawesomeCssIntegrity);\n linkFontawesomeElm.setAttribute('crossorigin', 'anonymous');\n document.head.appendChild(linkFontawesomeElm);\n break;\n }\n\n case 'material':\n {\n const materialElm = document.querySelector('link#s-material');\n if (materialElm) return;\n const linkMaterialElm = document.createElement('link');\n linkMaterialElm.setAttribute('id', 'material');\n linkMaterialElm.setAttribute('href', 'https://fonts.googleapis.com/icon?family=Material+Icons');\n linkMaterialElm.setAttribute('rel', 'stylesheet');\n document.head.appendChild(linkMaterialElm);\n break;\n }\n\n case 'foundation':\n {\n const foundationElm = document.querySelector('link#s-foundation');\n if (foundationElm) return;\n const foundationLinkElm = document.createElement('link');\n foundationLinkElm.setAttribute('id', 'foundation');\n foundationLinkElm.setAttribute('href', this.props.fondationCssUrl);\n foundationLinkElm.setAttribute('rel', 'stylesheet');\n document.head.appendChild(foundationLinkElm);\n break;\n }\n\n default:\n // do nothing by default\n break;\n }\n }", "function FIELD_LIGHT$static_(){ToolbarSkin.FIELD_LIGHT=( new ToolbarSkin(\"field-light\"));}", "function BootstrapOptions(){}", "function initToolbarBootstrapBindings() {\n var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier',\n 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',\n 'Times New Roman', 'Verdana'\n ],\n fontTarget = $('[title=Font]').siblings('.dropdown-menu');\n $.each(fonts, function(idx, fontName) {\n fontTarget.append($('<li><a data-edit=\"fontName ' + fontName + '\" style=\"font-family:\\'' + fontName + '\\'\">' + fontName + '</a></li>'));\n });\n $('a[title]').tooltip({\n container: 'body'\n });\n $('.dropdown-menu input').click(function() {\n return false;\n })\n .change(function() {\n $(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');\n })\n .keydown('esc', function() {\n this.value = '';\n $(this).change();\n });\n\n $('[data-role=magic-overlay]').each(function() {\n var overlay = $(this),\n target = $(overlay.data('target'));\n overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());\n });\n\n if (\"onwebkitspeechchange\" in document.createElement(\"input\")) {\n var editorOffset = $('#inclusions').offset();\n\n $('.voiceBtn').css('position', 'absolute').offset({\n top: editorOffset.top,\n left: editorOffset.left + $('#inclusions').innerWidth() - 35\n });\n } else {\n $('.voiceBtn').hide();\n }\n }", "async afterBootstrap () {}", "function mobile_materialpage() {\r\n /*\r\n End : 6 Mei 2017\r\n Task : Hide testing fields from the layout\r\n Page : Material page / product page\r\n File Location : $BASE_PATH$/image/javascript/js-ezrx.js\r\n Layout : Mobile\r\n */\r\n console.log('mobile_materialpage');\r\n /* hide testing fields */\r\n $(\"#attribute-firstLoad\").hide();\r\n $(\"#attribute-typeHeadScriptTagHolder\").hide();\r\n $(\"#attribute-masterString\").hide();\r\n $(\"#attribute-applicableProducts\").hide();\r\n $(\"#attribute-materialResultsString\").hide();\r\n\r\n setTimeout(function() {\r\n /* align all component on material page */\r\n $(\".ui-controlgroup-controls\").parent().css(\"width\", \"100%\");\r\n $(\".ui-controlgroup-label\").css(\"width\", \"auto\");\r\n $(\".ui-controlgroup-label\").next().css({\r\n \"width\": \"auto\",\r\n \"margin-top\": \"9px\"\r\n });\r\n /* align material search*/\r\n $(\"#attribute-addMaterials\").children('.ui-controlgroup').children().children('.ui-controlgroup-label').css(\"display\", \"none\", \"important\");\r\n $(\"#attribute-addMaterials\").children('.ui-controlgroup').children().children('.ui-controlgroup-controls').css(\"width\", \"130px\", \"important\");\r\n // $( $( $(\"#tab-content\").children()[1] ).children('.ui-body-inherit').children()[0] ).parent().css(\"padding-bottom\",\"100px\", \"important\");\r\n $($($(\"#tab-content\").children()[1]).children('.ui-body-inherit').children()[0]).parent().css(\"padding-bottom\", \"30px\", \"important\");\r\n // $(\"<div id='form_controlsearchmaterial' ></div>\").insertBefore(\"#attribute-addMaterials\");\r\n // $(\"#form_controlsearchmaterial\").css({\"width\":\"400px\", \"min-height\":\"90px\", \"float\":\"right\"});\r\n $(\"#attribute-addMaterials\").css({\r\n \"padding\": \"0px\",\r\n \"margin\": \"0px\",\r\n \"float\": \"left\"\r\n });\r\n // $(\"#attribute-addMaterials\").appendTo(\"#form_controlsearchmaterial\");\r\n\r\n if ($(\"#attribute-previous_res\").hasClass(\"hidden\") == false) {\r\n $(\"#attribute-previous_res\").hide();\r\n $(\"#form_controlsearchmaterial\").append(\"<div class='ui-controlgroup-controls ' style='width: 100px; float:left; margin-top: 15px;'>\" +\r\n \"<div class='html-attr form-field'>\" +\r\n \"<p><button id='cust_prevResult' class='ui-btn ui-shadow ui-corner-all ui-first-child ui-last-child'>Previous</button></p>\" +\r\n \"</div>\" +\r\n \"</div>\");\r\n $(\"#cust_prevResult\").on(\"click\", function() {\r\n $($(\"#attribute-previous_res\").children()[1]).click();\r\n });\r\n }\r\n\r\n if ($(\"#attribute-next_res\").hasClass(\"hidden\") == false) {\r\n $(\"#attribute-next_res\").hide();\r\n $(\"#form_controlsearchmaterial\").append(\"<div class='ui-controlgroup-controls ' style='width: 100px; float:left; margin-top: 15px;margin-left:30px;'>\" +\r\n \"<div class='html-attr form-field'>\" +\r\n \"<p><button id='cust_nextResult' class='ui-btn ui-shadow ui-corner-all ui-first-child ui-last-child'>Next</button></p>\" +\r\n \"</div>\" +\r\n \"</div>\");\r\n $(\"#cust_nextResult\").on(\"click\", function() {\r\n $($(\"#attribute-next_res\").children()[1]).click();\r\n });\r\n }\r\n /* display white if material page still loading */\r\n var $div = $(\"html\");\r\n var observer = new MutationObserver(function(mutations) {\r\n mutations.forEach(function(mutation) {\r\n if (mutation.attributeName === \"class\") {\r\n var attributeValue = $(mutation.target).prop(mutation.attributeName);\r\n if ((attributeValue.search(\"ui-loading\") != -1)) {\r\n $(\"#jg-overlay\").show();\r\n $(\"footer.slideup\").css(\"z-index\", \"999999\");\r\n } else {\r\n $(\"#jg-overlay\").hide();\r\n }\r\n }\r\n });\r\n });\r\n\r\n observer.observe($div[0], {\r\n attributes: true\r\n });\r\n\r\n //incomplete order function start\r\n mobile_incomplete_order();\r\n //incomplete order function end\r\n materialPageText();\r\n\t\t\tmobile_renameButton();\r\n }, 2000);\r\n\r\n $(\"input[name = _line_item_list]\").change(function() {\r\n console.log('mobile_itemCheckBonus');\r\n mobile_itemCheckBonus($(this));\r\n\r\n });\r\n\r\n\r\n /*\r\n End : 6 Mei 2017\r\n Task : Hide testing fields from the layout\r\n Page : Material page / product page\r\n File Location : $BASE_PATH$/image/javascript/js-ezrx.js\r\n Layout : Mobile\r\n */\r\n }", "function handleBootstrap() {\n /*Bootstrap Carousel*/\n jQuery('.carousel').carousel({\n interval: 15000,\n pause: 'hover'\n });\n\n /*Tooltips*/\n jQuery('.tooltips').tooltip();\n jQuery('.tooltips-show').tooltip('show'); \n jQuery('.tooltips-hide').tooltip('hide'); \n jQuery('.tooltips-toggle').tooltip('toggle'); \n jQuery('.tooltips-destroy').tooltip('destroy'); \n\n /*Popovers*/\n jQuery('.popovers').popover();\n jQuery('.popovers-show').popover('show');\n jQuery('.popovers-hide').popover('hide');\n jQuery('.popovers-toggle').popover('toggle');\n jQuery('.popovers-destroy').popover('destroy');\n }", "function LIGHT$static_(){ToolbarSkin.LIGHT=( new ToolbarSkin(\"light\"));}", "static get tag(){return\"md-block\"}", "initializeComponents() {\n // Initialize Info Panel\n this.infoComponent = new InfoPanel(\"info-panel-placeholder\");\n\n // Initialize Map\n this.mapComponent = new Map(\"map-placeholder\");\n\n //Initialize city dropdown\n this.dropdown = new DropDown(\"dropdown-panel-placeholder\", {\n data: { apiService: this.api },\n events: {\n resultSelected: event => {\n this.layerPanel.resetLayerSelections();\n this.mapComponent.panToLocation();\n }\n }\n });\n\n // Initialize Layer Toggle Panel\n this.layerPanel = new LayerPanel(\"layer-panel-placeholder\", {\n data: { layer: [...this.locationPointTypes] },\n events: {\n layerToggle:\n // Toggle layer in map controller on \"layerToggle\" event\n event => {\n this.mapComponent.toggleLayer(event.detail);\n }\n }\n });\n }", "function doBootstrap() {\n\n\tAssets.Initialize(function() {\n\n\t\t// Initialize the scnees.\n\t\tFramework.Initialize();\n\t\tdocument.getElementById(\"canvas_container\").addEventListener(\"mousedown\", function(evt){\n\t\t\tFramework.DoMouseDown( evt.offsetX, evt.offsetY );\n\t\t});\n\n\t\tdocument.body.addEventListener(\"keydown\", function(evt) {\n\t\t\t\tvar key = evt.keyCode;\n\t\t\t\tFramework.DoKeyDown(key);\n\t\t});\n\n\t\tdocument.body.addEventListener(\"keyup\", function(evt) {\n\t\t\t\tvar key = evt.keyCode;\n\t\t\t\tFramework.DoKeyUp(key);\n\t\t});\n\n\n\t\tdocument.getElementById(\"canvas_container\").onmousedown = function(evt){\n\t\t\tif ( evt.offsetX === undefined || evt.offsetY === undefined ) {\n\t\t\t\tvar rect = document.getElementById(\"canvas_container\").getBoundingClientRect();\n\t\t\t\tFramework.DoMouseDown( evt.clientX - rect.left, evt.clientY - rect.top );\n\t\t\t} else {\n\t\t\t\tFramework.DoMouseDown( evt.offsetX, evt.offsetY );\n\t\t\t}\n\t\t};\n\n\t\tdocument.getElementById(\"canvas_container\").addEventListener(\"mousemove\", function(evt) {\n\t\t\tif ( evt.offsetX === undefined || evt.offsetY === undefined ) {\n\t\t\t\tvar rect = document.getElementById(\"canvas_container\").getBoundingClientRect();\n\t\t\t\tFramework.DoMouseMove( evt.clientX - rect.left, evt.clientY - rect.top );\n\t\t\t} else {\n\t\t\t\tFramework.DoMouseMove( evt.offsetX, evt.offsetY );\n\t\t\t}\n\t\t});\n\n\t\tfunction update_loop() {\n\t\t\tFramework.DoUpdate();\n\t\t\tsetTimeout( update_loop, 20 );\n\t\t}\n\n\t\tfunction draw_loop() {\n\t\t\tFramework.DoDraw();\n\t\t\tsetTimeout( draw_loop, 20 );\n\t\t}\n\n\t\tupdate_loop();\n\t\tdraw_loop();\n\n\t});\n\n}", "function BootstrapOptions() {}", "function BootstrapOptions() {}", "function BootstrapOptions() {}", "componentDidUpdate () {\n const elems_collapsible = document.querySelectorAll('.collapsible')\n const elems_tooltipped = document.querySelectorAll('.tooltipped')\n const elems_modal = document.querySelectorAll('.modal')\n const elems_carousel = document.querySelectorAll('.carousel')\n const options_collapsible = {}\n const options_tooltipped = {}\n const options_modal = {}\n const options_carousel = {fullWidth: true, indicators: true}\n M.Collapsible.init(elems_collapsible, options_collapsible)\n M.Tooltip.init(elems_tooltipped, options_tooltipped)\n M.Modal.init(elems_modal, options_modal)\n // Debug the indicator init\n if (!this.state.CarouselInit) {\n M.Carousel.init(elems_carousel, options_carousel)\n this.setState({\n CarouselInit : true\n })\n }\n }", "render() {\n const classes = {\n 'mdc-top-app-bar--fixed':\n this.type === 'fixed' || this.type === 'prominentFixed',\n 'mdc-top-app-bar--short':\n this.type === 'shortCollapsed' || this.type === 'short',\n 'mdc-top-app-bar--short-collapsed': this.type === 'shortCollapsed',\n 'mdc-top-app-bar--prominent':\n this.type === 'prominent' || this.type === 'prominentFixed',\n 'mdc-top-app-bar--dense': this.dense,\n };\n const extraRow = this.extraRow\n ? html`\n <div class=\"mdc-top-app-bar__row\">\n <section class=\"mdc-top-app-bar__section\">\n <div class=\"mdc-top-app-bar__row\">\n <slot name=\"extraRow\"></slot>\n <section style=\"display: block\">\n <label>Text Color</label>\n <input onblur=\"setColorValue(this, '--pie-text', this.value)\"\n value=\"${document.body.style.getPropertyValue('--pie-text')}\"\n onchange=\"setColorValue(this, '--pie-text', this.value)\" />\n </section>\n <br />\n <section>\n <label>Disabled Color</label>\n <input onblur=\"setColorValue(this, '--pie-disabled', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-disabled'\n )}\"\n onchange=\"setColorValue(this, '--pie-disabled', this.value)\" />\n </section>\n <br />\n <section>\n <label>Correct Color</label>\n <input onblur=\"setColorValue(this, '--pie-correct', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-correct'\n )}\"\n onchange=\"setColorValue(this, '--pie-correct', this.value)\" />\n </section>\n <br />\n <section>\n <label>Incorrect Color</label>\n <input onblur=\"setColorValue(this, '--pie-incorrect', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-incorrect'\n )}\"\n onchange=\"setColorValue(this, '--pie-incorrect', this.value)\" />\n </section>\n <br />\n </div>\n <div class=\"mdc-top-app-bar__row\">\n <section>\n <label>Primary Color</label>\n <input onblur=\"setColorValue(this, '--pie-primary', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-primary'\n )}\"\n onchange=\"setColorValue(this, '--pie-primary', this.value)\" />\n </section>\n \n <section>\n <label>Primary Dark Color</label>\n <input onblur=\"setColorValue(this, '--pie-primary-dark', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-primary-dark'\n )}\"\n onchange=\"setColorValue(this, '--pie-primary-dark', this.value)\" />\n </section>\n <section>\n <label>Primary Light Color</label>\n <input onblur=\"setColorValue(this, '--pie-primary-light', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-primary-light'\n )}\"\n onchange=\"setColorValue(this, '--pie-primary-light', this.value)\" />\n </section>\n <br />\n </div>\n <div class=\"mdc-top-app-bar__row\">\n <section>\n <label>Secondary Color</label>\n <input onblur=\"setColorValue(this, '--pie-secondary', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-secondary'\n )}\"\n onchange=\"setColorValue(this, '--pie-secondary', this.value)\" />\n </section>\n <section>\n <label>Secondary Dark Color</label>\n <input onblur=\"setColorValue(this, '--pie-secondary-dark', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-secondary-dark'\n )}\"\n onchange=\"setColorValue(this, '--pie-secondary-dark', this.value)\" />\n </section>\n <section>\n <label>Secondary Light Color</label>\n <input onblur=\"setColorValue(this, '--pie-secondary-light', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-secondary-light'\n )}\"\n onchange=\"setColorValue(this, '--pie-secondary-light', this.value)\" />\n </section>\n <br />\n </div>\n <div class=\"mdc-top-app-bar__row\">\n <section>\n <label>Background Color</label>\n <input onblur=\"setColorValue(this, '--pie-background', this.value)\"\n value=\"${document.body.style.getPropertyValue(\n '--pie-background'\n )}\"\n onchange=\"setColorValue(this, '--pie-background', this.value)\" />\n </section>\n <br />\n <div>\n <button onclick=\"setBlackTextOnWhiteBackground()\">\n Black Text on White Background\n </button>\n </div>\n <div>\n <button onclick=\"setWhiteTextOnBlackBackground()\">\n White Text on Black Background\n </button>\n </div>\n <div>\n <button onclick=\"setYellowTextOnBlueBackground()\">\n Yellow Text on Blue Background\n </button>\n </div>\n </section>\n </div>\n </div>\n `\n : '';\n return html`\n <header class=\"mdc-top-app-bar ${classMap(classes)}\">\n <div class=\"mdc-top-app-bar__row\">\n <section\n class=\"mdc-top-app-bar__section mdc-top-app-bar__section--align-start\"\n >\n <slot name=\"navigationIcon\"></slot>\n <span class=\"mdc-top-app-bar__title\"\n ><slot name=\"title\"></slot\n ></span>\n </section>\n <section\n class=\"mdc-top-app-bar__section mdc-top-app-bar__section--align-end\"\n role=\"toolbar\"\n >\n <slot name=\"actionItems\"></slot>\n </section>\n </div>\n ${extraRow}\n </header>\n `;\n }", "renderChildComponents() {\n this.renderModuleButton();\n this.renderRoleDropdown();\n }", "function Material() {}", "componentDidMount() {\n // $('.float-label').jvFloat();\n // var WinHeight = $(window).height();\n // $('.step_form_wrap').height(WinHeight - (240 + $('.app_header').outerHeight(true)));\n }", "initializeElements () {\n this.$els = {\n window,\n body: document.body\n }\n }", "init() {\n // override init to make sure createEl is not triggered\n }", "updateComponent() {\n const materialLaunchIcon = this.shadowRoot.getElementById('launch-icon');\n this.helpLinkElement.innerHTML = this['app-context'] + \" help and resources \";\n this.helpLinkElement.appendChild(materialLaunchIcon);\n this.helpLinkElement.setAttribute(\"href\", this['url']);\n if (this['url'] && this['url'].startsWith(\"http\")) {\n this.helpLinkElement.setAttribute(\"rel\", \"noopener noreferrer\");\n this.helpLinkElement.setAttribute(\"target\", \"_blank\");\n }\n }", "function initToolbarBootstrapBindings() {\n var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier',\n 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',\n 'Times New Roman', 'Verdana'\n ],\n fontTarget = $('[title=Font]').siblings('.dropdown-menu');\n $.each(fonts, function(idx, fontName) {\n fontTarget.append($('<li><a data-edit=\"fontName ' + fontName + '\" style=\"font-family:\\'' + fontName + '\\'\">' + fontName + '</a></li>'));\n });\n $('a[title]').tooltip({\n container: 'body'\n });\n $('.dropdown-menu input').click(function() {\n return false;\n })\n .change(function() {\n $(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');\n })\n .keydown('esc', function() {\n this.value = '';\n $(this).change();\n });\n\n $('[data-role=magic-overlay]').each(function() {\n var overlay = $(this),\n target = $(overlay.data('target'));\n overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());\n });\n\n if (\"onwebkitspeechchange\" in document.createElement(\"input\")) {\n var editorOffset = $('#cancellationPolicy').offset();\n\n $('.voiceBtn').css('position', 'absolute').offset({\n top: editorOffset.top,\n left: editorOffset.left + $('#cancellationPolicy').innerWidth() - 35\n });\n } else {\n $('.voiceBtn').hide();\n }\n }", "function OCM_materialSize() {\r\n\t\t\t\t\tif ($('.ocm-effect-wrap.material-ocm-open').length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.ocm-effect-wrap').css({\r\n\t\t\t\t\t\t\t'height': $window.height()\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.ocm-effect-wrap-inner').css({\r\n\t\t\t\t\t\t\t'padding-top': nectarDOMInfo.adminBarHeight\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "componentDidMount() {\n document.addEventListener('DOMContentLoaded', function() {\n var elems = document.querySelectorAll('.dropdown-button');\n var instances = window.M.Dropdown.init(elems, {});\n }); \n }", "function setup() {\n var tmp = get('skin')\n if (tmp && $.inArray(tmp, mySkins))\n changeSkin(tmp)\n\n // Add the change skin listener\n $('[data-skin]').on('click', function (e) {\n if ($(this).hasClass('knob'))\n return\n e.preventDefault()\n changeSkin($(this).data('skin'))\n })\n\n // Add the layout manager\n $('[data-layout]').on('click', function () {\n changeLayout($(this).data('layout'))\n })\n\n $('[data-controlsidebar]').on('click', function () {\n changeLayout($(this).data('controlsidebar'))\n var slide = !$controlSidebar.options.slide\n\n $controlSidebar.options.slide = slide\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open')\n })\n\n $('[data-sidebarskin=\"toggle\"]').on('click', function () {\n var $sidebar = $('.control-sidebar')\n if ($sidebar.hasClass('control-sidebar-dark')) {\n $sidebar.removeClass('control-sidebar-dark')\n $sidebar.addClass('control-sidebar-light')\n } else {\n $sidebar.removeClass('control-sidebar-light')\n $sidebar.addClass('control-sidebar-dark')\n }\n })\n\n $('[data-enable=\"expandOnHover\"]').on('click', function () {\n $(this).attr('disabled', true)\n $pushMenu.expandOnHover()\n if (!$('body').hasClass('sidebar-collapse'))\n $('[data-layout=\"sidebar-collapse\"]').click()\n })\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $('[data-layout=\"fixed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('layout-boxed')) {\n $('[data-layout=\"layout-boxed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $('[data-layout=\"sidebar-collapse\"]').attr('checked', 'checked')\n }\n\n }", "function setup() {\n var tmp = get('skin')\n if (tmp && $.inArray(tmp, mySkins))\n changeSkin(tmp)\n\n // Add the change skin listener\n $('[data-skin]').on('click', function (e) {\n if ($(this).hasClass('knob'))\n return\n e.preventDefault()\n changeSkin($(this).data('skin'))\n })\n\n // Add the layout manager\n $('[data-layout]').on('click', function () {\n changeLayout($(this).data('layout'))\n })\n\n $('[data-controlsidebar]').on('click', function () {\n changeLayout($(this).data('controlsidebar'))\n var slide = !$controlSidebar.options.slide\n\n $controlSidebar.options.slide = slide\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open')\n })\n\n $('[data-sidebarskin=\"toggle\"]').on('click', function () {\n var $sidebar = $('.control-sidebar')\n if ($sidebar.hasClass('control-sidebar-dark')) {\n $sidebar.removeClass('control-sidebar-dark')\n $sidebar.addClass('control-sidebar-light')\n } else {\n $sidebar.removeClass('control-sidebar-light')\n $sidebar.addClass('control-sidebar-dark')\n }\n })\n\n $('[data-enable=\"expandOnHover\"]').on('click', function () {\n $(this).attr('disabled', true)\n $pushMenu.expandOnHover()\n if (!$('body').hasClass('sidebar-collapse'))\n $('[data-layout=\"sidebar-collapse\"]').click()\n })\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $('[data-layout=\"fixed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('layout-boxed')) {\n $('[data-layout=\"layout-boxed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $('[data-layout=\"sidebar-collapse\"]').attr('checked', 'checked')\n }\n\n }", "function setup() {\n var tmp = get('skin')\n if (tmp && $.inArray(tmp, mySkins))\n changeSkin(tmp)\n\n // Add the change skin listener\n $('[data-skin]').on('click', function (e) {\n if ($(this).hasClass('knob'))\n return\n e.preventDefault()\n changeSkin($(this).data('skin'))\n })\n\n // Add the layout manager\n $('[data-layout]').on('click', function () {\n changeLayout($(this).data('layout'))\n })\n\n $('[data-controlsidebar]').on('click', function () {\n changeLayout($(this).data('controlsidebar'))\n var slide = !$controlSidebar.options.slide\n\n $controlSidebar.options.slide = slide\n if (!slide)\n $('.control-sidebar').removeClass('control-sidebar-open')\n })\n\n $('[data-sidebarskin=\"toggle\"]').on('click', function () {\n var $sidebar = $('.control-sidebar')\n if ($sidebar.hasClass('control-sidebar-dark')) {\n $sidebar.removeClass('control-sidebar-dark')\n $sidebar.addClass('control-sidebar-light')\n } else {\n $sidebar.removeClass('control-sidebar-light')\n $sidebar.addClass('control-sidebar-dark')\n }\n })\n\n $('[data-enable=\"expandOnHover\"]').on('click', function () {\n $(this).attr('disabled', true)\n $pushMenu.expandOnHover()\n if (!$('body').hasClass('sidebar-collapse'))\n $('[data-layout=\"sidebar-collapse\"]').click()\n })\n\n // Reset options\n if ($('body').hasClass('fixed')) {\n $('[data-layout=\"fixed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('layout-boxed')) {\n $('[data-layout=\"layout-boxed\"]').attr('checked', 'checked')\n }\n if ($('body').hasClass('sidebar-collapse')) {\n $('[data-layout=\"sidebar-collapse\"]').attr('checked', 'checked')\n }\n\n }", "constructor() {\n // Always call super first in constructor\n super();\n\n // Create a shadow root\n const shadow = this.attachShadow({ mode: \"open\" });\n\n const buttonComponent = template.content;\n // Create input button with default values\n const text = this.innerHTML;\n buttonComponent.querySelector('button').innerHTML = text;\n\n // Attach the created elements to the shadow dom\n shadow.appendChild(buttonComponent.cloneNode(true));\n\n // check if bootstrap is enabled\n this._checkbootstrap(shadow);\n }", "function boot(err, cesData, wageData) {\n if (cesData)\n window.originalCesData = cesData;\n if (wageData)\n window.originalWageData = wageData;\n processCesData();\n addFilterDropShadow();\n// renderTable(); //not needed\n renderGraphic();\n// renderSparkline(); //not needed\n bindEvents(); //TODO\n// startFixie(); //not needed\n transitionBetween(true); //TODO\n// toggleKey(); //not needed\n renderKey(); //not needed\n// cloneToStaticSpots(); //not needed\n}", "function drupalgap_bootstrap() {\n try {\n // Load up any contrib and/or custom modules (the DG core moodules have\n // already been loaded at this point), load the theme and all blocks. Then\n // build the menu router, load the menus, and build the theme registry.\n drupalgap_load_modules();\n drupalgap_load_theme();\n drupalgap_load_blocks();\n menu_router_build();\n drupalgap_menus_load();\n drupalgap_theme_registry_build();\n\n // Attach device back button handler (Android).\n document.addEventListener('backbutton', drupalgap_back, false);\n }\n catch (error) { console.log('drupalgap_bootstrap - ' + error); }\n}", "_setInitialComponentDisplay() {\n const that = this;\n\n if (that.spinButtons === false) {\n that.$spinButtonsContainer.addClass('jqx-hidden');\n }\n\n if (that.radixDisplay === false) {\n that.$radixDisplayButton.addClass('jqx-hidden');\n }\n\n if (that.showUnit === false) {\n that.$unitDisplay.addClass('jqx-hidden');\n }\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}", "_ConstructElements() {\n // Create the container that all the other elements will be contained within\n this.container = document.createElement('div');\n this.container.classList.add(styles['guify-container']);\n\n let containerCSS = {};\n\n // Position the container relative to the root based on `opts`\n if(this.opts.barMode == 'overlay' || this.opts.barMode == 'above' || this.opts.barMode == 'none'){\n containerCSS.position = 'absolute';\n }\n if(this.hasRoot && this.opts.barMode == 'above'){\n containerCSS.top = `-${theme.sizing.menuBarHeight}`;\n }\n css(this.container, containerCSS);\n\n // Insert the container into the root as the first element\n this.opts.root.insertBefore(this.container, this.opts.root.childNodes[0]);\n\n // Create a menu bar if specified in `opts`\n if(this.opts.barMode !== 'none') {\n this.bar = new MenuBar(this.container, this.opts);\n this.bar.addListener('ontogglepanel', () => {\n this.panel.ToggleVisible();\n });\n }\n\n // Create panel\n this.panel = new Panel(this.container, this.opts);\n\n // Show the panel by default if there's no menu bar or it's requested\n if(this.opts.barMode === 'none' || this.opts.open === true) {\n this.panel.SetVisible(true);\n } else {\n // Otherwise hide it by default\n this.panel.SetVisible(false);\n }\n\n // Create toast area\n this.toaster = new ToastArea(this.container, this.opts);\n\n }", "static renderer (elem) {\n if (!elem.shadowRoot) {\n elem.attachShadow({ mode: 'open' });\n }\n patchInner(elem.shadowRoot, () => {\n const possibleFn = elem.renderCallback(elem);\n if (isFunction(possibleFn)) {\n possibleFn();\n } else if (Array.isArray(possibleFn)) {\n possibleFn.forEach((fn) => {\n if (isFunction(fn)) {\n fn();\n }\n });\n }\n });\n }", "function modern() {\n\tdocument.getElementById('custom').className = 'modern';\n}", "function preBootstrap() {\n setTimeout(bootstrap, 200);\n}", "build() {\n // this.element = this.ce('div', {\n // class: 'table-responsive'\n // });\n // this.createLabel(this.element);\n\n // var tableClass = 'table ';\n // ['striped', 'bordered', 'hover', 'condensed'].forEach(function(prop) {\n // if (this.component[prop]) {\n // tableClass += `table-${prop} `;\n // }\n // }.bind(this));\n\n // var table = this.ce('table', {\n // class: tableClass\n // });\n\n // Build the body.\n // var tbody = this.ce('tbody');\n // this.inputs = [];\n\n // for (let i = 0; i < this.component.numRows; i++) {\n // var tr = this.ce('tr');\n // this.checks.push([]);\n // for (let j = 0; j < this.component.numCols; j++) {\n // var td = this.ce('td');\n // this.checks[i][j] = this.ce('input', {\n // type: 'checkbox'\n // });\n // this.addInput(this.checks[i][j], td);\n // tr.appendChild(td);\n // }\n // tbody.appendChild(tr);\n // }\n // table.appendChild(tbody);\n // this.element.appendChild(table);\n }", "componentDidUpdate() {\n window.componentHandler.upgradeDom()\n }", "static renderer (elem) {\n if (!elem.shadowRoot) {\n elem.attachShadow({ mode: 'open' });\n }\n patchInner_1(elem.shadowRoot, () => {\n const possibleFn = elem.renderCallback(elem);\n if (isFunction(possibleFn)) {\n possibleFn();\n } else if (Array.isArray(possibleFn)) {\n possibleFn.forEach((fn) => {\n if (isFunction(fn)) {\n fn();\n }\n });\n }\n });\n }", "render() {\n const classes = {\n \"mdc-fab--mini\": this.mini,\n \"mdc-fab--exited\": this.exited,\n \"mdc-fab--extended\": this.extended,\n };\n const showLabel = this.label !== \"\" && this.extended;\n return _material_mwc_base_base_element__WEBPACK_IMPORTED_MODULE_1__[\"html\"] `\n <button\n .ripple=\"${Object(_material_mwc_ripple_ripple_directive_js__WEBPACK_IMPORTED_MODULE_2__[\"ripple\"])()}\"\n class=\"mdc-fab ${Object(_material_mwc_base_base_element__WEBPACK_IMPORTED_MODULE_1__[\"classMap\"])(classes)}\"\n ?disabled=\"${this.disabled}\"\n aria-label=\"${this.label || this.icon}\"\n >\n ${showLabel && this.showIconAtEnd ? this.label : \"\"}\n ${this.icon\n ? _material_mwc_base_base_element__WEBPACK_IMPORTED_MODULE_1__[\"html\"] `\n <ha-icon .icon=${this.icon}></ha-icon>\n `\n : \"\"}\n ${showLabel && !this.showIconAtEnd ? this.label : \"\"}\n </button>\n `;\n }", "function PratoDoDiaComponent() {\n }", "function Component() { }", "componentDidMount() {\n if(typeof componentHandler !== 'undefined')\n componentHandler.upgradeDom();\n }", "function WMEEmptyStreet_bootstrap() {\n\tif(!window.Waze.map) {\n\t\tsetTimeout(WMEEmptyStreet_bootstrap, 1000);\n\t\treturn;\n\t}\n WMEEmptyStreet_init();\n log(\"Start\");\n}", "function Comprador_elementsExtraJS() {\n // screen (Comprador) extra code\n /* mobilelist_11 */\n listView = $(\"#Comprador_mobilelist_11\");\n theme = listView.attr(\"data-theme\");\n if (typeof theme !== 'undefined') {\n var themeClass = \"ui-btn-up-\" + theme;\n listItem = $(\"#Comprador_mobilelist_11 .ui-li-static\");\n $.each(listItem, function(index, value) {\n $(this).addClass(themeClass);\n });\n }\n /* mobilelistitem_12 */\n /* mobilelistitem_14 */\n /* mobilelistitem_16 */\n /* mobilelistitem_109 */\n }", "static get miniStyles() {\n return [\n css`\n :host {\n position: relative;\n height: 0;\n margin: 0 auto;\n padding: 0;\n border: none;\n background-color: none;\n }\n #container {\n display: flex;\n position: absolute;\n bottom: 0;\n margin: 0 auto;\n padding: 0;\n border: var(--rich-text-editor-border-width, 1px) solid\n var(--rich-text-editor-border-color, #ddd);\n background-color: var(\n --rich-text-editor-bg,\n var(--rich-text-editor-bg, #ffffff)\n );\n }\n `,\n ];\n }", "componentDidMount() {\n $('head').append('<link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.10.3/css/bootstrap-tour-standalone.css\">');\n $(\".button-collapse\").sideNav({\n closeOnClick: true //closes when we click things\n });\n\n $('head').append('<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\">');\n $('head').append('<link rel=\"shortcut icon\" type=\"image/png\" href=\"favicon.png\">');\n $.getScript(\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.10.3/js/bootstrap-tour-standalone.js\", function(){\n\n });\n }", "function materialSkinTransition() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('body.material[data-header-search=\"true\"]').length > 0 || \r\n\t\t\t\t\t$('body.material .ocm-effect-wrap').length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar materialTransTO,\r\n\t\t\t\t\t\tallowMaterialResizeCalc = false,\r\n\t\t\t\t\t\torientTrack = 0,\r\n\t\t\t\t\t\t$winDOMWidth = nectarDOMInfo.winW,\r\n\t\t\t\t\t\t$winDOMHeight = nectarDOMInfo.winH;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// For mobile make sure the orientation has changed.\r\n\t\t\t\t\t\twindow.addEventListener(\"orientationchange\", function () {\r\n\t\t\t\t\t\t\torientTrack = 1;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Resize.\r\n\t\t\t\t\t\t$window.on('resize', function () {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( nectarDOMInfo.usingMobileBrowser ) {\r\n\t\t\t\t\t\t\t\t// Mobile.\r\n\t\t\t\t\t\t\t\tif (($window.width() != $winDOMWidth && $window.height != $winDOMHeight) || orientTrack === 1) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// Store the current window dimensions.\r\n\t\t\t\t\t\t\t\t\t$winDOMWidth = nectarDOMInfo.winW;\r\n\t\t\t\t\t\t\t\t\t$winDOMHeight = nectarDOMInfo.winH;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// Reset orientation change tracker.\r\n\t\t\t\t\t\t\t\t\torientTrack = 0;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t// Set to allow.\r\n\t\t\t\t\t\t\t\t\tallowMaterialResizeCalc = 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} else {\r\n\t\t\t\t\t\t\t\t// Desktop always allows.\r\n\t\t\t\t\t\t\t\tallowMaterialResizeCalc = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(allowMaterialResizeCalc) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tclearTimeout(materialTransTO);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$('body[data-slide-out-widget-area-style=\"slide-out-from-right\"] > a.slide_out_area_close, .material #header-outer, .ocm-effect-wrap, .ocm-effect-wrap-shadow')\r\n\t\t\t\t\t\t\t\t\t.addClass('no-material-transition');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tmaterialTransTO = setTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t$('body[data-slide-out-widget-area-style=\"slide-out-from-right\"] > a.slide_out_area_close, .material #header-outer, .ocm-effect-wrap, .ocm-effect-wrap-shadow')\r\n\t\t\t\t\t\t\t\t\t\t.removeClass('no-material-transition');\r\n\t\t\t\t\t\t\t\t}, 250);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tOCM_materialWidth();\r\n\r\n\t\t\t\t\t\t\t\t// Reset allow.\r\n\t\t\t\t\t\t\t\tallowMaterialResizeCalc = false;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t} // endif for allow.\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}); // end resize.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "static template() { return 'CanvasComponent'; }", "static get template() {\n // Tag the returned template literal with the html helper function\n // to convert it into an instance of HTMLTemplateElement\n return html`\n <!-- Compiled and minified CSS -->\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css\">\n\n <style include=\"shared-styles\">\n footer{\n padding-top: 50px;\n background: #f6f6f6;\n }\n .app-cart-links ul li{\n margin-bottom: 5px;\n }\n .app-cart-links ul li a{\n color: var(--royalblue);\n -webkit-transition: all ease .4s;\n }\n .app-cart-links ul li a:hover{\n color: var(--darkblue);\n font-weight: 600;\n }\n .app-cart-copy-right{\n background: #ddd;\n padding: 5px;\n text-align: center;\n }\n .app-cart-copy-right p{\n margin: 0;\n }\n .foot-link-maintain{\n color: var(--royalblue);\n -webkit-transition: all ease .4s;\n }\n .foot-link-maintain:hover{\n color: var(--darkblue);\n }\n .container{\n width: 80%!important;\n }\n </style>\n <footer>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col m4 s12\">\n <div class=\"app-cart-about\">\n <h5 tabindex=\"0\">UniqueHire Consulting LLP</h5>\n <p tabindex=\"0\">the readable content of a page when looking at its layout \n the readable content of a page when looking at its layout\n the readable content of a page when looking at its layout\n the readable content of a page when looking at its layout </p>\n </div>\n </div>\n\n <div class=\"col m4 s12 \">\n <div class=\"app-cart-links\">\n <ul>\n <li> <a name=\"home\" href=\"[[rootPath]]home\">Home</a> </li>\n <li><a name=\"productdetails\" href=\"[[rootPath]]productdetails\">Product Details</a></li>\n <li><a name=\"products\" href=\"[[rootPath]]products\">products</a></li>\n <li> <a name=\"cart\" href=\"[[rootPath]]cart\">cart</a></li> \n </ul>\n </div>\n </div>\n\n <div class=\"col m4 s12\">\n <div class=\"app-cart-location\">\n <address>\n <h5 tabindex=\"0\">Address</h5>\n <p tabindex=\"0\">486, 1st Cross Rd, Aswath Nagar,</p>\n <p tabindex=\"0\">Marathahalli, Bengaluru, Karnataka 560037</p>\n </address>\n </div>\n </div>\n </div>\n </div>\n \n <div class=\"app-cart-copy-right\">\n <p tabindex=\"0\">All rights reserved and maintained by <a href=\"uniquehire.in\" class=\"foot-link-maintain\" role=\"link\">uniquehire</a></p>\n </div>\n </footer>\n `;\n }", "defineBEMBlocks() {\n return {\n container: (this.props.mod || 'cr-search-summary')\n }\n }", "function DiagnosesComponentStyle(){\r\n this.initByNamespace(\"dx\");\r\n}", "createMarkup() {\n // get a list of all the observables\n // and then say render according to the current component\n const state = this.appState.get();\n const { formId } = state;\n\n return `<div id=${formId} class='column'>\n <div> </div>\n <div class=' row section'>\n <button class='rowOffer ' id=\"switchComponent\" type=\"button\"> Switch Component </button>\n </div> \n </div>`;\n }", "function initBootstrap()\r\n{\r\n\t// Activate tooltips\r\n\t$('[data-toggle=\"tooltip\"]').tooltip();\r\n}", "function set_styles() {\n \n // Parameters to display the elements in the web page - these can be changes\n const widget_width = '680px';\n const widget_max_width = '100%';\n const show_color_width = '100%';\n const show_color_height = '100px';\n \n component.style.display = 'block';\n component.style.width = `${widget_width}`;\n component.style.maxWidth = `${widget_max_width}`;\n component.style.fontFamily = 'inherit';\n const widgets = document.querySelectorAll('rgb-widget > div');\n Array.from(widgets).forEach(widget => {\n widget.style.marginTop = '20px';\n widget.style.paddingBottom = '8px';\n widget.style.borderBottom = 'solid 1px #ccc';\n });\n const widgetsDivs = document.querySelectorAll('rgb-widget > div > div:not(:last-child)');\n Array.from(widgetsDivs).forEach(widgetsDiv => {\n widgetsDiv.style.height = '30px';\n });\n const labels = document.querySelectorAll('rgb-widget > div label');\n Array.from(labels).forEach(label => {\n label.style.display = 'inline-flex';\n label.style.width = '230px';\n label.style.justifyContent = 'space-between';\n label.style.marginRight = '20px';\n });\n const inputs = document.querySelectorAll('rgb-widget > div input[type=\"range\"]');\n Array.from(inputs).forEach(input => {\n input.style.width = '130px';\n input.style.outlineWidth = '0';\n });\n const spans = document.querySelectorAll('rgb-widget > div label+span');\n Array.from(spans).forEach(span => {\n span.style.display = 'inline-block';\n span.style.width = '52px';\n span.style.boxSixing = 'border-box';\n span.style.verticalAlign = 'text-bottom';\n });\n const textInputs = document.querySelectorAll('rgb-widget > div label+span+input[type=\"text\"]');\n Array.from(textInputs).forEach(textInput => {\n textInput.style.display = 'inline-block';\n textInput.style.boxSixing = 'border-box';\n textInput.style.verticalAlign = 'middle';\n textInput.style.marginLeft = '10px';\n textInput.style.marginBottom = '5px';\n textInput.style.border = 'solid 1px #ddd';\n });\n const changeBtns = document.querySelectorAll('rgb-widget > div label+span+input[type=\"text\"]+button');\n Array.from(changeBtns).forEach(changeBtn => {\n changeBtn.style.color = 'green';\n changeBtn.style.backgroundColor = 'white';\n changeBtn.style.border = '0px';\n changeBtn.style.height = '18px';\n changeBtn.style.cursor = 'pointer';\n changeBtn.style.marginBottom = '2px';\n changeBtn.style.fontSize = '18px'; \n changeBtn.style.fontWeight = 'bold';\n });\n const details = document.querySelectorAll('rgb-widget div[id*=\"_RGB_details\"]');\n Array.from(details).forEach(detail => {\n detail.style.marginTop = '10px';\n });\n const titles = document.querySelectorAll('rgb-widget div[id*=\"RGB_text_\"]');\n Array.from(titles).forEach(title => {\n title.style.lineHeight = '1.125';\n title.style.fontSize = '1em';\n title.style.color = 'rgba(0,0,0,.7)';\n if(window.screen.width < 700) {\n title.style.minHeight = '50px';\n }\n });\n const colorDivs = document.querySelectorAll('rgb-widget div[class*=\"_RGB_showColor\"]');\n Array.from(colorDivs).forEach(colorDiv => {\n colorDiv.style.width = `${show_color_width}`;\n colorDiv.style.height = `${show_color_height}`;\n colorDiv.style.margin = '8px 0 8px 0';\n });\n \n }", "onMainChange() {\n this.themeBuilderService.MaterialPaletteColors = this.themeBuilderService.GetPalette(this.Form.value.main);\n // set lightest and darkest hue colors in color picker\n if (!this.Unlocked.value) {\n this.Form.patchValue({ lighter: this.themeBuilderService.MaterialPaletteColors['50'] });\n this.Form.patchValue({ darker: this.themeBuilderService.MaterialPaletteColors['900'] });\n }\n }", "function initUi(){\n let cont = document.querySelector('#userTools')\n console.log(cont)\n\n\n //code responsible for creating tool buttons programmatically so they can be put into a container created by react\n let buttonTemplates = [\n {\n name: 'Road',\n value: 'place-road',\n tool: 'Place a road',\n imgSrc: './assets/images/simpleRoadButton.svg'\n },\n {\n name: 'Residential',\n value: 'place-residential',\n tool: 'Place a residential building',\n imgSrc: './assets/images/simpleResButton.svg'\n },\n {\n name: 'Buisness',\n value: 'place-office',\n tool: 'Place an office building',\n imgSrc: './assets/images/officelogo.svg'\n },\n {\n name: 'Commercial',\n value: 'place-commercial',\n tool: 'Place a commercial building',\n imgSrc: './assets/images/simpleComButton.svg'\n },\n {\n name: 'Park',\n value: 'place-park',\n tool: 'Place a park',\n imgSrc: './assets/images/parklogo.svg'\n },\n {\n name: 'Delete',\n value: 'delete-block',\n highlight: '{\"r\":1,\"g\":0,\"b\":0}',\n tool: 'Delete this block',\n imgSrc: './assets/images/simpleDeleteButton.svg'\n },\n\n ]\n\n buttonTemplates.forEach(button => {\n\n let buttonContainer = document.createElement('div');\n buttonContainer.classList.add('toolButtonContainer')\n\n let elem = document.createElement('img');\n // elem.textContent = button.name;\n elem.value = button.value;\n elem.src = button.imgSrc;\n \n let toolTip = document.createElement('p');\n toolTip.textContent = button.tool;\n\n // let buttonImage = document.createElement('img');\n // buttonImage.src = button.imgSrc;\n\n buttonContainer.appendChild(toolTip);\n buttonContainer.appendChild(elem);\n // elem.appendChild(buttonImage);\n\n if(button.highlight){\n elem.dataset.highlight = button.highlight;\n }\n\n elem.classList.add('toolButton')\n // buttonImage.classList.add('buttonImage')\n toolTip.classList.add('tooltiptext')\n cont.appendChild(buttonContainer)\n })\n\n\n let buttons = document.querySelectorAll('.toolButton');\n buttons.forEach(button => button.addEventListener('mousedown', userInput.toolModeButton))\n\n let colorCont = document.createElement('div')\n colorCont.setAttribute('id','colorCont');\n cont.appendChild(colorCont)\n\n\n let colorLabel = document.createElement('label');\n colorLabel.setAttribute('for','paintColorInput');\n colorLabel.textContent = 'Building Color'\n colorCont.appendChild(colorLabel)\n\n let paintColorInput = document.createElement('input');\n paintColorInput.type = 'color';\n paintColorInput.value = '#0000ee';\n paintColorInput.setAttribute('id','paintColorInput')\n colorCont.appendChild(paintColorInput);\n paintColorInput.addEventListener(\"change\", (e) => {\n let rgb = ts.hexToRgb(e.target.value)\n process.paintColor = rgb;\n console.log(process.paintColor)\n \n })\n\n\n let randomLabel = document.createElement('label');\n randomLabel.setAttribute('for','paintColorInput');\n randomLabel.textContent = 'Random Building Colors'\n colorCont.appendChild(randomLabel)\n\n let randomColorInput = document.createElement('input');\n randomColorInput.setAttribute('type','checkbox');\n colorCont.appendChild(randomColorInput)\n randomColorInput.addEventListener('mousedown',function(){\n process.randomColor = randomColorInput.value;\n process.randomColor\n })\n\n\n}", "function bootstrapClass()\n {\n $(\".provide-bootstrap-class input\").addClass(\"form-control\");\n $(\".provide-bootstrap-class select\").addClass(\"form-control\");\n }", "function IntroducaoContra_elementsExtraJS() {\n // screen (IntroducaoContra) extra code\n\n }", "componentWillLoad() {\r\n this.base = new BaseComponent(this, dxp);\r\n const shadow = this.element ? this.element : this.element;\r\n let href = ``;\r\n dxp.util.appendLinkElement(shadow, href);\r\n href = ``;\r\n dxp.util.appendLinkElement(shadow, href);\r\n href = `${dxp.config.get('DXP_STYLE_BASE_URL')}/themes/${this.theme}/dxp-content-list.min.css`;\r\n dxp.util.appendLinkElement(shadow, href);\r\n }", "function materializeSetup() {\n $('#node-info').find('select').material_select();\n $('#node-info').find('.chips').material_chip();\n $('.datepicker').pickadate({\n format: 'yyyy-mm-dd',\n selectMonths: true,\n selectYears: 30,\n closeOnSelect: true\n });\n}", "function Screen4_elementsExtraJS() {\n // screen (Screen4) extra code\n\n }", "function amzn_ps_content_bootstrap() {\n var localComposeConfigsKey = 'platform_configs_compose';\n var localHtmlConfigsKey = 'platform_configs_html';\n var localOptionsConfigKey = 'aps-options';\n var amznSpecificClass = { 'amznps-short-code' : true };\n var platform = {};\n var getLocalComposeConfigsKey = function(){ return localComposeConfigsKey;};\n var getLocalHtmlConfigsKey = function(){ return localHtmlConfigsKey;};\n var getLocalOptionsConfigKey = function(){ return localOptionsConfigKey; };\n var getAmznSpecificClass = function() { return amznSpecificClass;};\n var getPlatform = function(type) { return platform[type];};\n var setPlatform = function(_platform,type) {\n platform[type] = _platform;\n sendCmsConfigs();\n };\n\n var sendCmsConfigs = function() {\n window.amznPs.browser.sendMessage({platform:platform,method:'cmsConfigs'});\n };\n var initComponents = function() {\n var _configs = amzn_ps_bm_cms_configs();\n window.amznPs = {\n contentBootstrap:amzn_ps_content_bootstrap(),\n fallback:amzn_ps_fallback(),\n platform:amzn_ps_platform(),\n platformUtils : platformUtils,\n browser: new amzn_ps_bm_browser(),\n logger : logger\n };\n window.amznPs.logger.init(false);\n window.amznPs.browser.init(platformUtils);\n _configs.init(configInitCallback);\n };\n\n var reinitConfigs = function() {\n platform = {};\n var _configs = amzn_ps_bm_cms_configs();\n _configs.init(configInitCallback);\n };\n\n var configInitCallback = function(cmsConfigs, shortCodeDomainMap, configFlags) {\n window.amznPs.cmsConfigs = cmsConfigs;\n window.amznPs.options = {\n configFlags: configFlags\n };\n window.amznPs.platform.init();\n setShortCodePlatform(shortCodeDomainMap, configFlags);\n };\n\n var setShortCodePlatform = function(domains, configFlags) {\n var _href = window.location.href;\n for(var i = 0; i < domains.length; i++) {\n var aDomain = domains[i];\n var reg = new RegExp(aDomain.pattern);\n if(reg.exec(_href)){\n window.amznPs.options.shortCodeInfo = aDomain;\n window.amznPs.browser.sendMessage({\n method:'attachShortCode',\n shortCodeInfo: aDomain,\n configFlags: configFlags\n });\n break;\n }\n }\n\n };\n return {\n getLocalComposeConfigsKey:getLocalComposeConfigsKey,\n getLocalHtmlConfigsKey:getLocalHtmlConfigsKey,\n getLocalOptionsConfigKey:getLocalOptionsConfigKey,\n getAmznSpecificClass:getAmznSpecificClass,\n getPlatform: getPlatform,\n setPlatform : setPlatform,\n sendCmsConfigs: sendCmsConfigs,\n initComponents : initComponents,\n reinitConfigs: reinitConfigs\n };\n}", "function Navbar() {\n return (\n \n<nav className=\"navbar navbar-expand-lg navbar-light \">\n <div className=\"container-fluid divdata ft_face1\">\n <button className=\"navbar-toggler\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#navbarTogglerDemo01\" aria-controls=\"navbarTogglerDemo01\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span className=\"navbar-toggler-icon\"></span>\n </button>\n <a className=\"navbar-brand\" href=\"#\" style={{color:'indigo',fontSize:'20px',fontWeight:'400'}}><i class=\"fab fa-google\"></i> Let's Gok</a>\n \n <div className=\"collapse navbar-collapse data1\" id=\"navbarTogglerDemo01\">\n \n <ul className=\"navbar-nav me-auto mb-2 mb-lg-0\">\n <li className=\"nav-item\">\n <a className=\"nav-link active\" aria-current=\"page\" href=\"#\">About</a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link active\" href=\"#\">Blog</a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link active\" href=\"#\">career</a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link active\" href=\"#\">ContactUs</a>\n </li>\n </ul>\n \n </div>\n </div>\n</nav>\n\n\n )\n}", "componentDidMount() {\n setTimeout(() => {\n this._bootstrapAsync()\n }, 3000)\n }", "function BootstrapThemeroller(){\n\t/*\n\t *check if less variables are provided in url #, if yes, then reload the style\n\t */\n\tthis.initTheme = function(){\n\t\tvar lessKeyValStringArray = location.hash.substring(1).split('&');\n\t\tvar lessKeyValStringArraySize = lessKeyValStringArray.length;\n\n\t\tfor(keyValStrinIndex=0;keyValStrinIndex<lessKeyValStringArraySize;keyValStrinIndex++){\n\t\t\tlessKeyValPair = lessKeyValStringArray[keyValStrinIndex].split('=');\n\t\t\tif(lessKeyValPair.length==2){\n\t\t\t\tvar selector = '[less-var=\"'+lessKeyValPair[0]+'\"]';\n\t\t\t\t$(selector).val(lessKeyValPair[1]).change();\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.getUpdatedLessVars = function(){\n\t\tvar finalLessMap = {};\n\t\t$('[themeroller=\"true\"] , .input-append.color input').each(function(index){\n\t\t var val = $(this).val();\n\t\t var lessVar = $(this).attr('less-var');\n\t\t\t \n\t\t if($.trim(val)!=''){\n\t\t\tfinalLessMap[lessVar] = val;\n\t\t }\n\t\t});\n\t\treturn finalLessMap;\n\t};\n\n\tthis.updateUrl = function(){\n\t\t\tvar finalLessMap = this.getUpdatedLessVars();\n\t\t\tvar lessString ='';\n\t\t\tfor(key in finalLessMap){\n\t\t\t\tlessString += key+ '='+finalLessMap[key]+'&';\n\n\t\t\t}\n\t\t\tlocation.hash = lessString;\n\t};\n\tthis.downloadTheme = function(){\n\t\t\tvar finalLessMap = themeRoller.getUpdatedLessVars();\n\t\t\tvar css = [\"reset.less\",\"scaffolding.less\",\"grid.less\",\"layouts.less\",\"type.less\",\"code.less\",\"labels-badges.less\",\"tables.less\",\"forms.less\",\"buttons.less\",\"sprites.less\",\"button-groups.less\",\"navs.less\",\"navbar.less\",\"breadcrumbs.less\",\"pagination.less\",\"pager.less\",\"thumbnails.less\",\"alerts.less\",\"progress-bars.less\",\"hero-unit.less\",\"tooltip.less\",\"popovers.less\",\"modals.less\",\"dropdowns.less\",\"accordion.less\",\"carousel.less\",\"wells.less\",\"close.less\",\"utilities.less\",\"component-animations.less\",\"responsive-utilities.less\",\"responsive-767px-max.less\",\"responsive-768px-979px.less\",\"responsive-1200px-min.less\",\"responsive-navbar.less\"]\n\t\t\t, js = [\"bootstrap-transition.js\",\"bootstrap-modal.js\",\"bootstrap-dropdown.js\",\"bootstrap-scrollspy.js\",\"bootstrap-tab.js\",\"bootstrap-tooltip.js\",\"bootstrap-popover.js\",\"bootstrap-alert.js\",\"bootstrap-button.js\",\"bootstrap-collapse.js\",\"bootstrap-carousel.js\",\"bootstrap-typeahead.js\"]\n\t\t\t, vars = finalLessMap\n\t\t\t, img = [\"glyphicons-halflings.png\",\"glyphicons-halflings-white.png\"];\n\t\t\t\n\t\t\t\n\t\t\t$.ajax({\n\t\t\ttype: 'POST'\n\t\t , url: 'http://bootstrap.herokuapp.com'\n\t\t , dataType: 'jsonpi'\n\t\t , params: {\n\t\t\t js: js\n\t\t\t, css: css\n\t\t\t, vars: vars\n\t\t\t, img: img\n\t\t }\n\t\t })\n\t\t};\n\n\tthis.updateColorPicker = function(){\n\t\t var val = $(this).val();\n\t\t var lessVar = $(this).attr('less-var');\n\t\t \n\t\t var parentEle = $(this).parent();\n\t\t if($.trim(val)==''){\n\t\t\tval = parentEle.attr('data-color');\n\t\t }\n\t\t\tvar colorpicker = parentEle.data('colorpicker');\n\t\t\tcolorpicker.update(val);\n\t\t\tvar lessMap = {};\n\t\t\tlessMap[lessVar] = val;\n\t\t\tless.modifyVars(lessMap);\n\t\t\tthemeRoller.updateUrl();\n\t };\n\tthis.updateTextFields = function(){\n\t\t var val = $(this).val();\n\t\t var lessVar = $(this).attr('less-var');\n\t\t\t \n\t\t if($.trim(val)==''){\n\t\t\tval = $(this).attr('placeholder');\n\t\t }\n\t\t\t\n\t\t\tvar lessMap = {};\n\t\t\tlessMap[lessVar] = val;\n\t\t\tless.modifyVars(lessMap);\n\t\t\tthemeRoller.updateUrl();\n\t };\n\t\n}", "_initWebsiteContainers() {\n __querySelectorLive('[s-container]', ($elm) => {\n const $container = document.createElement('div');\n $container.classList.add(this.utils.cls('_website-add-component'));\n const $toolbar = document.createElement('div');\n $toolbar.setAttribute('s-carpenter-website-ui', 'true');\n $toolbar.classList.add(this.utils.cls('_add-component-container'));\n $elm.addEventListener('keyup', (e) => {\n e.preventDefault();\n e.stopPropagation();\n });\n const $addFiltrableInputContainer = document.createElement('label');\n $addFiltrableInputContainer.innerHTML = `\n <s-carpenter-app-add-component>\n <div class=\"_group\">\n <span class=\"_icon\">${this.props.icons.component}</span>\n <input type=\"text\" id=\"s-carpenter-app-add-component\" placeholder=\"${this.props.i18n.addComponent}\" class=\"${this.utils.cls('_add-component-input')}\" />\n </div>\n </s-carpenter-app-add-component>`;\n $toolbar.appendChild($addFiltrableInputContainer);\n $container.appendChild($toolbar);\n $elm.appendChild($container);\n $elm._sCarpenterContainer = $container;\n }, {\n once: true,\n rootNode: this._$websiteDocument,\n });\n __querySelectorLive(`[s-container] > *:not(.${this.utils.cls('_website-add-component')})`, ($child) => {\n const $container = $child.parentNode;\n if (!$container._sCarpenterContainer) {\n return;\n }\n let timeout;\n $child.addEventListener('pointerover', (e) => {\n if ($container._$current === $child) {\n return;\n }\n $container._$current = $child;\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n $child.after($container._sCarpenterContainer);\n }, 300);\n });\n }, {\n rootNode: this._$websiteDocument,\n });\n }", "#renderToggle() {\n return html`\n <div class=\"navbar-header\">\n <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\"\n data-target=\"#bs-sidebar-navbar-collapse-1\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n <a class=\"navbar-brand\">${this.study?.name}</a>\n </div>`;\n }", "function PanelHelper() {\n\t}", "_initForms() {\n // layouts.js initialization\n if (typeof FormLayouts !== 'undefined') {\n const formLayouts = new FormLayouts();\n }\n // validation.js initialization\n if (typeof FormValidation !== 'undefined') {\n const formValidation = new FormValidation();\n }\n // wizards.js initialization\n if (typeof FormWizards !== 'undefined') {\n const formWizards = new FormWizards();\n }\n // inputmask.js initialization\n if (typeof InputMask !== 'undefined') {\n const inputMask = new InputMask();\n }\n // controls.autocomplete.js initialization\n if (typeof GenericForms !== 'undefined') {\n const genericForms = new GenericForms();\n }\n // controls.autocomplete.js initialization\n if (typeof AutocompleteControls !== 'undefined') {\n const autocompleteControls = new AutocompleteControls();\n }\n // controls.datepicker.js initialization\n if (typeof DatePickerControls !== 'undefined') {\n const datePickerControls = new DatePickerControls();\n }\n // controls.datepicker.js initialization\n if (typeof DropzoneControls !== 'undefined') {\n const dropzoneControls = new DropzoneControls();\n }\n // controls.editor.js initialization\n if (typeof EditorControls !== 'undefined') {\n const editorControls = new EditorControls();\n }\n // controls.spinner.js initialization\n if (typeof SpinnerControls !== 'undefined') {\n const spinnerControls = new SpinnerControls();\n }\n // controls.rating.js initialization\n if (typeof RatingControls !== 'undefined') {\n const ratingControls = new RatingControls();\n }\n // controls.select2.js initialization\n if (typeof Select2Controls !== 'undefined') {\n const select2Controls = new Select2Controls();\n }\n // controls.slider.js initialization\n if (typeof SliderControls !== 'undefined') {\n const sliderControls = new SliderControls();\n }\n // controls.tag.js initialization\n if (typeof TagControls !== 'undefined') {\n const tagControls = new TagControls();\n }\n // controls.timepicker.js initialization\n if (typeof TimePickerControls !== 'undefined') {\n const timePickerControls = new TimePickerControls();\n }\n }", "function init(e)\n {\n component = $(e);\n component.addClass('mt-container');\n addTextarea();\n addInput();\n addList();\n component.append('<div style=\"clear:both;\"></div>');\n }", "function mdlElementRegister() {\n return {\n update: function() {\n componentHandler.upgradeAllRegistered();\n }\n };\n}" ]
[ "0.64387685", "0.5597523", "0.55940104", "0.55410993", "0.5496329", "0.54490805", "0.5419573", "0.54158866", "0.53836006", "0.53553027", "0.5334785", "0.5324598", "0.5324069", "0.53102636", "0.5305343", "0.5300293", "0.5291188", "0.5291188", "0.5291188", "0.5291188", "0.5262316", "0.52581745", "0.525529", "0.5253027", "0.5253027", "0.5245317", "0.52432", "0.52432", "0.52417415", "0.524048", "0.5227421", "0.52271736", "0.5216432", "0.5211857", "0.52045953", "0.52016973", "0.5201374", "0.5200125", "0.5193359", "0.5190908", "0.5190908", "0.5190908", "0.51738054", "0.51645315", "0.5144096", "0.5140257", "0.51357603", "0.51344484", "0.5132362", "0.512674", "0.5120835", "0.5120298", "0.51173294", "0.5115547", "0.5114031", "0.5114031", "0.51109713", "0.5101757", "0.509857", "0.50897866", "0.5086467", "0.50816554", "0.5079311", "0.5076182", "0.5073732", "0.5071107", "0.50684375", "0.5067649", "0.50632185", "0.5059548", "0.5059231", "0.5058046", "0.5055933", "0.5045327", "0.50404346", "0.503767", "0.5037296", "0.5020397", "0.50110817", "0.5007789", "0.50057316", "0.5003838", "0.50009704", "0.49985504", "0.49730334", "0.49720997", "0.4970927", "0.4968009", "0.49653894", "0.49638757", "0.49605483", "0.4955381", "0.49545208", "0.49538273", "0.49422193", "0.49355546", "0.49351087", "0.49334276", "0.4932582", "0.49262735", "0.49237055" ]
0.0
-1
It should to be noted that this function isn't equivalent to `texttransform: capitalize`. A strict capitalization should uppercase the first letter of each word a the sentence. We only handle the first word.
function capitalize(string) { if (typeof string !== 'string') { throw new Error( false ? 0 : (0,_material_ui_utils__WEBPACK_IMPORTED_MODULE_0__/* .default */ .Z)(7)); } return string.charAt(0).toUpperCase() + string.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sentenceCapitalizer1(text) {\n text = text.toLowerCase();\n let output = \"\";\n text.split(\" \").forEach( sentence => {\n output += sentence.slice(0, 1).toUpperCase();\n output += sentence.slice(1, sentence.length)+\" \";\n } );\n return output.trim();\n}", "function capitalizeAll (sentence) {\n let sentenceSplit = sentence.toLowerCase().split(' ');\n for (var i=0; i < sentenceSplit.length; i++) {\n sentenceSplit[i] = sentenceSplit[i][0].toUpperCase() + sentenceSplit[i].slice(1);\n }\n return sentenceSplit.join(' ');\n}", "function capitalize(sentence) {\n // Get the individual words\n let words = sentence.split(' ');\n\n // Capitalize the first character in each word\n words = words.map(word => word[0].toUpperCase() + word.slice(1));\n\n return words.join(' ');\n}", "function sentenceCapitalizer(text) {\n let words = text.toLowerCase().split(' ');\n let capitalized = words.map( word => {\n return word[0].toUpperCase() + word.slice(1);\n });\n\n return capitalized.join(' ');\n}", "static capitalize(sentence){\n let a= sentence.toUpperCase().charAt(0);\n return a+sentence.substr(1);\n }", "function capitalize( s ) {\n // GOTCHA: Assumes it's all-one-word.\n return s[0].toUpperCase() + s.substring(1).toLowerCase();\n}", "function capitalize(str) {\n str = str.toLowerCase();\n return finalSentence = str.replace(/(^\\w{1})|(\\s+\\w{1})/g, letter => letter.toUpperCase());\n}", "function ucfirst(str,force){\n str=force ? str.toLowerCase() : str;\n return str.replace(/(\\b)([a-zA-Z])/,\n function(firstLetter){\n return firstLetter.toUpperCase();\n });\n }", "function firstToUpper(text) { // 160\n // 161\n return text.charAt(0).toUpperCase() + text.substr(1); // 162\n // 163\n }", "function uncapitalize(text) {\n if (!text || typeof text !== \"string\") {\n return '';\n }\n return text.charAt(0).toLowerCase() + text.substr(1);\n }", "function firstWordCapitalize(word){\n let firstCharcter = word[0].toUpperCase();\n return firstCharcter + word.slice(1);\n \n}", "function capitalizeAll (sentence) {\n\n var sentenceArray = sentence.split(' ')\n\tvar capitalizedArray = []\n\n sentenceArray.forEach( (word, i) => {\n\t\tcapitalizedArray[i] = word.charAt(0).toUpperCase() + word.substring(1)\n }) \n\n return capitalizedArray.join(' ')\n\n}", "function capitalizeFirstLetter(text) {\n if (typeof text !== 'string') {\n return '';\n }\n return text.charAt(0).toUpperCase() + text.slice(1);\n }", "function capitalize(str) {}", "capitalizeFirstLetter(word) {\n return (word.charAt(0).toUpperCase() + word.substring(1));\n }", "function capitalize(s){\n\t\t\treturn s[0].toUpperCase() + s.slice(1);\n\t\t}", "function capitalize() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Word,\n pat: /\\b(_*\\w)/g, repl: function (_match, p1) { return p1.toUpperCase(); },\n });\n }", "function capitalize(s) {\n return s && s[0].toUpperCase() + s.slice(1);\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 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 capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "function firstToUpper(text) {\n\n return text.charAt(0).toUpperCase() + text.substr(1);\n\n }", "function capitalize(text){\n // in: \"some_string\"\n // out: \"Some_string\"\n return text.charAt(0).toUpperCase() + text.slice(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 capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n }", "function camelCase(str, firstCapital) {\n if (firstCapital === void 0) { firstCapital = false; }\n return str.replace(/^([A-Z])|[\\s-_](\\w)/g, function (match, p1, p2, offset) {\n if (firstCapital === true && offset === 0)\n return p1;\n if (p2)\n return p2.toUpperCase();\n return p1.toLowerCase();\n });\n}", "function capitalize(s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}", "function upperCaseFirst(s) {\r\n return s ? s.replace(/\\w\\S*/g, function (txt) {\r\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\r\n }) : '';\r\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 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 capitalize(s){\n return s[0].toUpperCase() + s.slice(1);\n}", "function capitalizeFirst(input) {\n return input\n .split(\" \")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}", "function capitalize(s) {\n\t\t\treturn s.toLowerCase().replace( /\\b./g, function(a){ return a.toUpperCase(); } );\n\t\t}", "function capitalizeWord(word){\n return word[0].toUpperCase() + word.substr(1);\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 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 capitalize_Words(str) {\n return str.replace(/\\w\\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });\n}", "function capitalizeWords(sentence) {\n var sentenceArr = sentence.split(' ');\n var result = [];\n sentenceArr.forEach(function(word) {\n result.push(word[0].toUpperCase() + word.slice(1));\n })\n return result.join(' ');\n}", "function ucfirst(strText)\n{\n// return ((!strText) ? '' : strText.substr(0, 1).toUpperCase() + strText.substr(1).toLowerCase());\n return ((!strText) ? '' : strText.substr(0, 1).toUpperCase() + strText.substr(1));\n}", "function capitalizeFirst(s) {\n\n return s.substr(0, 1).toUpperCase() + s.substr(1);\n\n}", "function firstChar(sentence) {\n\tconst capitalize = sentence.charAt(0).toUpperCase() + sentence.slice(1);\n\treturn capitalize;\n}", "function sentenceCase(word) {\n return `${word[0].toUpperCase()}${word.substring(1)}`;\n}", "function sentenceCase(word) {\n return `${word[0].toUpperCase()}${word.substring(1)}`;\n}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1)\n}", "function capitalize(s) {\n return s.charAt(0).toUpperCase() + s.slice(1)\n}", "function ucwords(str,force){\n str=force ? str.toLowerCase() : str;\n return str.replace(/(^([a-zA-Z\\p{M}]))|([ -][a-zA-Z\\p{M}])/g,\n function(firstLetter){\n return firstLetter.toUpperCase();\n });\n}", "function firstToUpper(text) { // 143\n // 144\n return text.charAt(0).toUpperCase() + text.substr(1); // 145\n // 146\n }", "function capitalize(word) { // capitalizes word\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n}", "function sentence(str) {\n return str.replace(/^\\S/, function(t) { return t.toUpperCase() });\n}", "function capitalizeWord(word) {\n return word[0].toUpperCase() + word.substr(1);\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 capitalizeWord(string) {\n return string[0].toUpperCase() + string.substring(1);\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 capitalizeAll(sentence){\n // since the string is what we need to convert, we use an array.\n var sentenceArray = sentence.split(\" \");\n\n for (var i = 0; i < sentenceArray.length; i++) {\n\n var wordArray = sentenceArray[i].split(\"\");\n\n var capitalizedLetter = wordArray[0].toUpperCase();\n\n wordArray[0] = capitalizedLetter;\n\n var joinedWord = wordArray.join(\"\");\n\n sentenceArray[i] = joinedWord;\n\n }\n var joinedSentence = sentenceArray.join(\" \")\n return joinedSentence;\n}", "function capitalizeWord (string) {\n var firstLetter = string[0];\n var restOfWord = string.substring(1); \n return firstLetter.toUpperCase() + restOfWord;\n}", "function firstLetter(sentence) {\n let text = sentence.split(' ');\n for (let i = 0; i < text.length; i++) {\n text[i] = text[i].charAt(0).toUpperCase() + text[i].substr(1);\n //console.log(text[i].charAt(0));\n }\n return text.join(' ');\n}", "makeCapital(word) {\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n }", "function cap_first(s) {\n return s[0].toUpperCase() + s.substring(1); \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 capitalizeWord(string) {\n return string.replace(string[0], string[0].toUpperCase()); //return string but replace the string[0] with a capital letter\n}", "function allCapsTitleTrimmed(originalText) {\n var modifiedText = originalText.trim().toUpperCase(); \n return modifiedText;\n \n}", "static capitalize(string){\n let array = string.split(\"\")\n array[0] = string[0].toUpperCase()\n return array.join(\"\")\n }", "function capitalizeWord(word) {\n return word[0].toUpperCase() + word.slice(1);\n}", "function capitalize(inputString){\r\n\t\t\t\tif(inputString == null){\r\n\t\t\t\t\treturn \"There is no text\";\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\treturn inputString.charAt(0).toUpperCase() + inputString.slice(1);\r\n\t\t\t\t}\r\n\t\t\t}", "function xCapitalize(str)\r\n{\r\n var i, c, wd, s='', cap = true;\r\n \r\n for (i = 0; i < str.length; ++i) {\r\n c = str.charAt(i);\r\n wd = isWordDelim(c);\r\n if (wd) {\r\n cap = true;\r\n } \r\n if (cap && !wd) {\r\n c = c.toUpperCase();\r\n cap = false;\r\n }\r\n s += c;\r\n }\r\n return s;\r\n\r\n function isWordDelim(c)\r\n {\r\n // add other word delimiters as needed\r\n // (for example '-' and other punctuation)\r\n return c == ' ' || c == '\\n' || c == '\\t';\r\n }\r\n}", "function capsSentence(text) {\n let wordsArray = text.toLowerCase().split(\" \");\n\n let capsArray = wordsArray.map((word) => {\n return word.replace(word[0], word[0].toUppercase());\n //We replace the first letter of each word (word[0]) with an uppercase version of the same letter using word.[0].toUppercase as the second parameter of the .replace() method.\n });\n\n return capsArray.join(\" \");\n}", "function capSentence(text) {\n let wordsArray = text.toLowerCase().split(\" \");\n let capsArray = wordsArray.map((word) => {\n //We use .map() function to loop through every word in the array and execute the same function as before to create capsArray.\n return word[o].toUpperCase() + word.slice(1);\n });\n\n return capsArray.join(\" \");\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 capitalizeAllWords(words){\n return words.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}", "function capitalize(word) {\n return word.charAt(0).toUpperCase() + word.slice(1);\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}", "static capitalize(word){\n let arr;\n arr = word.split(\"\")\n arr[0] = arr[0].toUpperCase()\n return arr.join(\"\")\n }", "function capitalize(word) {\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n }", "function capitalize2(str) {\n let result = str[0].toUpperCase();\n // let letters = str.split(' ');\n for (let i = 1; i < str.length; i++) {\n if (str[i - 1] === '') {\n result += str[i].toUpperCase();\n } else {\n result += str[i];\n }\n }\n return result;\n}", "function capitalizeWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n }", "function capSentence(text) {\n let wordsArray = text.toLowerCase().split(\" \");\n //We use toLowercase() to convert the entire sentence in lowercase. We chain it with .split() to divide the lowercase sentence into an array of words.\n let capsArray = [];\n //The array is stored is capsArray.\n\n wordsArray.forEach((word) => {\n capsArray.push(word[0].toUpperCase() + word.slice(1));\n //We iterate through every word in the array, and we take the first letter with slice(1) and turn it to uppercase with toUpperCase().\n });\n\n return capsArray.join(\" \");\n //We combine the transformed first letter (New string from slice()) and the sliced lowercase section with the method join() and push it into our capsArray.\n}", "function titleCase(str) {\nreturn str.replace(/\\w\\S*/g, function(txt) { // Checks for a character then zero or more non-white space\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); // replaces the first char with a CAP letter\n}", "function capitalize(word) {\n\treturn word[0].toUpperCase() + word.slice(1).toLowerCase();\n}", "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 return string[0].toUpperCase() + string.slice(1);\n}", "capitalize(word){\n let char = word.charAt(0).toUpperCase();\n let remainder = word.slice(1);\n return char + remainder;\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 CapitalizeWord(str)\n {\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n }", "function capitalise(word) {\n var lowerCase = word.toLowerCase();\n return lowerCase.charAt(0).toUpperCase() + lowerCase.slice(1).trim();\n}", "function wordToUpper(strSentence) {\r\n return strSentence.toLowerCase().replace(/\\b[a-z]/g, convertToUpper);\r\n\r\n function convertToUpper() { \r\n\t\treturn arguments[0].toUpperCase(); \r\n\t} \r\n}", "function titleCase(str) {\nreturn str.replace(/\\w\\S*/g, function(txt) { // Checks for a character then zero or more non-white space\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); // Replaces the first char with a CAP letter\n}", "function capitalize( str , echo){\n var words = str.toLowerCase().split(\" \");\n for ( var i = 0; i < words.length; i++ ) {\n var j = words[i].charAt(0).toUpperCase();\n words[i] = j + words[i].substr(1);\n }\n if(typeof echo =='undefined')\n return words.join(\" \");\n else\n return str;\n}", "function titleCase(text) {\n if(text) {\n let output = \"\";\n let stringArray = text.split(\" \");\n for(let i = 0; i < stringArray.length; i ++) {\n for(let j = 0; j < stringArray[i].length; j ++) {\n let chr = stringArray[i][j];\n if(j === 0) {\n output += chr.toUpperCase();\n } else {\n output += chr.toLowerCase();\n }\n }\n if(i < stringArray.length - 1) {\n output += \" \";\n }\n }\n return output;\n } else {\n return text;\n }\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 capitalize(string) {\n return `${string[0].toUpperCase()}${string.slice(1)}`;\n} //so we return the first character captitalized, and the rest of the string starting from the first index", "function capitalize(input) {\n return input.replace(input.charAt(0), input.charAt(0).toUpperCase());\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 capitalize(str) {\n const firstLow = firstCharacter(str);\n const rest = str.slice(1);\n const firstUp = firstLow.toUpperCase(str);\n return firstUp + rest;\n}", "function toTitleCase(x) {\n var smalls = [];\n var articles = [\"A\", \"An\", \"The\"].forEach(function(d){ smalls.push(d); })\n var conjunctions = [\"And\", \"But\", \"Or\", \"Nor\", \"So\"].forEach(function(d){ smalls.push(d); })\n var prepositions = [\"As\", \"At\", \"By\", \"Into\", \"It\", \"In\", \"For\", \"From\", \"Of\", \"Onto\", \"On\", \"Out\", \"Per\", \"To\", \"Up\", \"Upon\", \"With\"].forEach(function(d){ smalls.push(d); });\n \n x = x.split(\"\").reverse().join(\"\") + \" \"\n\n x = x.replace(/['\"]?[a-z]['\"]?(?= )/g, function(match){return match.toUpperCase();})\n\n x = x.split(\"\").slice(0, -1).reverse().join(\"\")\n\n x = x.replace(/ .*?(?= )/g, function(match){\n if(smalls.indexOf(match.substr(1)) !== -1)\n return match.toLowerCase()\n return match\n })\n\n x = x.replace(/: .*?(?= )/g, function(match){return match.toUpperCase()})\n\n //smalls at the start of sentences shouldbe capitals. Also includes when the sentence ends with an abbreviation.\n x = x.replace(/(([^\\.]\\w\\. )|(\\.[\\w]*?\\.\\. )).*?(?=[ \\.])/g, function(match) {\n var word = match.split(\" \")[1]\n var letters = word.split(\"\");\n\n letters[0] = letters[0].toUpperCase();\n word = letters.join(\"\");\n\n if(smalls.indexOf(word) !== -1) {\n return match.split(\" \")[0] + \" \" + word;\n }\n\n return match\n })\n \n return x\n }", "static capitalize(string){\n let firstLetter = string.slice(0,1).toUpperCase()\n return firstLetter + string.slice(1)\n }", "static capitalize(str){\n return str[0].toUpperCase() + str.slice(1)\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 capFirstWord(string){\n return string[0].toUpperCase + string.slice(1).toLowerCase()\n}", "function capitalizeAll (str) {\n var upperCaseArr = []\n var lowerCaseArr = str.split(' ')\n for (var i = 0; i < lowerCaseArr.length; i++) {\n var firstLetter = lowerCaseArr[i][0].toUpperCase()\n var restOfSentence = lowerCaseArr[i].slice(1, lowerCaseArr[i].length)\n upperCaseArr[i] = firstLetter + restOfSentence\n }\n return upperCaseArr.join(' ')\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 }" ]
[ "0.78461677", "0.76351416", "0.76207817", "0.7620256", "0.7617055", "0.7614242", "0.76056707", "0.75864565", "0.7550391", "0.75190324", "0.75184196", "0.75137913", "0.7512628", "0.750188", "0.74994266", "0.747962", "0.7467241", "0.74620074", "0.7441867", "0.74398106", "0.74391425", "0.7423149", "0.73877895", "0.73837286", "0.7379011", "0.7375082", "0.73645306", "0.73578656", "0.7352905", "0.73487794", "0.73472524", "0.7342529", "0.73264", "0.7322065", "0.731952", "0.7318425", "0.73164046", "0.7313962", "0.7305997", "0.7294465", "0.7293869", "0.7282013", "0.7280352", "0.7280352", "0.7279776", "0.7279776", "0.7271881", "0.72643656", "0.72631896", "0.7261544", "0.72585714", "0.725503", "0.7237502", "0.72355926", "0.723512", "0.7235017", "0.723161", "0.723144", "0.72304183", "0.72236603", "0.72211087", "0.72203976", "0.7218782", "0.7217847", "0.7215459", "0.7209546", "0.7202945", "0.71935946", "0.71878356", "0.71826136", "0.7182319", "0.71782845", "0.71754056", "0.7172407", "0.7169048", "0.71672696", "0.7167194", "0.7165224", "0.71616405", "0.7154329", "0.7150529", "0.71471554", "0.7145518", "0.7144936", "0.71437365", "0.7143603", "0.7143572", "0.71408427", "0.7132421", "0.7131085", "0.7125851", "0.7117714", "0.7116748", "0.71146005", "0.7109771", "0.71096057", "0.7109211", "0.7108832", "0.7105878", "0.7103304", "0.7101595" ]
0.0
-1
TODO v5: consider to make it private
function setRef(ref, value) { if (typeof ref === 'function') { ref(value); } else if (ref) { ref.current = value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "transient private protected internal function m182() {}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient protected internal function m189() {}", "transient final protected internal function m174() {}", "static transient final private internal function m43() {}", "static final private internal function m106() {}", "static transient final protected internal function m47() {}", "static transient final protected public internal function m46() {}", "transient private protected public internal function m181() {}", "static private internal function m121() {}", "transient final private protected internal function m167() {}", "static transient private protected internal function m55() {}", "static transient final private protected internal function m40() {}", "static private protected internal function m118() {}", "transient final private internal function m170() {}", "obtain(){}", "static transient private protected public internal function m54() {}", "static transient private public function m56() {}", "transient private public function m183() {}", "__previnit(){}", "static transient final protected function m44() {}", "static transient private internal function m58() {}", "static final private protected internal function m103() {}", "transient final private protected public internal function m166() {}", "static protected internal function m125() {}", "static transient final private public function m41() {}", "static transient final private protected public internal function m39() {}", "static final private protected public internal function m102() {}", "static private protected public internal function m117() {}", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static transient final private protected public function m38() {}", "static final protected internal function m110() {}", "function _____SHARED_functions_____(){}", "static final private public function m104() {}", "transient final private public function m168() {}", "_get () {\n throw new Error('_get not implemented')\n }", "function DWRUtil() { }", "prepare() {}", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "apply () {}", "function customHandling() { }", "function StupidBug() {}", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "lastUsed() { }", "constructor () { super() }", "function AeUtil() {}", "method() {\n throw new Error('Not implemented');\n }", "function Utils() {}", "function Utils() {}", "init () {\n\t\treturn null;\n\t}", "static transient protected internal function m62() {}", "function __it() {}", "postorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "static first(context) {\n throw new Error(\"TODO: Method not implemented\");\n }", "static transient final private public internal function m42() {}", "function __func(){}", "static get order() { throw new Error('unimplemented - must use a concrete class'); }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }" ]
[ "0.69828594", "0.68293136", "0.66447395", "0.6604393", "0.63777304", "0.63569075", "0.6242749", "0.6213562", "0.6094962", "0.60823613", "0.6030378", "0.5978219", "0.5968729", "0.59292036", "0.5928409", "0.59108067", "0.58212715", "0.5781679", "0.5753366", "0.5691014", "0.56533366", "0.56349736", "0.56062275", "0.5598238", "0.55025655", "0.5479168", "0.5462611", "0.54370254", "0.54224735", "0.5314882", "0.53079236", "0.53063995", "0.5291207", "0.5291207", "0.5291207", "0.52735716", "0.5247726", "0.52141404", "0.5211306", "0.5151195", "0.51509726", "0.51345956", "0.50693095", "0.5059952", "0.50511485", "0.5045579", "0.5027157", "0.50185156", "0.50185156", "0.50052655", "0.4998157", "0.49898422", "0.49786708", "0.495954", "0.495954", "0.4957139", "0.4955828", "0.494265", "0.4933248", "0.49284813", "0.49284813", "0.49284813", "0.49284813", "0.49284813", "0.49284813", "0.4903862", "0.4884066", "0.4882067", "0.48719975", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919", "0.4867919" ]
0.0
-1
If at any point a user clicks with a pointing device, ensure that we change the modality away from keyboard. This avoids the situation where a user presses a key on an already focused element, and then clicks on a different element, focusing it with a pointing device, while we still think we're in keyboard modality.
function handlePointerDown() { hadKeyboardEvent = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onPointerDown(e) {\n if (hadKeyboardEvent === true) {\n removeAllFocusVisibleAttributes();\n }\n\n hadKeyboardEvent = false;\n }", "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "function handlePointerDown() {\n hadKeyboardEvent = false;\n }", "function FocusTrapInertStrategy() { }", "function checkPointerDown(e) {\n if (config.clickOutsideDeactivates && !container.contains(e.target)) {\n deactivate({ returnFocus: false });\n }\n }", "function checkPointerDown(e) {\n if (config.clickOutsideDeactivates && !container.contains(e.target)) {\n deactivate({ returnFocus: false });\n }\n }", "function checkPointerDown(e) {\n if (config.clickOutsideDeactivates && !container.contains(e.target)) {\n deactivate({ returnFocus: false });\n }\n }", "function checkPointerDown(e) {\n if (config.clickOutsideDeactivates && !container.contains(e.target)) {\n deactivate({ returnFocus: false });\n }\n }", "function checkPointerDown(e) {\n if (config.clickOutsideDeactivates && !container.contains(e.target)) {\n deactivate({ returnFocus: false });\n }\n }", "function checkPointerDown(e) {\n if (config.clickOutsideDeactivates && !container.contains(e.target)) {\n deactivate({ returnFocus: false });\n }\n }", "function checkPointerDown(e) {\n if (container.contains(e.target)) return;\n if (config.clickOutsideDeactivates) {\n deactivate({\n returnFocus: !tabbable_1.isFocusable(e.target)\n });\n } else {\n e.preventDefault();\n }\n }", "function inputFocusingPreventing(selector) {\n $('body').on('touchstart', function (e) {\n selector.css(\"pointer-events\", \"auto\");\n });\n $('body').on('touchmove', function (e) {\n selector.css(\"pointer-events\", \"none\");\n });\n $('body').on('touchend', function (e) {\n setTimeout(function () {\n selector.css(\"pointer-events\", \"none\");\n }, 0);\n });\n }", "function checkPointerDown(e) {\n if (container.contains(e.target)) return;\n if (config.clickOutsideDeactivates) {\n deactivate({\n returnFocus: !tabbable.isFocusable(e.target)\n });\n } else {\n e.preventDefault();\n }\n }", "function checkPointerDown(e) {\n if (container.contains(e.target)) return;\n if (config.clickOutsideDeactivates) {\n deactivate({\n returnFocus: !tabbable.isFocusable(e.target)\n });\n } else {\n e.preventDefault();\n }\n }", "function checkPointerDown(e) {\n if (container.contains(e.target)) return;\n if (config.clickOutsideDeactivates) {\n deactivate({\n returnFocus: !tabbable.isFocusable(e.target)\n });\n } else {\n e.preventDefault();\n }\n }", "function checkPointerDown(e) {\n if (container.contains(e.target)) return;\n if (config.clickOutsideDeactivates) {\n deactivate({\n returnFocus: !tabbable.isFocusable(e.target)\n });\n } else {\n e.preventDefault();\n }\n }", "function checkPointerDown(e) {\n if (config.clickOutsideDeactivates && !container.contains(e.target)) {\n deactivate({\n returnFocus: false\n });\n }\n }", "showKeyboard({ event }) {\n const input = this.input;\n\n if (DomHelper.isTouchEvent && document.activeElement === input && event.target === input) {\n GlobalEvents.suspendFocusEvents();\n input.blur();\n input.focus();\n GlobalEvents.resumeFocusEvents();\n }\n }", "_keepKeyboardOpen(target) {\n target = target || '#type-area';\n\n let txtInput = angular.element(document.body.querySelector(target));\n console.log('keepKeyboardOpen ' + target);\n txtInput.one('blur', function() {\n console.log('textarea blur, focus back on it');\n txtInput[0].focus();\n });\n }", "deactivateFocus() {\n this.isFocused_ = false;\n this.adapter_.deactivateLineRipple();\n const input = this.getNativeInput_();\n const shouldRemoveLabelFloat = !input.value && !this.isBadInput_();\n const isValid = this.isValid();\n this.styleValidity_(isValid);\n this.styleFocused_(this.isFocused_);\n if (this.adapter_.hasLabel()) {\n this.adapter_.shakeLabel(this.shouldShake);\n this.adapter_.floatLabel(this.shouldFloat);\n this.notchOutline(this.shouldFloat);\n }\n if (shouldRemoveLabelFloat) {\n this.receivedUserInput_ = false;\n }\n }", "deactivateFocus() {\n this.isFocused_ = false;\n this.adapter_.deactivateLineRipple();\n const input = this.getNativeInput_();\n const shouldRemoveLabelFloat = !input.value && !this.isBadInput_();\n const isValid = this.isValid();\n this.styleValidity_(isValid);\n this.styleFocused_(this.isFocused_);\n if (this.adapter_.hasLabel()) {\n this.adapter_.shakeLabel(this.shouldShake);\n this.adapter_.floatLabel(this.shouldFloat);\n this.notchOutline(this.shouldFloat);\n }\n if (shouldRemoveLabelFloat) {\n this.receivedUserInput_ = false;\n }\n }", "function FocusTrapInertStrategy() {}", "function focusBrowserWarning(){\n if($('#browserupgrade').is(\":visible\")){\n $('button#play').removeAttr('autofocus');\n $('#browserupgrade').attr('autofocus','autofocus');\n }\n }", "function handleAndroidFocus() {\n\tvar container = page.getViewById(\"container\");\n\tif (container.android) {\n\t\tcontainer.android.setFocusableInTouchMode(true);\n\t\tcontainer.android.setFocusable(true);\n\t\tusername.android.clearFocus();\n\t}\n}", "function checkPointerDown(e) {\n if (container.contains(e.target)) return;\n if (config.clickOutsideDeactivates) {\n deactivate({\n returnFocus: !tabbable_1.isFocusable(e.target)\n });\n return;\n }\n // This is needed for mobile devices.\n // (If we'll only let `click` events through,\n // then on mobile they will be blocked anyways if `touchstart` is blocked.)\n if (config.allowOutsideClick && config.allowOutsideClick(e)) {\n return;\n }\n e.preventDefault();\n }", "_hoverViaKeyboard(item) {\n if (!item) {\n return;\n }\n\n const that = this;\n\n item.$.addClass('focus');\n item.setAttribute('focus', '');\n\n that._focusedViaKeyboard = item;\n that._ensureVisible(item);\n }", "showKeyboard({\n event\n }) {\n const input = this.input;\n\n if (DomHelper.isTouchEvent && document.activeElement === input && event.target === input) {\n GlobalEvents.suspendFocusEvents();\n input.blur();\n input.focus();\n GlobalEvents.resumeFocusEvents();\n }\n }", "function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n var isReadOnly = el.readOnly;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !isReadOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !isReadOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }", "function focusTriggersKeyboardModality(el) {\n const type = el.type;\n const tagName = el.tagName;\n const isReadOnly = el.readOnly;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !isReadOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !isReadOnly) {\n return true;\n }\n if (el.isContentEditable) {\n return true;\n }\n return false;\n }", "function keepKeyboardOpen() {\n console.log('keepKeyboardOpen');\n txtInput.one('blur', function () {\n console.log('textarea blur, focus back on it');\n txtInput[0].focus();\n });\n }", "_updateFocusTrapState() {\n if (this._focusTrap) {\n // The focus trap is only enabled when the drawer is open in any mode other than side.\n this._focusTrap.enabled = this.opened && this.mode !== 'side';\n }\n }", "function keepKeyboardOpen() {\n\t\treturn;\n console.log('keepKeyboardOpen');\n txtInput.one('blur', function() {\n console.log('textarea blur, focus back on it');\n txtInput[0].focus();\n });\n }", "function keepKeyboardOpen() {\n console.log('keepKeyboardOpen');\n txtInput.one('blur', function() {\n console.log('textarea blur, focus back on it');\n txtInput[0].focus();\n });\n } //keepKeyboardOpen", "function keepKeyboardOpen() {\n console.log('keepKeyboardOpen');\n txtInput.one('blur', function() {\n console.log('textarea blur, focus back on it');\n txtInput[0].focus();\n });\n }", "onFocusGesture(event) {\n if (\n event.target === this.ownerCmp.contentElement ||\n (event.target.closest(this.itemSelector) && this.ownerCmp.itemsFocusable === false)\n ) {\n event.preventDefault();\n }\n }", "onFocusGesture(event) {\n if (event.target === this.ownerCmp.contentElement || event.target.closest(this.itemSelector) && this.ownerCmp.itemsFocusable === false) {\n event.preventDefault();\n }\n }", "function hideKeyboard() {\n document.activeElement.blur();\n $(\"input\").blur();\n }", "function _disable_keyboard_navigation() {\r\n $(document).unbind('keydown', _keyboard_action);\r\n }", "deactivateFocus() {\n const {FOCUSED, LABEL_FLOAT_ABOVE, LABEL_SHAKE} = MDCTextFieldFoundation.cssClasses;\n const input = this.getNativeInput_();\n\n this.isFocused_ = false;\n this.adapter_.removeClass(FOCUSED);\n this.adapter_.removeClassFromLabel(LABEL_SHAKE);\n\n if (!input.value && !this.isBadInput_()) {\n this.adapter_.removeClassFromLabel(LABEL_FLOAT_ABOVE);\n this.receivedUserInput_ = false;\n }\n\n if (!this.useCustomValidityChecking_) {\n this.changeValidity_(input.checkValidity());\n }\n }", "function keyboardOnKeyDown(e) {\n if (ionic.scroll.isScrolling) {\n keyboardPreventDefault(e);\n }\n}", "function mobile_openKeyboard() {\n if (onMobile){\n screen.focus();\n }\n}", "function _enable_keyboard_navigation() {\r\n $(document).keydown(_keyboard_action);\r\n }", "function preventKeyboardListeners(event) {\n if (activeElement !== undefined) {\n if (event.keyCode === 37 || event.keyCode === 39 || event.keyCode === 73) {\n event.preventDefault();\n event.stopPropagation();\n\n return false;\n }\n }\n}", "static _lockChangeAlert() {\n const canvas = EngineToolbox.getCanvas();\n if (document.pointerLockElement === canvas) {\n document.addEventListener(\"mousemove\", Input._updatePosition, false);\n } else {\n document.removeEventListener(\"mousemove\", Input._updatePosition, false);\n }\n }", "_allowFocusEscape() {\n this._tabIndex = -1;\n setTimeout(() => {\n this._tabIndex = 0;\n this._changeDetector.markForCheck();\n });\n }", "_allowFocusEscape() {\n this._tabIndex = -1;\n setTimeout(() => {\n this._tabIndex = 0;\n this._changeDetector.markForCheck();\n });\n }", "function hideKeyboard () {\n\n if (/Android|webOS|iPhone|iPad|iPod/i.test (navigator.userAgent)) {\n\n //this set timeout needed for case when hideKeyborad\n //is called inside of 'onfocus' event handler\n setTimeout (function () {\n //creating temp field\n var field = document.createElement ('input');\n field.setAttribute ('type', 'text');\n //hiding temp field from peoples eyes\n //-webkit-user-modify is nessesary for Android 4.x\n field.setAttribute ('style', 'position:absolute; top: 0px; opacity: 0; -webkit-user-modify: read-write-plaintext-only; left:0px;');\n document.body.appendChild (field);\n //adding onfocus event handler for out temp field\n field.onfocus = function (){\n //this timeout of 200ms is nessasary for Android 2.3.x\n setTimeout (function () {\n field.setAttribute ('style', 'display:none;');\n setTimeout (function () {\n document.body.removeChild (field);\n //document.body.trigger (\"focus\");\n document.body.focus ();\n }, 20);\n }, 200);\n };\n //focusing it\n field.focus();\n }, 50);\n\n }\n}", "function pauseElementClicked(event) {\n isUserFocusOnTheGame = true;\n event.stopPropagation();\n }", "function mobileKeyboard() {\n if (window.innerWidth < 800) {\n expressionInput.readOnly = 'readOnly';\n graphReadOnly = true;\n }\n}", "_setFocusable() {\n const that = this;\n\n if (that.disabled || that.unfocusable) {\n that.$.input.tabIndex = -1;\n\n return;\n }\n\n that.$.input.removeAttribute('tabindex');\n }", "function Browser_OnFocusLoss()\n{\n\t//remove on window down\n\twindow.__BROWSER_WINDOW_DOWN = false;\n\t//was shift down?\n\tif (__BROWSER_SHIFT_DOWN)\n\t{\n\t\t//release it\n\t\twindow.__BROWSER_SHIFT_DOWN = false;\n\t\t//and trigger the shift up mini event\n\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_SHIFT_UP);\n\t}\n\t//was ctrl down?\n\tif (window.__BROWSER_CTRL_DOWN)\n\t{\n\t\t//release it\n\t\twindow.__BROWSER_CTRL_DOWN = false;\n\t\t//and trigger the ctrl up mini event\n\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_CTRL_UP);\n\t}\n\t//was alt down?\n\tif (window.__BROWSER_ALT_DOWN)\n\t{\n\t\t//release it\n\t\twindow.__BROWSER_ALT_DOWN = false;\n\t\t//and trigger the alt up mini event\n\t\t__SIMULATOR.NotifyMiniAction(__MINIACTION_EVENT_ALT_UP);\n\t}\n}", "lock() {\n const that = this;\n\n that.locked = that.unfocusable = true;\n\n if (that.showNearButton || that.showFarButton) {\n return;\n }\n\n that._setFocusable();\n }", "beforeOp() {\n focusedNode = FocusManager.pdomFocusedNode;\n BrowserEvents.blockFocusCallbacks = true;\n }", "handleA11yFocus(event) {\n if (!this.dragging) {\n this.props.a11yFocus(event.type === 'focus');\n this.asFocus = event.type === 'focus';\n }\n }", "function bindEventsToInput(element) {\n element._input.addEventListener('keydown', function (e) {\n if (element.busy && e.keyCode === _keyCode2.default.SPACE) {\n e.preventDefault();\n }\n });\n // prevent toggle can be trigger through SPACE key on Firefox\n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {\n element._input.addEventListener('click', function (e) {\n if (element.busy) {\n e.preventDefault();\n }\n });\n }\n}", "function mainKeyboardFocus(action) {\n \"use strict\";\n try {\n var focusElements,\n i;\n switch (action) {\n case \"disable\":\n focusElements = document.querySelectorAll(\"#main a, #main [tabIndex='0'], #main button, #main input, #main select\");\n for (i = 0; i < focusElements.length; i++) {\n focusElements[i].tabIndex = \"-1\";\n }\n break;\n case \"enable\":\n focusElements = document.querySelectorAll(\"#main a, #main [tabIndex='-1'], #main button, #main input, #main select\");\n for (i = 0; i < focusElements.length; i++) {\n focusElements[i].tabIndex = \"0\";\n }\n break;\n }\n } catch (ex) {\n console.log(ex.name + \": \" + ex.message);\n }\n }", "keepFocus () {\n let element = this.activeElement;\n let allTabbableElements = [];\n\n // Don't keep the focus if the browser is unable to support\n // CSS3 selectors\n try {\n allTabbableElements = element.querySelectorAll(this.tabbableElements.join(','));\n } catch (ex) {\n return;\n }\n\n let firstTabbableElement = this.getFirstElementVisible(allTabbableElements);\n let lastTabbableElement = this.getLastElementVisible(allTabbableElements);\n\n let focusHandler = (event) => {\n var keyCode = event.which || event.keyCode;\n\n // TAB pressed\n if (keyCode !== 9) {\n return;\n }\n\n // Polyfill to prevent the default behavior of events\n event.preventDefault = event.preventDefault || function () {\n event.returnValue = false;\n };\n\n // Move focus to first element that can be tabbed if Shift isn't used\n if (event.target === lastTabbableElement && !event.shiftKey) {\n event.preventDefault();\n firstTabbableElement.focus();\n\n // Move focus to last element that can be tabbed if Shift is used\n } else if (event.target === firstTabbableElement && event.shiftKey) {\n event.preventDefault();\n lastTabbableElement.focus();\n }\n };\n\n this.Helpers.on('keydown', element, focusHandler);\n }", "udpateCurrentFocus(forceUpdate = false) {\n if ((!this.focusedElement || !this.a11yKeyIsPressed) && !forceUpdate) {\n return;\n }\n this.focusedElement.classList.add(A11yClassNames.FOCUSED);\n }", "function handleKeyboard(s, plt, e) {\n var win = plt.win();\n var kc = e.keyCode || e.charCode;\n // Directions locks\n if (!s._allowSwipeToNext && (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__[\"g\" /* isHorizontal */])(s) && kc === 39 || !Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__[\"g\" /* isHorizontal */])(s) && kc === 40)) {\n return false;\n }\n if (!s._allowSwipeToPrev && (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__[\"g\" /* isHorizontal */])(s) && kc === 37 || !Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__[\"g\" /* isHorizontal */])(s) && kc === 38)) {\n return false;\n }\n if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {\n return;\n }\n var activeEle = plt.getActiveElement();\n if (activeEle && activeEle.nodeName && (activeEle.nodeName.toLowerCase() === 'input' || activeEle.nodeName.toLowerCase() === 'textarea')) {\n return;\n }\n if (kc === 37 || kc === 39 || kc === 38 || kc === 40) {\n var inView = false;\n // Check that swiper should be inside of visible area of window\n if (s.container.closest('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__[\"a\" /* CLS */].slide) && !s.container.closest('.' + __WEBPACK_IMPORTED_MODULE_0__swiper_utils__[\"a\" /* CLS */].slideActive)) {\n return;\n }\n var windowScroll = {\n left: win.pageXOffset,\n top: win.pageYOffset\n };\n var windowWidth = plt.width();\n var windowHeight = plt.height();\n var swiperOffset = Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__[\"j\" /* offset */])(s.container, plt);\n if (s._rtl) {\n swiperOffset.left = swiperOffset.left - s.container.scrollLeft;\n }\n var swiperCoord = [\n [swiperOffset.left, swiperOffset.top],\n [swiperOffset.left + s.renderedWidth, swiperOffset.top],\n [swiperOffset.left, swiperOffset.top + s.renderedHeight],\n [swiperOffset.left + s.renderedWidth, swiperOffset.top + s.renderedHeight]\n ];\n for (var i = 0; i < swiperCoord.length; i++) {\n var point = swiperCoord[i];\n if (point[0] >= windowScroll.left && point[0] <= windowScroll.left + windowWidth &&\n point[1] >= windowScroll.top && point[1] <= windowScroll.top + windowHeight) {\n inView = true;\n }\n }\n if (!inView)\n return;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__swiper_utils__[\"g\" /* isHorizontal */])(s)) {\n if (kc === 37 || kc === 39) {\n if (e.preventDefault) {\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n }\n }\n if ((kc === 39 && !s._rtl) || (kc === 37 && s._rtl)) {\n Object(__WEBPACK_IMPORTED_MODULE_1__swiper__[\"h\" /* slideNext */])(s, plt);\n }\n if ((kc === 37 && !s._rtl) || (kc === 39 && s._rtl)) {\n Object(__WEBPACK_IMPORTED_MODULE_1__swiper__[\"i\" /* slidePrev */])(s, plt);\n }\n }\n else {\n if (kc === 38 || kc === 40) {\n if (e.preventDefault) {\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n }\n }\n if (kc === 40) {\n Object(__WEBPACK_IMPORTED_MODULE_1__swiper__[\"h\" /* slideNext */])(s, plt);\n }\n if (kc === 38) {\n Object(__WEBPACK_IMPORTED_MODULE_1__swiper__[\"i\" /* slidePrev */])(s, plt);\n }\n }\n}", "afterOp() {\n if ( focusedNode && focusedNode.focusable ) {\n focusedNode.focus();\n }\n BrowserEvents.blockFocusCallbacks = false;\n }", "function _disable_keyboard_navigation() {\r\n\t\t\t$(document).unbind();\r\n\t\t}", "deactivateFocus() {\n this.isFocused_ = false;\n const input = this.getNativeInput_();\n const shouldRemoveLabelFloat = !input.value && !this.isBadInput_();\n const isValid = this.isValid();\n this.styleValidity_(isValid);\n this.styleFocused_(this.isFocused_);\n if (this.label_) {\n this.label_.styleShake(this.isValid(), this.isFocused_);\n this.label_.styleFloat(\n this.getValue(), this.isFocused_, this.isBadInput_());\n }\n if (shouldRemoveLabelFloat) {\n this.receivedUserInput_ = false;\n }\n }", "function stealFocus() {\n content.document.activeElement[\"blur\"]();\n}", "function MaidCleaningClick() {\n\tif (CommonIsMobile) MaidCleaningDoMove();\n}", "function pointer_lock_change( )\n {\n\n if ( document.pointerLockElement === canvas ||\n document.mozPointerLockElement === canvas ||\n document.webkitPointerLockElement === canvas )\n {\n\n acquired_pointer_lock = true;\n\n use_controls = true;\n\n document.addEventListener( \"mousemove\", mouse_move, false );\n\n document.addEventListener( \"mouseup\", mouse_button_up, false );\n\n }\n else\n {\n\n acquired_pointer_lock = false;\n\n use_controls = false;\n\n document.removeEventListener( \"mousemove\", mouse_move, false );\n\n document.removeEventListener( \"mouseup\", mouse_button_up, false );\n\n }\n\n }", "function toggleKeyboard() {\n let dy;//endPageY - this = position of keyboard\n let scrollY = window.scrollY;\n\n if (!keyboardToggling) {\n keyboardToggling = true;\n\n if (!keyboardDisplay) {//if the keyboard isn't displayed, pull it up\n\n dy = 0;\n\n let interval = window.setInterval(function () {\n dy += 4;\n keyboard.style.top = endPageY - getHeightByPercent(dy) + \"px\";\n document.body.style.paddingBottom = getHeightByPercent(dy) + \"px\";\n\n if (dy == 40) {\n keyboardToggling = false;\n keyboardDisplay = true;\n window.clearInterval(interval);\n }\n }, 25);\n } else {//if the keyboard is displayed, pull it down\n dy = 40;\n\n let interval = window.setInterval(function () {\n dy -= 4;\n keyboard.style.top = endPageY - getHeightByPercent(dy) + \"px\";\n document.body.style.paddingBottom = getHeightByPercent(dy) + \"px\";\n\n if (dy == 0) {\n keyboardToggling = false;\n keyboardDisplay = false;\n keyboard.style.top = endPageY + 200 + \"px\";\n window.clearInterval(interval);\n }\n }, 25);\n }\n }\n}", "function _enable_keyboard_navigation() {\r\n\t\t\t$(document).keydown(function(objEvent) {\r\n\t\t\t\t_keyboard_action(objEvent);\r\n\t\t\t});\r\n\t\t}", "_toggleFocused() {\n let focused = document.activeElement === this.inputNode;\n this.toggleClass('p-mod-focused', focused);\n }", "function _disable_keyboard_navigation() {\n\t\t\t$(document).unbind();\n\t\t}", "_handleKeyboard(e) {\n Foundation.Keyboard.handleKey(e, 'OffCanvas', {\n close: () => {\n this.close();\n this.$lastTrigger.focus();\n return true;\n },\n handled: () => {\n e.stopPropagation();\n e.preventDefault();\n }\n });\n }", "revertFocus() {\n // TODO: look for fallback focus targets if the target is no longer focusable (disabled/hidden etc)\n if (\n this.focusInEvent &&\n this.focusInEvent.relatedTarget &&\n this.focusInEvent.relatedTarget.nodeType === 1 &&\n this.element.contains(document.activeElement)\n ) {\n DomHelper.focusWithoutScrolling(this.focusInEvent.relatedTarget);\n }\n }", "function restrictFocus(modal, focusedElement) {\n if (isAncestor(modal, focusedElement)) {\n state.lastFocus = focusedElement;\n } else {\n resolveFocus(modal);\n }\n }", "function _enable_keyboard_navigation() {\n\t\t\t$(document).keydown(function(objEvent) {\n\t\t\t\t_keyboard_action(objEvent);\n\t\t\t});\n\t\t}", "function redirectFocus () {\n ctrl.styleTabItemFocus = ($mdInteraction.getLastInteractionType() === 'keyboard');\n var tabToFocus = getElements().tabs[ctrl.focusIndex];\n if (tabToFocus) {\n tabToFocus.focus();\n }\n }", "function onInputStart() {\n if (isFakeboxFocused()) {\n setFakeboxFocus(false);\n setFakeboxDragFocus(false);\n setFakeboxAndLogoVisibility(false);\n }\n}", "function pointerEventsPolyfill(e) {\n if (!pointerEventsSupported && this.$el.hasClass('o-form-saving')) {\n var $el = (0, _jqueryWrapper.default)(e.currentTarget);\n $el.css('display', 'none');\n var underneathElem = document.elementFromPoint(e.clientX, e.clientY);\n $el.css('display', 'block');\n e.target = underneathElem;\n (0, _jqueryWrapper.default)(underneathElem).trigger(e);\n return false;\n }\n}", "function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on <html> whenever the\n // window blurs, even if you're tabbing out of the page. ¯\\_(ツ)_/¯\n if (e.target.nodeName === 'HTML') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n }", "canBeInteractedWith() { return false; }", "function stealFocus(event) {\n\t\t\t\t\tif (!elem.is(':visible')) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tvar target = $(event.target),\n\t\t\t\t\t tooltip = current.tooltip,\n\t\t\t\t\t container = target.closest(SELECTOR),\n\t\t\t\t\t targetOnTop;\n\t\n\t\t\t\t\t// Determine if input container target is above this\n\t\t\t\t\ttargetOnTop = container.length < 1 ? FALSE : parseInt(container[0].style.zIndex, 10) > parseInt(tooltip[0].style.zIndex, 10);\n\t\n\t\t\t\t\t// If we're showing a modal, but focus has landed on an input below\n\t\t\t\t\t// this modal, divert focus to the first visible input in this modal\n\t\t\t\t\t// or if we can't find one... the tooltip itself\n\t\t\t\t\tif (!targetOnTop && target.closest(SELECTOR)[0] !== tooltip[0]) {\n\t\t\t\t\t\tfocusInputs(target);\n\t\t\t\t\t}\n\t\t\t\t}", "_toggleFocused() {\n let focused = document.activeElement === this.inputNode;\n this.toggleClass('lm-mod-focused', focused);\n }", "unfocus() {}", "_setFocusable() {\n const that = this;\n\n if (that.disabled || that.unfocusable) {\n that.$.input.tabIndex = -1;\n that.$.selectDate.removeAttribute('tabindex');\n that.$.selectTime.removeAttribute('tabindex');\n\n if (that._defaultFooterTemplateApplied) {\n that._hourElement.tabIndex = -1;\n that._ampmElement.tabIndex = -1;\n that._minuteElement.tabIndex = -1;\n }\n\n return;\n }\n\n const index = that.tabIndex > 0 ? that.tabIndex : 0;\n\n that.$.input.removeAttribute('tabindex');\n that.$.selectDate.tabIndex = index;\n that.$.selectTime.tabIndex = index;\n\n if (that._defaultFooterTemplateApplied) {\n that._hourElement.removeAttribute('tabindex');\n that._ampmElement.removeAttribute('tabindex');\n that._minuteElement.removeAttribute('tabindex');\n that.$.calendarDropDown.getElementsByClassName('jqx-footer-component-today')[0].tabIndex = index;\n }\n }", "function CALCULATE_TOUCH_UP_OR_MOUSE_UP() {\r\n \r\n GLOBAL_CLICK.CLICK_PRESSED = false;\r\n \r\n }", "_discardKeyboardHover() {\n const that = this;\n\n if (!that._focusedViaKeyboard) {\n return;\n }\n\n if (that._focusedViaKeyboard === that.$.backButton) {\n that.$.backButton.removeAttribute('hover');\n that.$.backButton.$.button.removeAttribute('hover');\n }\n else {\n that._focusedViaKeyboard.removeAttribute('focus');\n that._focusedViaKeyboard.removeAttribute('hover');\n }\n\n that._focusedViaKeyboard = undefined;\n }", "focus() {\n if (this.isFocusable) {\n DomHelper.focusWithoutScrolling(this.focusElement);\n }\n }" ]
[ "0.66897947", "0.636832", "0.63288844", "0.62409866", "0.62024987", "0.62024987", "0.62024987", "0.62024987", "0.62024987", "0.62024987", "0.6198776", "0.61885154", "0.61869276", "0.61869276", "0.61869276", "0.61869276", "0.6174619", "0.6149254", "0.6142503", "0.61019945", "0.61019945", "0.6066649", "0.60592324", "0.60589147", "0.60579133", "0.6043067", "0.6040998", "0.60171366", "0.5978374", "0.5963768", "0.5951302", "0.59470546", "0.5945829", "0.5944315", "0.58972824", "0.5859049", "0.58555573", "0.5848281", "0.58454704", "0.58434904", "0.5836258", "0.5828744", "0.5827614", "0.58178174", "0.5809418", "0.5809418", "0.58075464", "0.5782663", "0.5763262", "0.57587385", "0.57427084", "0.574018", "0.5739293", "0.5717031", "0.5703759", "0.5703286", "0.5697406", "0.56968176", "0.56959", "0.5690621", "0.56863034", "0.56858087", "0.5682011", "0.5681114", "0.5677366", "0.5667054", "0.56543255", "0.56444585", "0.5636215", "0.56342906", "0.56320375", "0.56167513", "0.56110144", "0.5602966", "0.5593111", "0.5591763", "0.55894727", "0.5588136", "0.5585058", "0.5564414", "0.5555111", "0.555449", "0.5552491", "0.5551922", "0.5543163" ]
0.6366642
15
Should be called if a blur event is fired on a focusvisible element
function handleBlurVisible() { // To detect a tab/window switch, we look for a blur event followed // rapidly by a visibility change. // If we don't see a visibility change within 100ms, it's probably a // regular focus change. hadFocusVisibleRecently = true; window.clearTimeout(hadFocusVisibleRecentlyTimeout); hadFocusVisibleRecentlyTimeout = window.setTimeout(function () { hadFocusVisibleRecently = false; }, 100); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n }", "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n }, 100);\n}", "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n }, 100);\n}", "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n }, 100);\n}", "function handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {\n hadFocusVisibleRecently = false;\n }, 100);\n}", "function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (e.target.hasAttribute(focusVisibleAttributeName)) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n }, 100);\n removeFocusVisibleAttribute(e.target);\n }\n }", "function blur() {\r\n this.hasFocus = false;\r\n }", "_onBlur() {\n this.__hasFocus = false;\n }", "function blur () {\n hasFocus = false;\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n }\n }", "function ifNotFocusedDoOnBlur() { // was ifNotFocusedAttachFocusListener\n\tif (!document.hasFocus()) {\n\t\tattachFocusListener();\n\t}\n}", "function blur () {\n if (!noBlur) {\n hasFocus = false;\n ctrl.hidden = shouldHide();\n }\n }", "_onBlur(event, element) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n\n if (!elementInfo || elementInfo.checkChildren && event.relatedTarget instanceof Node && element.contains(event.relatedTarget)) {\n return;\n }\n\n this._setClasses(element);\n\n this._emitOrigin(elementInfo.subject, null);\n }", "function onBlur(){ vBody.attr('data-focus', 0); }", "_onBlur(event, element) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))) {\n return;\n }\n this._setClasses(element);\n this._emitOrigin(elementInfo.subject, null);\n }", "_onBlur(event, element) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))) {\n return;\n }\n this._setClasses(element);\n this._emitOrigin(elementInfo.subject, null);\n }", "_onBlur(event, element) {\n // If we are counting child-element-focus as focused, make sure that we aren't just blurring in\n // order to focus another child of the monitored element.\n const elementInfo = this._elementInfo.get(element);\n if (!elementInfo || (elementInfo.checkChildren && event.relatedTarget instanceof Node &&\n element.contains(event.relatedTarget))) {\n return;\n }\n this._setClasses(element);\n this._emitOrigin(elementInfo.subject, null);\n }", "blur() {\r\n this.isFocussed = false;\r\n this.showLimits = true;\r\n }", "function doBlur(forceBlur){if(forceBlur){noBlur=false;hasFocus=false;}elements.input.blur();}", "function blurHandler() {\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "function blur($event){hasFocus=false;if(!noBlur){ctrl.hidden=shouldHide();evalAttr('ngBlur',{$event:$event});}}", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "blur() {\n this.focused = false;\n // Blur the tag list if it is not focused\n if (!this._tagList.focused) {\n this.triggerValidation();\n this._tagList.blur();\n }\n // tslint:disable-next-line: no-unnecessary-type-assertion\n if (this.addOnBlur) {\n this.emitTagEnd();\n }\n this._tagList.stateChanges.next();\n }", "onBlur() {\r\n // Stub\r\n }", "function blurEvent() {\n active = false;\n if (!mouseHover) {\n hideSuggestionBox();\n }\n }", "function blurred() {\n\t\t\tsettings.hasFocus = false;\n\t\t}", "handleBlur () {\n // Should the container require to do anything in particular here\n }", "function onBlur(e) {\n const { target } = e;\n if (!isValidFocusTarget(target)) {\n return;\n }\n if (target.hasAttribute(focusVisibleAttributeName)) {\n removeFocusVisibleAttribute(target);\n }\n }", "function onElementFocus() {\r\n\r\n this.blur();\r\n\r\n }", "blur() {\n this.focusElement.blur();\n\n this._setFocused(false);\n }", "_onBlur() {\n this._focused = false;\n if (!this.disabled && !this.panelOpen) {\n this._onTouched();\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n }", "onBlur(e) {\n if (!this.$isFocused)\n return;\n this.$isFocused = false;\n this.renderer.hideCursor();\n this.renderer.visualizeBlur();\n this._emit(\"blur\", e);\n }", "_blur() {\n if (this.disabled) {\n return;\n }\n if (!this.focused) {\n this._keyManager.setActiveItem(-1);\n }\n // Wait to see if focus moves to an indivdual chip.\n setTimeout(() => {\n if (!this.focused) {\n this._propagateChanges();\n this._markAsTouched();\n }\n });\n }", "_blur() {\n if (this.disabled) {\n return;\n }\n if (!this.focused) {\n this._keyManager.setActiveItem(-1);\n }\n // Wait to see if focus moves to an indivdual chip.\n setTimeout(() => {\n if (!this.focused) {\n this._propagateChanges();\n this._markAsTouched();\n }\n });\n }", "_blur() {\n if (this.addOnBlur) {\n this._emitChipEnd();\n }\n this.focused = false;\n // Blur the chip list if it is not focused\n if (!this._chipGrid.focused) {\n this._chipGrid._blur();\n }\n this._chipGrid.stateChanges.next();\n }", "blur_() {\n const el = this.getElement();\n if (el) {\n el.blur();\n dom.removeClass(el, 'blocklyFocused');\n }\n }", "blur() {this.dispatchEvent(new GlobalEvent('blur'));}", "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n }", "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n }", "handleBlur() {\n if (this.adapter_.isMenuOpen()) return;\n this.adapter_.removeClass(cssClasses.FOCUSED);\n this.handleChange(false);\n this.adapter_.deactivateBottomLine();\n\n const isRequired = this.adapter_.hasClass(cssClasses.REQUIRED);\n\n if (isRequired) {\n this.setValid(this.isValid());\n if (this.helperText_) {\n this.helperText_.setValidity(this.isValid());\n }\n }\n }", "function checkFocus() {\n\t\t\tif ( settings.hasFocus && ! document.hasFocus() ) {\n\t\t\t\tblurred();\n\t\t\t} else if ( ! settings.hasFocus && document.hasFocus() ) {\n\t\t\t\tfocused();\n\t\t\t}\n\t\t}", "handleBlur(event) {\n this.finishUpdate();\n }", "function handleBlur() {\n\t\t\tif (onBlur) {\n\t\t\t\tonBlur(value);\n\t\t\t}\n\t\t}", "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "function onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}", "function onBlur() {\n\t\t\t$$invalidate(3, inputValue = value);\n\t\t}", "blur(callback, bubbles=false) {\n this.self.addEventListener('blur', callback, bubbles); \n }", "function _onBlur() {\n\t\tif (_target.oldRef) {\n\t\t\t// firing the blur\n\t\t\tobj.fire( 'blur', {\n\t\t\t\ttarget: _target.oldRef\n\t\t\t});\n\t\t}\n\t}", "onBlur() {\n this.onTouchedCallback();\n }", "onBlur()\n {\n this.hide();\n }", "blur() {}", "function onEditableBlur() {\n\t\tvar active = CKEDITOR.document.getActive(),\n\t\t\teditor = this.editor,\n\t\t\teditable = editor.editable();\n\n\t\t// If focus stays within editor override blur and set currentActive because it should be\n\t\t// automatically changed to editable on editable#focus but it is not fired.\n\t\tif ( ( editable.isInline() ? editable : editor.document.getWindow().getFrame() ).equals( active ) )\n\t\t\teditor.focusManager.focus( editable );\n\t}", "_tryBlurHandler() {\n setTimeout(() => {\n const {value} = this;\n if (!this.focused && value) {\n this._processAddInput(value);\n }\n });\n }", "function blur($event) {\n hasFocus = false;\n\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n evalAttr('ngBlur', { $event: $event });\n }\n }", "function blur($event) {\n hasFocus = false;\n\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n evalAttr('ngBlur', { $event: $event });\n }\n }", "handleBlur() {\n if (this._cancelBlur) {\n return;\n }\n if (this.triggers !== 'click') {\n this.toggleMenuVisibility();\n }\n }", "handleBlur() {\n if (this.state.hasFocus) {\n this.setState({ hasFocus: false });\n }\n }", "function textFieldBlur () {\n status.focusOnTextField = false\n }", "function onBlur() {\n //document.body.className = 'blurred';\n\tconsole.log(\"window is losing focus\");\n\tif(timer) timer.pause();\n}", "function blurHandler() {\n gFormSubmitObserver.panel.hidePopup();\n }", "blur() {\n this.control_input.blur();\n this.onBlur(null);\n }", "function blurActiveHiddenInput(){\n\n\tACTIVE_HIDDEN_TEXT_INPUT && ACTIVE_HIDDEN_TEXT_INPUT.blur();\n\tACTIVE_HIDDEN_TEXT_INPUT = null;\n\t\n}", "function onBlur(event) {\n if (event.target !== getEventListenersTarget()) {\n return;\n }\n\n if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {\n return;\n }\n\n scheduleHide();\n }", "function onBlur(event) {\n if (event.target !== getEventListenersTarget()) {\n return;\n }\n\n if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {\n return;\n }\n\n scheduleHide();\n }", "bindElement() {\n this.element.on('blur', () => {\n this.updateViewValue();\n this.validatePartner();\n });\n }", "function onBlur() {\n // only focus out when there is no text inside search bar, else, dont focus out\n if (searchVal.current.value === \"\") {\n setSearchIconClick(false);\n }\n }", "function SP_ValidateActiveElement()\n{\n\ttry\n\t{\n\t\tvar oActiveField = document.activeElement;\n\t\tvar eFieldEvent = 'blur';\n\t\n\t\tif(arguments.length > 0)\n\t\teFieldEvent = arguments[0];\n\t\n\t\n\t\t$(oActiveField).trigger(eFieldEvent);\n\t}\n\tcatch(ex)\n\t{}\n}", "function onBlur(e) {\n\thasFocus = false;\n\tif (drag) {\n\t\tonMouseUp(e);\n\t}\n}", "_blurEventHandler() {\n const that = this;\n\n that.removeAttribute('focus');\n\n if (!that._preventDropDownClose) {\n that.close();\n }\n }", "_blur() {\n if (this.disabled) {\n return;\n }\n // Check whether the focus moved to chip input.\n // If the focus is not moved to chip input, mark the field as touched. If the focus moved\n // to chip input, do nothing.\n // Timeout is needed to wait for the focus() event trigger on chip input.\n setTimeout(() => {\n if (!this.focused) {\n this._keyManager.setActiveCell({ row: -1, column: -1 });\n this._propagateChanges();\n this._markAsTouched();\n }\n });\n }", "function onBlur() {\n\t\t\t// Set last value as input value\n\t\t\t$$invalidate(2, inputValue = value);\n\t\t}" ]
[ "0.7986653", "0.797042", "0.797042", "0.797042", "0.796655", "0.78525454", "0.7629099", "0.7611382", "0.75502914", "0.75204337", "0.74019915", "0.7359951", "0.73509157", "0.7330408", "0.7330408", "0.7330408", "0.72779465", "0.7272837", "0.72561824", "0.72271365", "0.72271365", "0.72271365", "0.72271365", "0.72271365", "0.7216872", "0.72130847", "0.72130847", "0.72130847", "0.72130847", "0.72130847", "0.72130847", "0.72130847", "0.71951145", "0.7135821", "0.71351296", "0.7095025", "0.7058385", "0.7051199", "0.7041057", "0.7037082", "0.7034773", "0.7031951", "0.6991548", "0.6991548", "0.6982865", "0.697714", "0.6967493", "0.6965657", "0.6965657", "0.69547963", "0.694174", "0.6916782", "0.69141865", "0.6908399", "0.6908399", "0.6908399", "0.6908399", "0.6908399", "0.6908399", "0.69068766", "0.6864252", "0.6834494", "0.68174016", "0.6805607", "0.6775141", "0.67514515", "0.6731011", "0.6729247", "0.6729247", "0.6725732", "0.6716027", "0.669527", "0.6687099", "0.6686397", "0.66794187", "0.6671455", "0.6653884", "0.6642139", "0.6632495", "0.6621791", "0.6608241", "0.66017026", "0.6600665", "0.6573521", "0.65714973" ]
0.7981439
14
Initialize a new `Emitter`.
function Emitter(obj) { if (obj) return mixin(obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Emitter() {\n this.events = {};\n}", "constructor() {\n this.eventEmitter = new Emitter();\n }", "function Emitter() {\n\t\tthis.listeners = {};\n\t\tthis.singleListener = {};\n\t}", "function Emitter() {\r\n this.events = {};\r\n}", "function Emitter() {\r\n\t\tthis.callbacks = {};\r\n\t}", "function Emitter() {\n\n this.events = {};\n\n\n}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.listeners = {};\n}", "function Emitter() {\n\t\tthis._listeners = {};\n\t}", "function Emitter() {\n//in this object there will be one property\n this.events = {};\n}", "function Emitter () {}", "function Emitter() {\n this._subscriptions = [];\n}", "function Emitter() {\n }", "constructor () {\n this.nodeEmitter = new EventEmitter();\n }", "initEmittable() {\n /**\n * Event emitter\n * @property emitter\n */\n this.emitter = eventemitter.create({\n wildcard: true,\n });\n }", "function Emitter(){\n emitters.set(this, {});\n receivers.set(this, this);\n }", "function Emitter(){\nthis.event = {};\n}", "bindEmitter() {\n Emitter(this);\n }", "function MyEmitter() {\n events.EventEmitter.apply(this);\n\n this.emitSomething = function() {\n emitter.emit('some_event', 'any data', 'that goes along with it');\n };\n}", "newEmitter(emitter) {\n this.useMiddleware();\n return super.newEmitter(emitter);\n }", "function EventEmitter() {\n\t\t this._events = new Events();\n\t\t this._eventsCount = 0;\n\t\t}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function Emitter() {\n this.handlersByEventName = {};\n }", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "constructor(){\n super();//Se llama al constructor de la clase EventEmitter\n this.greeting = 'Hello world!';\n }", "function AsyncEmitter() {\n if (!(this instanceof AsyncEmitter))\n return new AsyncEmitter();\n\n this._events = Object.create(null);\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n \t this._events = new Events();\n \t this._eventsCount = 0;\n \t}", "function EventEmitter(){this._events=new Events();this._eventsCount=0;}", "function EventEmitter(){this._events=new Events();this._eventsCount=0;}", "function EventEmitter() {\n _classCallCheck(this, EventEmitter);\n\n this.registry_ = {};\n }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter(){}", "function EventEmitter(){}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}" ]
[ "0.7571564", "0.7560046", "0.75450575", "0.7514628", "0.7456722", "0.74460644", "0.7429575", "0.7429575", "0.7429575", "0.7429575", "0.7405929", "0.7387901", "0.7187168", "0.710413", "0.7097545", "0.7092573", "0.7062321", "0.7041538", "0.6998895", "0.696564", "0.68401015", "0.68046904", "0.67516243", "0.67175126", "0.6660992", "0.6660992", "0.6649277", "0.6649277", "0.6649277", "0.6649277", "0.6636669", "0.6616337", "0.6583543", "0.6579719", "0.6552358", "0.6552358", "0.6552358", "0.6552358", "0.6552358", "0.6552358", "0.65249723", "0.6510567", "0.65013224", "0.646963", "0.6459806", "0.6459806", "0.64034414", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63991165", "0.63853526", "0.63853526", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383", "0.63774383" ]
0.0
-1
IEEE754 conversions based on
function packIEEE754(value, mLen, nBytes) { var buffer = new Array(nBytes); var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; var i = 0; var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; var e, m, c; value = abs(value); // eslint-disable-next-line no-self-compare if (value != value || value === Infinity) { // eslint-disable-next-line no-self-compare m = value != value ? 1 : 0; e = eMax; } else { e = floor(log(value) / LN2); if (value * (c = pow(2, -e)) < 1) { e--; c *= 2; } if (e + eBias >= 1) { value += rt / c; } else { value += rt * pow(2, 1 - eBias); } if (value * c >= 2) { e++; c /= 2; } if (e + eBias >= eMax) { m = 0; e = eMax; } else if (e + eBias >= 1) { m = (value * c - 1) * pow(2, mLen); e = e + eBias; } else { m = value * pow(2, eBias - 1) * pow(2, mLen); e = 0; } } for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); e = e << mLen | m; eLen += mLen; for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); buffer[--i] |= s * 128; return buffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toIEEE754(v, ebits, fbits) {\n \n var bias = (1 << (ebits - 1)) - 1;\n \n // Compute sign, exponent, fraction\n var s, e, f;\n if (isNaN(v)) {\n e = (1 << bias) - 1; f = 1; s = 0;\n }\n else if (v === Infinity || v === -Infinity) {\n e = (1 << bias) - 1; f = 0; s = (v < 0) ? 1 : 0;\n }\n else if (v === 0) {\n e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0;\n }\n else {\n s = v < 0;\n v = Math.abs(v);\n \n if (v >= Math.pow(2, 1 - bias)) {\n var ln = Math.min(Math.floor(Math.log(v) / Math.LN2), bias);\n e = ln + bias;\n f = v * Math.pow(2, fbits - ln) - Math.pow(2, fbits);\n }\n else {\n e = 0;\n f = v / Math.pow(2, 1 - bias - fbits);\n }\n }\n \n // Pack sign, exponent, fraction\n var i, bits = [];\n for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = Math.floor(f / 2); }\n for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = Math.floor(e / 2); }\n bits.push(s ? 1 : 0);\n bits.reverse();\n var str = bits.join('');\n \n // Bits to bytes\n var bytes = [];\n while (str.length) {\n bytes.push(parseInt(str.substring(0, 8), 2));\n str = str.substring(8);\n }\n return bytes;\n}", "function packIEEE754(value,mLen,nBytes){var buffer=new Array(nBytes);var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?pow(2,-24)-pow(2,-77):0;var i=0;var s=value<0||value===0&&1/value<0?1:0;var e,m,c;value=abs(value);// eslint-disable-next-line no-self-compare\nif(value!=value||value===Infinity){// eslint-disable-next-line no-self-compare\nm=value!=value?1:0;e=eMax;}else{e=floor(log(value)/LN2);if(value*(c=pow(2,-e))<1){e--;c*=2;}if(e+eBias>=1){value+=rt/c;}else{value+=rt*pow(2,1-eBias);}if(value*c>=2){e++;c/=2;}if(e+eBias>=eMax){m=0;e=eMax;}else if(e+eBias>=1){m=(value*c-1)*pow(2,mLen);e=e+eBias;}else{m=value*pow(2,eBias-1)*pow(2,mLen);e=0;}}for(;mLen>=8;buffer[i++]=m&255,m/=256,mLen-=8);e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[i++]=e&255,e/=256,eLen-=8);buffer[--i]|=s*128;return buffer;}", "function packIEEE754(value,mLen,nBytes){var buffer=Array(nBytes);var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?pow(2,-24)-pow(2,-77):0;var i=0;var s=value<0||value===0&&1/value<0?1:0;var e,m,c;value=abs(value);// eslint-disable-next-line no-self-compare\nif(value!=value||value===Infinity){// eslint-disable-next-line no-self-compare\nm=value!=value?1:0;e=eMax;}else{e=floor(log(value)/LN2);if(value*(c=pow(2,-e))<1){e--;c*=2;}if(e+eBias>=1){value+=rt/c;}else{value+=rt*pow(2,1-eBias);}if(value*c>=2){e++;c/=2;}if(e+eBias>=eMax){m=0;e=eMax;}else if(e+eBias>=1){m=(value*c-1)*pow(2,mLen);e=e+eBias;}else{m=value*pow(2,eBias-1)*pow(2,mLen);e=0;}}for(;mLen>=8;buffer[i++]=m&255,m/=256,mLen-=8){;}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[i++]=e&255,e/=256,eLen-=8){;}buffer[--i]|=s*128;return buffer;}", "function packIEEE754(value,mLen,nBytes){var buffer=new Array(nBytes);var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?pow(2,-24)-pow(2,-77):0;var i=0;var s=value<0||value===0&&1/value<0?1:0;var e,m,c;value=abs(value);// eslint-disable-next-line no-self-compare\n if(value!=value||value===Infinity){// eslint-disable-next-line no-self-compare\n m=value!=value?1:0;e=eMax;}else{e=floor(log(value)/LN2);if(value*(c=pow(2,-e))<1){e--;c*=2;}if(e+eBias>=1){value+=rt/c;}else{value+=rt*pow(2,1-eBias);}if(value*c>=2){e++;c/=2;}if(e+eBias>=eMax){m=0;e=eMax;}else if(e+eBias>=1){m=(value*c-1)*pow(2,mLen);e=e+eBias;}else{m=value*pow(2,eBias-1)*pow(2,mLen);e=0;}}for(;mLen>=8;buffer[i++]=m&255,m/=256,mLen-=8){;}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[i++]=e&255,e/=256,eLen-=8){;}buffer[--i]|=s*128;return buffer;}", "parseOracleNumber(buf) {\n\n // the first byte is the exponent; positive numbers have the highest\n // order bit set, whereas negative numbers have the highest order bit\n // cleared and the bits inverted\n let exponent = buf[0];\n const isPositive = Boolean(exponent & 0x80);\n if (!isPositive) {\n exponent = (exponent ^ 0xFF);\n }\n exponent -= 193;\n let decimalPointIndex = exponent * 2 + 2;\n\n // a mantissa length of 0 implies a value of 0 (if positive) or a value\n // of -1e126 (if negative)\n if (buf.length === 1) {\n if (isPositive) {\n return \"0\";\n }\n return \"-1e126\";\n }\n\n // check for the trailing 102 byte for negative numbers and, if present,\n // reduce the number of mantissa digits\n let numBytes = buf.length;\n if (!isPositive && buf[buf.length - 1] === 102) {\n numBytes -= 1;\n }\n\n // process the mantissa bytes which are the remaining bytes; each\n // mantissa byte is a base-100 digit\n let base100Digit;\n const digits = [];\n for (let i = 1; i < numBytes; i++) {\n\n // positive numbers have 1 added to them; negative numbers are\n // subtracted from the value 101\n if (isPositive) {\n base100Digit = buf[i] - 1;\n } else {\n base100Digit = 101 - buf[i];\n }\n\n // process the first digit; leading zeroes are ignored\n let digit = Math.floor(base100Digit / 10);\n if (digit === 0 && i === 1) {\n decimalPointIndex -= 1;\n } else if (digit === 10) {\n digits.push(\"1\");\n digits.push(\"0\");\n decimalPointIndex += 1;\n } else if (digit !== 0 || i > 1) {\n digits.push(digit.toString());\n }\n\n // process the second digit; trailing zeroes are ignored\n digit = base100Digit % 10;\n if (digit !== 0 || i < numBytes - 1) {\n digits.push(digit.toString());\n }\n }\n\n // create string of digits for transformation to JS value\n const chars = [];\n\n // if negative, include the sign\n if (!isPositive) {\n chars.push(\"-\");\n }\n\n // if the decimal point index is 0 or less, add the decimal point and\n // any leading zeroes that are needed\n if (decimalPointIndex <= 0) {\n chars.push(\".\");\n if (decimalPointIndex < 0)\n chars.push(\"0\".repeat(-decimalPointIndex));\n }\n\n // add each of the digits\n for (let i = 0; i < digits.length; i++) {\n if (i > 0 && i === decimalPointIndex) {\n chars.push(\".\");\n }\n chars.push(digits[i]);\n }\n\n // if the decimal point index exceeds the number of digits, add any\n // trailing zeroes that are needed\n if (decimalPointIndex > digits.length) {\n for (let i = digits.length; i < decimalPointIndex; i++) {\n chars.push(\"0\");\n }\n }\n\n // convert result to a Number\n return chars.join(\"\");\n }", "function from11f(v) {\n\t var e = v >> 6;\n\t var m = v & 0x2F;\n\t if (e === 0) {\n\t if (m === 0) {\n\t return 0;\n\t } else {\n\t return Math.pow(2, -14) * (m / 64);\n\t }\n\t } else {\n\t if (e < 31) {\n\t return Math.pow(2, e - 15) * (1 + m / 64);\n\t } else {\n\t if (m === 0) {\n\t return 0; // Inf\n\t } else {\n\t return 0; // Nan\n\t }\n\t }\n\t }\n\t }", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {}\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {}\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t }", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {}\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {}\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t }", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value); // eslint-disable-next-line no-self-compare\n\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\n buffer[--i] |= s * 128;\n return buffer;\n }", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {}\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {}\n buffer[--i] |= s * 128;\n return buffer;\n }", "static toNumber(x) {\n const xLength = x.length;\n if (xLength === 0) return 0;\n if (xLength === 1) {\n const value = x.__unsignedDigit(0);\n return x.sign ? -value : value;\n }\n const xMsd = x.__digit(xLength - 1);\n const msdLeadingZeros = JSBI.__clz30(xMsd);\n const xBitLength = xLength * 30 - msdLeadingZeros;\n if (xBitLength > 1024) return x.sign ? -Infinity : Infinity;\n let exponent = xBitLength - 1;\n let currentDigit = xMsd;\n let digitIndex = xLength - 1;\n const shift = msdLeadingZeros + 3;\n let mantissaHigh = (shift === 32) ? 0 : currentDigit << shift;\n mantissaHigh >>>= 12;\n const mantissaHighBitsUnset = shift - 12;\n let mantissaLow = (shift >= 12) ? 0 : (currentDigit << (20 + shift));\n let mantissaLowBitsUnset = 20 + shift;\n if (mantissaHighBitsUnset > 0 && digitIndex > 0) {\n digitIndex--;\n currentDigit = x.__digit(digitIndex);\n mantissaHigh |= (currentDigit >>> (30 - mantissaHighBitsUnset));\n mantissaLow = currentDigit << mantissaHighBitsUnset + 2;\n mantissaLowBitsUnset = mantissaHighBitsUnset + 2;\n }\n while (mantissaLowBitsUnset > 0 && digitIndex > 0) {\n digitIndex--;\n currentDigit = x.__digit(digitIndex);\n if (mantissaLowBitsUnset >= 30) {\n mantissaLow |= (currentDigit << (mantissaLowBitsUnset - 30));\n } else {\n mantissaLow |= (currentDigit >>> (30 - mantissaLowBitsUnset));\n }\n mantissaLowBitsUnset -= 30;\n }\n const rounding = JSBI.__decideRounding(x, mantissaLowBitsUnset,\n digitIndex, currentDigit);\n if (rounding === 1 || (rounding === 0 && (mantissaLow & 1) === 1)) {\n mantissaLow = (mantissaLow + 1) >>> 0;\n if (mantissaLow === 0) {\n // Incrementing mantissaLow overflowed.\n mantissaHigh++;\n if ((mantissaHigh >>> 20) !== 0) {\n // Incrementing mantissaHigh overflowed.\n mantissaHigh = 0;\n exponent++;\n if (exponent > 1023) {\n // Incrementing the exponent overflowed.\n return x.sign ? -Infinity : Infinity;\n }\n }\n }\n }\n const signBit = x.sign ? (1 << 31) : 0;\n exponent = (exponent + 0x3FF) << 20;\n JSBI.__kBitConversionInts[1] = signBit | exponent | mantissaHigh;\n JSBI.__kBitConversionInts[0] = mantissaLow;\n return JSBI.__kBitConversionDouble[0];\n }", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function encodeFloat(number) {\n var n = +number,\n status = (n !== n) || n == -Infinity || n == +Infinity ? n : 0,\n exp = 0,\n len = 281, // 2 * 127 + 1 + 23 + 3,\n bin = new Array(len),\n signal = (n = status !== 0 ? 0 : n) < 0,\n n = Math.abs(n),\n intPart = Math.floor(n),\n floatPart = n - intPart,\n i, lastBit, rounded, j, exponent;\n\n if (status !== 0) {\n if (n !== n) {\n return 0x7fc00000;\n }\n if (n === Infinity) {\n return 0x7f800000;\n }\n if (n === -Infinity) {\n return 0xff800000\n }\n }\n\n i = len;\n while (i) {\n bin[--i] = 0;\n }\n\n i = 129;\n while (intPart && i) {\n bin[--i] = intPart % 2;\n intPart = Math.floor(intPart / 2);\n }\n\n i = 128;\n while (floatPart > 0 && i) {\n (bin[++i] = ((floatPart *= 2) >= 1) - 0) && --floatPart;\n }\n\n i = -1;\n while (++i < len && !bin[i]);\n\n if (bin[(lastBit = 22 + (i = (exp = 128 - i) >= -126 && exp <= 127 ? i + 1 : 128 - (exp = -127))) + 1]) {\n if (!(rounded = bin[lastBit])) {\n j = lastBit + 2;\n while (!rounded && j < len) {\n rounded = bin[j++];\n }\n }\n\n j = lastBit + 1;\n while (rounded && --j >= 0) {\n (bin[j] = !bin[j] - 0) && (rounded = 0);\n }\n }\n i = i - 2 < 0 ? -1 : i - 3;\n while(++i < len && !bin[i]);\n (exp = 128 - i) >= -126 && exp <= 127 ? ++i : exp < -126 && (i = 255, exp = -127);\n (intPart || status !== 0) && (exp = 128, i = 129, status == -Infinity ? signal = 1 : (status !== status) && (bin[i] = 1));\n\n n = Math.abs(exp + 127);\n exponent = 0;\n j = 0;\n while (j < 8) {\n exponent += (n % 2) << j;\n n >>= 1;\n j++;\n }\n\n var mantissa = 0;\n n = i + 23;\n for (; i < n; i++) {\n mantissa = (mantissa << 1) + bin[i];\n }\n return ((signal ? 0x80000000 : 0) + (exponent << 23) + mantissa) | 0;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "function packIEEE754(value, mLen, nBytes) {\n\t var buffer = new Array(nBytes);\n\t var eLen = nBytes * 8 - mLen - 1;\n\t var eMax = (1 << eLen) - 1;\n\t var eBias = eMax >> 1;\n\t var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n\t var i = 0;\n\t var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n\t var e, m, c;\n\t value = abs(value);\n\t // eslint-disable-next-line no-self-compare\n\t if (value != value || value === Infinity) {\n\t // eslint-disable-next-line no-self-compare\n\t m = value != value ? 1 : 0;\n\t e = eMax;\n\t } else {\n\t e = floor(log(value) / LN2);\n\t if (value * (c = pow(2, -e)) < 1) {\n\t e--;\n\t c *= 2;\n\t }\n\t if (e + eBias >= 1) {\n\t value += rt / c;\n\t } else {\n\t value += rt * pow(2, 1 - eBias);\n\t }\n\t if (value * c >= 2) {\n\t e++;\n\t c /= 2;\n\t }\n\t if (e + eBias >= eMax) {\n\t m = 0;\n\t e = eMax;\n\t } else if (e + eBias >= 1) {\n\t m = (value * c - 1) * pow(2, mLen);\n\t e = e + eBias;\n\t } else {\n\t m = value * pow(2, eBias - 1) * pow(2, mLen);\n\t e = 0;\n\t }\n\t }\n\t for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n\t e = e << mLen | m;\n\t eLen += mLen;\n\t for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n\t buffer[--i] |= s * 128;\n\t return buffer;\n\t}", "_calculateExponentAndMantissa(float){\n let integral2 = toBinaryX(parseInt(float, 10), EXP, '0');//on prends uniquement le chiffre avant la virgule en base 2\n let fractional10 = this._getDecimal(float);//on prends uniquement les chiffres après la virgule en base 10\n let fractional2 = ''; //contient les chiffres apres la virgule en base 2\n\n //la fraction est multiplié par 2 tant qu'elle n'est pas egal à 0 et que 23 itération ne se sont pas écoulé\n // si la fraction est plus grande que 1 on enleve le chiffre avant la virgule\n let i = 0;\n //127 + 23 permet de ne perdre aucune précision, en effet si on prends le cas extreme qui serait un nombre entre -1 et 1 tres tres petit, le nombre de décalage maximum\n //serait de 127 etant donné que l'exposant = 127 + décalge, apres 127 décalge il faut encore récupérer la valeur de mantisse donc 23 bit.\n //(cette exemple est pour la version 32 bit mais marche avec les autres version)\n while(fractional10 != 0 && i < D_ + MAN)\n {\n fractional10 = fractional10 * 2;\n if(fractional10 >= 1)\n {\n fractional2 += '1';\n }\n else\n {\n fractional2 += '0';\n }\n fractional10 = this._getDecimal(fractional10);\n i++;\n }\n\n let number2 = (integral2 + '.' + fractional2).split('');//nombre en binaire avec la notation scientifique mais non somplifié (2^0)\n\n let pointIndex = integral2.length;//index du point dans le chiffre\n\n //on itere dans le nombre jusqu'a trouver un 1, on effectue encore une fois j++ pour se placer juste apres le 1, car c'est ici que l'on veut placer la virgule\n let j = 0;\n while(number2[j] != 1)\n {\n j++;\n }\n j++;\n\n let power = 0;\n this.mantissa = (integral2 + fractional2).split('');\n //si le nombre n'est pas compris entre -1 et 1, on regarde de combien on a décalé la virgule,\n //pour la mantisse on enleve les 0 inutile et le 1er 1\n if(float <= -1 || float >= 1)\n {\n power = pointIndex - j;\n this.mantissa.splice(0,j);\n }\n //si le nombre est compris entre -1 et 1, on regarde de combien on a decalé la virgule\n //(+1 car si le nombre est comrpis entre - 1 et 1 on a compté la virgule dans le calcul et il faut enlever)\n //pour la mantisse on enleve les 0 inutile et le 1er 1\n else\n {\n power = pointIndex - j + 1;\n this.mantissa.splice(0, j - 1);\n }\n this.exponent = toBinaryX(D_ + power, EXP, '0');//on calcule l'exposant qu'on converti en binaire\n this.mantissa = fillWithX(this.mantissa.splice(0, MAN).join(\"\"), '0');//on prends les 23 premier bit de la mantisse[splice()], on converti le tableau en string[join()], on remplie la droite de la mantisse avec des 0[fillWith0()]\n }", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8) {}\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8) {}\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}", "function packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}" ]
[ "0.71729136", "0.64189947", "0.64161617", "0.63956785", "0.627264", "0.6167346", "0.61665237", "0.6147051", "0.6145078", "0.61065197", "0.60478586", "0.60118717", "0.60041714", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.5982775", "0.59784883", "0.59784883", "0.59784883", "0.59784883", "0.59784883", "0.59784883", "0.59784883", "0.59784883", "0.59696203", "0.5959187", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578", "0.5954578" ]
0.0
-1
Currently only WebKitbased Web Inspectors, Firefox >= v31, and the Firebug extension (any Firefox version) are known to support "%c" CSS customizations. TODO: add a `localStorage` variable to explicitly enable/disable colors eslintdisablenextline complexity
function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatBrowserArgs(args, config) {\n args[0] = (config.useColors ? '%c' : '') + config.namespace;\n\n if (!config.useColors) {\n return;\n }\n\n var c = 'color: ' + config.color; // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}", "function DebugStyling() {}", "function DebugStyling(){}", "function DebugStyling() { }", "function addStyles() {\n /* cheatSheet */\n var style = '\\\ndiv#cheatSheet>p{line-height: 2em;}\\n\\\np#shortcut-title{font-weight:bold;}\\n\\\ncode.shortcut-key{margin: auto 0.8em;\\\n-moz-appearance:button;\\\n-webkit-appearance:button;\\\npadding:3px 7px;\\\n}\\n\\\n@media screen and (-webkit-min-device-pixel-ratio:0){\\\ndiv#cheatSheet>p{line-height: 1.7em;}\\\n}' /* CSS hack for webkit */\n\n GM_addStyle(style);\n}", "function injectHighlightJsCss(tab) {\n storage\n .get({\n [HIGHLIGHT_JS_STYLE_KEY]:\n DEFAULT_SETTINGS[HIGHLIGHT_JS_STYLE_KEY],\n })\n .then((response) => {\n let style = response.highlightJsStyle;\n if (style !== 'none') {\n browser.tabs.insertCSS(tab.id, {\n file: `vendor/bower/hjsstyles/${style}.css`,\n });\n }\n });\n }", "function ct(e,t){\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var a=r(\"span\",null,null,xo?\"padding-right: .1px\":null),n={pre:r(\"pre\",[a],\"CodeMirror-line\"),content:a,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(vo||xo)&&e.getOption(\"lineWrapping\")};t.measure={};\n // Iterate over the logical lines that make up this visual line.\n for(var f=0;f<=(t.rest?t.rest.length:0);f++){var o=f?t.rest[f-1]:t.line,i=void 0;n.pos=0,n.addToken=lt,\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n Ue(e.display.measure)&&(i=Se(o,e.doc.direction))&&(n.addToken=_t(n.addToken,i)),n.map=[];pt(o,n,Qe(e,o,t!=e.display.externalMeasured&&D(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=s(o.styleClasses.bgClass,n.bgClass||\"\")),o.styleClasses.textClass&&(n.textClass=s(o.styleClasses.textClass,n.textClass||\"\"))),\n // Ensure at least a single node is present, for measuring.\n 0==n.map.length&&n.map.push(0,0,n.content.appendChild(Be(e.display.measure))),\n // Store the map and a cache object for the current logical line\n 0==f?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}\n // See issue #2901\n if(xo){var c=n.content.lastChild;(/\\bcm-tab\\b/.test(c.className)||c.querySelector&&c.querySelector(\".cm-tab\"))&&(n.content.className=\"cm-tab-wrap-hack\")}return Te(e,\"renderLine\",e,t.line,n.pre),n.pre.className&&(n.textClass=s(n.pre.className,n.textClass||\"\")),n}", "function useColors(){ // is webkit? http://stackoverflow.com/a/16459606/376773\nreturn 'WebkitAppearance' in document.documentElement.style || // is firebug? http://stackoverflow.com/a/398120/376773\nwindow.console && (console.firebug || console.exception && console.table) || // is firefox >= v31?\n// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\nnavigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1,10) >= 31;}", "function C0(){console.log('%c 0 ', \"background:#000; color: #99AAFF\");}", "function css() { return exports.cssSyntax.extension; }", "function useColors(){// NB: In an Electron preload script, document will be defined but not fully\n// initialized. Since we know we're in Chrome, we'll just detect this case\n// explicitly\nif(typeof window!=='undefined'&&window.process&&window.process.type==='renderer'){return true;}// is webkit? http://stackoverflow.com/a/16459606/376773\n// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\nreturn typeof document!=='undefined'&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||// is firebug? http://stackoverflow.com/a/398120/376773\ntypeof window!=='undefined'&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||// is firefox >= v31?\n// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\ntypeof navigator!=='undefined'&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31||// double check webkit in userAgent just in case we are in a worker\ntypeof navigator!=='undefined'&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);}", "function patch(){\n\n // store the original\n console._log = console.log;\n\n // overwrite console.log\n console.log = function(){\n\n var args = [];\n var key;\n var match;\n\n var line;\n var i = 0;\n var l = arguments.length;\n\n for(; i<l; ++i){\n line = arguments[i];\n \n if(typeof line !== 'string'){\n args.push(line);\n }else{\n\n for(key in colorMap){\n if(line.indexOf(key) === 0){\n match = key;\n }\n }\n\n if(match){\n args.push('%c'+ line);\n args.push('color: '+ colorMap[match] +';');\n }else{\n args.push(line);\n }\n }\n }\n\n console._log.apply(console, args);\n }; \n}", "function useColors(){// NB: In an Electron preload script, document will be defined but not fully\n// initialized. Since we know we're in Chrome, we'll just detect this case\n// explicitly\nvar useColorsOption=getOption('colors');if(/^(no|off|false|disabled)$/i.test(useColorsOption)){return false;}if(typeof window!=='undefined'&&window.process&&window.process.type==='renderer'){return true;}// Internet Explorer and Edge do not support colors.\nif(typeof navigator!=='undefined'&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)){return false;}// is webkit? http://stackoverflow.com/a/16459606/376773\n// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\nreturn Boolean(typeof document!=='undefined'&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||// is firebug? http://stackoverflow.com/a/398120/376773\ntypeof window!=='undefined'&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||// is firefox >= v31?\n// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\ntypeof navigator!=='undefined'&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31||// double check webkit in userAgent just in case we are in a worker\ntypeof navigator!=='undefined'&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));}", "function scss_error(e){\n console.log(`\\x1b[41m WARNING \\x1b[0m`);\n console.log(` Error: ${e.messageOriginal} (line ${e.line} column ${e.column})`);\n console.log(` \\x1b[33m${e.relativePath}\\x1b[0m`);\n}", "function add_css() {\n \tvar style = element(\"style\");\n \tstyle.id = 'svelte-5qo5ik-style';\n \tstyle.textContent = \".codemirror-container.svelte-5qo5ik{position:relative;width:100%;height:100%;border:none;line-height:1.5;overflow:hidden}.codemirror-container.svelte-5qo5ik .CodeMirror{height:100%;background:transparent;font:400 14px/1.7 var(--font-mono);color:var(--base)}.codemirror-container.flex.svelte-5qo5ik .CodeMirror{height:auto}.codemirror-container.flex.svelte-5qo5ik .CodeMirror-lines{padding:0}.codemirror-container.svelte-5qo5ik .CodeMirror-gutters{padding:0 16px 0 8px;border:none}.codemirror-container.svelte-5qo5ik .error-loc{position:relative;border-bottom:2px solid #da106e}.codemirror-container.svelte-5qo5ik .error-line{background-color:rgba(200, 0, 0, .05)}textarea.svelte-5qo5ik{visibility:hidden}pre.svelte-5qo5ik{position:absolute;width:100%;height:100%;top:0;left:0;border:none;padding:4px 4px 4px 60px;resize:none;font-family:var(--font-mono);font-size:13px;line-height:1.7;user-select:none;pointer-events:none;color:#ccc;tab-size:2;-moz-tab-size:2}.flex.svelte-5qo5ik pre.svelte-5qo5ik{padding:0 0 0 4px;height:auto}\";\n \tappend(document.head, style);\n }", "function activate(context) {\n console.log('highlight-bad-chars decorator is activated');\n const badCharDecorationStyle = vscode.workspace.getConfiguration('highlight-bad-chars').badCharDecorationStyle;\n const badCharDecorationType = vscode.window.createTextEditorDecorationType(badCharDecorationStyle);\n const chars = [\n // https://github.com/possan/sublime_unicode_nbsp/blob/master/sublime_unicode_nbsp.py\n '\\x82',\n '\\x84',\n '\\x85',\n '\\x88',\n '\\x91',\n '\\x92',\n '\\x93',\n '\\x94',\n '\\x95',\n '\\x96',\n '\\x97',\n '\\x99',\n '\\xA0',\n '\\xA6',\n '\\xAB',\n '\\xBB',\n '\\xBC',\n '\\xBD',\n '\\xBE',\n '\\xBF',\n '\\xA8',\n '\\xB1',\n // https://www.cs.tut.fi/~jkorpela/chars/spaces.html\n // '\\u00A0', // no-break space\n '\\u1680',\n '\\u180E',\n '\\u2000',\n '\\u2001',\n '\\u2002',\n '\\u2003',\n '\\u2004',\n '\\u2005',\n '\\u2006',\n '\\u2007',\n '\\u2008',\n '\\u2009',\n '\\u200A',\n '\\u200B',\n '\\u200D',\n '\\u2013',\n '\\u2014',\n '\\u2028',\n '\\u202F',\n '\\u205F',\n '\\u3000',\n '\\uFEFF',\n // others\n '\\u037E',\n '\\u0000',\n '\\u0011',\n '\\u0012',\n '\\u0013',\n '\\u0014',\n '\\u001B',\n '\\u0080',\n '\\u0090',\n '\\u009B',\n '\\u009F',\n '\\u00B8',\n '\\u01C0',\n '\\u2223',\n ];\n let additionalChars = vscode.workspace.getConfiguration('highlight-bad-chars').additionalUnicodeChars;\n let charRegExp = '[' + chars.join('') + additionalChars.join('') + ']';\n let activeEditor = vscode.window.activeTextEditor;\n if (activeEditor) {\n triggerUpdateDecorations();\n }\n vscode.window.onDidChangeActiveTextEditor(editor => {\n activeEditor = editor;\n if (editor) {\n triggerUpdateDecorations();\n }\n }, null, context.subscriptions);\n vscode.workspace.onDidChangeTextDocument(event => {\n if (activeEditor && event.document === activeEditor.document) {\n triggerUpdateDecorations();\n }\n }, null, context.subscriptions);\n var timeout = null;\n function triggerUpdateDecorations() {\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(updateDecorations, 500);\n }\n function updateDecorations() {\n if (!activeEditor) {\n return;\n }\n let regEx = new RegExp(charRegExp, 'g');\n const text = activeEditor.document.getText();\n const badChars = [];\n let match;\n while (match = regEx.exec(text)) {\n const startPos = activeEditor.document.positionAt(match.index);\n const endPos = activeEditor.document.positionAt(match.index + match[0].length);\n const decoration = { range: new vscode.Range(startPos, endPos), hoverMessage: 'Bad char \"**' + match[0] + '**\"' };\n badChars.push(decoration);\n }\n activeEditor.setDecorations(badCharDecorationType, badChars);\n }\n}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0] = (useColors?'%c':'') + this.namespace + (useColors?' %c':' ') + args[0] + (useColors?'%c ':' ') + '+' + exports.humanize(this.diff);if(!useColors)return args;var c='color: ' + this.color;args = [args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n// arguments passed either before or after the %c, so we need to\n// figure out the correct index to insert the CSS into\nvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%' === match)return;index++;if('%c' === match){ // we only are interested in the *last* %c\n// (the user may have provided their own)\nlastC = index;}});args.splice(lastC,0,c);return args;}", "function useColors(){// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif(typeof window!=='undefined'&&window&&typeof window.process!=='undefined'&&window.process.type==='renderer'){return true;}// is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn typeof document!=='undefined'&&document&&'WebkitAppearance'in document.documentElement.style||// is firebug? http://stackoverflow.com/a/398120/376773\n\ttypeof window!=='undefined'&&window&&window.console&&(console.firebug||console.exception&&console.table)||// is firefox >= v31?\n\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\ttypeof navigator!=='undefined'&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31||// double check webkit in userAgent just in case we are in a worker\n\ttypeof navigator!=='undefined'&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);}", "function onEditorChange(e) {\n var value = aceEditor.getSession().getDocument().getValue();\n\n PARSED = css.parse(value, { silent: true });\n }", "function highlightSpecialChars() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return [specialCharConfig.of(config), specialCharPlugin()];\n}", "function formatArgs(args){var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+module.exports.humanize(this.diff);if(!useColors)return;var c='color: '+this.color;args.splice(1,0,c,'color: inherit');// the final \"%c\" is somewhat tricky, because there could be other\n// arguments passed either before or after the %c, so we need to\n// figure out the correct index to insert the CSS into\nvar index=0;var lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){// we only are interested in the *last* %c\n// (the user may have provided their own)\nlastC=index;}});args.splice(lastC,0,c);}", "function colorizeWarnings() {\n if (process.stdout.isTTY) {\n\n const warn = console.warn;\n console.warn = function(msg, ...args) {\n warn.call(console, chalk.yellow(msg), ...args);\n };\n }\n}", "function formatArgs(args){var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return;var c='color: '+this.color;args.splice(1,0,c,'color: inherit');// the final \"%c\" is somewhat tricky, because there could be other\n// arguments passed either before or after the %c, so we need to\n// figure out the correct index to insert the CSS into\nvar index=0;var lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){// we only are interested in the *last* %c\n// (the user may have provided their own)\nlastC=index;}});args.splice(lastC,0,c);}", "function useColors(){ // is webkit? http://stackoverflow.com/a/16459606/376773\n\treturn 'WebkitAppearance' in document.documentElement.style|| // is firebug? http://stackoverflow.com/a/398120/376773\n\twindow.console&&(console.firebug||console.exception&&console.table)|| // is firefox >= v31?\n\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\tnavigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31;}", "function useColors(){ // is webkit? http://stackoverflow.com/a/16459606/376773\n\treturn 'WebkitAppearance' in document.documentElement.style|| // is firebug? http://stackoverflow.com/a/398120/376773\n\twindow.console&&(console.firebug||console.exception&&console.table)|| // is firefox >= v31?\n\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\tnavigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31;}", "function useColors(){ // is webkit? http://stackoverflow.com/a/16459606/376773\n\treturn 'WebkitAppearance' in document.documentElement.style|| // is firebug? http://stackoverflow.com/a/398120/376773\n\twindow.console&&(console.firebug||console.exception&&console.table)|| // is firefox >= v31?\n\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\tnavigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&parseInt(RegExp.$1,10)>=31;}", "function consoleHello() {\n var userAgent = navigator.userAgent.toLowerCase();\n var supported = /(chrome|firefox)/;\n\n if (supported.test(userAgent.toLowerCase())) {\n var dark = ['padding: 18px 5px 16px', 'background-color: #171718', 'color: #e74c3c'].join(';');\n\n if (userAgent.indexOf('chrome') > -1) {\n dark += ';';\n dark += ['padding: 18px 5px 16px 40px', 'background-image: url(\"https://i.imgur.com/ElEn6VW.png\")', 'background-position: 10px 9px', 'background-repeat: no-repeat', 'background-size: 30px 30px'].join(';');\n }\n\n var red = ['padding: 18px 5px 16px', 'background-color: #e74c3c', 'color: #ffffff'].join(';');\n\n var spacer = ['background-color: transparent'].join(';');\n\n var msg = '%c Crafted with ❤ by SBG Bots %c https://github.com/bhumikabhatia/sbg-bots %c';\n\n console.log(msg, dark, red, spacer);\n } else if (window.console) console.log('Crafted with love by SBG Bots || https://github.com/bhumikabhatia/sbg-bots');\n}", "function formatArgs(args){var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return;var c='color: '+this.color;args.splice(1,0,c,'color: inherit');// the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){// we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return args;var c='color: '+this.color;args=[args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){ // we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);return args;}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return args;var c='color: '+this.color;args=[args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){ // we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);return args;}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return args;var c='color: '+this.color;args=[args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){ // we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);return args;}", "function formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n const c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n let index = 0;\n let lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, match => {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}", "function formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n const c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n let index = 0;\n let lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, match => {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}", "function formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n const c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n let index = 0;\n let lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, match => {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}", "function formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n const c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n let index = 0;\n let lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, match => {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}", "function formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n const c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n let index = 0;\n let lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, match => {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}", "function formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n const c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n let index = 0;\n let lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, match => {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}", "function formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n const c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n let index = 0;\n let lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, match => {\n if (match === '%%') {\n return;\n }\n\n index++;\n\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}", "function log1(text, arg1) {\n var css = 'background: #ff0000; color: #fff';\n text += \" \";\n console.log(\"%c \".concat(text), css, arg1);\n}", "function formatArgs(args) {\n\t\t\targs[0] = (this.useColors ? '%c' : '') +\n\t\t\t\tthis.namespace +\n\t\t\t\t(this.useColors ? ' %c' : ' ') +\n\t\t\t\targs[0] +\n\t\t\t\t(this.useColors ? '%c ' : ' ') +\n\t\t\t\t'+' + module.exports.humanize(this.diff);\n\n\t\t\tif (!this.useColors) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst c = 'color: ' + this.color;\n\t\t\targs.splice(1, 0, c, 'color: inherit');\n\n\t\t\t// The final \"%c\" is somewhat tricky, because there could be other\n\t\t\t// arguments passed either before or after the %c, so we need to\n\t\t\t// figure out the correct index to insert the CSS into\n\t\t\tlet index = 0;\n\t\t\tlet lastC = 0;\n\t\t\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tif (match === '%c') {\n\t\t\t\t\t// We only are interested in the *last* %c\n\t\t\t\t\t// (the user may have provided their own)\n\t\t\t\t\tlastC = index;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\targs.splice(lastC, 0, c);\n\t\t}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}", "function css(hljs) {\n var FUNCTION_LIKE = {\n begin: /[\\w-]+\\(/,\n returnBegin: true,\n contains: [{\n className: 'built_in',\n begin: /[\\w-]+/\n }, {\n begin: /\\(/,\n end: /\\)/,\n contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, hljs.CSS_NUMBER_MODE]\n }]\n };\n var ATTRIBUTE = {\n className: 'attribute',\n begin: /\\S/,\n end: ':',\n excludeEnd: true,\n starts: {\n endsWithParent: true,\n excludeEnd: true,\n contains: [FUNCTION_LIKE, hljs.CSS_NUMBER_MODE, hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE, hljs.C_BLOCK_COMMENT_MODE, {\n className: 'number',\n begin: '#[0-9A-Fa-f]+'\n }, {\n className: 'meta',\n begin: '!important'\n }]\n }\n };\n var AT_IDENTIFIER = '@[a-z-]+'; // @font-face\n\n var AT_MODIFIERS = \"and or not only\";\n var AT_PROPERTY_RE = /@-?\\w[\\w]*(-\\w+)*/; // @-webkit-keyframes\n\n var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n var RULE = {\n begin: /([*]\\s?)?(?:[A-Z_.\\-\\\\]+|--[a-zA-Z0-9_-]+)\\s*(\\/\\*\\*\\/)?:/,\n returnBegin: true,\n end: ';',\n endsWithParent: true,\n contains: [ATTRIBUTE]\n };\n return {\n name: 'CSS',\n case_insensitive: true,\n illegal: /[=|'\\$]/,\n contains: [hljs.C_BLOCK_COMMENT_MODE, {\n className: 'selector-id',\n begin: /#[A-Za-z0-9_-]+/\n }, {\n className: 'selector-class',\n begin: '\\\\.' + IDENT_RE\n }, {\n className: 'selector-attr',\n begin: /\\[/,\n end: /\\]/,\n illegal: '$',\n contains: [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]\n }, {\n className: 'selector-pseudo',\n begin: /:(:)?[a-zA-Z0-9_+()\"'.-]+/\n }, // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: '@(page|font-face)',\n lexemes: AT_IDENTIFIER,\n keywords: '@page @font-face'\n }, {\n begin: '@',\n end: '[{;]',\n // at_rule eating first \"{\" is a good thing\n // because it doesn’t let it to be parsed as\n // a rule set but instead drops parser into\n // the default mode which is how it should be.\n illegal: /:/,\n // break on Less variables @var: ...\n returnBegin: true,\n contains: [{\n className: 'keyword',\n begin: AT_PROPERTY_RE\n }, {\n begin: /\\s/,\n endsWithParent: true,\n excludeEnd: true,\n relevance: 0,\n keywords: AT_MODIFIERS,\n contains: [{\n begin: /[a-z-]+:/,\n className: \"attribute\"\n }, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, hljs.CSS_NUMBER_MODE]\n }]\n }, {\n className: 'selector-tag',\n begin: IDENT_RE,\n relevance: 0\n }, {\n begin: /\\{/,\n end: /\\}/,\n illegal: /\\S/,\n contains: [hljs.C_BLOCK_COMMENT_MODE, {\n begin: /;/\n }, // empty ; rule\n RULE]\n }]\n };\n}", "function formatArgs(args) {\n \targs[0] = (this.useColors ? '%c' : '') +\n \t\tthis.namespace +\n \t\t(this.useColors ? ' %c' : ' ') +\n \t\targs[0] +\n \t\t(this.useColors ? '%c ' : ' ') +\n \t\t'+' + module.exports.humanize(this.diff);\n\n \tif (!this.useColors) {\n \t\treturn;\n \t}\n\n \tconst c = 'color: ' + this.color;\n \targs.splice(1, 0, c, 'color: inherit');\n\n \t// The final \"%c\" is somewhat tricky, because there could be other\n \t// arguments passed either before or after the %c, so we need to\n \t// figure out the correct index to insert the CSS into\n \tlet index = 0;\n \tlet lastC = 0;\n \targs[0].replace(/%[a-zA-Z%]/g, match => {\n \t\tif (match === '%%') {\n \t\t\treturn;\n \t\t}\n \t\tindex++;\n \t\tif (match === '%c') {\n \t\t\t// We only are interested in the *last* %c\n \t\t\t// (the user may have provided their own)\n \t\t\tlastC = index;\n \t\t}\n \t});\n\n \targs.splice(lastC, 0, c);\n }", "function highlightSpecialChars(\n/**\nConfiguration options.\n*/\nconfig = {}) {\n return [specialCharConfig.of(config), specialCharPlugin()];\n}", "function headline(str) {!silent && console.log('%c\\n'+str, 'font-size: 16px;');}", "function formatArgs(args) {\n args[0] = (this.useColors ? '%c' : '') +\n this.namespace +\n (this.useColors ? ' %c' : ' ') +\n args[0] +\n (this.useColors ? '%c ' : ' ') +\n '+' + module.exports.humanize(this.diff);\n\n if (!this.useColors) {\n return;\n }\n\n const c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit');\n\n // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n let index = 0;\n let lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, match => {\n if (match === '%%') {\n return;\n }\n index++;\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n }", "function formatArgs(args) {\n\t args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);\n\t\n\t if (!this.useColors) {\n\t return;\n\t }\n\t\n\t var c = 'color: ' + this.color;\n\t args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-zA-Z%]/g, function (match) {\n\t if (match === '%%') {\n\t return;\n\t }\n\t\n\t index++;\n\t\n\t if (match === '%c') {\n\t // We only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t args.splice(lastC, 0, c);\n\t}", "function css(hljs) {\n var FUNCTION_LIKE = {\n begin: /[\\w-]+\\(/, returnBegin: true,\n contains: [\n {\n className: 'built_in',\n begin: /[\\w-]+/\n },\n {\n begin: /\\(/, end: /\\)/,\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE,\n ]\n }\n ]\n };\n var ATTRIBUTE = {\n className: 'attribute',\n begin: /\\S/, end: ':', excludeEnd: true,\n starts: {\n endsWithParent: true, excludeEnd: true,\n contains: [\n FUNCTION_LIKE,\n hljs.CSS_NUMBER_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'number', begin: '#[0-9A-Fa-f]+'\n },\n {\n className: 'meta', begin: '!important'\n }\n ]\n }\n };\n var AT_IDENTIFIER = '@[a-z-]+'; // @font-face\n var AT_MODIFIERS = \"and or not only\";\n var AT_PROPERTY_RE = /@-?\\w[\\w]*(-\\w+)*/; // @-webkit-keyframes\n var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n var RULE = {\n begin: /([*]\\s?)?(?:[A-Z_.\\-\\\\]+|--[a-zA-Z0-9_-]+)\\s*(\\/\\*\\*\\/)?:/, returnBegin: true, end: ';', endsWithParent: true,\n contains: [\n ATTRIBUTE\n ]\n };\n\n return {\n name: 'CSS',\n case_insensitive: true,\n illegal: /[=|'\\$]/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'selector-id', begin: /#[A-Za-z0-9_-]+/\n },\n {\n className: 'selector-class', begin: '\\\\.' + IDENT_RE\n },\n {\n className: 'selector-attr',\n begin: /\\[/, end: /\\]/,\n illegal: '$',\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n ]\n },\n {\n className: 'selector-pseudo',\n begin: /:(:)?[a-zA-Z0-9_+()\"'.-]+/\n },\n // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: '@(page|font-face)',\n lexemes: AT_IDENTIFIER,\n keywords: '@page @font-face'\n },\n {\n begin: '@', end: '[{;]', // at_rule eating first \"{\" is a good thing\n // because it doesn’t let it to be parsed as\n // a rule set but instead drops parser into\n // the default mode which is how it should be.\n illegal: /:/, // break on Less variables @var: ...\n returnBegin: true,\n contains: [\n {\n className: 'keyword',\n begin: AT_PROPERTY_RE\n },\n {\n begin: /\\s/, endsWithParent: true, excludeEnd: true,\n relevance: 0,\n keywords: AT_MODIFIERS,\n contains: [\n {\n begin: /[a-z-]+:/,\n className:\"attribute\"\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE\n ]\n }\n ]\n },\n {\n className: 'selector-tag', begin: IDENT_RE,\n relevance: 0\n },\n {\n begin: /\\{/, end: /\\}/,\n illegal: /\\S/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n { begin: /;/ }, // empty ; rule\n RULE,\n ]\n }\n ]\n };\n}", "function css(hljs) {\n var FUNCTION_LIKE = {\n begin: /[\\w-]+\\(/, returnBegin: true,\n contains: [\n {\n className: 'built_in',\n begin: /[\\w-]+/\n },\n {\n begin: /\\(/, end: /\\)/,\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE,\n ]\n }\n ]\n };\n var ATTRIBUTE = {\n className: 'attribute',\n begin: /\\S/, end: ':', excludeEnd: true,\n starts: {\n endsWithParent: true, excludeEnd: true,\n contains: [\n FUNCTION_LIKE,\n hljs.CSS_NUMBER_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'number', begin: '#[0-9A-Fa-f]+'\n },\n {\n className: 'meta', begin: '!important'\n }\n ]\n }\n };\n var AT_IDENTIFIER = '@[a-z-]+'; // @font-face\n var AT_MODIFIERS = \"and or not only\";\n var AT_PROPERTY_RE = /@-?\\w[\\w]*(-\\w+)*/; // @-webkit-keyframes\n var IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';\n var RULE = {\n begin: /([*]\\s?)?(?:[A-Z_.\\-\\\\]+|--[a-zA-Z0-9_-]+)\\s*(\\/\\*\\*\\/)?:/, returnBegin: true, end: ';', endsWithParent: true,\n contains: [\n ATTRIBUTE\n ]\n };\n\n return {\n name: 'CSS',\n case_insensitive: true,\n illegal: /[=|'\\$]/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n {\n className: 'selector-id', begin: /#[A-Za-z0-9_-]+/\n },\n {\n className: 'selector-class', begin: '\\\\.' + IDENT_RE\n },\n {\n className: 'selector-attr',\n begin: /\\[/, end: /\\]/,\n illegal: '$',\n contains: [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n ]\n },\n {\n className: 'selector-pseudo',\n begin: /:(:)?[a-zA-Z0-9_+()\"'.-]+/\n },\n // matching these here allows us to treat them more like regular CSS\n // rules so everything between the {} gets regular rule highlighting,\n // which is what we want for page and font-face\n {\n begin: '@(page|font-face)',\n lexemes: AT_IDENTIFIER,\n keywords: '@page @font-face'\n },\n {\n begin: '@', end: '[{;]', // at_rule eating first \"{\" is a good thing\n // because it doesn’t let it to be parsed as\n // a rule set but instead drops parser into\n // the default mode which is how it should be.\n illegal: /:/, // break on Less variables @var: ...\n returnBegin: true,\n contains: [\n {\n className: 'keyword',\n begin: AT_PROPERTY_RE\n },\n {\n begin: /\\s/, endsWithParent: true, excludeEnd: true,\n relevance: 0,\n keywords: AT_MODIFIERS,\n contains: [\n {\n begin: /[a-z-]+:/,\n className:\"attribute\"\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.CSS_NUMBER_MODE\n ]\n }\n ]\n },\n {\n className: 'selector-tag', begin: IDENT_RE,\n relevance: 0\n },\n {\n begin: /\\{/, end: /\\}/,\n illegal: /\\S/,\n contains: [\n hljs.C_BLOCK_COMMENT_MODE,\n { begin: /;/ }, // empty ; rule\n RULE,\n ]\n }\n ]\n };\n}", "function useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return 'WebkitAppearance' in document.documentElement.style ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n window.console && (console.firebug || console.exception && console.table) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31;\n }" ]
[ "0.60772026", "0.6058366", "0.6044316", "0.5864998", "0.58472097", "0.58373964", "0.5758509", "0.5737241", "0.5725176", "0.5662743", "0.5642719", "0.5620752", "0.55817246", "0.5533216", "0.5497694", "0.5481922", "0.5472681", "0.5458244", "0.545638", "0.54380435", "0.54221475", "0.5417497", "0.5413453", "0.5386662", "0.5386662", "0.5386662", "0.538114", "0.5368356", "0.53623015", "0.53623015", "0.53623015", "0.5351223", "0.5351223", "0.5351223", "0.5351223", "0.5351223", "0.5351223", "0.5351223", "0.5350006", "0.5340715", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.5339784", "0.53376305", "0.5334887", "0.53286177", "0.53255117", "0.5318089", "0.53140205", "0.5312127", "0.5312127", "0.5309734" ]
0.0
-1
Colorize log arguments if enabled.
function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "log(...args) {\n console.log(this.getColorOn() + args.join(\" \"));\n }", "function writelnColor(){\n\t\tfor(var i=0; i<arguments.length; i=i+2)\n\t\t\tgrunt.log.write(arguments[i][arguments[i+1]]);\n\t\tgrunt.log.writeln('');\n\t}", "debug(...args) {\n console.debug(this.getColorOn() + args.join(\" \"));\n }", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return args;var c='color: '+this.color;args=[args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){ // we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);return args;}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return args;var c='color: '+this.color;args=[args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){ // we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);return args;}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return args;var c='color: '+this.color;args=[args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){ // we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);return args;}", "function formatArgs(args){var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+module.exports.humanize(this.diff);if(!useColors)return;var c='color: '+this.color;args.splice(1,0,c,'color: inherit');// the final \"%c\" is somewhat tricky, because there could be other\n// arguments passed either before or after the %c, so we need to\n// figure out the correct index to insert the CSS into\nvar index=0;var lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){// we only are interested in the *last* %c\n// (the user may have provided their own)\nlastC=index;}});args.splice(lastC,0,c);}", "function formatArgs(args){var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return;var c='color: '+this.color;args.splice(1,0,c,'color: inherit');// the final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tvar index=0;var lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){// we only are interested in the *last* %c\n\t// (the user may have provided their own)\n\tlastC=index;}});args.splice(lastC,0,c);}", "function formatArgs(args){var useColors=this.useColors;args[0]=(useColors?'%c':'')+this.namespace+(useColors?' %c':' ')+args[0]+(useColors?'%c ':' ')+'+'+exports.humanize(this.diff);if(!useColors)return;var c='color: '+this.color;args.splice(1,0,c,'color: inherit');// the final \"%c\" is somewhat tricky, because there could be other\n// arguments passed either before or after the %c, so we need to\n// figure out the correct index to insert the CSS into\nvar index=0;var lastC=0;args[0].replace(/%[a-zA-Z%]/g,function(match){if('%%'===match)return;index++;if('%c'===match){// we only are interested in the *last* %c\n// (the user may have provided their own)\nlastC=index;}});args.splice(lastC,0,c);}", "function formatArgs(){var args=arguments;var useColors=this.useColors;args[0] = (useColors?'%c':'') + this.namespace + (useColors?' %c':' ') + args[0] + (useColors?'%c ':' ') + '+' + exports.humanize(this.diff);if(!useColors)return args;var c='color: ' + this.color;args = [args[0],c,'color: inherit'].concat(Array.prototype.slice.call(args,1)); // the final \"%c\" is somewhat tricky, because there could be other\n// arguments passed either before or after the %c, so we need to\n// figure out the correct index to insert the CSS into\nvar index=0;var lastC=0;args[0].replace(/%[a-z%]/g,function(match){if('%%' === match)return;index++;if('%c' === match){ // we only are interested in the *last* %c\n// (the user may have provided their own)\nlastC = index;}});args.splice(lastC,0,c);return args;}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function (match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n }", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ');\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n var name = this.namespace;\n \n if (useColors) {\n var c = this.color;\n \n args[0] = ' \\u001b[3' + c + ';1m' + name + ' '\n + '\\u001b[0m'\n + args[0] + '\\u001b[3' + c + 'm'\n + ' +' + exports.humanize(this.diff) + '\\u001b[0m';\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n return args;\n }", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ');\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t var name = this.namespace;\n\t\n\t if (useColors) {\n\t var c = this.color;\n\t\n\t args[0] = ' \\u001b[3' + c + ';1m' + name + ' '\n\t + '\\u001b[0m'\n\t + args[0] + '\\u001b[3' + c + 'm'\n\t + ' +' + exports.humanize(this.diff) + '\\u001b[0m';\n\t } else {\n\t args[0] = new Date().toUTCString()\n\t + ' ' + name + ' ' + args[0];\n\t }\n\t return args;\n\t}", "function formatArgs(args) {\n\t args[0] = \"\".concat((this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' '), \"+\").concat(setupDebug.humanize(this.diff));\n\n\t if (!this.useColors) {\n\t return;\n\t }\n\n\t var c = \"color: \".concat(this.color);\n\t args.splice(1, 0, c, 'color: inherit'); // The final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-zA-Z%]/g, function (match) {\n\t if (match === '%%') {\n\t return;\n\t }\n\n\t index++;\n\n\t if (match === '%c') {\n\t // We only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t args.splice(lastC, 0, c);\n\t}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n var name = this.namespace;\n\n if (useColors) {\n var c = this.color;\n\n args[0] = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m' + args[0] + '\\u001b[3' + c + 'm' + ' +' + exports.humanize(this.diff) + '\\u001b[0m';\n } else {\n args[0] = new Date().toUTCString() + ' ' + name + ' ' + args[0];\n }\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function (match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\t\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\t\n\t if (!useColors) return args;\n\t\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\t\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n var name = this.namespace;\n\n if (useColors) {\n var c = this.color;\n\n args[0] = ' \\u001b[3' + c + ';1m' + name + ' '\n + '\\u001b[0m'\n + args[0] + '\\u001b[3' + c + 'm'\n + ' +' + exports.humanize(this.diff) + '\\u001b[0m';\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n return args;\n}", "function formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n var name = this.namespace;\n\n if (useColors) {\n var c = this.color;\n\n args[0] = ' \\u001b[3' + c + ';1m' + name + ' '\n + '\\u001b[0m'\n + args[0] + '\\u001b[3' + c + 'm'\n + ' +' + exports.humanize(this.diff) + '\\u001b[0m';\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n return args;\n}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}", "function formatArgs() {\n\t var args = arguments;\n\t var useColors = this.useColors;\n\n\t args[0] = (useColors ? '%c' : '')\n\t + this.namespace\n\t + (useColors ? ' %c' : ' ')\n\t + args[0]\n\t + (useColors ? '%c ' : ' ')\n\t + '+' + exports.humanize(this.diff);\n\n\t if (!useColors) return args;\n\n\t var c = 'color: ' + this.color;\n\t args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n\t // the final \"%c\" is somewhat tricky, because there could be other\n\t // arguments passed either before or after the %c, so we need to\n\t // figure out the correct index to insert the CSS into\n\t var index = 0;\n\t var lastC = 0;\n\t args[0].replace(/%[a-z%]/g, function(match) {\n\t if ('%%' === match) return;\n\t index++;\n\t if ('%c' === match) {\n\t // we only are interested in the *last* %c\n\t // (the user may have provided their own)\n\t lastC = index;\n\t }\n\t });\n\n\t args.splice(lastC, 0, c);\n\t return args;\n\t}" ]
[ "0.6760166", "0.6711751", "0.65307504", "0.65290976", "0.65290976", "0.65290976", "0.6475225", "0.64737195", "0.64728016", "0.6462169", "0.645757", "0.6455942", "0.6453729", "0.64420164", "0.64335275", "0.64298606", "0.642863", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.6418752", "0.64099276", "0.6407302", "0.6407302", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6391772", "0.6375712", "0.6375712", "0.63755894", "0.63755894", "0.63755894", "0.63755894", "0.63755894", "0.63755894" ]
0.0
-1
This is the common logic for both the Node.js and web browser implementations of `debug()`.
function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __webpack_require__(4695); createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; let enableOverride = null; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return '%'; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. Object.defineProperty(debug, 'enabled', { enumerable: true, configurable: false, get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride, set: v => { enableOverride = v; } }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } /** * XXX DO NOT USE. This is a temporary stub function. * XXX It WILL be removed in the next major release. */ function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } createDebug.enable(createDebug.load()); return createDebug; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "debug() {}", "function debugMessage() {\n if (debug) console.debug(arguments);\n}", "function devDebug(){\n\n}", "function myDebug(){\n if(window.console) console.info(arguments);\n}", "function debug(v){return false;}", "function debug () {\n if (Retsly.debug) console.log.apply(console, arguments);\n}", "function dbg(x) {\n debugger;\n}", "function debug () {\n if (!debugEnabled) { return; }\n console.log.apply(console, arguments);\n }", "function debug(msg){\n console.log(msg);\n}", "function debug(s) {\n if (!debugOn) {\n return;\n }\n console.log(s);\n}", "function debug(msg) {\n console.log(msg);\n}", "function debug() {\n if (process.env.DEBUG) {\n // Because arguments is an array-like object, it must be called with Function.prototype.apply().\n console.log('DEBUG: %s', util.format.apply(util, arguments));\n }\n}", "function debug()\n {\n var i;\n \n if (debugging)\n {\n for (i = 0; i < arguments.length; i++)\n {\n HTMLDebugInfo.innerHTML += arguments[i].toString() + \"<br>\";\n }\n } \n }", "static debug(...args) {\n if (this.toLog('DEBUG')) {\n // noinspection TsLint\n console.debug.apply(console, arguments); // eslint-disable-line\n }\n }", "function debug(message) {\n if(debugging) {\n console.log(message);\n }\n}", "function debug_log(msg) {\n\n if (window['debug']) {\n\n console.log(msg);\n\n }\n\n}", "function debug() {\r\n\tif (console) {\r\n\t\tconsole.log(this, arguments);\r\n\t}\r\n}", "function debug(message) {\n console.log(\"DEBUG: \" + message)\n}", "function showDebugInfo() {\n\t\t\tconsole.log();\n\t\t}", "updateDebugMode() {\n if (this.isDebug === true) {\n this.log = console.log.bind(console);\n this.error = console.error.bind(console);\n this.warn = console.warn.bind(console);\n }\n else {\n this.log = R.identity(undefined);\n this.error = R.identity(undefined);\n this.warn = R.identity(undefined);\n }\n }", "debug(...args) {\n return this.getInstance().debug(...args);\n }", "function _debug( msg )\n {\n if( window.console && window.console.log ) \n console.log( \"[debug] \" + msg ); \n }", "isDebug() {\n return nativeTools.debug;\n }", "static dbg() {\n var str;\n if (!Util.debug) {\n return;\n }\n str = Util.toStrArgs('', arguments);\n Util.consoleLog(str);\n }", "function _debug(str) {\n\tif (window.console && window.console.log) window.console.log(str);\n }", "function debug(title, url, body, method, headers) {\n if (__DEV__) {\n const d = new Date();\n if (console.groupCollapsed) {\n console.groupCollapsed(title, `@ ${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()}`);\n }\n else {\n console.log(title, `@ ${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}.${d.getMilliseconds()}`);\n }\n if (method) console.log('%c method: ', 'color: #e74c3c; font-weight: bold', method);\n if (url) console.log('%c endpoint: ', 'color: #2ecc71; font-weight: bold', url);\n if (body) console.log('%c body: ', 'color: #3498db; font-weight: bold', body);\n if (headers) console.log('%c headers: ', 'color: #e67e22; font-weight: bold', headers);\n if (console.groupEnd) {\n console.groupEnd();\n }\n }\n}", "function debug(message)\n{\n\tif (DEBUG)\n\t\tconsole.log(message);\n}", "function debug() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args_finder_1.isDebugMode()) {\n write(args, PRINT_COLOR, DEBUG('DEBUG: '));\n }\n}", "function debug() {\n if(IS_DEBUG) {\n let text = '';\n for(let i in arguments) {\n text += ' ' + arguments[i];\n }\n console.log(text);\n }\n}", "function debug(message) {\n if ($.fn.track.defaults.debug && typeof console !== 'undefined' && typeof console.debug !== 'undefined') {\n console.debug(message);\n }\n }", "function _setupDebugHelpers() {\n window.ld = LiveDevelopment;\n window.i = Inspector;\n window.report = function report(params) { window.params = params; console.info(params); };\n }", "function jum_debug(msg) {if (jum.DEBUG_INTERNAL) jum.debug('JUMDEBUG: ' + msg);}", "function debug(msg) {\n if (options.debug) console.error(msg)\n}", "debug (messageParms) {\n // We can actually replace this method with a simpler one when not in debug.\n if (!IsDebug) {\n Logger.prototype.debug = () => {}\n return\n }\n\n this._print(arguments, {debug: true})\n }", "function isDebug() {\n return debug;\n }", "function debu(x){\n if (debug) console.log(x)\n}", "debug (messageParms) {\n // We can actually replace this method with a simpler one when not in debug.\n if (!utils.isDebug) {\n Logger.prototype.debug = () => {}\n return\n }\n\n this._print(arguments, {debug: true})\n }", "function DebugConsole() {\n}", "function DebugConsole() {\n}", "function DebugConsole() {\n}", "debug (msg : string, ...args : mixed[]) {\n\t\tthis._print(\"debug\", msg, ...args)\n\t}", "function JavaDebug() {\r\n}", "function debugCallback(err) {\n if (err) {\n debug(err);\n }\n }", "function debug() {\n\t\t\tconsole.log()\n\t\t\ttheInterface.emit('ui:startDebug');\n\t\t}", "function testToDebug() {\n console.log(\"\\ntesting toDebug...\");\n \n console.log(\"a\");\n let lis = list(1,2,3,list(4,5));\n console.log(\"b\");\n let lis2 = \"nil\";\n console.log(\"c\");\n console.log(toDebug(null));\n console.log(\"cc\");\n console.log(cons(1,\"nil\").toString());\n console.log(\"ccc\");\n console.log(list(1).toString());\n console.log(\"cccc\");\n console.log(toDebug(lis));\n console.log(\"d\");\n //console.log(toDebug(lis2));\n console.log(\"e\");\n \n console.log();\n console.log();\n}", "function debug(msg) {\n if (typeof(console) != 'undefined') {\n console.info(msg);\n }\n }", "function debug() {\n if (attrs.isDebug) {\n //stringify func\n var stringified = scope + \"\";\n \n // parse variable names\n var groupVariables = stringified\n //match var x-xx= {};\n .match(/var\\s+([\\w])+\\s*=\\s*{\\s*}/gi)\n //match xxx\n .map(d => d.match(/\\s+\\w*/gi).filter(s => s.trim()))\n //get xxx\n .map(v => v[0].trim());\n \n //assign local variables to the scope\n groupVariables.forEach(v => {\n main[\"P_\" + v] = eval(v);\n });\n }\n }", "function debugLog(data){\n\t if(DEBUG !== 1) return false;\n\n\tconsole.log(data);\n}", "debug(...theArgs) { return this._log('DEBUG', {}, theArgs); }", "_log() {\n if (this.debug) {\n console.log(...arguments);\n }\n }", "function debug(){\r\n\t\tvar arr = [],\r\n\t\tl = arguments.length;\r\n\t\tif(l >1){\r\n\t\t\tif(!test.debug){\r\n\t\t\t\ttest.debug = {};\r\n\t\t\t}\r\n\t\t\twhile(--l){\r\n\t\t\t\tarr.push(arguments[l]);\r\n\t\t\t}\r\n\t\t\ttest.debug[arguments[0]] = arr;\r\n\t\t}\r\n\t}", "function isDebug() {\n\t\"use strict\";\n\tif ( 'undefined' === typeof ts_debug ) {\n\t\tts_debug = false;\n\t}\n\t\n\treturn Boolean(ts_debug);\n}", "function _debug (...args) {\n if (appOptions.debug) {\n console.log('[NextAuth.js][DEBUG]', ...args)\n }\n }", "function debug(entry) {\n console.log(entry)\n}", "function debug(entry) {\n console.log(entry)\n}", "function setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/socket.io-parser/node_modules/ms/index.js\");\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}", "debug(...parameters)\n\t{\n\t\tif (this.options.debug)\n\t\t{\n\t\t\tconsole.log(this.preamble, '[debug]', generate_log_message(parameters))\n\t\t}\n\t}", "function debug(message) {\n command_1.issueCommand(\"debug\", {}, message);\n }", "function debuglog(msg){\n if(!!isDebug) {console.log(msg)};\n }", "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "function setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/socket.io-client/node_modules/ms/index.js\");\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}", "function d(message) {\n if (debug_mode) console.log(message);\n }", "function writeDebug(s) {\n\t\"use strict\";\n\tjsReady = true;\n\tif ( true === ts_debug ) {\n\t\tconsole.log(s);\n\t}\n}", "function DEBUG2() {\n if (d) {\n console.warn.apply(console, arguments)\n }\n}", "function debug() {\n try {\n var messages = Array.prototype.slice.call(arguments, 0) || [];\n addMessages('debug', messages, stackTrace());\n logger.debug(messages);\n } catch (err) {\n Debugger.fatal.push(err);\n logger.fatal(err);\n }\n}", "function debug(msg){\n\n \t// comment out the below line while debugging\n \t \t//console.log(msg);\n }", "function setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(/*! ms */ \"FGiv\");\n createDebug.destroy = destroy;\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n var enableOverride = null;\n\n function debug() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return '%';\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.useColors = createDebug.useColors();\n debug.color = createDebug.selectColor(namespace);\n debug.extend = extend;\n debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n Object.defineProperty(debug, 'enabled', {\n enumerable: true,\n configurable: false,\n get: function get() {\n return enableOverride === null ? createDebug.enabled(namespace) : enableOverride;\n },\n set: function set(v) {\n enableOverride = v;\n }\n }); // Env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n return debug;\n }\n\n function extend(namespace, delimiter) {\n var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n newDebug.log = this.log;\n return newDebug;\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n }\n /**\n * Disable debug output.\n *\n * @return {String} namespaces\n * @api public\n */\n\n\n function disable() {\n var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) {\n return '-' + namespace;\n }))).join(',');\n createDebug.enable('');\n return namespaces;\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Convert regexp to namespace\n *\n * @param {RegExp} regxep\n * @return {String} namespace\n * @api private\n */\n\n\n function toNamespace(regexp) {\n return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\\.\\*\\?$/, '*');\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n /**\n * XXX DO NOT USE. This is a temporary stub function.\n * XXX It WILL be removed in the next major release.\n */\n\n\n function destroy() {\n console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}" ]
[ "0.76526976", "0.74100566", "0.731867", "0.7225102", "0.72153175", "0.71614915", "0.70852363", "0.7064815", "0.70552844", "0.7047338", "0.69518334", "0.6936694", "0.68824756", "0.68757594", "0.68717974", "0.68690306", "0.68218535", "0.68172204", "0.6785604", "0.6782167", "0.6782053", "0.67768455", "0.6767678", "0.6765711", "0.67093974", "0.6703566", "0.66972303", "0.66920227", "0.66800123", "0.66740537", "0.6644717", "0.66320646", "0.6629417", "0.6629356", "0.660968", "0.66008013", "0.6598946", "0.65628904", "0.65628904", "0.65628904", "0.65584445", "0.6552654", "0.65492344", "0.65438884", "0.65412223", "0.65384823", "0.6534262", "0.65199506", "0.6502824", "0.6468167", "0.64648014", "0.64471644", "0.64390063", "0.64298177", "0.64298177", "0.64170665", "0.6414492", "0.641446", "0.64128137", "0.6402556", "0.6402556", "0.6401807", "0.6399866", "0.6389822", "0.63824236", "0.63778955", "0.63702893", "0.6367683", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836", "0.63664836" ]
0.0
-1
XXX DO NOT USE. This is a temporary stub function. XXX It WILL be removed in the next major release.
function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "static final private internal function m106() {}", "transient private internal function m185() {}", "static private internal function m121() {}", "static private protected internal function m118() {}", "transient final protected internal function m174() {}", "transient private protected public internal function m181() {}", "static transient final protected internal function m47() {}", "static transient final private internal function m43() {}", "static transient final protected public internal function m46() {}", "static transient private protected internal function m55() {}", "transient final private protected internal function m167() {}", "static transient final private protected internal function m40() {}", "function StupidBug() {}", "static transient private protected public internal function m54() {}", "static protected internal function m125() {}", "static final protected internal function m110() {}", "transient final private internal function m170() {}", "static final private protected internal function m103() {}", "transient private public function m183() {}", "static private protected public internal function m117() {}", "patch() {\n }", "static transient private internal function m58() {}", "static transient final protected function m44() {}", "static transient private public function m56() {}", "prepare() {}", "static final private protected public internal function m102() {}", "function _____SHARED_functions_____(){}", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static final private public function m104() {}", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "fixupFrame() {\n // stub, used by Chaos Dragon\n }", "__previnit(){}", "transient final private protected public internal function m166() {}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function DWRUtil() { }", "function mock() {\n\twindow.SegmentString = Rng.Range;\n}", "function __it() {}", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "function noop(){}// No operation performed.", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "static transient final private protected public internal function m39() {}", "obtain(){}", "apply () {}", "__init25() {this.forceRenames = new Map()}", "static transient final private public function m41() {}", "postorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "static fromCASFile(casfile) {\n//-----------\nlggr.warn(\"fromCASFile: Not implemented\");\nreturn void 0;\n}", "function TMP() {\n return;\n }", "static first(context) {\n throw new Error(\"TODO: Method not implemented\");\n }", "static private public function m119() {}", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function customHandling() { }", "function TMP(){return;}", "function TMP(){return;}", "adoptedCallback() { }", "_reset() {}", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function Utils() {}", "function Utils() {}", "transient final private public function m168() {}", "lastUsed() { }", "function Util() {}", "static transient final private protected public function m38() {}", "function SigV4Utils() { }", "_get () {\n throw new Error('_get not implemented')\n }", "function FunctionUtils() {}", "sequence(sequenceString) { return 'stub' ;}", "frame() {\n throw new Error('Not implemented');\n }", "function AeUtil() {}", "initialize() {\n // Needs to be implemented by derived classes.\n }", "method() {\n throw new Error('Not implemented');\n }", "hacky(){\n return\n }", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "fakeScanComplete() {}", "prepare() {\n }", "function noop(){\n\t// Left intentionally blank. \n}", "upgrade() {}", "attempt() {}" ]
[ "0.6736127", "0.6577326", "0.6402469", "0.6298072", "0.6195974", "0.61782235", "0.61271334", "0.6046024", "0.5913906", "0.58889645", "0.5857231", "0.58215857", "0.58211464", "0.5772944", "0.57199204", "0.56736195", "0.5656994", "0.5571444", "0.55414695", "0.54445404", "0.5437576", "0.53500557", "0.53404033", "0.5314461", "0.529245", "0.5286522", "0.5267968", "0.5251746", "0.5240563", "0.522596", "0.52234536", "0.51959103", "0.5161281", "0.5161281", "0.5161281", "0.5129348", "0.5110299", "0.51083815", "0.5107171", "0.5100022", "0.50942004", "0.50942004", "0.50942004", "0.5086986", "0.5086986", "0.5086986", "0.504317", "0.50267684", "0.50266325", "0.49901137", "0.49901137", "0.49901137", "0.49901137", "0.49901137", "0.49901137", "0.49901137", "0.49846235", "0.49846235", "0.49846235", "0.49846235", "0.49846235", "0.49846235", "0.49821106", "0.49777287", "0.49431846", "0.49315503", "0.49272043", "0.49137554", "0.49047533", "0.48922825", "0.48862633", "0.4873828", "0.48717573", "0.48717573", "0.4863313", "0.4862063", "0.4862063", "0.48461384", "0.48425004", "0.48414412", "0.48316628", "0.48316628", "0.48285258", "0.48192033", "0.4809191", "0.4800725", "0.4795734", "0.47808304", "0.47757137", "0.47687647", "0.4758293", "0.47541305", "0.47347924", "0.47306597", "0.47254595", "0.47174022", "0.4715195", "0.47149462", "0.47034103", "0.46965966", "0.4690179" ]
0.0
-1
Initializes transport to use and starts probe.
open() { let transport; if (this.opts.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf("websocket") !== -1) { transport = "websocket"; } else if (0 === this.transports.length) { // Emit error on next tick so it can be listened to setTimeout(() => { this.emit("error", "No transports available"); }, 0); return; } else { transport = this.transports[0]; } this.readyState = "opening"; // Retry with the next transport if the transport is disabled (jsonp: false) try { transport = this.createTransport(transport); } catch (e) { debug("error while creating transport: %s", e); this.transports.shift(); this.open(); return; } transport.open(); this.setTransport(transport); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start (callback) {\n if (!this.modules.transport) {\n return callback(new Error('no transports were present'))\n }\n\n let ws\n let transports = this.modules.transport\n\n transports = Array.isArray(transports) ? transports : [transports]\n\n // so that we can have webrtc-star addrs without adding manually the id\n const maOld = []\n const maNew = []\n this.peerInfo.multiaddrs.toArray().forEach((ma) => {\n if (!ma.getPeerId()) {\n maOld.push(ma)\n maNew.push(ma.encapsulate('/ipfs/' + this.peerInfo.id.toB58String()))\n }\n })\n this.peerInfo.multiaddrs.replace(maOld, maNew)\n\n const multiaddrs = this.peerInfo.multiaddrs.toArray()\n transports.forEach((transport) => {\n if (transport.filter(multiaddrs).length > 0) {\n this.switch.transport.add(\n transport.tag || transport.constructor.name, transport)\n } else if (transport.constructor &&\n transport.constructor.name === 'WebSockets') {\n // TODO find a cleaner way to signal that a transport is always\n // used for dialing, even if no listener\n ws = transport\n }\n })\n\n series([\n (cb) => this.switch.start(cb),\n (cb) => {\n if (ws) {\n // always add dialing on websockets\n this.switch.transport.add(ws.tag || ws.constructor.name, ws)\n }\n\n // all transports need to be setup before discover starts\n if (this.modules.discovery) {\n return each(this.modules.discovery, (d, cb) => d.start(cb), cb)\n }\n cb()\n },\n (cb) => {\n // TODO: chicken-and-egg problem #1:\n // have to set started here because DHT requires libp2p is already started\n this._isStarted = true\n if (this._dht) {\n this._dht.start(cb)\n } else {\n cb()\n }\n },\n (cb) => {\n // TODO: chicken-and-egg problem #2:\n // have to set started here because FloodSub requires libp2p is already started\n if (this._options !== false) {\n this._floodSub.start(cb)\n } else {\n cb()\n }\n },\n\n (cb) => {\n // detect which multiaddrs we don't have a transport for and remove them\n const multiaddrs = this.peerInfo.multiaddrs.toArray()\n\n transports.forEach((transport) => {\n multiaddrs.forEach((multiaddr) => {\n if (!multiaddr.toString().match(/\\/p2p-circuit($|\\/)/) &&\n !transports.find((transport) => transport.filter(multiaddr).length > 0)) {\n this.peerInfo.multiaddrs.delete(multiaddr)\n }\n })\n })\n cb()\n },\n (cb) => {\n this.emit('start')\n cb()\n }\n ], callback)\n }", "start (callback) {\n if (!this.modules.transport) {\n return callback(new Error('no transports were present'))\n }\n\n let ws\n let transports = this.modules.transport\n\n transports = Array.isArray(transports) ? transports : [transports]\n\n // so that we can have webrtc-star addrs without adding manually the id\n const maOld = []\n const maNew = []\n this.peerInfo.multiaddrs.toArray().forEach((ma) => {\n if (!ma.getPeerId()) {\n maOld.push(ma)\n maNew.push(ma.encapsulate('/ipfs/' + this.peerInfo.id.toB58String()))\n }\n })\n this.peerInfo.multiaddrs.replace(maOld, maNew)\n\n const multiaddrs = this.peerInfo.multiaddrs.toArray()\n transports.forEach((transport) => {\n if (transport.filter(multiaddrs).length > 0) {\n this.switch.transport.add(\n transport.tag || transport.constructor.name, transport)\n } else if (transport.constructor &&\n transport.constructor.name === 'WebSockets') {\n // TODO find a cleaner way to signal that a transport is always\n // used for dialing, even if no listener\n ws = transport\n }\n })\n\n series([\n (cb) => this.switch.start(cb),\n (cb) => {\n if (ws) {\n // always add dialing on websockets\n this.switch.transport.add(ws.tag || ws.constructor.name, ws)\n }\n\n // all transports need to be setup before discover starts\n if (this.modules.discovery) {\n return each(this.modules.discovery, (d, cb) => d.start(cb), cb)\n }\n cb()\n },\n (cb) => {\n // TODO: chicken-and-egg problem:\n // have to set started here because DHT requires libp2p is already started\n this._isStarted = true\n if (this._dht) {\n return this._dht.start(cb)\n }\n cb()\n },\n (cb) => {\n // detect which multiaddrs we don't have a transport for and remove them\n const multiaddrs = this.peerInfo.multiaddrs.toArray()\n transports.forEach((transport) => {\n multiaddrs.forEach((multiaddr) => {\n if (!multiaddr.toString().match(/\\/p2p-circuit($|\\/)/) &&\n !transports.find((transport) => transport.filter(multiaddr).length > 0)) {\n this.peerInfo.multiaddrs.delete(multiaddr)\n }\n })\n })\n cb()\n },\n (cb) => {\n this.emit('start')\n cb()\n }\n ], callback)\n }", "start (callback) {\n each(this.availableTransports(this._peerInfo), (ts, cb) => {\n // Listen on the given transport\n this.transport.listen(ts, {}, null, cb)\n }, callback)\n }", "start (callback) {\n each(this.availableTransports(this._peerInfo), (ts, cb) => {\n // Listen on the given transport\n this.transport.listen(ts, {}, null, cb)\n }, callback)\n }", "function init()\n{\n\thost.getMidiInPort(0).setMidiCallback(onMidi);\n\ttransport = host.createTransportSection();\n\ttransport.addIsPlayingObserver(function(on) // Is Bitwig's transport playing?\n\t{\n\t\tsendNoteOn(0, ufx.PLAY, on ? 127 : 0); // Don't understand this yet.\n\t\tsendNoteOn(0, ufx.STOP, on ? 0 : 127);\n\t});\n\ttransport.addIsRecordingObserver(function(on) // Is Bitwig's transport recording?\n\t//transport.addLauncherOverdubObserver(function(on) // Handy for overdubbing in clips.\n\t{\n\t\tsendNoteOn(0, ufx.REC, on ? 127 : 0);\n\t});\n}", "start() {\n this.setupDoorbellSocket();\n this.setupMQTT();\n this.initLogin();\n }", "_setup () {\n // Setup pins\n this._dialPin = new Gpio(GpioManager.DIAL_PIN, 'in', 'both', { debounceTimeout: 10 })\n this._pulsePin = new Gpio(GpioManager.PULSE_PIN, 'in', 'falling', { debounceTimeout: 10 })\n\n this._cradlePin = new Gpio(GpioManager.CRADLE_PIN, 'in', 'both', { debounceTimeout: 20 })\n this._mutePin = new Gpio(GpioManager.MUTE_PIN, 'in', 'both', { debounceTimeout: 20 })\n this._ledPin = new Gpio(GpioManager.LED_PIN, 'out')\n this._ampEnablePin = new Gpio(GpioManager.AMP_ENABLE_PIN, 'out')\n\n // Ensure Pins are properly unexported when the module is unloaded\n process.on('SIGINT', _ => {\n this._dialPin.unexport()\n this._pulsePin.unexport()\n this._cradlePin.unexport()\n this._mutePin.unexport()\n this._ledPin.unexport()\n this._ampEnablePin.unexport()\n })\n\n this._startWatchingDial()\n this._startWatchingCradle()\n this._startWatchingMute()\n\n // Initialize the LED as LOW\n this._ledPin.write(Gpio.LOW).catch(() => {})\n this._ampEnablePin.write(Gpio.LOW).catch(() => {})\n }", "init() { //ref : nobleDFU.js this._transport.init();\n\n if (this._isInitialized) {\n return Promise.resolve();\n }\n\n const targetAddress = this._transportParameters.targetAddress;\n const targetAddressType = this._transportParameters.targetAddressType;\n //NU \n const prnValue = this._transportParameters.prnValue || DEFAULT_PRN;\n //NU\n const mtuSize = this._transportParameters.mtuSize || MAX_SUPPORTED_MTU_SIZE;\n\n this._debug(`Initializing DFU transport with targetAddress: ${targetAddress}, ` +\n `targetAddressType: ${targetAddressType}, prnValue: ${prnValue}, mtuSize: ${mtuSize}.`);\n\n var BogusReConnect = false;\n return this._connectIfNeeded(targetAddress, targetAddressType, BogusReConnect)\n .then(device => this._enterDfuMode(device))\n /*TODO\n .then(device => this._getCharacteristicIds(device))\n .then(characteristicIds => {\n const controlPointId = characteristicIds.controlPointId;\n const packetId = characteristicIds.packetId;\n this._controlPointService = new ControlPointService(this._adapter, controlPointId);\n this._objectWriter = new ObjectWriter(this._adapter, controlPointId, packetId);\n this._objectWriter.on('packetWritten', progress => {\n this._emitTransferEvent(progress.offset, progress.type);\n });\n return this._startCharacteristicsNotifications(controlPointId);\n })\n //NU .then(() => this._setPrn(prnValue))\n //NU .then(() => this._setMtuSize(mtuSize))\n TODO*/\n .then( device => this._startControlPointNotifications(device) ) //karel\n .then(() => this._isInitialized = true);\n }", "function init(options) {\n console.log('Transport init');\n new TransportView(options).render();\n}", "async start() {\n if (this._autoDetectResources) {\n await this.detectResources();\n }\n if (this._tracerProviderConfig) {\n const tracerProvider = new node_1.NodeTracerProvider(Object.assign(Object.assign({}, this._tracerProviderConfig.tracerConfig), { resource: this._resource }));\n tracerProvider.addSpanProcessor(this._tracerProviderConfig.spanProcessor);\n tracerProvider.register({\n contextManager: this._tracerProviderConfig.contextManager,\n propagator: this._tracerProviderConfig.textMapPropagator,\n });\n }\n if (this._meterProviderConfig) {\n const meterProvider = new metrics_1.MeterProvider(Object.assign(Object.assign({}, this._meterProviderConfig), { resource: this._resource }));\n api_1.metrics.setGlobalMeterProvider(meterProvider);\n }\n }", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on(\"drain\", function() {\n self.onDrain();\n })\n .on(\"packet\", function(packet) {\n self.onPacket(packet);\n })\n .on(\"error\", function(e) {\n self.onError(e);\n })\n .on(\"close\", function() {\n self.onClose(\"transport close\");\n });\n }", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on(\"drain\", function() {\n self.onDrain();\n })\n .on(\"packet\", function(packet) {\n self.onPacket(packet);\n })\n .on(\"error\", function(e) {\n self.onError(e);\n })\n .on(\"close\", function() {\n self.onClose(\"transport close\");\n });\n }", "_setup() {\n this.self.ipc.register(this.returnID, data => {\n this._handleResponse(data)\n });\n\n let data = {}\n\n data.globalType = this.globalType;\n data.clusterID = this.clusterID;\n data.responseID = this.returnID;\n data.data = this.broadcastString\n\n this.self.ipc.broadcast('advancedIPCListen', data);\n\n\n this.timeout = setTimeout(() => {\n if (this.responses.length < this.expectedReturns) {\n return this.emit('failed', 'Timeout waiting for all responses.');\n }\n }, 30000);\n }", "function trainerBLEinit () {\n trainerBLE = new TrainerBLE(options = {\n name: 'Jo1'\n },serverCallback);\n\ntrainerBLE.on('disconnect', string => {\n io.emit('control', 'disconnected')\n controlled = false;\n});\n\ntrainerBLE.on('key', string => {\n if (DEBUG) console.log('[server.js] - key: ' + string)\n io.emit('key', '[server.js] - ' + string)\n})\ntrainerBLE.on('error', string => {\n if (DEBUG) console.log('[server.js] - error: ' + string)\n io.emit('error', '[server.js] - ' + string)\n})\n\n\n}", "_setup() {\n this.setHeaderFunc({\n 'Content-Type': 'text/event-stream',\n 'Cache-Control': 'no-cache, no-transform',\n 'Connection': 'keep-alive'\n })\n this._writeKeepAliveStream(true)\n this._setRetryInterval()\n this.send(this.connectEventName, this.uid)\n\n const timer = setInterval(this._writeKeepAliveStream.bind(this), this.heartBeatInterval)\n\n this.stream.on('close', () => {\n clearInterval(timer)\n connectionMap.delete(this.uid)\n this.transformStream.destroy()\n })\n connectionMap.set(this.uid, this)\n }", "setTransport(transport) {\n debug$3(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug$3(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on(\"drain\", function() {\n self.onDrain();\n })\n .on(\"packet\", function(packet) {\n self.onPacket(packet);\n })\n .on(\"error\", function(e) {\n self.onError(e);\n })\n .on(\"close\", function() {\n self.onClose(\"transport close\");\n });\n }", "function init () {\n // Attach Socket.IO to server\n socket = io.listen(server);\n\n // Log Port selected\n util.log(\"#Listening on: \" + port);\n\n // Start listening for events\n setEventHandlers();\n\n // Running tests\n util.log(\"#Running tests\");\n var Debug = require(\"./debug\");\n Debug.runAllTests();\n util.log(\"#All tests run\");\n}", "function initPeer() {\n // Do we get a response\n client.gotRespond = false;\n // Getting the init peer\n var peer = constructor('init');\n // Peer signal\n // Send a request for connection\n peer.on('signal', (data) => {\n if (!client.gotRespond) {\n socket.emit('Request', data);\n }\n })\n client.peer = peer;\n }", "function init() {\n\tif (typeof Peer === 'function') {\n\t\tconsole.log('Init');\n\t\tvar peer = new Peer(myName, {key: '{{YOUR_PEERJS_KEY}}'});\n\t\tvar conn = peer.connect(contactName);\n\t\tpeer.on('connection', function(externalConnection) {\n\t\t\tonConnect();\n\t\t});\n\t} else {\n\t\tconsole.log('waiting...');\n\t\tsetTimeout(init, 1000);\n\t}\n}", "start () {\n\t\tthis._logger.info(`Connecting to ${this.host}...`)\n\t\tthis._params.host = this.host\n\t\tthis._connection.connect(this._params)\n\t\tthis.started = true\n\t}", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n } // set up transport\n\n\n this.transport = transport; // set up transport listeners\n\n transport.on(\"drain\", this.onDrain.bind(this)).on(\"packet\", this.onPacket.bind(this)).on(\"error\", this.onError.bind(this)).on(\"close\", () => {\n this.onClose(\"transport close\");\n });\n }", "onInit() {\n\n // Get settings\n this.settings = this.getSettings();\n // If still old settings then convert\n if (!this.settings.url) {\n this.log('No url setting found!')\n this.log(this.settings)\n this.setSettings({\n url: this.settings.urlprefix + '://' + this.settings.host + ':' + this.settings.tcpport,\n })\n .then(this.log)\n .catch(this.error)\n }\n\n this.log('device init');\n this.log('name:', this.getName());\n this.log('class:', this.getClass());\n\n this.addFlows();\n }", "start() {\r\n // Create the mqttClient (AWS IoT device object).\r\n console.log(\r\n `Instantiating mqtt client object [clientId: ${this._clientId}]...`\r\n )\r\n this._device.on('connect', this.onMqttConnection.bind(this))\r\n this._device.on('reconnect', this.onMqttReconnection.bind(this))\r\n this._device.on('message', this.onMqttMessage.bind(this))\r\n\r\n console.log(\r\n `mqtt client [clientId:${this._clientId}] initialized successfully.`\r\n )\r\n }", "setup() {\n\t\tthis.bpm = Persist.exists('bpm') ? Persist.get('bpm') : 100;\n\t\tthis.startTime = Persist.exists('startTime') ? Persist.get('startTime') : Date.now();\n\t\tthis.tempos = {\n\t\t\tmaster: 'four',\n\t\t\t...TEMPO_CONFIG\n\t\t}\n\t\tObject.keys(this.tempos).filter(k => k !== 'master').forEach(tempoKey => {\n\t\t\tthis.tempos[tempoKey].getBeatDuration = this.tempos[tempoKey].getBeatDuration.bind(this)\n\t\t})\n\n\t\tif (ENV.IS_HOST) {\n\t\t\tthis.attachHostEventHandlers();\n\t\t} else {\n\t\t\t$io.onBPMChange(this.dataReceived.bind(this))\n\t\t\t$io.onMasterTempoChange(this.dataReceived.bind(this))\n\t\t}\n\t}", "function init() {\n console.log('init!');\n setup();\n startTimer();\n }", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", () => {\n this.onClose(\"transport close\");\n });\n }", "static initialize() {\r\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\r\n if (!PAL._isInitialized) {\r\n PAL._isInitialized = true;\r\n networkClientFactory_1.NetworkClientFactory.instance().register(\"default\", (networkEndpoint, logger, timeoutMs) => new networkClient_1.NetworkClient(networkEndpoint, logger, timeoutMs));\r\n rngServiceFactory_1.RngServiceFactory.instance().register(\"default\", () => new rngService_1.RngService());\r\n platformCryptoFactory_1.PlatformCryptoFactory.instance().register(\"default\", () => new platformCrypto_1.PlatformCrypto());\r\n }\r\n return Promise.resolve();\r\n });\r\n }", "_specializedInitialisation()\r\n\t{\r\n\t\tLogger.log(\"Specialisation for service AVTransport\", LogType.Info);\r\n\t\tvar relativeTime = this.getVariableByName(\"RelativeTimePosition\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!relativeTime)\r\n\t\t\trelativeTime = this.getVariableByName(\"A_ARG_TYPE_GetPositionInfo_RelTime\");\r\n\t\tvar transportState = this.getVariableByName(\"TransportState\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!transportState)\r\n\t\t\ttransportState = this.getVariableByName(\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\");\r\n\r\n\t\tif (transportState)\r\n\t\t{\r\n\t\t\ttransportState.on('updated', (variable, newVal) =>\r\n\t\t\t{\r\n\t\t\t\tLogger.log(\"On transportStateUpdate : \" + newVal, LogType.DEBUG);\r\n\t\t\t\tvar actPosInfo = this.getActionByName(\"GetPositionInfo\");\r\n\t\t\t\tvar actMediaInfo = this.getActionByName(\"GetMediaInfo\");\r\n\t\t\t\t/*\r\n\t\t\t\t“STOPPED” R\r\n\t\t\t\t“PLAYING” R\r\n\t\t\t\t“TRANSITIONING” O\r\n\t\t\t\t”PAUSED_PLAYBACK” O\r\n\t\t\t\t“PAUSED_RECORDING” O\r\n\t\t\t\t“RECORDING” O\r\n\t\t\t\t“NO_MEDIA_PRESENT”\r\n\t\t\t\t */\r\n\t\t\t\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this._intervalUpdateRelativeTime)\r\n\t\t\t\t\t\tclearInterval(this._intervalUpdateRelativeTime);\r\n\t\t\t\t\tif (newVal == \"PLAYING\" || newVal == \"RECORDING\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t} );\r\n\t\t\t\t\t\t//Déclenche la maj toutes les 4 secondes\r\n\t\t\t\t\t\tthis._intervalUpdateRelativeTime = setInterval(() =>{\r\n\t\t\t\t\t\t\t\t//Logger.log(\"On autoUpdate\", LogType.DEBUG);\r\n\t\t\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t}\t);\r\n\t\t\t\t\t\t\t}, 4000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//else if (newVal == \"STOPPED\" || newVal == \"PAUSED_PLAYBACK\" || newVal == \"PAUSED_RECORDING\" || newVal == \"NO_MEDIA_PRESENT\")\r\n\t\t\t\t//{\r\n\t\t\t\t//\r\n\t\t\t\t//}\r\n\t\t\t\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\r\n\t\t\t\tif (newVal == \"TRANSITIONING\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{InstanceID: 0}\t);\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{InstanceID: 0} );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newVal == \"STOPPED\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t});\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{\tInstanceID: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}", "function init() {\n createDataReader('heartbeat', true);\n createDataReader('timing');\n createDataReader('telemetry');\n }", "function init() {\n initConnectionManager();\n initPingService();\n\n ros.connect(rosUrl);\n console.log('ros-connect-amigo initialized');\n}", "onInit() {\n\t\tthis.log('device init');\n\t\tthis.log('name:', this.getName());\n\t\tthis.log('id:', this.getData().id);\n\n\t\tthis._driver = this.getDriver();\n\t\tthis.readings = {};\n\t\t// console.log(util.inspect(this));\n\n\t\tconst settings = this.getSettings();\n\t\tthis.routerSession = new NetgearRouter(settings.password, settings.username, settings.host, settings.port);\n\t\t// this._driver.login.call(this)\n\t\t// \t.catch(this.error);\n\n\t\t// register trigger flow cards\n\t\tthis.speedChangedTrigger = new Homey.FlowCardTriggerDevice('uldl_speed_changed');\n\t\tthis.speedChangedTrigger.register();\n\t\tthis.internetConnectedTrigger = new Homey.FlowCardTriggerDevice('connection_start');\n\t\tthis.internetConnectedTrigger.register();\n\t\tthis.internetDisconnectedTrigger = new Homey.FlowCardTriggerDevice('connection_stop');\n\t\tthis.internetDisconnectedTrigger.register();\n\n\t\t// register action flow cards\n\t\tconst blockDevice = new Homey.FlowCardAction('block_device');\n\t\tblockDevice.register()\n\t\t\t.on('run', ( args, state, callback ) => {\n\t\t\t// console.log(args); //args.mac and args.device\n\t\t\t// console.log(state);\n\t\t\t\tthis._driver.blockOrAllow.call(this, args.mac, 'Block');\n\t\t\t\tcallback( null, true );\n\t\t\t});\n\n\t\tconst allowDevice = new Homey.FlowCardAction('allow_device');\n\t\tallowDevice.register()\n\t\t\t.on('run', ( args, state, callback ) => {\n\t\t\t// console.log(args);\n\t\t\t// console.log(state);\n\t\t\t\tthis._driver.blockOrAllow.call(this, args.mac, 'Allow');\n\t\t\t\tcallback( null, true );\n\t\t\t});\n\n\t\tconst reboot = new Homey.FlowCardAction('reboot');\n\t\treboot.register()\n\t\t\t.on('run', ( args, state, callback ) => {\n\t\t\t// console.log(args); //args.mac and args.device\n\t\t\t// console.log(state);\n\t\t\t\tthis._driver.reboot.call(this);\n\t\t\t\tcallback( null, true );\n\t\t\t});\n\n\t\t// start polling router for info\n\t\tthis.intervalIdDevicePoll = setInterval( () => {\n\t\t\ttry {\n\t\t\t\t// get new routerdata and update the state\n\t\t\t\tthis.updateRouterDeviceState();\n\t\t\t} catch (error) { this.log('intervalIdDevicePoll error', error); }\n\t\t}, 1000 * settings.polling_interval);\n\n\t}", "function startInit() {\n if (DEBUG) {\n console.log (\"(3) trial:\" + current_trial + \" repeats:\" + repeats + \" function: \" + \"startInit\");\n }\n\n reqwest ({\n url: \"/node/\" + my_node_id + \"/received_infos\",\n method: 'get',\n type: 'json',\n success: function (resp) {\n if (DEBUG) {\n console.log (\"---> (3) trial:\" + current_trial + \" repeats:\" + repeats + \" reqwest: \" + \"received_infos\");\n }\n\n TRUE_RATIO=Number(resp.infos[0].contents)\n if (IS_FEEDBACK) { // if practice randomize from scratch each time\n TRUE_RATIO=RANGE_MIN + Math.floor(Math.random()*(RANGE_MAX-RANGE_MIN + 1));\n }\n\n init();\n },\n error: function (err) {\n console.log(err);\n clearTimeout(err_time);\n err_time=setTimeout(function(){create_agent();},WAIT_TIME*2);\n }\n });\n}", "function init() {\n setupListeners();\n }", "_setupEvents () {\n\t\tvar self = this\n\n\t\tthis._logger.debug('Setting up Telnet communication events...')\n\n\t\tthis._connection.on('ready', function (prompt) {\n\t\t\tself._logger.debug(`Telnet connection ready!`)\n\n\t\t\tself._logger.info(`Obtaining version from MD-DM at ${self.host}...`)\n\n\t\t\tself._connection.exec('VERsion', function (err, response) {\n\t\t\t\tif (err)\n\t\t\t\t{\n\t\t\t\t\treturn self._logger.error(`Failed to get version from MD-DM: ${err}`)\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tself._logger.verbose(`VERsion response: ${response}`)\n\t\t\t\t\tself.device = TelnetOutputParser.parseVersion(response)\n\t\t\t\t\tself.device.connected = true\n\t\t\t\t\tself._logger.info(`Connected to ${self.device.name}, running ${self.device.firmware.version}.`)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\n\t\tthis._connection.on('close', function () {\n\t\t\tself._logger.warn('Telnet session closed.')\n\t\t\tself.device.connected = false\n\n\t\t\tif (self.started)\n\t\t\t{\n\t\t\t\tself._logger.info(`Reconnecting to ${self.host} in 5s.`)\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tself.start.call(self)\n\t\t\t\t}, 5000)\n\t\t\t}\n\t\t})\n\t}", "_setup() {\n this._controller.setup();\n }", "init() {\n const connections = getWithDefault(this, 'options.emberHifi.connections', emberArray());\n const owner = getOwner(this);\n\n owner.registerOptionsForType('ember-hifi@hifi-connection', { instantiate: false });\n owner.registerOptionsForType('hifi-connection', { instantiate: false });\n\n set(this, 'alwaysUseSingleAudioElement', getWithDefault(this, 'options.emberHifi.alwaysUseSingleAudioElement', false));\n set(this, 'appEnvironment', getWithDefault(this, 'options.environment', 'development'));\n set(this, '_connections', {});\n set(this, 'oneAtATime', OneAtATime.create());\n set(this, 'volume', 100);\n this._activateConnections(connections);\n\n this.set('isReady', true);\n\n // Polls the current sound for position. We wanted to make it easy/flexible\n // for connection authors, and since we only play one sound at a time, we don't\n // need other non-active sounds telling us position info\n this.get('poll').addPoll({\n interval: get(this, 'pollInterval') || 500,\n callback: bind(this, this._setCurrentPosition)\n });\n\n this._super(...arguments);\n }", "function _init() {\n log.init(LOG_PREFIX, 'Starting...');\n if (!_bluetooth) {\n log.error(LOG_PREFIX, 'Bluetooth not available.');\n return;\n }\n _bluetooth.on('discover', (peripheral) => {\n const flic = _flicButtons[peripheral.uuid];\n if (flic) {\n _sawFlic(flic, peripheral);\n }\n });\n }", "setup() {\n const trezorSendAction = this.actions.ada.trezorSend;\n trezorSendAction.sendUsingTrezor.listen(this._sendUsingTrezor);\n trezorSendAction.cancel.listen(this._cancel);\n }", "function initialize(err) {\n if (err) return raft.emit('error', err);\n\n raft.emit('initialize');\n raft.heartbeat(raft.timeout());\n }", "setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", reason => this.onClose(\"transport close\", reason));\n }", "_startUp()\n {\n // Check debug.\n if (RodanClientCore.config.DEBUG)\n {\n Radio.tuneIn('rodan');\n }\n\n this._initializeRadio();\n this._initializeControllers();\n this._initializeBehaviors();\n this._initializeDateTimeFormatter();\n this.addRegions({regionMaster: '#region-master'});\n this._initializeViews();\n require('./.plugins');\n }", "addTransport(transport) {\n\t\tthis.transports.push(transport);\n\n\t\t// Whenever a peer is connected send it to the topology\n\t\ttransport.on('connected', peer => this[topologySymbol].addPeer(peer));\n\n\t\tif(this.started) {\n\t\t\ttransport.start({\n\t\t\t\tid: this.id,\n\t\t\t\tname: this.name,\n\t\t\t\tendpoint: this.endpoint\n\t\t\t});\n\t\t}\n\t}", "static open(): Promise<TransportNodeHidSingleton> {\n return Promise.resolve().then(() => {\n if (transportInstance) {\n log(\"hid-verbose\", \"reusing opened transport instance\");\n return transportInstance;\n }\n\n const device = getDevices()[0];\n if (!device) throw new CantOpenDevice(\"no device found\");\n log(\"hid-verbose\", \"new HID transport\");\n transportInstance = new TransportNodeHidSingleton(\n new HID.HID(device.path)\n );\n const unlisten = listenDevices(\n () => {},\n () => {\n // assume any ledger disconnection concerns current transport\n if (transportInstance) {\n transportInstance.emit(\"disconnect\");\n }\n }\n );\n const onDisconnect = () => {\n if (!transportInstance) return;\n log(\"hid-verbose\", \"transport instance was disconnected\");\n transportInstance.off(\"disconnect\", onDisconnect);\n transportInstance = null;\n unlisten();\n };\n transportInstance.on(\"disconnect\", onDisconnect);\n\n return transportInstance;\n });\n }", "function initialize() {\n configureClientsGrid();\n getClientsForSetup();\n }", "function initialize() {\n configureClientsGrid();\n getClientsForSetup();\n }", "init() {\n module_utils.patchModule(\n 'mqtt',\n 'MqttClient',\n mqttClientWrapper,\n mqttModule => mqttModule\n );\n }", "setup() {\n\n // create the settings object\n var settings = {\n port: this.mqttPort,\n backend: {\n type: 'mongo',\n url: 'mongodb://localhost:' + this.mongodbPort + '/mqtt',\n pubsubCollection: this.mongoPersistanceName,\n mongo: {}\n },\n logger: {\n name: this.logName,\n level: this.logLevel,\n }\n };\n\n // create the instance\n this.mqttServer = new mqttBroker.Server(settings);\n\n var self = this;\n\n var moscaPersistenceDB = new mqttBroker.persistence.Mongo({\n url: 'mongodb://localhost:' + this.mongodbPort + '/moscaPersistence',\n ttl: {\n subscriptions: this.ttlSub,\n packets: this.ttlPacket\n }\n },\n function () {\n console.log('[HubManager] server persistence is ready on port ' + self.mongodbPort)\n }\n );\n moscaPersistenceDB.wire(this.mqttServer);\n this.mqttServer.on('ready', function(){\n // TODO fix this because it's ugly\n // but cheers Time Kadel (time.kadel@sfr.fr) <-- this guy is world class! grab him whilst you can\n self.__broker_setup(self)\n }); // engage the broker setup procedure\n }", "function setup () {\r\n\tIoEClient.setup({\r\n\t\ttype: \"Door\",\r\n\t\tstates: [{\r\n\t\t\tname: \"Open\",\r\n\t\t\ttype: \"bool\"\r\n\t\t}, {\r\n\t\t\tname: \"Lock\",\r\n\t\t\ttype: \"options\",\r\n\t\t\toptions: {\r\n\t\t\t\t\"0\": \"Unlock\",\r\n\t\t\t\t\"1\": \"Lock\"\r\n\t\t\t},\r\n\t\t\tcontrollable: true\r\n\t\t}]\r\n\t});\r\n\t\r\n\tIoEClient.onInputReceive = function (input) {\r\n\t\tprocessData(input, true);\r\n\t};\r\n\t\r\n\tattachInterrupt(0, function () {\r\n\t\tprocessData(customRead(0), false);\r\n\t});\r\n\t\r\n\tsetDoorState(doorState);\r\n\tsetLockState(lockState);\r\n}", "function init() {\n\t\t_startBridge(_bridgePort);\n\t}", "async init() {\n this.log = await Log({ label: 'devices' });\n this.ipc = require('electron').ipcMain;\n this.listen();\n }", "function start(){\n console.log('starting');\n board = new Board({\n debug: true,\n onError: function (err) {\n console.log('TEST ERROR');\n console.log(err);\n },\n onInit: function (res) {\n if (res) {\n console.log('GrovePi Version :: ' + board.version());\n if (testOptions.digitalButton) {\n //Digital Port 3\n // Button sensor\n buttonSensor = new DigitalButtonSensor(3);\n console.log('Digital Button Sensor (start watch)');\n buttonSensor.watch();\n }\n } else\n {\n console.log('TEST CANNOT START');\n }\n }\n })\n board.init();\n }", "onInit () {\n\n this.log('device init');\n this.log('name:', this.getName());\n this.log('class:', this.getClass());\n this.polleri = 0\n\n this.pollInterval = 60000 // 1 minute\n this.polling = false\n\n this.thermostattested = false\n this.thermostatset = false // 2 possibilizties not online not set correct\n this.thermostatconnected = true \n\n\n this.ip = ''\n this.port = ''\n this.thermostatusername = ''\n this.thermostatpassword = ''\n this.thermostattesting = true\n\n this.driver = this.getDriver().id\n this.log(`driver name`, this.driver)\n\n\n\n this.thermostatmethod = 'GET'\n\n // for nt10 averagge temp is temp1 local nt10\n this.thermostatTempCommand = 'OID4.1.13'\n\n // for nt20\n this.thermostatTempOneCommand = 'OID4.3.2.1'\n this.thermostatTempTwoCommand = 'OID4.3.2.2'\n this.thermostatTempThreeCommand = 'OID4.3.2.3'\n\n this.thermostatThermSetbackHeatCommand = 'OID4.1.5'\n this.thermostatThermHvacStateCommand = 'OID4.1.2'\n\n\n\n if (this.driver == 'nt10') {\n\n this.thermostatGetCommand = `/get?${this.thermostatTempCommand}\\\n=&${this.thermostatThermSetbackHeatCommand}\\\n=&${this.thermostatThermHvacStateCommand}=` // = path in req\n // this.registerCapabilityListener('measure_temperature', this.onCapabilityMeasure_temperature.bind(this))\n\n\n }\n\n else if (this.driver == 'nt20') {\n\n this.thermostatGetCommand = `/get?${this.thermostatTempOneCommand}\\\n=&${this.thermostatTempTwoCommand}\\\n=&${this.thermostatTempThreeCommand}\\\n=&${this.thermostatThermSetbackHeatCommand}\\\n=&${this.thermostatThermHvacStateCommand}=` // = path in req\n\n this.registerCapabilityListener('measure_temperature_one', this.onCapabilityMeasure_temperature_one.bind(this))\n this.registerCapabilityListener('measure_temperature_two', this.onCapabilityMeasure_temperature_two.bind(this))\n this.registerCapabilityListener('measure_temperature_three', this.onCapabilityMeasure_temperature_three.bind(this))\n\n\n }\n\n\n // register a capability listener\n \n this.registerCapabilityListener('target_temperature', this.onCapabilityTarget_temperature.bind(this))\n this.registerCapabilityListener('thermostat_mode', this.onCapabilityThermostat_mode.bind(this))\n\n\n\n\n this.settings = this.getSettings();\n\n this.ip = this.settings.ip\n this.port = this.settings.port\n this.thermostatusername = this.settings.user\n this.thermostatpassword = this.settings.password\n\n\n // this.log(`driver `, this.inspect(this.getDriver()))\n this.log(`driver clasname `, this.getDriver().constructor.name)\n this.log(`driver name`, this.getDriver().id)\n\n\n this.log(`settings `, this.settings)\n\n\n // check if thermostat is set\n if (!(this.ip == undefined) && !(this.port == undefined) && !(this.thermostatusername == undefined) && !(this.thermostatpassword == undefined)) {\n this.thermostatset = true;\n\n this.log('test if thermostat is set this.thermostatset = ', this.thermostatset);\n this.pollproliphix();\n } else {\n this.thermostatset = false;\n this.log('test if thermostat is set this.thermostatset = ', this.thermostatset);\n }\n\n \n\n\n // test thermostat \n if (!(this.ip == null) && !(this.port == null) && !(this.thermostatusername == null) && !(this.thermostatpassword == null)) {\n this.req(this.ip, this.port, this.thermostatGetCommand, this.thermostatmethod, this.thermostatusername, this.thermostatpassword);\n this.polleri += 1\n };\n\n \n\n\n\n\n\n\n\n // this.setSettings({\n // ip: \"newValue\",\n // // only provide keys for the settings you want to change\n // })\n // .then(this.log)\n // .catch(this.error)\n\n }", "start () {\n const instantiatedPacks = this.config.main.packs.map(Pack => new Pack(this))\n\n this.bindEvents()\n this.bindTrailpackListeners(instantiatedPacks)\n this.validateTrailpacks(instantiatedPacks)\n\n this.emit('trails:start')\n return this.after('trails:ready')\n }", "async init () {\n this.bridge = await this._getBridge()\n this.lamps = await this._getLamps()\n this.modules = await this._loadModules()\n }", "async onReady() {\n // Initialize your adapter here\n // Reset the connection indicator during startup\n this.setState('info.connection', false, true);\n if (!this.config.host) {\n this.log.error(`No host is configured, will not start anything!`);\n return;\n }\n await this.cleanupObjects();\n this.createWebSocket();\n if (this.config.luxPort) {\n await this.createLuxTreeAsync();\n this.createLuxtronikConnection(this.config.host, this.config.luxPort);\n }\n this.watchdogInterval = setInterval(() => this.handleWatchdog(), this.config.refreshInterval * 1000);\n }", "initPullUp(){\n\t\tthis.options.probeType = 3;\n\n\t\tthis.pullupWatching = false;\n\t\tthis.watchPullUp();\n\t}", "init()\r\n {\r\n var self = this;\r\n\r\n // set the template file for uri set method\r\n this.raumkernel.getSettings().uriMetaDataTemplateFile = \"node_modules/node-raumkernel/lib/setUriMetadata.template\";\r\n\r\n // set some other settings from the config/settings file\r\n // TODO: @@@\r\n //this.raumkernel.getSettings().\r\n\r\n // if there is no logger defined we do create a standard logger\r\n if(!this.parmLogger())\r\n this.createLogger(this.settings.loglevel, this.settings.logpath);\r\n\r\n this.logInfo(\"Welcome to raumserver v\" + PackageJSON.version +\" (raumkernel v\" + Raumkernel.PackageJSON.version + \")\");\r\n\r\n // log some information of the network interfaces for troubleshooting\r\n this.logNetworkInterfaces();\r\n\r\n // Do the init of the raumkernel. This will include starting for the raumfeld multiroom system and we\r\n // do hook up on some events so the raumserver knows the status of the multiroom system\r\n this.logVerbose(\"Setting up raumkernel\");\r\n this.raumkernel.parmLogger(this.parmLogger());\r\n // TODO: listen to events like hostOnline/hostOffline\r\n this.raumkernel.init();\r\n\r\n this.logVerbose(\"Starting HTTP server to receive requests\");\r\n this.startHTTPServer();\r\n\r\n this.logVerbose(\"Starting bonjour server for advertising\");\r\n // TODO: @@@\r\n }", "async onReady() {\n debug_1.default.enable('hap-controller:*');\n debug_1.default.log = this.log.debug.bind(this);\n if (this.config.discoverBle) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n GattClientConstructor = require('hap-controller').GattClient;\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n BLEDiscoveryConstructor = require('hap-controller').BLEDiscovery;\n }\n catch (err) {\n this.config.discoverBle = false;\n this.log.info(`Could not initialize Bluetooth LE, turn off. Error: ${err.message} `);\n }\n if (this.config.dataPollingIntervalBle < 60) {\n this.log.info(`Data polling interval for BLE devices is less then 60s, set to 60s`);\n this.config.dataPollingIntervalBle = 60;\n }\n }\n this.setConnected(false);\n if (this.config.discoverIp) {\n this.discoveryIp = new ip_discovery_1.default();\n this.discoveryIp.on('serviceUp', (service) => {\n this.log.debug(`Discovered IP device up: ${service.id}/${service.name}`);\n this.handleDeviceDiscovery('IP', service);\n });\n this.discoveryIp.on('serviceDown', (service) => {\n this.log.debug(`Discovered IP device down: ${service.id}/${service.name}`);\n });\n this.discoveryIp.on('serviceChanged', (service) => {\n this.log.debug(`Discovered IP device changed: ${service.id}/${service.name}`);\n this.handleDeviceDiscovery('IP', service);\n });\n this.discoveryIp.start();\n }\n if (this.config.discoverBle && BLEDiscoveryConstructor) {\n this.discoveryBle = new BLEDiscoveryConstructor();\n this.discoveryBle.on('serviceUp', (service) => {\n this.log.debug(`Discovered BLE device up: ${service.id}/${service.name}`);\n this.handleDeviceDiscovery('BLE', service);\n });\n this.discoveryBle.on('serviceChanged', (service) => {\n this.log.debug(`Discovered BLE device changed: ${service.id}/${service.name}`);\n this.handleDeviceDiscovery('BLE', service);\n });\n this.discoveryBle.start();\n }\n this.subscribeStates('*');\n try {\n const devices = await this.getKnownDevices();\n if (devices.length) {\n this.log.debug('Init ' + devices.length + ' known devices without discovery ...');\n for (const device of devices) {\n const hapDevice = {\n serviceType: device.native.serviceType,\n id: device.native.id,\n connected: false,\n service: device.native.lastService || undefined,\n pairingData: device.native.pairingData,\n initInProgress: false,\n };\n await this.initDevice(hapDevice);\n }\n }\n }\n catch (err) {\n this.log.error(`Could not initialize existing devices: ${err.message}`);\n }\n }", "async prepare() {\n universe.debuglog(DBGID, \"prepare\");\n universe.Identity.addListener('auth', async (identity) => {\n // get last used instance\n // select agent root for instance\n universe.debuglog(DBGID, \"prepare AUTH\");\n await this.requestSSISync();\n await this.initAgentInstance();\n await this.startServices();\n universe.debuglog(DBGID, \"prepare AUTH DONE\");\n });\n }", "start() {\n\t\tthis.registerListeners();\n\t}", "function init() {\n initMonitor();\n __players = [];\n __socket = initSocket();\n setEventHandlers();\n}", "start() {\n\t\t// Call service `started` handlers\n\t\tthis.services.forEach(service => {\n\t\t\tif (service && service.schema && isFunction(service.schema.started)) {\n\t\t\t\tservice.schema.started.call(service);\n\t\t\t}\n\t\t});\n\n\t\tif (this.options.metrics && this.options.metricsSendInterval > 0) {\n\t\t\tthis.metricsTimer = setInterval(() => {\n\t\t\t\t// Send event with node health info\n\t\t\t\tthis.getNodeHealthInfo().then(data => this.emit(\"metrics.node.health\", data));\n\n\t\t\t\t// Send event with node statistics\n\t\t\t\tif (this.statistics)\n\t\t\t\t\tthis.emit(\"metrics.node.stats\", this.statistics.snapshot());\n\t\t\t}, this.options.metricsSendInterval);\n\t\t\tthis.metricsTimer.unref();\n\t\t}\n\n\t\tthis.logger.info(\"Broker started.\");\n\n\t\tif (this.transit) {\n\t\t\treturn this.transit.connect().then(() => {\n\t\t\t\t\n\t\t\t\t// Start timers\n\t\t\t\tthis.heartBeatTimer = setInterval(() => {\n\t\t\t\t\t/* istanbul ignore next */\n\t\t\t\t\tthis.transit.sendHeartbeat();\n\t\t\t\t}, this.options.heartbeatInterval * 1000);\n\t\t\t\tthis.heartBeatTimer.unref();\n\n\t\t\t\tthis.checkNodesTimer = setInterval(() => {\n\t\t\t\t\t/* istanbul ignore next */\n\t\t\t\t\tthis.checkRemoteNodes();\n\t\t\t\t}, this.options.heartbeatTimeout * 1000);\n\t\t\t\tthis.checkNodesTimer.unref();\t\t\t\n\t\t\t});\n\t\t}\n\t\telse\n\t\t\treturn Promise.resolve();\n\t}", "function init() {\r\n\t\t\t// if there is an override stream, set it to the current stream so that it plays upon startup\r\n\t\t\tif (self.options.overrideStream) {\r\n\t\t\t\tsetCurrentStream(self.options.overrideStream);\r\n\t\t\t}\r\n\t\t\tif (self.options.config && self.options.config.length > 0) {\r\n\t\t\t\tloadConfiguration();\r\n\t\t\t} else {\r\n\t\t\t\tinitializePlayer();\r\n\t\t\t}\r\n\t\t}", "function initialize() {\n exports.tracer = new tracer_1.default();\n exports.span = new span_1.default();\n exports.spanContext = new span_context_1.default();\n}", "setup() {\n console.log('Mosca server is up and running');\n if (this.connectCallbackFn !== null) {\n this.connectCallbackFn();\n }\n }", "init() {\n // Make sure we've got an exchange client for the request handling.\n this.router.use(this.initialiseExchangeClient.bind(this));\n this.router.get('/', this.query);\n this.router.post('/', this.create);\n this.router.get('/:id', this.get);\n this.router.delete('/:id', this.delete);\n }", "init() {\n this.router.get(this.path, this.process);\n }", "setup () {\n this.thread = new Worker(resolve('./dashboardService.js'), { workerData: { beta: process.argv.includes('-b'), id: this.id } })\n\n this.thread.on('message', (msg) => {\n this.emit(msg.e, msg.d, msg.i)\n })\n\n this.thread.on('exit', (code) => {\n this.master.log(14, 10, `Cluster ${this.id}`, code)\n\n if (!this.dying) this.setup()\n })\n\n this.thread.on('error', (err) => {\n console.error(err)\n })\n\n if (this.master.spawned) this.spawn()\n }", "function init() {\n droneWebSocket(droneAddress);\n tracker = initTracker(\"#example\");\n tracking.track(\"#example .drone\", tracker);\n}", "function init(){\n transport = nodemailer.createTransport({\n host: \"smtp.gmail.com\",\n port: 465,\n secure: true,\n auth:{ // extract this\n user: \"edu.side.projects@gmail.com\",\n pass: process.env.GMAIL_PASSWORD\n }\n })\n console.log(\"Notification Service started\")\n}", "begin() {\n this.pc = new RTCPeerConnection(this.pcConfig, {\n optional: [\n {\n DtlsSrtpKeyAgreement: true\n },\n ]\n });\n this.pc.onicecandidate = (evt) => {\n // Browser sends a null candidate once the ICE gathering completes.\n if (null === evt.candidate && this.pc.connectionState !== 'closed') {\n // TODO: Use a promise.all to tell Snowflake about all offers at once,\n // once multiple proxypairs are supported.\n dbg('Finished gathering ICE candidates.');\n snowflake.broker.sendAnswer(this.id, this.pc.localDescription);\n }\n };\n // OnDataChannel triggered remotely from the client when connection succeeds.\n return this.pc.ondatachannel = (dc) => {\n var channel;\n channel = dc.channel;\n dbg('Data Channel established...');\n this.prepareDataChannel(channel);\n return this.client = channel;\n };\n }", "start() {\n this._setInitialState();\n\n if (!this._loadAndCheckSession()) {\n return;\n }\n\n // If there is no session, then something bad has happened - can't continue\n if (!this.session) {\n this._handleException(new Error('No session found'));\n return;\n }\n\n if (!this.session.sampled) {\n // If session was not sampled, then we do not initialize the integration at all.\n return;\n }\n\n // If session is sampled for errors, then we need to set the recordingMode\n // to 'error', which will configure recording with different options.\n if (this.session.sampled === 'error') {\n this.recordingMode = 'error';\n }\n\n // setup() is generally called on page load or manually - in both cases we\n // should treat it as an activity\n this._updateSessionActivity();\n\n this.eventBuffer = createEventBuffer({\n useCompression: this._options.useCompression,\n });\n\n this._addListeners();\n\n // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout\n this._isEnabled = true;\n\n this.startRecording();\n }", "transportReset(){\n this.transportState = 'stop'; //others: 'play'\n this.beatClick.nextPerfBeat = 0;\n console.log('Transport stopped and reset');\n //reset/re-init some framework stuff to clear lists\n // of MX and VX objects (and whatever else)\n this.VXmanager.reset(); //Do this one FIRST so standalone VX's can be re-inited\n this.translator.reset();\n this.notePlayer.resetTransport();\n }", "start() {\n Backend.init();\n Sessions.init();\n }", "function init () {\n log.info('Hyperion Remote starting...')\n createSSDPHandler()\n createWebsocketHandler()\n createWindow()\n}", "async function init() {\n try {\n await broker.start();\n const response = await broker.call('hello.sayHello')\n log(`Service Response ${response}`)\n }\n catch (e) {\n log(e);\n }\n}", "async connect() {\n this._mav = await this._getMavlinkInstance();\n this._socket = await this._getSocket();\n this._registerMessageListener();\n this._registerSocketListener();\n }", "start() {\n this.logger.log(\"user requested startup...\");\n if (this.status === _UAStatus.STATUS_INIT) {\n this.status = _UAStatus.STATUS_STARTING;\n this.setTransportListeners();\n return this.transport.connect();\n }\n else if (this.status === _UAStatus.STATUS_USER_CLOSED) {\n this.logger.log(\"resuming\");\n this.status = _UAStatus.STATUS_READY;\n return this.transport.connect();\n }\n else if (this.status === _UAStatus.STATUS_STARTING) {\n this.logger.log(\"UA is in STARTING status, not opening new connection\");\n }\n else if (this.status === _UAStatus.STATUS_READY) {\n this.logger.log(\"UA is in READY status, not resuming\");\n }\n else {\n this.logger.error(\"Connection is down. Auto-Recovery system is trying to connect\");\n }\n if (this.options.autoStop) {\n // Google Chrome Packaged Apps don't allow 'unload' listeners: unload is not available in packaged apps\n const googleChromePackagedApp = typeof chrome !== \"undefined\" && chrome.app && chrome.app.runtime ? true : false;\n if (typeof window !== \"undefined\" &&\n typeof window.addEventListener === \"function\" &&\n !googleChromePackagedApp) {\n window.addEventListener(\"unload\", this.unloadListener);\n }\n }\n return Promise.resolve();\n }", "init() {\n super.init();\n\n // noinspection JSUnusedGlobalSymbols\n this.interval = setInterval(function() {\n console.error('tick');\n }, 5000);\n\n // Tell the unit test that we are alive\n process.send('Reporting for duty');\n }", "function setup() {\n var dat = new Dat(common.dat1tmp, { serve: false }, function ready(err) {\n t.notOk(err, 'no open err')\n dat.backend('leveldown-hyper', function(err) {\n t.notOk(err, 'backend should not err')\n dat.close(function(err) {\n t.notOk(err, 'no close err')\n clone()\n })\n })\n })\n }", "function start() {\n\t\t// reset the controller in case any key is currently pressed\n\t\tcontroller.resetKeys()\n\t\t// manually establish a connection, connect the controller and load a state\n\t\tsocket.connect();\n\t}", "function postSetup () {\n // cleanup the listeners we attached in setup phrase.\n socket.emit('cleanupSetupListeners');\n\n // Work around lack of close event on tls.socket in node < 0.11\n ((socket.socket) ? socket.socket : socket).once('close',\n self._onClose.bind(self))\n socket.on('end', function onEnd () {\n log.trace('end event')\n\n self.emit('end')\n socket.end()\n })\n socket.on('error', function onSocketError (err) {\n log.trace({ err: err }, 'error event: %s', new Error().stack)\n\n self.emit('error', err)\n socket.destroy()\n })\n socket.on('timeout', function onTimeout () {\n log.trace('timeout event')\n\n self.emit('socketTimeout')\n socket.end()\n })\n\n const server = self.urls[self._nextServer]\n if (server) {\n self.host = server.hostname\n self.port = server.port\n self.secure = server.secure\n }\n }", "function setup() {\n // server.authenticate = authenticate;\n // server.authorizePublish = authorizePublish;\n // server.authorizeSubscribe = authorizeSubscribe;\n log.info('Mosca server is up and running on '+env.mhost+':'+env.mport+' for mqtt and '+env.mhost+':'+env.hport+' for websocket');\n\n}", "async function init() {\n // Configure plug-ins.\n await server.register([\n require('vision'),\n require('inert'),\n require('lout')\n ]);\n\n await server.register(require('blipp'));\n\n // Configure logging.\n await server.register({\n plugin: require('hapi-pino'),\n options: {\n prettyPrint: true\n }\n });\n\n // Start the server.\n await server.start();\n console.log(`Server running at ${server.info.uri}`);\n}", "start() {\n this._.on('request', this.onRequest.bind(this));\n this._.on('error', this.onError.bind(this));\n this._.on('listening', this.onListening.bind(this));\n\n this._.listen(this.config.port);\n }", "async initialize () {\n try {\n // Starts the validation of all engines on the broker. We do not await this\n // function because we want the validations to run in the background as it\n // can take time for the engines to be ready\n const enginesAreValidated = this.validateEngines()\n\n // Since these are potentially long-running operations, we run them in parallel to speed\n // up BrokerDaemon startup time.\n await Promise.all([\n this.initializeMarkets(this.marketNames),\n this.initializeBlockOrder(enginesAreValidated)\n ])\n\n this.rpcServer.listen(this.rpcAddress)\n this.logger.info(`BrokerDaemon RPC server started: gRPC Server listening on ${this.rpcAddress}`)\n\n this.interchainRouter.listen(this.interchainRouterAddress)\n this.logger.info(`Interchain Router server started: gRPC Server listening on ${this.interchainRouterAddress}`)\n } catch (e) {\n this.logger.error('BrokerDaemon failed to initialize', { error: e.stack })\n this.logger.error(e.toString(), e)\n this.logger.info('BrokerDaemon shutting down...')\n process.exit(1)\n }\n }", "startRouting() {\n var router = get(this, 'router');\n router.startRouting(isResolverModuleBased(this));\n this._didSetupRouter = true;\n }", "init() {\n this.socket.emit('init', 'ooga');\n }", "start() {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n }", "function setupClient (cb) {\n cb = once(cb)\n\n // Indicate failure if anything goes awry during setup\n function bail (err) {\n socket.destroy()\n cb(err || new Error('client error during setup'))\n }\n // Work around lack of close event on tls.socket in node < 0.11\n ((socket.socket) ? socket.socket : socket).once('close', bail)\n socket.once('error', bail)\n socket.once('end', bail)\n socket.once('timeout', bail)\n socket.once('cleanupSetupListeners', function onCleanup () {\n socket.removeListener('error', bail)\n .removeListener('close', bail)\n .removeListener('end', bail)\n .removeListener('timeout', bail)\n })\n\n self._socket = socket\n self._tracker = tracker\n\n // Run any requested setup (such as automatically performing a bind) on\n // socket before signalling successful connection.\n // This setup needs to bypass the request queue since all other activity is\n // blocked until the connection is considered fully established post-setup.\n // Only allow bind/search/starttls for now.\n const basicClient = {\n bind: function bindBypass (name, credentials, controls, callback) {\n return self.bind(name, credentials, controls, callback, true)\n },\n search: function searchBypass (base, options, controls, callback) {\n return self.search(base, options, controls, callback, true)\n },\n starttls: function starttlsBypass (options, controls, callback) {\n return self.starttls(options, controls, callback, true)\n },\n unbind: self.unbind.bind(self)\n }\n vasync.forEachPipeline({\n func: function (f, callback) {\n f(basicClient, callback)\n },\n inputs: self.listeners('setup')\n }, function (err, _res) {\n if (err) {\n self.emit('setupError', err)\n }\n cb(err)\n })\n }", "function checkAndStart() {\n console.error(isStarted);\n console.error(localStream);\n console.error(isChannelReady);\n if (!isStarted && typeof localStream != 'undefined' && isChannelReady) { \n\tcreatePeerConnection();\n isStarted = true;\n if (isInitiator) {\n doCall();\n }\n }\n}", "start () {\n // Sets up the events\n this._setupEvents()\n // Sets up setup\n if (this.setup) this.setup()\n // Loop!\n if (!this.loop) logger.warn('Looks like you need to define a loop')\n this._setupLoop()\n }", "constructor(id, name, send_signal, wrtc) {\n super()\n\n this.id = id\n this.name = name\n this.self = (send_signal == undefined)\n this.send_signal = send_signal\n this.queue = []\n\n this.on('connect', () => {\n if (this.connected()) {\n while (this.queue.length > 0) {\n this.send(this.queue.shift())\n }\n }\n })\n\n // we're in electron/browser\n if (typeof window != 'undefined') {\n this.wrtc = {\n RTCPeerConnection: RTCPeerConnection,\n RTCIceCandidate: RTCIceCandidate,\n RTCSessionDescription: RTCSessionDescription\n }\n }\n // byowebrtc <- this is for node and could undoubtedly be better handled\n else if (wrtc) {\n this.wrtc = wrtc\n }\n else {\n console.log(\"wrtc\", wrtc)\n throw new Error(\"wrtc needs to be set in headless mode\")\n }\n \n this.WebRTCConfig = {\n 'iceServers': [\n {url:'stun:stun.l.google.com:19302'},\n {url:'stun:stun1.l.google.com:19302'},\n {url:'stun:stun2.l.google.com:19302'},\n {url:'stun:stun3.l.google.com:19302'},\n {url:'stun:stun4.l.google.com:19302'}\n ]\n }\n\n // I'm not sure this should be here, but we call it literally\n // every time we instantiate a Peer(), so let's leave it here for now\n if(!this.self) this.initializePeerConnection()\n }", "__broker_setup() {\n this.mqttServer.authenticate = this.__broker_auth;\n this.mqttServer.authorizePublish = this.__broker_allow_pub;\n this.mqttServer.authorizeSubscribe = this.__broker_allow_sub;\n this.mqttServer.on('clientConnected', this.__broker_connected);\n this.mqttServer.on('published', this.__broker_published);\n this.mqttServer.on('subscribed', this.__broker_subscribed);\n this.mqttServer.on('unsubscribed', this.__broker_unsubscribed); \n this.mqttServer.on('clientDisconnecting', this.__broker_disconnecting);\n this.mqttServer.on('clientDisconnected', this.__broker_disconnected);\n if (this.readyCallback != null) {\n this.readyCallback(); // indicates that we are ready\n }\n console.log('[MQTT] Mosca server is up and running on port ' + this.mqttPort);\n }", "function initClient() {\n\tclient = new enet.Host(new enet.Address('localhost', 0), 128, 1, 256000, 256000, \"client\");\n\tclient.start(17); //17ms intervals\n\tclient.enableCompression(); //YES!! YES!!! COMPRESSION!!\n\tconsole.log(\"ENet client initialized.\");\n}", "function initiateConnection() {\n localPeer = new Peer();\n localPeer.remoteHandshake = sendHandshakeToRemote;\n\n // Data channels\n localPeer.useDataChannel = true;\n localPeer.dataChannel.outbound_onOpen = outboundChannelStatusChange;\n localPeer.dataChannel.outbound_onClose = outboundChannelStatusChange;\n localPeer.dataChannel.inbound_onMessage = messageFromRemote;\n\n // Initialize for a new connection, including generating an offer\n localPeer.InitializeConnection();\n}", "start() {\n if (!this.stopped && !this.stopping) {\n this.channel.on('close', () => {\n if (this.forcelyStop || (!this.pausing && !this.paused)) {\n if (!this.trapped)\n this.emit('done');\n this.emit('close');\n }\n this.stopped = false;\n });\n this.channel.on('stream', (packet) => {\n if (this.debounceSendingEmptyData)\n this.debounceSendingEmptyData.run();\n this.onStream(packet);\n });\n this.channel.once('trap', this.onTrap.bind(this));\n this.channel.once('done', this.onDone.bind(this));\n this.channel.write(this.params.slice(), true, false);\n this.emit('started');\n if (this.shouldDebounceEmptyData)\n this.prepareDebounceEmptyData();\n }\n }", "start() {\n\t\tif(this.started) return Promise.resolve(false);\n\n\t\tdebug('About to join network as ' + this.id);\n\n\t\tconst options = {\n\t\t\tid: this.id,\n\t\t\tname: this.name,\n\t\t\tendpoint: this.endpoint\n\t\t};\n\n\t\tthis.started = true;\n\t\treturn Promise.all(\n\t\t\tthis.transports.map(t => t.start(options))\n\t\t).then(() => {\n\t\t\treturn true;\n\t\t}).catch(err => {\n\t\t\tthis.started = false;\n\t\t\tthrow err;\n\t\t})\n\t}", "constructor() {\n this.controller = new Controller();\n this.receiver = new Receiver();\n this.enabled = false;\n this.initialized = false;\n }", "function init() {\n createRoomBtn.addEventListener(\"click\", createRoom);\n joinRoomBtn.addEventListener(\"click\", joinRoom);\n pc = new RTCPeerConnection(rtcconfig);\n\n initDataChannel();\n }", "function init() {\n // Creating views\n trackBank = host.createMainTrackBank (1, 0, 0), host.createCursorTrack (\"AIIOM_CTRL\", \"Cursor Track\", 0, 0, true);\n cursorTrack = host.createArrangerCursorTrack(1, 1); // Track cursor\n trackBank.followCursorTrack(cursorTrack); // Sync cursor track of view and script\n\n host.getMidiInPort(0).setMidiCallback(onMidi); // Configuring MIDI device\n\n // Initializing controller sections\n midiListeners = [\n initTransport(),\n initTrack(),\n initDevice(),\n initNote(),\n initNavigation(),\n initLoopback()\n ];\n}" ]
[ "0.62547445", "0.6221821", "0.61335695", "0.61335695", "0.6115516", "0.59811634", "0.579289", "0.5669699", "0.5632312", "0.5584776", "0.55815303", "0.55815303", "0.55589825", "0.55224377", "0.5513868", "0.5512871", "0.5506423", "0.54871136", "0.54670316", "0.5455401", "0.544395", "0.54401237", "0.53557783", "0.53525245", "0.534865", "0.5344063", "0.5334806", "0.5314131", "0.5293188", "0.5288517", "0.5273093", "0.5260057", "0.5256309", "0.52448845", "0.5238505", "0.5237324", "0.52307", "0.5226964", "0.5214534", "0.52126855", "0.5208859", "0.5199014", "0.51932555", "0.5174953", "0.5174953", "0.51736295", "0.5173021", "0.51586777", "0.5156293", "0.5146966", "0.514215", "0.51300335", "0.51290184", "0.51273245", "0.51129836", "0.51117706", "0.5090254", "0.50717294", "0.5067375", "0.50604373", "0.5055944", "0.5052907", "0.5051383", "0.5049552", "0.5046509", "0.5043088", "0.50391805", "0.5026618", "0.5026388", "0.5016832", "0.50162274", "0.5008307", "0.50062186", "0.5002809", "0.4999051", "0.49943298", "0.49882695", "0.4986027", "0.49858814", "0.49851155", "0.49813494", "0.4971567", "0.49714687", "0.49619734", "0.49544594", "0.4954242", "0.49535716", "0.49496055", "0.49399528", "0.49391004", "0.49353176", "0.4933462", "0.4930494", "0.49304554", "0.49288896", "0.49288443", "0.49272394", "0.4907094", "0.4906874", "0.49054277", "0.49045247" ]
0.0
-1
Sets the current transport. Disables the existing one (if any).
setTransport(transport) { debug("setting transport %s", transport.name); if (this.transport) { debug("clearing existing transport %s", this.transport.name); this.transport.removeAllListeners(); } // set up transport this.transport = transport; // set up transport listeners transport.on("drain", this.onDrain.bind(this)).on("packet", this.onPacket.bind(this)).on("error", this.onError.bind(this)).on("close", () => { this.onClose("transport close"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setTransport(transport) {\n debug$3(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug$3(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on(\"drain\", function() {\n self.onDrain();\n })\n .on(\"packet\", function(packet) {\n self.onPacket(packet);\n })\n .on(\"error\", function(e) {\n self.onError(e);\n })\n .on(\"close\", function() {\n self.onClose(\"transport close\");\n });\n }", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on(\"drain\", function() {\n self.onDrain();\n })\n .on(\"packet\", function(packet) {\n self.onPacket(packet);\n })\n .on(\"error\", function(e) {\n self.onError(e);\n })\n .on(\"close\", function() {\n self.onClose(\"transport close\");\n });\n }", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on(\"drain\", function() {\n self.onDrain();\n })\n .on(\"packet\", function(packet) {\n self.onPacket(packet);\n })\n .on(\"error\", function(e) {\n self.onError(e);\n })\n .on(\"close\", function() {\n self.onClose(\"transport close\");\n });\n }", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", () => {\n this.onClose(\"transport close\");\n });\n }", "setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", reason => this.onClose(\"transport close\", reason));\n }", "transportReset(){\n this.transportState = 'stop'; //others: 'play'\n this.beatClick.nextPerfBeat = 0;\n console.log('Transport stopped and reset');\n //reset/re-init some framework stuff to clear lists\n // of MX and VX objects (and whatever else)\n this.VXmanager.reset(); //Do this one FIRST so standalone VX's can be re-inited\n this.translator.reset();\n this.notePlayer.resetTransport();\n }", "disableHTTP() {\n this.enableHTTP = false;\n }", "disable () {\n this.enabled= false;\n }", "disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();\n }", "resetTransport(){\n //For loading loops on-the-fly, see below\n this.nextLoopStartBeat = 0;\n this.newLoopState();\n }", "function disable() {\n instance.state.isEnabled = false;\n }", "function disable() {\n instance.state.isEnabled = false;\n }", "disable() {\n this.active = false;\n }", "function defaultTransportFactory() {\n if (!selected) {\n selected = detectTransport();\n }\n return selected;\n}", "disable() {\n\t\tthis.toggle(false);\n\t}", "disable() {\n if (!this.isEnabled) return\n this.isEnabled = false\n }", "async disable() {\n return await new Promise((resolve, reject) => {\n this.dbg.sendCommand('Network.disable', {}, (error, result) => {\n this.assertError(error, 'Network.disable');\n resolve();\n });\n });\n }", "function disable() {\n enabled = false;\n }", "disable() {\n this.disabled = true;\n }", "function stopAll() {\n if (Tone.State == 'started') {\n Tone.Transport.stop();\n console.log(\"stop transport\");\n } else {\n Tone.Transport.stop();\n console.log(\"start transport\");\n Tone.Transport.start();\n }\n}", "disable() { }", "disable() {\n this._disabled = true;\n this._animation.stop();\n this.emit('clear');\n }", "disable() {\n this.disabled = true;\n }", "disable() {\n this.disabled = true;\n }", "disable() {\n this.disabled = true;\n }", "disable () {\n this._disabled = true\n return this\n }", "function changeTransport(mode){\n\t//\tTransportMode is a new global variable which sets what is the current mode shown on the select\n\tTransportMode = mode;\n\t//showDirection needs 2 values, the end position and the transport mode.\n\t//currentMarker is another new global variable which is defined by the marker you are currently clicked on\n\t//When the page loads current marker becomes the closest marker because that is the one we have coded to show us the direction to by default\n\t//When you click on a new marker, that marker becomes the currnet marker\n\tshowDirection(currentMarker.position, TransportMode);\n}", "disable() {\n super.disable();\n }", "deactivated() {\n if (this._TPInstance) {\n this._disableDOMObserver()\n this._TPInstance.hide()\n }\n }", "function setDisabled(target, disabled){\n var opts = $.data(target, 'spinner').options;\n if (disabled){\n opts.disabled = true;\n $(target).prop('disabled', true);\n } else {\n opts.disabled = false;\n $(target).prop('disabled', false);\n }\n }", "disable() {\n BluetoothSerial.disable()\n .then(res => this.setState({ isEnabled: false }))\n .catch(err => {\n Toast.showShortBottom(err.message);\n BackHandler.exitApp();\n });\n }", "function closed () {\n delete self.transports[transportName]\n callback()\n }", "disable () {\n BluetoothSerial.disable()\n .then((res) => this.setState({ isEnabled: false }))\n .catch((err) => console.log(err.message))\n }", "disable () {\n this.disabled = true\n }", "disable () {\n BluetoothSerial.disable()\n .then((res) => this.setState({ isEnabled: false }))\n .catch((err) => Toast.showLongBottom(err))\n }", "disable() {\n this._readonly = true;\n }", "disable() {\n tooling.unsubscribe( onChange );\n }", "disable() {\n this._getContextManager().disable();\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }", "enable() {\n this.disabled = false;\n }", "enable() {\n this.disabled = false;\n }", "enable() {\n this.disabled = false;\n }", "function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n\n freezeTransport();\n }\n }", "function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n freezeTransport();\n }\n }", "function __setDisabled() {\n setDisabled.apply(this, arguments);\n }", "stopConnecting()\n {\n this.connecting = false;\n }", "disableVuex() {\n\t // VUEX IS ENABLED BY DEFAULT\n\t this.VUEX_STORE = false;\n\t this.vuex_module = null;\n\t }", "disable() {\n this.world.disableEntity(this);\n }", "disable () {\n this.$disabled = true;\n }", "_stopTrackingTask() {\n // Disable timeout on control socket if there is no task active.\n this.socket.setTimeout(0);\n this._task = undefined;\n }", "_stopTrackingTask() {\n // Disable timeout on control socket if there is no task active.\n this.enableControlTimeout(false);\n this._task = undefined;\n this._handler = undefined;\n }", "removeGlobalLogTransport(globalTransport) {\n jitsi_meet_logger__WEBPACK_IMPORTED_MODULE_21___default.a.removeGlobalTransport(globalTransport);\n }", "disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }", "disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }", "disablePCE() {\n this.setPCEState(false);\n }", "disable () {\n this.hook.disable()\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade(to){\n if (transport && to.name != transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function deactivate() {\n Socket.unsyncUpdates('gpio');\n }", "enable() {\n this._readonly = false;\n }", "function Transports() {\n this._repository = {};\n}", "function Transports() {\n this._repository = {};\n}", "onDisable() {}", "deactivateRadio(){\n this.cellularRadio = false;\n console.log(\"Device ID:\"+this.deviceId+\", Radio deactivated.\");\n }", "static async disconnect() {\n if (transportInstance) {\n transportInstance.device.close();\n transportInstance.emit(\"disconnect\");\n transportInstance = null;\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }", "function onupgrade (to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n }" ]
[ "0.67459184", "0.6706888", "0.6706888", "0.6572428", "0.64738613", "0.6465157", "0.5838586", "0.56495196", "0.5562277", "0.5529616", "0.5461857", "0.5448869", "0.5448636", "0.5423519", "0.540358", "0.53743124", "0.5348146", "0.53134495", "0.5308269", "0.52647144", "0.52348036", "0.52129346", "0.520814", "0.520814", "0.520814", "0.52058846", "0.5202918", "0.51926136", "0.518013", "0.51739055", "0.51667887", "0.51600784", "0.51518196", "0.5146405", "0.513849", "0.5125244", "0.509791", "0.50957716", "0.5053891", "0.5053891", "0.5053891", "0.50146395", "0.500957", "0.49690473", "0.49566615", "0.49539414", "0.4952474", "0.49376318", "0.4928808", "0.4874244", "0.4868637", "0.48471582", "0.48471582", "0.48272043", "0.4826256", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.48245287", "0.4824", "0.48199823", "0.4816652", "0.4816652", "0.48103887", "0.48054358", "0.4802074", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458", "0.47978458" ]
0.682649
0
Called when connection is deemed open.
onOpen() { debug("socket open"); this.readyState = "open"; Socket.priorWebsocketSuccess = "websocket" === this.transport.name; this.emit("open"); this.flush(); // we check for `readyState` in case an `open` // listener already closed the socket if ("open" === this.readyState && this.opts.upgrade && this.transport.pause) { debug("starting upgrade probes"); let i = 0; const l = this.upgrades.length; for (; i < l; i++) { this.probe(this.upgrades[i]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connect () {\n if (this._readyState === this.READY_STATE.CLOSING) {\n this._nextReadyState = this.READY_STATE.OPEN\n return\n }\n\n this._nextReadyState = null\n if (this._readyState === this.READY_STATE.CLOSED) {\n this._doOpen()\n }\n }", "onOpen() {\n this.readyState = \"open\";\n Socket$1.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "function ready() {\n conn.on('close', function() {\n status.textContent = 'Connection closed';\n status.className = classNames.warning;\n conn = null;\n });\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "doOpen() {\n this.poll();\n }", "function onOpen(){\n console.log('Open connections!');\n}", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "function handleOpen() {\n $log.info('Web socket open - ', url);\n vs && vs.hide();\n\n if (fs.debugOn('txrx')) {\n $log.debug('Sending ' + pendingEvents.length + ' pending event(s)...');\n }\n pendingEvents.forEach(function (ev) {\n _send(ev);\n });\n pendingEvents = [];\n\n connectRetries = 0;\n wsUp = true;\n informListeners(host, url);\n }", "function onOpen() {\n\t\tconsole.log('Client socket: Connected');\n\t\tcastEvent('onOpen', event);\n\t}", "onOpen() {\n debug$3(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug$3(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "function onOpen( e ) {\n\t\t\t_reconnectCounter = 0;\n\t\t\t_scope.dispatchEvent( WS.ON_OPEN );\n\t\t}", "connected() {\n // implement if needed\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "connectedCallback() {\n if (!this.isConnected) return;\n super.connectedCallback();\n \n }", "_onOpen() {\n this.state.connected = true;\n console.log(\"Connected...\");\n this.notify(\"open\");\n }", "$onopen(e) {\n this.state.connected = true;\n if ( typeof this.onopen === 'function' ) {\n this.onopen(e);\n }\n }", "function webSocket_onopen()\n\t{\n\t\tlogger_.log(\"webSocket_onopen\", \"WebSocket Verbindung geoeffnet\");\n\t\treadValueList();\n\t\tstatusChange();\n\t}", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onClose() {\n if (!this.dead) this.client.setTimeout(this.connect.bind(this), this.attempts * 1000);\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onSocketFullyConnected() {\n this.debugOut('socketFullyConnected()');\n this.last_socket_error = null;\n this.emit('open');\n }", "onOpen() {\n\t\t}", "function onopen() {\n this._logger.info('Connection created.');\n\n this._debuggerObj.setEngineMode(this._debuggerObj.ENGINE_MODE.RUN);\n\n if (this._surface.getPanelProperty('chart.active')) {\n this._surface.toggleButton(true, 'chart-record-button');\n }\n\n if (this._surface.getPanelProperty('run.active')) {\n this._surface.updateRunPanel(this._surface.RUN_UPDATE_TYPE.ALL, this._debuggerObj, this._session);\n }\n\n if (this._surface.getPanelProperty('watch.active')) {\n this._surface.updateWatchPanelButtons(this._debuggerObj);\n }\n\n this._surface.disableActionButtons(false);\n this._surface.toggleButton(false, 'connect-to-button');\n}", "function onOpen(evt) {\n\t\tconnected = true;\n\t\t$('.connectionState').text(\"Connected\");\n\t\t$('.connectionState').addClass('connected');\n\t}", "_open() {\n if (!this._afterOpened.closed) {\n this._afterOpened.next();\n this._afterOpened.complete();\n }\n }", "_emitConnectionStateChange() {\n if (this._closed && this.connectionState !== 'closed') {\n return;\n }\n\n logger.debug(\n 'emitting \"connectionstatechange\", connectionState:',\n this.connectionState);\n\n const event = new yaeti.Event('connectionstatechange');\n\n this.dispatchEvent(event);\n }", "onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this.readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"data\", component_bind_1.default(this, \"ondata\")));\n this.subs.push(on_1.on(socket, \"ping\", component_bind_1.default(this, \"onping\")));\n this.subs.push(on_1.on(socket, \"error\", component_bind_1.default(this, \"onerror\")));\n this.subs.push(on_1.on(socket, \"close\", component_bind_1.default(this, \"onclose\")));\n this.subs.push(on_1.on(this.decoder, \"decoded\", component_bind_1.default(this, \"ondecoded\")));\n }", "_onClose() {\n this._socket = null;\n this._osk = null;\n this._connectedAt = 0;\n }", "function ws_onopen() {\n self._machine.transition('open');\n }", "function ws_onopen() {\n self._machine.transition('open');\n }", "function ws_onopen() {\n self._machine.transition('open');\n }", "function ws_onopen() {\n self._machine.transition('open');\n }", "function onOpenClose() {\n\t if (typeof this.fd === 'number') {\n\t // actually close down the fd\n\t this.close()\n\t }\n\t}", "onClosed() {\r\n // Stub\r\n }", "resume () {\n\t if (this.readyState !== WebSocket.OPEN) throw new Error('not opened');\n\n\t this._socket.resume();\n\t }", "resume () {\n\t if (this.readyState !== WebSocket.OPEN) throw new Error('not opened');\n\n\t this._socket.resume();\n\t }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n }", "function onopen() {\n\tconsole.log ('connection open!');\n\t//connection.send('echo\\r\\n'); // Send the message 'Ping' to the server\n}", "function connectionEstablished() {\n log.info('Connected to OpenTSDB.');\n\n opentsdb = socket;\n\n // Handle errors on this connection\n opentsdb.addListener('error', function(err) {\n log.error('OpenTSDB network error: ' + err);\n opentsdb.destroy();\n opentsdb = undefined; // Cause a reconnection\n });\n opentsdb.removeListener('error', connectionError);\n\n // Allow this socket to be destroyed\n opentsdb.unref();\n\n callback(null, socket);\n }", "onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data: this.auth });\n }\n }", "onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data: this.auth });\n }\n }", "connect() {\n let _this = this;\n\n _this._continuousOpen = true;\n _this._open(() => {});\n }", "function webSocket_onopen()\n\t{\n\t\tstatusChange();\n\t\tconsole.log(\"[ASNeG_Client] WebSocket Verbindung geoeffnet\");\n\t\treadValueList();\n\t}", "onopen() {\n debug(\"open\"); // clear old subs\n\n this.cleanup(); // mark as open\n\n this._readyState = \"open\";\n this.emitReserved(\"open\"); // add new subs\n\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "get connected () {\n return (this._connected && this._channel.readyState === 'open')\n }", "get connected () {\n return (this._connected && this._channel.readyState === 'open')\n }", "get connected () {\n return (this._connected && this._channel.readyState === 'open')\n }", "get connected () {\n return (this._connected && this._channel.readyState === 'open')\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(\"State\", { qos: Number(1) });\r\n client.subscribe(\"Content\", { qos: Number(1) });\r\n\r\n }", "resume() {\n if (this.readyState !== WebSocket.OPEN) throw new Error('not opened');\n this._socket.resume();\n }", "onConnectionStateChanged(isConnected) {\n this.subscriptions.onConnectionStateChanged(isConnected);\n }", "resume () {\n if (this.readyState !== WebSocket.OPEN) throw new Error('not opened');\n\n this._socket.resume();\n }", "function handleOpen() {\n setOpen(true);\n }", "onclose(reason) {\n debug(\"onclose\");\n this.cleanup();\n this.backoff.reset();\n this._readyState = \"closed\";\n super.emit(\"close\", reason);\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n }", "_onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }", "_onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }", "_onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }", "onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: dist.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: dist.PacketType.CONNECT, data: this.auth });\n }\n }", "resume () {\n if (this.readyState !== WebSocket$1.OPEN) throw new Error('not opened');\n\n this._socket.resume();\n }", "get opened() { return this._opened; }", "get opened() { return this._opened; }", "get opened() { return this._opened; }", "onclose(reason) {\n debug(\"onclose\");\n this.cleanup();\n this.backoff.reset();\n this.readyState = \"closed\";\n super.emit(\"close\", reason);\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n }", "_onClose(event) {\n this.state.connected = false;\n console.log(\"Disconnected...\");\n this.notify(\"closed\");\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "onclose(reason) {\n debug(\"onclose\");\n this.cleanup();\n this.backoff.reset();\n this._readyState = \"closed\";\n super.emit(\"close\", reason);\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n }", "function connected( connection ) {\n}", "_onClosed() {\n this.emit(\"closed\");\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_js_1.on(socket, \"ping\", this.onping.bind(this)), on_js_1.on(socket, \"data\", this.ondata.bind(this)), on_js_1.on(socket, \"error\", this.onerror.bind(this)), on_js_1.on(socket, \"close\", this.onclose.bind(this)), on_js_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "function peerjsOpenHandler(){\n if (_this.debug)\n console.log(\"Server started\", _this._serverPeer.id);\n\n // Reset peers\n _this._connections = {};\n \n // Trigger\n _this._triggerSystemEvent(\"$open\", {serverId: _this._serverPeer.id});\n }", "function handleOpen() {\n setOpen(true)\n }", "connectedCallback() {\n\t\t// super.connectedCallback()\n\t}", "disconnected() {\n // implement if needed\n }", "onClose() {\n this.reset();\n if (this.closed_by_user === false) {\n this.host.reportDisconnection();\n this.run();\n } else {\n this.emit('close');\n }\n }", "onConnected() {\n this.status = STATUS_CONNECTED;\n }", "onConnected() {\n if(!this.connected) {\n this.logger.debug(this.TAG, this.logMsgs.CONNECTED);\n }\n this.connected = true;\n }", "function _onConnectionOpened(duplexChannelEventArgs)\r\n {\r\n try\r\n {\r\n // Tell message bus which service shall be associated with this connection.\r\n var aMessage = new MessageBusMessage();\r\n aMessage.Request = 20;\r\n aMessage.Id = myChannelId;\r\n var aSerializedMessage = mySerializer.serialize(aMessage);\r\n myMessageBusOutputChannel.sendMessage(aSerializedMessage);\r\n }\r\n catch (err)\r\n {\r\n logError(myTracedObject + \"failed to open connection with message bus.\", err);\r\n throw err;\r\n }\r\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "onOpen() { }", "get isOpened() {\n return this._isOpened;\n }", "clientConnected() {\n super.clientConnected('connected', this.wasConnected);\n\n this.state = 'connected';\n this.wasConnected = true;\n this.stopRetryingToConnect = false;\n }", "function HandleOpen() {\n console.log('WebSocket open');\n SetState(IconBuilding, 'Connected');\n}", "onopen() {\n debug(\"transport is open - connecting\");\n\n if (typeof this.auth == \"function\") {\n this.auth(data => {\n this.packet({\n type: socket_io_parser_1.PacketType.CONNECT,\n data\n });\n });\n } else {\n this.packet({\n type: socket_io_parser_1.PacketType.CONNECT,\n data: this.auth\n });\n }\n }", "onConnection(delegate) {\n this.connected = delegate\n }", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}" ]
[ "0.66600823", "0.66312057", "0.656462", "0.65445435", "0.6495058", "0.6492395", "0.6488508", "0.6488508", "0.64872915", "0.6442891", "0.63960105", "0.63951576", "0.63951576", "0.6377987", "0.6375862", "0.6371359", "0.6371359", "0.6371359", "0.6341471", "0.6336445", "0.631182", "0.63050944", "0.63015854", "0.6289894", "0.62707275", "0.6262945", "0.62447864", "0.6244143", "0.62100637", "0.61323506", "0.6122211", "0.6119298", "0.6100092", "0.6098251", "0.6094953", "0.6094953", "0.60779655", "0.60779655", "0.605636", "0.60228604", "0.60061574", "0.60061574", "0.6005272", "0.6002772", "0.59937", "0.59712136", "0.59712136", "0.5958148", "0.5948774", "0.5937007", "0.59353596", "0.59353596", "0.59353596", "0.59353596", "0.5921003", "0.5915122", "0.5914606", "0.5905597", "0.5892603", "0.5892499", "0.5887048", "0.5887048", "0.5887048", "0.58762115", "0.58728206", "0.587138", "0.587138", "0.587138", "0.58711886", "0.585712", "0.58560747", "0.58560747", "0.58560747", "0.5852902", "0.58523756", "0.58413714", "0.58327556", "0.5819342", "0.5808165", "0.5808135", "0.5798849", "0.5794858", "0.57923084", "0.5789187", "0.5785936", "0.5766384", "0.57640785", "0.57640785", "0.57640785", "0.57640785", "0.57640785", "0.5763296", "0.57527643", "0.57401705", "0.57325464", "0.57310855", "0.57295924", "0.5726989", "0.5726989", "0.5726989" ]
0.6305185
21
Sets and resets ping timeout timer based on server pings.
resetPingTimeout() { clearTimeout(this.pingTimeoutTimer); this.pingTimeoutTimer = setTimeout(() => { this.onClose("ping timeout"); }, this.pingInterval + this.pingTimeout); if (this.opts.autoUnref) { this.pingTimeoutTimer.unref(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetPingTimeout() {\n clearTimeout(this.pingTimeoutTimer);\n this.pingTimeoutTimer = setTimeout(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n }", "resetPingTimeout() {\n clearTimeout(this.pingTimeoutTimer);\n this.pingTimeoutTimer = setTimeout(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n }", "resetPingTimeout() {\n clearTimeout(this.pingTimeoutTimer);\n this.pingTimeoutTimer = setTimeout(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n }", "resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }", "resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }", "function resetTimeout () {\n if (timeoutWarning !== undefined) {\n clearTimeout(timeoutWarning);\n }\n timeoutWarning = setTimeout(function () {\n noty.update('warning',\n 'The server has not sent updates in the last ' +\n SECONDS + ' seconds.');\n }, 1000 * SECONDS);\n }", "function setupTimeoutTimer() {\n updateTimeoutInfo(undefined);\n }", "schedule_heartbeat() {\n\t\tclearTimeout(this.heartbeat_timer);\n\t\tif (this.heartbeat_period > 0) {\n\t\t\tthis.heartbeat_timer = setTimeout(() => this.ws.ping(), this.heartbeat_period);\n\t\t}\n\t}", "function reset_timeout() {\n\n // Get rid of old timeouts (if any)\n window.clearTimeout(receive_timeout);\n window.clearTimeout(unstableTimeout);\n\n // Clear unstable status\n if (tunnel.state === Guacamole.Tunnel.State.UNSTABLE)\n tunnel.setState(Guacamole.Tunnel.State.OPEN);\n\n // Set new timeout for tracking overall connection timeout\n receive_timeout = window.setTimeout(function () {\n close_tunnel(new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_TIMEOUT, \"Server timeout.\"));\n }, tunnel.receiveTimeout);\n\n // Set new timeout for tracking suspected connection instability\n unstableTimeout = window.setTimeout(function() {\n tunnel.setState(Guacamole.Tunnel.State.UNSTABLE);\n }, tunnel.unstableThreshold);\n\n }", "function reset_timeout() {\n\n // Get rid of old timeouts (if any)\n window.clearTimeout(receive_timeout);\n window.clearTimeout(unstableTimeout);\n\n // Clear unstable status\n if (tunnel.state === Guacamole.Tunnel.State.UNSTABLE)\n tunnel.setState(Guacamole.Tunnel.State.OPEN);\n\n // Set new timeout for tracking overall connection timeout\n receive_timeout = window.setTimeout(function () {\n close_tunnel(new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_TIMEOUT, \"Server timeout.\"));\n }, tunnel.receiveTimeout);\n\n // Set new timeout for tracking suspected connection instability\n unstableTimeout = window.setTimeout(function() {\n tunnel.setState(Guacamole.Tunnel.State.UNSTABLE);\n }, tunnel.unstableThreshold);\n\n }", "function testPing() {\n\t\tlet start = Date.now(),\n\t\t\tdiff;\n\n\t\tmakeRequest(\"GET\",`${config.host_url}test_ping`,true,false,false,\"json\",function (status,response) {\n\t\t\tif (status >= 200 && status < 400) {\n\t\t\t\tdiff = response.time - start;\n\t\t\t\tif (diff > 0 && (diff < pingMinimal || pingMinimal == 0)) {\n\t\t\t\t\tpingMinimal = diff;\n\t\t\t\t}\n\t\t\t\tpingAttempts--;\n\t\t\t\tif(pingAttempts > 0) {\n\t\t\t\t\ttestPing();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function pingCheck() {\n if (timer) { clearTimeout(timer);}\n var pong = new Date() - start;\n if (typeof callback === \"function\") {\n callback(pong);\n }\n }", "function checkResetTimeout(scope, request, response) {\n var url = response.url,\n queryParamIndex = url.indexOf(\"?\");\n\n // Remove query params from the URL\n if (queryParamIndex > 0) {\n url = url.substring(0, queryParamIndex);\n }\n\n if (!SailPoint.isPollingUrl(url)) {\n SailPoint.resetTimeout();\n }\n}", "function reset_timeout() {\n\n // Get rid of old timeout (if any)\n window.clearTimeout(receive_timeout);\n\n // Set new timeout\n receive_timeout = window.setTimeout(function () {\n close_tunnel(new Status(Status.Code.UPSTREAM_TIMEOUT, \"Server timeout.\"));\n }, tunnel.receiveTimeout);\n\n }", "_handlePingMessage () {\n window.clearTimeout(this._pingTimeout)\n\n if (this.isConnected()) {\n this._pingTimeout = window.setTimeout(() => {\n this.emit(PeerSoxClient.EVENT_PEER_TIMEOUT)\n this._rtc.close()\n this._socket.close()\n }, this._peerTimeout * 1000)\n }\n }", "constructor(timeout_in_secs) {\n this.initial_timeout_in_secs = timeout_in_secs\n this.reset()\n }", "function _clearPingPong() {\n if (_interval) {\n clearInterval(_interval);\n _interval = null;\n }\n }", "function startPing()\n{\n var heartbeat = 90;\n heartbeatTimerId = window.setInterval(opPing, heartbeat*1000);\n}", "refreshPulseTimeout() {\n if (this._pulseTimeout) {\n clearTimeout(this._pulseTimeout);\n if (this.sub === null) return;\n this._pulseTimeout = setTimeout(() => {\n debug('broadcast timeout');\n this.isLeader = false;\n try {\n this.emit('timeout');\n }\n catch(err) {\n this.emit('error', err);\n }\n }, this.broadcastTimeoutMs);\n }\n }", "resetTimeout(){\n\t\t\n\t\tif(this.timeoutTime){\n\n\t\t\tclearTimeout(this.timeoutTime);\n\n\t\t\tthis.timeoutTime = setTimeout(() => this.gameLoop(), this.tick);\n\n\n\t\t}\n\n\t}", "function resetTimeout() {\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n reset();\n }, options.timeout);\n }", "function ping(){var value=+new Date;primus.timers.clear(\"ping\");primus._write(\"primus::ping::\"+value);primus.emit(\"outgoing::ping\",value);primus.timers.setTimeout(\"pong\",pong,primus.options.pong)}", "set timeout(milliseconds) {\n this._timeout = milliseconds;\n }", "function _resetTimeout() {\n $timeout.cancel(vm.promiseTimeoutInit);\n vm.promiseTimeoutInit = $timeout(function() {\n $rootScope.flags.isProcessing = false;\n }, C_CONFIG_COMMON.system.tansitionTime);\n }", "function checkAlive() {\n for(var i = 0; i < pingSet.length; i++) {\n var ip = pingSet[i];\n setTimeout(pingHost(ip), 1000);\n }\n}", "function resetTimeout() {\n if (timeoutTimer) {\n clearTimeout(timeoutTimer);\n }\n timeoutTimer = setTimeout(() => {\n callIFTTT(\"notify\", TEMP_SENSOR_MESSAGE);\n }, ARDUINO_TIMEOUT);\n}", "function setUpdateTimer(ms){\n\tif(timer != null)\n\t\tclearTimeout(timer);\n\ttimer = setInterval(function() {\n\t\tcheckQueryUpdate();\n\t},ms);\n}", "constructor(timeout) {\n this.initialTimeout = timeout\n this.reset()\n }", "function reset(){\n setTimeout(get_count,checkInterval)\n }", "function updateTimeout() {\n\ttimeout /= 1.043;\n}", "_heartbeatTimeoutFired() {\n this._heartbeatTimeoutHandle = null;\n\n this._onTimeout();\n }", "function ping(ipAddressText, endpoint, totalSeconds, timeDisplay) {\n const xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n const response = this.responseText;\n console.log(response);\n repeatPing = setTimeout(function() {\n ping(ipAddressText, endpoint, totalSeconds, timeDisplay);\n }, 5000);\n if (response == \"true\") {\n changeColor(endpoint, \"#A5CA93\");\n resetClock(totalSeconds, timeDisplay);\n startClock(totalSeconds, timeDisplay);\n } else {\n changeColor(endpoint, \"#f44e4e\");\n resetClock(totalSeconds, timeDisplay);\n startClock(totalSeconds, timeDisplay);\n }\n }\n };\n xhttp.open(\"POST\", \"http://localhost:8080\", true);\n xhttp.send(ipAddressText);\n }", "function setTime(time) {\n timeout = time;\n}", "function stopPing()\n{\n /* halt loop */\n if(ping_loop) \n {\n\tclearInterval(ping_loop);\n\tping_loop = null;\n }\n \n /* send stop ajax request */\n if(ping_id) \n {\n\t/* put status ping in correct way */\n\tshowStatusPing('#ping_status_stopping');\n\t\n\tsendRequest('/maintenance/tests',\n\t\t ajaxCbStopPing,\n\t\t {'action' : 'ping', 'run' : 'stop', 'id' : ping_id});\n }\n}", "set timeout(milliseconds) {\n this._timeout = milliseconds;\n }", "set timeout(milliseconds) {\n this._timeout = milliseconds;\n }", "function setCheckTimer() {\n\t\tcheckTimer = setTimeout(\"$.fn.messengerStatus.getStatus()\", settings.checkInterval);\n\t}", "function ping(websiteState) {\n websiteState.pingLoop = setTimeout(() => fetchCurrentlyPlaying(websiteState),\n websiteState.api.pingDelay);\n}", "static reset() {\n updateTimeouts.forEach(clearTimeout);\n updateTimeouts = [];\n improvedTimestampsInitted = false;\n improvedTimestamps = [];\n }", "function updateTimeout()\n {\n clearTimeout(timeout);\n timeout = setTimeout(function()\n {\n self.refresh();\n// }, 30*1000)\n }, 60 * 60 * 1000);\n }", "setStartupTimer() {\n let self = this;\n //+ coerces the result to a number, making typescript happy.\n this.startupTimer = +setTimeout(() => {\n self.emit(\"timeout\");\n }, STARTUP_TIMEOUT_DURATION);\n }", "function setServerTimer(delay) {\n stopServerTimer();\n servertimer = setTimeout(\"getState()\", delay);\n}", "function startRefreshTimer() {\n // Stop the current timer\n stopRefreshTimer();\n\n // Determine the refresh delay, based on the connection state\n var connectionTimeout = GUESSES_REFRESH_TIMEOUT_CONNECTED;\n\n // Use a connection timer of 5 seconds if the last connection failed\n if(!lastRefreshState)\n connectionTimeout = GUESSES_REFRESH_TIMEOUT_DISCONNECTED;\n\n // Set up the timer\n guessesRefreshTimer = setInterval(function() {\n refreshGuessesLate();\n }, connectionTimeout);\n }", "function pingUpdate()\n{\n\t// Reset variables\n\tjoomlaupdate_stat_files = 0;\n\tjoomlaupdate_stat_inbytes = 0;\n\tjoomlaupdate_stat_outbytes = 0;\n\n\t// Do AJAX post\n\tvar post = {task : 'ping'};\n\tdoAjax(post, function(data){\n\t\tstartUpdate(data);\n\t});\n}", "startPollTimeout() {\n if (this.pollingTimeout) {\n clearTimeout(this.pollingTimeout);\n }\n\n this.pollingTimeout = setTimeout(() => {\n this.pollingTimeout = null;\n this.checkDOMDependencies();\n this.startPollTimeout();\n }, pollingInterval);\n }", "unscheduleChecks()\n {\n if (this._timeout)\n {\n clearTimeout(this._timeout); // eslint-disable-line no-undef\n this._timeout = 0;\n }\n }", "reset() {\n this.timer = 5000;\n this.interval = 0;\n }", "_heartbeatIntervalFired() {\n // don't send ping if we've seen a packet since we last checked,\n // *or* if we have already sent a ping and are awaiting a timeout.\n // That shouldn't happen, but it's possible if\n // `this.heartbeatInterval` is smaller than\n // `this.heartbeatTimeout`.\n if (!this._seenPacket && !this._heartbeatTimeoutHandle) {\n this._sendPing(); // Set up timeout, in case a pong doesn't arrive in time.\n\n this._startHeartbeatTimeoutTimer();\n }\n\n this._seenPacket = false;\n }", "ontimeout() {}", "resetTimer_() {\n clearTimeout(this.timer);\n this.timer = 0;\n }", "function updateTimeoutInfo(dropdown) {\n const interval = (dropdown && dropdown.hasClass('open')) ?\n queryTimeoutInfoInterval : queryTimeoutInfoNoDisplayInterval;\n const now = Date.now();\n if (now - lastUpdateTimeoutTime > interval) {\n util.debug.log('Querying timeout');\n const timeoutInfoUrl = util.datalabLink(\"/_timeout\");\n function callback() {\n util.debug.log('_timeout call response:');\n util.debug.log(this);\n lastUpdateTimeoutTime = Date.now();\n const result = this.response; // 'this' is the XHR\n timeoutInfo = JSON.parse(result) || {};\n timeoutInfo.expirationTime = Date.now() + timeoutInfo.secondsRemaining * 1000;\n _updateTimeoutDisplay(dropdown);\n _setUpdateTimeoutInfoTimeout(dropdown);\n }\n function errorHandler() {\n util.debug.log('xhr error response:');\n util.debug.log(this);\n const status = this.status; // 'this' is the XHR\n util.debug.log('status=' + status);\n if (status == 0) { // We get 0 when we lost our connection to the server.\n _alertIfTimedOutAndDisable();\n }\n }\n const xhrOptions = {\n errorCallback: errorHandler\n };\n util.xhr(timeoutInfoUrl, callback, xhrOptions);\n } else {\n // Too soon to query, just run the clock locally.\n _updateTimeoutDisplay(dropdown);\n _setUpdateTimeoutInfoTimeout(dropdown);\n }\n }", "resetIdleTimeout(socket) {\n if (socket.idleTimeout) clearTimeout(socket.idleTimeout);\n if (this.options.timeoutInterval > 0) {\n socket.idleTimeout = setTimeout(() => {\n this.onPlayerTimeout(socket);\n }, this.options.timeoutInterval * 1000);\n }\n }", "reset() {\n this.timer = 500;\n this.interval = 0;\n }", "function checkServerTimeout()\n{\n\t// Checking server performance\n\tvar receivedDataDelay = (Date.now() - lastPacketReceived) / 1000.0;\n\tif (receivedDataDelay > lagReloadDelay) \n\t{\n\t\tconsole.log(\"things might be a little slow: \" + receivedDataDelay);\n\t\tpostWarningMessage(\"red\", \"things might be a little slow: \" + receivedDataDelay);\n\t\tlastPacketReceived = Date.now() + (lagReloadRetry*1000); // add 10 sec before running this reconnect/reset again\n\t\t\n\t\t//reconnectToServerNode();\n\t\t\n\t\t//location.reload(false);\n\t\t//loadNewGameSessionData();\n\t\t//console.log(\"RELOADED PAGE\");\n\t\t\n\t\tif (reloadOnServerTimeout) {\n\t\t\twindow.location=\"http://sandbox-dane.rhcloud.com/games/voidpirates?autostart=1\";\n\t\t}\n\t}\n}", "function setTimeout(timeout) {\n options.requestTimeout = Number(timeout);\n instance.defaults.timeout = options.requestTimeout;\n }", "setupTimer() {\n this.stopTimer();\n const secs = parseInt( this._options.interval );\n if ( !secs ) return;\n this._interval = setInterval( () => {\n if ( !this._options.enabled ) return;\n this.fetchNextHandler();\n }, 1000 * secs );\n }", "function resetTimers() {\n startTime = new Date;\n startTime.setHours(0);\n startTime.setMinutes(0);\n startTime.setSeconds(0);\n startTime.setMilliseconds(0);\n \n stopTime = new Date;\n stopTime.setHours(config.timer.hour);\n stopTime.setMinutes(config.timer.minute);\n stopTime.setSeconds(0);\n stopTime.setMilliseconds(0);\n }", "startTimer() {\n this.element.dispatchEvent(\n new CustomEvent(\"pingpong.time\", {\n bubbles: true,\n composed: true,\n detail: this.formatAMPM(this.getDateOffset())\n })\n );\n\n // if greater than 10 mins || 600 seconds show latency\n if (this.isDelayed && lastDataRecieved !== \"\") {\n this.element.dispatchEvent(\n new CustomEvent(\"pingpong.latency\", {\n bubbles: true,\n composed: true,\n detail: {\n show: true,\n time: this.formatAMPM(this.lastDataRecieved)\n }\n })\n );\n } else {\n this.element.dispatchEvent(\n new CustomEvent(\"pingpong.latency\", {\n bubbles: true,\n composed: true,\n detail: {\n show: false,\n time: null\n }\n })\n );\n }\n\n setTimeout(this.startTimer.bind(this), 1000);\n }", "function Ping(data){\n //urls used for constant monitoring\n this.website = data.url;\n //uptime count before sending uptime message\n this.upTime = data.upTime;\n this.downTime = 10;\n //counter for when to send up time or down time messages\n this.upTimeCounter = 0;\n this.downTimeCounter = 0;\n //total time running monitor\n this.runningCounter = 0;\n //delay between ping website checks\n this.delay = data.delay;\n //number of repititions before ending monitor service\n this.repetitions = data.reps;\n //handle holds interval ID to allow it to be cleared\n this.handle = null;\n //method used by ping\n this.method = 'GET';\n \n}", "stopInterval() {\n if (this.intervalId) {\n window.clearInterval(this.intervalId);\n this.intervalId = null;\n this.failedPings = 0;\n logger.info('Ping interval cleared');\n }\n }", "function resetTimer()\n{\n\twindow.clearTimeout(timeoutID);\n\ttimeoutID = setTimeout(user_idle, delay);\n\t\n}", "function resetTimer() {\n clearInterval(liveTimer);\n }", "resetDisconnectionTimeout() {\n\t\tif (this.mAutoDisconnectAfter <= 0) {return;}\n\t\tif (this.mAutoDisconnectionTimeoutHandler) {clearTimeout(this.mAutoDisconnectionTimeoutHandler)}\n\t\tthis.mAutoDisconnectionTimeoutHandler = setTimeout(() => {\n\t\t\tif (this.mWS.readyState === WebSocket.OPEN) {this.mWS.close(1000);}\n\t\t}, this.mAutoDisconnectAfter);\n\t}", "function ping() {\n // console.log('ping');\n b.digitalWrite(trigger, 0);\n startTime = process.hrtime();\n}", "function ping() {\n // console.log('ping');\n b.digitalWrite(trigger, 0);\n startTime = process.hrtime();\n}", "ping(){\n\t\tLogger.debug(`Message with ping request being responded to by pong...`);\n\t\tthis.send('pong', Global.mac);\n\t}", "function resetTimeout(fn,ms) {\n\t\t\t\tif (timer) {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t}\n\t\t\t\tsetTimeout(fn,ms);\n\t\t\t}", "function handleInitUpdateTimeout(timerId) {\n\t\n\t// although the respnses themselves will clear the timeout that leads to \n // this function running, we are careful to check here, and if either of \n // the two systems has displayed content, we bail out.\n\tif ($(\"#updateCheckerContainer\").hasClass(\"updatesActive\") || $(\"#tipsCheckerContainer\").hasClass(\"tipsActive\") || $(\"#freeUpdateCheckerContainer\").hasClass(\"updatesActive\")) {\n\t\t return false;\n\t\t\n\t} else {\n\t\tD.debug(\"The request to splunk.com is taking so long that we assume we cannot connect.\");\n\n\t\tif (getLicenseType() == \"free\" && !CONFIG.hasErrorMessage) {\n\t\t\tdisplayFallbackTipsContent();\n\t\t\t$(\"#freeMessageContainer\").html(_(\"<a href='/' class='splButton-primary connectErrorContinue'><span>Continue &raquo;</span></a>\")).show();\n\t\t} else {\t\t\t\t\n D.debug(\"handleInitUpdateTimeout - license not free or there is error\");\n\t\t\tdisplayBannerFrame('connectError');\n\t\t}\n\t}\n}", "function updateTimeouts() {\n const timeouts = getSortedTimeouts();\n if (timeouts.length == 0) {\n printTimeouts(discordClient, timeoutChannelId);\n return;\n }\n let i = 0;\n // Mitigate a race condition with the cron job. The cron job throws an error\n // if the wake time is in the past, so remove people one minute early and hope\n // the cron gets started before the next closest time passes.\n const now = util.addMinutes(new Date(), 1);\n while (i < timeouts.length && timeouts[i].timeout < now) {\n removeUser(timeouts[i]);\n i++;\n }\n\n if (i < timeouts.length) {\n setCronTimeout(timeouts[i].timeout);\n } else {\n console.log('No more timeouts, not starting cron job');\n }\n\n printTimeouts(discordClient, timeoutChannelId);\n}", "resetTimer() {\n this.timeSelected = 0;\n this.completeElapsed = 0;\n this.complete = false;\n }", "function reset() {\n clearInterval(interval);\n able_start_button();\n able_stop_button();\n $.post(\n '/server/index.php',\n { action : 'timer_reset' }\n );\n sedonds = 0;\n ss.html('00');\n mm.html('00');\n hh.html('00');\n }", "reset () {\n if (this._timeoutID) {\n window.clearTimeout(this._timeoutID);\n this._timeoutID = null;\n }\n }", "function timeReset() {\n setTimeout(resetAll, 2000);\n}", "function doPingTest() {\n\tvar el = this;\n\tvar id = el.id.split(\"_\");\t// Id should be in the form inp_pingdst2\n\tif (id.length !== 2) return;\n\tid = id[1];\t// pingdst2\n\n\t// get peripheral elements\n\tvar waitIcon=$(\"#\" + id + \"_wait\");\n\tvar pingResult=$(\"#\" + id + \"_stat\");\n\n\tel.value = el.value.trim(); // trim white spaces from copy and paste\n\tvar server = el.value;\n\t// bypass if no server is available\n\tif(server.length==0) {\n\t\t// hide pinging icon\n\t\twaitIcon.hide();\n\t\tpingResult.hide();\n\t\treturn;\n\t}\n\n\t// bypass if we have no change in the server\n\tif(el.server === server) return;\n\tel.server = server;\n\n\tif (el.pinging === true) return;\t// do nothing if already pinging\n\n\t// don't ping if IP or domain name is invalid\n\tif (!(isValidIpAddress(server) || is_valid_domain_name(server) || isValidIpv6Address(server))) {\n\t\tpingResult.html(_(\"fail\"));\n\t\tpingResult.show();\n\t\treturn ;\n\t}\n\n\tel.pinging = true;\n\twaitIcon.show();\n\tpingResult.hide();\n\n\t$.getJSON( \"./cgi-bin/ltph.cgi\",\n\t\t{reqtype :\"ping\", reqparam: server},\n\t\tfunction(res){\n\t\t\tel.pinging = false;\n\t\t\twaitIcon.hide();\n\t\t\tpingResult.html((res.cgiresult == 0)? _(\"succ\"): _(\"fail\"));\n\t\t\tpingResult.show();\n\t\t\tif(el.server !== el.value) {\t// trigger keyup if we have a new server\n\t\t\t\t$(el).trigger(\"keyup\");\n\t\t\t}\n\t\t}\n\t);\n}", "function resetTimer() {\n\t//Counter for how many \"active\" citizens. Resets once every day, or when\n\t//the bot restarts\n\ttagcounter = 0;\n\t//Neat little counter used for making the bot only post once when it reaches\n\t//enough active citizens\n\tcooldown = 0;\n}", "run() {\n\n\t\tif (this.sequence.number == this.settings.sequences) {\n\n\t\t\t//If we reached the maximum amount of icmp_echo_request stop the interval\n\t\t\tthis.stop()\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t//Create the ping message\n\t\tlet ping = {\n\n\t\t\tservice : 'ping',\n\t\t\tdata : {\n\t\t\t\ttype: 'ping-request',\n\t\t\t\tsequence : this.sequence.number,\n\t\t\t\ttimestamp : new Date()\n\t\t\t}\n\n\t\t}\n\n\t\tthis.sendData(this.host, ping)\n\n\t\t//!!!Remember to increment the sequence number\n\t\tthis.sequence.number++;\n\n\t}", "function resetTimer(id) {\n\tdebug(\"resetTimer(\" + id + \")\");\n\tclearTimeout(timers[id]);\n\ttimers[id] = setTimeout(function() {\n\t\tsendGoodbye(id);\n\t}, TIMEOUT_DURATION);\n}", "function ajaxCbInitPing(response) \n{\n /* get init ajax packet */\n var status_val = getResponseAttrElement(response, 'status', 'val');\n var status_text = getResponseAttrElement(response, 'status', 'text');\n\n if(status_val != \"living\") \n {\n\tendPing(status_text);\n } \n else\n {\n\tping_id = getResponseElement(response, 'id');\n\t\n\t/* put stop button active */\n\t$('#button_ping').attr('disabled', false);\n\t$('#button_ping_launch').css('display', 'none');\n\t$('#button_ping_stop').css('display', '');\n\t$('#div_submit_ping').attr('class', 'button_submit');\n\t\n\t/* change status msg */\n\tshowStatusPing('#ping_status_custom');\n\t$('#ping_status_custom').text(status_text);\n\t\n\tping_loop = setInterval(\"sendRequest('/maintenance/tests', ajaxCbUpdatePing, {'action' : 'ping', 'run' : 'status', 'id' : '\" + ping_id + \"'})\", 1700);\n }\n}", "function StatusTimer() {\n\tvar self = this;\n\tself.timer = undefined;\n\n\tself.setInterval = function(logic) {\n\t\tclearInterval(self.timer);\n\t\tself.timer = setInterval(function() {\n\t\t\tconsole.log(PROCESS_NAME + ' updating status....' + moment().format());\n\t\t\tlogic();\n\t\t}, process.env.INTERVAL_TIME || 5000);\n\t};\n\n\tself.clearInterval = function() {\n\t\tclearInterval(self.timer);\n\t};\n}", "stopInterval() {\n if (this.intervalId) {\n window.clearInterval(this.intervalId);\n this.intervalId = null;\n this.failedPings = 0;\n logger.info('Ping interval cleared');\n }\n }", "stopInterval() {\n if (this.intervalId) {\n window.clearInterval(this.intervalId);\n this.intervalId = null;\n this.failedPings = 0;\n logger.info('Ping interval cleared');\n }\n }", "function YCellular_set_pingInterval(newval)\n { var rest_val;\n rest_val = String(newval);\n return this._setAttr('pingInterval',rest_val);\n }", "function setZeroTimeout(fn) {\n timeouts.push(fn);\n window.postMessage(messageName, \"*\");\n }", "function resetTimer () {\n timerRunning = false;\n clearInterval(clockInterval);\n clearInterval(wpmInterval);\n}", "setTimeout(ms) {\n if (!this._commandTimeoutTimer) {\n this._commandTimeoutTimer = setTimeout(() => {\n if (!this.isResolved) {\n this.reject(new Error(\"Command timed out\"));\n }\n }, ms);\n }\n }", "function startPing()\n{\n /* init vars */\n ping_id = null;\n ping_loop = null;\n ping_ip = null;\n \n /* get ip for the ping */\n ping_ip = $('#ping_dest_hostname').val();\n\n /* disable form */\n $('#ping_dest_hostname').attr('disabled', true);\n $('#button_ping').attr('disabled', true);\n $('#div_submit_ping').attr('class', 'button_submit_disabled');\n \n /* put status ping in correct way */\n $('#ping_status > span').attr('class', 'loading');\n $('#ping_status > b').text(ping_ip);\n showStatusPing('#ping_status_starting');\n \n /* init counters */\n $('#ping_sent').text('0');\n $('#ping_recv').text('0');\n $('#ping_avgrtt').text('0');\n \n /* send first ajax request */\n sendRequest('/maintenance/tests',\n\t\tajaxCbInitPing,\n\t\t{'action' : 'ping', 'run' : 'start', 'ping_dest_hostname' : ping_ip});\n}", "sendPing(){\n if(!this.isAlive()){\n this.emit('noPong');\n if(this.state === CONST.STATE.CONNECTED){\n this.state = CONST.STATE.NOT_CONNECTED;\n }\n return;\n }\n this.setHalfDead();\n this.ping();\n }", "onTimeout() {}", "function addTimeoutServiceToXhr(settings, xhr) {\r\n xhr.ontimeout = setTimeout(function () {\r\n timeoutHandler(settings, xhr);\r\n }, settings.timeout);\r\n }", "static timeout(t) {\n if ( !(typeof t === 'undefined' ))\n _timeout = t;\n else\n return _timeout;\n }", "function resetTimer() {\n\t\tclearTimeout(awayTimeout);\n\t\tawayTimeout = setTimeout(handleVisibilityHide, 1000 * 60 * 10 /* 10 min */);\n\t\thandleVisibilityShow();\n\t}", "function setZeroTimeout(fn) {\n timeouts.push(fn);\n window.postMessage(messageName, \"*\");\n }", "function setZeroTimeout(fn) {\n timeouts.push(fn);\n window.postMessage(messageName, \"*\");\n }", "clearDelay() {\n clearTimeout(this.openTimeout);\n clearTimeout(this.closeTimeout);\n }", "clearDelay() {\n clearTimeout(this.openTimeout);\n clearTimeout(this.closeTimeout);\n }", "clearDelay() {\n clearTimeout(this.openTimeout);\n clearTimeout(this.closeTimeout);\n }", "clearDelay() {\n clearTimeout(this.openTimeout);\n clearTimeout(this.closeTimeout);\n }", "clearDelay() {\n clearTimeout(this.openTimeout);\n clearTimeout(this.closeTimeout);\n }", "enableBackgroundPinging() {\n this._beSatisfiedWith = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._counter = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._suitableNodeFound = false;\n this._pingInBackGround = true;\n }", "function resetTimer() {\n inactiveTime = 0;\n}" ]
[ "0.78815746", "0.78076965", "0.78076965", "0.770182", "0.770182", "0.63214767", "0.62413937", "0.6154825", "0.59722215", "0.59722215", "0.5878971", "0.58640546", "0.5824339", "0.5806684", "0.57668924", "0.5742948", "0.5728771", "0.571936", "0.56895703", "0.56488776", "0.56377155", "0.56286126", "0.55455816", "0.5543821", "0.5521801", "0.5508275", "0.5498457", "0.5481784", "0.5460356", "0.5454997", "0.5443835", "0.543933", "0.54253495", "0.5416049", "0.54116404", "0.54116404", "0.5375595", "0.5372576", "0.53622377", "0.53318924", "0.53098965", "0.53026915", "0.5269437", "0.52651393", "0.5252591", "0.5244107", "0.5238343", "0.52342063", "0.5228473", "0.52163637", "0.52035594", "0.52016735", "0.51902056", "0.51418895", "0.5137775", "0.51368666", "0.51347166", "0.51340723", "0.51335937", "0.5126766", "0.51205313", "0.5118251", "0.51173663", "0.5112801", "0.5112801", "0.51063734", "0.51056117", "0.5103963", "0.5097277", "0.50948465", "0.5094843", "0.5092519", "0.50844765", "0.50772655", "0.50745285", "0.5070001", "0.506458", "0.5060925", "0.505885", "0.50533825", "0.50533825", "0.5053", "0.50518316", "0.5048999", "0.504548", "0.5040326", "0.50333804", "0.5030266", "0.50290674", "0.5026488", "0.5023388", "0.5014247", "0.5014247", "0.500627", "0.500627", "0.500627", "0.500627", "0.500627", "0.5003787", "0.5001135" ]
0.76362985
5
Called on `drain` event
onDrain() { this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important // for example, when upgrading, upgrade packet is sent over, // and a nonzero prevBufferLen could cause problems on `drain` this.prevBufferLen = 0; if (0 === this.writeBuffer.length) { this.emit("drain"); } else { this.flush(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit(\"drain\")}}", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function $rtWY$var$onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n } // if there's something in the buffer waiting, then process it", "function $KNil$var$onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n }", "function onwriteDrain$1(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}", "function onwriteDrain(stream, state) {\n\t if (state.length === 0 && state.needDrain) {\n\t state.needDrain = false;\n\t stream.emit('drain');\n\t }\n\t}" ]
[ "0.8247324", "0.8247324", "0.8173619", "0.8173619", "0.81596136", "0.77630365", "0.75937366", "0.75937366", "0.75937366", "0.75937366", "0.7451056", "0.74041635", "0.7384224", "0.7368941", "0.73628247", "0.73325115", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.730123", "0.730123", "0.7274874", "0.72746503", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905", "0.72432905" ]
0.8281806
0
Called upon transport error
onError(err) { debug("socket error %j", err); Socket.priorWebsocketSuccess = false; this.emit("error", err); this.onClose("transport error", err); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transportError(err) {\n this.emit('error', err, this.transport);\n }", "onTransportError() {\n if (this.status === _UAStatus.STATUS_USER_CLOSED) {\n return;\n }\n this.status = _UAStatus.STATUS_NOT_READY;\n }", "function forwardError (err) {\n\t clientRequest.emit('error', err);\n\t }", "_onSerialError(err) {\n // not really sure how to handle this in a more elegant way\n\n this.emit('error', err);\n }", "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "function err(msg)\n {\n debug(\"PROXY ERROR\", msg);\n packet.stream.send({end:true, res:{\"s\":500}}, msg.toString());\n }", "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "function onerror(err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\t\n\t freezeTransport();\n\t\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t self.emit('upgradeError', error);\n\t }", "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "function onerror (err) {\n\t var error = new Error('probe error: ' + err);\n\t error.transport = transport.name;\n\n\t freezeTransport();\n\n\t debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n\t self.emit('upgradeError', error);\n\t }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "onError(err) {\n debug$3(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "onError(err) {\n Socket$1.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "_receiveError (err) {\n this._log.error('ReceiveError: %s', err.message)\n }", "_receiveError (err) {\n this._log.error('ReceiveError: %s', err.message)\n }", "_receiveError (err) {\n this._log.error('ReceiveError: %s', err.message)\n }", "_receiveError (err) {\n this._log.error('ReceiveError: %s', err.message)\n }", "function onerror(err) {\n const error = new Error(\"probe error: \" + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit(\"upgradeError\", error);\n }", "function onerror(err) {\n const error = new Error(\"probe error: \" + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit(\"upgradeError\", error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "connectError(error)\r\n {\r\n\t\t\tthis.notifyconnection(false);\r\n alert(error.headers.message);\r\n return;\r\n }", "function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n\n\n self.emit('upgradeError', error);\n }", "_lostConnection(error) {\n this._stream._lostConnection(error);\n }", "function onError(error) {\n self.error('Error : ' + error.status + ' ' + error.statusText);\n }", "function xhrTransferError(xhrEvent) {\n // console.log(\"An error occured while transferring the data\");\n}", "function onerror (err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug$7('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit('upgradeError', error);\n }", "function onerror(err) {\n const error = new Error(\"probe error: \" + err);\n error.transport = transport.name;\n\n freezeTransport();\n\n debug$3('probe transport \"%s\" failed because of error: %s', name, err);\n\n self.emit(\"upgradeError\", error);\n }", "function onConnectionFailed() {\r\n\t\t console.error('Connection Failed!');\r\n\t\t}", "function error(err) {\r\n console.log('err' + remoteAddress + \" \" + err.message + \" \" + now.getHours() + \":\" + now.getMinutes() + \":\" + now.getSeconds());\r\n }", "importFailed(data) {\n this.socket.emit('importFailed', data);\n }", "function connectionError() {\n throw new Error('Connection error');\n }" ]
[ "0.81600857", "0.75285035", "0.70201033", "0.68795127", "0.6867015", "0.6867015", "0.6867015", "0.6864234", "0.68166274", "0.68166274", "0.68166274", "0.68166274", "0.68166274", "0.68098766", "0.68098766", "0.6764993", "0.6764993", "0.6764993", "0.67597204", "0.6747688", "0.67299235", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66546696", "0.66534483", "0.66494274", "0.66494274", "0.66494274", "0.66494274", "0.66201484", "0.66201484", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6612209", "0.6573695", "0.6571427", "0.65661484", "0.6556978", "0.655324", "0.65518296", "0.6549141", "0.6499886", "0.6462635", "0.64120126", "0.64031976" ]
0.67468596
22
Called upon transport close.
onClose(reason, desc) { if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) { debug('socket close with reason: "%s"', reason); // clear timers clearTimeout(this.pingIntervalTimer); clearTimeout(this.pingTimeoutTimer); // stop event from firing again for transport this.transport.removeAllListeners("close"); // ensure transport won't stay open this.transport.close(); // ignore further transport communication this.transport.removeAllListeners(); if (typeof removeEventListener === "function") { removeEventListener("offline", this.offlineEventListener, false); } // set ready state this.readyState = "closed"; // clear session id this.id = null; // emit close event this.emit("close", reason, desc); // clean buffers after, so users can still // grab the buffers on `close` event this.writeBuffer = []; this.prevBufferLen = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closed () {\n delete self.transports[transportName]\n callback()\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const close = () => {\n debug(\"writing close packet\");\n this.write([{\n type: \"close\"\n }]);\n };\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const close = () => {\n debug(\"writing close packet\");\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "function cleanUp() {\n transportStream.close();\n }", "close() {\n this.transports.forEach(t => t.close());\n }", "function ontargetclose () {\n debug.proxyResponse('proxy target %s \"close\" event', req.url);\n cleanup();\n socket.destroy();\n }", "static async disconnect() {\n if (transportInstance) {\n transportInstance.device.close();\n transportInstance.emit(\"disconnect\");\n transportInstance = null;\n }\n }", "close() {\n if (this._closed) {\n return;\n }\n\n this._closed = true;\n\n logger.debug('close()');\n\n this._updateAndEmitSignalingStateChange(RTCSignalingState.closed);\n\n // Close RTCIceGatherer.\n // NOTE: Not yet implemented by Edge.\n try {\n this._iceGatherer.close();\n } catch (error) {\n logger.warn(`iceGatherer.close() failed:${error}`);\n }\n\n // Close RTCIceTransport.\n try {\n this._iceTransport.stop();\n } catch (error) {\n logger.warn(`iceTransport.stop() failed:${error}`);\n }\n\n // Close RTCDtlsTransport.\n try {\n this._dtlsTransport.stop();\n } catch (error) {\n logger.warn(`dtlsTransport.stop() failed:${error}`);\n }\n\n // Close and clear RTCRtpSenders.\n for (const info of this._localTrackInfos.values()) {\n const rtpSender = info.rtpSender;\n\n try {\n rtpSender.stop();\n } catch (error) {\n logger.warn(`rtpSender.stop() failed:${error}`);\n }\n }\n\n this._localTrackInfos.clear();\n\n // Close and clear RTCRtpReceivers.\n for (const info of this._remoteTrackInfos.values()) {\n const rtpReceiver = info.rtpReceiver;\n\n try {\n rtpReceiver.stop();\n } catch (error) {\n logger.warn(`rtpReceiver.stop() failed:${error}`);\n }\n }\n\n this._remoteTrackInfos.clear();\n\n // Clear remote streams.\n this._remoteStreams.clear();\n }", "close() {\n if (this.socket) this.socket.destroy();\n }", "close() {\n this._passToHandler({ error: { info: \"User closed client during task.\" }});\n this._reset();\n }", "function close() {\n\t\tif ( error ) {\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tself.emit( 'close' );\n\t}", "_onTimeout() {\n this.send(421, 'Timeout - closing connection');\n }", "close() {\n this.connection.sendBeacon({type: 'disconnect', session: this.sessionId})\n this.messageSubscription.unsubscribe()\n clearTimeout(this.resendReportTimer)\n clearInterval(this.performPurgeTimer)\n clearTimeout(this.changeReportDebounceTimer)\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "emitClose () {\n\t this.readyState = WebSocket.CLOSED;\n\t this.emit('close', this._closeCode || 1006, this._closeMessage || '');\n\n\t if (this.extensions[PerMessageDeflate.extensionName]) {\n\t this.extensions[PerMessageDeflate.extensionName].cleanup();\n\t }\n\n\t this.extensions = null;\n\n\t this.removeAllListeners();\n\t this.on('error', constants.NOOP); // Catch all errors after this.\n\t }", "emitClose () {\n\t this.readyState = WebSocket.CLOSED;\n\t this.emit('close', this._closeCode || 1006, this._closeMessage || '');\n\n\t if (this.extensions[PerMessageDeflate.extensionName]) {\n\t this.extensions[PerMessageDeflate.extensionName].cleanup();\n\t }\n\n\t this.extensions = null;\n\n\t this.removeAllListeners();\n\t this.on('error', constants.NOOP); // Catch all errors after this.\n\t }", "close() {\n\t\tthis._communicator.close();\n\t}", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine) this.engine.close();\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode || 1006, this._closeMessage || '');\n\n if (this.extensions[PerMessageDeflate.extensionName]) {\n this.extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this.extensions = null;\n\n this.removeAllListeners();\n this.on('error', constants.NOOP); // Catch all errors after this.\n }", "close() {\n this._socket.close();\n this._socket = null;\n this._parseObj = null;\n }", "emitClose () {\n this.readyState = WebSocket$1.CLOSED;\n\n this.emit('close', this._closeCode, this._closeMessage);\n\n if (this.extensions[PerMessageDeflate_1.extensionName]) {\n this.extensions[PerMessageDeflate_1.extensionName].cleanup();\n }\n\n this.extensions = null;\n\n this.removeAllListeners();\n }", "onClose() {\n this.reset();\n if (this.closed_by_user === false) {\n this.host.reportDisconnection();\n this.run();\n } else {\n this.emit('close');\n }\n }", "close() {\n this.__internal.close()\n }", "close() {\n this.__internal.close()\n }", "close() {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = 0;\n }\n if (this.messageTimer) {\n clearTimeout(this.messageTimer);\n this.messageTimer = 0;\n }\n if (this.webrtcIsReady()) {\n this.client.close();\n }\n if (this.peerConnOpen()) {\n this.pc.close();\n }\n if (this.relayIsReady()) {\n this.relay.close();\n }\n this.onCleanup();\n }", "close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this.reconnecting = false;\n if (\"opening\" === this.readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this.readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "_onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }", "_onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }", "_onClose() {\n this.logger.info(\n {\n tnx: 'network'\n },\n 'Connection closed'\n );\n\n if (this.upgrading && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');\n } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {\n return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');\n }\n\n this._destroy();\n }", "_close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }", "close() {\n if (this.connectStream) {\n this.connectStream.cancel();\n this.connectStream = null;\n }\n\n this.serverAddress = null;\n this.hostname = null;\n this.address = null;\n this.callbacks = null;\n this.creds = null;\n }", "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "close() {\r\n this.closed = true;\r\n this.client.end();\r\n }", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }", "onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket$1.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[permessageDeflate.extensionName]) {\n this._extensions[permessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket$1.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "close() {\n this._flushRequestQueue();\n if(this.isOpen()) {\n\n this.port.close();\n }\n this.port = null;\n this.isReady = false;\n\n }", "close() {\n this._endpointId = null;\n this._deviceModel = null;\n this._onChange = function (arg) {};\n this._onError = function (arg) {};\n }", "close() {\n\t\tthis.connection.close();\n\t}", "function cleanup () {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup () {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup () {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup () {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup () {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "closeNow(){\n this.socket.close()\n }", "doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }", "function onSocketClose() {\n self.resetAll(errors.SocketClosedError({\n reason: 'remote closed',\n socketRemoteAddr: self.socketRemoteAddr,\n direction: self.direction,\n remoteName: self.remoteName\n }));\n\n if (self.ephemeral) {\n var peer = self.channel.peers.get(self.socketRemoteAddr);\n if (peer) {\n peer.close(noop);\n }\n self.channel.peers.delete(self.socketRemoteAddr);\n }\n }", "close() {\n fidl.ProtocolClient.close(this._pathClient);\n }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "onTimeout() {\n\t\tthis.lastError = 'TCPTransport::onTimeout';\n\t\tthis.debug(this._lastError);\n\t\tthis._socket.destroy();\n\t}", "disconnect(e) {\n if (this.isConnected) {\n this.sender.close();\n this.sender = null;\n if (this.disconnected) {\n this.disconnected(this, e || transportDisconnectedEvent_1.TransportDisconnectedEvent.Empty);\n }\n }\n }", "function cleanup() {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n self.removeListener(\"close\", onclose);\n self.removeListener(\"upgrading\", onupgrade);\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "onClose() {\n\t\t}", "function cleanup() {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n self.removeListener(\"close\", onclose);\n self.removeListener(\"upgrading\", onupgrade);\n }", "function cleanup() {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n self.removeListener(\"close\", onclose);\n self.removeListener(\"upgrading\", onupgrade);\n }", "close()\n\t{\n\t\t//Terminate worker\n\t\tthis.worker.terminate();\n\t\t\n\t\t//End all pending transactions\n\t\tfor (let transaction of this.transactions.values())\n\t\t\t//Reject with terminated error\n\t\t\ttransaction.reject(new Error(\"Client closed\"));\n\t\t//Clear transactions\n\t\tthis.transactions.clear();\n\t}", "destroy() {\n var _a;\n try {\n (_a = this.debug) === null || _a === void 0 ? void 0 : _a.call(this, 'destroyed');\n this.setHeartbeatInterval(-1);\n this.ws.close(1000);\n }\n catch (error) {\n this.emit('error', error);\n }\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }" ]
[ "0.84708756", "0.78021735", "0.7763885", "0.7763885", "0.77553374", "0.774528", "0.74054694", "0.7300703", "0.7067258", "0.7045535", "0.701875", "0.6964324", "0.687647", "0.68182486", "0.6804835", "0.6774911", "0.67689997", "0.67571044", "0.67571044", "0.6755574", "0.6740346", "0.6738742", "0.6691543", "0.66754144", "0.6673469", "0.66714984", "0.6658082", "0.6658082", "0.665788", "0.6657587", "0.665308", "0.665308", "0.665308", "0.66142106", "0.661301", "0.661301", "0.65941834", "0.65879154", "0.65879154", "0.65879154", "0.6586861", "0.65806437", "0.65806437", "0.65762687", "0.6559191", "0.65573233", "0.65358937", "0.65272766", "0.6516311", "0.65127146", "0.65127146", "0.65127146", "0.65127146", "0.65127146", "0.6512072", "0.6509799", "0.648144", "0.6476357", "0.64714956", "0.64714956", "0.64714956", "0.64714956", "0.64714956", "0.64714956", "0.64714956", "0.64714956", "0.646704", "0.64648336", "0.6462272", "0.64496", "0.64331025", "0.64331025", "0.64331025", "0.6425669", "0.642362", "0.642362", "0.6417358", "0.6413009", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741", "0.6411741" ]
0.0
-1
this is an int
function clone(obj) { const o = {}; for (let i in obj) { if (obj.hasOwnProperty(i)) { o[i] = obj[i]; } } return o; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get intValue() {}", "integer() {\n this.int = true;\n return this;\n }", "get valueInteger () {\r\n\t\treturn this.__valueInteger;\r\n\t}", "function o2ws_get_int() { return o2ws_get_int32(); }", "get valueInteger() {\n\t\treturn this.__valueInteger;\n\t}", "integer(txt){ \n var lexeme = this.integer_lexeme()\n return parseInt(lexeme.get(new Source(\"int\", txt)))\n }", "function toInt(val){\n\t // we do not use lang/toNumber because of perf and also because it\n\t // doesn't break the functionality\n\t return ~~val;\n\t }", "set intValue(value) {}", "influence () {\n return parseInt(this.I, 16);\n }", "function returnInt(element) {\n return parseInt(element, 10);\n }", "toInt() {\n return this.unsigned ? this.low >>> 0 : this.low;\n }", "function intValue(elt) {\n return parseInt($(elt).value);\n}", "function Column_INT() {}", "isInteger() {\n return !!this.value;\n }", "function int(num) {\n\treturn parseInt(num, 10);\n}", "getInteger() {\n return this.value ? this.value : null;\n }", "function parseInt_(a){return\"string\"==typeof a?parseInt(a,10):a}", "static get integer() {\n return /^[\\+\\-]?\\d+$/;\n }", "function returnInt(element) {\n return parseInt(element, 10);\n }", "function $Integer() {\n\t\treturn Field.apply(this, arguments);\n\t}", "function isInteger(num) {\n return Number.isInteger(num);\n }", "function integer(n)\r\n{\r\n return Number(n);\r\n}", "static SetInt() {}", "function bnIntValue() {\n\tif(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t}\n\telse if(this.t == 1) return this[0];\n\telse if(this.t == 0) return 0;\n\t// assumes 16 < DB < 32\n\treturn ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function parse_PtgInt(blob) {\n blob.l++;\n return blob.read_shift(2);\n }", "function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n\t }", "function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n\t }", "function readIntValue() {\n read(tempBuf, 0, 1);\n var typeChar = tempBuf[0];\n\n switch (typeChar) {\n case INT_ZERO_TYPE: return 0;\n case (INT_ZERO_TYPE + 1):\n case (INT_ZERO_TYPE + 2):\n case (INT_ZERO_TYPE + 3):\n case (INT_ZERO_TYPE + 4):\n case (INT_ZERO_TYPE + 5):\n case (INT_ZERO_TYPE + 6):\n case (INT_ZERO_TYPE + 7):\n case (INT_ZERO_TYPE + 8): return readInt(typeChar - INT_ZERO_TYPE);\n }\n\n throw new Error(\"Unknown int type: \" + typeChar);\n }", "function toDCInt(int) {\n return int;\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n }", "function bnIntValue() {\n\t if(this.s < 0) {\n\t if(this.t == 1) return this[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t }\n\t else if(this.t == 1) return this[0];\n\t else if(this.t == 0) return 0;\n\t // assumes 16 < DB < 32\n\t return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n\t }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];\n }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];\n }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];\n }", "function bnIntValue() {\r\n\t if (this.s < 0) {\r\n\t if (this.t == 1) return this[0] - this.DV;\r\n\t else if (this.t === 0) return -1;\r\n\t }\r\n\t else if (this.t == 1) return this[0];\r\n\t else if (this.t === 0) return 0;\r\n\t// assumes 16 < DB < 32\r\n\t return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\r\n\t}", "function bnIntValue() {\r\n\t if (this.s < 0) {\r\n\t if (this.t == 1) return this[0] - this.DV;\r\n\t else if (this.t === 0) return -1;\r\n\t }\r\n\t else if (this.t == 1) return this[0];\r\n\t else if (this.t === 0) return 0;\r\n\t// assumes 16 < DB < 32\r\n\t return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\r\n\t}", "integer_lexeme() { return new GeneratorLexeme(\"int\", \"[\\\\+|\\\\-]?\\\\d+\") }", "function bnIntValue() {\n\tif(this.s < 0) {\n\t if(this.t == 1) return this.data[0]-this.DV;\n\t else if(this.t == 0) return -1;\n\t} else if(this.t == 1) return this.data[0];\n\telse if(this.t == 0) return 0;\n\t// assumes 16 < DB < 32\n\treturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n\t}", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n }", "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;\n else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];\n else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];\n }", "function isInt() {\n\treturn (Number(value) === parseInt(value, 10));\n}" ]
[ "0.7386892", "0.67763585", "0.66849697", "0.6615927", "0.6587982", "0.6415983", "0.63550144", "0.63370776", "0.6284858", "0.62382734", "0.6212422", "0.6195806", "0.61783713", "0.6172717", "0.6172663", "0.61693823", "0.61388636", "0.61206925", "0.6090448", "0.6080745", "0.6067161", "0.6024672", "0.60209584", "0.60152125", "0.60152024", "0.60147786", "0.60147786", "0.60141903", "0.60124993", "0.59775376", "0.59775376", "0.59775376", "0.59775376", "0.59775376", "0.59775376", "0.59775376", "0.59734684", "0.59734684", "0.5973329", "0.59645164", "0.59645164", "0.59645164", "0.59626734", "0.59626734", "0.5958944", "0.5950839", "0.59494644", "0.59494644", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5944779", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5936642", "0.5924857" ]
0.0
-1
Called with a decoded packet.
onPacket(packet) { this.emit("packet", packet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n this.emitReserved(\"packet\", packet);\n }", "ondecoded(packet) {\n this.emitReserved(\"packet\", packet);\n }", "ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }", "onPacket(packet) {\n super.emit(\"packet\", packet);\n }", "onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }", "onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "function dispatch(packet) {\n\n }", "function decode (rawPackage, callback) {\n cbor.decodeFirst(rawPackage, (err, pkt) => {\n callback(err, err === null ? exchangeKeys(pkt, false) : null);\n });\n}", "function Decode(fPort, bytes) {\n return Decoder(bytes, fPort);\n}", "readResetResponsePacket(packet, out, opts, info) {\n if (packet.peek() !== 0x00) {\n return this.throwNewError(\n 'unexpected packet',\n false,\n info,\n '42000',\n Errors.ER_RESET_BAD_PACKET\n );\n }\n\n packet.skip(1); //skip header\n packet.skipLengthCodedNumber(); //affected rows\n packet.skipLengthCodedNumber(); //insert ids\n\n info.status = packet.readUInt16();\n this.successEnd(null);\n }", "decode() {\n this.generateIobPips(this.pin, this.tile, this.style, this.pad);\n }", "function DT_DecoderDataResponse(decoderData, rawDecoderData, symbologyType, dlParsedObject) {\n\n // We recomend using the \"RAW\" Base64 data and decoding it with the built-in \"atob\" function\n \n // Now you can call processing functions to handle the barcode scanner data however you'd like.\n // var ActiveObject = document.activeElement;\n // ActiveObject.value = scanData;\n // scanData = atob(dlParsedObject);\n \n // Alert the user with a naitive iOS alert box of the scan data\n // DT_AlertBoxRequest(12345, 'Scan Data', 'first name: ' + dlParsedObject.firstName, ['OK']);\n\n // Check if we're in the survey section\n if (currentSurveySection == 'final') {\n scanCoupon(decoderData);\n } else {\n entryMethod = 'Barcode';\n fillFormFields(decoderData, rawDecoderData, null, null, symbologyType, dlParsedObject);\n }\n}", "function dataCallback(d) {\n\n//\tconsole.log(d);\n\n\tif (insidePacket === false && dataBuffer.length > 0 && dataBuffer[0] === 0x7e) {\n\t\tinsidePacket = true;\n\t}\n\n\t// We're not inside a packet and we're not looking at a packet\n\t// header, so something went wrong. Look for the 7e.\n\tif (insidePacket === false && d[0] != 0x7e) {\n\t\tvar startPosition = -1;\n\t\tfor (var i = 0; i < d.length; i++) {\n\t\t\tif (d[i] === 0x7e) {\n\t\t\t\tstartPosition = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If we found a 0x7e, then cut the packet so that's the\n\t\t// new start. If not, then just return from the callback,\n\t\t// because there's nothing we can do until the next\n\t\t// packet comes in.\n\t\tif (startPosition !== -1) {\n\t\t\td = d.slice(startPosition);\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// If we are at the beginning of a packet, then note that fact.\n\tif (d[0] === 0x7e) {\n\t\tinsidePacket = true;\n\t}\n\n\t// Count the number of characters that need to be escaped\n\tvar escapedCharacters = 0;\n\tfor (var i = 0; i < d.length; i++) {\n\t\tif (d[i] === 0x7D) {\n\t\t\tescapedCharacters++;\n\t\t}\n\t}\n\n\t// Create a new buffer to hold all of the data after the\n\t// characters have been escaped\n\tvar escapedData = Buffer.alloc(d.length - escapedCharacters);\n\tvar escapedIndex = 0;\n\n\t// Apply the escape-character logic to the incoming data\n\tfor (var i = 0; i < d.length; i++) {\n\t\tif (isEscape) {\n\t\t\tescapedData[escapedIndex] = d[i] ^ 0x20;\n\t\t\tescapedIndex++;\n\t\t\tisEscape = false;\n\t\t} else if (d[i] === 0x7D) {\n\t\t\tisEscape = true;\n\t\t} else {\n\t\t\tescapedData[escapedIndex] = d[i];\n\t\t\tescapedIndex++;\n\t\t}\n\t}\n\n\t// Add the escaped data to the data buffer\n\tdataBuffer = Buffer.concat([dataBuffer, escapedData]);\n\n\t// We need at least three bytes.\n\t// The first two bytes should always be 0x7e to denote\n\t// the start of a new packet. The third byte is the length.\n\t// Once we have the length we can grab the whole packet and\n\t// process it.\n\tif (dataBuffer.length >= 3) {\n\t\tvar length = dataBuffer[2] + 4;\n\t\t// We have the entire RF data (the length attribute)\n\t\t// and the 15 bytes of header data, so we can process\n\t\t// the packet.\n\t\tif (dataBuffer.length >= length) {\n\t\t\tvar dataPacket = dataBuffer.slice(0, length);\n\t\t\tdataBuffer = dataBuffer.slice(length);\n\t\t\tdataEmitter.emit(\"data\", dataPacket);\n\t\t\tinsidePacket = false;\n\t\t}\n\t}\n}", "function onDecodeSuccess (buffer) {\r\n\t\tvar source = context.createBufferSource();\r\n\t\tsource.buffer = buffer;\r\n\t\tsource.connect(context.destination);\r\n\t\tsource.start(0);\r\n\t}", "decode(buffer) {\n return this._decoder.decode(buffer);\n }", "function decodeData(ev) {\n const { data } = ev;\n const message = JSON.parse(Pako.ungzip(data, { to: 'string' }));\n return message;\n }", "function getDecodedData() {\n return decoded_data;\n}", "function decodeBuffer(dbuff) {\n if (dbuff.readInt16BE(Offset.MagicNumber) === MagicNumber) { // Confirm the return packet is in the BYOND format.\n const size = dbuff.readUInt16BE(Offset.ExpectedDataLength) - 1; // Byte size of the string/floating-point (minus the identifier byte).\n const data = dbuff.slice(Offset.Data, Offset.Data + size); // Take the data section\n if (dbuff[Offset.DataTypeIdentifier] === Identifier.String) { // ASCII String.\n return String.fromCharCode(...data); // Return the data section as a string\n }\n else {\n return data;\n }\n }\n}", "function decodePayload(payload){\n\t//filter out packets that do not correspond with payload sizes.\n\tif(payload.length % devicePayloadSize === 0){\n\t\trecievedTable = new Array();\n\t\tfor(var i = 0; i < payload.length / devicePayloadSize; i++){\n\t\t\tvar id = payload[i * (payload.length / (i + 1))];\n\t\t\tvar lat = (hexToInt(bytesToHex(payload.slice(i * (payload.length / (i + 1)) + devIdsize, i * (payload.length / (i + 1)) + devIdsize + latSize))) / 10000000);\n\t\t\tvar lon = (hexToInt(bytesToHex(payload.slice(i * (payload.length / (i + 1)) + devIdsize + latSize, i * (payload.length / (i + 1)) + devIdsize + latSize + lonSize))) / 10000000);\n console.log(payload.slice(i * (payload.length / (i + 1)) + devIdsize + latSize + lonSize, i * (payload.length / (i + 1)) + devIdsize + latSize + lonSize + timeSize));\n\t\t\tvar timePayload = timePayloadToTime( payload.slice(i * (payload.length / (i + 1)) + devIdsize + latSize + lonSize, i * (payload.length / (i + 1)) + devIdsize + latSize + lonSize + timeSize) ); \n\t\t\t\n var tempDevice = new device(id,lat,lon,timePayload);\n\t\t\trecievedTable.push(tempDevice);\n\t\t}\n\t\treturn recievedTable;\n\t}\n\telse{\n\t\tconsole.log(\"not the packet we are looking for\");\n\t}\n}", "function decode(data) {\n var current = data.data;\n for (var i = data.encoding.length - 1; i >= 0; i--) {\n current = Decoder.decodeStep(current, data.encoding[i]);\n }\n return current;\n }", "_readPacket() {\n let pos = this._streamPosition;\n const intParams = [];\n let strParam;\n try {\n // Each incoming packet is initially tagged with 7 int32 values, they look like this:\n // 0 = \"Magic\" value that is *always* -2027771214\n // 1 = \"FCType\" that identifies the type of packet this is (FCType being a MyFreeCams defined thing)\n // 2 = nFrom\n // 3 = nTo\n // 4 = nArg1\n // 5 = nArg2\n // 6 = sPayload, the size of the payload\n // 7 = sMessage, the actual payload. This is not an int but is the actual buffer\n // Any read here could throw a RangeError exception for reading beyond the end of the buffer. In theory we could handle this\n // better by checking the length before each read, but that would be a bit ugly. Instead we handle the RangeErrors and just\n // try to read again the next time the buffer grows and we have more data\n // Parse out the first 7 integer parameters (Magic, FCType, nFrom, nTo, nArg1, nArg2, sPayload)\n const countOfIntParams = 7;\n const sizeOfInt32 = 4;\n for (let i = 0; i < countOfIntParams; i++) {\n intParams.push(this._streamBuffer.readInt32BE(pos));\n pos += sizeOfInt32;\n }\n const [magic, fcType, nFrom, nTo, nArg1, nArg2, sPayload] = intParams;\n // If the first integer is MAGIC, we have a valid packet\n if (magic === constants.MAGIC) {\n // If there is a JSON payload to this packet\n if (sPayload > 0) {\n // If we don't have the complete payload in the buffer already, bail out and retry after we get more data from the network\n if (pos + sPayload > this._streamBuffer.length) {\n throw new RangeError(); // This is needed because streamBuffer.toString will not throw a rangeerror when the last param is out of the end of the buffer\n }\n // We have the full packet, store it and move our buffer pointer to the next packet\n strParam = this._streamBuffer.toString(\"utf8\", pos, pos + sPayload);\n pos = pos + sPayload;\n }\n }\n else {\n // Magic value did not match? In that case, all bets are off. We no longer understand the MFC stream and cannot recover...\n // This is usually caused by a mis-alignment error due to incorrect buffer management (bugs in this code or the code that writes the buffer from the network)\n this._disconnected(`Invalid packet received! - ${magic} Length == ${this._streamBuffer.length}`);\n return;\n }\n // At this point we have the full packet in the intParams and strParam values, but intParams is an unstructured array\n // Let's clean it up before we delegate to this.packetReceived. (Leaving off the magic int, because it MUST be there always\n // and doesn't add anything to the understanding)\n let sMessage;\n if (strParam !== undefined && strParam !== \"\") {\n try {\n sMessage = JSON.parse(strParam);\n }\n catch (e) {\n sMessage = strParam;\n }\n }\n this._packetReceived(new Packet_1.Packet(fcType, nFrom, nTo, nArg1, nArg2, sPayload, sMessage));\n // If there's more to read, keep reading (which would be the case if the network sent >1 complete packet in a single transmission)\n if (pos < this._streamBuffer.length) {\n this._streamPosition = pos;\n this._readPacket();\n }\n else {\n // We read the full buffer, clear the buffer cache so that we can\n // read cleanly from the beginning next time (and save memory)\n this._streamBuffer = Buffer.alloc(0);\n this._streamPosition = 0;\n }\n }\n catch (e) {\n // RangeErrors are expected because sometimes the buffer isn't complete. Other errors are not...\n if (!(e instanceof RangeError)) {\n this._disconnected(`Unexpected error while reading socket stream: ${e}`);\n }\n else {\n // this.log(\"Expected exception (?): \" + e);\n }\n }\n }", "function Decoder(buffer, offset) {\n this.offset = offset || 0;\n this.buffer = buffer;\n}", "function Decoder(buffer, offset) {\n this.offset = offset || 0;\n this.buffer = buffer;\n}", "Decode(string, EncodingType, X500NameFlags) {\n\n }", "function parsePacket(packet, connection) {\n\tlet packetType = packet[0];\n\tlet key = stringDecoder.write(packet.slice(1, 6));\n\tlet user = userManager.getUser(key);\n\n\tlet data = packet.slice(6);\n\tswitch(packetType) {\n\t\tcase packetTypes.REQUEST_AUTH:\n\t\t\tauthorize(connection);\n\t\t\tbreak;\n\t\tcase packetTypes.REQUEST_JOIN_OR_CREATE_LOBBY:\n\t\t\tlobbymanager.joinOrCreateLobby(user, packetTypes.REQUEST_JOIN_OR_CREATE_LOBBY);\n\t\t\tbreak;\n\t\tcase packetTypes.DATA_SYNC:\n\t\t\tlobbymanager.syncData(user, packetTypes.DATA_SYNC, data);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tlogger.logWarning(`Invalid packet type: ${packetType}`);\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}", "onReceive( packet)\n{\n let packet_view = new Uint8Array(packet);\n this.rxMsgArrayBuffer = appendArray(this.rxMsgArrayBuffer, packet_view);\n let view = new Uint8Array(this.rxMsgArrayBuffer);\n\n if (this.size_Of_request)\n {\n let data = new Uint8Array(this.size_Of_request);\n let offset = 0;\n for(let index = 0; index < view.byteLength; ++index)\n {\n switch(view[index])\n {\n case ESC:\n data[offset++] = this.xor_20(view[index]);\n break;\n\n case SOP:\n offset = 0;\n break;\n\n case EOP:\n break;\n\n default:\n data[offset++] = view[index];\n break;\n }\n }\n\n if (this.size_Of_request == offset)\n {\n //dumpArray(data);\n if (this.postCallback)\n this.postCallback(data);\n this.rxMsgArrayBuffer = new ArrayBuffer();\n\n }\n \n }\n}", "function onDecodingSuccess(buffer) {\n if (buffer) {\n bufferList[bufferIndex] = buffer;\n } else {\n onDecodingError('unknown');\n }\n\n endIfAllURLsResolved();\n }", "$onmessage(e) {\n if ( e.data instanceof ArrayBuffer ) {\n const bytes = new Uint8Array(e.data);\n try {\n const decoded = pb.sync.Packet.decode(bytes);\n if ( typeof this.onmessage === 'function' ) {\n this.onmessage(decoded);\n }\n } catch (e) {\n console.log(e);\n }\n }\n }", "function Decoder(bytes, port) {\n // Decode an uplink message from a buffer\n // (array) of bytes to an object of fields.\n var decoded = {};\n\n if (! (port === 3))\n return null;\n\n // see catena-message-port3-format.md\n // i is used as the index into the message. Start with the flag byte.\n // note that there's no discriminator.\n // test vectors are also available there.\n var i = 0;\n // fetch the bitmap.\n var flags = bytes[i++];\n\n if (flags & 0x1) {\n // set Vraw to a uint16, and increment pointer\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n // interpret uint16 as an int16 instead.\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n // scale and save in result.\n decoded.Vbat = Vraw / 4096.0;\n }\n\n if (flags & 0x2) {\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n decoded.VDD = Vraw / 4096.0;\n }\n\n if (flags & 0x4) {\n var iBoot = bytes[i];\n i += 1;\n decoded.boot = iBoot;\n }\n\n if (flags & 0x8) {\n // we have temp, pressure, RH\n var tRaw = (bytes[i] << 8) + bytes[i + 1];\n if (tRaw & 0x8000)\n tRaw = -0x10000 + tRaw;\n i += 2;\n var rhRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n\n decoded.t = tRaw / 256;\n decoded.rh = rhRaw / 65535.0 * 100;\n decoded.tDew = dewpoint(decoded.t, decoded.rh);\n decoded.tHeatIndexC = CalculateHeatIndexCelsius(decoded.t, decoded.rh);\n }\n\n if (flags & 0x10) {\n // we have light irradiance info\n var irradiance = {};\n decoded.irradiance = irradiance;\n\n var lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.IR = lightRaw;\n\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.White = lightRaw;\n\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.UV = lightRaw;\n }\n\n if (flags & 0x20) {\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n decoded.Vbus = Vraw / 4096.0;\n }\n\n // at this point, decoded has the real values.\n return decoded;\n}", "read_sub_packet(bytes, trusted = true) {\n let mypos = 0;\n\n const read_array = (prop, bytes) => {\n this[prop] = [];\n\n for (let i = 0; i < bytes.length; i++) {\n this[prop].push(bytes[i]);\n }\n };\n\n // The leftmost bit denotes a \"critical\" packet\n const critical = bytes[mypos] & 0x80;\n const type = bytes[mypos] & 0x7F;\n\n // GPG puts the Issuer and Signature subpackets in the unhashed area.\n // Tampering with those invalidates the signature, so we can trust them.\n // Ignore all other unhashed subpackets.\n if (!trusted && ![\n enums.signatureSubpacket.issuer,\n enums.signatureSubpacket.issuerFingerprint,\n enums.signatureSubpacket.embeddedSignature\n ].includes(type)) {\n this.unhashedSubpackets.push(bytes.subarray(mypos, bytes.length));\n return;\n }\n\n mypos++;\n\n // subpacket type\n switch (type) {\n case 2:\n // Signature Creation Time\n this.created = util.readDate(bytes.subarray(mypos, bytes.length));\n break;\n case 3: {\n // Signature Expiration Time in seconds\n const seconds = util.readNumber(bytes.subarray(mypos, bytes.length));\n\n this.signatureNeverExpires = seconds === 0;\n this.signatureExpirationTime = seconds;\n\n break;\n }\n case 4:\n // Exportable Certification\n this.exportable = bytes[mypos++] === 1;\n break;\n case 5:\n // Trust Signature\n this.trustLevel = bytes[mypos++];\n this.trustAmount = bytes[mypos++];\n break;\n case 6:\n // Regular Expression\n this.regularExpression = bytes[mypos];\n break;\n case 7:\n // Revocable\n this.revocable = bytes[mypos++] === 1;\n break;\n case 9: {\n // Key Expiration Time in seconds\n const seconds = util.readNumber(bytes.subarray(mypos, bytes.length));\n\n this.keyExpirationTime = seconds;\n this.keyNeverExpires = seconds === 0;\n\n break;\n }\n case 11:\n // Preferred Symmetric Algorithms\n read_array('preferredSymmetricAlgorithms', bytes.subarray(mypos, bytes.length));\n break;\n case 12:\n // Revocation Key\n // (1 octet of class, 1 octet of public-key algorithm ID, 20\n // octets of\n // fingerprint)\n this.revocationKeyClass = bytes[mypos++];\n this.revocationKeyAlgorithm = bytes[mypos++];\n this.revocationKeyFingerprint = bytes.subarray(mypos, mypos + 20);\n break;\n\n case 16:\n // Issuer\n this.issuerKeyId.read(bytes.subarray(mypos, bytes.length));\n break;\n\n case 20: {\n // Notation Data\n const humanReadable = !!(bytes[mypos] & 0x80);\n\n // We extract key/value tuple from the byte stream.\n mypos += 4;\n const m = util.readNumber(bytes.subarray(mypos, mypos + 2));\n mypos += 2;\n const n = util.readNumber(bytes.subarray(mypos, mypos + 2));\n mypos += 2;\n\n const name = util.uint8ArrayToStr(bytes.subarray(mypos, mypos + m));\n const value = bytes.subarray(mypos + m, mypos + m + n);\n\n this.rawNotations.push({ name, humanReadable, value, critical });\n\n if (humanReadable) {\n this.notations[name] = util.uint8ArrayToStr(value);\n }\n break;\n }\n case 21:\n // Preferred Hash Algorithms\n read_array('preferredHashAlgorithms', bytes.subarray(mypos, bytes.length));\n break;\n case 22:\n // Preferred Compression Algorithms\n read_array('preferredCompressionAlgorithms', bytes.subarray(mypos, bytes.length));\n break;\n case 23:\n // Key Server Preferences\n read_array('keyServerPreferences', bytes.subarray(mypos, bytes.length));\n break;\n case 24:\n // Preferred Key Server\n this.preferredKeyServer = util.uint8ArrayToStr(bytes.subarray(mypos, bytes.length));\n break;\n case 25:\n // Primary User ID\n this.isPrimaryUserID = bytes[mypos++] !== 0;\n break;\n case 26:\n // Policy URI\n this.policyURI = util.uint8ArrayToStr(bytes.subarray(mypos, bytes.length));\n break;\n case 27:\n // Key Flags\n read_array('keyFlags', bytes.subarray(mypos, bytes.length));\n break;\n case 28:\n // Signer's User ID\n this.signersUserId = util.uint8ArrayToStr(bytes.subarray(mypos, bytes.length));\n break;\n case 29:\n // Reason for Revocation\n this.reasonForRevocationFlag = bytes[mypos++];\n this.reasonForRevocationString = util.uint8ArrayToStr(bytes.subarray(mypos, bytes.length));\n break;\n case 30:\n // Features\n read_array('features', bytes.subarray(mypos, bytes.length));\n break;\n case 31: {\n // Signature Target\n // (1 octet public-key algorithm, 1 octet hash algorithm, N octets hash)\n this.signatureTargetPublicKeyAlgorithm = bytes[mypos++];\n this.signatureTargetHashAlgorithm = bytes[mypos++];\n\n const len = mod.getHashByteLength(this.signatureTargetHashAlgorithm);\n\n this.signatureTargetHash = util.uint8ArrayToStr(bytes.subarray(mypos, mypos + len));\n break;\n }\n case 32:\n // Embedded Signature\n this.embeddedSignature = new SignaturePacket();\n this.embeddedSignature.read(bytes.subarray(mypos, bytes.length));\n break;\n case 33:\n // Issuer Fingerprint\n this.issuerKeyVersion = bytes[mypos++];\n this.issuerFingerprint = bytes.subarray(mypos, bytes.length);\n if (this.issuerKeyVersion === 5) {\n this.issuerKeyId.read(this.issuerFingerprint);\n } else {\n this.issuerKeyId.read(this.issuerFingerprint.subarray(-8));\n }\n break;\n case 34:\n // Preferred AEAD Algorithms\n read_array.call(this, 'preferredAeadAlgorithms', bytes.subarray(mypos, bytes.length));\n break;\n default: {\n const err = new Error(\"Unknown signature subpacket type \" + type + \" @:\" + mypos);\n if (critical) {\n throw err;\n } else {\n util.printDebug(err);\n }\n }\n }\n }", "_packetReceived(packet) {\n this._lastPacketTime = Date.now();\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.TRACE, () => packet.toString());\n // Special case some packets to update and maintain internal state\n switch (packet.FCType) {\n case constants.FCTYPE.DETAILS:\n case constants.FCTYPE.ROOMHELPER:\n case constants.FCTYPE.SESSIONSTATE:\n case constants.FCTYPE.ADDFRIEND:\n case constants.FCTYPE.ADDIGNORE:\n case constants.FCTYPE.CMESG:\n case constants.FCTYPE.PMESG:\n case constants.FCTYPE.TXPROFILE:\n case constants.FCTYPE.USERNAMELOOKUP:\n case constants.FCTYPE.MYCAMSTATE:\n case constants.FCTYPE.MYWEBCAM:\n case constants.FCTYPE.JOINCHAN:\n // According to the site code, these packets can all trigger a user state update\n this._lastStatePacketTime = this._lastPacketTime;\n // This case updates our available tokens (yes the logic is insane, but it's lifted right from MFC code...)\n if (packet.FCType === constants.FCTYPE.DETAILS && packet.nTo === this.sessionId) {\n this._tokens = (packet.nArg1 > 2147483647) ? ((4294967297 - packet.nArg1) * -1) : packet.nArg1;\n }\n // And these specific cases don't update state...\n if ((packet.FCType === constants.FCTYPE.DETAILS && packet.nFrom === constants.FCTYPE.TOKENINC) ||\n // 100 here is taken directly from MFC's top.js and has no additional\n // explanation. My best guess is that it is intended to reference the\n // constant: USER.ID_START. But since I'm not certain, I'll leave this\n // \"magic\" number here.\n (packet.FCType === constants.FCTYPE.ROOMHELPER && packet.nArg2 < 100) ||\n (packet.FCType === constants.FCTYPE.JOINCHAN && packet.nArg2 === constants.FCCHAN.PART)) {\n break;\n }\n if (packet.FCType === constants.FCTYPE.ROOMHELPER) {\n if (packet.nArg2 >= 100 || packet.nArg2 === constants.FCRESPONSE.SUCCESS) {\n this._roomHelperStatus.set(packet.nArg1, true);\n }\n if (packet.nArg2 === constants.FCRESPONSE.SUSPEND) {\n this._roomHelperStatus.set(packet.nArg1, false);\n }\n }\n // Ok, we're good, merge if there's anything to merge\n if (packet.sMessage !== undefined) {\n const msg = packet.sMessage;\n const lv = msg.lv;\n const sid = msg.sid;\n let uid = msg.uid;\n if (uid === 0 && sid > 0) {\n uid = sid;\n }\n if (uid === undefined && packet.aboutModel !== undefined) {\n uid = packet.aboutModel.uid;\n }\n // Only merge models (when we can tell). Unfortunately not every SESSIONSTATE\n // packet has a user level property. So this is no worse than we had been doing\n // before in terms of merging non-models...\n if (uid !== undefined && uid !== -1 && (lv === undefined || lv === constants.FCLEVEL.MODEL)) {\n // If we know this is a model, get her instance and create it\n // if it does not exist. Otherwise, don't create an instance\n // for someone that might not be a model.\n const possibleModel = Model_1.Model.getModel(uid, lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(msg);\n }\n }\n }\n break;\n case constants.FCTYPE.TAGS:\n const tagPayload = packet.sMessage;\n if (typeof tagPayload === \"object\") {\n for (const key in tagPayload) {\n if (tagPayload.hasOwnProperty(key)) {\n const possibleModel = Model_1.Model.getModel(key);\n if (possibleModel !== undefined) {\n possibleModel.mergeTags(tagPayload[key]);\n }\n }\n }\n }\n break;\n case constants.FCTYPE.BOOKMARKS:\n const bmMsg = packet.sMessage;\n if (Array.isArray(bmMsg.bookmarks)) {\n bmMsg.bookmarks.forEach((b) => {\n const possibleModel = Model_1.Model.getModel(b.uid);\n if (possibleModel !== undefined) {\n possibleModel.merge(b);\n }\n });\n }\n break;\n case constants.FCTYPE.EXTDATA:\n if (packet.nTo === this.sessionId && packet.nArg2 === constants.FCWOPT.REDIS_JSON) {\n this._handleExtData(packet.sMessage).catch((reason) => {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.WARNING, () => `WARNING: _packetReceived caught rejection from _handleExtData: ${reason}`);\n });\n }\n break;\n case constants.FCTYPE.METRICS:\n // For METRICS, nTO is an FCTYPE indicating the type of data that's\n // starting or ending, nArg1 is the count of data received so far, and nArg2\n // is the total count of data, so when nArg1 === nArg2, we're done for that data\n // Note that after MFC server updates on 2017-04-18, Metrics packets are rarely,\n // or possibly never, sent\n break;\n case constants.FCTYPE.MANAGELIST:\n if (packet.nArg2 > 0 && packet.sMessage !== undefined && packet.sMessage.rdata !== undefined) {\n const rdata = this.processListData(packet.sMessage.rdata);\n const nType = packet.nArg2;\n switch (nType) {\n case constants.FCL.ROOMMATES:\n if (Array.isArray(rdata)) {\n rdata.forEach((viewer) => {\n if (viewer !== undefined) {\n const possibleModel = Model_1.Model.getModel(viewer.uid, viewer.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(viewer);\n }\n }\n });\n }\n break;\n case constants.FCL.CAMS:\n if (Array.isArray(rdata)) {\n rdata.forEach((model) => {\n if (model !== undefined) {\n const possibleModel = Model_1.Model.getModel(model.uid, model.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(model);\n }\n }\n });\n if (!this._completedModels) {\n this._completedModels = true;\n if (this._completedTags) {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, `[CLIENT] emitting: CLIENT_MODELSLOADED`);\n this.emit(\"CLIENT_MODELSLOADED\");\n }\n }\n }\n break;\n case constants.FCL.FRIENDS:\n if (Array.isArray(rdata)) {\n rdata.forEach((model) => {\n if (model !== undefined) {\n const possibleModel = Model_1.Model.getModel(model.uid, model.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(model);\n }\n }\n });\n }\n break;\n case constants.FCL.IGNORES:\n if (Array.isArray(rdata)) {\n rdata.forEach((user) => {\n if (user !== undefined) {\n const possibleModel = Model_1.Model.getModel(user.uid, user.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(user);\n }\n }\n });\n }\n break;\n case constants.FCL.TAGS:\n const tagPayload2 = rdata;\n if (tagPayload2 !== undefined) {\n for (const key in tagPayload2) {\n if (tagPayload2.hasOwnProperty(key)) {\n const possibleModel = Model_1.Model.getModel(key);\n if (possibleModel !== undefined) {\n possibleModel.mergeTags(tagPayload2[key]);\n }\n }\n }\n if (!this._completedTags) {\n this._completedTags = true;\n if (this._completedModels) {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, `[CLIENT] emitting: CLIENT_MODELSLOADED`);\n this.emit(\"CLIENT_MODELSLOADED\");\n }\n }\n }\n break;\n case constants.FCL.SHARE_CLUBS:\n // @TODO\n break;\n case constants.FCL.SHARE_CLUBMEMBERSHIPS:\n // @TODO\n break;\n case constants.FCL.SHARE_CLUBSHOWS:\n if (Array.isArray(rdata)) {\n rdata.forEach((message) => {\n this._packetReceived(new Packet_1.Packet(constants.FCTYPE.CLUBSHOW, \n // tslint:disable-next-line:no-any\n message.model, packet.nTo, packet.nArg1, packet.nArg2, 0, message));\n });\n }\n break;\n default:\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.WARNING, () => `WARNING: _packetReceived unhandled list type on MANAGELIST packet: ${nType}`);\n }\n }\n break;\n case constants.FCTYPE.ROOMDATA:\n if (packet.nArg1 === 0 && packet.nArg2 === 0) {\n if (Array.isArray(packet.sMessage)) {\n const sizeOfModelSegment = 2;\n for (let i = 0; i < packet.sMessage.length; i = i + sizeOfModelSegment) {\n const possibleModel = Model_1.Model.getModel(packet.sMessage[i]);\n if (possibleModel !== undefined) {\n possibleModel.merge({ \"sid\": possibleModel.bestSessionId, \"m\": { \"rc\": packet.sMessage[i + 1] } });\n }\n }\n }\n else if (typeof (packet.sMessage) === \"object\") {\n for (const key in packet.sMessage) {\n if (packet.sMessage.hasOwnProperty(key)) {\n const rdmsg = packet.sMessage;\n const possibleModel = Model_1.Model.getModel(key);\n if (possibleModel !== undefined) {\n possibleModel.merge({ \"sid\": possibleModel.bestSessionId, \"m\": { \"rc\": rdmsg[key] } });\n }\n }\n }\n }\n }\n break;\n case constants.FCTYPE.TKX:\n const auth = packet.sMessage;\n if (auth && auth.cxid && auth.tkx && auth.ctxenc) {\n this.stream_cxid = auth.cxid;\n this.stream_password = auth.tkx;\n const pwParts = auth.ctxenc.split(\"/\");\n this.stream_vidctx = pwParts.length > 1 ? pwParts[1] : auth.ctxenc;\n }\n break;\n case constants.FCTYPE.TOKENINC:\n if (packet.sMessage === undefined) {\n this._tokens = packet.nArg1;\n }\n break;\n case constants.FCTYPE.CLUBSHOW:\n const showDetails = packet.sMessage;\n if (showDetails.op === constants.FCCHAN.WELCOME && showDetails.tksid !== undefined) {\n this._availableClubShows.add(showDetails.model);\n }\n else {\n this._availableClubShows.delete(showDetails.model);\n }\n break;\n default:\n break;\n }\n // Fire this packet's event for any listeners\n this.emit(constants.FCTYPE[packet.FCType], packet);\n this.emit(constants.FCTYPE[constants.FCTYPE.ANY], packet);\n }", "async PacketIO(packet) {\n async function _packetIO(packet, ctx) {\n // console.log(\"SEND DATA: \" + packet.GetBytes() + \" [\" + (new Date().getTime()) + \"]\");\n await ctx.PacketSend(packet);\n return new Promise((resolve, reject) => {\n var timeout;\n\n const _afterData = async (data) => {\n var readBuffer = [...data];\n clearTimeout(timeout);\n ctx.parser.removeListener('data', _afterData);\n // console.log(\"RECEIVE DATA: \" + readBuffer + \" [\" + (new Date().getTime()) + \"]\");\n //await _timeout(1);\n resolve(DpsPacket.FromBytes(readBuffer));\n };\n\n // Reject on timeout\n timeout = setTimeout(() => {\n // console.log(\"TIMEOUT\");\n ctx.parser.removeListener('data', _afterData);\n resolve(null);\n }, DpsConstants.read_timeout);\n\n // Resolve on data\n ctx.parser.on('data', _afterData);\n });\n }\n var data;\n for (var i = 0; i < DpsConstants.retry && !data; i++) {\n if (!this.serialPort.closing || this.serialPort.readable)\n data = await _packetIO(packet, this);\n }\n return data;\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n }", "function inPop(self, packet)\n{\n if(!Array.isArray(packet.js.pop) || packet.js.pop.length == 0) return warn(\"invalid pop of\", packet.js.pop, \"from\", packet.from);\n if(!dhash.isSHA1(packet.js.from)) return warn(\"invalid pop from of\", packet.js.from, \"from\", packet.from);\n\n packet.js.pop.forEach(function(address){\n var pop = seen(self, address);\n if(!pop.line) return warn(\"pop requested for\", address, \"but no line, from\", packet.from);\n var popping = {js:{popping:[packet.js.from, packet.from.ip, packet.from.port].join(',')}};\n send(self, pop, popping);\n });\n delete packet.js.pop;\n}", "function incoming(self, packet)\n{\n debug(\"INCOMING\", self.hashname, packet.id, \"packet from\", packet.from.address, packet.js, packet.body && packet.body.toString());\n\n // signed packets must be processed and verified straight away\n if(packet.js.sig) inSig(self, packet);\n\n // make sure any to is us (for multihosting)\n if(packet.js.to)\n {\n if(packet.js.to !== self.hashname) return warn(\"packet for\", packet.js.to, \"is not us\");\n delete packet.js.to;\n }\n\n // copy back their sender name if we don't have one yet for the \"to\" on answers\n if(!packet.from.hashname && dhash.isSHA1(packet.js.from)) packet.from.hashname = packet.js.from;\n\n // these are only valid when requested, no trust needed\n if(packet.js.popped) inPopped(self, packet);\n\n // new line creation\n if(packet.js.open) inOpen(self, packet);\n\n // incoming lines can happen out of order or before their open is verified, queue them\n if(packet.js.line)\n {\n // a matching line is required\n packet.line = packet.from = self.lines[packet.js.line];\n if(!packet.line) return queueLine(self, packet);\n packet.line.recvAt = Date.now();\n delete packet.js.line;\n }\n \n // must decrypt and start over\n if(packet.line && packet.js.cipher)\n {\n debug(\"deciphering!\")\n var aes = crypto.createDecipher(\"AES-128-CBC\", packet.line.openSecret);\n var deciphered = decode(Buffer.concat([aes.update(packet.body), aes.final()]));\n deciphered.id = packet.id + (packet.id * .2);\n deciphered.from = packet.from;\n deciphered.ciphered = true;\n return incoming(self, deciphered);\n }\n\n // any ref must be validated as someone we're connected to\n if(packet.js.ref)\n {\n var ref = seen(self, packet.js.ref);\n if(!ref.line) return warn(\"invalid ref of\", packet.js.ref, \"from\", packet.from);\n packet.ref = ref;\n delete packet.js.ref;\n }\n\n // process the who \"key\" responses since we know the sender best now\n if(packet.js.key) inKey(self, packet);\n\n // answer who/see here so we have the best from info to decide if we care\n if(packet.js.who) inWho(self, packet);\n if(packet.js.see) inSee(self, packet);\n\n // everything else must have some level of from trust!\n if(!packet.line && !packet.signed && !packet.ref) return inApp(self, packet);\n\n if(dhash.isSHA1(packet.js.seek)) inSeek(self, packet);\n if(packet.js.pop) inPop(self, packet);\n\n // now, only proceed if there's a line\n if(!packet.line) return inApp(self, packet);\n\n // these are line-only things\n if(packet.js.popping) inPopping(self, packet);\n\n // only proceed if there's a stream\n if(!packet.js.stream) return inApp(self, packet);\n\n // this makes sure everything is in sequence before continuing\n inStream(self, packet);\n\n}", "function onDecodeComplete(data) {\n webAudio.decodedBuffer = data;\n // Call all handlers that were waiting for this decode to finish, and clear the handler list.\n webAudio.onDecodeComplete.forEach(function(e) { e(); });\n webAudio.onDecodeComplete = undefined; // Don't allow more callback handlers since audio has finished decoding.\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "onReceive( pdu ) {\n\n // We push it to the Transform object, which spits it out\n // the Readable side of the stream as a 'data' event\n this.push( Buffer.from( pdu.slice(3, pdu.length-1 )));\n\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "function decodePIDResponse(frame) {\n console.log(frame.ID.toUpperCase());\n console.log('PID:' + frame.BYTES[2].toUpperCase());\n if (0x0D == parseInt(frame.BYTES[2], 16)) {\n console.log('Speed: ' + parseInt(frame.BYTES[3], 16) + ' km/h')\n }\n else if (0xA6 == parseInt(frame.BYTES[2], 16)) {\n var sum = 0;\n\n sum += (parseInt(frame.BYTES[3], 16) * (2 ^ 24));\n sum += (parseInt(frame.BYTES[4], 16) * (2 ^ 16));\n sum += (parseInt(frame.BYTES[5], 16) * (2 ^ 8));\n sum += (parseInt(frame.BYTES[6], 16) * (2 ^ 1));\n\n console.log('Odometer: ' + sum + ' km')\n\n }\n else {\n console.log('Data0: ' + frame.BYTES[3] + 'h');\n console.log('Data1: ' + frame.BYTES[4] + 'h');\n console.log('Data2: ' + frame.BYTES[5] + 'h');\n console.log('Data3: ' + frame.BYTES[6] + 'h');\n }\n}", "function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }", "function inSig(self, packet)\n{\n // decode the body as a packet so we can examine it\n var signed = decode(packet.body);\n var sig = packet.js.sig;\n var body = packet.body;\n delete packet.js.sig;\n delete packet.js.body;\n signed.id = packet.id + (packet.id * .1);\n if(!signed.js || !dhash.isSHA1(signed.js.from)) return warn(\"signed packet missing from value from\", packet.from);\n signed.from = seen(self, signed.js.from);\n if(!signed.from.ip) updateAddress(signed.from, packet.from.ip, packet.from.port); // may exist already, don't override until verified\n\n // if a signed packet has a key, it might be the one for this signature! so process it :)\n if(signed.js.key) inKey(self, signed);\n\n // who requests don't need to be verified\n if(signed.js.who) inWho(self, signed);\n\n // where we handle validation if/when there's a key\n getKey(self, signed.from.hashname, function(err, pubkey)\n {\n if(!pubkey) return warn(\"signed packet, no public key for\", signed.from.hashname, \"from\", packet.from, err);\n\n // validate packet.js.sig against packet.body\n var valid = crypto.createVerify(\"RSA-MD5\").update(body).verify(pubkey, sig, \"base64\");\n if(!valid) return warn(\"invalid signature from:\", packet.from);\n\n // make sure our values are correct/current\n updateAddress(signed.from, packet.from.ip, packet.from.port);\n signed.from.pubkey = pubkey;\n\n // process body as a new packet with a real from\n signed.signed = signed.from;\n signed.signed.recvAt = Date.now();\n incoming(self, signed);\n });\n}", "decode() {\n let instruction = new InstructionR_1.InstructionR(this.ins);\n this.binIns = instruction.getBinIns();\n }", "function\nWebSocketIFHandleResponse\n(InPacket)\n{\n if ( InPacket.status == \"Error\" ) {\n SetMessageError(InPacket.message);\n return;\n }\n\n console.log(InPacket);\n if ( InPacket.status == \"OK\" ) {\n WebSocketIFID = InPacket.packetid + 1;\n if ( InPacket.type == \"init\" ) {\n WebSocketIFHandleResponseInit(InPacket.body);\n return;\n }\n }\n}", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n } else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "function onDecodingError(error) {\n console.error('decodeAudioData error', error);\n }", "function\nWebSocketIFHandleResponseInit\n(InPacket)\n{\n}", "function decode(string){\n\n}", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "_readData(buf) {\n this._streamBuffer = Buffer.concat([this._streamBuffer, buf]);\n // The new buffer might contain a complete packet, try to read to find out...\n this._readPacket();\n }", "function decodeStream ( binary ) {\n this.offset = 0;\n this.buf = binary;\n var self = this;\n\n this.remainingLength = function() {\n return self.buf.length - self.offset;\n };\n\n this.remainingData = function() {\n if (self.buf.length == self.offset) {\n return new Uint8Array(0);\n } else {\n return self.buf.slice(self.offset, self.buf.length);\n }\n };\n\n this.ensure = function( n ) {\n if (self.offset + n > self.buf.length) {\n throw \"incomplete_packet\";\n }\n };\n\n this.decodeVarint = function() {\n var multiplier = 1;\n var n = 0;\n var digits = 0;\n var digit;\n do {\n self.ensure(1);\n if (++digits > 4) {\n throw \"malformed\";\n }\n digit = self.buf[self.offset++];\n n += ((digit & 0x7F) * multiplier);\n multiplier *= 128;\n } while ((digit & 0x80) !== 0);\n return n;\n };\n\n this.decode1 = function() {\n self.ensure(1);\n return self.buf[self.offset++];\n };\n\n this.decodeUint16 = function() {\n self.ensure(2);\n var msb = self.buf[self.offset++];\n var lsb = self.buf[self.offset++];\n return (msb << 8) + lsb;\n };\n\n this.decodeUint32 = function() {\n self.ensure(4);\n var b1 = self.buf[self.offset++];\n var b2 = self.buf[self.offset++];\n var b3 = self.buf[self.offset++];\n var b4 = self.buf[self.offset++];\n return (b1 << 24) + (b2 << 16) + (b3 << 8) + b4;\n };\n\n this.decodeBin = function( length ) {\n if (length == 0) {\n return new Uint8Array(0);\n } else {\n self.ensure(length);\n var offs = self.offset;\n self.offset += length;\n return self.buf.slice(offs, self.offset);\n }\n };\n\n this.decodeUtf8 = function() {\n var length = self.decodeUint16();\n return UTF8ToString( self.decodeBin(length) );\n };\n\n this.decodeProperties = function() {\n if (self.remainingLength() == 0) {\n return {};\n }\n var len = self.decodeVarint();\n var end = self.offset + len;\n var props = {};\n while (self.offset < end) {\n var c = self.decode1();\n var p = PROPERTY_DECODE[c];\n if (p) {\n var v;\n var k = p[0];\n switch (p[1]) {\n case \"bool\":\n v = !!(self.decode1());\n break;\n case \"uint32\":\n v = self.decodeUint32();\n break;\n case \"uint16\":\n v = self.decodeUint16();\n break;\n case \"uint8\":\n v = self.decode1();\n break;\n case \"utf8\":\n v = self.decodeUtf8();\n break;\n case \"bin\":\n var count = self.decodeUint16();\n v = self.decodeBin(count);\n break;\n case \"varint\":\n v = self.decodeVarint();\n break;\n case \"user\":\n default:\n // User property\n k = self.decodeUtf8();\n v = self.decodeUtf8();\n break;\n }\n if (p[2]) {\n switch (typeof props[k]) {\n case 'undefined':\n props[k] = v;\n break;\n case 'object':\n // assume array\n props[k].push(v);\n break;\n default:\n props[k] = new Array(props[k], v);\n break;\n }\n } else {\n props[k] = v;\n }\n } else {\n throw \"Illegal property\";\n }\n }\n return props;\n };\n}", "function proprietary_fast_packet (decoder_items) //126720/130816/130817/130818/130819/130820/130821/130824/130827/130828/130831/130832/130834/130835/130836/130837/130838/130839/130840/130842/130843/130845/130847/130850/130851/130856/130880/130881/130944\n{\n var str = \"\";\n switch (fast_packet_byte)\n {\n case 1 :\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n break;\n }\n case 2 :\n {\n var manufacturer_code = multi_byte_value + (((hex_value>>5)&0x7)<<8);\n var reserved = (hex_value>>3)&0x3;\n var industry_code = hex_value&0x7;\n end_item = decoder_items.start_sample_index + (decoder_items.end_sample_index - decoder_items.start_sample_index)/8*3;\n str = LOOKUP_MANUFACTURER(manufacturer_code);\n ScanaStudio.dec_item_new(decoder_items.channel_index, start_item, end_item);\n ScanaStudio.dec_item_add_content(\"Manufacturer Code : \" + str);\n ScanaStudio.dec_item_add_content(\"\" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n end_item,\n \"Fast Packet Data\",\n (\"Manufacturer Code : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n start_item = end_item;\n end_item = decoder_items.start_sample_index + (decoder_items.end_sample_index - decoder_items.start_sample_index)/8*5;\n ScanaStudio.dec_item_new(decoder_items.channel_index, start_item, end_item);\n ScanaStudio.dec_item_add_content(\"Reserved : 0x\" + pad(reserved.toString(16),1));\n ScanaStudio.dec_item_add_content(\"Reserved\");\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n end_item,\n \"Fast Packet Data\",\n (\"Reserved : 0x\" + pad(reserved.toString(16),1)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n str = LOOKUP_INDUSTRY_CODE(industry_code);\n ScanaStudio.dec_item_new(decoder_items.channel_index, end_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Industry Code : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n end_item,\n decoder_items.end_sample_index,\n \"Fast Packet Data\",\n (\"Industry Code : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n default :\n {\n packet_title = \"Byte n°\" + fast_packet_byte;\n item_content = \"0x\" + pad(hex_value.toString(16),2);\n break;\n }\n }\n}", "InitializeDecode(EncodingType, string) {\n\n }", "function Decoder(bytes) {\n var decode=[];\n var string_bin=\"\";\n var tab_bin=[];\n var string_bin_elements=\"\"; \n var buffer=[];\n var i=0;\n var j=0;\n \n // Mise en forme de la payload propre à TTN\n for(i=0;i<bytes.length;i++){ // conversion d'hexa à binaire de tous les bytes puis regroupement sous un seul string\n string_bin_elements=bytes[i].toString(2);\n if(string_bin_elements.length<8){ // PadStart \n var nb_zeros=8-string_bin_elements.length;\n for (j=0;j<nb_zeros;j++){\n string_bin_elements=\"0\"+string_bin_elements;\n }\n }\n string_bin=string_bin+string_bin_elements;\n }\n \n var compte=0;\n for(i=0;i<2*bytes.length;i++){\n buffer[i]=\"\";\n for( j=0;j<4;j++){ // tableau contenant un hexa de la payload par adresse\n buffer[i]=buffer[i]+string_bin.charAt(compte);\n compte++;\n }\n buffer[i]=parseInt(buffer[i],2);\n }\n \n // Décodage\n var Insafe_Carbon_LoRa=0x7;\n \n switch(buffer[0]){\n case Insafe_Carbon_LoRa:\n decode[0]={\"Type_of_Product\":\"Insafe_Carbon_LoRa\"};\n break;\n }\n \n if (buffer[0]==Insafe_Carbon_LoRa){\n // On crée les différents tableaux correspondant à la taille de chaque data en terme de bits \n var tab_decodage_Real_Time=[4,4,8,8,8,3,4,3,3,3,3,2,3]; // Exemple: la 2ème information donc [1] est codée sur 4 bits\n var tab_decodage_Product_Status_Message=[4,4,2,1,3,2,8,8,6,4,5,5,6,6];\n var tab_decodage_Push=[4,4,3,3,2];\n var tab_decodage_Datalog=[4,4,8,8,8,8,8,8,8,8,8,4,3,1];\n var tab_decodage_Temperature_Alert=[4,4,8,1,1,3,3];\n var tab_decodage_CO2_Alert=[4,4,8,3,1,1,3];\n var tab_decodage_Config_CO2=[4,4,8,8,6,6,6,6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,8];\n var tab_decodage_Config_General=[4,4,1,1,1,1,1,1,1,1,8,8,8,8,8,8,8,8,2,6];\n var tab_decodage_Keepalive=[4,4];\n \n // On initialise les différents type de message pour les Carbon\n var Type_Real_Time= 0x2;\n var Type_Product_Status_Message=0x3;\n var Type_Push= 0x4;\n var Type_Datalog=0x5;\n var Type_Temperature_Alert=0x6;\n var Type_CO2_Alert=0x7;\n var Type_Config_CO2=0x8;\n var Type_Config_General=0x9;\n var Type_Keep_Alive=0xA;\n \n //Tous les indicateurs sont codés de la même manière pour coder plus efficacement on crée un tableau\n // qui contient tous ces adjectifs\n \n var tab_adjectif=[\"Excellent\",\"Good\",\"Fair\",\"Poor\",\"Bad\",\"Erreur\",\"All\",\"Dryness Indicator\",\"Mould Indicator\",\"Dust Mites Indicator\",\"CO\",\"CO2\"];\n \n // Avec buffer[1], on détermine le Type de Message\n switch(buffer[1]){\n case Type_Real_Time:\n tab_decode(tab_decodage_Real_Time); //(VOIR EN FIN DE PROGRAMME) On passe le tableau correspondant au message dans la fonction tab_decode, cette fonction renvoie tab_bin. \n decode[1]={\"Type_of_message\":\"Real_Time\"};\n decode[2]={\"CO2_concentration_(ppm)\": 20*tab_bin[2]};\n decode[3]={\"Temperature(°C)\": Math.round(0.2*tab_bin[3] * 10) / 10};\n decode[4]={\"Relative_Humidity_(%RH)\": 0.5*tab_bin[4]};\n decode[5]={\"IAQ_GLOBAL\":get_iaq(tab_bin[5])};\n decode[6]={\"IAQ_SRC\":get_iaq_SRC(tab_bin[6])};\n decode[7]={\"IAQ_CO2\":get_iaq(tab_bin[7])};\n decode[8]={\"IAQ_DRY\":get_iaq(tab_bin[8])};\n decode[9]={\"IAQ_MOULD\":get_iaq(tab_bin[9])};\n decode[10]={\"IAQ_DM\":get_iaq(tab_bin[10])};\n decode[11]={\"IAQ_HCI\":get_IAQ_HCI(tab_bin[11])};\n decode[12]={\"Frame_Index\":tab_bin[12]};\n break;\n \n case Type_Product_Status_Message:\n tab_decode(tab_decodage_Product_Status_Message);\n decode[1]={\"Type_of_message\":\"Product_Status_Message\"};\n decode[2]={\"Battery_level\":battery(tab_bin[2])};\n decode[3]={\"HW_Fault_mode\":hw_mode(tab_bin[3])};\n decode[4]={\"Frame_Index\":tab_bin[4]};\n decode[5]={\"Not_used\":\"\"};\n decode[6]={\"Product_hours_meter(per month)\":tab_bin[6]};\n decode[7]={\"CO2_autocalibration_value_(ppm)\": 20*tab_bin[7]};\n decode[8]={\"Product_RTC_date_since_2000 (in years)\": tab_bin[8]};\n decode[9]={\"Product_RTC_date__Month_of_the_year\":tab_bin[9]};\n decode[10]={\"Product_RTC_date__Day_of_the_month\":tab_bin[10]};\n decode[11]={\"Product_RTC_date_Hours_of_the_day\":tab_bin[11]};\n decode[12]={\"Product_RTC_date__Minutes_of_the_hour\":tab_bin[12]};\n decode[13]={\"Not_used\":\"\"};\n break;\n \n case Type_Push:\n tab_decode(tab_decodage_Push); \n decode[1]={\"Type_of_message\":\"Push\"};\n decode[2]={\"Push_Button_Action\": push_button(tab_bin[2])};\n decode[3]={\"Frame_Index\":tab_bin[3]};\n decode[4]={\"Not_used\":\"\"}\n break;\n \n case Type_Datalog:\n tab_decode(tab_decodage_Datalog); \n decode[1]={\"Type_of_message\":\"Datalog\"};\n decode[2]={\"CO2_concentration(ppm)_[n-2]\": 20*tab_bin[2]};\n decode[3]={\"Temperature(°C) [n-2]\": Math.round(0.2*tab_bin[3] * 10) / 10};\n decode[4]={\"Relative Humidity(%) [n-2]\": 0.5*tab_bin[4]};\n decode[5]={\"CO2_concentration(ppm)_[n-1]\": 20*tab_bin[5]};\n decode[6]={\"Temperature(°C) [n-1]\": Math.round(0.2*tab_bin[6] * 10) / 10};\n decode[7]={\"Relative Humidity(%) [n-1]\": 0.5*tab_bin[7]};\n decode[8]={\"CO2_concentration(ppm) [n]\": 20*tab_bin[8]};\n decode[9]={\"Temperature(°C) [n]\": Math.round(0.2*tab_bin[9] * 10) / 10};\n decode[10]={\"Relative Humidity(%) [n]\": 0.5*tab_bin[10]}; \n decode[11]={\"Time_between_measurements_in_minutes\": 10*tab_bin[11]};\n decode[12]={\"Frame_Index\":tab_bin[12]}; \n decode[13]={\"Not_used\":\"\"}; \n break;\n \n case Type_Temperature_Alert:\n tab_decode(tab_decodage_Temperature_Alert); \n decode[1]={\"Type_of_message\":\"Temperature_Alert\"};\n decode[2]={\"Temperature(°C)\": Math.round(0.2*tab_bin[2] * 10) / 10};\n decode[3]={\"Temperature threshold 1\":th(tab_bin[3])};\n decode[4]={\"Temperature threshold 2\":th(tab_bin[4])};\n decode[5]={\"Frame_Index\":tab_bin[5]}; \n decode[6]={\"Not_used\":\"\"}; \n break;\n \n case Type_CO2_Alert:\n tab_decode(tab_decodage_CO2_Alert); \n decode[1]={\"Type_of_message\":\"CO2_Alert\"};\n decode[2]={\"CO2_concentration(ppm)\": 20*tab_bin[2]};\n decode[3]={\"Frame_Index\":tab_bin[3]}; \n decode[4]={\"CO2_threshold_1\":th(tab_bin[4])};\n decode[5]={\"CO2_threshold_2\":th(tab_bin[5])};\n decode[6]={\"Not_used\":\"\"}; \n break;\n \n case Type_Config_CO2:\n tab_decode(tab_decodage_Config_CO2); \n decode[1]={\"Type_of_message\":\"Config_CO2\"};\n decode[2]={\"CO2_threshold_1\":20*tab_bin[2]};\n decode[3]={\"CO2_threshold_2\":20*tab_bin[3]};\n decode[4]={\"Smart Period 1 start at: (hour)\":0.5*tab_bin[4]};\n decode[5]={\"Smart Period 1 duration (hour)\":0.5*tab_bin[5]}; \n decode[6]={\"Smart Period 2 start at: (hour)\":0.5*tab_bin[6]};\n decode[7]={\"Smart Period 2 duration (hour)\":0.5*tab_bin[7]}; \n decode[8]={\"Smart Period 1\": active(tab_bin[8])};\n decode[9]={\"Smart Period 1 on Monday\": active(tab_bin[9])};\n decode[10]={\"Smart Period 1 on Tuesday\": active(tab_bin[10])};\n decode[11]={\"Smart Period 1 on Wednesday\": active(tab_bin[11])};\n decode[12]={\"Smart Period 1 on Thursday\": active(tab_bin[12])}; \n decode[13]={\"Smart Period 1 on Friday\": active(tab_bin[13])};\n decode[14]={\"Smart Period 1 on Saturday\": active(tab_bin[14])};\n decode[15]={\"Smart Period 1 on Sunday\": active(tab_bin[15])};\n decode[16]={\"Smart Period 2\": active(tab_bin[16])};\n decode[17]={\"Smart Period 2 on Monday\": active(tab_bin[17])};\n decode[18]={\"Smart Period 2 on Tuesday\": active(tab_bin[18])};\n decode[19]={\"Smart Period 2 on Wednesday\": active(tab_bin[19])};\n decode[20]={\"Smart Period 2 on Thursday\": active(tab_bin[20])}; \n decode[21]={\"Smart Period 2 on Friday\": active(tab_bin[21])};\n decode[22]={\"Smart Period 2 on Saturday\": active(tab_bin[22])};\n decode[23]={\"Smart Period 2 on Sunday\": active(tab_bin[23])}; \n decode[24]={\"Altitude\":50*tab_bin[24]}; \n \n break;\n \n case Type_Config_General:\n tab_decode(tab_decodage_Config_General); \n decode[1]={\"Type_of_message\":\"Config_General\"};\n decode[2]={\"LED blink\": active(tab_bin[2])};\n decode[3]={\"Button Notification\": active(tab_bin[3])}; \n decode[4]={\"Real-time data\": active(tab_bin[4])}; \n decode[5]={\"Datalog enable\": active(tab_bin[5])}; \n decode[6]={\"Temperature Alert\": active(tab_bin[6])}; \n decode[7]={\"CO2 Alert\": active(tab_bin[7])}; \n decode[8]={\"Keep Alive\": active(tab_bin[8])}; \n decode[9]={\"Orange_Led\":active(tab_bin[9])}; \n decode[10]={\"Period between measurements (CO2,temperature, humidity) (minutes)\": tab_bin[10]}; \n decode[11]={\"Datalog decimation factor(record only 1 on x samples)\":tab_bin[11]};\n decode[12]={\"Temperature alert threshold 1 (°C)\": 0.2*tab_bin[12]};\n decode[13]={\"Temperature alert threshold 2 (°C)\": 0.2*tab_bin[13]}; \n decode[14]={\"Temperature change leading to a real-time message transmission (°C)\": 0.1*tab_bin[14]}; \n decode[15]={\"Relative humidity change leading to a real-time message transmission (%RH)\": 0.5*tab_bin[15]}; \n decode[16]={\"CO2 concentration change leading to a realtime message transmission(ppm)\": 20*tab_bin[16]}; \n decode[17]={\"Keepalive period (h)\": tab_bin[17]}; \n decode[18]={\"NFC_status\":nfc_status(tab_bin[18])};\n decode[19]={\"Not_Used\":\"\"};\n break;\n \n case Type_Keep_Alive:\n decode[1]={\"Type_of_message\":\"Keep_Alive\"};\n break;\n }\n }\n \n var new_msg={payload:decode};\n return new_msg;\n \n function tab_decode (tab){ // on rentre en paramètre la table propre à chaque message \n var compteur=0;\n for ( i=0; i<tab.length;i++){ // tab.length nousdonne donc le nombre d'information à décoder pour ce message \n tab_bin[i]=\"\";\n for ( j=0; j<tab[i];j++){ // tab[i] nous donne le nombre de bits sur lequel est codée l'information i \n str1=string_bin.charAt(compteur); // compteur va aller de 0 jusqu'à la longueur de string_bin\n tab_bin[i]=tab_bin[i]+str1; // A la fin de ce deuxième for: tab_bin[i] sera composé de tab[i] bits \n compteur++;\n }\n // Problème si tab[i] bits est différent de 4 (ou 8) bits ca ne correspond à 1 (ou 2) hexa donc: ne pourra pas conrrectement convertir les binaires en hexa\n // Donc il faut qu'on fasse un bourrage de 0 grâce à padstart\n if (tab_bin[i].length>4){ // pour les données de tailles supérieures à 4 bits et inféireures ou égales à 8 bits\t\t\n //tab_bin[i]=tab_bin[i].padStart(8,'0');\n tab_bin[i]=parseInt(tab_bin[i] , 2).toString(16).toUpperCase(); // Puis on convertit les binaire en hexa (en string)\n tab_bin[i]=parseInt(tab_bin[i],16) ;//puis on convertit les string en int\t\n }\n else{ // pour les données de tailles inférieures ou égales à 4 bits\n //tab_bin[i]=tab_bin[i].padStart(4,'0');\n tab_bin[i]=parseInt(tab_bin[i] , 2).toString(16).toUpperCase();\n tab_bin[i]=parseInt(tab_bin[i], 16);\n }\n }\n }\n \n \n function get_iaq (a){\n var result=\"\";\n switch(a){\n case 0:\n result=tab_adjectif[0];\n break;\n case 1:\n result=tab_adjectif[1];\n break;\n case 2:\n result=tab_adjectif[2];\n break;\n case 3:\n result=tab_adjectif[3];\n break;\n case 4:\n result=tab_adjectif[4];\n break;\n case 5:\n result=tab_adjectif[5];\n break;\n }\n return result; \n }\n \n function get_iaq_SRC(a){\n \n var result=\"\";\n switch(a){\n case 0:\n result=tab_adjectif[6];\n break;\n case 1:\n result=tab_adjectif[7];\n break;\n case 2:\n result=tab_adjectif[8];\n break;\n case 3:\n result=tab_adjectif[9];\n break;\n case 4:\n result=tab_adjectif[10];\n break;\n case 5:\n result=tab_adjectif[11];\n break;\n case 15:\n result=tab_adjectif[5];\n break;\n }\n return result; \n }\n \n function get_IAQ_HCI(a){\n var result=\"\";\n switch(a){\n case 0:\n result=tab_adjectif[1];\n break;\n case 1:\n result=tab_adjectif[2];\n break;\n case 2:\n result=tab_adjectif[4];\n break;\n case 3:\n result=tab_adjectif[5];\n break;\n }\n return result; \n }\n \n \n function tab_decode (tab){ // on rentre en paramètre la table propre à chaque message \n var compteur=0;\n for ( i=0; i<tab.length;i++){ // tab.length nousdonne donc le nombre d'information à décoder pour ce message \n tab_bin[i]=\"\";\n for ( j=0; j<tab[i];j++){ // tab[i] nous donne le nombre de bits sur lequel est codée l'information i \n str1=string_bin.charAt(compteur); // compteur va aller de 0 jusqu'à la longueur de string_bin\n tab_bin[i]=tab_bin[i]+str1; // A la fin de ce deuxième for: tab_bin[i] sera composé de tab[i] bits \n compteur++\n }\n \n // Problème si tab[i] bits est différent de 4 (ou 8) bits ca ne correspond à 1 (ou 2) hexa donc: ne pourra pas conrrectement convertir les binaires en hexa\n // Donc il faut qu'on fasse un bourrage de 0 grâce à padstart\n if (tab_bin[i].length>4){ // pour les données de tailles supérieures à 4 bits et inféireures ou égales à 8 bits\n var nb_zeros=8-tab_bin[i].length;\n for (j=0;j<nb_zeros;j++){\n tab_bin[i]=\"0\"+tab_bin[i];\n }\n tab_bin[i]=parseInt(tab_bin[i] , 2).toString(16).toUpperCase(); // Puis on convertit les binaire en hexa (en string)\n tab_bin[i]=parseInt(tab_bin[i],16) //puis on convertit les string en int\n }\t\n else{ // pour les données de tailles inférieures ou égales à 4 bits\n var nb_zeros=8-tab_bin[i].length;\n for (j=0;j<nb_zeros;j++){\n tab_bin[i]=\"0\"+tab_bin[i];\n }\n tab_bin[i]=parseInt(tab_bin[i] , 2).toString(16).toUpperCase();\n tab_bin[i]=parseInt(tab_bin[i], 16);\n }\n }\n return tab_bin; \n }\n \n \n function battery(a){\n result=\"\";\n switch(a){\n case 0:\n result=\"High\";\n break;\n case 1: \n result=\"Medium\";\n break;\n case 2: \n result=\"Critical\";\n break;\n }\n return result;\n }\n \n \n function hw_mode(a){\n result=\"\";\n switch(a){\n case 0:\n result=\" non activated\";\n break;\n case 1: \n result=\" activated\";\n break;\n }\n return result;\n }\n \n function push_button(a){\n result=\"\";\n switch(a){\n case 0: \n result=\"Short Push\";\n break;\n \n case 1: \n result=\"Long Push\";\n break;\n \n case 2: \n result=\"Multiple Push(x3)\"; \n break;\n \n case 3: \n result=\"Multiple Push(x6)\"; \n break; \n }\n \n return result;\n }\n \n function th(a){\n result=\"\";\n switch(a){\n case 0: \n result=\"not reached\";\n break;\n case 1: \n result=\"reached\";\n break;\n }\n return result;\n }\n \n function active(a){\n result=\"\";\n switch(a){\n case 0: \n result=\"Non-Active\";\n break;\n case 1: \n result=\"Active\";\n }\n return result;\n }\n \n function nfc_status(a)\n {\n result=\"\";\n switch(a){\n case 0: \n result=\"Discoverable\";\n break;\n case 1: \n result=\"Not_Discoverable\";\n }\n return result;\n }\n \n msg.payload=decode;\n return msg;\n \n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace) return;\n\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n } else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n\n break;\n\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message); // @ts-ignore\n\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "function processPayload(socket, fBytes, handleText = undefined, handleBinary = undefined)\n{\n /* Attempt to parse the frame getting the frame's payload and then processing\n * that data from there */\n try \n {\n processFrameData(socket, fBytes, handleText, handleBinary);\n }\n catch (error)\n {\n // Close the socket connection \n socket.destroy({message: \"Incoming Frame Proccessing Error: \" + \n error.message});\n }\n}", "function onData(d){\n var frame,\n generatedData,\n response;\n\n frame = TBus.parse(d);\n\n if(!frame.valid){\n console.log(\"Invalid frame received.\");\n return;\n }\n\n if(!Devices[frame.receiver[0]]){\n console.log(\"Device is not supported.\");\n }\n\n generatedData = Devices[frame.receiver[0]].randomData();\n response = TBus.prepareCommand(frame.sender, frame.receiver, generatedData);\n\n setTimeout(function(){\n /*\n var one,\n two;\n\n one = new Buffer(response.slice(0,5));\n two = new Buffer(response.slice(5,response.length));\n serialPort.write(one);\n setTimeout(function(){\n serialPort.write(two);\n },110);\n */\n serialPort.write(response);\n },0);\n}", "function readPayload(buffer, frame, encoders, offset) {\n if (isMetadata(frame.flags)) {\n const metaLength = readUInt24BE(buffer, offset);\n offset += UINT24_SIZE;\n if (metaLength > 0) {\n frame.metadata = encoders.metadata.decode(\n buffer,\n offset,\n offset + metaLength\n );\n\n offset += metaLength;\n }\n }\n if (offset < buffer.length) {\n frame.data = encoders.data.decode(buffer, offset, buffer.length);\n }\n }", "function Decoder(view, offset) {\n\t\tthis.offset = offset || 0;\n\t\tthis.view = view;\n\t}", "function alert_byte (decoder_items)\n{\n var str = \"\";\n switch (fast_packet_byte)\n {\n case 1 :\n {\n var alert_type = (hex_value>>4);\n var alert_category = hex_value&0xF;\n switch (alert_type)\n {\n case 1 :\n {\n str = \"Emergency Alarm\";\n break;\n }\n case 2 :\n {\n str = \"Alarm\";\n break;\n }\n case 5 :\n {\n str = \"Warning\";\n break;\n }\n case 8 :\n {\n str = \"Caution\";\n break;\n }\n case 14 :\n {\n str = \"Data out of range\";\n break;\n }\n case 15 :\n {\n str = \"Data not available\";\n break;\n }\n default :\n {\n str = \"Reserved\";\n break;\n }\n }\n end_alert_type = decoder_items.start_sample_index + 4*(decoder_items.end_sample_index - decoder_items.start_sample_index)/8;\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index,end_alert_type);\n ScanaStudio.dec_item_add_content(\"Alert Type : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_add_content(\"0x\" + pad(alert_type.toString(16),1));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index,\n end_alert_type,\n \"Alert Data\",\n (\"Alert Type : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n switch (alert_category)\n {\n case 0 :\n {\n str = \"Navigational\";\n break;\n }\n case 1 :\n {\n str = \"Technical\";\n break;\n }\n case 14 :\n {\n str = \"Data out of range\";\n break;\n }\n case 15 :\n {\n str = \"Data not available\";\n break;\n }\n default :\n {\n str = \"Reserved\";\n break;\n }\n }\n ScanaStudio.dec_item_new(decoder_items.channel_index,end_alert_type,decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Alert Category : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_add_content(\"0x\" + pad(alert_category.toString(16),1));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n end_alert_type,\n decoder_items.end_sample_index,\n \"Alert Category\",\n (str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 2 :\n {\n item_content = \"Alert System : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n case 3 :\n {\n item_content = \"Alert Sub-System : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n case 4 :\n case 5 :\n {\n item_content = \"Alert ID : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n case 6 :\n case 7 :\n case 8 :\n case 9 :\n case 10 :\n case 11 :\n case 12 :\n case 13 :\n {\n item_content = \"Source Network ID NAME : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n case 14 :\n {\n item_content = \"Data Source Instance : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n case 15 :\n {\n item_content = \"Data Source Index/Source : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n case 16 :\n {\n item_content = \"Alert Occurrence Number : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n case 17 :\n {\n var bit_length = (decoder_items.end_sample_index - decoder_items.start_sample_index)/8;\n if (((hex_value>>7)&0x1) == 0)\n {\n str = \"Not Temporary Silence\";\n }\n else\n {\n str = \"Temporary Silence\";\n }\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index,decoder_items.start_sample_index + bit_length);\n ScanaStudio.dec_item_add_content(\"Temporary Silence Status : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index,\n decoder_items.start_sample_index + bit_length,\n \"Temp Silence Stat\",\n (str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n if (((hex_value>>6)&0x1) == 0)\n {\n str = \"Not Acknowledged\";\n }\n else\n {\n str = \"Acknowledged\";\n }\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index + bit_length,decoder_items.start_sample_index + 2*bit_length);\n ScanaStudio.dec_item_add_content(\"Acknowledge Status : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index + bit_length,\n decoder_items.start_sample_index + 2*bit_length,\n \"Alert Data\",\n (\"Ack Status : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n if (((hex_value>>5)&0x1) == 0)\n {\n str = \"Not Escalated\";\n }\n else\n {\n str = \"Escalated\";\n }\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index + 2*bit_length,decoder_items.start_sample_index + 3*bit_length);\n ScanaStudio.dec_item_add_content(\"Escalation Status : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index + 2*bit_length,\n decoder_items.start_sample_index + 3*bit_length,\n \"Alert Data\",\n (\"Escalation Stat : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n if (((hex_value>>4)&0x1) == 0)\n {\n str = \"Not Supported\";\n }\n else\n {\n str = \"Supported\";\n }\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index + 3*bit_length,decoder_items.start_sample_index + 4*bit_length);\n ScanaStudio.dec_item_add_content(\"Temporary Silence Status : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index + 3*bit_length,\n decoder_items.start_sample_index + 4*bit_length,\n \"Alert Data\",\n (\"Temp Silence : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n if (((hex_value>>3)&0x1) == 0)\n {\n str = \"Not Supported\";\n }\n else\n {\n str = \"Supported\";\n }\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index + 4*bit_length,decoder_items.start_sample_index + 5*bit_length);\n ScanaStudio.dec_item_add_content(\"Acknowledge Status : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index + 4*bit_length,\n decoder_items.start_sample_index + 5*bit_length,\n \"Alert Data\",\n (\"Ack Status : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n if (((hex_value>>2)&0x1) == 0)\n {\n str = \"Not Supported\";\n }\n else\n {\n str = \"Supported\";\n }\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index + 5*bit_length,decoder_items.start_sample_index + 6*bit_length);\n ScanaStudio.dec_item_add_content(\"Escalation Status : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index + 5*bit_length,\n decoder_items.start_sample_index + 6*bit_length,\n \"Alert Data\",\n (\"Escalation Stat : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n // NMEA Reserved\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index + 6*bit_length,decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"NMEA Reserved : 0x\" + ((hex_value)&0x3));\n ScanaStudio.dec_item_add_content(((hex_value)&0x3));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index + 6*bit_length,\n decoder_items.end_sample_index,\n \"Alert Data\",\n (\"NMEA Reserved : 0x\" + ((hex_value)&0x3)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 18 :\n case 19 :\n case 20 :\n case 21 :\n case 22 :\n case 23 :\n case 24 :\n case 25 :\n {\n item_content = \"Acknowledge ID NAME : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n case 26 :\n {\n var alert_trigger = (hex_value>>4);\n var alert_treshold = hex_value&0xF;\n switch (alert_type)\n {\n case 0 :\n {\n str = \"Manual\";\n break;\n }\n case 1 :\n {\n str = \"Auto\";\n break;\n }\n case 2 :\n {\n str = \"Test\";\n break;\n }\n case 3 :\n {\n str = \"Disabled\";\n break;\n }\n case 14 :\n {\n str = \"Data out of range\";\n break;\n }\n case 15 :\n {\n str = \"Data not available\";\n break;\n }\n default :\n {\n str = \"Reserved\";\n break;\n }\n }\n end_alert_trigger = decoder_items.start_sample_index + 4*(decoder_items.end_sample_index - decoder_items.start_sample_index)/8;\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index,end_alert_trigger);\n ScanaStudio.dec_item_add_content(\"Alert Trigger Condition : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index,\n end_alert_trigger,\n \"Alert Data\",\n \"Alert Trig Cond : \" + str,\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n switch (alert_treshold)\n {\n case 0 :\n {\n str = \"Normal\";\n break;\n }\n case 1 :\n {\n str = \"Threshold Exceeded\";\n break;\n }\n case 2 :\n {\n str = \"Extreme Threshold Exceeded\";\n break;\n }\n case 3 :\n {\n str = \"Low Threshold Exceeded\";\n break;\n }\n case 4 :\n {\n str = \"Acknowledged\";\n break;\n }\n case 5 :\n {\n str = \"Awaiting Acknowledge\";\n break;\n }\n case 14 :\n {\n str = \"Data out of range\";\n break;\n }\n case 15 :\n {\n str = \"Data not available\";\n break;\n }\n default :\n {\n str = \"Reserved\";\n break;\n }\n }\n ScanaStudio.dec_item_new(decoder_items.channel_index,end_alert_trigger,decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Alert Threshold Status : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n end_alert_trigger,\n decoder_items.end_sample_index,\n \"Threshold Status\",\n str,\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 27 :\n {\n item_content = \"Alert Priority : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n case 28 :\n {\n switch (hex_value)\n {\n case 0 :\n {\n str = \"Disabled\";\n break;\n }\n case 1 :\n {\n str = \"Normal\";\n break;\n }\n case 2 :\n {\n str = \"Active\";\n break;\n }\n case 3 :\n {\n str = \"Silenced\";\n break;\n }\n case 4 :\n {\n str = \"Acknowledged\";\n break;\n }\n case 5 :\n {\n str = \"Awaiting Acknowledge\";\n break;\n }\n case 14 :\n {\n str = \"Data out of range\";\n break;\n }\n case 15 :\n {\n str = \"Data not available\";\n break;\n }\n default :\n {\n str = \"Reserved\";\n break;\n }\n }\n item_content = \"Alert State : \" + str;\n break;\n }\n default :\n {\n packet_title = \"Filled Data\";\n if (hex_value == 255)\n {\n item_content = \"Filled with 0xFF\";\n }\n else\n {\n item_content = \"0x\" + pad(hex_value.toString(16),2) + \", should be 0xFF\";\n types_title = ScanaStudio.PacketColors.Error.Title;\n types_content = ScanaStudio.PacketColors.Error.Content;\n }\n }\n }//end switch (byte)\n}//end function alert_byte", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n super.emit(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n super.emit(\"connect_error\", err);\n break;\n }\n }", "decodePdu( encoded ) {\n\n let values = [];\n\n let index = 0;\n\n while( index < encoded.length ) {\n if( encoded[index] === MSG_TOKEN_ESC && index < encoded.length-1 ) {\n index++;\n\n if( encoded[index] === MSG_START_STUFF ){\n values.push( MSG_TOKEN_START );\n }\n else if( encoded[index] === MSG_ESC_STUFF ){\n values.push( MSG_TOKEN_ESC );\n }\n\n }\n else {\n values.push( encoded[index] );\n }\n\n index++;\n\n }\n\n return values;\n }", "function decode()\n{\n\tvar uartData;\n\tvar uartDataCnt = 0;\n\n\tif (!check_scanastudio_support())\n {\n add_to_err_log(\"Please update your ScanaStudio software to the latest version to use this decoder\");\n return;\n }\n\n\tPKT_COLOR_DATA = get_ch_light_color(ch);\n\tPKT_COLOR_GENER_TITLE = dark_colors.gray;\n\tPKT_COLOR_GPGGA_TITLE = dark_colors.blue;\n\tPKT_COLOR_GPGSA_TITLE = dark_colors.orange;\n\tPKT_COLOR_GPGSV_TITLE = dark_colors.green;\n\tPKT_COLOR_GPRMC_TITLE = dark_colors.violet;\n\n\tget_ui_vals();\n\t\n\tvar decBuf = pre_decode(\"uart.js\", \"ch = \" + ch + \";\"\n + \"baud = \" + baud + \";\"\n\t\t\t\t\t\t\t\t\t+ \"nbits = \" + 3 + \";\"\t\t// 8-bit word\n\t\t\t\t\t\t\t\t\t+ \"parity = \" + 0 + \";\"\t\t// no parity\n\t\t\t\t\t\t\t\t\t+ \"stop = \" + 0 + \";\" // 1 stop\n\t\t\t\t\t\t\t\t\t+ \"order = \" + 0 + \";\" // LSB first\n\t\t\t\t\t\t\t\t\t+ \"invert = \" + 0);\t\t\t// non inverted\n\n\twhile (decBuf.length > uartDataCnt)\n\t{\n\t\tuartData = decBuf[uartDataCnt];\n\t\tuartDataCnt++;\n\n\t\tif (uartData.data.length > 0)\n\t\t{\n\t\t\tif (String.fromCharCode(uartData.data) == \"$\")\n\t\t\t{\n\t\t\t\tvar msg = String.fromCharCode(uartData.data);\n\t\t\t\tvar stOfMsg = uartData.start_s, endOfMsg;\n\n\t\t\t\twhile ((String.fromCharCode(uartData.data) != \"\\r\") && (decBuf.length > uartDataCnt))\n\t\t\t\t{\n\t\t\t\t\tuartData = decBuf[uartDataCnt];\n\t\t\t\t\tuartDataCnt++;\n\n\t\t\t\t\tendOfMsg = uartData.end_s;\n\n\t\t\t\t\tif (uartData.data.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, uartData.data);\n\t\t\t\t\t\tmsg += String.fromCharCode(uartData.data);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar outMsgArr = msg.split(\",\");\n\t\t\t\tvar msgId = outMsgArr.shift();\n\t\t\t\tmsgId = msgId.slice(1);\n\n\t\t\t\tdec_item_new(ch, stOfMsg , endOfMsg);\n\t\t\t\tdec_item_add_pre_text(msg);\n\t\t\t\tdec_item_add_pre_text(msgId);\n\n\t\t\t\tpkt_start(\"NMEA 0183\");\n\n\t\t\t\tif (msgId == \"GPGGA\")\n\t\t\t\t{\n\t\t\t\t\tpkt_add_item(-1, -1, msgId, \"\", PKT_COLOR_GPGGA_TITLE, PKT_COLOR_DATA);\n\t\t\t\t\tpkt_start(msgId);\n\n\t\t\t\t\tvar utc = outMsgArr.shift();\n\n\t\t\t\t\tif (utc.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tutc = utc.slice(0, 2) + \":\" + utc.slice(2, 4) + \":\" + utc.slice(4, 6) + \".\" + utc.slice(7, 10);\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(utc, \"\", \"UTC TIME\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar latitude = outMsgArr.shift();\n\t\t\t\t\tvar ns = outMsgArr.shift();\n\n\t\t\t\t\tif (latitude.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlatitude = latitude.slice(0, 2) + \"°\" + latitude.slice(2, 4) + \"'\" + latitude.slice(5, 9) + '\"';\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(latitude, ns, \"LATITUDE\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar longitude = outMsgArr.shift();\n\t\t\t\t\tvar ew = outMsgArr.shift();\n\n\t\t\t\t\tif (longitude.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlongitude = longitude.slice(0, 2) + \"°\" + longitude.slice(2, 4) + \"'\" + longitude.slice(5, 9) + '\"';\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(longitude, ew, \"LONGITUDE\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar posFix = outMsgArr.shift();\n\t\t\t\t\tvar posFixStr;\n\n\t\t\t\t\tswitch (posFix)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"0\": posFixStr = \"Fix not available or invalid\"; break;\n\t\t\t\t\t\tcase \"1\": posFixStr = \"SPS Mode\"; break;\n\t\t\t\t\t\tcase \"2\": posFixStr = \"Diff SPS Mode\"; break;\n\t\t\t\t\t\tcase \"3\": posFixStr = \"PPS Mode\"; break;\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(posFixStr, \"\", \"POS FIX IND\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar satNum = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(satNum, \"\", \"TOTAL SAT\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar hdop = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(satNum, \"\", \"HDOP\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar altitude = outMsgArr.shift();\n\t\t\t\t\tvar units = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(altitude, (\" \" + units), \"ALTITUDE\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar geoid = outMsgArr.shift();\n\t\t\t\t\tunits = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(geoid, (\" \" + units), \"GEOID SEP\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar ageDiff = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(ageDiff, \"\", \"AGE DIFF\", PKT_COLOR_GPGGA_TITLE);\n\n\t\t\t\t\tvar checksum = verify_checksum(msg);\n\t\t\t\t\tpkt_add_item(-1, -1, \"CHECKSUM\", checksum, PKT_COLOR_GPGGA_TITLE, PKT_COLOR_DATA);\n\n\t\t\t\t\tpkt_end();\n\t\t\t\t}\n\n\t\t\t\tif (msgId == \"GPGSV\")\n\t\t\t\t{\n\t\t\t\t\tpkt_add_item(-1, -1, msgId, \"\", PKT_COLOR_GPGSV_TITLE, PKT_COLOR_DATA);\n\t\t\t\t\tpkt_start(msgId);\n\n\t\t\t\t\tvar numMsg = outMsgArr.shift();\t\t\t\t\t\n\t\t\t\t\tadd_pkt_data(numMsg, \"\", \"TOTAL MSG\", PKT_COLOR_GPGSV_TITLE);\n\n\t\t\t\t\tvar msgNum = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(msgNum, \"\", \"MSG NUM\", PKT_COLOR_GPGSV_TITLE);\n\n\t\t\t\t\tvar satNum = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(satNum, \"\", \"TOTAL SAT\", PKT_COLOR_GPGSV_TITLE);\n\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tvar satId = outMsgArr.shift();\n\t\t\t\t\t\tadd_pkt_data(satId, \"\", \"SAT ID\", PKT_COLOR_GPGSV_TITLE);\n\t\t\t\t\t\tif (outMsgArr[0] == \"*\") break;\n\n\t\t\t\t\t\tvar elevation = outMsgArr.shift();\t\t\t\t\t\t\n\t\t\t\t\t\tadd_pkt_data(elevation, \" deg\", \"ELEVATION\", PKT_COLOR_GPGSV_TITLE);\n\t\t\t\t\t\tif (outMsgArr[0] == \"*\") break;\n\n\t\t\t\t\t\tvar azimuth = outMsgArr.shift();\n\t\t\t\t\t\tadd_pkt_data(azimuth, \" deg\", \"AZIMUTH\", PKT_COLOR_GPGSV_TITLE);\n\t\t\t\t\t\tif (outMsgArr[0] == \"*\") break;\n\n\t\t\t\t\t\tvar snr = outMsgArr.shift();\n\t\t\t\t\t\tadd_pkt_data(azimuth, \" dB\", \"SNR\", PKT_COLOR_GPGSV_TITLE);\n\t\t\t\t\t\tif (outMsgArr[0] == \"*\") break;\n\n\t\t\t\t\t} while (outMsgArr.length > 0);\n\n\t\t\t\t\tvar checksum = verify_checksum(msg);\n\t\t\t\t\tpkt_add_item(-1, -1, \"CHECKSUM\", checksum, PKT_COLOR_GPGSV_TITLE, PKT_COLOR_DATA);\n\n\t\t\t\t\tpkt_end();\n\t\t\t\t}\n\n\t\t\t\tif (msgId == \"GPRMC\")\n\t\t\t\t{\n\t\t\t\t\tpkt_add_item(-1, -1, msgId, \"\", PKT_COLOR_GPRMC_TITLE, PKT_COLOR_DATA);\n\t\t\t\t\tpkt_start(msgId);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar utc = outMsgArr.shift();\n\n\t\t\t\t\tif (utc.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tutc = utc.slice(0, 2) + \":\" + utc.slice(2, 4) + \":\" + utc.slice(4, 6) + \".\" + utc.slice(7, 10);\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(utc, \"\", \"UTC TIME\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar stat = outMsgArr.shift();\n\n\t\t\t\t\tif (stat.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (stat == \"A\") \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstat = \"data valid\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (stat == \"V\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstat = \"data not valid\";\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\tstat = \"invalid arg\";\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(stat, \"\", \"STATUS\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar latitude = outMsgArr.shift();\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar ns = outMsgArr.shift();\n\n\t\t\t\t\tif (latitude.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlatitude = latitude.slice(0, 2) + \"°\" + latitude.slice(2, 4) + \"'\" + latitude.slice(5, 9) + '\"';\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(latitude, ns, \"LATITUDE\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar longitude = outMsgArr.shift();\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar ew = outMsgArr.shift();\n\n\t\t\t\t\tif (longitude.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tlongitude = longitude.slice(0, 2) + \"°\" + longitude.slice(2, 4) + \"'\" + longitude.slice(5, 9) + '\"';\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(longitude, ew, \"LONGITUDE\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar speed = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(speed, \" knots\", \"SPEED\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar course = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(course, \" deg\", \"COURSE\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar date = outMsgArr.shift();\n\n\t\t\t\t\tif (date.length > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdate = date.slice(0, 2) + \"/\" + date.slice(2, 4) + \"/\" + date.slice(4, 6);\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_pkt_data(date, \"\", \"DATE\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar magVar = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(magVar, \" deg\", \"MAGN VAR\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar ewInd = outMsgArr.shift();\n\t\t\t\t\tadd_pkt_data(ewInd, \"\", \"E/W IND\", PKT_COLOR_GPRMC_TITLE);\n\n\t\t\t\t\tif (isEmpty(outMsgArr)) break;\n\t\t\t\t\tvar checksum = verify_checksum(msg);\n\t\t\t\t\tpkt_add_item(-1, -1, \"CHECKSUM\", checksum, PKT_COLOR_GPRMC_TITLE, PKT_COLOR_DATA);\n\n\t\t\t\t\tpkt_end();\n\t\t\t\t}\n\n\t\t\t\tpkt_end();\n\t\t\t}\n\t\t}\n\t}\n}", "function decode(buf)\n{\n // read and validate the json length\n var len = buf.readUInt16BE(0);\n if(len == 0 || len > (buf.length - 2)) return undefined;\n\n // parse out the json\n var packet = {};\n try {\n packet.js = JSON.parse(buf.toString(\"utf8\",2,len+2));\n } catch(E) {\n return undefined;\n }\n\n // if any body, attach it as a buffer\n if(buf.length > (len + 2)) packet.body = buf.slice(len + 2);\n \n return packet;\n}", "function decode()\n{\n\tget_ui_vals();\n\n\n\tif (typeof hex_opt === 'undefined')\n\t{\n\t\thex_opt = 0;\n\t}\n\n\n\n\tif (rate == 0)\n\t{\n\t\treturn;\n\t}\n\n\tspb = sample_rate / rate; \t\t// Calculate the number of Samples Per Bit.\n\n\ttry\n\t{\n\t\tspb_hs = sample_rate / high_rate;\n\t}\n\tcatch(e)\n\t{\n\t\tspb_hs = sample_rate / 2000000;\n\t}\n\n\tm = spb / 10; \t\t\t\t\t// Margin = 1 tenth of a bit time (expresed in number of samples)\n\tm_hs = spb_hs / 10;\n\n\tvar t = trs_get_first(ch);\n\n\tchannel_color = get_ch_light_color(ch);\n\n\twhile (trs_is_not_last(ch) && (stop == false))\n\t{\n\t if (abort_requested() == true)\t\t// Allow the user to abort this script\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (state)\n\t\t{\n\t\t\tcase GET_SOF:\n\n\t\t\t\twhile ((t.val != 0) && trs_is_not_last(ch))\t\t// Search for SOF\n\t\t\t\t{\n\t\t\t\t\tt = trs_get_next(ch);\n\t\t\t\t}\n\n\t\t\t\ts = t.sample + (spb * 0.5); \t\t// Position our reader on the middle of first bit\n\n\t\t\t\tbit_sampler_ini(ch,spb /2, spb); \t// Initialize the bit sampler (to be able tu use \"bit_sampler_next()\")\n\t\t\t\tbit_sampler_next(ch); \t\t\t\t// Read and skip the start bit\n\n\t\t\t\tdec_item_new(ch,t.sample,t.sample + spb - m); \t// Add the start bit item\n\t\t\t\tdec_item_add_pre_text(\"Start of Frame\");\n\t\t\t\tdec_item_add_pre_text(\"Start\");\n\t\t\t\tdec_item_add_pre_text(\"SOF\");\n\t\t\t\tdec_item_add_pre_text(\"S\");\n\n\t\t\t\tpkt_start(\"CAN\");\n\t\t\t\tpkt_add_item(-1, -1, \"SOF\", \"\", dark_colors.blue, channel_color);\n\n\t\t\t\tbits = [];\n\t\t\t\trb = 0;\n\t\t\t\tframe_length_in_sample = 0;\n\t\t\t\tb = 0; sb = 0;\n\t\t\t\tbit_pos = [];\n\t\t\t\tide_mode = false;\n\t\t\t\tdata_size = 0;\n\t\t\t\tbits.push(0); \t\t// Add the start bit to the bits table\n\t\t\t\tbit_pos.push(s); \t// Add its position\n\t\t\t\tb++;\n\t\t\t\trb++;\n\t\t\t\tframe_length_in_sample += spb;\n\t\t\t\tlast_bit = 0;\n\t\t\t\tstate = GET_ID;\n\t\t\t\trtr_mode = false;\n\t\t\t\tide_mode = false;\n\t\t\t\tedl_mode = false;\n\t\t\t\tpotential_overload = true; \t// This *may* be the beginning of an overload frame\n\n\t\t\tbreak;\n\n\t\t\tcase GET_ID:\n\n\t\t\t\twhile (true) \t// Read bits until we break\n\t\t\t\t{\n\t\t\t\t\tif (abort_requested() == true)\t// Allow the user to abort this script\n\t\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(edl_mode && (((b==35)&&ide_mode) || ((b==16)&&!ide_mode)) )\n\t\t\t\t\t{\n\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs); \t// use High speed since now\n\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (sb == 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tstuffing_ok = check_stuffing();\t\t// Stuffed bit\n\t\t\t\t\t\tif (stuffing_ok == false) break; \t// Break on the first stuffing error\n\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbits[b] = bit_sampler_next(ch);\t\t// Regular bit\n\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(edl_mode && (((b>35)&&ide_mode) || ((b>16)&&!ide_mode)) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb_hs/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\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\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb / 2, spb);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\tif (bits[b] == last_bit)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb++;\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\tsb = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlast_bit = bits[b];\n\t\t\t\t\t\tb++;\n\t\t\t\t\t}\n\n\t\t\t\t\trb++;\n\t\t\t\t\tif(edl_mode && (((b>35)&&ide_mode) || ((b>16)&&!ide_mode)) )\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\telse\n\t\t\t\t\t\tframe_length_in_sample += spb;\n\n\n\t\t\t\t\tif(edl_mode && (((b==36)&&ide_mode) || ((b==17)&&!ide_mode)) )\n\t\t\t\t\t{\n\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((b == 14) && (bits[13] == 1))\n\t\t\t\t\t{\n\t\t\t\t\t\tide_mode = true;\n\t\t\t\t\t\trtr_mode = false; \t// Reset rtr, will be checked at bit 32\n\t\t\t\t\t}\n\n\t\t\t\t\tif (ide_mode)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((b == 33) && (bits[32] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trtr_mode = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((b == 34) && (bits[33] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tedl_mode = true;\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\tif ((b == 13) && (bits[12] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trtr_mode = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((b == 15) && (bits[14] == 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tedl_mode = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((ide_mode == true) && (b == 41))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ((ide_mode == false) && (b == 22))\n\t\t\t\t\t\t{\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((ide_mode == true) && (b == 39))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ((ide_mode == false) && (b == 19))\n\t\t\t\t\t\t{\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\n\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t{\n\t\t\t\t\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\tstate = GET_SOF;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif(edl_mode) //if it's CAN-FD\n\t\t\t\t{\n\t\t\t\t\t// Check if we are in normal or extended ID mode\n\t\t\t\t\tif (ide_mode == false)\t \t// Normal frame\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\t\t\t\t// Calculate the value of the ID\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[11] + (0.5 * spb) - m); \t\t// Add the ID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"ID\", int_to_str_hex(val), dark_colors.green, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[12] - (0.5 * spb) + m, bit_pos[12] + (0.5 * spb) - m); \t// Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.green, channel_color, true);\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\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[13] - (0.5 * spb) + m, bit_pos[13] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME FORMAT\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"B\");\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"IDE = 0\",\"BASE FRAME FORMAT\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[14] - (0.5 * spb) + m, bit_pos[14] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Extended Data Length\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EDL\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[15] - (0.5 * spb) + m, bit_pos[15] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"r0\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[16] - (0.5 * spb) + m, bit_pos[16] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Bit Rate Switch\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BRS\");\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tdec_item_new(ch, bit_pos[17] - (0.5 * spb) + m, bit_pos[17] + (0.5 * spb) - m);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_item_new(ch, bit_pos[17] - (0.5 * spb_hs) + m_hs, bit_pos[17] + (0.5 * spb_hs) - m_hs);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Error State Indicator)\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ESI\");\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 18; c < 22; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tswitch (val)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 0x9 : data_size = 12; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xA : data_size = 16; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xB : data_size = 20; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xC : data_size = 24; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xD : data_size = 32; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xE : data_size = 48; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xF : data_size = 64; crc_len=21; break;\n\t\t\t\t\t\t\tdefault : break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[18] - (0.5 * spb) + m, bit_pos[21] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[18] - (0.5 * spb_hs) + m_hs, bit_pos[21] + (0.5 * spb_hs) - m_hs); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color, true);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (c = 14; c < 32; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[31] + (0.5 * spb) - m); \t// Add the EID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"EXTENDED IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EID: \");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = val;\n\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar tmp_byte = (tmp_val & 0xFF);\n\t\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_byte);\n\t\t\t\t\t\t\t\ttmp_val = (tmp_val - tmp_byte) / 256;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"EID\", int_to_str_hex(val), dark_colors.violet, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[32] - (0.5 * spb) + m, bit_pos[32] + (0.5 * spb) - m); // Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.violet, channel_color, true);\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\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[33] - (0.5 * spb) + m, bit_pos[33] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Extended Data Length\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EDL\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[34] - (0.5 * spb) + m, bit_pos[34] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"r0\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[35] - (0.5 * spb) + m, bit_pos[35] + (0.5 * spb) - m);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Bit Rate Switch\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BRS\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[36] - (0.5 * spb_hs) + m_hs, bit_pos[36] + (0.5 * spb_hs) - m_hs);\n\t\t\t\t\t\tdec_item_add_pre_text(\"Error State Indicator)\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ESI\");\n\n\t\t\t\t\t\tpkt_add_item(0, 0, \"IDE = 1\", \"EXTENDED FRAME FORMAT\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 37; c < 41; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tswitch (val)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 0x9 : data_size = 12; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xA : data_size = 16; crc_len=17; break;\n\t\t\t\t\t\t\tcase 0xB : data_size = 20; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xC : data_size = 24; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xD : data_size = 32; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xE : data_size = 48; crc_len=21; break;\n\t\t\t\t\t\t\tcase 0xF : data_size = 64; crc_len=21; break;\n\t\t\t\t\t\t\tdefault : break;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[37] - (0.5 * spb) + m, bit_pos[40] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_item_new(ch,bit_pos[37] - (0.5 * spb_hs) + m_hs, bit_pos[40] + (0.5 * spb_hs) - m_hs); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(t.sample, t.sample + spb - m, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color,true);\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\t// Check if we are in normal or extended ID mode\n\t\t\t\t\tif (ide_mode == false)\t \t// Normal frame\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\t\t\t\t// Calculate the value of the ID\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[11] + (0.5 * spb) - m); \t\t// Add the ID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"ID\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"ID\", int_to_str_hex(val), dark_colors.green, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[12] - (0.5 * spb) + m, bit_pos[12] + (0.5 * spb) - m); \t// Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.green, channel_color, true);\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\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[13] - (0.5 * spb) + m, bit_pos[13] + (0.5 * spb) - m); \t// Add the IDE bit\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME FORMAT\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE FRAME\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"BASE\");\n\t\t\t\t\t\tdec_item_add_pre_text(\"B\");\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"IDE = 0\",\"BASE FRAME FORMAT\", dark_colors.green, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 15; c < 19; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[15] - (0.5 * spb) + m, bit_pos[18] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color, true);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 1; c < 12; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (c = 14; c < 32; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdec_item_new(ch,bit_pos[1] - (0.5 * spb) + m, bit_pos[31] + (0.5 * spb) - m); \t// Add the EID item\n\t\t\t\t\t\tdec_item_add_pre_text(\"EXTENDED IDENTIFIER: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"EID: \");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar tmp_val = val;\n\n\t\t\t\t\t\t\tfor (var i = 0; i < 4; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar tmp_byte = (tmp_val & 0xFF);\n\t\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_byte);\n\t\t\t\t\t\t\t\ttmp_val = (tmp_val - tmp_byte) / 256;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"EID\", int_to_str_hex(val), dark_colors.violet, channel_color);\n\t\t\t\t\t\tpkt_start(\"Frame Type\");\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[32] - (0.5 * spb) + m, bit_pos[32] + (0.5 * spb) - m); // Add the RTR bit\n\n\t\t\t\t\t\tif (rtr_mode == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"RTR\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"R\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 1\", \"RTR FRAME\", dark_colors.violet, channel_color, true);\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\tdec_item_add_pre_text(\"DATA FRAME\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"DATA\");\n\t\t\t\t\t\t\tdec_item_add_pre_text(\"D\");\n\t\t\t\t\t\t\tpkt_add_item(-1, -1, \"RTR = 0\", \"DATA FRAME\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(0, 0, \"IDE = 1\", \"EXTENDED FRAME FORMAT\", dark_colors.violet, channel_color, true);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tval = 0;\n\n\t\t\t\t\t\tfor (c = 35; c < 39; c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tval = (val * 2) + bits[c];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdata_size = val;\n\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[35] - (0.5 * spb) + m, bit_pos[38] + (0.5 * spb) - m); \t// Add the DLC item\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH CODE: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LENGTH: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DATA LEN: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"DLC: \");\n\t\t\t\t\t\tdec_item_add_pre_text(\"L:\");\n\t\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpkt_add_item(t.sample, t.sample + spb - m, \"DLC\", int_to_str_hex(val), dark_colors.orange, channel_color,true);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (rtr_mode == false)\n\t\t\t\t{\n\t\t\t\t\tstate = GET_DATA;\n\t\t\t\t}\n\t\t\t\telse\t// Skip the data in case of RTR frame\n\t\t\t\t{\n\t\t\t\t\tstate = GET_CRC;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase GET_DATA:\n\t\t\t\tdb = 0;\n\t\t\t\tif(edl_mode)\n\t\t\t\t{\n\t\t\t\t\tbit_sampler_ini(ch,spb_hs /2, spb_hs); \t// use High speed since now\n\t\t\t\t}\n\n\t\t\t\twhile (db < (data_size * 8)) \t// Read data bits\n\t\t\t\t{\n\t\t\t\t\tif (sb == 4)\n\t\t\t\t\t{\n\t\t\t\t\t\tstuffing_ok = check_stuffing();\t\t// Stuffed bit\n\n\t\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsb = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbits[b] = bit_sampler_next(ch);\t\t// Regular bitif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(edl_mode)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb_hs/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\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\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb / 2, spb);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif (bits[b] == last_bit)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsb++;\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\tsb = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlast_bit = bits[b];\n\t\t\t\t\t\tb++;\n\t\t\t\t\t\tdb++;\n\t\t\t\t\t}\n\n\t\t\t\t\trb++;\n\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\tframe_length_in_sample += spb;\n\t\t\t\t\telse\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\n\t\t\t\t}\n\n\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t{\n\t\t\t\t\tt = trs_go_after(ch,bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\tstate = GET_SOF;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tb -= (data_size * 8);\t// Now interpret those bits as bytes\n\t\t\t\tpkt_data = \"\";\n\n\t\t\t\tfor (i = 0; i < data_size; i++)\n\t\t\t\t{\n\t\t\t\t\tval = 0;\n\n\t\t\t\t\tfor (c = 0; c < 8; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tval = (val * 2) + bits[b + (i * 8) + c];\n\t\t\t\t\t}\n\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b + (i * 8)] - (0.5 * spb) + m, bit_pos[b + (i * 8) + 7] + (0.5 * spb) - m); \t// Add the ID item\n\t\t\t\t\telse\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b + (i * 8)] - (0.5 * spb_hs) + m_hs, bit_pos[b + (i * 8) + 7] + (0.5 * spb_hs) - m_hs); \t// Add the ID item\n\t\t\t\t\tdec_item_add_pre_text(\"DATA: \");\n\t\t\t\t\tdec_item_add_pre_text(\"D: \");\n\t\t\t\t\tdec_item_add_pre_text(\"D \");\n\t\t\t\t\tdec_item_add_data(val);\n\t\t\t\t\thex_add_byte(ch, -1, -1, val);\n\n\t\t\t\t\tpkt_data += int_to_str_hex(val) + \" \";\n\t\t\t\t}\n\n\t\t\t\tif(!edl_mode)\n\t\t\t\t\tpkt_add_item(bit_pos[b] - (0.5 * spb), bit_pos[b + ((data_size - 1) * 8) + 7] + (0.5 * spb), \"DATA\", pkt_data, dark_colors.gray, channel_color);\n\t\t\t\telse\n\t\t\t\t\tpkt_add_item(bit_pos[b] - (0.5 * spb_hs), bit_pos[b + ((data_size - 1) * 8) + 7] + (0.5 * spb_hs), \"DATA\", pkt_data, dark_colors.gray, channel_color);\n\n\t\t\t\tb += (data_size * 8);\n\t\t\t\tstate = GET_CRC;\n\n\t\t\t\t// TO DO:\n\t\t\t\t// correct all start and end samples\n\t\t\t\t// add packet for CRC, and error frames\n\t\t\t\t// add the packet stop\n\t\t\tbreak;\n\n\t\t\tcase GET_CRC:\n\t\t\t\tvar nbr_stf_b = 0;\n\t\t\t\tdb = 0;\n\t\t\t\tif(edl_mode)\n\t\t\t\t{\n\t\t\t\t\tbit_sampler_ini(ch,spb_hs /2, spb_hs); \t// use High speed since now\n\n\t\t\t\t\twhile (db-nbr_stf_b < crc_len) //read crc bits\n\t\t\t\t\t{\n\t\t\t\t\t\tif (db % 5 ==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbit_sampler_next(ch);\n\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_CROSS);\n\t\t\t\t\t\t\tdb++;\n\t\t\t\t\t\t\tnbr_stf_b++;\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\tbits[b] = bit_sampler_next(ch);\t // Regular bit\n\t\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb_hs/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb_hs/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb_hs/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb_hs / 2, spb_hs);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\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\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlast_bit = bits[b];\n\n\t\t\t\t\t\t\tb++;\n\t\t\t\t\t\t\tdb++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trb++;\n\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\t\tstate = GET_SOF;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tval = 0;\n\t\t\t\t\tb -= crc_len;\n\n\t\t\t\t\tfor (c = 0; c < crc_len; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tval = (val * 2) + bits[b + c];\n\t\t\t\t\t}\n\n\t\t\t\t\tcrc_rg = 0;\t\t// Now calculate our own crc to compare\n\n\n\t\t\t\t\tfor (c = 1; c < b; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcrc_nxt = bits[c] ^ ((crc_rg >> (crc_len)) & 0x1);\n\t\t\t\t\t\tcrc_rg = crc_rg << 1;\n\n\t\t\t\t\t\tif (crc_nxt == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (crc_len==17)\n\t\t\t\t\t\t\t\tcrc_rg ^= 0x3685B;\n\t\t\t\t\t\t\telse if (crc_len==21)\n\t\t\t\t\t\t\t\tcrc_rg ^= 0x302898;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (crc_len==17)\n\t\t\t\t\t\t\tcrc_rg &= 0x1ffff;\n\t\t\t\t\t\telse if (crc_len==21)\n\t\t\t\t\t\t\tcrc_rg &= 0x1fffff\n\t\t\t\t\t}\n\n\t\t\t\t\tdec_item_new(ch, bit_pos[b] - (0.5 * spb_hs) + m_hs, bit_pos[b + crc_len-1] + (0.5 * spb_hs) - m_hs); \t// Add the ID item\n\t\t\t\t\tdec_item_add_pre_text(\"CRC : \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC\");\n\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (val == crc_rg)\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\"\");\n\t\t\t\t\t\tpkt_add_item(-1, -1 ,\"CRC\", int_to_str_hex(val) + \" OK\", dark_colors.yellow, channel_color);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG, Should be: \" + int_to_str_hex(crc_rg));\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG!\");\n\t\t\t\t\t\tdec_item_add_post_text(\"E!\");\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"CRC\", int_to_str_hex(val) + \"(WRONG)\", dark_colors.red, channel_color);\n\n\t\t\t\t\t\tpkt_start(\"CRC ERROR\");\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (captured)\",int_to_str_hex(val), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (calculated)\", int_to_str_hex(crc_rg), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tdec_item_add_post_text(\"!\");\n\t\t\t\t\t}\n\n\t\t\t\t\tb += crc_len-1;\n\t\t\t\t\tbit_pos[b] += spb;\n\t\t\t\t\tstate = GET_ACK;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twhile (db < 16) //read crc bits\n\t\t\t\t\t{\n\t\t\t\t\t\tif (sb == 4)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstuffing_ok = check_stuffing();\t\t// Stuffed bit\n\n\t\t\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsb = 0;\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\tbits[b] = bit_sampler_next(ch);\t // Regular bit\n\t\t\t\t\t\t\tif( (last_bit == 1)&&(bits[b] == 0) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttrs_tmp = trs_get_prev(ch);\n\t\t\t\t\t\t\t\tframe_length_in_sample = trs_tmp.sample - s + spb/2;\n\t\t\t\t\t\t\t\tbit_pos.push(trs_tmp.sample + spb/2); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, trs_tmp.sample + spb/2, DRAW_POINT);\n\t\t\t\t\t\t\t\tbit_sampler_ini(ch,spb / 2, spb);\n\t\t\t\t\t\t\t\tbit_sampler_next(ch);\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\tbit_pos.push(s + frame_length_in_sample); \t\t// Store the position of that bit\n\t\t\t\t\t\t\t\tdec_item_add_sample_point(ch, s + frame_length_in_sample, DRAW_POINT);\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\tif (bits[b] == last_bit)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsb++;\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\tsb = 0;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlast_bit = bits[b];\n\t\t\t\t\t\t\tb++;\n\t\t\t\t\t\t\tdb++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trb++;\n\t\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\t\tframe_length_in_sample += spb;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tframe_length_in_sample += spb_hs;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (stuffing_ok == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tt = trs_go_after(ch, bit_pos[b - 1] + (10.5 * spb));\n\t\t\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\t\t\tstate = GET_SOF;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tval = 0;\n\t\t\t\t\tb -= 16;\n\n\t\t\t\t\tfor (c = 0; c < 15; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tval = (val * 2) + bits[b + c];\n\t\t\t\t\t}\n\n\t\t\t\t\tcrc_rg = 0;\t\t// Now calculate our own crc to compare\n\n\t\t\t\t\tfor (c = 0; c < b; c++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcrc_nxt = bits[c] ^ ((crc_rg >> 14) & 0x1);\n\t\t\t\t\t\tcrc_rg = crc_rg << 1;\n\n\t\t\t\t\t\tif (crc_nxt == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcrc_rg ^= 0x4599;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcrc_rg &= 0x7fff;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!edl_mode)\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b] - (0.5 * spb) + m, bit_pos[b + 14] + (0.5 * spb) - m); \t// Add the ID item\n\t\t\t\t\telse\n\t\t\t\t\t\tdec_item_new(ch, bit_pos[b] - (0.5 * spb_hs) + m_hs, bit_pos[b + 14] + (0.5 * spb_hs) - m_hs); \t// Add the ID item\n\t\t\t\t\tdec_item_add_pre_text(\"CRC : \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC \");\n\t\t\t\t\tdec_item_add_pre_text(\"CRC\");\n\t\t\t\t\tdec_item_add_data(val);\n\n\t\t\t\t\tif (hex_opt > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar tmp_val = (val >> 8);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t\ttmp_val = (val & 0xFF);\n\t\t\t\t\t\thex_add_byte(ch, -1, -1, tmp_val);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (val == crc_rg)\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\" OK\");\n\t\t\t\t\t\tdec_item_add_post_text(\"\");\n\t\t\t\t\t\tpkt_add_item(-1, -1 ,\"CRC\", int_to_str_hex(val) + \" OK\", dark_colors.yellow, channel_color);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG, Should be: \" + int_to_str_hex(crc_rg));\n\t\t\t\t\t\tdec_item_add_post_text(\" WRONG!\");\n\t\t\t\t\t\tdec_item_add_post_text(\"E!\");\n\n\t\t\t\t\t\tpkt_add_item(-1, -1, \"CRC\", int_to_str_hex(val) + \"(WRONG)\", dark_colors.red, channel_color);\n\n\t\t\t\t\t\tpkt_start(\"CRC ERROR\");\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (captured)\",int_to_str_hex(val), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_add_item(0, 0, \"CRC (calculated)\", int_to_str_hex(crc_rg), dark_colors.red, channel_color);\n\t\t\t\t\t\tpkt_end();\n\n\t\t\t\t\t\tdec_item_add_post_text(\"!\");\n\t\t\t\t\t}\n\n\t\t\t\t\tb += 15;\n\t\t\t\t\tstate = GET_ACK;\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase GET_ACK: \t// and the EOF too.\n\t\t\t\tbit_pos[b] -= spb;// CRC delimiter\n\t\t\t\tack_chk = bit_sampler_next(ch);\n\t\t\t\tbit_sampler_next(ch); \t// ACK delimiter\n\n\t\t\t\tif(!edl_mode)\n\t\t\t\t\tdec_item_new(ch,bit_pos[b] + (1.5 * spb) + m, bit_pos[b] + (3.5 * spb) - m); \t// Add the ACK item\n\t\t\t\telse\n\t\t\t\t\tdec_item_new(ch,bit_pos[b] + (2.5 * spb_hs) + m, bit_pos[b] + (2.5 * spb_hs) + 2*spb - m); \t// Add the ACK item\n\n\t\t\t\tif(ack_chk == 1)\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"NO ACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"NACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"!A\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"ACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"ACK\");\n\t\t\t\t\tdec_item_add_pre_text(\"A\");\n\t\t\t\t}\n\t\t\t\tpkt_add_item(-1, -1, \"ACK\", ack_chk.toString(10), dark_colors.black, channel_color);\n\t\t\t\teof_chk = 0;\n\t\t\t\tfor (c = 0; c < 7; c++)\n\t\t\t\t{\n\t\t\t\t\teof_chk += bit_sampler_next(ch);\n\t\t\t\t}\n\n\t\t\t\tif(!edl_mode)\n\t\t\t\t\tdec_item_new(ch, bit_pos[b] + (3.5 * spb) + m, bit_pos[b] + (10.5 * spb) - m); \t// Add the EOF item\n\t\t\t\telse\n\t\t\t\t\tdec_item_new(ch, bit_pos[b] + (2.5 * spb_hs) + 2*spb - m, bit_pos[b] + (2.5 * spb_hs) + 9*spb - m); \t// Add the EOF item\n\n\t\t\t\tif (eof_chk == 7)\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"END OF FRAME OK\");\n\t\t\t\t\tdec_item_add_pre_text(\"EOF OK\");\n\t\t\t\t\tdec_item_add_pre_text(\"EOF\");\n\t\t\t\t\tdec_item_add_pre_text(\"E\");\n\t\t\t\t\tpkt_add_item(-1, -1, \"EOF\", \"\", dark_colors.blue, channel_color);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdec_item_add_pre_text(\"END OF FRAME ERR\");\n\t\t\t\t\tdec_item_add_pre_text(\"EOF ERR!\");\n\t\t\t\t\tdec_item_add_pre_text(\"!EOF!\");\n\t\t\t\t\tdec_item_add_pre_text(\"!E!\");\n\t\t\t\t\tdec_item_add_pre_text(\"!\");\n\t\t\t\t\tpkt_add_item(-1, -1, \"EOF\",\"MISSING!\", dark_colors.red, channel_color);\n\t\t\t\t}\n\n\t\t\t\tpkt_end();\n\n\t\t\t\tt = trs_go_after(ch, bit_pos[b] + (10.5 * spb));\n\t\t\t\tset_progress(100 * t.sample / n_samples);\n\t\t\t\tstate = GET_SOF;\n\t\t\t\t//dec_item_new(ch, bit_pos[0] - (0.5 * spb) + m, bit_pos[b] + (0.5 * spb) - m); \t//<=========================DEBUG ALL THE FRAME\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function decode(src) {\n var stream = new IOStream(src)\n return RansDecodeStream(stream, 0)\n}", "function decode(z80) {\n const inst = fetchInstruction(z80);\n const func = decodeMapBASE.get(inst);\n if (func === undefined) {\n console.log(\"Unhandled opcode \" + z80_base_1.toHex(inst, 2));\n }\n else {\n func(z80);\n }\n}", "decode(token) {\n return atob(token);\n }", "insert (packet) {\n if ((this._length + 1) > this._buffer.length) {\n this.remove()\n }\n\n const next = this._start + this._length\n const index = next % this._buffer.length\n this._buffer[index] = packet\n this._length += 1\n }", "InitializeDecode(string, EncodingType) {\n\n }", "function decodeListener() {\n\tloadingtext.style.visibility = \"hidden\";\n\tconst vals = JSON.parse(this.responseText);\n\tconst birthV = vals.b;\n\tbirthForm.value = birthV;\n\tbirth = parseRule(birthV);\n\tconst survivalV = vals.s;\n\tsurvivalForm.value = survivalV;\n\tsurvival = parseRule(survivalV);\n\tconst rle = vals.d;\n\tdecodeRLE(rle);\n }", "function subscriptionHandler(node, datatype ,topic, payload, packet) {\n const v5 = node.brokerConn.options && node.brokerConn.options.protocolVersion == 5;\n var msg = {topic:topic, payload:null, qos:packet.qos, retain:packet.retain};\n if(v5 && packet.properties) {\n setStrProp(packet.properties, msg, \"responseTopic\");\n setBufferProp(packet.properties, msg, \"correlationData\");\n setStrProp(packet.properties, msg, \"contentType\");\n setIntProp(packet.properties, msg, \"messageExpiryInterval\", 0);\n setBoolProp(packet.properties, msg, \"payloadFormatIndicator\");\n setStrProp(packet.properties, msg, \"reasonString\");\n setUserProperties(packet.properties.userProperties, msg);\n }\n const v5isUtf8 = v5 ? msg.payloadFormatIndicator === true : null;\n const v5HasMediaType = v5 ? !!msg.contentType : null;\n const v5MediaTypeLC = v5 ? (msg.contentType + \"\").toLowerCase() : null;\n\n if (datatype === \"buffer\") {\n // payload = payload;\n } else if (datatype === \"base64\") {\n payload = payload.toString('base64');\n } else if (datatype === \"utf8\") {\n payload = payload.toString('utf8');\n } else if (datatype === \"json\") {\n if (v5isUtf8 || isUtf8(payload)) {\n try {\n payload = JSON.parse(payload.toString());\n } catch (e) {\n node.error(RED._(\"mqtt.errors.invalid-json-parse\"), { payload: payload, topic: topic, qos: packet.qos, retain: packet.retain }); return;\n }\n } else {\n node.error((RED._(\"mqtt.errors.invalid-json-string\")), { payload: payload, topic: topic, qos: packet.qos, retain: packet.retain }); return;\n }\n } else {\n //\"auto\" (legacy) or \"auto-detect\" (new default)\n if (v5isUtf8 || v5HasMediaType) {\n const outputType = knownMediaTypes[v5MediaTypeLC]\n switch (outputType) {\n case \"string\":\n payload = payload.toString();\n break;\n case \"buffer\":\n //no change\n break;\n case \"json\":\n try {\n //since v5 type states this should be JSON, parse it & error out if NOT JSON\n payload = payload.toString()\n const obj = JSON.parse(payload);\n if (datatype === \"auto-detect\") {\n payload = obj; //as mode is \"auto-detect\", return the parsed JSON\n }\n } catch (e) {\n node.error(RED._(\"mqtt.errors.invalid-json-parse\"), { payload: payload, topic: topic, qos: packet.qos, retain: packet.retain }); return;\n }\n break;\n default:\n if (v5isUtf8 || isUtf8(payload)) {\n payload = payload.toString(); //auto String\n if (datatype === \"auto-detect\") {\n try {\n payload = JSON.parse(payload); //auto to parsed object (attempt)\n } catch (e) {\n /* mute error - it simply isnt JSON, just leave payload as a string */\n }\n }\n }\n break;\n }\n } else if (isUtf8(payload)) {\n payload = payload.toString(); //auto String\n if (datatype === \"auto-detect\") {\n try {\n payload = JSON.parse(payload);\n } catch (e) {\n /* mute error - it simply isnt JSON, just leave payload as a string */\n }\n }\n } //else { \n //leave as buffer\n //}\n }\n msg.payload = payload;\n if ((node.brokerConn.broker === \"localhost\")||(node.brokerConn.broker === \"127.0.0.1\")) {\n msg._topic = topic;\n }\n node.send(msg);\n }", "function decode(input) {\n var decoder = new Decoder()\n var output = decoder.update(input, true)\n return output\n}", "function decode(input) {\n var decoder = new Decoder()\n var output = decoder.update(input, true)\n return output\n}", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!Validation(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "function handleDecodeSegment(\n message,\n key,\n cipher,\n mode,\n pad,\n output_format = 'utf8',\n is_message_hex = undefined\n ) {\n switch ( cipher ) {\n case 0:\n return _discordCrypt.__blowfish512_decrypt(\n message,\n key,\n mode,\n pad,\n output_format,\n is_message_hex\n );\n case 1:\n return _discordCrypt.__aes256_decrypt( message, key, mode, pad, output_format, is_message_hex );\n case 2:\n return _discordCrypt.__camellia256_decrypt(\n message,\n key,\n mode,\n pad,\n output_format,\n is_message_hex\n );\n case 3:\n return _discordCrypt.__idea128_decrypt( message, key, mode, pad, output_format, is_message_hex );\n case 4:\n return _discordCrypt.__tripledes192_decrypt( message,\n key,\n mode,\n pad,\n output_format,\n is_message_hex\n );\n default:\n return null;\n }\n }", "function Product_Information (decoder_items) //126996\n{\n var str = \"\";\n if (fast_packet_byte == 1)\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n }\n else if (fast_packet_byte == 2)\n {\n multi_byte_value += (hex_value<<8);\n ScanaStudio.dec_item_new(decoder_items.channel_index, start_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"NMEA 2000 Version : 0x\" + pad(multi_byte_value.toString(16),4));\n ScanaStudio.dec_item_add_content(\"0x\" + pad(multi_byte_value.toString(16),4));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n decoder_items.end_sample_index,\n \"Fast Packet Data\",\n (\"NMEA 2000 Version : 0x\" + pad(multi_byte_value.toString(16),4)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n }\n else if (fast_packet_byte == 3)\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n }\n else if (fast_packet_byte == 4)\n {\n multi_byte_value += (hex_value<<8);\n ScanaStudio.dec_item_new(decoder_items.channel_index, start_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Product Code : 0x\" + pad(multi_byte_value.toString(16),4));\n ScanaStudio.dec_item_add_content(\"0x\" + pad(multi_byte_value.toString(16),4));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n decoder_items.end_sample_index,\n \"Fast Packet Data\",\n (\"Product Code : 0x\" + pad(multi_byte_value.toString(16),4)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n }\n else if ((fast_packet_byte > 4) && (fast_packet_byte < 37))\n {\n item_content = \"Model ID : \" + \"'\" + String.fromCharCode(hex_value) + \"'\";\n }\n else if ((fast_packet_byte > 36) && (fast_packet_byte < 69))\n {\n item_content = \"Software Version Code : \" + \"'\" + String.fromCharCode(hex_value) + \"'\";\n }\n else if ((fast_packet_byte > 68) && (fast_packet_byte < 101))\n {\n item_content = \"Model Version : \" + \"'\" + String.fromCharCode(hex_value) + \"'\";\n }\n else if ((fast_packet_byte > 100) && (fast_packet_byte < 133))\n {\n item_content = \"Model Serial Code : \" + \"'\" + String.fromCharCode(hex_value) + \"'\";\n }\n else if (fast_packet_byte == 133)\n {\n item_content = \"Certification Level : 0x\" + pad(hex_value.toString(16),2);\n }\n else if (fast_packet_byte == 134)\n {\n item_content = \"Load Equivalency : 0x\" + pad(hex_value.toString(16),2);\n }\n else\n {\n packet_title = \"Filled Data\";\n if (hex_value == 255)\n {\n item_content = \"Filled with 0xFF\";\n }\n else\n {\n item_content = \"0x\" + pad(hex_value.toString(16),2) + \", should be 0xFF\";\n types_title = ScanaStudio.PacketColors.Error.Title;\n types_content = ScanaStudio.PacketColors.Error.Content;\n }\n }\n}//end function Product_Information", "function decode(data) {\n var prefix = protocols[data[0]];\n if (!prefix) { // 36 to 255 should be \"\"\n prefix = \"\";\n } \n return prefix + util.bytesToString(data.slice(1)); \n}", "decode() {\n const numChars = this.m_code.length;\n let iChar = 0;\n let iKey = 0;\n for (; iChar < numChars; iChar++) {\n const numIn = this.m_code[iChar];\n const codeIn = (this.m_keys[iKey] & 0xff);\n const numOut = numIn ^ codeIn;\n this.m_code[iChar] = numOut;\n this.updateKeys();\n // next key\n iKey ++;\n iKey &= (NUM_KEYS - 1);\n }\n }", "requestPacket(packetId, callback, onFailure) {\n this.handler.requestPacket(packetId, callback);\n }", "dec(opcode) {\n const meta = OPCODE[opcode];\n const dest = meta.operand1.toLowerCase();\n\n // HL means change the value in memory\n if (dest === '(hl)') {\n let value = this.memory.readROM(this.hl);\n value -= 1;\n this.memory.writeROM(this.hl, value);\n }\n // change in register\n else {\n this[dest] -= 1;\n }\n }", "function packet_inbound(id, message) {\n\n\tif (message.byteLength) { /* must be an arraybuffer, aka a data packet */\n\t\t//console.log('recieved arraybuffer!');\n\t\tprocess_binary(id,message,0); /* no reason to hash here */\n\t} else {\n\t\tdata = JSON.parse(message).data;\n\t\t\n\t\tdata.id = id;\n\t\tdata.username = rtc.usernames[id]; /* username lookup */\n\t\t\n\t\tprocess_data(data);\n\t\t\n\t}\n}", "function decodeFromString(encoded, pshift) {\n if (pshift === void 0) { pshift = DEFAULT_PSHIFT; }\n return decode((new TextEncoder()).encode(encoded), pshift);\n}", "GetPayload()\n {\n // Here it is the checking if the this.curPacket is empty, then it will clear the interval \n\n if(this.curPacket.length === 0)\n {\n clearInterval(this.timer);\n return;\n }\n\n // Here it is checking the the this.prevPacketText is empty string or not, this method is invoked when there is fin 1 without the occurance of previous message with fin 0\n\n if(this.prevPacketText === \"\")\n {\n // now we will get the first bit, to know bit and bytes read the following link.\n // https://www.javatpoint.com/java-data-types\n // 8 bits = 1 byte\n\n // first byte of the buffer\n\n var firstByte = this.curPacket[0];\n\n // getting the first bit the fetch the fin 0x80 is hex representation of decimal you can read hex conversion from google. & and >>> these are bit operators you can check this in javascript documentation. These are basics of javascript.\n\n this.prevfin = (firstByte & 0x80) >>> 7;\n\n // getting the opCode from the second bit of the first byte\n\n this.prevOpCode = firstByte & 0x0f;\n\n // here we are handling special opCode that we want to ignore for now.\n\n var payloadType;\n\n if ( this.prevOpCode >= 0x3 && this.prevOpCode <= 0x7 \n ||\n this.prevOpCode >= 0xB && this.prevOpCode <= 0xF)\n {\n console.log(\"Special frame recieved\");\n return;\n }\n\n // now matching the opCode and setting payloadType string\n\n // if we recieve 0 that means packets are coming more and we need to continue to read the packets before parsing.\n\n // if we recieve 1 that means text and 2 means binary data\n\n // if we recieve 9 means client / server has disconnected and sends the opCode to other party\n\n // if we recieve ping then server will send pong to maintain heartbeat same goes for client.\n\n if(this.prevOpCode == 0x0)\n {\n payloadType = 'continuation';\n }\n else if(this.prevOpCode == 0x1)\n {\n payloadType = 'text';\n }\n else if(this.prevOpCode == 0x2)\n {\n payloadType = 'binary';\n }\n else if(this.prevOpCode == 0x8)\n {\n payloadType = 'connection close';\n }\n else if(this.prevOpCode == 0x9)\n {\n payloadType = 'ping';\n }\n else if(this.prevOpCode == 0xA)\n {\n payloadType = 'pong';\n }\n else\n {\n payloadType = 'reservedfornon-control';\n }\n\n // here we are printing the fin and opCode\n\n console.log(\"this.prevfin: \"+this.prevfin);\n console.log(payloadType);\n\n // Here we are handling continuation flag and we are parsing the values and more packets are about to come.\n\n if(payloadType === \"continuation\")\n {\n this.parseMessage(this.prevfin);\n return;\n }\n\n // here if the fin = 1 and payloadType is text or binary means message is complete\n\n // if fin is 0 then we store the packet after parse and wait for next packet to parse and then we concatenate the packets to one.\n\n if(this.prevfin === 1 && (payloadType === \"text\" || payloadType === \"binary\"))\n {\n this.parseMessage(this.prevfin);\n }\n else if(this.prevfin === 0)\n {\n this.parseMessage(this.prevfin);\n }\n }\n else\n {\n // this case comes when previous fin = 0 and we store the packet to this.prevPacketText and then we parse the current packet and concatenate both.\n\n if(this.prevfin === 1)\n {\n this.parseMessage(1, \"append\");\n }\n else\n {\n this.parseMessage(this.prevfin);\n }\n }\n }", "function decodeCard(card) {\n let value;\n\n if (card[0] == \"A\") {\n value = 14;\n } else if (card[0] == \"K\") {\n value = 13;\n } else if (card[0] == \"Q\") {\n value = 12;\n } else if (card[0] == \"J\") {\n value = 11;\n } else {\n value = parseInt(card[0], 10);\n }\n\n return value;\n}", "function parse_pkt(pkt) {\n/*\n var c0 = Columns[0].start;\n var c1 = Columns[0].end;\n var c2 = Columns[0].name;\n\n console.log(c0);\n console.log(c1);\n console.log(c2);\n\n var frame = bin2hex(Buffer.from(pkt.slice(1,5)));\n var digit = parseInt(frame, 16);\n console.log(digit);\n\n var phi = Buffer.from(pkt.slice(5,9));\n var theta = Buffer.from(pkt.slice(9,13));\n var psi = Buffer.from(pkt.slice(9,13));\n\n var magx = Buffer.from(pkt.slice(5,9));\n var magy = Buffer.from(pkt.slice(9,13));\n var magz = Buffer.from(pkt.slice(9,13));\n \n console.log(phi);\n console.log(theta);\n console.log(psi);\n //console.log(phi.writeFloatBE(0.1,0));\n //console.log(theta.writeFloatBE(0.1,0));\n //console.log(psi.writeFloatBE(0.1,0));\n //console.log(psi.getFloat32(0, true));\n*/\n //console.log(hexdump(pkt));\n var col;\n for (col = 0; col < numColumns; col++) {\n var type = Columns[col].type;\n var value = bin2hex(Buffer.from(pkt.slice(Columns[col].start,Columns[col].end)));\n var buffer = Buffer.from(pkt.slice(Columns[col].start,Columns[col].end));\n //var int32View = new Int32Array(buffer);\n //var float32View = new Float32Array(buffer);\n\n console.log(Columns[col].name, \": \", value);\n //console.log(int32View);\n //console.log(float32View);\n //console.log(type);\n //console.log(value);\n }\n console.log(\"\");\n}", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case dist.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n super.emit(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case dist.PacketType.EVENT:\n this.onevent(packet);\n break;\n case dist.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case dist.PacketType.ACK:\n this.onack(packet);\n break;\n case dist.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case dist.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case dist.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n super.emit(\"connect_error\", err);\n break;\n }\n }", "function decodePayload(record) {\n var recordType = nfc.bytesToString(record.type),\n payload;\n\n // TODO extract this out to decoders that live in NFC code\n // TODO add a method to ndefRecord so the helper \n // TODO doesn't need to do this\n\n if (recordType === \"T\") {\n var langCodeLength = record.payload[0],\n text = record.payload.slice((1 + langCodeLength), record.payload.length);\n payload = nfc.bytesToString(text);\n\n } else if (recordType === \"U\") {\n var identifierCode = record.payload.shift(),\n uri = nfc.bytesToString(record.payload);\n\n if (identifierCode !== 0) {\n // TODO decode based on URI Record Type Definition\n console.log(\"WARNING: uri needs to be decoded\");\n }\n //payload = \"<a href='\" + uri + \"'>\" + uri + \"<\\/a>\";\n payload = uri;\n\n } else {\n\n // kludge assume we can treat as String\n payload = nfc.bytesToString(record.payload);\n }\n\n return payload;\n}", "function onClientPacket(packet) {\n switch (packet.opcode) {\n case this.opcodes.SERVER.AGENT_SERVER:\n this.login.identify(packet);\n break;\n case this.opcodes.SERVER.SERVER_LIST:\n this.login.serverList(packet);\n break;\n case this.opcodes.SERVER.CAPTCHA_REQUEST:\n this.login.captchaRequest(packet);\n break;\n case this.opcodes.SERVER.LOGIN_REPLY:\n this.login.loginResponse(packet);\n break;\n case this.opcodes.SERVER.GAME_LOGIN_REPLY:\n this.login.gameLoginResponse(packet);\n break;\n case this.opcodes.SERVER.CHARACTER_LIST:\n this.charList.analyze(packet);\n break;\n case this.opcodes.SERVER.CHARACTER_SELECT:\n this.charList.characterSelected(packet);\n break;\n case this.opcodes.SERVER.TELEPORT_REQUEST:\n this.teleport.teleportRequest(packet);\n break;\n case this.opcodes.SERVER.CHARDATA_BEGIN:\n this.charData.begin(packet);\n break;\n case this.opcodes.SERVER.CHARDATA_DATA:\n this.charData.data(packet);\n break;\n case this.opcodes.SERVER.CHARDATA_END:\n this.charData.end(packet);\n break;\n case this.opcodes.SERVER.CHARDATA_ID:\n this.charData.id(packet);\n break;\n case this.opcodes.SERVER.WEATHER:\n this.world.weather(packet);\n break;\n case this.opcodes.SERVER.SINGLE_SPAWN:\n this.spawnManager.spawn(packet);\n break;\n case this.opcodes.SERVER.SINGLE_DESPAWN:\n this.spawnManager.despawn(packet);\n break;\n case this.opcodes.SERVER.GROUPSPAWN_BEGIN:\n this.groupSpawn.groupSpawnBegin(packet);\n break;\n case this.opcodes.SERVER.GROUPSPAWN_DATA:\n this.groupSpawn.groupSpawnData(packet);\n break;\n case this.opcodes.SERVER.GROUPSPAWN_END:\n this.groupSpawn.groupSpawnEnd(packet);\n break;\n default:\n break;\n }\n\n //Forward packet to connected clients on the local server\n this.serverPacketManager.forwardPacketAll(packet);\n \n this.emit('clientPacket', packet);\n}", "function ReedSolomonDecoder(field) {\n this.field = field;\n }", "decode (view, offset=0) {\n return this._decode && inBounds(view, this._nbytes, offset) ?\n this._decode(view, offset) : null\n }", "function decompressPng(data, callback) {\n try {\n callback(JSON.parse(atob(data)));\n } catch (e){\n console.warn('Cannot process PNG encoded message ');\n console.error(e);\n }\n}" ]
[ "0.83742833", "0.83576876", "0.83576876", "0.8198985", "0.8152154", "0.7907196", "0.61136425", "0.6030843", "0.6030843", "0.5997337", "0.58481246", "0.5774652", "0.5508943", "0.5468239", "0.54551244", "0.5429483", "0.5420767", "0.53866976", "0.53487724", "0.53168094", "0.52450925", "0.5219086", "0.52081746", "0.52077776", "0.5204278", "0.51854426", "0.51854426", "0.515502", "0.5146723", "0.5143371", "0.5140516", "0.5126372", "0.5115878", "0.51025337", "0.50882506", "0.50555557", "0.5030336", "0.49960512", "0.49927315", "0.4988919", "0.49672678", "0.49672678", "0.49632066", "0.495632", "0.4954617", "0.4898685", "0.48926187", "0.48897532", "0.4885971", "0.48799992", "0.48797965", "0.48600307", "0.48247766", "0.48142922", "0.47966394", "0.478613", "0.47829452", "0.4782654", "0.47776952", "0.47714522", "0.47663513", "0.4739578", "0.47210184", "0.4715231", "0.4710482", "0.47085258", "0.4696137", "0.46949008", "0.46926588", "0.465356", "0.46511808", "0.46435544", "0.46249127", "0.4622956", "0.46221006", "0.46085712", "0.4589586", "0.45848674", "0.45697805", "0.45697805", "0.4563653", "0.45619693", "0.45549798", "0.4554639", "0.45490858", "0.45400783", "0.45342442", "0.4533656", "0.45277396", "0.45266783", "0.4519411", "0.4518582", "0.45185304", "0.450258", "0.44958463", "0.44921914", "0.44867572", "0.4481067" ]
0.5908655
12
Polling transport polymorphic constructor. Decides on xhr vs jsonp based on feature detection.
function polling(opts) { let xhr; let xd = false; let xs = false; const jsonp = false !== opts.jsonp; if (typeof location !== "undefined") { const isSSL = "https:" === location.protocol; let port = location.port; // some user agents have empty `location.port` if (!port) { port = isSSL ? 443 : 80; } xd = opts.hostname !== location.hostname || port !== opts.port; xs = opts.secure !== isSSL; } opts.xdomain = xd; opts.xscheme = xs; xhr = new XMLHttpRequest(opts); if ("open" in xhr && !opts.forceJSONP) { return new XHR(opts); } else { if (!jsonp) throw new Error("JSONP disabled"); return new JSONP(opts); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LongPollingTransport() {\n var _super = new org.cometd.LongPollingTransport();\n var that = org.cometd.Transport.derive(_super);\n\n that.xhrSend = function (packet) {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: \"POST\",\n contentType: \"application/json;charset=UTF-8\",\n data: packet.body,\n xhrFields: {\n // Has no effect if the request is not cross domain\n // but if it is, allows cookies to be sent to the server\n withCredentials: true,\n },\n beforeSend: function (xhr) {\n _setHeaders(xhr, packet.headers);\n // Returning false will abort the XHR send\n return true;\n },\n success: packet.onSuccess,\n error: function (xhr, reason, exception) {\n packet.onError(reason, exception);\n },\n });\n };\n\n return that;\n }", "function LongPollingTransport() {\n const _super = new org.cometd.LongPollingTransport();\n const that = org.cometd.Transport.derive(_super);\n that.xhrSend = (packet) => {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: 'POST',\n contentType: 'application/json;charset=UTF-8',\n data: packet.body,\n beforeSend: (xhr) => {\n _setHeaders(xhr, packet.headers);\n // Returning false will abort the XHR send\n return true;\n },\n success: packet.onSuccess,\n error: (xhr, reason, exception) => {\n packet.onError(reason, exception);\n }\n });\n };\n return that;\n }", "function LongPollingTransport() {\n var _super = new _cometd.LongPollingTransport();\n var that = (0, _cometd.derive)(_super);\n\n that.xhrSend = function (packet) {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: 'POST',\n contentType: 'application/json;charset=UTF-8',\n data: packet.body,\n global: false,\n xhrFields: {\n // For asynchronous calls.\n withCredentials: true\n },\n beforeSend: function beforeSend(xhr) {\n // For synchronous calls.\n xhr.withCredentials = true;\n _setHeaders(xhr, packet.headers);\n // Returning false will abort the XHR send.\n return true;\n },\n success: packet.onSuccess,\n error: function error(xhr, reason, exception) {\n packet.onError(reason, exception);\n }\n });\n };\n\n return that;\n}", "function LongPollingTransport() {\n var _super = new _cometd.LongPollingTransport();\n var that = (0, _cometd.derive)(_super);\n\n that.xhrSend = function (packet) {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: 'POST',\n contentType: 'application/json;charset=UTF-8',\n data: packet.body,\n global: false,\n xhrFields: {\n // For asynchronous calls.\n withCredentials: true\n },\n beforeSend: function beforeSend(xhr) {\n // For synchronous calls.\n xhr.withCredentials = true;\n _setHeaders(xhr, packet.headers);\n // Returning false will abort the XHR send.\n return true;\n },\n success: packet.onSuccess,\n error: function error(xhr, reason, exception) {\n packet.onError(reason, exception);\n }\n });\n };\n\n return that;\n}", "function LongPollingTransport() {\n var _super = new cometdModule.LongPollingTransport();\n var that = cometdModule.Transport.derive(_super);\n\n that.xhrSend = function(packet) {\n return $.ajax({\n url: packet.url,\n async: packet.sync !== true,\n type: 'POST',\n contentType: 'application/json;charset=UTF-8',\n data: packet.body,\n global: false,\n xhrFields: {\n // For asynchronous calls.\n withCredentials: true\n },\n beforeSend: function(xhr) {\n // For synchronous calls.\n xhr.withCredentials = true;\n _setHeaders(xhr, packet.headers);\n // Returning false will abort the XHR send.\n return true;\n },\n success: packet.onSuccess,\n error: function(xhr, reason, exception) {\n packet.onError(reason, exception);\n }\n });\n };\n\n return that;\n }", "function XHRPolling () {\n io.Transport.XHR.apply(this, arguments);\n }", "function XHRPolling () {\n io.Transport.XHR.apply(this, arguments);\n }", "function XHRPolling () {\n io.Transport.XHR.apply(this, arguments);\n }", "function polling$1 (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new xmlhttprequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new pollingXhr(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new pollingJsonp(opts);\n }\n }", "function polling$1(opts) {\n let xhr;\n let xd = false;\n let xs = false;\n const jsonp = false !== opts.jsonp;\n\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new xmlhttprequest(opts);\n\n if (\"open\" in xhr && !opts.forceJSONP) {\n return new pollingXhr(opts);\n } else {\n if (!jsonp) throw new Error(\"JSONP disabled\");\n return new pollingJsonp(opts);\n }\n }", "function polling (opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\t\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\t\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\t\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\t\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\t\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling (opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\t\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\t\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\t\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\t\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\t\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling (opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling (opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling (opts) {\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' === location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname !== location.hostname || port !== opts.port;\n\t xs = opts.secure !== isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\t\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\t\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\t\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\t\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\t\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\t\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\t\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\t\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\t\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\t\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts){\n\t var xhr;\n\t var xd = false;\n\t var xs = false;\n\t var jsonp = false !== opts.jsonp;\n\t\n\t if (global.location) {\n\t var isSSL = 'https:' == location.protocol;\n\t var port = location.port;\n\t\n\t // some user agents have empty `location.port`\n\t if (!port) {\n\t port = isSSL ? 443 : 80;\n\t }\n\t\n\t xd = opts.hostname != location.hostname || port != opts.port;\n\t xs = opts.secure != isSSL;\n\t }\n\t\n\t opts.xdomain = xd;\n\t opts.xscheme = xs;\n\t xhr = new XMLHttpRequest(opts);\n\t\n\t if ('open' in xhr && !opts.forceJSONP) {\n\t return new XHR(opts);\n\t } else {\n\t if (!jsonp) throw new Error('JSONP disabled');\n\t return new JSONP(opts);\n\t }\n\t}", "function polling(opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n }", "function polling(opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n }", "function polling(opts){var xhr;var xd=false;var xs=false;var jsonp=false !== opts.jsonp;if(global.location){var isSSL='https:' == location.protocol;var port=location.port; // some user agents have empty `location.port`\nif(!port){port = isSSL?443:80;}xd = opts.hostname != location.hostname || port != opts.port;xs = opts.secure != isSSL;}opts.xdomain = xd;opts.xscheme = xs;xhr = new XMLHttpRequest(opts);if('open' in xhr && !opts.forceJSONP){return new XHR(opts);}else {if(!jsonp)throw new Error('JSONP disabled');return new JSONP(opts);}}", "function polling(opts) {\n let xhr;\n let xd = false;\n let xs = false;\n const jsonp = false !== opts.jsonp;\n\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if (\"open\" in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error(\"JSONP disabled\");\n return new JSONP(opts);\n }\n}", "function polling(opts) {\n let xhr;\n let xd = false;\n let xs = false;\n const jsonp = false !== opts.jsonp;\n\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if (\"open\" in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error(\"JSONP disabled\");\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' === location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port; // some user agents have empty `location.port`\n\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n xs = opts.secure != isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}", "function polling(opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== \"undefined\") {\n var isSSL = \"https:\" === location.protocol;\n var port = location.port; // some user agents have empty `location.port`\n\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if (\"open\" in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error(\"JSONP disabled\");\n return new JSONP(opts);\n }\n}", "function polling (opts) {\n var xhr\n , xd = false;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n }\n\n xhr = util.request(xd, opts);\n\n if (xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n return new JSONP(opts);\n }\n}", "function polling(opts){\n var xhr;\n var xd = false;\n\n if (global.location) {\n var isSSL = 'https:' == location.protocol;\n var port = location.port;\n\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname != location.hostname || port != opts.port;\n }\n\n opts.xdomain = xd;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n return new JSONP(opts);\n }\n}", "function BaseTransport(options) {\n this.options = options;\n /** A simple buffer holding all requests. */\n this._buffer = new utils_1.PromiseBuffer(30);\n /** Locks transport after receiving rate limits in a response */\n this._rateLimits = {};\n /** Default function used to parse URLs */\n this.urlParser = function (url) { return new url_1.URL(url); };\n this._api = new core_1.API(options.dsn, options._metadata, options.tunnel);\n }", "function Transport(options, callback) {\n options = options || {};\n if (typeof options === 'string') {\n options = {url: options};\n }\n if (typeof callback === 'function') {\n options.callback = callback;\n }\n this.data = options.data || {};\n this.path = options.path || [];\n this.base = options.url;\n this.callback = options.callback || function () {\n };\n this.state = 'idle';\n }", "function polling(opts) {\n var xhr\n var xd = false\n var xs = false\n\n opts.xdomain = xd\n opts.xscheme = xs\n\n return new XHR(opts)\n}", "getLongPollTransport(){ return LongPoll }", "doPoll() {\n debug(\"xhr poll\");\n const req = this.request();\n const self = this;\n req.on(\"data\", function(data) {\n self.onData(data);\n });\n req.on(\"error\", function(err) {\n self.onError(\"xhr poll error\", err);\n });\n this.pollXhr = req;\n }", "doPoll() {\n debug(\"xhr poll\");\n const req = this.request();\n const self = this;\n req.on(\"data\", function(data) {\n self.onData(data);\n });\n req.on(\"error\", function(err) {\n self.onError(\"xhr poll error\", err);\n });\n this.pollXhr = req;\n }", "function Polling(ri, Receiver, recv_url, AjaxObject) {\n var that = this;\n that.ri = ri;\n that.Receiver = Receiver;\n that.recv_url = recv_url;\n that.AjaxObject = AjaxObject;\n that._scheduleRecv();\n}", "doPoll() {\n debug(\"xhr poll\");\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", err => {\n this.onError(\"xhr poll error\", err);\n });\n this.pollXhr = req;\n }", "doPoll() {\n debug(\"xhr poll\");\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", err => {\n this.onError(\"xhr poll error\", err);\n });\n this.pollXhr = req;\n }", "doPoll() {\n debug$1(\"xhr poll\");\n const req = this.request();\n const self = this;\n req.on(\"data\", function(data) {\n self.onData(data);\n });\n req.on(\"error\", function(err) {\n self.onError(\"xhr poll error\", err);\n });\n this.pollXhr = req;\n }" ]
[ "0.7308519", "0.7286786", "0.72286385", "0.72286385", "0.7202566", "0.7158869", "0.7158869", "0.7158869", "0.6479727", "0.64629453", "0.6436861", "0.6436861", "0.64278656", "0.64278656", "0.64278656", "0.6380751", "0.6380751", "0.6380751", "0.6380751", "0.6380751", "0.63772345", "0.63772345", "0.63772345", "0.6319875", "0.6319875", "0.625409", "0.6248678", "0.6248678", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.6242214", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.62203187", "0.6212791", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6205426", "0.6192265", "0.61626863", "0.6035533", "0.6016028", "0.5990677", "0.5942718", "0.56544554", "0.56486654", "0.56486654", "0.56410384", "0.5635839", "0.5597591", "0.5547469" ]
0.6249667
26
JSONP only supports binary as base64 encoded strings
get supportsBinary() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function o(e){return\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+\" */\"}", "function n(e){return\"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+\" */\"}", "btoa(str) {\n return window.btoa(str);\n }", "function cliEncode(any) {\n return Buffer.from(JSON.stringify(any)).toString('base64');\n}", "function btoa(s) {\n var wordArray = CryptoJS.enc.Utf8.parse(s);\n return CryptoJS.enc.Base64.stringify(wordArray);\n}", "function b64_to_utf8( str ) {\n return decodeURIComponent(escape(window.atob( str )));\n}", "function base64url_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64u)\n }", "utoa(str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n }", "function json_string(s) {\n if (s.length > 75) return JSON.stringify(s).slice(1, -1);\n for (var i=0; i<s.length; i++) {\n var code = s.charCodeAt(i);\n if (code < 0x20 || code >= 127 || code === 0x5c || code === 0x22) return JSON.stringify(s).slice(1, -1);\n }\n return s;\n}", "raw_blob(txt) { return Base64.decode(txt) }", "function encodeJSON(options) {\n return btoa(JSON.stringify(options));\n}", "apply_blob(blob) { return Base64.encode(blob) }", "function _btoa(s){\n\treturn window.btoa ? btoa(s) : s;\n}", "function handleJSON(JSONP){\r\n\tvar jDebug = \"JSONP evals to \" +eval(JSONP) + \"\\n\";\r\n\t/*\r\n\tconsole.log(JSONP);\r\n\tif (JSONP == null) jDebug += \"JSONP is null\\n\";\r\n\tif (typeof JSONP === \"undefined\") jDebug += \"typeof JSONP is undefined\\n\";\r\n\tif (JSONP.pub_id == \"\") jDebug += \"JSONP has no pub_id\\n\";\r\n\t*/\r\n\r\n\tvar jStr = JSON.stringify(JSONP);\r\n\tpub_id = jStr.substring( jStr.indexOf('\":\"')+3, jStr.indexOf('\"}]') );\r\n\tjDebug += \"\\njStr = \" +jStr+ \"\\npub_id = \" +pub_id;\r\n\treturn pub_id;\r\n}", "function base64_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64c)\n }", "function b64UTFEncode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, v) {\n return String.fromCharCode(parseInt(v, 16));\n }));\n}", "function json_encode(mixed_val) {\n var retVal, json = this.window.JSON;\n try {\n if (typeof json === 'object' && typeof json.stringify === 'function') {\n retVal = json.stringify(mixed_val); // Errors will not be caught here if our own equivalent to resource\n // (an instance of PHPJS_Resource) is used\n if (retVal === undefined) {\n throw new SyntaxError('json_encode');\n }\n return retVal;\n }\n\n var value = mixed_val;\n\n var quote = function(string) {\n var escapable =\n /[\\\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"': '\\\\\"',\n '\\\\': '\\\\\\\\'\n };\n\n escapable.lastIndex = 0;\n return escapable.test(string) ? '\"' + string.replace(escapable, function(a) {\n var c = meta[a];\n return typeof c === 'string' ? c : '\\\\u' + ('0000' + a.charCodeAt(0)\n .toString(16))\n .slice(-4);\n }) + '\"' : '\"' + string + '\"';\n };\n\n var str = function(key, holder) {\n var gap = '';\n var indent = ' ';\n var i = 0; // The loop counter.\n var k = ''; // The member key.\n var v = ''; // The member value.\n var length = 0;\n var mind = gap;\n var partial = [];\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n if (value && typeof value === 'object' && typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n\n // What happens next depends on the value's type.\n switch (typeof value) {\n case 'string':\n return quote(value);\n\n case 'number':\n // JSON numbers must be finite. Encode non-finite numbers as null.\n return isFinite(value) ? String(value) : 'null';\n\n case 'boolean':\n case 'null':\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce 'null'. The case is included here in\n // the remote chance that this gets fixed someday.\n return String(value);\n\n case 'object':\n // If the type is 'object', we might be dealing with an object or an array or\n // null.\n // Due to a specification blunder in ECMAScript, typeof null is 'object',\n // so watch out for that case.\n if (!value) {\n return 'null';\n }\n if ((this.PHPJS_Resource && value instanceof this.PHPJS_Resource) || (window.PHPJS_Resource &&\n value instanceof window.PHPJS_Resource)) {\n throw new SyntaxError('json_encode');\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n gap += indent;\n partial = [];\n\n // Is the value an array?\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || 'null';\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n v = partial.length === 0 ? '[]' : gap ? '[\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind +\n ']' : '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n\n // Iterate through all of the keys in the object.\n for (k in value) {\n if (Object.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n v = partial.length === 0 ? '{}' : gap ? '{\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + '}' :\n '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n case 'undefined':\n // Fall-through\n case 'function':\n // Fall-through\n default:\n throw new SyntaxError('json_encode');\n }\n };\n\n // Make a fake root object containing our value under the key of ''.\n // Return the result of stringifying the value.\n return str('', {\n '': value\n });\n\n } catch (err) { // Todo: ensure error handling above throws a SyntaxError in all cases where it could\n // (i.e., when the JSON global is not available and there is an error)\n if (!(err instanceof SyntaxError)) {\n throw new Error('Unexpected error type in json_encode()');\n }\n this.php_js = this.php_js || {};\n this.php_js.last_error_json = 4; // usable by json_last_error()\n return null;\n }\n}", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function base64Encode()\n\t\t{\n\t\t\tvar encoded = Base64.encode(fl.scriptURI)\n\t\t\tfl.trace(encoded)\n\t\t\tfl.trace(Base64.decode(encoded))\n\t\t}", "function utf8_to_b64( str ) {\n return window.btoa(unescape(encodeURIComponent( str )));\n}", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent( str )));\n }", "function b64toUtf8(str) {\n return decodeURIComponent(escape(window.atob(str)));\n}", "function utoa(data) {\n return btoa(unescape(encodeURIComponent(data)));\n}", "function toBase64(a){return CryptoJS&&CryptoJS.enc.Base64?CryptoJS.enc.Base64.stringify(CryptoJS.enc.Latin1.parse(a)):Base64.encode(a)}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n\t var output = str.replace('-', '+').replace('_', '/');\n\t switch (output.length % 4) {\n\t\tcase 0:\n\t\t break;\n\t\tcase 2:\n\t\t output += '==';\n\t\t break;\n\t\tcase 3:\n\t\t output += '=';\n\t\t break;\n\t\tdefault:\n\t\t throw 'Illegal base64url string!';\n\t }\n\t return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\t}", "static base64Encode(str) {\n if (typeof btoa != 'undefined') return btoa(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'binary').toString('base64'); // Node.js\n throw new Error('No Base64 Encode');\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polyfill https://github.com/davidchambers/Base64.js\n }", "function supportsBase64() {\n return btoa && atob ? true : false;\n}", "btoa(str, decoder=new TextDecoder()){\n return decoder.decode(this.decode(str))\n }", "function JSON() {}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function encoderBase64() {\n return {\n write: encodeBase64Write,\n end: encodeBase64End,\n\n prevStr: '',\n };\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function fromBase64Url(data) {\n var input = data.padRight(data.length + (4 - data.length % 4) % 4, '=')\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n return toArrayBuffer(atob(input));\n}", "static base64Encode(str) {\n if (typeof btoa != 'undefined') return btoa(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'binary').toString('base64'); // Node.js\n if (typeof base64 !== 'undefined') return base64.encode(str); //react native\n throw new Error('No Base64 Encode');\n }", "function utoa(str) {\n return btoa(unescape(encodeURIComponent(str)));\n}", "function b64EncodeUnicode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {\n return String.fromCharCode('0x' + p1);\n }));\n}", "function b64EncodeUnicode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {\n return String.fromCharCode('0x' + p1);\n }));\n}", "function r(e) {\n return o(btoa(e));\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function toBuffer(base64url) {\n return new Buffer(toBase64(base64url), \"base64\");\n}", "function decodeFileRequest(data){\n\tif(obfuscation==1){\n\t\tvar json = data;\n\t\tjson.content = decodeURIComponent(escape(window.atob(json.content)));\n\t\tjson.fileKey = decodeURIComponent(escape(window.atob(json.fileKey)));\n\t\treturn json;\n\t}\n\telse{\n\t\treturn data;\n\t}\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function encode_params(obj)\n {\n return encodeURIComponent(base64.urlencode($.trim(obj)));\n }", "static serializeJSONBlob(data) {\n return JSON.stringify(data);\n }", "function decodeEpubReader(data){\n\tif(obfuscation==1){\n\t\tjson = JSON.stringify(data);\n\t\tjson = json.replace(/\"/g,\"\");\n\t\tjson = json.substring(0,json.length-4);\n\t\tjson = window.atob(json);\n\t\treturn json;\n\t}\n\telse{\n\t\treturn data;\n\t}\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function getBase64(entry) {\n return btoa(entry);\n}", "function b64ToUtf8(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function decode(input) {\n return JSON.parse(base64.decode(input));\n}", "function b64EncodeUnicode(str) {\n\treturn btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,\n\t\tfunction toSolidBytes(match, p1) {\n\t\t\treturn String.fromCharCode('0x' + p1);\n\t\t}));\n}", "function url_base64_decode(str) {\n\tvar output = str.replace(/-/g, '+').replace(/_/g, '/');\n\tswitch (output.length % 4) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\toutput += '==';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\toutput += '=';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Illegal base64url string!';\n\t}\n\tvar result = window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\ttry {\n\t\treturn decodeURIComponent(escape(result));\n\t} catch (err) {\n\t\treturn result;\n\t}\n}", "function encodeString(value) {\n return Buffer.from(value).toString(\"base64\");\n}", "function encodeString(value) {\n return Buffer.from(value).toString(\"base64\");\n}", "function encodeString(value) {\n return Buffer.from(value).toString(\"base64\");\n}", "function ajax_get_callback_binary(url, callback) {\n var xhr = createCORSRequest(\"GET\", url);\n xhr.onload = function() {\n console.log(\"got response length \" + xhr.response.byteLength);\n callback(xhr.response);\n }\n xhr.responseType = \"arraybuffer\";\n xhr.send();\n}", "function encode(str) {\n // バイナリイメージでbtoaにかける\n const binUi8a = unescape(encodeURIComponent(str));\n\n return btoa(binUi8a);\n }", "function toBase64(u8arr) {\r\n return btoa(String.fromCharCode.apply(null, u8arr)).\r\n replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=*$/, '');\r\n}", "function base64_url_decode(data) {\n return new Buffer(data.replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('ascii');\n}", "function b64EncodeUnicode(str) {\n // first we use encodeURIComponent to get percent-encoded UTF-8,\n // then we convert the percent encodings into raw bytes which\n // can be fed into btoa.\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,\n function toSolidBytes(match, p1) {\n return String.fromCharCode('0x' + p1);\n }));\n}", "base64Encode(input) {\n return EncodingUtils.base64Encode(input);\n }", "function atou(b64) {\n return decodeURIComponent(escape(atob(b64)));\n}", "static base64Encode(str, encoding) {\n return Buffer.from(str, encoding).toString(\"base64\");\n }", "function base64encode(value) {\n\treturn new Buffer(value).toString('base64');\n}", "function requestStringBuilder(base64Encode)\n {\n var str = '';\n\n var addNvPair = function(key, value, encode)\n {\n if (SnowPlow.isNonEmptyString(value))\n {\n var sep = (str.length > 0) ? \"&\" : \"?\";\n str += sep + key + '=' + (encode ? SnowPlow.encodeWrapper(value) : value);\n }\n };\n\n /*\n * Extract suffix from a property\n */\n var getPropertySuffix = function(property)\n {\n var e = new RegExp('\\\\$(.[^\\\\$]+)$'),\n\t\t\t matches = e.exec(property);\n\n if (matches) return matches[1];\n };\n\n /*\n * Translates a value of an unstructured date property\n */\n var translateDateValue = function(date, type)\n {\n switch (type)\n {\n case 'tms':\n return SnowPlow.toTimestamp(date, true);\n case 'ts':\n return SnowPlow.toTimestamp(date, false);\n case 'dt':\n return SnowPlow.toDatestamp(date);\n default:\n return date;\n }\n };\n\n /*\n * Add type suffixes as needed to JSON properties\n */\n var appendTypes = (function()\n {\n\n function recurse(json)\n {\n var translated = {};\n for (var prop in json)\n {\n var key = prop, value = json[prop];\n\n // Special treatment...\n if (json.hasOwnProperty(key))\n {\n\n // ... for JavaScript Dates\n if (SnowPlow.isDate(value))\n {\n type = getPropertySuffix(key);\n if (!type)\n {\n type = 'tms';\n key += '$' + type;\n }\n value = translateDateValue(value, type);\n }\n\n // ... for JSON objects\n if (SnowPlow.isJson(value))\n {\n value = recurse(value);\n }\n\n // TODO: should think about Arrays of Dates too\n }\n\n translated[key] = value;\n }\n return translated;\n }\n return recurse;\n })();\n\n var add = function(key, value)\n {\n addNvPair(key, value, true);\n };\n\n var addRaw = function(key, value)\n {\n addNvPair(key, value, false);\n };\n\n // var addJson = function (keyIfEncoded, keyIfNotEncoded, json) {\n\n // if (SnowPlow.isNonEmptyJson(json)) {\n // var typed = appendTypes(json);\n // var str = JSON2.stringify(typed);\n\n // if (base64Encode) {\n // addRaw(keyIfEncoded, SnowPlow.base64urlencode(str));\n // } else {\n // add(keyIfNotEncoded, str);\n // }\n // }\n // };\n\n return {\n add: add,\n addRaw: addRaw,\n //addJson: addJson,\n build: function()\n {\n return str;\n }\n };\n }", "function base64ToArrayBuffer(base64) {\n if(base64==null || base64=='')\n return;\n var binaryString = window.atob(base64);\n var binaryLen = binaryString.length;\n var bytes = new Uint8Array(binaryLen);\n for (var i = 0; i < binaryLen; i++) {\n var ascii = binaryString.charCodeAt(i);\n bytes[i] = ascii;\n }\n Download('new',bytes);\n}", "function encodeDataString(str)\n {\n\n // Encoding.\n var retStr = str.split(\"\").reverse().join(\"\");\n retStr = '|' + retStr + ' ';\n retStr = Base64.encode(retStr);\n\n return retStr;\n\n }", "function encodeDataURL(string){\n var encoded = encodeURIComponent(string);\n var url = 'data:application/octet-stream,' + encoded;\n return url;\n}", "function urlBase64Decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "qb64b() {\n return Buffer.from(this.qb64(), 'utf-8');\n }", "supportsByteArrayValues() {\n return true;\n }", "function xwwwfurlenc(srcjson) {\n if (typeof srcjson !== \"object\")\n if (typeof console !== \"undefined\") {\n console.log(\"\\\"srcjson\\\" is not a JSON object\");\n return null;\n }\n u = encodeURIComponent;\n var urljson = \"\";\n var keys = Object.keys(srcjson);\n for (var i = 0; i < keys.length; i++) {\n urljson += u(keys[i]) + \"=\" + u(srcjson[keys[i]]);\n if (i < (keys.length - 1)) urljson += \"&\";\n }\n return urljson;\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 b64EncodeUnicode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) =>\n String.fromCharCode(`0x${p1}`)));\n}", "function b64EncodeUnicode(str) {\n // First we use encodeURIComponent to get percent-encoded UTF-8,\n // then we convert the percent encodings into raw bytes which\n // can be fed into btoa.\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode(parseInt(p1, 16));\n }));\n}", "encodedFilters() {\n return btoa(encodeURIComponent(JSON.stringify(this.filters)))\n }", "function base64Encode_(inputStr)\n {\n var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var outputStr = \"\";\n var i = 0;\n while (i < inputStr.length)\n {\n //all three \"& 0xff\" added below are there to fix a known bug\n //with bytes returned by xhr.responseText\n var byte1 = inputStr.charCodeAt(i++) & 0xff;\n var byte2 = inputStr.charCodeAt(i++) & 0xff;\n var byte3 = inputStr.charCodeAt(i++) & 0xff;\n var enc1 = byte1 >> 2;\n var enc2 = ((byte1 & 3) << 4) | (byte2 >> 4);\n var enc3, enc4;\n if (isNaN(byte2)) { enc3 = enc4 = 64; } else { enc3 = ((byte2 & 15) << 2) | (byte3 >> 6); if (isNaN(byte3)) { enc4 = 64; } else { enc4 = byte3 & 63; } }\n outputStr += b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4);\n }\n return outputStr;\n }", "function stringToBase64Url(str) {\n var b64 = btoa(str);\n return base64ToBase64Url(b64);\n } // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function decodeLocalSyncServer(response){\n\tif(obfuscation==1){\n\t\tvar json = JSON.stringify(response);\n\t\tjson=json.replace(/\"/g,\"\");\n\t\tjson=json.substring(0,json.length-4);\t\n\t\tif(!(json=='null++null')){\n\t\t\tjson=decodeURIComponent(escape(window.atob(json)));\n\t\t}\n\t\treturn json;\t\n\t}\n\telse{\n\t\treturn response;\n\t}\t\n}", "atou(str) {\n return decodeURIComponent(escape(window.atob(str)));\n }", "function jsonp_cb() { return XORIGN || FDomainRequest() ? 0 : unique() }", "function encode (obj) {\n return Buffer.from(JSON.stringify(obj)).toString('base64');\n}", "function encodeURLEncodedBase64(value) {\n return encode(value)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '');\n}", "function atob(x) { return Buffer.from(x, 'base64').toString('binary'); }", "static base64Decode(str) {\n if (typeof atob != 'undefined') return atob(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'base64').toString('binary'); // Node.js\n throw new Error('No Base64 Decode');\n }", "function W(t) {\n return \"string\" == typeof t ? R.fromBase64String(t) : R.fromUint8Array(t);\n}", "function json_escape(s){\n return s.toString().replace(/&/g, \"\\u0026\")\n .replace(/</g, \"\\u003C\")\n .replace(/>/g, \"\\u003E\");\n}", "function encode(string){\n\n}", "function JSONString(result, message){\r\n\tresult.write(JSON.stringify({quote: message}));\r\n\tresult.end();\t\r\n}", "function toBase64(base64url) {\n // We this to be a string so we can do .replace on it. If it's\n // already a string, this is a noop.\n base64url = base64url.toString();\n return padString(base64url)\n .replace(/\\-/g, \"+\")\n .replace(/_/g, \"/\");\n}", "function b64EncodeUnicode(str) {\n\t// first we use encodeURIComponent to get percent-encoded UTF-8,\n\t// then we convert the percent encodings into raw bytes which\n\t// can be fed into btoa.\n\treturn btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,\n\t\tfunction toSolidBytes(match, p1) {\n\t\t\treturn String.fromCharCode('0x' + p1);\n\t})).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '.');\n}", "function ct(t) {\n return \"string\" == typeof t ? K.fromBase64String(t) : K.fromUint8Array(t);\n}", "function base64Encode(strText)\n{\n if ((!window.btoa) || (strText.indexOf('°') != -1)) {\n var strKey = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var strOutput = '';\n var strChr1, strChr2, strChr3;\n var strEnc1, strEnc2, strEnc3, strEnc4;\n var intCount = 0;\n do\n {\n strChr1 = strText.charCodeAt(intCount++);\n strChr2 = strText.charCodeAt(intCount++);\n strChr3 = strText.charCodeAt(intCount++);\n strEnc1 = strChr1 >> 2;\n strEnc2 = ((strChr1 & 3) << 4) | (strChr2 >> 4);\n strEnc3 = ((strChr2 & 15) << 2) | (strChr3 >> 6);\n strEnc4 = strChr3 & 63;\n if (isNaN(strChr2))\n strEnc3 = strEnc4 = 64;\n else if (isNaN(strChr3))\n strEnc4 = 64;\n strOutput = strOutput + strKey.charAt(strEnc1) + strKey.charAt(strEnc2) + strKey.charAt(strEnc3) + strKey.charAt(strEnc4);\n }\n while (intCount < strText.length);\n return strOutput;\n }\n include_once('/vendor/jquery-base64/jquery-base64-0.1/jquery.base64.min.js' + strGlobalSufixJsGzip);\n return $.base64.btoa(strText, true);\n}", "function encodeData(strVal){\n\tvar strVal=window.btoa(unescape(encodeURIComponent(strVal)));\n\treturn strVal;\n}", "_encode(ejson) {\n const ejsonString = EJSON.stringify(ejson);\n return encodeURIComponent(ejsonString);\n }", "_encodeQRCodeData(data) {\n try {\n const jsonString = JSON.stringify(data);\n return this._compressAndBase32Encode(jsonString);\n } catch (encodeJSONError) {\n console.error(encodeJSONError);\n throw new Error(\"Unable to create QR code (JSON encode error).\");\n }\n }" ]
[ "0.625282", "0.62268007", "0.61209893", "0.606337", "0.5965628", "0.5958167", "0.5920079", "0.59061635", "0.5901631", "0.5882821", "0.5868579", "0.58586603", "0.58502734", "0.5822688", "0.57557434", "0.5703836", "0.5702308", "0.5700207", "0.569903", "0.56937516", "0.5677663", "0.56750494", "0.5663924", "0.5641275", "0.5625737", "0.5615447", "0.56044614", "0.5594849", "0.55923915", "0.5574927", "0.55728906", "0.55610365", "0.5557057", "0.555513", "0.5552433", "0.5536624", "0.5535378", "0.5526621", "0.55215645", "0.55215645", "0.551438", "0.5511691", "0.5500588", "0.5500349", "0.5496095", "0.54820824", "0.5475031", "0.5470608", "0.5469074", "0.5469074", "0.5469074", "0.5469074", "0.54490626", "0.54489934", "0.5447589", "0.5446357", "0.5445472", "0.54434025", "0.54434025", "0.54434025", "0.5427662", "0.5422324", "0.54195744", "0.54146045", "0.5413425", "0.54098535", "0.5404888", "0.5398139", "0.5394944", "0.53861123", "0.5384761", "0.5381592", "0.5380512", "0.537594", "0.5369228", "0.5362514", "0.53612745", "0.53516996", "0.5349999", "0.53428936", "0.5318949", "0.5303454", "0.53017503", "0.5298356", "0.52959263", "0.529283", "0.52919877", "0.52884316", "0.52806056", "0.5273734", "0.5269516", "0.52598816", "0.52488345", "0.524072", "0.524004", "0.523768", "0.5237306", "0.52364707", "0.5235743", "0.52355313", "0.52339566" ]
0.0
-1
Starts a poll cycle.
doPoll() { const script = document.createElement("script"); if (this.script) { this.script.parentNode.removeChild(this.script); this.script = null; } script.async = true; script.src = this.uri(); script.onerror = e => { this.onError("jsonp poll error", e); }; const insertAt = document.getElementsByTagName("script")[0]; if (insertAt) { insertAt.parentNode.insertBefore(script, insertAt); } else { (document.head || document.body).appendChild(script); } this.script = script; const isUAgecko = "undefined" !== typeof navigator && /gecko/i.test(navigator.userAgent); if (isUAgecko) { setTimeout(function () { const iframe = document.createElement("iframe"); document.body.appendChild(iframe); document.body.removeChild(iframe); }, 100); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n // handle old polls\n if (this.pollHandle) {\n clearInterval(this.pollHandle);\n this.pollHandle = 0;\n }\n // start polling\n this.pollHandle = setInterval(this.poll, this.pollFrequency);\n }", "function startPolling() {\t\t\n\t\t// Don't accidentally start a second loop.\n\t\tif (!ticking) { \n\t\t\tticking = true;\n\t\t\ttick();\n\t\t}\n\t}", "async startPolling(pollOptions = {}) {\n if (this.stopped) {\n this.stopped = false;\n }\n while (!this.isStopped() && !this.isDone()) {\n await this.poll(pollOptions);\n await this.delay();\n }\n }", "async startPolling(pollOptions = {}) {\n if (this.stopped) {\n this.stopped = false;\n }\n while (!this.isStopped() && !this.isDone()) {\n await this.poll(pollOptions);\n await this.delay();\n }\n }", "async startPolling() {\n if (this.stopped) {\n this.stopped = false;\n }\n while (!this.isStopped() && !this.isDone()) {\n await this.poll();\n await this.delay();\n }\n }", "startPolling() {\n this.polling.start();\n }", "function startPolling() {\n setInterval(checkForEvents, 2000);\n }", "startPolling() {\n if (this.interval) {\n return;\n }\n\n this.keepPolling = true;\n this.asyncInterval(this.props.intervalDuration, this.onInterval);\n }", "function tick() {\n var newState = getPollState();\n \n // start the new poll\n if (currentState === STOPPED && newState === STARTED) {\n self.emit('pollstart');\n }\n // stop the current poll\n else if (currentState === STARTED && newState === STOPPED) {\n self.emit('pollstop');\n }\n \n currentState = newState;\n \n self.emit('tick', currentState);\n }", "function doPoll() { setTimeout(poll, 100); }", "function start () {\n resetInterval();\n scope.intervalId = setInterval(tick, scope.interval); \n }", "startTick(){\n this.loop = setInterval(() => {\n this.tickEvent();\n }, 1000/this.tickPerSec);\n this.isTickStarted = true;\n }", "startTicker() {\n this._intervalRef = window.setInterval(this.tick, this._config.frequency || 1000);\n }", "function start () {\n timerHandle = setInterval(beat, interval)\n }", "function tick() {\n\t\tpollStatus();\n\t\tscheduleNextTick();\n\t}", "function start() {\n setInterval(ping, 3000);\n }", "startInterval(){\n this.stopInterval();\n this.interval = setInterval(() => {\n this.dispatchMessageEvent();\n }, parseInt(this.repeat.value));\n }", "run() {\n if (\n this.pollTime >= this.lowestPollTime &&\n this.pollTime <= this.highestPollTime\n ) {\n if (this.watcher === null) {\n this.watcher = setInterval(() => {\n this.update();\n }, this.pollTime);\n } else {\n console.warn(\n \"Watcher is already running. Use stop() first to close the previous watcher and then restart with run().\"\n );\n }\n } else {\n console.error(\n `Invalid value for polltime; The polltime should be between ${\n this.lowestPollTime\n } and ${this.highestPollTime} seconds.`\n );\n }\n }", "function start() {\r\n getScanStatusPoller();\r\n checkScanStatus = setInterval(getScanStatusPoller, 500);\r\n }", "function startRequest() {\n\tinitialize();\n\t// console.log(pollInterval);\n\twindow.setTimeout(startRequest, pollInterval);\n}", "start () {\n\t\tthis.updateTask.setRepeating ((callback) => {\n\t\t\tthis.update (callback);\n\t\t}, App.HeartbeatPeriod, App.HeartbeatPeriod * 2);\n\t}", "function startLoop(intervalPeriod) {\n setInterval(function () {\n serviceLoop();\n }, intervalPeriod);\n }", "start() {\n\t\tif (this.interval !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.interval = setInterval(\"timer.tick()\", 1000);\n\t}", "start () {\n\t\tthis.updateTask.setRepeating ((callback) => {\n\t\t\tthis.update (callback);\n\t\t}, App.HeartbeatPeriod * 4, App.HeartbeatPeriod * 8);\n\t}", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\r\n var missed = false;\r\n cm.display.pollingFast = true;\r\n function p() {\r\n var changed = readInput(cm);\r\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\r\n else {cm.display.pollingFast = false; slowPoll(cm);}\r\n }\r\n cm.display.poll.set(20, p);\r\n }", "start() {\n // initiliaze a time var for the starting time of the invocation\n\n // set the interval\n interval = setInterval(() => {\n // check if the time value is greater than 60 if true reset the value to 1\n if (time > 60) time = 1;\n //with invoking setInterval: inkoking the cb as first para\n this.cb(time);\n // increment the time to the next second\n time++;\n // time interval as second para\n }, 1000);\n }", "function startPing()\n{\n var heartbeat = 90;\n heartbeatTimerId = window.setInterval(opPing, heartbeat*1000);\n}", "function start ()\n{\n\ttimer=self.setInterval(\"increment()\", (1000/divide))\n}", "function startLoopToggle() {\n\t//Check for an active timer interval\n if (timerIntervalId) {\n\t//If interval exists, clear it and reset\n clearInterval(timerIntervalId)\n timerIntervalId = null\n } else {\n //Start a new timer interval\n timerIntervalId = setInterval(everyLoopThisHappens, snake.speed)\n }\n}", "_startPauseLoop() {\n if (this._pauseLoopId) return;\n\n // Note that this interval is canceled every call to setState.\n this._pauseLoopId = window.setInterval(() => {\n if (this.state === PAUSED) {\n this.setState(FINISHED);\n } else if (this.state === STARTED) {\n this.setState(PAUSED);\n }\n }, INTERVAL);\n }", "start() {\n if (this._timeout) return;\n if (this.interval < 0) this.interval = 5 * 60 * 1000;\n\n const self = this;\n function endless() {\n self.check().then(() => {\n if (self._timeout) self._timeout = setTimeout(endless, self.interval);\n });\n }\n this._timeout = setTimeout(endless, this.interval);\n }", "function _start() {\r\n\t\tif (_events.length === 0) {\r\n\t\t\tconsole.log('No events found');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t_currentEvents = _events[0];\r\n\t\t$evName.html(_currentEvents.name);\r\n\t\t_currentEvents.onCountdownStart(_currentEvents);\r\n\t\t_actions();\r\n\t\t_timer = setInterval(_actions, 1000);\r\n\t}", "function startStream() {\n streamInterval = setInterval(working, msFrequency);\n}", "start()\n {\n if (this._started)\n return;\n\n Prefs.on(\"blocked_total\", this._onBlockedTotal);\n\n this._downloader.scheduleChecks(CHECK_INTERVAL, INITIAL_DELAY);\n this._started = true;\n }", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 60000);\r\n }", "function run() {\r\n\t intervalId = setInterval(startClock, 1000);\r\n \t}", "function poll()\n{\n\tverbose('polling');\n\n\tvar nextTime = 10000;\n\n\tfor(var pname in _plugins)\n\t{\n\t\tvar plugin = _plugins[pname];\n\n\t\tif (!pluginDisabled(pname) && plugin.nextPoll <= Date.now())\n\t\t{\n\t\t\tensureProcess(plugin);\n\n\t\t\tnextTime = Math.min(nextTime, plugin.pollInterval);\n\t\t}\n\t}\n\n\tsetTimeout(poll, nextTime);\n}", "start () {\n // Sets up the events\n this._setupEvents()\n // Sets up setup\n if (this.setup) this.setup()\n // Loop!\n if (!this.loop) logger.warn('Looks like you need to define a loop')\n this._setupLoop()\n }", "start()\n {\n if (this._started)\n return;\n\n this._downloader.scheduleChecks(CHECK_INTERVAL, INITIAL_DELAY);\n this._started = true;\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "function start(){\n\tinit();\n\ttimer=setInterval('run()', 100);\n}", "startPollTimeout() {\n if (this.pollingTimeout) {\n clearTimeout(this.pollingTimeout);\n }\n\n this.pollingTimeout = setTimeout(() => {\n this.pollingTimeout = null;\n this.checkDOMDependencies();\n this.startPollTimeout();\n }, pollingInterval);\n }", "doOpen() {\n this.poll();\n }", "start() {\n\t if (this.iObj == null) {\n\t\tthis.iObj = setInterval(this.timerLoopClosure(this), this.deltaT);\n\t }\n\t else {\n\t\tconsole.log(\"lTimer: \" + this.name + \" already started.\");\n\t }\n\t}", "function startPolling(device_data){\n intervalId[device_data.id] = setInterval(function () {\n if (client==undefined){connectMqtt()}\n else {\n if (!client.connected){\n module.exports.setUnavailable( device_data, \"MQTT broker not connected\" );\n connectMqtt();\n } else {\n checkCircleState(device_data, function(response){\n //reserved for callback\n });\n }\n }\n }, 20000);\n}", "async start() {\n await this._runLoop();\n }", "start() {\n this.loop();\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "function start (){ \r\nsetInterval(tickUpdate,12);\r\n}", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 30 * 1000);\r\n }", "_setupLoop () {\n this._time = 0\n this._loop()\n }", "function schedulePulls() {\n interval = setInterval(postNew, routineFrequency);\n}", "start() {\n this.id = setInterval(() => this.handleJoke(), 10000);\n }", "function start (){\n\t\tintervalId = setInterval(countdown, 1000);\n\t}", "function startStopwatch() {\n ticker = setInterval(updateStopwatch, 1000);\n}", "function startTimer() {\n resetTimer();\n tick_ref = setInterval(tick, 1000);\n tick();\n}", "begin(n) {\n this.tickInterval = n;\n this.queueInterval = window.setInterval(this.onTick.bind(this), this.tickInterval);\n }", "startPolling(interval) {\n const fn = async () => {\n try {\n await this.getInfo();\n }\n catch (err) {\n this.log.debug('[%s] device.startPolling(): getInfo(): error:', this.alias, err);\n /**\n * @event Device#polling-error\n * @property {Error} error\n */\n this.emit('polling-error', err);\n }\n };\n this.pollingTimer = setInterval(fn, interval);\n fn();\n return this;\n }", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 30000);\r\n }", "start() {\n\t\tthis.run = true;\n\t\tthis.startDrawCycle();\n\t}", "function init() {\n pollCounts();\n intervals.push(setInterval(pollCounts, pollInterval));\n\n pollStateCounts();\n // intervals.push(setInterval(pollStateCounts, pollInterval));\n\n request.get(wgwapiServer + '/streams', function(res) {\n streams = JSON.parse(res.text);\n for (var i=0; i < streams.length; i++) {\n var stream = streams[i];\n pollStreamData(stream);\n intervals.push(setInterval(pollStreamData, pollInterval, stream));\n }\n });\n }", "function init() {\n pollCounts();\n intervals.push(setInterval(pollCounts, pollInterval));\n\n pollStateCounts();\n // intervals.push(setInterval(pollStateCounts, pollInterval));\n\n request.get(wgwapiServer + '/streams', function(res) {\n streams = JSON.parse(res.text);\n for (var i=0; i < streams.length; i++) {\n var stream = streams[i];\n pollStreamData(stream);\n intervals.push(setInterval(pollStreamData, pollInterval, stream));\n }\n });\n }", "componentDidMount() {\n if (this.props.intervalDuration > 0) {\n this.startPolling();\n }\n }", "function looper_ () {\n \n if (typeof callback_ !== \"function\") {\n throw 'callback to .watch() must be a function';\n }\n \n // keep repeating\n self.start()\n .then (function(pack) {\n \n // do a callback if anything happened\n somethingHappened_ (pack);\n \n // if we're not stopped. go again\n if (!stopped_) {\n looper_();\n }\n \n })\n ['catch'](function(err) {\n // this will have been dealt with further up, but we still need to repoll\n if (!stopped_ && watch_.pollFrequency) {\n looper_();\n }\n });\n \n }", "function start() {\n redislock.acquire(redisKey, function(error) {\n if (!error) {\n\n var soloOptions = {\n touch : function extend(callback) {\n redislock.extend(ttl, callback);\n },\n extend : function extend(time, callback) {\n redislock.extend(time, callback);\n },\n done : function workerFinished() {\n redislock.extend(interval, function (error) {\n setTimeout(function restart() {\n redislock.release(start);\n }, interval);\n });\n }\n };\n\n worker(undefined, soloOptions);\n } else {\n // No lock yet, attempt latter\n setTimeout(start, ping);\n }\n });\n }", "function startRefreshing(){\n var objThis = this;\n\n if (strModeRefresh == \"on\"){\n intIntervalId = setInterval(checkDoneChallenges.bind(objThis), intRefreshRate);\n }\n }", "async refresh() {\n await this._poll.refresh();\n await this._poll.tick;\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function start() {\n if (requestAnimationFrame) {\n requestAnimationFrame(loop);\n }\n else {\n timer = window.setInterval(function () {\n loop(Date.now());\n }, TIME_STEP_MS);\n }\n }", "function start() {\n if (requestAnimationFrame) {\n requestAnimationFrame(loop);\n }\n else {\n timer = window.setInterval(function () {\n loop(Date.now());\n }, TIME_STEP_MS);\n }\n }", "componentDidMount() {\n this.getAppointments();\n this.interval = setInterval(() => {\n loop();\n }, 1000);\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(options.pollInterval, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(options.pollInterval, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(options.pollInterval, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(options.pollInterval, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "startInterval() {\n\t\tif (!this.interval) {\n\t\t\tconsole.log('============ setting interval ' + this.interval);\n\t\t\tvar s = 0;\n\t\t\tthis.interval = setInterval(function() {\n\t\t\t\ts = s + 1 - 1;\n\t\t\t\tconsole.log(s++);\n\t\t\t}, 1000);\n\t\t}\n\t}", "function startLoop() {\n\tisrunnning = true;\n}", "function start(){\n //Use setInterval to start the count here and set the clock to running\n if (!clockRunning){\n intervalId = setInterval(count, 1000);\n clockRunning = true;\n }\n $(\".questionArea\").show();\n\n}", "polling() {\n // let hourInSec = 3600;\n let hourInSec = 32; // For testing purposes make an hour 16 seconds\n\n // Poll every 15 minutes in the first hour\n this.getLatestResponse();\n let numPolls = 1;\n let context = this;\n let polling = setInterval(function() {\n context.getLatestResponse();\n numPolls += 1;\n if (numPolls >= 4 || context.getClaimResponse().outcome != \"queued\") {\n clearInterval(polling);\n context.poll(hourInSec * 1000);\n }\n }, (hourInSec * 1000) / 4);\n }", "start() {\n logger.info('Starting 😡🐶')\n this._setNetworkConditions()\n this.tickToken = setInterval(() => {\n if (didPause) return\n if (this.currentlyPausedService) return\n const x = Math.random()\n if (x < DOWN_PROBABILITY) {\n this.currentlyPausedService = true\n this._pauseService()\n }\n }, TICK_INTERVAL_SEC * 1000)\n }", "startClock() {\n const _this = this;\n\n this.clock = setInterval(() => {\n _this.tick();\n }, 1); // 1 ms delay == 1 KHz clock == 0.000001 GHz\n }", "run() {\n this.fillSportListAndTick();\n this.timerID = setInterval(() => {\n this.tick();\n console.log(\"ctr = \"+this.ctr);\n if (this.ctr < (ONE_DAY_IN_MS / LIVE_TICK_INTERVAL)) {\n this.ctr = this.ctr + 1;\n } else {\n this.ctr = 1;\n }\n }, LIVE_TICK_INTERVAL);\n }", "function doPoll(){\n getMessages();\n setTimeout(doPoll,5000);\n}", "start() {\n var time = new Date;\n var _this = this;\n\n if (this.fps == 60) {\n this.runLoop = displayBind(function tick() {\n _this.onTick(new Date - time);\n _this.runLoop = displayBind(tick);\n time = new Date;\n });\n } else {\n this.runLoop = setTimeout(function tick() {\n _this.onTick(new Date - time);\n _this.runLoop = setTimeout(tick, 1000 / _this.fps);\n time = new Date;\n }, 1000 / this.fps);\n }\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(2000, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(2000, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(2000, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }" ]
[ "0.76123863", "0.71895", "0.6874135", "0.6874135", "0.68717766", "0.66515064", "0.6592384", "0.6528441", "0.6434245", "0.6176149", "0.61074203", "0.61061406", "0.60509974", "0.6016126", "0.58066636", "0.58064574", "0.57810533", "0.5771464", "0.5704371", "0.5701902", "0.5679426", "0.5662528", "0.5645515", "0.56226563", "0.5559893", "0.5559893", "0.5559893", "0.5559893", "0.5559893", "0.5559893", "0.5556876", "0.5506783", "0.54951084", "0.54892176", "0.54724526", "0.5461186", "0.54556066", "0.5434694", "0.5429209", "0.54278296", "0.54277253", "0.5425495", "0.541503", "0.54023725", "0.5399661", "0.539666", "0.539666", "0.539666", "0.53955436", "0.53946066", "0.53940713", "0.5390703", "0.53882045", "0.5354839", "0.53339016", "0.53279245", "0.53279245", "0.53221273", "0.53173554", "0.531191", "0.5309426", "0.529856", "0.52971786", "0.5280417", "0.52744305", "0.5267045", "0.5261516", "0.52505594", "0.5233525", "0.523112", "0.523112", "0.52234966", "0.52214605", "0.522108", "0.52166414", "0.52046955", "0.52026397", "0.52026397", "0.52026397", "0.52026397", "0.52026397", "0.52026397", "0.52008635", "0.52008635", "0.5197104", "0.51944333", "0.51885694", "0.51885694", "0.51885694", "0.5181784", "0.51724297", "0.51701653", "0.51654536", "0.51520735", "0.51423144", "0.51399916", "0.5132685", "0.51320577", "0.51246244", "0.51246244", "0.51246244" ]
0.0
-1
Starts a poll cycle.
doPoll() { debug("xhr poll"); const req = this.request(); req.on("data", this.onData.bind(this)); req.on("error", err => { this.onError("xhr poll error", err); }); this.pollXhr = req; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n // handle old polls\n if (this.pollHandle) {\n clearInterval(this.pollHandle);\n this.pollHandle = 0;\n }\n // start polling\n this.pollHandle = setInterval(this.poll, this.pollFrequency);\n }", "function startPolling() {\t\t\n\t\t// Don't accidentally start a second loop.\n\t\tif (!ticking) { \n\t\t\tticking = true;\n\t\t\ttick();\n\t\t}\n\t}", "async startPolling(pollOptions = {}) {\n if (this.stopped) {\n this.stopped = false;\n }\n while (!this.isStopped() && !this.isDone()) {\n await this.poll(pollOptions);\n await this.delay();\n }\n }", "async startPolling(pollOptions = {}) {\n if (this.stopped) {\n this.stopped = false;\n }\n while (!this.isStopped() && !this.isDone()) {\n await this.poll(pollOptions);\n await this.delay();\n }\n }", "async startPolling() {\n if (this.stopped) {\n this.stopped = false;\n }\n while (!this.isStopped() && !this.isDone()) {\n await this.poll();\n await this.delay();\n }\n }", "startPolling() {\n this.polling.start();\n }", "function startPolling() {\n setInterval(checkForEvents, 2000);\n }", "startPolling() {\n if (this.interval) {\n return;\n }\n\n this.keepPolling = true;\n this.asyncInterval(this.props.intervalDuration, this.onInterval);\n }", "function tick() {\n var newState = getPollState();\n \n // start the new poll\n if (currentState === STOPPED && newState === STARTED) {\n self.emit('pollstart');\n }\n // stop the current poll\n else if (currentState === STARTED && newState === STOPPED) {\n self.emit('pollstop');\n }\n \n currentState = newState;\n \n self.emit('tick', currentState);\n }", "function doPoll() { setTimeout(poll, 100); }", "function start () {\n resetInterval();\n scope.intervalId = setInterval(tick, scope.interval); \n }", "startTick(){\n this.loop = setInterval(() => {\n this.tickEvent();\n }, 1000/this.tickPerSec);\n this.isTickStarted = true;\n }", "startTicker() {\n this._intervalRef = window.setInterval(this.tick, this._config.frequency || 1000);\n }", "function start () {\n timerHandle = setInterval(beat, interval)\n }", "function tick() {\n\t\tpollStatus();\n\t\tscheduleNextTick();\n\t}", "function start() {\n setInterval(ping, 3000);\n }", "startInterval(){\n this.stopInterval();\n this.interval = setInterval(() => {\n this.dispatchMessageEvent();\n }, parseInt(this.repeat.value));\n }", "run() {\n if (\n this.pollTime >= this.lowestPollTime &&\n this.pollTime <= this.highestPollTime\n ) {\n if (this.watcher === null) {\n this.watcher = setInterval(() => {\n this.update();\n }, this.pollTime);\n } else {\n console.warn(\n \"Watcher is already running. Use stop() first to close the previous watcher and then restart with run().\"\n );\n }\n } else {\n console.error(\n `Invalid value for polltime; The polltime should be between ${\n this.lowestPollTime\n } and ${this.highestPollTime} seconds.`\n );\n }\n }", "function start() {\r\n getScanStatusPoller();\r\n checkScanStatus = setInterval(getScanStatusPoller, 500);\r\n }", "function startRequest() {\n\tinitialize();\n\t// console.log(pollInterval);\n\twindow.setTimeout(startRequest, pollInterval);\n}", "start () {\n\t\tthis.updateTask.setRepeating ((callback) => {\n\t\t\tthis.update (callback);\n\t\t}, App.HeartbeatPeriod, App.HeartbeatPeriod * 2);\n\t}", "function startLoop(intervalPeriod) {\n setInterval(function () {\n serviceLoop();\n }, intervalPeriod);\n }", "start() {\n\t\tif (this.interval !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.interval = setInterval(\"timer.tick()\", 1000);\n\t}", "start () {\n\t\tthis.updateTask.setRepeating ((callback) => {\n\t\t\tthis.update (callback);\n\t\t}, App.HeartbeatPeriod * 4, App.HeartbeatPeriod * 8);\n\t}", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\n var missed = false;\n cm.display.pollingFast = true;\n function p() {\n var changed = readInput(cm);\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\n else {cm.display.pollingFast = false; slowPoll(cm);}\n }\n cm.display.poll.set(20, p);\n }", "function fastPoll(cm) {\r\n var missed = false;\r\n cm.display.pollingFast = true;\r\n function p() {\r\n var changed = readInput(cm);\r\n if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}\r\n else {cm.display.pollingFast = false; slowPoll(cm);}\r\n }\r\n cm.display.poll.set(20, p);\r\n }", "start() {\n // initiliaze a time var for the starting time of the invocation\n\n // set the interval\n interval = setInterval(() => {\n // check if the time value is greater than 60 if true reset the value to 1\n if (time > 60) time = 1;\n //with invoking setInterval: inkoking the cb as first para\n this.cb(time);\n // increment the time to the next second\n time++;\n // time interval as second para\n }, 1000);\n }", "function startPing()\n{\n var heartbeat = 90;\n heartbeatTimerId = window.setInterval(opPing, heartbeat*1000);\n}", "function start ()\n{\n\ttimer=self.setInterval(\"increment()\", (1000/divide))\n}", "function startLoopToggle() {\n\t//Check for an active timer interval\n if (timerIntervalId) {\n\t//If interval exists, clear it and reset\n clearInterval(timerIntervalId)\n timerIntervalId = null\n } else {\n //Start a new timer interval\n timerIntervalId = setInterval(everyLoopThisHappens, snake.speed)\n }\n}", "_startPauseLoop() {\n if (this._pauseLoopId) return;\n\n // Note that this interval is canceled every call to setState.\n this._pauseLoopId = window.setInterval(() => {\n if (this.state === PAUSED) {\n this.setState(FINISHED);\n } else if (this.state === STARTED) {\n this.setState(PAUSED);\n }\n }, INTERVAL);\n }", "start() {\n if (this._timeout) return;\n if (this.interval < 0) this.interval = 5 * 60 * 1000;\n\n const self = this;\n function endless() {\n self.check().then(() => {\n if (self._timeout) self._timeout = setTimeout(endless, self.interval);\n });\n }\n this._timeout = setTimeout(endless, this.interval);\n }", "function _start() {\r\n\t\tif (_events.length === 0) {\r\n\t\t\tconsole.log('No events found');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t_currentEvents = _events[0];\r\n\t\t$evName.html(_currentEvents.name);\r\n\t\t_currentEvents.onCountdownStart(_currentEvents);\r\n\t\t_actions();\r\n\t\t_timer = setInterval(_actions, 1000);\r\n\t}", "function startStream() {\n streamInterval = setInterval(working, msFrequency);\n}", "start()\n {\n if (this._started)\n return;\n\n Prefs.on(\"blocked_total\", this._onBlockedTotal);\n\n this._downloader.scheduleChecks(CHECK_INTERVAL, INITIAL_DELAY);\n this._started = true;\n }", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 60000);\r\n }", "function run() {\r\n\t intervalId = setInterval(startClock, 1000);\r\n \t}", "function poll()\n{\n\tverbose('polling');\n\n\tvar nextTime = 10000;\n\n\tfor(var pname in _plugins)\n\t{\n\t\tvar plugin = _plugins[pname];\n\n\t\tif (!pluginDisabled(pname) && plugin.nextPoll <= Date.now())\n\t\t{\n\t\t\tensureProcess(plugin);\n\n\t\t\tnextTime = Math.min(nextTime, plugin.pollInterval);\n\t\t}\n\t}\n\n\tsetTimeout(poll, nextTime);\n}", "start () {\n // Sets up the events\n this._setupEvents()\n // Sets up setup\n if (this.setup) this.setup()\n // Loop!\n if (!this.loop) logger.warn('Looks like you need to define a loop')\n this._setupLoop()\n }", "start()\n {\n if (this._started)\n return;\n\n this._downloader.scheduleChecks(CHECK_INTERVAL, INITIAL_DELAY);\n this._started = true;\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "function start(){\n\tinit();\n\ttimer=setInterval('run()', 100);\n}", "startPollTimeout() {\n if (this.pollingTimeout) {\n clearTimeout(this.pollingTimeout);\n }\n\n this.pollingTimeout = setTimeout(() => {\n this.pollingTimeout = null;\n this.checkDOMDependencies();\n this.startPollTimeout();\n }, pollingInterval);\n }", "doOpen() {\n this.poll();\n }", "start() {\n\t if (this.iObj == null) {\n\t\tthis.iObj = setInterval(this.timerLoopClosure(this), this.deltaT);\n\t }\n\t else {\n\t\tconsole.log(\"lTimer: \" + this.name + \" already started.\");\n\t }\n\t}", "function startPolling(device_data){\n intervalId[device_data.id] = setInterval(function () {\n if (client==undefined){connectMqtt()}\n else {\n if (!client.connected){\n module.exports.setUnavailable( device_data, \"MQTT broker not connected\" );\n connectMqtt();\n } else {\n checkCircleState(device_data, function(response){\n //reserved for callback\n });\n }\n }\n }, 20000);\n}", "async start() {\n await this._runLoop();\n }", "start() {\n this.loop();\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "function start (){ \r\nsetInterval(tickUpdate,12);\r\n}", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 30 * 1000);\r\n }", "_setupLoop () {\n this._time = 0\n this._loop()\n }", "function schedulePulls() {\n interval = setInterval(postNew, routineFrequency);\n}", "start() {\n this.id = setInterval(() => this.handleJoke(), 10000);\n }", "function start (){\n\t\tintervalId = setInterval(countdown, 1000);\n\t}", "function startStopwatch() {\n ticker = setInterval(updateStopwatch, 1000);\n}", "function startTimer() {\n resetTimer();\n tick_ref = setInterval(tick, 1000);\n tick();\n}", "begin(n) {\n this.tickInterval = n;\n this.queueInterval = window.setInterval(this.onTick.bind(this), this.tickInterval);\n }", "startPolling(interval) {\n const fn = async () => {\n try {\n await this.getInfo();\n }\n catch (err) {\n this.log.debug('[%s] device.startPolling(): getInfo(): error:', this.alias, err);\n /**\n * @event Device#polling-error\n * @property {Error} error\n */\n this.emit('polling-error', err);\n }\n };\n this.pollingTimer = setInterval(fn, interval);\n fn();\n return this;\n }", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 30000);\r\n }", "start() {\n\t\tthis.run = true;\n\t\tthis.startDrawCycle();\n\t}", "function init() {\n pollCounts();\n intervals.push(setInterval(pollCounts, pollInterval));\n\n pollStateCounts();\n // intervals.push(setInterval(pollStateCounts, pollInterval));\n\n request.get(wgwapiServer + '/streams', function(res) {\n streams = JSON.parse(res.text);\n for (var i=0; i < streams.length; i++) {\n var stream = streams[i];\n pollStreamData(stream);\n intervals.push(setInterval(pollStreamData, pollInterval, stream));\n }\n });\n }", "function init() {\n pollCounts();\n intervals.push(setInterval(pollCounts, pollInterval));\n\n pollStateCounts();\n // intervals.push(setInterval(pollStateCounts, pollInterval));\n\n request.get(wgwapiServer + '/streams', function(res) {\n streams = JSON.parse(res.text);\n for (var i=0; i < streams.length; i++) {\n var stream = streams[i];\n pollStreamData(stream);\n intervals.push(setInterval(pollStreamData, pollInterval, stream));\n }\n });\n }", "componentDidMount() {\n if (this.props.intervalDuration > 0) {\n this.startPolling();\n }\n }", "function looper_ () {\n \n if (typeof callback_ !== \"function\") {\n throw 'callback to .watch() must be a function';\n }\n \n // keep repeating\n self.start()\n .then (function(pack) {\n \n // do a callback if anything happened\n somethingHappened_ (pack);\n \n // if we're not stopped. go again\n if (!stopped_) {\n looper_();\n }\n \n })\n ['catch'](function(err) {\n // this will have been dealt with further up, but we still need to repoll\n if (!stopped_ && watch_.pollFrequency) {\n looper_();\n }\n });\n \n }", "function start() {\n redislock.acquire(redisKey, function(error) {\n if (!error) {\n\n var soloOptions = {\n touch : function extend(callback) {\n redislock.extend(ttl, callback);\n },\n extend : function extend(time, callback) {\n redislock.extend(time, callback);\n },\n done : function workerFinished() {\n redislock.extend(interval, function (error) {\n setTimeout(function restart() {\n redislock.release(start);\n }, interval);\n });\n }\n };\n\n worker(undefined, soloOptions);\n } else {\n // No lock yet, attempt latter\n setTimeout(start, ping);\n }\n });\n }", "function startRefreshing(){\n var objThis = this;\n\n if (strModeRefresh == \"on\"){\n intIntervalId = setInterval(checkDoneChallenges.bind(objThis), intRefreshRate);\n }\n }", "async refresh() {\n await this._poll.refresh();\n await this._poll.tick;\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function slowPoll(cm) {\n if (cm.display.pollingFast) return;\n cm.display.poll.set(cm.options.pollInterval, function() {\n readInput(cm);\n if (cm.state.focused) slowPoll(cm);\n });\n }", "function start() {\n if (requestAnimationFrame) {\n requestAnimationFrame(loop);\n }\n else {\n timer = window.setInterval(function () {\n loop(Date.now());\n }, TIME_STEP_MS);\n }\n }", "function start() {\n if (requestAnimationFrame) {\n requestAnimationFrame(loop);\n }\n else {\n timer = window.setInterval(function () {\n loop(Date.now());\n }, TIME_STEP_MS);\n }\n }", "componentDidMount() {\n this.getAppointments();\n this.interval = setInterval(() => {\n loop();\n }, 1000);\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(options.pollInterval, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(options.pollInterval, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(options.pollInterval, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(options.pollInterval, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "startInterval() {\n\t\tif (!this.interval) {\n\t\t\tconsole.log('============ setting interval ' + this.interval);\n\t\t\tvar s = 0;\n\t\t\tthis.interval = setInterval(function() {\n\t\t\t\ts = s + 1 - 1;\n\t\t\t\tconsole.log(s++);\n\t\t\t}, 1000);\n\t\t}\n\t}", "function startLoop() {\n\tisrunnning = true;\n}", "function start(){\n //Use setInterval to start the count here and set the clock to running\n if (!clockRunning){\n intervalId = setInterval(count, 1000);\n clockRunning = true;\n }\n $(\".questionArea\").show();\n\n}", "polling() {\n // let hourInSec = 3600;\n let hourInSec = 32; // For testing purposes make an hour 16 seconds\n\n // Poll every 15 minutes in the first hour\n this.getLatestResponse();\n let numPolls = 1;\n let context = this;\n let polling = setInterval(function() {\n context.getLatestResponse();\n numPolls += 1;\n if (numPolls >= 4 || context.getClaimResponse().outcome != \"queued\") {\n clearInterval(polling);\n context.poll(hourInSec * 1000);\n }\n }, (hourInSec * 1000) / 4);\n }", "start() {\n logger.info('Starting 😡🐶')\n this._setNetworkConditions()\n this.tickToken = setInterval(() => {\n if (didPause) return\n if (this.currentlyPausedService) return\n const x = Math.random()\n if (x < DOWN_PROBABILITY) {\n this.currentlyPausedService = true\n this._pauseService()\n }\n }, TICK_INTERVAL_SEC * 1000)\n }", "startClock() {\n const _this = this;\n\n this.clock = setInterval(() => {\n _this.tick();\n }, 1); // 1 ms delay == 1 KHz clock == 0.000001 GHz\n }", "run() {\n this.fillSportListAndTick();\n this.timerID = setInterval(() => {\n this.tick();\n console.log(\"ctr = \"+this.ctr);\n if (this.ctr < (ONE_DAY_IN_MS / LIVE_TICK_INTERVAL)) {\n this.ctr = this.ctr + 1;\n } else {\n this.ctr = 1;\n }\n }, LIVE_TICK_INTERVAL);\n }", "function doPoll(){\n getMessages();\n setTimeout(doPoll,5000);\n}", "start() {\n var time = new Date;\n var _this = this;\n\n if (this.fps == 60) {\n this.runLoop = displayBind(function tick() {\n _this.onTick(new Date - time);\n _this.runLoop = displayBind(tick);\n time = new Date;\n });\n } else {\n this.runLoop = setTimeout(function tick() {\n _this.onTick(new Date - time);\n _this.runLoop = setTimeout(tick, 1000 / _this.fps);\n time = new Date;\n }, 1000 / this.fps);\n }\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(2000, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(2000, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }", "function slowPoll() {\n if (pollingFast) return;\n poll.set(2000, function() {\n startOperation();\n readInput();\n if (focused) slowPoll();\n endOperation();\n });\n }" ]
[ "0.76123863", "0.71895", "0.6874135", "0.6874135", "0.68717766", "0.66515064", "0.6592384", "0.6528441", "0.6434245", "0.6176149", "0.61074203", "0.61061406", "0.60509974", "0.6016126", "0.58066636", "0.58064574", "0.57810533", "0.5771464", "0.5704371", "0.5701902", "0.5679426", "0.5662528", "0.5645515", "0.56226563", "0.5559893", "0.5559893", "0.5559893", "0.5559893", "0.5559893", "0.5559893", "0.5556876", "0.5506783", "0.54951084", "0.54892176", "0.54724526", "0.5461186", "0.54556066", "0.5434694", "0.5429209", "0.54278296", "0.54277253", "0.5425495", "0.541503", "0.54023725", "0.5399661", "0.539666", "0.539666", "0.539666", "0.53955436", "0.53946066", "0.53940713", "0.5390703", "0.53882045", "0.5354839", "0.53339016", "0.53279245", "0.53279245", "0.53221273", "0.53173554", "0.531191", "0.5309426", "0.529856", "0.52971786", "0.5280417", "0.52744305", "0.5267045", "0.5261516", "0.52505594", "0.5233525", "0.523112", "0.523112", "0.52234966", "0.52214605", "0.522108", "0.52166414", "0.52046955", "0.52026397", "0.52026397", "0.52026397", "0.52026397", "0.52026397", "0.52026397", "0.52008635", "0.52008635", "0.5197104", "0.51944333", "0.51885694", "0.51885694", "0.51885694", "0.5181784", "0.51724297", "0.51701653", "0.51654536", "0.51520735", "0.51423144", "0.51399916", "0.5132685", "0.51320577", "0.51246244", "0.51246244", "0.51246244" ]
0.0
-1
Creates the XHR object and sends the request.
create() { const opts = pick(this.opts, "agent", "enablesXDR", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref"); opts.xdomain = !!this.opts.xd; opts.xscheme = !!this.opts.xs; const xhr = this.xhr = new XMLHttpRequest(opts); try { debug("xhr open %s: %s", this.method, this.uri); xhr.open(this.method, this.uri, this.async); try { if (this.opts.extraHeaders) { xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true); for (let i in this.opts.extraHeaders) { if (this.opts.extraHeaders.hasOwnProperty(i)) { xhr.setRequestHeader(i, this.opts.extraHeaders[i]); } } } } catch (e) {} if ("POST" === this.method) { try { xhr.setRequestHeader("Content-type", "text/plain;charset=UTF-8"); } catch (e) {} } try { xhr.setRequestHeader("Accept", "*/*"); } catch (e) {} // ie6 check if ("withCredentials" in xhr) { xhr.withCredentials = this.opts.withCredentials; } if (this.opts.requestTimeout) { xhr.timeout = this.opts.requestTimeout; } if (this.hasXDR()) { xhr.onload = () => { this.onLoad(); }; xhr.onerror = () => { this.onError(xhr.responseText); }; } else { xhr.onreadystatechange = () => { if (4 !== xhr.readyState) return; if (200 === xhr.status || 1223 === xhr.status) { this.onLoad(); } else { // make sure the `error` event handler that's user-set // does not throw in the same tick and gets caught here setTimeout(() => { this.onError(typeof xhr.status === "number" ? xhr.status : 0); }, 0); } }; } debug("xhr data %s", this.data); xhr.send(this.data); } catch (e) { // Need to defer since .create() is called directly from the constructor // and thus the 'error' event can only be only bound *after* this exception // occurs. Therefore, also, we cannot throw here at all. setTimeout(() => { this.onError(e); }, 0); return; } if (typeof document !== "undefined") { this.index = Request.requestsCount++; Request.requests[this.index] = this; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create() {\n const opts = (0, util_js_1.pick)(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n opts.xscheme = !!this.opts.xs;\n const xhr = (this.xhr = new xmlhttprequest_js_1.default(opts));\n try {\n debug(\"xhr open %s: %s\", this.method, this.uri);\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n debug(\"xhr data %s\", this.data);\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }", "create() {\n const opts = pick$1(\n this.opts,\n \"agent\",\n \"enablesXDR\",\n \"pfx\",\n \"key\",\n \"passphrase\",\n \"cert\",\n \"ca\",\n \"ciphers\",\n \"rejectUnauthorized\"\n );\n opts.xdomain = !!this.opts.xd;\n opts.xscheme = !!this.opts.xs;\n\n const xhr = (this.xhr = new xmlhttprequest(opts));\n const self = this;\n\n try {\n debug$1(\"xhr open %s: %s\", this.method, this.uri);\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n } catch (e) {}\n\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n } catch (e) {}\n }\n\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n } catch (e) {}\n\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n\n if (this.hasXDR()) {\n xhr.onload = function() {\n self.onLoad();\n };\n xhr.onerror = function() {\n self.onError(xhr.responseText);\n };\n } else {\n xhr.onreadystatechange = function() {\n if (4 !== xhr.readyState) return;\n if (200 === xhr.status || 1223 === xhr.status) {\n self.onLoad();\n } else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n setTimeout(function() {\n self.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n }\n\n debug$1(\"xhr data %s\", this.data);\n xhr.send(this.data);\n } catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n setTimeout(function() {\n self.onError(e);\n }, 0);\n return;\n }\n\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }", "create() {\n const opts = pick(\n this.opts,\n \"agent\",\n \"enablesXDR\",\n \"pfx\",\n \"key\",\n \"passphrase\",\n \"cert\",\n \"ca\",\n \"ciphers\",\n \"rejectUnauthorized\"\n );\n opts.xdomain = !!this.opts.xd;\n opts.xscheme = !!this.opts.xs;\n\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n const self = this;\n\n try {\n debug(\"xhr open %s: %s\", this.method, this.uri);\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n } catch (e) {}\n\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n } catch (e) {}\n }\n\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n } catch (e) {}\n\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n\n if (this.hasXDR()) {\n xhr.onload = function() {\n self.onLoad();\n };\n xhr.onerror = function() {\n self.onError(xhr.responseText);\n };\n } else {\n xhr.onreadystatechange = function() {\n if (4 !== xhr.readyState) return;\n if (200 === xhr.status || 1223 === xhr.status) {\n self.onLoad();\n } else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n setTimeout(function() {\n self.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n }\n\n debug(\"xhr data %s\", this.data);\n xhr.send(this.data);\n } catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n setTimeout(function() {\n self.onError(e);\n }, 0);\n return;\n }\n\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }", "create() {\n const opts = pick(\n this.opts,\n \"agent\",\n \"enablesXDR\",\n \"pfx\",\n \"key\",\n \"passphrase\",\n \"cert\",\n \"ca\",\n \"ciphers\",\n \"rejectUnauthorized\"\n );\n opts.xdomain = !!this.opts.xd;\n opts.xscheme = !!this.opts.xs;\n\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n const self = this;\n\n try {\n debug(\"xhr open %s: %s\", this.method, this.uri);\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n } catch (e) {}\n\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n } catch (e) {}\n }\n\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n } catch (e) {}\n\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n\n if (this.hasXDR()) {\n xhr.onload = function() {\n self.onLoad();\n };\n xhr.onerror = function() {\n self.onError(xhr.responseText);\n };\n } else {\n xhr.onreadystatechange = function() {\n if (4 !== xhr.readyState) return;\n if (200 === xhr.status || 1223 === xhr.status) {\n self.onLoad();\n } else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n setTimeout(function() {\n self.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n }\n\n debug(\"xhr data %s\", this.data);\n xhr.send(this.data);\n } catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n setTimeout(function() {\n self.onError(e);\n }, 0);\n return;\n }\n\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }", "async send() {\n const Request = this;\n const xhr = Request.xhr;\n return new Promise((resolve, reject) => {\n Request.xhr.open(Request.requestType, Request.url, true);\n Request._prepHeaders.bind(Request)();\n Request.xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 400) {\n var data = Request._processReturn(xhr.response);\n resolve(data);\n }\n reject(xhr);\n };\n Request.xhr.onerror = (event) => {\n reject(event);\n };\n // INITIATE AJAX REQUEST\n Request.xhr.send(Request.data);\n });\n }", "_initXhr() {\n this._xhr = new XMLHttpRequest();\n this._xhr.upload.onprogress = this._onProgress.bind(this);\n this._xhr.onreadystatechange = this._onReadyStateChange.bind(this);\n this._xhr.open(this.method, this.getUrl(), true);\n\n try {\n this._xhr.withCredentials = true;\n } catch (e) {}\n\n // Set headers\n let headers = {};\n if (BrowserHelper.isWebkit() || BrowserHelper.isTrident()) {\n headers = {\n ...headers,\n 'If-None-Match': '*',\n 'If-Modified-Since': 'Mon, 26 Jul 1997 05:00:00 GMT',\n 'Cache-Control': 'no-cache',\n 'X-Requested-With': 'XMLHttpRequest'\n };\n }\n headers = {...headers, ...this.headers};\n Object.keys(headers).forEach(key => {\n this._xhr.setRequestHeader(key, headers[key]);\n });\n }", "function make_XHR_request(destination, data) {\n\tvar request = new XMLHttpRequest();\n\trequest.open('POST', destination);\n\trequest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\trequest.send(data);\n\n\trequest.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n \tprocess_response(this.responseText);\n }\n }\n request.onerror = function() {\n \thandle_error();\n }\n}", "function createXhr() {\r\n var xhr;\r\n try {\r\n xhr = new XMLHttpRequest();\r\n } catch (ignore) {\r\n xhr = createMicrosoftXhr();\r\n }\r\n return xhr;\r\n }", "function send(){\n\trequest = new XMLHttpRequest();\n\tvar url = \"ViewHistoryController\";\n\trequest.onreadystatechange = handleResponse;\n\trequest.open(\"GET\",url,true);\n\trequest.send();\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 createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {\n }\n }", "function createXMLHttpRequest() {\r\n var obj;\r\n if (window.XMLHttpRequest) {\r\n obj = new XMLHttpRequest();\r\n }\r\n else {\r\n obj = new ActiveXObject('Microsoft.XMLHTTP');\r\n }\r\n return obj;\r\n }", "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {}\n }", "function sendRequest() {\n if (window.XMLHttpRequest) {\n req = new XMLHttpRequest();\n } else {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n req.onreadystatechange = handleResponse;\n req.open(\"GET\", \"/get_post_json\", true);\n req.send(); \n}", "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch ( e ) {}\n }", "function createRequest() {\n\t\tvar request;\n\t\tif (window.XMLHttpRequest || true) {\n\t\t\trequest = new XMLHttpRequest();\n\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Older Browser\");\n\t\t}\n\t\treturn request;\n\t}", "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch( e ) {}\n }", "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch( e ) {}\n }", "create() {\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n opts.xscheme = !!this.opts.xs;\n const xhr = (this.xhr = new XHR(opts));\n try {\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }", "function doXHR() {\n \"use strict;\"\n\n // pre check\n if (g_polling_xhr && g_polling_xhr.readystate != 4) {\n g_polling_xhr.abort();\n }\n\n // creation of requestToNotifyEvent method request json object\n var item = {};\n item[\"uuid\"] = getUUID();\n item[\"seqNum\"] = isSafari(g_userAgent) ? 0 : g_seqnum;\n\n var paramObj = [];\n paramObj.push(item);\n\n var JSONObj = {};\n JSONObj['method'] = \"requestToNotifyEvent\";\n JSONObj['params'] = paramObj;\n JSONObj['id'] = 72;\n JSONObj['version'] = \"1.0\";\n\n // creation and making connection of XMLHttpRequest API\n g_polling_xhr = new XMLHttpRequest();\n g_polling_xhr.onreadystatechange = callbackXHR;\n //g_polling_xhr.open(\"POST\", webAPIName, true);\n g_polling_xhr.open(\"POST\", \"cgi-bin/photo_share_cgi.cgi\", true);\n g_polling_xhr.setRequestHeader('Content-Type', 'application/json');\n g_polling_xhr.timeout = 100 * 1000; // msec\n g_polling_xhr.send(JSON.stringify(JSONObj));\n /* after 5s check if polling XHR die then send it again. */\n clearTimeout(g_polling_check);\n g_polling_check = setTimeout(\"doXHR()\", 5000);\n}", "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {}\n }", "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {}\n }", "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {\n }\n }", "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {\n }\n }", "function createStandardXHR() {\r\n\t\ttry {\r\n\t\t\treturn new window.XMLHttpRequest();\r\n\t\t} catch (e) { }\r\n\t}", "function createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch (e) { }\n }", "function createStandardXHR() {\n\t try {\n\t return new window.XMLHttpRequest();\n\t } catch( e ) {}\n\t}", "function createStandardXHR() {\n\t\ttry {\n\t\t\treturn new window.XMLHttpRequest();\n\t\t} catch( e ) {}\n\t}", "function createStandardXHR() {\n\t\ttry {\n\t\t\treturn new window.XMLHttpRequest();\n\t\t} catch( e ) {}\n\t}", "function createStandardXHR() {\n\t\ttry {\n\t\t\treturn new window.XMLHttpRequest();\n\t\t} catch (e) {}\n\t}", "send() {\n\n this.request.open(this.method, this.url);\n\n for (var header in this.headers) {\n this.request.setRequestHeader(header, this.headers[header]);\n }\n\n var str_data = '';\n\n if (this.data instanceof FormData) {\n this.request.send(this.data);\n } else {\n for(var name in this.data) {\n str_data = str_data + name + '=' + encodeURIComponent(this.data[name]) + '&';\n }\n this.request.send(str_data);\n }\n\n }", "function sendXHR(url, createXHR, _a) {\r\n var _b = _a === void 0 ? {} : _a, _c = _b.method, method = _c === void 0 ? 'GET' : _c, _d = _b.data, data = _d === void 0 ? null : _d, _e = _b.parseResponse, parseResponse = _e === void 0 ? true : _e;\r\n return new Promise$5(function (resolve, reject) {\r\n var xhr = createXHR();\r\n xhr.open(method, url, true);\r\n xhr.onreadystatechange = function () {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 200) {\r\n var responseText = xhr.responseText || '';\r\n if (responseText && parseResponse)\r\n responseText = JSON.parse(xhr.responseText); //eslint-disable-line no-restricted-globals\r\n resolve(responseText);\r\n }\r\n else\r\n reject('disconnected');\r\n }\r\n };\r\n xhr.send(data);\r\n });\r\n }", "function createStandardXHR(){try{return new window.XMLHttpRequest();}catch(e){}}", "function createStandardXHR(){try{return new window.XMLHttpRequest();}catch(e){}}", "function createStandardXHR(){try{return new window.XMLHttpRequest();}catch(e){}}", "function createRequestXhr(request, accessToken) {\n\t var url = request.url(accessToken);\n\t var xhr = new window.XMLHttpRequest();\n\t xhr.open(request.method, url);\n\t Object.keys(request.headers).forEach(function(key) {\n\t xhr.setRequestHeader(key, request.headers[key]);\n\t });\n\t return xhr;\n\t}", "function createXMLHttpRequest() {\n if ( window.XMLHttpRequest ) {\n return new XMLHttpRequest();\n } else {\n return new ActiveXObject( \"Microsoft.XMLHTTP\" );\n }\n}", "function createRequest() {\n var xhr = false;\n if (window.XMLHttpRequest) {\n xhr = new XMLHttpRequest();\n }\n else if (window.ActiveXObject) {\n xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n return xhr;\n} // end function createRequest()", "function makeXHR(){//this should let IE have properish suport\n\t\t\tif (!window.XMLHttpRequest) {\n\t\t\t\treturn new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t} else if (window.XMLHttpRequest) {//for normal browsers\n\t\t\t\treturn new XMLHttpRequest();\n\t\t\t}\n\t\t}", "function createHttpRequestObject() {\n\tvar xmlHttp = new XMLHttpRequest || new ActiveXObject(\"Microsoft.XMLHTTP\");\n\treturn xmlHttp;\t\t \n}", "request() {\n var self = this;\n var elements = Editable.getAllEditableElement();\n this.Serialize = new Serialize(elements);\n\n var method = self.config.method;\n this.xhr = new XMLHttpRequest();\n\n // open request\n if (method == 'GET') {\n this.xhr.open(method, self.config.url + '?' + this.Serialize.GET(), true);\n this.addHeader([\"Content-Type\", \"application/x-www-form-urlencoded\"]);\n } else if (method == 'POST') {\n this.xhr.open(method, self.config.url, true);\n this.addHeader([\"Content-Type\", \"multipart/form-data\"]);\n }\n\n // headers\n this.header();\n\n // additional params\n this.param();\n\n // send\n if (method == 'GET') {\n this.xhr.send();\n } else if (method == 'POST') {\n this.xhr.send(this.Serialize.POST());\n }\n\n return this;\n }", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n}", "function createHTTPRequest(){\n if (window.XMLHttpRequest){\n return new XMLHttpRequest();\n } else {\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch( e ) {}\n}", "function createStandardXHR() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch( e ) {}\n}" ]
[ "0.7162275", "0.7077175", "0.69760513", "0.69760513", "0.6852933", "0.6830658", "0.66991496", "0.668577", "0.66575855", "0.6622561", "0.65485585", "0.65437675", "0.6529103", "0.6523386", "0.64866996", "0.6481637", "0.6469967", "0.6469967", "0.6460935", "0.644697", "0.644549", "0.644549", "0.6440425", "0.6440425", "0.64348954", "0.6434649", "0.6431469", "0.6425316", "0.6425316", "0.64206463", "0.64202684", "0.6379144", "0.63761365", "0.63761365", "0.63761365", "0.63582087", "0.6331608", "0.63219595", "0.63213915", "0.6306269", "0.63012135", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.62664187", "0.6260141", "0.62573755", "0.62573755", "0.62573755", "0.62573755", "0.62573755" ]
0.7026445
2
Called upon successful response.
onSuccess() { this.emit("success"); this.cleanup(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function successHandler() {\n if (response.get_statusCode() == 200)\n onSuccess(response.get_body());\n else\n onError(response.get_body());\n }", "function handleSuccess( response ) {\n\t\t return( response.data.responseObject);\n\t\t }", "success(response) {\n\t\tthis.response = response;\n\t\tthis.status = response.status;\n\t}", "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn super.handleResponse();\n\t\t}\n\n\t\t// return customized response data to New Relic\n\t\tthis.responseData = {\n\t\t\tpost: Utils.ToNewRelic(this.codeError, this.post, this.users)\n\t\t};\n\t\treturn super.handleResponse();\n\t}", "function processResponse(){\n //\n }", "function handleSuccess( response ) {\n return( response.data );\n }", "function handleSuccess( response ) {\n return( response.data );\n }", "function handleSuccess( response ) {\n return( response.data );\n }", "function handleSuccess( response ) {\n return( response.data );\n }", "function handleSuccess( response ) {\n return( response.data );\n }", "function handleSuccess( response ) {\n return( response.data );\n }", "function handleSuccess( response ) {\n\n return( response.data );\n\n }", "function handleSuccess( response ) {\n\n return( response.data );\n\n }", "function handleSuccess( response ) {\n\n return( response.data );\n\n }", "function handleSuccess( response ) {\n\n return( response.data );\n\n }", "function handleSuccess( response ) {\n return( response.data.responseObject);\n }", "function handleSuccess( response ) {\n return( response.data );\n }", "function handleSuccess( response ) {\n\n return response.data;\n }", "function success(response) {\n return response;\n }", "function success(response) {\n return response;\n }", "function success(response) {\n return response;\n }", "function handleSuccess(response) {\r\n\t\t\treturn (response.data);\r\n\t\t}", "function _success_callback(resp, man){\n\t// The response is a generic bbop.rest.response.json.\n\t// Peel out the graph and render it.\n\tif( resp.okay() ){\n\t add_to_graph(resp.raw());\n\t}else{\n\t ll('the response was not okay');\t \n\t}\n\t_spin_hide();\n }", "function statusSuccess(model, response)\n\t{\n\t\tapp.setUser(response);\n//\t\tcallback();\n\t\tapp.changeContext('top');\n\t}", "setNextResponseType (success) {\r\n this.responseWillBeSucccessFull = success;\r\n }", "function processResponse() {\n // readyState of 4 signifies request is complete\n if (xhr.readyState == 4) {\n // status of 200 signifies sucessful HTTP call\n if (xhr.status == 200) {\n pageChangeResponseHandler(xhr.responseText);\n }\n }\n }", "function handleSuccess(response) {\n\t\t\t\treturn (response.data);\n\t\t\t}", "function handleSuccess(response) {\n\t\t\t\treturn (response.data);\n\t\t\t}", "function sendResponse(result) {\n if (result != null) {\n response.send(200, result);\n \n }\n else\n response.send(401, \"no records found\");\n return next();\n }", "function sendResponse(result) {\n if (result != null) {\n response.send(200, result);\n }\n else\n response.send(401, \"no records found\");\n return next();\n }", "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn super.handleResponse();\n\t\t}\n\n\t\t// only return a full response if this was the user's first company\n\t\tif (this.transforms.additionalCompanyResponse) {\n\t\t\tthis.log('NOTE: sending additional company response to POST /companies request');\n\t\t\tthis.responseData = this.transforms.additionalCompanyResponse;\n\t\t\tthis.teamId = this.responseData.teamId;\n\t\t\tthis.userId = this.responseData.userId;\n\t\t} else {\n\t\t\tthis.userId = this.user.id;\n\t\t\tif (this.transforms.createdTeam) {\n\t\t\t\tthis.responseData.team = this.transforms.createdTeam.getSanitizedObject({ request: this });\n\t\t\t\tthis.responseData.team.companyMemberCount = 1;\n\t\t\t\tthis.teamId = this.transforms.createdTeam.id;\n\t\t\t}\n\t\t\tif (this.transforms.createdTeamStream) {\n\t\t\t\tthis.responseData.streams = [\n\t\t\t\t\tthis.transforms.createdTeamStream.getSanitizedObject({ request: this })\n\t\t\t\t]\n\t\t\t}\n\t\t\tif (this.transforms.newAccessToken) {\n\t\t\t\tthis.responseData.accessToken = this.transforms.newAccessToken;\n\t\t\t}\n\t\t}\n\n\t\tif (this.transforms.userUpdate) {\n\t\t\tthis.responseData.user = this.transforms.userUpdate;\n\t\t\tif (this.responseData.user.$set) {\n\t\t\t\tdelete this.responseData.user.$set.nrUserInfo;\n\t\t\t}\n\t\t}\n\n\t\tthis.log('NEWRELIC IDP TRACK: CS company was created');\n\t\treturn super.handleResponse();\n\t}", "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn super.handleResponse();\n\t\t}\n\t\tthis.responseData = {\n\t\t\tuser: Object.assign({ id: this.user.id }, this.transforms.userUpdate)\n\t\t};\n\t\tawait super.handleResponse();\n\t}", "function after_response(info) {\n\t\t\t//If the response has not been recorded, record it\n\t\t\tif (response.key == -1) {\n\t\t\t\tresponse = info; //Replace the response object created above\n\t\t\t}\n\t\t\tend_trial();\n\n\t\t}", "function handleSuccess(response) {\r\n\t\tconsole.log('handle success');\r\n\t\tconsole.log(response);\r\n\t\treturn (response.data.responseBody);\r\n\r\n\t}", "function onSaveSuccess (response) {\n console.debug('BOOM', response);\n }", "response() {\n throw new Error('Not implemented');\n }", "atkSuccessTest(response, content) {\n if (response.success) {\n this.onSuccess(response, content);\n } else {\n this.onFailure(response);\n }\n }", "function handleSuccess(response) {\n\n // alert(\"handleSuccess\");\n\n return (response.data);\n\n }", "function onSuccess () {}", "function handleSuccess(response) {\n return response.data;\n }", "function handleSuccess(response) {\n return (response.data);\n }", "function OnSuccessCallMaladie(data, status, jqXHR) {\n\t\t}", "function handleSuccess( response ) {\n //alert('data count ' + response.data[0].firstName);\n empInformation = response.data;\n return( response.data );\n\n }", "function successfulChange(response){\n response.tell('Merry Christmas!');\n}", "success(resp) {\n if (!resp.X.responseText) {\n this.failure(resp);\n }\n else {\n const [_sesKey, _values, _scripts] = this.parseResponseArray(resp.X.responseText);\n if (_sesKey === '') {\n console.error('Invalid session key, error message should follow...');\n }\n else if (_sesKey === Session.oldKey) {\n // TODO: (which?) iPad sometimes sends same request 3 times. Skip repsonder if it has same ses key than previous one.\n console.warn('Session key is the same as the previous one; skipping response...');\n }\n else {\n Session.newKey(_sesKey);\n this.setValues(_values);\n this.runScripts(_scripts, _sesKey);\n }\n if (this._serverInterruptView && _sesKey !== '') {\n this._serverInterruptView.die();\n this._serverInterruptView = false;\n }\n }\n }", "function handleSuccess(response) {\n return (response.data);\n }", "function sendResponse(result ) {\n if (result != null) {\n console.log(result);\n response.send(200, result);\n }\n else\n response.send(401, \"\");\n return next();\n }", "function onSuccessItem(fileItem, response, status, headers) {\n // Show success message\n\n\n // Clear upload buttons\n vm.cancelUpload();\n var data = {};\n data._id = vm.eventId;\n data.imgUrl = response.imgUrl;\n EventService.updateEvent(data).then(function (res) {\n vm.success = \"success\";\n getEventsLocation();\n },\n function (err) {\n vm.error = \"error\"\n });\n // $state.go('index.gallery');\n\n }", "function response(response) {\n console.log(response)\n res.status(response.status).json({msg: response.msg})\n }", "function finish( response ) {\n logResponse(response);\n\n if ( state == STATE_END ){\n state = STATE_READY;\n done();\n }\n }", "function onComplete() {\n\t// Print the time response received\n\t$('#info').append('<p>Response received at: ' + new Date() + '</p>');\n}", "function respond(){\n\t\t\t\t\t// flush HTTP response\n\t\t\t\t\tvar bin = responsePacket.serialize();\n\t\t\t\t\t//sys.puts( utils.hex(bin) );\n\t\t\t\t\t//sys.puts( sys.inspect(responsePacket) );\n\t\t\t\t\tres.writeHead( 200, {\n\t\t\t\t\t\t'Content-Type': 'application/x-amf',\n\t\t\t\t\t\t'Content-Length': bin.length \n\t\t\t\t\t} );\n\t\t\t\t\tres.write( bin, \"binary\" );\n\t\t\t\t\tres.end();\n\t\t\t\t}", "serverResponse(data) {\n if (data.result == 'success') {\n Toast.fire({\n type: 'success',\n title: data.message //Success message from server\n })\n this.$Progress.finish();\n Fire.$emit('AfterCreate'); //Fire an reload event\n\n } else {\n swal.fire(\n 'Error!',\n data.message, //Error message from server\n 'error'\n )\n this.$Progress.fail(); //End the progress bar\n }\n }", "function processServerResponse(response){\n if(response.error){\n\n }\n else if (response.success) {\n\n }\n}", "static succeded() {\n return MediaServerResponse.response('success', '');\n }", "__handleResponse() {\n this.push('messages', {\n author: 'server',\n text: this.response\n });\n }", "function finishResponse(error, buffer) {\n if (error) {\n response.write('Failure: ' + error + '<br>');\n } else {\n response.write(command + ' success.<br>');\n if (command === 'readTag') {\n var verified = tagReader.parseMessage(buffer);\n if (verified) {\n response.write('You entered the correct response.<br>');\n lockControl.open();\n } else {\n response.write('However, your response does not match this tag.<br>');\n }\n }\n }\n response.end();\n }", "function success(response) {\n console.log(\"update states success\");\n }", "function after_response(info) {\n\t\t\t//If the response has not been recorded, record it\n\t\t\tif (response.key == -1) {\n\t\t\t\tresponse = info; //Replace the response object created above\n\t\t\t\thighlight_rect(response.key)\n\t\t\t}\n\t\t\telse{\n\t\t\t\tend_trial();\n\n\t\t\t}\n\n\t\t}", "onOk() {\n doneRedirect();\n }", "function handleSubmitServerResponse(){\n\t\t// move forward only if the transaction has completed\n if (xmlHttp.readyState == 4){\n \t// status of 200 indicates the transaction completed successfully\n if (xmlHttp.status == 200){\n \tvar response = xmlHttp.responseText; \n \tgame.alert = \"REGISTER\";\n \talertBox(response);\n \t\n }\n // a HTTP status different than 200 signals an error\n else{\n \tgame.alert = \"ERROR\";\n \talertBox(\"There was a problem accessing the server: \" + xmlHttp.statusText);\n }\n\t\t}\n\t}", "function responseHandler (app) {\n // Complete your fulfillment logic and send a response\n // DONE: Figure out how to grab the zipcode from dialogflow's post\n // app.tell(JSON.stringify(request.body.result.parameters.zip-code));\n app.tell()\n // TODO: Create a function that takes that and gets the shabbat time and responds accordingly\n\n }", "onSuccess() {\n this.emit(\"success\");\n this.cleanup();\n }", "done() {\n const eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);\n //because some frameworks might decorate them over the context in the response\n const eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(() => this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;\n AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);\n }", "function completeHandler(e) {\n console.log(\"received \" + e.responseCode + \" code\");\n var serverResponse = e.response;\n}", "function handle_unsuccessful_response(response) {\n clear_elements([\"fixture_body\", \"fixture_name\", \"integration_name\", \"URL\"]);\n try {\n var status_code = response.statusCode().status;\n response = JSON.parse(response.responseText);\n set_message(\"Result: \" + \"(\" + status_code + \") \" + response.msg, \"warning\");\n } catch (err) {\n // If the response is not a JSON response then it would be Django sending a HTML response\n // containing a stack trace and useful debugging information regarding the backend code.\n document.write(response.responseText);\n }\n return;\n}", "function sendResponse(result) {\n if (result != null) {\n response.send(200, result);\n }\n else\n response.send(401, \"\");\n return next();\n }", "function successCallBack(response) {\n $scope.hideMessage();\n $scope.setUserToLS({ email: $scope.user.email, password: \"\" });\n User.setToken(response.data.token);\n response.data.user = $scope.parseDataFromDB(response.data.user);\n User.setUser(response.data.user);\n $scope.goToPage('app/matching');\n }", "function processTheSuccessPage(response){\r\n if (response.statusResponse.statusCode === 200) { \r\n history.push(\"/registersuccess\");\r\n window.location.reload();\r\n }\r\n }", "function callback(response){\n }", "onSuccess() {\n this.emit(\"success\");\n this.cleanup();\n }", "function onSuccess() {}", "function responseProcess(){\n\t\t\tif(logrequest.readyState == 4){\n\t\t\t\tif(logrequest.status == 200){\n\t\t\t\t\talert(logrequest.responseText);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\talert(logrequest.responseText);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function handleRequest(request, response){\n response.end(JSON.stringify({\n \"success\": true\n }));\n}", "async handleResponse () {\n\t\tif (this.gotError) {\n\t\t\treturn await super.handleResponse();\n\t\t}\n\t\tthis.responseData.team.$set.version = this.updateOp.$set.version;\n\t\tthis.responseData.team.$version = this.updateOp.$version;\n\t\tawait super.handleResponse();\n\t}", "function success(result) {\n return { kind: \"success\", result: result };\n }", "function checkResponse() {\n response = JSON.parse(this.response);\n if (this.status == 200) {\n flash(response.status);\n } else {\n flash(response.status, true);\n }\n}", "function handleSuccess(response) {\n\n return (response.data);\n\n }", "function OnSuccessCallMaladie(data, status, jqXHR) {\n\t\t\treturn true;\n\t\t}", "function simple_response_handler(response) {\n\tif (response.status !== 200) {\n\t\tconsole.log(\"sendData failed\");\n\t}\n}", "function success(response) {\n return response.data;\n }", "function handleSuccess(res) {\n\t\t\treturn res.data;\n\t\t}", "function success(packet) {\n console.log(\"This method is called if a response from the server is received.\");\n // Take a look at the java docs for details on the structure of the packets.\n if(packet.loginResponse === \"Valid\") {\n Cookies.setCookie(\"token\", packet.token, packet.expiration);\n }\n}", "function cb (_error, _response, _context) {\n if(_error) {\n callback({errorMessage: _error.message, errorCode: _error.code},null,_context);\n } else if (_response.statusCode >= 200 && _response.statusCode <= 206) {\n var parsed = JSON.parse(_response.body);\n parsed = new UpdateAClientResponse(parsed);\n callback(null,parsed,_context);\n } else {\n callback({errorMessage: \"HTTP Response Not OK\", errorCode: _response.statusCode, errorResponse: _response.body}, null, _context);\n }\n }", "function callback(response, status) {\n\n\t}", "function fillInResponse(response){\n $(\"#response\").text(response.responseText);\n }", "function ok(obj) {\n response({ status: 'ok', response: obj });\n }", "function onRegister(response) {\n\n if (response.Result === \"Success\") {\n\n console.log('Translation requested...');\n\n //set a relative long time (15 minutes)\n lmv.checkTranslationStatus(\n urn, 1000 * 60 * 30, 1000 * 10,\n progressCallback).then(\n onTranslationCompleted,\n onError);\n\n uploadprogress = 1;\n currentUrn = urn;\n //res.send({'urn':urn});\n\n }\n else {\n console.log(response.Result);\n }\n\n //res.send(response.Result);\n }", "function response(result){\n if(result && !result.error){\n if(callbacks.pass) callbacks.pass(result);\n app.log('Logged in', result);\n\n isIn = true;\n authToken = gapi.auth.getToken().access_token;\n db.load();\n }\n else {\n if(callbacks.fail) callbacks.fail(result);\n app.log('Could not log in.', result);\n\n isIn = false;\n authToken = null;\n }\n checked = true;\n auth.visualize();\n }", "function successHandler() {\n\n // Check for status code == 200\n // Some other status codes, such as 302 redirect\n // do not trigger the errorHandler. \n if (response.get_statusCode() == 200) {\n var categories;\n var output;\n\n // Load the OData source from the response.\n categories = JSON.parse(response.get_body());\n\n // Extract the CategoryName and Description\n // from each result in the response.\n // Build the output as a list.\n output = \"<UL>\";\n for (var i = 0; i < categories.d.results.length; i++) {\n var categoryName = categories.d.results[i].CategoryName;\n var description = categories.d.results[i].Description;\n output += \"<LI>\" + categoryName + \":&nbsp;\" +\n description + \"</LI>\";\n }\n output += \"</UL>\";\n\n $(\"#categories\").html(output);\n }\n else {\n var errordesc;\n\n errordesc = \"<P>Status code: \" +\n response.get_statusCode() + \"<br/>\";\n errordesc += response.get_body();\n $(\"#categories\").html(errordesc);\n }\n }", "update_response(response) {\n this.response = response;\n }", "function handlePostResponse(response,status,jsonDataStr){\r\n\t\t\t//check JQuerry status\r\n\t\t\tif (status == 'success'){\r\n\t\t\t\t//convert response to JSON\r\n\t\t\t\tvar responseJson = JSON.parse(response);\r\n\t\t\t\t//convert data send with request to JSON\r\n\t\t\t\tvar storedData = JSON.parse(jsonDataStr);\r\n\t\t\t\t//Check status code in server respone\r\n\t\t\t\tif (responseJson.code == \"200\"){\r\n\t\t\t\t\t//code: 200 is OK \r\n\t\t\t\t\t//change the marker typ make it a non editable marker\r\n\t\t\t\t\tchangeMarkerNonEdit(storedData);\r\n\t\t\t\t\t//display statusmassge to user and color it \r\n\t\t\t\t\t//green because every thing worked fine\r\n\t\t\t\t\tdisplay.updateMassageBoard(responseJson.msg,\"green\");\r\n\t\t\t\t\t//clear massage && enable digitizing && display next step to user after timeout (seconds)\r\n\t\t\t\t\twaitResetStart(2)\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// all other codes are errors and will be treaded the same \r\n\t\t\t\t\t//display individual errormassage (comes form backend) (collor: red)\r\n\t\t\t\t\tdisplay.updateMassageBoard(responseJson.msg,\"red\");\r\n\t\t\t\t\t//remove the marker form map\r\n\t\t\t\t\tremoveEditMarker();\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t//status is acutally not set, response is only send as JSON (respone)\r\n\t\t\t\t//sust in case display an errormassage anyways\r\n\t\t\t\tvar massage = \"Es ist ein unerwarteter Fehler aufgetretten! Bitte kontaktieren Sie: Webmaster@xyz.de.\"\r\n\t\t\t\tdisplay.updateMassageBoard(massage,\"red\");\r\n\t\t\t\t//remove marker \r\n\t\t\t\tremoveEditMarker();\r\n\t\t\t};\r\n}", "function itemAddedSuccess(){\n responseText.textContent = responses[1]\n responseText.style.color = '#155724'\n responseText.style.backgroundColor = '#d4edda'\n clearActionResponse()\n}", "function onComplete(err, response){\n if(err){\n callback(errors.create(err));\n } else {\n callback(null, response);\n }\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 }", "handleResponse(response) {\n this.getAmenities();\n if (response.data.error === \"noErrors\")\n $.notify(response.data.message, 'success')\n else $.notify(response.data.message, 'error');\n }", "function callback(response) {\n\n newsLetterResponseSim = response;\n\n isSuccessResponseSim = response.isSuccess;\n\n errorReponseSim = response.error;\n\n console.log(\"isSuccessResponseSim : \" + isSuccessResponseSim);\n\n if (isSuccessResponseSim) {\n\n $j('#formNewsLetterSim').removeClass().addClass('news-success');\n\n var emailInput = document.getElementById(\"emailSim\");\n\n emailInput.value = \"\";\n document.getElementById(\"news-info-sim\").innerHTML = errorReponseSim;\n\n console.log(\"Sim errorReponseSim : \" + errorReponseSim);\n $j('#formNewsLetterSim').removeClass().addClass('news-success');\n\n\n\n } else {\n\n $j('#formNewsLetterSim').removeClass().addClass('news-error');\n\n document.getElementById(\"news-info-sim\").innerHTML = errorReponseSim;\n\n console.log(\"Sim errorReponseSim : \" + errorReponseSim);\n\n }\n\n\n\n \n\n }", "function add_claim_success_response_function(response)\n {\n show_notification(\"msg_holder\", \"success\", \"Success:\", \"Claim made successfully\");\n fade_out_loader_and_fade_in_form(\"loader\", \"form\"); \n $(\"#balance_now\").html(\"Gh¢\" + response.new_balance);\n $('#form')[0].reset();\n }", "function processResponse(resp) {\n hideStatus();\n log('processResponse: ' + resp);\n\n // TBD...\n if (true) {\n let output = 'Success! Response:\\n\\n' + resp;\n if (opt_debugAlerts) { // Debugging\n alert(output);\n }\n let newOutput = parseResponse(resp);\n if (newOutput != \"\") { // TBD...\n alert(newOutput);\n }\n }\n }", "function emailSuccess(response) {\n showSuccessMessage(\"Email sent successfully.\");\n $rootScope.closeSpinner();\n }", "response(response) {\n\t\tconsole.log(response);\n\t\treturn response;\n\t}" ]
[ "0.74693984", "0.70926416", "0.69739425", "0.6914346", "0.6857608", "0.6819196", "0.6815287", "0.6815287", "0.67661136", "0.67661136", "0.67661136", "0.67448944", "0.67448944", "0.67448944", "0.6742008", "0.6737797", "0.6642669", "0.6600003", "0.6488967", "0.6475226", "0.6475226", "0.64655024", "0.6460038", "0.6456662", "0.64362675", "0.6411967", "0.64060533", "0.64060533", "0.6392211", "0.6360898", "0.635518", "0.6333596", "0.633001", "0.6323152", "0.6294897", "0.6293153", "0.628897", "0.6286305", "0.6278939", "0.6272976", "0.627241", "0.6253845", "0.6199012", "0.6197629", "0.61958146", "0.61952716", "0.6190734", "0.6182052", "0.617645", "0.6170305", "0.61682737", "0.61632586", "0.61626416", "0.6156782", "0.6155598", "0.61418325", "0.6128329", "0.61210346", "0.6101526", "0.6096903", "0.6093799", "0.60916585", "0.6086334", "0.60823834", "0.60773146", "0.6076614", "0.6076372", "0.6066165", "0.60605896", "0.605447", "0.6049031", "0.6048763", "0.6046161", "0.60454047", "0.6043943", "0.6042335", "0.60301375", "0.6029911", "0.6027925", "0.602616", "0.60194254", "0.6016257", "0.601223", "0.5998883", "0.599848", "0.5997217", "0.5979804", "0.597149", "0.59655935", "0.59625834", "0.5948392", "0.5948083", "0.5946798", "0.5940896", "0.59314334", "0.59249383", "0.59155065", "0.5910794", "0.59101015", "0.5906693", "0.590334" ]
0.0
-1
Called if we have data.
onData(data) { this.emit("data", data); this.onSuccess(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setObjectDataLoaded() {\n this.hasDataLoaded.object = true\n if(this.hasDataLoaded.record === true) {\n this.handleWireDataLoaded();\n }\n }", "_doFetch() {\n\t\tthis.emit(\"needs_data\", this);\n\t}", "get hasData(){ return this._rawARData !== null }", "function requestData() {\n firstDataPass = true;\n __notifySubscribersForNewDataCache(firstDataValues);\n firstDataValues = [];\n }", "function dataLoaded(err,data,m){\n}", "getData () {\n if (data) {\n this.data = data;\n this.emit('change', this.data);\n }\n }", "function on_data(data) {\n data_cache[key] = data;\n placeholder.update();\n }", "setData() {}", "function checkIfDataLoaded()\n{\n\tif (dataIsLoaded)\n\t{\n\t\t// Load data into tables\n\t\tloadDataIntoTables();\n\n\t\t// If has attachments, then load them\n\t\tif (window.imageLinksArray != null)\n\t\t{\n\t\t\tloadScreenshots();\n\t\t}\n\t\t// If has comments, then load them\n\t\tif (window.commentsArray != null)\n\t\t{\n\t\t\tloadComments();\n\t\t}\n\n\t\t// Hide loading screen and show the body\n\t\t$(\"#loadingContainer\").addClass(\"hidden\");\n\t\t$(\"#viewReportContainer\").removeClass(\"hidden\");\n\n\t\t// Stop the check\n\t\tclearInterval(checkDataLoaded);\n\t}\n}", "data(data) {\n this.__processEvent('data', data);\n }", "loadingData() {}", "loadingData() {}", "function updateData() {\n\t/*\n\t* TODO: Fetch data\n\t*/\n}", "_handleData() {\n // Pull out what we need from props\n const {\n _data,\n _dataOptions = {},\n } = this.props;\n\n // Pull out what we need from context\n const {\n settings = {},\n } = this.context;\n\n // Pull the 'getData' method that all modules which need data fetching\n // must implement\n const {\n getData = (() => Promise.resolve({ crap: 5 })),\n } = this.constructor;\n\n /**\n * Check if data was loaded server-side.\n * If not - we fetch the data client-side\n * and update the state\n *\n * We'll also add add the global settings to\n * the request implicitely\n */\n if (!_data) {\n getData(Object.assign({}, { __settings: settings }, _dataOptions))\n .then(_data => this.setState({ ['__data']: _data }))\n .catch(_data => this.setState({ ['__error']: _data }));\n }\n }", "checkInitialData(data, config) {\n return true;\n }", "mrdataavailable (e) {\n\t\t\tthis.send_datavailable ();\n\t\t\tthis.statuslog(\"Handling on data available\");\n\t\t\tif (e.data.size > 0) {\n\t\t\t\tthis.recordedChunks.push(e.data);\n\t\t\t\tthis.statuslog(e.data);\n\t\t\t}\n\n\t\t\tif (this.shouldStop === true && this.stopped === false) {\n\t\t\t\tthis.mediaRecorder.stop();\n\t\t\t\tthis.stopped = true;\n\t\t\t\tthis.statuslog (\"clicked... and ... stopped\");\n\t\t\t}\n\t\t}", "get hasData() {\n return !!this.props.data;\n }", "setHasData(value) {\n this.hasData = value;\n }", "function get_data() {}", "onData(data) {\n let done = false;\n if (data.progress) {\n this.onProgress(this.progressBarElement, this.progressBarMessageElement, data.progress);\n }\n if (data.complete === true) {\n done = true;\n if (data.success === true) {\n this.onSuccess(this.progressBarElement, this.progressBarMessageElement, this.getMessageDetails(data.result));\n } else if (data.success === false) {\n this.onTaskError(this.progressBarElement, this.progressBarMessageElement, this.getMessageDetails(data.result));\n } else {\n done = undefined;\n this.onDataError(this.progressBarElement, this.progressBarMessageElement, \"Data Error\");\n }\n if (data.hasOwnProperty('result')) {\n this.onResult(this.resultElement, data.result);\n }\n } else if (data.complete === undefined) {\n done = undefined;\n this.onDataError(this.progressBarElement, this.progressBarMessageElement, \"Data Error\");\n }\n return done;\n }", "_dataReceived(data) {\n this._rawData = data;\n this._data = JSON.parse(this._rawData);\n try {\n this._initialise();\n } catch(e) {\n console.error(e.message);\n }\n }", "function isDataReady(dataRequest, data) {\n data.ready = true; // initialize as true\n\n dataRequest.stream.forEach((variable) => {\n if (_.isNil(data[variable])) {\n data.ready = false;\n }\n });\n\n dataRequest.get.forEach((variable) => {\n if (_.isNil(data[variable])) {\n data.ready = false;\n }\n });\n}", "function receivedData(objs) {\n // if the received data is not of the last request: do nothing with it\n if (id == this._dataRequestID) {\n this._processData(objs,callback);\n }\n }", "function waitForData(){\n if(data.fetching){\n setTimeout(waitForData, 10);\n } else {\n callback(data);\n }\n }", "function checkForData(data) {\n\t\tconst probe = JSON.parse(data.body);\n\t\tconst sub = data.headers.subscription;\n\n\t\tif (!probe) {\n\t\t\treportEmptyData(probe.id);\n\t\t}\n\n\t\tunsubscribe(sub);\n\t}", "onDataReceived(data) {\n /*\n All received data is appended to a ReceiveBuffer.\n This makes sure that all the data we need is received before we attempt to process it.\n */\n this._receiveBuffer.append(data);\n // Process data that we have.\n this.processData();\n }", "function handle_data_available(event) {\n if (event.data.size > 0) {\n recordedChunks.push(event.data);\n }\n}", "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "function processDataFromDocusky() {\n\tparseDocInfo();\n\ttoolSetting();\n}", "get data () {return this._data;}", "function reloadData() {\n if (typeof (CPData) != \"undefined\") { CPData.regenerate(); }\n if (typeof (CPDataSoon) != \"undefined\") { CPData.regenerate(); }\n if (typeof (CPDataDownloaded) != \"undefined\") { CPData.regenerate(); }\n loadInfo();\n }", "function getDataReady() {\n return _dataReady;\n }", "prepareData() {\n super.prepareData();\n\n const actorData = this.data;\n const data = actorData.data;\n const flags = actorData.flags;\n }", "function handleData(error, streamData) {\n\n streamValues = streamData[0].streamData;\n streamInfo = streamData[1];\n streamConfig = streamData[2].settingFound;\n\n $(\"#datapts\").text(streamValues.length);\n $(\"#autofit\").hide();\n $(\"#autofitlabel\").hide();\n\n if (streamValues == false){\n alert('No values available');\n return;\n }\n\n if (error) {\n throw error;\n }\n renderMap();\n}", "renderedCallback(){\n if( this.accountdata.data != undefined && this.accountdata.data != null && Object.keys(this.accountdata.data).length > 0 ){\n console.log('showMode--');\n this.showMode=true;\n }\n }", "handleDataSuccess() {\n\t\tthis.setState( {\n\t\t\treceivingData: true,\n\t\t\tloading: false,\n\t\t} );\n\t}", "function useData(data) {\n data = data || EMBED.getData();\n //debugger;\n var url_string = window.location.href; \n var url = new URL(url_string);\n SegmentActualId = url.searchParams.get(\"SegmentActualId\");\n updateGlobalVariable(SegmentActualId, \"SegmentActualId\", true, true);\n if (flagLoaded == false) {\n styleData();\n flagLoaded = true;\n }\n \n var ParsedPreparedLotsJson = returnParsedIfJson(data.PreparedLotsJson, \"PreparedLotsJson\");\n if (PreparedLotsJson == undefined || !deepEqual(PreparedLotsJson, returnParsedIfJson(data.PreparedLotsJson, \"PreparedLotsJson\"))) {\n PreparedLotsJson = ParsedPreparedLotsJson;\n \n }\n\n var ParsedProductDescriptionJson = returnParsedIfJson(data.ProductDescriptionJson, \"ProductDescriptionJson\");\n if (ProductDescriptionJson == undefined || !deepEqual(ProductDescriptionJson, returnParsedIfJson(data.ProductDescriptionJson, \"DataGridJsonData\"))) {\n ProductDescriptionJson = ParsedProductDescriptionJson;\n \n }\n PreparedLotsDataGrid();\n ProductDescriptionDatagrid();\n}", "function loadData(data) {\n _userData = data.userData;\n}", "function loadExistingData() {\n existingData = lbs.limeDataConnection.ActiveInspector.Controls.GetValue('creditinfo')\n if (existingData) {\n existingData = lbs.loader.xmlToJSON(existingData, 'creditdata');\n if (moment().diff(existingData.creditdata.ratingData.ratingDate, 'days') < self.config.maxAge) {\n viewModel.ratingValue(existingData.creditdata.ratingData.ratingValue);\n viewModel.ratingText(existingData.creditdata.ratingData.ratingText);\n viewModel.ratingDate(existingData.creditdata.ratingData.ratingDate);\n }\n }else if(viewModel.inline){\n existingData = viewModel.inline;\n viewModel.ratingValue('?');\n viewModel.ratingText('Ingen kreditrating tagen');\n viewModel.loadText('Ta kreditkontroll');\n }\n }", "function _init() {\n var self = this\n ;\n\n if (!!self['_data']) {\n self.bindTo(_loadData)(self['_data']);\n }\n }", "onLoaderData(data) {\n\n this.loaded = true;\n\n this.metadata = getMetadata(data);\n\n // Ensure other actions are taken before re-rendering\n this._onLoadActions.forEach(onLoadAction => onLoadAction(data));\n\n if (this._setState) {\n\n this._setState({\n ...this.state,\n data: data.payload,\n loading: false,\n loadingError: null,\n ...this.metadata.pagination\n });\n }\n\n if (this.onLoadData) {\n\n this.onLoadData(data);\n }\n }", "function loadData(){ \t\n \t//if (gameData.data.player.playerID>0) {\n \t\tCORE.LOG.addInfo(\"PROFILE_PAGE:loadData\");\n \t\t//var p = new ProfileCommunication(CORE.SOCKET, setData); \t\t\n \t\t//p.getData(gameData.data.player.playerID); \t\t\n \t\t\n \t//}\n \t//else \n \t\tsetDataFromLocalStorage(); \t \t \t\n }", "function getAndProcessData() { \n\t\tchooseFileSource();\n\t}", "handleZeroData() {\n\t\tconst instructionProps = propsFromAccountStatus( 'account-connected-no-data' );\n\n\t\tthis.setState( {\n\t\t\tzeroData: true,\n\t\t\tloading: false,\n\t\t\tinstructionProps,\n\t\t} );\n\t}", "setData(data) {\n // Handle situation where this is clearing existing data, by ensuring the change event is\n // emitted.\n const forceEmit = (Object.keys(this._cachedData).length > 0);\n this._cachedData = {};\n this.add(data, forceEmit);\n }", "render() {\n const self = this;\n const data = self.get('data');\n if (!data) {\n throw new Error('data must be defined first');\n }\n self.clear();\n self.emit('beforerender');\n self.refreshLayout(this.get('fitView'));\n self.emit('afterrender');\n }", "hasValues() {\n\t\treturn this.data.length > 0;\n\t}", "componentDidMount() {\n if (this.props.dataset.length === 0) {\n const { dispatch } = this.props;\n dispatch(fetchDataset());\n }\n }", "load() {\n\t\tif (this.props.onDataRequire) {\n\t\t\tthis.props.onDataRequire.call(this, this, 0, 1048576, this.props.columns);\n\t\t}\n\t}", "getData () {\n }", "function verifyData(){\n getDatas();\n}", "set data(data) {\n if (this._data === data) return;\n this._data = data;\n this._render();\n }", "function syncData() {}", "function isEmptyDataObject(obj) {\n var name;\n for (name in obj) {\n\n // if the public data object is empty, the private is still empty\n if (name === \"data\" && jQuery.isEmptyObject(obj[name])) {\n continue;\n }\n if (name !== \"toJSON\") {\n return false;\n }\n }\n\n return true;\n }", "function ready(error, csv_data){\n console.log('You now have access to data. We saved it in the variable csv_data.');\n // console.log(csv_data);\n var parsedData = parseData(csv_data);\n if (parsedData.passedTypeChecks == false){\n // console.log(parsedData);\n $('#chart').empty();\n }\n else {\n drawGraph(csv_data, parsedData.data, '#chart');\n }\n }", "__doDataUpdate() {\n if (this.$isDestroyed) {\n return;\n }\n\n let queues = this.__setDataQueue;\n this.__setDataQueue = null;\n if (!queues || !queues.length) {\n return;\n }\n\n // call lifecycle beforeUpdate hook\n this.beforeUpdate && this.beforeUpdate();\n this.setData(getSetDataPaths(queues), this.__nextTickCallback);\n }", "function getData()\n\t\t{\n\t\t\tvar newData = { hello : \"world! it's \" + new Date().toLocaleTimeString() }; // Just putting some sample data in for fun.\n\n\t\t\t/* Get my data from somewhere and populate newData with it... Probably a JSON API or something. */\n\t\t\t/* ... */\n\n\t\t\t// I'm calling updateCallback to tell it I've got new data for it to munch on.\n\t\t\tupdateCallback(newData);\n\t\t}", "loadData() {\n\n }", "onDataReady() {\n switch (this.state) {\n case RPCServerState.InitHeader: {\n this.handleInitHeader();\n break;\n }\n case RPCServerState.InitHeaderKey: {\n this.handleInitHeaderKey();\n break;\n }\n case RPCServerState.ReceivePacketHeader: {\n this.currPacketHeader = this.readFromBuffer(8 /* I64 */);\n const reader = new ByteStreamReader(this.currPacketHeader);\n this.currPacketLength = reader.readU64();\n support_1.assert(this.pendingBytes == 0);\n this.requestBytes(this.currPacketLength);\n this.state = RPCServerState.ReceivePacketBody;\n break;\n }\n case RPCServerState.ReceivePacketBody: {\n const body = this.readFromBuffer(this.currPacketLength);\n support_1.assert(this.pendingBytes == 0);\n support_1.assert(this.currPacketHeader !== undefined);\n this.onPacketReady(this.currPacketHeader, body);\n break;\n }\n case RPCServerState.WaitForCallback: {\n support_1.assert(this.pendingBytes == 0);\n break;\n }\n default: {\n throw new Error(\"Cannot handle state \" + this.state);\n }\n }\n }", "isEmpty() {\n return (this.data.length===0);\n }", "function assigned (data) {\n return !isUndefined(data) && !isNull(data);\n }", "processCallbackData() {\n\t\tconst {\n\t\t\tdata,\n\t\t\trequestDataToState,\n\t\t} = this.props;\n\n\t\tif ( data && ! data.error && 'function' === typeof requestDataToState ) {\n\t\t\tthis.setState( requestDataToState );\n\t\t}\n\t}", "function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }", "function handleDataAvailable(e) {\n console.log('video data available');\n recordedChunks.push(e.data);\n }", "function onDataUpdate(data, errors, metadata) {\n // Implement custom data handling here.\n // Push the data to an internal queue, filter & process it in realtime, ...\n console.log(JSON.stringify(data));\n if(errors) {\n console.error(errors);\n }\n}", "function isEmptyDataObject( obj ) {\n var name;\n for ( name in obj ) {\n \n // if the public data object is empty, the private is still empty\n if ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n continue;\n }\n if ( name !== \"toJSON\" ) {\n return false;\n }\n }\n \n return true;\n }", "processData() {\n for (const item of this.unprocessedData) {\n this.addToData(buildOrInfer(item));\n }\n this.unprocessedData.clear();\n }", "function noDataAvailable() {\n readingDivs.append(\"p\")\n .text(\"No data available\")\n .attr(\"class\", \"container\");\n }", "function isDataReady() {\n if (mapData && newsData && data2004 && data2014 && data2016 && data2019) {\n drawMap(yearsAvailable[slider.value], [1, 2, 3, 6, 10]);\n drawChart(data2004);\n }\n}", "getData(){}", "function clearData(data) {\n _userData = data.userData;\n}", "function getData()\n\t\t{\n\t\t\tvar newData = { hello : \"world! it's \" + new Date().toLocaleTimeString() }; // Just putting some sample data in for fun.\n\n\t\t\t/* Get my data from somewhere and populate newData with it... Probably a JSON API or something. */\n\t\t\t/* ... */\n\t\t\tupdateCallback(newData);\n\t\t}", "function isEmptyDataObject( obj ) {\n var name;\n for ( name in obj ) {\n\n // if the public data object is empty, the private is still empty\n if ( name === \"data\" && jQuery.isEmptyObject( obj[ name ] ) ) {\n continue;\n }\n if ( name !== \"toJSON\" ) {\n return false;\n }\n }\n\n return true;\n }", "function isEmptyDataObject( obj ) {\n\t\tvar name;\n\t\tfor ( name in obj ) {\n\n\t\t\t// if the public data object is empty, the private is still empty\n\t\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( name !== \"toJSON\" ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "function isEmptyDataObject( obj ) {\n\t\tvar name;\n\t\tfor ( name in obj ) {\n\n\t\t\t// if the public data object is empty, the private is still empty\n\t\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( name !== \"toJSON\" ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "function handleDataAvailable(event){\n if(event.data && event.data.size > 0){\n recordedBlobs.push(event.data);\n }\n}", "function checkDataFiles() {\n // TODO set up later\n}", "get data() {\n\t\treturn this.__data;\n\t}", "preIngestData() {}", "function init(){\n getData();\n}", "function isEmptyDataObject( obj ) {\n var name;\n for ( name in obj ) {\n\n // if the public data object is empty, the private is still empty\n if ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n continue;\n }\n if ( name !== \"toJSON\" ) {\n return false;\n }\n }\n\n return true;\n }", "checkData(){\n return this.print();\n }", "function isEmptyDataObject( obj ) {\n\t var name;\n\t for ( name in obj ) {\n\n\t // if the public data object is empty, the private is still empty\n\t if ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\n\t continue;\n\t }\n\t if ( name !== \"toJSON\" ) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t}", "function isEmptyDataObject(obj) {\r\n\t\tvar name;\r\n\t\tfor (name in obj) {\r\n\r\n\t\t\t// if the public data object is empty, the private is still empty\r\n\t\t\tif (name === \"data\" && jQuery.isEmptyObject(obj[name])) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (name !== \"toJSON\") {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "_onRead(data) {\n\t this.valueBytes.write(data);\n\t }", "isEmpty() {\r\n return this.data.isEmpty();\r\n }", "isEmpty() {\r\n return this.data.isEmpty();\r\n }", "_resetData () {\n this.data = {}\n }", "get data() {\n return this._data;\n }", "get data() {\n return this._data;\n }", "get data() {\n return this._data;\n }", "function handleTOOData (data) {\n var Data = data.data;\n pushMaster(Data);\n\n }", "function isEmptyDataObject( obj ) {\r\r\n\tvar name;\r\r\n\tfor ( name in obj ) {\r\r\n\r\r\n\t\t// if the public data object is empty, the private is still empty\r\r\n\t\tif ( name === \"data\" && jQuery.isEmptyObject( obj[name] ) ) {\r\r\n\t\t\tcontinue;\r\r\n\t\t}\r\r\n\t\tif ( name !== \"toJSON\" ) {\r\r\n\t\t\treturn false;\r\r\n\t\t}\r\r\n\t}\r\r\n\r\r\n\treturn true;\r\r\n}", "dataVisible() {\n this._dataVisible = true;\n\n this._maybeInvokeCallback();\n }", "function emptyObject (data) {\n return object(data) && Object.keys(data).length === 0;\n }", "function loadData()\n\t{\n\t\tloadMaterials(false);\n\t\tloadLabors(false);\n\t}", "_setData(d) {\n if (!(d instanceof SplitStreamInputData || d instanceof SplitStreamFilter))\n console.error(\n 'Added data is not an instance of SplitStreamData or SplitStreamFilter'\n );\n\n this._datasetsLoaded++;\n this._data = d.data;\n this._update();\n }" ]
[ "0.6899146", "0.6470858", "0.6272037", "0.6118044", "0.6094376", "0.6074078", "0.5948876", "0.5943965", "0.5921367", "0.58853835", "0.58749", "0.58749", "0.5873513", "0.58547103", "0.58515847", "0.5835468", "0.581973", "0.58135194", "0.58068866", "0.57939297", "0.5779331", "0.5777172", "0.575696", "0.5735936", "0.573175", "0.57280284", "0.57260144", "0.5719475", "0.5709049", "0.56842226", "0.5673121", "0.5659715", "0.5657742", "0.5633563", "0.56221414", "0.5620251", "0.5608386", "0.55768645", "0.55610025", "0.556088", "0.5559992", "0.5548807", "0.5540128", "0.55318326", "0.5531585", "0.55005443", "0.54950243", "0.54914683", "0.54829484", "0.5481808", "0.54809475", "0.54792655", "0.5478674", "0.54770064", "0.5475309", "0.54700094", "0.5468854", "0.54599047", "0.54394186", "0.5428951", "0.5428287", "0.5422342", "0.54199135", "0.54194504", "0.5416244", "0.5408606", "0.5404738", "0.5403898", "0.5401454", "0.5394992", "0.5393287", "0.5390399", "0.5387695", "0.53866225", "0.538398", "0.538398", "0.53839564", "0.5383062", "0.53807724", "0.53788596", "0.537656", "0.5375834", "0.5371047", "0.536346", "0.5358082", "0.5357835", "0.53561443", "0.53561443", "0.5355469", "0.5352298", "0.5352298", "0.5352298", "0.5351391", "0.5348363", "0.53457355", "0.53456026", "0.5344038", "0.5334203" ]
0.55478173
44
Check if it has XDomainRequest.
hasXDR() { return typeof XDomainRequest !== "undefined" && !this.xs && this.enablesXDR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasXDR() {\n return typeof XDomainRequest !== \"undefined\" && !this.xs && this.enablesXDR;\n }", "function _valid_request(domain, root_domain){\n if (root_domain in _white_list){\n var domains = _white_list[root_domain];\n for (var i=0; i < domains.length; i++){\n if (domain.indexOf(domains[i]) != -1){\n return true;\n }\n }\n return false;\n } else {\n return false;\n }\n}", "function req(req) {\r\n\t\t\treturn req !== undefined;\r\n\t\t}", "hasRequestAttr(attrName) {\n return this.hasAttr(Attributetype_1.AttributeType.REQUEST, attrName);\n }", "function checkRequest(ID) {\n\t\tif(Requests[ID] != null) {\n\t\t\treturn true;\n\t\t} return false;\n\t}", "function validateRequest(request) {\n console.log(request);\n console.log(SITE_PROPERTY);\n return request.hasOwnProperty(SITE_PROPERTY) &&\n request.hasOwnProperty(OP_PROPERTY) &&\n request.hasOwnProperty(START_TIME_PROPERTY) &&\n request.hasOwnProperty(END_TIME_PROPERTY);\n}", "hasEmptyDomain() {\n\t\tfor (const v of this._vars) {\n\t\t\tif (v.domain().size() === 0) return true;\n\t\t}\n\t\treturn false;\n\t}", "function checkIfAJAXRequest(req) {\n return (req.headers && ((req.headers['x-requested-with'] && req.headers['x-requested-with'] === 'XMLHttpRequest') ||\n (req.headers['content-type'].indexOf('application/json') !== -1)) ? true : false);\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function isRequest$1(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2$1] === 'object';\n}", "function BOOMR_check_doc_domain(a){if(window){if(!a){if(window.parent===window||!document.getElementById(\"boomr-if-as\"))return;if(window.BOOMR&&BOOMR.boomerang_frame&&BOOMR.window)try{BOOMR.boomerang_frame.document.domain!==BOOMR.window.document.domain&&(BOOMR.boomerang_frame.document.domain=BOOMR.window.document.domain)}catch(b){BOOMR.isCrossOriginError(b)||BOOMR.addError(b,\"BOOMR_check_doc_domain.domainFix\")}a=document.domain}if(-1!==a.indexOf(\".\")){try{window.parent.document;return}catch(b){document.domain=a}try{window.parent.document;return}catch(b){a=a.replace(/^[\\w\\-]+\\./,\"\")}BOOMR_check_doc_domain(a)}}}", "function isRequest(input) {\n return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function is_api_call(req) {\n\n\t\tif (req.is('json') || req.is('application/json') || req.get('content-type') =='application/json') {\n\t\t\treturn true;\n\t\t}\n\t\tvar host = req.get('x-forwarded-host') || (req.hostname || req.host);\n\n\t\tif (host == app.njax.env_config.core.api.host || (app.njax.env_config.api && (host == app.njax.env_config.api.host))) {\n\t\t\treturn true;\n\t\t}\n\t\tif (_.contains(req.subdomains, 'api')) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "function is_crossDomain(url) {\n var rurl = /^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/\n\n // jQuery #8138, IE may throw an exception when accessing\n // a field from window.location if document.domain has been set\n var ajaxLocation\n try { ajaxLocation = location.href }\n catch (e) {\n // Use the href attribute of an A element since IE will modify it given document.location\n ajaxLocation = document.createElement( \"a\" );\n ajaxLocation.href = \"\";\n ajaxLocation = ajaxLocation.href;\n }\n\n var ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []\n , parts = rurl.exec(url.toLowerCase() )\n\n var result = !!(\n parts &&\n ( parts[1] != ajaxLocParts[1]\n || parts[2] != ajaxLocParts[2]\n || (parts[3] || (parts[1] === \"http:\" ? 80 : 443)) != (ajaxLocParts[3] || (ajaxLocParts[1] === \"http:\" ? 80 : 443))\n )\n )\n\n //console.debug('is_crossDomain('+url+') -> ' + result)\n return result\n}", "isInDomain(url) {\n return url.replace(/(https|http):/i, \"\").startsWith(\"//\" + this.args.domain);\n }", "refererBelongsTo(domain) {\n if ('referer' in this.headers) {\n const refererURLObj = URL.parse(this.headers.referer);\n if (refererURLObj.hostname === domain) {\n return true;\n }\n }\n return false;\n }", "function isCrossDomain(hostname, crossDomains) {\n /**\n * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is\n * `null` or `undefined`, http://bugs.jquery.com/ticket/10076,\n * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174\n *\n * @todo: Remove/Refactor in D8\n */\n if (!crossDomains) {\n return false;\n }\n else {\n return $.inArray(hostname, crossDomains) > -1 ? true : false;\n }\n}", "function _isSentryRequest(url) {\n const client = getCurrentHub().getClient();\n const dsn = client && client.getDsn();\n return dsn ? url.includes(dsn.host) : false;\n }", "isNavigationRequest() {\n throw new Error('Not implemented');\n }", "function domainCheck(req, res, next) {\n let domain = req.headers.origin &&\n req.headers.origin.split('//')[1].split('/')[0].split('.').slice(-2).join('.');\n\n if (ALLOWED_DOMAINS.includes(domain)) {\n next();\n } else {\n res.status(401)\n .send({ errors: ['Access not allowed.'] });\n }\n}", "function isCrossDomain(hostname, crossDomains) {\n /**\n * jQuery < [cardboard].6.3 bug: $.inArray crushes IE6 and Chrome if second argument is\n * `null` or `undefined`, http://bugs.jquery.com/ticket/[cardboard][cardboard][cardboard]76,\n * https://github.com/jquery/jquery/commit/a839af[cardboard]3[cardboard]db[cardboard]bd93[cardboard]e[cardboard]d[cardboard]fa6758a3fed8de7[cardboard][cardboard]7[cardboard]\n *\n * @todo: Remove/Refactor in D8\n */\n if (!crossDomains) {\n return false;\n }\n else {\n return $.inArray(hostname, crossDomains) > -[cardboard] ? true : false;\n }\n}", "_loadXdr() {\n // // if unset, determine the value\n // if (typeof this.xhrType !== 'string') {\n // this.xhrType = this._determineXhrType();\n // }\n // var xdr = this.xhr = new window['XDomainRequest'](); // eslint-disable-line no-undef\n // // XDomainRequest has a few quirks. Occasionally it will abort requests\n // // A way to avoid this is to make sure ALL callbacks are set even if not used\n // // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9\n // xdr.timeout = this.timeout || 5000; // XDR needs a timeout value or it breaks in IE9\n // xdr.onerror = this._boundXhrOnError;\n // xdr.ontimeout = this._boundXhrOnTimeout;\n // xdr.onprogress = this._boundOnProgress;\n // xdr.onload = this._boundXhrOnLoad;\n // xdr.open('GET', this._request.url, true);\n // // Note: The xdr.send() call is wrapped in a timeout to prevent an\n // // issue with the interface where some requests are lost if multiple\n // // XDomainRequests are being sent at the same time.\n // // Some info here: https://github.com/photonstorm/phaser/issues/1248\n // setTimeout(function () {\n // return xdr.send();\n // }, 1);\n }", "verifyRequest(address) {\n if (address in this.mempoolValid) {\n let isValid = this.mempoolValid[address].registerStar;\n return isValid;\n } else if (address in this.mempool) {\n // Thow rather than return\n throw 'Request not validated';\n } else {\n // Thow rather than return\n throw 'Request does not exist';\n }\n }", "is3rdPartyToDoc() {\n let docDomain = this.getDocDomain();\n if ( docDomain === '' ) { docDomain = this.docHostname; }\n if ( this.domain !== undefined && this.domain !== '' ) {\n return this.domain !== docDomain;\n }\n const hostname = this.getHostname();\n if ( hostname.endsWith(docDomain) === false ) { return true; }\n const i = hostname.length - docDomain.length;\n if ( i === 0 ) { return false; }\n return hostname.charCodeAt(i - 1) !== 0x2E /* '.' */;\n }", "function _checkDomain (domain) {\r\n if (_checkIsBlank(domain))\r\n {\r\n return false;\r\n }\r\n\r\n for (var i=0;i<_domainWhiteList.length;i++)\r\n {\r\n if (_domainWhiteList[i].toLowerCase() == domain.toLowerCase())\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "allowDomains(domains) {\n if (domains.includes(this.getDomain())) {\n return true;\n }\n return false;\n }", "_isWhiteListed(domain) {\n const {domains} = this.props;\n return _.isObject(_.find(domains, object => {\n return object.domain === domain;\n }));\n }", "function is_apiDomain(){\n\treturn inArray(url(1), apiPrefixA);\n}", "hasPendingRequest(chatUserKey) {\n return this.pendingRequests[chatUserKey] != null;\n }", "function XDomainRequestWrapper(xdr){\n this.xdr = xdr;\n this.readyState = 0;\n this.onreadystatechange = null;\n this.status = 0;\n this.statusText = \"\";\n this.responseText = \"\";\n var self = this;\n this.xdr.onload = function(){\n self.readyState = 4;\n self.status = 200;\n self.statusText = \"\";\n self.responseText = self.xdr.responseText;\n if(self.onreadystatechange){\n self.onreadystatechange();\n }\n }\n this.xdr.onerror = function(){\n if(self.onerror){\n self.onerror();\n }\n self.readyState = 4;\n self.status = 0;\n self.statusText = \"\";\n if(self.onreadystatechange){\n self.onreadystatechange();\n }\n }\n this.xdr.ontimeout = function(){\n self.readyState = 4;\n self.status = 408;\n self.statusText = \"timeout\";\n if(self.onreadystatechange){\n self.onreadystatechange();\n }\n }\n }", "function crossDomain() {\n\t\t\tvar parser = document.createElement(\"a\");\n\t\t\tparser.href = params.routerDomainRoot;\n\n\t\t\tvar isSameHost = window.location.hostname === parser.hostname;\n\n\t\t\tvar isSameProtocol = window.location.protocol === parser.protocol;\n\n\t\t\tvar wport = window.location.port !== undefined ? window.location.port : 80;\n\t\t\tvar pport = parser.port !== undefined ? parser.port : 80;\n\t\t\tvar isSamePort = wport === pport;\n\n\t\t\tvar isCrossDomain = !(isSameHost && isSamePort && isSameProtocol);\n\t\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.debug(\"Transport crossDomain=\" + isCrossDomain + \" (\" + isSameHost + \":\" + isSameProtocol + \":\" + isSamePort + \")\");\n\t\t\treturn isCrossDomain;\n\t\t}", "function validateDomain() {\n HttpFactory.post('/api/v1/validate', {domain: ctrl.domain.domain})\n .then(function(response) {\n ctrl.isValidDomain = response.data;\n\n if (ctrl.isValidDomain) {\n Notification.success({\n message:'This domain is valid!',\n title: 'Success'\n });\n } else {\n Notification.error({\n message: 'This domain already exists in our database.',\n title: 'Uh Oh'\n });\n }\n })\n .catch(function(response) {\n Notification.error({\n message: response.data,\n title: 'Uh Oh'\n });\n\n ctrl.isValidDomain = false;\n })\n }", "function isOwnDomain(url) {\n return (url.indexOf('//') === -1 ||\n url.indexOf('//www.ebi.ac.uk') !== -1 ||\n url.indexOf('//wwwdev.ebi.ac.uk') !== -1 ||\n url.indexOf('//srs.ebi.ac.uk') !== -1 ||\n url.indexOf('//ftp.ebi.ac.uk') !== -1 ||\n url.indexOf('//intranet.ebi.ac.uk') !== -1 ||\n url.indexOf('//pdbe.org') !== -1 ||\n url.indexOf('//' + document.domain) !== -1);\n }", "requestDomainVerification_() {\n this.requestNonce_ = this.generateRequestNonce_();\n this.sendMessageToParent_({\n command: PUBLISHER_IFRAME_READY_COMMAND,\n nonce: this.requestNonce_,\n });\n }", "has(key) {\n return typeof this.request.body[key] !== 'undefined';\n }", "_ensureDomainIsSet(args, coins) {\r\n let self = this;\r\n //When /begin has already returned a response, we must use that Issuer's domain \r\n if (args && args.beginResponse && args.beginResponse.headerInfo && args.beginResponse.headerInfo.domain) {\r\n args.domain = args.beginResponse.headerInfo.domain;\r\n //} else if (typeof(args.domain) === \"undefined\") {\r\n //Set the domain if all coins come from the same Issuer\r\n //args.domain = self._getSameDomain(coins); \r\n }\r\n //finally use the default issuer \r\n if (args.domain === null) {\r\n args.domain = self.getSettingsVariable(self.config.DEFAULT_ISSUER);\r\n }\r\n }", "isRequestIncorrect(request) {\n return !request || !request.endpoint || (\n (!request.body || (\n typeof request.body.length !== 'undefined' && request.body.length === 0\n )) \n && \n (\n request.method === 'POST'\n )\n );\n }", "hasOrigin() {\n return this.originJuggler != null;\n }", "hasOrigin() {\n return this.originJuggler != null;\n }", "function isDefined(x) { return (typeof x != 'undefined' && x != null && x !== null); }", "function validateHeaders(xdrHeaders) {\n var multipartCheck, boundaryCheck, typeCheck, contentIdCheck, soapCheck, actionCheck;\n\n if (!xdrHeaders || !xdrHeaders[\"content-type\"]) {\n return false;\n }\n\n var tokens = xdrHeaders[\"content-type\"].trim().split(\";\");\n for (var i in tokens) {\n var token = tokens[i];\n var parts = token.trim().split(\"=\");\n if (parts.length === 1) {\n multipartCheck = parts[0] === \"multipart/related\";\n } else if (parts.length === 2) {\n parts[1] = stripquotes(parts[1]);\n switch (parts[0]) {\n case \"boundary\":\n boundaryCheck = parts[1].startsWith(\"MIMEBoundary\") && parts[1].length > 12;\n break;\n case \"type\":\n typeCheck = parts[1] === \"application/xop+xml\";\n break;\n case \"start\":\n contentIdCheck = true;\n break;\n case \"start-info\":\n soapCheck = parts[1] === \"application/soap+xml\";\n break;\n case \"action\":\n actionCheck = parts[1] === \"urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b\";\n break;\n }\n }\n }\n\n if (multipartCheck && boundaryCheck && typeCheck && contentIdCheck && soapCheck && actionCheck) {\n return true;\n } else {\n return false;\n }\n}", "function checkCleanUrl(urlFromReq) {\n let parsedUrl = url.parse(urlFromReq);\n let host = parsedUrl.host || parsedUrl.pathname.trim().split(\"/\")[0];\n if(!host.startsWith('www.')) {\n host = `www.${host}`;\n }\n if(host in data) {\n return true; \n }\n return false;\n}", "function isSentryRequest(url) {\n var _a;\n var dsn = (_a = core_1.getCurrentHub()\n .getClient()) === null || _a === void 0 ? void 0 : _a.getDsn();\n return dsn ? url.includes(dsn.host) : false;\n}", "function isValid(response) {\n return typeof response !== 'undefined' && response.length > 0;\n}", "hasProxy(proxyName) {\n return this.proxyMap[proxyName] != null;\n }", "function checkAndGetSchemaRecords(request,callback){\n\tvar hostname=request.headers.host.split(\":\")[0];\n\tvar cloudPointHostId=(ContentServer.getConfigDetails(hostname))?ContentServer.getConfigDetails(hostname).cloudPointHostId:undefined;\n\tvar data=urlParser.getRequestBody(request);\n\tdata.schemaRoleOnOrg={};\n\tdata.cloudPointHostId=cloudPointHostId;\n\tGenericServer.getSchemaRoleOnOrg(request,{org:data.org,schema:data.schema},function(schemaRoles){\n\t\tdata.schemaRoleOnOrg=schemaRoles;\n\t\tif(schemaRoles && Object.keys(schemaRoles).length>0){\n\t\t\tgetSchemaRecords(data,function(resp){\n\t\t\t\tcallback(resp);\n\t\t\t});\n\t\t}else{\n\t\t\tcallback({\"error\":\"No privilege\"});\n\t\t}\n\t});\n}", "function chooseRequestObject() {\n return instantiateIfExists(window.XMLHttpRequest) || instantiateIfExists(window.ActiveXObject) || fail(\"Your platform doesn't support HTTP request objects\");\n }", "function validate(request) {\n\t// \"t\" will default to \"req\" if not defined\n\tif(request.t==null || $.trim(request.t)==\"\") {\n\t\trequest.t = \"req\";\n\t}\n\tif(request.svc==null || $.trim(request.svc)==\"\") throw 'Request Target Service [\"svc\"] was null or empty for request [' + stringifyReq(request) + \"]\";\n\tif(request.op==null || $.trim(request.op)==\"\") throw 'Request Target Op [\"op\"] was null or empty for request [' + stringifyReq(request) + \"]\";\n}", "function isXUL() { try { if(IAMXUL) return true;}catch(e){return false;}; }", "function hasNonProxyingCaller() {\n var caller = arguments.callee;\n var maxDepth = 5;\n var domain;\n for (var i = 0; i < maxDepth && caller; i++) {\n if (caller === nonProxyingHasProperty) {\n return true;\n }\n caller = caller.caller;\n }\n return false;\n}", "hasFormId() {\n return this.hasValidPayload() && this.getFormId();\n }", "has(name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n }", "has(name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n }", "has(name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n }", "has(name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n }", "has(name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n }", "has(name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n }", "isRequesting(id) {\n for (let request of this.requestout) {\n if (request.id === id) {\n return true;\n }\n }\n return false;\n }", "function getRequestObject(){\n try{\n httpRequest = new XMLHttpRequest();\n }\n catch(err){\n return false;\n }\n return httpRequest;\n}", "onValidationRequest() {\n\n\t\t\t// Simple validation - check if there are any inputs with errors\n\t\t\tvar errors = $(\".sapMInputBaseContentWrapperError\").length,\n\t\t\t\tresult = errors === 0;\n\n\t\t\t// Raise the response event back to the consumer\n\t\t\tsap.ui.getCore().getEventBus().publish(\"codan.zUrgentBoard\", \"validationResult\", {\n\t\t\t\tresult: result\n\t\t\t});\n\t\t}", "has(name) {\n return this._headersMap.has(normalizeName(name));\n }" ]
[ "0.7625714", "0.60022146", "0.5885047", "0.57688653", "0.5668544", "0.56456864", "0.5582068", "0.54925877", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.53818", "0.5318925", "0.52999514", "0.52811295", "0.5273031", "0.5271165", "0.5271165", "0.5271165", "0.5271165", "0.5271165", "0.5271165", "0.5271165", "0.5271165", "0.5250515", "0.52296126", "0.52060115", "0.51431775", "0.5136566", "0.51348674", "0.51316506", "0.51223075", "0.5073559", "0.5071499", "0.50593674", "0.50573885", "0.502571", "0.5023257", "0.5003162", "0.49601418", "0.49544483", "0.49478966", "0.494701", "0.49349236", "0.4934492", "0.4928569", "0.49180016", "0.49083903", "0.49083903", "0.48615927", "0.48588705", "0.48549923", "0.48463452", "0.48289868", "0.48115343", "0.47974616", "0.47939274", "0.4768968", "0.47618428", "0.47567433", "0.4754289", "0.47522455", "0.47070184", "0.47070184", "0.47070184", "0.47070184", "0.47070184", "0.47055316", "0.47052786", "0.47031516", "0.47005647" ]
0.7613765
3
Opens the socket (triggers polling). We write a PING message to determine when the transport is open.
doOpen() { this.poll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n debug(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }", "open() {\n let transport;\n\n if (this.opts.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n setTimeout(() => {\n this.emit(\"error\", \"No transports available\");\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n\n this.readyState = \"opening\"; // Retry with the next transport if the transport is disabled (jsonp: false)\n\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n debug(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n }", "open() {\n let transport;\n if (\n this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1\n ) {\n transport = \"websocket\";\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n const self = this;\n setTimeout(function() {\n self.emit(\"error\", \"No transports available\");\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n debug$3(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n }", "open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket$1.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }", "open() {\n let transport;\n if (\n this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1\n ) {\n transport = \"websocket\";\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n const self = this;\n setTimeout(function() {\n self.emit(\"error\", \"No transports available\");\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n debug(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n }", "open() {\n let transport;\n if (\n this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1\n ) {\n transport = \"websocket\";\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n const self = this;\n setTimeout(function() {\n self.emit(\"error\", \"No transports available\");\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n debug(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n }", "onOpen() {\n debug$3(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug$3(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "function handleOpen() {\n $log.info('Web socket open - ', url);\n vs && vs.hide();\n\n if (fs.debugOn('txrx')) {\n $log.debug('Sending ' + pendingEvents.length + ' pending event(s)...');\n }\n pendingEvents.forEach(function (ev) {\n _send(ev);\n });\n pendingEvents = [];\n\n connectRetries = 0;\n wsUp = true;\n informListeners(host, url);\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush(); // we check for `readyState` in case an `open`\n // listener already closed the socket\n\n if (\"open\" === this.readyState && this.opts.upgrade && this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n this.readyState = \"open\";\n Socket$1.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "function openSocket() {\n\tsocket.send(\"Player connecting...\");\n}", "function onopen() {\n\tconsole.log ('connection open!');\n\t//connection.send('echo\\r\\n'); // Send the message 'Ping' to the server\n}", "function _wsOpen() {\n _self.connected = true;\n _self.emit('connect');\n log.log(LOG_PREFIX, 'WebSocket opened');\n _interval = setInterval(() => {\n _ws.ping('', false, true);\n }, PING_INTERVAL);\n }", "async openSocket() {\n return this._connect();\n }", "_onSocketOpen(variable, evt) {\n variable._socketConnected = true;\n // EVENT: ON_OPEN\n initiateCallback(VARIABLE_CONSTANTS.EVENT.OPEN, variable, _.get(evt, 'data'), evt);\n }", "doOpen() {\n this.poll();\n }", "function onOpen() {\n\t\tconsole.log('Client socket: Connected');\n\t\tcastEvent('onOpen', event);\n\t}", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data: this.auth });\n }\n }", "onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data: this.auth });\n }\n }", "onopen() {\n debug(\"transport is open - connecting\");\n\n if (typeof this.auth == \"function\") {\n this.auth(data => {\n this.packet({\n type: socket_io_parser_1.PacketType.CONNECT,\n data\n });\n });\n } else {\n this.packet({\n type: socket_io_parser_1.PacketType.CONNECT,\n data: this.auth\n });\n }\n }", "function socket_open(bitmex, from_server = false) {\n // Ignore for connected clients.\n if(bitmex.opt('connected')) return\n \n // Standalone server, wait for response from BitMEX.\n if(bitmex.opt('standalone') && !from_server) return\n\n // Not a standalone server, request a connection.\n if(!bitmex.opt('standalone') && !from_server) return void bitmex.send({ type: 1 })\n\n // Set the default states.\n bitmex[s.status].connecting = false\n bitmex[s.status].connected = true\n\n // Check if stream can authenticate.\n const ctxt = secureContext[bitmex.id]\n if(ctxt) bitmex.authenticate(ctxt.key, ctxt.secret)\n\n // Subscribe to wanted channels.\n if(bitmex[s.status].needs.length) bitmex.subscribe(...bitmex[s.status].needs)\n\n // Emit a connect event.\n bitmex.emit('connect')\n\n // Start sending ping-pong.\n bitmex[s.ping].start()\n}", "function openSocket() {\r\n\t// Ensures only one connection is open at a time\r\n\tif (webSocket !== undefined && webSocket.readyState !== WebSocket.CLOSED) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Create a new instance of the websocket\r\n\twebSocket = new WebSocket(\"ws://\" + socket_url + \":\" + port\r\n\t\t\t+ \"/WebMobileGroupChatServer/chat?name=\" + name);\r\n\r\n\t/**\r\n\t * Binds functions to the listeners for the websocket.\r\n\t */\r\n\twebSocket.onopen = function(event) {\r\n\t\t// $('#message_container').fadeIn();\r\n\r\n\t\tif (event.data === undefined)\r\n\t\t\treturn;\r\n\t};\r\n\r\n\twebSocket.onmessage = function(event) {\r\n\r\n\t\t// parsing the json data\r\n\t\tparseMessage(event.data);\r\n\t};\r\n\r\n\twebSocket.onclose = function(event) {\r\n\r\n\t};\r\n}", "function connect() {\n // nothing to do if already connected\n if ( socket && socket.readyState === 1) return\n\n try{\n socket = new WebSocket(\n `ws://${host}:${port}/livereload`)\n }\n catch(e) { return void onError(e) }\n\n socket.onmessage = hello\n socket.onerror = onError // consumer provided callback\n socket.onclose = onClose // consumer provided callback\n socket.onopen = async ()=> {\n const fullyOpened = await yesItsReallyOpen()\n if(fullyOpened) socket.send(handshake)\n else socket.close()\n }\n\n return socket\n }", "function connectionOpen() {\n //socket.send(\"Connection with Server. Подключение установлено обоюдно, отлично!\");\n console.log(\"Connected\");\n main();\n}", "async open() {\n\t\tif (this.lock_status_id === 4) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(2);\n\t\tawait this.await_event('status:OPENED');\n\t}", "function HandleOpen() {\n console.log('WebSocket open');\n SetState(IconBuilding, 'Connected');\n}", "function open() {\n let ts = new Date(Date.now()).toISOString();\n main.innerHTML = `<p><b><code>${ts} - opened</code></b></p>`;\n let payload = {\n action: 'connected'\n };\n ws.send(JSON.stringify(payload));\n}", "onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: dist.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: dist.PacketType.CONNECT, data: this.auth });\n }\n }", "open() {\n return __awaiter(this, void 0, void 0, function* () {\n this._throwIfSenderOrConnectionClosed();\n return MessageSender.create(this._context).open();\n });\n }", "onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this.readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"data\", component_bind_1.default(this, \"ondata\")));\n this.subs.push(on_1.on(socket, \"ping\", component_bind_1.default(this, \"onping\")));\n this.subs.push(on_1.on(socket, \"error\", component_bind_1.default(this, \"onerror\")));\n this.subs.push(on_1.on(socket, \"close\", component_bind_1.default(this, \"onclose\")));\n this.subs.push(on_1.on(this.decoder, \"decoded\", component_bind_1.default(this, \"ondecoded\")));\n }", "onopen() {\n debug(\"open\"); // clear old subs\n\n this.cleanup(); // mark as open\n\n this._readyState = \"open\";\n this.emitReserved(\"open\"); // add new subs\n\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "function on_open() {\n add_to_output(\"### Opened WebSocket\");\n const socket_connected_log = document.getElementById(\"socketConnect\");\n socket_connected_log.innerHTML = \"Yes\";\n socket_connected = true;\n}", "function SandboxSocketOpen()\n{\n ws.onmessage = SandboxSocketMessageHandler;\n}", "connect () {\n if (this._readyState === this.READY_STATE.CLOSING) {\n this._nextReadyState = this.READY_STATE.OPEN\n return\n }\n\n this._nextReadyState = null\n if (this._readyState === this.READY_STATE.CLOSED) {\n this._doOpen()\n }\n }", "function doConnect() {\n\t\tif (typeof(name) == null) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tif (io !== undefined) {\n\t\t\t\tsocket = io.connect('ws://'+host+':'+port+'/');\n\t\t\t\tsynSocketID();\n\t\t\t\tsocket.on('connect', function (evt) { \n\t\t\t\t\tconsole.log(\"Connection opened\");\n\t\t\t\t\tonOpen(evt);\n\t\t\t\t\tsocket.on('disconnect', function (evt) { onDisconnect(evt) });\n\t\t\t\t\tsocket.on('message', function (evt) { onMessage(evt) });\n\t\t\t\t\tsocket.on('error', function (evt) { onError(evt) });\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t$('.connectionState').text(\"Not connected\");\n\t\t\t$('.connectionState').removeClass('connected');\n\t\t}\n\t}", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "function webSocket_onopen()\n\t{\n\t\tlogger_.log(\"webSocket_onopen\", \"WebSocket Verbindung geoeffnet\");\n\t\treadValueList();\n\t\tstatusChange();\n\t}", "function openSocket(websocketlocation) {\r\n socket = new WebSocket(websocketlocation);\r\n socket.onclose = function() {\r\n setTimeout(function(){openSocket(websocketlocation)}, 5000);\r\n };\r\n}", "async open()\n { \n // Open serial port\n await new Promise((resolve, reject) => {\n this.serialPort.open(function(err) { \n if (err)\n reject(err);\n else\n resolve();\n });\n });\n\n // Flush any data sitting in buffers\n await new Promise((resolve, reject) => {\n this.serialPort.flush(function(err) { \n if (err)\n reject(err);\n else\n resolve();\n });\n });\n\n // Receive data handler\n this.serialPort.on('data', this.onReceive.bind(this));\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "function openConnection() {\n // connect to the host server\n socket = io.connect(socketUrl);\n\n socket.on('disconnect', function(msg) {\n console.log('disconnected: ' + JSON.stringify(msg));\n });\n socket.on('error', function(msg) {\n console.log('errored: ' + JSON.stringify(msg));\n });\n\n // get initial state of table\n $.each(stats, function(i, elem) {\n socket.on(elem, function(result) {\n $('#' + elem).html(''); \n $('#' + elem).append(result); \n });\n\n socket.emit('get_stat', elem);\n });\n console.log('connection created');\n }", "function connectionEstablished() {\n log.info('Connected to OpenTSDB.');\n\n opentsdb = socket;\n\n // Handle errors on this connection\n opentsdb.addListener('error', function(err) {\n log.error('OpenTSDB network error: ' + err);\n opentsdb.destroy();\n opentsdb = undefined; // Cause a reconnection\n });\n opentsdb.removeListener('error', connectionError);\n\n // Allow this socket to be destroyed\n opentsdb.unref();\n\n callback(null, socket);\n }", "connect () {\n if (this.state == this.states.connected && this.socket.readyState == 'open')\n return\n\n if (!this.hasAuth())\n return this.fail('No auth parameters')\n\n this.state = this.states.connecting\n\n // To prevent duplicate messages\n this.clearSocketListeners()\n if (this.socket)\n this.socket.close()\n\n const url = this._buildUrl()\n this.socket = eio(url, this.options)\n this.socket.removeAllListeners('open')\n this.socket.removeAllListeners('error')\n this.socket.once('open', this.onOpen.bind(this))\n this.socket.once('error', (err) => {\n if (console && typeof(console.trace) == 'function') // eslint-disable-line\n console.trace(err) // eslint-disable-line\n\n if (err && err.type == 'TransportError') {\n this.fail(err)\n this._setupReconnect()\n }\n })\n }", "function onOpen( e ) {\n\t\t\t_reconnectCounter = 0;\n\t\t\t_scope.dispatchEvent( WS.ON_OPEN );\n\t\t}", "connect() { socket_connect(this) }", "function isSocketOpen() {\n var socket = gSocket;\n return socket !== null && socket.readyState === WebSocket.OPEN;\n}", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_js_1.on(socket, \"ping\", this.onping.bind(this)), on_js_1.on(socket, \"data\", this.ondata.bind(this)), on_js_1.on(socket, \"error\", this.onerror.bind(this)), on_js_1.on(socket, \"close\", this.onclose.bind(this)), on_js_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "open(address) {\n return new Promise((resolve, reject) => {\n if (window.location.protocol === 'https:') {\n this.ws = new WebSocket(`wss://${address}/ws`);\n } else {\n this.ws = new WebSocket(`ws://${address}/ws`);\n }\n\n this.ws.onopen = _ => resolve(this);\n\n this.ws.onclose = e => this._onclose(e);\n\n this.ws.onmessage = e => {\n this._onmessage(JSON.parse(e.data));\n };\n });\n }", "function onOpenHandler() {\n socket_ok = true;\n $(\".ws_status\").children().empty();\n $(\".ws_status\").children().first().attr(\"id\", \"ws_online\");\n $(\".ws_status\").children().append(\"ONLINE\");\n \n /* Send the initial request to the server */\n socket.send(update_req);\n \n /* Wait 5 seconds, then request resources updates every 500 msec */\n setTimeout(function() {\n update_timer = setInterval(requestUpdate, 500);\n }, 5000);\n \n}", "function onOpen(evt) {\n console.log(\"Connected to server\");\n}", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "function init_socket(socket) {\n socket.onopen = on_open;\n socket.onclose = on_close;\n socket.onmessage = (raw) => on_message(raw.data);\n}", "function openChannel() {\n\tvar channel = new goog.appengine.Channel(TOKEN);\n\tvar socket = channel.open();\n\tsocket.onopen = onSocketOpen;\n\tsocket.onmessage = onSocketMessage;\n\tsocket.onerror = onSocketError;\n\tsocket.onclose = onSocketClose;\n}", "function StatusSocketOpen()\n{\n // Get a list from the server of all linuxcnc status items\n ws.onmessage = StatusListRecieved;\n ws.send( JSON.stringify({ \"id\":\"getlist\", \"command\":\"list_get\" }) ) ;\n}", "handleOpen() {\n log.info(`[WS] Connected to ${WS_URI}`)\n }", "function Connect() {\n SetState('?', 'Connecting');\n Socket = new WebSocket(`ws://${window.location.host}/socket`);\n Socket.addEventListener('error', HandleError);\n Socket.addEventListener('open', HandleOpen);\n Socket.addEventListener('close', HandleClose);\n Socket.addEventListener(\n 'message',\n /** @type EventListener */ (HandleMessage),\n );\n}", "function onOpen(event) {\n console.log('Connection opened');\n websocket.send(\"D\\r\"); /**< Request Lawicel Status */\n}", "run() {\n this.reset();\n this.socket = net.createConnection({\n 'host': this.host.address, \n 'port': this.port,\n }).setKeepAlive(true); // .setNoDelay(true)\n this.socket.on('connect', this.onConnect);\n this.socket.on('error', this.onError);\n this.socket.on('data', this.onData);\n this.socket.on('close', this.onClose);\n }", "function webSocket_onopen()\n\t{\n\t\tstatusChange();\n\t\tconsole.log(\"[ASNeG_Client] WebSocket Verbindung geoeffnet\");\n\t\treadValueList();\n\t}", "function openWebSocket() {\n if (!gWebSocketOpened) {\n gWebSocket = new WebSocket('ws://localhost:12221/webrtc_write');\n }\n\n gWebSocket.onopen = function () {\n console.log('Opened WebSocket connection');\n gWebSocketOpened = true;\n };\n\n gWebSocket.onerror = function (error) {\n console.log('WebSocket Error ' + error);\n };\n\n gWebSocket.onmessage = function (e) {\n console.log('Server says: ' + e.data);\n };\n}", "function start() {\n\tsocket.connect(port, host);\n}", "function onopen(callback){\n mySocket.onopen = function () {\n mySocket.send(\"join \" + chatroom); //enter the desired chatroom\n mySocket.onmessage = test;\n }\n callback();\n }", "function testSocket () {\n socket.once('error', onError);\n socket.once('connect', onConnect);\n socket.connect(options.path);\n }", "function registerOpenHandler(handlerFunction) {\n socket.onopen = function () {\n console.log('open');\n handlerFunction();\n };\n}", "setupDoorbellSocket() {\n let socket = new net.Socket({ readable: true, writable: true });\n socket.on('end', function () {\n console.log('Doorbell socket ended');\n });\n socket.on('close', function () {\n console.log('Doorbell socket closed');\n clearInterval(this._keepAliveTimer);\n });\n socket.on('data', this.receive.bind(this));\n socket.on('error', function (e) {\n console.error('Doorbell socket error', e);\n this.doorbellSocket.destroy(); // destroy the socket\n this.mqttClient.end(true); // End the mqtt connection right away.\n clearInterval(this._keepAliveTimer); // Stop sending keepalive requests\n this.start(); // Start over again.\n });\n this.doorbellSocket = socket.connect({ port: 5000, host: this.dahua_host });\n }", "function onOpen(evt) \n{\n\tconsole.info(\"onOpen\");\n websocketConnectedCallback();\n}", "function rawSocketConnect() {\n that.debugOut('Raw socket connected');\n that.emit('raw socket connected', (that.socket.socket || that.socket));\n }", "function WSConnect(url, onOpen, onMessage, onClose) {\n var _interrupted = false\n var _ready = false\n var _conTimer = null;\n\n var socket = new WebSocket(url);\n\n var send = function (data) {\n if (_interrupted || !_ready) {\n if (window.alerts)\n alerts.danger(\"Working to connect with the server. Please try again in a few seconds.\");\n console.error(\"Working to connect with the server. Please try again in a few seconds.\");\n }\n else\n socket.send(JSON.stringify(data));\n }\n\n var api = {\n send: send,\n close: function () {\n socket.close();\n },\n isReady: function () {\n return _ready && !_interrupted;\n }\n };\n\n socket.onopen = function () {\n _interrupted = false;\n _ready = true;\n onOpen(api);\n }\n socket.onclose = function (e) {\n _interrupted = true;\n if (_conTimer)\n clearTimeout(_conTimer);\n if (e.code != 1000 /* normal closure */) {\n _conTimer = setTimeout(function () {\n WSConnect(url, onOpen, onMessage, onClose);\n }, 2000);\n }\n if (onClose)\n onClose()\n }\n socket.onmessage = function (event) {\n onMessage(JSON.parse(event.data));\n }\n\n console.log(\"Opening connection...\")\n return api\n}", "connect(existing_socket) {\n this._onDataReceived = (data) => this.onDataReceived(data);\n this._onClose = () => this.onClose();\n this._onError = (err) => this.onError(err);\n this._onConnect = () => this.onConnect();\n // Start timeout timer (defaults to 30 seconds)\n const timer = setTimeout(() => this.onEstablishedTimeout(), this._options.timeout || constants_1.DEFAULT_TIMEOUT);\n // check whether unref is available as it differs from browser to NodeJS (#33)\n if (timer.unref && typeof timer.unref === 'function') {\n timer.unref();\n }\n // If an existing socket is provided, use it to negotiate SOCKS handshake. Otherwise create a new Socket.\n if (existing_socket) {\n this._socket = existing_socket;\n }\n else {\n this._socket = new net.Socket();\n }\n // Attach Socket error handlers.\n this._socket.once('close', this._onClose);\n this._socket.once('error', this._onError);\n this._socket.once('connect', this._onConnect);\n this._socket.on('data', this._onDataReceived);\n this.state = constants_1.SocksClientState.Connecting;\n this._receiveBuffer = new receivebuffer_1.ReceiveBuffer();\n if (existing_socket) {\n this._socket.emit('connect');\n }\n else {\n this._socket.connect(this.getSocketOptions());\n if (this._options.set_tcp_nodelay !== undefined &&\n this._options.set_tcp_nodelay !== null) {\n this._socket.setNoDelay(!!this._options.set_tcp_nodelay);\n }\n }\n // Listen for established event so we can re-emit any excess data received during handshakes.\n this.prependOnceListener('established', info => {\n setImmediate(() => {\n if (this._receiveBuffer.length > 0) {\n const excessData = this._receiveBuffer.get(this._receiveBuffer.length);\n info.socket.emit('data', excessData);\n }\n info.socket.resume();\n });\n });\n }", "connect() {\n\t\ttry {\n\t\t\tif(!this.opts.url && !this._reconnectTo) {\n\t\t\t\tthis._lastError = `TCPTransport::connect url is required`;\n\t\t\t\tthrow new Error(this._lastError);\n\t\t\t}\n\n\t\t\tvar constructedUrl = (this.opts.url.indexOf('://') == -1 ? 'tcp://' : '') + this.opts.url;\n\t\t\tif(this._reconnectTo) {\n\t\t\t\tconstructedUrl = this._reconnectTo.url ? this._reconnectTo.url : `tcp://${this._reconnectTo.host}:${this._reconnectTo.port}`;\n\t\t\t\t// do not save reconnect to the URL. query original source again if disconnected\n\t\t\t\t// idea for AM pool: add ttl as a 3rd param to client.reconnect method\n\t\t\t\tthis._reconnectTo = null;\n\t\t\t}\n\t\t\tconst u = url.parse(constructedUrl);\n\t\t\tvar host = u.hostname;\n\t\t\tvar port = u.port;\n\t\t\tif(!port && u.protocol === 'http:') port = 80;\n\t\t\tif(!port && u.protocol === 'https:') port = 443;\n\n\t\t\tif(!port || !host) {\n\t\t\t\tthis._lastError = `TCPTransport::connect invalid URL. host and port are required to connect`;\n\t\t\t\tthrow new Error(this._lastError);\n\t\t\t}\n\n\t\t\tif(this._socket) this.disconnect();\n\n\t\t\tif(!this._socket) {\n\t\t\t\tthis._socket = new net.Socket();\n\t\t\t\tthis._socket.setKeepAlive(this.opts.keepalive || true);\n\t\t\t\tthis._socket.setNoDelay(this.opts.nodelay || true)\n\n\t\t\t\tthis._socket.on('connect', () => { \n\t\t\t\t\tthis._connected = true; \n\t\t\t\t\tthis.emit('connected');\n\t\t\t\t\tthis._measuretime = new Date();\n\t\t\t\t\tif(this._reconnectTimer) {\n\t\t\t\t\t\tclearTimeout(this._reconnectTimer);\n\t\t\t\t\t\tthis._reconnectTimer = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(this.opts.netstatPeriod) this.__netstatTimer = setInterval(() => { this._measureSpeed(); }, this.opts.netstatPeriod);\n\t\t\t\t\tthis.onConnect();\n\t\t\t\t});\n\t\t\t\tthis._socket.on('timeout', () => { this._connected = false; this.onTimeout(); this.emit('disconnected'); });\n\t\t\t\tthis._socket.on('error', this.onError.bind(this));\n\t\t\t\tthis._socket.on('data', this.onData.bind(this));\n\t\t\t\t\n\t\t\t}\n\n\t\t\tthis._socket.on('end', () => { this._connected = false; this.onEnd(); });\n\t\t\tthis._socket.on('close', (hadError) => { \n\t\t\t\tthis._connected = false; \n\t\t\t\tthis.emit('disconnected');\n\t\t\t\tthis.onClose(hadError);\n\t\t\t\tif(this.__netstatTimer) {\n\t\t\t\t\tclearInterval(this.__netstatTimer);\n\t\t\t\t\tthis.__netstatTimer = null;\n\t\t\t\t\tthis._measureSpeed();\n\t\t\t\t}\n\t\t\t\tthis._socket.removeAllListeners('end');\n\t\t\t\tthis._socket.removeAllListeners('close');\n\t\t\t\tthis._socket.destroy();\n\t\t\t});\n\n\t\t\tthis._bytesOut = 0;\n\t\t\tthis._bytesIn = 0;\n\n\t\t\tthis._beforeConnect && this._beforeConnect(); // hook. can throw exceptions\n\t\t\tthis.status = `Connecting to ${host}:${port}`;\n\t\t\tthis._socket.connect({port:port, host:host, lookup: this.opts.dnsCache || dns.lookup});\n\t\t}\n\t\tcatch(e) {\n\t\t\tthis.lastError = e.message;\n\t\t}\n\t}", "connect() {\n let _this = this;\n\n _this._continuousOpen = true;\n _this._open(() => {});\n }", "socketConnect() {\n\t\tthis.socket = io('localhost:4001');\n\t\tthis.socket.on('disconnect', () => {\n\t\t\tthis.socket.open();\n\t\t});\n\t}", "function socketAlive() {\n setTimeout(function() {\n socket.emit('socket_alive');\n socketAlive();\n }, 3200);\n }", "function peerjsOpenHandler(){\n if (_this.debug)\n console.log(\"Server started\", _this._serverPeer.id);\n\n // Reset peers\n _this._connections = {};\n \n // Trigger\n _this._triggerSystemEvent(\"$open\", {serverId: _this._serverPeer.id});\n }", "_onOpen() {\n this.state.connected = true;\n console.log(\"Connected...\");\n this.notify(\"open\");\n }", "initConnection() {\n\t\tconsole.debug(\"Attempting to connect to {url}...\".formatUnicorn({\n\t\t\t\"url\": this.url,\n\t\t}));\n\t\tthis.socket = new WebSocket(this.url);\n\t\tthis.addListeners(this.callbacks);\n\n\t\t// Add listener to attempt reconnect after set delay.\n\t\t// Makes for an autorepeat because failure will trigger the 'close' event.\n\t\tthis.addListeners({\n\t\t\t\"close\": function(event) {\n\t\t\t\tconsole.debug(\"Connection to {url} closed/failed, trying to reconnect in {delay} seconds.\"\n\t\t\t\t\t.formatUnicorn({\n\t\t\t\t\t\t\"url\": this.url,\n\t\t\t\t\t\t\"delay\": this.closed_repeat_delay\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\twindow.setTimeout(\n\t\t\t\t\tthis.initConnection.bind(this),\n\t\t\t\t\tthis.closed_repeat_delay * 1000\n\t\t\t\t);\n\t\t\t}.bind(this)\n\t\t});\n\t}", "function openWSConnection(protocol, hostname, port, endpoint) {\n var webSocketURL = null;\n webSocketURL = protocol + \"://\" + hostname + \":\" + port + endpoint;\n console.log(\"openWSConnection::Connecting to: \" + webSocketURL);\n try {\n webSocket = io(webSocketURL);\n console.log('--webSocket--');\n console.dir(webSocket, { depth: null, colors: true });\n\n webSocket.on('new parameters', (parameters) => {\n console.dir(parameters, { depth: null, colors: true });\n let template = document.getElementById('horizontalTemplate').innerHTML;\n if (parameters.orientation !== 0) {\n template = document.getElementById('verticalTemplate').innerHTML;\n }\n else {\n template = document.getElementById('horizontalTemplate').innerHTML;\n }\n renderTemplate(parameters, template);\n });\n\n webSocket.on('connect_failed', (details) => {\n console.log(\"WebSocket CONNECTION FAILED: \" + JSON.stringify(details, null, 4));\n });\n\n webSocket.on('error', (details) => {\n console.log(\"WebSocket ERROR: \" + JSON.stringify(details, null, 4));\n });\n\n webSocket.onopen = function (openEvent) {\n console.log(\"WebSocket OPEN: \" + JSON.stringify(openEvent, null, 4));\n document.getElementById(\"btnSend\").disabled = false;\n document.getElementById(\"btnConnect\").disabled = true;\n document.getElementById(\"btnDisconnect\").disabled = false;\n };\n webSocket.onclose = function (closeEvent) {\n console.log(\"WebSocket CLOSE: \" + JSON.stringify(closeEvent, null, 4));\n document.getElementById(\"btnSend\").disabled = true;\n document.getElementById(\"btnConnect\").disabled = false;\n document.getElementById(\"btnDisconnect\").disabled = true;\n };\n webSocket.onerror = function (errorEvent) {\n console.log(\"WebSocket ERROR: \" + JSON.stringify(errorEvent, null, 4));\n };\n webSocket.onmessage = function (messageEvent) {\n var wsMsg = messageEvent.data;\n console.log(\"WebSocket MESSAGE: \" + wsMsg);\n if (wsMsg.indexOf(\"error\") > 0) {\n document.getElementById(\"incomingMsgOutput\").value += \"error: \" + wsMsg.error + \"\\r\\n\";\n } else {\n document.getElementById(\"incomingMsgOutput\").value += \"message: \" + wsMsg + \"\\r\\n\";\n }\n };\n } catch (exception) {\n console.error(exception);\n webSocket.close();\n }\n}", "function tryOpeningWebSocket() {\n if (!gWebSocketOpened) {\n console.log('Once again trying to open web socket');\n openWebSocket();\n setTimeout(function() { tryOpeningWebSocket(); }, 1000);\n }\n}", "function start() {\n // in case we fail over to a new server,\n // listen for wsock-open events\n openListener = wss.addOpenListener(wsOpen);\n wss.sendEvent('topo2Start');\n $log.debug('topo2 comms started');\n }", "function openRefreshSocket() {\n refreshNotesSocket = new WebSocket( 'ws://' + window.location.host + '/ws/refresh/notes/');\n console.log(\"Opening socket!!\");\n refreshNotesSocket.onmessage = function (e) {\n refresh_notes()\n };\n\n refreshNotesSocket.onclose = function (e) {\n console.log(e);\n };\n}", "function statusSocket()\n{\n console.log('attempting status socket');\n try {\n Status.replaceData(noReq, '/status/get');\n } catch (e) {\n console.error(e);\n console.log('FAILED STATUS CONNECTION');\n setTimeout(statusSocket, 10000);\n }\n}", "function attach_socket() {\n var wsUri = \"ws://\" + window.location.hostname + \"/controller\";\n update_connection_status(\"Connection to \" + wsUri + \" ...\")\n websocket = new WebSocket(wsUri);\n websocket.onopen = function (evt) { onOpen(evt) };\n websocket.onclose = function (evt) { onClose(evt) };\n websocket.onmessage = function (evt) { onMessage(evt) };\n websocket.onerror = function (evt) { onError(evt) };\n}", "function _connect() {\n log.debug(LOG_PREFIX, `Connecting to ${_wsURL}`);\n _ws = new WebSocket(_wsURL);\n _ws.on('open', _wsOpen);\n _ws.on('close', _wsClose);\n _ws.on('message', _wsMessage);\n _ws.on('error', _wsError);\n _ws.on('ping', _wsPing);\n _ws.on('pong', _wsPong);\n }", "function open() {\n state = 'open';\n czarTimerEnd = false;\n clearInterval(czarTimerInterval);\n roundTimerEnd = Date.now() + (1000 * game.roundTime);\n roundTimerInterval = setInterval(checkRoundTime, 100);\n io.to(game.id).emit('roundStatus', status());\n }", "connect() {\n this.ws = new WebSocket(this.host);\n this.ws.on('open', this.onConnect.bind(this));\n this.ws.on('close', this.onDisconnect.bind(this));\n this.ws.on('error', this.onError.bind(this));\n }", "function SystemSocketOpen()\n{\n ws.onmessage = SystemSocketMessageHandler;\n document.getElementById(\"Command_Reply\").innerHTML = \"Server Connection Initiated\"\n\n // Get a list from the server of all linuxcnc status items\n ws.send( JSON.stringify({ \"id\":\"STATUS_CHECK\", \"command\":\"watch\", \"name\":\"estop\" }) ) ;\n ws.send( JSON.stringify({ \"id\":\"INI_MONITOR\", \"command\":\"watch\", \"name\":\"ini_file_name\" }) ) ;\n}", "function init () {\n\t\n\t\tvar host = \"ws://localhost\"; //ws://localhost:8787/\n\t\t\n\t\ttry {\n\t\t\t// Firefox accept only MozWebSocket\n\t\t\tsocket = (\"MozWebSocket\" in window ? new MozWebSocket (host) : new WebSocket(host));\n\t\t\t//socket = (\"WebScoket\" in window) ? new WebSocket(host) :\n\t\t\tlog ('WebSocket - status ' + socket.readyState);\n\t\t\t\n\t\t\tsocket.onopen = function (msg) {\n\t\t\t\tlog (\"Welcome - status \" + this.readyState);\n\t\t\t}\n\t\t\t\n\t\t\tsocket.onmessage = function (msg) {\n\t\t\t\tlog (\"Received: \" + msg.data);\n\t\t\t}\n\n\t\t\tsocket.onclose = function (msg) {\n\t\t\t\tlog (\"Disconnected - status \" + this.readyState); \n\t\t\t}\n\t\t}\n\t\tcatch (ex) {\n\t\t\tlog (ex);\n\t\t}\n\t\t$(\"#msg\").focus ();\n\t}", "function setWebsocketConnection() {\n console.log('Opening WS connection to: ' + \"ws://\" + window.location.host + \"/API-ws/\");\n vm.ws = new WebSocket(\"ws://\" + window.location.host + \"/API-ws/\");\n vm.ws.onmessage = function(e) {\n receiveWebsocketMessage(e.data);\n };\n vm.ws.onopen = function() {\n // Request information\n console.log('Opened WS connection to: ' + \"ws://\" + window.location.host + \"/API-ws/\");\n //TODO\n requestGetDetails('content', 'get_details');\n };\n\n // Call onopen directly if socket is already open\n if (vm.ws.readyState == WebSocket.OPEN) {vm.ws.onopen();}\n }", "function onOpen(evt) {\n\n \n console.log(\"Connected\"); // Log connection state\n \n doSend(\"getLEDState\"); // Get the current state of the LED\n}", "function gotOpen() {\n print(\"Serial Port is open!\");\n}" ]
[ "0.7640673", "0.7634848", "0.76204854", "0.76161873", "0.7608673", "0.7608673", "0.7334414", "0.73018736", "0.73018736", "0.7239802", "0.71913844", "0.71823084", "0.6942761", "0.69084346", "0.6855785", "0.67066973", "0.67041504", "0.6685705", "0.66050684", "0.65992165", "0.65760785", "0.65760785", "0.6566985", "0.6566985", "0.6553131", "0.634616", "0.63407034", "0.63006115", "0.6293947", "0.62833077", "0.6236247", "0.62332046", "0.62053514", "0.61564153", "0.6131613", "0.6117933", "0.6097436", "0.6086107", "0.60857683", "0.60493803", "0.60252124", "0.5954322", "0.594853", "0.5936749", "0.5934548", "0.59197795", "0.59014934", "0.58980006", "0.5896835", "0.5893779", "0.5884956", "0.5880779", "0.5866561", "0.586379", "0.5862497", "0.58605886", "0.58167094", "0.58167094", "0.58167094", "0.58056563", "0.5802976", "0.57779723", "0.5774993", "0.5770269", "0.5756698", "0.5756394", "0.5751447", "0.5738399", "0.5737383", "0.57371134", "0.5725763", "0.57102007", "0.57084703", "0.5674458", "0.56605", "0.56550014", "0.56363195", "0.5632134", "0.5626525", "0.5621813", "0.5603754", "0.5594975", "0.5577209", "0.5572445", "0.5532794", "0.5520511", "0.5509996", "0.5493961", "0.54813826", "0.54806054", "0.54727155", "0.5462965", "0.5442016", "0.5431049", "0.540823", "0.540779", "0.54074436", "0.53997785" ]
0.6620185
20
Overloads onData to detect payloads.
onData(data) { debug("polling got data %s", data); const callback = packet => { // if its the first message we consider the transport open if ("opening" === this.readyState && packet.type === "open") { this.onOpen(); } // if its a close packet, we close the ongoing requests if ("close" === packet.type) { this.onClose(); return false; } // otherwise bypass onData and handle the message this.onPacket(packet); }; // decode payload parser.decodePayload(data, this.socket.binaryType).forEach(callback); // if an event did not trigger closing if ("closed" !== this.readyState) { // if we got data we're not polling this.polling = false; this.emit("pollComplete"); if ("open" === this.readyState) { this.poll(); } else { debug('ignoring poll - transport state "%s"', this.readyState); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onData(data) {\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n }\n }", "onData(data) {\n const self = this;\n debug(\"polling got data %s\", data);\n const callback = function(packet, index, total) {\n // if its the first message we consider the transport open\n if (\"opening\" === self.readyState && packet.type === \"open\") {\n self.onOpen();\n }\n\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n self.onClose();\n return false;\n }\n\n // otherwise bypass onData and handle the message\n self.onPacket(packet);\n };\n\n // decode payload\n parser.decodePayload(data, this.socket.binaryType).forEach(callback);\n\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit(\"pollComplete\");\n\n if (\"open\" === this.readyState) {\n this.poll();\n } else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n }", "onData(data) {\n const self = this;\n debug(\"polling got data %s\", data);\n const callback = function(packet, index, total) {\n // if its the first message we consider the transport open\n if (\"opening\" === self.readyState && packet.type === \"open\") {\n self.onOpen();\n }\n\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n self.onClose();\n return false;\n }\n\n // otherwise bypass onData and handle the message\n self.onPacket(packet);\n };\n\n // decode payload\n parser.decodePayload(data, this.socket.binaryType).forEach(callback);\n\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit(\"pollComplete\");\n\n if (\"open\" === this.readyState) {\n this.poll();\n } else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n }", "function onData(data) {\n\n // Attach or extend receive buffer\n _receiveBuffer = (null === _receiveBuffer) ? data : Buffer.concat([_receiveBuffer, data]);\n\n // Pop all messages until the buffer is exhausted\n while(null !== _receiveBuffer && _receiveBuffer.length > 3) {\n var size = _receiveBuffer.readInt32BE(0);\n\n // Early exit processing if we don't have enough data yet\n if((size + 4) > _receiveBuffer.length) {\n break;\n }\n\n // Pull out the message\n var json = _receiveBuffer.toString('utf8', 4, (size + 4));\n\n // Resize the receive buffer\n _receiveBuffer = ((size + 4) === _receiveBuffer.length) ? null : _receiveBuffer.slice((size + 4));\n\n // Parse the message as a JSON object\n try {\n var msgObj = JSON.parse(json);\n\n // emit the generic message received event\n _self.emit('message', msgObj);\n\n // emit an object-type specific event\n if((typeof msgObj.messageName) === 'undefined') {\n _self.emit('unknown', msgObj);\n } else {\n _self.emit(msgObj.messageName, msgObj);\n }\n }\n catch(ex) {\n _self.emit('exception', ex);\n }\n }\n }", "onData(data) {\n const self = this;\n debug(\"polling got data %s\", data);\n const callback = function(packet, index, total) {\n // if its the first message we consider the transport open\n if (\"opening\" === self.readyState && packet.type === \"open\") {\n self.onOpen();\n }\n\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n self.onClose();\n return false;\n }\n\n // otherwise bypass onData and handle the message\n self.onPacket(packet);\n };\n\n // decode payload\n lib$1.decodePayload(data, this.socket.binaryType).forEach(callback);\n\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit(\"pollComplete\");\n\n if (\"open\" === this.readyState) {\n this.poll();\n } else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n }", "onData(data) {\n debug(\"polling got data %s\", data);\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose();\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n (0, engine_io_parser_1.decodePayload)(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n }", "function onData(data) {\n\t\tconst probes = JSON.parse(data.body);\n\t\tconst keys = Object.keys(probes);\n\n\t\t// calls the functions to check which probes are on/off (return true/false)\n\t\tfindTrueProbes(probes, keys);\n\t\tfindFalseProbes(probes, keys);\n\t}", "_onData (data) {\n try {\n const message = JSON.parse(data);\n if (typeof message !== 'object' || !message.type) {\n error('Malformed message:', message);\n return panic('Malformed message');\n }\n this._emit('message', message);\n } catch (e) {\n if (e instanceof SyntaxError) {\n error('Non JSON format:', data, e);\n return panic('Non JSON format');\n }\n throw e;\n }\n }", "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "listenForData() {\n this.socket.on(EVENT_DATA, data => this.handleData(data))\n }", "function ondata(data) {\n\tswitch (data.type) {\n\t\tcase 'publish':\n\t\t\tsaveMsg.call(this, data.channel, data.msg);\n\t\t\tonNewData.call(this, data.channel, data.msg);\n\t\t\tbreak;\n\t\tcase 'subscribe':\n\t\t\tchsSub.call(this, data.id, data.channels);\n\t\t\tonNewSubscr.call(this, data.id, data.channels);\n\t\t\tbreak;\n\t\tcase 'notify':\n\t\t\tonNewNotifications.call(this, data.notifications);\n\t\t\tbreak;\n\t}\n}", "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }", "data(data) {\n this.__processEvent('data', data);\n }", "onDataReceived(data) {\n /*\n All received data is appended to a ReceiveBuffer.\n This makes sure that all the data we need is received before we attempt to process it.\n */\n this._receiveBuffer.append(data);\n // Process data that we have.\n this.processData();\n }", "function onData(event) {\n\t\tif(event.getSubject() != '/pushlet/ping') {\n\t\t\tif(event.getSubject() == 'system_online') {\n\t\t\t\tsystemOnline(event);\n\t\t\t} else {\n\t\t\t\tif(event.getSubject() == 'system_logout') {\n\t\t\t\t\tsystemLogout(event);\n\t\t\t\t} else {\n\t\t\t\t\tif(event.getSubject() == 'system_chat') {\n\t\t\t\t\t\tsystemChat(event);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(event.getSubject() == 'system_notice') {\n\t\t\t\t\t\t\tsystemNotice(event);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(globalDataPower.noticeTypeCode[event.getSubject()]['point']) {\n\t\t\t\t\t\t\t\teval(globalDataPower.noticeTypeCode[event.getSubject()]['point'] + \".call(window, event)\");\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}", "function handleData(data) {\n console.log(\"[Gateway] >>>>>>>>>>\", data);\n\n\t/** Parse Packet **/\n\t/** Packet format: \"mac_addr:seq_num:msg_id:payload\" **/\n\t// \"source_mac_addr:seq_num:msg_type:num_hops:payload\"\n\tvar components = data.split(':');\n\tif (components.length !== 5) {\n\t\tconsole.error(\"Invalid minimum packet length\");\n\t\treturn;\n\t}\n\tvar macAddress = parseInt(components[0]),\n\t msgId = parseInt(components[2]),\n\t payload = components[4];\n\n\tswitch(msgId) {\n\t\tcase OUTLET_SENSOR_MESSAGE:\n\t\t\treturn handleSensorDataMessage(macAddress, payload);\n\t\tcase OUTLET_ACTION_ACK_MESSAGE:\n\t\t\treturn handleActionAckMessage(macAddress, payload);\n\t\tdefault:\n\t\t\tconsole.error(`Unknown Message type: ${msgId}`);\n\t}\n}", "function onReceiveImportantData(data) {\n console.log(\"Important data: \" + data);\n}", "_dataReceived(data) {\n this._rawData = data;\n this._data = JSON.parse(this._rawData);\n try {\n this._initialise();\n } catch(e) {\n console.error(e.message);\n }\n }", "onData(data) {\n let done = false;\n if (data.progress) {\n this.onProgress(this.progressBarElement, this.progressBarMessageElement, data.progress);\n }\n if (data.complete === true) {\n done = true;\n if (data.success === true) {\n this.onSuccess(this.progressBarElement, this.progressBarMessageElement, this.getMessageDetails(data.result));\n } else if (data.success === false) {\n this.onTaskError(this.progressBarElement, this.progressBarMessageElement, this.getMessageDetails(data.result));\n } else {\n done = undefined;\n this.onDataError(this.progressBarElement, this.progressBarMessageElement, \"Data Error\");\n }\n if (data.hasOwnProperty('result')) {\n this.onResult(this.resultElement, data.result);\n }\n } else if (data.complete === undefined) {\n done = undefined;\n this.onDataError(this.progressBarElement, this.progressBarMessageElement, \"Data Error\");\n }\n return done;\n }", "handleDataRecieved(data){\n\t\tvar parsedData = JSON.parse(data.data);\n\n\t\tswitch(parsedData.dataType){\n\t\t\tcase \"0\"://parsedData.dataType.PLAYER\"\":\n\t\t\t\tthis.updateOtherPlayers(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"1\":\n\t\t\t\tthis.updateServerEnemies(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\tthis.updateOtherPlayerShots(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\tthis.updateDropsInfo(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"4\":\n\t\t\t\tthis.updateBrainInfo(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"5\":\n\t\t\t\tthis.createNewEnemies(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"6\":\n\t\t\t\tthis.checkIfResurrected(parsedData);\n\t\t\t\tbreak;\n\t\t\tcase \"11\":\n\t\t\t\tthis.updateRoundInfo(parsedData);\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}", "onDataChange() {}", "function dataHandler(data) {\n // Operate on different message types\n switch (data.type) {\n case \"chat\":\n // Add message to the log\n let log = document.getElementById(\"chat-log\");\n log.innerHTML = `<p class=\"chat-message\"><span class=\"from-other-person\">Other Person:</span> ${data.message}</p><hr/>` + log.innerHTML;\n break;\n\n default:\n console.error(`Invalid data type '${data.type}': ${JSON.stringify(data)}`)\n }\n}", "function onDataUpdate(data, errors, metadata) {\n // Implement custom data handling here.\n // Push the data to an internal queue, filter & process it in realtime, ...\n console.log(JSON.stringify(data));\n if(errors) {\n console.error(errors);\n }\n}", "function dataHandler(data) { console.log(data); }", "function handleTOOData (data) {\n var Data = data.data;\n pushMaster(Data);\n\n }", "function realHandler(data) {\n self.bytesReceived += data.length;\n self._receiver.add(data);\n }", "function realHandler(data) {\n self.bytesReceived += data.length;\n self._receiver.add(data);\n }", "function realHandler(data) {\n self.bytesReceived += data.length;\n self._receiver.add(data);\n }", "recieveData(data) {\n switch (data.event) {\n\n //Start game event.\n case \"begin-game\":\n if (this.gameState === 0) {\n this.handleStartGame();\n this.handleStartTurn();\n }\n break;\n //Event for joining a team\n case \"join-team\":\n this.handleJoinTeam(data);\n break;\n\n //This just forwards team chat.\n case \"team-chat\":\n this.handleTeamChat(data);\n break;\n\n //This happens when the client submits the red hint data.\n case \"red-hints\":\n this.handleRedHints(data);\n break;\n //This happens when the client submits the blue hint data.\n case \"blue-hints\":\n this.handleBlueHints(data);\n break;\n\n //When guesses are being made, update selections across all clients\n case \"red-selections\":\n this.handleRedSelections(data);\n break;\n case \"blue-selections\":\n this.handleBlueSelections(data);\n break;\n\n //This event contains guess data for each team.\n case \"submit-guess\":\n this.handleGuess(data);\n break;\n\n //Round is over, clients are ready for the next round to begin.\n case \"next-round\":\n if (this.gameState === 5) {\n this.advanceTurnOrder();\n this.currentRound += 1;\n this.handleStartTurn();\n }\n break;\n\n //Reset the game for a new one.\n case \"new-game\":\n if (this.gameState === 6) {\n this.handleNewGame();\n }\n break;\n default:\n break;\n }\n }", "function handleSensorDataMessage(macAddress, payload) {\n\t// Parse sensor data, convert to ints\n var sensorValues = payload.split(',').map(value => parseInt(value));\n\n // We're expecting five values: power, temp, light, (eventually status).\n if (sensorValues.length !== 3) {\n throw new Error(`Not enough sensor values in packet: ${sensorValues}`);\n }\n\n // Get data values from payload.\n var power = sensorValues[0];\n temperature = sensorValues[1],\n light = sensorValues[2];\n\n // TODO: Trigger events as necessary.\n return saveSensorData(macAddress, power, temperature, light);\n}", "function receivedData(objs) {\n // if the received data is not of the last request: do nothing with it\n if (id == this._dataRequestID) {\n this._processData(objs,callback);\n }\n }", "function on_data(data) {\n data_cache[key] = data;\n placeholder.update();\n }", "handleData(data) {\n const { threshold, receiveData: receiveDataProp } = this.props\n receiveDataProp(data)\n\n if (threshold !== null && !isNaN(threshold)) {\n if (data.value > threshold) {\n toast(data.value)\n }\n }\n }", "function processDataCallback(data) {\n\t\t\t\n\t\t\tvar event = {};\n\t\t\t\n\t\t\tevent.deviceId = data.deviceId;\n\t\t\tevent.riderId = data.riderInformation.riderId != undefined ? data.riderInformation.riderId : 0;\n\t\t\tevent.distance = data.geographicLocation.distance != undefined ? Math.round(data.geographicLocation.distance) : 0;\n\t\t\tevent.lat = data.geographicLocation.snappedCoordinates.latitude != undefined ? data.geographicLocation.snappedCoordinates.latitude : 0;\n\t\t\tevent.long = data.geographicLocation.snappedCoordinates.longitude != undefined ? data.geographicLocation.snappedCoordinates.longitude : 0;\n\t\t\tevent.acceleration = data.riderStatistics.acceleration != undefined ? parseFloat(data.riderStatistics.acceleration.toFixed(2)) : 0;\n\t\t\tevent.time = data.time != undefined ? data.time : 0;\n\t\t\tevent.altitude = data.gps.altitude != undefined ? data.gps.altitude: 0;\n\t\t\tevent.gradient = data.geographicLocation.gradient != undefined ? data.geographicLocation.gradient: 0;\n\t\t\t\n\t\t\t//Add speed object\n\t\t\tvar speed = data.riderInformation.speedInd ? (data.gps.speedGps != undefined ? data.gps.speedGps : 0) : 0 ;\n\t\t\tevent.speed = {\n\t\t\t\t\t\"current\" : speed,\n\t\t\t\t\t\"avg10km\" : 0.0,\n\t\t\t\t\t\"avg30km\" : 0.0\n\t\t\t}\n\t\t\t\n\t\t\t//Add power object\n\t\t\tvar power = data.riderInformation.powerInd ? (data.sensorInformation.power != undefined ? data.sensorInformation.power : 0) : 0;\n\t\t\tevent.power = {\n\t\t\t\t\t\"current\" : getFeedValue(\"power\", power),\n\t\t\t\t\t\"avg10km\" : 0,\n\t\t\t\t\t\"avg30km\" : 0\n\t\t\t}\n\t\t\t\n\t\t\tevent.heartRate = data.riderInformation.HRInd ? (data.sensorInformation.heartRate != undefined ? getFeedValue(\"HR\", data.sensorInformation.heartRate) : 0) : 0;\n\t\t\tevent.cadence = data.riderInformation.cadenceInd ? (data.sensorInformation.cadence != undefined ? data.sensorInformation.cadence : 0) : 0;\n\t\t\tevent.bibNumber = data.riderInformation.bibNumber != undefined ? data.riderInformation.bibNumber: 0;\n\t\t\tevent.teamId = data.riderInformation.teamId != undefined ? data.riderInformation.teamId: 0;\n\t\t\t\n\t\t\tvar eventStageId = data.riderInformation.eventId + \"-\" + data.riderInformation.stageId;\t\t\n\t\t\tdataCallback(event, eventStageId + \"-rider\");\n\t\t}", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!validation.isValidUTF8(buf)) {\n this.error(\n new Error('Invalid WebSocket frame: invalid UTF-8 sequence'),\n 1007\n );\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "rxGameData(evt) {\n // JitsiExternalAPI::endpointTextMessageReceived event arguments format: \n // evt = {\n // data: {\n // senderInfo: {\n // jid: \"string\", // the jid of the sender\n // id: \"string\" // the participant id of the sender\n // },\n // eventData: {\n // name: \"string\", // the name of the datachannel event: `endpoint-text-message`\n // text: \"string\" // the received text from the sender\n // }\n // }\n //};\n const data = JSON.parse(evt.data.eventData.text);\n if (data.hax === APP_FINGERPRINT) {\n const evt2 = new CallaUserEvent(evt.data.senderInfo.id, data);\n this.dispatchEvent(evt2);\n }\n }", "dataMessage () {\n if (this.fin) {\n const messageLength = this.messageLength;\n const fragments = this.fragments;\n\n this.totalPayloadLength = 0;\n this.messageLength = 0;\n this.fragmented = 0;\n this.fragments = [];\n\n if (this.opcode === 2) {\n var data;\n\n if (this.binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this.binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data, { masked: this.masked, binary: true });\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString(), { masked: this.masked });\n }\n }\n\n this.state = GET_INFO;\n }", "on(data) {\n switch (data.type) {\n case ACTION_TYPES.CHANGE_GRAMMAR:\n this.onGrammar(data.grammar);\n break;\n case ACTION_TYPES.MOVE_CURSOR:\n this.onCursorMoved(data.cursor, data.user);\n break;\n case ACTION_TYPES.HIGHLIGHT:\n this.onHighlight(data.newRange, data.userId);\n break;\n case ACTION_TYPES.CHANGE_FILE:\n this.onChange(data.path, data.buffer);\n break;\n default:\n }\n }", "function handleData(data){\n switch(state){\n case 0:\n functions.authenticate();\n break;\n case 1:\n functions.processRequest(data);\n break;\n case 2:\n functions.forward(data);\n break;\n case -1:\n default:\n console.log(data.toString());\n break;\n };\n }", "onLoaderData(data) {\n\n this.loaded = true;\n\n this.metadata = getMetadata(data);\n\n // Ensure other actions are taken before re-rendering\n this._onLoadActions.forEach(onLoadAction => onLoadAction(data));\n\n if (this._setState) {\n\n this._setState({\n ...this.state,\n data: data.payload,\n loading: false,\n loadingError: null,\n ...this.metadata.pagination\n });\n }\n\n if (this.onLoadData) {\n\n this.onLoadData(data);\n }\n }", "function onNewNotifications(data) {\n\t_.map(Object.keys(data), function(ch) {\n\t\t_.map(data[ch], emitData(ch).bind(this));\n\t}.bind(this));\n}", "function getData (event) {\n var msg = JSON.parse(event.data);\n //console.log(msg);\n // We can select specific JSON groups by using msg.name, where JSON contains \"name\":x\n // Every type MUST have msg.type to determine what else is pulled from it\n switch (msg.type){\n case \"print\": // Print out msg.data\n //console.log(msg.data);\n break;\n case \"battery\":\n $('#battery-voltage').text(msg.data);\n break;\n case \"ping_sensors\":\n $('#ping-display').text(JSON.stringify(msg.data));\n var d = msg.data;\n sensorIndicatorDraw(d.fr,d.r,d.br,d.b,d.bl,d.l,d.fl);\n break;\n }\n }", "on_assign_data() {\n }", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!Validation(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "dispatch(data) {\n this._receiveListener(data);\n }", "function onReceiveData(data) {\n appForm.responseTarget.value = JSON.stringify(data);\n }", "onData(chunk) {\n this.chunks.push(chunk);\n }", "onData(chunk) {\n this.chunks.push(chunk);\n }", "send(data){\n Flow.from(this.listeners).where(listener => listener.notify && Util.isFunction(listener.notify)).foreach(listener => listener.notify(data));\n Flow.from(this.listeners).where(listener => !(listener.notify && Util.isFunction(listener.notify)) && Util.isFunction(listener)).foreach(listener => listener(data));\n }", "function handleMessage(data,client){\n\t\t//var jsondata = '{\"sample\": \"data\", \"is\": \"great\", \"data\": [1, 2, 3, 4]}';\n\t\t//var obj = JSON.parse(jsondata);\n\t\t//console.log(obj.sample);\t\n\t\tvar obj;\n\t\tif(typeof data !== 'object'){\n\t\t\tconsole.log(\"error with an object\");\n\t\t\tobj = JSON.parse(data);\n\t\t}else{\n\t\t\tobj = data;\n\t\t}\n\n\t\tvar eventType = messageConfig[obj.id];\n\t\t\n\t\t//Check if this getting data by collection or other call\n\t\tif(data.hasOwnProperty(\"collection\")){\n\t\t\t\teventType(client, obj.collection);\n\t\t}else{\n\t\t\teventType(client);\n\t\t}\t\t\n\t}", "processPlayerData(data) {\n if (data.type === 'data') {\n console.log(data);\n }\n }", "prepareData() {\n super.prepareData();\n\n const actorData = this.data;\n const data = actorData.data;\n const flags = actorData.flags;\n }", "function dataHandler() { //TODO Add properties to info Card **************\n const routeData = data.route;\n for (const item in routeData) {\n if (item.includes(day)) {\n const routeItems = data.route[item];\n for (const key in routeItems) {\n const keys = routeItems[key];\n if ((keys.name).includes(title)) {\n event.push(keys.label, keys.score, keys.imageURL, keys.intro)\n return\n }\n }\n }\n }\n }", "dataMessage () {\n\t if (this.fin) {\n\t const messageLength = this.messageLength;\n\t const fragments = this.fragments;\n\n\t this.totalPayloadLength = 0;\n\t this.messageLength = 0;\n\t this.fragmented = 0;\n\t this.fragments = [];\n\n\t if (this.opcode === 2) {\n\t var data;\n\n\t if (this.binaryType === 'nodebuffer') {\n\t data = toBuffer(fragments, messageLength);\n\t } else if (this.binaryType === 'arraybuffer') {\n\t data = toArrayBuffer(toBuffer(fragments, messageLength));\n\t } else {\n\t data = fragments;\n\t }\n\n\t this.onmessage(data, { masked: this.masked, binary: true });\n\t } else {\n\t const buf = toBuffer(fragments, messageLength);\n\n\t if (!isValidUTF8(buf)) {\n\t this.error(new Error('invalid utf8 sequence'), 1007);\n\t return;\n\t }\n\n\t this.onmessage(buf.toString(), { masked: this.masked });\n\t }\n\t }\n\n\t this.state = GET_INFO;\n\t }", "onStoreDataChange(data) {\n const store = data.source;\n\n // Grouping mixin needs to process data which then makes sure UI is refeshed\n if (store.isGrouped && store.count > 0) return;\n\n this.overridden.onStoreDataChange(data);\n }", "function setDataListener(request, onData)\n{\n\tvar buffer = '';\n\t\n\trequest.on('data', function(chunk){\n\t\tbuffer += chunk;\n\t})\n\t\n\trequest.on('end', function(){\n\t\tonData(buffer);\n\t});\n}", "on_data_received(e) {\n $hope.log(\"widget\", \"widget data received:\", e);\n // only add to these cared about\n if (this.data[e.widget_id]) {\n this.data[e.widget_id].add_data(e.data);\n ui_store.emit(\"ui\", {type: \"widget\", id: e.widget_id, event: \"data/received\"});\n }\n }", "function handleModelDataChanged(dataObj) {\n //console.log('handleModelDataChanged', dataObj.payload);\n }", "function hasPipeDataListeners(stream){var listeners=stream.listeners('data');for(var i=0;i<listeners.length;i++){if(listeners[i].name==='ondata'){return true;}}return false;}", "dataMessage () {\n\t if (this._fin) {\n\t const messageLength = this._messageLength;\n\t const fragments = this._fragments;\n\n\t this._totalPayloadLength = 0;\n\t this._messageLength = 0;\n\t this._fragmented = 0;\n\t this._fragments = [];\n\n\t if (this._opcode === 2) {\n\t var data;\n\n\t if (this._binaryType === 'nodebuffer') {\n\t data = toBuffer(fragments, messageLength);\n\t } else if (this._binaryType === 'arraybuffer') {\n\t data = toArrayBuffer(toBuffer(fragments, messageLength));\n\t } else {\n\t data = fragments;\n\t }\n\n\t this.onmessage(data);\n\t } else {\n\t const buf = toBuffer(fragments, messageLength);\n\n\t if (!isValidUTF8(buf)) {\n\t this.error(new Error('invalid utf8 sequence'), 1007);\n\t return;\n\t }\n\n\t this.onmessage(buf.toString());\n\t }\n\t }\n\n\t this._state = GET_INFO;\n\t }", "function onData(chunk) {\n try {\n parse(chunk);\n } catch (err) {\n self.emit(\"error\", err);\n }\n }", "postIngestData() {}", "function handleReceiveData(data) {\r\n\t\tif (\"orden\" in data) {\r\n\t\t\tif (data.orden == \"takeoff\") {\r\n\t\t\t\tarDrone.takeoff();\r\n\t\t\t} else if (data.orden == \"land\") {\r\n\t\t\t\tarDrone.land();\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log(\"Orden no valida. \");\r\n\t\t\t}\r\n\t\t} else if (\"x\" in data) {\r\n\t\t\tarDrone.setXYValues(data.x, data.y);\r\n\t\t} else if (\"alt\" in data) {\r\n\t\t\tarDrone.setAltYaw(data.alt, data.yaw);\r\n\t\t} else {\r\n\t\t\tconsole.log(\"Dato invalido. \");\r\n\t\t}\t\t\r\n\t}", "handleLocalData(data) {\n const count = data[data.length - 3];\n const blockId = this.executeCheckList[count];\n if (blockId) {\n const socketData = this.handler.encode();\n socketData.blockId = blockId;\n this.setSocketData({\n data,\n socketData,\n });\n this.socket.send(socketData);\n }\n }", "function dataHandler(data, socket){\n\tvar type = null;\n\tvar target = null;\n\tvar msg = null;\n\n\tvar strArray = [];\n\tvar dataString = data.toString();\n\n\t//dataString = trim(dataString);\n\tstrArray = dataString.split('$');\n\n\tswitch(strArray[0]){\n\t\tcase 'CONNECT':\n\t\t\tnewMatching(strArray[1], strArray[2]);\n\t\t\tbreak;\n\t\tcase 'SEND':\n\t\t\tsendMessage(strArray[1], strArray[2], strArray[3]);\n\t\t\tbreak;\n\t\tcase 'NEW':\n\t\t\tnewConnect(strArray[1], socket);\n\t\t\tbreak;\n\t}\n}", "_onRead(data) {\n\t this.valueBytes.write(data);\n\t }", "function onData (chunk) {\n debug('onData (chunk.length: %d)', chunk.length);\n if (!this._preprocessedDone) {\n // TODO: don't be lazy, buffer if needed...\n assert(chunk.length >= 3, 'buffer too small! ' + chunk.length);\n if (/icy/i.test(chunk.slice(0, 3))) {\n debug('got ICY response!');\n var b = new Buffer(chunk.length + HTTP10.length - 'icy'.length);\n var i = 0;\n i += HTTP10.copy(b);\n i += chunk.copy(b, i, 3);\n assert.equal(i, b.length);\n chunk = b;\n this._wasIcy = true;\n } else {\n this._wasIcy = false;\n }\n this._preprocessedDone = true;\n }\n this.emit('processedData', chunk);\n}", "function checkForData(data) {\n\t\tconst probe = JSON.parse(data.body);\n\t\tconst sub = data.headers.subscription;\n\n\t\tif (!probe) {\n\t\t\treportEmptyData(probe.id);\n\t\t}\n\n\t\tunsubscribe(sub);\n\t}", "function gotData(data){\n console.log(data);\n}", "prepareData() {\n super.prepareData();\n\n const actorData = this.data;\n const data = actorData.data;\n const flags = actorData.flags;\n\n // Make separate methods for each Actor type (character, npc, etc.) to keep\n // things organized.\n if (actorData.type === 'character') this._prepareCharacterData(actorData);\n if (actorData.type === 'pokemon') this._preparePokemonData(actorData);\n }", "_onData(data) {\n\n let me = this;\n\n me._rxData = me._rxData + data.toString();\n\n // If we are waiting for a response from the device, see if this is it\n if(this.requestQueue.length > 0) {\n\n let cmd = me.requestQueue[0];\n\n if(me._rxData.search(cmd.regex) > -1) {\n // found what we are looking for\n\n\n // Cancel the no-response timeout because we have a response\n if(cmd.timer !== null) {\n clearTimeout(cmd.timer);\n cmd.timer = null;\n }\n\n // Signal the caller with the response data\n if(cmd.cb) {\n cmd.cb(null, me._rxData);\n }\n\n // Remove the request from the queue\n me.requestQueue.shift();\n\n // discard all data (this only works because we only send one\n // command at a time...)\n me._rxData = '';\n }\n } else if(me.isReady) {\n\n let packets = me._rxData.split(';');\n\n if(packets.length > 0) {\n\n\n // save any extra data that's not a full packet for next time\n me._rxData = packets.pop();\n\n packets.forEach(function(packet) {\n\n let fields = packet.match(/:([SX])([0-9A-F]{1,8})N([0-9A-F]{0,16})/);\n\n if(fields) {\n\n let id = 0;\n let ext = false,\n data;\n\n try {\n\n data = Buffer.from(fields[3], 'hex');\n id = parseInt(fields[2], 16);\n\n if(fields[1] === 'X') {\n ext = true;\n }\n\n } catch (err) {\n // we sometimes get malformed packets (like an odd number of hex digits for the data)\n // I dunno why that is, so ignore them\n // console.log('onData error: ', fields, err);\n }\n\n if(id > 0) {\n // emit a standard (non-J1939) message\n me.push({\n id: id,\n ext: ext,\n buf: data\n });\n\n }\n\n }\n });\n }\n }\n }", "processCallbackData() {\n\t\tconst {\n\t\t\tdata,\n\t\t\trequestDataToState,\n\t\t} = this.props;\n\n\t\tif ( data && ! data.error && 'function' === typeof requestDataToState ) {\n\t\t\tthis.setState( requestDataToState );\n\t\t}\n\t}", "function handle_data_available(event) {\n if (event.data.size > 0) {\n recordedChunks.push(event.data);\n }\n}", "handleDataSuccess() {\n\t\tthis.setState( {\n\t\t\treceivingData: true,\n\t\t\tloading: false,\n\t\t} );\n\t}", "processIpcData(evt, type, data){\n switch(type){\n // parse settings before broadcasting\n case \"settings-get\":\n try{\n let settings = JSON.parse(data.str);\n this.emit(type, {settings});\n }\n catch(err){\n break;\n }\n break;\n\n // trigger for any other event\n default:\n this.emit(type, data);\n break;\n }\n }", "function onEvent(type, data) {\n eventsBuffer.push({type: type, data: data});\n }", "function handleDataAvailable(event){\n if(event.data && event.data.size > 0){\n recordedBlobs.push(event.data);\n }\n}", "function onMessage(data) {\n // EventBridge message from HTML script.\n // Check against EVENT_NAME to ensure we're getting the correct messages from the correct app\n if (!data.type || data.type.indexOf(CONFIG.APP_NAME) === -1) {\n if (DEBUG) {\n print(\"Event type event name index check: \", !data.type, data.type.indexOf(CONFIG.APP_NAME) === -1);\n }\n return;\n }\n data.type = data.type.replace(CONFIG.APP_NAME, \"\");\n\n if (DEBUG) {\n print(\"onMessage: \", data.type);\n print(\"subtype: \", data.subtype);\n }\n\n switch (data.type) {\n case CONFIG.EVENT_BRIDGE_OPEN_MESSAGE:\n onOpened();\n updateUI();\n break;\n case CONFIG.EVENT_UPDATE_AVATAR:\n switch (data.subtype) {\n case CONFIG.EVENT_CHANGE_AVATAR_TO_AVI_AND_SAVE_AVATAR:\n saveAvatarAndChangeToAvi();\n break;\n case CONFIG.EVENT_RESTORE_SAVED_AVATAR:\n restoreAvatar();\n break;\n case CONFIG.EVENT_CHANGE_AVATAR_TO_AVI_WITHOUT_SAVING_AVATAR:\n changeAvatarToAvi();\n break;\n default:\n break;\n }\n updateUI(STRING_STATE);\n break;\n case CONFIG.EVENT_CHANGE_TAB:\n switchTabs(data.value);\n updateUI(STRING_STATE);\n break;\n case CONFIG.EVENT_UPDATE_MATERIAL:\n // delegates the method depending on if \n // event has name property or updates property\n if (DEBUG) {\n print(\"MATERIAL EVENT\" , data.subtype, \" \", data.name, \" \", data.updates);\n }\n switch (data.subtype) {\n case CONFIG.MATERIAL_EVENTS_SUBTYPE.STRING_MODEL_TYPE_SELECTED:\n applyNamedMaterial(CONFIG.STRING_DEFAULT);\n dynamicData[STRING_MATERIAL].selectedTypeIndex = data.updates;\n break;\n case CONFIG.MATERIAL_EVENTS_SUBTYPE.STRING_NAMED_MATERIAL_SELECTED: \n applyNamedMaterial(data.name);\n break;\n case CONFIG.MATERIAL_EVENTS_SUBTYPE.STRING_UPDATE_PROPERTY:\n\n var propertyName = data.updates.propertyName;\n var newMaterialData = data.updates.newMaterialData;\n var componentType = data.updates.componentType;\n var isPBR = data.updates.isPBR;\n\n console.log(\"update Property\" + propertyName + JSON.stringify(newMaterialData));\n updateMaterialProperty(propertyName, newMaterialData, componentType, isPBR);\n break;\n }\n updateUI(STRING_MATERIAL);\n break;\n\n case CONFIG.EVENT_UPDATE_BLENDSHAPE:\n if (data.name) {\n applyNamedBlendshapes(data.name);\n } else {\n updateBlendshapes(data.updates);\n }\n updateUI(STRING_BLENDSHAPES);\n break;\n case CONFIG.EVENT_UPDATE_FLOW:\n switch (data.subtype) {\n case CONFIG.FLOW_EVENTS_SUBTYPE.STRING_DEBUG_TOGGLE:\n if (DEBUG) {\n print(\"TOGGLE DEBUG SPHERES \", data.updates);\n }\n addRemoveFlowDebugSpheres(data.updates, true);\n break;\n case CONFIG.FLOW_EVENTS_SUBTYPE.STRING_COLLISIONS_TOGGLE:\n addRemoveCollisions(data.updates);\n break;\n case CONFIG.FLOW_EVENTS_SUBTYPE.STRING_HAIR: \n updateFlow(data.updates, CONFIG.FLOW_EVENTS_SUBTYPE.STRING_HAIR);\n break;\n case CONFIG.FLOW_EVENTS_SUBTYPE.STRING_JOINTS: \n updateFlow(data.updates, CONFIG.FLOW_EVENTS_SUBTYPE.STRING_JOINTS);\n break;\n default: \n console.error(\"Flow recieved no matching subtype\");\n break;\n }\n updateUI(STRING_FLOW);\n break;\n default:\n break;\n }\n }", "_handle(data) {\n // TODO: json-schema validation of received message- should be pretty straight-forward\n // and will allow better documentation of the API\n let msg;\n try {\n msg = deserialise(data);\n } catch (err) {\n this._logger.push({ data }).log('Couldn\\'t parse received message');\n this.send(build.ERROR.NOTIFY.JSON_PARSE_ERROR());\n }\n this._logger.push({ msg }).log('Handling received message');\n switch (msg.msg) {\n case MESSAGE.CONFIGURATION:\n switch (msg.verb) {\n case VERB.NOTIFY:\n case VERB.PATCH: {\n const dup = JSON.parse(JSON.stringify(this._appConfig)); // fast-json-patch explicitly mutates\n jsonPatch.applyPatch(dup, msg.data);\n this._logger.push({ oldConf: this._appConfig, newConf: dup }).log('Emitting new configuration');\n this.emit(EVENT.RECONFIGURE, dup);\n break;\n }\n default:\n this.send(build.ERROR.NOTIFY.UNSUPPORTED_VERB(msg.id));\n break;\n }\n break;\n default:\n this.send(build.ERROR.NOTIFY.UNSUPPORTED_MESSAGE(msg.id));\n break;\n }\n\n }", "processData(data) {\n // if no error, publish a message, change button text, remove old event listener, add new one\n if (data && data.source == 'server error') {\n this.querySelector('div.warning').innerHTML = data.text;\n return\n } else {\n this.querySelector('div.warning').innerHTML = '';\n }\n\n // once notified of 'ReturnedServerData', unsubscribe to it so this won't get fired again\n this.pubsub.unsubscribe('ReturnedServerData', null, null, this.processData);\n\n this.querySelector('button').innerHTML = \"process videos\";\n this.querySelector('button').removeEventListener('click', () => this.pubsub.publish('RequestServerData', null));\n this.querySelector('button').addEventListener('click', () => {\n // announce 'SendLocalData' has been pressed to anyone listening\n this.pubsub.publish('SendLocalData', null);\n // change button\n this.querySelector('button').innerHTML = \"processing...\";\n this.querySelector('button').disabled = true;\n this.querySelector('button').classList.remove('btn-primary')\n this.querySelector('button').classList.add('btn-secondary');\n });\n\n }", "function handleData(data) {\n if (data.Status == \"parked\") {\n getPlate(data.Spot);\n } else {\n handleTimer(data);\n }\n}", "prepareData () {\n super.prepareData()\n\n const actorData = this.data\n const data = actorData.data\n const flags = actorData.flags\n\n // Make separate methods for each Actor type (character, npc, etc.) to keep\n // things organized.\n if (actorData.type === 'character' || actorData.type === 'creature') {\n this._prepareCharacterData(actorData)\n }\n }", "get payload() {\n return this.data.payload;\n }", "handleRemoteData({ receiveHandler = {} }) {\n// console.log('handleRemoteData');\n const { data: handlerData } = receiveHandler;\n if (_.isEmpty(handlerData)) {\n return;\n }\n\n Object.keys(handlerData).forEach((id) => {\n const { type, data } = handlerData[id] || {};\n if (\n _.findIndex(this.sendBuffers, { id }) === -1 &&\n this.executeCheckList.indexOf(id) === -1\n ) {\n const sendData = this.makeData(type, data);\n this.sendBuffers.push({\n id,\n data: sendData,\n index: this.executeCount,\n });\n }\n });\n }", "static _notificationCallback (notificationData) {\n Widget._printLogLine(`[notificationCallback] data: ${JSON.stringify(notificationData)}`)\n }", "function handlePayload(record, callback) {\n encodedPayload = record.kinesis.data;\n rawPayload = new Buffer(encodedPayload, 'base64').toString('utf-8');\n handleData(JSON.parse(rawPayload), callback);\n }", "onCandleDataEvent(fn) {\n\n this.eventEmitter.on(settings.socket.candleDataEvent, (data) => {\n\n fn(data);\n\n });\n }", "mrdataavailable (e) {\n\t\t\tthis.send_datavailable ();\n\t\t\tthis.statuslog(\"Handling on data available\");\n\t\t\tif (e.data.size > 0) {\n\t\t\t\tthis.recordedChunks.push(e.data);\n\t\t\t\tthis.statuslog(e.data);\n\t\t\t}\n\n\t\t\tif (this.shouldStop === true && this.stopped === false) {\n\t\t\t\tthis.mediaRecorder.stop();\n\t\t\t\tthis.stopped = true;\n\t\t\t\tthis.statuslog (\"clicked... and ... stopped\");\n\t\t\t}\n\t\t}", "function handleNotifications(data) {\n console.log('data: ', data);\n myValue = data;\n}", "handleIpcData(evt, args){\n // prepare to extract type, data from json\n let type, data;\n \n // attempt json parse\n try{\n // parse json\n let json = JSON.parse(args);\n\n // print the response data (remove this later?)\n console.log(json);\n\n // extract type, data\n type = json.type || null;\n data = json.data || null;\n }\n catch(err){\n // parse error\n return;\n }\n\n // process data if type provided (should always be)\n if(type){\n this.processIpcData(evt, type, data);\n }\n }", "getData () {\n if (data) {\n this.data = data;\n this.emit('change', this.data);\n }\n }", "function on (name, fn) {\n debug('on: %s', name);\n if ('data' == name) {\n debug('remapping as \"processedData\" listener', fn);\n name = 'processedData';\n }\n return this.realOn(name, fn);\n}", "function broadcast(evt, data) {\n var msg = {};\n var json = toJSON(data);\n msg[evt] = _.isUndefined(json) ? true : json;\n outProc(msg, null);\n }", "set payload(value) {\n this.data.payload = value;\n }", "applyEventHandler(data = {}) {\n this.handler(data);\n }", "function connectionDataCallback(data) {\n // handle text\n if (data.type === MAQAW_DATA_TYPE.TEXT) {\n that.chatSession.newTextReceived(data.text);\n // show an alert that new text has been received\n alertNewText();\n }\n if (data.type === MAQAW_DATA_TYPE.SCREEN) {\n that.mirror && that.mirror.data(data);\n }\n }", "_setData(d) {\n if (!(d instanceof SplitStreamInputData || d instanceof SplitStreamFilter))\n console.error(\n 'Added data is not an instance of SplitStreamData or SplitStreamFilter'\n );\n\n this._datasetsLoaded++;\n this._data = d.data;\n this._update();\n }" ]
[ "0.697258", "0.67780143", "0.67780143", "0.6709862", "0.67050457", "0.6701381", "0.6509037", "0.6490938", "0.64888304", "0.6423922", "0.64085513", "0.6369954", "0.63236326", "0.63236326", "0.63236326", "0.63065654", "0.6194526", "0.60783505", "0.6056878", "0.60295606", "0.5890146", "0.5866558", "0.581795", "0.5791559", "0.57184654", "0.56984067", "0.56899136", "0.56695545", "0.5632169", "0.5632169", "0.5632169", "0.5624599", "0.5593354", "0.5563412", "0.5542635", "0.5506491", "0.54960716", "0.5491391", "0.54792213", "0.5475578", "0.5467903", "0.5463088", "0.5460703", "0.5450184", "0.5448211", "0.5438033", "0.5432105", "0.5419208", "0.5416079", "0.5411562", "0.5411562", "0.54114616", "0.5411418", "0.5382592", "0.5378227", "0.53628314", "0.53608537", "0.5358534", "0.5322008", "0.5320086", "0.5295165", "0.528933", "0.5288612", "0.52819115", "0.5277595", "0.52571374", "0.5239935", "0.5233225", "0.52258575", "0.52248293", "0.52014554", "0.5195138", "0.5192147", "0.517933", "0.5176114", "0.51659954", "0.51599014", "0.5158828", "0.5158337", "0.5156519", "0.51561636", "0.51453424", "0.5140212", "0.5132044", "0.51307666", "0.5122798", "0.5120381", "0.51142454", "0.5112098", "0.51113904", "0.5111014", "0.5101196", "0.5100959", "0.5096938", "0.50913745", "0.5087338", "0.508589", "0.5083633", "0.5079409", "0.50782186" ]
0.65636563
6
For polling, send a close packet.
doClose() { const close = () => { debug("writing close packet"); this.write([{ type: "close" }]); }; if ("open" === this.readyState) { debug("transport open - closing"); close(); } else { // in case we're trying to close while // handshaking is in progress (GH-164) debug("transport not open - deferring close"); this.once("open", close); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const close = () => {\n debug(\"writing close packet\");\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }", "function sendCloseRequest(callback) {\n var id = self.sequenceID.get();\n var signal = MESSAGE_SIGNAL.REQUEST;\n var content = Helper.buildRequestMessage(id, MESSAGE_TYPE.ONE_WAY, PRESERVED_MESSAGE_NAME.CLOSE);\n sendMessage(id, signal, content, callback);\n }", "emitClose () {\n\t this.readyState = WebSocket.CLOSED;\n\t this.emit('close', this._closeCode || 1006, this._closeMessage || '');\n\n\t if (this.extensions[PerMessageDeflate.extensionName]) {\n\t this.extensions[PerMessageDeflate.extensionName].cleanup();\n\t }\n\n\t this.extensions = null;\n\n\t this.removeAllListeners();\n\t this.on('error', constants.NOOP); // Catch all errors after this.\n\t }", "emitClose () {\n\t this.readyState = WebSocket.CLOSED;\n\t this.emit('close', this._closeCode || 1006, this._closeMessage || '');\n\n\t if (this.extensions[PerMessageDeflate.extensionName]) {\n\t this.extensions[PerMessageDeflate.extensionName].cleanup();\n\t }\n\n\t this.extensions = null;\n\n\t this.removeAllListeners();\n\t this.on('error', constants.NOOP); // Catch all errors after this.\n\t }", "function emitClose() {\n socket.emit(\"close\");\n}", "function handleClose(){\n\n console.log('[SOCKET] - CLOSE');\n }", "close() {\n this.connection.sendBeacon({type: 'disconnect', session: this.sessionId})\n this.messageSubscription.unsubscribe()\n clearTimeout(this.resendReportTimer)\n clearInterval(this.performPurgeTimer)\n clearTimeout(this.changeReportDebounceTimer)\n }", "onClose(reason, desc) {\n if (\"opening\" === this.readyState || \"open\" === this.readyState || \"closing\" === this.readyState) {\n debug('socket close with reason: \"%s\"', reason); // clear timers\n\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer); // stop event from firing again for transport\n\n this.transport.removeAllListeners(\"close\"); // ensure transport won't stay open\n\n this.transport.close(); // ignore further transport communication\n\n this.transport.removeAllListeners();\n\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"offline\", this.offlineEventListener, false);\n } // set ready state\n\n\n this.readyState = \"closed\"; // clear session id\n\n this.id = null; // emit close event\n\n this.emit(\"close\", reason, desc); // clean buffers after, so users can still\n // grab the buffers on `close` event\n\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode || 1006, this._closeMessage || '');\n\n if (this.extensions[PerMessageDeflate.extensionName]) {\n this.extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this.extensions = null;\n\n this.removeAllListeners();\n this.on('error', constants.NOOP); // Catch all errors after this.\n }", "onClose(reason, desc) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug$3('socket close with reason: \"%s\"', reason);\n const self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = \"closed\";\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit(\"close\", reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n }", "onClose(reason, desc) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug('socket close with reason: \"%s\"', reason);\n const self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = \"closed\";\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit(\"close\", reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n }", "onClose(reason, desc) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug('socket close with reason: \"%s\"', reason);\n const self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = \"closed\";\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit(\"close\", reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n }", "emitClose () {\n this.readyState = WebSocket$1.CLOSED;\n\n this.emit('close', this._closeCode, this._closeMessage);\n\n if (this.extensions[PerMessageDeflate_1.extensionName]) {\n this.extensions[PerMessageDeflate_1.extensionName].cleanup();\n }\n\n this.extensions = null;\n\n this.removeAllListeners();\n }", "onClose(reason, desc) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n debug('socket close with reason: \"%s\"', reason);\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, desc);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }", "onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket$1.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[permessageDeflate.extensionName]) {\n this._extensions[permessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket$1.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "function ontargetclose () {\n debug.proxyResponse('proxy target %s \"close\" event', req.url);\n cleanup();\n socket.destroy();\n }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function close() {\n main.innerHTML = 'Closed <a href=/>reload</a>';\n let payload = {\n action: 'disconnected'\n };\n ws.send(JSON.stringify(payload));\n\n}", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "close() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\t\t// 'disconnected' event will be emitted by onClose listener\n\t}", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine) this.engine.close();\n }", "closeNow(){\n this.socket.close()\n }", "onClose() {\n this._closeSocket(constants_1.ERRORS.SocketClosed);\n }", "onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emitReserved(\"disconnect\", reason);\n }", "_onSocketClose(variable, evt) {\n variable._socketConnected = false;\n this.freeSocket(variable);\n // EVENT: ON_CLOSE\n initiateCallback(VARIABLE_CONSTANTS.EVENT.CLOSE, variable, _.get(evt, 'data'), evt);\n }", "close() {\n this.sendAction('close');\n }", "close(variable) {\n const shouldClose = this._onBeforeSocketClose(variable), socket = this.getSocket(variable);\n if (shouldClose === false) {\n return;\n }\n socket.close();\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "function onclose() {\n onerror('socket closed');\n }", "function onclose() {\n onerror('socket closed');\n }", "close () {\n this._rtc.close()\n return this._socket.close()\n }", "socketClose() {\n console.log('sock close');\n\n GlobalVars.reset();\n this.reset();\n\n this.reconnect();\n }", "_onTimeout() {\n this.send(421, 'Timeout - closing connection');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose() {\n onerror(\"socket closed\");\n }" ]
[ "0.77094585", "0.77094585", "0.7688598", "0.7667976", "0.70320964", "0.6886", "0.6818271", "0.6818271", "0.68078834", "0.68016535", "0.6762174", "0.67345065", "0.6728473", "0.6640385", "0.66342425", "0.66342425", "0.6624417", "0.66060144", "0.6605341", "0.6602532", "0.6602532", "0.65039736", "0.64915043", "0.64915043", "0.64541656", "0.6401399", "0.6401399", "0.6401399", "0.6401399", "0.6401399", "0.6390831", "0.6383247", "0.6383247", "0.6383247", "0.6383247", "0.6383247", "0.6383247", "0.6383247", "0.6383247", "0.6376063", "0.6369473", "0.63508636", "0.6341208", "0.63291115", "0.6312046", "0.6301709", "0.6298842", "0.62922436", "0.6264282", "0.6256092", "0.6256092", "0.6255016", "0.62426156", "0.62426156", "0.6242298", "0.6238348", "0.62237287", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.6198347", "0.61970615", "0.6193139", "0.6193139" ]
0.77702695
0
Generates uri for connection.
uri() { let query = this.query || {}; const schema = this.opts.secure ? "https" : "http"; let port = ""; // cache busting is forced if (false !== this.opts.timestampRequests) { query[this.opts.timestampParam] = yeast(); } if (!this.supportsBinary && !query.sid) { query.b64 = 1; } query = parseqs.encode(query); // avoid port if default for schema if (this.opts.port && ("https" === schema && Number(this.opts.port) !== 443 || "http" === schema && Number(this.opts.port) !== 80)) { port = ":" + this.opts.port; } // prepend ? to query if (query.length) { query = "?" + query; } const ipv6 = this.opts.hostname.indexOf(":") !== -1; return schema + "://" + (ipv6 ? "[" + this.opts.hostname + "]" : this.opts.hostname) + port + this.opts.path + query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen_url (connection, collection) {\n\tvar config = connections.connections[connection];\n\tvar url = config.URI;\n\n\turl += '/' + config.orgName + '/' + config.appName + '/' + collection + '?';\n\n\treturn url;\n}", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = (0, yeast_1.default)();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n const encodedQuery = parseqs_1.default.encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n const encodedQuery = encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast_1();\n }\n\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n const encodedQuery = encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\"; // avoid port if default for schema\n\n if (this.opts.port && (\"wss\" === schema && Number(this.opts.port) !== 443 || \"ws\" === schema && Number(this.opts.port) !== 80)) {\n port = \":\" + this.opts.port;\n } // append timestamp to URI\n\n\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n } // communicate binary support capabilities\n\n\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query); // prepend ? to query\n\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return schema + \"://\" + (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) + port + this.opts.path + query;\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = (0, yeast_1.default)();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n const encodedQuery = parseqs_1.default.encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "get URI() {\n\t\treturn 'exchange://' + this.username + '@' + this.hostname + this.name;\n\t}", "function constructIgUri(igServer){\n var uri = \"\";\n\n uri = igServer.protocol + \"://\" + igServer.host\n\n return uri;\n}", "buildUrl() {\n let url = this.hostname;\n\n if (this.port !== 80) {\n url += ':' + this.port;\n }\n\n let path = this.path;\n if (path.substring(0, 1) !== '/') {\n path = '/' + path;\n }\n\n url += path;\n\n url = replaceUrlParams(url, this.givenArgs);\n url = url.replace('//', '/');\n url = 'https://' + url;\n return url;\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast_1();\n }\n\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "function _createURL()\n { var arr\n\n if(arguments.length === 1) arr=arguments[0]\n else arr = arguments\n\n var url = _transaction.server.location\n\n // arr:['route', 'article', 54 ] => str:\"/route/article/54\"\n for (var i=0; i<arr.length; i++){\n url += '/';\n if (arr[i] in _transaction.server)\n url += _transaction.server[arr[i]];\n else if (arr[i]+'Path' in _transaction.server)\n url += _transaction.server[arr[i]+'Path'];\n else\n url += arr[i]\n }\n\n return url;\n }", "function _getEndpointUri(endpoint) {\n return _endpoint.gebo + _endpoint[endpoint];\n }", "function createCompleteUri(uri) {\n // Add the passed parameter to the base\n return ApiUrlBase + uri;\n}", "function makeUrl() {\n let args = Array.from(arguments);\n return args.reduce(function (acc, cur) {\n return urljoin(acc, cur);\n });\n}", "getUri() {\n return super.getAsString(\"uri\");\n }", "function makeUri(u) {\n\t var uri = ''\n\t if (u.protocol) {\n\t uri += u.protocol + '://'\n\t }\n\t if (u.user) {\n\t uri += u.user\n\t }\n\t if (u.password) {\n\t uri += ':' + u.password\n\t }\n\t if (u.user || u.password) {\n\t uri += '@'\n\t }\n\t if (u.host) {\n\t uri += u.host\n\t }\n\t if (u.port) {\n\t uri += ':' + u.port\n\t }\n\t if (u.path) {\n\t uri += u.path\n\t }\n\t var qk = u.queryKey\n\t var qs = []\n\t for (var k in qk) {\n\t if (!qk.hasOwnProperty(k)) {\n\t continue\n\t }\n\t var v = encodeURIComponent(qk[k])\n\t k = encodeURIComponent(k)\n\t if (v) {\n\t qs.push(k + '=' + v)\n\t }\n\t else {\n\t qs.push(k)\n\t }\n\t }\n\t if (qs.length > 0) {\n\t uri += '?' + qs.join('&')\n\t }\n\t if (u.anchor) {\n\t uri += '#' + u.anchor\n\t }\n\t return uri\n\t}", "function makeUrl() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.reduce(function (acc, cur) { return url_join_1[\"default\"](acc, cur); });\n}", "function buildUrl(schema) {\n return function (domain, path) {\n console.log(`${schema}://${domain}/${path}`); \n }\n }", "get url() {\n return createUserUri(this.database.id, this.id);\n }", "get_url() {\n\t\treturn config.zeromq.proto + '://' + config.zeromq.host + ':' + config.zeromq.port;\n\t}", "function generateWsUrl() {\n var self = this;\n var port = getPort.call(this);\n var protocol = self.parameters.secure ? 'wss' : 'ws';\n return URL.format({\n 'slashes': true,\n 'protocol': protocol,\n 'hostname': self.parameters.host,\n 'port': port,\n 'pathname': self.parameters.path,\n 'query': self.parameters.query\n });\n}", "function _getConnectionURL(info) {\n var context = info.registrationContext;\n var scheme = context.https ? \"https\" : \"http\";\n var host = context.serverHost + \":\" + context.serverPort;\n var path = (context.resourcePath.length > 0 && context.resourcePath != 'null' && context.farmId.length > 0 && context.farmId!= 'null') ? (context.resourcePath + \"/\" + context.farmId + \"/\") : \"\";\n return scheme + \"://\" + host + \"/\" + path + \"odata/applications/v1/\" + sap.Logon.applicationId + \"/Connections('\" + info.applicationConnectionId + \"')\";\n }", "function create_url(endpoint) {\n // TODO: ここを書き換えてURL作る\n // return '/api/guchi' + endpoint\n return URL_BASE + '/deai/' + endpoint;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n }", "function gen_url(object){\n var server = config.get('api_conf.server');\n var port = config.get('api_conf.port');\n var version = config.get('api_conf.version');\n var account = config.get('api_conf.account');\n\n url = \"http://\" + server + \":\" + port + \"/\" + version + \"/\" + account \n //Check if the container/object exist, if they exist \n //concatenate it to the url variable \n if(config.has('api_conf.container')){\n url += \"/\" + config.get('api_conf.container'); \n } \n if(config.has('api_conf.object')){\n url += \"/\" + config.get('api_conf.object');\n }\n url += object; \n\n return url;\n}", "function genUrl(opts, path) {\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t var pathDel = !opts.path ? '' : '/';\n\t\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t return opts.protocol + '://' + opts.host +\n\t (opts.port ? (':' + opts.port) : '') +\n\t '/' + opts.path + pathDel + path;\n\t}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n if (opts.remote) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host + ':' + opts.port + '/' +\n opts.path + pathDel + path;\n }\n\n return '/' + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host + ':' + opts.port + '/' +\n opts.path + pathDel + path;\n}", "function genUrl(opts, path$$1) {\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t var pathDel = !opts.path ? '' : '/';\n\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t return opts.protocol + '://' + opts.host +\n\t (opts.port ? (':' + opts.port) : '') +\n\t '/' + opts.path + pathDel + path$$1;\n\t}", "uri() {\n return [\n (this.endpoint() || ''),\n (this.exists() ? this.id() : null)\n ]\n .filter(value => !!value)\n .concat([].slice.call(arguments))\n .map(part => { \n Object.entries(this.attributes)\n .forEach(([key, value]) => {\n part = part.toString().replace(new RegExp(`\\:${key}`), value);\n });\n\n return part;\n })\n .join('/');\n }", "getUri(config) {\n if (typeof config === 'string') {\n return config;\n }\n if (_1.isSeederDatabaseConfigObject(config)) {\n return this.getDbConnectionUri(config);\n }\n throw new Error('Connection URI or database config object is required to connect to database');\n }", "buildURL(){\n var url = this._super(...arguments);\n if (url.lastIndexOf('/') !== url.length - 1) {\n url += '/';\n }\n return url;\n }", "toString() {\n let result = \"\";\n if (this._scheme) {\n result += `${this._scheme}://`;\n }\n if (this._host) {\n result += this._host;\n }\n if (this._port) {\n result += `:${this._port}`;\n }\n if (this._path) {\n if (!this._path.startsWith(\"/\")) {\n result += \"/\";\n }\n result += this._path;\n }\n if (this._query && this._query.any()) {\n result += `?${this._query.toString()}`;\n }\n return result;\n }", "toString() {\n let result = \"\";\n if (this._scheme) {\n result += `${this._scheme}://`;\n }\n if (this._host) {\n result += this._host;\n }\n if (this._port) {\n result += `:${this._port}`;\n }\n if (this._path) {\n if (!this._path.startsWith(\"/\")) {\n result += \"/\";\n }\n result += this._path;\n }\n if (this._query && this._query.any()) {\n result += `?${this._query.toString()}`;\n }\n return result;\n }", "get uri() {\n return this._uri;\n }", "async function getUri() {\n /* istanbul ignore if */\n if (isValidUri(uri)) {\n return uri;\n }\n if (server) {\n return _uri(server);\n }\n process.chdir(`${__dirname}/../public`);\n server = http.createServer(handler);\n const listen = promisify(server.listen.bind(server));\n await listen();\n return _uri(server);\n}", "function _getConnectionURLForRegistration(info) {\n var context = info.registrationContext;\n var scheme = context.https ? \"https\" : \"http\";\n var host = context.serverHost + \":\" + context.serverPort;\n var path = (context.resourcePath.length > 0 && context.farmId.length > 0) ? (context.resourcePath + \"/\" + context.farmId + \"/\") : \"\";\n return scheme + \"://\" + host + \"/\" + path + \"odata/applications/v1/\" + sap.Logon.applicationId + \"/Connections\";\n }", "static stringURI(uriobj) {\nvar res;\nres = uriobj.path;\nif (uriobj != null ? uriobj.authority : void 0) {\nres = \"//\" + uriobj.authority + res;\n}\nif (uriobj != null ? uriobj.scheme : void 0) {\nres = uriobj.scheme + \":\" + res;\n}\nif (uriobj.query != null) {\nres += \"?\" + uriobj.query;\n}\nreturn res;\n}", "get uri() {\n\t\treturn this.__uri;\n\t}", "get uri() {\n\t\treturn this.__uri;\n\t}", "get uri() {\n\t\treturn this.__uri;\n\t}", "function generateURL(){\n\tbroadcastURL.innerHTML = baseURL+senderID;\n}", "get uri () {\n\t\treturn this._uri;\n\t}", "getDbConnectionUri({ protocol, host, port, name, username, password, options, }) {\n const credentials = username\n ? `${username}${password ? `:${password}` : ''}@`\n : '';\n const optsUriPart = options\n ? `?${new url_1.URLSearchParams(options).toString()}`\n : '';\n const portUriPart = protocol !== 'mongodb+srv' ? `:${port}` : '';\n return `${protocol}://${credentials}${host}${portUriPart}/${name}${optsUriPart}`;\n }", "function makeUrl(protocol, host, resource, id) {\n return protocol + \"://\" + host + resource + id;\n}", "get url() {\n return createDocumentCollectionUri(this.database.id, this.id);\n }", "function buildMongoUrl() {\n var mongoUrl = 'mongodb://' + c.db.username + ':' + c.db.password + '@' + c.db.host + ':' + c.db.port + '/' + c.db.database + '?auto_reconnect=true&safe=true';\n return mongoUrl;\n }", "function get_uri(name, title, operation, fields, category_item, insertedId, show_all) {\n \n var uri;\n if (insertedId == null) {\n uri = 'http://localhost:9000/erp/' + category_item;\n }\n else if (show_all) {\n uri = 'http://localhost:9000/erp/' + category_item;\n }\n else {\n \n uri = 'http://localhost:9000/erp/' + category_item + '/' + insertedId;\n }\n \n var return_uri = {\n \"name\": name,\n \"title\": title,\n \"method\": operation,\n \"href\": uri,\n \"type\": \"application/x-www-form-urlencoded\",\n \"fields\": fields\n };\n \n return return_uri;\n\t\n}", "getRoomURL() {\n return location.protocol + \"//\" + location.host + (location.path || \"\") + \"?room=\" + this.getRoom();\n }", "function generateEndpointURL () {\n var querystring = $.param({\n advisor_profile_id: this[options.advisorIdAttribute],\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return routes('back_office_availabilities', { format: 'json' }) + '?' + querystring;\n }", "function generateURI(hxlClass) {\n var arr = hxlClass.split(\"#\");\n if (arr.length == 2) {\n var shortClass = arr[1];\n } else {\n var shortClass = hxlClass;\n }\n var now = new Date();\n // we'll use the time stamp as the unique part of the URI for the time being.\n var id = now.getTime();\n var URI = \"http://hxl.carsten.io/\" + shortClass.toLowerCase() + \"/\" + id;\n return URI;\n}", "function generateCouchDBURL(options) {\n options.hostname = (options.hostname || options.host || '127.0.0.1');\n options.protocol = options.protocol || 'http';\n options.port = (options.port || 5984);\n\n return options.protocol + '://' + options.hostname + ':' + options.port;\n}", "function createUrl(item) {\n var urlObj = {\n protocol: config.HOST.protocol,\n slashes: config.HOST.slashes,\n auth: config.HOST.auth,\n host: config.HOST.host,\n hostname: config.HOST.hostname,\n hash: config.HOST.hash,\n query: item,\n pathname: config.HOST.pathname\n }\n var urlString = url.format(urlObj);\n return urlString\n}", "function generateEndpointURL () {\n var querystring = $.param({\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return routes('sliced_back_office_advisor_profile_availabilities', {\n advisor_profile_id: this[options.advisorIdAttribute],\n format: 'json'\n }) + '?' + querystring;\n }", "function generateEndpointURL () {\n var querystring = $.param({\n advisor_profile_id: this[options.advisorIdAttribute],\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return API_ENDPOINT + '?' + querystring;\n }", "function generateURL() {\r\n var cisRoot = getTopNavApplicationUrl(\"CIS\");\r\n if (!cisRoot) {\r\n // retrieve the web context root for current application\r\n var appPath = getAppPath();\r\n // pick up the parent context root\r\n var parentContextRoot = appPath.replace(/\\/[^\\/]+$/,'');\r\n // infer the context url for eClaim\r\n cisRoot = parentContextRoot + \"/\" + \"CIS\";\r\n }\r\n return cisRoot;\r\n}", "_buildURL(url, options = {}) {\n if ((0, _urlHelpers.isFullURL)(url)) {\n return url;\n }\n const urlParts = [];\n let host = options.host || Ember.get(this, 'host');\n if (host) {\n host = stripSlashes(host);\n }\n urlParts.push(host);\n let namespace = options.namespace || Ember.get(this, 'namespace');\n if (namespace) {\n namespace = stripSlashes(namespace);\n urlParts.push(namespace);\n }\n // If the URL has already been constructed (presumably, by Ember Data), then we should just leave it alone\n const hasNamespaceRegex = new RegExp(`^(/)?${namespace}/`);\n if (namespace && hasNamespaceRegex.test(url)) {\n return url;\n }\n // *Only* remove a leading slash -- we need to maintain a trailing slash for\n // APIs that differentiate between it being and not being present\n if (startsWithSlash(url)) {\n url = removeLeadingSlash(url);\n }\n urlParts.push(url);\n return urlParts.join('/');\n }", "getEndpointUrl() {\n let path = super.getEndpointUrl();\n if (!path.startsWith('/')) {\n path = '/' + path;\n }\n const protocol = getWebsocketProtocol();\n const host = window.location.hostname;\n const port = window.location.port;\n return `${protocol}//${host}:${port}${path}`;\n }", "address() {\n const address = this.server.address();\n const endpoint = typeof address !== \"string\"\n ? (address.address === \"::\" ? \"localhost\" : address.address) + \":\" + address.port\n : address;\n return `${this.protocol}://${endpoint}`;\n }", "function createURL() {\n var query_url = api_url.concat(patientID,auth,accessToken);\n actualQuery();\n }", "function constructTheUrl(i) {\n let url = host + path + lang + \"dguid=\" + geoCSV[i] + \"&\" + topic + notes;\n return url;\n }", "function getUri()/*:URI*/ {\n return this._uri$aqE4;\n }", "get uri() {\n return this.uri_;\n }", "function set_uri(nslocal){\r\n\t\treturn (snorql._namespaces[nslocal[0]] || \"\") + nslocal[1];\r\n\t}", "function newURI(spec) {\n var ioServ = Cc[\"@mozilla.org/network/io-service;1\"].\n getService(Ci.nsIIOService);\n return ioServ.newURI(spec, null, null);\n}", "function getSocketURI () {\n var protocol = (window.location.protocol === 'https:') ? 'wss' : 'ws'\n return `${protocol}://${window.location.host}/ws`\n}", "buildUrlEndpoint(action) {\n\t\t\tconst host = this._configuration.getDomain() + '/api/Bookmark/'\n\t\t\tconst endpoint = action || '';\n\t\t\treturn host + endpoint;\n\t\t}", "function generateURL(host, protocol, resourceType) {\n var url = new URL(\"http://{{host}}:{{ports[https][0]}}/common/security-features/subresource/\");\n url.protocol = protocol == Protocol.INSECURE ? \"http\" : \"https\";\n url.hostname = host == Host.SAME_ORIGIN ? \"{{host}}\" : \"{{domains[天気の良い日]}}\";\n\n if (resourceType == ResourceType.IMAGE) {\n url.pathname += \"image.py\";\n } else if (resourceType == ResourceType.FRAME) {\n url.pathname += \"document.py\";\n } else if (resourceType == ResourceType.WEBSOCKET) {\n url.port = {{ports[wss][0]}};\n url.protocol = protocol == Protocol.INSECURE ? \"ws\" : \"wss\";\n url.pathname = \"echo\";\n } else if (resourceType == ResourceType.WORKER) {\n url.pathname += \"worker.py\";\n } else if (resourceType == ResourceType.WORKLET) {\n url.pathname += \"worker.py\";\n } else if (resourceType == ResourceType.FETCH) {\n url.pathname += \"xhr.py\";\n }\n return {\n name: protocol + \"/\" + host + \" \" + resourceType,\n url: url.toString()\n };\n}", "function makeURI(name, type){\n\tif (name.indexOf(\"http://\") != 0){\n\t\tvar fragment = name.replace(/\\s+/g, '_'); // replace whitespaces\n\t\tname = \"http://hxl.carsten.io/\"+type.toLowerCase()+\"/\" + fragment.toLowerCase();\t\t\n\t}\t\n\treturn name;\n}", "function repoInfoConnectionURL(repoInfo, type, params) {\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(typeof type === 'string', 'typeof type must == string');\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(typeof params === 'object', 'typeof params must == object');\n var connURL;\n if (type === WEBSOCKET) {\n connURL =\n (repoInfo.secure ? 'wss://' : 'ws://') + repoInfo.internalHost + '/.ws?';\n }\n else if (type === LONG_POLLING) {\n connURL =\n (repoInfo.secure ? 'https://' : 'http://') +\n repoInfo.internalHost +\n '/.lp?';\n }\n else {\n throw new Error('Unknown connection type: ' + type);\n }\n if (repoInfoNeedsQueryParam(repoInfo)) {\n params['ns'] = repoInfo.namespace;\n }\n var pairs = [];\n each(params, function (key, value) {\n pairs.push(key + '=' + value);\n });\n return connURL + pairs.join('&');\n}", "function getURI() {\n return request([{\n \"name\": \"uri\",\n \"src\": \"../lib/uri/uri.js\",\n \"shim\": true\n }, {\n \"name\": \"util\",\n \"src\": \"../lib/src/util.js\"\n }, {\n \"name\": \"template\",\n \"src\": \"../lib/uritemplate/uritemplate.js\",\n \"shim\": true\n }]);\n }", "static REMOTE_SERVER_URL(collection, parameter, urlParametersAsString) {\n\t\tconst port = 1337;\n\t\tlet url = `http://localhost:${port}/${collection}/`;\n\t\tif (parameter) {\n\t\t\turl += `${parameter}/`;\n\t\t}\n\t\tif (urlParametersAsString) {\n\t\t\turl += `?${urlParametersAsString}`;\n\t\t}\n\t\treturn url;\n\t}", "function modifyTourUri(){\n\t\tserverUri = Parameters.getTourServerUri() + \"/path\";\n\t}", "function createUrl(val){\n return `http://localhost:3000/api/${val}`;\n \n}", "function generateURL(host, protocol, resourceType) {\n var url = new URL(\"http://{{host}}:{{ports[https][0]}}/upgrade-insecure-requests/support/\");\n url.protocol = protocol == Protocol.INSECURE ? \"http\" : \"https\";\n url.hostname = host == Host.SAME_ORIGIN ? \"{{host}}\" : \"{{domains[天気の良い日]}}\";\n\n if (resourceType == ResourceType.IMAGE) {\n url.pathname += \"pass.png\";\n } else if (resourceType == ResourceType.FRAME) {\n url.pathname += \"post-origin-to-parent.html\";\n } else if (resourceType == ResourceType.WEBSOCKET) {\n url.port = {{ports[wss][0]}};\n url.protocol = protocol == Protocol.INSECURE ? \"ws\" : \"wss\";\n url.pathname = \"echo\";\n }\n return {\n name: protocol + \"/\" + host + \" \" + resourceType,\n url: url.toString()\n };\n}", "function ThetaUri() {\n this.base = 'http://192.168.1.1/osc';\n this.execute = this.base + '/commands/execute';\n this.info = this.base + '/info';\n this.state = this.base + '/state';\n}", "function setURL() {\n var proto;\n var url;\n var port;\n if (window.location.protocol == \"http:\") {\n proto = \"ws://\";\n port = \"8080\";\n } else {\n proto = \"wss://\";\n port = \"8443\";\n }\n\n url = proto + window.location.hostname + \":\" + port;\n return url;\n}", "function getConnectionUrl(auth) {\n return auth.generateAuthUrl({\n access_type: 'offline',\n prompt: 'consent', // added new refresh token when sign In\n scope: scopes\n });\n}", "function getConnectionUrl(auth) {\r\n return auth.generateAuthUrl({\r\n access_type: 'offline',\r\n prompt: 'consent', // access type and approval prompt will force a new refresh token to be made each time signs in\r\n scope: defaultScope\r\n });\r\n}", "buildURL(modelName, id, snapshot, requestType) {\n if (requestType === 'createRecord') {\n return `${this.get('host')}/${this.get('namespace')}/users/${id}`;\n }\n return this._super(...arguments);\n }", "function getRoomURL() {\n\treturn location.protocol + \"//\" + location.host + (location.pathname || \"\") + \"?room=\" + getRoom();\n}", "function setupEndpoint() {\n if (host.val().indexOf('/') != -1) {\n var hostArr = host.val().split('/');\n\n path = \"http://\" + hostArr[0] + \":\" + port.val();\n hostArr.shift(); // remove host\n\n if (hostArr.length > 0) { // anything left?\n path += \"/\" + hostArr.join('/');\n }\n } else {\n path = \"http://\" + host.val() + \":\" + port.val();\n }\n endpoint = path;\n }", "function getShortURL () {\n\t//base 36 characters\n\tvar alphanumeric = ['0','1','2','3','4','5','6','7','8','9','A','B',\n\t\t\t\t\t\t'C','D','E','F','G','H','I','J','K','L','M','N',\n\t\t\t\t\t\t'O','P','Q','R','S','T','U','V','W','X','Y','Z'];\n\tvar urlString = \"http://localhost:3000/\";\n\tfor (i = 0; i < 4; i++) {\n\t\tvar num = randomNum(0,35);\n\t\turlString = urlString + alphanumeric[num];\n\t}\n\n\treturn urlString;\n}", "function urlMaker() {\n url_string = \"\"\n\n // adding the first character\n url_string = url_string.concat(\"?\")\n\n // concatinating the filternames\n configSet.filters.forEach(element => {\n url_string = url_string.concat('filter_name_list=', element, '&')\n })\n\n // concatinating the thresholds\n configSet.confidence_thresholds.forEach(element => {\n url_string = url_string.concat('confidence_threshold_list=', element, '&')\n })\n\n // concatinating the column name\n url_string = url_string.concat('column_name=', configSet.col_name, '&')\n\n // concatinating the CSV URL/Path\n url_string = url_string.concat('csv_url=', encodeURIComponent(configSet.csv_url))\n\n // remove the extra & sign in the loop\n // url_string = url_string.slice(0, -1)\n return url_string\n}", "function generateUrl(el) {\n\tvar generatedUrl = assembleUrl();\n\n\t// ADD TO CLIPBOARD add it to the dom\n\tcopyToClipboard(generatedUrl);\n\tdomElements.wrapperUrl.el.html(generatedUrl);\n}", "function makeurl( path ) {\n if (path.indexOf(\"://\") > 0) return path;\n return url + \"/\" + path;\n }" ]
[ "0.7223226", "0.7173111", "0.7164633", "0.6994125", "0.6994125", "0.698464", "0.6882258", "0.6877759", "0.6788025", "0.6628015", "0.6628015", "0.6620066", "0.6599762", "0.6552466", "0.6522966", "0.6422189", "0.63868827", "0.6358184", "0.62283826", "0.61361", "0.6063683", "0.6060825", "0.6048767", "0.6046379", "0.60071856", "0.6005793", "0.5968925", "0.5929022", "0.5913362", "0.590083", "0.58788455", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5837794", "0.5830228", "0.5824697", "0.58042806", "0.58020896", "0.5797031", "0.57294536", "0.57294536", "0.5712802", "0.571239", "0.57043153", "0.5694431", "0.5683867", "0.5683867", "0.5683867", "0.5652418", "0.5624428", "0.56165296", "0.557432", "0.5570544", "0.5555782", "0.5550228", "0.5519366", "0.551546", "0.5510629", "0.55062187", "0.54964745", "0.54940367", "0.54903144", "0.548056", "0.5477829", "0.54680043", "0.5466008", "0.54537356", "0.5453158", "0.5429723", "0.5426097", "0.5415555", "0.541085", "0.54105854", "0.53904843", "0.53843105", "0.5377936", "0.5376961", "0.5367312", "0.53537095", "0.5325861", "0.5322013", "0.53184915", "0.531315", "0.53007394", "0.5291907", "0.52915454", "0.5288254", "0.5281941", "0.5280429", "0.5272207", "0.5267167", "0.52612066", "0.5259047" ]
0.6565206
13
Adds event listeners to the socket
addEventListeners() { this.ws.onopen = () => { if (this.opts.autoUnref) { this.ws._socket.unref(); } this.onOpen(); }; this.ws.onclose = this.onClose.bind(this); this.ws.onmessage = ev => this.onData(ev.data); this.ws.onerror = e => this.onError("websocket error", e); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addEventListeners () {\n this._socket.on(ConnectionSocket.EVENT_ESTABLISHED, this._handleConnectionEstablished.bind(this))\n this._socket.on(ConnectionSocket.EVENT_CLOSED, this._handleConnnectionClosed.bind(this))\n this._socket.on(ConnectionSocket.EVENT_PEER_CONNECTED, this._handlePeerConnected.bind(this))\n this._socket.on(ConnectionSocket.EVENT_PEER_PING, this._handlePingMessage.bind(this))\n this._socket.on(ConnectionSocket.EVENT_PEER_SIGNAL, (signal) => this._rtc.signal(signal))\n this._rtc.on(ConnectionRTC.EVENT_RTC_SIGNAL, (signal) => this._socket.sendSignal(signal))\n this._rtc.on(ConnectionRTC.EVENT_PEER_PING, this._handlePingMessage.bind(this))\n this._rtc.on(ConnectionRTC.EVENT_CLOSED, this._handleConnnectionClosed.bind(this))\n }", "function socketListeners(){\n\tsocket.on('joined',function(){\n\t\tuser.success();\n\t});\n\tsocket.on('exists',function(err){\n\t\tuser.error(err);\n\t});\n\tsocket.on('roomList',function(roomlist){\n\t\tchatRoom.populate(roomlist);\n\t});\n}", "addEventListeners() {\n const self = this;\n\n this.ws.onopen = function() {\n self.onOpen();\n };\n this.ws.onclose = function() {\n self.onClose();\n };\n this.ws.onmessage = function(ev) {\n self.onData(ev.data);\n };\n this.ws.onerror = function(e) {\n self.onError(\"websocket error\", e);\n };\n }", "addEventListeners() {\n const self = this;\n\n this.ws.onopen = function() {\n self.onOpen();\n };\n this.ws.onclose = function() {\n self.onClose();\n };\n this.ws.onmessage = function(ev) {\n self.onData(ev.data);\n };\n this.ws.onerror = function(e) {\n self.onError(\"websocket error\", e);\n };\n }", "addEventListeners() {\n const self = this;\n\n this.ws.onopen = function() {\n self.onOpen();\n };\n this.ws.onclose = function() {\n self.onClose();\n };\n this.ws.onmessage = function(ev) {\n self.onData(ev.data);\n };\n this.ws.onerror = function(e) {\n self.onError(\"websocket error\", e);\n };\n }", "setUpSocketEventListeners() {}", "addChatListeners () {\n this.webSocket.onopen = () => console.log('open channel')\n this.webSocket.addEventListener('open', this.handleSocketConnection)\n this.webSocket.onmessage = (e) => this.handleMessage(JSON.parse(e.data))\n this.form.addEventListener('submit', this.handleSubmit)\n this.emojiIcon.addEventListener('click', this.toggleEmojis)\n }", "addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = this.onClose.bind(this);\n this.ws.onmessage = ev => this.onData(ev.data);\n this.ws.onerror = e => this.onError(\"websocket error\", e);\n }", "_attachListeners () {\n const onListening = () => {\n const address = this._server.address()\n debug(`server listening on ${address.address}:${address.port}`)\n this._readyState = Server.LISTENING\n }\n\n const onRequest = (request, response) => {\n debug(`incoming request from ${request.socket.address().address}`)\n request = Request.from(request)\n response = Response.from(response)\n this._handleRequest(request, response)\n }\n\n const onError = err => {\n this.emit('error', err)\n }\n\n const onClose = () => {\n this._readyState = Server.CLOSED\n }\n\n this._server.on('listening', onListening)\n this._server.on('request', onRequest)\n this._server.on('checkContinue', onRequest)\n this._server.on('error', onError)\n this._server.on('close', onClose)\n this._readyState = Server.READY\n }", "addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = closeEvent => this.onClose({\n description: \"websocket connection closed\",\n context: closeEvent\n });\n this.ws.onmessage = ev => this.onData(ev.data);\n this.ws.onerror = e => this.onError(\"websocket error\", e);\n }", "function listeners() {\n\t//Connection event--currently no data passed\n\tsocket.on('connect', function() {\n\t\ttotalTimer.start();\n\t});\n\t\n\t//Sets colors\n\tsocket.on('color', function(data) {\n\t\tif (data.color == 'white')\n\t\t\tisWhite = true;\n\t\telse\n\t\t\tisWhite = false;\n\t});\n\t\n\t//Updates board from server\n\tsocket.on('update', function(data) {\n\t\tboard = data.board;\n\t\tdrawBoard(data.board);\n\t\tdrawTurn(data.color);\n\t});\n\t\n\t//Bad move handler\n\tsocket.on('badMove', function() {\n\t\talert('Sorry, that was a bad move. Try a different one');\n\t});\n}", "registerSocketListener() {\n this.ws.onopen = () => { this.onOpen() }\n this.ws.onclose = () => { this.onClose() }\n this.ws.onerror = () => { this.onError() }\n this.ws.onmessage = (e) => { this.onMessage(e) }\n }", "function setEventHandlers() {\n // Keyboard\n window.addEventListener('keydown', onKeyDown);\n window.addEventListener('keyup', onKeyUp);\n\n // Window resize\n window.addEventListener('resize', onResize);\n\n // call onSocketConnected when this player is connected\n socket.on('connect', onSocketConnected);\n \n // call onSocketDisconnect when this player disconnects\n socket.on('disconnect', onSocketDisconnect);\n \n // call onNewPlayer when a new player joins the game\n socket.on('new player', onNewPlayer);\n \n // call onMovePlayer when any player moves\n socket.on('move player', onMovePlayer);\n\n // call onRemovePlayer when any player leaves\n socket.on('remove player', onRemovePlayer);\n}", "_connectEvents () {\n this._socket.on('sensorChanged', this._onSensorChanged);\n this._socket.on('deviceWasClosed', this._onDisconnect);\n this._socket.on('disconnect', this._onDisconnect);\n }", "function bindEvents(socket){\n\tsocket.on(\"sendUserJoinEvent\", function (formInfoObj){\n\t\tsendUserJoinEvent(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"sendWhiteboardDrawEvent\", function (formInfoObj){\n\t\tsendWhiteboardDrawEvent(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"sendWhiteboardUpdShapeEvent\", function (formInfoObj){\n\t\tsendWhiteboardUpdShapeEvent(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"createMeeting\", function (formInfoObj){\n\t\tcreateMeeting(formInfoObj);\t\t\n\t});\n\n\tsocket.on(\"sendJSON\", function (formInfoObj){\n\t\tsendJSON(formInfoObj);\t\t\n\t});\n\n\n}", "_setDefaultListeners () {\n this.io.on('connection', (objSocket) => {\n console.log('Socket client connected', this.io.engine.clientsCount);\n objSocket.on('join_room', (strRoom) => {\n console.log('Joining room', strRoom);\n objSocket.join(strRoom);\n });\n })\n }", "registerPlayerEvents() {\n const socket = Game.socket;\n socket.on('update', this.onUpdate.bind(this));\n socket.on('command', this.onCommand.bind(this));\n socket.on('player:connected', this.onPlayerConnected.bind(this));\n socket.on('player:disconnected', this.onPlayerDisconnected.bind(this));\n }", "registerListeners(){\n this.io.on('connection', socket => {\n this.App.debug(\"Client connected\", this.prefix);\n\n this.registerSocketListener(socket, 'send-message', data => {\n this.App.MessageOrm.getByChatName({chatName: data.room}, (err, rows) => {\n if (err) return this.App.throwErr(err, this.prefix);\n if (rows) rows.forEach(row => row.userId = this.App.serializeSalt(row.userId));//Serialize userId\n this.send(this.io.sockets, 'get-message', rows)\n })\n });\n\n this.registerSocketListener(socket, 'refresh', data => {\n this.App.MessageOrm.getByChatName({chatName: data.room}, (err, rows) => {\n if (err) return this.App.throwErr(err, this.prefix);\n if (rows) rows.forEach(row => row.userId = this.App.serializeSalt(row.userId));//Serialize userId\n this.send(this.io.sockets, 'refresh', rows)\n })\n })\n })\n }", "bindCallbacks() {\n this.socket.onopen = (event) => this.onopen(event);\n this.socket.onmessage = (event) => this.onmmessage(event);\n this.socket.onclose = (event) => this.onclose(event);\n this.socket.onerror = (event) => this.onerror(event);\n }", "registerListeners() {}", "startSocketHandling() {\n this.userNamespace.on('connection', (socket) => {\n logger.debug(`New socket connected to namespace ${this.userNamespace.name} + ${socket.id}`);\n\n // Register socket functions\n socket.on('getQuestions', this.getQuestions(socket));\n socket.on('answerQuestion', this.answerQuestion(socket));\n socket.on('answerOpenQuestion', this.answerOpenQuestion(socket));\n });\n }", "setListeners(){\n let self = this;\n\n self.socketHub.on('connection', (socket) => {\n console.log(`SOCKET HUB CONNECTION: socket id: ${socket.id}`)\n self.emit(\"client_connected\", socket.id);\n socket.on(\"disconnect\", (reason)=>{\n console.log(\"Client disconnected: \" + socket.id)\n self.emit(\"client_disconnected\", socket.id)\n });\n\n socket.on('reconnect', (attemptNumber) => {\n self.emit(\"client_reconnected\", socket.id)\n });\n\n socket.on(\"ping\", ()=>{\n console.log(\"RECEIVED PING FROM CLIENT\")\n socket.emit(\"pong\");\n })\n\n socket.on(\"error\", (err)=>{\n Logger.error(`Client socket error: ${err.message}`, {stack: err.stack});\n })\n\n });\n\n self.dataSocketHub.on('connection', (socket)=>{\n console.log(\"File socket connected\");\n self.emit(\"data_channel_opened\", socket);\n console.log(\"After data_channel_opened emit\")\n socket.on(\"disconnect\", (reason)=>{\n self.emit(\"data_channel_closed\", socket.id);\n });\n\n socket.on(\"reconnect\", (attemptNumber) => {\n self.emit(\"data_channel_reconnection\", socket.id);\n })\n\n socket.on(\"error\", (err)=>{\n Logger.error(\"Data socket error: \" + err)\n })\n\n })\n }", "registerListeners() {\n const client = MatrixClientPeg.get();\n\n client.on('sync', this.onSync);\n client.on('Room.timeline', this.onRoomTimeline);\n client.on('Event.decrypted', this.onEventDecrypted);\n client.on('Room.timelineReset', this.onTimelineReset);\n client.on('Room.redaction', this.onRedaction);\n }", "listen(){\n this.namespace.on('connection', (socket)=>{\n socket.on('teacher start poll', (teacherSocketId, poll) => {\n this.handleStartPoll(teacherSocketId, poll);\n });\n socket.on('student submit poll', (answersInfo, userId, sessionId)=>{\n this.handleStudentSubmitPoll(answersInfo, userId, sessionId);\n })\n });\n }", "_constructSocketListeners () {\n /* Handles our open event */\n this._ws.addEventListener('open', evt => {\n setInterval(() => {\n this._sendArray([{ m: '+ls' }])\n }, this._roomScanMS)\n this._isConnected = true\n this._sendArray([{ m: 'hi' }])\n this._heartbeatInterval = setInterval(() => {\n this._sendArray([{ m: 't', e: Date.now() }])\n }, this._heartbeatMS)\n this.emit('connected')\n this.setChannel('lobby')\n this._noteFlushInterval = setInterval(() => {\n if (this._noteBufferTime && this._noteBuffer.length > 0) {\n this._sendArray([{ m: 'n', t: this._noteBufferTime + this._serverTimeOffset, n: this._noteBuffer }])\n this._noteBufferTime = 0\n this._noteBuffer = []\n }\n }, this._noteFlushIntervalMS)\n })\n\n /* Handles our close event */\n this._ws.addEventListener('close', evt => {\n clearInterval(this._heartbeatInterval)\n clearInterval(this._noteFlushInterval)\n if (!this.hasErrored) this.emit('disconnected')\n })\n\n /* Handles our errors */\n this._ws.addEventListener('error', error => {\n if (error.message === 'WebSocket was closed before the connection was established') return\n this.emit('error', new Error(error))\n this._ws.close()\n })\n\n /* Handles generic messages */\n this._ws.addEventListener('message', evt => {\n if (typeof evt.data !== 'string') return\n try {\n const transmission = JSON.parse(evt.data)\n for (var i = 0; i < transmission.length; i++) {\n var msg = transmission[i]\n if (msg.m === 'hi') {\n this._recieveServerTime(msg.t, msg.e || undefined)\n }\n if (msg.m === 't') {\n this._recieveServerTime(msg.t, msg.e || undefined)\n }\n if (msg.m === 'a') {\n this.emit('message', {\n content: msg.a,\n user: {\n id: msg.p.id,\n name: msg.p.name,\n color: msg.p.color\n },\n time: msg.t\n })\n }\n if (msg.m === 'ch') {\n this.room.name = msg.ch._id\n this._channelHasJoined = true\n if (this.room.users.length !== 0) return\n msg.ppl.forEach(person => {\n this.room.users.push({\n id: person.id,\n name: person.name,\n color: person.color\n })\n })\n }\n if (msg.m === 'p') {\n const formattedUser = {\n id: msg.id,\n name: msg.name,\n color: msg.color\n }\n this.emit('userJoined', formattedUser)\n this.room.users.push(formattedUser)\n }\n if (msg.m === 'bye') {\n const user = this.room.users.filter(e => e.id === msg.p)[0]\n this.room.users = this.room.users.filter(e => e.id !== msg.p)\n this.emit('userLeave', user)\n }\n if (msg.m === 'ls') {\n this.rooms = []\n msg.u.forEach(room => {\n this.rooms.push({\n name: room._id,\n count: room.count\n })\n })\n this._sendArray([{ m: '-ls' }])\n }\n if (msg.m === 'n') {\n this.emit('notePress', {\n note: msg.n,\n user: msg.p\n })\n }\n }\n } catch (error) {\n this.emit('error', error)\n }\n })\n }", "handleEvents(){\n this.io.on('connection', (socket) => {\n this.handleJoinEvent(socket);\n this.handleLeaveEvent(socket);\n this.handleSendMsgEvent(socket);\n this.handleAddNotificationEvent(socket);\n });\n }", "function setSocketIoConnectionListener() {\n io.on('connection', function (client) {\n setSocketIoListeners(client);\n });\n}", "function setEventHandlers() {\n // Socket.IO\n socket.sockets.on(\"connection\", onSocketConnection);\n SearchServices.emptyArray();\n}", "loadSockets () {\n const funcs = this.loadModules();\n this.io.on('connection', (socket) => {\n console.log('Socket Connected');\n const keys = Object.keys(funcs);\n for (let k = 0; k < keys.length; k++) {\n const key = keys[k];\n socket.on(key, (data) => funcs[key](socket, data));\n }\n });\n }", "subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on(io, \"open\", this.onopen.bind(this)),\n on(io, \"packet\", this.onpacket.bind(this)),\n on(io, \"error\", this.onerror.bind(this)),\n on(io, \"close\", this.onclose.bind(this)),\n ];\n }", "static listenSocketEvents() {\n Socket.shared.on(\"wallet:updated\", (data) => {\n let logger = Logger.create(\"wallet:updated\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(Wallet.actions.walletUpdatedEvent(data));\n });\n }", "bindSocketListeners() {\n //Remove listeners that were used for connecting\n this.netClient.removeAllListeners('connect');\n this.netClient.removeAllListeners('timeout');\n // The socket is expected to be open at this point\n this.isSocketOpen = true;\n this.netClient.on('close', () => {\n this.log('info', `Connection to ${this.endpointFriendlyName} closed`);\n this.isSocketOpen = false;\n const wasConnected = this.connected;\n this.close();\n if (wasConnected) {\n // Emit only when it was closed unexpectedly\n this.emit('socketClose');\n }\n });\n\n this.protocol = new streams.Protocol({ objectMode: true });\n this.parser = new streams.Parser({ objectMode: true }, this.encoder);\n const resultEmitter = new streams.ResultEmitter({objectMode: true});\n resultEmitter.on('result', this.handleResult.bind(this));\n resultEmitter.on('row', this.handleRow.bind(this));\n resultEmitter.on('frameEnded', this.freeStreamId.bind(this));\n resultEmitter.on('nodeEvent', this.handleNodeEvent.bind(this));\n\n this.netClient\n .pipe(this.protocol)\n .pipe(this.parser)\n .pipe(resultEmitter);\n\n this.writeQueue = new WriteQueue(this.netClient, this.encoder, this.options);\n }", "on(eventType, callback) {\n super.on(eventType, callback);\n this.socket.on(eventType, callback);\n }", "attachListeners() {\n this.#outInterface.on('line', this.lineListener);\n this.#errInterface.on('line', this.errorListener);\n this.#child.on('exit', this.exitListener);\n this.#child.on('close', () => {});\n }", "addListener(type, callback) {\n if (type == CALLBACKS.WEBSOCKET_CONNECTED) {\n this.websocketConnectedListeners.push(callback);\n } else if (type == CALLBACKS.WEBSOCKET_DISCONNECTED) {\n this.websocketDisconnectListeners.push(callback);\n } else if (type == CALLBACKS.RAW_WEBSOCKET_MESSAGE_RECEIVED) {\n this.rawMessageListeners.push(callback);\n }\n }", "function setSocketIoListeners(client) {\n\n client.on('GetAds',function(data){\n // making sure that the client sent the 'getAll' parameter\n if (typeof data.getAll === 'undefined') return;\n\n logEvent('GetActiveAds', data);\n onGetAds(client, data.getAll);\n });\n\n client.on('GetAdsByStation',function(data){\n // making sure that the client sent the 'stationId' parameter\n if (typeof data.stationId === 'undefined') return;\n\n logEvent('GetActiveAdsByStation', data);\n onGetAdsByStation(client, data.stationId);\n });\n\n client.on('ValidateAd', function(data) {\n // making sure that the client sent the 'ad' parameter\n if (typeof data.ad === 'undefined') return;\n \n logEvent('ValidateAd', data);\n onValidateAd(client, data.ad);\n });\n\n client.on('CreateAd', function(data) {\n // making sure that the client sent the 'adData' parameter\n if (typeof data.adData === 'undefined') return;\n \n logEvent('CreateAd', data);\n onCreateAd(data.adData);\n });\n\n client.on('DeleteAd', function(data) {\n // making sure that the client sent the 'adId' parameter\n if (typeof data.adId === 'undefined') return;\n \n logEvent('DeleteAd', data);\n onDeleteAd(client , data.adId);\n });\n\n client.on('EditAd', function(data) {\n // making sure that the client sent the 'adId' and 'adData' parameters\n if (typeof data.adId === 'undefined') return;\n if (typeof data.adData === 'undefined') return;\n \n logEvent('EditAd', data);\n onEditAd(data.adId, data.adData);\n });\n\n client.on('GetAllStations', function(data) {\n \n logEvent('GetAllStations', data);\n onLoadAllDisplays(client);\n });\n \n client.on('GetAdCountByStation', function(data) {\n\n logEvent('GetAllStations', data);\n onGetAdCountByStation(client, data.stationId);\n });\n}", "_setListeners(callback) {\n this._socket.on('close', hadError => this._onCloseEvent(hadError));\n this._socket.on('error', err => this._onError(err));\n this._socket.setTimeout(this._server.options.socketTimeout || SOCKET_TIMEOUT, () => this._onTimeout());\n this._socket.pipe(this._parser);\n if (!this.needsUpgrade) {\n return callback();\n }\n this.upgrade(() => false, callback);\n }", "function addSocket(socket){\n\n //al.info('adding Socket');\n //console.log(this);\n //var foo = handleQuickJoin.bind(this);\n //var bar = handleCancelQuickJoin.bind(this)\n //socket.removeAllListeners('quick-join');\n //socket.removeAllListeners('cancel-quick-join');\n //socket.on('cancel-quick-join', () => this.handleCancelQuickJoin(socket));\n\n socket.on('quick-join',(msg) => { this.handleQuickJoin(socket,msg)});\n\n}", "subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on_js_1.on(io, \"open\", this.onopen.bind(this)),\n on_js_1.on(io, \"packet\", this.onpacket.bind(this)),\n on_js_1.on(io, \"error\", this.onerror.bind(this)),\n on_js_1.on(io, \"close\", this.onclose.bind(this)),\n ];\n }", "on(eventName, callback) {\n this.socket.on(eventName, callback);\n }", "function addListeners(listeners) {\n config.listeners = __assign({}, listeners);\n window.addEventListener('message', _onParentMessage);\n}", "subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on_1.on(io, \"open\", this.onopen.bind(this)),\n on_1.on(io, \"packet\", this.onpacket.bind(this)),\n on_1.on(io, \"error\", this.onerror.bind(this)),\n on_1.on(io, \"close\", this.onclose.bind(this)),\n ];\n }", "connected(socket) {\n for (let eventName in events) {\n socket.on(eventName, (function (eventName) {\n return function (userdata) {\n events[eventName](socket, userdata);\n };\n })(eventName));\n }\n }", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i]);\n }\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i]);\n }\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i])\n }\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i])\n }\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i])\n }\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i])\n }\n}", "addListener(listener) {\n listeners.push(listener);\n }", "subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on_1.on(io, \"open\", this.onopen.bind(this)),\n on_1.on(io, \"packet\", this.onpacket.bind(this)),\n on_1.on(io, \"error\", this.onerror.bind(this)),\n on_1.on(io, \"close\", this.onclose.bind(this)),\n ];\n }", "listen() {\n let others = this._context._services.get(this.name, this.type).filter(entry => {\n return entry.address == this.address;\n });\n if (others.length) {\n for (let node of others) {\n this.socket.connect(node.address);\n }\n }\n this.socket.bind(this.node.host + ':' + this.port);\n }", "listen(){\n this.namespace.on('connection', (socket)=>{\n socket.on('teacher start exit', (teacherSocketId, quiz) => {\n this.handleStartQuiz(teacherSocketId, quiz);\n });\n\n socket.on('student submit exit', (sessionId, firstname, answersInfo) =>{\n console.log(\"Student\" + firstname);\n console.log(\"Student responded \" + answersInfo);\n this.handleSubmitExit(sessionId,firstname,answersInfo);\n\n })\n });\n }", "setupListenersOnConnect() {\n const { socket } = this;\n\n return new Promise((resolve, reject) => {\n const handleMessage = event => {\n const messageEvent = event;\n //The cast was necessary because Flow's libdef's don't contain\n //a MessageEventListener definition.\n\n if(this.receiveCallbacksQueue.length !== 0) {\n this.receiveCallbacksQueue.shift().resolve(messageEvent.data);\n return;\n }\n\n this.receiveDataQueue.push(messageEvent.data);\n };\n\n const handleOpen = event => {\n socket.addEventListener('message', handleMessage);\n socket.addEventListener('close', event => {\n this.closeEvent = event;\n\n //Whenever a close event fires, the socket is effectively dead.\n //It's impossible for more messages to arrive.\n //If there are any promises waiting for messages, reject them.\n while(this.receiveCallbacksQueue.length !== 0) {\n this.receiveCallbacksQueue.shift().reject(this.closeEvent);\n }\n });\n resolve();\n };\n\n socket.addEventListener('error', reject);\n socket.addEventListener('open', handleOpen);\n });\n }", "function addListeners() {\n\t\t// TODO remove inline comments, just example code.\n\t\t// To attach an event, use one of the following methods.\n\t\t// No need remove the listener in `instance.detached`\n\t\t// instance.addEventListener('click', onClick); //attached to `instance.element`\n\t\t// instance.addEventListener('click', onClick, myEl); //attached to `myEl`\n\t}", "subEvents() {\n if (this.subs) return;\n const io = this.io;\n this.subs = [on_1.on(io, \"open\", this.onopen.bind(this)), on_1.on(io, \"packet\", this.onpacket.bind(this)), on_1.on(io, \"error\", this.onerror.bind(this)), on_1.on(io, \"close\", this.onclose.bind(this))];\n }", "listenForData() {\n this.socket.on(EVENT_DATA, data => this.handleData(data))\n }", "function onEventHandlersChanged() {\n if ((eventHandlers.length > 0) && !eventSocketManager.isStarted) {\n eventSocketManager.start();\n } else if ((eventHandlers.length == 0) && eventSocketManager.isStarted) {\n eventSocketManager.stop();\n }\n }", "_registerSocketListener() {\n this._socket.on('message', (data) => {\n this._mav.parse(data);\n });\n }", "addEventListeners() {\n\t\tthis.bindResize = this.onResize.bind(this);\n\t\twindow.addEventListener('resize', this.bindResize);\n\t\tthis.bindClick = this.onClick.bind(this);\n\t\tEmitter.on('CURSOR_ENTER', this.bindClick);\n\t\tthis.bindRender = this.render.bind(this);\n\t\tTweenMax.ticker.addEventListener('tick', this.bindRender);\n\t\tthis.bindEnter = this.enter.bind(this);\n\t\tEmitter.on('LOADING_COMPLETE', this.bindEnter);\n\t}", "function attachSocketHandlers() {\n socket.on('boardjoin', function (socketdata) {\n console.log(socketdata);\n if (socketdata.success) {\n boardID = socketdata.boardID;\n localStorage[\"cmuopoly_boardID\"] = boardID;\n openGameLobbyScreen($(\"#homeScreen\"), socketdata.gameID);\n }\n else {\n alert(socketdata.message);\n }\n });\n\n\tsocket.on('newplayer', function (socketdata) {\n\t\tgetGameInfo(socketdata.gameID);\n\t});\n\n socket.on('playerleft', function (socketdata) {\n getGameInfo(socketdata.gameID);\n });\n\n socket.on('boardleft', function (socketdata) {\n getGameInfo(socketdata.gameID);\n });\n\n socket.on('hostleft', function (socketdata) {\n alert(\"The host has left the game.\");\n currentGame = undefined;\n openHomeScreen($(\"#gameLobbyScreen\"));\n });\n\n\tsocket.on('gameReady', function () {\n\t\tconsole.log(\"READY.\");\n localStorage[\"cmuopoly_chatLog\"] = \"\";\n localStorage[\"cmuopoly_eventLog\"] = \"\";\n\t\twindow.location = \"/board/monopoly.html\";\n\t});\n}", "function addListeners() {\n browser.runtime.onInstalled.addListener( handleOnInstalledEvent );\n browser.runtime.onMessage.addListener( handleOnMessageEvent );\n}", "addConnectionListener(callback) {\n this.addListener( this.connectionListeners, callback);\n }", "_propagateServerEvents () {\n function socketProperties (socket) {\n const byteSize = require('byte-size')\n const output = {\n bytesRead: byteSize(socket.bytesRead).toString(),\n bytesWritten: byteSize(socket.bytesWritten).toString(),\n remoteAddress: socket.remoteAddress\n }\n if (socket.bufferSize) {\n output.bufferSize = byteSize(socket.bufferSize).toString()\n }\n return output\n }\n\n /* stream connection events */\n const server = this.server\n server.on('connection', socket => {\n this.emit('verbose', 'server.socket.new', socketProperties(socket))\n socket.on('connect', () => {\n this.emit('verbose', 'server.socket.connect', socketProperties(socket))\n })\n socket.on('data', () => {\n this.emit('verbose', 'server.socket.data', socketProperties(socket))\n })\n socket.on('drain', () => {\n this.emit('verbose', 'server.socket.drain', socketProperties(socket))\n })\n socket.on('timeout', () => {\n this.emit('verbose', 'server.socket.timeout', socketProperties(socket))\n })\n socket.on('close', () => {\n this.emit('verbose', 'server.socket.close', socketProperties(socket))\n })\n socket.on('end', () => {\n this.emit('verbose', 'server.socket.end', socketProperties(socket))\n })\n socket.on('error', function (err) {\n this.emit('verbose', 'server.socket.error', err)\n })\n })\n\n server.on('close', () => {\n this.emit('verbose', 'server.close')\n })\n\n /* on server-up message */\n server.on('listening', () => {\n const isSecure = t.isDefined(server.addContext)\n let ipList\n if (this.config.hostname) {\n ipList = [ `${isSecure ? 'https' : 'http'}://${this.config.hostname}:${this.config.port}` ]\n } else {\n ipList = util.getIPList()\n .map(iface => `${isSecure ? 'https' : 'http'}://${iface.address}:${this.config.port}`)\n }\n this.emit('verbose', 'server.listening', ipList)\n })\n\n server.on('error', err => {\n this.emit('verbose', 'server.error', err)\n })\n\n /* emit memory usage stats every 30s */\n const interval = setInterval(() => {\n const byteSize = require('byte-size')\n const memUsage = process.memoryUsage()\n memUsage.rss = byteSize(memUsage.rss).toString()\n memUsage.heapTotal = byteSize(memUsage.heapTotal).toString()\n memUsage.heapUsed = byteSize(memUsage.heapUsed).toString()\n memUsage.external = byteSize(memUsage.external).toString()\n this.emit('verbose', 'process.memoryUsage', memUsage)\n }, 60000)\n interval.unref()\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 }", "onConnect(socket) {\n // When the client emits 'info', this listens and executes\n socket.on('info', data => {\n socket.log(JSON.stringify(data, null, 2));\n });\n\n // Insert sockets below\n require('../api/thing/thing.socket').register(socket);\n }", "addListener(cb) {\n this.listeners.push(cb)\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_js_1.on(socket, \"ping\", this.onping.bind(this)), on_js_1.on(socket, \"data\", this.ondata.bind(this)), on_js_1.on(socket, \"error\", this.onerror.bind(this)), on_js_1.on(socket, \"close\", this.onclose.bind(this)), on_js_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "listen(evento) {\n return this.socket.fromEvent(evento);\n }", "function registerPeerConnectionListeners() {\n peerConnection.addEventListener('icegatheringstatechange', () => {\n console.log(\n `ICE gathering state changed: ${peerConnection.iceGatheringState}`);\n });\n\n peerConnection.addEventListener('connectionstatechange', () => {\n console.log(`Connection state change: ${peerConnection.connectionState}`);\n if (peerConnection.connectionState === 'disconnected') {\n document.querySelector('#remoteVideo').srcObject = null;\n }\n });\n\n peerConnection.addEventListener('signalingstatechange', () => {\n console.log(`Signaling state change: ${peerConnection.signalingState}`);\n });\n\n peerConnection.addEventListener('iceconnectionstatechange ', () => {\n console.log(\n `ICE connection state change: ${peerConnection.iceConnectionState}`);\n });\n}", "initSockets() {\n this.relay.on('requests satisfied', (data) => {\n const sockets = this.channel('relay');\n\n if (!sockets)\n return;\n\n this.to('relay', 'relay requests satisfied', data);\n });\n }", "function _addListeners() {\n window.addEventListener(\"resize\", _onResize);\n window.addEventListener(\"gamepadconnected\", _onGamepadConnected);\n window.addEventListener(\"gamepaddisconnected\", _onGamepadDisconnected);\n }", "listen() {\n /* global ipc */\n ipc.on('search-count', this._searchCoundHandler);\n ipc.on('focus-input', this._focusHandler);\n this.addEventListener('keydown', this._keydownHandler);\n }", "_removeEventListeners () {\n this._socket.removeAllListeners(ConnectionSocket.EVENT_ESTABLISHED)\n this._socket.removeAllListeners(ConnectionSocket.EVENT_CLOSED)\n this._socket.removeAllListeners(ConnectionSocket.EVENT_PEER_CONNECTED)\n this._socket.removeAllListeners(ConnectionSocket.EVENT_PEER_PING)\n this._socket.removeAllListeners(ConnectionSocket.EVENT_PEER_SIGNAL)\n this._rtc.removeAllListeners(ConnectionRTC.EVENT_RTC_SIGNAL)\n this._rtc.removeAllListeners(ConnectionRTC.EVENT_PEER_PING)\n this._rtc.removeAllListeners(ConnectionRTC.EVENT_CLOSED)\n }", "async registerSystemEventListeners () {\n await Collect(this.coreEventListener)\n .map(Listener => {\n return new Listener()\n })\n .concat(\n await this.getSystemEventListeners()\n )\n .forEach(listener => {\n this.registerListeners(listener.on(), listener)\n })\n }", "function proxySocket() {\n\t\tproxyEvents.forEach(function(event){\n\t\t\tsocket.on(event, function(data) {\n\t\t\t\tamplify.publish('socket:'+event, data || null);\n\t\t\t});\n\t\t});\n\t\tsocket.on('connect', function() {\n\t\t\tsocket.emit('subscribe', user.token);\n\t\t\tamplify.publish('socket:connect');\n\t\t});\n\t\n\t}", "listen() {\r\n this.client.on('message', message => this.onMessage(message));\r\n }", "async discoverEventsAndListeners () {\n await this.registerUserEvents()\n await this.registerSystemEventListeners()\n }", "attachListeners() {\n }", "function addListeners() {\n browser.runtime.onInstalled.addListener(handleInstall);\n browser.runtime.onMessage.addListener(handleMessage);\n browser.alarms.onAlarm.addListener(handleAlarms);\n}", "setupHandlers () {\n this.rs.on('connected', () => this.eventHandler('connected'));\n this.rs.on('ready', () => this.eventHandler('ready'));\n this.rs.on('disconnected', () => this.eventHandler('disconnected'));\n this.rs.on('network-online', () => this.eventHandler('network-online'));\n this.rs.on('network-offline', () => this.eventHandler('network-offline'));\n this.rs.on('error', (error) => this.eventHandler('error', error));\n\n this.setEventListeners();\n this.setClickHandlers();\n }", "subscribeTo(event, callback) {\n this.socket.on(event, callback);\n }", "function handleClientEvents(socket) {\n socket.on(\"start\", function(data) {\n processStart(socket, data);\n });\n\n socket.on(\"stop\", function(data) {\n processStop(socket, data);\n });\n}", "addListener(listener) {\n this.listeners.push(listener);\n }", "addListener(listener) {\n this.listeners.push(listener);\n }", "function listenForClients () {\n\n // call listen method\n listen({ event: \"connection\" }, function (client) {\n\n // add the client to the global client hash\n clients[client.id] = client;\n\n // sockets.server.send\n listen({\n event: \"sockets.server.send\",\n client: client\n }, function (options) {\n M.emit(\"sockets.send\", options);\n });\n\n // sockets.server.emitGlobal\n listen({\n event: \"sockets.server.emitGlobal\",\n client: client\n }, function (options) {\n M.emit(options.event, options.data);\n });\n\n // if we have a session, add the client to thi session as well\n if (client.handshake.headers.cookie) {\n\n var match = client.handshake.headers.cookie.match(/_s=(.*);/);\n if (match && match[1]) {\n\n // get the session id and its clients\n var sid = match[1]\n , sessionClients = sessions[sid] || []\n ;\n\n // push the new client id\n sessionClients.push(client.id);\n\n // set the clients of the session in the sessions object\n sessions[sid] = sessionClients;\n }\n }\n });\n}", "createEvents() {\n let connection = this;\n let socket = connection.socket;\n let server = connection.server;\n let player = connection.player;\n\n socket.on('disconnect', function () {\n server.onDisconnected(connection);\n });\n\n socket.on('joinGame', function () {\n server.onAttemptToJoinGame(connection);\n });\n\n socket.on('fireBullet', function (data) {\n connection.lobby.onFireBullet(connection, data);\n });\n\n socket.on('collisionDestroy', function (data) {\n connection.lobby.onCollisionDestroy(connection, data);\n });\n\n socket.on('updatePosition', function (data) {\n player.position.x = String(data.position.x);\n player.position.y = String(data.position.y);\n player.position.z = String(data.position.z);\n\n socket.broadcast.to(connection.lobby.id).emit('updatePosition', player);\n });\n\n socket.on('updateRotation', function (data) {\n player.rotation = String(data.rotation);\n player.barrelRotation = String(data.barrelRotation);\n \n socket.broadcast.to(connection.lobby.id).emit('updateRotation', player);\n });\n }", "function setupListeners () {\n\t\tvar btn= document.getElementById('ws');\n\t\tbtn.addEventListener('click', yet.track, false);\n\t}", "onopen() {\n debug(\"open\"); // clear old subs\n\n this.cleanup(); // mark as open\n\n this._readyState = \"open\";\n this.emitReserved(\"open\"); // add new subs\n\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "setTransportListeners() {\n this.transport.on(\"connected\", () => this.onTransportConnected());\n this.transport.on(\"message\", (message) => this.onTransportReceiveMsg(message));\n this.transport.on(\"transportError\", () => this.onTransportError());\n }", "_listen() {\n let onExit = () => {\n this._log('exit signal');\n\n this._exit();\n };\n\n let onMessage = (data) => {\n if (data && data.event === SIGNAL_OUT_OF_MEMORY) {\n this.rotate();\n }\n\n this.emit('message', data);\n };\n\n let onDisconnect = () => {\n this._log('disconnect signal');\n\n if (!this.started || this._disconnecting) {\n return;\n }\n\n this._exit();\n };\n\n let onClose = () => {\n this._log('close signal');\n };\n\n this.worker.on('exit', onExit);\n this.worker.on('message', onMessage);\n this.worker.on('disconnect', onDisconnect);\n this.worker.on('close', onClose);\n }", "initMessageHandlers() {\n Object.keys(this.topics).forEach(key => this.subscriberSocket.subscribe(this.topics[key]));\n this.subscriberSocket.on('message', this.emit.bind(this));\n }", "on(event, cb) {\n this.conn.on(event, cb);\n }", "addEventListener (f) {\n this.eventListeners.push(f)\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "function _on (event, listener) {\n if (typeof _events[event] !== 'object') {\n _events[event] = [];\n }\n\n _events[event].push(listener);\n }", "constructor() {\n this.socketEventList = [];\n this.asyncExtensionList = [];\n this.extensions = {};\n this.setupSocket();\n }", "_onListening() {\n /* Called after socket.bind */\n let address = this.socket.address()\n log.info(`server listening ${address.address}:${address.port}`)\n }", "function addEventListener (type, callback) {\n wsEmitter.addListener(type, callback)\n}", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this.readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"data\", component_bind_1.default(this, \"ondata\")));\n this.subs.push(on_1.on(socket, \"ping\", component_bind_1.default(this, \"onping\")));\n this.subs.push(on_1.on(socket, \"error\", component_bind_1.default(this, \"onerror\")));\n this.subs.push(on_1.on(socket, \"close\", component_bind_1.default(this, \"onclose\")));\n this.subs.push(on_1.on(this.decoder, \"decoded\", component_bind_1.default(this, \"ondecoded\")));\n }" ]
[ "0.75131446", "0.7479154", "0.74326223", "0.74268484", "0.74268484", "0.73286813", "0.7311246", "0.71748644", "0.7126428", "0.70855176", "0.7031225", "0.69963765", "0.69505674", "0.69198656", "0.68633825", "0.68372756", "0.68357515", "0.68356156", "0.6687739", "0.6685014", "0.66736233", "0.65380037", "0.6527775", "0.65255314", "0.6487814", "0.6471209", "0.64594555", "0.63718534", "0.63649094", "0.6363803", "0.6318241", "0.63098514", "0.62956804", "0.62875384", "0.6279091", "0.6270179", "0.62545216", "0.62540066", "0.6251596", "0.62413996", "0.6223563", "0.62207675", "0.6214487", "0.62053996", "0.62053996", "0.6204144", "0.6204144", "0.6204144", "0.6204144", "0.6189401", "0.61818075", "0.6181538", "0.6154997", "0.61476755", "0.6144157", "0.6120827", "0.6109308", "0.6086386", "0.6066341", "0.60609466", "0.60510457", "0.60408014", "0.6033446", "0.6018215", "0.60081375", "0.5998057", "0.5997282", "0.59888756", "0.5988349", "0.59880733", "0.5986657", "0.5982313", "0.5981972", "0.5972494", "0.59721553", "0.5970781", "0.59661925", "0.59640527", "0.5956799", "0.59551865", "0.5944829", "0.5941493", "0.594016", "0.5933544", "0.5933544", "0.59321654", "0.59320277", "0.5930911", "0.59245855", "0.59166723", "0.5914153", "0.59081614", "0.59040636", "0.588929", "0.58838445", "0.58822453", "0.58805174", "0.58762056", "0.5870837", "0.5868987" ]
0.7204242
7
Generates uri for connection.
uri() { let query = this.query || {}; const schema = this.opts.secure ? "wss" : "ws"; let port = ""; // avoid port if default for schema if (this.opts.port && ("wss" === schema && Number(this.opts.port) !== 443 || "ws" === schema && Number(this.opts.port) !== 80)) { port = ":" + this.opts.port; } // append timestamp to URI if (this.opts.timestampRequests) { query[this.opts.timestampParam] = yeast(); } // communicate binary support capabilities if (!this.supportsBinary) { query.b64 = 1; } query = parseqs.encode(query); // prepend ? to query if (query.length) { query = "?" + query; } const ipv6 = this.opts.hostname.indexOf(":") !== -1; return schema + "://" + (ipv6 ? "[" + this.opts.hostname + "]" : this.opts.hostname) + port + this.opts.path + query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen_url (connection, collection) {\n\tvar config = connections.connections[connection];\n\tvar url = config.URI;\n\n\turl += '/' + config.orgName + '/' + config.appName + '/' + collection + '?';\n\n\treturn url;\n}", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = (0, yeast_1.default)();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n const encodedQuery = parseqs_1.default.encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n const encodedQuery = encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast_1();\n }\n\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n const encodedQuery = encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = (0, yeast_1.default)();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n const encodedQuery = parseqs_1.default.encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "get URI() {\n\t\treturn 'exchange://' + this.username + '@' + this.hostname + this.name;\n\t}", "function constructIgUri(igServer){\n var uri = \"\";\n\n uri = igServer.protocol + \"://\" + igServer.host\n\n return uri;\n}", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\"; // cache busting is forced\n\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query); // avoid port if default for schema\n\n if (this.opts.port && (\"https\" === schema && Number(this.opts.port) !== 443 || \"http\" === schema && Number(this.opts.port) !== 80)) {\n port = \":\" + this.opts.port;\n } // prepend ? to query\n\n\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return schema + \"://\" + (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) + port + this.opts.path + query;\n }", "buildUrl() {\n let url = this.hostname;\n\n if (this.port !== 80) {\n url += ':' + this.port;\n }\n\n let path = this.path;\n if (path.substring(0, 1) !== '/') {\n path = '/' + path;\n }\n\n url += path;\n\n url = replaceUrlParams(url, this.givenArgs);\n url = url.replace('//', '/');\n url = 'https://' + url;\n return url;\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast_1();\n }\n\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query);\n\n // avoid port if default for schema\n if (\n this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))\n ) {\n port = \":\" + this.opts.port;\n }\n\n // prepend ? to query\n if (query.length) {\n query = \"?\" + query;\n }\n\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (\n schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n query\n );\n }", "function _createURL()\n { var arr\n\n if(arguments.length === 1) arr=arguments[0]\n else arr = arguments\n\n var url = _transaction.server.location\n\n // arr:['route', 'article', 54 ] => str:\"/route/article/54\"\n for (var i=0; i<arr.length; i++){\n url += '/';\n if (arr[i] in _transaction.server)\n url += _transaction.server[arr[i]];\n else if (arr[i]+'Path' in _transaction.server)\n url += _transaction.server[arr[i]+'Path'];\n else\n url += arr[i]\n }\n\n return url;\n }", "function _getEndpointUri(endpoint) {\n return _endpoint.gebo + _endpoint[endpoint];\n }", "function createCompleteUri(uri) {\n // Add the passed parameter to the base\n return ApiUrlBase + uri;\n}", "function makeUrl() {\n let args = Array.from(arguments);\n return args.reduce(function (acc, cur) {\n return urljoin(acc, cur);\n });\n}", "getUri() {\n return super.getAsString(\"uri\");\n }", "function makeUri(u) {\n\t var uri = ''\n\t if (u.protocol) {\n\t uri += u.protocol + '://'\n\t }\n\t if (u.user) {\n\t uri += u.user\n\t }\n\t if (u.password) {\n\t uri += ':' + u.password\n\t }\n\t if (u.user || u.password) {\n\t uri += '@'\n\t }\n\t if (u.host) {\n\t uri += u.host\n\t }\n\t if (u.port) {\n\t uri += ':' + u.port\n\t }\n\t if (u.path) {\n\t uri += u.path\n\t }\n\t var qk = u.queryKey\n\t var qs = []\n\t for (var k in qk) {\n\t if (!qk.hasOwnProperty(k)) {\n\t continue\n\t }\n\t var v = encodeURIComponent(qk[k])\n\t k = encodeURIComponent(k)\n\t if (v) {\n\t qs.push(k + '=' + v)\n\t }\n\t else {\n\t qs.push(k)\n\t }\n\t }\n\t if (qs.length > 0) {\n\t uri += '?' + qs.join('&')\n\t }\n\t if (u.anchor) {\n\t uri += '#' + u.anchor\n\t }\n\t return uri\n\t}", "function makeUrl() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.reduce(function (acc, cur) { return url_join_1[\"default\"](acc, cur); });\n}", "function buildUrl(schema) {\n return function (domain, path) {\n console.log(`${schema}://${domain}/${path}`); \n }\n }", "get url() {\n return createUserUri(this.database.id, this.id);\n }", "get_url() {\n\t\treturn config.zeromq.proto + '://' + config.zeromq.host + ':' + config.zeromq.port;\n\t}", "function generateWsUrl() {\n var self = this;\n var port = getPort.call(this);\n var protocol = self.parameters.secure ? 'wss' : 'ws';\n return URL.format({\n 'slashes': true,\n 'protocol': protocol,\n 'hostname': self.parameters.host,\n 'port': port,\n 'pathname': self.parameters.path,\n 'query': self.parameters.query\n });\n}", "function _getConnectionURL(info) {\n var context = info.registrationContext;\n var scheme = context.https ? \"https\" : \"http\";\n var host = context.serverHost + \":\" + context.serverPort;\n var path = (context.resourcePath.length > 0 && context.resourcePath != 'null' && context.farmId.length > 0 && context.farmId!= 'null') ? (context.resourcePath + \"/\" + context.farmId + \"/\") : \"\";\n return scheme + \"://\" + host + \"/\" + path + \"odata/applications/v1/\" + sap.Logon.applicationId + \"/Connections('\" + info.applicationConnectionId + \"')\";\n }", "function create_url(endpoint) {\n // TODO: ここを書き換えてURL作る\n // return '/api/guchi' + endpoint\n return URL_BASE + '/deai/' + endpoint;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n }", "function gen_url(object){\n var server = config.get('api_conf.server');\n var port = config.get('api_conf.port');\n var version = config.get('api_conf.version');\n var account = config.get('api_conf.account');\n\n url = \"http://\" + server + \":\" + port + \"/\" + version + \"/\" + account \n //Check if the container/object exist, if they exist \n //concatenate it to the url variable \n if(config.has('api_conf.container')){\n url += \"/\" + config.get('api_conf.container'); \n } \n if(config.has('api_conf.object')){\n url += \"/\" + config.get('api_conf.object');\n }\n url += object; \n\n return url;\n}", "function genUrl(opts, path) {\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t var pathDel = !opts.path ? '' : '/';\n\t\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t return opts.protocol + '://' + opts.host +\n\t (opts.port ? (':' + opts.port) : '') +\n\t '/' + opts.path + pathDel + path;\n\t}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n if (opts.remote) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host + ':' + opts.port + '/' +\n opts.path + pathDel + path;\n }\n\n return '/' + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host + ':' + opts.port + '/' +\n opts.path + pathDel + path;\n}", "function genUrl(opts, path$$1) {\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t var pathDel = !opts.path ? '' : '/';\n\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t return opts.protocol + '://' + opts.host +\n\t (opts.port ? (':' + opts.port) : '') +\n\t '/' + opts.path + pathDel + path$$1;\n\t}", "uri() {\n return [\n (this.endpoint() || ''),\n (this.exists() ? this.id() : null)\n ]\n .filter(value => !!value)\n .concat([].slice.call(arguments))\n .map(part => { \n Object.entries(this.attributes)\n .forEach(([key, value]) => {\n part = part.toString().replace(new RegExp(`\\:${key}`), value);\n });\n\n return part;\n })\n .join('/');\n }", "getUri(config) {\n if (typeof config === 'string') {\n return config;\n }\n if (_1.isSeederDatabaseConfigObject(config)) {\n return this.getDbConnectionUri(config);\n }\n throw new Error('Connection URI or database config object is required to connect to database');\n }", "buildURL(){\n var url = this._super(...arguments);\n if (url.lastIndexOf('/') !== url.length - 1) {\n url += '/';\n }\n return url;\n }", "toString() {\n let result = \"\";\n if (this._scheme) {\n result += `${this._scheme}://`;\n }\n if (this._host) {\n result += this._host;\n }\n if (this._port) {\n result += `:${this._port}`;\n }\n if (this._path) {\n if (!this._path.startsWith(\"/\")) {\n result += \"/\";\n }\n result += this._path;\n }\n if (this._query && this._query.any()) {\n result += `?${this._query.toString()}`;\n }\n return result;\n }", "toString() {\n let result = \"\";\n if (this._scheme) {\n result += `${this._scheme}://`;\n }\n if (this._host) {\n result += this._host;\n }\n if (this._port) {\n result += `:${this._port}`;\n }\n if (this._path) {\n if (!this._path.startsWith(\"/\")) {\n result += \"/\";\n }\n result += this._path;\n }\n if (this._query && this._query.any()) {\n result += `?${this._query.toString()}`;\n }\n return result;\n }", "get uri() {\n return this._uri;\n }", "async function getUri() {\n /* istanbul ignore if */\n if (isValidUri(uri)) {\n return uri;\n }\n if (server) {\n return _uri(server);\n }\n process.chdir(`${__dirname}/../public`);\n server = http.createServer(handler);\n const listen = promisify(server.listen.bind(server));\n await listen();\n return _uri(server);\n}", "function _getConnectionURLForRegistration(info) {\n var context = info.registrationContext;\n var scheme = context.https ? \"https\" : \"http\";\n var host = context.serverHost + \":\" + context.serverPort;\n var path = (context.resourcePath.length > 0 && context.farmId.length > 0) ? (context.resourcePath + \"/\" + context.farmId + \"/\") : \"\";\n return scheme + \"://\" + host + \"/\" + path + \"odata/applications/v1/\" + sap.Logon.applicationId + \"/Connections\";\n }", "static stringURI(uriobj) {\nvar res;\nres = uriobj.path;\nif (uriobj != null ? uriobj.authority : void 0) {\nres = \"//\" + uriobj.authority + res;\n}\nif (uriobj != null ? uriobj.scheme : void 0) {\nres = uriobj.scheme + \":\" + res;\n}\nif (uriobj.query != null) {\nres += \"?\" + uriobj.query;\n}\nreturn res;\n}", "get uri() {\n\t\treturn this.__uri;\n\t}", "get uri() {\n\t\treturn this.__uri;\n\t}", "get uri() {\n\t\treturn this.__uri;\n\t}", "function generateURL(){\n\tbroadcastURL.innerHTML = baseURL+senderID;\n}", "get uri () {\n\t\treturn this._uri;\n\t}", "getDbConnectionUri({ protocol, host, port, name, username, password, options, }) {\n const credentials = username\n ? `${username}${password ? `:${password}` : ''}@`\n : '';\n const optsUriPart = options\n ? `?${new url_1.URLSearchParams(options).toString()}`\n : '';\n const portUriPart = protocol !== 'mongodb+srv' ? `:${port}` : '';\n return `${protocol}://${credentials}${host}${portUriPart}/${name}${optsUriPart}`;\n }", "function makeUrl(protocol, host, resource, id) {\n return protocol + \"://\" + host + resource + id;\n}", "get url() {\n return createDocumentCollectionUri(this.database.id, this.id);\n }", "function buildMongoUrl() {\n var mongoUrl = 'mongodb://' + c.db.username + ':' + c.db.password + '@' + c.db.host + ':' + c.db.port + '/' + c.db.database + '?auto_reconnect=true&safe=true';\n return mongoUrl;\n }", "function get_uri(name, title, operation, fields, category_item, insertedId, show_all) {\n \n var uri;\n if (insertedId == null) {\n uri = 'http://localhost:9000/erp/' + category_item;\n }\n else if (show_all) {\n uri = 'http://localhost:9000/erp/' + category_item;\n }\n else {\n \n uri = 'http://localhost:9000/erp/' + category_item + '/' + insertedId;\n }\n \n var return_uri = {\n \"name\": name,\n \"title\": title,\n \"method\": operation,\n \"href\": uri,\n \"type\": \"application/x-www-form-urlencoded\",\n \"fields\": fields\n };\n \n return return_uri;\n\t\n}", "getRoomURL() {\n return location.protocol + \"//\" + location.host + (location.path || \"\") + \"?room=\" + this.getRoom();\n }", "function generateEndpointURL () {\n var querystring = $.param({\n advisor_profile_id: this[options.advisorIdAttribute],\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return routes('back_office_availabilities', { format: 'json' }) + '?' + querystring;\n }", "function generateURI(hxlClass) {\n var arr = hxlClass.split(\"#\");\n if (arr.length == 2) {\n var shortClass = arr[1];\n } else {\n var shortClass = hxlClass;\n }\n var now = new Date();\n // we'll use the time stamp as the unique part of the URI for the time being.\n var id = now.getTime();\n var URI = \"http://hxl.carsten.io/\" + shortClass.toLowerCase() + \"/\" + id;\n return URI;\n}", "function generateCouchDBURL(options) {\n options.hostname = (options.hostname || options.host || '127.0.0.1');\n options.protocol = options.protocol || 'http';\n options.port = (options.port || 5984);\n\n return options.protocol + '://' + options.hostname + ':' + options.port;\n}", "function createUrl(item) {\n var urlObj = {\n protocol: config.HOST.protocol,\n slashes: config.HOST.slashes,\n auth: config.HOST.auth,\n host: config.HOST.host,\n hostname: config.HOST.hostname,\n hash: config.HOST.hash,\n query: item,\n pathname: config.HOST.pathname\n }\n var urlString = url.format(urlObj);\n return urlString\n}", "function generateEndpointURL () {\n var querystring = $.param({\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return routes('sliced_back_office_advisor_profile_availabilities', {\n advisor_profile_id: this[options.advisorIdAttribute],\n format: 'json'\n }) + '?' + querystring;\n }", "function generateEndpointURL () {\n var querystring = $.param({\n advisor_profile_id: this[options.advisorIdAttribute],\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return API_ENDPOINT + '?' + querystring;\n }", "function generateURL() {\r\n var cisRoot = getTopNavApplicationUrl(\"CIS\");\r\n if (!cisRoot) {\r\n // retrieve the web context root for current application\r\n var appPath = getAppPath();\r\n // pick up the parent context root\r\n var parentContextRoot = appPath.replace(/\\/[^\\/]+$/,'');\r\n // infer the context url for eClaim\r\n cisRoot = parentContextRoot + \"/\" + \"CIS\";\r\n }\r\n return cisRoot;\r\n}", "_buildURL(url, options = {}) {\n if ((0, _urlHelpers.isFullURL)(url)) {\n return url;\n }\n const urlParts = [];\n let host = options.host || Ember.get(this, 'host');\n if (host) {\n host = stripSlashes(host);\n }\n urlParts.push(host);\n let namespace = options.namespace || Ember.get(this, 'namespace');\n if (namespace) {\n namespace = stripSlashes(namespace);\n urlParts.push(namespace);\n }\n // If the URL has already been constructed (presumably, by Ember Data), then we should just leave it alone\n const hasNamespaceRegex = new RegExp(`^(/)?${namespace}/`);\n if (namespace && hasNamespaceRegex.test(url)) {\n return url;\n }\n // *Only* remove a leading slash -- we need to maintain a trailing slash for\n // APIs that differentiate between it being and not being present\n if (startsWithSlash(url)) {\n url = removeLeadingSlash(url);\n }\n urlParts.push(url);\n return urlParts.join('/');\n }", "getEndpointUrl() {\n let path = super.getEndpointUrl();\n if (!path.startsWith('/')) {\n path = '/' + path;\n }\n const protocol = getWebsocketProtocol();\n const host = window.location.hostname;\n const port = window.location.port;\n return `${protocol}//${host}:${port}${path}`;\n }", "address() {\n const address = this.server.address();\n const endpoint = typeof address !== \"string\"\n ? (address.address === \"::\" ? \"localhost\" : address.address) + \":\" + address.port\n : address;\n return `${this.protocol}://${endpoint}`;\n }", "function createURL() {\n var query_url = api_url.concat(patientID,auth,accessToken);\n actualQuery();\n }", "function constructTheUrl(i) {\n let url = host + path + lang + \"dguid=\" + geoCSV[i] + \"&\" + topic + notes;\n return url;\n }", "function getUri()/*:URI*/ {\n return this._uri$aqE4;\n }", "get uri() {\n return this.uri_;\n }", "function set_uri(nslocal){\r\n\t\treturn (snorql._namespaces[nslocal[0]] || \"\") + nslocal[1];\r\n\t}", "function newURI(spec) {\n var ioServ = Cc[\"@mozilla.org/network/io-service;1\"].\n getService(Ci.nsIIOService);\n return ioServ.newURI(spec, null, null);\n}", "function getSocketURI () {\n var protocol = (window.location.protocol === 'https:') ? 'wss' : 'ws'\n return `${protocol}://${window.location.host}/ws`\n}", "buildUrlEndpoint(action) {\n\t\t\tconst host = this._configuration.getDomain() + '/api/Bookmark/'\n\t\t\tconst endpoint = action || '';\n\t\t\treturn host + endpoint;\n\t\t}", "function generateURL(host, protocol, resourceType) {\n var url = new URL(\"http://{{host}}:{{ports[https][0]}}/common/security-features/subresource/\");\n url.protocol = protocol == Protocol.INSECURE ? \"http\" : \"https\";\n url.hostname = host == Host.SAME_ORIGIN ? \"{{host}}\" : \"{{domains[天気の良い日]}}\";\n\n if (resourceType == ResourceType.IMAGE) {\n url.pathname += \"image.py\";\n } else if (resourceType == ResourceType.FRAME) {\n url.pathname += \"document.py\";\n } else if (resourceType == ResourceType.WEBSOCKET) {\n url.port = {{ports[wss][0]}};\n url.protocol = protocol == Protocol.INSECURE ? \"ws\" : \"wss\";\n url.pathname = \"echo\";\n } else if (resourceType == ResourceType.WORKER) {\n url.pathname += \"worker.py\";\n } else if (resourceType == ResourceType.WORKLET) {\n url.pathname += \"worker.py\";\n } else if (resourceType == ResourceType.FETCH) {\n url.pathname += \"xhr.py\";\n }\n return {\n name: protocol + \"/\" + host + \" \" + resourceType,\n url: url.toString()\n };\n}", "function makeURI(name, type){\n\tif (name.indexOf(\"http://\") != 0){\n\t\tvar fragment = name.replace(/\\s+/g, '_'); // replace whitespaces\n\t\tname = \"http://hxl.carsten.io/\"+type.toLowerCase()+\"/\" + fragment.toLowerCase();\t\t\n\t}\t\n\treturn name;\n}", "function repoInfoConnectionURL(repoInfo, type, params) {\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(typeof type === 'string', 'typeof type must == string');\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(typeof params === 'object', 'typeof params must == object');\n var connURL;\n if (type === WEBSOCKET) {\n connURL =\n (repoInfo.secure ? 'wss://' : 'ws://') + repoInfo.internalHost + '/.ws?';\n }\n else if (type === LONG_POLLING) {\n connURL =\n (repoInfo.secure ? 'https://' : 'http://') +\n repoInfo.internalHost +\n '/.lp?';\n }\n else {\n throw new Error('Unknown connection type: ' + type);\n }\n if (repoInfoNeedsQueryParam(repoInfo)) {\n params['ns'] = repoInfo.namespace;\n }\n var pairs = [];\n each(params, function (key, value) {\n pairs.push(key + '=' + value);\n });\n return connURL + pairs.join('&');\n}", "function getURI() {\n return request([{\n \"name\": \"uri\",\n \"src\": \"../lib/uri/uri.js\",\n \"shim\": true\n }, {\n \"name\": \"util\",\n \"src\": \"../lib/src/util.js\"\n }, {\n \"name\": \"template\",\n \"src\": \"../lib/uritemplate/uritemplate.js\",\n \"shim\": true\n }]);\n }", "static REMOTE_SERVER_URL(collection, parameter, urlParametersAsString) {\n\t\tconst port = 1337;\n\t\tlet url = `http://localhost:${port}/${collection}/`;\n\t\tif (parameter) {\n\t\t\turl += `${parameter}/`;\n\t\t}\n\t\tif (urlParametersAsString) {\n\t\t\turl += `?${urlParametersAsString}`;\n\t\t}\n\t\treturn url;\n\t}", "function modifyTourUri(){\n\t\tserverUri = Parameters.getTourServerUri() + \"/path\";\n\t}", "function createUrl(val){\n return `http://localhost:3000/api/${val}`;\n \n}", "function generateURL(host, protocol, resourceType) {\n var url = new URL(\"http://{{host}}:{{ports[https][0]}}/upgrade-insecure-requests/support/\");\n url.protocol = protocol == Protocol.INSECURE ? \"http\" : \"https\";\n url.hostname = host == Host.SAME_ORIGIN ? \"{{host}}\" : \"{{domains[天気の良い日]}}\";\n\n if (resourceType == ResourceType.IMAGE) {\n url.pathname += \"pass.png\";\n } else if (resourceType == ResourceType.FRAME) {\n url.pathname += \"post-origin-to-parent.html\";\n } else if (resourceType == ResourceType.WEBSOCKET) {\n url.port = {{ports[wss][0]}};\n url.protocol = protocol == Protocol.INSECURE ? \"ws\" : \"wss\";\n url.pathname = \"echo\";\n }\n return {\n name: protocol + \"/\" + host + \" \" + resourceType,\n url: url.toString()\n };\n}", "function ThetaUri() {\n this.base = 'http://192.168.1.1/osc';\n this.execute = this.base + '/commands/execute';\n this.info = this.base + '/info';\n this.state = this.base + '/state';\n}", "function setURL() {\n var proto;\n var url;\n var port;\n if (window.location.protocol == \"http:\") {\n proto = \"ws://\";\n port = \"8080\";\n } else {\n proto = \"wss://\";\n port = \"8443\";\n }\n\n url = proto + window.location.hostname + \":\" + port;\n return url;\n}", "function getConnectionUrl(auth) {\n return auth.generateAuthUrl({\n access_type: 'offline',\n prompt: 'consent', // added new refresh token when sign In\n scope: scopes\n });\n}", "function getConnectionUrl(auth) {\r\n return auth.generateAuthUrl({\r\n access_type: 'offline',\r\n prompt: 'consent', // access type and approval prompt will force a new refresh token to be made each time signs in\r\n scope: defaultScope\r\n });\r\n}", "buildURL(modelName, id, snapshot, requestType) {\n if (requestType === 'createRecord') {\n return `${this.get('host')}/${this.get('namespace')}/users/${id}`;\n }\n return this._super(...arguments);\n }", "function getRoomURL() {\n\treturn location.protocol + \"//\" + location.host + (location.pathname || \"\") + \"?room=\" + getRoom();\n}", "function setupEndpoint() {\n if (host.val().indexOf('/') != -1) {\n var hostArr = host.val().split('/');\n\n path = \"http://\" + hostArr[0] + \":\" + port.val();\n hostArr.shift(); // remove host\n\n if (hostArr.length > 0) { // anything left?\n path += \"/\" + hostArr.join('/');\n }\n } else {\n path = \"http://\" + host.val() + \":\" + port.val();\n }\n endpoint = path;\n }", "function getShortURL () {\n\t//base 36 characters\n\tvar alphanumeric = ['0','1','2','3','4','5','6','7','8','9','A','B',\n\t\t\t\t\t\t'C','D','E','F','G','H','I','J','K','L','M','N',\n\t\t\t\t\t\t'O','P','Q','R','S','T','U','V','W','X','Y','Z'];\n\tvar urlString = \"http://localhost:3000/\";\n\tfor (i = 0; i < 4; i++) {\n\t\tvar num = randomNum(0,35);\n\t\turlString = urlString + alphanumeric[num];\n\t}\n\n\treturn urlString;\n}", "function urlMaker() {\n url_string = \"\"\n\n // adding the first character\n url_string = url_string.concat(\"?\")\n\n // concatinating the filternames\n configSet.filters.forEach(element => {\n url_string = url_string.concat('filter_name_list=', element, '&')\n })\n\n // concatinating the thresholds\n configSet.confidence_thresholds.forEach(element => {\n url_string = url_string.concat('confidence_threshold_list=', element, '&')\n })\n\n // concatinating the column name\n url_string = url_string.concat('column_name=', configSet.col_name, '&')\n\n // concatinating the CSV URL/Path\n url_string = url_string.concat('csv_url=', encodeURIComponent(configSet.csv_url))\n\n // remove the extra & sign in the loop\n // url_string = url_string.slice(0, -1)\n return url_string\n}", "function generateUrl(el) {\n\tvar generatedUrl = assembleUrl();\n\n\t// ADD TO CLIPBOARD add it to the dom\n\tcopyToClipboard(generatedUrl);\n\tdomElements.wrapperUrl.el.html(generatedUrl);\n}", "function makeurl( path ) {\n if (path.indexOf(\"://\") > 0) return path;\n return url + \"/\" + path;\n }" ]
[ "0.7223226", "0.7173111", "0.7164633", "0.6994125", "0.6994125", "0.698464", "0.6882258", "0.6788025", "0.6628015", "0.6628015", "0.6620066", "0.6599762", "0.6565206", "0.6552466", "0.6522966", "0.6422189", "0.63868827", "0.6358184", "0.62283826", "0.61361", "0.6063683", "0.6060825", "0.6048767", "0.6046379", "0.60071856", "0.6005793", "0.5968925", "0.5929022", "0.5913362", "0.590083", "0.58788455", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5843661", "0.5837794", "0.5830228", "0.5824697", "0.58042806", "0.58020896", "0.5797031", "0.57294536", "0.57294536", "0.5712802", "0.571239", "0.57043153", "0.5694431", "0.5683867", "0.5683867", "0.5683867", "0.5652418", "0.5624428", "0.56165296", "0.557432", "0.5570544", "0.5555782", "0.5550228", "0.5519366", "0.551546", "0.5510629", "0.55062187", "0.54964745", "0.54940367", "0.54903144", "0.548056", "0.5477829", "0.54680043", "0.5466008", "0.54537356", "0.5453158", "0.5429723", "0.5426097", "0.5415555", "0.541085", "0.54105854", "0.53904843", "0.53843105", "0.5377936", "0.5376961", "0.5367312", "0.53537095", "0.5325861", "0.5322013", "0.53184915", "0.531315", "0.53007394", "0.5291907", "0.52915454", "0.5288254", "0.5281941", "0.5280429", "0.5272207", "0.5267167", "0.52612066", "0.5259047" ]
0.6877759
7
Copyright 2013present, 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. Mostly taken from ReactPropTypes.
function createChainableTypeChecker(validate) { function checkType(isRequired, props, propName, componentName, location, propFullName) { var componentNameSafe = componentName || '<<anonymous>>'; var propFullNameSafe = propFullName || propName; if (props[propName] == null) { if (isRequired) { return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.')); } return null; } for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) { args[_key - 6] = arguments[_key]; } return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args)); } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get propTypes() {\n return {\n config: React.PropTypes.object,\n test: React.PropTypes.string,\n };\n }", "function isReactPropTypes(path) {\n return (\n (path.node.object.type === 'MemberExpression' &&\n path.node.object.object &&\n path.node.object.object.name === 'PropTypes') || (\n path.node.object.name === 'PropTypes' && !path.node.object.object)\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 get propTypes() { \n return {\n error: PropTypes.bool,\n title: PropTypes.string,\n stats: PropTypes.number,\n statsSymbol: PropTypes.string,\n footerInfo: PropTypes.object,\n }; \n }", "function shim() {\n invariant(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 }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function shim() {\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n }", "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\r\n\t var propType = typeof propValue;\r\n\t if (Array.isArray(propValue)) {\r\n\t return 'array';\r\n\t }\r\n\t if (propValue instanceof RegExp) {\r\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\r\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\r\n\t // passes PropTypes.object.\r\n\t return 'object';\r\n\t }\r\n\t if (isSymbol(propType, propValue)) {\r\n\t return 'symbol';\r\n\t }\r\n\t return propType;\r\n\t}", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t}", "function getPropType(propValue) {\n\t\t var propType = typeof propValue;\n\t\t if (Array.isArray(propValue)) {\n\t\t return 'array';\n\t\t }\n\t\t if (propValue instanceof RegExp) {\n\t\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t // passes PropTypes.object.\n\t\t return 'object';\n\t\t }\n\t\t if (isSymbol(propType, propValue)) {\n\t\t return 'symbol';\n\t\t }\n\t\t return propType;\n\t\t}", "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n}", "function getPropType(propValue) {\n\t var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof$1(propValue);\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }", "function getPropType(propValue) {\n\t\t\t\t\t\tvar propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);\n\t\t\t\t\t\tif (Array.isArray(propValue)) {\n\t\t\t\t\t\t\treturn 'array';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (propValue instanceof RegExp) {\n\t\t\t\t\t\t\t// Old webkits (at least until Android 4.0) return 'function' rather than\n\t\t\t\t\t\t\t// 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t\t\t\t\t\t\t// passes PropTypes.object.\n\t\t\t\t\t\t\treturn 'object';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isSymbol(propType, propValue)) {\n\t\t\t\t\t\t\treturn 'symbol';\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn propType;\n\t\t\t\t\t}" ]
[ "0.69605863", "0.67468566", "0.6628833", "0.6464124", "0.6229379", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.6206012", "0.60928804", "0.60928804", "0.60928804", "0.60928804", "0.60928804", "0.60928804", "0.60928804", "0.60928804", "0.58008", "0.57621074", "0.5722716", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712969", "0.5712488", "0.5712488", "0.56921947", "0.56921947", "0.56921947", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5673137", "0.5661958", "0.56552327" ]
0.0
-1
Expose a method for transforming tokens into the path function.
function tokensToFunction(tokens, options) { // Compile all the tokens into regexps. var matches = new Array(tokens.length); // Compile all the patterns before compilation. for (var i = 0; i < tokens.length; i++) { if (typeof tokens[i] === 'object') { matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options)); } } return function (obj, opts) { var path = ''; var data = obj || {}; var options = opts || {}; var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent; for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; if (typeof token === 'string') { path += token; continue; } var value = data[token.name]; var segment; if (value == null) { if (token.optional) { // Prepend partial segment prefixes. if (token.partial) { path += token.prefix; } continue; } else { throw new TypeError('Expected "' + token.name + '" to be defined'); } } if (isarray(value)) { if (!token.repeat) { throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`'); } if (value.length === 0) { if (token.optional) { continue; } else { throw new TypeError('Expected "' + token.name + '" to not be empty'); } } for (var j = 0; j < value.length; j++) { segment = encode(value[j]); if (!matches[i].test(segment)) { throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`'); } path += (j === 0 ? token.prefix : token.delimiter) + segment; } continue; } segment = token.asterisk ? encodeAsterisk(value) : encode(value); if (!matches[i].test(segment)) { throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"'); } path += token.prefix + segment; } return path; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n const matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (let i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (data, options) {\n let path = ''\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n continue\n }\n\n const value = data ? data[token.name] : undefined\n var segment\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (let j = 0; j < value.length; j++) {\n path += (j === 0 ? token.prefix : token.delimiter) + value[j]\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n path += token.prefix + String(value)\n continue\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix\n\n continue\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n \n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$')\n }\n }\n \n return function (obj) {\n var path = ''\n var data = obj || {}\n \n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n \n if (typeof token === 'string') {\n path += token\n \n continue\n }\n \n var value = data[token.name]\n var segment\n \n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n \n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n \n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n \n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j])\n \n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n \n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n \n continue\n }\n \n segment = encodeURIComponent(value)\n \n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n \n path += token.prefix + segment\n }\n \n return path\n }\n }", "function tokensToFunction(tokens) {\n var matches = new Array(tokens.length)\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function(data, options) {\n var path = ''\n var encode = (options && options.encode) || encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n continue\n }\n\n var value = data ? data[token.name] : undefined\n var segment\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError(\n 'Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"'\n )\n }\n\n path += token.prefix + segment\n continue\n }\n\n if (token.optional) {\n if (token.partial) path += token.prefix\n\n continue\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n }", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (data, options) {\n var path = ''\n var encode = (options && options.encode) || encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n continue\n }\n\n var value = data ? data[token.name] : undefined\n var segment\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n continue\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix\n\n continue\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (data, options) {\n var path = ''\n var encode = (options && options.encode) || encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n continue\n }\n\n var value = data ? data[token.name] : undefined\n var segment\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n continue\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix\n\n continue\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (data, options) {\n var path = ''\n var encode = (options && options.encode) || encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n continue\n }\n\n var value = data ? data[token.name] : undefined\n var segment\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n continue\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix\n\n continue\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (data, options) {\n var path = ''\n var encode = (options && options.encode) || encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n continue\n }\n\n var value = data ? data[token.name] : undefined\n var segment\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n continue\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix\n\n continue\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (data, options) {\n var path = ''\n var encode = (options && options.encode) || encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n continue\n }\n\n var value = data ? data[token.name] : undefined\n var segment\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n continue\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix\n\n continue\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (data, options) {\n var path = ''\n var encode = (options && options.encode) || encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n continue\n }\n\n var value = data ? data[token.name] : undefined\n var segment\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n continue\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix\n\n continue\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n}", "function tokensToFunction(tokens, options) {\n // Compile all the tokens into regexps.\n const matches = new Array(tokens.length); // Compile all the patterns before compilation.\n\n for (let i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n let path = '';\n const data = obj || {};\n const options = opts || {};\n const encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n continue;\n }\n\n const value = data[token.name || 'pathMatch'];\n let segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined');\n }\n }\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`');\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty');\n }\n }\n\n for (let j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`');\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue;\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"');\n }\n\n path += token.prefix + segment;\n }\n\n return path;\n };\n}", "function tokensToFunction(tokens, options) {\n // Compile all the tokens into regexps.\n const matches = new Array(tokens.length); // Compile all the patterns before compilation.\n\n for (let i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n let path = '';\n const data = obj || {};\n const options = opts || {};\n const encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n continue;\n }\n\n const value = data[token.name || 'pathMatch'];\n let segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined');\n }\n }\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`');\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty');\n }\n }\n\n for (let j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`');\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue;\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"');\n }\n\n path += token.prefix + segment;\n }\n\n return path;\n };\n}", "function tokensToFunction(tokens, options) {\n // Compile all the tokens into regexps.\n const matches = new Array(tokens.length); // Compile all the patterns before compilation.\n\n for (let i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n let path = '';\n const data = obj || {};\n const options = opts || {};\n const encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n continue;\n }\n\n const value = data[token.name || 'pathMatch'];\n let segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined');\n }\n }\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`');\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty');\n }\n }\n\n for (let j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`');\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue;\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"');\n }\n\n path += token.prefix + segment;\n }\n\n return path;\n };\n}", "function tokensToFunction(tokens, options) {\n // Compile all the tokens into regexps.\n const matches = new Array(tokens.length); // Compile all the patterns before compilation.\n\n for (let i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n let path = '';\n const data = obj || {};\n const options = opts || {};\n const encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n continue;\n }\n\n const value = data[token.name || 'pathMatch'];\n let segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined');\n }\n }\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`');\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty');\n }\n }\n\n for (let j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`');\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue;\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"');\n }\n\n path += token.prefix + segment;\n }\n\n return path;\n };\n}", "function tokensToFunction(tokens, options) {\n // Compile all the tokens into regexps.\n const matches = new Array(tokens.length); // Compile all the patterns before compilation.\n\n for (let i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));\n }\n }\n\n return function (obj, opts) {\n let path = '';\n const data = obj || {};\n const options = opts || {};\n const encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n continue;\n }\n\n const value = data[token.name || 'pathMatch'];\n let segment;\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix;\n }\n\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined');\n }\n }\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`');\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue;\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty');\n }\n }\n\n for (let j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`');\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue;\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"');\n }\n\n path += token.prefix + segment;\n }\n\n return path;\n };\n}", "function tokensToFunction(tokens, options = {}) {\n const reFlags = flags(options);\n const { encode = (x) => x, validate = true } = options;\n // Compile all the tokens into regexps.\n const matches = tokens.map(token => {\n if (typeof token === 'object') {\n return new RegExp(`^(?:${token.pattern})$`, reFlags);\n }\n });\n return (data) => {\n let path = '';\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (typeof token === 'string') {\n path += token;\n continue;\n }\n const value = data ? data[token.name] : undefined;\n const optional = token.modifier === '?' || token.modifier === '*';\n const repeat = token.modifier === '*' || token.modifier === '+';\n if (Array.isArray(value)) {\n if (!repeat) {\n throw new TypeError(`Expected \"${token.name}\" to not repeat, but got an array`);\n }\n if (value.length === 0) {\n if (optional)\n continue;\n throw new TypeError(`Expected \"${token.name}\" to not be empty`);\n }\n for (let j = 0; j < value.length; j++) {\n const segment = encode(value[j], token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(`Expected all \"${token.name}\" to match \"${token.pattern}\", but got \"${segment}\"`);\n }\n path += token.prefix + segment + token.suffix;\n }\n continue;\n }\n if (typeof value === 'string' || typeof value === 'number') {\n const segment = encode(String(value), token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(`Expected \"${token.name}\" to match \"${token.pattern}\", but got \"${segment}\"`);\n }\n path += token.prefix + segment + token.suffix;\n continue;\n }\n if (optional)\n continue;\n const typeOfMessage = repeat ? 'an array' : 'a string';\n throw new TypeError(`Expected \"${token.name}\" to be ${typeOfMessage}`);\n }\n return path;\n };\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n }\n }\n\n return function (data, options) {\n var path = '';\n var encode = (options && options.encode) || encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n continue\n }\n\n var value = data ? data[token.name] : undefined;\n var segment;\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n continue\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix;\n\n continue\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n }", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length)\n\t\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^' + tokens[i].pattern + '$')\n\t }\n\t }\n\t\n\t return function (obj) {\n\t var path = ''\n\t var data = obj || {}\n\t\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i]\n\t\n\t if (typeof token === 'string') {\n\t path += token\n\t\n\t continue\n\t }\n\t\n\t var value = data[token.name]\n\t var segment\n\t\n\t if (value == null) {\n\t if (token.optional) {\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to be defined')\n\t }\n\t }\n\t\n\t if (isarray(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n\t }\n\t\n\t if (value.length === 0) {\n\t if (token.optional) {\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\t }\n\t\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encodeURIComponent(value[j])\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t }\n\t\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment\n\t }\n\t\n\t continue\n\t }\n\t\n\t segment = encodeURIComponent(value)\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t }\n\t\n\t path += token.prefix + segment\n\t }\n\t\n\t return path\n\t }\n\t}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$')\n }\n }\n\n return function (obj) {\n var path = ''\n var data = obj || {}\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = encodeURIComponent(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$')\n }\n }\n\n return function (obj) {\n var path = ''\n var data = obj || {}\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = encodeURIComponent(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$')\n }\n }\n\n return function (obj) {\n var path = ''\n var data = obj || {}\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = encodeURIComponent(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$')\n }\n }\n\n return function (obj) {\n var path = ''\n var data = obj || {}\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = encodeURIComponent(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$')\n }\n }\n\n return function (obj) {\n var path = ''\n var data = obj || {}\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = encodeURIComponent(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$')\n }\n }\n\n return function (obj) {\n var path = ''\n var data = obj || {}\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = encodeURIComponent(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n }\n }\n\n return function (data, options) {\n var path = '';\n var encode = (options && options.encode) || encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n continue\n }\n\n var value = data ? data[token.name] : undefined;\n var segment;\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n }\n\n if (value.length === 0) {\n if (token.optional) continue\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n continue\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix;\n\n continue\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n\t\t // Compile all the tokens into regexps.\n\t\t var matches = new Array(tokens.length)\n\t\n\t\t // Compile all the patterns before compilation.\n\t\t for (var i = 0; i < tokens.length; i++) {\n\t\t if (typeof tokens[i] === 'object') {\n\t\t matches[i] = new RegExp('^' + tokens[i].pattern + '$')\n\t\t }\n\t\t }\n\t\n\t\t return function (obj) {\n\t\t var path = ''\n\t\t var data = obj || {}\n\t\n\t\t for (var i = 0; i < tokens.length; i++) {\n\t\t var token = tokens[i]\n\t\n\t\t if (typeof token === 'string') {\n\t\t path += token\n\t\n\t\t continue\n\t\t }\n\t\n\t\t var value = data[token.name]\n\t\t var segment\n\t\n\t\t if (value == null) {\n\t\t if (token.optional) {\n\t\t continue\n\t\t } else {\n\t\t throw new TypeError('Expected \"' + token.name + '\" to be defined')\n\t\t }\n\t\t }\n\t\n\t\t if (isarray(value)) {\n\t\t if (!token.repeat) {\n\t\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n\t\t }\n\t\n\t\t if (value.length === 0) {\n\t\t if (token.optional) {\n\t\t continue\n\t\t } else {\n\t\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t\t }\n\t\t }\n\t\n\t\t for (var j = 0; j < value.length; j++) {\n\t\t segment = encodeURIComponent(value[j])\n\t\n\t\t if (!matches[i].test(segment)) {\n\t\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t\t }\n\t\n\t\t path += (j === 0 ? token.prefix : token.delimiter) + segment\n\t\t }\n\t\n\t\t continue\n\t\t }\n\t\n\t\t segment = encodeURIComponent(value)\n\t\n\t\t if (!matches[i].test(segment)) {\n\t\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t\t }\n\t\n\t\t path += token.prefix + segment\n\t\t }\n\t\n\t\t return path\n\t\t }\n\t\t}", "function tokensToFunction(tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === \"object\") {\n matches[i] = new RegExp(\"^(?:\" + tokens[i].pattern + \")$\");\n }\n }\n\n return function(data, options) {\n var path = \"\";\n var encode = (options && options.encode) || encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === \"string\") {\n path += token;\n continue;\n }\n\n var value = data ? data[token.name] : undefined;\n var segment;\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError(\n 'Expected \"' + token.name + '\" to not repeat, but got array'\n );\n }\n\n if (value.length === 0) {\n if (token.optional) continue;\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty');\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token);\n\n if (!matches[i].test(segment)) {\n throw new TypeError(\n 'Expected all \"' +\n token.name +\n '\" to match \"' +\n token.pattern +\n '\"'\n );\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue;\n }\n\n if (\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n ) {\n segment = encode(String(value), token);\n\n if (!matches[i].test(segment)) {\n throw new TypeError(\n 'Expected \"' +\n token.name +\n '\" to match \"' +\n token.pattern +\n '\", but got \"' +\n segment +\n '\"'\n );\n }\n\n path += token.prefix + segment;\n continue;\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix;\n\n continue;\n }\n\n throw new TypeError(\n 'Expected \"' +\n token.name +\n '\" to be ' +\n (token.repeat ? \"an array\" : \"a string\")\n );\n }\n\n return path;\n };\n}", "function tokensToFunction(tokens) {\r\n // Compile all the tokens into regexps.\r\n var matches = new Array(tokens.length);\r\n\r\n // Compile all the patterns before compilation.\r\n for (var i = 0; i < tokens.length; i++) {\r\n if (_typeof(tokens[i]) === 'object') {\r\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\r\n }\r\n }\r\n\r\n return function (obj, opts) {\r\n var path = '';\r\n var data = obj || {};\r\n var options = opts || {};\r\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\r\n\r\n for (var i = 0; i < tokens.length; i++) {\r\n var token = tokens[i];\r\n\r\n if (typeof token === 'string') {\r\n path += token;\r\n\r\n continue;\r\n }\r\n\r\n var value = data[token.name];\r\n var segment;\r\n\r\n if (value == null) {\r\n if (token.optional) {\r\n // Prepend partial segment prefixes.\r\n if (token.partial) {\r\n path += token.prefix;\r\n }\r\n\r\n continue;\r\n } else {\r\n throw new TypeError('Expected \"' + token.name + '\" to be defined');\r\n }\r\n }\r\n\r\n if (isarray(value)) {\r\n if (!token.repeat) {\r\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`');\r\n }\r\n\r\n if (value.length === 0) {\r\n if (token.optional) {\r\n continue;\r\n } else {\r\n throw new TypeError('Expected \"' + token.name + '\" to not be empty');\r\n }\r\n }\r\n\r\n for (var j = 0; j < value.length; j++) {\r\n segment = encode(value[j]);\r\n\r\n if (!matches[i].test(segment)) {\r\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`');\r\n }\r\n\r\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\r\n }\r\n\r\n continue;\r\n }\r\n\r\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\r\n\r\n if (!matches[i].test(segment)) {\r\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"');\r\n }\r\n\r\n path += token.prefix + segment;\r\n }\r\n\r\n return path;\r\n };\r\n }", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length)\n\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n\t }\n\t }\n\n\t return function (data, options) {\n\t var path = ''\n\t var encode = (options && options.encode) || encodeURIComponent\n\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i]\n\n\t if (typeof token === 'string') {\n\t path += token\n\t continue\n\t }\n\n\t var value = data ? data[token.name] : undefined\n\t var segment\n\n\t if (Array.isArray(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n\t }\n\n\t if (value.length === 0) {\n\t if (token.optional) continue\n\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encode(value[j], token)\n\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n\t }\n\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment\n\t }\n\n\t continue\n\t }\n\n\t if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n\t segment = encode(String(value), token)\n\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n\t }\n\n\t path += token.prefix + segment\n\t continue\n\t }\n\n\t if (token.optional) {\n\t // Prepend partial segment prefixes.\n\t if (token.partial) path += token.prefix\n\n\t continue\n\t }\n\n\t throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n\t }\n\n\t return path\n\t }\n\t}", "function tokensToFunction(tokens, options) {\n if (options === void 0) { options = {}; }\n var reFlags = flags(options);\n var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b;\n // Compile all the tokens into regexps.\n var matches = tokens.map(function (token) {\n if (typeof token === \"object\") {\n return new RegExp(\"^(?:\" + token.pattern + \")$\", reFlags);\n }\n });\n return function (data) {\n var path = \"\";\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (typeof token === \"string\") {\n path += token;\n continue;\n }\n var value = data ? data[token.name] : undefined;\n var optional = token.modifier === \"?\" || token.modifier === \"*\";\n var repeat = token.modifier === \"*\" || token.modifier === \"+\";\n if (Array.isArray(value)) {\n if (!repeat) {\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to not repeat, but got an array\");\n }\n if (value.length === 0) {\n if (optional)\n continue;\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to not be empty\");\n }\n for (var j = 0; j < value.length; j++) {\n var segment = encode(value[j], token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected all \\\"\" + token.name + \"\\\" to match \\\"\" + token.pattern + \"\\\", but got \\\"\" + segment + \"\\\"\");\n }\n path += token.prefix + segment + token.suffix;\n }\n continue;\n }\n if (typeof value === \"string\" || typeof value === \"number\") {\n var segment = encode(String(value), token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to match \\\"\" + token.pattern + \"\\\", but got \\\"\" + segment + \"\\\"\");\n }\n path += token.prefix + segment + token.suffix;\n continue;\n }\n if (optional)\n continue;\n var typeOfMessage = repeat ? \"an array\" : \"a string\";\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to be \" + typeOfMessage);\n }\n return path;\n };\n }", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$');\n }\n }\n\n return function (obj) {\n var path = '';\n var data = obj || {};\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = encodeURIComponent(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$');\n }\n }\n\n return function (obj) {\n var path = '';\n var data = obj || {};\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = encodeURIComponent(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$');\n }\n }\n\n return function (obj) {\n var path = '';\n var data = obj || {};\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = encodeURIComponent(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^' + tokens[i].pattern + '$');\n }\n }\n\n return function (obj) {\n var path = '';\n var data = obj || {};\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n\n continue\n }\n\n var value = data[token.name];\n var segment;\n\n if (value == null) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received \"' + value + '\"')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encodeURIComponent(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue\n }\n\n segment = encodeURIComponent(value);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment;\n }\n\n return path\n }\n}", "function tokensToFunction(tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length);\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (_typeof(tokens[i]) === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n }\n }\n\n return function (data, options) {\n var path = '';\n var encode = options && options.encode || encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n continue;\n }\n\n var value = data ? data[token.name] : undefined;\n var segment;\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array');\n }\n\n if (value.length === 0) {\n if (token.optional) continue;\n\n throw new TypeError('Expected \"' + token.name + '\" to not be empty');\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j]);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"');\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue;\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value));\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"');\n }\n\n path += token.prefix + segment;\n continue;\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix;\n\n continue;\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'));\n }\n\n return path;\n };\n}", "function tokensToFunction(tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length); // Compile all the patterns before compilation.\n\n for (var i = 0; i < tokens.length; i++) {\n if (_typeof(tokens[i]) === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n }\n }\n\n return function (data, options) {\n var path = '';\n var encode = options && options.encode || encodeURIComponent;\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (typeof token === 'string') {\n path += token;\n continue;\n }\n\n var value = data ? data[token.name] : undefined;\n var segment;\n\n if (Array.isArray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array');\n }\n\n if (value.length === 0) {\n if (token.optional) continue;\n throw new TypeError('Expected \"' + token.name + '\" to not be empty');\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j], token);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"');\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\n }\n\n continue;\n }\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n segment = encode(String(value), token);\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"');\n }\n\n path += token.prefix + segment;\n continue;\n }\n\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) path += token.prefix;\n continue;\n }\n\n throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'));\n }\n\n return path;\n };\n}", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length)\n\t\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n\t }\n\t }\n\t\n\t return function (obj, opts) {\n\t var path = ''\n\t var data = obj || {}\n\t var options = opts || {}\n\t var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\t\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i]\n\t\n\t if (typeof token === 'string') {\n\t path += token\n\t\n\t continue\n\t }\n\t\n\t var value = data[token.name]\n\t var segment\n\t\n\t if (value == null) {\n\t if (token.optional) {\n\t // Prepend partial segment prefixes.\n\t if (token.partial) {\n\t path += token.prefix\n\t }\n\t\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to be defined')\n\t }\n\t }\n\t\n\t if (isarray(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n\t }\n\t\n\t if (value.length === 0) {\n\t if (token.optional) {\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\t }\n\t\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encode(value[j])\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n\t }\n\t\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment\n\t }\n\t\n\t continue\n\t }\n\t\n\t segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t }\n\t\n\t path += token.prefix + segment\n\t }\n\t\n\t return path\n\t }\n\t}", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length)\n\t\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n\t }\n\t }\n\t\n\t return function (obj, opts) {\n\t var path = ''\n\t var data = obj || {}\n\t var options = opts || {}\n\t var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\t\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i]\n\t\n\t if (typeof token === 'string') {\n\t path += token\n\t\n\t continue\n\t }\n\t\n\t var value = data[token.name]\n\t var segment\n\t\n\t if (value == null) {\n\t if (token.optional) {\n\t // Prepend partial segment prefixes.\n\t if (token.partial) {\n\t path += token.prefix\n\t }\n\t\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to be defined')\n\t }\n\t }\n\t\n\t if (isarray(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n\t }\n\t\n\t if (value.length === 0) {\n\t if (token.optional) {\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\t }\n\t\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encode(value[j])\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n\t }\n\t\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment\n\t }\n\t\n\t continue\n\t }\n\t\n\t segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t }\n\t\n\t path += token.prefix + segment\n\t }\n\t\n\t return path\n\t }\n\t}", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length)\n\t\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n\t }\n\t }\n\t\n\t return function (obj, opts) {\n\t var path = ''\n\t var data = obj || {}\n\t var options = opts || {}\n\t var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\t\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i]\n\t\n\t if (typeof token === 'string') {\n\t path += token\n\t\n\t continue\n\t }\n\t\n\t var value = data[token.name]\n\t var segment\n\t\n\t if (value == null) {\n\t if (token.optional) {\n\t // Prepend partial segment prefixes.\n\t if (token.partial) {\n\t path += token.prefix\n\t }\n\t\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to be defined')\n\t }\n\t }\n\t\n\t if (isarray(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n\t }\n\t\n\t if (value.length === 0) {\n\t if (token.optional) {\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\t }\n\t\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encode(value[j])\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n\t }\n\t\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment\n\t }\n\t\n\t continue\n\t }\n\t\n\t segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t }\n\t\n\t path += token.prefix + segment\n\t }\n\t\n\t return path\n\t }\n\t}", "function tokensToFunction (tokens) {\r\n // Compile all the tokens into regexps.\r\n var matches = new Array(tokens.length);\r\n\r\n // Compile all the patterns before compilation.\r\n for (var i = 0; i < tokens.length; i++) {\r\n if (typeof tokens[i] === 'object') {\r\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\r\n }\r\n }\r\n\r\n return function (obj, opts) {\r\n var path = '';\r\n var data = obj || {};\r\n var options = opts || {};\r\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\r\n\r\n for (var i = 0; i < tokens.length; i++) {\r\n var token = tokens[i];\r\n\r\n if (typeof token === 'string') {\r\n path += token;\r\n\r\n continue\r\n }\r\n\r\n var value = data[token.name];\r\n var segment;\r\n\r\n if (value == null) {\r\n if (token.optional) {\r\n // Prepend partial segment prefixes.\r\n if (token.partial) {\r\n path += token.prefix;\r\n }\r\n\r\n continue\r\n } else {\r\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\r\n }\r\n }\r\n\r\n if (isarray(value)) {\r\n if (!token.repeat) {\r\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\r\n }\r\n\r\n if (value.length === 0) {\r\n if (token.optional) {\r\n continue\r\n } else {\r\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\r\n }\r\n }\r\n\r\n for (var j = 0; j < value.length; j++) {\r\n segment = encode(value[j]);\r\n\r\n if (!matches[i].test(segment)) {\r\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\r\n }\r\n\r\n path += (j === 0 ? token.prefix : token.delimiter) + segment;\r\n }\r\n\r\n continue\r\n }\r\n\r\n segment = token.asterisk ? encodeAsterisk(value) : encode(value);\r\n\r\n if (!matches[i].test(segment)) {\r\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\r\n }\r\n\r\n path += token.prefix + segment;\r\n }\r\n\r\n return path\r\n }\r\n}", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length);\n\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n\t }\n\t }\n\n\t return function (data, options) {\n\t var path = '';\n\t var encode = (options && options.encode) || encodeURIComponent;\n\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i];\n\n\t if (typeof token === 'string') {\n\t path += token;\n\t continue\n\t }\n\n\t var value = data ? data[token.name] : undefined;\n\t var segment;\n\n\t if (Array.isArray(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but got array')\n\t }\n\n\t if (value.length === 0) {\n\t if (token.optional) continue\n\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encode(value[j], token);\n\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\"')\n\t }\n\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment;\n\t }\n\n\t continue\n\t }\n\n\t if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n\t segment = encode(String(value), token);\n\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but got \"' + segment + '\"')\n\t }\n\n\t path += token.prefix + segment;\n\t continue\n\t }\n\n\t if (token.optional) {\n\t // Prepend partial segment prefixes.\n\t if (token.partial) path += token.prefix;\n\n\t continue\n\t }\n\n\t throw new TypeError('Expected \"' + token.name + '\" to be ' + (token.repeat ? 'an array' : 'a string'))\n\t }\n\n\t return path\n\t }\n\t}", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length);\n\t\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n\t }\n\t }\n\t\n\t return function (obj, opts) {\n\t var path = '';\n\t var data = obj || {};\n\t var options = opts || {};\n\t var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\t\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i];\n\t\n\t if (typeof token === 'string') {\n\t path += token;\n\t\n\t continue\n\t }\n\t\n\t var value = data[token.name];\n\t var segment;\n\t\n\t if (value == null) {\n\t if (token.optional) {\n\t // Prepend partial segment prefixes.\n\t if (token.partial) {\n\t path += token.prefix;\n\t }\n\t\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to be defined')\n\t }\n\t }\n\t\n\t if (isarray(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n\t }\n\t\n\t if (value.length === 0) {\n\t if (token.optional) {\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\t }\n\t\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encode(value[j]);\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n\t }\n\t\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment;\n\t }\n\t\n\t continue\n\t }\n\t\n\t segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t }\n\t\n\t path += token.prefix + segment;\n\t }\n\t\n\t return path\n\t }\n\t}", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length);\n\t\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n\t }\n\t }\n\t\n\t return function (obj, opts) {\n\t var path = '';\n\t var data = obj || {};\n\t var options = opts || {};\n\t var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\t\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i];\n\t\n\t if (typeof token === 'string') {\n\t path += token;\n\t\n\t continue\n\t }\n\t\n\t var value = data[token.name];\n\t var segment;\n\t\n\t if (value == null) {\n\t if (token.optional) {\n\t // Prepend partial segment prefixes.\n\t if (token.partial) {\n\t path += token.prefix;\n\t }\n\t\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to be defined')\n\t }\n\t }\n\t\n\t if (isarray(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n\t }\n\t\n\t if (value.length === 0) {\n\t if (token.optional) {\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\t }\n\t\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encode(value[j]);\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n\t }\n\t\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment;\n\t }\n\t\n\t continue\n\t }\n\t\n\t segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t }\n\t\n\t path += token.prefix + segment;\n\t }\n\t\n\t return path\n\t }\n\t}", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length);\n\t\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n\t }\n\t }\n\t\n\t return function (obj, opts) {\n\t var path = '';\n\t var data = obj || {};\n\t var options = opts || {};\n\t var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\t\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i];\n\t\n\t if (typeof token === 'string') {\n\t path += token;\n\t\n\t continue\n\t }\n\t\n\t var value = data[token.name];\n\t var segment;\n\t\n\t if (value == null) {\n\t if (token.optional) {\n\t // Prepend partial segment prefixes.\n\t if (token.partial) {\n\t path += token.prefix;\n\t }\n\t\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to be defined')\n\t }\n\t }\n\t\n\t if (isarray(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n\t }\n\t\n\t if (value.length === 0) {\n\t if (token.optional) {\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\t }\n\t\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encode(value[j]);\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n\t }\n\t\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment;\n\t }\n\t\n\t continue\n\t }\n\t\n\t segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t }\n\t\n\t path += token.prefix + segment;\n\t }\n\t\n\t return path\n\t }\n\t}", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length);\n\t\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n\t }\n\t }\n\t\n\t return function (obj, opts) {\n\t var path = '';\n\t var data = obj || {};\n\t var options = opts || {};\n\t var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\t\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i];\n\t\n\t if (typeof token === 'string') {\n\t path += token;\n\t\n\t continue\n\t }\n\t\n\t var value = data[token.name];\n\t var segment;\n\t\n\t if (value == null) {\n\t if (token.optional) {\n\t // Prepend partial segment prefixes.\n\t if (token.partial) {\n\t path += token.prefix;\n\t }\n\t\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to be defined')\n\t }\n\t }\n\t\n\t if (isarray(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n\t }\n\t\n\t if (value.length === 0) {\n\t if (token.optional) {\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\t }\n\t\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encode(value[j]);\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n\t }\n\t\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment;\n\t }\n\t\n\t continue\n\t }\n\t\n\t segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t }\n\t\n\t path += token.prefix + segment;\n\t }\n\t\n\t return path\n\t }\n\t}", "function tokensToFunction (tokens) {\n\t // Compile all the tokens into regexps.\n\t var matches = new Array(tokens.length);\n\t\n\t // Compile all the patterns before compilation.\n\t for (var i = 0; i < tokens.length; i++) {\n\t if (typeof tokens[i] === 'object') {\n\t matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');\n\t }\n\t }\n\t\n\t return function (obj, opts) {\n\t var path = '';\n\t var data = obj || {};\n\t var options = opts || {};\n\t var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;\n\t\n\t for (var i = 0; i < tokens.length; i++) {\n\t var token = tokens[i];\n\t\n\t if (typeof token === 'string') {\n\t path += token;\n\t\n\t continue\n\t }\n\t\n\t var value = data[token.name];\n\t var segment;\n\t\n\t if (value == null) {\n\t if (token.optional) {\n\t // Prepend partial segment prefixes.\n\t if (token.partial) {\n\t path += token.prefix;\n\t }\n\t\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to be defined')\n\t }\n\t }\n\t\n\t if (index$1(value)) {\n\t if (!token.repeat) {\n\t throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n\t }\n\t\n\t if (value.length === 0) {\n\t if (token.optional) {\n\t continue\n\t } else {\n\t throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n\t }\n\t }\n\t\n\t for (var j = 0; j < value.length; j++) {\n\t segment = encode(value[j]);\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n\t }\n\t\n\t path += (j === 0 ? token.prefix : token.delimiter) + segment;\n\t }\n\t\n\t continue\n\t }\n\t\n\t segment = token.asterisk ? encodeAsterisk(value) : encode(value);\n\t\n\t if (!matches[i].test(segment)) {\n\t throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n\t }\n\t\n\t path += token.prefix + segment;\n\t }\n\t\n\t return path\n\t }\n\t}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens, options) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}", "function tokensToFunction (tokens) {\n // Compile all the tokens into regexps.\n var matches = new Array(tokens.length)\n\n // Compile all the patterns before compilation.\n for (var i = 0; i < tokens.length; i++) {\n if (typeof tokens[i] === 'object') {\n matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')\n }\n }\n\n return function (obj, opts) {\n var path = ''\n var data = obj || {}\n var options = opts || {}\n var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent\n\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i]\n\n if (typeof token === 'string') {\n path += token\n\n continue\n }\n\n var value = data[token.name]\n var segment\n\n if (value == null) {\n if (token.optional) {\n // Prepend partial segment prefixes.\n if (token.partial) {\n path += token.prefix\n }\n\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to be defined')\n }\n }\n\n if (isarray(value)) {\n if (!token.repeat) {\n throw new TypeError('Expected \"' + token.name + '\" to not repeat, but received `' + JSON.stringify(value) + '`')\n }\n\n if (value.length === 0) {\n if (token.optional) {\n continue\n } else {\n throw new TypeError('Expected \"' + token.name + '\" to not be empty')\n }\n }\n\n for (var j = 0; j < value.length; j++) {\n segment = encode(value[j])\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected all \"' + token.name + '\" to match \"' + token.pattern + '\", but received `' + JSON.stringify(segment) + '`')\n }\n\n path += (j === 0 ? token.prefix : token.delimiter) + segment\n }\n\n continue\n }\n\n segment = token.asterisk ? encodeAsterisk(value) : encode(value)\n\n if (!matches[i].test(segment)) {\n throw new TypeError('Expected \"' + token.name + '\" to match \"' + token.pattern + '\", but received \"' + segment + '\"')\n }\n\n path += token.prefix + segment\n }\n\n return path\n }\n}" ]
[ "0.6186804", "0.6011498", "0.5988314", "0.59863955", "0.59863955", "0.59863955", "0.59863955", "0.59863955", "0.59863955", "0.59597945", "0.59597945", "0.59597945", "0.59597945", "0.59597945", "0.59275687", "0.5921299", "0.5902797", "0.5896205", "0.5896205", "0.5896205", "0.5896205", "0.5896205", "0.5896205", "0.5875311", "0.5868575", "0.58594", "0.5856725", "0.58452034", "0.5842023", "0.5840739", "0.5840739", "0.5840739", "0.5840739", "0.58396655", "0.583892", "0.58157235", "0.58157235", "0.58157235", "0.5815337", "0.5814947", "0.58082616", "0.58082616", "0.58082616", "0.58082616", "0.5801601", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.57956713", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702", "0.5787702" ]
0.0
-1
Try/catch helper to minimize deoptimizations. Returns a completion record like context.tryEntries[i].completion. This interface could have been (and was previously) designed to take a closure to be invoked without arguments, but in all the cases we care about we already have an existing method we want to call, so there's no need to create a new function object. We can even get away with assuming the method takes exactly one argument, since that happens to be true in every case, so we don't have to touch the arguments object. The only additional allocation required is the completion record, which has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tryCatch(fn, obj, arg) { // 59\n try { // 60\n return { type: \"normal\", arg: fn.call(obj, arg) }; // 61\n } catch (err) { // 62\n return { type: \"throw\", arg: err }; // 63\n } // 64\n } // 65", "function tryCatch(fn, obj, arg) { // 63\n try { // 64\n return { type: \"normal\", arg: fn.call(obj, arg) }; // 65\n } catch (err) { // 66\n return { type: \"throw\", arg: err }; // 67\n } // 68\n } // 69", "function tryCatch(fn,obj,arg){try{return {type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return {type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function tryCatch(fn,obj,arg){try{return{type:\"normal\",arg:fn.call(obj,arg)};}catch(err){return{type:\"throw\",arg:err};}}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n var eso = function(o) {\n return ensureSafeObject(o, fullExp);\n };\n var expensiveChecks = options.expensiveChecks;\n var eso0 = (expensiveChecks || isPossiblyDangerousMemberName(key0)) ? eso : identity;\n var eso1 = (expensiveChecks || isPossiblyDangerousMemberName(key1)) ? eso : identity;\n var eso2 = (expensiveChecks || isPossiblyDangerousMemberName(key2)) ? eso : identity;\n var eso3 = (expensiveChecks || isPossiblyDangerousMemberName(key3)) ? eso : identity;\n var eso4 = (expensiveChecks || isPossiblyDangerousMemberName(key4)) ? eso : identity;\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = eso0(pathVal[key0]);\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso1(pathVal[key1]);\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso2(pathVal[key2]);\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso3(pathVal[key3]);\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso4(pathVal[key4]);\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = eso0(pathVal[key0]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso0(val); });\n }\n pathVal = eso0(pathVal.$$v);\n }\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso1(pathVal[key1]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso1(val); });\n }\n pathVal = eso1(pathVal.$$v);\n }\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso2(pathVal[key2]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso2(val); });\n }\n pathVal = eso2(pathVal.$$v);\n }\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso3(pathVal[key3]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso3(val); });\n }\n pathVal = eso3(pathVal.$$v);\n }\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso4(pathVal[key4]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso4(val); });\n }\n pathVal = eso4(pathVal.$$v);\n }\n return pathVal;\n };\n}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n var eso = function(o) {\n return ensureSafeObject(o, fullExp);\n };\n var expensiveChecks = options.expensiveChecks;\n var eso0 = (expensiveChecks || isPossiblyDangerousMemberName(key0)) ? eso : identity;\n var eso1 = (expensiveChecks || isPossiblyDangerousMemberName(key1)) ? eso : identity;\n var eso2 = (expensiveChecks || isPossiblyDangerousMemberName(key2)) ? eso : identity;\n var eso3 = (expensiveChecks || isPossiblyDangerousMemberName(key3)) ? eso : identity;\n var eso4 = (expensiveChecks || isPossiblyDangerousMemberName(key4)) ? eso : identity;\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = eso0(pathVal[key0]);\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso1(pathVal[key1]);\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso2(pathVal[key2]);\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso3(pathVal[key3]);\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso4(pathVal[key4]);\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = eso0(pathVal[key0]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso0(val); });\n }\n pathVal = eso0(pathVal.$$v);\n }\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso1(pathVal[key1]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso1(val); });\n }\n pathVal = eso1(pathVal.$$v);\n }\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso2(pathVal[key2]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso2(val); });\n }\n pathVal = eso2(pathVal.$$v);\n }\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso3(pathVal[key3]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso3(val); });\n }\n pathVal = eso3(pathVal.$$v);\n }\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = eso4(pathVal[key4]);\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = eso4(val); });\n }\n pathVal = eso4(pathVal.$$v);\n }\n return pathVal;\n };\n}", "function c(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}", "function IteratorClose(iteratorRecord, completion) { // eslint-disable-line no-unused-vars\n\t\t// 1. Assert: Type(iteratorRecord.[[Iterator]]) is Object.\n\t\tif (Type(iteratorRecord['[[Iterator]]']) !== 'object') {\n\t\t\tthrow new Error(Object.prototype.toString.call(iteratorRecord['[[Iterator]]']) + 'is not an Object.');\n\t\t}\n\t\t// 2. Assert: completion is a Completion Record.\n\t\t// Polyfill.io - Ignoring this step as there is no way to check if something is a Completion Record in userland JavaScript.\n\n\t\t// 3. Let iterator be iteratorRecord.[[Iterator]].\n\t\tvar iterator = iteratorRecord['[[Iterator]]'];\n\t\t// 4. Let return be ? GetMethod(iterator, \"return\").\n\t\t// Polyfill.io - We name it returnMethod because return is a keyword and can not be used as an identifier (E.G. variable name, function name etc).\n\t\tvar returnMethod = GetMethod(iterator, \"return\");\n\t\t// 5. If return is undefined, return Completion(completion).\n\t\tif (returnMethod === undefined) {\n\t\t\treturn completion;\n\t\t}\n\t\t// 6. Let innerResult be Call(return, iterator, « »).\n\t\ttry {\n\t\t\tvar innerResult = Call(returnMethod, iterator);\n\t\t} catch (error) {\n\t\t\tvar innerException = error;\n\t\t}\n\t\t// 7. If completion.[[Type]] is throw, return Completion(completion).\n\t\tif (completion) {\n\t\t\treturn completion;\n\t\t}\n\t\t// 8. If innerResult.[[Type]] is throw, return Completion(innerResult).\n\t\tif (innerException) {\n\t\t\tthrow innerException;\n\t\t}\n\t\t// 9. If Type(innerResult.[[Value]]) is not Object, throw a TypeError exception.\n\t\tif (Type(innerResult) !== 'object') {\n\t\t\tthrow new TypeError(\"Iterator's return method returned a non-object.\");\n\t\t}\n\t\t// 10. Return Completion(completion).\n\t\treturn completion;\n\t}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = pathVal[key0];\n\n if (pathVal == null) return key1 ? undefined : pathVal;\n pathVal = pathVal[key1];\n\n if (pathVal == null) return key2 ? undefined : pathVal;\n pathVal = pathVal[key2];\n\n if (pathVal == null) return key3 ? undefined : pathVal;\n pathVal = pathVal[key3];\n\n if (pathVal == null) return key4 ? undefined : pathVal;\n pathVal = pathVal[key4];\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = pathVal[key0];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (pathVal == null) return key1 ? undefined : pathVal;\n\n pathVal = pathVal[key1];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (pathVal == null) return key2 ? undefined : pathVal;\n\n pathVal = pathVal[key2];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (pathVal == null) return key3 ? undefined : pathVal;\n\n pathVal = pathVal[key3];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n if (pathVal == null) return key4 ? undefined : pathVal;\n\n pathVal = pathVal[key4];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n return pathVal;\n };\n}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = pathVal[key0];\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = pathVal[key0];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n return pathVal;\n };\n}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = pathVal[key0];\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = pathVal[key0];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n return pathVal;\n };\n}", "function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {\n ensureSafeMemberName(key0, fullExp);\n ensureSafeMemberName(key1, fullExp);\n ensureSafeMemberName(key2, fullExp);\n ensureSafeMemberName(key3, fullExp);\n ensureSafeMemberName(key4, fullExp);\n\n return !options.unwrapPromises\n ? function cspSafeGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;\n\n if (pathVal == null) return pathVal;\n pathVal = pathVal[key0];\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n\n return pathVal;\n }\n : function cspSafePromiseEnabledGetter(scope, locals) {\n var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,\n promise;\n\n if (pathVal == null) return pathVal;\n\n pathVal = pathVal[key0];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key1) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key1];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key2) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key2];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key3) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key3];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n\n if (!key4) return pathVal;\n if (pathVal == null) return undefined;\n pathVal = pathVal[key4];\n if (pathVal && pathVal.then) {\n promiseWarning(fullExp);\n if (!(\"$$v\" in pathVal)) {\n promise = pathVal;\n promise.$$v = undefined;\n promise.then(function(val) { promise.$$v = val; });\n }\n pathVal = pathVal.$$v;\n }\n return pathVal;\n };\n}", "function catcher () { return fn }", "function _co(method, arg) {\n let res;\n\n try {\n //retrieve the promise returned by the http request if `arg` is undefined\n //if `arg` is defined it will be the data from the http request promise\n //and will be \"injected\" into `yield` and caught in a variable\n res = it[method](arg);\n } catch(err) {\n //not sure about the error handling here??\n return Promise.reject(err);\n }\n\n if (res.done) {\n if (method === 'throw') {\n return arg;\n } else {\n return res.value;\n }\n } else {\n //at this point we may resolve a promise or a value??\n //a) if we are resolving a promise we will inject it's value by calling `.next`\n //b) if we are resolving a value it will be ignored by `.next` as `yield` will be\n // the returned Promise from the http request\n return Promise.resolve(res.value)\n .then((val) => {\n return _co('next', val);\n }, (err) => {\n //not sure about the error handling here??\n return _co('throw', err);\n });\n }\n }", "completionItemResolve(item, span = new opentracing_1.Span()) {\n if (!item.data) {\n throw new Error('Cannot resolve completion item without data');\n }\n const { uri, offset, entryName } = item.data;\n const fileName = util_1.uri2path(uri);\n return this.projectManager.ensureReferencedFiles(uri, undefined, undefined, span)\n .toArray()\n .map(() => {\n const configuration = this.projectManager.getConfiguration(fileName);\n configuration.ensureBasicFiles(span);\n const details = configuration.getService().getCompletionEntryDetails(fileName, offset, entryName);\n if (details) {\n item.documentation = ts.displayPartsToString(details.documentation);\n item.detail = ts.displayPartsToString(details.displayParts);\n if (this.supportsCompletionWithSnippets &&\n (details.kind === 'method' || details.kind === 'function')) {\n const parameters = details.displayParts\n .filter(p => p.kind === 'parameterName')\n .map((p, i) => '${' + `${i + 1}:${p.text}` + '}');\n const paramString = parameters.join(', ');\n item.insertText = details.name + `(${paramString})`;\n item.insertTextFormat = vscode_languageserver_1.InsertTextFormat.Snippet;\n }\n else {\n item.insertTextFormat = vscode_languageserver_1.InsertTextFormat.PlainText;\n item.insertText = details.name;\n }\n item.data = undefined;\n }\n return item;\n })\n .map(completionItem => ({ op: 'add', path: '', value: completionItem }));\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: 'normal', arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: 'throw', arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return { type: \"normal\", arg: fn.call(obj, arg) };\n\t } catch (err) {\n\t return { type: \"throw\", arg: err };\n\t }\n\t }", "function completeValueCatchingError(exeContext, returnType, fieldNodes, info, path, result) {\n try {\n var completed;\n\n if (Object(_jsutils_isPromise__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(result)) {\n completed = result.then(function (resolved) {\n return completeValue(exeContext, returnType, fieldNodes, info, path, resolved);\n });\n } else {\n completed = completeValue(exeContext, returnType, fieldNodes, info, path, result);\n }\n\n if (Object(_jsutils_isPromise__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(completed)) {\n // Note: we don't rely on a `catch` method, but we do expect \"thenable\"\n // to take a second callback for the error case.\n return completed.then(undefined, function (error) {\n return handleFieldError(error, fieldNodes, path, returnType, exeContext);\n });\n }\n\n return completed;\n } catch (error) {\n return handleFieldError(error, fieldNodes, path, returnType, exeContext);\n }\n}", "function tryCatch(fn, obj, arg) {\n\t try {\n\t return {\n\t type: \"normal\",\n\t arg: fn.call(obj, arg)\n\t };\n\t } catch (err) {\n\t return {\n\t type: \"throw\",\n\t arg: err\n\t };\n\t }\n\t }", "function call_method(func, scope, args) {\n try {\n return func.apply(scope, guess_callback(args, scope));\n } catch(e) { if (!(e instanceof Break)) { throw(e); } }\n\n return undefined;\n}", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }", "function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }" ]
[ "0.5071653", "0.5061426", "0.48501745", "0.479296", "0.479296", "0.479296", "0.479296", "0.479296", "0.47842094", "0.47842094", "0.4706789", "0.4688443", "0.4669041", "0.46566677", "0.46566677", "0.46566677", "0.46548957", "0.46371785", "0.46227673", "0.4615054", "0.4615054", "0.4615054", "0.4615054", "0.4615054", "0.46120042", "0.46084887", "0.45970705", "0.4596353", "0.4592602", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533", "0.4592533" ]
0.0
-1
Dummy constructor functions that we use as the .constructor and .constructor.prototype properties for functions that return Generator objects. For full spec compliance, you may wish to configure your minifier not to mangle the names of these two functions.
function Generator() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tempCtor() {}", "function temporaryConstructor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function HelperConstructor() {}", "function DummyClass() {\r\n // All construction is actually done in the construct method\r\n if ( !init && this.construct )\r\n this.construct.apply(this, arguments);\r\n }", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function Ctor() {}", "function SomeConstructor() {\n\n}", "__init2() {this.noAnonFunctionType = false}", "function GeneratorClass () {}", "function Dummy() {}", "function Dummy() {}", "function Ctor() {\n\t// Empty...\n}", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function $makeBlank(ctor)\n{\n var blank = function() {};\n blank.prototype = ctor.prototype;\n return blank;\n}", "function new_constructor(extend, initializer, methods){\n\t\t\tvar func,\n\t\t\t\tmethodsArr,\n\t\t\t\tmethodsLen,\n\t\t\t\tk,\n\t\t\t\tprototype = Object.create(extend && extend.prototype);\t// ES5, but backup function provided above\n\t\t\t\n\t\t\tif(methods){\n\t\t\t\tmethodsArr = Object.keys(methods);\t\t\t\t\t\t// ES5, but backup function provided above\n\t\t\t\tmethodsLen = methodsArr.length;\n\t\t\t\tfor(k = methodsLen; k--;){\n\t\t\t\t\tprototype[methodsArr[k]] = methods[methodsArr[k]];\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfunc = function(){\t\t\n\t\t\t\tvar that = Object.create(prototype);\t\t\t\t\t// ES5, but backup function provided above\n\t\t\t\tif(typeof initializer === \"function\"){\n\t\t\t\t\tinitializer.apply(that, arguments);\n\t\t\t\t}\n\t\t\t\treturn that;\n\t\t\t};\n\t\t\t\n\t\t\tfunc.prototype = prototype;\n\t\t\tprototype.constructor = func;\n\t\t\treturn func;\n\t\t}", "function makeObjectWithFakeCtor() {\n function fakeCtor() {\n }\n fakeCtor.prototype = ctor.prototype;\n return new fakeCtor();\n }", "function o(e,t,n){try{return{type:\"normal\",arg:e.call(t,n)}}catch(e){return{type:\"throw\",arg:e}}}// Dummy constructor functions that we use as the .constructor and", "function r(e,t,o){try{return{type:\"normal\",arg:e.call(t,o)}}catch(e){return{type:\"throw\",arg:e}}}// Dummy constructor functions that we use as the .constructor and", "function new_constructor(initializer, methods, extend) {\n var prototype = Object.create(typeof extend === 'function'\n ? extend.prototype\n : extend);\n if (methods) {\n methods.keys().forEach(function (key) {\n prototype[key] = methods[key];\n}); }\n function constructor() {\n var that = Object.create(prototype);\n if (typeof initializer === 'function') {\n initializer.apply(that, arguments);\n }\n return that;\n }\n constructor.prototype = prototype;\n prototype.constructor = constructor;\n return constructor;\n }", "function _ctor() {\n\t}", "function simpleConstructor(bases){\n\t\treturn function(){\n\t\t\tvar a = arguments, i = 0, f, m;\n\n\t\t\tif(!(this instanceof a.callee)){\n\t\t\t\t// not called via new, so force it\n\t\t\t\treturn applyNew(a);\n\t\t\t}\n\n\t\t\t//this._inherited = {};\n\t\t\t// perform the shaman's rituals of the original dojo.declare()\n\t\t\t// 1) do not call the preamble\n\t\t\t// 2) call the top constructor (it can use this.inherited())\n\t\t\tfor(; f = bases[i]; ++i){ // intentional assignment\n\t\t\t\tm = f._meta;\n\t\t\t\tf = m ? m.ctor : f;\n\t\t\t\tif(f){\n\t\t\t\t\tf.apply(this, a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 3) call the postscript\n\t\t\tf = this.postscript;\n\t\t\tif(f){\n\t\t\t\tf.apply(this, a);\n\t\t\t}\n\t\t};\n\t}", "function Clazz () {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "function c(a,b,c){try{return{type:\"normal\",arg:a.call(b,c)}}catch(a){return{type:\"throw\",arg:a}}}// Dummy constructor functions that we use as the .constructor and", "function SpoofConstructor(name){\n this.name=\"I am \" + name;\n return {name:\"I am Deadpool\"};\n}", "function SimpleClass() {\n }", "function simpleConstructor(bases){\n\t\treturn function(){\n\t\t\tvar a = arguments, i = 0, f, m;\n\n\t\t\tif(!(this instanceof a.callee)){\n\t\t\t\t// not called via new, so force it\n\t\t\t\treturn applyNew(a);\n\t\t\t}\n\n\t\t\t//this._inherited = {};\n\t\t\t// perform the shaman's rituals of the original declare()\n\t\t\t// 1) do not call the preamble\n\t\t\t// 2) call the top constructor (it can use this.inherited())\n\t\t\tfor(; f = bases[i]; ++i){ // intentional assignment\n\t\t\t\tm = f._meta;\n\t\t\t\tf = m ? m.ctor : f;\n\t\t\t\tif(f){\n\t\t\t\t\tf.apply(this, a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 3) call the postscript\n\t\t\tf = this.postscript;\n\t\t\tif(f){\n\t\t\t\tf.apply(this, a);\n\t\t\t}\n\t\t};\n\t}", "function simpleConstructor(bases){\n\t\treturn function(){\n\t\t\tvar a = arguments, i = 0, f, m;\n\n\t\t\tif(!(this instanceof a.callee)){\n\t\t\t\t// not called via new, so force it\n\t\t\t\treturn applyNew(a);\n\t\t\t}\n\n\t\t\t//this._inherited = {};\n\t\t\t// perform the shaman's rituals of the original declare()\n\t\t\t// 1) do not call the preamble\n\t\t\t// 2) call the top constructor (it can use this.inherited())\n\t\t\tfor(; f = bases[i]; ++i){ // intentional assignment\n\t\t\t\tm = f._meta;\n\t\t\t\tf = m ? m.ctor : f;\n\t\t\t\tif(f){\n\t\t\t\t\tf.apply(this, a);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 3) call the postscript\n\t\t\tf = this.postscript;\n\t\t\tif(f){\n\t\t\t\tf.apply(this, a);\n\t\t\t}\n\t\t};\n\t}", "function asCtor(constr) {\n return primFreeze(asCtorOnly(constr));\n }", "function Proto() {\n\n // empty functions\n}", "function createConstructor(name, opts) {\n\t var func = create.bind(null, name);\n\n\t // Assigning defaults gives a predictable definition and prevents us from\n\t // having to do defaults checks everywhere.\n\t assign(func, defaults);\n\n\t // Inherit all options. This takes into account object literals as well as\n\t // ES2015 classes that may have inherited static props which would not be\n\t // considered \"own\".\n\t utilDefineProperties(func, getAllPropertyDescriptors(opts));\n\n\t return func;\n\t}", "function markCtor(constr, opt_Sup, opt_name) {\n enforceType(constr, 'function', opt_name);\n if (isFunc(constr)) {\n fail(\"Simple functions can't be constructors: \", constr);\n }\n if (isXo4aFunc(constr)) {\n fail(\"Exophoric functions can't be constructors: \", constr);\n }\n constr.CONSTRUCTOR___ = true;\n if (opt_Sup) {\n derive(constr, opt_Sup);\n } else if (constr !== Object) {\n fail('Only \"Object\" has no super: ', constr);\n }\n if (opt_name) {\n constr.NAME___ = String(opt_name);\n }\n if (constr !== Object && constr !== Array) {\n // Iff constr is not Object nor Array, then any object inheriting from\n // constr.prototype is a constructed object which therefore tames to\n // itself by default. We do this with AS_TAMED___ and AS_FERAL___\n // methods on the prototype so it can be overridden either by overriding\n // these methods or by pre-taming with ___.tamesTo or ___.tamesToSelf.\n constr.prototype.AS_TAMED___ =\n constr.prototype.AS_FERAL___ = function() {\n return this;\n };\n }\n return constr; // translator freezes constructor later\n }", "function FooObj(){}", "function getBlockedFunctionConstructor() {\n\n\t\t\tfunction FakeFunction(execCode) {\n\t\t\t\tvar code = \"FUNCTION_CONSTRUCTOR_DETECTED\";\n\t\t\t\tvar message = \"function constructor with code: \" + execCode;\n\t\t\t\terror = {code: code, message: message};\n\n\t\t\t\treturn function() {};\n\t\t\t}\n\n\t\t\treturn FakeFunction;\n\t\t}", "constructor( ) {}", "function Foo() { /* .. */ }", "function Ctor() {\r\n }", "function Generator() {} // 80", "function YourConstructor() {\n\t// initialization\n}", "static clear() {\n CallbackConstructorRegistry.constructors = {};\n }", "function Generator() {} // 84", "constructur() {}", "function populateConstructorExports(exports,codes,HttpError){codes.forEach(function forEachCode(code){var CodeError;var name=toIdentifier(statuses[code]);switch(codeClass(code)){case 400:CodeError=createClientErrorConstructor(HttpError,name,code);break;case 500:CodeError=createServerErrorConstructor(HttpError,name,code);break;}if(CodeError){// export the constructor\nexports[code]=CodeError;exports[name]=CodeError;}});// backwards-compatibility\nexports[\"I'mateapot\"]=deprecate.function(exports.ImATeapot,'\"I\\'mateapot\"; use \"ImATeapot\" instead');}", "function Foo() { .. }", "function ctor() {\n this.constructor = ChildFunc;\n }", "function make_class(){\n\tvar isInternal;\n\tvar constructor = function(args){\n if ( this instanceof constructor ) {\n\t\tif ( typeof this.init == \"function\" ) {\n this.init.apply( this, isInternal ? args : arguments );\n\t\t}\n } else {\n\t\tisInternal = true;\n\t\tvar instance = new constructor( arguments );\n\t\tisInternal = false;\n\t\treturn instance;\n }\n\t};\n\treturn constructor;\n }", "function make_class(){\n\tvar isInternal;\n\tvar constructor = function(args){\n if ( this instanceof constructor ) {\n\t\tif ( typeof this.init == \"function\" ) {\n this.init.apply( this, isInternal ? args : arguments );\n\t\t}\n } else {\n\t\tisInternal = true;\n\t\tvar instance = new constructor( arguments );\n\t\tisInternal = false;\n\t\treturn instance;\n }\n\t};\n\treturn constructor;\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}" ]
[ "0.72171277", "0.7024035", "0.6951186", "0.6951186", "0.6951186", "0.6951186", "0.6951186", "0.6951186", "0.6759808", "0.6600548", "0.6570523", "0.6570523", "0.6570523", "0.6484547", "0.6442678", "0.6399644", "0.639223", "0.63782364", "0.63782364", "0.6336881", "0.6275807", "0.6275807", "0.6275807", "0.6275807", "0.6275807", "0.6275807", "0.6275807", "0.6275807", "0.6275807", "0.6269236", "0.6203895", "0.6197079", "0.6194634", "0.612552", "0.6082195", "0.60474396", "0.6042943", "0.6016498", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.6006228", "0.5980589", "0.5963926", "0.59465146", "0.5914073", "0.5914073", "0.5892054", "0.58855903", "0.5854285", "0.58527714", "0.58247584", "0.57978445", "0.57886803", "0.5785473", "0.57835144", "0.5753008", "0.57426417", "0.57395464", "0.57336193", "0.5726742", "0.56987077", "0.56799525", "0.5679336", "0.56730986", "0.56730986", "0.5668962", "0.5668962", "0.5668962", "0.5668962" ]
0.0
-1
Helper for defining the .next, .throw, and .return methods of the Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype){[\"next\",\"throw\",\"return\"].forEach(function(method){prototype[method]=function(arg){return this._invoke(method,arg);};});}", "function defineIteratorMethods(prototype) { // 114\n [\"next\", \"throw\", \"return\"].forEach(function(method) { // 115\n prototype[method] = function(arg) { // 116\n return this._invoke(method, arg); // 117\n }; // 118\n }); // 119\n } // 120", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t prototype[method] = function(arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t define(prototype, method, function(arg) {\n\t return this._invoke(method, arg);\n\t });\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function(method) {\n\t define(prototype, method, function(arg) {\n\t return this._invoke(method, arg);\n\t });\n\t });\n\t }", "function defineIteratorMethods(prototype) {\r\n ['next', 'throw', 'return'].forEach(function(method) {\r\n prototype[method] = function(arg) {\r\n return this._invoke(method, arg);\r\n };\r\n });\r\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n\t [\"next\", \"throw\", \"return\"].forEach(function (method) {\n\t prototype[method] = function (arg) {\n\t return this._invoke(method, arg);\n\t };\n\t });\n\t }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n ['next', 'throw', 'return'].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n ['next', 'throw', 'return'].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n prototype[method] = function (arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }", "function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }" ]
[ "0.7480683", "0.7480683", "0.7480683", "0.7480683", "0.7480683", "0.7480683", "0.7178389", "0.6994433", "0.6994433", "0.6972576", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.6966516", "0.69511837", "0.69511837", "0.6907911", "0.68567264", "0.6824597", "0.682316", "0.682316", "0.68131447", "0.67903316", "0.67903316", "0.6786681", "0.6784969", "0.6784969", "0.67823166", "0.67809254", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.67784125", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232", "0.6773232" ]
0.0
-1
Starts trying to reconnect if reconnection is enabled and we have not started reconnecting yet
maybeReconnectOnOpen() { // Only try to reconnect if it's the first time we're connecting if (!this._reconnecting && this._reconnection && this.backoff.attempts === 0) { // keeps reconnection from firing twice for the same reconnection loop this.reconnect(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attemptReconnect(resetAndReconnect = true) {\n ConnectionManager.reconnect(resetAndReconnect);\n }", "function reconnect() {\n\n\tconsole.log(\"Reconnect called\");\n\t// Make sure there is not another reconnect attempt in progress (and that we are really not connected)\n\tif(active911.timer_controller.exists(\"reconnect\") || active911.xmpp.is_connected()) {\n\n\t\tconsole.log(\"Reconnect already in operation. Returning.\");\n\t\treturn;\n\t}\n\n\t// Set up a reconnect timer\n\tactive911.timer_controller.add(\"reconnect\",function(){\n\n\t\tif(!active911.xmpp.is_connected()) {\t// We used to make sure we were disconnected before reconnecting. But sometimes we can reach neither state, and we just need to go for it.\n\n\t\t\tconsole.log(\"Reconnect attempt\");\n\t\t\tactive911.xmpp.connect();\n\t\t}\n\n\t\treturn !active911.xmpp.is_connected();\t// Remove ourself once connected\n\n\t}, 10);\n\n\t// Connect right now\n\t// Don't do this since we may still be disconnecting\n\t/*\tif(active911.xmpp.is_disconnected()) {\n\n\t\t\tconsole.log(\"Reconnect is performing mmediate reconnect attempt\");\n\t\t\tactive911.xmpp.connect();\n\t\t\t}\n\t\t\t*/\n\n}", "async _reconnect() {\n await this._waitBackgroundConnect();\n await this._connect();\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this.reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "_reconnect () {\n if (this._reconnecting === true) return\n this._reconnecting = true\n\n log('Trying to reconnect to remote endpoint')\n this._checkInternet((online) => {\n if (!online && !cst.PM2_DEBUG) {\n log('Internet down, retry in 2 seconds ..')\n this._reconnecting = false\n return setTimeout(this._reconnect.bind(this), process.env.NODE_ENV === 'test' ? 1 : 2000)\n }\n this.connect((err) => {\n if (err || !this.isConnected()) {\n log('Endpoint down, retry in 5 seconds ...')\n this._reconnecting = false\n return setTimeout(this._reconnect.bind(this), process.env.NODE_ENV === 'test' ? 1 : 5000)\n }\n\n log('Connection etablished with remote endpoint')\n this._reconnecting = false\n this._emptyQueue()\n })\n })\n }", "_setupReconnect () {\n if (this.reconnectTimeout) {\n clearTimeout(this.reconnectTimeout)\n this.reconnectTimeout = null\n }\n\n if (this.currentRetries >= this.options.retriesAmount)\n return\n\n this.reconnectTimeout = setTimeout(this._reconnect.bind(this), 1000)\n }", "function reconnect () {\n if (connection.killed) {\n return;\n }\n\n // Make sure the connection is closed...\n try {\n connection.client.end();\n } catch (e) {}\n\n // Remove this from the available connections.\n self.connections = _.reject(self.connections, {port: port, host: host});\n connection.killed = true;\n\n // Wait and reconnect.\n setTimeout(function () {\n self.addConnection(port, host);\n }, config.check_interval);\n }", "async reconnect () {\n this.reconnecting = true;\n await this.connect();\n \n //Object.values(this.subscriptions).forEach (sub => {\n // this._subscribe (sub);\n //});\n }", "async retry_to_connect(options, reconnect_delay, retrials_left = -1) {\n let { virtual_document } = options;\n if (this.ignored_languages.has(virtual_document.language)) {\n return;\n }\n let interval = reconnect_delay * 1000;\n let success = false;\n while (retrials_left !== 0 && !success) {\n await this.connect(options)\n .then(() => {\n success = true;\n })\n .catch(e => {\n console.warn(e);\n });\n console.log('LSP: will attempt to re-connect in ' + interval / 1000 + ' seconds');\n await sleep(interval);\n // gradually increase the time delay, up to 5 sec\n interval = interval < 5 * 1000 ? interval + 500 : interval;\n }\n }", "async reconnect () {\n const delay = (t) => { // Helper function to await time-outed reconnect\n return new Promise((resolve) => {\n setTimeout(() => resolve(), t)\n })\n }\n await delay(this.delay * Math.pow(2, this.delayCounter))\n this.delayCounter++\n await this.reconn()\n }", "function attemptReconnect() {\n if (reconnecting) return;\n reconnecting = true;\n\n while (reconnectHistory[0] &&\n Date.now() - reconnectHistory[0] > 5 * 60 * 60 * 1000) {\n reconnectHistory.splice(0, 1);\n }\n\n const num = reconnectHistory.length;\n const delay = num * num * num * 1000;\n console.log(\n 'Enqueuing reconnect attempt in', delay, 'ms (Recent attempts: ', num,\n ')');\n\n setTimeout(() => {\n console.log('Attempting reconnect...');\n reconnecting = false;\n reconnectHistory.push(Date.now());\n socket.open((...args) => {\n console.log(...args);\n if (args[0]) attemptReconnect();\n });\n }, delay);\n }", "function tryReconnect() {\n reconnTimer = null;\n winston.warm(\"try to connect: %d\".grey, mongoose.connection.readyState);\n db = mongoose.connect(config.mongodb_development,function(err){\n\t if(err) {\n\t winston.error('connect mongodb error'.red,err);\n\t\t onConnectUnexpected(err);\n\t }\n\t else winston.log('mongodb connect success'.green,mongoose.connection.readyState);\n });\n}", "reconnect() {\n this.debug('Attemping to reconnect in 5500ms...');\n /**\n * Emitted whenever the client tries to reconnect to the WebSocket.\n * @event Client#reconnecting\n */\n this.client.emit(Constants.Events.RECONNECTING);\n this.connect(this.gateway, 5500, true);\n }", "reconnect() {\n this.connectionManager.reconnect();\n }", "function reconnectTimer () {\n if (!ws || ws.readyState == WebSocket.CLOSED) {\n reallyConnect();\n }\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this.reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "_wsReconnect () {\n this._log('websocket reconnecting...');\n\n if (this._options.onReconnect) {\n this._options.onReconnect();\n }\n\n this._cache.reconnectingAttempts++;\n this._ws = getWebSocket({\n url: this._url,\n protocols: this._protocols,\n options: this._options\n });\n this._initWsCallbacks();\n }", "reconnect () {\n if (!this.connected) {\n this.connected = true\n return this.connector.reconnect()\n } else {\n return Promise.resolve()\n }\n }", "reconnect() {\n if ( this.socket )\n {\n this.socket.close();\n delete this.socket;\n }\n\n this.connect();\n }", "async function attemptReconnection() {\n try {\n console.log(\"Attempting to reconnect\");\n const db = firebase.firestore();\n const rooms = db.collection(\"rooms\");\n\n pc = new RTCPeerConnection(rtcconfig);\n initDataChannel();\n const offer = await pc.createOffer();\n await pc.setLocalDescription(offer);\n\n pc.onicecandidate = async ({ candidate }) => {\n if (candidate) return;\n await rooms\n .doc(roomID.value)\n .collection(\"offer\")\n .doc(offerID.value)\n .update({ offer: { type: offer.type, sdp: offer.sdp } });\n };\n } catch (error) {\n console.log(`There was an error in an attempt to reconnect: ${error}`);\n createRoomBtn.disabled = false;\n joinRoomBtn.disabled = false;\n }\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "reconnect () {\n if (!this.connected) {\n this.connected = true;\n return this.connector.reconnect()\n } else {\n return Promise.resolve()\n }\n }", "reconnect() {\n\t\t//refreshes page to call componentDidMount() again,\n\t\t//this will force the peer to search for another connection\n\t\twindow.location.reload(true);\n\t\t//show connect button and hide disconnect button\n\t\tthis.setState({connState:true});\n\t}", "function pre() {\n\t\t// attempt to reconnect\n\t\tif (connectionRequested && !connectionEstablished) {\n\t\t\tif (parent.millis() - reconnectAttempt > reconnectInterval) {\n\t\t\t\tif ( verbose ) console.log(\"[Spacebrew::pre] attempting to reconnect to Spacebrew\");\n\t\t\t\tthis.connect( hostname, port, this.name, this.description);\n\t\t\t\treconnectAttempt = parent.millis();\n\t\t\t}\n\t\t}\n\t}", "async reconnect() {\n const conn_status = _converse.connfeedback.get('connection_status');\n\n if (api.settings.get('authentication') === _converse.ANONYMOUS) {\n await tearDown();\n await clearSession();\n }\n if (conn_status === Strophe.Status.CONNFAIL) {\n // When reconnecting with a new transport, we call setUserJID\n // so that a new resource is generated, to avoid multiple\n // server-side sessions with the same resource.\n //\n // We also call `_proto._doDisconnect` so that connection event handlers\n // for the old transport are removed.\n if (\n api.connection.isType('websocket') &&\n api.settings.get('bosh_service_url')\n ) {\n await _converse.setUserJID(_converse.bare_jid);\n _converse.connection._proto._doDisconnect();\n _converse.connection._proto = new Strophe.Bosh(_converse.connection);\n _converse.connection.service = api.settings.get('bosh_service_url');\n } else if (\n api.connection.isType('bosh') &&\n api.settings.get('websocket_url')\n ) {\n if (api.settings.get('authentication') === _converse.ANONYMOUS) {\n // When reconnecting anonymously, we need to connect with only\n // the domain, not the full JID that we had in our previous\n // (now failed) session.\n await _converse.setUserJID(api.settings.get('jid'));\n } else {\n await _converse.setUserJID(_converse.bare_jid);\n }\n _converse.connection._proto._doDisconnect();\n _converse.connection._proto = new Strophe.Websocket(\n _converse.connection\n );\n _converse.connection.service = api.settings.get('websocket_url');\n }\n } else if (\n conn_status === Strophe.Status.AUTHFAIL &&\n api.settings.get('authentication') === _converse.ANONYMOUS\n ) {\n // When reconnecting anonymously, we need to connect with only\n // the domain, not the full JID that we had in our previous\n // (now failed) session.\n await _converse.setUserJID(api.settings.get('jid'));\n }\n\n if (_converse.connection.reconnecting) {\n _converse.connection.debouncedReconnect();\n } else {\n return _converse.connection.reconnect();\n }\n }", "function user_reconnect() {\n console.log(\"User reconnected.\");\n attempt_reopen_channel = true;\n fullyUsedUp = false;\n\n // set this to true so websockets automatically reopen the channel if they fail\n open_channel = true;\n\n send_version();\n set_ui_state(UI_STATES.CONNECTED);\n}", "function activateAutoReconnect() {\n\tif(io.socket) {\n\t\tvar autoReconnectIntervalId = window.setInterval(function () {\n\t\t\t// console.log('checking if websocket is alive: state = '+ io.socket.readyState);\n\t\t\tif(io.socket != null && io.socket.readyState == 3) {\n\t\t\t\tconsole.log(\"WebSocket closed, reconnect...\");\n\t\t\t\tio.init();\n\t\t\t}\n\t\t}, 5000);\n\n\t\t// clear interval removed after pr#353 to fix reconnect after frozen tab \t\t\n\t\twindow.onbeforeunload = function() {\n\t\t//console.log('event onbeforeunload');\n\t\twindow.clearInterval(autoReconnectIntervalId);\n\t\t};\n\t}\n}", "function reconnect() {\n device.find().then(() => {\n // Connect to device\n device.connect();\n });\n}", "attemptStartIfDisconnected() {\n this.start()\n }", "reconnect () {\n this.adapter.reconnect()\n }", "SOCKET_RECONNECT(state, count) {\n state.socket.isReconnecting = true\n console.info(state.socket, count, \"reconnect socket\")\n if (count >= 3) {\n // window.location.href = '/';\n }\n }", "attemptConnect() {\n ConnectionManager.connect();\n }", "function restart() {\n setTimeout(function () {\n // There is a promise being ignored here\n // but I am currently too lazy to fix that\n client.init();\n }, 2500);\n }", "SOCKET_RECONNECT(state, count) {\n console.log('Reconnect: ', count)\n }", "function connectionStatus() {\n if (!window.connecting || retry == 20) {\n window.forcing = false;\n retry = 0;\n connectBtn.disabled = false;\n return;\n }\n retry++;\n setTimeout(connectionStatus, 1000);\n }", "checkReconnect( id, callback ) {\n if ( !this._reconnect[ id ] ) return;\n setTimeout( callback, this._wait );\n }", "async function _connect () {\n // Get current connection by name\n connection = getConnection(config.name)\n\n // If connection is no longer established, reconnect\n if (!connection.isConnected) { connection = await connection.connect() }\n }", "function onReconnect() {\n emitHello();\n $log.log(\"monitor is reconnected\");\n }", "function reconnectWebSocket() {\n window.setTimeout(() => {\n connectWebSocket();\n }, 5000);\n}", "function reconnect(err) {\n\tadapter.log.warn(\"Connection to '\" + auroraAPI.host + \":\" + auroraAPI.port + \"' lost, \" + formatError(err) + \". Try to reconnect...\");\n\tstopAdapterProcessing();\n\tsetConnectedState(false);\t\t// set disconnect state\n\tlastError = err;\n\tStartConnectTimer(true);\t\t// start connect timer\n}", "cycleSteamConnect(){\r\n\t\tsetTimeout(() => {\r\n\t\t\tif(!this.steam.loggedOn){\r\n\t\t\t\tthis.steam.log(\"attempting to reconnect\");\r\n\t\t\t\tthis.steam.connect();\r\n\t\t\t\tthis.cycleSteamConnect();\r\n\t\t\t}\r\n\t\t}, this.steamReconnectTime);\r\n\t}", "function executeReconnect(self) {\n return function() {\n if (self.state === DESTROYED || self.state === UNREFERENCED) {\n return;\n }\n\n connectNewServers(self, self.s.replicaSetState.unknownServers, function() {\n var monitoringFrequencey = self.s.replicaSetState.hasPrimary()\n ? _haInterval\n : self.s.minHeartbeatFrequencyMS;\n\n // Create a timeout\n self.intervalIds.push(new Timeout(executeReconnect(self), monitoringFrequencey).start());\n });\n };\n }", "function executeReconnect(self) {\n return function() {\n if (self.state === DESTROYED || self.state === UNREFERENCED) {\n return;\n }\n\n connectNewServers(self, self.s.replicaSetState.unknownServers, function() {\n var monitoringFrequencey = self.s.replicaSetState.hasPrimary()\n ? _haInterval\n : self.s.minHeartbeatFrequencyMS;\n\n // Create a timeout\n self.intervalIds.push(new Timeout(executeReconnect(self), monitoringFrequencey).start());\n });\n };\n }", "function executeReconnect(self) {\n return function() {\n if (self.state === DESTROYED || self.state === UNREFERENCED) {\n return;\n }\n\n connectNewServers(self, self.s.replicaSetState.unknownServers, function() {\n var monitoringFrequencey = self.s.replicaSetState.hasPrimary()\n ? _haInterval\n : self.s.minHeartbeatFrequencyMS;\n\n // Create a timeout\n self.intervalIds.push(new Timeout(executeReconnect(self), monitoringFrequencey).start());\n });\n };\n }", "function executeReconnect(self) {\n return function() {\n if(self.state == DESTROYED || self.state == UNREFERENCED) {\n return;\n }\n\n connectNewServers(self, self.s.replicaSetState.unknownServers, function() {\n var monitoringFrequencey = self.s.replicaSetState.hasPrimary()\n ? _haInterval : self.s.minHeartbeatFrequencyMS;\n\n // Create a timeout\n self.intervalIds.push(new Timeout(executeReconnect(self), monitoringFrequencey).start());\n });\n }\n }", "function renew_server_socket()\n {\n \t// check if the server was in disconnected state and is now connected\n \tvar is_server_up = checkIfServerIsUp(preferred_ip_address);\n \tif(is_server_up == true) {\n \t // clear this polling function since the server is up now\n \t console.log(\"Clearing the interval function ..\");\n \t clearInterval(new_sock_checker);\n\n \t\tconsole.log(\"Restoring primary websocket connection after disconnect mode ..\");\n \t\tinit_primary_websocket(true);\n \t \n \t $(\"#disconnected_handler\").hide();\n \t $(\"#connected_handler\").show();\n \t \n \t // setup a session for this client with the session manager\n \t registerClientSessionInFailoverMode();\n \t} \t\n }", "function enableReconnect() {\r\n \tvar button = dom.byId(\"enableReconnectButton\");\r\n \tbutton.onclick = function() {\r\n \t\tdisableReconnect();\r\n \t};\r\n \tbutton.value = 'Disable!';\r\n \treconnect = true;\r\n \tdom.byId(\"reconnectMsg\").innerHTML = 'Reconnect is Enabled!';\r\n \tmyLog( 'reconnect enabled: ' + reconnect );\r\n }", "_checkConnection(throw_error, force_reconnect) {\n\t\tlogger.debug('_checkConnection - start throw_error %s, force_reconnect %s',throw_error, force_reconnect);\n\t\tif(!this._stream) {\n\t\t\t// when there is no stream, then wait for the user to do a 'connect'\n\t\t\treturn;\n\t\t}\n\t\tlet state = getStreamState(this);\n\t\tif(this._connected || this._connect_running || state == 2) {\n\t\t\tlogger.debug('_checkConnection - this hub %s is connected or trying to connect with stream channel state %s', this._ep.getUrl(), state);\n\t\t}\n\t\telse {\n\t\t\tlogger.debug('_checkConnection - this hub %s is not connected with stream channel state %s', this._ep.getUrl(), state);\n\t\t\tif(throw_error && !force_reconnect) {\n\t\t\t\tthrow new Error('The event hub has not been connected to the event source');\n\t\t\t}\n\t\t}\n\n\t\t//reconnect will only happen when there is error callback\n\t\tif(force_reconnect) {\n\t\t\ttry {\n\t\t\t\tvar is_paused = this._stream.isPaused();\n\t\t\t\tlogger.debug('_checkConnection - grpc isPaused :%s',is_paused);\n\t\t\t\tif(is_paused) {\n\t\t\t\t\tthis._stream.resume();\n\t\t\t\t\tlogger.debug('_checkConnection - grpc resuming ');\n\t\t\t\t} else if(state != 2) {\n\t\t\t\t\t// try to reconnect\n\t\t\t\t\tthis._connected = false;\n\t\t\t\t\tthis._connect(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(error) {\n\t\t\t\tlogger.error('_checkConnection - error ::' + error.stack ? error.stack : error);\n\t\t\t\tvar err = new Error('Event hub is not connected ');\n\t\t\t\tthis._disconnect(err);\n\t\t\t}\n\t\t}\n\t}", "function checkConnectionStatus() {\n if (!client.isConnected()) {\n connect();\n }\n}", "_attemptReconnect(resolve, reject) {\n this._oldChain = \"old\";\n bitsharesjs_ws__WEBPACK_IMPORTED_MODULE_0__.Apis.reset(this._connectionManager.url, true, undefined, {\n enableOrders: true\n }).then(instance => {\n instance.init_promise.then(this._onConnect.bind(this, resolve, reject)).catch(this._onResetError.bind(this, this._connectionManager.url));\n });\n }", "function reconnectHandler (attemptNumber) {\n console.log('socket on reconnect', '#'+attemptNumber+':', subscriptionRequest);\n subscribe();\n }", "function reconnectHandler (attemptNumber) {\n console.log('socket on reconnect', '#'+attemptNumber+':', subscriptionRequest);\n subscribe();\n }", "function retryConnection() {\n retry++;\n close();\n\n if(!stopReloading) {\n log('reloading in 1s... may take some tries');\n\n window.setTimeout(function() {\n if(findGetParameter('ip') != null) {\n // ip already in href, reload\n location.reload(); // magically works\n } else {\n // add ip to url, reload\n location.href = location.href + '?ip='+document.getElementById('ip').value;\n }\n }, 2000);\n }\n\n /*delete socket; // kind of works\n\n var ttw = retry * 2;\n log('retry #'+retry+' in '+ttw+'s');\n\n window.setTimeout(connect, ttw*1000);*/\n}", "function monitor() {\n\n timer = setTimeout(function () {\n\n if (attempts >= MAX_RETRIES) {\n reject(new Error('The maximum number of retries was reached'));\n return;\n }\n\n beyond.showMessage({\n 'id': 'rpc-retrying-connection',\n 'text': 'Reintentando conexión',\n 'duration': 0\n });\n\n monitor();\n send(socket);\n\n }, TIME_OUT + (attempts * 2000));\n\n }", "initConnection() {\n\t\tconsole.debug(\"Attempting to connect to {url}...\".formatUnicorn({\n\t\t\t\"url\": this.url,\n\t\t}));\n\t\tthis.socket = new WebSocket(this.url);\n\t\tthis.addListeners(this.callbacks);\n\n\t\t// Add listener to attempt reconnect after set delay.\n\t\t// Makes for an autorepeat because failure will trigger the 'close' event.\n\t\tthis.addListeners({\n\t\t\t\"close\": function(event) {\n\t\t\t\tconsole.debug(\"Connection to {url} closed/failed, trying to reconnect in {delay} seconds.\"\n\t\t\t\t\t.formatUnicorn({\n\t\t\t\t\t\t\"url\": this.url,\n\t\t\t\t\t\t\"delay\": this.closed_repeat_delay\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\twindow.setTimeout(\n\t\t\t\t\tthis.initConnection.bind(this),\n\t\t\t\t\tthis.closed_repeat_delay * 1000\n\t\t\t\t);\n\t\t\t}.bind(this)\n\t\t});\n\t}", "function checkConnection(){\n viewModel.notOnline(!navigator.onLine);\n // requests next check in 500 ms\n setTimeout(checkConnection, 500);\n}", "reopen() {\n if (this.reopening) return\n let backoff = this.backoff.duration()\n this.reopening = true\n this.multiplexer.stop()\n if (backoff >= this.backoff.max) this.onDisconnected()\n log('reopen in %sms', backoff)\n setTimeout(() => {\n this.reopening = false\n log('reopening')\n this.open()\n }, backoff)\n }", "reconnected() {\n this.subscribe(this.replica, this.path);\n }", "function tryOpeningWebSocket() {\n if (!gWebSocketOpened) {\n console.log('Once again trying to open web socket');\n openWebSocket();\n setTimeout(function() { tryOpeningWebSocket(); }, 1000);\n }\n}", "SOCKET_RECONNECT() {\n // console.info(state, count);\n }", "startConnection() {\n // If the SDP negotiation has not been completed, return\n if (this.getHasNotRan || this.setHasNotRan) {\n if (!this.getHasNotRan || !this.setHasNotRan) {\n MsrpSdk.Logger.debug('[Session]: Unable to start connection yet. SDP negotiation in progress.');\n }\n return;\n }\n\n // Reset SDP negotiation flags\n this.getHasNotRan = true;\n this.setHasNotRan = true;\n\n // If the session has an active connection, return\n if (this.socket && !this.socket.destroyed) {\n MsrpSdk.Logger.debug(`[Session]: startConnection - Session ${this.sid} already has an active connection.`);\n return;\n }\n\n // If inactive attribute is present, do not connect\n if (this.remoteConnectionMode === 'inactive') {\n MsrpSdk.Logger.info('[Session]: Found \"a=inactive\" in remote endpoint SDP. Connection not needed.');\n return;\n }\n\n if (!this.remoteEndpoints.length || !this.localEndpoint) {\n MsrpSdk.Logger.info('[Session]: Unable to start connection. Missing remote and/or local enpoint.');\n return;\n }\n\n if (this.connectionSetup === 'active') {\n this._connectSession()\n .catch(err => {\n MsrpSdk.Logger.error(`[Session]: Failed to connect session. ${err}`);\n });\n }\n\n this.startHeartbeats();\n }", "connectToRSServer() {\n if (this.runScore && this.runScore.connecting) {\n log.info('Currently attempting connection.');\n return;\n }\n\n const serverInfo = this.serverInfo();\n this.runScore = new net.Socket();\n\n const attemptRSServerConnection = (info: { host: string, port: number }) => {\n // log.info(`Connecting to RSServer on: ${serverInfo.host}:${serverInfo.port}`);\n this.runScore.connect(info, () => {\n log.info('Connected to RSServer!');\n this.store.dispatch(setRSServerConnection(true));\n });\n }", "_updateConnectionStatus() {\r\n\t\tif (!this.db) {\r\n\t\t\tthis.connected = false;\r\n\t\t\tthis.connecting = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.client) {\r\n\t\t\tthis.connected = this.client.isConnected();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.connected = this.db.topology.isConnected();\r\n\t}", "function StartSocket()\n{\n ws = new WebSocket(\"ws://localhost:3000\");\n\n //On sucessful connection with socket server \n ws.onopen = function() {\n console.log(\"Connected with socket\");\n };\n //Message received from socket server\n ws.onmessage = function(payload) {\n console.log(payload.data);\n };\n //Trying to reconnect if the connection in down for some reason or has been severed \n ws.onclose = function() {\n console.log(\"Disconnected\");\n console.log(\"Trying again\");\n //Trying to reconnect in 5 seconds after the connection is lost\n setTimeout(function(){StartSocket()}, 5000);//recursively calling the function durring connection loss\n\n }; \n}", "maybeRestartIce() {\n // only initiators do an ice-restart to avoid conflicts.\n if (!this.isInitiator) {\n return;\n }\n if (this._maybeRestartingIce !== undefined) {\n clearTimeout(this._maybeRestartingIce);\n }\n this._maybeRestartingIce = setTimeout(() => {\n delete this._maybeRestartingIce;\n if (this.pc.iceConnectionState === 'disconnected') {\n this.restartIce();\n }\n }, 2000);\n }", "async _maybeConnect() {\n if (this._isConnectedOrConnecting) {\n return null;\n }\n\n this._isConnectedOrConnecting = true;\n await this.client.connect();\n }", "function think()\n{\n\tif(!connected)\n\t\tconnect();\n}", "function attemptConnect(remote, callback) {\n\n var connected = false;\n\n function onLedgerClosed() {\n if (isConnected(remote)) {\n connected = true;\n remote.removeListener('ledger_closed', onLedgerClosed);\n callback(null, true);\n return;\n }\n }\n\n remote.once('ledger_closed', onLedgerClosed);\n\n var timeout_duration;\n if (remote._getServer() && remote._getServer().server) {\n timeout_duration = Date.now() - remote._getServer().server._lastLedgerClose;\n } else {\n timeout_duration = 20000;\n }\n\n setTimeout(function(){\n remote.removeListener('ledger_closed', onLedgerClosed);\n if (!connected) {\n callback(new Error('Cannot connect to rippled. No \"ledger_closed\" events were heard within 20 seconds, most likely indicating that the connection to rippled has been interrupted or the rippled is unresponsive. Please check your internet connection and server settings and try again.'));\n }\n return;\n }, timeout_duration);\n\n remote.connect();\n\n}", "function connect() {\n\t\n\treconnect = true; \n\t\n var socket = new SockJS('http://localhost:8080/ws-map-update');\n stompClient = Stomp.over(socket);\n stompClient.connect({}, function (frame) {\n\t\tconsole.log(\"connecting...\"); \n console.log('Connected: ' + frame);\n\n\t\tstompClient.subscribe('/map/test', function(data) {\n\t\t\tconsole.log(\"Received data from server: \", data); \n\t\t}); \n\t\t\n\t\tstompClient.subscribe('/map/route/update', function(route) {\n\t\t\tonRouteUpdate(JSON.parse(route.body)); \n\t\t}); \n });\n\t\n\tsocket.onclose = function(e) {\n\t\t\n\t\tif( reconnect ) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconnect();\n\t\t\t }, 500);\n\t\t}\n\t};\n}", "function retry (delay) {\n setTimeout(function () {\n initializeServer()\n }, delay)\n }", "function countdownToClientReconnect(state, dT, msg) {\n var interval\n var target = Date.now() + dT\n function step() {\n var remaining = target - Date.now()\n if (remaining <= 0) {\n // stop countdown\n clearInterval(interval)\n state.conn.explanation.set(msg.replace('$TIME', 'now...'))\n\n // reconnect\n client = exports.client = null\n setupClient(state)\n } else {\n // update message\n state.conn.explanation.set(msg.replace('$TIME', 'in ' + Math.round(remaining / 1000) + 's.'))\n }\n }\n interval = setInterval(step, 1000)\n step()\n}", "SOCKET_RECONNECT(state, count) {\n // console.log('ws重新连接')\n // console.info(state, count)\n if (state.socket.isConnected) {\n Message.success({\n content: 'websocket 重新连接成功',\n duration: 4\n })\n }\n \n }", "function open_ws() {\n\tconsole.log(\"connecting to the server\");\n\tif(window.location.href.indexOf(\":343\")>=0){\n\t\tcon = new WebSocket('wss://'+IP+':9779/');\n\t\tconsole.log(\"!!!! running experimental port !!!!\");\n\t} else {\n\t\tcon = new WebSocket('wss://'+IP+':9879/');\n\t}\n\tcon.onopen = function(){\n\t\twhile($(\"#rl_msg\").length){\n\t\t\t$.fancybox.close();\t\t\t\t\t\t\t\n\t\t\t$(\"#rl_msg\").remove();\n\t\t};\n\n\t\tconsole.log(\"onOpen\");\n\t\trequest_pre_login();\n\t};\n\n\t// reacting on incoming messages\n\tcon.onmessage = function(msg) {\n\t\tconsole.log(msg);\n\t\tmsg_dec=JSON.parse(msg.data);\n\t\tparse_msg(msg_dec);\n\t};\n\tcon.onclose = function(){\n\t\tconsole.log(\"onClose\");\n\t\t// removed old existing entries\n\t\twhile($(\"#rl_msg\").length){\n\t\t\t$.fancybox.close();\t\t\t\t\t\t\t\n\t\t\t$(\"#rl_msg\").remove();\n\t\t};\n\n\t\t// remove register box .. sorry\n\t\twhile($(\"#register_input_box\").length){\n\t\t\t$.fancybox.close();\n $(\"#register_input_box\").remove();\n };\n\n\t\t// show fancybox\n\t\tshow_fancybox(\"reconnecting...\",\"rl_msg\");\n\n\t\tif(c_freeze_state!=1){\n\t\t\tconsole.log(\"running reconnect in 2 sec\");\n\t\t\tvar timeout=2000;\n\t\t\tif(fast_reconnect){\n\t\t\t\tfast_reconnect=0;\n\t\t\t\ttimeout=0;\n\t\t\t};\n\t\t\tsetTimeout(function(){ open_ws();} , timeout);\n\t\t} else {\n\t\t\tconsole.log(\"will not run reconnect, as cordoba put us to sleep\");\n\t\t};\n\t};\n}", "function handleDisconnect() {\n\tconnection = mysql.createConnection(db_config); // Recreate the connection, since\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the old one cannot be reused.\n \n\tconnection.connect(function(err) { // The server is either down\n\t if(err) { // or restarting (takes a while sometimes).\n\t\tlogger.error('Error establishing connection... retrying', err);\n\t\tsetTimeout(handleDisconnect, 2000); // We introduce a delay before attempting to reconnect,\n\t\t} \n\t\telse{\n\t\t\tconnectionResets = 0;\n\t\t} // to avoid a hot loop, and to allow our node script to\n\t}); // process asynchronous requests in the meantime.\n\t\t\t\t\t\t\t\t\t\t\t// If you're also serving http, display a 503 error.\n\tconnection.on('error', function(err) {\n\t connectionResets++;\n\t\tif (connectionResets < 5) {\t\t\t\t //try to connect to the db again 5 times at most\n\t\t\thandleDisconnect();\t \n\t\t} else {\n\t\t\tlogger.error(\"Could not establish database connection\");\n\t\t\tthrow err; \n\t\t}\n\t});\n }", "setReconnect( id, toggle ) {\n this._reconnect[ id ] = toggle ? true : false;\n }", "reconnect(code = 1000) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.close(code).finally(() => {\n\t\t\t\tthis.log(`WebSocket disconnected manually by client and a reconnection is scheduled since this.reconnect() is called!`);\n\t\t\t\tthis.connect().then(resolve).catch(reject);\n\t\t\t});\n\t\t});\n\t}", "reconnectMempoolSafe() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.connectSecondaryMempool();\n yield this.sleep(1);\n this.disconnectMempool();\n yield this.connectMempool();\n yield this.sleep(1);\n this.disconnectSecondaryMempool();\n });\n }", "function restartIrc(settings, errorName){\r\n if (!ircRestarting){\r\n ircRestarting = true;\r\n stopIrc(settings, errorName);\r\n setTimeout(function(){startIrc(settings)}, 5000);\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n}", "function restartIrc(settings, errorName){\r\n if (!ircRestarting){\r\n ircRestarting = true;\r\n stopIrc(settings, errorName);\r\n setTimeout(function(){startIrc(settings)}, 5000);\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n}", "function reInitializeApp() {\n console.log(\"Attempt Re Initialize Connection to Signiant\");\n Signiant.Mst.initialize(\n function() {\n console.log(\"Connection to Signiant App Re-established\");\n //alert(\"Connection to Signiant App Re-established\");\n },\n function() {\n console.log(\"Re-Initialize Signiant App Failed, retrying\");\n //alert(\"Signiant App Connection Lost, Retrying...\");\n reInitializeApp();\n }, {\n \"timeout\": 20000\n }\n );\n }", "SOCKET_RECONNECT() {\n //console.info(state, count);\n }", "reconnected () {\n window.location.reload() // This triggers another websocket disconnect/connect (!)\n }", "onMqttReconnection() {\r\n console.log('reconnecting to IoT... ')\r\n }", "function checkNextConnection (callback) {\n self.emit('log', 'info', 'Checking next connection');\n if (self.connectionError) {\n callback(new Error('No available connection, all connections failed.'));\n return;\n }\n self.connectionIndex++;\n if (self.connectionIndex > self.connections.length-1) {\n self.connectionIndex = 0;\n }\n var c = self.connections[self.connectionIndex];\n if (self.isHealthy(c)) {\n callback(null, c);\n }\n else if (self.canReconnect(c) && !c.connecting) {\n self.emit('log', 'info', 'Retrying to open #' + c.indexInPool);\n //try to reconnect\n c.open(function(err){\n if (err) {\n //This connection is still not good, go for the next one\n self.setUnhealthy(c);\n setTimeout(function () {\n checkNextConnection(callback);\n }, 50);\n }\n else {\n //this connection is now good\n self.setHealthy.call(self, c);\n callback(null, c);\n }\n });\n }\n else {\n //this connection is not good, try the next one\n setTimeout(function () {\n checkNextConnection(callback);\n }, 50);\n }\n }", "function refresh() {\n\t\ttry {\n\t\t\tif (!connected) {\n\t\t\t\tdoConnect();\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(\"Socket.IO is not loaded properly.\");\n\t\t}\n\t}", "function connect() {\n\t\t\tvar deferred = _core.Deferred();\n\t\t\tconsole.log(\"Attempting to connect...\");\n\t\t\tvar c = null,\n\t\t\t\tix = -1,\n\t\t\t\thandshakeComplete = false,\n\t\t\t\t_\n\n\t\t\tfunction tryNext() {\n\t\t\t\tix+=1;\n\t\t\t\tif (ix < _preferredClients.length) {\n\n\t\t\t\t\tc = new _preferredClients[ix].class(_preferredClients[ix].name);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tc.start(_uri, settings.hubs, {\n\t\t\t\t\t\tparseMessage : parseMessage,\n\t\t\t\t\t\tconnectionId : _connection ? _connection.getConnectionId() : null\n\t\t\t\t\t})\n\t\t\t\t\t\t.done(function(e) {\n\n\t\t\t\t\t\t\tconsole.warn(\"CONNECTION STABLISHED!\")\n\n\t\t\t\t\t\t\tc.onclose = function() {\n\t\t\t\t\t\t\t\tconsole.error(\"Connection was lost!!!! NOOOO!\");\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tif (_connection) {\n\t\t\t\t\t\t\t\tconsole.warn(\"[OOAOAAO] An existing connection exists! MÖÖÖRGE!\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/// Connection successful.\n\t\t\t\t\t\t\t/// Hand over the connection lifecycle to a new OringConnection\n\t\t\t\t\t\t\t_connection = Object.create(OringConnection);\n\t\t\t\t\t\t\t_connection.onclose = function() {\n\t\t\t\t\t\t\t\tconsole.warn(\"_connection closed\");\n\t\t\t\t\t\t\t\tsetTimeout(connect, 50);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_connection.start(c, function(context) {\n\t\t\t\t\t\t\t\tconsole.warn(\"context\", context);\n\t\t\t\t\t\t\t\tdeferred.resolve(context);\n\t\t\t\t\t\t\t});\t\n\n\t\t\t\t\t\t\tif (e.message) {\n\t\t\t\t\t\t\t\t_connection.onmessage(e.message);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.fail(function() {\n\t\t\t\t\t\t\tconsole.warn(\"Noo, \" + _preferredClients[ix].name + \" failed\");\n\t\t\t\t\t\t\ttryNext();\n\t\t\t\t\t\t});\n\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"All connection attempts failed. Will soon retry...\");\n\t\t\t\t\tdeferred.reject();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttryNext();\n\n\t\t\treturn deferred.promise();\n\t}", "async connect() {\n switch(this._connectionState) {\n case CONN_ST.CONNECTED:\n return;\n case CONN_ST.CONNECTING:\n await this._inProgressConnection;\n return;\n case CONN_ST.DISCONNECTED:\n break;\n case CONN_ST.DISCONNECTING:\n // TODO: should this be an error?\n // If we're disconnecting, we'll let that finish first\n await this._inProgressDisconnection;\n break;\n }\n this._connectionState = CONN_ST.CONNECTING;\n this._inProgressConnection = Promise.all([this._getClient(), this._getClient()]);\n [this._client, this._subscriptionClient] = await this._inProgressConnection;\n\n // hook up our sub message handler\n this._subscriptionClient.on('message', this._onMessage.bind(this));\n\n if (this._config.enableTestFeatures) {\n this.setTestMode(true);\n }\n\n this._inProgressConnection = null;\n this._connectionState = CONN_ST.CONNECTED;\n }", "cycleSteamLogin(){\r\n\t\tsetTimeout(() => {\r\n\t\t\tif(!this.steam.loggedOn && this.steam._connection){\r\n\t\t\t\tthis.steam.log(\"attempting to relogin\");\r\n\t\t\t\tthis.steam.user.logOn({\r\n\t\t\t\t\taccount_name: this.username,\r\n\t\t\t\t\tpassword: this.password\r\n\t\t\t\t});\r\n\t\t\t\tthis.cycleSteamLogin();\r\n\t\t\t}\r\n\t\t}, this.steamReconnectTime)\r\n\t}", "function re_connectSerial(){ \n setTimeout(function(){\n connectSerial();\n }, 2000);\n }", "clientConnected() {\n super.clientConnected('connected', this.wasConnected);\n\n this.state = 'connected';\n this.wasConnected = true;\n this.stopRetryingToConnect = false;\n }", "function reconnect(nickname, pw) {\r\n socket.emit('reconnect', nickname, pw);\r\n}", "function connect() {\n \t\t\tvar deferred = _core.Deferred();\n \t\t\tconsole.log(\"Attempting to connect...\");\n \t\t\tvar c = null,\n \t\t\t\tix = -1,\n \t\t\t\thandshakeComplete = false,\n \t\t\t\t_\n\n \t\t\tfunction tryNext() {\n \t\t\t\tix+=1;\n \t\t\t\tif (ix < _preferredClients.length) {\n\n \t\t\t\t\tc = new _preferredClients[ix].class(_preferredClients[ix].name);\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\tc.start(_uri, settings.hubs, {\n \t\t\t\t\t\tparseMessage : parseMessage,\n \t\t\t\t\t\tconnectionId : _connection ? _connection.getConnectionId() : null\n \t\t\t\t\t})\n \t\t\t\t\t\t.done(function(e) {\n\n \t\t\t\t\t\t\tconsole.warn(\"CONNECTION STABLISHED!\")\n\n \t\t\t\t\t\t\tc.onclose = function() {\n \t\t\t\t\t\t\t\tconsole.error(\"Connection was lost!!!! NOOOO!\");\n \t\t\t\t\t\t\t};\n\n \t\t\t\t\t\t\tif (_connection) {\n \t\t\t\t\t\t\t\tconsole.warn(\"[OOAOAAO] An existing connection exists! MÖÖÖRGE!\");\n \t\t\t\t\t\t\t}\n\n \t\t\t\t\t\t\t/// Connection successful.\n \t\t\t\t\t\t\t/// Hand over the connection lifecycle to a new OringConnection\n \t\t\t\t\t\t\t_connection = Object.create(OringConnection);\n \t\t\t\t\t\t\t_connection.onclose = function() {\n \t\t\t\t\t\t\t\tconsole.warn(\"_connection closed\");\n \t\t\t\t\t\t\t\tsetTimeout(connect, 50);\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t_connection.start(c, function(context) {\n \t\t\t\t\t\t\t\tconsole.warn(\"context\", context);\n \t\t\t\t\t\t\t\tdeferred.resolve(context);\n \t\t\t\t\t\t\t});\t\n\n \t\t\t\t\t\t\tif (e.message) {\n \t\t\t\t\t\t\t\t_connection.onmessage(e.message);\n \t\t\t\t\t\t\t}\n\n \t\t\t\t\t\t})\n \t\t\t\t\t\t.fail(function() {\n \t\t\t\t\t\t\tconsole.warn(\"Noo, \" + _preferredClients[ix].name + \" failed\");\n \t\t\t\t\t\t\ttryNext();\n \t\t\t\t\t\t});\n\n \t\t\t\t} else {\n \t\t\t\t\tconsole.log(\"All connection attempts failed. Will soon retry...\");\n \t\t\t\t\tdeferred.reject();\n \t\t\t\t}\n \t\t\t}\n\n \t\t\ttryNext();\n\n \t\t\treturn deferred.promise();\n \t}" ]
[ "0.78976095", "0.7827285", "0.77504957", "0.7675659", "0.766561", "0.766561", "0.766561", "0.76577926", "0.7627878", "0.75349", "0.75091213", "0.74362236", "0.73924994", "0.73695177", "0.7339763", "0.7310562", "0.7304469", "0.7269702", "0.7234667", "0.70140994", "0.70027554", "0.6988397", "0.6963743", "0.6936263", "0.68908656", "0.6885934", "0.6878972", "0.687648", "0.687648", "0.68703324", "0.6826947", "0.6816202", "0.6801101", "0.6748776", "0.67239934", "0.6524319", "0.6517923", "0.6503232", "0.6491416", "0.6482385", "0.64626986", "0.64436746", "0.6388228", "0.63864416", "0.6371387", "0.6320204", "0.6297224", "0.62859166", "0.6276725", "0.6265779", "0.6265779", "0.6265779", "0.62182075", "0.61943614", "0.61857265", "0.61632615", "0.6160956", "0.61572844", "0.6136694", "0.6136694", "0.6113506", "0.6107683", "0.6066451", "0.6063738", "0.6012516", "0.60052186", "0.5990467", "0.59591806", "0.5940753", "0.59253377", "0.5901657", "0.5894466", "0.5883857", "0.58767337", "0.5843731", "0.5831173", "0.58125013", "0.581046", "0.5798453", "0.57946527", "0.5775424", "0.5768918", "0.576407", "0.5757008", "0.57491976", "0.5740138", "0.5740138", "0.5719363", "0.5697264", "0.5693901", "0.5692069", "0.56890994", "0.56823516", "0.5677077", "0.56542814", "0.5630849", "0.56290734", "0.5595989", "0.5593977", "0.55934644" ]
0.78232354
2
Called upon transport open.
onopen() { debug("open"); // clear old subs this.cleanup(); // mark as open this._readyState = "open"; this.emitReserved("open"); // add new subs const socket = this.engine; this.subs.push(on_1.on(socket, "ping", this.onping.bind(this)), on_1.on(socket, "data", this.ondata.bind(this)), on_1.on(socket, "error", this.onerror.bind(this)), on_1.on(socket, "close", this.onclose.bind(this)), on_1.on(this.decoder, "decoded", this.ondecoded.bind(this))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: dist.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: dist.PacketType.CONNECT, data: this.auth });\n }\n }", "onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data: this.auth });\n }\n }", "onopen() {\n debug(\"transport is open - connecting\");\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data: this.auth });\n }\n }", "onopen() {\n debug(\"transport is open - connecting\");\n\n if (typeof this.auth == \"function\") {\n this.auth(data => {\n this.packet({\n type: socket_io_parser_1.PacketType.CONNECT,\n data\n });\n });\n } else {\n this.packet({\n type: socket_io_parser_1.PacketType.CONNECT,\n data: this.auth\n });\n }\n }", "open() {\n let transport;\n\n if (this.opts.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n setTimeout(() => {\n this.emit(\"error\", \"No transports available\");\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n\n this.readyState = \"opening\"; // Retry with the next transport if the transport is disabled (jsonp: false)\n\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n debug(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n }", "open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n debug(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }", "open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket$1.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }", "open() {\n let transport;\n if (\n this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1\n ) {\n transport = \"websocket\";\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n const self = this;\n setTimeout(function() {\n self.emit(\"error\", \"No transports available\");\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n debug$3(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n }", "open() {\n let transport;\n if (\n this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1\n ) {\n transport = \"websocket\";\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n const self = this;\n setTimeout(function() {\n self.emit(\"error\", \"No transports available\");\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n debug(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n }", "open() {\n let transport;\n if (\n this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1\n ) {\n transport = \"websocket\";\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n const self = this;\n setTimeout(function() {\n self.emit(\"error\", \"No transports available\");\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n debug(\"error while creating transport: %s\", e);\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n this.readyState = \"open\";\n Socket$1.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "function handleOpen() {\n $log.info('Web socket open - ', url);\n vs && vs.hide();\n\n if (fs.debugOn('txrx')) {\n $log.debug('Sending ' + pendingEvents.length + ' pending event(s)...');\n }\n pendingEvents.forEach(function (ev) {\n _send(ev);\n });\n pendingEvents = [];\n\n connectRetries = 0;\n wsUp = true;\n informListeners(host, url);\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n debug$3(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush();\n\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\n \"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause\n ) {\n debug$3(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emit(\"open\");\n this.flush(); // we check for `readyState` in case an `open`\n // listener already closed the socket\n\n if (\"open\" === this.readyState && this.opts.upgrade && this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this.readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"data\", component_bind_1.default(this, \"ondata\")));\n this.subs.push(on_1.on(socket, \"ping\", component_bind_1.default(this, \"onping\")));\n this.subs.push(on_1.on(socket, \"error\", component_bind_1.default(this, \"onerror\")));\n this.subs.push(on_1.on(socket, \"close\", component_bind_1.default(this, \"onclose\")));\n this.subs.push(on_1.on(this.decoder, \"decoded\", component_bind_1.default(this, \"ondecoded\")));\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "static async open(_, _openTimeout = 5000) {\n return new TransportU2F();\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "function onOpen() {\n\t\tconsole.log('Client socket: Connected');\n\t\tcastEvent('onOpen', event);\n\t}", "onOpen() {\n\t\t}", "function webSocket_onopen()\n\t{\n\t\tlogger_.log(\"webSocket_onopen\", \"WebSocket Verbindung geoeffnet\");\n\t\treadValueList();\n\t\tstatusChange();\n\t}", "onopen() {\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this.packet({ type: PacketType.CONNECT, data });\n });\n }\n else {\n this.packet({ type: PacketType.CONNECT, data: this.auth });\n }\n }", "_setup() {\n this.setHeaderFunc({\n 'Content-Type': 'text/event-stream',\n 'Cache-Control': 'no-cache, no-transform',\n 'Connection': 'keep-alive'\n })\n this._writeKeepAliveStream(true)\n this._setRetryInterval()\n this.send(this.connectEventName, this.uid)\n\n const timer = setInterval(this._writeKeepAliveStream.bind(this), this.heartBeatInterval)\n\n this.stream.on('close', () => {\n clearInterval(timer)\n connectionMap.delete(this.uid)\n this.transformStream.destroy()\n })\n connectionMap.set(this.uid, this)\n }", "connect () {\n if (this._readyState === this.READY_STATE.CLOSING) {\n this._nextReadyState = this.READY_STATE.OPEN\n return\n }\n\n this._nextReadyState = null\n if (this._readyState === this.READY_STATE.CLOSED) {\n this._doOpen()\n }\n }", "function webSocket_onopen()\n\t{\n\t\tstatusChange();\n\t\tconsole.log(\"[ASNeG_Client] WebSocket Verbindung geoeffnet\");\n\t\treadValueList();\n\t}", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n } // set up transport\n\n\n this.transport = transport; // set up transport listeners\n\n transport.on(\"drain\", this.onDrain.bind(this)).on(\"packet\", this.onPacket.bind(this)).on(\"error\", this.onError.bind(this)).on(\"close\", () => {\n this.onClose(\"transport close\");\n });\n }", "connect () {\n if (this.state == this.states.connected && this.socket.readyState == 'open')\n return\n\n if (!this.hasAuth())\n return this.fail('No auth parameters')\n\n this.state = this.states.connecting\n\n // To prevent duplicate messages\n this.clearSocketListeners()\n if (this.socket)\n this.socket.close()\n\n const url = this._buildUrl()\n this.socket = eio(url, this.options)\n this.socket.removeAllListeners('open')\n this.socket.removeAllListeners('error')\n this.socket.once('open', this.onOpen.bind(this))\n this.socket.once('error', (err) => {\n if (console && typeof(console.trace) == 'function') // eslint-disable-line\n console.trace(err) // eslint-disable-line\n\n if (err && err.type == 'TransportError') {\n this.fail(err)\n this._setupReconnect()\n }\n })\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_js_1.on(socket, \"ping\", this.onping.bind(this)), on_js_1.on(socket, \"data\", this.ondata.bind(this)), on_js_1.on(socket, \"error\", this.onerror.bind(this)), on_js_1.on(socket, \"close\", this.onclose.bind(this)), on_js_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "connect() {\n let _this = this;\n\n _this._continuousOpen = true;\n _this._open(() => {});\n }", "doClose() {\n const close = () => {\n debug(\"writing close packet\");\n this.write([{\n type: \"close\"\n }]);\n };\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "_onOpen() {\n this.state.connected = true;\n console.log(\"Connected...\");\n this.notify(\"open\");\n }", "handleOpen() {\n log.info(`[WS] Connected to ${WS_URI}`)\n }", "doClose() {\n const close = () => {\n debug(\"writing close packet\");\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "function onOpen( e ) {\n\t\t\t_reconnectCounter = 0;\n\t\t\t_scope.dispatchEvent( WS.ON_OPEN );\n\t\t}", "async open() {\n\t\tif (this.lock_status_id === 4) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(2);\n\t\tawait this.await_event('status:OPENED');\n\t}", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on(\"drain\", function() {\n self.onDrain();\n })\n .on(\"packet\", function(packet) {\n self.onPacket(packet);\n })\n .on(\"error\", function(e) {\n self.onError(e);\n })\n .on(\"close\", function() {\n self.onClose(\"transport close\");\n });\n }", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on(\"drain\", function() {\n self.onDrain();\n })\n .on(\"packet\", function(packet) {\n self.onPacket(packet);\n })\n .on(\"error\", function(e) {\n self.onError(e);\n })\n .on(\"close\", function() {\n self.onClose(\"transport close\");\n });\n }", "setTransport(transport) {\n debug$3(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug$3(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.transport = transport;\n\n // set up transport listeners\n transport\n .on(\"drain\", function() {\n self.onDrain();\n })\n .on(\"packet\", function(packet) {\n self.onPacket(packet);\n })\n .on(\"error\", function(e) {\n self.onError(e);\n })\n .on(\"close\", function() {\n self.onClose(\"transport close\");\n });\n }", "function peerjsOpenHandler(){\n if (_this.debug)\n console.log(\"Server started\", _this._serverPeer.id);\n\n // Reset peers\n _this._connections = {};\n \n // Trigger\n _this._triggerSystemEvent(\"$open\", {serverId: _this._serverPeer.id});\n }", "static open(): Promise<TransportNodeHidSingleton> {\n return Promise.resolve().then(() => {\n if (transportInstance) {\n log(\"hid-verbose\", \"reusing opened transport instance\");\n return transportInstance;\n }\n\n const device = getDevices()[0];\n if (!device) throw new CantOpenDevice(\"no device found\");\n log(\"hid-verbose\", \"new HID transport\");\n transportInstance = new TransportNodeHidSingleton(\n new HID.HID(device.path)\n );\n const unlisten = listenDevices(\n () => {},\n () => {\n // assume any ledger disconnection concerns current transport\n if (transportInstance) {\n transportInstance.emit(\"disconnect\");\n }\n }\n );\n const onDisconnect = () => {\n if (!transportInstance) return;\n log(\"hid-verbose\", \"transport instance was disconnected\");\n transportInstance.off(\"disconnect\", onDisconnect);\n transportInstance = null;\n unlisten();\n };\n transportInstance.on(\"disconnect\", onDisconnect);\n\n return transportInstance;\n });\n }", "function onopen() {\n\tconsole.log ('connection open!');\n\t//connection.send('echo\\r\\n'); // Send the message 'Ping' to the server\n}", "open() {\n return __awaiter(this, void 0, void 0, function* () {\n this._throwIfSenderOrConnectionClosed();\n return MessageSender.create(this._context).open();\n });\n }", "onOpen() {\n this.sendPacket({\n op: Constants.OPCodes.DISPATCH,\n d: {\n server_id: this.voiceConnection.channel.guild.id,\n user_id: this.client.user.id,\n token: this.voiceConnection.authentication.token,\n session_id: this.voiceConnection.authentication.sessionID,\n },\n }).catch(() => {\n this.emit('error', new Error('Tried to send join packet, but the WebSocket is not open.'));\n });\n }", "onOpen() { }", "$onopen(e) {\n this.state.connected = true;\n if ( typeof this.onopen === 'function' ) {\n this.onopen(e);\n }\n }", "async open()\n { \n // Open serial port\n await new Promise((resolve, reject) => {\n this.serialPort.open(function(err) { \n if (err)\n reject(err);\n else\n resolve();\n });\n });\n\n // Flush any data sitting in buffers\n await new Promise((resolve, reject) => {\n this.serialPort.flush(function(err) { \n if (err)\n reject(err);\n else\n resolve();\n });\n });\n\n // Receive data handler\n this.serialPort.on('data', this.onReceive.bind(this));\n }", "setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", reason => this.onClose(\"transport close\", reason));\n }", "function onOpen(){\n console.log('Open connections!');\n}", "onopen(evt) {\n this.webSocket.send(JSON.stringify({\n accessKey: this.accessKey,\n sessionID: this.sessionID\n }));\n }", "onDrain(messages) {\n if (this.request) this.request.close()\n this.open(messages)\n }", "setTransport(transport) {\n debug(\"setting transport %s\", transport.name);\n if (this.transport) {\n debug(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", () => {\n this.onClose(\"transport close\");\n });\n }", "_onSocketOpen(variable, evt) {\n variable._socketConnected = true;\n // EVENT: ON_OPEN\n initiateCallback(VARIABLE_CONSTANTS.EVENT.OPEN, variable, _.get(evt, 'data'), evt);\n }", "function init(options) {\n console.log('Transport init');\n new TransportView(options).render();\n}", "function OnChannelOpen()\n{\n}", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(\"State\", { qos: Number(1) });\r\n client.subscribe(\"Content\", { qos: Number(1) });\r\n\r\n }", "function HandleOpen() {\n console.log('WebSocket open');\n SetState(IconBuilding, 'Connected');\n}", "handleWebsocketOpened() {\n this.sendHeaders();\n this.flushFrameBuffer();\n }", "function closed () {\n delete self.transports[transportName]\n callback()\n }", "_specializedInitialisation()\r\n\t{\r\n\t\tLogger.log(\"Specialisation for service AVTransport\", LogType.Info);\r\n\t\tvar relativeTime = this.getVariableByName(\"RelativeTimePosition\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!relativeTime)\r\n\t\t\trelativeTime = this.getVariableByName(\"A_ARG_TYPE_GetPositionInfo_RelTime\");\r\n\t\tvar transportState = this.getVariableByName(\"TransportState\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!transportState)\r\n\t\t\ttransportState = this.getVariableByName(\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\");\r\n\r\n\t\tif (transportState)\r\n\t\t{\r\n\t\t\ttransportState.on('updated', (variable, newVal) =>\r\n\t\t\t{\r\n\t\t\t\tLogger.log(\"On transportStateUpdate : \" + newVal, LogType.DEBUG);\r\n\t\t\t\tvar actPosInfo = this.getActionByName(\"GetPositionInfo\");\r\n\t\t\t\tvar actMediaInfo = this.getActionByName(\"GetMediaInfo\");\r\n\t\t\t\t/*\r\n\t\t\t\t“STOPPED” R\r\n\t\t\t\t“PLAYING” R\r\n\t\t\t\t“TRANSITIONING” O\r\n\t\t\t\t”PAUSED_PLAYBACK” O\r\n\t\t\t\t“PAUSED_RECORDING” O\r\n\t\t\t\t“RECORDING” O\r\n\t\t\t\t“NO_MEDIA_PRESENT”\r\n\t\t\t\t */\r\n\t\t\t\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this._intervalUpdateRelativeTime)\r\n\t\t\t\t\t\tclearInterval(this._intervalUpdateRelativeTime);\r\n\t\t\t\t\tif (newVal == \"PLAYING\" || newVal == \"RECORDING\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t} );\r\n\t\t\t\t\t\t//Déclenche la maj toutes les 4 secondes\r\n\t\t\t\t\t\tthis._intervalUpdateRelativeTime = setInterval(() =>{\r\n\t\t\t\t\t\t\t\t//Logger.log(\"On autoUpdate\", LogType.DEBUG);\r\n\t\t\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t}\t);\r\n\t\t\t\t\t\t\t}, 4000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//else if (newVal == \"STOPPED\" || newVal == \"PAUSED_PLAYBACK\" || newVal == \"PAUSED_RECORDING\" || newVal == \"NO_MEDIA_PRESENT\")\r\n\t\t\t\t//{\r\n\t\t\t\t//\r\n\t\t\t\t//}\r\n\t\t\t\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\r\n\t\t\t\tif (newVal == \"TRANSITIONING\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{InstanceID: 0}\t);\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{InstanceID: 0} );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newVal == \"STOPPED\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t});\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{\tInstanceID: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}", "function onOpen(evt) \n{\n\tconsole.info(\"onOpen\");\n websocketConnectedCallback();\n}", "function onOpen(evt) {\n console.log(\"Connected to server\");\n}", "_onPeersConnectionReady() {\n if (this.arePeersReady() && !this._transferStarted) {\n this._fileTransfer = new FileTransferHelper(this._fileModel, this);\n this._fileTransfer.initTransfer();\n }\n }", "onTransportError() {\n if (this.status === _UAStatus.STATUS_USER_CLOSED) {\n return;\n }\n this.status = _UAStatus.STATUS_NOT_READY;\n }", "addTransport(transport) {\n\t\tthis.transports.push(transport);\n\n\t\t// Whenever a peer is connected send it to the topology\n\t\ttransport.on('connected', peer => this[topologySymbol].addPeer(peer));\n\n\t\tif(this.started) {\n\t\t\ttransport.start({\n\t\t\t\tid: this.id,\n\t\t\t\tname: this.name,\n\t\t\t\tendpoint: this.endpoint\n\t\t\t});\n\t\t}\n\t}", "function onOpen() {\n console.log('Port Open');\n console.log(`Baud Rate: ${port.options.baudRate}`);\n const outString = String.fromCharCode(output);\n console.log(`Sent:\\t\\t${outString}`);\n port.write(outString);\n}", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "function connectionEstablished() {\n log.info('Connected to OpenTSDB.');\n\n opentsdb = socket;\n\n // Handle errors on this connection\n opentsdb.addListener('error', function(err) {\n log.error('OpenTSDB network error: ' + err);\n opentsdb.destroy();\n opentsdb = undefined; // Cause a reconnection\n });\n opentsdb.removeListener('error', connectionError);\n\n // Allow this socket to be destroyed\n opentsdb.unref();\n\n callback(null, socket);\n }", "function onopen() {\n this._logger.info('Connection created.');\n\n this._debuggerObj.setEngineMode(this._debuggerObj.ENGINE_MODE.RUN);\n\n if (this._surface.getPanelProperty('chart.active')) {\n this._surface.toggleButton(true, 'chart-record-button');\n }\n\n if (this._surface.getPanelProperty('run.active')) {\n this._surface.updateRunPanel(this._surface.RUN_UPDATE_TYPE.ALL, this._debuggerObj, this._session);\n }\n\n if (this._surface.getPanelProperty('watch.active')) {\n this._surface.updateWatchPanelButtons(this._debuggerObj);\n }\n\n this._surface.disableActionButtons(false);\n this._surface.toggleButton(false, 'connect-to-button');\n}", "function _onConnectionOpened(duplexChannelEventArgs)\r\n {\r\n try\r\n {\r\n // Tell message bus which service shall be associated with this connection.\r\n var aMessage = new MessageBusMessage();\r\n aMessage.Request = 20;\r\n aMessage.Id = myChannelId;\r\n var aSerializedMessage = mySerializer.serialize(aMessage);\r\n myMessageBusOutputChannel.sendMessage(aSerializedMessage);\r\n }\r\n catch (err)\r\n {\r\n logError(myTracedObject + \"failed to open connection with message bus.\", err);\r\n throw err;\r\n }\r\n }", "_open() {\n if (!this._afterOpened.closed) {\n this._afterOpened.next();\n this._afterOpened.complete();\n }\n }", "run() {\n this.reset();\n this.socket = net.createConnection({\n 'host': this.host.address, \n 'port': this.port,\n }).setKeepAlive(true); // .setNoDelay(true)\n this.socket.on('connect', this.onConnect);\n this.socket.on('error', this.onError);\n this.socket.on('data', this.onData);\n this.socket.on('close', this.onClose);\n }", "_onTimeout() {\n this.send(421, 'Timeout - closing connection');\n }", "init() { //ref : nobleDFU.js this._transport.init();\n\n if (this._isInitialized) {\n return Promise.resolve();\n }\n\n const targetAddress = this._transportParameters.targetAddress;\n const targetAddressType = this._transportParameters.targetAddressType;\n //NU \n const prnValue = this._transportParameters.prnValue || DEFAULT_PRN;\n //NU\n const mtuSize = this._transportParameters.mtuSize || MAX_SUPPORTED_MTU_SIZE;\n\n this._debug(`Initializing DFU transport with targetAddress: ${targetAddress}, ` +\n `targetAddressType: ${targetAddressType}, prnValue: ${prnValue}, mtuSize: ${mtuSize}.`);\n\n var BogusReConnect = false;\n return this._connectIfNeeded(targetAddress, targetAddressType, BogusReConnect)\n .then(device => this._enterDfuMode(device))\n /*TODO\n .then(device => this._getCharacteristicIds(device))\n .then(characteristicIds => {\n const controlPointId = characteristicIds.controlPointId;\n const packetId = characteristicIds.packetId;\n this._controlPointService = new ControlPointService(this._adapter, controlPointId);\n this._objectWriter = new ObjectWriter(this._adapter, controlPointId, packetId);\n this._objectWriter.on('packetWritten', progress => {\n this._emitTransferEvent(progress.offset, progress.type);\n });\n return this._startCharacteristicsNotifications(controlPointId);\n })\n //NU .then(() => this._setPrn(prnValue))\n //NU .then(() => this._setMtuSize(mtuSize))\n TODO*/\n .then( device => this._startControlPointNotifications(device) ) //karel\n .then(() => this._isInitialized = true);\n }", "function onOpen(evt) {\n\n \n console.log(\"Connected\"); // Log connection state\n \n doSend(\"getLEDState\"); // Get the current state of the LED\n}", "function ws_onopen() {\n self._machine.transition('open');\n }", "function ws_onopen() {\n self._machine.transition('open');\n }", "function ws_onopen() {\n self._machine.transition('open');\n }", "function ws_onopen() {\n self._machine.transition('open');\n }", "onSocketFullyConnected() {\n this.debugOut('socketFullyConnected()');\n this.last_socket_error = null;\n this.emit('open');\n }", "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }", "function onupgrade(to){\n\t if (transport && to.name != transport.name) {\n\t debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t freezeTransport();\n\t }\n\t }" ]
[ "0.7343769", "0.7301768", "0.7301768", "0.72755814", "0.69748294", "0.6871645", "0.67919064", "0.6669136", "0.6636399", "0.6636399", "0.6511857", "0.6488991", "0.6443836", "0.64396596", "0.64396596", "0.64012074", "0.6347581", "0.63349086", "0.6322032", "0.6322032", "0.6258143", "0.62384546", "0.62384546", "0.62384546", "0.6210255", "0.61948663", "0.61873376", "0.6147263", "0.6102672", "0.607321", "0.60604453", "0.60366875", "0.5989961", "0.5960473", "0.5927806", "0.58890504", "0.5850483", "0.5841339", "0.5833128", "0.58278084", "0.58238363", "0.5809927", "0.5805525", "0.57857907", "0.578311", "0.578311", "0.57641906", "0.5762889", "0.57618034", "0.57618034", "0.5727922", "0.57201606", "0.57182527", "0.56998605", "0.56796443", "0.56514424", "0.5648917", "0.5632909", "0.5631853", "0.5630312", "0.5624365", "0.56044686", "0.5598303", "0.55960035", "0.5577608", "0.55713594", "0.5568394", "0.556781", "0.5564261", "0.555772", "0.55550396", "0.55454355", "0.55411035", "0.55375975", "0.55284464", "0.5516337", "0.5510248", "0.550647", "0.5500238", "0.5500238", "0.5500238", "0.54872584", "0.54765207", "0.5472915", "0.54556787", "0.54429805", "0.5427874", "0.5420809", "0.5413715", "0.5408557", "0.5408557", "0.540284", "0.540284", "0.53995156", "0.53846806", "0.53846806", "0.53846806", "0.53846806", "0.53846806", "0.53846806" ]
0.60273004
32
Called upon a ping.
onping() { this.emitReserved("ping"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onping() {\n this.emitReserved(\"ping\");\n }", "onping() {\n this.emitReserved(\"ping\");\n }", "ping(){\n\t\tLogger.debug(`Message with ping request being responded to by pong...`);\n\t\tthis.send('pong', Global.mac);\n\t}", "onping() {\n super.emit(\"ping\");\n }", "onping() {\n super.emit(\"ping\");\n }", "onping() {\n super.emit(\"ping\");\n }", "function ping(){\n \t//Sends postRequest to finds info about game\n sendMessage(\"get\",{\n \tkey: \"ping\",\n \tgameHash: GAME_HASH,\n \tplayerId: PLAYER_ID\n }, pingCallback);\n \n \n }", "Ping() {\n\t\tServer.SendMessage(\"/ping\");\n\t}", "function _wsPing() {\n log.verbose(LOG_PREFIX, 'Ping.');\n _self.emit('ping');\n }", "function ping(){var value=+new Date;primus.timers.clear(\"ping\");primus._write(\"primus::ping::\"+value);primus.emit(\"outgoing::ping\",value);primus.timers.setTimeout(\"pong\",pong,primus.options.pong)}", "function ping() {\n\tconsole.log(\"*** ping ***\")\n}", "sendPing(){\n if(!this.isAlive()){\n this.emit('noPong');\n if(this.state === CONST.STATE.CONNECTED){\n this.state = CONST.STATE.NOT_CONNECTED;\n }\n return;\n }\n this.setHalfDead();\n this.ping();\n }", "function pingCheck() {\n if (timer) { clearTimeout(timer);}\n var pong = new Date() - start;\n if (typeof callback === \"function\") {\n callback(pong);\n }\n }", "function onPing () {\n util.log('Player ' + this.id +' has pinged.')\n //this.broadcast.emit('pong');\n socket.sockets.emit('pong');\n\n}", "function testPing() {\n\t\tlet start = Date.now(),\n\t\t\tdiff;\n\n\t\tmakeRequest(\"GET\",`${config.host_url}test_ping`,true,false,false,\"json\",function (status,response) {\n\t\t\tif (status >= 200 && status < 400) {\n\t\t\t\tdiff = response.time - start;\n\t\t\t\tif (diff > 0 && (diff < pingMinimal || pingMinimal == 0)) {\n\t\t\t\t\tpingMinimal = diff;\n\t\t\t\t}\n\t\t\t\tpingAttempts--;\n\t\t\t\tif(pingAttempts > 0) {\n\t\t\t\t\ttestPing();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "sendPing() {\n this._sendMessage({\n msg: 'ping',\n id: Random.default().id(20),\n });\n }", "function testPing(host) {\n $network.startPinging({\n host: host,\n timeout: 2.0,\n period: 1.0,\n payloadSize: 1,\n ttl: 49,\n didReceiveReply: summary => {\n hostIp = summary.host;\n $network.stopPinging();\n if (hostIp) {\n $('ip').text = hostIp;\n getIpInfo(hostIp);\n startPing(hostIp);\n }\n },\n didReceiveUnexpectedReply: _ => actionErr(_),\n didFail: _ => actionErr(_),\n didFailToSendPing: _ => actionErr(_),\n });\n}", "async ping() {\n }", "sendPing() {\n this.broadcast('wc:ping');\n }", "function noop(){} // ping callback", "function ping() {\n // console.log('ping');\n b.digitalWrite(trigger, 0);\n startTime = process.hrtime();\n}", "function ping() {\n // console.log('ping');\n b.digitalWrite(trigger, 0);\n startTime = process.hrtime();\n}", "function onPing(req, res) {\n req.setEncoding('utf8');\n res.writeHead( 200, {'Content-Type': 'text/plain'} );\n res.end( \"PONG\" );\n}", "function testPing() {\n vertx.eventBus.send(\"ping-address\", \"ping!\", function(reply) {\n vassert.assertEquals(\"pong!\", reply);\n /*\n If we get here, the test is complete\n You must always call `testComplete()` at the end. Remember that testing is *asynchronous* so\n we cannot assume the test is complete by the time the test method has finished executing like\n in standard synchronous tests\n */\n vassert.testComplete();\n });\n}", "function Main_Ping()\n{\n\t//do nothing\n}", "function ping() {\r\n return client.ping({\r\n // ping usually has a 3000ms timeout\r\n requestTimeout: 3000,\r\n });\r\n}", "function handlePing(req, res){\n var response = { ping: new Date }\n res.jsonp(response)\n}", "function ping() {\r\n\t\t\treturn $izendaRsQuery.query('ping', [], {\r\n\t\t\t\tdataType: 'text'\r\n\t\t\t});\r\n\t\t}", "function sendPing() {\n let now = new Date().getTime()\n // record new ping\n current = current + 1\n let last_message = [current, now, -1]\n\n // Try to send new ping.\n if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {\n // Send the data to peer as a message\n try {\n messaging.peerSocket.send(last_message)\n status = ''\n } catch (error) {\n status = error\n last_message[2] = '-2'\n }\n // Record the event.\n past.push(last_message)\n } else {\n // Peer is not open. Don't sent anything.\n status = ''\n last_message[2] = '-3'\n last_message[1] = 0\n let previous_message = past[past.length - 1]\n if (previous_message && previous_message[2] == '-3') {\n // Last message was also for a closed.\n // Don't add a new event, just update the last one.\n previous_message[0] = current\n previous_message[1] = Math.round((now - state_changed) / 1000)\n } else {\n // Record the new event type.\n past.push(last_message)\n }\n }\n\n // Remove old entries.\n if (past.length > LINES) {\n past = past.slice((past.length - LINES), past.length)\n }\n}", "run() {\n\n\t\tif (this.sequence.number == this.settings.sequences) {\n\n\t\t\t//If we reached the maximum amount of icmp_echo_request stop the interval\n\t\t\tthis.stop()\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t//Create the ping message\n\t\tlet ping = {\n\n\t\t\tservice : 'ping',\n\t\t\tdata : {\n\t\t\t\ttype: 'ping-request',\n\t\t\t\tsequence : this.sequence.number,\n\t\t\t\ttimestamp : new Date()\n\t\t\t}\n\n\t\t}\n\n\t\tthis.sendData(this.host, ping)\n\n\t\t//!!!Remember to increment the sequence number\n\t\tthis.sequence.number++;\n\n\t}", "ping() {\n return \"pong!\"\n }", "function ping(websiteState) {\n websiteState.pingLoop = setTimeout(() => fetchCurrentlyPlaying(websiteState),\n websiteState.api.pingDelay);\n}", "onMessage(message) {\n if (message.type === 'PING_SERVER') {\n const { id, playerID } = message.data;\n const handler = this.pingChecks[id];\n if (handler) {\n const { resolve, start } = handler;\n const end = Date.now();\n const time = end - start;\n resolve(time);\n delete this.pingChecks[id];\n }\n } else {\n GM.emitEvent(message);\n }\n }", "function ping() {\n return 'pong';\n}", "function startPing()\n{\n var heartbeat = 90;\n heartbeatTimerId = window.setInterval(opPing, heartbeat*1000);\n}", "function ping() {\n return \"pong\";\n}", "ping(num) {\n num = 1 * num || 1;\n for (let i = 0; i < num; i++) {\n this.emit('ping');\n }\n }", "ping(srcContact, data, cb) {\n\n if (srcContact) this._welcomeIfNewNode(srcContact);\n cb(null, true);\n\n }", "function lobbyPing(){\n \n \tsendMessage(\"get\",{\n \t\tkey: \"lobbyPing\",\n \t\tgameHash: GAME_HASH,\n \t\tplayerId: PLAYER_ID\n \t}, lobbyPingCallback);\n }", "function pingUpdate()\n{\n\t// Reset variables\n\tjoomlaupdate_stat_files = 0;\n\tjoomlaupdate_stat_inbytes = 0;\n\tjoomlaupdate_stat_outbytes = 0;\n\n\t// Do AJAX post\n\tvar post = {task : 'ping'};\n\tdoAjax(post, function(data){\n\t\tstartUpdate(data);\n\t});\n}", "function next () {\n let start = new Date()\n let buf = rnd(PING_LENGTH)\n shake.write(buf)\n shake.read(PING_LENGTH, (err, bufBack) => {\n let end = new Date()\n if (err || !buf.equals(bufBack)) {\n const err = new Error('Received wrong ping ack')\n return self.emit('error', err)\n }\n\n self.emit('ping', end - start)\n\n if (stop) {\n return\n }\n next()\n })\n }", "function next () {\n let start = new Date()\n let buf = rnd(PING_LENGTH)\n shake.write(buf)\n shake.read(PING_LENGTH, (err, bufBack) => {\n let end = new Date()\n if (err || !buf.equals(bufBack)) {\n const err = new Error('Received wrong ping ack')\n return self.emit('error', err)\n }\n\n self.emit('ping', end - start)\n\n if (stop) {\n return\n }\n next()\n })\n }", "ackHeartbeat() {\n this.debug(`Heartbeat acknowledged, latency of ${Date.now() - this.lastPingTimestamp}ms`);\n this.client._pong(this.lastPingTimestamp);\n }", "function handlePingMsg(msg, id, ip_address, port, routing_table, awaiting_acks, socket) {\n ackDirect(msg.target_id, msg.ip_address, msg.port, ip_address, port, socket);\n if (msg.target_id !== id) {\n ping(msg.target_id,\n msg.sender_id,\n id,\n routing_table,\n awaiting_acks,\n socket);\n }\n}", "function pingCommand(arguments, receivedMessage) {\n receivedMessage.channel.send(\"Pong!\");\n}", "function Ping(data){\n //urls used for constant monitoring\n this.website = data.url;\n //uptime count before sending uptime message\n this.upTime = data.upTime;\n this.downTime = 10;\n //counter for when to send up time or down time messages\n this.upTimeCounter = 0;\n this.downTimeCounter = 0;\n //total time running monitor\n this.runningCounter = 0;\n //delay between ping website checks\n this.delay = data.delay;\n //number of repititions before ending monitor service\n this.repetitions = data.reps;\n //handle holds interval ID to allow it to be cleared\n this.handle = null;\n //method used by ping\n this.method = 'GET';\n \n}", "function meshPing(self)\n{\n Object.keys(self.lines).forEach(function(line){\n var hn = self.lines[line];\n // have to be elected or a line induced by the app\n if(!hn.elected && !hn.forApp) return;\n // approx no more than once a minute\n if(Date.now() - hn.sentAt < 45*1000) return;\n // seek ourself to discover any new hashnames closer to us for the buckets\n send(self, hn, {js:{seek:self.hashname, see:nearby(self, hn.hashname)}});\n });\n}", "function ping(html) {\r\n return 'Display last response payload'\r\n}", "_handlePingMessage () {\n window.clearTimeout(this._pingTimeout)\n\n if (this.isConnected()) {\n this._pingTimeout = window.setTimeout(() => {\n this.emit(PeerSoxClient.EVENT_PEER_TIMEOUT)\n this._rtc.close()\n this._socket.close()\n }, this._peerTimeout * 1000)\n }\n }", "function ping(suspect_id, source_id, id, routing_table, awaiting_acks, socket) {\n route(suspect_id, id, routing_table, function(route_id) {\n if (route_id === id) return;\n var msg = messages.ping(source_id || id, suspect_id, routing_table[id].ip, routing_table[id].port);\n send(msg, route_id, id, routing_table, awaiting_acks, socket, { no_ping: true });\n awaiting_acks[suspect_id] = setTimeout(function() {\n delete awaiting_acks[suspect_id];\n delete routing_table[suspect_id];\n }, 10000);\n });\n}", "function pingCallback() {\n\n $.get('Window/ping/ ', function(response) {\n\n if (response == \"blocked\") {\n $('#block').triggerHandler('click');\n return;\n }\n\n if (response == 'dead') {\n\n alertify.alert('Sua sessão expirou, favor fazer login novamente.', function() {\n window.close();\n });\n }\n }, 'text');\n\n }", "async ping() {\n let res = await this[store].get(this.key('Root', 'Ping'));\n return true;\n }", "function pong(){primus.timers.clear(\"pong\");//\n// The network events already captured the offline event.\n//\nif(!primus.online)return;primus.online=false;primus.emit(\"offline\");primus.emit(\"incoming::end\")}", "function templatePing(event, data, next) {\n\n console.log(process.pid + \" received \" + data.data + \" from \" + data.pid);\n\n // Req is passed through by the event emitter (specifically, not normally done)\n // options.req.flash('info','Fired from an ' + event + ' listener in the page rendering process ... You are: ' + (options.req.session.user ? options.req.session.user.username : \" The Invisible Man/Woman!\"));\n return next({data:\"Goodbye\",pid:process.pid});\n\n}", "function sendPing() {\n var task = new Task(\"ping\");\n var jsonStringTask = JSON.stringify(task);\n webSocket.send(jsonStringTask);\n}", "function ping() {\n var ping = new Audio();\n ping.src = \"audio/ping.mp3\";\n ping.play();\n }", "function displayPing(message, pingMessage) {\n message.channel.send(Tools.setupDefaultEmbed().setDescription(pingMessage)).then(msg => {\n let pingValue = calculateTimeDifferenceBetweenTwoMessages(message, msg);\n msg.edit(Tools.setupDefaultEmbed().setDescription(pingMessage + \" | \" + pingValue + \" ms\"));\n })\n\n}", "function startPing()\n{\n /* init vars */\n ping_id = null;\n ping_loop = null;\n ping_ip = null;\n \n /* get ip for the ping */\n ping_ip = $('#ping_dest_hostname').val();\n\n /* disable form */\n $('#ping_dest_hostname').attr('disabled', true);\n $('#button_ping').attr('disabled', true);\n $('#div_submit_ping').attr('class', 'button_submit_disabled');\n \n /* put status ping in correct way */\n $('#ping_status > span').attr('class', 'loading');\n $('#ping_status > b').text(ping_ip);\n showStatusPing('#ping_status_starting');\n \n /* init counters */\n $('#ping_sent').text('0');\n $('#ping_recv').text('0');\n $('#ping_avgrtt').text('0');\n \n /* send first ajax request */\n sendRequest('/maintenance/tests',\n\t\tajaxCbInitPing,\n\t\t{'action' : 'ping', 'run' : 'start', 'ping_dest_hostname' : ping_ip});\n}", "get ping() {\r\n return this.lastReceivedAt === -1 ? -1 : (this.lastReceivedAt - this.lastAckedAt);\r\n }", "function initPingPong() {\n Log.debug(\"init ping pong...\");\n ExtMsg.listen('content.ping', function(message) {\n return new Promise((resolve, _) => {\n if (message.type == 'ping') {\n Log.debug(\"sending pong\");\n resolve('pong');\n }\n });\n });\n}", "static async ping(req, res) {\n return res.sendResponse({\n success: true,\n message: 'Pong'\n });\n }", "function logPagePing(pageTitle)\n {\n\n var sb = requestStringBuilder(configEncodeBase64);\n sb.add('e', 'pp'); // 'pp' for Page Ping\n sb.add('page', pageTitle);\n sb.addRaw('pp_mix', minXOffset); // Global\n sb.addRaw('pp_max', maxXOffset); // Global\n sb.addRaw('pp_miy', minYOffset); // Global\n sb.addRaw('pp_may', maxYOffset); // Global\n resetMaxScrolls();\n var request = getRequest(sb, 'pagePing');\n sendRequest(request, configTrackerPause);\n }", "function doPingTest() {\n\tvar el = this;\n\tvar id = el.id.split(\"_\");\t// Id should be in the form inp_pingdst2\n\tif (id.length !== 2) return;\n\tid = id[1];\t// pingdst2\n\n\t// get peripheral elements\n\tvar waitIcon=$(\"#\" + id + \"_wait\");\n\tvar pingResult=$(\"#\" + id + \"_stat\");\n\n\tel.value = el.value.trim(); // trim white spaces from copy and paste\n\tvar server = el.value;\n\t// bypass if no server is available\n\tif(server.length==0) {\n\t\t// hide pinging icon\n\t\twaitIcon.hide();\n\t\tpingResult.hide();\n\t\treturn;\n\t}\n\n\t// bypass if we have no change in the server\n\tif(el.server === server) return;\n\tel.server = server;\n\n\tif (el.pinging === true) return;\t// do nothing if already pinging\n\n\t// don't ping if IP or domain name is invalid\n\tif (!(isValidIpAddress(server) || is_valid_domain_name(server) || isValidIpv6Address(server))) {\n\t\tpingResult.html(_(\"fail\"));\n\t\tpingResult.show();\n\t\treturn ;\n\t}\n\n\tel.pinging = true;\n\twaitIcon.show();\n\tpingResult.hide();\n\n\t$.getJSON( \"./cgi-bin/ltph.cgi\",\n\t\t{reqtype :\"ping\", reqparam: server},\n\t\tfunction(res){\n\t\t\tel.pinging = false;\n\t\t\twaitIcon.hide();\n\t\t\tpingResult.html((res.cgiresult == 0)? _(\"succ\"): _(\"fail\"));\n\t\t\tpingResult.show();\n\t\t\tif(el.server !== el.value) {\t// trigger keyup if we have a new server\n\t\t\t\t$(el).trigger(\"keyup\");\n\t\t\t}\n\t\t}\n\t);\n}", "static async ping (ip) {\n const result = await ping.promise.probe(ip);\n return result;\n }", "function ping(ipAddressText, endpoint, totalSeconds, timeDisplay) {\n const xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n const response = this.responseText;\n console.log(response);\n repeatPing = setTimeout(function() {\n ping(ipAddressText, endpoint, totalSeconds, timeDisplay);\n }, 5000);\n if (response == \"true\") {\n changeColor(endpoint, \"#A5CA93\");\n resetClock(totalSeconds, timeDisplay);\n startClock(totalSeconds, timeDisplay);\n } else {\n changeColor(endpoint, \"#f44e4e\");\n resetClock(totalSeconds, timeDisplay);\n startClock(totalSeconds, timeDisplay);\n }\n }\n };\n xhttp.open(\"POST\", \"http://localhost:8080\", true);\n xhttp.send(ipAddressText);\n }", "function _wsPong() {\n log.verbose(LOG_PREFIX, 'Pong.');\n _self.emit('pong');\n }", "function pingPhone(){\n //console.log(\"pinging\");\n if (peerSocket.readyState === peerSocket.OPEN){\n peerSocket.send({time: Date.now()})\n }\n}", "_pingDevice () {\n this._ble.read(\n BoostBLE.service,\n BoostBLE.characteristic,\n false\n );\n }", "function diagImpl_PingURL(diagnostic) {\n try {\n rlCrossSubDomainAjax.call({\n type: 'GET',\n url: rlMandator.replaceCoreUrl(diagnostic.pingURL),\n success: function(data) {\n var stat = STATE_SUCCESS;\n if (diagnostic.isHealthcheck) {\n if (!data.data) {\n if(console){\n console.log('result for call \"'+diagnostic.diagId+'\" does not contain expected element \"data\"');\n }\n stat = STATE_FAILED;\n }\n else if (!data.data.result) {\n if(console){\n console.log('result for call \"'+diagnostic.diagId+'\" does not contain expected element \"data.result\"');\n }\n stat = STATE_FAILED;\n }\n else {\n var result = data.data.result;\n if (!result || result.toLowerCase() !== 'ok') {\n if ( result.toLowerCase() === 'warn' ) {\n stat = STATE_WARN;\n }\n else {\n stat = STATE_FAILED;\n }\n }\n }\n }\n setStatus(diagnostic.diagId, stat);\n processQueue();\n },\n error: function(e) {\n setStatus(diagnostic.diagId, STATE_FAILED);\n processQueue();\n },\n timeout: diagnostic.timeout ? diagnostic.timeout : TIMEOUT\n });\n } catch(e) {\n setStatus(diagnostic.diagId, STATE_FAILED, \"AJAX exception\");\n processQueue();\n }\n }", "function ping(url, sCallback, eCallback){\n $.ajax({\n url: url,\n //cache:false,\n success: function(result){\n sCallback();\n },\n error: function(result){\n eCallback();\n }\n });\n}", "function checkAlive() {\n for(var i = 0; i < pingSet.length; i++) {\n var ip = pingSet[i];\n setTimeout(pingHost(ip), 1000);\n }\n}", "servePing() {\n if (this.uibRouter === undefined) throw new Error('this.uibRouter is undefined')\n\n this.uibRouter.get('/ping', (req, res) => {\n res.status(204).end()\n })\n this.routers.user.push( { name: 'Ping', path: `${this.uib.httpRoot}/uibuilder/ping`, desc: 'Ping/keep-alive endpoint, returns 201', type: 'Endpoint' } )\n }", "ping(jid, success, error, timeout) {\n this._addPingExecutionTimestamp();\n\n const iq = Object(strophe_js__WEBPACK_IMPORTED_MODULE_1__[\"$iq\"])({\n type: 'get',\n to: jid\n });\n iq.c('ping', {\n xmlns: strophe_js__WEBPACK_IMPORTED_MODULE_1__[\"Strophe\"].NS.PING\n });\n this.connection.sendIQ(iq, success, error, timeout);\n }", "async _pingDevice(device, host) {\n const session = ping.createSession();\n let online;\n let ms;\n let ip;\n\n try {\n if (ipRegex({exact: true, includeBoundaries: true}).test(host)) {\n ip = host;\n } else {\n ip = (await promisify(dns.lookup)(host)).address;\n }\n ms = await new Promise((resolve, reject) => {\n let start = Date.now();\n // Sent is undefined sometimes for unknown reasons,\n // so start is used instead.\n session.pingHost(ip, (err, _target, sent, rcvd) => {\n if (err) reject(err);\n else resolve(rcvd - (sent || start));\n });\n });\n\n if (ms < 1) ms = 1;\n\n online = true;\n } catch (_err) {\n ms = 0;\n online = false;\n } finally {\n session.close();\n }\n\n this._pingStore.updateDevicePing(device, online, ms);\n }", "doCallbackAndEnableBackgroundPinging() {\n this._beSatisfiedWith = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._counter = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._suitableNodeFound = true;\n this._pingInBackGround = true;\n }", "function pingSync() {\n const url = httpURL( 'ping' )\n try {\n\n const response = syncRequest( 'GET', url, {\n timeout: 500\n } )\n\n if ( response.statusCode != 200 )\n return false\n\n const data = JSON.parse( response.body )\n return data == 'pong'\n } catch ( error ) {\n return false\n }\n\n }", "function ping_the_rest() {\n this._pinger.addNodes(this._nodesToPing.map(a => a.url), false, \"app_init.check_latency_feedback_rest\");\n\n this._pinger.pingNodes(this._callback);\n }", "heartbeat () {\n }", "async _pingService(service, url) {\n const start = Date.now();\n let online;\n\n try {\n await request.get(url)\n .timeout(this._serviceTimeout)\n // Don't follow redirects and consider 3xx status codes as\n // being successful.\n .redirects(0)\n .ok(res => res.status < 400);\n\n online = true;\n } catch (_err) {\n online = false;\n }\n\n // Get request time in milliseconds if successful, 0 otherwise.\n const ms = online ? Date.now() - start : 0;\n\n // Update the ping details.\n this._pingStore.updateServicePing(service, online, ms);\n }", "function ping(_, node) {\n return \"\\\\ping{\".concat(node.username, \"}\");\n}", "ping(jid, success, error, timeout) {\n this._addPingExecutionTimestamp();\n\n const iq = $iq({\n type: 'get',\n to: jid\n });\n\n iq.c('ping', { xmlns: Strophe.NS.PING });\n this.connection.sendIQ2(iq, { timeout })\n .then(success, error);\n }", "ping(jid, success, error, timeout) {\n this._addPingExecutionTimestamp();\n\n const iq = $iq({\n type: 'get',\n to: jid\n });\n\n iq.c('ping', { xmlns: Strophe.NS.PING });\n this.connection.sendIQ2(iq, { timeout })\n .then(success, error);\n }", "sendPing() {\n Object.keys(this.sessionsDict).forEach(key => {\n this.sessionsDict[key].write(\"@ping@\\n\");\n });\n }", "function pingClients() {\n\tvar length = players.length;\n\tfor(var i = 0; i < length; i++) {\n\t\tif (players[i].id) {\n\t\t\tpings[players[i].id] = { time: Date.now(), ping: 0 };\n\t\t\t//console.log('Ping? '+ players[i].id); //log filler\n\t\t\tgame.sockets[players[i].id].emit('ping');\n\t\t}\n\t}\n}", "function templatePing(event,options,next) {\n \n // Req is passed through by the event emitter (specifically, not normally done)\n options.req.flash('info','Fired from an ' + event + ' listener in the page rendering process ... You are: ' + (options.req.session.user ? options.req.session.user.username : \" The Invisible Man/Woman!\")); \n return next();\n \n}", "function start() {\n setInterval(ping, 3000);\n }", "function pingURL(url, callback) {\n // append a random number, to prevent browsers caching the ping image\n var rand = Math.random();\n wtolog('Pinging url ' + url.app_url + ' using image ' + url.img_url + '?r=' + rand);\n var img = $('<img class=\"pingimg\"/>')\n img.attr('url', url.app_url);\n img.attr('status', 'down'); // default down, changed in onLoad\n img.load(function (e) {\n\t// So that we know it's been loaded\n\twtolog('ping successful');\n\tjQuery(this).attr('status', 'up');\n });\n img.attr('src', url.img_url + '?r=' + rand);\n jQuery('#pingImages').append(img);\n\n // And call the callback in TIMEOUT seconds, to see whether it's been loaded\n setTimeout(function () {\n\tif (img.attr('status') == 'down') wtolog('URL is down');\n\telse wtolog('URL is up');\n\tcallback(url, img.attr('status'));\n }, TIMEOUT*1000);\n}", "function replyPing(){\n message.channel.send('pong! I am Crypto Bot.\\nType: \">help\" for help(without double quotes)') ;\n }", "async fetch() {\n return await ping()\n }", "function pingDevice(deviceId) {\n return particle.callFunction({deviceId: deviceId, name: 'ping', auth: token });\n}", "function ajaxCbInitPing(response) \n{\n /* get init ajax packet */\n var status_val = getResponseAttrElement(response, 'status', 'val');\n var status_text = getResponseAttrElement(response, 'status', 'text');\n\n if(status_val != \"living\") \n {\n\tendPing(status_text);\n } \n else\n {\n\tping_id = getResponseElement(response, 'id');\n\t\n\t/* put stop button active */\n\t$('#button_ping').attr('disabled', false);\n\t$('#button_ping_launch').css('display', 'none');\n\t$('#button_ping_stop').css('display', '');\n\t$('#div_submit_ping').attr('class', 'button_submit');\n\t\n\t/* change status msg */\n\tshowStatusPing('#ping_status_custom');\n\t$('#ping_status_custom').text(status_text);\n\t\n\tping_loop = setInterval(\"sendRequest('/maintenance/tests', ajaxCbUpdatePing, {'action' : 'ping', 'run' : 'status', 'id' : '\" + ping_id + \"'})\", 1700);\n }\n}", "async function ping() {\n let x, y = clientPool.length;\n while(x < y) {\n con.send(clientPool[x], 'ping', con.NET.PINGPONG);\n ++x;\n }\n\n setTimeout(() => { ping() }, 3000);\n}", "function server_ping()\n {\n $http.get('/api/v1/me/ping').success(function (json) {\n //console.log(json);\n }); \n }", "function sendHeartbeat() {\n _.forOwn(_this.socks, function (sock) {\n sock.write('hb');\n });\n setTimeout(sendHeartbeat, _this.heartbeatFreq);\n }", "sendPong() {\n const pong = { type: SOCKET_MESSAGE_TYPES.PONG };\n this.send(pong);\n }", "function pingAll(hosts) {\r\n if (stopTimer) clearTimeout(stopTimer);\r\n\r\n if (!hosts) {\r\n hosts = [];\r\n for (var i = 0; i < adapter.config.devices.length; i++) {\r\n hosts.push(adapter.config.devices[i].ip);\r\n }\r\n }\r\n if (!hosts.length) {\r\n timer = setTimeout(function () {\r\n pingAll();\r\n }, adapter.config.interval);\r\n return;\r\n }\r\n\r\n var ip = hosts.pop();\r\n adapter.log.debug('Pinging ' + ip);\r\n\r\n ping.probe(ip, {log: adapter.log.debug}, function (err, result) {\r\n if (err) adapter.log.error(err);\r\n if (result) {\r\n adapter.log.debug('Ping result for ' + result.host + ': ' + result.alive + ' in ' + (result.ms === null ? '-' : result.ms) + 'ms');\r\n adapter.setState({device: '', channel: host ? host.replace(/[.\\s]+/g, '_') : '', state: result.host.replace(/[.\\s]+/g, '_')}, {val: result.alive, ack: true});\r\n //adapter.setState({device: '', channel: host, state: result.host.replace(/[.\\s]+/g, '_') + '.ms'}, {val: result.ms, ack: true});\r\n }\r\n if (!isStopping) {\r\n setTimeout(function () {\r\n pingAll(hosts);\r\n }, 0);\r\n }\r\n });\r\n}", "function pingServer()//Find Code ---------- SP1001\r\n{\r\n\tif (window.XMLHttpRequest)\r\n\t{// code for IE7+, Firefox, Chrome, Opera, Safari\r\n\t\tpingXML=new XMLHttpRequest();\r\n\t}\r\n\telse\r\n\t{// code for IE6, IE5\r\n\t\tpingXML=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n \t}\r\n\t\r\n\t\r\n\tpingXML.onreadystatechange=function()\r\n\t{\r\n\t\tif (pingXML.readyState==4 && pingXML.status==200)\r\n\t\t{\r\n\t\t}\r\n\t}\r\n\t\r\n\tpingCount++;\r\n\tpingXML.open(\"GET\",\"PingImpl.php?pingCount=\"+pingCount,true);\r\n\tpingXML.send();\r\n}", "async cmd_ping(params) {\n let [ to, msg ] = params\n\n let toBot = BOTS[to.toUpperCase()]\n\n if ( !toBot ) throw {\n reason: `bot \"${to}\" not found`,\n }\n\n console.log(`ping: to: ${to}, msg: ${JSON.stringify(msg)}`)\n\n return this.query({\n url: \"/chat/sendmessage/\",\n body: {\n kind: \"private\",\n msg,\n target_id: toBot.id,\n },\n })\n }", "function pingRover (ping_msg, ros_msg) {\n appendToConsole(ping_msg)\n appendToConsole(ros_msg)\n scrollToBottom()\n}", "async function ping(message, pingCount) {\n let data = stringToByteArray(message);\n let sendCount = 0;\n let receiveCount = 0;\n do {\n pingCount -= 1;\n echoRetries = 3;\n sendCount += 1;\n // send ping packet\n await radio.sendPacket(CHANNEL, data, RESEND_COUNT, RESEND_DELAY);\n // try to receive echo packet\n do {\n echoRetries -= 1;\n // try to receive echo packet\n let packets = await radio.getPackets(CHANNEL, RCV_TIMEOUT);\n // check packets\n let success = false;\n packets.forEach(p => {\n let ps = p.reduce((s, c) => { s += String.fromCharCode(c); return s; }, '');\n if (ps === message) { success = true; }\n });\n if (success) {\n receiveCount += 1;\n break;\n }\n } while (echoRetries > 0);\n } while (pingCount > 0);\n return receiveCount / sendCount;\n}" ]
[ "0.776418", "0.776418", "0.7735137", "0.7547586", "0.7547586", "0.74601215", "0.74397814", "0.74303377", "0.74279314", "0.7378363", "0.73283696", "0.717668", "0.7074319", "0.7053587", "0.69453806", "0.6942994", "0.68753606", "0.6821996", "0.6817834", "0.68038607", "0.6657586", "0.6657586", "0.66174036", "0.6582959", "0.6476486", "0.6446787", "0.64315736", "0.6431088", "0.6417814", "0.64147115", "0.64028245", "0.63910246", "0.6384136", "0.63778615", "0.6343387", "0.6338781", "0.63370055", "0.6310618", "0.628201", "0.62776387", "0.6225234", "0.6225234", "0.62072057", "0.6180932", "0.6180269", "0.616878", "0.61492836", "0.61475384", "0.61290765", "0.6113661", "0.610543", "0.6074522", "0.60630214", "0.6028832", "0.6016142", "0.6003487", "0.59505534", "0.5940325", "0.5939755", "0.5933258", "0.5933192", "0.5904108", "0.58912057", "0.58901095", "0.5884764", "0.58794487", "0.584769", "0.5834714", "0.58268", "0.5824474", "0.58155924", "0.5783493", "0.577963", "0.5767436", "0.57615626", "0.57535547", "0.5751117", "0.57227355", "0.5718472", "0.57142794", "0.57114035", "0.57114035", "0.5663831", "0.563919", "0.5638764", "0.5638649", "0.5626757", "0.5612074", "0.55885565", "0.55884546", "0.55648154", "0.55263245", "0.5519103", "0.5510563", "0.5509611", "0.5502006", "0.5498612", "0.54935217", "0.54793775", "0.54753697" ]
0.7597325
3
Called when parser fully decodes a packet.
ondecoded(packet) { this.emitReserved("packet", packet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n this.emitReserved(\"packet\", packet);\n }", "ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }", "function onDecodeComplete(data) {\n webAudio.decodedBuffer = data;\n // Call all handlers that were waiting for this decode to finish, and clear the handler list.\n webAudio.onDecodeComplete.forEach(function(e) { e(); });\n webAudio.onDecodeComplete = undefined; // Don't allow more callback handlers since audio has finished decoding.\n }", "function deFramer(onFrame) {\n var buffer;\n var state = 0;\n var length = 0;\n var offset;\n return function parse(chunk) {\n for (var i = 0, l = chunk.length; i < l; i++) {\n switch (state) {\n case 0: length |= chunk[i] << 24; state = 1; break;\n case 1: length |= chunk[i] << 16; state = 2; break;\n case 2: length |= chunk[i] << 8; state = 3; break;\n case 3: length |= chunk[i]; state = 4;\n buffer = bops.create(length);\n offset = 0;\n break;\n case 4:\n var len = l - i;\n var emit = false;\n if (len + offset >= length) {\n emit = true;\n len = length - offset;\n }\n // TODO: optimize for case where a copy isn't needed can a slice can\n // be used instead?\n bops.copy(chunk, buffer, offset, i, i + len);\n offset += len;\n i += len - 1;\n if (emit) {\n state = 0;\n length = 0;\n var _buffer = buffer\n buffer = undefined;\n offset = undefined;\n onFrame(_buffer);\n }\n break;\n }\n }\n };\n}", "parseComplete(data) {\n this.reset();\n this.end(data);\n }", "Decode(string, EncodingType, X500NameFlags) {\n\n }", "onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }", "onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }", "onPacket(packet) {\n super.emit(\"packet\", packet);\n }", "readResetResponsePacket(packet, out, opts, info) {\n if (packet.peek() !== 0x00) {\n return this.throwNewError(\n 'unexpected packet',\n false,\n info,\n '42000',\n Errors.ER_RESET_BAD_PACKET\n );\n }\n\n packet.skip(1); //skip header\n packet.skipLengthCodedNumber(); //affected rows\n packet.skipLengthCodedNumber(); //insert ids\n\n info.status = packet.readUInt16();\n this.successEnd(null);\n }", "function onDecodeSuccess (buffer) {\r\n\t\tvar source = context.createBufferSource();\r\n\t\tsource.buffer = buffer;\r\n\t\tsource.connect(context.destination);\r\n\t\tsource.start(0);\r\n\t}", "function decodeData(ev) {\n const { data } = ev;\n const message = JSON.parse(Pako.ungzip(data, { to: 'string' }));\n return message;\n }", "function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }", "decode(buffer) {\n return this._decoder.decode(buffer);\n }", "function onDecodingSuccess(buffer) {\n if (buffer) {\n bufferList[bufferIndex] = buffer;\n } else {\n onDecodingError('unknown');\n }\n\n endIfAllURLsResolved();\n }", "function decode(data) {\n var current = data.data;\n for (var i = data.encoding.length - 1; i >= 0; i--) {\n current = Decoder.decodeStep(current, data.encoding[i]);\n }\n return current;\n }", "function decode (rawPackage, callback) {\n cbor.decodeFirst(rawPackage, (err, pkt) => {\n callback(err, err === null ? exchangeKeys(pkt, false) : null);\n });\n}", "decode() {\n this.generateIobPips(this.pin, this.tile, this.style, this.pad);\n }", "function decodeListener() {\n\tloadingtext.style.visibility = \"hidden\";\n\tconst vals = JSON.parse(this.responseText);\n\tconst birthV = vals.b;\n\tbirthForm.value = birthV;\n\tbirth = parseRule(birthV);\n\tconst survivalV = vals.s;\n\tsurvivalForm.value = survivalV;\n\tsurvival = parseRule(survivalV);\n\tconst rle = vals.d;\n\tdecodeRLE(rle);\n }", "deinitParser() {\n console.log(\"CaptionsParser :: deinitParser\");\n }", "function MyParser() {\n\tTransform.call(this);\n\n\t// buffer the first 8 bytes written\n\tthis._bytes(8 + 15, this.onheader);\n}", "function parsePacket(packet, connection) {\n\tlet packetType = packet[0];\n\tlet key = stringDecoder.write(packet.slice(1, 6));\n\tlet user = userManager.getUser(key);\n\n\tlet data = packet.slice(6);\n\tswitch(packetType) {\n\t\tcase packetTypes.REQUEST_AUTH:\n\t\t\tauthorize(connection);\n\t\t\tbreak;\n\t\tcase packetTypes.REQUEST_JOIN_OR_CREATE_LOBBY:\n\t\t\tlobbymanager.joinOrCreateLobby(user, packetTypes.REQUEST_JOIN_OR_CREATE_LOBBY);\n\t\t\tbreak;\n\t\tcase packetTypes.DATA_SYNC:\n\t\t\tlobbymanager.syncData(user, packetTypes.DATA_SYNC, data);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tlogger.logWarning(`Invalid packet type: ${packetType}`);\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "function Decode(fPort, bytes) {\n return Decoder(bytes, fPort);\n}", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "function onDownloadedChunk() {\n if (playback.downloadedAudio.value && playback.downloadedVideo.value) {\n playback.downloadedAudio.removeListener(onDownloadedChunk);\n playback.downloadedVideo.removeListener(onDownloadedChunk);\n _dlprestart();\n }\n }", "function dataCallback(d) {\n\n//\tconsole.log(d);\n\n\tif (insidePacket === false && dataBuffer.length > 0 && dataBuffer[0] === 0x7e) {\n\t\tinsidePacket = true;\n\t}\n\n\t// We're not inside a packet and we're not looking at a packet\n\t// header, so something went wrong. Look for the 7e.\n\tif (insidePacket === false && d[0] != 0x7e) {\n\t\tvar startPosition = -1;\n\t\tfor (var i = 0; i < d.length; i++) {\n\t\t\tif (d[i] === 0x7e) {\n\t\t\t\tstartPosition = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If we found a 0x7e, then cut the packet so that's the\n\t\t// new start. If not, then just return from the callback,\n\t\t// because there's nothing we can do until the next\n\t\t// packet comes in.\n\t\tif (startPosition !== -1) {\n\t\t\td = d.slice(startPosition);\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// If we are at the beginning of a packet, then note that fact.\n\tif (d[0] === 0x7e) {\n\t\tinsidePacket = true;\n\t}\n\n\t// Count the number of characters that need to be escaped\n\tvar escapedCharacters = 0;\n\tfor (var i = 0; i < d.length; i++) {\n\t\tif (d[i] === 0x7D) {\n\t\t\tescapedCharacters++;\n\t\t}\n\t}\n\n\t// Create a new buffer to hold all of the data after the\n\t// characters have been escaped\n\tvar escapedData = Buffer.alloc(d.length - escapedCharacters);\n\tvar escapedIndex = 0;\n\n\t// Apply the escape-character logic to the incoming data\n\tfor (var i = 0; i < d.length; i++) {\n\t\tif (isEscape) {\n\t\t\tescapedData[escapedIndex] = d[i] ^ 0x20;\n\t\t\tescapedIndex++;\n\t\t\tisEscape = false;\n\t\t} else if (d[i] === 0x7D) {\n\t\t\tisEscape = true;\n\t\t} else {\n\t\t\tescapedData[escapedIndex] = d[i];\n\t\t\tescapedIndex++;\n\t\t}\n\t}\n\n\t// Add the escaped data to the data buffer\n\tdataBuffer = Buffer.concat([dataBuffer, escapedData]);\n\n\t// We need at least three bytes.\n\t// The first two bytes should always be 0x7e to denote\n\t// the start of a new packet. The third byte is the length.\n\t// Once we have the length we can grab the whole packet and\n\t// process it.\n\tif (dataBuffer.length >= 3) {\n\t\tvar length = dataBuffer[2] + 4;\n\t\t// We have the entire RF data (the length attribute)\n\t\t// and the 15 bytes of header data, so we can process\n\t\t// the packet.\n\t\tif (dataBuffer.length >= length) {\n\t\t\tvar dataPacket = dataBuffer.slice(0, length);\n\t\t\tdataBuffer = dataBuffer.slice(length);\n\t\t\tdataEmitter.emit(\"data\", dataPacket);\n\t\t\tinsidePacket = false;\n\t\t}\n\t}\n}", "function decodeBuffer(dbuff) {\n if (dbuff.readInt16BE(Offset.MagicNumber) === MagicNumber) { // Confirm the return packet is in the BYOND format.\n const size = dbuff.readUInt16BE(Offset.ExpectedDataLength) - 1; // Byte size of the string/floating-point (minus the identifier byte).\n const data = dbuff.slice(Offset.Data, Offset.Data + size); // Take the data section\n if (dbuff[Offset.DataTypeIdentifier] === Identifier.String) { // ASCII String.\n return String.fromCharCode(...data); // Return the data section as a string\n }\n else {\n return data;\n }\n }\n}", "function inPop(self, packet)\n{\n if(!Array.isArray(packet.js.pop) || packet.js.pop.length == 0) return warn(\"invalid pop of\", packet.js.pop, \"from\", packet.from);\n if(!dhash.isSHA1(packet.js.from)) return warn(\"invalid pop from of\", packet.js.from, \"from\", packet.from);\n\n packet.js.pop.forEach(function(address){\n var pop = seen(self, address);\n if(!pop.line) return warn(\"pop requested for\", address, \"but no line, from\", packet.from);\n var popping = {js:{popping:[packet.js.from, packet.from.ip, packet.from.port].join(',')}};\n send(self, pop, popping);\n });\n delete packet.js.pop;\n}", "function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }", "_unpackData() {\n const buf = new DbObjectPickleBuffer(this.packedData);\n buf.readHeader(this);\n this._unpackDataFromBuf(buf);\n this.packedData = undefined;\n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "_ensureUnpacked() {\n if (this.packedData) {\n this._unpackData();\n }\n }", "function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }", "function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }", "function Decompress(cb) {\n this.G = Gunzip;\n this.I = Inflate;\n this.Z = Unzlib;\n this.ondata = cb;\n }", "onend() {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n }", "function handleDecodeSegment(\n message,\n key,\n cipher,\n mode,\n pad,\n output_format = 'utf8',\n is_message_hex = undefined\n ) {\n switch ( cipher ) {\n case 0:\n return _discordCrypt.__blowfish512_decrypt(\n message,\n key,\n mode,\n pad,\n output_format,\n is_message_hex\n );\n case 1:\n return _discordCrypt.__aes256_decrypt( message, key, mode, pad, output_format, is_message_hex );\n case 2:\n return _discordCrypt.__camellia256_decrypt(\n message,\n key,\n mode,\n pad,\n output_format,\n is_message_hex\n );\n case 3:\n return _discordCrypt.__idea128_decrypt( message, key, mode, pad, output_format, is_message_hex );\n case 4:\n return _discordCrypt.__tripledes192_decrypt( message,\n key,\n mode,\n pad,\n output_format,\n is_message_hex\n );\n default:\n return null;\n }\n }", "function onData(chunk) {\n try {\n parse(chunk);\n } catch (err) {\n self.emit(\"error\", err);\n }\n }", "function Decoder(bytes, port) {\n // Decode an uplink message from a buffer\n // (array) of bytes to an object of fields.\n var decoded = {};\n\n if (! (port === 3))\n return null;\n\n // see catena-message-port3-format.md\n // i is used as the index into the message. Start with the flag byte.\n // note that there's no discriminator.\n // test vectors are also available there.\n var i = 0;\n // fetch the bitmap.\n var flags = bytes[i++];\n\n if (flags & 0x1) {\n // set Vraw to a uint16, and increment pointer\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n // interpret uint16 as an int16 instead.\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n // scale and save in result.\n decoded.Vbat = Vraw / 4096.0;\n }\n\n if (flags & 0x2) {\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n decoded.VDD = Vraw / 4096.0;\n }\n\n if (flags & 0x4) {\n var iBoot = bytes[i];\n i += 1;\n decoded.boot = iBoot;\n }\n\n if (flags & 0x8) {\n // we have temp, pressure, RH\n var tRaw = (bytes[i] << 8) + bytes[i + 1];\n if (tRaw & 0x8000)\n tRaw = -0x10000 + tRaw;\n i += 2;\n var rhRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n\n decoded.t = tRaw / 256;\n decoded.rh = rhRaw / 65535.0 * 100;\n decoded.tDew = dewpoint(decoded.t, decoded.rh);\n decoded.tHeatIndexC = CalculateHeatIndexCelsius(decoded.t, decoded.rh);\n }\n\n if (flags & 0x10) {\n // we have light irradiance info\n var irradiance = {};\n decoded.irradiance = irradiance;\n\n var lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.IR = lightRaw;\n\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.White = lightRaw;\n\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.UV = lightRaw;\n }\n\n if (flags & 0x20) {\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n decoded.Vbus = Vraw / 4096.0;\n }\n\n // at this point, decoded has the real values.\n return decoded;\n}", "_packetReceived(packet) {\n this._lastPacketTime = Date.now();\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.TRACE, () => packet.toString());\n // Special case some packets to update and maintain internal state\n switch (packet.FCType) {\n case constants.FCTYPE.DETAILS:\n case constants.FCTYPE.ROOMHELPER:\n case constants.FCTYPE.SESSIONSTATE:\n case constants.FCTYPE.ADDFRIEND:\n case constants.FCTYPE.ADDIGNORE:\n case constants.FCTYPE.CMESG:\n case constants.FCTYPE.PMESG:\n case constants.FCTYPE.TXPROFILE:\n case constants.FCTYPE.USERNAMELOOKUP:\n case constants.FCTYPE.MYCAMSTATE:\n case constants.FCTYPE.MYWEBCAM:\n case constants.FCTYPE.JOINCHAN:\n // According to the site code, these packets can all trigger a user state update\n this._lastStatePacketTime = this._lastPacketTime;\n // This case updates our available tokens (yes the logic is insane, but it's lifted right from MFC code...)\n if (packet.FCType === constants.FCTYPE.DETAILS && packet.nTo === this.sessionId) {\n this._tokens = (packet.nArg1 > 2147483647) ? ((4294967297 - packet.nArg1) * -1) : packet.nArg1;\n }\n // And these specific cases don't update state...\n if ((packet.FCType === constants.FCTYPE.DETAILS && packet.nFrom === constants.FCTYPE.TOKENINC) ||\n // 100 here is taken directly from MFC's top.js and has no additional\n // explanation. My best guess is that it is intended to reference the\n // constant: USER.ID_START. But since I'm not certain, I'll leave this\n // \"magic\" number here.\n (packet.FCType === constants.FCTYPE.ROOMHELPER && packet.nArg2 < 100) ||\n (packet.FCType === constants.FCTYPE.JOINCHAN && packet.nArg2 === constants.FCCHAN.PART)) {\n break;\n }\n if (packet.FCType === constants.FCTYPE.ROOMHELPER) {\n if (packet.nArg2 >= 100 || packet.nArg2 === constants.FCRESPONSE.SUCCESS) {\n this._roomHelperStatus.set(packet.nArg1, true);\n }\n if (packet.nArg2 === constants.FCRESPONSE.SUSPEND) {\n this._roomHelperStatus.set(packet.nArg1, false);\n }\n }\n // Ok, we're good, merge if there's anything to merge\n if (packet.sMessage !== undefined) {\n const msg = packet.sMessage;\n const lv = msg.lv;\n const sid = msg.sid;\n let uid = msg.uid;\n if (uid === 0 && sid > 0) {\n uid = sid;\n }\n if (uid === undefined && packet.aboutModel !== undefined) {\n uid = packet.aboutModel.uid;\n }\n // Only merge models (when we can tell). Unfortunately not every SESSIONSTATE\n // packet has a user level property. So this is no worse than we had been doing\n // before in terms of merging non-models...\n if (uid !== undefined && uid !== -1 && (lv === undefined || lv === constants.FCLEVEL.MODEL)) {\n // If we know this is a model, get her instance and create it\n // if it does not exist. Otherwise, don't create an instance\n // for someone that might not be a model.\n const possibleModel = Model_1.Model.getModel(uid, lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(msg);\n }\n }\n }\n break;\n case constants.FCTYPE.TAGS:\n const tagPayload = packet.sMessage;\n if (typeof tagPayload === \"object\") {\n for (const key in tagPayload) {\n if (tagPayload.hasOwnProperty(key)) {\n const possibleModel = Model_1.Model.getModel(key);\n if (possibleModel !== undefined) {\n possibleModel.mergeTags(tagPayload[key]);\n }\n }\n }\n }\n break;\n case constants.FCTYPE.BOOKMARKS:\n const bmMsg = packet.sMessage;\n if (Array.isArray(bmMsg.bookmarks)) {\n bmMsg.bookmarks.forEach((b) => {\n const possibleModel = Model_1.Model.getModel(b.uid);\n if (possibleModel !== undefined) {\n possibleModel.merge(b);\n }\n });\n }\n break;\n case constants.FCTYPE.EXTDATA:\n if (packet.nTo === this.sessionId && packet.nArg2 === constants.FCWOPT.REDIS_JSON) {\n this._handleExtData(packet.sMessage).catch((reason) => {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.WARNING, () => `WARNING: _packetReceived caught rejection from _handleExtData: ${reason}`);\n });\n }\n break;\n case constants.FCTYPE.METRICS:\n // For METRICS, nTO is an FCTYPE indicating the type of data that's\n // starting or ending, nArg1 is the count of data received so far, and nArg2\n // is the total count of data, so when nArg1 === nArg2, we're done for that data\n // Note that after MFC server updates on 2017-04-18, Metrics packets are rarely,\n // or possibly never, sent\n break;\n case constants.FCTYPE.MANAGELIST:\n if (packet.nArg2 > 0 && packet.sMessage !== undefined && packet.sMessage.rdata !== undefined) {\n const rdata = this.processListData(packet.sMessage.rdata);\n const nType = packet.nArg2;\n switch (nType) {\n case constants.FCL.ROOMMATES:\n if (Array.isArray(rdata)) {\n rdata.forEach((viewer) => {\n if (viewer !== undefined) {\n const possibleModel = Model_1.Model.getModel(viewer.uid, viewer.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(viewer);\n }\n }\n });\n }\n break;\n case constants.FCL.CAMS:\n if (Array.isArray(rdata)) {\n rdata.forEach((model) => {\n if (model !== undefined) {\n const possibleModel = Model_1.Model.getModel(model.uid, model.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(model);\n }\n }\n });\n if (!this._completedModels) {\n this._completedModels = true;\n if (this._completedTags) {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, `[CLIENT] emitting: CLIENT_MODELSLOADED`);\n this.emit(\"CLIENT_MODELSLOADED\");\n }\n }\n }\n break;\n case constants.FCL.FRIENDS:\n if (Array.isArray(rdata)) {\n rdata.forEach((model) => {\n if (model !== undefined) {\n const possibleModel = Model_1.Model.getModel(model.uid, model.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(model);\n }\n }\n });\n }\n break;\n case constants.FCL.IGNORES:\n if (Array.isArray(rdata)) {\n rdata.forEach((user) => {\n if (user !== undefined) {\n const possibleModel = Model_1.Model.getModel(user.uid, user.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(user);\n }\n }\n });\n }\n break;\n case constants.FCL.TAGS:\n const tagPayload2 = rdata;\n if (tagPayload2 !== undefined) {\n for (const key in tagPayload2) {\n if (tagPayload2.hasOwnProperty(key)) {\n const possibleModel = Model_1.Model.getModel(key);\n if (possibleModel !== undefined) {\n possibleModel.mergeTags(tagPayload2[key]);\n }\n }\n }\n if (!this._completedTags) {\n this._completedTags = true;\n if (this._completedModels) {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, `[CLIENT] emitting: CLIENT_MODELSLOADED`);\n this.emit(\"CLIENT_MODELSLOADED\");\n }\n }\n }\n break;\n case constants.FCL.SHARE_CLUBS:\n // @TODO\n break;\n case constants.FCL.SHARE_CLUBMEMBERSHIPS:\n // @TODO\n break;\n case constants.FCL.SHARE_CLUBSHOWS:\n if (Array.isArray(rdata)) {\n rdata.forEach((message) => {\n this._packetReceived(new Packet_1.Packet(constants.FCTYPE.CLUBSHOW, \n // tslint:disable-next-line:no-any\n message.model, packet.nTo, packet.nArg1, packet.nArg2, 0, message));\n });\n }\n break;\n default:\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.WARNING, () => `WARNING: _packetReceived unhandled list type on MANAGELIST packet: ${nType}`);\n }\n }\n break;\n case constants.FCTYPE.ROOMDATA:\n if (packet.nArg1 === 0 && packet.nArg2 === 0) {\n if (Array.isArray(packet.sMessage)) {\n const sizeOfModelSegment = 2;\n for (let i = 0; i < packet.sMessage.length; i = i + sizeOfModelSegment) {\n const possibleModel = Model_1.Model.getModel(packet.sMessage[i]);\n if (possibleModel !== undefined) {\n possibleModel.merge({ \"sid\": possibleModel.bestSessionId, \"m\": { \"rc\": packet.sMessage[i + 1] } });\n }\n }\n }\n else if (typeof (packet.sMessage) === \"object\") {\n for (const key in packet.sMessage) {\n if (packet.sMessage.hasOwnProperty(key)) {\n const rdmsg = packet.sMessage;\n const possibleModel = Model_1.Model.getModel(key);\n if (possibleModel !== undefined) {\n possibleModel.merge({ \"sid\": possibleModel.bestSessionId, \"m\": { \"rc\": rdmsg[key] } });\n }\n }\n }\n }\n }\n break;\n case constants.FCTYPE.TKX:\n const auth = packet.sMessage;\n if (auth && auth.cxid && auth.tkx && auth.ctxenc) {\n this.stream_cxid = auth.cxid;\n this.stream_password = auth.tkx;\n const pwParts = auth.ctxenc.split(\"/\");\n this.stream_vidctx = pwParts.length > 1 ? pwParts[1] : auth.ctxenc;\n }\n break;\n case constants.FCTYPE.TOKENINC:\n if (packet.sMessage === undefined) {\n this._tokens = packet.nArg1;\n }\n break;\n case constants.FCTYPE.CLUBSHOW:\n const showDetails = packet.sMessage;\n if (showDetails.op === constants.FCCHAN.WELCOME && showDetails.tksid !== undefined) {\n this._availableClubShows.add(showDetails.model);\n }\n else {\n this._availableClubShows.delete(showDetails.model);\n }\n break;\n default:\n break;\n }\n // Fire this packet's event for any listeners\n this.emit(constants.FCTYPE[packet.FCType], packet);\n this.emit(constants.FCTYPE[constants.FCTYPE.ANY], packet);\n }", "function getDecodedData() {\n return decoded_data;\n}", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!Validation(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "function Decoder(buffer, offset) {\n this.offset = offset || 0;\n this.buffer = buffer;\n}", "function Decoder(buffer, offset) {\n this.offset = offset || 0;\n this.buffer = buffer;\n}", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "decode() {\n /** @type {!Array.<!shaka.cea.ICaptionDecoder.ClosedCaption>} */\n const parsedClosedCaptions = [];\n\n // In some versions of Chrome, and other browsers, the default sorting\n // algorithm isn't stable. This sort breaks ties based on receive order.\n this.ccPacketArray_.sort(\n /**\n * Stable sorting function.\n * @param {!shaka.cea.Cea608DataChannel.Cea608Packet} ccPacket1\n * @param {!shaka.cea.Cea608DataChannel.Cea608Packet} ccPacket2\n * @return {!number}\n */\n (ccPacket1, ccPacket2) => {\n const diff = ccPacket1.pts - ccPacket2.pts;\n const isEqual = diff === 0;\n return isEqual ? ccPacket1.order - ccPacket2.order : diff;\n });\n\n for (const ccPacket of this.ccPacketArray_) {\n // Only consider packets that are NTSC line 21 (CEA-608).\n // Types 2 and 3 contain DVTCC data, for a future CEA-708 decoder.\n if (ccPacket.type === shaka.cea.CeaDecoder.NTSC_CC_FIELD_1 ||\n ccPacket.type === shaka.cea.CeaDecoder.NTSC_CC_FIELD_2) {\n const parsedClosedCaption = this.decodeCea608_(ccPacket);\n if (parsedClosedCaption) {\n parsedClosedCaptions.push(parsedClosedCaption);\n }\n }\n }\n\n this.clearExtractedPackets_();\n return parsedClosedCaptions;\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "InitializeDecode(EncodingType, string) {\n\n }", "function decodeStream ( binary ) {\n this.offset = 0;\n this.buf = binary;\n var self = this;\n\n this.remainingLength = function() {\n return self.buf.length - self.offset;\n };\n\n this.remainingData = function() {\n if (self.buf.length == self.offset) {\n return new Uint8Array(0);\n } else {\n return self.buf.slice(self.offset, self.buf.length);\n }\n };\n\n this.ensure = function( n ) {\n if (self.offset + n > self.buf.length) {\n throw \"incomplete_packet\";\n }\n };\n\n this.decodeVarint = function() {\n var multiplier = 1;\n var n = 0;\n var digits = 0;\n var digit;\n do {\n self.ensure(1);\n if (++digits > 4) {\n throw \"malformed\";\n }\n digit = self.buf[self.offset++];\n n += ((digit & 0x7F) * multiplier);\n multiplier *= 128;\n } while ((digit & 0x80) !== 0);\n return n;\n };\n\n this.decode1 = function() {\n self.ensure(1);\n return self.buf[self.offset++];\n };\n\n this.decodeUint16 = function() {\n self.ensure(2);\n var msb = self.buf[self.offset++];\n var lsb = self.buf[self.offset++];\n return (msb << 8) + lsb;\n };\n\n this.decodeUint32 = function() {\n self.ensure(4);\n var b1 = self.buf[self.offset++];\n var b2 = self.buf[self.offset++];\n var b3 = self.buf[self.offset++];\n var b4 = self.buf[self.offset++];\n return (b1 << 24) + (b2 << 16) + (b3 << 8) + b4;\n };\n\n this.decodeBin = function( length ) {\n if (length == 0) {\n return new Uint8Array(0);\n } else {\n self.ensure(length);\n var offs = self.offset;\n self.offset += length;\n return self.buf.slice(offs, self.offset);\n }\n };\n\n this.decodeUtf8 = function() {\n var length = self.decodeUint16();\n return UTF8ToString( self.decodeBin(length) );\n };\n\n this.decodeProperties = function() {\n if (self.remainingLength() == 0) {\n return {};\n }\n var len = self.decodeVarint();\n var end = self.offset + len;\n var props = {};\n while (self.offset < end) {\n var c = self.decode1();\n var p = PROPERTY_DECODE[c];\n if (p) {\n var v;\n var k = p[0];\n switch (p[1]) {\n case \"bool\":\n v = !!(self.decode1());\n break;\n case \"uint32\":\n v = self.decodeUint32();\n break;\n case \"uint16\":\n v = self.decodeUint16();\n break;\n case \"uint8\":\n v = self.decode1();\n break;\n case \"utf8\":\n v = self.decodeUtf8();\n break;\n case \"bin\":\n var count = self.decodeUint16();\n v = self.decodeBin(count);\n break;\n case \"varint\":\n v = self.decodeVarint();\n break;\n case \"user\":\n default:\n // User property\n k = self.decodeUtf8();\n v = self.decodeUtf8();\n break;\n }\n if (p[2]) {\n switch (typeof props[k]) {\n case 'undefined':\n props[k] = v;\n break;\n case 'object':\n // assume array\n props[k].push(v);\n break;\n default:\n props[k] = new Array(props[k], v);\n break;\n }\n } else {\n props[k] = v;\n }\n } else {\n throw \"Illegal property\";\n }\n }\n return props;\n };\n}", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace) return;\n\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n } else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n\n break;\n\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message); // @ts-ignore\n\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "assureUncompressed_() {\r\n if (this.bitDepth == '8a') {\r\n this.fromALaw();\r\n } else if (this.bitDepth == '8m') {\r\n this.fromMuLaw();\r\n } else if (this.bitDepth == '4') {\r\n this.fromIMAADPCM();\r\n }\r\n }", "_parseComplete() {\n var callback = this._callback;\n this._callback = null;\n this._batchIndex = 0;\n callback.call(this, this.textures);\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n }", "function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }", "assureUncompressed_() {\n if (this.bitDepth == '8a') {\n this.fromALaw();\n } else if (this.bitDepth == '8m') {\n this.fromMuLaw();\n } else if (this.bitDepth == '4') {\n this.fromIMAADPCM();\n }\n }", "async decompress(streaming) {\n\n if (!decompress_fns[this.algorithm]) {\n throw new Error(this.algorithm + ' decompression not supported');\n }\n\n await this.packets.read(decompress_fns[this.algorithm](this.compressed), {\n LiteralDataPacket,\n OnePassSignaturePacket,\n SignaturePacket\n }, streaming);\n }", "decode(token) {\n return atob(token);\n }", "dataMessage () {\n if (this.fin) {\n const messageLength = this.messageLength;\n const fragments = this.fragments;\n\n this.totalPayloadLength = 0;\n this.messageLength = 0;\n this.fragmented = 0;\n this.fragments = [];\n\n if (this.opcode === 2) {\n var data;\n\n if (this.binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this.binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data, { masked: this.masked, binary: true });\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString(), { masked: this.masked });\n }\n }\n\n this.state = GET_INFO;\n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n super.emit(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n super.emit(\"connect_error\", err);\n break;\n }\n }", "InitializeDecode(string, EncodingType) {\n\n }", "unpack(deck) {\n\t\tthis.remaining = deck.remaining;\n\t\tthis.id = deck.id;\n\t\tthis.activeCard = deck.activeCard;\n\t}", "static parseUDPFrame(data) {\n const buff = smart_buffer_1.SmartBuffer.fromBuffer(data);\n buff.readOffset = 2;\n const frameNumber = buff.readUInt8();\n const hostType = buff.readUInt8();\n let remoteHost;\n if (hostType === constants_1.Socks5HostType.IPv4) {\n remoteHost = ip.fromLong(buff.readUInt32BE());\n }\n else if (hostType === constants_1.Socks5HostType.IPv6) {\n remoteHost = ip.toString(buff.readBuffer(16));\n }\n else {\n remoteHost = buff.readString(buff.readUInt8());\n }\n const remotePort = buff.readUInt16BE();\n return {\n frameNumber,\n remoteHost: {\n host: remoteHost,\n port: remotePort\n },\n data: buff.readBuffer()\n };\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n });\n }", "decode (view, offset=0) {\n return this._decode && inBounds(view, this._nbytes, offset) ?\n this._decode(view, offset) : null\n }", "decode(message) {\n if (!message) return null;\n\n let fragments = message.split('|');\n if (fragments.length != 3) return null;\n\n const type = fragments[0];\n if (this.acceptTypes.indexOf(type) < 0) return null;\n\n const address = fragments[1];\n if ( ! this.ethAddressValidation.isAddress(address) && ! this.ethAddressValidation.isChecksumAddress(address)) return null;\n\n const data = fragments[2];\n if (type === 'INVOICE' || type === 'VOUCHER') {\n if (isNaN(data) || parseFloat(data) <= 0) return null;\n }\n\n return {\n type: type,\n address: address,\n data: data\n }\n }", "exitEncoding_decl(ctx) {\n\t}", "onDataReady() {\n switch (this.state) {\n case RPCServerState.InitHeader: {\n this.handleInitHeader();\n break;\n }\n case RPCServerState.InitHeaderKey: {\n this.handleInitHeaderKey();\n break;\n }\n case RPCServerState.ReceivePacketHeader: {\n this.currPacketHeader = this.readFromBuffer(8 /* I64 */);\n const reader = new ByteStreamReader(this.currPacketHeader);\n this.currPacketLength = reader.readU64();\n support_1.assert(this.pendingBytes == 0);\n this.requestBytes(this.currPacketLength);\n this.state = RPCServerState.ReceivePacketBody;\n break;\n }\n case RPCServerState.ReceivePacketBody: {\n const body = this.readFromBuffer(this.currPacketLength);\n support_1.assert(this.pendingBytes == 0);\n support_1.assert(this.currPacketHeader !== undefined);\n this.onPacketReady(this.currPacketHeader, body);\n break;\n }\n case RPCServerState.WaitForCallback: {\n support_1.assert(this.pendingBytes == 0);\n break;\n }\n default: {\n throw new Error(\"Cannot handle state \" + this.state);\n }\n }\n }", "function Utf8DecodeWorker() {\n GenericWorker.call(this, \"utf-8 decode\"); // the last bytes if a chunk didn't end with a complete codepoint.\n\n this.leftOver = null;\n }", "function unpack (data) {\n // We don't control all message events, they won't always be JSON\n try {\n var unpacked = JSON.parse(data)\n if (unpacked.__postie) return unpacked.__postie\n return false\n }\n catch (e) {\n return false\n }\n}", "decode() {\n let instruction = new InstructionR_1.InstructionR(this.ins);\n this.binIns = instruction.getBinIns();\n }", "function decodePayload(payload){\n\t//filter out packets that do not correspond with payload sizes.\n\tif(payload.length % devicePayloadSize === 0){\n\t\trecievedTable = new Array();\n\t\tfor(var i = 0; i < payload.length / devicePayloadSize; i++){\n\t\t\tvar id = payload[i * (payload.length / (i + 1))];\n\t\t\tvar lat = (hexToInt(bytesToHex(payload.slice(i * (payload.length / (i + 1)) + devIdsize, i * (payload.length / (i + 1)) + devIdsize + latSize))) / 10000000);\n\t\t\tvar lon = (hexToInt(bytesToHex(payload.slice(i * (payload.length / (i + 1)) + devIdsize + latSize, i * (payload.length / (i + 1)) + devIdsize + latSize + lonSize))) / 10000000);\n console.log(payload.slice(i * (payload.length / (i + 1)) + devIdsize + latSize + lonSize, i * (payload.length / (i + 1)) + devIdsize + latSize + lonSize + timeSize));\n\t\t\tvar timePayload = timePayloadToTime( payload.slice(i * (payload.length / (i + 1)) + devIdsize + latSize + lonSize, i * (payload.length / (i + 1)) + devIdsize + latSize + lonSize + timeSize) ); \n\t\t\t\n var tempDevice = new device(id,lat,lon,timePayload);\n\t\t\trecievedTable.push(tempDevice);\n\t\t}\n\t\treturn recievedTable;\n\t}\n\telse{\n\t\tconsole.log(\"not the packet we are looking for\");\n\t}\n}", "function decoder(value, position, handler) {\n entities(value, {\n position: normalize(position),\n warning: handleWarning,\n text: handler,\n reference: handler,\n textContext: ctx,\n referenceContext: ctx\n })\n }", "function Decoder(view, offset) {\n\t\tthis.offset = offset || 0;\n\t\tthis.view = view;\n\t}", "_readPacket() {\n let pos = this._streamPosition;\n const intParams = [];\n let strParam;\n try {\n // Each incoming packet is initially tagged with 7 int32 values, they look like this:\n // 0 = \"Magic\" value that is *always* -2027771214\n // 1 = \"FCType\" that identifies the type of packet this is (FCType being a MyFreeCams defined thing)\n // 2 = nFrom\n // 3 = nTo\n // 4 = nArg1\n // 5 = nArg2\n // 6 = sPayload, the size of the payload\n // 7 = sMessage, the actual payload. This is not an int but is the actual buffer\n // Any read here could throw a RangeError exception for reading beyond the end of the buffer. In theory we could handle this\n // better by checking the length before each read, but that would be a bit ugly. Instead we handle the RangeErrors and just\n // try to read again the next time the buffer grows and we have more data\n // Parse out the first 7 integer parameters (Magic, FCType, nFrom, nTo, nArg1, nArg2, sPayload)\n const countOfIntParams = 7;\n const sizeOfInt32 = 4;\n for (let i = 0; i < countOfIntParams; i++) {\n intParams.push(this._streamBuffer.readInt32BE(pos));\n pos += sizeOfInt32;\n }\n const [magic, fcType, nFrom, nTo, nArg1, nArg2, sPayload] = intParams;\n // If the first integer is MAGIC, we have a valid packet\n if (magic === constants.MAGIC) {\n // If there is a JSON payload to this packet\n if (sPayload > 0) {\n // If we don't have the complete payload in the buffer already, bail out and retry after we get more data from the network\n if (pos + sPayload > this._streamBuffer.length) {\n throw new RangeError(); // This is needed because streamBuffer.toString will not throw a rangeerror when the last param is out of the end of the buffer\n }\n // We have the full packet, store it and move our buffer pointer to the next packet\n strParam = this._streamBuffer.toString(\"utf8\", pos, pos + sPayload);\n pos = pos + sPayload;\n }\n }\n else {\n // Magic value did not match? In that case, all bets are off. We no longer understand the MFC stream and cannot recover...\n // This is usually caused by a mis-alignment error due to incorrect buffer management (bugs in this code or the code that writes the buffer from the network)\n this._disconnected(`Invalid packet received! - ${magic} Length == ${this._streamBuffer.length}`);\n return;\n }\n // At this point we have the full packet in the intParams and strParam values, but intParams is an unstructured array\n // Let's clean it up before we delegate to this.packetReceived. (Leaving off the magic int, because it MUST be there always\n // and doesn't add anything to the understanding)\n let sMessage;\n if (strParam !== undefined && strParam !== \"\") {\n try {\n sMessage = JSON.parse(strParam);\n }\n catch (e) {\n sMessage = strParam;\n }\n }\n this._packetReceived(new Packet_1.Packet(fcType, nFrom, nTo, nArg1, nArg2, sPayload, sMessage));\n // If there's more to read, keep reading (which would be the case if the network sent >1 complete packet in a single transmission)\n if (pos < this._streamBuffer.length) {\n this._streamPosition = pos;\n this._readPacket();\n }\n else {\n // We read the full buffer, clear the buffer cache so that we can\n // read cleanly from the beginning next time (and save memory)\n this._streamBuffer = Buffer.alloc(0);\n this._streamPosition = 0;\n }\n }\n catch (e) {\n // RangeErrors are expected because sometimes the buffer isn't complete. Other errors are not...\n if (!(e instanceof RangeError)) {\n this._disconnected(`Unexpected error while reading socket stream: ${e}`);\n }\n else {\n // this.log(\"Expected exception (?): \" + e);\n }\n }\n }", "function decode(buf)\n{\n // read and validate the json length\n var len = buf.readUInt16BE(0);\n if(len == 0 || len > (buf.length - 2)) return undefined;\n\n // parse out the json\n var packet = {};\n try {\n packet.js = JSON.parse(buf.toString(\"utf8\",2,len+2));\n } catch(E) {\n return undefined;\n }\n\n // if any body, attach it as a buffer\n if(buf.length > (len + 2)) packet.body = buf.slice(len + 2);\n \n return packet;\n}", "function decodePayload(record) {\n var recordType = nfc.bytesToString(record.type),\n payload;\n\n // TODO extract this out to decoders that live in NFC code\n // TODO add a method to ndefRecord so the helper \n // TODO doesn't need to do this\n\n if (recordType === \"T\") {\n var langCodeLength = record.payload[0],\n text = record.payload.slice((1 + langCodeLength), record.payload.length);\n payload = nfc.bytesToString(text);\n\n } else if (recordType === \"U\") {\n var identifierCode = record.payload.shift(),\n uri = nfc.bytesToString(record.payload);\n\n if (identifierCode !== 0) {\n // TODO decode based on URI Record Type Definition\n console.log(\"WARNING: uri needs to be decoded\");\n }\n //payload = \"<a href='\" + uri + \"'>\" + uri + \"<\\/a>\";\n payload = uri;\n\n } else {\n\n // kludge assume we can treat as String\n payload = nfc.bytesToString(record.payload);\n }\n\n return payload;\n}", "function incoming(self, packet)\n{\n debug(\"INCOMING\", self.hashname, packet.id, \"packet from\", packet.from.address, packet.js, packet.body && packet.body.toString());\n\n // signed packets must be processed and verified straight away\n if(packet.js.sig) inSig(self, packet);\n\n // make sure any to is us (for multihosting)\n if(packet.js.to)\n {\n if(packet.js.to !== self.hashname) return warn(\"packet for\", packet.js.to, \"is not us\");\n delete packet.js.to;\n }\n\n // copy back their sender name if we don't have one yet for the \"to\" on answers\n if(!packet.from.hashname && dhash.isSHA1(packet.js.from)) packet.from.hashname = packet.js.from;\n\n // these are only valid when requested, no trust needed\n if(packet.js.popped) inPopped(self, packet);\n\n // new line creation\n if(packet.js.open) inOpen(self, packet);\n\n // incoming lines can happen out of order or before their open is verified, queue them\n if(packet.js.line)\n {\n // a matching line is required\n packet.line = packet.from = self.lines[packet.js.line];\n if(!packet.line) return queueLine(self, packet);\n packet.line.recvAt = Date.now();\n delete packet.js.line;\n }\n \n // must decrypt and start over\n if(packet.line && packet.js.cipher)\n {\n debug(\"deciphering!\")\n var aes = crypto.createDecipher(\"AES-128-CBC\", packet.line.openSecret);\n var deciphered = decode(Buffer.concat([aes.update(packet.body), aes.final()]));\n deciphered.id = packet.id + (packet.id * .2);\n deciphered.from = packet.from;\n deciphered.ciphered = true;\n return incoming(self, deciphered);\n }\n\n // any ref must be validated as someone we're connected to\n if(packet.js.ref)\n {\n var ref = seen(self, packet.js.ref);\n if(!ref.line) return warn(\"invalid ref of\", packet.js.ref, \"from\", packet.from);\n packet.ref = ref;\n delete packet.js.ref;\n }\n\n // process the who \"key\" responses since we know the sender best now\n if(packet.js.key) inKey(self, packet);\n\n // answer who/see here so we have the best from info to decide if we care\n if(packet.js.who) inWho(self, packet);\n if(packet.js.see) inSee(self, packet);\n\n // everything else must have some level of from trust!\n if(!packet.line && !packet.signed && !packet.ref) return inApp(self, packet);\n\n if(dhash.isSHA1(packet.js.seek)) inSeek(self, packet);\n if(packet.js.pop) inPop(self, packet);\n\n // now, only proceed if there's a line\n if(!packet.line) return inApp(self, packet);\n\n // these are line-only things\n if(packet.js.popping) inPopping(self, packet);\n\n // only proceed if there's a stream\n if(!packet.js.stream) return inApp(self, packet);\n\n // this makes sure everything is in sequence before continuing\n inStream(self, packet);\n\n}", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!validation.isValidUTF8(buf)) {\n this.error(\n new Error('Invalid WebSocket frame: invalid UTF-8 sequence'),\n 1007\n );\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "$onmessage(e) {\n if ( e.data instanceof ArrayBuffer ) {\n const bytes = new Uint8Array(e.data);\n try {\n const decoded = pb.sync.Packet.decode(bytes);\n if ( typeof this.onmessage === 'function' ) {\n this.onmessage(decoded);\n }\n } catch (e) {\n console.log(e);\n }\n }\n }", "function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }", "function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }", "function Inflate(cb) {\n this.s = {};\n this.p = new u8(0);\n this.ondata = cb;\n }", "function decode(data) {\n var prefix = protocols[data[0]];\n if (!prefix) { // 36 to 255 should be \"\"\n prefix = \"\";\n } \n return prefix + util.bytesToString(data.slice(1)); \n}", "function wddxSerializer_initPacketOld()\n{\n\tthis.wddxPacket = \"\";\n}", "function decodePIDResponse(frame) {\n console.log(frame.ID.toUpperCase());\n console.log('PID:' + frame.BYTES[2].toUpperCase());\n if (0x0D == parseInt(frame.BYTES[2], 16)) {\n console.log('Speed: ' + parseInt(frame.BYTES[3], 16) + ' km/h')\n }\n else if (0xA6 == parseInt(frame.BYTES[2], 16)) {\n var sum = 0;\n\n sum += (parseInt(frame.BYTES[3], 16) * (2 ^ 24));\n sum += (parseInt(frame.BYTES[4], 16) * (2 ^ 16));\n sum += (parseInt(frame.BYTES[5], 16) * (2 ^ 8));\n sum += (parseInt(frame.BYTES[6], 16) * (2 ^ 1));\n\n console.log('Odometer: ' + sum + ' km')\n\n }\n else {\n console.log('Data0: ' + frame.BYTES[3] + 'h');\n console.log('Data1: ' + frame.BYTES[4] + 'h');\n console.log('Data2: ' + frame.BYTES[5] + 'h');\n console.log('Data3: ' + frame.BYTES[6] + 'h');\n }\n}", "async PacketIO(packet) {\n async function _packetIO(packet, ctx) {\n // console.log(\"SEND DATA: \" + packet.GetBytes() + \" [\" + (new Date().getTime()) + \"]\");\n await ctx.PacketSend(packet);\n return new Promise((resolve, reject) => {\n var timeout;\n\n const _afterData = async (data) => {\n var readBuffer = [...data];\n clearTimeout(timeout);\n ctx.parser.removeListener('data', _afterData);\n // console.log(\"RECEIVE DATA: \" + readBuffer + \" [\" + (new Date().getTime()) + \"]\");\n //await _timeout(1);\n resolve(DpsPacket.FromBytes(readBuffer));\n };\n\n // Reject on timeout\n timeout = setTimeout(() => {\n // console.log(\"TIMEOUT\");\n ctx.parser.removeListener('data', _afterData);\n resolve(null);\n }, DpsConstants.read_timeout);\n\n // Resolve on data\n ctx.parser.on('data', _afterData);\n });\n }\n var data;\n for (var i = 0; i < DpsConstants.retry && !data; i++) {\n if (!this.serialPort.closing || this.serialPort.readable)\n data = await _packetIO(packet, this);\n }\n return data;\n }" ]
[ "0.73792654", "0.73680985", "0.73680985", "0.72189546", "0.7212638", "0.55667466", "0.547574", "0.53708714", "0.527848", "0.52459073", "0.52459073", "0.5207613", "0.51701874", "0.51682156", "0.5150683", "0.51230115", "0.5122873", "0.5114787", "0.51105845", "0.5079545", "0.5077187", "0.5073272", "0.50199205", "0.50189704", "0.4988243", "0.49573457", "0.48890805", "0.4862452", "0.4862452", "0.4862452", "0.48392895", "0.48368412", "0.4833725", "0.48219746", "0.48104146", "0.48016176", "0.47967014", "0.47946635", "0.47946635", "0.47946635", "0.47871807", "0.47634485", "0.47634485", "0.47634485", "0.47633842", "0.4753487", "0.4749145", "0.47487867", "0.4745891", "0.47431055", "0.47256094", "0.47167692", "0.47167692", "0.47015718", "0.46820414", "0.46702632", "0.46692804", "0.46653858", "0.4664369", "0.46469307", "0.46210015", "0.46171075", "0.4610216", "0.46073198", "0.46041492", "0.46020406", "0.45975384", "0.45951548", "0.4586165", "0.4585038", "0.45603958", "0.45508394", "0.45508394", "0.45508394", "0.45508394", "0.45508394", "0.45508394", "0.45501024", "0.45408663", "0.4536015", "0.45304108", "0.452895", "0.45284852", "0.4527425", "0.45269367", "0.4526541", "0.4512172", "0.450626", "0.4498588", "0.44968286", "0.4477229", "0.4475114", "0.44748834", "0.44725496", "0.44725496", "0.44725496", "0.44642532", "0.44605467", "0.44597924", "0.44517162" ]
0.7171507
5
Called upon socket error.
onerror(err) { debug("error", err); this.emitReserved("error", err); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSocketError(err) {\n let data = _data.get(this);\n\n data.error = err;\n\n _data.set(this, data);\n}", "function error(err, socket) {\n socket.emit(\"err\", err);\n console.log(new Error(err));\n}", "function socketError () {\n\t this.destroy();\n\t}", "function socketError () {\n\t this.destroy();\n\t}", "onError(err) {\n debug$3(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "_onSocketError(variable, evt) {\n variable._socketConnected = false;\n this.freeSocket(variable);\n // EVENT: ON_ERROR\n initiateCallback(VARIABLE_CONSTANTS.EVENT.ERROR, variable, _.get(evt, 'data') || 'Error while connecting with ' + variable.service, evt);\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "handleSocketError(err) {\n this._metrics.onConnectionError(err);\n this.clearAndInvokePending(err);\n }", "onError(err) {\n this._closeSocket(err.message);\n }", "function connectionErrorHandler(error) {\n var socket = this\n if (socket.res) {\n if (socket.res.request) {\n socket.res.request.emit('error', error)\n } else {\n socket.res.emit('error', error)\n }\n } else {\n socket._httpMessage.emit('error', error)\n }\n}", "onerror(err) {\n if (!this.connected) {\n super.emit(\"connect_error\", err);\n }\n }", "function socketError () {\n this.destroy();\n}", "function socketError () {\n this.destroy();\n}", "onerror(err) {\n if (!this.connected) {\n super.emit(\"connect_error\", err);\n }\n }", "function socketError() {\n this.destroy();\n}", "function give_error_status(msg){\n global_socket.emit(\"error\",msg);\n}", "onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }", "onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }", "onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }", "function onError(event) {\n\t\tconsole.log('Client socket: Error occured, messsage: ' + event.data);\n\t\tcastEvent('onError', event);\n\t}", "_lostConnection(error) {\n this._stream._lostConnection(error);\n }", "function onConnectionFailed() {\r\n\t\t console.error('Connection Failed!');\r\n\t\t}", "function _failedReq() {\n\t\t\t\t\t\tif(idataObj.hasOwnProperty('socket')) {\n\t\t\t\t\t\t\tidataObj.socket = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//logger.error(JSON.stringify(idataObj));\n\t\t\t\t\t\tif(idataObj.offLineRequest == true) {\n\t\t\t\t\t\t\tdbStore.redisConnPub.publish('FAILURE_DAEMON', JSON.stringify(idataObj));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(socket) {\n\t\t\t\t\t\t\tidataObj.socketId = socket.id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "function onclose() {\n onerror(\"socket closed\");\n }", "onError(err) {\n Socket$1.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "function socketOnError () {\n this.destroy();\n}", "function socketOnError () {\n this.destroy();\n}", "function socketOnError () {\n this.destroy();\n}", "function onclose() {\n onerror('socket closed');\n }", "function onclose() {\n onerror('socket closed');\n }", "function on_connect_error() {\n console.log(\"Connection failed\");\n }", "function connectionError() {\n throw new Error('Connection error');\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "handleError(err) {\n if (this.udpSocket) {\n try {\n this.udpSocket.disconnect();\n } catch (e) {\n logger.error(\"UDP disconnect error:\", + err);\n }\n try {\n this.udpSocket.close();\n } catch (e) {\n logger.error(\"UDP close error:\", + err);\n }\n this.udpSocket = null;\n }\n this.updateStatus(this.STATUS_ERROR);\n logger.error(\"UDP error: \" + err);\n // Create socket again\n setTimeout(() => this.setupCommunication(), 500);\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onConnectionFailed(){\n\t\t\tconsole.error(\"Connection Failed!\")\n\t\t}", "function socketOnError() {\n this.destroy();\n}", "function socketOnError() {\n this.destroy();\n}", "function socketOnError() {\n this.destroy();\n}", "onError(e) {\n this.handleNetworkingError(`Socket error: ${JSON.parse(e)}`);\n this.websocket.close();\n this.scheduleReconnect();\n }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function errorMsg (err, protocol) {\n return 'Connection OFF to ' + \n host + ' port ' + \n port + ', protocol \"' + \n protocol + '\" with message \"' + \n err + '\"';\n }", "function onclose(){\n onerror(\"socket closed\");\n }" ]
[ "0.78520536", "0.7548801", "0.7517081", "0.7517081", "0.7487335", "0.7466298", "0.74459034", "0.74459034", "0.74459034", "0.7421493", "0.7313251", "0.72387755", "0.72054595", "0.7200901", "0.71788555", "0.71788555", "0.71626854", "0.7107387", "0.7104195", "0.70971036", "0.708233", "0.708233", "0.70689917", "0.7042025", "0.70328546", "0.6959239", "0.68863875", "0.6883068", "0.68804973", "0.68804973", "0.68804973", "0.68783355", "0.68783355", "0.6874663", "0.6871011", "0.68700945", "0.68700945", "0.68681604", "0.6847028", "0.6847028", "0.68419564", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68119496", "0.68117183", "0.68117183", "0.68117183", "0.68117183", "0.68117183", "0.6800167", "0.67694134", "0.67694134", "0.67694134", "0.67619836", "0.6754451", "0.6754451", "0.6754451", "0.6754451", "0.6754451", "0.6754451", "0.6754451", "0.6754451", "0.67088944", "0.67075384" ]
0.0
-1
Called upon a socket close.
_destroy(socket) { const nsps = Object.keys(this.nsps); for (const nsp of nsps) { const socket = this.nsps[nsp]; if (socket.active) { debug("socket %s is still active, skipping close", nsp); return; } } this._close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onClose() {\n this._closeSocket(constants_1.ERRORS.SocketClosed);\n }", "disconnect() { socket_close(this) }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onSocketClose() {\n let data = _data.get(this);\n let error = data.error;\n\n data.error = null;\n data.socket = null;\n data.connected = false;\n\n _data.set(this, data);\n\n setImmediate(this.emit.bind(this, 'disconnected', error));\n}", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "socketClose() {\n console.log('sock close');\n\n GlobalVars.reset();\n this.reset();\n\n this.reconnect();\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose() {\n onerror('socket closed');\n }", "function onclose() {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "function onclose () {\n onerror('socket closed');\n }", "close() {\n if (this.socket) this.socket.destroy();\n }", "function onSocketClose() {\n self.resetAll(errors.SocketClosedError({\n reason: 'remote closed',\n socketRemoteAddr: self.socketRemoteAddr,\n direction: self.direction,\n remoteName: self.remoteName\n }));\n\n if (self.ephemeral) {\n var peer = self.channel.peers.get(self.socketRemoteAddr);\n if (peer) {\n peer.close(noop);\n }\n self.channel.peers.delete(self.socketRemoteAddr);\n }\n }", "function onSocketClose(err) {\n this[owner_symbol].destroy(err != null ? errnoException(err) : undefined);\n}", "function handleClose(){\n\n console.log('[SOCKET] - CLOSE');\n }", "close() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\t\t// 'disconnected' event will be emitted by onClose listener\n\t}", "_onSocketClose(variable, evt) {\n variable._socketConnected = false;\n this.freeSocket(variable);\n // EVENT: ON_CLOSE\n initiateCallback(VARIABLE_CONSTANTS.EVENT.CLOSE, variable, _.get(evt, 'data'), evt);\n }", "function socketOnClose(event) {\n\tif (this._connecting) {\n\t\tlet message = 'Unknown Error'\n\t\tif (event.code in disconnectReasons) {\n\t\t\tmessage = disconnectReasons[event.code]\n\t\t}\n\t\tthis._connecting.reject({error: message, event})\n\t\tthis._connecting = null\n\t}\n\n\tthis.emit('socket.close')\n}", "function emitClose() {\n socket.emit(\"close\");\n}", "function on_socket_end() {\n if (returned && !this.writable && this.destroyed === false) {\n this.destroy();\n had_error(new Error('Remote end closed socket abruptly.'))\n }\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onclose(){\n onerror(\"socket closed\");\n }", "function onSocketClose(message) {\n say(\"Disconnected from the server\");\n }", "function on_socket_end() {\n if (!this.writable && this.destroyed === false) {\n this.destroy();\n had_error(new Error('Remote end closed socket abruptly.'))\n }\n }", "closeNow(){\n this.socket.close()\n }", "close (socket) {\r\n if (socket.target) {\r\n socket.target.close();\r\n }\r\n socket.close();\r\n this._sockets[socket.id] = null;\r\n }", "_onClose(/* hadError */) {\n if (this._parser) {\n this._parser.isClosed = true;\n this._socket.unpipe(this._parser);\n this._parser = false;\n }\n\n if (this._dataStream) {\n this._dataStream.unpipe();\n this._dataStream = null;\n }\n\n this._server.connections.delete(this);\n\n if (this._closed) {\n return;\n }\n\n this._closed = true;\n this._closing = false;\n\n this._server.logger.info(\n {\n tnx: 'close',\n cid: this.id,\n host: this.remoteAddress,\n user: (this.session.user && this.session.user.username) || this.session.user\n },\n 'Connection closed to %s',\n this.clientHostname || this.remoteAddress\n );\n setImmediate(() => this._server.onClose(this.session));\n }", "close() {\n this._socket.close();\n this._socket = null;\n this._parseObj = null;\n }", "onClose(reason, desc) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug('socket close with reason: \"%s\"', reason);\n const self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = \"closed\";\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit(\"close\", reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n }", "onClose(reason, desc) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug('socket close with reason: \"%s\"', reason);\n const self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = \"closed\";\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit(\"close\", reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n }" ]
[ "0.823854", "0.8168456", "0.8166392", "0.8166392", "0.8166392", "0.8166392", "0.8166392", "0.80692065", "0.8069015", "0.8069015", "0.8069015", "0.8069015", "0.8069015", "0.8069015", "0.8069015", "0.8069015", "0.80582476", "0.8039217", "0.8039217", "0.8021011", "0.800893", "0.800893", "0.7994414", "0.7994414", "0.7979712", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.79346395", "0.7921537", "0.7910266", "0.78985196", "0.7883043", "0.7796233", "0.77618307", "0.7736655", "0.77361554", "0.7716791", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.77126336", "0.76799965", "0.76708", "0.7544499", "0.74834824", "0.74748933", "0.74567616", "0.74355936", "0.74355936" ]
0.0
-1
Clean up transport subscriptions and packet buffer.
cleanup() { debug("cleanup"); this.subs.forEach(subDestroy => subDestroy()); this.subs.length = 0; this.decoder.destroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "function cleanUp() {\n transportStream.close();\n }", "cleanup() {\n debug(\"cleanup\");\n const subsLength = this.subs.length;\n for (let i = 0; i < subsLength; i++) {\n const sub = this.subs.shift();\n sub.destroy();\n }\n this.decoder.destroy();\n }", "_cleanup() {\n this.readable = false;\n delete this._current;\n delete this._waiting;\n this._openQueue.die();\n\n this._queue.forEach((data) => {\n data.cleanup();\n });\n this._queue = [];\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup () {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup () {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup () {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup () {\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup () {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "destructResources() {\n this.peerComm.removeEventListener(\n PeerCommunicationConstants.PEER_DATA,\n this.onPeerDataReceived.bind(this)\n );\n this.receivedBuffer = null;\n }", "function cleanup() {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n self.removeListener(\"close\", onclose);\n self.removeListener(\"upgrading\", onupgrade);\n }", "function cleanup() {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup() {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup(){\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }", "function cleanup() {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n self.removeListener(\"close\", onclose);\n self.removeListener(\"upgrading\", onupgrade);\n }", "function cleanup() {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n self.removeListener(\"close\", onclose);\n self.removeListener(\"upgrading\", onupgrade);\n }", "cleanup() {\n if (this.broker) {\n this.broker.removeHandler(String(this.channelId), this);\n MessageChannel.pendingResponses.delete(this);\n\n this.message = null;\n this.broker = null;\n }\n }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "function cleanup(){\n\t transport.removeListener('open', onTransportOpen);\n\t transport.removeListener('error', onerror);\n\t transport.removeListener('close', onTransportClose);\n\t self.removeListener('close', onclose);\n\t self.removeListener('upgrading', onupgrade);\n\t }", "unsubscribe() {\n this.bufferSubscriptions.dispose();\n this.bufferSubscriptions = new Atom.CompositeDisposable();\n }", "function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n dest.removeListener('close', cleanup);\n }", "cleanup() {\n const { ws, udp } = this.sockets;\n\n if (ws) {\n ws.removeAllListeners('error');\n ws.removeAllListeners('ready');\n ws.removeAllListeners('sessionDescription');\n ws.removeAllListeners('startSpeaking');\n ws.shutdown();\n }\n\n if (udp) udp.removeAllListeners('error');\n\n this.sockets.ws = null;\n this.sockets.udp = null;\n }", "function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n dest.removeListener('close', cleanup);\n }", "cleanup() {\n const { ws, udp } = this.sockets;\n\n if (ws) {\n ws.removeAllListeners('error');\n ws.removeAllListeners('ready');\n ws.removeAllListeners('sessionDescription');\n ws.removeAllListeners('speaking');\n }\n\n if (udp) udp.removeAllListeners('error');\n\n this.sockets.ws = null;\n this.sockets.udp = null;\n }", "function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }", "function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }", "function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n }", "function cleanup() {\r\n source.removeListener('data', ondata);\r\n dest.removeListener('drain', ondrain);\r\n\r\n source.removeListener('end', onend);\r\n source.removeListener('close', onclose);\r\n\r\n source.removeListener('error', onerror);\r\n dest.removeListener('error', onerror);\r\n\r\n source.removeListener('end', cleanup);\r\n source.removeListener('close', cleanup);\r\n\r\n dest.removeListener('close', cleanup);\r\n }", "function cleanup() {\n\t source.removeListener('data', ondata);\n\t dest.removeListener('drain', ondrain);\n\n\t source.removeListener('end', onend);\n\t source.removeListener('close', onclose);\n\n\t source.removeListener('error', onerror);\n\t dest.removeListener('error', onerror);\n\n\t source.removeListener('end', cleanup);\n\t source.removeListener('close', cleanup);\n\n\t dest.removeListener('end', cleanup);\n\t dest.removeListener('close', cleanup);\n\t }", "function cleanup() {\n\t source.removeListener('data', ondata);\n\t dest.removeListener('drain', ondrain);\n\n\t source.removeListener('end', onend);\n\t source.removeListener('close', onclose);\n\n\t source.removeListener('error', onerror);\n\t dest.removeListener('error', onerror);\n\n\t source.removeListener('end', cleanup);\n\t source.removeListener('close', cleanup);\n\n\t dest.removeListener('close', cleanup);\n\t }", "function cleanup() {\n\t source.removeListener('data', ondata);\n\t dest.removeListener('drain', ondrain);\n\n\t source.removeListener('end', onend);\n\t source.removeListener('close', onclose);\n\n\t source.removeListener('error', onerror);\n\t dest.removeListener('error', onerror);\n\n\t source.removeListener('end', cleanup);\n\t source.removeListener('close', cleanup);\n\n\t dest.removeListener('close', cleanup);\n\t }", "function cleanup() {\n\t source.removeListener('data', ondata);\n\t dest.removeListener('drain', ondrain);\n\n\t source.removeListener('end', onend);\n\t source.removeListener('close', onclose);\n\n\t source.removeListener('error', onerror);\n\t dest.removeListener('error', onerror);\n\n\t source.removeListener('end', cleanup);\n\t source.removeListener('close', cleanup);\n\n\t dest.removeListener('close', cleanup);\n\t }" ]
[ "0.7355705", "0.73198074", "0.73198074", "0.71959114", "0.7179587", "0.70700294", "0.7043185", "0.70044434", "0.6980398", "0.6980398", "0.6980398", "0.6980398", "0.6980398", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.69799715", "0.6979207", "0.69734204", "0.69711775", "0.69711775", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6949466", "0.6949466", "0.69468725", "0.694379", "0.694379", "0.694379", "0.694379", "0.694379", "0.694379", "0.694379", "0.694379", "0.6808695", "0.6770751", "0.6744238", "0.6733146", "0.67327243", "0.6718439", "0.6718439", "0.6714655", "0.6702892", "0.66920054", "0.66900355", "0.66900355", "0.66900355" ]
0.7227625
3
Close the current socket.
_close() { debug("disconnect"); this.skipReconnect = true; this._reconnecting = false; if ("opening" === this._readyState) { // `onclose` will not fire because // an open event never happened this.cleanup(); } this.backoff.reset(); this._readyState = "closed"; if (this.engine) this.engine.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "close() {\n if (this.socket) this.socket.destroy();\n }", "close (socket) {\r\n if (socket.target) {\r\n socket.target.close();\r\n }\r\n socket.close();\r\n this._sockets[socket.id] = null;\r\n }", "socketClose() {\n console.log('sock close');\n\n GlobalVars.reset();\n this.reset();\n\n this.reconnect();\n }", "close() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\t\t// 'disconnected' event will be emitted by onClose listener\n\t}", "closeNow(){\n this.socket.close()\n }", "onClose() {\n this._closeSocket(constants_1.ERRORS.SocketClosed);\n }", "disconnect() { socket_close(this) }", "close() {\n this._socket.close();\n this._socket = null;\n this._parseObj = null;\n }", "close () {\n this._rtc.close()\n return this._socket.close()\n }", "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "function socketOnClose () {\n const websocket = this[kWebSocket];\n\n this.removeListener('close', socketOnClose);\n this.removeListener('end', socketOnEnd);\n\n websocket.readyState = WebSocket.CLOSING;\n\n //\n // The close frame might not have been received or the `'end'` event emitted,\n // for example, if the socket was destroyed due to an error. Ensure that the\n // `receiver` stream is closed after writing any remaining buffered data to\n // it. If the readable side of the socket is in flowing mode then there is no\n // buffered data as everything has been already written and `readable.read()`\n // will return `null`. If instead, the socket is paused, any possible buffered\n // data will be read as a single chunk and emitted synchronously in a single\n // `'data'` event.\n //\n websocket._socket.read();\n websocket._receiver.end();\n\n this.removeListener('data', socketOnData);\n this[kWebSocket] = undefined;\n\n clearTimeout(websocket._closeTimer);\n\n if (\n websocket._receiver._writableState.finished ||\n websocket._receiver._writableState.errorEmitted\n ) {\n websocket.emitClose();\n } else {\n websocket._receiver.on('error', receiverOnFinish);\n websocket._receiver.on('finish', receiverOnFinish);\n }\n}", "function socketOnClose () {\n const websocket = this[kWebSocket];\n\n this.removeListener('close', socketOnClose);\n this.removeListener('end', socketOnEnd);\n\n websocket.readyState = WebSocket.CLOSING;\n\n //\n // The close frame might not have been received or the `'end'` event emitted,\n // for example, if the socket was destroyed due to an error. Ensure that the\n // `receiver` stream is closed after writing any remaining buffered data to\n // it. If the readable side of the socket is in flowing mode then there is no\n // buffered data as everything has been already written and `readable.read()`\n // will return `null`. If instead, the socket is paused, any possible buffered\n // data will be read as a single chunk and emitted synchronously in a single\n // `'data'` event.\n //\n websocket._socket.read();\n websocket._receiver.end();\n\n this.removeListener('data', socketOnData);\n this[kWebSocket] = undefined;\n\n clearTimeout(websocket._closeTimer);\n\n if (\n websocket._receiver._writableState.finished ||\n websocket._receiver._writableState.errorEmitted\n ) {\n websocket.emitClose();\n } else {\n websocket._receiver.on('error', receiverOnFinish);\n websocket._receiver.on('finish', receiverOnFinish);\n }\n}", "function socketOnClose() {\n const websocket = this[kWebSocket];\n\n this.removeListener('close', socketOnClose);\n this.removeListener('end', socketOnEnd);\n\n websocket._readyState = WebSocket.CLOSING;\n\n //\n // The close frame might not have been received or the `'end'` event emitted,\n // for example, if the socket was destroyed due to an error. Ensure that the\n // `receiver` stream is closed after writing any remaining buffered data to\n // it. If the readable side of the socket is in flowing mode then there is no\n // buffered data as everything has been already written and `readable.read()`\n // will return `null`. If instead, the socket is paused, any possible buffered\n // data will be read as a single chunk and emitted synchronously in a single\n // `'data'` event.\n //\n websocket._socket.read();\n websocket._receiver.end();\n\n this.removeListener('data', socketOnData);\n this[kWebSocket] = undefined;\n\n clearTimeout(websocket._closeTimer);\n\n if (\n websocket._receiver._writableState.finished ||\n websocket._receiver._writableState.errorEmitted\n ) {\n websocket.emitClose();\n } else {\n websocket._receiver.on('error', receiverOnFinish);\n websocket._receiver.on('finish', receiverOnFinish);\n }\n}", "function socketOnClose() {\n const websocket = this[kWebSocket];\n\n this.removeListener('close', socketOnClose);\n this.removeListener('end', socketOnEnd);\n\n websocket._readyState = WebSocket.CLOSING;\n\n //\n // The close frame might not have been received or the `'end'` event emitted,\n // for example, if the socket was destroyed due to an error. Ensure that the\n // `receiver` stream is closed after writing any remaining buffered data to\n // it. If the readable side of the socket is in flowing mode then there is no\n // buffered data as everything has been already written and `readable.read()`\n // will return `null`. If instead, the socket is paused, any possible buffered\n // data will be read as a single chunk and emitted synchronously in a single\n // `'data'` event.\n //\n websocket._socket.read();\n websocket._receiver.end();\n\n this.removeListener('data', socketOnData);\n this[kWebSocket] = undefined;\n\n clearTimeout(websocket._closeTimer);\n\n if (\n websocket._receiver._writableState.finished ||\n websocket._receiver._writableState.errorEmitted\n ) {\n websocket.emitClose();\n } else {\n websocket._receiver.on('error', receiverOnFinish);\n websocket._receiver.on('finish', receiverOnFinish);\n }\n}", "function onSocketClose(err) {\n this[owner_symbol].destroy(err != null ? errnoException(err) : undefined);\n}", "_destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n debug(\"socket %s is still active, skipping close\", nsp);\n return;\n }\n }\n this._close();\n }", "_destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n debug(\"socket %s is still active, skipping close\", nsp);\n return;\n }\n }\n this._close();\n }", "function socketOnClose() {\n const websocket = this[kWebSocket$1];\n\n this.removeListener('close', socketOnClose);\n this.removeListener('data', socketOnData);\n this.removeListener('end', socketOnEnd);\n\n websocket._readyState = WebSocket$1.CLOSING;\n\n let chunk;\n\n //\n // The close frame might not have been received or the `'end'` event emitted,\n // for example, if the socket was destroyed due to an error. Ensure that the\n // `receiver` stream is closed after writing any remaining buffered data to\n // it. If the readable side of the socket is in flowing mode then there is no\n // buffered data as everything has been already written and `readable.read()`\n // will return `null`. If instead, the socket is paused, any possible buffered\n // data will be read as a single chunk.\n //\n if (\n !this._readableState.endEmitted &&\n !websocket._closeFrameReceived &&\n !websocket._receiver._writableState.errorEmitted &&\n (chunk = websocket._socket.read()) !== null\n ) {\n websocket._receiver.write(chunk);\n }\n\n websocket._receiver.end();\n\n this[kWebSocket$1] = undefined;\n\n clearTimeout(websocket._closeTimer);\n\n if (\n websocket._receiver._writableState.finished ||\n websocket._receiver._writableState.errorEmitted\n ) {\n websocket.emitClose();\n } else {\n websocket._receiver.on('error', receiverOnFinish);\n websocket._receiver.on('finish', receiverOnFinish);\n }\n}", "async close() {\n const socket = this._socket;\n\n this.__waker = null;\n this._socket = null;\n if (!socket) return Promise.resolve();\n\n socket.close();\n return new Promise((resolve, reject) => {\n socket.once('error', (err) => {\n reject(err);\n });\n\n socket.once('disconnected', () => {\n resolve();\n });\n });\n }", "function close() {\n\t\tif (mWebSocket) {\n\t\t\tconsole.log('Client socket: Closing');\n\t\t\tmWebSocket.close();\n\t\t}\n\t}", "_destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n debug(\"socket %s is still active, skipping close\", nsp);\n return;\n }\n }\n this._close();\n }", "_destroy(socket) {\n const nsps = Object.keys(this.nsps);\n\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n\n if (socket.active) {\n debug(\"socket %s is still active, skipping close\", nsp);\n return;\n }\n }\n\n this._close();\n }", "function handleClose(){\n\n console.log('[SOCKET] - CLOSE');\n }", "function closeWebSocket() {\n var socket = gSocket;\n if (socket === null) return;\n \n socket.close();\n}", "function onSocketClose() {\n self.resetAll(errors.SocketClosedError({\n reason: 'remote closed',\n socketRemoteAddr: self.socketRemoteAddr,\n direction: self.direction,\n remoteName: self.remoteName\n }));\n\n if (self.ephemeral) {\n var peer = self.channel.peers.get(self.socketRemoteAddr);\n if (peer) {\n peer.close(noop);\n }\n self.channel.peers.delete(self.socketRemoteAddr);\n }\n }", "destroy() {\n this.socket.destroy();\n }", "close() {\n debug(\"session close\");\n this.socket.destroy();\n\n // delegate\n this.app.remove(this);\n this.app.emit(\"close\", this);\n }", "function onSocketClose() {\n let data = _data.get(this);\n let error = data.error;\n\n data.error = null;\n data.socket = null;\n data.connected = false;\n\n _data.set(this, data);\n\n setImmediate(this.emit.bind(this, 'disconnected', error));\n}", "close(variable) {\n const shouldClose = this._onBeforeSocketClose(variable), socket = this.getSocket(variable);\n if (shouldClose === false) {\n return;\n }\n socket.close();\n }", "close() {\n console.log(\"disconnecting\");\n this._distributeMessage('remove', '');\n clearInterval(this._swarmUpdater);\n this._server.close();\n Object.keys(this._connections).forEach(function(key) {\n this._connections[key].socket.end();\n }, this);\n }", "function emitClose() {\n socket.emit(\"close\");\n}", "function closeSocket(socket) {\n\tvar i = sockets.indexOf(socket);\n\tif (i != -1) {\n\t\tsockets.splice(i, 1);\n\t}\n}", "function close(socket) {\n // Free the IP\n let n = connectedIPs.findIndex(w => { return w.ip === socket.ip; });\n if (n !== -1) {\n util.log(socket.ip + \" disconnected.\");\n util.remove(connectedIPs, n);\n }\n // Free the token\n if (socket.key != '') { \n keys.push(socket.key);\n util.log(\"Token freed.\");\n } \n // Figure out who the player was\n let player = socket.player,\n index = players.indexOf(player);\n // Remove the player if one was created\n if (index != -1) {\n // Kill the body if it exists\n if (player.body != null) {\n player.body.invuln = false;\n setTimeout(() => {\n player.body.kill();\n }, 10000);\n }\n // Disconnect everything\n util.log('[INFO] User ' + player.name + ' disconnected!');\n util.remove(players, index);\n } else {\n util.log('[INFO] A player disconnected before entering the game.');\n }\n // Free the view\n util.remove(views, views.indexOf(socket.view));\n // Remove the socket\n util.remove(clients, clients.indexOf(socket)); \n util.log('[INFO] Socket closed. Views: ' + views.length + '. Clients: ' + clients.length + '.');\n }", "function on_socket_end() {\n if (returned && !this.writable && this.destroyed === false) {\n this.destroy();\n had_error(new Error('Remote end closed socket abruptly.'))\n }\n }", "function on_socket_end() {\n if (!this.writable && this.destroyed === false) {\n this.destroy();\n had_error(new Error('Remote end closed socket abruptly.'))\n }\n }", "disconnect() {\n let _this = this;\n\n _this._continuousOpen = false;\n if (_this._sock) {\n _this._sendClose();\n }\n }", "function socketOnClose(event) {\n\tif (this._connecting) {\n\t\tlet message = 'Unknown Error'\n\t\tif (event.code in disconnectReasons) {\n\t\t\tmessage = disconnectReasons[event.code]\n\t\t}\n\t\tthis._connecting.reject({error: message, event})\n\t\tthis._connecting = null\n\t}\n\n\tthis.emit('socket.close')\n}", "function closeSocket(socket) {\n\tvar i = sockets.indexOf(socket);\t\n\n\tif (i != -1) {\n\t\tsockets.splice(i,1);\n\t}\n}", "close () {\n this.socket.close()\n document.removeEventListener('keypress', this.sendMessageEventListener)\n }", "shutdown () {\r\n for (let ix = 0; ix < this._sockets.length; ix++) {\r\n this.close(this._sockets[ix]);\r\n }\r\n this._sockets.length = 0;\r\n }", "_destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n return;\n }\n }\n this._close();\n }", "stop() {\n this.socket.end();\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onEnd() {\n if (this._socket && !this._socket.destroyed) {\n this._socket.destroy();\n }\n }", "_onClose(/* hadError */) {\n if (this._parser) {\n this._parser.isClosed = true;\n this._socket.unpipe(this._parser);\n this._parser = false;\n }\n\n if (this._dataStream) {\n this._dataStream.unpipe();\n this._dataStream = null;\n }\n\n this._server.connections.delete(this);\n\n if (this._closed) {\n return;\n }\n\n this._closed = true;\n this._closing = false;\n\n this._server.logger.info(\n {\n tnx: 'close',\n cid: this.id,\n host: this.remoteAddress,\n user: (this.session.user && this.session.user.username) || this.session.user\n },\n 'Connection closed to %s',\n this.clientHostname || this.remoteAddress\n );\n setImmediate(() => this._server.onClose(this.session));\n }", "async close() {\n // Close all pending connections.\n forEach(this._pendingAuthRequests, ({ socket }) => socket.destroy());\n\n // Shut down server.\n try {\n this._wsServer.close();\n } catch (e) {\n log.warn(`Cannot shutdown WebSocket server cleanly: ${e}`);\n }\n }", "function socketOnEnd () {\n const websocket = this[kWebSocket];\n\n websocket.readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function socketOnEnd () {\n const websocket = this[kWebSocket];\n\n websocket.readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "destroy () {\n this._socket.close()\n this._rtc.close()\n this._removeEventListeners()\n }", "function socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function socketOnEnd() {\n const websocket = this[kWebSocket$1];\n\n websocket._readyState = WebSocket$1.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "_onSocketClose(variable, evt) {\n variable._socketConnected = false;\n this.freeSocket(variable);\n // EVENT: ON_CLOSE\n initiateCallback(VARIABLE_CONSTANTS.EVENT.CLOSE, variable, _.get(evt, 'data'), evt);\n }", "function disconnect() {\n if (!socket || !socket.close)\n return void onError(\n new Error('Invalid Disconnect: Cannot close a '\n + 'socket that has never been opened.')\n )\n socket.close()\n return socket\n }", "function HandleClose() {\n console.log('WebSocket closed');\n Socket = null;\n SetState(IconError, 'Disconnected');\n}", "disconnect() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\n\t\tif(this._reconnectTimer) {\n\t\t\tclearTimeout(this._reconnectTimer);\n\t\t\tthis._reconnectTimer = null;\n\t\t}\n\t\tif(this.__netstatTimer) {\n\t\t\tclearInterval(this.__netstatTimer);\n\t\t\tthis.__netstatTimer = null;\n\t\t\tthis._measureSpeed();\n\t\t}\n\n\t\tif(this._socket.destroyed) return;\n\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\n\t\tthis._socket.removeAllListeners('end');\n\t\tthis._socket.removeAllListeners('close');\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\n\t\tthis.emit('disconnected');\n\t\tthis.status = \"Disconnected\";\n\t}", "close() {\n if (this.server !== null && this.server !== undefined) {\n this.server.close();\n }\n }", "function closeConnection() {\n //alert(\"closing\");\n if (socket != null) {\n socket.close();\n }\n}", "terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n\n if (this._socket) {\n this.readyState = WebSocket.CLOSING;\n this._socket.end();\n // Add a timeout to ensure that the connection is completely cleaned up\n // within 30 seconds, even if the other peer does not send a FIN packet.\n clearTimeout(this._closeTimer);\n this._closeTimer = setTimeout(this._finalize, closeTimeout, true);\n } else if (this.readyState === WebSocket.CONNECTING) {\n this.finalize(true);\n }\n }", "disconnect() {\n if (this.proto == 'tcp') {\n this._api.disconnect(this.socketId);\n }\n }", "function socket_close(bitmex, from_server = false) {\n // Ignore for disconnected clients.\n if(bitmex.opt('disconnected')) return\n\n // Terminate socket for stand-alone sockets and if master server closes.\n if(!bitmex[s.parent] && !from_server) return void bitmex[s.socket].terminate()\n\n // Send disconnection request.\n if(!bitmex.opt('standalone') && !from_server) return void bitmex.send({ type: 2 })\n\n // Send DC commands to all kids.\n if(bitmex[s.kids] && from_server) {\n Object.keys(bitmex[s.kids]).forEach(key => {\n if(key !== bitmex.id) socket_close(bitmex[s.kids][key], !bitmex[s.kids][key].opt('standalone'))\n })\n }\n \n // Update status.\n bitmex[s.status].authenticated = false\n bitmex[s.status].connected = false\n bitmex[s.status].connecting = false\n bitmex[s.status].disconnected = true\n bitmex[s.status].ready = false\n bitmex[s.status].wants = []\n\n // Emit disconnect message.\n bitmex.emit('disconnect')\n\n // No more pongs now, ya'll hear?\n bitmex[s.ping].stop()\n}", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "onClose(reason, desc) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug('socket close with reason: \"%s\"', reason);\n const self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = \"closed\";\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit(\"close\", reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n }", "onClose(reason, desc) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug('socket close with reason: \"%s\"', reason);\n const self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = \"closed\";\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit(\"close\", reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n }", "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug(\"transport not open - deferring close\");\n this.once(\"open\", close);\n }\n }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function ontargetclose () {\n debug.proxyResponse('proxy target %s \"close\" event', req.url);\n cleanup();\n socket.destroy();\n }", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "cancel () {\n this._buf = null\n this._dataState = 0\n this._clearTimeout()\n\n if (!this.socket) return\n\n this.isConnected = false\n this.socket.removeAllListeners()\n this.socket.destroy()\n this.socket.unref()\n\n this.socket = null\n }", "offsocket() {\n return socket.off('res');\n }", "onClose(reason, desc) {\n if (\n \"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState\n ) {\n debug$3('socket close with reason: \"%s\"', reason);\n const self = this;\n\n // clear timers\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer);\n\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n\n // ensure transport won't stay open\n this.transport.close();\n\n // ignore further transport communication\n this.transport.removeAllListeners();\n\n // set ready state\n this.readyState = \"closed\";\n\n // clear session id\n this.id = null;\n\n // emit close event\n this.emit(\"close\", reason, desc);\n\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n }", "closePeer() {\n try {\n this._remoteStream = null;\n } catch (err) {}\n try {\n this._pc.close();\n } catch (err) {\n console.log('close');\n }\n }", "emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket$1.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[permessageDeflate.extensionName]) {\n this._extensions[permessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket$1.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }", "close() {\n this._closedFromClient = true;\n\n this._stopConnectionRetries();\n\n this._areRetriesEnabled = false;\n\n if (this._channel) {\n try {\n this._channel.close();\n } catch (error) {} // eslint-disable-line no-empty\n\n\n this._channel = null;\n }\n }", "async destroy() {\n\t\tthis.log('debug', 'destroy')\n\t\tif (this.socket) \n\t\t\t{this.socket.destroy()\n\t\t}\n\t}", "close() {\n\n\t\t// Remove the channel from all its connections\n\t\tthis.connections.forEach((connection) => {\n\t\t\tthis.unbind(connection);\n\t\t});\n\n\t\t// Remove the channel from the host\n\t\tthis._host._channels.delete(this._name);\n\n\t\t// Emit close event\n\t\tthis.emit('close');\n\t}", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "function onclose(){\n\t onerror(\"socket closed\");\n\t }", "async disconnect () {\n this.connection.end()\n this.socket.end()\n this.server.onDisconnected()\n return this._destroy()\n }", "function cleanup() {\n if (socket) {\n socket.close(function(err) {\n if (err) {\n log('ERROR: could not close server: ' + err);\n } else {\n log('INFO: server closed');\n }\n });\n }\n\n if (converseTimer) {\n clearInterval(converseTimer);\n }\n\n if (bcastTimer) {\n clearTimeout(bcastTimer);\n }\n}", "function onSocketClose(message) {\n say(\"Disconnected from the server\");\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }", "emitClose () {\n this.readyState = WebSocket.CLOSED;\n\n if (!this._socket) {\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this.emit('close', this._closeCode, this._closeMessage);\n }", "function onClose() {\n\t\tconsole.log('Client socket: Connection closed');\n\t\tmWebSocket = null;\n\t\tcastEvent('onClose', event);\n\t}", "close() {\n\t\tthis._communicator.close();\n\t}", "function onclose() {\n onerror(\"socket closed\");\n }" ]
[ "0.81200373", "0.7721045", "0.77195907", "0.7671094", "0.7618793", "0.7451911", "0.7407919", "0.7257038", "0.7208258", "0.70691717", "0.70691717", "0.70691717", "0.7035647", "0.7035647", "0.6994768", "0.6994768", "0.6962962", "0.6955681", "0.6955681", "0.69285816", "0.69186807", "0.69175667", "0.69116", "0.6905439", "0.6902078", "0.6889319", "0.6858955", "0.68556964", "0.68538606", "0.6812773", "0.6803087", "0.678187", "0.6756749", "0.67432296", "0.67332643", "0.6679398", "0.6675404", "0.6669218", "0.6662474", "0.66498804", "0.66298395", "0.66081774", "0.6563832", "0.65538114", "0.654982", "0.654982", "0.654982", "0.6544417", "0.6530289", "0.6502803", "0.6502803", "0.6468934", "0.6467238", "0.6467238", "0.6453044", "0.6447693", "0.64437115", "0.63787544", "0.6361774", "0.6361107", "0.6357434", "0.63292795", "0.6325156", "0.6322008", "0.6316838", "0.6316838", "0.6298669", "0.6298669", "0.62888664", "0.62795323", "0.62795323", "0.62795323", "0.62795323", "0.62795323", "0.6272069", "0.62714916", "0.62714916", "0.62685734", "0.625207", "0.6248312", "0.6237688", "0.621537", "0.6206826", "0.6204252", "0.6202548", "0.6202059", "0.6202059", "0.6202059", "0.6202059", "0.6202059", "0.6202059", "0.6202059", "0.6202059", "0.6187485", "0.6169883", "0.6167572", "0.6159972", "0.6159972", "0.6147213", "0.6145386", "0.6143184" ]
0.0
-1
Called upon engine close.
onclose(reason) { debug("onclose"); this.cleanup(); this.backoff.reset(); this._readyState = "closed"; this.emitReserved("close", reason); if (this._reconnection && !this.skipReconnect) { this.reconnect(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }", "onClose() {\n\t\t}", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }", "close() {\n this.__internal.close()\n }", "close() {\n this.__internal.close()\n }", "onDestroy() {}", "Close() {\n\n }", "function Close() {\n } // Close", "onClose() {\n this.reset();\n if (this.closed_by_user === false) {\n this.host.reportDisconnection();\n this.run();\n } else {\n this.emit('close');\n }\n }", "onClosed() {\r\n // Stub\r\n }", "beforeClose() {\n\t\t}", "_close() {\n // mark ourselves inactive without doing any work.\n this._active = false;\n }", "end() {\n this.session.close();\n }", "onClose() {}", "onClose() {}", "function destroy () {\n\t\t// TODO\n\t}", "destroy() {\n if (this.engineWorker != null) {\n engineLoader.returnEngineWorker(this.engineWorker);\n }\n this.eventEmitter.removeAllListeners();\n }", "destroy() {\n this._end();\n }", "onShutdown () {\n unload()\n }", "onClose(){}", "function destroy() {\n\t\tif ( error ) {\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tself.emit( 'close' );\n\t}", "close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this.reconnecting = false;\n if (\"opening\" === this.readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this.readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine) this.engine.close();\n }", "_onClosing() {\n this._watcher.stop();\n this.emit(\"closing\");\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "function close() {\n\t\tif ( error ) {\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tself.emit( 'close' );\n\t}", "function dispose() {\n }", "onDispose() {}", "endSession() {\r\n this.endScript();\r\n this.cycler.endSession();\r\n }", "close() {\r\n this.native.close();\r\n }", "function destroy(){\n\t\t// TODO\n\t}", "function ForceClose() {\r\n}", "unload() {}", "function dispose() {}", "destroy() { }", "destroy() { }", "destroy() { }", "_destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }", "_destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }", "_destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }", "finalize() {\n }", "finalize() {\n }", "finalize() {\n }", "finalize() {\n }", "async dispose() {\r\n const tasks = [];\r\n if (this._engine) {\r\n tasks.push(this._engine.quitAsync());\r\n }\r\n if (this._engineSub) {\r\n tasks.push(this._engineSub.quitAsync());\r\n this._engineSub = null;\r\n }\r\n await Promise.all(tasks);\r\n this._engine = this._localCache = this._cacheExps = null;\r\n }", "_onClosed() {\n this.emit(\"closed\");\n }", "onDestroy(e) {\n\n }", "componentWillUnmount() {\n this.engine.dispose();\n }", "close() {\n const method = 'close';\n LOG.entry(method);\n this.db.close();\n LOG.exit(method);\n }", "dispose() {}", "dispose() {}", "dispose() {}", "dispose() {}", "dispose() {}", "end() {\n this.medals();\n this.endMessage();\n this.cleanUp();\n this.gc();\n }", "destroy () {}", "function close() {\n var self = this;\n\n self._close.apply(self, arguments);\n}", "_onClose() {\n this._socket = null;\n this._osk = null;\n this._connectedAt = 0;\n }", "function onUnload() {\r\n log('onUnload');\r\n stop();\r\n }", "end() {\n }", "end() {\n }", "function doneClosing()\n\t{\n\t\tthat.terminate();\n\t}", "_after() {\n this._exitContext();\n }", "endTease() {\r\n this.endScript();\r\n this.cycler.end();\r\n }", "unload () {\n renderer.dispose();\n }", "function CloseEvent() {}", "close() {\n if (phantom_instance != null) {\n phantom_instance.exit();\n phantom_instance = null;\n }\n }", "function close() {\n\n ipcRenderer.send('close', 'close')\n\n }", "unload() {\n renderer.dispose();\n }", "unload() {\n renderer.dispose();\n }", "close() {\n close(internalSlots.get(this));\n }", "async onShutdown() {\n // put things to do upon application shutdown here\n }", "function _onBeforeUnload() {\n _startClosing();\n }", "function _onBeforeUnload() {\n _startClosing();\n }", "dispose() { }", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "function onUnload() {\r\n \tcontrols.log('onUnload');\r\n stop();\r\n }", "_destroy() {}", "close() {\n this._endpointId = null;\n this._deviceModel = null;\n this._onChange = function (arg) {};\n this._onError = function (arg) {};\n }", "function doClose() {\n db.close();\n finished();\n }", "function doClose() {\n db.close();\n finished();\n }", "Unload() {}", "function Graph_teardown () { }", "onClose() {\n\t\t// There are still clients connected.\n\t\tif ( this.wss.clients.size ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.log( 'No more clients!' );\n\t\tthis.forge.stop();\n\t}", "destroy() {\r\n super.destroy();\r\n }", "onTerminate() {}", "onEnd() {\n\t\tthis.debug('onEnd');\n\t}", "close() {\n const result = this.activateCallback('beforeClose');\n if (result !== undefined && !result) {\n return;\n }\n this.clearListeners();\n this.setMap(null);\n }", "destroy() {\n }", "_onversionchange() {\n this.close();\n }" ]
[ "0.7245429", "0.71433264", "0.7057358", "0.68012583", "0.68012583", "0.6720794", "0.6646946", "0.6622437", "0.6598121", "0.6595858", "0.65648824", "0.6460574", "0.64204776", "0.6418652", "0.6418652", "0.6412957", "0.6403186", "0.63874286", "0.6387089", "0.63693917", "0.6366338", "0.6359917", "0.6345695", "0.6338447", "0.6334766", "0.6334192", "0.63276047", "0.63186574", "0.6301002", "0.6268155", "0.62643087", "0.6255782", "0.62310266", "0.6215807", "0.6215233", "0.6210895", "0.6210895", "0.6210895", "0.61982775", "0.61982775", "0.61982775", "0.6197883", "0.6197883", "0.6197883", "0.6197883", "0.6193271", "0.6177016", "0.61581427", "0.6157682", "0.6155706", "0.6138907", "0.6138907", "0.6138907", "0.6138907", "0.6138907", "0.61359954", "0.6134822", "0.612426", "0.6112112", "0.6100863", "0.60936344", "0.60936344", "0.6090505", "0.60741675", "0.6070185", "0.606883", "0.60677713", "0.6063791", "0.6055143", "0.6053694", "0.6053694", "0.60459054", "0.60243064", "0.602194", "0.602194", "0.60218316", "0.60217935", "0.60217935", "0.60217935", "0.60217935", "0.60217935", "0.60217935", "0.60217935", "0.60217935", "0.60217935", "0.60217935", "0.60217935", "0.6010514", "0.6006748", "0.60029477", "0.6000007", "0.6000007", "0.59658974", "0.596372", "0.5959616", "0.5958194", "0.5956535", "0.5943846", "0.59433997", "0.5935211", "0.5932561" ]
0.0
-1
Called upon successful reconnect.
onreconnect() { const attempt = this.backoff.attempts; this._reconnecting = false; this.backoff.reset(); this.emitReserved("reconnect", attempt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async _reconnect() {\n await this._waitBackgroundConnect();\n await this._connect();\n }", "reconnect() {\n this.connectionManager.reconnect();\n }", "function onReconnect() {\n emitHello();\n $log.log(\"monitor is reconnected\");\n }", "reconnect() {\n if ( this.socket )\n {\n this.socket.close();\n delete this.socket;\n }\n\n this.connect();\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this.reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "function reconnect() {\n\n\tconsole.log(\"Reconnect called\");\n\t// Make sure there is not another reconnect attempt in progress (and that we are really not connected)\n\tif(active911.timer_controller.exists(\"reconnect\") || active911.xmpp.is_connected()) {\n\n\t\tconsole.log(\"Reconnect already in operation. Returning.\");\n\t\treturn;\n\t}\n\n\t// Set up a reconnect timer\n\tactive911.timer_controller.add(\"reconnect\",function(){\n\n\t\tif(!active911.xmpp.is_connected()) {\t// We used to make sure we were disconnected before reconnecting. But sometimes we can reach neither state, and we just need to go for it.\n\n\t\t\tconsole.log(\"Reconnect attempt\");\n\t\t\tactive911.xmpp.connect();\n\t\t}\n\n\t\treturn !active911.xmpp.is_connected();\t// Remove ourself once connected\n\n\t}, 10);\n\n\t// Connect right now\n\t// Don't do this since we may still be disconnecting\n\t/*\tif(active911.xmpp.is_disconnected()) {\n\n\t\t\tconsole.log(\"Reconnect is performing mmediate reconnect attempt\");\n\t\t\tactive911.xmpp.connect();\n\t\t\t}\n\t\t\t*/\n\n}", "function reconnect(err) {\n\tadapter.log.warn(\"Connection to '\" + auroraAPI.host + \":\" + auroraAPI.port + \"' lost, \" + formatError(err) + \". Try to reconnect...\");\n\tstopAdapterProcessing();\n\tsetConnectedState(false);\t\t// set disconnect state\n\tlastError = err;\n\tStartConnectTimer(true);\t\t// start connect timer\n}", "SOCKET_RECONNECT(state, count) {\n console.log('Reconnect: ', count)\n }", "function reconnect () {\n if (connection.killed) {\n return;\n }\n\n // Make sure the connection is closed...\n try {\n connection.client.end();\n } catch (e) {}\n\n // Remove this from the available connections.\n self.connections = _.reject(self.connections, {port: port, host: host});\n connection.killed = true;\n\n // Wait and reconnect.\n setTimeout(function () {\n self.addConnection(port, host);\n }, config.check_interval);\n }", "reconnect () {\n this.adapter.reconnect()\n }", "reconnect() {\n this.debug('Attemping to reconnect in 5500ms...');\n /**\n * Emitted whenever the client tries to reconnect to the WebSocket.\n * @event Client#reconnecting\n */\n this.client.emit(Constants.Events.RECONNECTING);\n this.connect(this.gateway, 5500, true);\n }", "async reconnect () {\n this.reconnecting = true;\n await this.connect();\n \n //Object.values(this.subscriptions).forEach (sub => {\n // this._subscribe (sub);\n //});\n }", "function user_reconnect() {\n console.log(\"User reconnected.\");\n attempt_reopen_channel = true;\n fullyUsedUp = false;\n\n // set this to true so websockets automatically reopen the channel if they fail\n open_channel = true;\n\n send_version();\n set_ui_state(UI_STATES.CONNECTED);\n}", "_reconnect () {\n if (this._reconnecting === true) return\n this._reconnecting = true\n\n log('Trying to reconnect to remote endpoint')\n this._checkInternet((online) => {\n if (!online && !cst.PM2_DEBUG) {\n log('Internet down, retry in 2 seconds ..')\n this._reconnecting = false\n return setTimeout(this._reconnect.bind(this), process.env.NODE_ENV === 'test' ? 1 : 2000)\n }\n this.connect((err) => {\n if (err || !this.isConnected()) {\n log('Endpoint down, retry in 5 seconds ...')\n this._reconnecting = false\n return setTimeout(this._reconnect.bind(this), process.env.NODE_ENV === 'test' ? 1 : 5000)\n }\n\n log('Connection etablished with remote endpoint')\n this._reconnecting = false\n this._emptyQueue()\n })\n })\n }", "_wsReconnect () {\n this._log('websocket reconnecting...');\n\n if (this._options.onReconnect) {\n this._options.onReconnect();\n }\n\n this._cache.reconnectingAttempts++;\n this._ws = getWebSocket({\n url: this._url,\n protocols: this._protocols,\n options: this._options\n });\n this._initWsCallbacks();\n }", "reconnect() {\n\t\t//refreshes page to call componentDidMount() again,\n\t\t//this will force the peer to search for another connection\n\t\twindow.location.reload(true);\n\t\t//show connect button and hide disconnect button\n\t\tthis.setState({connState:true});\n\t}", "async reconnect() {\n const conn_status = _converse.connfeedback.get('connection_status');\n\n if (api.settings.get('authentication') === _converse.ANONYMOUS) {\n await tearDown();\n await clearSession();\n }\n if (conn_status === Strophe.Status.CONNFAIL) {\n // When reconnecting with a new transport, we call setUserJID\n // so that a new resource is generated, to avoid multiple\n // server-side sessions with the same resource.\n //\n // We also call `_proto._doDisconnect` so that connection event handlers\n // for the old transport are removed.\n if (\n api.connection.isType('websocket') &&\n api.settings.get('bosh_service_url')\n ) {\n await _converse.setUserJID(_converse.bare_jid);\n _converse.connection._proto._doDisconnect();\n _converse.connection._proto = new Strophe.Bosh(_converse.connection);\n _converse.connection.service = api.settings.get('bosh_service_url');\n } else if (\n api.connection.isType('bosh') &&\n api.settings.get('websocket_url')\n ) {\n if (api.settings.get('authentication') === _converse.ANONYMOUS) {\n // When reconnecting anonymously, we need to connect with only\n // the domain, not the full JID that we had in our previous\n // (now failed) session.\n await _converse.setUserJID(api.settings.get('jid'));\n } else {\n await _converse.setUserJID(_converse.bare_jid);\n }\n _converse.connection._proto._doDisconnect();\n _converse.connection._proto = new Strophe.Websocket(\n _converse.connection\n );\n _converse.connection.service = api.settings.get('websocket_url');\n }\n } else if (\n conn_status === Strophe.Status.AUTHFAIL &&\n api.settings.get('authentication') === _converse.ANONYMOUS\n ) {\n // When reconnecting anonymously, we need to connect with only\n // the domain, not the full JID that we had in our previous\n // (now failed) session.\n await _converse.setUserJID(api.settings.get('jid'));\n }\n\n if (_converse.connection.reconnecting) {\n _converse.connection.debouncedReconnect();\n } else {\n return _converse.connection.reconnect();\n }\n }", "SOCKET_RECONNECT(state, count) {\n state.socket.isReconnecting = true\n console.info(state.socket, count, \"reconnect socket\")\n if (count >= 3) {\n // window.location.href = '/';\n }\n }", "clientConnected() {\n super.clientConnected('connected', this.wasConnected);\n\n this.state = 'connected';\n this.wasConnected = true;\n this.stopRetryingToConnect = false;\n }", "function reconnectHandler (attemptNumber) {\n console.log('socket on reconnect', '#'+attemptNumber+':', subscriptionRequest);\n subscribe();\n }", "function reconnectHandler (attemptNumber) {\n console.log('socket on reconnect', '#'+attemptNumber+':', subscriptionRequest);\n subscribe();\n }", "attemptReconnect(resetAndReconnect = true) {\n ConnectionManager.reconnect(resetAndReconnect);\n }", "function reconnectTimer () {\n if (!ws || ws.readyState == WebSocket.CLOSED) {\n reallyConnect();\n }\n }", "SOCKET_RECONNECT() {\n // console.info(state, count);\n }", "function reconnect() {\n device.find().then(() => {\n // Connect to device\n device.connect();\n });\n}", "_setupReconnect () {\n if (this.reconnectTimeout) {\n clearTimeout(this.reconnectTimeout)\n this.reconnectTimeout = null\n }\n\n if (this.currentRetries >= this.options.retriesAmount)\n return\n\n this.reconnectTimeout = setTimeout(this._reconnect.bind(this), 1000)\n }", "reconnected () {\n window.location.reload() // This triggers another websocket disconnect/connect (!)\n }", "reconnect () {\n if (!this.connected) {\n this.connected = true\n return this.connector.reconnect()\n } else {\n return Promise.resolve()\n }\n }", "connectedCallback() {\n if (!this.isConnected) return;\n super.connectedCallback();\n \n }", "reconnect () {\n if (!this.connected) {\n this.connected = true;\n return this.connector.reconnect()\n } else {\n return Promise.resolve()\n }\n }", "function reconnect(nickname, pw) {\r\n socket.emit('reconnect', nickname, pw);\r\n}", "reconnected() {\n this.subscribe(this.replica, this.path);\n }", "function onConnectionLost(responseObject) {\n\t\tsetTimeout(MQTTconnect, reconnectTimeout);\n\t\t$('#status').val(\"connection lost: \" + responseObject.errorMessage + \". Reconnecting\");\n\t}", "SOCKET_RECONNECT() {\n //console.info(state, count);\n }", "async reconnect () {\n const delay = (t) => { // Helper function to await time-outed reconnect\n return new Promise((resolve) => {\n setTimeout(() => resolve(), t)\n })\n }\n await delay(this.delay * Math.pow(2, this.delayCounter))\n this.delayCounter++\n await this.reconn()\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting && this._reconnection && this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "SOCKET_RECONNECT(state, count) {\n // console.log('ws重新连接')\n // console.info(state, count)\n if (state.socket.isConnected) {\n Message.success({\n content: 'websocket 重新连接成功',\n duration: 4\n })\n }\n \n }", "function onConnectionLost(responseObject) {\r\n if (responseObject.errorCode !== 0) {\r\n console.log(\"onConnectionLost:\" + responseObject.errorMessage);\r\n client.connect({onSuccess:onConnect});\r\n }\r\n }", "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n console.log(\"onConnectionLost:\", responseObject.errorMessage);\n setTimeout(function() { client.connect() }, 5000);\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "reconnect() {\n this.emit(\"reconnect user\", { tokenId: localStorage.getItem(\"x-access-token\") }).then((response) => {\n });\n }", "SOCKET_RECONNECT(state, count) {\n console.info(state, count);\n console.log(\"SOCKET_RECONNECT\");\n }", "onConnect() {\n this.attempts = 1;\n this.connected = true;\n this.emit('connect');\n this.ws.on('message', msg => {\n msg = JSON.parse(msg);\n this.onMessage(msg);\n });\n }", "attemptConnect() {\n ConnectionManager.connect();\n }", "async afterConnected() {}", "function executeReconnect(self) {\n return function() {\n if(self.state == DESTROYED || self.state == UNREFERENCED) {\n return;\n }\n\n connectNewServers(self, self.s.replicaSetState.unknownServers, function() {\n var monitoringFrequencey = self.s.replicaSetState.hasPrimary()\n ? _haInterval : self.s.minHeartbeatFrequencyMS;\n\n // Create a timeout\n self.intervalIds.push(new Timeout(executeReconnect(self), monitoringFrequencey).start());\n });\n }\n }", "function executeReconnect(self) {\n return function() {\n if (self.state === DESTROYED || self.state === UNREFERENCED) {\n return;\n }\n\n connectNewServers(self, self.s.replicaSetState.unknownServers, function() {\n var monitoringFrequencey = self.s.replicaSetState.hasPrimary()\n ? _haInterval\n : self.s.minHeartbeatFrequencyMS;\n\n // Create a timeout\n self.intervalIds.push(new Timeout(executeReconnect(self), monitoringFrequencey).start());\n });\n };\n }", "function executeReconnect(self) {\n return function() {\n if (self.state === DESTROYED || self.state === UNREFERENCED) {\n return;\n }\n\n connectNewServers(self, self.s.replicaSetState.unknownServers, function() {\n var monitoringFrequencey = self.s.replicaSetState.hasPrimary()\n ? _haInterval\n : self.s.minHeartbeatFrequencyMS;\n\n // Create a timeout\n self.intervalIds.push(new Timeout(executeReconnect(self), monitoringFrequencey).start());\n });\n };\n }", "function executeReconnect(self) {\n return function() {\n if (self.state === DESTROYED || self.state === UNREFERENCED) {\n return;\n }\n\n connectNewServers(self, self.s.replicaSetState.unknownServers, function() {\n var monitoringFrequencey = self.s.replicaSetState.hasPrimary()\n ? _haInterval\n : self.s.minHeartbeatFrequencyMS;\n\n // Create a timeout\n self.intervalIds.push(new Timeout(executeReconnect(self), monitoringFrequencey).start());\n });\n };\n }", "function _onHAPIDisconnectSuccessCallback() {\n location.reload(true)\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "onMqttReconnection() {\r\n console.log('reconnecting to IoT... ')\r\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this.reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "function onConnectionLost(responseObject)\n{\n if (responseObject.errorCode !== 0)\n {\n console.log(\"Connection to broker lost:\"+responseObject.errorMessage);\n chrome.browserAction.setIcon({path:\"icon_noconnection.png\"});\n popupNotification(\"MQTT Broker disconneced\",\"Reason: \"+responseObject.errorMessage,\"icon_noconnection.png\");\n if (localStorage.reconnectTimeout !== 0)\n {\n window.setTimeout(connect, parseInt(localStorage.reconnectTimeout, 10) * 1000); //wait X seconds before trying to connect again.\n }\n }\n}", "function onConnectionLost(responseObject)\n{\n if (responseObject.errorCode !== 0)\n {\n console.log(\"Connection to broker lost:\"+responseObject.errorMessage);\n chrome.browserAction.setIcon({path:\"icon_noconnection.png\"});\n popupNotification(\"MQTT Broker disconneced\",\"Reason: \"+responseObject.errorMessage,\"icon_noconnection.png\");\n if (localStorage.reconnectTimeout !== 0)\n {\n window.setTimeout(connect, parseInt(localStorage.reconnectTimeout, 10) * 1000); //wait X seconds before trying to connect again.\n }\n }\n}", "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n console.log(\"onConnectionLost:\"+responseObject.errorMessage);\n }\n setTimeout(mqttConnect, reconnectTimeout);\n connect();\n}", "reconnect(e, Data) {\n\n if (socket == null) {\n return socket.on('connect', () => {\n socket.emit('req', { event: e, data: Data });\n });\n }\n \n }", "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n alert(\"Se perdió la conexión\")\n console.log(\"onConnectionLost:\", responseObject.errorMessage);\n setTimeout(function() {\n client.connect()\n }, 5000);\n }\n}", "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n console.log(\"Connection to broker lost:\" + responseObject.errorMessage);\n chrome.browserAction.setIcon({path: \"icon_grey128.png\"});\n popupNotification(\"MQTT Broker disconneced\", \"Reason: \" + responseObject.errorMessage, \"icon_noconnection.png\");\n if (localStorage.reconnectTimeout !== 0) {\n window.setTimeout(connect, parseInt(localStorage.reconnectTimeout, 10) * 1000); //wait X seconds before trying to connect again.\n }\n }\n}", "initConnection() {\n\t\tconsole.debug(\"Attempting to connect to {url}...\".formatUnicorn({\n\t\t\t\"url\": this.url,\n\t\t}));\n\t\tthis.socket = new WebSocket(this.url);\n\t\tthis.addListeners(this.callbacks);\n\n\t\t// Add listener to attempt reconnect after set delay.\n\t\t// Makes for an autorepeat because failure will trigger the 'close' event.\n\t\tthis.addListeners({\n\t\t\t\"close\": function(event) {\n\t\t\t\tconsole.debug(\"Connection to {url} closed/failed, trying to reconnect in {delay} seconds.\"\n\t\t\t\t\t.formatUnicorn({\n\t\t\t\t\t\t\"url\": this.url,\n\t\t\t\t\t\t\"delay\": this.closed_repeat_delay\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\twindow.setTimeout(\n\t\t\t\t\tthis.initConnection.bind(this),\n\t\t\t\t\tthis.closed_repeat_delay * 1000\n\t\t\t\t);\n\t\t\t}.bind(this)\n\t\t});\n\t}", "function pre() {\n\t\t// attempt to reconnect\n\t\tif (connectionRequested && !connectionEstablished) {\n\t\t\tif (parent.millis() - reconnectAttempt > reconnectInterval) {\n\t\t\t\tif ( verbose ) console.log(\"[Spacebrew::pre] attempting to reconnect to Spacebrew\");\n\t\t\t\tthis.connect( hostname, port, this.name, this.description);\n\t\t\t\treconnectAttempt = parent.millis();\n\t\t\t}\n\t\t}\n\t}", "function onConnectionLost(responseObject) {\n\t//start interval for reconnecting to mqtt server\n\tinterval = setInterval(function() {\n\t\tConnectToMQTT();\n\t}, 10000);\n\n\tif (responseObject.errorCode !== 0) {\n\t\tconsole.log('onConnectionLost:' + responseObject.errorMessage);\n\t}\n}", "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n location.reload();\n }\n}", "function attemptReconnect() {\n if (reconnecting) return;\n reconnecting = true;\n\n while (reconnectHistory[0] &&\n Date.now() - reconnectHistory[0] > 5 * 60 * 60 * 1000) {\n reconnectHistory.splice(0, 1);\n }\n\n const num = reconnectHistory.length;\n const delay = num * num * num * 1000;\n console.log(\n 'Enqueuing reconnect attempt in', delay, 'ms (Recent attempts: ', num,\n ')');\n\n setTimeout(() => {\n console.log('Attempting reconnect...');\n reconnecting = false;\n reconnectHistory.push(Date.now());\n socket.open((...args) => {\n console.log(...args);\n if (args[0]) attemptReconnect();\n });\n }, delay);\n }", "onConnectionLost(responseObject) {\r\n if (responseObject.errorCode !== 0) {\r\n console.log('Connection lost with Solace Cloud');\r\n }\r\n\r\n // TODO: add auto-reconnect\r\n }", "reconnectUserInfo(){\n\t\tconst { socket, user } = this.state\n\n\t\tif(this.state.user != null){\n\n\t\t\tsocket.emit(USER_CONNECTED, user)\n\t\t}\n\n\t}", "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n console.log(\"onConnectionLost:\", responseObject.errorMessage);\n setTimeout(function() { client.connect() }, 5000);\n }\n}", "disconnect() { }", "disconnect() { }", "disconnect() { }", "didConnectSuccessfully () {\n\t\tconsole.log(\"connected successfully\")\n\n\t\tthis.status = WhatsAppWeb.Status.connected // update our status\n\t\tthis.lastSeen = new Date() // set last seen to right now\n\t\tthis.startKeepAliveRequest() // start sending keep alive requests (keeps the WebSocket alive & updates our last seen)\n\n\t\tif (this.reconnectLoop) { // if we connected after being disconnected\n\t\t\tclearInterval(this.reconnectLoop) // kill the loop to reconnect us\n\t\t} else { // if we connected for the first time, i.e. not after being disconnected\n\t\t\tif (this.handlers.onConnected) // tell the handler that we're connected\n\t\t\t\tthis.handlers.onConnected()\n\t\t}\n\t}", "async function attemptReconnection() {\n try {\n console.log(\"Attempting to reconnect\");\n const db = firebase.firestore();\n const rooms = db.collection(\"rooms\");\n\n pc = new RTCPeerConnection(rtcconfig);\n initDataChannel();\n const offer = await pc.createOffer();\n await pc.setLocalDescription(offer);\n\n pc.onicecandidate = async ({ candidate }) => {\n if (candidate) return;\n await rooms\n .doc(roomID.value)\n .collection(\"offer\")\n .doc(offerID.value)\n .update({ offer: { type: offer.type, sdp: offer.sdp } });\n };\n } catch (error) {\n console.log(`There was an error in an attempt to reconnect: ${error}`);\n createRoomBtn.disabled = false;\n joinRoomBtn.disabled = false;\n }\n }", "SOCKET_RECONNECT(state, count) {\n console.info(state, count)\n }", "SOCKET_RECONNECT(state, count) {\n console.info(state, count)\n }", "function onFailedConnect() {\n $.notify('MQTT: Cannot connect to broker', \"error\");\n client = null;\n }", "async retry_to_connect(options, reconnect_delay, retrials_left = -1) {\n let { virtual_document } = options;\n if (this.ignored_languages.has(virtual_document.language)) {\n return;\n }\n let interval = reconnect_delay * 1000;\n let success = false;\n while (retrials_left !== 0 && !success) {\n await this.connect(options)\n .then(() => {\n success = true;\n })\n .catch(e => {\n console.warn(e);\n });\n console.log('LSP: will attempt to re-connect in ' + interval / 1000 + ' seconds');\n await sleep(interval);\n // gradually increase the time delay, up to 5 sec\n interval = interval < 5 * 1000 ? interval + 500 : interval;\n }\n }", "_attemptReconnect(resolve, reject) {\n this._oldChain = \"old\";\n bitsharesjs_ws__WEBPACK_IMPORTED_MODULE_0__.Apis.reset(this._connectionManager.url, true, undefined, {\n enableOrders: true\n }).then(instance => {\n instance.init_promise.then(this._onConnect.bind(this, resolve, reject)).catch(this._onResetError.bind(this, this._connectionManager.url));\n });\n }", "function onConnect () {\n socket.removeListener('error', onError);\n socket.destroy();\n\n options.path = exports.nextSocket(options.path);\n exports.getSocket(options, callback);\n }", "function renew_server_socket()\n {\n \t// check if the server was in disconnected state and is now connected\n \tvar is_server_up = checkIfServerIsUp(preferred_ip_address);\n \tif(is_server_up == true) {\n \t // clear this polling function since the server is up now\n \t console.log(\"Clearing the interval function ..\");\n \t clearInterval(new_sock_checker);\n\n \t\tconsole.log(\"Restoring primary websocket connection after disconnect mode ..\");\n \t\tinit_primary_websocket(true);\n \t \n \t $(\"#disconnected_handler\").hide();\n \t $(\"#connected_handler\").show();\n \t \n \t // setup a session for this client with the session manager\n \t registerClientSessionInFailoverMode();\n \t} \t\n }", "onSocketFullyConnected() {\n this.debugOut('socketFullyConnected()');\n this.last_socket_error = null;\n this.emit('open');\n }", "_lostConnection(error) {\n this._stream._lostConnection(error);\n }", "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n console.log(\"onConnectionLost:\", responseObject.errorMessage);\n setTimeout(function () {\n clientMQTT.connect(mqttConnectOptions);\n }, 5000);\n }\n }", "function on_connect_error() {\n console.log(\"Connection failed\");\n }", "function server_or_connect_error()\n{\n// FIXME: We could display something on screen at this point to let the user know we had a problem completing a reload\n reload_later(reload_interval)\n}", "beforeConnectedCallbackHook(){\n\t\t\n\t}", "function reconnectWebSocket() {\n window.setTimeout(() => {\n connectWebSocket();\n }, 5000);\n}", "SOCKET_RECONNECT (state, count) {\n console.info(state, count)\n }", "connectedCallback() {\n\t\t// super.connectedCallback()\n\t}", "connectedCallback() {\n this.connected = true;\n this.init();\n }", "connectedCallback() {\n this.connected = true;\n this.init();\n }", "function startDisconnect() {\r\n client.disconnect();\r\n window.location.reload();\r\n}", "function onerror() {\n if (this._socket) {\n this._socket = null;\n this._logger.info('Connection closed.');\n }\n\n this._debuggerObj.setEngineMode(this._debuggerObj.ENGINE_MODE.DISCONNECTED);\n\n if (this._surface.getPanelProperty('chart.active')) {\n this._chart.disableChartButtons();\n if (this._chart.containsData()) {\n this._surface.toggleButton(true, 'chart-reset-button');\n }\n }\n\n if (this._surface.getPanelProperty('watch.active')) {\n this._surface.updateWatchPanelButtons(this._debuggerObj);\n }\n\n if (this._session.isUploadStarted()) {\n this._session.setUploadStarted(false);\n }\n\n // Reset the editor.\n this._session.reset();\n this._surface.reset();\n this._surface.disableActionButtons(true);\n this._surface.toggleButton(true, 'connect-to-button');\n this._surface.continueStopButtonState(this._surface.CSICON.CONTINUE);\n\n if (this._session.isContextReset()) {\n this._session.setContextReset(false);\n\n // Try to reconnect once.\n setTimeout(() => {\n $('#connect-to-button').trigger('click');\n }, 1000);\n }\n}", "connectedCallback() {\n super.connectedCallback();\n }", "connectedCallback() {\n super.connectedCallback();\n }" ]
[ "0.7635908", "0.7592526", "0.75271463", "0.74548393", "0.740412", "0.7370118", "0.7364767", "0.7364767", "0.73642075", "0.72689104", "0.7248326", "0.7234352", "0.7226426", "0.7206959", "0.71837294", "0.7111254", "0.7067534", "0.7058101", "0.6999292", "0.6984575", "0.6908057", "0.6893694", "0.6883868", "0.6810722", "0.6810722", "0.677624", "0.6774358", "0.6714282", "0.6699309", "0.66861504", "0.66658735", "0.6659871", "0.6649891", "0.66471064", "0.6605293", "0.6579921", "0.6544661", "0.6531335", "0.6514672", "0.6505157", "0.6466835", "0.6453094", "0.64350146", "0.6429964", "0.64233494", "0.64107263", "0.6390887", "0.63893455", "0.636606", "0.6364816", "0.6364415", "0.6364415", "0.6364415", "0.6355461", "0.63380784", "0.63380784", "0.63380784", "0.6337522", "0.63341016", "0.63277", "0.63277", "0.6323051", "0.6321502", "0.6311113", "0.628257", "0.6280359", "0.6272808", "0.6263616", "0.62636125", "0.6254771", "0.6246519", "0.6236098", "0.6212517", "0.61997455", "0.61997455", "0.61997455", "0.6196403", "0.6186835", "0.6185132", "0.6185132", "0.61845255", "0.61839455", "0.6183265", "0.6182574", "0.61764127", "0.61756283", "0.61684686", "0.61620295", "0.61597425", "0.6146887", "0.614646", "0.6146358", "0.6143876", "0.6132078", "0.6129373", "0.6129373", "0.6124205", "0.61224985", "0.61214614", "0.61214614" ]
0.7363662
9
Subscribe to open, close and packet events
subEvents() { if (this.subs) return; const io = this.io; this.subs = [on_1.on(io, "open", this.onopen.bind(this)), on_1.on(io, "packet", this.onpacket.bind(this)), on_1.on(io, "error", this.onerror.bind(this)), on_1.on(io, "close", this.onclose.bind(this))]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on(io, \"open\", this.onopen.bind(this)),\n on(io, \"packet\", this.onpacket.bind(this)),\n on(io, \"error\", this.onerror.bind(this)),\n on(io, \"close\", this.onclose.bind(this)),\n ];\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onopen() {\n debug(\"open\"); // clear old subs\n\n this.cleanup(); // mark as open\n\n this._readyState = \"open\";\n this.emitReserved(\"open\"); // add new subs\n\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this.readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"data\", component_bind_1.default(this, \"ondata\")));\n this.subs.push(on_1.on(socket, \"ping\", component_bind_1.default(this, \"onping\")));\n this.subs.push(on_1.on(socket, \"error\", component_bind_1.default(this, \"onerror\")));\n this.subs.push(on_1.on(socket, \"close\", component_bind_1.default(this, \"onclose\")));\n this.subs.push(on_1.on(this.decoder, \"decoded\", component_bind_1.default(this, \"ondecoded\")));\n }", "subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on_1.on(io, \"open\", this.onopen.bind(this)),\n on_1.on(io, \"packet\", this.onpacket.bind(this)),\n on_1.on(io, \"error\", this.onerror.bind(this)),\n on_1.on(io, \"close\", this.onclose.bind(this)),\n ];\n }", "subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on_1.on(io, \"open\", this.onopen.bind(this)),\n on_1.on(io, \"packet\", this.onpacket.bind(this)),\n on_1.on(io, \"error\", this.onerror.bind(this)),\n on_1.on(io, \"close\", this.onclose.bind(this)),\n ];\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_js_1.on(socket, \"ping\", this.onping.bind(this)), on_js_1.on(socket, \"data\", this.ondata.bind(this)), on_js_1.on(socket, \"error\", this.onerror.bind(this)), on_js_1.on(socket, \"close\", this.onclose.bind(this)), on_js_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on_js_1.on(io, \"open\", this.onopen.bind(this)),\n on_js_1.on(io, \"packet\", this.onpacket.bind(this)),\n on_js_1.on(io, \"error\", this.onerror.bind(this)),\n on_js_1.on(io, \"close\", this.onclose.bind(this)),\n ];\n }", "_connectEvents () {\n this._socket.on('sensorChanged', this._onSensorChanged);\n this._socket.on('deviceWasClosed', this._onDisconnect);\n this._socket.on('disconnect', this._onDisconnect);\n }", "_addEventListeners () {\n this._socket.on(ConnectionSocket.EVENT_ESTABLISHED, this._handleConnectionEstablished.bind(this))\n this._socket.on(ConnectionSocket.EVENT_CLOSED, this._handleConnnectionClosed.bind(this))\n this._socket.on(ConnectionSocket.EVENT_PEER_CONNECTED, this._handlePeerConnected.bind(this))\n this._socket.on(ConnectionSocket.EVENT_PEER_PING, this._handlePingMessage.bind(this))\n this._socket.on(ConnectionSocket.EVENT_PEER_SIGNAL, (signal) => this._rtc.signal(signal))\n this._rtc.on(ConnectionRTC.EVENT_RTC_SIGNAL, (signal) => this._socket.sendSignal(signal))\n this._rtc.on(ConnectionRTC.EVENT_PEER_PING, this._handlePingMessage.bind(this))\n this._rtc.on(ConnectionRTC.EVENT_CLOSED, this._handleConnnectionClosed.bind(this))\n }", "attachChannelEvents() {\n this.channel.onmessage = this.handleChannelMessage;\n\n this.channel.onopen = e => {\n this.channel.send('ping');\n }\n\n this.channel.onerror = e => {\n console.log('channel error', e);\n }\n\n this.channel.onclose = e => {\n console.log('channel closed');\n }\n\n this.channel.onbufferedamountlow = e => {\n this.resumeTransfers();\n }\n }", "ConnectEvents() {\n\n }", "_subscribeToChipEvents() {\n this._listenToChipsRemove();\n this._listenToChipsDestroyed();\n this._listenToChipsInteraction();\n }", "registerPlayerEvents() {\n const socket = Game.socket;\n socket.on('update', this.onUpdate.bind(this));\n socket.on('command', this.onCommand.bind(this));\n socket.on('player:connected', this.onPlayerConnected.bind(this));\n socket.on('player:disconnected', this.onPlayerDisconnected.bind(this));\n }", "[net.onConnect](evt) {\n console.log('SC:connected', evt);\n }", "_constructMIDIListeners () {\n this._player.on('fileLoaded', () => {\n this.emit('midiLoaded')\n })\n\n this._player.on('playing', () => {\n this.emit('midiPlaying')\n })\n\n this._player.on('midiEvent', event => {\n this.emit('midiEvent', event)\n })\n\n this._player.on('endOfFile', () => {\n this.emit('midiEnded')\n })\n }", "subscribeEvents()\n {\n on('debug.log', event => {\n this.screen.log(event.text);\n });\n\n // Check for battle after moving\n on('move.finish', () => { \n if (this.checkStartFight())\n {\n // switch to Battle state\n this.battleState();\n }\n });\n\n // Handle postbattle event; go to world screen after postbattle screen\n on('battle.over.win', args => { this.postBattleState(args) });\n }", "handleEvents(){\n this.io.on('connection', (socket) => {\n this.handleJoinEvent(socket);\n this.handleLeaveEvent(socket);\n this.handleSendMsgEvent(socket);\n this.handleAddNotificationEvent(socket);\n });\n }", "setupDataHandlers() {\n this.dc.onmessage = (e) => {\n var msg = JSON.parse(e.data);\n console.log(\"received message over data channel:\" + msg);\n };\n this.dc.onclose = () => {\n this.remoteStream.getVideoTracks()[0].stop();\n console.log(\"The Data Channel is Closed\");\n };\n }", "listen() {\n this.media_.addListener(this.handler_)\n this.handler_(this.media_)\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n\n}", "afterInitialisation() {\n // Forward initialization event to server\n this.eventBusMaster.on(MASTER_SLAVE_CHANNEL, 'initialized', data => this.eventBusMaster.emit(MASTER_SERVER_CHANNEL, 'init', data));\n // Forward \"gotoSlide\" events to slave\n this.eventBusMaster.on(MASTER_SERVER_CHANNEL, 'gotoSlide', data => this.eventBusMaster.emit(MASTER_SLAVE_CHANNEL, 'gotoSlide', data));\n // Forward \"showNotes\" events to slave\n this.eventBusMaster.on(MASTER_SLAVE_CHANNEL, 'sendNotesToMaster', data => this.eventBusMaster.emit(MASTER_SLAVE_CHANNEL, 'sendNotesToSlave', data));\n // Start listening on \"keyboardEvent\" on MASTER_SLAVE_CHANNEL\n this.eventBusMaster.on(MASTER_SLAVE_CHANNEL, 'keyboardEvent', this.onKeyboardEvent.bind(this));\n // Start listening on \"touchEvent\" on MASTER_SLAVE_CHANNEL\n this.eventBusMaster.on(MASTER_SLAVE_CHANNEL, 'touchEvent', this.onTouchEvent.bind(this));\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(\"State\", { qos: Number(1) });\r\n client.subscribe(\"Content\", { qos: Number(1) });\r\n\r\n }", "setUpSocketEventListeners() {}", "_subscribe () {\n if (!this.connected)\n throw new Error('No connection exist')\n\n this.subClient.on('message', this._onMessage.bind(this))\n\n if (_.isFunction(this._config.handlers.onError)) {\n this.subClient.on('error', this._config.handlers.onError)\n }\n }", "connected() {\n event();\n }", "function bindDataChannelHandlers(dataChannel) {\n dataChannel.onopen = () => {\n print(\"%cRTCDataChannel now open and ready to receive messages\", \"color:blue;\");\n // for (let i = 0; i < 200; i++) {\n // dataChannel.send(\"hello!\");\n // }\n };\n dataChannel.onmessage = (event) => { // careful: both clients recieve message sent\n let message = event.data;\n print(\"RTCDataChannel recieved a message: \"+message);\n };\n dataChannel.onclose = () => {\n print(\"RTCDataChannel closed\");\n };\n dataChannel.onerror = () => {\n print(\"RTCDataChannel error!\");\n };\n}", "listen(){\n this.namespace.on('connection', (socket)=>{\n socket.on('teacher start poll', (teacherSocketId, poll) => {\n this.handleStartPoll(teacherSocketId, poll);\n });\n socket.on('student submit poll', (answersInfo, userId, sessionId)=>{\n this.handleStudentSubmitPoll(answersInfo, userId, sessionId);\n })\n });\n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "subscribeTo(event, callback) {\n this.socket.on(event, callback);\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n\n if (this.connected) {\n this.emitEvent(args);\n } else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "connect() {\n window.addEventListener('message', this.onConnectionMessageHandler);\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n }", "function onOpen() {\n\t\tconsole.log('Client socket: Connected');\n\t\tcastEvent('onOpen', event);\n\t}", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "setListeners(){\n let self = this;\n\n self.socketHub.on('connection', (socket) => {\n console.log(`SOCKET HUB CONNECTION: socket id: ${socket.id}`)\n self.emit(\"client_connected\", socket.id);\n socket.on(\"disconnect\", (reason)=>{\n console.log(\"Client disconnected: \" + socket.id)\n self.emit(\"client_disconnected\", socket.id)\n });\n\n socket.on('reconnect', (attemptNumber) => {\n self.emit(\"client_reconnected\", socket.id)\n });\n\n socket.on(\"ping\", ()=>{\n console.log(\"RECEIVED PING FROM CLIENT\")\n socket.emit(\"pong\");\n })\n\n socket.on(\"error\", (err)=>{\n Logger.error(`Client socket error: ${err.message}`, {stack: err.stack});\n })\n\n });\n\n self.dataSocketHub.on('connection', (socket)=>{\n console.log(\"File socket connected\");\n self.emit(\"data_channel_opened\", socket);\n console.log(\"After data_channel_opened emit\")\n socket.on(\"disconnect\", (reason)=>{\n self.emit(\"data_channel_closed\", socket.id);\n });\n\n socket.on(\"reconnect\", (attemptNumber) => {\n self.emit(\"data_channel_reconnection\", socket.id);\n })\n\n socket.on(\"error\", (err)=>{\n Logger.error(\"Data socket error: \" + err)\n })\n\n })\n }", "$onopen(e) {\n this.state.connected = true;\n if ( typeof this.onopen === 'function' ) {\n this.onopen(e);\n }\n }", "function onOpen(){\n console.log('Open connections!');\n}", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "onOpenInterestEvent(fn) {\n\n this.eventEmitter.on(settings.socket.openInterestEvent, (data) => {\n\n fn(data);\n\n });\n }", "setupHandlers () {\n this.rs.on('connected', () => this.eventHandler('connected'));\n this.rs.on('ready', () => this.eventHandler('ready'));\n this.rs.on('disconnected', () => this.eventHandler('disconnected'));\n this.rs.on('network-online', () => this.eventHandler('network-online'));\n this.rs.on('network-offline', () => this.eventHandler('network-offline'));\n this.rs.on('error', (error) => this.eventHandler('error', error));\n\n this.setEventListeners();\n this.setClickHandlers();\n }", "_subscribeToChipEvents() {\n super._subscribeToChipEvents();\n this._listenToChipsSelection();\n this._listenToChipsFocus();\n this._listenToChipsBlur();\n }", "_subscribeToChipEvents() {\n super._subscribeToChipEvents();\n this._listenToChipsSelection();\n this._listenToChipsFocus();\n this._listenToChipsBlur();\n }", "function FsEventsHandler() {}", "listenForData() {\n this.socket.on(EVENT_DATA, data => this.handleData(data))\n }", "subscribe() {}", "function _subscribe() {\n\n _comapiSDK.on(\"conversationMessageEvent\", function (event) {\n console.log(\"got a conversationMessageEvent\", event);\n if (event.name === \"conversationMessage.sent\") {\n $rootScope.$broadcast(\"conversationMessage.sent\", event.payload);\n }\n });\n\n _comapiSDK.on(\"participantAdded\", function (event) {\n console.log(\"got a participantAdded\", event);\n $rootScope.$broadcast(\"participantAdded\", event);\n });\n\n _comapiSDK.on(\"participantRemoved\", function (event) {\n console.log(\"got a participantRemoved\", event);\n $rootScope.$broadcast(\"participantRemoved\", event);\n });\n\n _comapiSDK.on(\"conversationDeleted\", function (event) {\n console.log(\"got a conversationDeleted\", event);\n $rootScope.$broadcast(\"conversationDeleted\", event);\n });\n\n }", "onData(data) {\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n }\n }", "function registerOpenHandler(handlerFunction) {\n socket.onopen = function () {\n console.log('open');\n handlerFunction();\n };\n}", "listen() {\n /* global ipc */\n ipc.on('search-count', this._searchCoundHandler);\n ipc.on('focus-input', this._focusHandler);\n }", "constructor() {\n super();\n\n this._Add_event(\"offer\");\n this._Add_event(\"data_in\");\n this._Add_event(\"file_end\");\n }", "_setupEvents () {\n\t\tvar self = this\n\n\t\tthis._logger.debug('Setting up Telnet communication events...')\n\n\t\tthis._connection.on('ready', function (prompt) {\n\t\t\tself._logger.debug(`Telnet connection ready!`)\n\n\t\t\tself._logger.info(`Obtaining version from MD-DM at ${self.host}...`)\n\n\t\t\tself._connection.exec('VERsion', function (err, response) {\n\t\t\t\tif (err)\n\t\t\t\t{\n\t\t\t\t\treturn self._logger.error(`Failed to get version from MD-DM: ${err}`)\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tself._logger.verbose(`VERsion response: ${response}`)\n\t\t\t\t\tself.device = TelnetOutputParser.parseVersion(response)\n\t\t\t\t\tself.device.connected = true\n\t\t\t\t\tself._logger.info(`Connected to ${self.device.name}, running ${self.device.firmware.version}.`)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\n\t\tthis._connection.on('close', function () {\n\t\t\tself._logger.warn('Telnet session closed.')\n\t\t\tself.device.connected = false\n\n\t\t\tif (self.started)\n\t\t\t{\n\t\t\t\tself._logger.info(`Reconnecting to ${self.host} in 5s.`)\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tself.start.call(self)\n\t\t\t\t}, 5000)\n\t\t\t}\n\t\t})\n\t}", "onevent(packet) {\n const args = packet.data || [];\n if (null != packet.id) {\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "createEventHandlers() {\n this.player.on('initialization_error', e => { console.error(e); });\n this.player.on('authentication_error', e => {\n console.error(e);\n this.setState({ loggedIn: false});\n });\n this.player.on('account_error', e => { console.error(e); });\n this.player.on('playback_error', e => { console.error(e); });\n\n this.player.on('player_state_changed', state => this.onStateChanged(state));\n\n this.player.on('ready', data => {\n let { device_id } = data;\n console.log(\"Listen now\");\n this.setState({ deviceId: device_id });\n });\n }", "listen() {\n /* global ipc */\n ipc.on('search-count', this._searchCoundHandler);\n ipc.on('focus-input', this._focusHandler);\n this.addEventListener('keydown', this._keydownHandler);\n }", "listenToEvents() {\n this.listenTo(this.view, 'destroy', this.destroy);\n this.listenTo(this.channel, 'activate:tab', this.activateTab);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "setupEvents() {\n this.eventEmitter\n .on('close', () => {\n this.botInterface.emit('close');\n })\n .on('connect', () => {\n this.loadSavedEvents();\n })\n .on('reconnect', () => {\n this.reconnect();\n })\n .on('shutdown', () => {\n this.botInterface.emit('shutdown');\n })\n .on('start', () => {\n this.botInterface.emit('start');\n })\n .on('ping', (args) => {\n this.dispatchMessage(...args);\n })\n .on('message', (args) => {\n this.handleMessage(...args);\n })\n .on('channel', (args) => {\n this.handleChannelEvents(...args);\n })\n .on('user', (args) => {\n this.handleUserEvents(...args);\n })\n .on('team', (args) => {\n this.handleTeamEvents(...args);\n })\n .on('presence', (args) => {\n this.handlePresenceEvents(...args);\n });\n }", "function eventsHandler(req, res, next) {\n // Mandatory headers and http status to keep connection open\n const headers = {\n 'Content-Type': 'text/event-stream',\n 'Connection': 'keep-alive',\n 'Cache-Control': 'no-cache'\n };\n res.writeHead(200, headers);\n\n // After client opens connection send current state as string\n const data = `data: ${JSON.stringify(state)}\\n\\n`;\n res.write(data);\n\n // Generate an id based on timestamp and save res\n // object of client connection on clients list\n // Later we'll iterate it and send updates to each client\n const clientId = Date.now();\n const newClient = {\n id: clientId,\n res\n };\n console.log(`${clientId} Connection opened`);\n // console.log(req);\n clients.push(newClient);\n\n // When client closes connection we update the clients list\n // avoiding the disconnected one\n req.on('close', () => {\n console.log(`${clientId} Connection closed`);\n clients = clients.filter(c => c.id !== clientId);\n });\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"X\");\n client.subscribe(\"Y\");\n client.subscribe(\"smile\");\n}", "function subscribeForEvents() {\n const userResponseEvetnType = 'UserHIReceived';\n const subscriber = eventSubscriber();\n subscriber.subscribeEvent(userResponseEvetnType, userResponseEventReceived);\n }", "static listenSocketEvents() {\n Socket.shared.on(\"wallet:updated\", (data) => {\n let logger = Logger.create(\"wallet:updated\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(Wallet.actions.walletUpdatedEvent(data));\n });\n }", "onInit() {\n this._client.subscribe(\"connect\", this.onConnect.bind(this));\n this._client.subscribe(\"message\", this.onMessage.bind(this));\n this._client.subscribe(\"error\", this.onError.bind(this));\n }", "function subscribe(p){\n // Add events\n p.interactive = true;\n p.buttonMode = true;\n p\n // events for drag start\n .on('mousedown', onDragStart)\n .on('touchstart', onDragStart)\n // events for drag end\n .on('mouseup', onDragEnd)\n .on('mouseupoutside', onDragEnd)\n .on('touchend', onDragEnd)\n .on('touchendoutside', onDragEnd)\n // events for drag move\n .on('mousemove', onDragMove)\n .on('touchmove', onDragMove);\n}", "startSocketHandling() {\n this.userNamespace.on('connection', (socket) => {\n logger.debug(`New socket connected to namespace ${this.userNamespace.name} + ${socket.id}`);\n\n // Register socket functions\n socket.on('getQuestions', this.getQuestions(socket));\n socket.on('answerQuestion', this.answerQuestion(socket));\n socket.on('answerOpenQuestion', this.answerOpenQuestion(socket));\n });\n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case dist.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n super.emit(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case dist.PacketType.EVENT:\n this.onevent(packet);\n break;\n case dist.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case dist.PacketType.ACK:\n this.onack(packet);\n break;\n case dist.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case dist.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case dist.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n super.emit(\"connect_error\", err);\n break;\n }\n }", "_setup() {\n this.setHeaderFunc({\n 'Content-Type': 'text/event-stream',\n 'Cache-Control': 'no-cache, no-transform',\n 'Connection': 'keep-alive'\n })\n this._writeKeepAliveStream(true)\n this._setRetryInterval()\n this.send(this.connectEventName, this.uid)\n\n const timer = setInterval(this._writeKeepAliveStream.bind(this), this.heartBeatInterval)\n\n this.stream.on('close', () => {\n clearInterval(timer)\n connectionMap.delete(this.uid)\n this.transformStream.destroy()\n })\n connectionMap.set(this.uid, this)\n }", "bindCallbacks() {\n this.socket.onopen = (event) => this.onopen(event);\n this.socket.onmessage = (event) => this.onmmessage(event);\n this.socket.onclose = (event) => this.onclose(event);\n this.socket.onerror = (event) => this.onerror(event);\n }", "_listen() {\n let onExit = () => {\n this._log('exit signal');\n\n this._exit();\n };\n\n let onMessage = (data) => {\n if (data && data.event === SIGNAL_OUT_OF_MEMORY) {\n this.rotate();\n }\n\n this.emit('message', data);\n };\n\n let onDisconnect = () => {\n this._log('disconnect signal');\n\n if (!this.started || this._disconnecting) {\n return;\n }\n\n this._exit();\n };\n\n let onClose = () => {\n this._log('close signal');\n };\n\n this.worker.on('exit', onExit);\n this.worker.on('message', onMessage);\n this.worker.on('disconnect', onDisconnect);\n this.worker.on('close', onClose);\n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace) return;\n\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n } else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n\n break;\n\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message); // @ts-ignore\n\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "subscribeEvents(uuid) {\n logManagement.log(uuid, 'Start: DeviceUtility.subscribeEvents', 'debug');\n deviceSystem.on('attach', this.emitEvent.bind(this, 'attach'));\n deviceSystem.on('detach', this.emitEvent.bind(this, 'detach'));\n logManagement.log(uuid, 'End: DeviceUtility.subscribeEvents', 'debug');\n }", "_subscribeToChipEvents() {\n super._subscribeToChipEvents();\n this._listenToChipsFocus();\n this._listenToChipsBlur();\n }", "async registerEvents() {\n xtsMarketDataWS.onConnect((connectData) => {\n console.log(connectData, \"connectData\");\n });\n\n xtsMarketDataWS.onJoined((joinedData) => {\n console.log(joinedData, \"joinedData\");\n });\n\n xtsMarketDataWS.onMarketDepthEvent((marketDepthData) => {\n console.log(marketDepthData, \"marketDepthData\");\n });\n\n xtsMarketDataWS.onError((errorData) => {\n console.log(errorData, \"errorData\");\n });\n\n xtsMarketDataWS.onDisconnect((disconnectData) => {\n console.log(disconnectData, \"disconnectData\");\n });\n\n xtsMarketDataWS.onLogout((logoutData) => {\n console.log(logoutData, \"logoutData\");\n });\n }", "_onConnected() {\n this.emit(\"connected\");\n for (let marketSymbol of this._tickerSubs.keys()) {\n this._sendSubTicker(marketSymbol);\n }\n for (let marketSymbol of this._tradeSubs.keys()) {\n this._sendSubTrades(marketSymbol);\n }\n for (let marketSymbol of this._level2SnapshotSubs.keys()) {\n this._sendSubLevel2Snapshots(marketSymbol);\n }\n for (let marketSymbol of this._level2UpdateSubs.keys()) {\n this._sendSubLevel2Updates(marketSymbol);\n }\n for (let marketSymbol of this._level3UpdateSubs.keys()) {\n this._sendSubLevel3Updates(marketSymbol);\n }\n this._watcher.start();\n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n super.emit(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n super.emit(\"connect_error\", err);\n break;\n }\n }", "onData(data) {\n const self = this;\n debug(\"polling got data %s\", data);\n const callback = function(packet, index, total) {\n // if its the first message we consider the transport open\n if (\"opening\" === self.readyState && packet.type === \"open\") {\n self.onOpen();\n }\n\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n self.onClose();\n return false;\n }\n\n // otherwise bypass onData and handle the message\n self.onPacket(packet);\n };\n\n // decode payload\n lib$1.decodePayload(data, this.socket.binaryType).forEach(callback);\n\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit(\"pollComplete\");\n\n if (\"open\" === this.readyState) {\n this.poll();\n } else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n }", "function onOpen(evt) \n{\n\tconsole.info(\"onOpen\");\n websocketConnectedCallback();\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"bdcc/itaxi\");\n}", "onData(data) {\n const self = this;\n debug(\"polling got data %s\", data);\n const callback = function(packet, index, total) {\n // if its the first message we consider the transport open\n if (\"opening\" === self.readyState && packet.type === \"open\") {\n self.onOpen();\n }\n\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n self.onClose();\n return false;\n }\n\n // otherwise bypass onData and handle the message\n self.onPacket(packet);\n };\n\n // decode payload\n parser.decodePayload(data, this.socket.binaryType).forEach(callback);\n\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit(\"pollComplete\");\n\n if (\"open\" === this.readyState) {\n this.poll();\n } else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n }", "onData(data) {\n const self = this;\n debug(\"polling got data %s\", data);\n const callback = function(packet, index, total) {\n // if its the first message we consider the transport open\n if (\"opening\" === self.readyState && packet.type === \"open\") {\n self.onOpen();\n }\n\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n self.onClose();\n return false;\n }\n\n // otherwise bypass onData and handle the message\n self.onPacket(packet);\n };\n\n // decode payload\n parser.decodePayload(data, this.socket.binaryType).forEach(callback);\n\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit(\"pollComplete\");\n\n if (\"open\" === this.readyState) {\n this.poll();\n } else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(subscribeTopic.lights); //for subscription of lights\r\n client.subscribe(subscribeTopic.window); //for subscription of windows\r\n client.subscribe(subscribeTopic.tempHumidity); //for subscription of tempHumidity\r\n client.subscribe(subscribeTopic.tempTemperature);\r\n client.subscribe(subscribeTopic.AirQuality); //for subscription of AirQuality\r\n}", "function event_initialise(){\n\tgcAddListener(capture_events_onCbusMessage);\n}", "connectedCallback() {\n // Detect super?\n if (this.addEvents) this.addEvents();\n }", "function linkToCuratedDeviceEvents() {\n self.curatedDevice.on(\n 'DEVICE_DISCONNECTED',\n curatedDeviceDisconnected\n );\n self.curatedDevice.on(\n 'DEVICE_RECONNECTED',\n curatedDeviceReconnected\n );\n self.curatedDevice.on(\n 'DEVICE_ERROR',\n curatedDeviceError\n );\n self.curatedDevice.on(\n 'DEVICE_RECONNECTING',\n curatedDeviceReconnecting\n );\n self.curatedDevice.on(\n 'DEVICE_ATTRIBUTES_CHANGED',\n cureatedDeviceAttributesChanged\n );\n }", "function handleOpen() {\n $log.info('Web socket open - ', url);\n vs && vs.hide();\n\n if (fs.debugOn('txrx')) {\n $log.debug('Sending ' + pendingEvents.length + ' pending event(s)...');\n }\n pendingEvents.forEach(function (ev) {\n _send(ev);\n });\n pendingEvents = [];\n\n connectRetries = 0;\n wsUp = true;\n informListeners(host, url);\n }", "onConnection(delegate) {\n this.connected = delegate\n }", "_onSocketOpen(variable, evt) {\n variable._socketConnected = true;\n // EVENT: ON_OPEN\n initiateCallback(VARIABLE_CONSTANTS.EVENT.OPEN, variable, _.get(evt, 'data'), evt);\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"ips\");\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(SUBSCRIBER);\n }", "bindSocketListeners() {\n //Remove listeners that were used for connecting\n this.netClient.removeAllListeners('connect');\n this.netClient.removeAllListeners('timeout');\n // The socket is expected to be open at this point\n this.isSocketOpen = true;\n this.netClient.on('close', () => {\n this.log('info', `Connection to ${this.endpointFriendlyName} closed`);\n this.isSocketOpen = false;\n const wasConnected = this.connected;\n this.close();\n if (wasConnected) {\n // Emit only when it was closed unexpectedly\n this.emit('socketClose');\n }\n });\n\n this.protocol = new streams.Protocol({ objectMode: true });\n this.parser = new streams.Parser({ objectMode: true }, this.encoder);\n const resultEmitter = new streams.ResultEmitter({objectMode: true});\n resultEmitter.on('result', this.handleResult.bind(this));\n resultEmitter.on('row', this.handleRow.bind(this));\n resultEmitter.on('frameEnded', this.freeStreamId.bind(this));\n resultEmitter.on('nodeEvent', this.handleNodeEvent.bind(this));\n\n this.netClient\n .pipe(this.protocol)\n .pipe(this.parser)\n .pipe(resultEmitter);\n\n this.writeQueue = new WriteQueue(this.netClient, this.encoder, this.options);\n }", "addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n\n this.onOpen();\n };\n\n this.ws.onclose = this.onClose.bind(this);\n\n this.ws.onmessage = ev => this.onData(ev.data);\n\n this.ws.onerror = e => this.onError(\"websocket error\", e);\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "function onConnect() {\n emitHello();\n $log.log(\"monitor is connected\");\n }" ]
[ "0.73237157", "0.7254929", "0.72468", "0.7221486", "0.718474", "0.71351457", "0.71309495", "0.71125484", "0.7076456", "0.6761499", "0.6736577", "0.6460867", "0.6313735", "0.6308095", "0.6271258", "0.6154106", "0.61204135", "0.60877234", "0.6078979", "0.60705215", "0.59825456", "0.5974573", "0.5968478", "0.59549826", "0.5937507", "0.59365845", "0.59259963", "0.59165996", "0.5902295", "0.589235", "0.588721", "0.5875319", "0.5870689", "0.5863979", "0.58566594", "0.58456963", "0.5837541", "0.5828339", "0.5828339", "0.58111763", "0.57978624", "0.57967657", "0.5781309", "0.5780821", "0.5771478", "0.57660264", "0.57660264", "0.57608426", "0.57595706", "0.57559335", "0.5753065", "0.5746356", "0.5735782", "0.5734123", "0.57261646", "0.5722315", "0.5719146", "0.57142574", "0.5713677", "0.57063115", "0.57056236", "0.5703815", "0.5703815", "0.5703815", "0.570231", "0.5698703", "0.56969076", "0.5696469", "0.56960815", "0.56956565", "0.5684862", "0.56822085", "0.5665004", "0.5664987", "0.5659461", "0.5659167", "0.565448", "0.56533116", "0.56337976", "0.56264526", "0.5622868", "0.5619323", "0.5611613", "0.55983126", "0.5596356", "0.5588471", "0.5588471", "0.558652", "0.5570672", "0.55704534", "0.5569893", "0.5569337", "0.55667496", "0.55661416", "0.5563374", "0.556324", "0.5560899", "0.55580056", "0.5552193", "0.55479866" ]
0.70583206
9
Whether the Socket will try to reconnect when its Manager connects or reconnects
get active() { return !!this.subs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting && this._reconnection && this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this.reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }", "reconnect() {\n if ( this.socket )\n {\n this.socket.close();\n delete this.socket;\n }\n\n this.connect();\n }", "function isConnect() {\n return !needWait;\n }", "SOCKET_RECONNECT(state, count) {\n state.socket.isReconnecting = true\n console.info(state.socket, count, \"reconnect socket\")\n if (count >= 3) {\n // window.location.href = '/';\n }\n }", "SOCKET_RECONNECT(state, count) {\n console.log('Reconnect: ', count)\n }", "async _reconnect() {\n await this._waitBackgroundConnect();\n await this._connect();\n }", "SOCKET_RECONNECT() {\n // console.info(state, count);\n }", "_reconnect () {\n if (this._reconnecting === true) return\n this._reconnecting = true\n\n log('Trying to reconnect to remote endpoint')\n this._checkInternet((online) => {\n if (!online && !cst.PM2_DEBUG) {\n log('Internet down, retry in 2 seconds ..')\n this._reconnecting = false\n return setTimeout(this._reconnect.bind(this), process.env.NODE_ENV === 'test' ? 1 : 2000)\n }\n this.connect((err) => {\n if (err || !this.isConnected()) {\n log('Endpoint down, retry in 5 seconds ...')\n this._reconnecting = false\n return setTimeout(this._reconnect.bind(this), process.env.NODE_ENV === 'test' ? 1 : 5000)\n }\n\n log('Connection etablished with remote endpoint')\n this._reconnecting = false\n this._emptyQueue()\n })\n })\n }", "function reconnectTimer () {\n if (!ws || ws.readyState == WebSocket.CLOSED) {\n reallyConnect();\n }\n }", "attemptReconnect(resetAndReconnect = true) {\n ConnectionManager.reconnect(resetAndReconnect);\n }", "function checkConnectionStatus() {\n if (!client.isConnected()) {\n connect();\n }\n}", "reconnect() {\n this.connectionManager.reconnect();\n }", "get isConnected() {return false;}", "SOCKET_RECONNECT() {\n //console.info(state, count);\n }", "init() {\n this.get('socketId').then((oldSocketId) => {\n if (oldSocketId !== null && this._io['sockets']['connected'].hasOwnProperty(oldSocketId)) {\n this.logger.log('detected a new connection from the same client'\n + ' | disconnecting the old connection of socket id: ' + this._socketId);\n try {\n this._io['sockets']['connected'][oldSocketId].emit('force-disconnect');\n } catch (err) {\n // Do nothing.\n }\n }\n this.set('socketId', this._socketId);\n });\n }", "reconnect () {\n if (!this.connected) {\n this.connected = true\n return this.connector.reconnect()\n } else {\n return Promise.resolve()\n }\n }", "async _maybeConnect() {\n if (this._isConnectedOrConnecting) {\n return null;\n }\n\n this._isConnectedOrConnecting = true;\n await this.client.connect();\n }", "reconnect () {\n if (!this.connected) {\n this.connected = true;\n return this.connector.reconnect()\n } else {\n return Promise.resolve()\n }\n }", "isConnected () {\n // TODO(ikajaste): It's possible this acutally returns true, make sure later\n return this.connection && this.connection.connected;\n }", "function checkConnection(){\n viewModel.notOnline(!navigator.onLine);\n // requests next check in 500 ms\n setTimeout(checkConnection, 500);\n}", "function checkIfNormalClientDisconnect()\n {\n \tvar is_server_up = checkIfServerIsUp(preferred_ip_address);\n \tconsole.log(\"Normal client disconnect : \" + is_server_up);\n \tif(is_server_up == true) {\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }", "reconnect() {\n this.debug('Attemping to reconnect in 5500ms...');\n /**\n * Emitted whenever the client tries to reconnect to the WebSocket.\n * @event Client#reconnecting\n */\n this.client.emit(Constants.Events.RECONNECTING);\n this.connect(this.gateway, 5500, true);\n }", "function reconnect () {\n if (connection.killed) {\n return;\n }\n\n // Make sure the connection is closed...\n try {\n connection.client.end();\n } catch (e) {}\n\n // Remove this from the available connections.\n self.connections = _.reject(self.connections, {port: port, host: host});\n connection.killed = true;\n\n // Wait and reconnect.\n setTimeout(function () {\n self.addConnection(port, host);\n }, config.check_interval);\n }", "_updateConnectionStatus() {\r\n\t\tif (!this.db) {\r\n\t\t\tthis.connected = false;\r\n\t\t\tthis.connecting = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (this.client) {\r\n\t\t\tthis.connected = this.client.isConnected();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.connected = this.db.topology.isConnected();\r\n\t}", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "reconnect(e, Data) {\n\n if (socket == null) {\n return socket.on('connect', () => {\n socket.emit('req', { event: e, data: Data });\n });\n }\n \n }", "attemptConnect() {\n ConnectionManager.connect();\n }", "function renew_server_socket()\n {\n \t// check if the server was in disconnected state and is now connected\n \tvar is_server_up = checkIfServerIsUp(preferred_ip_address);\n \tif(is_server_up == true) {\n \t // clear this polling function since the server is up now\n \t console.log(\"Clearing the interval function ..\");\n \t clearInterval(new_sock_checker);\n\n \t\tconsole.log(\"Restoring primary websocket connection after disconnect mode ..\");\n \t\tinit_primary_websocket(true);\n \t \n \t $(\"#disconnected_handler\").hide();\n \t $(\"#connected_handler\").show();\n \t \n \t // setup a session for this client with the session manager\n \t registerClientSessionInFailoverMode();\n \t} \t\n }", "function reconnect() {\n\n\tconsole.log(\"Reconnect called\");\n\t// Make sure there is not another reconnect attempt in progress (and that we are really not connected)\n\tif(active911.timer_controller.exists(\"reconnect\") || active911.xmpp.is_connected()) {\n\n\t\tconsole.log(\"Reconnect already in operation. Returning.\");\n\t\treturn;\n\t}\n\n\t// Set up a reconnect timer\n\tactive911.timer_controller.add(\"reconnect\",function(){\n\n\t\tif(!active911.xmpp.is_connected()) {\t// We used to make sure we were disconnected before reconnecting. But sometimes we can reach neither state, and we just need to go for it.\n\n\t\t\tconsole.log(\"Reconnect attempt\");\n\t\t\tactive911.xmpp.connect();\n\t\t}\n\n\t\treturn !active911.xmpp.is_connected();\t// Remove ourself once connected\n\n\t}, 10);\n\n\t// Connect right now\n\t// Don't do this since we may still be disconnecting\n\t/*\tif(active911.xmpp.is_disconnected()) {\n\n\t\t\tconsole.log(\"Reconnect is performing mmediate reconnect attempt\");\n\t\t\tactive911.xmpp.connect();\n\t\t\t}\n\t\t\t*/\n\n}", "isConnected() {\n return this.connection && this.connection.isConnected;\n }", "function tryReconnect() {\n reconnTimer = null;\n winston.warm(\"try to connect: %d\".grey, mongoose.connection.readyState);\n db = mongoose.connect(config.mongodb_development,function(err){\n\t if(err) {\n\t winston.error('connect mongodb error'.red,err);\n\t\t onConnectUnexpected(err);\n\t }\n\t else winston.log('mongodb connect success'.green,mongoose.connection.readyState);\n });\n}", "function connectionStatus() {\n if (!window.connecting || retry == 20) {\n window.forcing = false;\n retry = 0;\n connectBtn.disabled = false;\n return;\n }\n retry++;\n setTimeout(connectionStatus, 1000);\n }", "SOCKET_RECONNECT(state, count) {\n // console.log('ws重新连接')\n // console.info(state, count)\n if (state.socket.isConnected) {\n Message.success({\n content: 'websocket 重新连接成功',\n duration: 4\n })\n }\n \n }", "connect() {\n\t\ttry {\n\t\t\tif(!this.opts.url && !this._reconnectTo) {\n\t\t\t\tthis._lastError = `TCPTransport::connect url is required`;\n\t\t\t\tthrow new Error(this._lastError);\n\t\t\t}\n\n\t\t\tvar constructedUrl = (this.opts.url.indexOf('://') == -1 ? 'tcp://' : '') + this.opts.url;\n\t\t\tif(this._reconnectTo) {\n\t\t\t\tconstructedUrl = this._reconnectTo.url ? this._reconnectTo.url : `tcp://${this._reconnectTo.host}:${this._reconnectTo.port}`;\n\t\t\t\t// do not save reconnect to the URL. query original source again if disconnected\n\t\t\t\t// idea for AM pool: add ttl as a 3rd param to client.reconnect method\n\t\t\t\tthis._reconnectTo = null;\n\t\t\t}\n\t\t\tconst u = url.parse(constructedUrl);\n\t\t\tvar host = u.hostname;\n\t\t\tvar port = u.port;\n\t\t\tif(!port && u.protocol === 'http:') port = 80;\n\t\t\tif(!port && u.protocol === 'https:') port = 443;\n\n\t\t\tif(!port || !host) {\n\t\t\t\tthis._lastError = `TCPTransport::connect invalid URL. host and port are required to connect`;\n\t\t\t\tthrow new Error(this._lastError);\n\t\t\t}\n\n\t\t\tif(this._socket) this.disconnect();\n\n\t\t\tif(!this._socket) {\n\t\t\t\tthis._socket = new net.Socket();\n\t\t\t\tthis._socket.setKeepAlive(this.opts.keepalive || true);\n\t\t\t\tthis._socket.setNoDelay(this.opts.nodelay || true)\n\n\t\t\t\tthis._socket.on('connect', () => { \n\t\t\t\t\tthis._connected = true; \n\t\t\t\t\tthis.emit('connected');\n\t\t\t\t\tthis._measuretime = new Date();\n\t\t\t\t\tif(this._reconnectTimer) {\n\t\t\t\t\t\tclearTimeout(this._reconnectTimer);\n\t\t\t\t\t\tthis._reconnectTimer = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(this.opts.netstatPeriod) this.__netstatTimer = setInterval(() => { this._measureSpeed(); }, this.opts.netstatPeriod);\n\t\t\t\t\tthis.onConnect();\n\t\t\t\t});\n\t\t\t\tthis._socket.on('timeout', () => { this._connected = false; this.onTimeout(); this.emit('disconnected'); });\n\t\t\t\tthis._socket.on('error', this.onError.bind(this));\n\t\t\t\tthis._socket.on('data', this.onData.bind(this));\n\t\t\t\t\n\t\t\t}\n\n\t\t\tthis._socket.on('end', () => { this._connected = false; this.onEnd(); });\n\t\t\tthis._socket.on('close', (hadError) => { \n\t\t\t\tthis._connected = false; \n\t\t\t\tthis.emit('disconnected');\n\t\t\t\tthis.onClose(hadError);\n\t\t\t\tif(this.__netstatTimer) {\n\t\t\t\t\tclearInterval(this.__netstatTimer);\n\t\t\t\t\tthis.__netstatTimer = null;\n\t\t\t\t\tthis._measureSpeed();\n\t\t\t\t}\n\t\t\t\tthis._socket.removeAllListeners('end');\n\t\t\t\tthis._socket.removeAllListeners('close');\n\t\t\t\tthis._socket.destroy();\n\t\t\t});\n\n\t\t\tthis._bytesOut = 0;\n\t\t\tthis._bytesIn = 0;\n\n\t\t\tthis._beforeConnect && this._beforeConnect(); // hook. can throw exceptions\n\t\t\tthis.status = `Connecting to ${host}:${port}`;\n\t\t\tthis._socket.connect({port:port, host:host, lookup: this.opts.dnsCache || dns.lookup});\n\t\t}\n\t\tcatch(e) {\n\t\t\tthis.lastError = e.message;\n\t\t}\n\t}", "isConnected() {\n return !this._connection._closed;\n }", "isConnected() {\n return !this._connection._closed;\n }", "isConnected() {\n return !this._connection._closed;\n }", "function isSocketOpen() {\n var socket = gSocket;\n return socket !== null && socket.readyState === WebSocket.OPEN;\n}", "onSocketFullyConnected() {\n this.debugOut('socketFullyConnected()');\n this.last_socket_error = null;\n this.emit('open');\n }", "isSocket() {\n return (this.#type & IFMT) === IFSOCK;\n }", "get isConnected() {\n return !!this.sender;\n }", "_checkConnection(throw_error, force_reconnect) {\n\t\tlogger.debug('_checkConnection - start throw_error %s, force_reconnect %s',throw_error, force_reconnect);\n\t\tif(!this._stream) {\n\t\t\t// when there is no stream, then wait for the user to do a 'connect'\n\t\t\treturn;\n\t\t}\n\t\tlet state = getStreamState(this);\n\t\tif(this._connected || this._connect_running || state == 2) {\n\t\t\tlogger.debug('_checkConnection - this hub %s is connected or trying to connect with stream channel state %s', this._ep.getUrl(), state);\n\t\t}\n\t\telse {\n\t\t\tlogger.debug('_checkConnection - this hub %s is not connected with stream channel state %s', this._ep.getUrl(), state);\n\t\t\tif(throw_error && !force_reconnect) {\n\t\t\t\tthrow new Error('The event hub has not been connected to the event source');\n\t\t\t}\n\t\t}\n\n\t\t//reconnect will only happen when there is error callback\n\t\tif(force_reconnect) {\n\t\t\ttry {\n\t\t\t\tvar is_paused = this._stream.isPaused();\n\t\t\t\tlogger.debug('_checkConnection - grpc isPaused :%s',is_paused);\n\t\t\t\tif(is_paused) {\n\t\t\t\t\tthis._stream.resume();\n\t\t\t\t\tlogger.debug('_checkConnection - grpc resuming ');\n\t\t\t\t} else if(state != 2) {\n\t\t\t\t\t// try to reconnect\n\t\t\t\t\tthis._connected = false;\n\t\t\t\t\tthis._connect(true);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(error) {\n\t\t\t\tlogger.error('_checkConnection - error ::' + error.stack ? error.stack : error);\n\t\t\t\tvar err = new Error('Event hub is not connected ');\n\t\t\t\tthis._disconnect(err);\n\t\t\t}\n\t\t}\n\t}", "SOCKET_RECONNECT(state, count) {\n console.info(state, count);\n console.log(\"SOCKET_RECONNECT\");\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "function isConnected() {\n if (client === undefined) {\n return false;\n }\n return client.isConnected();\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this.reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "async reconnect () {\n this.reconnecting = true;\n await this.connect();\n \n //Object.values(this.subscriptions).forEach (sub => {\n // this._subscribe (sub);\n //});\n }", "function test(o0)\n{\n try {\no4.o11 = \"Socket already connected\";\n}catch(e){}\n}", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "_setupReconnect () {\n if (this.reconnectTimeout) {\n clearTimeout(this.reconnectTimeout)\n this.reconnectTimeout = null\n }\n\n if (this.currentRetries >= this.options.retriesAmount)\n return\n\n this.reconnectTimeout = setTimeout(this._reconnect.bind(this), 1000)\n }", "function checkConnection(serviceName, socket, aCtr, ownSocket, messageProcessor) {\n\t\tfunction checkLoop(ctr) {\n\t\t\t// resolved socket is valid; send heart beat (containing own connection info) to client\n\t\t\t\n\t\t\tif (socket.isValid || (util.cordova && ownSocket.isValid)) {\n\t\t\t\t//console.log(\"connection stored with name: \" + serviceName);\n\n\t\t\t\t/* \n\t\t\t\t * Note for Cordova :\n\t\t\t\t * WebRTC is still an experimental technology. Setting up a socket can take some time.\n\t\t\t\t *\n \t\t\t\t * Optimization: Sockets are bidirectional hence we only need one.\n \t\t\t\t * Take the one that is the first to be connected with the remote actor.\n \t\t\t\t * If both are connected at the time of checking, choose the socket pointing to the actor with the smallest ip.\n \t\t\t\t * --> This \"protocol\" ensures both actors will choose the same socket in that particular case.\n\t\t\t\t */\n\n\t\t\t\tvar choosenSocket;\n\n\t\t\t\tif (util.cordova) {\n\n\t\t\t\t\tif (socket.isValid && ownSocket.isValid && typeof(connections[serviceName]) !== 'undefined')\n\t\t\t\t\t\tchoosenSocket = connections[serviceName]; // Both connections are still valid, stay with the same connection\n\t\t\t\t\telse if (socket.isValid && ownSocket.isValid)\n\t\t\t\t\t\tchoosenSocket = (isIpLesser(socket.hostName, ownSocket.hostName)) ? socket : ownSocket;\n\t\t\t\t\telse if (socket.isValid)\n\t\t\t\t\t\tchoosenSocket = socket;\n\t\t\t\t\telse if (ownSocket.isValid)\n\t\t\t\t\t\tchoosenSocket = ownSocket;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Close the other socket \n\t\t\t\t\t * --> could result in problems if the socket we are going to close is not yet valid (because the other peer won't see that it has been closed).\n\t\t\t\t\t */\n\t\t\t\t\t//if(choosenSocket === socket) ownSocket.close();\n\t\t\t\t\t//else socket.close();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tchoosenSocket = socket;\n\n\t\t\t\tconnections[serviceName] = choosenSocket;\n\t\t\t\tvar objects = receptionist.getPublishedObjects();\n\t\t\t\t// notify newly added client all of all published objects\n\t\t\t\tfor (var typetag in objects){\n\t\t\t\t\tobjects[typetag].forEach(function (objectID) {\n\t\t\t\t\t\tvar nearReference = receptionist.getObjectReference(objectID).publicInterface;\n\t\t\t\t\t\tvar strategy = (nearReference.constructor == \"localFarReference\") ? \"by_reference\" : \"by_copy\";\n\t\t\t\t\t\tunicastObject(serviceName, strategy, objectID, typetag);\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\t// send messages from outbox of far reference to the client\n\t\t\t\tvar references = receptionist.getRemoteFarReferences(serviceName);\n\n\t\t\t\treferences.forEach(function (reference) {\n\t\t\t\t\treference.getOutbox().forEach(function(letter) {\n\t\t\t\t\t\tsendMessage(letter.message, letter.objectID, letter.futureID);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t// Send a heartbeat containing connection info to other client\n\t\t\t\tsendHeartbeat(serviceName);\n\t\t\t// client received a heartbeat from other client, resolve socket manually\n\t\t\t} else if (heartBeats[serviceName] && (ctr > 8)) {\n\t\t\t\t//console.log(\"using heartbeat info for: \" + serviceName);\n\t\t\t\tif (util.nodejs) {\n\t\t\t\t\tsocket = ambientModule.module.createTCPSocket();\n\t\t\t\t\tsocket.on('data', function(rawData) {\n\t\t\t\t\t\tmessageProcessor(message);\n\t\t\t\t\t});\n\t\t\t\t\tsocket.connect(heartBeats[serviceName], serviceName);\n\t\t\t\t\tsocket.isValid = true;\n\t\t\t\t} else {\n\t\t\t\t\tsocket = ambientModule.module.createTCPSocket({\n\t\t\t\t\t\thostName: serviceName,\n\t\t\t\t\t\tport: heartBeats[serviceName],\n\t\t\t\t\t\tmode: util.rw_mode\n\t\t\t\t\t});\n\t\t\t\t\tsocket.addEventListener('read', function(x) {\n\t\t\t\t\t\tmessageProcessor(message);\n\t\t\t\t\t});\n\t\t\t\t\tsocket.connect();\n\t\t\t\t}\n\t\t\t\tdelete heartBeats[serviceName];\n\t\t\t\tcheckLoop(0);\n\t\t\t}\n\t\t\t// keep waiting for valid socket connection for 30 seconds \n\t\t\telse if (ctr < 100) {\n\t\t\t\tsetTimeout(function(){checkLoop(ctr+1);}, 300);\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif (aCtr)\n\t\t\tcheckLoop(aCtr);\n\t\telse\n\t\t\tcheckLoop(0);\n\t}", "function think()\n{\n\tif(!connected)\n\t\tconnect();\n}", "function connected() {\n\t// return true;\n return navigator.connection.type != Connection.NONE;\n}", "function onConnectionEnabledChanged() {\n if (isConnectionEnabled && !streamSocketManager.isStarted) {\n streamSocketManager.start();\n } else if (!isConnectionEnabled && streamSocketManager.isStarted) {\n streamSocketManager.stop();\n }\n }", "reconnect() {\n\t\t//refreshes page to call componentDidMount() again,\n\t\t//this will force the peer to search for another connection\n\t\twindow.location.reload(true);\n\t\t//show connect button and hide disconnect button\n\t\tthis.setState({connState:true});\n\t}", "onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n super.emit(\"reconnect\", attempt);\n }", "function attemptReconnect() {\n if (reconnecting) return;\n reconnecting = true;\n\n while (reconnectHistory[0] &&\n Date.now() - reconnectHistory[0] > 5 * 60 * 60 * 1000) {\n reconnectHistory.splice(0, 1);\n }\n\n const num = reconnectHistory.length;\n const delay = num * num * num * 1000;\n console.log(\n 'Enqueuing reconnect attempt in', delay, 'ms (Recent attempts: ', num,\n ')');\n\n setTimeout(() => {\n console.log('Attempting reconnect...');\n reconnecting = false;\n reconnectHistory.push(Date.now());\n socket.open((...args) => {\n console.log(...args);\n if (args[0]) attemptReconnect();\n });\n }, delay);\n }", "reconnectUserInfo(){\n\t\tconst { socket, user } = this.state\n\n\t\tif(this.state.user != null){\n\n\t\t\tsocket.emit(USER_CONNECTED, user)\n\t\t}\n\n\t}", "function onSocketSecureConnect() {\n let data = _data.get(this);\n\n data.error = null;\n data.connected = true;\n\n _data.set(this, data);\n\n setImmediate(this.emit.bind(this, 'connected'));\n}", "is_connected() {\n return this.connected\n }", "SOCKET_RECONNECT (state, count) {\n console.info(state, count)\n }", "async reconnect() {\n const conn_status = _converse.connfeedback.get('connection_status');\n\n if (api.settings.get('authentication') === _converse.ANONYMOUS) {\n await tearDown();\n await clearSession();\n }\n if (conn_status === Strophe.Status.CONNFAIL) {\n // When reconnecting with a new transport, we call setUserJID\n // so that a new resource is generated, to avoid multiple\n // server-side sessions with the same resource.\n //\n // We also call `_proto._doDisconnect` so that connection event handlers\n // for the old transport are removed.\n if (\n api.connection.isType('websocket') &&\n api.settings.get('bosh_service_url')\n ) {\n await _converse.setUserJID(_converse.bare_jid);\n _converse.connection._proto._doDisconnect();\n _converse.connection._proto = new Strophe.Bosh(_converse.connection);\n _converse.connection.service = api.settings.get('bosh_service_url');\n } else if (\n api.connection.isType('bosh') &&\n api.settings.get('websocket_url')\n ) {\n if (api.settings.get('authentication') === _converse.ANONYMOUS) {\n // When reconnecting anonymously, we need to connect with only\n // the domain, not the full JID that we had in our previous\n // (now failed) session.\n await _converse.setUserJID(api.settings.get('jid'));\n } else {\n await _converse.setUserJID(_converse.bare_jid);\n }\n _converse.connection._proto._doDisconnect();\n _converse.connection._proto = new Strophe.Websocket(\n _converse.connection\n );\n _converse.connection.service = api.settings.get('websocket_url');\n }\n } else if (\n conn_status === Strophe.Status.AUTHFAIL &&\n api.settings.get('authentication') === _converse.ANONYMOUS\n ) {\n // When reconnecting anonymously, we need to connect with only\n // the domain, not the full JID that we had in our previous\n // (now failed) session.\n await _converse.setUserJID(api.settings.get('jid'));\n }\n\n if (_converse.connection.reconnecting) {\n _converse.connection.debouncedReconnect();\n } else {\n return _converse.connection.reconnect();\n }\n }", "checkConnectionStatus() {\n const connected = Meteor.status().connected;\n if (!connected) sAlert.error('Ingen tilkobling til server. Er du koblet til internett?');\n return connected;\n }", "function user_reconnect() {\n console.log(\"User reconnected.\");\n attempt_reopen_channel = true;\n fullyUsedUp = false;\n\n // set this to true so websockets automatically reopen the channel if they fail\n open_channel = true;\n\n send_version();\n set_ui_state(UI_STATES.CONNECTED);\n}", "checkReconnect( id, callback ) {\n if ( !this._reconnect[ id ] ) return;\n setTimeout( callback, this._wait );\n }", "function socketFullyConnected() {\n that.debugOut('Socket fully connected');\n that.reconnect_attempts = 0;\n that.connected = true;\n last_socket_error = null;\n that.emit('socket connected');\n }", "async _connect(autoLogin) {\n if (this._socket) return this._socket;\n\n // find the right device, if any\n const result = await this._detect();\n\n const opts = {\n ...this.opts,\n };\n if (autoLogin !== undefined) {\n opts.autoLogin = autoLogin;\n }\n\n return new Promise((resolve, reject) => {\n // we don't need to return anything from this callback:\n // eslint-disable-next-line\n this._waker().wake(opts, result.device, (err, socket) => {\n debug(\n `wake result: (autoLogin=${opts.autoLogin})`,\n err, `socket? ${!!socket}`,\n );\n\n if (err) return reject(err);\n if (!opts.autoLogin) return resolve();\n if (!socket) return reject(new Error('No socket'));\n\n if (this._socket) {\n // close existing socket\n this._socket.close();\n this._onClose();\n }\n\n this._socket = socket;\n this._connectedAt = Date.now();\n\n // forward socket events:\n socket.on('connected', () => {\n this.emit('connected', this);\n }).on('ready', () => {\n this.emit('ready', this);\n }).on('login_result', (loginResult) => {\n // NOTE: we're more likely to get this event from the waker\n this.emit('login_result', loginResult);\n }).on('login_retry', () => {\n this.emit('login_retry', this);\n }).on('error', (e) => {\n this.emit('error', e);\n }).on('disconnected', () => {\n this._onClose();\n this.emit('disconnected', this);\n });\n\n resolve(socket);\n\n // checking socket.client is a hack to\n // confirm that we're already connected\n if (socket.client) {\n // in fact, if we have a socket here\n // it should be connected...\n this.emit('connected', this);\n }\n });\n });\n }", "get closed() {\n return this.socket.remoteAddress === undefined || this._closingError !== undefined;\n }", "SOCKET_RECONNECT(state, count) {\n console.info(state, count)\n }", "SOCKET_RECONNECT(state, count) {\n console.info(state, count)\n }", "_wsReconnect () {\n this._log('websocket reconnecting...');\n\n if (this._options.onReconnect) {\n this._options.onReconnect();\n }\n\n this._cache.reconnectingAttempts++;\n this._ws = getWebSocket({\n url: this._url,\n protocols: this._protocols,\n options: this._options\n });\n this._initWsCallbacks();\n }", "waitForSocketConnection(callback){\n const socket = this.socketRef;\n const recursion = this.waitForSocketConnection;\n // It can maintain connected conditions.\n\n setTimeout(\n // Set Times by seconds milliseconds.\n function(){\n if (socket.readyState === 1){\n console.log('connection is secure');\n // if didn't pass in a callback,\n // then call the callback.\n if(callbacks != null){\n callback();\n }\n // Otherwise will just return.\n return;\n } else {\n console.log('waiting for connection...');\n recursion(callback);\n }\n }, 1);\n }", "function attemptConnect(remote, callback) {\n\n var connected = false;\n\n function onLedgerClosed() {\n if (isConnected(remote)) {\n connected = true;\n remote.removeListener('ledger_closed', onLedgerClosed);\n callback(null, true);\n return;\n }\n }\n\n remote.once('ledger_closed', onLedgerClosed);\n\n var timeout_duration;\n if (remote._getServer() && remote._getServer().server) {\n timeout_duration = Date.now() - remote._getServer().server._lastLedgerClose;\n } else {\n timeout_duration = 20000;\n }\n\n setTimeout(function(){\n remote.removeListener('ledger_closed', onLedgerClosed);\n if (!connected) {\n callback(new Error('Cannot connect to rippled. No \"ledger_closed\" events were heard within 20 seconds, most likely indicating that the connection to rippled has been interrupted or the rippled is unresponsive. Please check your internet connection and server settings and try again.'));\n }\n return;\n }, timeout_duration);\n\n remote.connect();\n\n}", "function onReconnect() {\n emitHello();\n $log.log(\"monitor is reconnected\");\n }", "socketIsHost(socket) {\n return socket == this.hostSocket;\n }", "async openSocket() {\n return this._connect();\n }", "onConnect() {\n this.socket && this.socket.write(this.handshake);\n this.healthCheck = setInterval(() => {\n if (new Date() - this.lastRead > 35000) {\n this.close(false);\n }\n }, 5 * 1000);\n }", "function reconnect(err) {\n\tadapter.log.warn(\"Connection to '\" + auroraAPI.host + \":\" + auroraAPI.port + \"' lost, \" + formatError(err) + \". Try to reconnect...\");\n\tstopAdapterProcessing();\n\tsetConnectedState(false);\t\t// set disconnect state\n\tlastError = err;\n\tStartConnectTimer(true);\t\t// start connect timer\n}", "SOCKET_RECONNECT(state, count) {\n console.info(state, count)\n }", "_online() {\n // if we've requested to be offline by disconnecting, don't reconnect.\n if (this.currentStatus.status != \"offline\") this.reconnect();\n }", "function checkNetConnection() {\n\tvar status = window.navigator.onLine;\n\tif (status) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function hasConnectionError() {\n\t\t\treturn settings.connectionError;\n\t\t}", "function checkClientAlreadyConnected(request)\n { \n if (all_players_list[request.sessionID] != null)\n {\n request.session.player = all_players_list[request.sessionID];\n request.session.player['ref_count']++;\n console.log(\"This session (client \" + request.session.player.player_tag + \") is already connected. Increasing refcount to \" + request.session.player['ref_count']);\n return true;\n }\n return false;\n }", "connectToRSServer() {\n if (this.runScore && this.runScore.connecting) {\n log.info('Currently attempting connection.');\n return;\n }\n\n const serverInfo = this.serverInfo();\n this.runScore = new net.Socket();\n\n const attemptRSServerConnection = (info: { host: string, port: number }) => {\n // log.info(`Connecting to RSServer on: ${serverInfo.host}:${serverInfo.port}`);\n this.runScore.connect(info, () => {\n log.info('Connected to RSServer!');\n this.store.dispatch(setRSServerConnection(true));\n });\n }", "function activateAutoReconnect() {\n\tif(io.socket) {\n\t\tvar autoReconnectIntervalId = window.setInterval(function () {\n\t\t\t// console.log('checking if websocket is alive: state = '+ io.socket.readyState);\n\t\t\tif(io.socket != null && io.socket.readyState == 3) {\n\t\t\t\tconsole.log(\"WebSocket closed, reconnect...\");\n\t\t\t\tio.init();\n\t\t\t}\n\t\t}, 5000);\n\n\t\t// clear interval removed after pr#353 to fix reconnect after frozen tab \t\t\n\t\twindow.onbeforeunload = function() {\n\t\t//console.log('event onbeforeunload');\n\t\twindow.clearInterval(autoReconnectIntervalId);\n\t\t};\n\t}\n}", "connect () {\n if (this.state == this.states.connected && this.socket.readyState == 'open')\n return\n\n if (!this.hasAuth())\n return this.fail('No auth parameters')\n\n this.state = this.states.connecting\n\n // To prevent duplicate messages\n this.clearSocketListeners()\n if (this.socket)\n this.socket.close()\n\n const url = this._buildUrl()\n this.socket = eio(url, this.options)\n this.socket.removeAllListeners('open')\n this.socket.removeAllListeners('error')\n this.socket.once('open', this.onOpen.bind(this))\n this.socket.once('error', (err) => {\n if (console && typeof(console.trace) == 'function') // eslint-disable-line\n console.trace(err) // eslint-disable-line\n\n if (err && err.type == 'TransportError') {\n this.fail(err)\n this._setupReconnect()\n }\n })\n }", "function onConnect () {\n socket.removeListener('error', onError);\n socket.destroy();\n\n options.path = exports.nextSocket(options.path);\n exports.getSocket(options, callback);\n }", "function reconnect(nickname, pw) {\r\n socket.emit('reconnect', nickname, pw);\r\n}", "async reconnect () {\n const delay = (t) => { // Helper function to await time-outed reconnect\n return new Promise((resolve) => {\n setTimeout(() => resolve(), t)\n })\n }\n await delay(this.delay * Math.pow(2, this.delayCounter))\n this.delayCounter++\n await this.reconn()\n }", "_changeNetwork() {\n\t\tconst onLine = window.navigator.onLine;\n\n\t\tif (!onLine) {\n\t\t\tthis.set('_state', STATES.OFFLINE);\n\t\t} else {\n\t\t\tthis.reconnect();\n\t\t}\n\t}", "function try_socket (success) {\n if (socket_connected) {\n try {\n success()\n } catch (e){\n socket_connected = false\n returnMessage(0)\n }\n }\n}", "clientConnected() {\n super.clientConnected('connected', this.wasConnected);\n\n this.state = 'connected';\n this.wasConnected = true;\n this.stopRetryingToConnect = false;\n }" ]
[ "0.7151596", "0.70292515", "0.70292515", "0.70292515", "0.702447", "0.70179117", "0.69970465", "0.6790252", "0.6711622", "0.6711497", "0.66968596", "0.66409576", "0.66295606", "0.6627513", "0.6609298", "0.65415686", "0.6524716", "0.65166223", "0.6496915", "0.63725656", "0.6368237", "0.6368083", "0.6362503", "0.6359284", "0.6358777", "0.63465947", "0.6309367", "0.6305956", "0.6299398", "0.6281765", "0.6281765", "0.6281765", "0.6279919", "0.6256418", "0.62526983", "0.62391055", "0.6184471", "0.6162913", "0.6154866", "0.6154828", "0.6150707", "0.61424613", "0.61424613", "0.61424613", "0.6131734", "0.610094", "0.6100243", "0.60935086", "0.6083567", "0.60806024", "0.60657173", "0.60541403", "0.6042223", "0.60400283", "0.6031885", "0.60236126", "0.60236126", "0.6021569", "0.60196877", "0.60121626", "0.60042024", "0.5988263", "0.5982699", "0.5982258", "0.597174", "0.597104", "0.5964765", "0.5963274", "0.59525627", "0.5948039", "0.59348553", "0.592933", "0.5926764", "0.5917845", "0.59162945", "0.59137344", "0.59055114", "0.5899039", "0.5899039", "0.589391", "0.5889742", "0.58870935", "0.5857773", "0.58573467", "0.58278096", "0.5826269", "0.5825421", "0.5817615", "0.5815846", "0.5815711", "0.57895064", "0.5785859", "0.57712513", "0.57676905", "0.5766097", "0.57653314", "0.576299", "0.5753999", "0.5751479", "0.5749081", "0.5748143" ]
0.0
-1
Sends a `message` event.
send(...args) { args.unshift("message"); this.emit.apply(this, args); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SendMessage(message)\n{\n client.sendEvent(new Message(JSON.stringify(message))); //, printResultFor(\"send\"));\n}", "sendMessage(message) {\n self.socket.emit('message', message);\n }", "sendMessage(message) {\n this.socket.emit('message', message);\n }", "function sendMessage(message) {\n\tconsole.log('Client sending message ', message);\n\t// send the server a message to launch the on message handler\n\tsocket.emit('message', message);\n}", "function sendMessage(message){\n console.log('Sending message: ', message);\n socket.emit('message', message);\n}", "tell(event, message) {\n this.eventStream.emit(event, message);\n }", "send_message(message) {\n this.socket.send(message)\n }", "function doSend(message) {\n console.log(\"Sending: \" + message);\n websocket.send(message);\n}", "dispatchMessageEvent(){\n const detail = this.getMessage();\n const event = new CustomEvent('message', {detail});\n this.dispatchEvent(event);\n }", "function sendMessage(message) {\n console.log('Client sending message: ', message);\n socket.emit('message', message);\n }", "function sendMessage(message) {\n console.log('Client sending message: ', message);\n socket.emit('message', message);\n}", "function sendMessage(message){\n\t\tconsole.log('Client sending message: ', message);\n\t\tsocket.emit('message', message);\n}", "sendMessage(message) {\n if (this.handler) {\n this.handler.sendMessageFor(message, this.identity);\n }\n }", "function messageSend(message) {\n sendMessage(message, roomID);\n }", "function sendMessage (message) {\n connection.sendMessage({\n message: message\n });\n renderMessage(message);\n }", "function sendMessage(message){\n socket.emit('message', message);\n}", "function emitMessage(message) {\n torrentAlerter.emit('message', message);\n}", "emitMessage (event) {\n this.emit('on-message', event)\n }", "function send(message) {\n\t\tconsole.log('Client socket: Sending message: ' + message);\n\t\tmWebSocket.send(message);\n\t}", "function sendMessage(message){\n console.log('Sending message: ', message);\n socket.emit('message', {\n 'destination' : destination,\n 'msgObj' : message\n });\n}", "function sendMessage (message) {\n\n // no message no fun\n if (!message || !message.event) { return; }\n\n switch (message.type) {\n\n case \"client\":\n if (clients[message.dest]) {\n clients[message.dest].emit(message.event, message.data);\n }\n break;\n\n case \"session\":\n for (var i in sessions[message.dest]) {\n var clientId = sessions[message.dest][i];\n if (clients[clientId]) {\n clients[clientId].emit(message.event, message.data);\n }\n }\n break;\n\n case \"group\":\n // TODO\n break;\n\n case \"all\":\n for (var clientId in clients) {\n clients[clientId].emit(message.event, message.data);\n }\n break;\n }\n}", "function sendMessage(message){\n\t\tconsole.log('Client sending vr_message: ', message);\n\t\tsocket.emit('vr_message', message);\n}", "function sendEvent(message){\n socket.emit('chat', {\n student: student.name,\n message: message\n });\n}", "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message,\n });\n }", "function sendMessage() {\n var windSpeed = 8 + (Math.random() * 7);\n var data = JSON.stringify({ \n deviceId: device, \n uuid: uuid(), \n windSpeed: windSpeed \n });\n var message = new Message(data);\n console.log(\"Sending message: \" + message.getData());\n client.sendEvent(message, printResultFor('send'));\n}", "function sendMessage(message) {\n\tdrone.publish({\n\t room: roomName,\n\t message\n\t});\n }", "send(message) {\n if (port) {\n port.postMessage(message);\n }\n }", "function sendMessage(message) {\n\t\n\tvar obj = {\n\t\tmsg: message\n\t};\n\t\n if (message !== \"\") {\n webSocket.send(JSON.stringify(obj));\n id(\"message\").value = \"\";\n }\n}", "function doSend(message) {\n let serializedData = JSON.stringify(message);\n writeToLog(\"----> REQUEST SENDED: \" + serializedData);\n websocket.send(serializedData);\n}", "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message\n });\n}", "function sendMessage(message) {\n drone.publish({\n room: roomName,\n message\n });\n}", "function sendMessage (message) { socket.emit('new message', cleanInput(message)); }", "function sendMessage() {\n // Create a new message object\n var message = {\n text: vm.messageText\n };\n\n // Emit a 'gameMessage' message event\n Socket.emit('gameMessage', message);\n\n // Clear the message text\n vm.messageText = '';\n }", "function sendMessage(event, message) {\n if(!mInitialized) {\n logger.warn('[socket-io] SocketIO is not initialized yet. Message cannot be sent.');\n return null;\n }\n\n if(typeof message !== 'object') {\n logger.error('[socket-io] Message must be instanced of an object');\n return null;\n }\n\n if(!message.id) {\n message.id = getUuid();\n }\n\n logger.debug('[socket-io] sending message.', message);\n\n mSocket.emit(event, message);\n\n return message;\n }", "function sendMessage(data) {\n socket.emit(\"message\", data);\n}", "sendSystemMessage(message) {\n this.socket.emit('message', { author: 's', message });\n }", "function send(message){\n append(line(message, 'blue'))\n websocket.send(message);\n}", "send(message) {\n this.log(\"Sending message: \"+message);\n this.ws.send(message);\n }", "send(message) {\n // Sanity check that what we're sending is a valid type.\n if (!message.type || !SOCKET_MESSAGE_TYPES[message.type]) {\n console.warn(\n `Outbound message: Unknown socket message type: \"${message.type}\" sent.`\n );\n }\n\n const messageJSON = JSON.stringify(message);\n this.websocket.send(messageJSON);\n }", "send (message) {\n if (_.isObject(message))\n message = MessageMaster.stringify(message)\n\n this.socket.send(message)\n }", "send(message) {\n if (this.interval_id == null) {\n this.connection.send(JSON.stringify(message));\n const captured = this;\n this.interval_id = setInterval(function () {\n captured.interval_event();\n }, 100);\n } else {\n this.last_written = message;\n }\n }", "function sendSignalingMessage(message) {\n\t\tdrone.publish({\n\t\t\troom: roomName,\n\t\t\tmessage\n\t\t});\n\t}", "function sendMessage(message) {\n if (message !== \"\" && players == \"double\") {\n \tconsole.log(\"typed + message\" + message);\n webSocket.send(message);\n id(\"message\").value = \"\";\n }\n}", "function sendMessage(message) {\n var mymsg = JSON.stringify(message);\n logg(\"SEND: \" + mymsg);\n console.log(\"****************************************\" + mymsg);\n socket.send(mymsg);\n}", "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\" + message.payloadString);\n write(message.payloadString);\n}", "function sendMessage(message) {\n input.value = message;\n send.click();\n }", "function send(message) {\n conn.send(JSON.stringify(message));\n}", "function onSocketMessage(message) {\n var action = actions[message.action + \"Action\"];\n if(action) action(message);\n }", "SOCKET_ONMESSAGE(state, message) {\n state.socket.message = message;\n }", "function send(message) {\n socket.emit(\"move\", {message:message});\n log(\"local\", message);\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n console.log(\"sendMessage\")\n }", "function onMessage(event) {\n\t\tconsole.log('Client socket: Message received: ' + event.data);\n\t\tcastEvent('onMessage', event);\n\t}", "sendMessage(message) {\n if (message.message.length < 1) {\n return false;\n }\n\n message.message = ': ' + message.message;\n\n this.socket.emit('chat message', message);\n }", "function emitMessage() {\n socket.emit('sendingMessage', {\n 'message': messageInput.value,\n 'username': username,\n 'userID': userID\n }, ROOM_ID);\n messageInput.value = '';\n}", "function sendMessage (message, room) {\n console.log('Client sending message: ', message, room);\n socket.emit('message', message, room);\n}", "function receive (message) {\n input.send(Message(id, requestUrl, message.toString()));\n }", "function sendMessage(message, room) {\n console.log(\"Client sending message: \", message, room);\n socket.emit(\"message\", message, room);\n}", "function emitMessage() {\n socket.emit('sendingMessage', {\n 'message': messageInputBox.value,\n 'username': username,\n 'userID': userID\n }, ROOM_ID);\n messageInputBox.value = '';\n}", "function sendMessage() {\n\tconst message = messageInputBox.value;\n\tdisplayMessage(message);\n\tdataChannel.send(message);\n\n\t// Clear the input box and re-focus it, so that we're\n\t// ready for the next message.\n\tmessageInputBox.value = \"\";\n\tmessageInputBox.focus();\n}", "function onSendMessage(e)\n{\n\tvar self = this;\n\te.preventDefault();\n\n\tshh.post({\n\t\t\"from\": this.identity,\n\t\t\"topic\": [ web3.fromAscii(TEST_TOPIC) ],\n\t\t\"payload\": [ web3.fromAscii(self.messagePayload()) ],\n\t\t\"ttl\": 1000,\n\t\t\"priority\": 10000\n\t});\n}", "SOCKET_ONMESSAGE(state, message) {\n // console.log(message, \"msgg\")\n state.socket.message = message\n }", "function sendMessage() {\n let message = $inputMessage.value;\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n addChatMessage({ username, message }, { kind: \"sent\" });\n // tell server to execute 'new message' and send along one parameter\n\n let payload = {\n username: username,\n message: message\n }\n if (!dev) {\n socket.emit('new message', payload);\n }\n }\n }", "function SendMessage(e) {\r\n\r\n\t\te.preventDefault();\r\n\t\tvar msg = document.getElementById(\"msg\").value.trim();\r\n\r\n\t\tif (msg && window.CustomEvent) {\r\n\t\t\tvar event = new CustomEvent(\"newMessage\", {\r\n\t\t\t\tdetail: {\r\n\t\t\t\t\tmessage: msg,\r\n\t\t\t\t\ttime: new Date(),\r\n\t\t\t\t},\r\n\t\t\t\tbubbles: true,\r\n\t\t\t\tcancelable: true\r\n\t\t\t});\r\n\r\n\t\t\te.currentTarget.dispatchEvent(event);\r\n\t\t}\r\n\r\n\t}", "SOCKET_ONMESSAGE(state, message) {\n state.socket.message = message;\n console.log(\"SOCKET_ONMESSAGE\");\n }", "sendMessage(message, room) {\n socket.emit('post-message', {text: message, room: room})\n }", "function receivedMessage(event) {\n messageHandler.handleMessage(event);\n }", "sendData(message, data){\n this.socket.emit(message, data);\n }", "SOCKET_ONMESSAGE(state, message) {\n switch (message.type) {\n case \"message\":\n state.messages.push(message.payload);\n break;\n default:\n state.socket.message = message;\n }\n }", "send(message) {\n message.time = Date.now();\n if (this.socket.readyState === 1) {\n this.socket.send(JSON.stringify(message));\n } else {\n this.sendBuffer.push(message);\n }\n }", "function sendMessage () {\n var message = $('#input_' + target).val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $('#input_' + target).val('');\n \n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', {\n message: message,\n target: target,\n displayName: displayName,\n });\n }\n }", "SOCKET_ONMESSAGE (state, message) {\n state.socket.message = message\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "function send(message) {\n iframe.contentWindow.postMessage(JSON.stringify(message), identityOrigin);\n }", "function sendMessage() {\n json.activeSince = moment();\n \n var message = JSON.stringify(json);\n \n console.log('Music ' + SOUNDS[json.instrument] + ' message : ' + message);\n\n socket.send(message, 0, message.length, protocol.PORT, protocol.MULTICAST_ADDRESS, function (err, bytes) {\n if (err) throw err;\n });\n}", "broadCastMessage(message){\n this.socket.send(message);\n }", "sendMessage(msg){\n this.socket.emit(\"client\", msg);\n }", "send(targetNest, message) {\n targetNest.receive(this.nestName, message);\n console.log(\"Message sent\");\n }", "function _send(message, chatstate) {\n var elem = $msg({\n to: contact.jid,\n from: jtalk.me.jid,\n type: \"chat\"\n });\n\n if (message) elem.c(\"body\", message);\n if (chatstate) {\n elem.c(chatstate, {xmlns: Strophe.NS.CHATSTATE});\n }\n\n connection.send(elem);\n }", "function send(message) {\n if(stompClient && stompClient.connected){\n stompClient.send(\"/socket-subscriber/call\", {}, JSON.stringify(message));\n }\n}", "_eventHandler(message) {\n // push to web client\n this._io.emit('service:event:' + message.meta.event, message.payload)\n this._io.emit('_bson:service:event:' + message.meta.event,\n this._gateway._connector.encoder.pack(message.payload))\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message,\n namecolor: namecolor,\n floatdir: 'right',\n msgbgcolor: '#94C2ED'\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "onClientMessage(message) {\n try {\n // Decode the string to an object\n const { event, payload } = JSON.parse(message);\n\n this.emit(\"message\", event, payload);\n } catch {}\n }", "onMessage( message ) {\n\t\tconsole.log(`Received message from client: ${ message.toString() }`);\n\t}", "send (message) {\n return this.receive(this.reporter(message))\n }", "onMessage(event) {\n try {\n const data = JSON.parse(event.data);\n // data.event is used to lookup which registered listener to call\n this.ee.emit(data.event, data);\n } catch (error) {\n this.ee.emit('error', error);\n }\n }", "onMessage(message) {\n log('received %s', message.type, message)\n this.emit('message', message)\n\n switch (message.type) {\n case 'ack':\n this.in.emit(`ack:${message.id}`, message)\n // No need to send an ack in response to an ack.\n return\n case 'data':\n if (message.data) this.emit('data', message.data)\n break\n default:\n }\n\n // Lets schedule an confirmation.\n this.multiplexer.add({\n type: 'ack',\n id: message.id\n })\n }", "function onMessageWasSent(message) {\r\n console.log(message);\r\n setState((state) => ({\r\n ...state,\r\n messageList: [...state.messageList, message],\r\n }));\r\n }", "send (message) {\n if (this.broker === null)\n throw new Error(\"not connected\")\n this.emit(\"sent\", message)\n this.broker.publish(`stream/${this.options.channel}/sender`, message, { qos: 2 }, (err) => {\n if (err)\n this.emit(\"send:error\", err)\n else\n this.emit(\"send:success\", message)\n })\n }", "async send(message, channel='unknown'){\n\n\t\ttry {\n\t\t\tlet body = {\n\t\t\t\tmac: Global.mac,\n\t\t\t\tdevice_name: Global.device_name,\n\t\t\t\t//public_ip: await Global.ip.public(),\n\t\t\t\t//private_ip: Global.ip.private,\n\t\t\t\tmessage: message || null\n\t\t\t}\n\t\t\n\n\t\t\tLogger.info(`Sending message to topic [${channel}]`);\n\t\t\tLogger.debug(JSON.stringify(body));\n\n\t\t\tthis.client.channels.get(channel).publish(Global.mac, body, err => {\n\t\t\t\tif(err){ Logger.error(err); } else { Logger.info(`Event published to topic [${channel}]`); }\n\t\t\t});\n\n\t\t} catch(err){\n\t\t\tLogger.error(err);\n\t\t}\n\n\t}", "function sendMessage(message) {\n\tinput.value = message;\n\tsend.click();\n}", "function sendMessage(channel, message){\n ipcRenderer.send(channel, message);\n}", "SOCKET_ONMESSAGE (state, message) {\n console.info(state, message)\n }", "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "function sendMessage(message) {\n\tconsole.log(\"sending message \" + JSON.stringify(message));\n\n\tvar pageToken = PAGE_TOKEN;\n\t\n\t//Happens only when testing a user\n\tif(process.env.TEST_USERID_1 === message.recipient.id) {\t\n\t\t\n\t\tpageToken = process.env.TEST_PAGE_TOKEN_1;\n\t}\n\n\t//POST the message for Facebook to Send\n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: {access_token:pageToken},\n method: 'POST',\n json: message\n }, function(error, response, body) {\n\t\t//TODO better error handling, maybe print more pertinent info\n if (error) {\n console.log('Error sending message: ', error);\n } else if (response.body.error) {\n console.log('Error: ', response.body.error);\n }\n\n });\n}", "function sendMessage(message) {\n return new RSVP.Promise(function (resolve, reject) {\n spec._processor.onmessage = function (event) {\n if (event.data.error) {\n return reject(event.data.error);\n } else {\n return resolve(event.data.data);\n }\n };\n return spec._processor.postMessage(message);\n });\n }" ]
[ "0.7677966", "0.75148445", "0.73375595", "0.7331411", "0.7328179", "0.7297612", "0.7280864", "0.7263806", "0.7254172", "0.72407025", "0.7212112", "0.71970236", "0.71746325", "0.71495134", "0.7113005", "0.7102047", "0.70754313", "0.7006708", "0.6990754", "0.6917797", "0.69091576", "0.69020045", "0.6854671", "0.6842421", "0.68368095", "0.68277174", "0.6819768", "0.68018836", "0.67867726", "0.67847717", "0.67847717", "0.6768515", "0.671562", "0.66932195", "0.6650221", "0.6633733", "0.6619834", "0.6617314", "0.66026574", "0.6587273", "0.65780765", "0.65543467", "0.6552449", "0.65218073", "0.64905393", "0.6463214", "0.64632", "0.64626336", "0.64617336", "0.6437335", "0.64344025", "0.6425495", "0.6421296", "0.6419965", "0.64108616", "0.64036244", "0.6401031", "0.6399248", "0.63882893", "0.6382658", "0.63707334", "0.6364963", "0.63643014", "0.6356004", "0.63556963", "0.635229", "0.6339006", "0.6325926", "0.63225585", "0.6320828", "0.63193554", "0.63171875", "0.63171875", "0.63171875", "0.6315592", "0.6315208", "0.63065463", "0.630085", "0.6293554", "0.62915695", "0.62893504", "0.62832916", "0.62745816", "0.62745816", "0.62745816", "0.6273331", "0.6270638", "0.6268309", "0.6256623", "0.6255475", "0.6253143", "0.6251228", "0.624753", "0.6243721", "0.6236136", "0.62335455", "0.6228766", "0.6227418", "0.6227418", "0.6213923", "0.62106997" ]
0.0
-1
Override `emit`. If the event is in `events`, it's emitted normally.
emit(ev, ...args) { if (RESERVED_EVENTS.hasOwnProperty(ev)) { throw new Error('"' + ev + '" is a reserved event name'); } args.unshift(ev); const packet = { type: socket_io_parser_1.PacketType.EVENT, data: args }; packet.options = {}; packet.options.compress = this.flags.compress !== false; // event ack callback if ("function" === typeof args[args.length - 1]) { debug("emitting packet with ack id %d", this.ids); this.acks[this.ids] = args.pop(); packet.id = this.ids++; } const isTransportWritable = this.io.engine && this.io.engine.transport && this.io.engine.transport.writable; const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected); if (discardPacket) { debug("discard packet as the transport is not currently writable"); } else if (this.connected) { this.packet(packet); } else { this.sendBuffer.push(packet); } this.flags = {}; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emit(self, eventName) { self.emit(eventName); }", "emit() {\n if (this.active) {\n super.emit.apply(this, arguments);\n } else {\n this.emits.push(arguments);\n }\n }", "emit(...args) {\n this._event_dispatcher.$emit(...args);\n }", "emitEvent(type, event) {\n this.emit(type, event);\n }", "emit() {\n try {\n this.out.emit.apply(this.out, arguments)\n }\n catch (err) {\n this.out.emit('error', err)\n }\n }", "emitReserved(ev, ...args) {\n super.emit(ev, ...args);\n return this;\n }", "emit(eventName) {\r\n let fired = false;\r\n if (eventName in this.events === false) return fired;\r\n\r\n const list = this.events[eventName].slice();\r\n\r\n for (let i = 0; i < list.length; i++) {\r\n list[i].apply(this, Array.prototype.slice.call(arguments, 1));\r\n fired = true;\r\n }\r\n\r\n return fired;\r\n }", "emit(eventName, ...rest) {\n if (this._events[eventName]) {\n this._events[eventName].forEach((callback) => {\n callback(rest);\n });\n } else {\n console.log(\"The event doesn't exists.\");\n }\n }", "$emit(event, ...args) {\n this.emitter.emit(event, ...args)\n }", "$emit(event, ...args) {\n this.emitter.emit(event, ...args);\n }", "emit(evt) {\n\t\tif (!Duplex.prototype._flush && evt === 'finish') {\n\t\t\tthis._flush((err) => {\n\t\t\t\tif (err) EventEmitter.prototype.emit.call(this, 'error', err);\n\t\t\t\telse EventEmitter.prototype.emit.call(this, 'finish');\n\t\t\t});\n\t\t} else {\n\t\t\tconst args = Array.prototype.slice.call(arguments);\n\t\t\tEventEmitter.prototype.emit.apply(this, args);\n\t\t}\n\t}", "function __emit (stream, event, data, data_events) {\n stream.emit(event, data);\n if (data_events.indexOf(event) >= 0) stream.emit('data', data);\n}", "function emit() {\n channel.emit.apply(self, arguments);\n self.emit.apply(channel, arguments);\n }", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: dist.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "emitEvent(event) {\n this.eventBus.emit(event);\n }", "emit(eventName, ...args) {\n if (!eventName) {\n return;\n }\n else if (!this.dispatch._[eventName]) {\n // Check that dispatch has a registered event\n const msg = `Unknown event ${eventName}. Double check the spelling or register the event. Custom events must registered at chart creation.`;\n throw new MonteError(msg);\n }\n\n this.__notify(eventName, ...args);\n\n return this;\n }", "emit(eventName, data) {\n let stream = this.stream;\n try {\n stream.emit(eventName, data);\n }\n catch (err) {\n if (eventName === \"error\") {\n // Don't recursively emit \"error\" events.\n // If the first one fails, then just throw\n throw err;\n }\n else {\n stream.emit(\"error\", err);\n }\n }\n }", "emit(...args) {\n // emit the event through own emitter\n EventEmitter.prototype.emit.apply(this, args);\n\n debug('Emitting', args);\n\n // emit the event through all the attached emitters\n this.emitters.forEach((emitter) => {\n emitter.emit(...args);\n });\n }", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "function emit(eventName, data) {\n if(events[eventName]) {\n events[eventName].forEach(function(fn) {\n fn(data);\n });\n }\n }", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n const id = this.ids++;\n debug(\"emitting packet with ack id %d\", id);\n const ack = args.pop();\n this._registerAckCallback(id, ack);\n packet.id = id;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "emit(event, payload, block, emitter = this._defaultEmitter()) {\n emitter.emit(event, payload, block);\n }", "emit(ev, ...args) {\r\n if (socket_1.RESERVED_EVENTS.has(ev)) {\r\n throw new Error(`\"${ev}\" is a reserved event name`);\r\n }\r\n // set up packet object\r\n const data = [ev, ...args];\r\n const packet = {\r\n type: socket_io_parser_1.PacketType.EVENT,\r\n data: data,\r\n };\r\n if (\"function\" == typeof data[data.length - 1]) {\r\n throw new Error(\"Callbacks are not supported when broadcasting\");\r\n }\r\n this.adapter.broadcast(packet, {\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n flags: this.flags,\r\n });\r\n return true;\r\n }", "emit() {\n for (var i = 0, len = this._cb.length; i < len; i++)\n this._cb[i].apply(this._cb[i], arguments);\n }", "emit() {\n\t\t\tlet currentListeners = listeners;\n\t\t\tfor (let i=0; i<currentListeners.length; i++) {\n\t\t\t\tcurrentListeners[i].apply(null, arguments);\n\t\t\t}\n\t\t}", "function emit(eventName, data) {\n if (events[eventName]) {\n events[eventName].forEach( (fn) => {\n fn(data);\n });\n }\n }", "emit(event, ...args) {\n if (this._events) {\n if (this._events.hasOwnProperty(event)) {\n const eventList = this._events[event].slice(0);\n for (let i = 0, len = eventList.length; i < len; i++) {\n eventList[i].apply(this, args);\n }\n }\n }\n return this;\n }", "emit(e, ...s) {\n const t = this.events[e];\n if (t) for (let e of t) e(...s);\n }", "emitChange () {\n this.emit(Constants.CHANGE_EVENT);\n }", "emit () {\n const emitTo = this._emitTo.pull()\n const args = _.toArray(arguments)\n if (_.size(emitTo.ids)) {\n emitTo.ids.forEach((id) => {\n const to = this.io.to(id)\n to.emit.apply(to, args)\n })\n return\n }\n\n if (_.size(emitTo.rooms)) {\n emitTo.rooms.forEach((room) => {\n const to = this.io.to(room)\n args.splice(1, 0, room)\n to.emit.apply(to, args)\n })\n return\n }\n\n this.io.emit.apply(this.io, args)\n }", "function emit(eventName, data) {\n if (events[eventName]) {\n events[eventName].forEach( (fn) => {\n fn(data);\n });\n }\n }", "h(eventName) {\n return this.emit.bind(this, eventName);\n }", "emit(eventName, ...args) {\n if (!this.listeners[eventName] || this.listeners[eventName] === []) {\n return false\n }\n this.listeners[eventName].forEach(fn => {\n fn(...args)\n })\n return true\n }", "emit(eventName, payload) {\n this.socket.emit(eventName, payload);\n }", "function emitEvent ( name ) {\n\t\t\tif ( options['on' + name] ) {\n\t\t\t\toptions['on' + name].call(API);\n\t\t\t}\n\t\t}", "async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }", "on(eventName, handler, fireOnBind = false) {\n super.on(eventName, handler);\n if (fireOnBind) {\n this.emit(eventName);\n }\n }", "emit(eventName,param,next) {\n if (!this._events[eventName]) throw new Error(`${eventName} is not registered`);\n this._events[eventName](param);\n if (typeof next == 'function') next();\n }", "emitChange(){\n this.emit(this.CHANGE_EVENT);\n }", "emitChange() {\n this.emit(CHANGE_EVENT);\n }", "emitChange() {\n this.emit(CHANGE_EVENT);\n }", "emitChange() {\n this.emit(CHANGE);\n }", "activate() {\n let event;\n this.active = true;\n\n while (event = this.emits.shift()) {\n super.emit.apply(this, event);\n }\n }", "emit(name, data){\n if(this.eventsMap[name]){\n for(let callback of this.eventsMap[name]){\n callback(data) ;\n };\n }\n}", "publish (...args) {\n this.emit.apply(this, args)\n }", "triggerEvent(e){\n\t\tthis.emit(e.type, e);\n\t}", "function replayEvents(self, events) {\n for(var i = 0; i < events.length; i++) {\n self.emit(events[i].event, events[i].object1, events[i].object2);\n }\n}", "function replayEvents(self, events) {\n for (var i = 0; i < events.length; i++) {\n self.emit(events[i].event, events[i].object1, events[i].object2);\n }\n}", "emit(key, event) {\n //prevent infinite event loops by skipping already-notified keys\n if (!event.notifiedKeys.has(key)) {\n event.notifiedKeys.add(key);\n this.onchangeEmitter.emit(key, event);\n }\n }", "emit(event, payload) {\n this.socket.send(JSON.stringify([event, payload]));\n }", "emitChange() {\n\t\tthis.emit(CHANGE_EVENT)\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}", "emitChanges() {\n this.app.emit(this.changeActionName, this);\n }", "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_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}", "emit(event, data) {\n this.results.logs.events.push({ event, data });\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}", "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 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 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_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_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 EventEmitter(){this._events=new Events();this._eventsCount=0;}", "function EventEmitter(){this._events=new Events();this._eventsCount=0;}", "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 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}", "emit(event, eventData) {\n this.emitter.emit(event, eventData);\n return this.eventListenersCount(event) > 0;\n }", "emit(event, eventData) {\n this.emitter.emit(event, eventData);\n return this.eventListenersCount(event) > 0;\n }", "function emitEvent(fn) {\n if (typeof fn != 'function') return\n\n var args = [].slice.call(arguments, 1)\n return fn.apply(null, args)\n}", "_emitChangeEvent() {\n this._onChange(this.checked);\n this.change.emit(new MatSlideToggleChange(this, this.checked));\n }", "emit(type, detail, options) {\n if (this._isConnected) {\n return this.element.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign({\n detail\n }, defaultEventOptions), options)));\n }\n\n return false;\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}", "emitMessage (event) {\n this.emit('on-message', event)\n }", "_emit(type, payload) {\n // Get the current counter value:\n const order = this[_eventCounter];\n const event = new EventSourcedAggregateRoot.Event({\n ID: uuid.v4(),\n type: type,\n timestamp: new Date(),\n payload: payload,\n order: order\n });\n // Run internal handlers to advance state:\n this.applyEvent(event);\n // Call external event listeners, too:\n this[_listeners].forEach(function callRegisteredEventListener(listener) {\n listener(event);\n });\n }", "emit(...args) {\n const [name, ...params] = args;\n\n if (this.logBlacklist && this.logBlacklist.indexOf(name) === -1) {\n console.info(name, params);\n }\n\n super.emit(...args);\n }", "emitChange() {\n this.changeEmitters.forEach(func => func.call(null));\n }", "emit(event, data = null) {\n let message = (data === null) ? JSON.stringify({event}) : JSON.stringify({event, data});\n this.ws.send(message);\n }", "function Emitter() {\n this.handlersByEventName = {};\n }", "function emitAsync(args){\n\t\tsetTimeout(function(){\n\t\t\temit.apply(evented, args);\n\t\t}, 0);\n\t}", "_emitChangeEvent() {\n // Clear the selected values so they can be re-cached.\n this._selected = null;\n\n if (this._selectedToEmit.length || this._deselectedToEmit.length) {\n this.changed.next({\n source: this,\n added: this._selectedToEmit,\n removed: this._deselectedToEmit\n });\n this._deselectedToEmit = [];\n this._selectedToEmit = [];\n }\n }", "emitChange() {\n this.emit(\"change\");\n }", "send(eventName, ...args) {\n this.socket.emit(eventName, ...args);\n }", "emit(eventName, param) {\n var walk = (toks, tree, match) => {\n if (tree == null) {\n return;\n }\n let t = toks[0];\n if (toks.length === 1) {\n let h;\n if (t in tree) {\n for (h of Array.from(tree[t].__ehs)) {\n h(eventName, param, match.slice(0, -1));\n }\n }\n if ('*' in tree) {\n for (h of tree['*'].__ehs) {\n h(eventName, param, match + t);\n }\n }\n }\n else {\n if (t in tree) {\n walk(toks.slice(1), tree[t], match);\n }\n if ('*' in tree) {\n walk(toks.slice(1), tree['*'], match + t + \".\");\n }\n }\n };\n walk(eventName.split(\".\"), this.evTree, '');\n }", "_emitChangeEvent() {\n // Clear the selected values so they can be re-cached.\n this._selected = null;\n if (this._selectedToEmit.length || this._deselectedToEmit.length) {\n this.changed.next({\n source: this,\n added: this._selectedToEmit,\n removed: this._deselectedToEmit\n });\n this._deselectedToEmit = [];\n this._selectedToEmit = [];\n }\n }", "_emitChangeEvent() {\n // Clear the selected values so they can be re-cached.\n this._selected = null;\n if (this._selectedToEmit.length || this._deselectedToEmit.length) {\n this.changed.next({\n source: this,\n added: this._selectedToEmit,\n removed: this._deselectedToEmit\n });\n this._deselectedToEmit = [];\n this._selectedToEmit = [];\n }\n }", "function emitEnd() {\n eventEmitter.emit('end');\n}", "function selfEmit(type) {\n //registrationFailed handler is invoked with two arguments. Allow event handlers to be invoked with a variable no. of arguments\n return self.emit.bind(self, type);\n }", "function _emit(type, args) {\n if ( listeners[type] ) {\n listeners[type].forEach(function(listener) {\n listener.apply(null, args || []);\n });\n }\n }", "function selfEmit(type){//registrationFailed handler is invoked with two arguments. Allow event handlers to be invoked with a variable no. of arguments\nreturn self.emit.bind(self,type);}// Set Accepted Body Types", "function logAndEmit(e) {\n console.log(e.toString());\n this.emit('end');\n}", "emit(event, ...args) {\n this.list.has(event) &&\n this.list.get(event).forEach(callback =>\n setTimeout(() => {\n callback(...args);\n }, 0)\n );\n }", "function selfEmit(type) {\n //registrationFailed handler is invoked with two arguments. Allow event handlers to be invoked with a variable no. of arguments\n return self.emit.bind(self, type);\n }", "emit(...args){\n let emitter = privateMembers.get(this).emitter;\n emitter.emit(...args);\n }", "emit(...args){\n let emitter = privateMembers.get(this).emitter;\n emitter.emit(...args);\n }", "function emit(name, data) {\n var list = events[name];\n if(!Array.isArray(data)) {\n data = [data];\n }\n\n if(list) {\n // Copy callback lists to prevent modification\n list = list.slice();\n\n // Execute event callbacks, use index because it's the faster.\n for(var i = 0, len = list.length; i < len; i++) {\n list[i].apply(exports, data);\n }\n }\n\n return events;\n}", "emit(type, data) {\n\n if(!data) {\n data = {};\n }\n\n // Prevent cycles by refusing to emit more events until this one is over\n if(this.locked) {\n return;\n }\n\n this.locked = true;\n\n if(this.subs[type]) {\n for(var cb of this.subs[type]) {\n cb(data, this);\n }\n }\n\n if(this.subs['*']) {\n for(var cb of this.subs['*']) {\n cb(data, this);\n }\n }\n\n this.locked = false;\n }", "function EventEmitter(){}// Shortcuts to improve speed and size", "emit() {\n this.emitCurrent();\n this.emitData();\n EventBus.$emit('file_selected', { file: this.file });\n }", "function MyEmitter() {\n events.EventEmitter.apply(this);\n\n this.emitSomething = function() {\n emitter.emit('some_event', 'any data', 'that goes along with it');\n };\n}", "function emit(event, payload){\n // Set the event name on the payload to be sent to client\n payload['event'] = event;\n\n // Emit the payload\n io.emit(\"message\", payload);\n}" ]
[ "0.71419877", "0.6873362", "0.6856954", "0.6856177", "0.68205065", "0.6762024", "0.6637402", "0.6626966", "0.66229755", "0.6615304", "0.6503729", "0.6473271", "0.6472541", "0.64717585", "0.6436068", "0.6431107", "0.63417286", "0.633171", "0.62871623", "0.6185921", "0.618311", "0.6182567", "0.6178793", "0.61746347", "0.61571556", "0.612331", "0.61113286", "0.61043906", "0.608413", "0.6068755", "0.6061418", "0.6049997", "0.6033562", "0.6031583", "0.60315174", "0.5998932", "0.5976358", "0.5935802", "0.5926615", "0.5914819", "0.5914819", "0.5884781", "0.5822881", "0.5821436", "0.5815378", "0.58152884", "0.5810466", "0.5810455", "0.57886237", "0.5787452", "0.57776946", "0.5735122", "0.57236165", "0.57232153", "0.5718636", "0.57174873", "0.57173806", "0.5716443", "0.57160246", "0.57138866", "0.57115865", "0.5702144", "0.5699432", "0.5699432", "0.5698783", "0.5690728", "0.56888354", "0.56888354", "0.5680836", "0.56702393", "0.5648997", "0.56418383", "0.5619153", "0.56033146", "0.56012285", "0.55975944", "0.5596313", "0.5596167", "0.5593033", "0.5583289", "0.55795485", "0.5571954", "0.5566981", "0.55528873", "0.55528873", "0.55368596", "0.55255175", "0.5503295", "0.5498312", "0.5480197", "0.5474976", "0.54690117", "0.5464184", "0.5464184", "0.54626757", "0.54490626", "0.5448395", "0.5434728", "0.54341286", "0.54340494" ]
0.63463193
16
Called upon engine `open`.
onopen() { debug("transport is open - connecting"); if (typeof this.auth == "function") { this.auth(data => { this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data }); }); } else { this.packet({ type: socket_io_parser_1.PacketType.CONNECT, data: this.auth }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onOpen() {\n\t\t}", "onOpen() { }", "open () {\n super.open();\n }", "open() {\n this._open();\n }", "function onOpen(e)\n{\n init();\n}", "_onOpen(doc) {\r\n if (doc.languageId !== 'python') {\r\n return;\r\n }\r\n let params = { processId: process.pid, uri: doc.uri, requestEventType: request_1.RequestEventType.OPEN };\r\n let cb = (result) => {\r\n if (!result.succesful) {\r\n console.error(\"Lintings failed on open\");\r\n console.error(`File: ${params.uri.toString()}`);\r\n console.error(`Message: ${result.message}`);\r\n }\r\n };\r\n this._doRequest(params, cb);\r\n }", "open (text) {\n return super.open(text)\n }", "open (text) {\n return super.open(text)\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this.readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"data\", component_bind_1.default(this, \"ondata\")));\n this.subs.push(on_1.on(socket, \"ping\", component_bind_1.default(this, \"onping\")));\n this.subs.push(on_1.on(socket, \"error\", component_bind_1.default(this, \"onerror\")));\n this.subs.push(on_1.on(socket, \"close\", component_bind_1.default(this, \"onclose\")));\n this.subs.push(on_1.on(this.decoder, \"decoded\", component_bind_1.default(this, \"ondecoded\")));\n }", "onOpenedFile() {\n throw \"[CacheObjectBaseInject::onOpnenedFile] Function Abstract, extended class have implement this method\";\n }", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "open() {\n\t\treturn true;\n\t}", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n super.emit(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "open () {\n return super.open();\n }", "open () {\n return super.open();\n }", "function _onOpen() {\n\tdraw();\n}", "function _onOpen() {\n\tdraw();\n}", "onopen() {\n debug(\"open\");\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on_js_1.on(socket, \"ping\", this.onping.bind(this)), on_js_1.on(socket, \"data\", this.ondata.bind(this)), on_js_1.on(socket, \"error\", this.onerror.bind(this)), on_js_1.on(socket, \"close\", this.onclose.bind(this)), on_js_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "onopen() {\n debug(\"open\"); // clear old subs\n\n this.cleanup(); // mark as open\n\n this._readyState = \"open\";\n this.emitReserved(\"open\"); // add new subs\n\n const socket = this.engine;\n this.subs.push(on_1.on(socket, \"ping\", this.onping.bind(this)), on_1.on(socket, \"data\", this.ondata.bind(this)), on_1.on(socket, \"error\", this.onerror.bind(this)), on_1.on(socket, \"close\", this.onclose.bind(this)), on_1.on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }", "function OpenEvent() {}", "open(){\n super.open('path');\n }", "open(){\n super.open('path');\n }", "function onopen() {\n this._logger.info('Connection created.');\n\n this._debuggerObj.setEngineMode(this._debuggerObj.ENGINE_MODE.RUN);\n\n if (this._surface.getPanelProperty('chart.active')) {\n this._surface.toggleButton(true, 'chart-record-button');\n }\n\n if (this._surface.getPanelProperty('run.active')) {\n this._surface.updateRunPanel(this._surface.RUN_UPDATE_TYPE.ALL, this._debuggerObj, this._session);\n }\n\n if (this._surface.getPanelProperty('watch.active')) {\n this._surface.updateWatchPanelButtons(this._debuggerObj);\n }\n\n this._surface.disableActionButtons(false);\n this._surface.toggleButton(false, 'connect-to-button');\n}", "function handleOpen() {\n setOpen(true);\n }", "function handleOpen() {\n setOpen(true)\n }", "function openDoc() {\n\tcsInterface.evalScript(\"openDocument()\");\n}", "doOpen() {\n this.poll();\n }", "onOpen () {\n this.callback()\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "open() {\n const that = this;\n\n if (that.opened) {\n return;\n }\n\n that._open();\n }", "function onOpen( e ) {\n\t\t\t_reconnectCounter = 0;\n\t\t\t_scope.dispatchEvent( WS.ON_OPEN );\n\t\t}", "function reqListener() {\n console.log('File loaded: ' + sourceLocation);\n cm.setValue(this.responseText);\n engineStartup();\n }", "function Engine() {\n }", "function onOpen(){\n console.log('Open connections!');\n}", "beforeClose() {\n\t\t}", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "doOpen() {\n this.poll();\n }", "function onOpen() {\n file.pipe(res);\n\n onFinished(res, onResFinished);\n }", "function onOpenClose() {\n\t if (typeof this.fd === 'number') {\n\t // actually close down the fd\n\t this.close()\n\t }\n\t}", "function doOpenDocument() {\n var presenter = new mindmaps.OpenDocumentPresenter(eventBus,\n mindmapModel, new mindmaps.OpenDocumentView(), filePicker);\n presenter.go();\n }", "open () {\n return super.open('');\n }", "open() {\n return super.open('');\n }", "function OnChannelOpen()\n{\n}", "open (data, user) {\n this.process(data, user);\n }", "Close() {\n\n }", "function onOpen(){\n console.log( \"Connected through Spacebrew as: \" + sb.name() + \".\" );\n}", "handleSourceOpen_() {\n // Only attempt to create the source buffer if none already exist.\n // handleSourceOpen is also called when we are \"re-opening\" a source buffer\n // after `endOfStream` has been called (in response to a seek for instance)\n this.setupSourceBuffer_();\n\n // if autoplay is enabled, begin playback. This is duplicative of\n // code in video.js but is required because play() must be invoked\n // *after* the media source has opened.\n if (this.tech_.autoplay()) {\n this.tech_.play();\n }\n\n this.trigger('sourceopen');\n }", "open () {\n return super.open('car-safety');\n }", "constructor(engine) {\n this.engine = engine;\n }", "listener() {\n\t\trequire('electron').ipcRenderer.send('log:open', this.name);\n\t}", "function pfOpen(){\n\tif (siteManager.sManager.checkMode() === 'S'){\n\t\tspawnPF('S', 0);\n\t}\n\telse {\n\t\tspawnPF('K', 0);\n\t}\n\tcloseThreepack();\n}", "open () {\n return super.open('parkcalc');\n }", "open() {\n this.opened = true;\n }", "open() {\n return accessFromDataset(undefined, this);\n }", "connect() {\n let _this = this;\n\n _this._continuousOpen = true;\n _this._open(() => {});\n }", "function onOpenClose(){if(typeof this.fd==='number'){// actually close down the fd\nthis.close();}}", "function peerjsOpenHandler(){\n if (_this.debug)\n console.log(\"Server started\", _this._serverPeer.id);\n\n // Reset peers\n _this._connections = {};\n \n // Trigger\n _this._triggerSystemEvent(\"$open\", {serverId: _this._serverPeer.id});\n }", "openTopLevel() {\n throw new NotImplementedError(this);\n }", "_open() {\n if (!this._afterOpened.closed) {\n this._afterOpened.next();\n this._afterOpened.complete();\n }\n }", "onOpen() {\n debug(\"socket open\");\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n debug(\"starting upgrade probes\");\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "onClose() {}", "onClose() {}", "function onOpen() {\n\t\tconsole.log('Client socket: Connected');\n\t\tcastEvent('onOpen', event);\n\t}", "openCassetteFile() {\n // TODO open/rewind cassette?\n // Reset the clock.\n this.cassetteMotorOnClock = this.tStateCount;\n this.cassetteSamplesRead = 0;\n }", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close();\n }\n}", "enterFile(ctx) {\n\t}", "_close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose() {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "onClose() {\n\t\t}", "open () {\n this.opened = true;\n }", "clicked() {\n this.get('onOpen')();\n }", "open () {\n return super.open('/index.php?controller=order');\n }", "onOpen() {\n this.readyState = \"open\";\n Socket$1.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState &&\n this.opts.upgrade &&\n this.transport.pause) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }", "static open(callback) {\r\n FileWriterRemote.fileWriter.open(callback);\r\n }", "_onversionchange() {\n this.close();\n }", "open(file) {\n this.file = file;\n this.input = this.file.input;\n this.state = new State();\n this.state.init(this.options, this.file);\n }", "openFile() {\n controller.openMarkdown();\n }", "onOpenedWindow() {\n throw new NotImplementedException();\n }", "onLoad() { }", "function onOpenClose () {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "function onOpenClose () {\n if (typeof this.fd === 'number') {\n // actually close down the fd\n this.close()\n }\n}", "onLoad() {}", "start () {}", "constructor(handleCreate) {\n this.query = this.query.bind(this);\n this.handleSuccess = this.handleSuccess.bind(this);\n this.pengine = new window.Pengine({\n server: \"http://localhost:3030/pengine\",\n application: \"proylcc\",\n oncreate: handleCreate,\n onsuccess: this.handleSuccess,\n onfailure: this.handleFailure,\n onerror: this.handleError,\n destroy: false\n });\n }" ]
[ "0.7267958", "0.68602115", "0.6464908", "0.62442505", "0.6236251", "0.6223333", "0.62199444", "0.62199444", "0.6161312", "0.61048317", "0.6081943", "0.60552484", "0.60498405", "0.6049197", "0.600314", "0.600314", "0.5987324", "0.5987324", "0.5966099", "0.594745", "0.59190387", "0.58890164", "0.58890164", "0.5819986", "0.5784441", "0.57122797", "0.5653827", "0.5589618", "0.5583061", "0.5572672", "0.5572672", "0.55640805", "0.5552593", "0.55416507", "0.554105", "0.5539504", "0.54579043", "0.54435116", "0.54435116", "0.54435116", "0.541645", "0.5413606", "0.5411138", "0.5408438", "0.5400562", "0.53938186", "0.5386044", "0.53636914", "0.533489", "0.5326911", "0.5321416", "0.53214115", "0.5303635", "0.52865815", "0.5280686", "0.52725387", "0.5270165", "0.52692133", "0.52580106", "0.5245686", "0.52447283", "0.5243825", "0.5230186", "0.5225959", "0.5225959", "0.5209459", "0.5200295", "0.51936316", "0.5193383", "0.5188658", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5184324", "0.5181027", "0.517989", "0.51770073", "0.51708406", "0.51556826", "0.5153173", "0.51499176", "0.51492965", "0.5145525", "0.51441187", "0.51383734", "0.51367", "0.51367", "0.5129151", "0.5127326", "0.51224506" ]
0.0
-1
Called upon engine or manager `error`.
onerror(err) { if (!this.connected) { this.emitReserved("connect_error", err); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "error(error) {\n this.__processEvent('error', error);\n }", "error(error) {}", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "function error(args, err, cb) {\n if (err) {\n seneca.log.debug('error: ' + err);\n seneca.fail({code:'entity/error',store:name}, cb);\n }\n return err;\n }", "onChildError(error) {\n this.emit('error', error);\n }", "error(err){\n log.silly('Session.error', `Session ${this.name}:`, err.message);\n this.events.push({ event: 'ERROR',\n timestamp: new Date().toISOString(),\n message: err.message,\n content: err && err.content ? err.content : ''});\n\n this.status = 'FINALIZING';\n if(this.priv && this.priv.error){\n this.priv.error(this.priv, err);\n }\n this.emit('error', err);\n this.destroy();\n }", "function setError(err) {\n _error = err;\n component.forceUpdate();\n }", "function onError(error) {\n self.error('Error : ' + error.status + ' ' + error.statusText);\n }", "function OnErr() {\r\n}", "function setError(error) {\n _error = \"(\" + _counter + \") \" + ioHelper.normalizeError(error);\n _counter++;\n _msg = \"\";\n component.forceUpdate();\n }", "function error (err) {\n if(error.err) return;\n callback(error.err = err);\n }", "function onError(error) { handleError.call(this, 'error', error);}", "function error() {\n _error.apply(null, utils.toArray(arguments));\n }", "function error(err) {\n\t\t// TODO output error message to HTML\n\t\tconsole.warn(`ERROR(${err.code}): ${err.message}`);\n\t\t// let msg = \"If you don't want us to use your location, you can still make a custom search\";\n\t\t// displayErrorMsg(msg);\n\t}", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "reportError(error) {\n event.emit(\"error-event\", error)\n }", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function error(message) {\r\n command_1.issue('error', message);\r\n}", "function error(message) {\r\n command_1.issue('error', message);\r\n}", "function node_error(err) {\r\n node.error(err, err);\r\n }", "function forwardError (err) {\n\t clientRequest.emit('error', err);\n\t }", "function esconderError() {\n setError(null);\n }", "function handleError() {\n // TODO handle errors\n // var message = 'Something went wrong...';\n }", "onerror(err) {\n this.emitReserved(\"error\", err);\n }", "function handleError(error) {\n if (error && error.name === 'SheetrockError') {\n if (request && request.update) {\n request.update({ failed: true });\n }\n }\n\n if (userOptions.callback) {\n userOptions.callback(error, options, response);\n return;\n }\n\n if (error) {\n throw error;\n }\n }", "function onError(error) {\n throw error;\n}", "function error(message) {\n command_1.issue('error', message);\n}", "function error(message) {\n command_1.issue('error', message);\n}", "function error(message) {\n command_1.issue('error', message);\n}", "function error(message) {\n command_1.issue('error', message);\n}", "function error(message) {\n command_1.issue('error', message);\n}", "function updateErrHandler(error, result) {\n\tif (error) {\n\t\tlog(\"cannot update data\")\n\t\tthrow error\n\t} else {\n\t\tlog(\"Update Success\") \n\t}\n}", "_handleError (name, msg) {\n this.view.renderError(name, msg);\n }", "function errorFunction(position) {\n console.log('Error!');\n }", "function handlerErroe(error){\r\n console.error(error.toString())\r\n this.emit('end');\r\n}", "function error(error) {\n console.log(\"Error : \" + error);\n}", "function onErrorHandler (error) {\n console.log(error);\n this.emit('end');\n}", "error() {}", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function error(err) {\n if (error.err) return;\n callback((error.err = err));\n }", "function wikiError(){\r\n self.errorMessage(\"Error in accessing wikipedia\");\r\n self.apiError(true);\r\n}", "function ErrorHandler() {}", "gotError (error) {\n\t\tthis.handlers.onError(error) // tell the handler, we got an error\n\t}", "function error() {\n\tTi.App.fireEvent('closeLoading');\n\tTi.API.info(\"error\");\n}", "function errback(err) {\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "function onError(error) {\n handleError.call(this, 'error', error);\n }", "errorHandler(err) {\n if (!err.name === 'QueryResultError') {\n this.logError(err);\n }\n return Left(err);\n }", "_onSerialError(err) {\n // not really sure how to handle this in a more elegant way\n\n this.emit('error', err);\n }", "function error(err) {\n const errorembed = new Discord.MessageEmbed()\n .setColor(color)\n .setTitle('New Error Caught!')\n .setTimestamp()\n .setDescription(`\\`\\`\\`xl\\n${err.stack}\\`\\`\\``);\n client.channels.get('385485532458778626').send({\n embed: errorembed\n });\n }", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "function callError(info){\n APP.displayError(info);\n }", "function createShelterError(error) {\n vm.error = \"Could not find pet info at this time. Please try again later.\";\n }", "function _errorHandler(request, errorText) {\n console.error((errorText || 'asyncStorage error') + ': ',\n request.error.name);\n }", "function handleError(errors, error) {\n utilService.handleDialogError(errors, error);\n }", "function onError(error) {\n console.log(error);\n }", "function mapError(){\r\n self.errorMessage(\"Error in accessing google maps\");\r\n self.apiError(true);\r\n}", "function CustomError() {}", "function errorCB(err) {\n //alert(\"Error processing SQL: \"+err.code);\n \n }", "handleError(error) {\n throw error.response.data;\n }", "function updateShelterError(error) {\n vm.error = \"Could not update shelter at this time. Please try again later.\";\n scrollToError();\n }", "onActivationError() {\n this.removeListeners();\n this.state = State.ERROR;\n this.dispatchEvent(new GoogEvent(EventType.EXECUTED));\n }", "function findPetByPetfinderIdError(error) {\n vm.error = \"Could not find pet info at this time. Please try again later.\";\n }", "function onErrorItem(error) { // ensure correct\r\n alert(`Catch Error: ${error}`);\r\n console.error(error);\r\n}", "function onError(e, componentStack) {\n }", "function error(error) {\n\t\talert(\"Error: getCurrentPosition: \" + error)\n\t}", "function handleError(command, index, error) {\n // Record the reason for the command failure.\n if (command.func.name === 'throwError') {\n historyItem[index].status = 'Unrecognized';\n }\n else if (failHard) {\n historyItem[index].status = 'Skipped';\n }\n else {\n historyItem[index].status = 'Failed: ' + error.message;\n }\n\n // If the command was unrecognized or failed outright, log it.\n if (!failHard) {\n error.message = error.message.split('\\n').map(function(string) {\n return string = '\\t' + string;\n }).join('\\n');\n\n console.error(\"Editor command '\" + command.name\n + \"' failed with error:\\n\" + error.message);\n }\n\n // Skip remaining commands.\n failHard = true;\n }", "function findPetfinderShelterByIdError(error) {\n vm.error = \"Could not get shelter info at this time. Please try again later.\"\n }", "function transportError(err) {\n this.emit('error', err, this.transport);\n }", "handleRelatedProductsError(error) {}", "function errorCallback() {\n\t const activeTransaction = getActiveTransaction();\n\t if (activeTransaction) {\n\t const status = 'internal_error';\n\t (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n\t activeTransaction.setStatus(status);\n\t }\n\t}", "function error(n, m) {\n CB.status(false, n, m);\n console.error('SimpleCTI.error() - We got an error number: ' + n + ' Text: ' + m);\n }", "function findShelterByIdError(error) {\n vm.error = \"Could not get shelter info at this time. Please try again later.\";\n }", "showError(error) {\n console.dir(error)\n store.error = error\n }", "function ManageErrors(commandcalledName, data) {\n selecteditem.error = Translate(\"Error\" + commandcalledName + data.error.errorCode);\n\n if (selecteditem.error.length === 0) {\n selecteditem.error = data.error.errorMessage; //to translate --> The Cannot prepare an ES ticket becouse scenario step id 2 is not valid.\n }\n }", "function error() {\r\n\t\t\t\talert(\"error\");\r\n\t\t\t}", "function onPeerAgentFindError(errorCode) {\r\n\t\tconsole.log(\"Error code : \" + errorCode);\r\n\t}", "function newMovieError() {\n\tconsole.log('Unable to add new movie...');\n}", "function onError(error) {\n console.log(error);\n }", "function onError(error) {\n console.log(error);\n }", "function onError(error) {\n console.log(error);\n }", "onParserError (err) {\n this.emit('error', err)\n }", "function setError(error) {\n\t\t\tself.error = error;\n\t\t}", "function sc_error() {\n var e = new Error(\"sc_error\");\n\n if (arguments.length >= 1) {\n e.name = arguments[0];\n if (arguments.length >= 2) {\n\t e.message = arguments[1];\n\t if (arguments.length >= 3) {\n\t e.scObject = arguments[2];\n\t }\n }\n }\n\n throw __sc_errorHook ? __sc_errorHook( e, arguments ) : e;\n}", "function onError(e) {\n console.log(\"ASSETMANAGER ERROR > Error Loading asset\");\n }", "function handleError(error) {\n if (error) {\n console.log(error.message);\n }\n }", "static get ERROR () { return 0 }", "function handle_error(error) {\r\n\r\n //reset the player.\r\n reset_player();\r\n\r\n //Log the error to the console.\r\n console.error(error);\r\n\r\n //If we are not already in an error state, then change state.\r\n if (!error_state) {\r\n\r\n //Set the player to an error state (prevents updates)\r\n error_state = true;\r\n\r\n //Define and show an error message.\r\n var message = \"Oops - Something went wrong (code: \" + error + \").\";\r\n $(\"#error_banner p\").text(message);\r\n $(\"#error_banner\").animate({ bottom: \"-=40px\" }, 1000);\r\n\r\n }\r\n\r\n }", "function handleError(err) {\n\tif (err) throw err;\n}", "onError() {}", "function errorCallback() {\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n const status = 'internal_error';\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n activeTransaction.setStatus(status);\n }\n }", "function errorCB(err) {\r\n console.log(\"Error occured while executing SQL: \"+err.code);\r\n }", "function syncError(error) {\n showStatus('Bad', 'Sync error! Check network connection.');\n console.log('Error: '+error);\n }", "function error(msg){\n throw _b_.TypeError.$factory(msg)\n }", "function handleError(error){\n\t\tconsole.error(\"[ERROR] \", error);\n\t}", "function commonErrorHandler (err) {\n console.log(err); \n resetToLibraryIndexPage();\n }", "function onPlayerError(errorCode) {\n // TODO, advance to next album\n alert(\"An error occured of type:\" + errorCode);\n}", "_emitError (err) {\n if (!this.listenerCount('error')) throw err\n else this.emit('error', err)\n }", "_error(message, token) {\n const err = new Error(`${message} on line ${token.line}.`);\n err.context = {\n token: token,\n line: token.line,\n previousToken: this._lexer.previousToken\n };\n this._callback(err);\n this._callback = noop;\n }" ]
[ "0.7346488", "0.6861143", "0.6852798", "0.6785682", "0.6785682", "0.67207766", "0.67157733", "0.66260445", "0.66077554", "0.6580212", "0.6576525", "0.65751517", "0.65744984", "0.6573179", "0.6557817", "0.65537924", "0.65387547", "0.65302175", "0.64988047", "0.6496039", "0.6496039", "0.6493302", "0.6461551", "0.64593524", "0.6455984", "0.6454484", "0.64539915", "0.6451652", "0.64391583", "0.64391583", "0.64391583", "0.64391583", "0.64391583", "0.6435852", "0.6415187", "0.64046335", "0.63671213", "0.636467", "0.63505423", "0.63428295", "0.6337146", "0.6337146", "0.6337146", "0.6311831", "0.63056386", "0.62952095", "0.6294516", "0.6294322", "0.6284816", "0.6277892", "0.62740296", "0.62723976", "0.6271793", "0.6268235", "0.6264098", "0.6256587", "0.62502503", "0.6249718", "0.624765", "0.62463003", "0.6227966", "0.6216802", "0.6213796", "0.6212737", "0.62065744", "0.62054896", "0.6204638", "0.6203123", "0.6198361", "0.6189793", "0.61883324", "0.618107", "0.61797494", "0.6178564", "0.6177244", "0.61727947", "0.6160524", "0.6157962", "0.6155226", "0.61541116", "0.6148939", "0.6148939", "0.6148939", "0.6147093", "0.6146354", "0.61397666", "0.61253434", "0.61237824", "0.61234534", "0.6118518", "0.61169976", "0.6112615", "0.61105406", "0.6109857", "0.61025447", "0.60956323", "0.6093365", "0.6087951", "0.6084624", "0.60790086", "0.60768986" ]
0.0
-1
Called upon engine `close`.
onclose(reason) { debug("close (%s)", reason); this.connected = false; this.disconnected = true; delete this.id; this.emitReserved("disconnect", reason); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }", "onClose() {\n\t\t}", "close() {\n this.__internal.close()\n }", "close() {\n this.__internal.close()\n }", "Close() {\n\n }", "beforeClose() {\n\t\t}", "end() {\n this.session.close();\n }", "onClose() {}", "onClose() {}", "function Close() {\n } // Close", "onClose(){}", "onClose() {\n this.reset();\n if (this.closed_by_user === false) {\n this.host.reportDisconnection();\n this.run();\n } else {\n this.emit('close');\n }\n }", "_close() {\n // mark ourselves inactive without doing any work.\n this._active = false;\n }", "onClosed() {\r\n // Stub\r\n }", "close() {\r\n this.native.close();\r\n }", "function close() {\n\t\tif ( error ) {\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tself.emit( 'close' );\n\t}", "close() {\n const method = 'close';\n LOG.entry(method);\n this.db.close();\n LOG.exit(method);\n }", "function dispose() {}", "function dispose() {\n }", "function close() {\n var self = this;\n\n self._close.apply(self, arguments);\n}", "close() {\n /* Disconnect Trueno session */\n process.exit();\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine) this.engine.close();\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "function close(){\n con.end() \n}", "end() {\n }", "end() {\n }", "dispose() {}", "dispose() {}", "dispose() {}", "dispose() {}", "dispose() {}", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this.reconnecting = false;\n if (\"opening\" === this.readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this.readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "_onClosed() {\n this.emit(\"closed\");\n }", "function ForceClose() {\r\n}", "onDispose() {}", "onDestroy() {}", "function doClose() {\n db.close();\n finished();\n }", "function doClose() {\n db.close();\n finished();\n }", "function destroy() {\n\t\tif ( error ) {\n\t\t\tself.emit( 'error', error );\n\t\t}\n\t\tself.emit( 'close' );\n\t}", "dispose() { }", "end() { }", "_onClosing() {\n this._watcher.stop();\n this.emit(\"closing\");\n }", "destroy() {\n this._end();\n }", "function doneClosing()\n\t{\n\t\tthat.terminate();\n\t}", "unload() {}", "close() {\n if (phantom_instance != null) {\n phantom_instance.exit();\n phantom_instance = null;\n }\n }", "function close() {\n\n ipcRenderer.send('close', 'close')\n\n }", "endSession() {\r\n this.endScript();\r\n this.cycler.endSession();\r\n }", "destroy() { }", "destroy() { }", "destroy() { }", "finalize() {\n }", "finalize() {\n }", "finalize() {\n }", "finalize() {\n }", "_onClose() {\n this._socket = null;\n this._osk = null;\n this._connectedAt = 0;\n }", "_onClose(code) {\n this.log.warn(\"pocketsphinx process closed with code=\" + code);\n // Restart everything after a short delay\n //setTimeout(this.restart.bind(this), RESTART_DELAY);\n }", "close() {\n\t\treturn true;\n\t}", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "function onclose () {\n\t onerror('socket closed');\n\t }", "destroy () {}", "function onClose() {\n\tmain( opts, done );\n}", "function destroy () {\n\t\t// TODO\n\t}", "function CloseEvent() {}", "onShutdown () {\n unload()\n }", "end() {\n this.medals();\n this.endMessage();\n this.cleanUp();\n this.gc();\n }", "close() {\n this.sendAction('close');\n }", "close() {\n API.LMSGetValue(\"cmi.core._children\")\n API.LMSFinish(\"\");\n _init = false;\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function Cerrar()\n{\n self.close()\n}", "_onversionchange() {\n this.close();\n }", "function onclose() {\n onerror('socket closed');\n }", "function onclose() {\n onerror('socket closed');\n }", "close() {\n this.rl.close();\n }", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "destroy() {}", "_destroy() {}", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "function onclose () {\n onerror('socket closed');\n }", "close() {\n close(internalSlots.get(this));\n }", "function Close_Builtin() {\r\n}", "async end() {\n return;\n }", "function onClose() {\n\tprocess.exit( 0 );\n}", "function onClose() {\n\tprocess.exit( 0 );\n}", "onTerminate() {}", "function onclose(){\n\t onerror(\"socket closed\");\n\t }" ]
[ "0.7500916", "0.7228282", "0.7206464", "0.71972764", "0.71972764", "0.7087051", "0.67953855", "0.672078", "0.6709728", "0.6709728", "0.6626636", "0.66029567", "0.6586244", "0.656277", "0.6556234", "0.6552788", "0.6535173", "0.65098417", "0.650257", "0.6472451", "0.6454491", "0.64479715", "0.6416584", "0.6412235", "0.63984257", "0.63886565", "0.63886565", "0.6387256", "0.6387256", "0.6387256", "0.6387256", "0.6387256", "0.63803947", "0.637161", "0.63548905", "0.63419235", "0.63331735", "0.6321878", "0.63182294", "0.63182294", "0.6299878", "0.6272221", "0.6262429", "0.6252346", "0.62487066", "0.62391007", "0.62337744", "0.6233277", "0.62134457", "0.61825573", "0.6181203", "0.6181203", "0.6181203", "0.6171771", "0.6171771", "0.6171771", "0.6171771", "0.6171197", "0.6166384", "0.6164211", "0.61593306", "0.61593306", "0.61593306", "0.61593306", "0.61593306", "0.6116787", "0.6113102", "0.6103967", "0.609879", "0.6098032", "0.6092917", "0.60875386", "0.6080808", "0.60768425", "0.6065497", "0.60621226", "0.605727", "0.605727", "0.60522014", "0.60515577", "0.60515577", "0.60515577", "0.60515577", "0.60515577", "0.60515577", "0.60515577", "0.60515577", "0.60515577", "0.60515577", "0.60515577", "0.60490584", "0.6048842", "0.6048842", "0.60364", "0.6034107", "0.6031814", "0.60207325", "0.60142493", "0.60142493", "0.600468", "0.60028684" ]
0.0
-1
Called with socket packet.
onpacket(packet) { const sameNamespace = packet.nsp === this.nsp; if (!sameNamespace) return; switch (packet.type) { case socket_io_parser_1.PacketType.CONNECT: if (packet.data && packet.data.sid) { const id = packet.data.sid; this.onconnect(id); } else { this.emitReserved("connect_error", new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)")); } break; case socket_io_parser_1.PacketType.EVENT: this.onevent(packet); break; case socket_io_parser_1.PacketType.BINARY_EVENT: this.onevent(packet); break; case socket_io_parser_1.PacketType.ACK: this.onack(packet); break; case socket_io_parser_1.PacketType.BINARY_ACK: this.onack(packet); break; case socket_io_parser_1.PacketType.DISCONNECT: this.ondisconnect(); break; case socket_io_parser_1.PacketType.CONNECT_ERROR: const err = new Error(packet.data.message); // @ts-ignore err.data = packet.data.data; this.emitReserved("connect_error", err); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n this.emit(\"packet\", packet);\n }", "onPacket(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n this.emitReserved(\"packet\", packet);\n }", "ondecoded(packet) {\n this.emitReserved(\"packet\", packet);\n }", "onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }", "onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n super.emit(\"packet\", packet);\n }", "ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }", "function dispatch(packet) {\n\n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case dist.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n super.emit(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case dist.PacketType.EVENT:\n this.onevent(packet);\n break;\n case dist.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case dist.PacketType.ACK:\n this.onack(packet);\n break;\n case dist.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case dist.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case dist.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n super.emit(\"connect_error\", err);\n break;\n }\n }", "onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case socket_io_parser_1.PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n const id = packet.data.sid;\n this.onconnect(id);\n }\n else {\n super.emit(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case socket_io_parser_1.PacketType.EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case socket_io_parser_1.PacketType.ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case socket_io_parser_1.PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case socket_io_parser_1.PacketType.CONNECT_ERROR:\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n super.emit(\"connect_error\", err);\n break;\n }\n }", "function sendPacket(packet){\n if(packet != prevPacket) {\n console.log(packet)\n socket.send(packet)\n prevPacket = packet\n }\n}", "function onSocketChunk(chunk) {\n var err = self.mach.handleChunk(chunk);\n if (err) {\n self.sendProtocolError('read', err);\n }\n }", "onevent(packet) {\n const args = packet.data || [];\n if (null != packet.id) {\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "_packetReceived(packet) {\n this._lastPacketTime = Date.now();\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.TRACE, () => packet.toString());\n // Special case some packets to update and maintain internal state\n switch (packet.FCType) {\n case constants.FCTYPE.DETAILS:\n case constants.FCTYPE.ROOMHELPER:\n case constants.FCTYPE.SESSIONSTATE:\n case constants.FCTYPE.ADDFRIEND:\n case constants.FCTYPE.ADDIGNORE:\n case constants.FCTYPE.CMESG:\n case constants.FCTYPE.PMESG:\n case constants.FCTYPE.TXPROFILE:\n case constants.FCTYPE.USERNAMELOOKUP:\n case constants.FCTYPE.MYCAMSTATE:\n case constants.FCTYPE.MYWEBCAM:\n case constants.FCTYPE.JOINCHAN:\n // According to the site code, these packets can all trigger a user state update\n this._lastStatePacketTime = this._lastPacketTime;\n // This case updates our available tokens (yes the logic is insane, but it's lifted right from MFC code...)\n if (packet.FCType === constants.FCTYPE.DETAILS && packet.nTo === this.sessionId) {\n this._tokens = (packet.nArg1 > 2147483647) ? ((4294967297 - packet.nArg1) * -1) : packet.nArg1;\n }\n // And these specific cases don't update state...\n if ((packet.FCType === constants.FCTYPE.DETAILS && packet.nFrom === constants.FCTYPE.TOKENINC) ||\n // 100 here is taken directly from MFC's top.js and has no additional\n // explanation. My best guess is that it is intended to reference the\n // constant: USER.ID_START. But since I'm not certain, I'll leave this\n // \"magic\" number here.\n (packet.FCType === constants.FCTYPE.ROOMHELPER && packet.nArg2 < 100) ||\n (packet.FCType === constants.FCTYPE.JOINCHAN && packet.nArg2 === constants.FCCHAN.PART)) {\n break;\n }\n if (packet.FCType === constants.FCTYPE.ROOMHELPER) {\n if (packet.nArg2 >= 100 || packet.nArg2 === constants.FCRESPONSE.SUCCESS) {\n this._roomHelperStatus.set(packet.nArg1, true);\n }\n if (packet.nArg2 === constants.FCRESPONSE.SUSPEND) {\n this._roomHelperStatus.set(packet.nArg1, false);\n }\n }\n // Ok, we're good, merge if there's anything to merge\n if (packet.sMessage !== undefined) {\n const msg = packet.sMessage;\n const lv = msg.lv;\n const sid = msg.sid;\n let uid = msg.uid;\n if (uid === 0 && sid > 0) {\n uid = sid;\n }\n if (uid === undefined && packet.aboutModel !== undefined) {\n uid = packet.aboutModel.uid;\n }\n // Only merge models (when we can tell). Unfortunately not every SESSIONSTATE\n // packet has a user level property. So this is no worse than we had been doing\n // before in terms of merging non-models...\n if (uid !== undefined && uid !== -1 && (lv === undefined || lv === constants.FCLEVEL.MODEL)) {\n // If we know this is a model, get her instance and create it\n // if it does not exist. Otherwise, don't create an instance\n // for someone that might not be a model.\n const possibleModel = Model_1.Model.getModel(uid, lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(msg);\n }\n }\n }\n break;\n case constants.FCTYPE.TAGS:\n const tagPayload = packet.sMessage;\n if (typeof tagPayload === \"object\") {\n for (const key in tagPayload) {\n if (tagPayload.hasOwnProperty(key)) {\n const possibleModel = Model_1.Model.getModel(key);\n if (possibleModel !== undefined) {\n possibleModel.mergeTags(tagPayload[key]);\n }\n }\n }\n }\n break;\n case constants.FCTYPE.BOOKMARKS:\n const bmMsg = packet.sMessage;\n if (Array.isArray(bmMsg.bookmarks)) {\n bmMsg.bookmarks.forEach((b) => {\n const possibleModel = Model_1.Model.getModel(b.uid);\n if (possibleModel !== undefined) {\n possibleModel.merge(b);\n }\n });\n }\n break;\n case constants.FCTYPE.EXTDATA:\n if (packet.nTo === this.sessionId && packet.nArg2 === constants.FCWOPT.REDIS_JSON) {\n this._handleExtData(packet.sMessage).catch((reason) => {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.WARNING, () => `WARNING: _packetReceived caught rejection from _handleExtData: ${reason}`);\n });\n }\n break;\n case constants.FCTYPE.METRICS:\n // For METRICS, nTO is an FCTYPE indicating the type of data that's\n // starting or ending, nArg1 is the count of data received so far, and nArg2\n // is the total count of data, so when nArg1 === nArg2, we're done for that data\n // Note that after MFC server updates on 2017-04-18, Metrics packets are rarely,\n // or possibly never, sent\n break;\n case constants.FCTYPE.MANAGELIST:\n if (packet.nArg2 > 0 && packet.sMessage !== undefined && packet.sMessage.rdata !== undefined) {\n const rdata = this.processListData(packet.sMessage.rdata);\n const nType = packet.nArg2;\n switch (nType) {\n case constants.FCL.ROOMMATES:\n if (Array.isArray(rdata)) {\n rdata.forEach((viewer) => {\n if (viewer !== undefined) {\n const possibleModel = Model_1.Model.getModel(viewer.uid, viewer.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(viewer);\n }\n }\n });\n }\n break;\n case constants.FCL.CAMS:\n if (Array.isArray(rdata)) {\n rdata.forEach((model) => {\n if (model !== undefined) {\n const possibleModel = Model_1.Model.getModel(model.uid, model.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(model);\n }\n }\n });\n if (!this._completedModels) {\n this._completedModels = true;\n if (this._completedTags) {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, `[CLIENT] emitting: CLIENT_MODELSLOADED`);\n this.emit(\"CLIENT_MODELSLOADED\");\n }\n }\n }\n break;\n case constants.FCL.FRIENDS:\n if (Array.isArray(rdata)) {\n rdata.forEach((model) => {\n if (model !== undefined) {\n const possibleModel = Model_1.Model.getModel(model.uid, model.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(model);\n }\n }\n });\n }\n break;\n case constants.FCL.IGNORES:\n if (Array.isArray(rdata)) {\n rdata.forEach((user) => {\n if (user !== undefined) {\n const possibleModel = Model_1.Model.getModel(user.uid, user.lv === constants.FCLEVEL.MODEL);\n if (possibleModel !== undefined) {\n possibleModel.merge(user);\n }\n }\n });\n }\n break;\n case constants.FCL.TAGS:\n const tagPayload2 = rdata;\n if (tagPayload2 !== undefined) {\n for (const key in tagPayload2) {\n if (tagPayload2.hasOwnProperty(key)) {\n const possibleModel = Model_1.Model.getModel(key);\n if (possibleModel !== undefined) {\n possibleModel.mergeTags(tagPayload2[key]);\n }\n }\n }\n if (!this._completedTags) {\n this._completedTags = true;\n if (this._completedModels) {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, `[CLIENT] emitting: CLIENT_MODELSLOADED`);\n this.emit(\"CLIENT_MODELSLOADED\");\n }\n }\n }\n break;\n case constants.FCL.SHARE_CLUBS:\n // @TODO\n break;\n case constants.FCL.SHARE_CLUBMEMBERSHIPS:\n // @TODO\n break;\n case constants.FCL.SHARE_CLUBSHOWS:\n if (Array.isArray(rdata)) {\n rdata.forEach((message) => {\n this._packetReceived(new Packet_1.Packet(constants.FCTYPE.CLUBSHOW, \n // tslint:disable-next-line:no-any\n message.model, packet.nTo, packet.nArg1, packet.nArg2, 0, message));\n });\n }\n break;\n default:\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.WARNING, () => `WARNING: _packetReceived unhandled list type on MANAGELIST packet: ${nType}`);\n }\n }\n break;\n case constants.FCTYPE.ROOMDATA:\n if (packet.nArg1 === 0 && packet.nArg2 === 0) {\n if (Array.isArray(packet.sMessage)) {\n const sizeOfModelSegment = 2;\n for (let i = 0; i < packet.sMessage.length; i = i + sizeOfModelSegment) {\n const possibleModel = Model_1.Model.getModel(packet.sMessage[i]);\n if (possibleModel !== undefined) {\n possibleModel.merge({ \"sid\": possibleModel.bestSessionId, \"m\": { \"rc\": packet.sMessage[i + 1] } });\n }\n }\n }\n else if (typeof (packet.sMessage) === \"object\") {\n for (const key in packet.sMessage) {\n if (packet.sMessage.hasOwnProperty(key)) {\n const rdmsg = packet.sMessage;\n const possibleModel = Model_1.Model.getModel(key);\n if (possibleModel !== undefined) {\n possibleModel.merge({ \"sid\": possibleModel.bestSessionId, \"m\": { \"rc\": rdmsg[key] } });\n }\n }\n }\n }\n }\n break;\n case constants.FCTYPE.TKX:\n const auth = packet.sMessage;\n if (auth && auth.cxid && auth.tkx && auth.ctxenc) {\n this.stream_cxid = auth.cxid;\n this.stream_password = auth.tkx;\n const pwParts = auth.ctxenc.split(\"/\");\n this.stream_vidctx = pwParts.length > 1 ? pwParts[1] : auth.ctxenc;\n }\n break;\n case constants.FCTYPE.TOKENINC:\n if (packet.sMessage === undefined) {\n this._tokens = packet.nArg1;\n }\n break;\n case constants.FCTYPE.CLUBSHOW:\n const showDetails = packet.sMessage;\n if (showDetails.op === constants.FCCHAN.WELCOME && showDetails.tksid !== undefined) {\n this._availableClubShows.add(showDetails.model);\n }\n else {\n this._availableClubShows.delete(showDetails.model);\n }\n break;\n default:\n break;\n }\n // Fire this packet's event for any listeners\n this.emit(constants.FCTYPE[packet.FCType], packet);\n this.emit(constants.FCTYPE[constants.FCTYPE.ANY], packet);\n }", "_onControlSocketData(chunk) {\n this.log(`< ${chunk}`);\n // This chunk might complete an earlier partial response.\n const completeResponse = this._partialResponse + chunk;\n const parsed = (0, parseControlResponse_1.parseControlResponse)(completeResponse);\n // Remember any incomplete remainder.\n this._partialResponse = parsed.rest;\n // Each response group is passed along individually.\n for (const message of parsed.messages) {\n const code = parseInt(message.substr(0, 3), 10);\n const response = { code, message };\n const err = code >= 400 ? new FTPError(response) : undefined;\n this._passToHandler(err ? err : response);\n }\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "function on_socket_get(message){}", "function\nWebSocketIFHandleRequest\n(InPacket)\n{\n\n}", "function onClientPacket(packet) {\n switch (packet.opcode) {\n case this.opcodes.SERVER.AGENT_SERVER:\n this.login.identify(packet);\n break;\n case this.opcodes.SERVER.SERVER_LIST:\n this.login.serverList(packet);\n break;\n case this.opcodes.SERVER.CAPTCHA_REQUEST:\n this.login.captchaRequest(packet);\n break;\n case this.opcodes.SERVER.LOGIN_REPLY:\n this.login.loginResponse(packet);\n break;\n case this.opcodes.SERVER.GAME_LOGIN_REPLY:\n this.login.gameLoginResponse(packet);\n break;\n case this.opcodes.SERVER.CHARACTER_LIST:\n this.charList.analyze(packet);\n break;\n case this.opcodes.SERVER.CHARACTER_SELECT:\n this.charList.characterSelected(packet);\n break;\n case this.opcodes.SERVER.TELEPORT_REQUEST:\n this.teleport.teleportRequest(packet);\n break;\n case this.opcodes.SERVER.CHARDATA_BEGIN:\n this.charData.begin(packet);\n break;\n case this.opcodes.SERVER.CHARDATA_DATA:\n this.charData.data(packet);\n break;\n case this.opcodes.SERVER.CHARDATA_END:\n this.charData.end(packet);\n break;\n case this.opcodes.SERVER.CHARDATA_ID:\n this.charData.id(packet);\n break;\n case this.opcodes.SERVER.WEATHER:\n this.world.weather(packet);\n break;\n case this.opcodes.SERVER.SINGLE_SPAWN:\n this.spawnManager.spawn(packet);\n break;\n case this.opcodes.SERVER.SINGLE_DESPAWN:\n this.spawnManager.despawn(packet);\n break;\n case this.opcodes.SERVER.GROUPSPAWN_BEGIN:\n this.groupSpawn.groupSpawnBegin(packet);\n break;\n case this.opcodes.SERVER.GROUPSPAWN_DATA:\n this.groupSpawn.groupSpawnData(packet);\n break;\n case this.opcodes.SERVER.GROUPSPAWN_END:\n this.groupSpawn.groupSpawnEnd(packet);\n break;\n default:\n break;\n }\n\n //Forward packet to connected clients on the local server\n this.serverPacketManager.forwardPacketAll(packet);\n \n this.emit('clientPacket', packet);\n}", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "_readWebSocketData(buf) {\n this._streamWebSocketBuffer += buf;\n // The new buffer might contain a complete packet, try to read to find out...\n this._readWebSocketPacket();\n }", "socket_customEventFromServer(_, payload) {\n console.log(\"customEventFromServer\", payload);\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n\n if (this.connected) {\n this.emitEvent(args);\n } else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "#data(socket_ind, data) {\n\t\tconst socket = this.#connections[socket_ind];\n\t\tconst frame = Frame.read(data);\n\n\t\t// Invalid frame (too large)\n\t\tif(frame === null) return this.#emitter.emit(\"error\", {\n\t\t\tmessage: \"Invalid frame received\",\n\t\t\tsocket\n\t\t});\n\n\t\t// Invalid frame (missing mask), disconnect\n\t\tif(!frame.mask) {\n\t\t\tthis.#emitter.emit(\"error\", {\n\t\t\t\tmessage: \"Frame missing mask\",\n\t\t\t\tsocket\n\t\t\t});\n\n\t\t\tthis.disconnect(socket_ind, \"Frame missing mask\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Text or binary data\n\t\tif(frame.opcode === Frame.TEXT || frame.opcode === Frame.BINARY) {\n\t\t\tthis.#emitter.emit(\"message\", frame, socket_ind);\n\t\t}\n\n\t\t// Close the connection\n\t\tif(frame.opcode === Frame.CLOSE) {\n\t\t\tthis.disconnect(socket_ind, frame.data);\n\t\t}\n\n\t\t// Ping\n\t\telse if(frame.opcode === Frame.PING) {\n\t\t\tthis.#emitter.emit(\"ping\", frame, socket_ind);\n\n\t\t\tconst pong = Frame.write(Frame.PONG, frame.data);\n\t\t\tsocket.write(pong);\n\t\t}\n\n\t\t// Pong\n\t\telse if(frame.opcode === Frame.PONG) {\n\t\t\tthis.#emitter.emit(\"pong\", frame, socket_ind);\n\t\t}\n\t}", "function _send_message(socket, packet) {\n if (!socket) {\n debug_log(\"No socket to send packet to\", packet);\n // Socket doesn't exist - odd\n return;\n }\n\n if (socket.readyState == 3) {\n // Socket has already closed\n return;\n }\n\n packet[\"router_outgoing_timestamp\"] = pythonTime();\n // Send the message through, with one retry a half second later\n socket.send(JSON.stringify(packet), function ack(error) {\n if (error === undefined) {\n return;\n }\n setTimeout(function () {\n socket.send(JSON.stringify(packet), function ack2(error2) {\n if (error2 === undefined) {\n return;\n } else {\n console.log(error2);\n }\n });\n }, 500);\n });\n}", "onWsPacket(packet) {\n if (packet.op === 8 /* Hello */ && this.state.code !== NetworkingStatusCode.Closed) {\n this.state.ws.setHeartbeatInterval(packet.d.heartbeat_interval);\n }\n else if (packet.op === 2 /* Ready */ && this.state.code === NetworkingStatusCode.Identifying) {\n const { ip, port, ssrc, modes } = packet.d;\n const udp = new VoiceUDPSocket_1.VoiceUDPSocket({ ip, port });\n udp.on('error', this.onChildError);\n udp.on('debug', this.onUdpDebug);\n udp.once('close', this.onUdpClose);\n udp\n .performIPDiscovery(ssrc)\n .then((localConfig) => {\n if (this.state.code !== NetworkingStatusCode.UdpHandshaking)\n return;\n this.state.ws.sendPacket({\n op: 1 /* SelectProtocol */,\n d: {\n protocol: 'udp',\n data: {\n address: localConfig.ip,\n port: localConfig.port,\n mode: chooseEncryptionMode(modes),\n },\n },\n });\n this.state = {\n ...this.state,\n code: NetworkingStatusCode.SelectingProtocol,\n };\n })\n .catch((error) => this.emit('error', error));\n this.state = {\n ...this.state,\n code: NetworkingStatusCode.UdpHandshaking,\n udp,\n connectionData: {\n ssrc,\n },\n };\n }\n else if (packet.op === 4 /* SessionDescription */ &&\n this.state.code === NetworkingStatusCode.SelectingProtocol) {\n const { mode: encryptionMode, secret_key: secretKey } = packet.d;\n this.state = {\n ...this.state,\n code: NetworkingStatusCode.Ready,\n connectionData: {\n ...this.state.connectionData,\n encryptionMode,\n secretKey: new Uint8Array(secretKey),\n sequence: randomNBit(16),\n timestamp: randomNBit(32),\n nonce: 0,\n nonceBuffer: Buffer.alloc(24),\n speaking: false,\n packetsPlayed: 0,\n },\n };\n }\n else if (packet.op === 9 /* Resumed */ && this.state.code === NetworkingStatusCode.Resuming) {\n this.state = {\n ...this.state,\n code: NetworkingStatusCode.Ready,\n };\n this.state.connectionData.speaking = false;\n }\n }", "function onSocketData(chunk) {\n let data = _data.get(this);\n\n if (typeof data.buffer !== 'string') {\n data.buffer = '';\n }\n\n data.buffer += chunk;\n\n let delimiter = data.buffer.indexOf('\\n');\n\n while (delimiter >= 0) {\n let message;\n\n try {\n message = JSON.parse(data.buffer.substr(0, delimiter));\n } catch (err) {\n setImmediate(this.emit.bind(this, 'error', err));\n }\n\n if (message) {\n setImmediate(this.emit.bind(this, 'data', message));\n }\n\n data.buffer = data.buffer.substr(delimiter + 1);\n\n delimiter = data.buffer.indexOf('\\n');\n }\n\n _data.set(this, data);\n}", "SOCKET_ONMESSAGE (state, payload) {\n state.socket.message = payload\n }", "async PacketIO(packet) {\n async function _packetIO(packet, ctx) {\n // console.log(\"SEND DATA: \" + packet.GetBytes() + \" [\" + (new Date().getTime()) + \"]\");\n await ctx.PacketSend(packet);\n return new Promise((resolve, reject) => {\n var timeout;\n\n const _afterData = async (data) => {\n var readBuffer = [...data];\n clearTimeout(timeout);\n ctx.parser.removeListener('data', _afterData);\n // console.log(\"RECEIVE DATA: \" + readBuffer + \" [\" + (new Date().getTime()) + \"]\");\n //await _timeout(1);\n resolve(DpsPacket.FromBytes(readBuffer));\n };\n\n // Reject on timeout\n timeout = setTimeout(() => {\n // console.log(\"TIMEOUT\");\n ctx.parser.removeListener('data', _afterData);\n resolve(null);\n }, DpsConstants.read_timeout);\n\n // Resolve on data\n ctx.parser.on('data', _afterData);\n });\n }\n var data;\n for (var i = 0; i < DpsConstants.retry && !data; i++) {\n if (!this.serialPort.closing || this.serialPort.readable)\n data = await _packetIO(packet, this);\n }\n return data;\n }", "_readData(buf) {\n this._streamBuffer = Buffer.concat([this._streamBuffer, buf]);\n // The new buffer might contain a complete packet, try to read to find out...\n this._readPacket();\n }", "function\nWebSocketIFHandleResponseInit\n(InPacket)\n{\n}", "sendPacket(packet) {\n var _a;\n try {\n const stringified = JSON.stringify(packet);\n (_a = this.debug) === null || _a === void 0 ? void 0 : _a.call(this, `>> ${stringified}`);\n return this.ws.send(stringified);\n }\n catch (error) {\n this.emit('error', error);\n }\n }", "transmit() {\n // Only transmit if socket is ready\n if (this.socket_ready) {\n if (this.ArtDmxSeq > 255) {\n this.ArtDmxSeq = 1;\n }\n // Build packet: ID Int8[8], OpCode Int16 0x5000 (conv. to 0x0050),\n // ProtVer Int16, Sequence Int8, PhysicalPort Int8,\n // SubnetUniverseNet Int16, Length Int16\n var udppacket = Buffer.from(\n jspack.Pack(\n ArtDmxHeaderFormat + ArtDmxPayloadFormat,\n [\n \"Art-Net\",\n 0,\n 0x0050,\n 14,\n this.ArtDmxSeq,\n 0,\n this.subuni,\n this.net,\n 512,\n ].concat(this.values)\n )\n );\n // Increase Sequence Counter\n this.ArtDmxSeq++;\n this.emit(\"frame_sending\", { node: this, data: udppacket });\n\n // Send UDP\n var client = this.socket;\n client.send(udppacket, 0, udppacket.length, this.port, this.ip, (err) => {\n if (err) throw err;\n this.emit(\"frame_sent\", { node: this, data: udppacket });\n });\n }\n }", "listenForData() {\n this.socket.on(EVENT_DATA, data => this.handleData(data))\n }", "function\nWebSocketIFHandleResponse\n(InPacket)\n{\n if ( InPacket.status == \"Error\" ) {\n SetMessageError(InPacket.message);\n return;\n }\n\n console.log(InPacket);\n if ( InPacket.status == \"OK\" ) {\n WebSocketIFID = InPacket.packetid + 1;\n if ( InPacket.type == \"init\" ) {\n WebSocketIFHandleResponseInit(InPacket.body);\n return;\n }\n }\n}", "function receiveData(socket, data) {\n\n\tif(data.toString().match(/\\-/)) {\n // annouce new connection to channel.\n servers[socket.remoteAddress] = socket.remoteAddress;\n io.sockets.emit('updateservers', servers);\n\n\t\t// Get the fields from the header, this way we provide SOME id of what we deal with.\n\t\tvar header = data.toString().split(\"\\n\");\n\t\tfields = header[1].replace(/\\|/g, \" \");\n\t\tfields = fields.replace(/\\s+/g, \" \");\n\t\tfields = fields.replace(/\\s+/, \"\");\n\t\tfields = fields.split(\" \");\n\t\treturn; // stop processing here.\n\t}\t\n\n\tvar cleanData = cleanInput(data);\n\n\tvar record = {};\n\n\t// First element of the array will be the HOST ip.\n\trecord['server_addr'] = socket.remoteAddress;\n\n\tfor(var i=0;i<cleanData.length;i++) {\n\t\tif(cleanData[i]) {\n\t\t\t// dont assign empty vars to items.\n\t\t\trecord[fields[i]] = cleanData[i];\n\t\t}\n\t}\n\n\t// turn array into json.\n\tvar msgHealth;\n\n\tmsgHealth = JSON.stringify(record);\n\n\t//console.log(\"\\n\");\n io.sockets.emit('updatelog', socket.remoteAddress, msgHealth);\n\t//console.log(msgHealth);\n\n}", "handleSocketMessage(event) {\n console.log(event);\n //let response = JSON.parse(event.data);\n //console.log(response.type);\n\n //this.emit(response.type, response.value);\n }", "function\nWebSocketIFHandlePacket\n(InData)\n{\n var packet;\n var packettype;\n \n packet = JSON.parse(InData);\n n = packet.packetid;\n if ( n > 0 ) {\n WebSocketIFID = n;\n }\n\n packettype = packet.packettype;\n if ( packettype == \"request\" ) {\n WebSocketIFHandleRequest(packet);\n } else if ( packettype == \"response\" ) {\n WebSocketIFHandleResponse(packet);\n }\n}", "function onData(d){\n var frame,\n generatedData,\n response;\n\n frame = TBus.parse(d);\n\n if(!frame.valid){\n console.log(\"Invalid frame received.\");\n return;\n }\n\n if(!Devices[frame.receiver[0]]){\n console.log(\"Device is not supported.\");\n }\n\n generatedData = Devices[frame.receiver[0]].randomData();\n response = TBus.prepareCommand(frame.sender, frame.receiver, generatedData);\n\n setTimeout(function(){\n /*\n var one,\n two;\n\n one = new Buffer(response.slice(0,5));\n two = new Buffer(response.slice(5,response.length));\n serialPort.write(one);\n setTimeout(function(){\n serialPort.write(two);\n },110);\n */\n serialPort.write(response);\n },0);\n}", "onReceive( pdu ) {\n\n // We push it to the Transform object, which spits it out\n // the Readable side of the stream as a 'data' event\n this.push( Buffer.from( pdu.slice(3, pdu.length-1 )));\n\n }", "function receiveMessage(msgheader, buf) {\n self.emit(\"data\", msgheader, buf);\n }", "_readPacket() {\n let pos = this._streamPosition;\n const intParams = [];\n let strParam;\n try {\n // Each incoming packet is initially tagged with 7 int32 values, they look like this:\n // 0 = \"Magic\" value that is *always* -2027771214\n // 1 = \"FCType\" that identifies the type of packet this is (FCType being a MyFreeCams defined thing)\n // 2 = nFrom\n // 3 = nTo\n // 4 = nArg1\n // 5 = nArg2\n // 6 = sPayload, the size of the payload\n // 7 = sMessage, the actual payload. This is not an int but is the actual buffer\n // Any read here could throw a RangeError exception for reading beyond the end of the buffer. In theory we could handle this\n // better by checking the length before each read, but that would be a bit ugly. Instead we handle the RangeErrors and just\n // try to read again the next time the buffer grows and we have more data\n // Parse out the first 7 integer parameters (Magic, FCType, nFrom, nTo, nArg1, nArg2, sPayload)\n const countOfIntParams = 7;\n const sizeOfInt32 = 4;\n for (let i = 0; i < countOfIntParams; i++) {\n intParams.push(this._streamBuffer.readInt32BE(pos));\n pos += sizeOfInt32;\n }\n const [magic, fcType, nFrom, nTo, nArg1, nArg2, sPayload] = intParams;\n // If the first integer is MAGIC, we have a valid packet\n if (magic === constants.MAGIC) {\n // If there is a JSON payload to this packet\n if (sPayload > 0) {\n // If we don't have the complete payload in the buffer already, bail out and retry after we get more data from the network\n if (pos + sPayload > this._streamBuffer.length) {\n throw new RangeError(); // This is needed because streamBuffer.toString will not throw a rangeerror when the last param is out of the end of the buffer\n }\n // We have the full packet, store it and move our buffer pointer to the next packet\n strParam = this._streamBuffer.toString(\"utf8\", pos, pos + sPayload);\n pos = pos + sPayload;\n }\n }\n else {\n // Magic value did not match? In that case, all bets are off. We no longer understand the MFC stream and cannot recover...\n // This is usually caused by a mis-alignment error due to incorrect buffer management (bugs in this code or the code that writes the buffer from the network)\n this._disconnected(`Invalid packet received! - ${magic} Length == ${this._streamBuffer.length}`);\n return;\n }\n // At this point we have the full packet in the intParams and strParam values, but intParams is an unstructured array\n // Let's clean it up before we delegate to this.packetReceived. (Leaving off the magic int, because it MUST be there always\n // and doesn't add anything to the understanding)\n let sMessage;\n if (strParam !== undefined && strParam !== \"\") {\n try {\n sMessage = JSON.parse(strParam);\n }\n catch (e) {\n sMessage = strParam;\n }\n }\n this._packetReceived(new Packet_1.Packet(fcType, nFrom, nTo, nArg1, nArg2, sPayload, sMessage));\n // If there's more to read, keep reading (which would be the case if the network sent >1 complete packet in a single transmission)\n if (pos < this._streamBuffer.length) {\n this._streamPosition = pos;\n this._readPacket();\n }\n else {\n // We read the full buffer, clear the buffer cache so that we can\n // read cleanly from the beginning next time (and save memory)\n this._streamBuffer = Buffer.alloc(0);\n this._streamPosition = 0;\n }\n }\n catch (e) {\n // RangeErrors are expected because sometimes the buffer isn't complete. Other errors are not...\n if (!(e instanceof RangeError)) {\n this._disconnected(`Unexpected error while reading socket stream: ${e}`);\n }\n else {\n // this.log(\"Expected exception (?): \" + e);\n }\n }\n }", "function realHandler(data) {\n self.bytesReceived += data.length;\n self._receiver.add(data);\n }", "function realHandler(data) {\n self.bytesReceived += data.length;\n self._receiver.add(data);\n }", "function realHandler(data) {\n self.bytesReceived += data.length;\n self._receiver.add(data);\n }", "function receivedMessageFromServer(e) {\n // extract the ID from the received packet\n const q = JSON.parse(e.data);\n\n ctx.beginPath();\n ctx.arc(q.x * 10, q.y * 10, 10, 0, TAU);\n ctx.closePath();\n ctx.fillStyle = q.col;\n ctx.fill();\n}", "onData(data) {\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n }\n }", "start() {\n const that = this;\n this.transport.socket.on('data', (data) => {\n that.bufferQueue = Buffer.concat([that.bufferQueue, Buffer.from(data)]);\n if (that.bufferQueue.length > RTConst.PROTOCOL_HEADER_LEN) { // parse head length\n const packetLen = that.bufferQueue.readUInt32BE(0);\n const totalLen = packetLen + RTConst.PROTOCOL_HEADER_LEN;\n if (that.bufferQueue.length >= totalLen) {\n // it is a full packet, this packet can be parsed as message\n const messageBuffer = Buffer.alloc(packetLen);\n that.bufferQueue.copy(messageBuffer, 0, RTConst.PROTOCOL_HEADER_LEN, totalLen);\n that.incomeMessage(RTRemoteSerializer.fromBuffer(messageBuffer));\n that.bufferQueue = that.bufferQueue.slice(totalLen); // remove parsed message\n }\n }\n });\n }", "_onData(data) {\n\n let me = this;\n\n me._rxData = me._rxData + data.toString();\n\n // If we are waiting for a response from the device, see if this is it\n if(this.requestQueue.length > 0) {\n\n let cmd = me.requestQueue[0];\n\n if(me._rxData.search(cmd.regex) > -1) {\n // found what we are looking for\n\n\n // Cancel the no-response timeout because we have a response\n if(cmd.timer !== null) {\n clearTimeout(cmd.timer);\n cmd.timer = null;\n }\n\n // Signal the caller with the response data\n if(cmd.cb) {\n cmd.cb(null, me._rxData);\n }\n\n // Remove the request from the queue\n me.requestQueue.shift();\n\n // discard all data (this only works because we only send one\n // command at a time...)\n me._rxData = '';\n }\n } else if(me.isReady) {\n\n let packets = me._rxData.split(';');\n\n if(packets.length > 0) {\n\n\n // save any extra data that's not a full packet for next time\n me._rxData = packets.pop();\n\n packets.forEach(function(packet) {\n\n let fields = packet.match(/:([SX])([0-9A-F]{1,8})N([0-9A-F]{0,16})/);\n\n if(fields) {\n\n let id = 0;\n let ext = false,\n data;\n\n try {\n\n data = Buffer.from(fields[3], 'hex');\n id = parseInt(fields[2], 16);\n\n if(fields[1] === 'X') {\n ext = true;\n }\n\n } catch (err) {\n // we sometimes get malformed packets (like an odd number of hex digits for the data)\n // I dunno why that is, so ignore them\n // console.log('onData error: ', fields, err);\n }\n\n if(id > 0) {\n // emit a standard (non-J1939) message\n me.push({\n id: id,\n ext: ext,\n buf: data\n });\n\n }\n\n }\n });\n }\n }\n }", "TxPacket(packet) {\n this.TxCmd(packet.FCType, packet.nTo, packet.nArg1, packet.nArg2, JSON.stringify(packet.sMessage));\n }", "function send(self, to, packet)\n{\n if(!to.ip || !(to.port > 0)) return warn(\"invalid address\", to);\n\n var buf = encode(self, to, packet);\n\n // if this packet is to be signed, wrap it and do that\n if(packet.sign && !packet.js.line)\n {\n var signed = {js:{}};\n signed.body = buf;\n signed.js.sig = crypto.createSign(\"RSA-MD5\").update(buf).sign(self.prikey, \"base64\");\n buf = encode(self, to, signed);\n packet = signed;\n }\n\n if(to.cipher)\n {\n var enc = {js:{}};\n enc.js.line = packet.js.line;\n enc.js.cipher = true;\n var aes = crypto.createCipher(\"AES-128-CBC\", to.openedSecret);\n enc.body = Buffer.concat([aes.update(buf), aes.final()]);\n buf = encode(self, to, enc);\n packet = enc;\n }\n\n // track some stats\n to.sent ? to.sent++ : to.sent = 1;\n to.sentAt = Date.now();\n\n // if there's a hashname, this is the best place to handle clearing the pop'd state on any send\n if(to.hashname && to.popping) delete to.popping;\n\n // special, first packet + nat + via'd, send a pop too\n if(to.via && to.sent === 1 && self.nat)\n {\n to.popping = packet; // cache first packet for possible resend\n send(self, to.via, {js:{pop:[[to.hashname,to.ip,to.port].join(\",\")]}});\n }\n\n self.server.send(buf, 0, buf.length, to.port, to.ip);\n}", "onSocketRawConnected() {\n this.debugOut('socketRawConnected()');\n this.state = SOCK_CONNECTED;\n this.emit('extra', 'raw socket connected', (this.socket.socket || this.socket));\n }", "function newConnection(socket) {\n console.log('Connnected: ' + socket.id);\n player_id.push(socket.id);\n players++;\n //function if this socket ever disconnects\n socket.on(\"disconnect\", (reason) => {\n\n console.log(reason);\n Disconnect(socket);\n\n });\n socket.emit('number_of_players', player_id);\n socket.broadcast.emit('updated_player_length', player_id);\n socket.on('player_data', playerdata);\n socket.on('shoot', Shoot);\n socket.on('Player_got_hit',PlayerHit);\n socket.on('i_hit_someone', hit)\n socket.on('increase_kill_count', increaseKillCount);\n\n function Shoot(shoot_data) {\n socket.broadcast.emit('shoot', shoot_data);\n //console.log(shoot_data);\n }\n\n function playerdata(all_data) {\n socket.broadcast.emit('player_data', all_data);\n //console.log(all_data);\n }\n\n function PlayerHit(hit_data){\n socket.broadcast.emit('someone_got_hit',hit_data);\n }\n\n function increaseKillCount(pid) {\n socket.to(pid).emit('kills_badhao_mera');\n }\n\n function hit(hit_data) {\n //console.log(hit_data[0])\n socket.broadcast.emit('someone_hit_me',hit_data);\n }\n}", "insert (packet) {\n if ((this._length + 1) > this._buffer.length) {\n this.remove()\n }\n\n const next = this._start + this._length\n const index = next % this._buffer.length\n this._buffer[index] = packet\n this._length += 1\n }", "handleOnPlayerMessage(player) {\n let _this = this;\n\n // handle on message\n player.socket.on(\"message\", function (message) {\n let _data = JSON.parse(message);\n\n if (_data.messageType === MESSAGE_TYPE.CLIENT_CHAT) {\n let _playerDisplayName = player.id;\n if (player.playerName) {\n _playerDisplayName = player.playerName;\n }\n let _message = new Message(MESSAGE_TYPE.CLIENT_CHAT);\n _message.content = _playerDisplayName + \" : \" + _data.content;\n _this.sendAll(JSON.stringify(_message));\n } else if (_data.messageType === MESSAGE_TYPE.CLIENT_CARD) {\n // Karte in der Logik verarbeiten.\n scopaLogic.processPlayerMessage(_data, _this);\n } else if (_data.messageType === MESSAGE_TYPE.CLIENT_STATE) {\n // Name und ID des Spielers setzen\n player.playerName = _data.playerName;\n player.playerId = _data.playerId;\n console.log(\"Spielername: \" + _data.playerName + \" Spieler ID\" + _data.playerId);\n }else if (_data.messageType === MESSAGE_TYPE.CLIENT_RESTART) {\n scopaLogic.startGame();\n }\n });\n }", "function handleInitialMessage(data) {\n\n\t\t// if we are in the middle of buffering a header\n\t\tif(prevData) {\n\t\t\t// add this data to the end of our header buffer\n\t\t\tdata = Buffer.concat([prevData, data], prevData.length + data.length);\n\t\t}\n\n\t\t// Gets our header string if we have the entire header buffered, or false if not\n\t\tvar header = getHeaderString(data);\n\n\t\t// If we have yet to receive the entire header\n\t\tif(!header) {\n\t\t\t// Get our buffer ready for the next packet\n\t\t\tprevData = data;\n\t\t\treturn;\n\t\t}\n\n\t\t// When we have the entire header, no longer call this function when getting new data\n\t\tsocket.removeListener('data', handleInitialMessage);\n\n\t\tvar method = getMethod(header);\n\t\tvar serverInfo = getHostname(header);\n\t\t\n\t\tconsole.log(\">>> \" + header.split(\"\\r\\n\")[0]);\n\n\t\tif(method === 'CONNECT') {\n\t\t\thandleConnectTunnel(serverInfo);\n\t\t} else {\n\t\t\thandleNormalRequest(serverInfo, data);\n\t\t}\n\t}", "SOCKET_ONMESSAGE(state, message) {\n state.socket.message = message;\n }", "SOCKET_ONMESSAGE (state, message) {\n state.socket.message = message\n }", "messageHandler(socket)\n {\n socket.on('message', message =>\n {\n // lo strasforma in un tipo javascript\n const data = JSON.parse(message);\n\n switch(data.type)\n {\n case MESSAGE_TYPES.chain:\n this.blockchain.replaceChain(data.chain);\n break;\n case MESSAGE_TYPES.transaction:\n this.transactionPool.updateOrAddTransaction(data.transaction);\n break;\n case MESSAGE_TYPES.clear_transactions:\n this.transactionPool.clear();\n break;\n }\n });\n }", "$onmessage(e) {\n if ( e.data instanceof ArrayBuffer ) {\n const bytes = new Uint8Array(e.data);\n try {\n const decoded = pb.sync.Packet.decode(bytes);\n if ( typeof this.onmessage === 'function' ) {\n this.onmessage(decoded);\n }\n } catch (e) {\n console.log(e);\n }\n }\n }", "function socketEvent(data){\n data = socketResponse(data);\n var Context = pageContext( null,null, null, data.param.route );\n tiny.pub(Context.page.eventDone, [ data, Context, data.param.route ] );\n }", "requestPacket(packetId, callback, onFailure) {\n this.handler.requestPacket(packetId, callback);\n }", "SOCKET_ONMESSAGE(state, message) {\n state.socket.message = message;\n console.log(\"SOCKET_ONMESSAGE\");\n }", "emit(eventName, payload) {\n this.socket.emit(eventName, payload);\n }", "function dataHandler(data, socket){\n\tvar type = null;\n\tvar target = null;\n\tvar msg = null;\n\n\tvar strArray = [];\n\tvar dataString = data.toString();\n\n\t//dataString = trim(dataString);\n\tstrArray = dataString.split('$');\n\n\tswitch(strArray[0]){\n\t\tcase 'CONNECT':\n\t\t\tnewMatching(strArray[1], strArray[2]);\n\t\t\tbreak;\n\t\tcase 'SEND':\n\t\t\tsendMessage(strArray[1], strArray[2], strArray[3]);\n\t\t\tbreak;\n\t\tcase 'NEW':\n\t\t\tnewConnect(strArray[1], socket);\n\t\t\tbreak;\n\t}\n}", "sendPayload(header, payload, sentCallback) {\n var packet = { header, payload, sentCallback };\n this.writePacket(packet);\n }", "function handleData(data) {\n console.log(\"[Gateway] >>>>>>>>>>\", data);\n\n\t/** Parse Packet **/\n\t/** Packet format: \"mac_addr:seq_num:msg_id:payload\" **/\n\t// \"source_mac_addr:seq_num:msg_type:num_hops:payload\"\n\tvar components = data.split(':');\n\tif (components.length !== 5) {\n\t\tconsole.error(\"Invalid minimum packet length\");\n\t\treturn;\n\t}\n\tvar macAddress = parseInt(components[0]),\n\t msgId = parseInt(components[2]),\n\t payload = components[4];\n\n\tswitch(msgId) {\n\t\tcase OUTLET_SENSOR_MESSAGE:\n\t\t\treturn handleSensorDataMessage(macAddress, payload);\n\t\tcase OUTLET_ACTION_ACK_MESSAGE:\n\t\t\treturn handleActionAckMessage(macAddress, payload);\n\t\tdefault:\n\t\t\tconsole.error(`Unknown Message type: ${msgId}`);\n\t}\n}", "function parsePacket(packet, connection) {\n\tlet packetType = packet[0];\n\tlet key = stringDecoder.write(packet.slice(1, 6));\n\tlet user = userManager.getUser(key);\n\n\tlet data = packet.slice(6);\n\tswitch(packetType) {\n\t\tcase packetTypes.REQUEST_AUTH:\n\t\t\tauthorize(connection);\n\t\t\tbreak;\n\t\tcase packetTypes.REQUEST_JOIN_OR_CREATE_LOBBY:\n\t\t\tlobbymanager.joinOrCreateLobby(user, packetTypes.REQUEST_JOIN_OR_CREATE_LOBBY);\n\t\t\tbreak;\n\t\tcase packetTypes.DATA_SYNC:\n\t\t\tlobbymanager.syncData(user, packetTypes.DATA_SYNC, data);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tlogger.logWarning(`Invalid packet type: ${packetType}`);\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}", "statusPacketTick(){\n\t\tdebug(`#${this.port} Sending a status packet with id ${this.send_count}`);\n\t\tif(this.socket)\n\t\t\tthis.socket.send([Buffer.from([PROTOCOL_ID, DATAGRAM_CODES.RELIABLE_UDP_STATUS]), uint16(this.send_count)], this.port, this.address);\n\t}", "function readData(binarystring, timestamp, host, portConnect, senderid, socket) {\n let senderidstring = \"\";\n\n //parsing the header \n v = parseInt(binarystring.substring(0, 3), 2);\n msgtype = parseInt(binarystring.substring(3, 11), 2);\n numpeers = parseInt(binarystring.substring(11, 24), 2);\n senderidlength = parseInt(binarystring.substring(24, 32), 2);\n\n //looping through data to decode the sender id\n for (j = 32; j < 32 + (senderidlength * 8); j = j + 8) {\n let charb = binarystring.substring(j, j + 8)\n senderidstring = senderidstring + String.fromCharCode(parseInt(charb, 2));\n }\n\n //getting the payload information\n let newstart = 32 + (senderidlength * 8);\n for (i = 0; i < numpeers; i++) {\n let peeraddressstring = \"\";\n peeraddress = parseInt(binarystring.substring(newstart, newstart + 32), 2);\n peerportnum = parseInt(binarystring.substring(newstart + 32, newstart + 48), 2);\n let peeradd1 = parseInt(binarystring.substring(newstart, newstart + 8), 2);\n let peeradd2 = parseInt(binarystring.substring(newstart + 8, newstart + 16), 2);\n let peeradd3 = parseInt(binarystring.substring(newstart + 16, newstart + 24), 2);\n let peeradd4 = parseInt(binarystring.substring(newstart + 24, newstart + 32), 2);\n peeraddressstring = peeradd1.toString() + \".\" + peeradd2.toString() + \".\" + peeradd3.toString() + \".\" + peeradd4.toString();\n\n\n //adding to stack\n if (!peeringdeclined.includes(newPortConnect)) {\n queue.push({\"HOST\":peeraddressstring,\"PORT\":peerportnum});\n }\n\n peered = peered + \"[\" + peeraddressstring + \":\" + peerportnum + '] ';\n newstart = newstart + 48;\n }\n\n if (v != 7) { //ignore if v does not equal 7\n return 0;\n }\n\n else if (msgtype == 2) { //if the packet is redirect\n console.log('\\nReceived ack from ', senderidstring, ':', portConnect);\n if (peered.length > 0) { //if peered with others print peer table\n console.log('\\tWhich is peered with', peered)\n }\n console.log('\\n')\n console.log('The join has been declined; The auto join process is being performed... ');\n\n // destroying the peer\n peered = \"\";\n peer.destroy();\n }\n\n //if the packet is welcome\n else {\n //add peer to peer table\n if (newPortConnect > 0) {\n //add the host and port to the peer table\n singleton.addPeerTable(host, newPortConnect, socket)\n //print connection information\n console.log('\\n')\n console.log('Connected to peer ', senderidstring, ':', newPortConnect, 'at timestamp: ', timestamp);\n console.log('This peer address is', host, ':', portLocal, 'located at', senderid);\n console.log('Received ack from ', senderidstring, ':', newPortConnect);\n if (peered.length > 0) { //if peered with others print peer table\n console.log('\\tWhich is peered with', peered)\n }\n } else {\n //add the host and port to the peer table\n singleton.addPeerTable(host, portConnect, socket)\n console.log('\\n')\n //print connection information\n console.log('Connected to peer ', senderidstring, ':', portConnect, 'at timestamp: ', timestamp);\n console.log('This peer address is', host, ':', portLocal, 'located at', senderid);\n console.log('Received ack from ', senderidstring, ':', portConnect);\n if (peered.length > 0) { //if peered with others print peer table\n console.log('\\t Which is peered with', peered)\n }\n }\n }\n}", "onReceive( packet)\n{\n let packet_view = new Uint8Array(packet);\n this.rxMsgArrayBuffer = appendArray(this.rxMsgArrayBuffer, packet_view);\n let view = new Uint8Array(this.rxMsgArrayBuffer);\n\n if (this.size_Of_request)\n {\n let data = new Uint8Array(this.size_Of_request);\n let offset = 0;\n for(let index = 0; index < view.byteLength; ++index)\n {\n switch(view[index])\n {\n case ESC:\n data[offset++] = this.xor_20(view[index]);\n break;\n\n case SOP:\n offset = 0;\n break;\n\n case EOP:\n break;\n\n default:\n data[offset++] = view[index];\n break;\n }\n }\n\n if (this.size_Of_request == offset)\n {\n //dumpArray(data);\n if (this.postCallback)\n this.postCallback(data);\n this.rxMsgArrayBuffer = new ArrayBuffer();\n\n }\n \n }\n}", "static outgoing(packet) {\n let length = packet.replace(/\\s/g, '').length;\n\n return `${length}{${packet}}`;\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n }", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!Validation(buf)) {\n this.error(new Error('invalid utf8 sequence'), 1007);\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "SOCKET_ONMESSAGE (state, message) {\n // console.log(message)\n state.socket.message = message\n }", "onDataReady() {\n switch (this.state) {\n case RPCServerState.InitHeader: {\n this.handleInitHeader();\n break;\n }\n case RPCServerState.InitHeaderKey: {\n this.handleInitHeaderKey();\n break;\n }\n case RPCServerState.ReceivePacketHeader: {\n this.currPacketHeader = this.readFromBuffer(8 /* I64 */);\n const reader = new ByteStreamReader(this.currPacketHeader);\n this.currPacketLength = reader.readU64();\n support_1.assert(this.pendingBytes == 0);\n this.requestBytes(this.currPacketLength);\n this.state = RPCServerState.ReceivePacketBody;\n break;\n }\n case RPCServerState.ReceivePacketBody: {\n const body = this.readFromBuffer(this.currPacketLength);\n support_1.assert(this.pendingBytes == 0);\n support_1.assert(this.currPacketHeader !== undefined);\n this.onPacketReady(this.currPacketHeader, body);\n break;\n }\n case RPCServerState.WaitForCallback: {\n support_1.assert(this.pendingBytes == 0);\n break;\n }\n default: {\n throw new Error(\"Cannot handle state \" + this.state);\n }\n }\n }", "function on_socket_get(message) {\"use strict\"; }", "_sendData() {\n\n }", "onReceivedInput(data, socket) {\n \n if (this.connectedPlayers[socket.id]) {\n this.connectedPlayers[socket.id].socket.lastHandledInput = data.messageIndex;\n }\n\n this.resetIdleTimeout(socket);\n\n this.queueInputForPlayer(data, socket.playerId);\n }", "function dataCallback(d) {\n\n//\tconsole.log(d);\n\n\tif (insidePacket === false && dataBuffer.length > 0 && dataBuffer[0] === 0x7e) {\n\t\tinsidePacket = true;\n\t}\n\n\t// We're not inside a packet and we're not looking at a packet\n\t// header, so something went wrong. Look for the 7e.\n\tif (insidePacket === false && d[0] != 0x7e) {\n\t\tvar startPosition = -1;\n\t\tfor (var i = 0; i < d.length; i++) {\n\t\t\tif (d[i] === 0x7e) {\n\t\t\t\tstartPosition = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If we found a 0x7e, then cut the packet so that's the\n\t\t// new start. If not, then just return from the callback,\n\t\t// because there's nothing we can do until the next\n\t\t// packet comes in.\n\t\tif (startPosition !== -1) {\n\t\t\td = d.slice(startPosition);\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// If we are at the beginning of a packet, then note that fact.\n\tif (d[0] === 0x7e) {\n\t\tinsidePacket = true;\n\t}\n\n\t// Count the number of characters that need to be escaped\n\tvar escapedCharacters = 0;\n\tfor (var i = 0; i < d.length; i++) {\n\t\tif (d[i] === 0x7D) {\n\t\t\tescapedCharacters++;\n\t\t}\n\t}\n\n\t// Create a new buffer to hold all of the data after the\n\t// characters have been escaped\n\tvar escapedData = Buffer.alloc(d.length - escapedCharacters);\n\tvar escapedIndex = 0;\n\n\t// Apply the escape-character logic to the incoming data\n\tfor (var i = 0; i < d.length; i++) {\n\t\tif (isEscape) {\n\t\t\tescapedData[escapedIndex] = d[i] ^ 0x20;\n\t\t\tescapedIndex++;\n\t\t\tisEscape = false;\n\t\t} else if (d[i] === 0x7D) {\n\t\t\tisEscape = true;\n\t\t} else {\n\t\t\tescapedData[escapedIndex] = d[i];\n\t\t\tescapedIndex++;\n\t\t}\n\t}\n\n\t// Add the escaped data to the data buffer\n\tdataBuffer = Buffer.concat([dataBuffer, escapedData]);\n\n\t// We need at least three bytes.\n\t// The first two bytes should always be 0x7e to denote\n\t// the start of a new packet. The third byte is the length.\n\t// Once we have the length we can grab the whole packet and\n\t// process it.\n\tif (dataBuffer.length >= 3) {\n\t\tvar length = dataBuffer[2] + 4;\n\t\t// We have the entire RF data (the length attribute)\n\t\t// and the 15 bytes of header data, so we can process\n\t\t// the packet.\n\t\tif (dataBuffer.length >= length) {\n\t\t\tvar dataPacket = dataBuffer.slice(0, length);\n\t\t\tdataBuffer = dataBuffer.slice(length);\n\t\t\tdataEmitter.emit(\"data\", dataPacket);\n\t\t\tinsidePacket = false;\n\t\t}\n\t}\n}", "dataMessage () {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n var data;\n\n if (this._binaryType === 'nodebuffer') {\n data = toBuffer(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(toBuffer(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.onmessage(data);\n } else {\n const buf = toBuffer(fragments, messageLength);\n\n if (!validation.isValidUTF8(buf)) {\n this.error(\n new Error('Invalid WebSocket frame: invalid UTF-8 sequence'),\n 1007\n );\n return;\n }\n\n this.onmessage(buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }", "function inPop(self, packet)\n{\n if(!Array.isArray(packet.js.pop) || packet.js.pop.length == 0) return warn(\"invalid pop of\", packet.js.pop, \"from\", packet.from);\n if(!dhash.isSHA1(packet.js.from)) return warn(\"invalid pop from of\", packet.js.from, \"from\", packet.from);\n\n packet.js.pop.forEach(function(address){\n var pop = seen(self, address);\n if(!pop.line) return warn(\"pop requested for\", address, \"but no line, from\", packet.from);\n var popping = {js:{popping:[packet.js.from, packet.from.ip, packet.from.port].join(',')}};\n send(self, pop, popping);\n });\n delete packet.js.pop;\n}", "function processPayload(socket, fBytes, handleText = undefined, handleBinary = undefined)\n{\n /* Attempt to parse the frame getting the frame's payload and then processing\n * that data from there */\n try \n {\n processFrameData(socket, fBytes, handleText, handleBinary);\n }\n catch (error)\n {\n // Close the socket connection \n socket.destroy({message: \"Incoming Frame Proccessing Error: \" + \n error.message});\n }\n}", "function inSock(self, packet, callback)\n{\n // TODO see if the requested ip:port is whitelisted\n var parts = packet.js.sock.split(\":\");\n var ip = parts[0];\n var port = parseInt(parts[1]);\n if(!(port > 0 && port < 65536))\n {\n packet.stream.send({end:true, err:\"invalid address\"});\n return callback();\n }\n\n // wrap it w/ a node stream\n var client = net.connect({host:ip, port:port});\n var tunnel = wrapStream(self, packet.stream);\n client.pipe(tunnel).pipe(client);\n client.on('error', function(err){\n packet.stream.errMsg = err.toString();\n });\n callback();\n}", "_readWebSocketPacket() {\n const sizeTagLength = 6;\n const minimumPacketLength = sizeTagLength + 9; // tag chars + 5 possibly single digit numbers + 4 spaces\n while (this._streamWebSocketBuffer.length >= minimumPacketLength) {\n // Occasionally there is noise in the WebSocket buffer\n // it really should start with 7-8 digits followed by a\n // space. Where the first 6 digits are the size of the\n // total message and the last digits of that first 7-8\n // are the FCType of the first Packet in the buffer\n // We'll clean it up by shifting the buffer until we\n // find that pattern\n while (!Client.webSocketNoiseFilter.test(this._streamWebSocketBuffer) && this._streamWebSocketBuffer.length > (minimumPacketLength * 10)) {\n // If this happens too often it likely represents a bug\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.WARNING, () => `WARNING: _readWebSocketPacket handling noise: '${this._streamWebSocketBuffer.slice(0, 30)}...'`);\n this._streamWebSocketBuffer = this._streamWebSocketBuffer.slice(1);\n }\n if (this._streamWebSocketBuffer.length < minimumPacketLength) {\n return;\n }\n const messageLength = parseInt(this._streamWebSocketBuffer.slice(0, sizeTagLength), 10);\n if (isNaN(messageLength)) {\n // If this packet is invalid we can possibly recover by continuing to shift\n // the buffer to the next packet. If that doesn't ever line up and work\n // we should still be able to recover eventually through silence timeouts.\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.WARNING, () => `WARNING: _readWebSocketPacket received invalid packet: '${this._streamWebSocketBuffer}'`);\n return;\n }\n if (this._streamWebSocketBuffer.length < messageLength) {\n return;\n }\n this._streamWebSocketBuffer = this._streamWebSocketBuffer.slice(sizeTagLength);\n let currentMessage = this._streamWebSocketBuffer.slice(0, messageLength);\n this._streamWebSocketBuffer = this._streamWebSocketBuffer.slice(messageLength);\n const countOfIntParams = 5;\n const intParamsLength = currentMessage.split(\" \", countOfIntParams).reduce((p, c) => p + c.length, 0) + countOfIntParams;\n const intParams = currentMessage.split(\" \", countOfIntParams).map(s => parseInt(s, 10));\n const [FCType, nFrom, nTo, nArg1, nArg2] = intParams;\n currentMessage = currentMessage.slice(intParamsLength);\n let sMessage;\n if (currentMessage.length > 0) {\n try {\n sMessage = JSON.parse(decodeURIComponent(currentMessage));\n }\n catch (e) {\n // Guess it wasn't a JSON blob. OK, just use it raw.\n sMessage = currentMessage;\n }\n }\n this._packetReceived(new Packet_1.Packet(FCType, nFrom, nTo, nArg1, nArg2, currentMessage.length, currentMessage.length === 0 ? undefined : sMessage));\n }\n }", "function socketReady() {\n SOCKET.send(\"R\");\n}", "emitEvent(packet) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n if (!this.working) {\n return;\n }\n // publish and store\n yield this.eventPubSub.publish(packet.event, packet);\n this.registry.addEventExample([packet.event], packet);\n // log\n this.props.logger[this.opts.log.event ? \"info\" : \"debug\"](`received ${kleur.green(packet.event)} ${packet.broadcast ? \"broadcast \" : \"\"}event from ${kleur.yellow(packet.from || \"unknown\")}`);\n });\n }", "send ( packet ) {\n let keyLen = ( this.key.get(this.info.user) != undefined)? this.key.get(this.info.user).length: -1;\n if ( keyLen == -1 ) {\n this.key.set({ object_id: this.info.user, value: []});\n this.send( packet );\n } else if ( keyLen >= 5 ) {\n this.key.pop({ object_id: this.info.user, num_items: keyLen - 4 });\n this.send( packet );\n } else {\n this.key.unshift({ object_id: this.info.user, value: packet });\n }\n }", "onReceivedInput(data, socket) {\n if (this.connectedPlayers[socket.id]) {\n this.connectedPlayers[socket.id].lastHandledInput = data.messageIndex;\n }\n this.gameEngine.emit('server__inputReceived', {\n input: data,\n playerId: socket.playerId\n });\n\n this.queueInputForPlayer(data, socket.playerId);\n }", "SOCKET_ONMESSAGE(state, message) {\n // console.log(message, \"msgg\")\n state.socket.message = message\n }", "function incoming(self, packet)\n{\n debug(\"INCOMING\", self.hashname, packet.id, \"packet from\", packet.from.address, packet.js, packet.body && packet.body.toString());\n\n // signed packets must be processed and verified straight away\n if(packet.js.sig) inSig(self, packet);\n\n // make sure any to is us (for multihosting)\n if(packet.js.to)\n {\n if(packet.js.to !== self.hashname) return warn(\"packet for\", packet.js.to, \"is not us\");\n delete packet.js.to;\n }\n\n // copy back their sender name if we don't have one yet for the \"to\" on answers\n if(!packet.from.hashname && dhash.isSHA1(packet.js.from)) packet.from.hashname = packet.js.from;\n\n // these are only valid when requested, no trust needed\n if(packet.js.popped) inPopped(self, packet);\n\n // new line creation\n if(packet.js.open) inOpen(self, packet);\n\n // incoming lines can happen out of order or before their open is verified, queue them\n if(packet.js.line)\n {\n // a matching line is required\n packet.line = packet.from = self.lines[packet.js.line];\n if(!packet.line) return queueLine(self, packet);\n packet.line.recvAt = Date.now();\n delete packet.js.line;\n }\n \n // must decrypt and start over\n if(packet.line && packet.js.cipher)\n {\n debug(\"deciphering!\")\n var aes = crypto.createDecipher(\"AES-128-CBC\", packet.line.openSecret);\n var deciphered = decode(Buffer.concat([aes.update(packet.body), aes.final()]));\n deciphered.id = packet.id + (packet.id * .2);\n deciphered.from = packet.from;\n deciphered.ciphered = true;\n return incoming(self, deciphered);\n }\n\n // any ref must be validated as someone we're connected to\n if(packet.js.ref)\n {\n var ref = seen(self, packet.js.ref);\n if(!ref.line) return warn(\"invalid ref of\", packet.js.ref, \"from\", packet.from);\n packet.ref = ref;\n delete packet.js.ref;\n }\n\n // process the who \"key\" responses since we know the sender best now\n if(packet.js.key) inKey(self, packet);\n\n // answer who/see here so we have the best from info to decide if we care\n if(packet.js.who) inWho(self, packet);\n if(packet.js.see) inSee(self, packet);\n\n // everything else must have some level of from trust!\n if(!packet.line && !packet.signed && !packet.ref) return inApp(self, packet);\n\n if(dhash.isSHA1(packet.js.seek)) inSeek(self, packet);\n if(packet.js.pop) inPop(self, packet);\n\n // now, only proceed if there's a line\n if(!packet.line) return inApp(self, packet);\n\n // these are line-only things\n if(packet.js.popping) inPopping(self, packet);\n\n // only proceed if there's a stream\n if(!packet.js.stream) return inApp(self, packet);\n\n // this makes sure everything is in sequence before continuing\n inStream(self, packet);\n\n}" ]
[ "0.7551261", "0.74785894", "0.74785894", "0.74785894", "0.74427253", "0.7349582", "0.73271525", "0.729503", "0.729503", "0.7290821", "0.72262466", "0.72262466", "0.71575254", "0.6818126", "0.67296445", "0.67188483", "0.66421485", "0.66095036", "0.63366735", "0.6272093", "0.6267358", "0.62280107", "0.6115904", "0.61074233", "0.6103235", "0.6097057", "0.60189885", "0.6014905", "0.6014905", "0.5998317", "0.5985295", "0.5966195", "0.5959156", "0.59582907", "0.5890628", "0.58621913", "0.58553845", "0.5849725", "0.58270836", "0.5802897", "0.57970196", "0.5795209", "0.5786976", "0.5694159", "0.5678987", "0.56728053", "0.56682795", "0.56523645", "0.5629612", "0.5617354", "0.5607736", "0.5589628", "0.5589628", "0.5589628", "0.5573317", "0.55717456", "0.556965", "0.55575037", "0.55519044", "0.5550026", "0.55456334", "0.5534651", "0.5531386", "0.55251235", "0.5523799", "0.5508462", "0.5501561", "0.54939544", "0.5492238", "0.548674", "0.5466269", "0.5459567", "0.5458118", "0.5455968", "0.54533064", "0.5453174", "0.5444953", "0.54386586", "0.54332733", "0.5424233", "0.5423446", "0.54097813", "0.540776", "0.5405912", "0.54039156", "0.5396008", "0.5381702", "0.5378592", "0.5376164", "0.5374451", "0.5367199", "0.53667545", "0.53639275", "0.53638256", "0.5362988", "0.5362581", "0.5360026", "0.5356942", "0.53564924", "0.5354967" ]
0.6698802
16
Called upon a server event.
onevent(packet) { const args = packet.data || []; debug("emitting event %j", args); if (null != packet.id) { debug("attaching ack callback to event"); args.push(this.ack(packet.id)); } if (this.connected) { this.emitEvent(args); } else { this.receiveBuffer.push(Object.freeze(args)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HttpSentEvent() { }", "function HttpSentEvent() { }", "function HttpSentEvent() { }", "ServerCallback() {\n\n }", "function handleServerRequest()\n{\n\t//send data to the div or html element for notifications\n}", "function onEvent(event){\n\n switch(event.type){\n\n case 'CONNECTED':\n log('Server connected!');\n prepareNewGame();\n break;\n\n case 'REGISTERED':\n log('Ready to play!');\n gameInfo = event.payload;\n renderer = MapRenderer(gameInfo.getGameSettings().getWidth(), gameInfo.getGameSettings().getHeight());\n client.startGame();\n break;\n\n case 'GAME_MAP_UPDATED':\n log('Game map updated - gameTick:' + event.payload.getGameTick());\n var snakeBrainDump = handleGameUpdate(event.payload);\n renderer.record(event.payload, snakeBrainDump);\n break;\n\n case 'GAME_SNAKE_DEAD':\n log('A snake died!');\n renderer.record(event.payload);\n break;\n\n case 'GAME_ENDED':\n log('Game ended!');\n renderer.record(event.payload);\n renderer.render(function(){process.exit()}, {followPid : gameInfo.getPlayerId()});\n //renderer.render(function(){process.exit()}, {animate: true, delay: 500, followPid : gameInfo.getPlayerId()});\n break;\n\n default:\n case 'ERROR':\n logError('Error - ' + event.payload);\n break;\n }\n}", "function HttpSentEvent() {}", "function HttpSentEvent() {}", "socket_customEventFromServer(_, payload) {\n console.log(\"customEventFromServer\", payload);\n }", "function sendServerEvent(client, serverEvent) {\n\tconsole.log(\"Sending from server\", serverEvent)\n\tclient.websocket.send(JSON.stringify(serverEvent));\n}", "function socketEvent(data){\n data = socketResponse(data);\n var Context = pageContext( null,null, null, data.param.route );\n tiny.pub(Context.page.eventDone, [ data, Context, data.param.route ] );\n }", "function HttpUserEvent() { }", "function HttpUserEvent() { }", "function HttpUserEvent() { }", "function onmessage(e) {\n\tconsole.log('Server: ' + e.data);\n}", "function onMessage(event) {\n\t\tconsole.log('Client socket: Message received: ' + event.data);\n\t\tcastEvent('onMessage', event);\n\t}", "function sendOnLoadEvent() {\n writeToServer(\"OnLoadEvent\", \"loaded\");\n}", "function sendOnLoadEvent() {\n writeToServer(\"OnLoadEvent\", \"loaded\");\n}", "function HttpUserEvent() {}", "function HttpUserEvent() {}", "function onevent(args) {\n console.log('connected')\n console.log(\"Event:\", args[0]);\n }", "function completeHandler(e) {\n console.log(\"received \" + e.responseCode + \" code\");\n var serverResponse = e.response;\n}", "function EventHandler(context, event) {\n if (!context.simpledb.botleveldata.numinstance)\n context.simpledb.botleveldata.numinstance = 0;\n numinstances = parseInt(context.simpledb.botleveldata.numinstance) + 1;\n context.simpledb.botleveldata.numinstance = numinstances;\n context.sendResponse(\"Hello \"+event.senderobj.display+\"\\r\\nI am Praxis & how can I help you?\\r\\n\\r\\nTo know more just reply with 'more info' or 'about praxis'\\r\\n\\r\\nOr simply visit this link:\\r\\nbit.ly/praxisbot\");\n}", "function receivedMessage(event) {\n messageHandler.handleMessage(event);\n }", "function callback(msg) {\n print(\"Server response - Msg -> \" + msg.data);\n print(\"\");\n var data = jQuery.parseJSON(msg.data);\n handle_event(data);\n}", "function incomingEvent(e) {\n trace(\"incomingEvent: \" + JSON.stringify(e));\n}", "function OnServerInitialized() {\n\n\tDebug.Log(\"Server initialized and ready\");\n}", "function onWebEventReceived(event) {\r\n\r\n // Converts the event to a JavaScript Object\r\n if (typeof event === \"string\") {\r\n event = JSON.parse(event);\r\n }\r\n\r\n // Make sure it's for us\r\n if (event.type == \"scripter.write\")\r\n onWriteEvent(event)\r\n\r\n }", "_eventHandler(message) {\n // push to web client\n this._io.emit('service:event:' + message.meta.event, message.payload)\n this._io.emit('_bson:service:event:' + message.meta.event,\n this._gateway._connector.encoder.pack(message.payload))\n }", "function handleServerMessage(e) {\n var i;\n for (i = 0; i < messageHandlers.length; i++) {\n if (messageHandlers[i](e)) {\n // messsage has been handled.. skipping other commands.\n return;\n }\n }\n }", "function onevent(args) {\n console.log(\"Event:\", args[0]);\n }", "function handleMessage(message_event) {\n appendToEventLog('nexe sez: ' + message_event.data);\n}", "function onMessageReceived(e) {\n console.log('message received');\n console.log(e);\n var msg = JSON.parse(e.data);\n console.log(msg.event);\n switch (msg.event) {\n case 'ready':\n onReady();\n break;\n case 'finish': \n onFinish();\n break;\n };\n }", "function flyatics_event(data){\n\tflybase.trigger( 'client-event', data );\n}", "function EventHandler(context, event) {\n\t if (!context.simpledb.roomleveldata.numinstance) {\n\t context.simpledb.roomleveldata.numinstance = 0;\n\t context.sendResponse(\"Hi, I'm MedBot! I'll help you keep track of your medications. Add a medication by typing in 'new med' followed by its name!\");\n\t }\n\t }", "function onevent(args) {\n console.log(\"Event:\", args[0]);\n }", "onEvent() {\n \n }", "handleEvent() {}", "handleEvent() {}", "receiveFromServer(ev) {\n if(process.env.NODE_ENV === 'development') {\n ev.should.be.an.instanceOf(_Server.Event);\n }\n this.sendToClient(ev);\n }", "function onError(event) {\n\t\tconsole.log('Client socket: Error occured, messsage: ' + event.data);\n\t\tcastEvent('onError', event);\n\t}", "onMessage(event) {\n try {\n const data = JSON.parse(event.data);\n // data.event is used to lookup which registered listener to call\n this.ee.emit(data.event, data);\n } catch (error) {\n this.ee.emit('error', error);\n }\n }", "function handleServerMessage(message) {\n\t\n\tconsole.log('handleServerMessage');\n\tconsole.log(message.data);\n\n\tmessage = message.data;\n\n\t// fix weird json encoding issues (http://stackoverflow.com/questions/9036429/convert-object-string-to-json)\n\t//message = $.parseJSON(JSON.stringify(eval('(' + message.data + ')')));\n\twhile (typeof message == 'string' && message.length > 0) {\n\t\tmessage = JSON.parse(message);\n\t}\n\n\t// get message type\n\tif (typeof message.type == 'undefined') {\n\t\tconsole.log('Missing message.type');\n\t\treturn;\n\t}\n\n\t// song update\n\tif (message.type == 'song_update') {\n\t\t// add song end timestamp\n\t\tif (songEndTimestamp != 0) {\n\t\t\tsongEndTimestamps.push(songEndTimestamp);\n\t\t\tsongEndTimestamp = 0;\n\t\t}\n\n\t\tconsole.log('newSongTimestamps: ' + newSongTimestamps);\n\t\tconsole.log('songBeginTimestamps: ' + songBeginTimestamps);\n\t\tconsole.log('songEndTimestamps: ' + songEndTimestamps);\n\n\t\tnewSongTimestamps.push(new Date().getTime());\n\t\tsongUpdate(message.curSongKey, message.play, message.endFlag, message.timestamp, message.hostEmail, false);\n\t}\n\t// session update\n\telse if (message.type == 'session_update') {\n\t\tupdateListeners(message.hostEmail, message.listeners);\n\t\tupdateListenerList();\n\n\t\t//updateSessions\n\n\t\t// check if we need to add a song\n\t\tif (songs.length == 0) {\n\n\t\t\t// hosting\n\t\t\tif (typeof message.curSongIdx != 'undefined' && message.hostEmail && message.hostEmail == server_me_email) {\n\t\t\t\tconsole.log('join existing hosted session with index ' + message.curSongIdx);\n\t\t\t\thostingIndex = message.curSongIdx\n\n\t\t\t\t// enable buttons\n\t\t\t\t$('#pause_button').removeAttr('disabled');\n\t\t\t\t$('#play_button').removeAttr('disabled');\n\t\t\t\t$('#next_button').removeAttr('disabled');\n\n\t\t\t\tsongUpdate(message.curSongKey, message.play, message.endFlag, message.timestamp, message.hostEmail, true);\n\t\t\t}\n\t\t\t// listening\n\t\t\telse {\n\t\t\t\tsongUpdate(message.curSongKey, message.play, message.endFlag, message.timestamp, message.hostEmail, false);\n\t\t\t}\n\t\t}\n\t}\n\t// new song added\n\telse if (message.type == 'song_upload') {\n\t\t// add newly uploaded song, play if hosting (for initial upload)\n\t\tif (message.newSongKey) {\n\t\t\taddSong(message.newSongKey, 0, hostingIndex != -1 && songs.length == 0, false);\n\n\t\t\t// update listeners if we are host and we are playing this song\n\t\t\tif (hostingIndex != 0 && songs.length == 1) {\n\t\t\t\tupdateChannel(1, 0, 0);\n\t\t\t}\n\t\t}\n\t}\n\telse if (message.type == 'open_page') {\n\t\t// TODO\n\t}\n}", "sendCustomEventToServer(_, payload) {\n this._vm.$socket.client.emit(\"customEventFromClient\", payload);\n }", "function handleEvent(event) {\n\n }", "static listenSocketEvents() {\n Socket.shared.on(\"wallet:updated\", (data) => {\n let logger = Logger.create(\"wallet:updated\");\n logger.info(\"enter\", data);\n\n Redux.dispatch(Wallet.actions.walletUpdatedEvent(data));\n });\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "function eventHandler(message){\n bdayHandler(message);\n}", "function eventHandler(event) {\n\t\t//alert(\"inside login event handler: \" + event.type);\n\t\tif (event.type == AppConstants.Event.APP_SCHEDULE_PAGE_FILL_DATA) {\n\n\t\t} else if (event.type == AppConstants.Event.APP_SCHEDULE_PAGE_BIND_EVENTS) {\n\t\t\tshowCalendar();\n\t\t\t// loadCalendar();\n\t\t} else if (event.type == AppConstants.Event.APP_SCHEDULE_PAGE_RESPONSE) {\n\n\t\t} else if (event.type == AppConstants.Event.APP_SCHEDULE_PAGE_ERROR) {\n\n\t\t}\n\t}", "function onWebAppEventReceived(event) {\n var eventJSON = JSON.parse(event);\n if (eventJSON.app === \"inventory\") { // This is our web app!\n // print(\"inventory.js received a web event: \" + event);\n \n if (eventJSON.command === \"ready\") {\n initializeInventoryApp();\n }\n \n if (eventJSON.command === \"web-to-script-inventory\") {\n receiveInventory(eventJSON.data);\n }\n \n if (eventJSON.command === \"web-to-script-settings\") {\n receiveSettings(eventJSON.data);\n }\n \n if (eventJSON.command === \"use-item\") {\n useItem(eventJSON.data);\n }\n \n if (eventJSON.command === \"share-item\") {\n shareItem(eventJSON.data);\n }\n \n if (eventJSON.command === \"web-to-script-request-nearby-users\") {\n sendNearbyUsers();\n }\n \n if (eventJSON.command === \"web-to-script-request-receiving-item-queue\") {\n sendReceivingItemQueue();\n }\n \n if (eventJSON.command === \"web-to-script-update-receiving-item-queue\") {\n updateReceivingItemQueue(eventJSON.data);\n }\n \n }\n }", "function onSocketMessage(event) {\r\n\tappendContent(\"theMessages\", \"Received: \" + event.data + \"<br/>\");\r\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 }", "on(event, cb) {\n this.conn.on(event, cb);\n }", "function handleClientEvents(socket) {\n socket.on(\"start\", function(data) {\n processStart(socket, data);\n });\n\n socket.on(\"stop\", function(data) {\n processStop(socket, data);\n });\n}", "function handleEventResponse(rsp) {\n loadComplete();\n if (rsp.events && rsp.events.length > 0) {\n bg.storage.events = JSON.stringify(rsp.events);\n addEvents(rsp.events);\n $scope.nextEvent();\n }\n }", "function onData(event) {\n\t\tif(event.getSubject() != '/pushlet/ping') {\n\t\t\tif(event.getSubject() == 'system_online') {\n\t\t\t\tsystemOnline(event);\n\t\t\t} else {\n\t\t\t\tif(event.getSubject() == 'system_logout') {\n\t\t\t\t\tsystemLogout(event);\n\t\t\t\t} else {\n\t\t\t\t\tif(event.getSubject() == 'system_chat') {\n\t\t\t\t\t\tsystemChat(event);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(event.getSubject() == 'system_notice') {\n\t\t\t\t\t\t\tsystemNotice(event);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(globalDataPower.noticeTypeCode[event.getSubject()]['point']) {\n\t\t\t\t\t\t\t\teval(globalDataPower.noticeTypeCode[event.getSubject()]['point'] + \".call(window, event)\");\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}", "function messageListener(event) {\r\n //console.log(event.data);\r\n }", "function onMessageReceived(e) {\n var data = JSON.parse(e.data);\n \n switch (data.event) {\n case 'ready':\n onReady();\n break;\n \n case 'playProgress':\n onPlayProgress(data.data);\n break;\n \n case 'finish':\n onFinish();\n break;\n }\n \t}", "function EventHandler(context, event) {\n context.simpledb.roomleveldata.state=\"phone number\"; \n context.sendResponse(\"Hi, I am your TestMinister Bot. The most simple yet powerful way to take tests and learn. You can take tests by choosing from a large test library and I will give you scorecards for tracking and benchmarking\\n\\nPlease provide your phone number to begin\");\n}", "function handleMessage(event) {\r\n\t\t//console.log('Received message: ' + event.data);\r\n\t\tvar data = JSON.parse(event.data);\r\n\t\thandleReceiveData(data);\r\n\t}", "onMessage() {}", "onMessage() {}", "function sliderChange(e) {\n socket.emit('data request', dataRequestPayload());\n}", "function onMessageReceived(e) {\n var data = JSON.parse(e.data);\n\n switch (data.event) {\n case 'ready':\n onReady();\n break;\n\n case 'playProgress':\n onPlayProgress(data.data);\n break;\n\n case 'pause':\n onPause();\n break;\n\n case 'finish':\n onFinish();\n break;\n }\n }", "function onMessage(evt) {\n\t\t// Update the marks on the map\n\t\tvar data = JSON.parse(evt);\n\t\tswitch(data.type) {\n\t\t\tcase 'location':\n\t\t\t\t//noty({text: 'Incoming: New coordinates for geolocations.'});\n\t\t\t\tif (controller == \"Geolocations\") {\n\t\t\t\t\tupdateMarkers(data);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'update':\n\t\t\t\tif (data.section == \"events\") {\n\t\t\t\t\tnoty({text: 'Your event '+data.title+\" has been updated!\", type: 'information'});\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'history':\n\t\t\t\tincomingChatMessage(data);\n\t\t\t\tbreak;\n\n\t\t\tcase 'message':\n\t\t\t\tincomingChatMessage(data);\n\t\t\t\tbreak;\n\t\t}\n\t}", "onRequest(cmd, message) {\n\t\tRouter.listenForBack(cmd, message);\n\t\tif (cmd === \"setSiteInfo\") {\n\t\t\tthis.siteInfo = message.params;\n\t\t\tapp.siteInfo = message.params;\n\t\t\tapp.getUserInfo();\n\t\t}\n\n\t\tif (message.params.event[0] === \"file_done\") {\n\t\t\tapp.$emit(\"update\");\n\t\t}\n\t}", "function EventHandler(context, event) {\n\t if(! context.simpledb.botleveldata.numinstance)\n\t context.simpledb.botleveldata.numinstance = 0;\n\t numinstances = parseInt(context.simpledb.botleveldata.numinstance) + 1;\n\t context.simpledb.botleveldata.numinstance = numinstances;\n\t context.sendResponse(\"Thanks for adding me. You are:\" + numinstances);\n\t }", "function OnBtnServerSynch_Click( e )\r\n{\r\n OnBtnServerSynch() ;\r\n}", "function handler (request, response) {\n\n\trequest.addListener('end', function () {\n fileServer.serve(request, response);\n });\n}", "function receivedMessageFromServer(e) {\n // extract the ID from the received packet\n const q = JSON.parse(e.data);\n\n ctx.beginPath();\n ctx.arc(q.x * 10, q.y * 10, 10, 0, TAU);\n ctx.closePath();\n ctx.fillStyle = q.col;\n ctx.fill();\n}", "_onResponse(msg) {\n let _this = this;\n\n let event = {\n type: msg.type,\n url: msg.body.source,\n code: msg.body.code\n };\n\n if (_this._onResponseHandler) {\n _this._onResponseHandler(event);\n }\n }", "function readyStateRecieved(eventHandler)\n{\n if (xhrObj.readyState == 4 && xhrObj.status == 200) //!< XHR has data loaded and server says OK\n {\n xhrResponse = xhrObj.responseText; //!< Response text recieved; store as response\n eventHandler(); //!< Execute the event handler\n }\n}", "run () {\n this._client.on('messageCreate', this.onMessageCreateEvent.bind(this))\n this._client.on('messageReactionAdd', this.onMessageReactionEvent.bind(this))\n this._client.on('messageReactionRemove', this.onMessageReactionEvent.bind(this))\n }", "function serverMessage(data) {\n\tlet t = data.messageType, m = data.siteMeta;\n\tdelete data.siteMeta; // siteMeta is handled here, avoid passing it to game\n\tif (m) {\n\t\tif (m.refresh) refresh(m.refresh);\n\t}\n\tif (!t) return;\n\telse if (t == \"LOAD\") sendGame(data);\n\telse if (t == \"ERROR\") sendGame(data); // Errors are displayed by game\n\telse if (t == \"REFRESH\") refresh(data.element); // Refresh a named element on page\n\telse console.log(\"Unknown response message ignored\", data);\n}", "function syncWithServer(){\n\tvar route = '/getSync';\n\tvar event_data = '';\n\t//gets the stored event queue on the client\n\tlocal_events = get_local_events();\n\tif(local_events == null){\n\t\t//if the event queue is null create a new one\n\t\tevent_data = JSON.stringify(newEventQueue());\t\n\t}\n\telse{\n\t\t//stringify the event queue for sending\n\t\tvar event_data = JSON.stringify(local_events);\n\t}\t\n\t//emit the event queue to our listening socket server\n\tsocket.emit(route, event_data );\n}", "function onListening() {\n\tdebug('Listening on port ' + server.address().port);\n}", "function onMessageReceived(event){\n\t\ttry{\n\t\t\tvar message = event.data;\n\t\t\tvar json = JSON.parse(message);\n\t\t\t\n\t\t\tif(json.errorMessage){\n\t\t\t\tconsole.log(\"Error message received from server (control unit), error message was: \" + json.errorMessage);\n\t\t\t}else if(json.propertyName && json.propertyValue !== undefined){\n\t\t\t\tsetPropertyValue(json.propertyName, json.propertyValue);\n\t\t\t}else if(json.methodName && json.methodParameters){\n\t\t\t\tcallMethod(json.methodName, json.methodParameters);\n\t\t\t}else{\n\t\t\t\tconsole.log(\"Invalid incoming data from server, expected data to contain propertyName and propertyValue\");\n\t\t\t}\n\t\t}catch(e){\n\t\t\tconsole.log(\"onMessageReceived, Exception occured with message: \" + e.message);\n\t\t\tconsole.log(e.stack);\n\t\t}\n\t}", "function logEventInServer(videoId) {\n\n const jsonData = prepareEventData(videoId);\n\n $.ajax({\n type: \"POST\",\n url: SERVER_URL,\n dataType: 'json',\n data: { viewChanged: JSON.stringify(jsonData) },\n success: (response) => {\n console.log(\"SUCCESS\");\n },\n error: (err) => {\n console.log(\"Failed \", err);\n }\n }).done((msg) => {\n console.log(\"Data Saved: \", msg);\n });\n }", "function requestListener(serverRequest, serverResponse)\n{\n var postedData = \"\";\n\n serverRequest.setEncoding(\"utf8\");\n\n // as we receive data append it to a variable within this closure\n serverRequest.addListener(\"data\", function(postDataChunk) {\n postedData += postDataChunk;\n console.log(\"Received POST data chunk '\"+ postDataChunk + \"'.\");\n });\n\n // when an end is received all the posted data has been collected, the request is ready to be handled\n serverRequest.addListener(\"end\", function() {\n router(serverRequest, serverResponse, postedData);\n });\n}", "handleEvents() {\n }", "messageHandler(self, e) {\n let msg = ( (e.data).match(/^[0-9]+(\\[.+)$/) || [] )[1];\n if( msg != null ) {\n let msg_parsed = JSON.parse(msg);\n let [r, data] = msg_parsed;\n self.socketEventList.forEach(e=>e.run(self, msg_parsed))\n }\n }", "function processEvent(data){\n\n var resp = {action: data.action, status:\"success\", msg:null };\n try{\n // resp.action = data.action;\n if(data.action === 'init'){\n if (obj.onInit) obj.onInit(data);\n running = true;\n }else if (data.action === 'die'){\n if(obj.onDie) obj.onDie(data);\n running=false; // to ensure this is ignored by sigint listener\n process.exit(0);\n }else {\n // console.log(data);\n resp.data = obj.onMessage(data.data);\n // console.log(resp);\n } \n }catch(err){\n if(obj.onError) obj.onError(err);\n // throw err;\n // resp.action = data.action;\n resp.status = \"failure\";\n resp.data= {request: data.data, error:err };\n }\n process.send(resp); //by default all message are replied to\n }", "function onScriptEventReceived(scriptEvent) {\r\n try {\r\n scriptEvent = JSON.parse(scriptEvent);\r\n } catch (error) {\r\n console.log(\"ERROR parsing scriptEvent: \" + error);\r\n return;\r\n }\r\n\r\n if (scriptEvent.app !== \"multiConVote\") {\r\n return;\r\n }\r\n\r\n \r\n switch (scriptEvent.method) {\r\n case \"initializeUI\":\r\n initializeUI(scriptEvent.myUsername, scriptEvent.voteData);\r\n selectTab(scriptEvent.activeTabName);\r\n break;\r\n\r\n case \"voteError\":\r\n voteError(scriptEvent.errorText);\r\n break;\r\n\r\n case \"voteSuccess\":\r\n voteSuccess(scriptEvent.usernameVotedFor);\r\n break;\r\n\r\n default:\r\n console.log(\"Unknown message from multiConApp_app.js: \" + JSON.stringify(scriptEvent));\r\n break;\r\n }\r\n}", "function handleListen() {\n console.log(\"Listening\");\n }", "function handleListen() {\n console.log(\"Listening\");\n }", "function emitEvent() {\n socket.emit(\"publish-large-message\", \"message-sent\");\n}", "_bindEventHandlers(){\n if ( this._server !== null ){\n // TODO\n }\n }", "function FsEventsHandler() {}", "function receivedPostback(event) {\n messageHandler.receivedPostback(event);\n }", "function eventsHandler(req, res, next) {\n // Mandatory headers and http status to keep connection open\n const headers = {\n 'Content-Type': 'text/event-stream',\n 'Connection': 'keep-alive',\n 'Cache-Control': 'no-cache'\n };\n res.writeHead(200, headers);\n\n // After client opens connection send current state as string\n const data = `data: ${JSON.stringify(state)}\\n\\n`;\n res.write(data);\n\n // Generate an id based on timestamp and save res\n // object of client connection on clients list\n // Later we'll iterate it and send updates to each client\n const clientId = Date.now();\n const newClient = {\n id: clientId,\n res\n };\n console.log(`${clientId} Connection opened`);\n // console.log(req);\n clients.push(newClient);\n\n // When client closes connection we update the clients list\n // avoiding the disconnected one\n req.on('close', () => {\n console.log(`${clientId} Connection closed`);\n clients = clients.filter(c => c.id !== clientId);\n });\n}", "function EventHandler(context, event) {\r\n if(! context.simpledb.botleveldata.numinstance)\r\n context.simpledb.botleveldata.numinstance = 0;\r\n numinstances = parseInt(context.simpledb.botleveldata.numinstance) + 1;\r\n context.simpledb.botleveldata.numinstance = numinstances;\r\n context.sendResponse(\"Thanks for adding me. You are:\" + numinstances);\r\n \r\n \r\n}", "networkQueryOffersCollected() {\n this.socket.emit('networkQueryOffersCollected');\n }", "function receiveMessage(event){\n if(event.data.messageType==\"ERROR\"){\n alert(event.data.info);\n }else{\n loadState(event.data.gameState);\n alert(\"Game loaded!\");\n }\n \n }", "connected() {\n event();\n }", "function handler (request, response) {\n request.addListener('end', function () {\n fileServer.serve(request, response);\n });\n}", "function sendServerUpdate() {\r\n myTurn = game.turn == localStorage.userID;\r\n if(myTurn) {\r\n if(game.playerMoved()) {\r\n myPos = game.getPlayerPos();\r\n myDir = game.getPlayerDir();\r\n game.resetLastMoved();\r\n socket.emit(\"gameEvent\", {eventType: \"playerMove\",\r\n newPos: myPos,\r\n newDir: myDir});\r\n }\r\n else if (game.getPlayerShot()) {\r\n socket.emit(\"gameEvent\", {eventType: \"playerFire\"});\r\n }\r\n }\r\n}", "function onPostSuccess(data,status)\n {\n\t\t\tconsole.log(\"Server status (POST): \" + status);\n }", "function onMessage(event) {\n\n\t\tvar msg = JSON.parse(event.data);\n\n\t\tswitch(msg.type) {\n\n\t\tcase 'chat':\n\t\t\tdisplayChatMessage(event);\n\t\t\tbreak;\n\n\t\tcase 'attendeeCount':\n\t\t\tdisplayAttendeeCount(event);\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'kudosCount':\n\t\t\tdisplayKudosCount(event);\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'fanCount':\n\t\t\tdisplayFanCount(event);\n\t\t\tbreak;\n\n\t\t}\n\t}", "function receiveDataChannelMessage(event) {\n emitter.emit('clientEvent', JSON.parse(event.data));\n}" ]
[ "0.7054478", "0.7054478", "0.7054478", "0.6991791", "0.69816613", "0.69636124", "0.69308937", "0.69308937", "0.68481964", "0.65922594", "0.659124", "0.6563248", "0.6563248", "0.6563248", "0.64499706", "0.6417641", "0.63800436", "0.63800436", "0.63251776", "0.63251776", "0.62857926", "0.62760895", "0.62734246", "0.62607145", "0.6214894", "0.6187071", "0.61801875", "0.61760503", "0.6161107", "0.61501896", "0.6141648", "0.60926133", "0.6087754", "0.6081897", "0.60752636", "0.607149", "0.6059289", "0.60526395", "0.60526395", "0.60335004", "0.6030351", "0.60221493", "0.60096663", "0.59876347", "0.5981546", "0.5962773", "0.59619856", "0.59619856", "0.59619856", "0.59592205", "0.5952646", "0.59462965", "0.5944548", "0.5941381", "0.591911", "0.5914474", "0.58995354", "0.58971226", "0.58970237", "0.58872116", "0.5884041", "0.58838457", "0.5873504", "0.5873504", "0.5848653", "0.5842278", "0.58421475", "0.5838852", "0.5836686", "0.5811473", "0.58057326", "0.58020604", "0.57936406", "0.5789511", "0.57889354", "0.577467", "0.5761597", "0.5760482", "0.57600373", "0.57482374", "0.5746903", "0.57456", "0.57411367", "0.57410425", "0.57402885", "0.57338876", "0.57338876", "0.5733579", "0.57288057", "0.5727228", "0.5707693", "0.57041883", "0.57025486", "0.5694563", "0.56926", "0.569094", "0.5682062", "0.5679896", "0.56774235", "0.56722075", "0.56587195" ]
0.0
-1
Produces an ack callback to emit with an event.
ack(id) { const self = this; let sent = false; return function (...args) { // prevent double callbacks if (sent) return; sent = true; debug("sending ack %j", args); self.packet({ type: socket_io_parser_1.PacketType.ACK, id: id, data: args }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n debug(\"sending ack %j\", args);\n self.packet({\n type: socket_io_parser_1.PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }", "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n debug(\"sending ack %j\", args);\n self.packet({\n type: socket_io_parser_1.PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }", "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n debug(\"sending ack %j\", args);\n self.packet({\n type: dist.PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n } else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "function ack($var) {\n\t\treturn new ackExpose($var);\n\t}", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n self.packet({\n type: PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n\n if (this.connected) {\n this.emitEvent(args);\n } else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "function callback (responseText) {\n let response = JSON.parse(responseText);\n const ackIds = {\"ackIds\": []};\n if (response.receivedMessages) {\n const messages = response.receivedMessages;\n if (messages.length > 0) {\n for (let i = 0; i < messages.length; i++) {\n let payloadRaw = atob(messages[i].message.data).toString();\n let payloadString = JSON.stringify(JSON.parse(payloadRaw));\n pushLog(LogType.EVENT, \"Event Received\", payloadString);\n ackIds.ackIds.push(messages[i].ackId);\n }\n }\n }\n // Acknowledge messages:\n if (ackIds.ackIds.length > 0) {\n ack(token, ackIds);\n }\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false; // event ack callback\n\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n\n const isTransportWritable = this.io.engine && this.io.engine.transport && this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n } else if (this.connected) {\n this.packet(packet);\n } else {\n this.sendBuffer.push(packet);\n }\n\n this.flags = {};\n return this;\n }", "function ack(token, ackIds) {\n // Construct url for pubsub ack:\n const url = buildSubscriptionUrl() + \":acknowledge\";\n\n // Callback function for pubsub ack:\n function callback (responseText) {\n console.log('ack callback', JSON.stringify(JSON.parse(responseText)));\n }\n\n // Issue pubsub ack:\n postRequest(url, ackIds, callback, token);\n}", "subscribeAck(message, callback) {\n let timeoutId\n let onAck = () => {\n log('delivered %s', message.type, message)\n clearTimeout(timeoutId)\n callback()\n }\n this.in.once(`ack:${message.id}`, onAck)\n timeoutId = setTimeout(() => {\n log('message timeout', message)\n this.in.off(`ack:${message.id}`, onAck)\n callback(new Error('Delivery timeout.'))\n }, this.options.ackTimeout)\n }", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: dist.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n const id = this.ids++;\n debug(\"emitting packet with ack id %d\", id);\n const ack = args.pop();\n this._registerAckCallback(id, ack);\n packet.id = id;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "function handleActionAckMessage(macAddress, payload) {\n\treturn Outlet.find({mac_address: macAddress}).exec()\n\t\t.then( outlets => {\n\t\t\tif (outlets.length == 0) {\n\t throw new Error(`Outlet does not exist for MAC Address: ${macAddress}`);\n\t }\n\t var outlet = outlets[0];\n\n\t // Toggle outlet status.\n\t outlet.status = (outlet.status == 'ON') ? 'OFF' : 'ON';\n\t return outlet.save();\n\t\t}).catch(console.error);\n}", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "function ack() {\n Twibble.sendMessage();\n }", "function AckCallRequest() {}", "function receiveAcknowledgeMessage(e) {\n\t\tconsole.log(\"receiveAcknowledgeMessage\");\n\t\tconsole.log(e);\n\t\t// Update the div element to display the message.\n\t\tvar ackDiv = document.getElementById('ack');\n\t\tackDiv.innerHTML = e.data;\n\t}", "serializeAck (requestId, protocolData) {\n return serialize({\n type: TYPE_ACK,\n requestId,\n data: protocolData\n }, BTP_VERSION_ALPHA)\n }", "function onHelloAck() {\n disconnected.value = false;\n self.disconnected = disconnected.value;\n $log.log('(Hello:ack) monitor is connected');\n }", "onevent(packet) {\n const args = packet.data || [];\n if (null != packet.id) {\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "call(event, ...payload) {\n debug('Triggering callback \"%s\" with payload: %o', event, payload);\n\n const fn = this.coreSyncedAnswerers.get(event);\n\n if (!fn) {\n throw kerror.get(\n \"core\",\n \"fatal\",\n \"assertion_failed\",\n `the requested callback event '${event}' doesn't have an answerer`\n );\n }\n\n const response = fn(...payload);\n\n getWildcardEvents(event).forEach((ev) =>\n super.emit(ev, {\n args: payload,\n response,\n })\n );\n\n return response;\n }", "async waitAck()\n {\n // Read the ack byte\n let ack = await this.readWait(1);\n\n // If not an ack, read to eol for an error message\n if (ack[0] != 6)\n {\n let err = await this.readToEOL();\n throw new Error(`No ack - ${err}`);\n }\n }", "function on (event, cb) {\n emitter.on(event, cb)\n }", "function on (event, cb) {\n emitter.on(event, cb)\n }", "function on (event, cb) {\n emitter.on(event, cb)\n }", "function callback (responseText) {\n console.log('ack callback', JSON.stringify(JSON.parse(responseText)));\n }", "function ackDate(date) {\n this.date = ackDate.toDate(date);\n return this;\n }", "function ack(m,n){\n if (m==0) { return n+1; }\n if (n==0) { return ack(m-1,1); }\n return ack(m-1, ack(m,n-1) );\n}", "function ack(m,n){\n if (m==0) { return n+1; }\n if (n==0) { return ack(m-1,1); }\n return ack(m-1, ack(m,n-1) );\n}", "ack(message) {\r\n if (!this.isAutoAcknowledged()) {\r\n this.queue().ack(message);\r\n }\r\n }", "on(event, callback) {\n const id = this._seq();\n this._subscribers.push({id, event, callback});\n return {\n unsubscribe: this._unsubscribe.bind(this)\n };\n }", "function createEventEmitterCallback(event, emitter) {\n return function (ex) {\n if (ex) {\n emitter.emit('error', ex);\n } else {\n var args = Array.prototype.slice.call(arguments);\n args[0] = event;\n emitter.emit.apply(emitter, args);\n if (event == 'end') {\n emitter.removeAllListeners();\n }\n }\n };\n}", "onOpenInterestEvent(fn) {\n\n this.eventEmitter.on(settings.socket.openInterestEvent, (data) => {\n\n fn(data);\n\n });\n }", "function ack(m, n) {\n if (m === 0) {\n return n + 1;\n } else if (m > 0 && n === 0) {\n return ack(m - 1, 1);\n } else if (m > 0 && n > 0) {\n return ack(m - 1, ack(m, n - 1));\n }\n}", "function ack_alert(id,mid){\n\t// remove field\n\t$(\"#alert_\"+mid+\"_\"+id).fadeOut(600, function() { $(this).remove(); });\n\n\t// decrement nr\n\tvar button=$(\"#\"+mid+\"_toggle_alarms\");\n\tvar open_alarms=parseInt(button.text().substring(0,button.text().indexOf(\" \")))-1;\n\tvar txt=$(\"#\"+mid+\"_toggle_alarms_text\");\n\tvar counter=$(\"#\"+mid+\"_alarm_counter\");\n\tset_alert_button_state(counter,button,txt,open_alarms);\n\n\tvar cmd_data = { \"cmd\":\"ack_alert\", \"mid\":mid, \"aid\":id};\n\t//console.log(JSON.stringify(cmd_data));\n\tcon.send(JSON.stringify(cmd_data)); \t\t\n}", "acceptTextChangeAcknowledge(message, eventId) {\n if (this.diagnosticTrace) {\n coeditingUtils_1.logger.log(`acceptTextChangeAcknowledge`);\n coeditingUtils_1.logger.indent();\n }\n try {\n coeditingUtils_1.assert(message.clientId === this.host.clientID, 'Changes must a change we initiated');\n if (message.clientId !== this.host.clientID) {\n return;\n }\n // Our unacknowledged change got acknowledged: delete the 1st unacknowledged change.\n let unacknowledgedChange = this.unacknowledgedChanges[0];\n this.unacknowledgedChanges.splice(0, 1);\n this.transformManager.AddToServersionHistory(eventId, unacknowledgedChange.message, null);\n }\n finally {\n if (this.diagnosticTrace) {\n coeditingUtils_1.logger.unindent();\n }\n }\n }", "function emitEvent(fn) {\n if (typeof fn != 'function') return\n\n var args = [].slice.call(arguments, 1)\n return fn.apply(null, args)\n}", "function serializeSubscribeAcks( v, acks ) {\n for (var i = 0; i < acks.length; i++) {\n var ack = acks[i];\n if (ack >= 0 && ack <= 2) {\n // ok result with QoS\n v.append1(ack);\n } else if (ack >= 0x80 && ack <= 0xff) {\n // error code\n v.append1(ack);\n } else {\n throw \"Subscribe ack outside 0..2 and 0x80..0xff\";\n }\n }\n}", "function addForgettableCallback (event, callback, listenerId) {\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback\n\n var safeCallback = protectedCallback(callback)\n\n event.on(function () {\n var discard = false\n\n oboeApi.forget = function () {\n discard = true\n }\n\n Object(__WEBPACK_IMPORTED_MODULE_1__functional__[\"b\" /* apply */])(arguments, safeCallback)\n\n delete oboeApi.forget\n\n if (discard) {\n event.un(listenerId)\n }\n }, listenerId)\n\n return oboeApi // chaining\n }", "function sendBinaryAck(aWs, aMessage) {\n console.log('Send binary ack');\n // let's send the message text as binary\n var buffer = Buffer.from(aMessage);\n aWs.send(buffer);\n}", "emitEvent(event) {\n this.eventBus.emit(event);\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "async onConsume(ags) {\n const consumeEventNames = this.consumeEmitter.eventNames();\n\n if(consumeEventNames.indexOf('consume') > -1) {\n return;\n }\n\n this.consumeEmitter.on('consume', async () => {\n return await this.channel.consume(ags[0], async (msg) => { \n await ags[1](msg.content.toString(), ags[0]);\n if(ags[2] && !ags[2].noAck) {\n await this.channel.ack(msg);\n }\n }, ags[2]);\n })\n\n return this.consumeEmitter.emit('consume');\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }", "on(eventName, eventHandler) {\n return this._chosenConsumer.on(eventName, eventHandler);\n }", "function eventCallback (event) {\n\t\tvar arrResetEvents = ['vast.adError', 'vast.adsCancel', 'vast.adSkip', 'vast.reset',\n\t\t\t\t\t\t\t 'vast.contentEnd', 'adFinished'];\n\t\tvar isResetEvent = function (name) {\n\t\t\tfor (var i = 0; i < arrResetEvents.length; i++) {\n\t\t\t\tif (arrResetEvents[i] === name) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\tvar name = event.type;\n\t\tif (name === 'vast.adStart') {\n\t\t\t_adIndicator.style.display = 'block';\n\t\t\t_adPlaying = true;\n\t\t\tshowCover(false);\n\t\t}\n\t\telse if (name === 'trace.message') {\n\t\t\ttraceMessage(event);\n\t\t}\n\t\telse if (name === 'trace.event') {\n\t\t\ttraceEvent(event);\n\t\t}\n\t\telse if (isResetEvent(name)) {\n\t\t\tif (_pageNotificationCallback) {\n\t\t\t\t_pageNotificationCallback('message', 'renderer event name - ' + name);\n\t\t\t}\n\t\t\tresetContent();\n\t\t}\n\t\telse if (name === 'internal') {\n\t\t\tvar internalName = event.data.name;\n\t\t\tif (internalName === 'cover') {\n\t\t\t\tshowCover(event.data.cover);\n\t\t\t}\n\t\t\telse if (internalName === 'resetContent') {\n\t\t\t\tresetContent();\n\t\t\t}\n\t\t}\n\t}", "emit(ev, ...args) {\r\n if (socket_1.RESERVED_EVENTS.has(ev)) {\r\n throw new Error(`\"${ev}\" is a reserved event name`);\r\n }\r\n // set up packet object\r\n const data = [ev, ...args];\r\n const packet = {\r\n type: socket_io_parser_1.PacketType.EVENT,\r\n data: data,\r\n };\r\n if (\"function\" == typeof data[data.length - 1]) {\r\n throw new Error(\"Callbacks are not supported when broadcasting\");\r\n }\r\n this.adapter.broadcast(packet, {\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n flags: this.flags,\r\n });\r\n return true;\r\n }", "h(eventName) {\n return this.emit.bind(this, eventName);\n }", "function Emit(event) {\n\t\t\t\treturn function (target, key, descriptor) {\n\t\t\t\t\tkey = hyphenate(key);\n\t\t\t\t\tvar original = descriptor.value;\n\t\t\t\t\tdescriptor.value = function emitter() {\n\t\t\t\t\t\tvar args = [];\n\t\t\t\t\t\tfor (var _i = 0; _i < arguments.length; _i++) {\n\t\t\t\t\t\t\targs[_i] = arguments[_i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (original.apply(this, args) !== false) this.$emit.apply(this, [event || key].concat(args));\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}", "on(event, cb) {\n this.conn.on(event, cb);\n }", "addEvent(event, cb) {\n if (this._observer) {\n this._observer(event.setKey(this._groupBy(event)));\n }\n if (cb) {\n cb(null);\n }\n }", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n };\n };\n}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n };\n };\n}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n };\n };\n}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n return returnValue;\n };\n };\n}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n return returnValue;\n };\n };\n}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n return returnValue;\n };\n };\n}", "function sendTextAck(aWs, aText) {\n console.log('Send text ack');\n aWs.send(aText);\n}", "function addProtectedCallback (eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback)\n return oboeApi // chaining\n }", "onRequestSuccess(res) {\n this.emit('success', res)\n this.backoff.reset()\n\n if (res.set) {\n if (res.set.id) {\n this.id = res.set.id\n // This should happen before 'set:id' event becasuse user code needs to\n // rely on the order and handle new client id reception potentially by\n // rerequesting the whole messages history (if there is one).\n this.onConnected()\n this.emit('set:id', this.id)\n }\n }\n\n // Its possible that it hasn't been called above, because no client id has\n // been set.\n this.onConnected()\n\n // Always at the end. Emitter calls handlers in sync and without catching\n // errors so a user handler might throw and cause an exit out of this function.\n // Messages handling needs to be done here, before we reopen request in order\n // to get the acks and send them with the same request.\n res.messages.forEach(::this.onMessage)\n\n // Get the acks right away.\n // Also in case we have got new messages while we where busy with sending previous.\n let messages = this.multiplexer.get()\n this.multiplexer.reset()\n // It won't do anything if already started.\n this.multiplexer.start()\n this.open(messages)\n }", "once(event, cb = () => {\n }) {\n this._event.once(event, cb);\n }", "emit(evt) {\n\t\tif (!Duplex.prototype._flush && evt === 'finish') {\n\t\t\tthis._flush((err) => {\n\t\t\t\tif (err) EventEmitter.prototype.emit.call(this, 'error', err);\n\t\t\t\telse EventEmitter.prototype.emit.call(this, 'finish');\n\t\t\t});\n\t\t} else {\n\t\t\tconst args = Array.prototype.slice.call(arguments);\n\t\t\tEventEmitter.prototype.emit.apply(this, args);\n\t\t}\n\t}", "function emit(event, payload){\n // Set the event name on the payload to be sent to client\n payload['event'] = event;\n\n // Emit the payload\n io.emit(\"message\", payload);\n}", "confirm() {\n /**\n * @event confirmed\n * Fired when confirm button of banner is clicked\n * detail payload: {Object} payload\n */\n const customEvent = new Event('confirmed', { composed: true, bubbles: true });\n customEvent.detail = this.payload;\n this.dispatchEvent(customEvent);\n\n this._close();\n }", "subscribe(event, callback) {\n this.bus.addEventListener(event, callback);\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function callThisAfter3sec(){\n myEventEmitter.emit('customEvent',\"Hii I am the message\");\n}", "on(eventName, cb) {\n this._events.on(eventName, cb);\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }", "ackHeartbeat() {\n this.debug(`Heartbeat acknowledged, latency of ${Date.now() - this.lastPingTimestamp}ms`);\n this.client._pong(this.lastPingTimestamp);\n }" ]
[ "0.6723864", "0.6723864", "0.6637715", "0.63410074", "0.6321067", "0.62284005", "0.6210286", "0.61519814", "0.61519814", "0.5999861", "0.5871506", "0.57802236", "0.5758691", "0.57207406", "0.57207406", "0.56145823", "0.5605704", "0.55522174", "0.55365825", "0.54450524", "0.5399142", "0.5396783", "0.539658", "0.5367015", "0.533362", "0.5265442", "0.5221455", "0.50334156", "0.4948373", "0.4856675", "0.48266518", "0.48266518", "0.48266518", "0.4804609", "0.47960094", "0.47672433", "0.47672433", "0.47565886", "0.47086337", "0.46801323", "0.46670392", "0.4645009", "0.4634023", "0.46007177", "0.45977634", "0.45831117", "0.45732445", "0.45673683", "0.4562179", "0.45528245", "0.45528245", "0.45528245", "0.45528245", "0.45528245", "0.45528245", "0.45528245", "0.45528245", "0.45262206", "0.45183343", "0.45183343", "0.45183343", "0.45183343", "0.45183343", "0.45121008", "0.45051047", "0.44939592", "0.44897753", "0.44857597", "0.44800535", "0.44762784", "0.44504476", "0.44504476", "0.44504476", "0.44297245", "0.44297245", "0.44297245", "0.44192386", "0.4393475", "0.43911523", "0.4385116", "0.4369223", "0.43566427", "0.43536994", "0.4327836", "0.43245128", "0.43245128", "0.43245128", "0.43245128", "0.43245128", "0.43245128", "0.43245128", "0.43245128", "0.43237075", "0.43228918", "0.43208984", "0.43208984", "0.43208984", "0.43208984", "0.43208984", "0.43197858" ]
0.6820758
0
Called upon a server acknowlegement.
onack(packet) { const ack = this.acks[packet.id]; if ("function" === typeof ack) { debug("calling ack %s with %j", packet.id, packet.data); ack.apply(this, packet.data); delete this.acks[packet.id]; } else { debug("bad ack %s", packet.id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ack() {\n Twibble.sendMessage();\n }", "function onHelloAck() {\n disconnected.value = false;\n self.disconnected = disconnected.value;\n $log.log('(Hello:ack) monitor is connected');\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "ackHeartbeat() {\n this.debug(`Heartbeat acknowledged, latency of ${Date.now() - this.lastPingTimestamp}ms`);\n this.client._pong(this.lastPingTimestamp);\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n debug(\"calling ack %s with %j\", packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n else {\n debug(\"bad ack %s\", packet.id);\n }\n }", "function HttpSentEvent() { }", "function HttpSentEvent() { }", "function HttpSentEvent() { }", "onack(packet) {\n const ack = this.acks[packet.id];\n if (\"function\" === typeof ack) {\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n }\n }", "function HttpSentEvent() {}", "function HttpSentEvent() {}", "ServerCallback() {\n\n }", "function callback (responseText) {\n let response = JSON.parse(responseText);\n const ackIds = {\"ackIds\": []};\n if (response.receivedMessages) {\n const messages = response.receivedMessages;\n if (messages.length > 0) {\n for (let i = 0; i < messages.length; i++) {\n let payloadRaw = atob(messages[i].message.data).toString();\n let payloadString = JSON.stringify(JSON.parse(payloadRaw));\n pushLog(LogType.EVENT, \"Event Received\", payloadString);\n ackIds.ackIds.push(messages[i].ackId);\n }\n }\n }\n // Acknowledge messages:\n if (ackIds.ackIds.length > 0) {\n ack(token, ackIds);\n }\n }", "function handleServerRequest()\n{\n\t//send data to the div or html element for notifications\n}", "function onComplete() {\n\t// Print the time response received\n\t$('#info').append('<p>Response received at: ' + new Date() + '</p>');\n}", "function completeHandler(e) {\n console.log(\"received \" + e.responseCode + \" code\");\n var serverResponse = e.response;\n}", "onAfterSend()\n {\n }", "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n debug(\"sending ack %j\", args);\n self.packet({\n type: dist.PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }", "__handleResponse() {\n this.push('messages', {\n author: 'server',\n text: this.response\n });\n }", "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent) return;\n sent = true;\n debug(\"sending ack %j\", args);\n self.packet({\n type: socket_io_parser_1.PacketType.ACK,\n id: id,\n data: args\n });\n };\n }", "function OnServerInitialized() {\n\n\tDebug.Log(\"Server initialized and ready\");\n}", "_onResponse(msg) {\n let _this = this;\n\n let event = {\n type: msg.type,\n url: msg.body.source,\n code: msg.body.code\n };\n\n if (_this._onResponseHandler) {\n _this._onResponseHandler(event);\n }\n }", "function receiveAcknowledgeMessage(e) {\n\t\tconsole.log(\"receiveAcknowledgeMessage\");\n\t\tconsole.log(e);\n\t\t// Update the div element to display the message.\n\t\tvar ackDiv = document.getElementById('ack');\n\t\tackDiv.innerHTML = e.data;\n\t}", "function __FIXME_SBean_server_echo() {\n\tthis._pname_ = \"server_echo\";\n\t//this.stamp:\t\tint32\t\n}", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "function announce(announcement){\n tagpro.group.socket.emit(\"chat\", announcement);\n}", "function sendOnLoadEvent() {\n writeToServer(\"OnLoadEvent\", \"loaded\");\n}", "function sendOnLoadEvent() {\n writeToServer(\"OnLoadEvent\", \"loaded\");\n}", "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n debug(\"sending ack %j\", args);\n self.packet({\n type: socket_io_parser_1.PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }", "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n debug(\"sending ack %j\", args);\n self.packet({\n type: socket_io_parser_1.PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }", "_scheduleSendResponseMessage() {\n\n }", "function announce(response) {\n $('#message').html(response.result);\n}", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n\n if (this.connected) {\n this.emitEvent(args);\n } else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "queueHeartbeat() {\n\t\t\tif (this.options.ignoreHeartbeat) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!(this.hasHandshook && this.open)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.heartbeatTimeout !== undefined) {\n\t\t\t\tclearTimeout(this.heartbeatTimeout);\n\t\t\t}\n\n\t\t\tthis.heartbeatTimeout = setTimeout(\n\t\t\t\t() => {\n\t\t\t\t\tthis.sendMessage([\n\t\t\t\t\t\t___R$project$rome$$internal$events$types_ts$BridgeMessageCodes.HEARTBEAT,\n\t\t\t\t\t]);\n\t\t\t\t},\n\t\t\t\t1_000,\n\t\t\t);\n\t\t}", "update() {\n\t\tbus.emit('Server:Update', this)\n\t\tif (this.Vars._displayStatusMessage) {\n\t\t\tthis.Vars._displayStatusMessage = false\n\t\t}\n\t\tthis.log('Updating Server Info')\n\t}", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "onevent(packet) {\n const args = packet.data || [];\n debug(\"emitting event %j\", args);\n if (null != packet.id) {\n debug(\"attaching ack callback to event\");\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "function announce(settings, callback) {\n\tsettings = settings || null;\n\tSiad.apiCall({\n\t\turl: '/host/announce',\n\t\tmethod: 'POST',\n\t\tqs: settings,\n\t}, callback);\n}", "function CoAPServerAutoAck(app) {\n if (!app.properties[SERVER.Capabilities][COAPMIDDLEWARE.CAPABILITY])\n throw (\"Missing Dependency: IOPA CoAP Server/Middleware in Pipeline\");\n\n app.properties[SERVER.Capabilities][THISMIDDLEWARE.CAPABILITY] = {};\n app.properties[SERVER.Capabilities][THISMIDDLEWARE.CAPABILITY][SERVER.Version] = packageVersion;\n\n}", "onAnnounce (packet) {\n this.connectToPeer(packet.uuid)\n }", "function heartbeat() {\n client.publish('/heartbeat', { id: '1', type: 'emitter' });\n}", "function callback (responseText) {\n console.log('ack callback', JSON.stringify(JSON.parse(responseText)));\n }", "notifyCommittedEnvelop(bidderAddress) {\n addAlertElement(\"Envelop committed by <strong>\" + bidderAddress + \"</strong>\",\"secondary\");\n console.log(\"Envelop commited \" + bidderAddress);\n }", "onRequestSuccess(res) {\n this.emit('success', res)\n this.backoff.reset()\n\n if (res.set) {\n if (res.set.id) {\n this.id = res.set.id\n // This should happen before 'set:id' event becasuse user code needs to\n // rely on the order and handle new client id reception potentially by\n // rerequesting the whole messages history (if there is one).\n this.onConnected()\n this.emit('set:id', this.id)\n }\n }\n\n // Its possible that it hasn't been called above, because no client id has\n // been set.\n this.onConnected()\n\n // Always at the end. Emitter calls handlers in sync and without catching\n // errors so a user handler might throw and cause an exit out of this function.\n // Messages handling needs to be done here, before we reopen request in order\n // to get the acks and send them with the same request.\n res.messages.forEach(::this.onMessage)\n\n // Get the acks right away.\n // Also in case we have got new messages while we where busy with sending previous.\n let messages = this.multiplexer.get()\n this.multiplexer.reset()\n // It won't do anything if already started.\n this.multiplexer.start()\n this.open(messages)\n }", "function onServerSuccessfulStart() {\n // Actually display the started game\n console.log(\"Game started/resumed from server. Playing as \" + playerInfo.playingAs);\n initializeUI();\n updateBoardUI();\n if (!myTurn()) awaitMoveReply();\n setInterval(serverTickUpdate, 1000);\n }", "function sessionEndedRequest () {\n this.emit(':tell', 'Dam, you are gonna back out of taking a drink? You better hope no one else is here to see you')\n}", "async _onMessage (address, heads) {\n await this.stores[address].ready\n super._onMessage(address, heads)\n }", "function onPostSuccess(data,status)\n {\n\t\t\tconsole.log(\"Server status (POST): \" + status);\n }", "_postSent(post) {\n\t\tthis.broadcast('postSent', post);\n\t}", "function ack(token, ackIds) {\n // Construct url for pubsub ack:\n const url = buildSubscriptionUrl() + \":acknowledge\";\n\n // Callback function for pubsub ack:\n function callback (responseText) {\n console.log('ack callback', JSON.stringify(JSON.parse(responseText)));\n }\n\n // Issue pubsub ack:\n postRequest(url, ackIds, callback, token);\n}", "function AckCallRequest() {}", "function onBye(req, rem) {\n sipClient.send(sip.makeResponse(req, 200, 'OK'));\n}", "networkQueryOffersCollected() {\n this.socket.emit('networkQueryOffersCollected');\n }", "function onRequest ( request, response ){\n\n response.writeHead(200, {'Content-type': 'text/plain'});\n response.write('hello world alex into a server');\n response.end();\n}", "onevent(packet) {\n const args = packet.data || [];\n if (null != packet.id) {\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }", "onBeforeRespond (message)\n {\n }", "function responseHandler (app) {\n // Complete your fulfillment logic and send a response\n // DONE: Figure out how to grab the zipcode from dialogflow's post\n // app.tell(JSON.stringify(request.body.result.parameters.zip-code));\n app.tell()\n // TODO: Create a function that takes that and gets the shabbat time and responds accordingly\n\n }", "function ack($var) {\n\t\treturn new ackExpose($var);\n\t}", "function after_response(info) {\n\t\t\t//If the response has not been recorded, record it\n\t\t\tif (response.key == -1) {\n\t\t\t\tresponse = info; //Replace the response object created above\n\t\t\t}\n\t\t\tend_trial();\n\n\t\t}", "function requestCompleted(){\n\t\twriteStream.emit(\"requestCompleted\");\n\t}", "function onRequest(request,response) {\n console.log(\"A user has made a request \" + request);\n response.writeHead(202, {\"Context-Type\":\"text/plain\"});\n response.write(\"Here is your response\");\n response.end();\n}", "function ack_all_alert(mid){\n\tvar cmd_data = { \"cmd\":\"ack_all_alert\", \"mid\":mid};\n\tcon.send(JSON.stringify(cmd_data)); \t\t\n\n\tshow_alarms(mid); \t// its already open, but this will reset the content\n\tget_alarms(mid);\t// and this should send us an empty list\n}", "__broker_published(packet, client) {\n\n // quick fix moche comme MJ\n if (client != undefined) {\n console.log('[HubManager MQTT] ' + client.id + ' published \"' + JSON.stringify(packet.payload) + '\" to ' + packet.topic);\n if (that.pubCallback != null) {\n that.pubCallback(client, packet.topic, packet.payload);\n }\n }\n }", "function OnBtnServerSynch_Click( e )\r\n{\r\n OnBtnServerSynch() ;\r\n}", "function handleEventResponse(rsp) {\n loadComplete();\n if (rsp.events && rsp.events.length > 0) {\n bg.storage.events = JSON.stringify(rsp.events);\n addEvents(rsp.events);\n $scope.nextEvent();\n }\n }", "function sendHeartbeat() {\n _.forOwn(_this.socks, function (sock) {\n sock.write('hb');\n });\n setTimeout(sendHeartbeat, _this.heartbeatFreq);\n }", "onLoad() {\n emitter.on(this, \"refreshAchieve\", this.onRefreshAchieve);\n }", "function ack_alert(id,mid){\n\t// remove field\n\t$(\"#alert_\"+mid+\"_\"+id).fadeOut(600, function() { $(this).remove(); });\n\n\t// decrement nr\n\tvar button=$(\"#\"+mid+\"_toggle_alarms\");\n\tvar open_alarms=parseInt(button.text().substring(0,button.text().indexOf(\" \")))-1;\n\tvar txt=$(\"#\"+mid+\"_toggle_alarms_text\");\n\tvar counter=$(\"#\"+mid+\"_alarm_counter\");\n\tset_alert_button_state(counter,button,txt,open_alarms);\n\n\tvar cmd_data = { \"cmd\":\"ack_alert\", \"mid\":mid, \"aid\":id};\n\t//console.log(JSON.stringify(cmd_data));\n\tcon.send(JSON.stringify(cmd_data)); \t\t\n}", "static _onListenDone () {\n }", "function onPostServerResponse() {\n console.log(\"Post Server Response\", this.status);\n console.log(httpPostRequest.responseText);\n console.log(httpPostRequest.readyState);\n console.log(XMLHttpRequest.DONE);\n if (httpPostRequest.readyState == XMLHttpRequest.DONE) {\n // at this point the server should have handled the request\n \n //printButton.parentNode.removeChild(printButton); // remove the print button\n \n // if server sends back an okay and a sucess that means everything printed\n if (httpPostRequest.status === 200 && httpPostRequest.responseText === \"success\") {\n // change the text to the fact that request was sent to printer\n console.log(\"POST SUCCESS SEEN\");\n }\n // else means that most lilkey the server is not online (I cant think of any other problems)\n else {\n // explain that the server is down and and show a link to an internal webpage on how to fix it\n console.log(\"POST is fail\");\n }\n }\n}", "function heartbeat()\n{\n\tvar fn = function(key, val)\n\t{\n\t\tvar queue = val.queue;\n\t\tvar msg = (typeof queue != \"undefined\" && queue != null && queue.length > 0) ? queue.shift() : getSpam();\n\t\tvar skt = io.sockets.connected[val.id];\n\t\tif (skt)\n\t\t{\n\t\t\tif (msg.event && msg.data)\n\t\t\t\tskt.emit(msg.event, msg.data);\n\t\t}\n\t}\n\n\tkeyTree.inorder(fn, false);\n}", "happen(){\r\n\t\tvar train = this.train;\r\n\t\tthis.passenger = new Passenger(train, train.getAvgPassengerTransactionTime());\r\n\t\tvar response = new Response(train.printTime(),\" Passenger \"+this.passenger.getId()+\" has arrived.\",true);\r\n\t\ttrain.queueResponse(response);\r\n\t\tthis.passenger.enterQueue();\r\n\t\tvar interval = train.getRandom(train.getAvgPassengerArrivalTime());\r\n\t\tvar currentTime = train.getCurrentTime();\r\n\t\tvar nextArrival = Number(parseFloat(currentTime)+parseFloat(interval)).toFixed(2);\r\n\t\tif(this.getId() < this.numberOfPersons)\r\n\t\ttrain.addEvent(new PassengerArrivalEvent(train,nextArrival,this.numberOfPersons));\r\n\t}", "heartbeat () {\n }", "async onAdded() {\n // This device has just been added by Homey\n this.log('Device: onAdded...');\n }", "function updateHomePageAnnouncement(ev){\n ev.preventDefault();\n toggleLoadingGif(true);\n var params ={};\n params.method = \"POST\";\n params.url = \"/section/back/home/updateAnnouncement\";\n params.data = \"announcement_text=\"+document.getElementById(\"announcement-text\").value;\n params.setHeader = true;\n ajaxRequest(params, mainPannelResponse); \n }", "function handleResponseCallback(msg) {\n IALOG.debug(\"Enter - handleResponseCallback. Handling response [\" + msg.response + \"] for event [\" + msg.additionalTokens.incident_id + \"]\");\n\n var incidentId = msg.additionalTokens.incident_id;\n var responder = msg.recipient;\n\n var annotation = \"\";\n var logAnnotation = \"\";\n var msgAnnotation = \"\";\n\n var isRepliedFromXM = true;\n\n var bppmws = new BPPMWS();\n\n switch ((msg.response).toLowerCase()) {\n case \"acknowledge\":\n logAnnotation = NOTE_PREFIX + \"Event acknowledged by \" + responder;\n bppmws.updateEvent(incidentId, bppmws.IMWS_STATUS_ACKNOWLEDGE, NO_ASSIGNEE, responder, logAnnotation, NO_NOTES, isRepliedFromXM);\n break;\n\n case \"close\":\n logAnnotation = NOTE_PREFIX + \"Event closed by \" + responder;\n bppmws.updateEvent(incidentId, bppmws.IMWS_STATUS_CLOSED, NO_ASSIGNEE, responder, logAnnotation, NO_NOTES, isRepliedFromXM);\n break;\n\n case \"accept\":\n logAnnotation = NOTE_PREFIX + \"Event accepted by \" + responder;\n bppmws.updateEvent(incidentId, bppmws.IMWS_STATUS_NONE, responder, responder, logAnnotation, NO_NOTES, isRepliedFromXM);\n break;\n\n case \"ignore\":\n logAnnotation = NOTE_PREFIX + \"Event ignored by \" + responder;\n bppmws.updateEvent(incidentId, bppmws.IMWS_STATUS_NONE, NO_ASSIGNEE, responder, logAnnotation, NO_NOTES, isRepliedFromXM);\n break;\n\n case \"ping mchostaddress\":\n responseToXM.setToken(TOKEN_NAME_DIAGNOSTIC_RESPONSE,\n StringEscapeUtils.escapeXml(runPing(msg.additionalTokens.host_address)),\n APXMLToken.Type.STRING);\n break;\n\n case \"ping eventorigin\":\n responseToXM.setToken(TOKEN_NAME_DIAGNOSTIC_RESPONSE,\n StringEscapeUtils.escapeXml(runPing(msg.additionalTokens.client_address)),\n APXMLToken.Type.STRING);\n break;\n\n case \"traceroute mchostaddress\":\n responseToXM.setToken(TOKEN_NAME_DIAGNOSTIC_RESPONSE,\n StringEscapeUtils.escapeXml(runTraceRoute(msg.additionalTokens.host_address)),\n APXMLToken.Type.STRING);\n break;\n\n case \"traceroute eventorigin\":\n responseToXM.setToken(TOKEN_NAME_DIAGNOSTIC_RESPONSE,\n StringEscapeUtils.escapeXml(runTraceRoute(msg.additionalTokens.client_address)),\n APXMLToken.Type.STRING);\n break;\n\n default:\n throw \"Unknown response Action: \" + responseAction;\n break;\n }\n\n // Add annotation if present\n if (msg.annotation != null && msg.annotation != \"null\") {\n msgAnnotation = NOTE_PREFIX + msg.annotation;\n bppmws.updateEvent(incidentId, bppmws.IMWS_STATUS_NONE, NO_ASSIGNEE, responder, NO_LOGS, msgAnnotation, false);\n }\n\n IALOG.debug(\"Exit - handleResponseAction\");\n}", "onMessageEnd() { }", "async function handleNegotiationNeededEvent() {\n if (negotioned) {\n log(\"Already netioned dear!!!!!\");\n return;\n }\n log(\"*** Negotiation needed\");\n try {\n log(\"---> Creating offer\");\n const offer = await myPeerConnection.createOffer();\n\n // If the connection hasn't yet achieved the \"stable\" state,\n // return to the caller. Another negotiationneeded event\n // will be fired when the state stabilizes.\n\n if (myPeerConnection.signalingState != \"stable\") {\n log(\" -- The connection isn't stable yet; postponing...\");\n return;\n }\n\n // Establish the offer as the local peer's current\n // description.\n\n log(\"---> Setting local description to the offer\");\n await myPeerConnection.setLocalDescription(offer);\n\n // Send the offer to the remote peer.\n\n log(\"---> Sending the offer to the remote peer\");\n sendToServer({\n from: my_profile?.userId,\n target: params?.userId,\n type: \"offer\",\n offer: myPeerConnection.localDescription,\n });\n } catch (err) {\n log(\n \"*** The following error occurred while handling the negotiationneeded event:\"\n );\n reportError(err);\n }\n\n setNegotioned(true);\n }", "function nlobjServerResponse() {\n}", "function onOutgoingSipMessage(sipRequestAsReceived, prSipResponse) {\n sendMessage.evtOutgoingMessage.post({\n \"sipRequest\": sipRequestAsReceived,\n prSipResponse: prSipResponse\n });\n}", "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n \t displayMessageConsole(\"Connection Lost with MQTT Broker. Error: \" + \"\\\"\" +responseObject.errorMessage + \"\\\"\");\n }\n }", "function heartbeat() {\n\n board.updateEnemy();\n var data = {\n player_dico: board.player_dic,\n enemy_list: board.enemy,\n waveNum: board.wave_num\n };\n io.sockets.emit('heartbeat', data);\n}", "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n self.packet({\n type: PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }", "announce(screens, event, data) {\n /**\n * @event event:announce\n */\n this.dispatcher.emit(\"announce\", { screens: screens, event: event, data: data });\n }", "function addannouncement() {\n\n}", "_onNewAccessToken() {\n super._onNewAccessToken();\n if (this.accessToken !== '') {\n this.socket.emit('initiate', { accessToken: this.accessToken })\n }\n }", "function addWelcome(data) {\r\n addMsg(data, \"server\");\r\n}", "onServerReady(callback) {\n this.readyCallback = callback;\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 EventHandler(context, event) {\n if (!context.simpledb.botleveldata.numinstance)\n context.simpledb.botleveldata.numinstance = 0;\n numinstances = parseInt(context.simpledb.botleveldata.numinstance) + 1;\n context.simpledb.botleveldata.numinstance = numinstances;\n context.sendResponse(\"Hello \"+event.senderobj.display+\"\\r\\nI am Praxis & how can I help you?\\r\\n\\r\\nTo know more just reply with 'more info' or 'about praxis'\\r\\n\\r\\nOr simply visit this link:\\r\\nbit.ly/praxisbot\");\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n }", "function sendToServer_wantnext() {\r\n socket.emit('clientend', {\r\n 'room': ROOM_ID\r\n });\r\n}", "onrecord() {}", "_ackConnectHandler(messages){\n\t // Add stored messages\n\t if ((messages !== \"\") && (this.messages.length === 0)){\n\t\t for (var x in messages){\n\t\t\t var message = messages[x];\n\t\t\t this.push('messages', {\"user\": message.user, \"message\": message.textMessage, \"time\": message.time});\n\t\t }\n\t } \n }", "function handleServerResponse() {\n\t\t// move forward only if the transaction has completed\n\t\tif (xmlHttp.readyState == 4) {\n\t\t\t// status of 200 indicates the transaction completed successfully\n\t\t\tif (xmlHttp.status == 200) {\n\t\t\t\tnewScoreWindow(xmlHttp.responseText);\n\t\t\t}\n\t\t\t// a HTTP status different than 200 signals an error\n\t\t\telse {\n\t\t\t\talert(\"There was a problem accessing the server: \" + xmlHttp.statusText);\n\t\t\t}\n\t\t}\n\t}", "function nack() {\n Twibble.messages.unshift(message);\n Twibble.sendMessage();\n }", "async onBegin() {\n\t\tawait this.say('Hello, I am Edison');\n\t\tawait this.say('Ask me anything');\n\t}", "function _heartbeat(menusComp)\n {\n //don't send heartbeat if one is pending\n if(menusComp.get(\"beatPending\")) return\n \n menusComp.set(\"beatPending\", true) \n //send ajax request to server\n Ajax.Get(\"SearchHeartbeat\", {clientVersion: menusComp.get(\"version\")}, function(response)\n {\n menusComp.set(\"beatPending\", false)\n //if a response was given, parse it for its value\n if(response)\n response = JSON.parse(response)\n //if the parsed response has content\n if(response)\n {\n menusComp.set(\"Version\", response.Version)\n menusComp.set(\"Venders\", response.VenderData)\n }\n })\n }", "function sendAnnouncement(player, message) {\n\n var sessionID = player.sessionID;\n \n io.sockets.sockets[sessionID].emit('announcement', message);\n return;\n}" ]
[ "0.6818837", "0.6449511", "0.63143164", "0.62949145", "0.6186926", "0.6186926", "0.61520237", "0.61520237", "0.61520237", "0.6060652", "0.6014214", "0.6014214", "0.60119325", "0.5985348", "0.5880019", "0.58117795", "0.5749443", "0.56953895", "0.5670078", "0.56513417", "0.564891", "0.5645013", "0.56443834", "0.5633822", "0.5611287", "0.5609559", "0.5599863", "0.5582675", "0.5582675", "0.5577278", "0.5577278", "0.5572593", "0.5559493", "0.5511798", "0.54886794", "0.5480625", "0.5477971", "0.5477971", "0.54602605", "0.54547226", "0.5446208", "0.5442756", "0.54240507", "0.5415872", "0.5413838", "0.54045373", "0.5397882", "0.5392391", "0.5385164", "0.5337663", "0.5327661", "0.5294304", "0.5293603", "0.52804404", "0.52710664", "0.52530456", "0.5244593", "0.52416176", "0.52358514", "0.52348113", "0.5232214", "0.52187514", "0.52180624", "0.52071184", "0.5198001", "0.51900464", "0.5177196", "0.51605934", "0.51605093", "0.5156679", "0.5148563", "0.5144609", "0.5143951", "0.5128307", "0.5108016", "0.51052904", "0.5104432", "0.5097307", "0.5093191", "0.50895447", "0.5087172", "0.50810575", "0.5075476", "0.50672823", "0.50652534", "0.5064305", "0.50615835", "0.5057779", "0.505493", "0.50434893", "0.5043047", "0.5041697", "0.5041502", "0.504024", "0.503752", "0.50339603", "0.5026521", "0.502145", "0.50190634", "0.5018905" ]
0.62665045
4
Called upon server connect.
onconnect(id) { debug("socket connected with id %s", id); this.id = id; this.connected = true; this.disconnected = false; this.emitBuffered(); this.emitReserved("connect"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onConnect() {\n\t\tconsole.log(\"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@connect\");\n\t}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(SUBSCRIBER);\n }", "connect() {}", "function serverConnected(){\n \tconsole.log(\"connected\");\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n }", "onConnect() {\n this.state = constants_1.SocksClientState.Connected;\n // Send initial handshake.\n if (this._options.proxy.type === 4) {\n this.sendSocks4InitialHandshake();\n }\n else {\n this.sendSocks5InitialHandshake();\n }\n this.state = constants_1.SocksClientState.SentInitialHandshake;\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(\"State\", { qos: Number(1) });\r\n client.subscribe(\"Content\", { qos: Number(1) });\r\n\r\n }", "_onConnecting() {\n this.emit(\"connecting\");\n }", "function serverConnected(){\nconsole.log('connected to the server');\n}", "function serverConnected(){\n\tconsole.log('connected to the server');\n}", "function serverConnected(){\n\tconsole.log('connected to the server');\n}", "function serverConnected(){\n\tconsole.log('connected to the server');\n}", "_onConnect() {\n console.log(\"connected\")\n }", "function serverConnected() {\n print(\"Connected to Server\");\n}", "function serverConnected() {\n print(\"We are connected!\");\n}", "connect() {\n if (this.host === undefined || this.port === undefined) {\n log.error('No host or port specified: %s:%d', this.host. this.port);\n return;\n }\n\n if (!this.connected) {\n var scope = this;\n scope.clearState();\n this.server = net.connect(this.port, this.host, () => {\n scope.connected = true;\n log.info('Connected to server @%s:%d', scope.host, scope.port);\n log.debug('Running callbacks for connect @%s:%d', scope.host, scope.port);\n for (var i in scope.callbacks.connected) {\n scope.callbacks.connected[i](scope);\n }\n });\n this.server.on('data', this.processData.bind(this));\n this.server.on('end', this.onDisconnect.bind(this));\n }\n }", "function onsocketConnected () {\n\tconsole.log(\"connected to server\"); \n}", "function serverConnected() {\n print(\"Connected to Server\");\n}", "function onConnect() {\n // Once a connection has been made report.\n console.log(\"Connected\");\n}", "onConnect() {\n console.log(\"STretch Connected\");\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "_onConnect() {\n clearTimeout(this._connectionTimeout);\n\n this.logger.info(\n {\n tnx: 'network',\n localAddress: this._socket.localAddress,\n localPort: this._socket.localPort,\n remoteAddress: this._socket.remoteAddress,\n remotePort: this._socket.remotePort\n },\n '%s established to %s:%s',\n this.secure ? 'Secure connection' : 'Connection',\n this._socket.remoteAddress,\n this._socket.remotePort\n );\n\n if (this._destroyed) {\n // Connection was established after we already had canceled it\n this.close();\n return;\n }\n\n this.stage = 'connected';\n\n // clear existing listeners for the socket\n this._socket.removeListener('data', this._onSocketData);\n this._socket.removeListener('timeout', this._onSocketTimeout);\n this._socket.removeListener('close', this._onSocketClose);\n this._socket.removeListener('end', this._onSocketEnd);\n\n this._socket.on('data', this._onSocketData);\n this._socket.once('close', this._onSocketClose);\n this._socket.once('end', this._onSocketEnd);\n\n this._socket.setTimeout(this.options.socketTimeout || SOCKET_TIMEOUT);\n this._socket.on('timeout', this._onSocketTimeout);\n\n this._greetingTimeout = setTimeout(() => {\n // if still waiting for greeting, give up\n if (this._socket && !this._destroyed && this._responseActions[0] === this._actionGreeting) {\n this._onError('Greeting never received', 'ETIMEDOUT', false, 'CONN');\n }\n }, this.options.greetingTimeout || GREETING_TIMEOUT);\n\n this._responseActions.push(this._actionGreeting);\n\n // we have a 'data' listener set up so resume socket if it was paused\n this._socket.resume();\n }", "function serverConnected() {\n print('connected to server.');\n}", "onConnect() {\n this.attempts = 1;\n this.connected = true;\n this.emit('connect');\n this.ws.on('message', msg => {\n msg = JSON.parse(msg);\n this.onMessage(msg);\n });\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"#\");\n}", "function onConnect (err) {\n if (err) console.log(err);\n\n server.listen(8000, function () {\n console.log(chalk.magenta('server started on port 8000!'));\n });\n\n wsServer.on('connection', onConnection);\n}", "function serverConnected() {\n console.log(\"Connected to Server\");\n}", "_handleSocketConnected() {\n this.sendClientHandshake();\n this._bsClientBush.postConnect();\n }", "function connected( connection ) {\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"ips\");\n }", "function onConnect() {\n emitHello();\n $log.log(\"monitor is connected\");\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"Conectado...\");\n\t\n client.subscribe(\"jeffersson.pino@gmail.com/WEB\");\n\n\t\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n\n}", "Connect() {\r\n this._MistyWebSocket.Connect(function (event) {\r\n //\talert(\"Connected to websockets\");\r\n });\r\n }", "function serverConnected() {\n println(\"Connected to Server\");\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"X\");\n client.subscribe(\"Y\");\n client.subscribe(\"smile\");\n}", "onconnect(id) {\n debug(\"socket connected with id %s\", id);\n this.id = id;\n this.connected = true;\n this.disconnected = false;\n super.emit(\"connect\");\n this.emitBuffered();\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n log(\"Connection successful to topic \" + topic + \" as client \" + clientname);\n client.subscribe(topic);\n onconnect()\n }", "function serverConnected() {\n infoData=\"Connected to /node backend\";\n println(\"Connected to /node backend\");\n}", "function onConnect() {\n localDiv.html('client is connected');\n client.subscribe(topic);\n}", "connect() { socket_connect(this) }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(topic);\n }", "connectedCallback() {\n this.parseParams();\n this.parseHeaders();\n this.generateData();\n }", "clientConnected() {\n super.clientConnected('connected', this.wasConnected);\n\n this.state = 'connected';\n this.wasConnected = true;\n this.stopRetryingToConnect = false;\n }", "onconnect(id) {\n debug(\"socket connected with id %s\", id);\n this.id = id;\n this.connected = true;\n this.disconnected = false;\n this.emitBuffered();\n this.emitReserved(\"connect\");\n }", "onconnect(id) {\n debug(\"socket connected with id %s\", id);\n this.id = id;\n this.connected = true;\n this.disconnected = false;\n super.emit(\"connect\");\n this.emitBuffered();\n }", "async connect(){}", "function handleConnected(data) {\n // Create a log message which explains what has happened and includes\n // the url we have connected too.\n var logMsg = 'Connected to server: ' + data.target.url;\n }", "function onConnect() {\n console.log(\"connected\");\n\n}", "_handleConnect() {\n debug(\"Connected to TCP connection to node \" + this._node.id());\n this._connecting = false;\n this.emit(\"connect\");\n // flush queue after emitting \"connect\"\n var out = this._queue.flush();\n out.forEach((msg) => {\n this.send(msg.event, msg.data);\n });\n }", "function onConnect () {\n socket.removeListener('error', onError);\n socket.destroy();\n\n options.path = exports.nextSocket(options.path);\n exports.getSocket(options, callback);\n }", "connectedCallback(){}", "onConnect() {\n logger.info(`client was connected: ${this._client.connected}`);\n }", "function onConnect() {\n console.log(\"Connected!\");\n}", "onConnected() {\n if (this.connected || !this.id) return\n this.connected = true\n log('connected')\n this.emit('connected')\n }", "function connect() {\n // Create a new WebSocket to the SERVER_URL (defined above). The empty\n // array ([]) is for the protocols, which we are not using for this\n // demo.\n ws = new WebSocket(SERVER_URL, []);\n // Set the function to be called when we have connected to the server.\n ws.onopen = handleConnected;\n // Set the function to be called when an error occurs.\n ws.onerror = handleError;\n\n\n ws.onmessage = MsjRecibido;\n // Set the function to be called when we have connected to the server.\n }", "function cb_onConnect() {\n console.log(\"Connection established.\");\n $('#status').val('Connected to ' + host + ':' + port);\n topic = $('#topic').val();\n client.subscribe(topic);\n}", "function serverConnected() {\n infoData=\"Connected to Server\";\n println(\"Connected to Server\");\n}", "start () {\n\t\tthis._logger.info(`Connecting to ${this.host}...`)\n\t\tthis._params.host = this.host\n\t\tthis._connection.connect(this._params)\n\t\tthis.started = true\n\t}", "function connect(){\n\tconsole.log('Attempting to connect to ' + Config.url());\n\tsocket = new io.connect(Config.url());\n\tsocket.on('start',onStart);\n\tsocket.on('disconnect',onDisconnect);\n\tsocket.on('connect',onConnect);\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"bdcc/itaxi\");\n}", "ServerCallback() {\n\n }", "afterConnect() {}", "afterConnect() {}", "connect() {\n\t\tthis._communicator.connect();\n\t}", "function handleSocketConnect()\n{\n setPanelStatus(\"Panel Ready\");\n \n var panelBackground = svgDocument.getElementById(\"panelBackground\");\n if(panelBackground != null)\n {\n setStyleSubAttribute(panelBackground, \"fill\", connectedBackgroundColor);\n }\n \n // Now that we are connected, try to update all objects from the server\n updateAllObjectsFromServer();\n}", "function start(){\n// will start the connection\n}", "onConnect() {\n console.log(\"connected to broker\");\n this.client.subscribe(\"common/reply\");\n this.emit('onConnected');\n }", "connect() {\n if (this.connected) {\n return;\n }\n this.connected = true;\n return this.emitEvent('connect', null);\n }", "onConnected() {\n this.status = STATUS_CONNECTED;\n }", "function serve() {\n connect.server(serverConfig);\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(SUBSCRIBER);\n //message = new Paho.MQTT.Message(\"Hello\");\n //message.destinationName = \"World\";\n //client.send(message);\n }", "[net.onConnect](evt) {\n console.log('SC:connected', evt);\n }", "function on_auth_success(socket, accept) {\n console.log(\"Auth success\");\n /**\n * Accepts the connection\n * A message may be sent to client via accept\n */\n accept();\n }", "function connect () {\n var data = {\n pseudo : getCookie(\"Podeus\"),\n id : getCookie(\"Illiad\")\n }\n socket.emit(\"know\", data);\n}", "connectedCallback() {\n }", "function onConnectedHandler (addr, port) {\n // Подключаемся к базе.\n //connectSQL();\n\n //getInfo();\n\n console.log(`* Connected to ${addr}:${port}`);\n\n}", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n\r\n client.subscribe(\"jomsk@hotmail.com/IoT\");\r\n\r\n\r\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n client.subscribe(topics[\"response\"])\n console.log(\"onConnect\");\n}", "function onOpen() {\n\t\tconsole.log('Client socket: Connected');\n\t\tcastEvent('onOpen', event);\n\t}", "function onConnect() {\n console.log(\"onConnect\");\n client.subscribe(\"student/id\");\n}", "function handleConnect(e) {\n if (e.kind === 'connect') {\n if (connectCallback) {\n connectCallback();\n }\n socket.emit('message', { id: id, kind: 'register' });\n return true;\n }\n\n return false;\n }", "function onConnect() {\t\n\t\tmqtt.subscribe(moisture_topic, {qos: 0});\n\t\t//$('#status').val('Connected to ' + host + ':' + port + path);\n\t}", "onConnection(delegate) {\n this.connected = delegate\n }", "run() {\n this.reset();\n this.socket = net.createConnection({\n 'host': this.host.address, \n 'port': this.port,\n }).setKeepAlive(true); // .setNoDelay(true)\n this.socket.on('connect', this.onConnect);\n this.socket.on('error', this.onError);\n this.socket.on('data', this.onData);\n this.socket.on('close', this.onClose);\n }", "function initClient () {\n\tvar io = socket.connect( Config.kSERVER_URL );\n\n\tio.sockets.on( 'connect', function handleConnect ( socket ) {\n\t\tconsole.log( 'client connected' );\n\n\t\tsocket.on( 'control', function handleControl ( data ) {\n\t\t\tconsole.log( 'client received control event' );\n\n\t\t\tsegments = data[ 'segmentCount' ];\n\t\t\tsegmentSet = data[ 'segmentSet' ];\n\n\t\t\tsegmentHighlight( segments );\n\t\t} );\n\n\t} );\n\n\tconsole.log( 'client initialized' );\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(topic);\n message = new Messaging.Message(\"webClient connected\");\n message.destinationName = topic;\n client.send(message);\n }", "function onConnection(socket){\n console.log('connected...');\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and save a message to a txt.\n client.subscribe(\"mebaris01/nurusallam/\");\n \n}", "onConnect() {\n console.log(\"WS Opened\")\n }", "connect() {\n communicator.sendMessage('connected');\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"Conectado...\");\r\n client.subscribe(\"licha_05reyes@outlook.com/IoT\");\r\n enviarInfo(\"00:00/00:00/0/0/0/0\")\r\n \r\n}", "connectedCallback () {\n this.log_('connected');\n this.connected_ = true;\n }", "connectedCallback()\n\t{\n\n\t}", "function OnServerInitialized() {\n\n\tDebug.Log(\"Server initialized and ready\");\n}", "function think()\n{\n\tif(!connected)\n\t\tconnect();\n}", "init() {\n // Setup event handlers for the socket\n this._setListeners(() => {\n // Check that connection limit is not exceeded\n if (this._server.options.maxClients && this._server.connections.size > this._server.options.maxClients) {\n return this.send(421, this.name + ' Too many connected clients, try again in a moment');\n }\n\n // Keep a small delay for detecting early talkers\n setTimeout(() => this.connectionReady(), 100);\n });\n }", "connect() {\n log.info('connection constructing.');\n const WebSocketServer = WebSocket.Server;\n const wss = new WebSocketServer({\n port: PORT\n });\n\n wss.on('connection', (ws) => {\n log.info('connection established.');\n this.ws = ws;\n ws.on('message', this.handleMessage);\n });\n\n listener.subscribe('_send', this.send.bind(this));\n }", "function onConnectedHandler (addr, port) {\n\twriteToLog(`* Connected to Twitch: ${addr}:${port}`);\n}" ]
[ "0.72508335", "0.7236416", "0.72278905", "0.72005546", "0.7177443", "0.7077179", "0.7065388", "0.7045901", "0.7017169", "0.7001419", "0.7001419", "0.7001419", "0.6943829", "0.69241816", "0.6924022", "0.6920274", "0.6913959", "0.6897356", "0.68920887", "0.6889454", "0.687537", "0.687537", "0.687537", "0.6875289", "0.686226", "0.68478006", "0.68475884", "0.68349636", "0.683101", "0.6793814", "0.6793321", "0.67835844", "0.67198086", "0.6695837", "0.6688179", "0.6671604", "0.66579044", "0.6655751", "0.6631348", "0.66301936", "0.6622747", "0.66110474", "0.6601079", "0.6600265", "0.65995455", "0.6593624", "0.65919626", "0.65716606", "0.65676874", "0.6561344", "0.6558388", "0.6548186", "0.65341765", "0.65142655", "0.65131354", "0.65031785", "0.648792", "0.64766574", "0.64721406", "0.64618397", "0.64566725", "0.64477456", "0.6443748", "0.64311516", "0.64311516", "0.64292395", "0.64175624", "0.6417408", "0.6412078", "0.6411956", "0.6398272", "0.6394884", "0.6392334", "0.6384039", "0.63824195", "0.63746053", "0.63741076", "0.6373859", "0.6369313", "0.6359953", "0.63579184", "0.63576543", "0.6348769", "0.63431966", "0.6338983", "0.63297135", "0.6326744", "0.63235945", "0.6321007", "0.6317889", "0.63172776", "0.6312917", "0.63100123", "0.6309988", "0.63020307", "0.63000673", "0.62996167", "0.62977076", "0.6290321", "0.6283371" ]
0.65961933
45
Emit buffered events (received and emitted).
emitBuffered() { this.receiveBuffer.forEach(args => this.emitEvent(args)); this.receiveBuffer = []; this.sendBuffer.forEach(packet => this.packet(packet)); this.sendBuffer = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n });\n this.sendBuffer = [];\n }", "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "function buffer(event) {\n var nextTick = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var _buffer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n\n var buffer = _buffer.slice();\n\n var listener = event(function (e) {\n if (buffer) {\n buffer.push(e);\n } else {\n emitter.fire(e);\n }\n });\n\n var flush = function flush() {\n if (buffer) {\n buffer.forEach(function (e) {\n return emitter.fire(e);\n });\n }\n\n buffer = null;\n };\n\n var emitter = new Emitter({\n onFirstListenerAdd: function onFirstListenerAdd() {\n if (!listener) {\n listener = event(function (e) {\n return emitter.fire(e);\n });\n }\n },\n onFirstListenerDidAdd: function onFirstListenerDidAdd() {\n if (buffer) {\n if (nextTick) {\n setTimeout(flush);\n } else {\n flush();\n }\n }\n },\n onLastListenerRemove: function onLastListenerRemove() {\n if (listener) {\n listener.dispose();\n }\n\n listener = null;\n }\n });\n return emitter.event;\n}", "function buffer(event, flushAfterTimeout = false, _buffer = []) {\n let buffer = _buffer.slice();\n let listener = event(e => {\n if (buffer) {\n buffer.push(e);\n }\n else {\n emitter.fire(e);\n }\n });\n const flush = () => {\n buffer === null || buffer === void 0 ? void 0 : buffer.forEach(e => emitter.fire(e));\n buffer = null;\n };\n const emitter = new Emitter({\n onWillAddFirstListener() {\n if (!listener) {\n listener = event(e => emitter.fire(e));\n }\n },\n onDidAddFirstListener() {\n if (buffer) {\n if (flushAfterTimeout) {\n setTimeout(flush);\n }\n else {\n flush();\n }\n }\n },\n onDidRemoveLastListener() {\n if (listener) {\n listener.dispose();\n }\n listener = null;\n }\n });\n return emitter.event;\n }", "function emitBuffer (e) {\n let arraybuffer = req.response\n emitter.emit('buffer', arraybuffer)\n }", "function emitMessages(payloads) {\n\t\tfor (var i = 0; i < payloads.length; i++) {\n\t\t\tvar data = payloads[i]\n\t\t\tif (this.encoding) {\n\t\t\t\tdata = data.toString(this.encoding)\n\t\t\t}\n\t\t\tif (this.paused) {\n\t\t\t\tlogger.info(\n\t\t\t\t\t'buffering', this.name,\n\t\t\t\t\t'length', this.bufferedMessages.length\n\t\t\t\t)\n\t\t\t\tthis.bufferedMessages.push(data)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.emit('data', data)\n\t\t\t}\n\t\t}\n\t}", "function emitData() {\n // While there are `data` listeners and items, emit them\n var item;\n while (this._hasListeners('data') && (item = this.read()) !== null)\n this.emit('data', item);\n // Stop draining the source if there are no more `data` listeners\n if (!this._hasListeners('data') && !this.done) {\n this.removeListener('readable', emitData);\n this._addSingleListener('newListener', waitForDataListener);\n }\n}", "emit(evt) {\n\t\tif (!Duplex.prototype._flush && evt === 'finish') {\n\t\t\tthis._flush((err) => {\n\t\t\t\tif (err) EventEmitter.prototype.emit.call(this, 'error', err);\n\t\t\t\telse EventEmitter.prototype.emit.call(this, 'finish');\n\t\t\t});\n\t\t} else {\n\t\t\tconst args = Array.prototype.slice.call(arguments);\n\t\t\tEventEmitter.prototype.emit.apply(this, args);\n\t\t}\n\t}", "_emitBufferedIceCandidates() {\n if (this._closed) {\n return;\n }\n\n for (const sdpCandidate of this._bufferedIceCandidates) {\n if (!sdpCandidate) {\n continue; // eslint-disable-line no-continue\n }\n\n // Now we have set the MID values of the SDP O/A, so let's fill the\n // sdpMIndex of the candidate.\n sdpCandidate.sdpMIndex = this._mids.keys().next().value;\n\n logger.debug(\n 'emitting buffered \"icecandidate\", candidate:', sdpCandidate);\n\n const event = new yaeti.Event('icecandidate');\n\n event.candidate = sdpCandidate;\n this.dispatchEvent(event);\n }\n\n this._bufferedIceCandidates = [];\n }", "function eventBuffer() {\n clearTimer();\n setInput(event);\n\n buffer = true;\n timer = window.setTimeout(function () {\n buffer = false;\n }, 650);\n }", "function eventBuffer() {\n clearTimer();\n setInput(event);\n\n buffer = true;\n timer = window.setTimeout(function() {\n buffer = false;\n }, 650);\n }", "function drain() {\n if (!cb) return;\n if (abort) callback(abort);else if (!buffer.length && ended) callback(ended);else if (buffer.length) callback(null, buffer.shift());\n } // `callback` calls back to waiting sink,", "pushFromBuffer() {\n let stream = this.stream;\n let chunk = this.buffer.shift();\n // Stream the data\n try {\n this.shouldRead = stream.push(chunk.data);\n }\n catch (err) {\n this.emit(\"error\", err);\n }\n if (this.options.emit) {\n // Also emit specific events, based on the type of chunk\n chunk.file && this.emit(\"file\", chunk.data);\n chunk.symlink && this.emit(\"symlink\", chunk.data);\n chunk.directory && this.emit(\"directory\", chunk.data);\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) {\n /**\n * An internal event emitter.\n */\n this.emitter = new events.EventEmitter();\n /**\n * An internal offset marker to track data offset in bytes of next outgoingHandler.\n */\n this.offset = 0;\n /**\n * An internal marker to track whether stream is end.\n */\n this.isStreamEnd = false;\n /**\n * An internal marker to track whether stream or outgoingHandler returns error.\n */\n this.isError = false;\n /**\n * How many handlers are executing.\n */\n this.executingOutgoingHandlers = 0;\n /**\n * How many buffers have been allocated.\n */\n this.numBuffers = 0;\n /**\n * Because this class doesn't know how much data every time stream pops, which\n * is defined by highWaterMarker of the stream. So BufferScheduler will cache\n * data received from the stream, when data in unresolvedDataArray exceeds the\n * blockSize defined, it will try to concat a blockSize of buffer, fill into available\n * buffers from incoming and push to outgoing array.\n */\n this.unresolvedDataArray = [];\n /**\n * How much data consisted in unresolvedDataArray.\n */\n this.unresolvedLength = 0;\n /**\n * The array includes all the available buffers can be used to fill data from stream.\n */\n this.incoming = [];\n /**\n * The array (queue) includes all the buffers filled from stream data.\n */\n this.outgoing = [];\n if (bufferSize <= 0) {\n throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`);\n }\n if (maxBuffers <= 0) {\n throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`);\n }\n if (concurrency <= 0) {\n throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`);\n }\n this.bufferSize = bufferSize;\n this.maxBuffers = maxBuffers;\n this.readable = readable;\n this.outgoingHandler = outgoingHandler;\n this.concurrency = concurrency;\n this.encoding = encoding;\n }", "constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) {\n /**\n * An internal event emitter.\n */\n this.emitter = new events.EventEmitter();\n /**\n * An internal offset marker to track data offset in bytes of next outgoingHandler.\n */\n this.offset = 0;\n /**\n * An internal marker to track whether stream is end.\n */\n this.isStreamEnd = false;\n /**\n * An internal marker to track whether stream or outgoingHandler returns error.\n */\n this.isError = false;\n /**\n * How many handlers are executing.\n */\n this.executingOutgoingHandlers = 0;\n /**\n * How many buffers have been allocated.\n */\n this.numBuffers = 0;\n /**\n * Because this class doesn't know how much data every time stream pops, which\n * is defined by highWaterMarker of the stream. So BufferScheduler will cache\n * data received from the stream, when data in unresolvedDataArray exceeds the\n * blockSize defined, it will try to concat a blockSize of buffer, fill into available\n * buffers from incoming and push to outgoing array.\n */\n this.unresolvedDataArray = [];\n /**\n * How much data consisted in unresolvedDataArray.\n */\n this.unresolvedLength = 0;\n /**\n * The array includes all the available buffers can be used to fill data from stream.\n */\n this.incoming = [];\n /**\n * The array (queue) includes all the buffers filled from stream data.\n */\n this.outgoing = [];\n if (bufferSize <= 0) {\n throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`);\n }\n if (maxBuffers <= 0) {\n throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`);\n }\n if (concurrency <= 0) {\n throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`);\n }\n this.bufferSize = bufferSize;\n this.maxBuffers = maxBuffers;\n this.readable = readable;\n this.outgoingHandler = outgoingHandler;\n this.concurrency = concurrency;\n this.encoding = encoding;\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function drainBuffer () {\n draining = true;\n\n return co(function* () {\n while (buffer.length >= bufferSize || (lastCallback && buffer.length > 0)) {\n const packet = yield getPacket();\n const res = onPacket(packet);\n if (res instanceof Promise) {\n yield res;\n }\n }\n\n draining = false;\n });\n }", "function tick () {\n var stream\n return stream = through(function (data) {\n process.nextTick(function () {\n stream.emit('data', data)\n })\n }, function () {\n process.nextTick(function () {\n stream.emit('end', data)\n })\n })\n}", "async triggerOutgoingHandler(buffer) {\n const bufferLength = buffer.size;\n this.executingOutgoingHandlers++;\n this.offset += bufferLength;\n try {\n await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength);\n }\n catch (err) {\n this.emitter.emit(\"error\", err);\n return;\n }\n this.executingOutgoingHandlers--;\n this.reuseBuffer(buffer);\n this.emitter.emit(\"checkEnd\");\n }", "async triggerOutgoingHandler(buffer) {\n const bufferLength = buffer.size;\n this.executingOutgoingHandlers++;\n this.offset += bufferLength;\n try {\n await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength);\n }\n catch (err) {\n this.emitter.emit(\"error\", err);\n return;\n }\n this.executingOutgoingHandlers--;\n this.reuseBuffer(buffer);\n this.emitter.emit(\"checkEnd\");\n }", "function drain () {\n if (!cb) return\n\n if (abort) callback(abort)\n else if (!buffer.length && ended) callback(ended)\n else if (buffer.length) callback(null, buffer.shift())\n }", "function drain () {\n if (!cb) return\n\n if (abort) callback(abort)\n else if (!buffer.length && ended) callback(ended)\n else if (buffer.length) callback(null, buffer.shift())\n }", "function drain () {\n if (!cb) return\n\n if (abort) callback(abort)\n else if (!buffer.length && ended) callback(ended)\n else if (buffer.length) callback(null, buffer.shift())\n }", "function drain () {\n if (!cb) return\n\n if (abort) callback(abort)\n else if (!buffer.length && ended) callback(ended)\n else if (buffer.length) callback(null, buffer.shift())\n }", "function drain () {\n if (!cb) return\n\n if (abort) callback(abort)\n else if (!buffer.length && ended) callback(ended)\n else if (buffer.length) callback(null, buffer.shift())\n }", "function flushBuffer() {\n if (!currentBuffer) {\n return;\n }\n\n const data = currentBuffer; // Reset buffer.\n\n currentBuffer = ''; // Process data.\n\n const lines = formatter.pipe(data);\n\n for (const line of lines) {\n // Log parsed results.\n _log().default.log(line);\n }\n }", "async buffer() {\n if (this.#gen) {\n throw new Error(\"Cannot not switch from non-buffer to buffer mode\");\n }\n this.#isBuffering = true;\n this.#isStarted = true;\n this.#gen = this.#iterable[Symbol.asyncIterator]();\n let value = void 0;\n do {\n this.#next = this.#gen.next();\n try {\n value = await this.#next;\n this.#queue.push(value);\n } catch (e) {\n this.#error = e;\n }\n } while (value && !value.done);\n }", "function emitter() {\n\tvar i;\n\t// store stringified data\n\t// append new line character so can determine end of JSON object\n\tstringified = JSON.stringify(bobj) + '\\n';\n\t// emit data on every socket connection in eList\n\tfor (i in eList)\n\t\teList[i].write(stringified);\n\t// cleanup\n\tstringified = '';\n\tbobj = {};\n}", "collect () {\n const buf = []\n buf.dataLength = 0\n this.on('data', c => {\n buf.push(c)\n buf.dataLength += c.length\n })\n return this.promise().then(() => buf)\n }", "function onEmptyBuffer(stream) {\n var state = stream._writableState;\n if (state.ending) {\n emitFinish(stream);\n } else if (state.needDrain) {\n emitDrain(stream);\n }\n}", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it", "function onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n} // if there's something in the buffer waiting, then process it" ]
[ "0.81823784", "0.8137464", "0.8137464", "0.8026419", "0.7090655", "0.6554891", "0.64418477", "0.62802976", "0.6275241", "0.6170106", "0.60873294", "0.5932964", "0.5926397", "0.5884234", "0.5846472", "0.5810155", "0.578966", "0.578966", "0.57637584", "0.5746689", "0.5746689", "0.57262933", "0.57262933", "0.5721845", "0.5721845", "0.5721845", "0.5721845", "0.56818986", "0.56503105", "0.56387806", "0.56387806", "0.56165785", "0.56165785", "0.56165785", "0.56165785", "0.56165785", "0.55827326", "0.5528666", "0.5526401", "0.5509047", "0.5476915", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626", "0.541626" ]
0.8205933
0
Called upon server disconnect.
ondisconnect() { debug("server disconnect (%s)", this.nsp); this.destroy(); this.onclose("io server disconnect"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "handleDisconnect() {\n\t\tdebug(\n\t\t\t'warn: ' + ((this.fromServer)?'server':'client') + \n\t\t\t' connection lost'\n\t\t);\n\t\tthis.emit('disconnect');\n\t\tthis.emit('disconnection');\n\t\tthis.socket = null;\n\t}", "function onDisconnect(socket) {\n\t\n}", "ondisconnect() {\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "function _onDisconnect(socket) {\n}", "function disconnectFromServer() {\n\tconsole.log(\"disconnectFromServer\");\t\n\tclientObj.disconnect();\n\tonPageLoad();\n\tclearSubs();\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onSocketDisconnect() {\n console.log('Disconnected from socket server');\n}", "disconnect(){}", "onDisconnect(socket) {\n\n }", "clientDisconnected() {\n this.clear();\n this.emit('disconnect');\n }", "function clientDisconnect() {\r\n delete clients[connection.remoteAddress];\r\n console.log('connection closed: ' + remoteAddress + \" \" + now.getHours() + \":\" + now.getMinutes() + \":\" + now.getSeconds());\r\n\r\n\r\n }", "disconnect() { }", "disconnect() { }", "disconnect() { }", "function onDisconnect() {\n pruneConnectionsMap();\n}", "function disconnect(){\r\n\tconn.disconnect();\r\n}", "_onDisconnect () {\n this._disconnectEvents();\n }", "function disconnect() {\r\n\t\t console.log('disconnect!');\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\r\n\t\t onConnectionSuccess);\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_FAILED,\r\n\t\t onConnectionFailed);\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\r\n\t\t disconnect);\r\n\t\t}", "function onSocketClose(message) {\n say(\"Disconnected from the server\");\n }", "disconnected() {\n // implement if needed\n }", "handleDisconnection() {}", "onDisconnect()\n {\n this.connected = false;\n this.clearStates();\n this.emit(Connection.onDisconnect);\n }", "disconnectedCallback() { }", "function onDisconnect() {\n disconnected.value = true;\n self.disconnected = disconnected;\n $log.log(\"monitor is disconnected\");\n }", "disconnectedCallback() {\n // Attach callback:\n this._pipeCallback('onDisconnect');\n }", "disconnectedCallback(){\n \n }", "disconnectedCallback(){\n \n }", "disconnectedCallback(){\n \n }", "disconnectedCallback () {}", "onDisconnected() {\n if (!this.connected) return\n this.multiplexer.stop()\n // We need to unset the id in order to receive an immediate response with new\n // client id when reconnecting.\n this.id = undefined\n this.connected = false\n log('disconnected')\n this.emit('disconnected')\n }", "disconnectedCallback(){}", "disconnectedCallback(){}", "disconnectedCallback(){}", "disconnectedCallback() {}", "disconnectedCallback() {}", "function disconnecting( connection ) {\n}", "disconnectedCallback() {\n \n }", "onDisconnect() {\n console.log(\"WS Closed\")\n }", "disconnect() {\n this._disconnect();\n }", "disconnect() { socket_close(this) }", "disconnectedCallback(){\n\t\t\t\n\t\t}", "async disconnect () {\n this.connection.end()\n this.socket.end()\n this.server.onDisconnected()\n return this._destroy()\n }", "function onDisconnect(socket) {\n console.log(\"Disconnection process$$$$$$$\")\n socket.disconnect();\n}", "onDisconnect(socket) {\n Logger.logInfo('socket ' + socket.id + ' disconnected');\n }", "disconnectedCallback () {\n }", "onClientDisconnected() {\n NotificationManager.error(\n \"Connection Lost from server please check your connection.\",\n \"Error!\"\n );\n }", "disconnectedCallback()\n\t{\n\n\t}", "disconnectedCallback()\n\t{\n\n\t}", "disconnectedCallback()\n\t{\n\n\t}", "disconnectedCallback()\n\t{\n\n\t}", "function onClientDisconnect() {\r\n\tconsole.log(\"Client has disconnected: \"+this.id);\r\n\tvar nsp = url.parse(this.handshake.headers.origin).hostname;\r\n\t// Broadcast removed player to connected socket clients\r\n\tio.of(nsp).emit(\"userLeft\",{id: this.id});\r\n}", "disconnect() {\n console.log(\"disconnect!\");\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\n this.onConnectionSuccess.bind(this)\n );\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_FAILED,\n this.onConnectionFailed.bind(this)\n );\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\n this.disconnect.bind(this)\n );\n\n this.disconnectedFunction();\n }", "disconnectedCallback() {\n super.disconnectedCallback();\n }", "function disconnect() {\n console.log(\"Good Bye!\");\n connection.end(); //// END CONNECTION ////\n}", "function disconnect(){\r\n console.log('Bot disconnected! Disconnecting from server!');\r\n server.close();\r\n}", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n this._onDisconnectedCallback();\n }", "disconnectedCallback () {\n\n }", "_handleDisconnect() {\n debug(\"Disconnected from TCP connection to node \" + this._node.id());\n if (this._active) {\n this._connecting = true;\n } else {\n this._connecting = false;\n }\n this.emit(\"disconnect\");\n }", "disconnectedCallback() {\n super.disconnectedCallback();\n }", "function onDisconnect() {\n console.log(\"Disconnected!\");\n process.exit();\n}", "disconnected() {}", "function disconnect() {\n console.log('INFO (join.js): Connection disconnect!');\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\n onConnectionSuccess);\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_FAILED,\n onConnectionFailed);\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\n disconnect);\n}", "async destroy() {\n\t\tthis.disconnect()\n\t\tthis.updateStatus('disconnected')\n\t}", "disconnectedCallback() {\n\n }", "disconnectedCallback() {\n\n }", "disconnectedCallback() {\n //\n }", "onDisconnect(delegate) {\n this.disconnected = delegate\n }", "onDisconnect() {\n this.setState({\n connected: false,\n serverResponse: {\n event: '',\n status: '',\n timestamp: ''\n }\n });\n }", "async disconnect() {\n if (this._updateInvalidatedAccessories) { // Should come first, as other operations might take some time.\n clearInterval(this._updateInvalidatedAccessories);\n this._updateStatuses = undefined;\n }\n\n if (this._db) {\n this._db.close();\n this._db = undefined;\n }\n\n if (this._client) {\n this._client.disconnect();\n this._client = undefined;\n }\n\n if (this._publisher) {\n this._publisher.publish(PubSubEvents.SERVER_PUB_DISCONNECTED,\n JSON.stringify(this._options.homeId), () => {\n this._publisher.quit();\n this._publisher = undefined;\n });\n }\n\n if (this._subscriber) {\n this._subscriber.unsubscribe(PubSubEvents.SERVER_SUB_INTERACT);\n this._subscriber.quit();\n }\n\n this._updateStatuses = undefined;\n this.emit('disconnect');\n }", "disconnectedCallback() {\n }", "disconnectedCallback() {\n }", "_onDisconnected() {\n this._watcher.stop();\n this.emit(\"disconnected\");\n }", "onClientDisconnected(callback) {\n this.discCallback = callback;\n }", "function disconnect() {\n conn.close();\n conn = null;\n}", "function disconnect () {\n client.end(err => {\n console.log('Disconnected from database');\n\n if (err) {\n console.log('There was an error during disconnection', err.stack);\n }\n });\n}", "disconnectedCallback() {\n this.unsubscribeToMessageChannel();\n }", "disconnect() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\n\t\tif(this._reconnectTimer) {\n\t\t\tclearTimeout(this._reconnectTimer);\n\t\t\tthis._reconnectTimer = null;\n\t\t}\n\t\tif(this.__netstatTimer) {\n\t\t\tclearInterval(this.__netstatTimer);\n\t\t\tthis.__netstatTimer = null;\n\t\t\tthis._measureSpeed();\n\t\t}\n\n\t\tif(this._socket.destroyed) return;\n\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\n\t\tthis._socket.removeAllListeners('end');\n\t\tthis._socket.removeAllListeners('close');\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\n\t\tthis.emit('disconnected');\n\t\tthis.status = \"Disconnected\";\n\t}", "function onDisconnect(socket) {\n\t\tlogger.info({ type : loggerType, msg : \"Socket Disconnected\"});\n\t\tif(socket.decoded_token) {\n\t\t}\n\t}", "disconnectedCallback () {\n console.log('disconnected')\n }", "disconnectedCallback() {\r\n\t\t\tconsole.log(\"deleted\");\r\n\t\t}", "function terminate() {\n console.log('[client disconnected]', clientID);\n //stop sending metadata\n clearInterval(metadataTimer);\n //disconnect websocket if not already\n if (me.readyState === WebSocket.CONNECTING || me.readyState === WebSocket.OPEN) {\n me.terminate();\n }\n //clean up connections to channels\n for (const id of connectedChannels) {\n disconnect(id);\n }\n }", "onDisconnected() {\n this.status = STATUS_DISCONNECTED;\n }", "onclose(reason) {\n debug(\"close (%s)\", reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n super.emit(\"disconnect\", reason);\n }", "disconnectedCallback() {\r\n console.log('disconnectedCallback called')\r\n }", "socket_disconnect() {\n console.log(\"disconnected\", this._vm.$socket);\n }", "function onSocketClose() {\n let data = _data.get(this);\n let error = data.error;\n\n data.error = null;\n data.socket = null;\n data.connected = false;\n\n _data.set(this, data);\n\n setImmediate(this.emit.bind(this, 'disconnected', error));\n}", "disconnectedCallback() {\n console.log('disconnectedCallback called')\n }", "disconnectedCallback() {\n console.log(\"disconnected Callback called\")\n\n }", "function onclose() {\n onerror(\"socket closed\");\n }", "disconnect() {\n if (!this.stopped) {\n this.socket.disconnect();\n this.stopped = true;\n }\n }" ]
[ "0.82543766", "0.82543766", "0.81796277", "0.79097027", "0.78504634", "0.7839723", "0.7777871", "0.77664375", "0.7764524", "0.7764524", "0.7764524", "0.7764524", "0.7650259", "0.7625111", "0.7618517", "0.7608362", "0.75884503", "0.7566464", "0.7566464", "0.7566464", "0.7512196", "0.7483856", "0.7443297", "0.7436097", "0.7421649", "0.7351604", "0.7341826", "0.7322088", "0.73216677", "0.7314381", "0.72749954", "0.72534794", "0.72534794", "0.72534794", "0.7244182", "0.7242753", "0.7237228", "0.7237228", "0.7237228", "0.7223383", "0.7223383", "0.7215979", "0.7214051", "0.7200133", "0.7176002", "0.71623594", "0.7143266", "0.7142433", "0.7135311", "0.7126427", "0.7116685", "0.71158576", "0.71069515", "0.71069515", "0.71069515", "0.71069515", "0.710536", "0.7102255", "0.7093062", "0.70850295", "0.7080354", "0.70797265", "0.70797265", "0.70797265", "0.70797265", "0.70535403", "0.7047106", "0.7046635", "0.70381576", "0.7033562", "0.70316046", "0.7028799", "0.70268595", "0.7025583", "0.7025583", "0.7024284", "0.70116657", "0.70105726", "0.7009725", "0.69907856", "0.69907856", "0.6977827", "0.69665265", "0.69627726", "0.6953267", "0.6950483", "0.69367605", "0.6923377", "0.6913532", "0.68993276", "0.68928033", "0.6892658", "0.6867949", "0.6859537", "0.68391705", "0.68356436", "0.68352425", "0.6811097", "0.6779665", "0.6775625" ]
0.8121433
3
Called upon forced client/server side disconnections, this method ensures the manager stops tracking us and that reconnections don't get triggered for this.
destroy() { if (this.subs) { // clean subscriptions to avoid reconnections this.subs.forEach(subDestroy => subDestroy()); this.subs = undefined; } this.io["_destroy"](this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async disconnect() {\n if (this._updateInvalidatedAccessories) { // Should come first, as other operations might take some time.\n clearInterval(this._updateInvalidatedAccessories);\n this._updateStatuses = undefined;\n }\n\n if (this._db) {\n this._db.close();\n this._db = undefined;\n }\n\n if (this._client) {\n this._client.disconnect();\n this._client = undefined;\n }\n\n if (this._publisher) {\n this._publisher.publish(PubSubEvents.SERVER_PUB_DISCONNECTED,\n JSON.stringify(this._options.homeId), () => {\n this._publisher.quit();\n this._publisher = undefined;\n });\n }\n\n if (this._subscriber) {\n this._subscriber.unsubscribe(PubSubEvents.SERVER_SUB_INTERACT);\n this._subscriber.quit();\n }\n\n this._updateStatuses = undefined;\n this.emit('disconnect');\n }", "function onDisconnect() {\n pruneConnectionsMap();\n}", "handleDisconnect() {\n\t\tdebug(\n\t\t\t'warn: ' + ((this.fromServer)?'server':'client') + \n\t\t\t' connection lost'\n\t\t);\n\t\tthis.emit('disconnect');\n\t\tthis.emit('disconnection');\n\t\tthis.socket = null;\n\t}", "handleDisconnection() {}", "onBeforeDisconnect() {\n mainLog.info('Disconnecting from Lightning gRPC service')\n this.unsubscribe()\n if (this.service) {\n this.service.close()\n }\n }", "function clientDisconnect() {\r\n delete clients[connection.remoteAddress];\r\n console.log('connection closed: ' + remoteAddress + \" \" + now.getHours() + \":\" + now.getMinutes() + \":\" + now.getSeconds());\r\n\r\n\r\n }", "disconnect() {\n this.shouldReconnect = false;\n this._listenersMap = new Map();\n this.closeAllConnections()\n }", "disconnect() {\n // Clean the listener.\n this.lightSensor.listen(undefined);\n return this._client.cleanup()\n .catch(err => {\n console.log(err);\n });\n }", "_disconnect() {\n /* istanbul ignore next */\n if (this._type === ServiceType.LOCAL) {\n throw new Error('_disconnect must not be called on a Local Service');\n }\n\n if (this._state.inState(ServiceState.AUTHENTICATING)) {\n this._deauthenticate();\n }\n\n if (\n this._state.inState([\n ServiceState.READY,\n ServiceState.ONLINE,\n ServiceState.CONNECTING\n ])\n ) {\n this._authPromise = null;\n this._connectPromise = null;\n\n this._state.transitionTo(ServiceState.OFFLINE);\n }\n }", "onClientDisconnected() {\n NotificationManager.error(\n \"Connection Lost from server please check your connection.\",\n \"Error!\"\n );\n }", "handleServerStop() {\n this.activeStartingResource = null;\n this.activeStartingTime = null;\n }", "onDisconnected() {\n if (!this.connected) return\n this.multiplexer.stop()\n // We need to unset the id in order to receive an immediate response with new\n // client id when reconnecting.\n this.id = undefined\n this.connected = false\n log('disconnected')\n this.emit('disconnected')\n }", "_onDisconnect () {\n this._disconnectEvents();\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "ondisconnect() {\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "function terminate() {\n console.log('[client disconnected]', clientID);\n //stop sending metadata\n clearInterval(metadataTimer);\n //disconnect websocket if not already\n if (me.readyState === WebSocket.CONNECTING || me.readyState === WebSocket.OPEN) {\n me.terminate();\n }\n //clean up connections to channels\n for (const id of connectedChannels) {\n disconnect(id);\n }\n }", "disconnectedCallback () {\n this.log_('disconnected');\n\n // Clear all timers.\n this.forEachTimeoutID_((id) => {\n this.clearTimeout(id);\n });\n\n this.connected_ = false;\n }", "disconnect(details) {\n if (this._messageHandler)\n window.removeEventListener(\"message\", this._messageHandler);\n if (!this._disconnected) {\n this._disconnected = true;\n if (typeof this._frame !== \"undefined\") {\n this._frame.parentNode.removeChild(this._frame);\n } // otherwise farme is not yet created\n this._fire(\"disconnected\", details);\n }\n if (this._peer_id && all_connections[this._peer_id])\n delete all_connections[this._peer_id];\n }", "_onDisconnected() {\n this._watcher.stop();\n this.emit(\"disconnected\");\n }", "disconnect () {\n // close all data tunnel\n this.userTunnel.off();\n this.messageTunnel.off();\n this.channelStatusTunnel.off();\n this.removeAllListeners();\n }", "async destroy() {\n\t\tthis.disconnect()\n\t\tthis.updateStatus('disconnected')\n\t}", "function disconnectFromServer() {\n\tconsole.log(\"disconnectFromServer\");\t\n\tclientObj.disconnect();\n\tonPageLoad();\n\tclearSubs();\n}", "stop() {\n logger.info('OnlineStateManager: stop');\n this.isClientReady = false;\n this._clearCheck();\n this._changeToOffline();\n }", "function onDisconnect() {\n disconnected.value = true;\n self.disconnected = disconnected;\n $log.log(\"monitor is disconnected\");\n }", "disconnect() {\n let _this = this;\n\n _this._continuousOpen = false;\n if (_this._sock) {\n _this._sendClose();\n }\n }", "stopTracking() {\n HyperTrack.onTrackingStop();\n }", "componentWillUnmount() {\n\t\tthis.linksTracker.stop(); // stops the auto tracker from running after the component is closed\n\t}", "async onPostStop () {\n await this.disconnectFromDatabase()\n }", "disconnect() {\n\t\tif (this.client === undefined) {\n\t\t\treturn\n\t\t}\n\t\tthis.client.disconnect()\n\t\tthis.portalId = undefined\n\t\tthis.client.end()\n\t}", "clientDisconnected() {\n this.clear();\n this.emit('disconnect');\n }", "disconnect () {\n if (this.isConnected()) {\n this.logEvent(`Closing IoT connection of client ${this.clientId}`);\n this.connection.end();\n // FIXME(ikajaste): Disconnect does stop events, but fails somehow - the connection remains:\n // (this.connection.connected returns true)\n } else {\n // debug\n this.logEvent(`Client ${this.clientId} is not connected, so no need to disconnect.`);\n }\n }", "resetDisconnectionTimeout() {\n\t\tif (this.mAutoDisconnectAfter <= 0) {return;}\n\t\tif (this.mAutoDisconnectionTimeoutHandler) {clearTimeout(this.mAutoDisconnectionTimeoutHandler)}\n\t\tthis.mAutoDisconnectionTimeoutHandler = setTimeout(() => {\n\t\t\tif (this.mWS.readyState === WebSocket.OPEN) {this.mWS.close(1000);}\n\t\t}, this.mAutoDisconnectAfter);\n\t}", "function disconnect() {\n\t\tthis._observer.disconnect();\n\t}", "_keepAlive() {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, () => `[CLIENT] _keepAlive() ${this._state}/${this._currentConnectionStartTime}`);\n if (this._state === exports.ClientState.ACTIVE && this._currentConnectionStartTime) {\n const now = Date.now();\n const lastPacketDuration = now - (this._lastPacketTime || this._currentConnectionStartTime);\n const lastStatePacketDuration = now - (this._lastStatePacketTime || this._currentConnectionStartTime);\n if (lastPacketDuration > this._options.silenceTimeout\n || (this._choseToLogIn && lastStatePacketDuration > this._options.stateSilenceTimeout)) {\n if (this._client !== undefined) {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, () => `[CLIENT] _keepAlive silence tripped, lastPacket: ${lastPacketDuration}, lastStatePacket: ${lastStatePacketDuration}`);\n const msg = `Server has not responded for too long, forcing disconnect`;\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.INFO, msg);\n this._disconnected(msg);\n }\n }\n else {\n this.TxCmd(constants.FCTYPE.NULL, 0, 0, 0);\n }\n }\n }", "_stopTrackingTask() {\n // Disable timeout on control socket if there is no task active.\n this.socket.setTimeout(0);\n this._task = undefined;\n }", "function contextDisposedListener() {\n goog.log.warning(logger, 'Connection to the server app was shut down');\n context = null;\n stopWork();\n}", "_reset() {\n this.log(\"Closing connections.\");\n this._stopTrackingTask();\n this._partialResponse = \"\";\n this._closeSocket(this._socket);\n this._closeSocket(this._dataSocket);\n // Set a new socket instance to make reconnecting possible.\n this.socket = new Socket();\n }", "disconnect() {\n this._disconnect();\n }", "_onDisconnectTimeout() {\n this._abortAllRequests();\n }", "close() {\n this.connection.sendBeacon({type: 'disconnect', session: this.sessionId})\n this.messageSubscription.unsubscribe()\n clearTimeout(this.resendReportTimer)\n clearInterval(this.performPurgeTimer)\n clearTimeout(this.changeReportDebounceTimer)\n }", "dispose() {\n this.rtc.removeListener(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_5___default.a.ENDPOINT_CONN_STATUS_CHANGED, this._onEndpointConnStatusChanged);\n\n if (_browser__WEBPACK_IMPORTED_MODULE_4__[\"default\"].supportsVideoMuteOnConnInterrupted()) {\n this.rtc.removeListener(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_5___default.a.REMOTE_TRACK_MUTE, this._onTrackRtcMuted);\n this.rtc.removeListener(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_5___default.a.REMOTE_TRACK_UNMUTE, this._onTrackRtcUnmuted);\n this.conference.off(_JitsiConferenceEvents__WEBPACK_IMPORTED_MODULE_1__[\"TRACK_ADDED\"], this._onRemoteTrackAdded);\n this.conference.off(_JitsiConferenceEvents__WEBPACK_IMPORTED_MODULE_1__[\"TRACK_REMOVED\"], this._onRemoteTrackRemoved);\n }\n\n this.conference.off(_JitsiConferenceEvents__WEBPACK_IMPORTED_MODULE_1__[\"LAST_N_ENDPOINTS_CHANGED\"], this._onLastNChanged);\n this.rtc.removeListener(_service_RTC_RTCEvents__WEBPACK_IMPORTED_MODULE_5___default.a.LASTN_VALUE_CHANGED, this._onLastNValueChanged);\n this.conference.off(_JitsiConferenceEvents__WEBPACK_IMPORTED_MODULE_1__[\"P2P_STATUS\"], this._onP2PStatus);\n this.conference.off(_JitsiConferenceEvents__WEBPACK_IMPORTED_MODULE_1__[\"USER_LEFT\"], this._onUserLeft);\n const participantIds = Object.keys(this.trackTimers);\n\n for (const participantId of participantIds) {\n this.clearTimeout(participantId);\n this.clearRtcMutedTimestamp(participantId);\n }\n\n for (const id in this.connectionStatusMap) {\n if (this.connectionStatusMap.hasOwnProperty(id)) {\n this.onUserLeft(id);\n }\n } // Clear RTC connection status cache\n\n\n this.connStatusFromJvb = {};\n }", "function disconnectObserver() {\n if (!isObserverActive) {\n console.warn(\"Tried stopping the observer, but it was already stopped.\");\n return;\n }\n observer.disconnect();\n isObserverActive = false;\n}", "disconnected() {\n this.unsubscribe?.();\n delete this.unsubscribe;\n delete this.baseObject;\n delete this.property;\n delete this.replica;\n delete this.path;\n }", "disconnect() {\n try {\n if (this._connector) {\n this._connector.$disconnect();\n }\n } catch(e) {\n /* ignore any error */\n }\n }", "_setDisconnected() {\n debug(`Disconnected from ${this.name} (${this.id})`);\n\n this._channel = null;\n this._connected = false;\n this.notify('connected');\n\n this._plugins.forEach(async (plugin) => plugin.disconnected());\n }", "onDisconnect()\n {\n this.connected = false;\n this.clearStates();\n this.emit(Connection.onDisconnect);\n }", "function unload() {\n deleteStatusOverlays();\n Controller.mousePressEvent.disconnect(onMousePressEvent);\n Window.geometryChanged.disconnect(onWindowResize);\n MyAvatar.wentAway.disconnect(onWentAway);\n MyAvatar.wentActive.disconnect(onWentActive);\n MyAvatar.displayNameChanged.disconnect(updateStatus);\n HMD.displayModeChanged.disconnect(onDisplayModeChanged);\n Window.domainChanged.disconnect(onDomainChanged);\n if (heartbeat) {\n Script.clearTimeout(heartbeat);\n heartbeat = false;\n }\n }", "disconnect() {\n if (!_.isNil(this._dataChanel)) {\n this._dataChanel.close();\n }\n if (!_.isNil(this._receiveChanel)) {\n this._receiveChanel.close();\n }\n if (!_.isNil(this._pc)) {\n this._pc.close();\n }\t\n try {\n this._pc = null;\n } catch (e) {};\n\t}", "componentWillUnmount() {\n if(this.client !== null)\n {\n this.client.disconnect();\n this.client = null;\n }\n\n\n }", "disconnectedCallback() { \n this.remove();\n //this.disconnectObserver();\n }", "function cleanup () {\n debug.response('cleanup');\n socket.removeListener('close', onclientclose);\n socket.removeListener('error', onclienterror);\n socket.removeListener('end', onclientend);\n if (target) {\n target.removeListener('connect', ontargetconnect);\n target.removeListener('close', ontargetclose);\n target.removeListener('error', ontargeterror);\n target.removeListener('end', ontargetend);\n }\n }", "async onUnload(callback) {\n try {\n clearTimeout(this.polling);\n if (this.restartTimer) {\n clearTimeout(this.restartTimer);\n }\n this.log.info(`[END] Stopping sonnen this...`);\n await this.setStateAsync(`info.connection`, false, true);\n callback();\n }\n catch (_a) {\n callback();\n }\n }", "disconnect() {\n if (!this.active) return;\n this.observer.disconnect();\n this.active = false;\n }", "disconnect() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\n\t\tif(this._reconnectTimer) {\n\t\t\tclearTimeout(this._reconnectTimer);\n\t\t\tthis._reconnectTimer = null;\n\t\t}\n\t\tif(this.__netstatTimer) {\n\t\t\tclearInterval(this.__netstatTimer);\n\t\t\tthis.__netstatTimer = null;\n\t\t\tthis._measureSpeed();\n\t\t}\n\n\t\tif(this._socket.destroyed) return;\n\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\n\t\tthis._socket.removeAllListeners('end');\n\t\tthis._socket.removeAllListeners('close');\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\n\t\tthis.emit('disconnected');\n\t\tthis.status = \"Disconnected\";\n\t}", "disconnectedCallback() {\n unsubscribe(this.subscription);\n this.subscription = null;\n }", "disconnect(){}", "teardown() {\n\t\tclearInterval(this._heartbeatPing);\n\t\tthis.ws.close();\n\t}", "disconnectedCallback () {\n window.removeEventListener('startTimer', this._countdown)\n window.removeEventListener('stopTimer', this._stopTimer)\n }", "function disconnect() {\r\n\t\t console.log('disconnect!');\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\r\n\t\t onConnectionSuccess);\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_FAILED,\r\n\t\t onConnectionFailed);\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\r\n\t\t disconnect);\r\n\t\t}", "_disconnectEvents () {\n this._socket.off('sensorChanged', this._onSensorChanged);\n this._socket.off('deviceWasClosed', this._onDisconnect);\n this._socket.off('disconnect', this._onDisconnect);\n }", "disconnectedCallback() {\n console.log('Clean up work can be done here for example.');\n }", "_stopTrackingTask() {\n // Disable timeout on control socket if there is no task active.\n this.enableControlTimeout(false);\n this._task = undefined;\n this._handler = undefined;\n }", "destroy() {\n\t\tif (this.socket !== undefined) {\n\t\t\tif (!this.model.legacy_dvip) {\n\t\t\t\t//this.socket.send(this.disconnect_packet);\n\t\t\t}\n\t\t\tthis.socket.destroy();\n\t\t}\n\t\tif (this.socket_realtime !== undefined) {\n\t\t\tif (!this.model.legacy_dvip) {\n\t\t\t\t//this.socket_realtime.send(this.disconnect_packet);\n\t\t\t}\n\t\t\tthis.socket_realtime.destroy();\n\t\t}\n\t\tif (this.socket_request !== undefined) {\n\t\t\tthis.socket_request.destroy();\n\t\t}\n\t\tdebug('destroy', this.id);\n\t}", "disconnectDevice() {\n appClient.disconnectDevice();\n logger.info({\n METHOD: disconnectDevice,\n MESSAGE: \"Disconnect appClient\",\n DATE: this.getCurrentDateString(),\n TIME: this.getCurrentTimeString()\n });\n }", "function disconnect() {\n if (client != null) {\n client.close();\n client = undefined;\n db = undefined;\n debug('Disconnected from MongoDB');\n }\n }", "__broker_disconnecting(client) {\n console.log('[HubManager MQTT] clientDisconnecting : ', client.id);\n // callback needed?... TODO\n }", "onUnload(callback) {\n try {\n this.unsubscribeFromVolumioNotifications();\n // Here you must clear all timeouts or intervals that may still be active\n if (this.checkConnectionInterval) {\n clearInterval(this.checkConnectionInterval);\n this.checkConnectionInterval = null;\n }\n // terminate express http server\n this.httpServerInstance.close();\n callback();\n }\n catch (e) {\n callback();\n }\n }", "onDisconnected() {\n this.status = STATUS_DISCONNECTED;\n }", "function cleanup() {\n if (socket) {\n socket.close(function(err) {\n if (err) {\n log('ERROR: could not close server: ' + err);\n } else {\n log('INFO: server closed');\n }\n });\n }\n\n if (converseTimer) {\n clearInterval(converseTimer);\n }\n\n if (bcastTimer) {\n clearTimeout(bcastTimer);\n }\n}", "disconnect() {\n this.observer.disconnect();\n }", "disconnectedCallback() {\n // If timer exists\n if (this.timerId) {\n // Clear timer\n clearInterval(this._timerId);\n\n // Remove timer id\n delete this._timerId;\n }\n }", "disconnect() {\n this.emit('closing');\n this.sendVoiceStateUpdate({\n channel_id: null,\n });\n this.player.destroy();\n this.cleanup();\n this.status = Constants.VoiceStatus.DISCONNECTED;\n /**\n * Emitted when the voice connection disconnects.\n * @event VoiceConnection#disconnect\n */\n this.emit('disconnect');\n }", "stop() {\n server.logoutConnection(this.connection, this.user);\n }", "disconnected() {\n // implement if needed\n }", "disconnected(state){\n\t\tif(this.heartbeat) this.heartbeat.destroy();\n\t\tif(this.listenChannel) this.listenChannel.unsubscribe();\n\t}", "userStopTracking() {\n log.info(logger, \"user clicked stop tracking\");\n stopTracking(() => {\n log.info(logger, \"stop tracking callback from core\");\n this.userTracking = false;\n });\n }", "disconnect() {\n this.connection.destroy()\n }", "disconnected(){\n if(this.charge === true){\n this.charge = false;\n if(this.intervalCharging !== 0) {\n window.clearInterval(this.intervalCharging);\n }\n }\n }", "disconnect() {\n this.emit('closing');\n this.sendVoiceStateUpdate({\n channel_id: null,\n });\n\n this._disconnect();\n }", "__broker_disconnected(client) {\n console.log('[HubManager MQTT] ' + client.id + ' is now disconnected');\n if (that.discCallback != null) {\n that.discCallback(client);\n }\n }", "disconnect() {\n let node = this;\n if (node.targetc > 0) return;\n if (!node.tracker.gc.isGcPhase)\n return node.tracker.gc.schedule(node);\n\n // if canDisconnect explicitly returns falsy (not undefined), we won't clear value\n if (isFalsy(node.callHandler(node.handlers.canDisconnect))) return;\n\n // if onDisconnected returns truthy we will clear value (default behavior if nothing returned)\n if (!isFalsy(node.callHandler(node.handlers.onDisconnected)))\n node.value = undefined;\n }", "disconnectedCallback() {\n this._initialized = false // important for loading charts !\n if (this.updateTimer) {\n clearInterval(this.updateTimer)\n }\n }", "disconnectedCallback() {\n this._initialized = false // important for loading charts !\n if (this.updateTimer) {\n clearInterval(this.updateTimer)\n }\n }", "disconnectedCallback() {\n this._initialized = false // important for loading charts !\n if (this.updateTimer) {\n clearInterval(this.updateTimer)\n }\n }", "dispose() {\n if (this.stompClient) {\n this.stompClient.disconnect(function() {\n console.log('disconnected.');\n });\n }\n }", "function onClientDisconnect() {\r\n\tconsole.log(\"Client has disconnected: \"+this.id);\r\n\tvar nsp = url.parse(this.handshake.headers.origin).hostname;\r\n\t// Broadcast removed player to connected socket clients\r\n\tio.of(nsp).emit(\"userLeft\",{id: this.id});\r\n}", "destroy() {\n var _a;\n try {\n (_a = this.debug) === null || _a === void 0 ? void 0 : _a.call(this, 'destroyed');\n this.setHeartbeatInterval(-1);\n this.ws.close(1000);\n }\n catch (error) {\n this.emit('error', error);\n }\n }", "function onDisconnect(socket) {\n console.log(\"Disconnection process$$$$$$$\")\n socket.disconnect();\n}", "function cleanup() {\n sendCommand(\"cleanup\");\n window.removeEventListener(\"message\", onMessage);\n $(\"#primeplayerinjected\").remove();\n $(\"#main\").off(\"DOMSubtreeModified mouseup\");\n ratingContainer.off(\"click\");\n $(window).off(\"hashchange\");\n for (var i = 0; i < observers.length; i++) {\n observers[i].disconnect();\n }\n hideConnectedIndicator();\n disableLyrics();\n port = null;\n }", "destroy() {\n\t\tif (this.socket !== undefined) {\n\t\t\tthis.socket.destroy()\n\t\t}\n\n\t\tif (this.pollAPI) {\n\t\t\tclearInterval(this.pollAPI)\n\t\t}\n\n\t\tif (this.activeTBarListener) {\n\t\t\tthis.system.removeListener('variable_changed', this.activeTBarListener)\n\t\t\tdelete this.activeTBarListener\n\t\t}\n\t\tthis.debug('destroy', this.id)\n\t}", "disconnect() {\n if (!this.stopped) {\n this.socket.disconnect();\n this.stopped = true;\n }\n }", "onDisconnect(id) {\n // this.sockets_not_used.delete(id);\n this.sockets.delete(id);\n this.players.delete(id);\n }", "cleanup() {\n logger_1.default.system.info(\"WindowEventManager.cleanup\", this.windowName);\n //removes listeners added to the event emitter.\n this.removeAllListeners();\n //removes listeners added to the RouterClient.\n let eventSubscriptions = Object.keys(this.remoteEventSubscriptions);\n logger_1.default.system.info(\"WRAP CLOSE. WindowEventManager.cleanup. Removing router subscriptions\", this.windowName, eventSubscriptions);\n eventSubscriptions.forEach(channelName => {\n let handlers = this.remoteEventSubscriptions[channelName];\n handlers.forEach(handler => {\n routerClientInstance_1.default.removeListener(channelName, handler);\n });\n });\n }", "disconnectedCallback() {\n super.disconnectedCallback();\n LocalizationHelper.removeOnStringsUpdated(this.handleLocalizationChanged);\n LocalizationHelper.removeOnDirectionUpdated(this.handleDirectionChanged);\n Providers.removeProviderUpdatedListener(this.handleProviderUpdates);\n Providers.removeActiveAccountChangedListener(this.handleActiveAccountUpdates);\n }", "destroy() {\n this.instance.disconnect();\n return;\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine)\n this.engine.close();\n }", "stopDiscovery () {\n this.log.debug('client.stopDiscovery()');\n if (this.discoveryTimer) {\n clearInterval(this.discoveryTimer);\n this.discoveryTimer = null;\n }\n if (this.isSocketBound) {\n this.isSocketBound = false;\n this.socket.close();\n }\n }", "_close() {\n debug(\"disconnect\");\n this.skipReconnect = true;\n this._reconnecting = false;\n\n if (\"opening\" === this._readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n\n this.backoff.reset();\n this._readyState = \"closed\";\n if (this.engine) this.engine.close();\n }" ]
[ "0.7214315", "0.71876174", "0.71756774", "0.71052796", "0.7000674", "0.68662506", "0.67221314", "0.6720398", "0.66435707", "0.6555484", "0.6555079", "0.6551591", "0.6523721", "0.65167284", "0.65046006", "0.65046006", "0.64748776", "0.6474865", "0.6471373", "0.6470799", "0.644738", "0.6444533", "0.6443141", "0.64298314", "0.6402642", "0.63800114", "0.6351549", "0.6346986", "0.6342718", "0.63403726", "0.6316495", "0.6314884", "0.630803", "0.6307336", "0.6287372", "0.6285792", "0.6269978", "0.62674624", "0.62619823", "0.6255106", "0.624305", "0.6239926", "0.62351114", "0.62296647", "0.62125003", "0.6210434", "0.62072563", "0.62009025", "0.61970615", "0.61764514", "0.61645734", "0.61621755", "0.6159315", "0.6155108", "0.6154155", "0.6152544", "0.6151915", "0.6143998", "0.6132047", "0.6127687", "0.61183226", "0.6111154", "0.6108359", "0.6106323", "0.6102417", "0.60809815", "0.60801864", "0.60774845", "0.6073211", "0.6068802", "0.60684896", "0.60664624", "0.6060265", "0.60549843", "0.6051734", "0.6048615", "0.6041266", "0.60391927", "0.6030835", "0.59979457", "0.59942716", "0.59921163", "0.59910864", "0.5988368", "0.5986054", "0.5986054", "0.5986054", "0.5985911", "0.59823745", "0.59807926", "0.5963916", "0.59572697", "0.5950019", "0.59497714", "0.5944814", "0.5935321", "0.59346706", "0.5933501", "0.5929486", "0.5927714", "0.5926411" ]
0.0
-1
Disconnects the socket manually.
disconnect() { if (this.connected) { debug("performing disconnect (%s)", this.nsp); this.packet({ type: socket_io_parser_1.PacketType.DISCONNECT }); } // remove socket from pool this.destroy(); if (this.connected) { // fire events this.onclose("io client disconnect"); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disconnect() { socket_close(this) }", "disconnect() {\n if (this.proto == 'tcp') {\n this._api.disconnect(this.socketId);\n }\n }", "disconnect() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\n\t\tif(this._reconnectTimer) {\n\t\t\tclearTimeout(this._reconnectTimer);\n\t\t\tthis._reconnectTimer = null;\n\t\t}\n\t\tif(this.__netstatTimer) {\n\t\t\tclearInterval(this.__netstatTimer);\n\t\t\tthis.__netstatTimer = null;\n\t\t\tthis._measureSpeed();\n\t\t}\n\n\t\tif(this._socket.destroyed) return;\n\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\n\t\tthis._socket.removeAllListeners('end');\n\t\tthis._socket.removeAllListeners('close');\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\n\t\tthis.emit('disconnected');\n\t\tthis.status = \"Disconnected\";\n\t}", "disconnect() {\n if (!this.stopped) {\n this.socket.disconnect();\n this.stopped = true;\n }\n }", "function onDisconnect(socket) {\n console.log(\"Disconnection process$$$$$$$\")\n socket.disconnect();\n}", "function disconnect() {\n if (!socket || !socket.close)\n return void onError(\n new Error('Invalid Disconnect: Cannot close a '\n + 'socket that has never been opened.')\n )\n socket.close()\n return socket\n }", "disconnect() {\n let _this = this;\n\n _this._continuousOpen = false;\n if (_this._sock) {\n _this._sendClose();\n }\n }", "disconnect() {\n console.log('Disconnecting...');\n\n // Wait a few seconds so potential messages can be sent before socket is closed\n setTimeout(() => {\n this.rtm.disconnect();\n }, 7000);\n }", "function _onDisconnect(socket) {\n}", "onDisconnect(socket) {\n\n }", "close() {\n\t\tthis.debug('disconnect');\n\t\tif(!this._socket) return;\n\t\tthis._beforeDisconnect && this._beforeDisconnect();\n\t\tthis._socket.destroy();\n\t\tthis._connected = false;\n\t\t// 'disconnected' event will be emitted by onClose listener\n\t}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n\t\n}", "disconnect ( code, reason ) {\n this.socket.close( code, reason );\n }", "onDisconnect(socket) {\n Logger.logInfo('socket ' + socket.id + ' disconnected');\n }", "async disconnect () {\n this.connection.end()\n this.socket.end()\n this.server.onDisconnected()\n return this._destroy()\n }", "function doDisconnect() {\n\t\tsocket.close();\n\t\tconnected = false;\n\t\t$('.connectionState').text(\"Not connected\");\n\t\t$('.connectionState').removeClass('connected');\n\t}", "disconnect() {\n if (this.connected) {\n debug(\"performing disconnect (%s)\", this.nsp);\n this.packet({ type: dist.PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }", "disconnect() {\n _try(() => this._rawConn && this._rawConn.close());\n }", "function onSocketDisconnect() {\n console.log('Disconnected from socket server');\n}", "disconnect() {\n if (this.connected) {\n debug(\"performing disconnect (%s)\", this.nsp);\n this.packet({ type: socket_io_parser_1.PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }", "disconnect() {\n if (this.connected) {\n debug(\"performing disconnect (%s)\", this.nsp);\n this.packet({ type: socket_io_parser_1.PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }", "function socketDisconnect(socket) {\n $(\"title\").text(\"TS Bot Sync - Disconnected\");\n toggleNotification(true, \"loader\", \"Disconnected, reconnecting...\");\n socket.connect();\n}", "socket_disconnect() {\n console.log(\"disconnected\", this._vm.$socket);\n }", "handleDisconnect() {\n\t\tdebug(\n\t\t\t'warn: ' + ((this.fromServer)?'server':'client') + \n\t\t\t' connection lost'\n\t\t);\n\t\tthis.emit('disconnect');\n\t\tthis.emit('disconnection');\n\t\tthis.socket = null;\n\t}", "function onDisconnectClick() {\n webSocket.close();\n}", "socketClose() {\n console.log('sock close');\n\n GlobalVars.reset();\n this.reset();\n\n this.reconnect();\n }", "function disconnect() {\n data_buffer_x = [];\n data_buffer_y = [];\n if(socket) {\n socket.send('unsubscribe'); // we will subscribe to this sensor\n socket.disconnect();\n socket = null;\n\n let layout = {\n title: `-------- Disconnected --------`\n };\n Plotly.relayout(data_div, layout);\n\n }\n}", "disconnect() {\n if (this.ws != null) {\n this.ws.close();\n }\n this.connectionListeners.forEach((listener)=>listener(false));\n this.log(\"Disconnected\");\n }", "onDisconnect()\n {\n this.connected = false;\n this.clearStates();\n this.emit(Connection.onDisconnect);\n }", "disconnect() {\n this.shouldReconnect = false;\n this._listenersMap = new Map();\n this.closeAllConnections()\n }", "async disconnect() {\n this.ready = false\n return new Promise((resolve, reject) => {\n this.socket.addEventListener(\"close\", () => {\n resolve(this)\n })\n this.closeSocket()\n })\n }", "disconnect() {\n window.removeEventListener('message', this.onConnectionMessageHandler);\n this.closePort();\n }", "function disconnect () {\n if (ws != null) {\n if (isConnected()) { closeRequested = true }\n ws.close(1000)\n ws = null\n }\n}", "disconnect () {\n if (this._readyState === this.READY_STATE.CONNECTING) {\n this._nextReadyState = this.READY_STATE.CLOSED\n return\n }\n\n this._nextReadyState = null\n if (this._readyState === this.READY_STATE.OPEN) {\n this._doClose()\n }\n }", "_handleDisconnect() {\n debug(\"Disconnected from TCP connection to node \" + this._node.id());\n if (this._active) {\n this._connecting = true;\n } else {\n this._connecting = false;\n }\n this.emit(\"disconnect\");\n }", "function disconnect(socket) {\n winston.info('Disconnect', socket.id);\n socket.disconnect();\n if (!socket.disconnected && socket.namespace.name)\n socket.manager.namespaces[''].clients().some(function (s) {\n if (s.id === socket.id) {\n s.disconnect();\n return true;\n }\n return false;\n });\n return socket;\n }", "disconnect() {\n try {\n if (this._connector) {\n this._connector.$disconnect();\n }\n } catch(e) {\n /* ignore any error */\n }\n }", "function disconnect() {\n conn.close();\n conn = null;\n}", "disconnect() {\n this._disconnect();\n }", "_disconnect(socket, err) {\n\t\terror('Error: ', err);\n\t\tdebug('Authentication failure socket %s', socket.id);\n\n\t\tsocket\n\t\t\t.emit('unauthorized')\n\t\t\t.disconnect();\n\t}", "function disconnect(){\r\n\tconn.disconnect();\r\n}", "disconnect () {\n // close all data tunnel\n this.userTunnel.off();\n this.messageTunnel.off();\n this.channelStatusTunnel.off();\n this.removeAllListeners();\n }", "function disconnect(data, socket){\n for(var name in clients) {\n if(clients[name].socket === socket.id) {\n delete clients[name];\n break;\n }\n }\t\n}", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "function onDisconnect(socket) {\n\t\tlogger.info({ type : loggerType, msg : \"Socket Disconnected\"});\n\t\tif(socket.decoded_token) {\n\t\t}\n\t}", "disconnect(){}", "disconnect () {\n if (this.isConnected()) {\n this.logEvent(`Closing IoT connection of client ${this.clientId}`);\n this.connection.end();\n // FIXME(ikajaste): Disconnect does stop events, but fails somehow - the connection remains:\n // (this.connection.connected returns true)\n } else {\n // debug\n this.logEvent(`Client ${this.clientId} is not connected, so no need to disconnect.`);\n }\n }", "disconnect() {\n if (!_.isNil(this._dataChanel)) {\n this._dataChanel.close();\n }\n if (!_.isNil(this._receiveChanel)) {\n this._receiveChanel.close();\n }\n if (!_.isNil(this._pc)) {\n this._pc.close();\n }\t\n try {\n this._pc = null;\n } catch (e) {};\n\t}", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "function clientDisconnect() {\r\n delete clients[connection.remoteAddress];\r\n console.log('connection closed: ' + remoteAddress + \" \" + now.getHours() + \":\" + now.getMinutes() + \":\" + now.getSeconds());\r\n\r\n\r\n }", "function onSocketClose() {\n let data = _data.get(this);\n let error = data.error;\n\n data.error = null;\n data.socket = null;\n data.connected = false;\n\n _data.set(this, data);\n\n setImmediate(this.emit.bind(this, 'disconnected', error));\n}", "ondisconnect() {\n debug(\"server disconnect (%s)\", this.nsp);\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "function onDisconnect(socket) {\n socket.emit('log', _log('\"'+socket.address+'\" leave echo!'));\n}", "function disconnectSocket() {\n const self = this;\n\n console.log(`${self.socket.user.username} disconnected.`);\n\n sqlQueries.leaveGame(self.socket.user.accountSK, function (data) {\n if (data.hasOwnProperty('errors')) {\n console.log(data.errors.message);\n } else {\n console.log(`${self.socket.user.username} left game ${data.currentGame}.`);\n\n self.socket.leave(data.currentGame);\n\n if (data.gameShutdown) {\n self.socket.broadcast.to(data.currentGame).emit('generalError', {error: 'The host left.'});\n self.socket.broadcast.to(data.currentGame).emit('gameShutdown');\n\n // Makes every socket leave the room.\n self.socket.server.of('/').in(data.currentGame).clients(function(error, clients) {\n if (clients.length > 0) {\n clients.forEach(function(socket_id) {\n self.socket.server.sockets.sockets[socket_id].leave(data.currentGame);\n });\n }\n });\n\n } else {\n Broadcast.refreshGameDetails(self.socket, data.currentGame);\n }\n }\n\n Broadcast.lobbyRefresh(self.socket);\n });\n\n self.socket.user = {\n accountSK: null,\n username: null\n };\n}", "static async disconnect() {\n if (transportInstance) {\n transportInstance.device.close();\n transportInstance.emit(\"disconnect\");\n transportInstance = null;\n }\n }", "function disconnect() {\r\n\t\t console.log('disconnect!');\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\r\n\t\t onConnectionSuccess);\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_FAILED,\r\n\t\t onConnectionFailed);\r\n\t\t connection.removeEventListener(\r\n\t\t JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\r\n\t\t disconnect);\r\n\t\t}", "close() {\n if (this.socket) this.socket.destroy();\n }", "disconnect () {\n if (this.connected) {\n this.connected = false\n return this.connector.disconnect()\n } else {\n return Promise.resolve()\n }\n }", "disconnect () {\n if (this.connected) {\n this.connected = false;\n return this.connector.disconnect()\n } else {\n return Promise.resolve()\n }\n }", "cancel () {\n this._buf = null\n this._dataState = 0\n this._clearTimeout()\n\n if (!this.socket) return\n\n this.isConnected = false\n this.socket.removeAllListeners()\n this.socket.destroy()\n this.socket.unref()\n\n this.socket = null\n }", "disconnect() {\n\t\tif (this.client === undefined) {\n\t\t\treturn\n\t\t}\n\t\tthis.client.disconnect()\n\t\tthis.portalId = undefined\n\t\tthis.client.end()\n\t}", "close() {\n console.log(\"disconnecting\");\n this._distributeMessage('remove', '');\n clearInterval(this._swarmUpdater);\n this._server.close();\n Object.keys(this._connections).forEach(function(key) {\n this._connections[key].socket.end();\n }, this);\n }", "function onDisconnect(socket, io) {\n console.log('socket disconnect', socket.id);\n delete clients[socket.id];\n io.sockets.emit('clients', JSON.stringify(clients));\n}", "ondisconnect() {\n this.destroy();\n this.onclose(\"io server disconnect\");\n }", "disconnect() {\n this.connection.destroy()\n }", "function socketOnClose(event) {\n\tif (this._connecting) {\n\t\tlet message = 'Unknown Error'\n\t\tif (event.code in disconnectReasons) {\n\t\t\tmessage = disconnectReasons[event.code]\n\t\t}\n\t\tthis._connecting.reject({error: message, event})\n\t\tthis._connecting = null\n\t}\n\n\tthis.emit('socket.close')\n}", "function DisconnectPeer(address) {\n\n // debug time I use \"\" as peer address, it disconnects al\n Mobile('Disconnect').callNative(\"\", function (err) {\n console.log(\"DisconnectPeer callback with err: \" + err);\n\n if(clientSocket != 0) {\n clientSocket.end();\n clientSocket = 0;\n }\n });\n }", "disconnect() {\n if (!cluster.isMaster) {\n throw new Error('Try disconnect from worker process');\n }\n\n if (!this._disconnecting) {\n this._disconnecting = true;\n\n this._log('disconnecting');\n\n // Max wait time\n let timeout = setTimeout(() => this._exit(), this.config.killOnDisconnectTimeout);\n\n // When worker report disconnect - exit\n //this.worker.on('disconnect', () => {\n // clearTimeout(timeout);\n //\n // this._exit();\n //});\n\n // When worker exit, cleanup\n this.worker.on('exit', () => {\n this._log('worker exit');\n clearTimeout(timeout);\n\n this._exit();\n });\n\n this.send({\n event: SIGNAL_DISCONNECT\n });\n\n // Send signal to worker to disconnect\n this.worker.disconnect();\n }\n }", "disconnect() {\n // Clean the listener.\n this.lightSensor.listen(undefined);\n return this._client.cleanup()\n .catch(err => {\n console.log(err);\n });\n }", "disconnect() {\n console.log(\"disconnect!\");\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\n this.onConnectionSuccess.bind(this)\n );\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_FAILED,\n this.onConnectionFailed.bind(this)\n );\n this.connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\n this.disconnect.bind(this)\n );\n\n this.disconnectedFunction();\n }", "function disconnect() {\n console.log('INFO (join.js): Connection disconnect!');\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,\n onConnectionSuccess);\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_FAILED,\n onConnectionFailed);\n connection.removeEventListener(\n JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,\n disconnect);\n}", "disconnect() {\n delete this.element[RESOURCE_PROP_];\n this.element.disconnect(/* opt_pretendDisconnected */ true);\n }", "function workOnDisconnect(socketDisconnected) {\n socketDisconnected.on(\"disconnect\", function(data) {\n console.log(data);\n let temp = nodes.find(function(obj) {\n return obj.socket.id === socketDisconnected.id;\n });\n console.log(\"disconnecting\", temp.clientId);\n let i = nodes.indexOf(temp);\n nodes.splice(i, 1);\n });\n }", "function disconnect() {\n console.log(\"Good Bye!\");\n connection.end(); //// END CONNECTION ////\n}", "function onDisconnect(socket) {\n QQArtist.findOne({socket:socket.id},function(err,qqartist){\n if (qqartist){\n qqartist.removeAsync()\n qqartist.save(); \n }\n }) \n}", "disconnect() {\n try {\n this.client.destroy();\n } catch (error) {\n winston.error('failed to disconnect from ssh', error);\n }\n\n this.ready = false;\n\n }", "disconnectPlayer(socket) {\n var username = this.playerMap.getUsernameBySocket(socket);\n\n this.playerMap.removePlayerSocket(username);\n this.gameServer.deactivateListenersForSocket(socket);\n\n if (this.socketIsHost(socket)) {\n this.reassignHostSocket();\n }\n if (!this.gameServer.isInGame()) {\n this.playerMap.removePlayerByUsername(username);\n }\n }", "function disconnect(socket) {\n socket.on('disconnect', function() {\n console.log('A player disconnected');\n\n // increment turn\n current_turn = (current_turn + 1) % players.length;\n players[current_turn].emit('your_turn');\n Socketio.emit('turnChange', {turn: current_turn}); // emit to all clients\n\n // remove player socket from server\n players.splice(players.indexOf(socket), 1);\n next_turn(socket);\n });\n}", "onDisconnect(id) {\n // this.sockets_not_used.delete(id);\n this.sockets.delete(id);\n this.players.delete(id);\n }", "onDisconnect(fn) {\n\n this.eventEmitter.on(settings.socket.disconnect, (data) => {\n\n fn(data)\n });\n }", "_onDisconnect () {\n this._disconnectEvents();\n }", "function disconnect() {\n\n if (source) {\n source.close();\n source = null;\n }\n connected = 0;\n }", "disconnect() {\n if (this.connected == true) {\n this.superRemove();\n this.connected = false;\n }\n }", "_disconnectEvents () {\n this._socket.off('sensorChanged', this._onSensorChanged);\n this._socket.off('deviceWasClosed', this._onDisconnect);\n this._socket.off('disconnect', this._onDisconnect);\n }", "function disconnectStation() {\n Wifi.disconnect();\n}", "disconnect(callback = _.noop) {\n this.hub.close(() => {\n this.sw.close();\n callback();\n });\n }", "stopDiscovery () {\n this.log.debug('client.stopDiscovery()');\n if (this.discoveryTimer) {\n clearInterval(this.discoveryTimer);\n this.discoveryTimer = null;\n }\n if (this.isSocketBound) {\n this.isSocketBound = false;\n this.socket.close();\n }\n }", "closeNow(){\n this.socket.close()\n }", "disconnectDevice() {\n appClient.disconnectDevice();\n logger.info({\n METHOD: disconnectDevice,\n MESSAGE: \"Disconnect appClient\",\n DATE: this.getCurrentDateString(),\n TIME: this.getCurrentTimeString()\n });\n }", "onDisconnect(socket){\n socket.on('disconnect', (reason) => {\n if(USERS.get(socket.id)) {\n console.log('[onDisconnect]: user disconnected', USERS.get(socket.id));\n USERS.delete(socket.id);\n console.log('[onDisconnect]: online users:', USERS);\n }\n })\n }", "destroy() {\n this.socket.destroy();\n }", "_disconnect() {\n /* istanbul ignore next */\n if (this._type === ServiceType.LOCAL) {\n throw new Error('_disconnect must not be called on a Local Service');\n }\n\n if (this._state.inState(ServiceState.AUTHENTICATING)) {\n this._deauthenticate();\n }\n\n if (\n this._state.inState([\n ServiceState.READY,\n ServiceState.ONLINE,\n ServiceState.CONNECTING\n ])\n ) {\n this._authPromise = null;\n this._connectPromise = null;\n\n this._state.transitionTo(ServiceState.OFFLINE);\n }\n }", "function disconnect() {\n if (stompClient != null) {\n stompClient.disconnect();\n }\n console.log(\"disconnected\");\n}", "disconnect() {\n return __awaiter(this, void 0, void 0, function* () {\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, () => `[CLIENT] disconnect(), state: ${exports.ClientState[this._state]}`);\n if (this._state !== exports.ClientState.IDLE) {\n return new Promise((resolve) => {\n this.emit(\"CLIENT_MANUAL_DISCONNECT\");\n this._manualDisconnect = true;\n if (this._keepAliveTimer !== undefined) {\n clearInterval(this._keepAliveTimer);\n this._keepAliveTimer = undefined;\n }\n if (this._reconnectTimer !== undefined) {\n clearTimeout(this._reconnectTimer);\n this._reconnectTimer = undefined;\n }\n if (this._state === exports.ClientState.ACTIVE) {\n this.prependOnceListener(\"CLIENT_DISCONNECTED\", () => {\n resolve();\n });\n }\n if (this._client !== undefined) {\n if (this._client instanceof net.Socket) {\n this._client.end();\n }\n else {\n this._client.close();\n }\n }\n // If we're not currently connected, then calling\n // this._client.end() will not cause CLIENT_DISCONNECTED\n // to be emitted, so we shouldn't wait for that.\n if (this._state !== exports.ClientState.ACTIVE) {\n this._state = exports.ClientState.IDLE;\n Utils_1.logWithLevelInternal(Utils_1.LogLevel.DEBUG, () => `[CLIENT] State: ${this._state}`);\n this._manualDisconnect = false;\n resolve();\n }\n });\n }\n });\n }", "afterDisconnect(session, socket, done) {\n sails.log('Socket discnnected for socket id ', socket.id);\n\n // let userOnRooms = [];\n //\n // // Delete the user from room\n // for (const r in sails.rooms) {\n // userOnRooms[r][socket.id] = sails.rooms[r][socket.id];\n // delete sails.rooms[r][socket.id];\n // }\n //\n // // Tell all rooms the user is disconnected\n // for (const room in userOnRooms) {\n // sails.sockets.broadcast(room, 'unknown_disconnected', { userOnRooms: userOnRooms[room], rooms: sails.rooms });\n // }\n //\n // // Empty the temp\n // userOnRooms = [];\n\n\n // By default: do nothing.\n // (but always trigger the callback)\n return done();\n }" ]
[ "0.827323", "0.81174034", "0.79788846", "0.7726539", "0.75119656", "0.7423343", "0.73787034", "0.7378272", "0.7330927", "0.7217453", "0.72004706", "0.7185145", "0.7185145", "0.7185145", "0.7185145", "0.7184539", "0.71643335", "0.71437883", "0.71360177", "0.7108773", "0.7052561", "0.70381707", "0.6969195", "0.6954506", "0.6954506", "0.69486034", "0.69353735", "0.6913668", "0.6901662", "0.6867238", "0.6865136", "0.6837338", "0.6793394", "0.6789846", "0.677789", "0.67633605", "0.67563784", "0.67360204", "0.67185795", "0.66528696", "0.66254103", "0.6621816", "0.66168267", "0.6601464", "0.66001153", "0.6598141", "0.65802646", "0.6567193", "0.6561623", "0.6550301", "0.65447545", "0.65302926", "0.6513259", "0.6513259", "0.65092987", "0.6508026", "0.6487007", "0.64723426", "0.64267516", "0.64173055", "0.64148885", "0.6407126", "0.6404702", "0.6389098", "0.6384335", "0.6380997", "0.6372989", "0.63606346", "0.63441736", "0.6326936", "0.6314119", "0.6312892", "0.63125217", "0.63079053", "0.630787", "0.63039154", "0.6303045", "0.62968606", "0.6292374", "0.6289305", "0.62850946", "0.62648886", "0.6250189", "0.62428945", "0.62403005", "0.6236697", "0.6232147", "0.6219291", "0.62169296", "0.62060744", "0.616548", "0.6156174", "0.6152856", "0.6150316", "0.6147904", "0.6142903", "0.61284155", "0.6126711", "0.61243933", "0.6123711" ]
0.70985806
20
Sets the compress flag.
compress(compress) { this.flags.compress = compress; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "compress(compress) {\n this.flags.compress = compress;\n return this;\n }", "compress(compress) {\n this.flags.compress = compress;\n return this;\n }", "compress(compress) {\n this.flags.compress = compress;\n return this;\n }", "compress(compress) {\n this.flags.compress = compress;\n return this;\n }", "set Compressed(value) {}", "set compressionFormat(value) {}", "compress() {\n if (!compress_fns[this.algorithm]) {\n throw new Error(this.algorithm + ' compression not supported');\n }\n\n this.compressed = compress_fns[this.algorithm](this.packets.write(), this.deflateLevel);\n }", "set skip_compression(value) {\n this._skip_compression = value;\n this._url_options.headers['Content-Encoding'] = value ? 'identity' : 'deflated';\n }", "_disableCompression () {\n if (!this.compressed) {\n return\n }\n\n this.compressed = false\n this.socket.ondata = this._socketOnData\n this._socketOnData = null\n\n if (this._compressionWorker) {\n // terminate the worker\n this._compressionWorker.terminate()\n this._compressionWorker = null\n }\n }", "enableCompression () {\n this._socketOnData = this.socket.ondata\n this.compressed = true\n\n if (typeof window !== 'undefined' && window.Worker) {\n this._compressionWorker = new Worker(URL.createObjectURL(new Blob([CompressionBlob])))\n this._compressionWorker.onmessage = (e) => {\n var message = e.data.message\n var data = e.data.buffer\n\n switch (message) {\n case MESSAGE_INFLATED_DATA_READY:\n this._socketOnData({ data })\n break\n\n case MESSAGE_DEFLATED_DATA_READY:\n this.waitDrain = this.socket.send(data)\n break\n }\n }\n\n this._compressionWorker.onerror = (e) => {\n this._onError(new Error('Error handling compression web worker: ' + e.message))\n }\n\n this._compressionWorker.postMessage(createMessage(MESSAGE_INITIALIZE_WORKER))\n } else {\n const inflatedReady = (buffer) => { this._socketOnData({ data: buffer }) }\n const deflatedReady = (buffer) => { this.waitDrain = this.socket.send(buffer) }\n this._compression = new Compression(inflatedReady, deflatedReady)\n }\n\n // override data handler, decompress incoming data\n this.socket.ondata = (evt) => {\n if (!this.compressed) {\n return\n }\n\n if (this._compressionWorker) {\n this._compressionWorker.postMessage(createMessage(MESSAGE_INFLATE, evt.data), [evt.data])\n } else {\n this._compression.inflate(evt.data)\n }\n }\n }", "compressFiles_() {\n this.fileIndex_ = 0;\n zip.createWriter(new zip.BlobWriter(), this.writeNextFile_.bind(this), this.reportError.bind(this));\n }", "compress() {\n\n }", "function compress(self, dataToBeCompressed, callback) {\n switch (self.options.agreedCompressor) {\n case 'snappy':\n Snappy.compress(dataToBeCompressed, callback);\n break;\n case 'zlib':\n // Determine zlibCompressionLevel\n var zlibOptions = {};\n if (self.options.zlibCompressionLevel) {\n zlibOptions.level = self.options.zlibCompressionLevel;\n }\n zlib.deflate(dataToBeCompressed, zlibOptions, callback);\n break;\n default:\n throw new Error(\n 'Attempt to compress message using unknown compressor \"' +\n self.options.agreedCompressor +\n '\".'\n );\n }\n}", "function compress(self, dataToBeCompressed, callback) {\n switch (self.options.agreedCompressor) {\n case 'snappy':\n Snappy.compress(dataToBeCompressed, callback);\n break;\n case 'zlib':\n // Determine zlibCompressionLevel\n var zlibOptions = {};\n if (self.options.zlibCompressionLevel) {\n zlibOptions.level = self.options.zlibCompressionLevel;\n }\n zlib.deflate(dataToBeCompressed, zlibOptions, callback);\n break;\n default:\n throw new Error(\n 'Attempt to compress message using unknown compressor \"' +\n self.options.agreedCompressor +\n '\".'\n );\n }\n}", "set compressionRatio( value )\n {\n const [minValue, maxValue] = OldSmartFader.compressionRatioRange;\n \n this._compressionRatio = utilities.clamp( value, minValue, maxValue );\n \n this._updateCompressorSettings();\n }", "set CompressedHQ(value) {}", "_initCompress() {\n this.app.use(compress());\n }", "compression() {\n this.app.use(\n compression({\n filter: (req, res) => {\n if (req.headers[\"x-no-compression\"]) {\n // don't compress responses with this request header\n return false;\n }\n\n // fallback to standard filter function\n return compression.filter(req, res);\n },\n }),\n );\n }", "compress(compress) {\r\n const flags = Object.assign({}, this.flags, { compress });\r\n return new BroadcastOperator(this.adapter, this.rooms, this.exceptRooms, flags);\r\n }", "function GLTFMeshoptCompression( parser ) {\n\n\t\t\tthis.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION;\n\t\t\tthis.parser = parser;\n\n\t\t}", "set Uncompressed(value) {}", "get skip_compression() {\n return this._skip_compression;\n }", "function compress() {\n if (compressJs) {\n return streamCombiner(\n tars.require('gulp-terser')(tars.pluginsConfig['gulp-terser']),\n rename({ suffix: '.min' }),\n gulp.dest(destFolder),\n );\n }\n\n return tars.packages.gutil.noop();\n}", "get Compressed() {}", "function compressFile(file, thang) {\n\t\tCombineItem.set(\"className\", \"done\");\n\t\tCombineText.setContent(thang + \" combined (\" + humanSize(file.size) + \")\");\n\n\t\tCompressItem.set(\"className\", \"active\");\n\t\tCompressText.setContent(\"Compressing File\");\n\n\t\tBP.LZMA.compress(\n\t\t\t{\n\t\t\t\tfile: file, \n\t\t\t\tprogressCB: function(x) { CompressText.setContent(\"Compressing File (\" + x.toFixed() + \"%)\"); }\n\t\t\t}, \n\t\t\tfunction(lzma){\n\t\t\t\tif (lzma.success) {\n\t\t\t\t\tdownloadFile(lzma.value);\n\t\t\t\t}\n\t\t\t});\n\t}", "function compress(filePath, stats, application, client, httpCode) {\r\n\t\timpress.fs.readFile(filePath, function(error, data) {\r\n\t\t\tif (error) {\r\n\t\t\t\tif (client) client.error(404);\r\n\t\t\t} else {\r\n\t\t\t\tvar ext = client ? client.ext : fileExt(filePath);\r\n\t\t\t\tif (ext == 'js' && application.config.files.minify) {\r\n\t\t\t\t\tdata = impress.minify(data);\r\n\t\t\t\t\tstats.size = data.length;\r\n\t\t\t\t}\r\n\t\t\t\tif (!inArray(impress.compressedExt, ext) && stats.size>impress.compressAbove) {\r\n\t\t\t\t\timpress.zlib.gzip(data, function(err, data) {\r\n\t\t\t\t\t\tstats.size = data.length;\r\n\t\t\t\t\t\tif (client) {\r\n\t\t\t\t\t\t\tclient.res.writeHead(httpCode, baseHeader(ext, stats, true));\r\n\t\t\t\t\t\t\tclient.end(data);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tapplication.cache.static[filePath] = {data:data, stats:stats, compressed: true};\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (client) {\r\n\t\t\t\t\t\tclient.res.writeHead(httpCode, baseHeader(ext, stats));\r\n\t\t\t\t\t\tclient.end(data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tapplication.cache.static[filePath] = {data:data, stats:stats, compressed: false};\r\n\t\t\t\t}\r\n\t\t\t\twatchCache(application, filePath);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "set CompressedLQ(value) {}", "function compressed(){\n\t\treturn hasClass(compressClass);\n\t}", "get compressionRatio()\n {\n return this._compressionRatio;\n }", "function compressImages() {\n return src(files.images.src)\n // .pipe(imagemin([\n // imagemin.gifsicle({ interlaced: true }),\n // imagemin.jpegtran({ progressive: false }),\n // imagemin.optipng({ optimizationLevel: 5 }),\n // imagemin.svgo({\n // plugins: [\n // { removeViewBox: true },\n // { cleanupIDs: false }\n // ]\n // })\n // ]))\n .pipe(dest(files.images.dest))\n .on('end', () => console.log(`Image compression is disabled.`));\n}", "compressImage(val){\n this.setState({\n files: val\n }, this.sendRequestToCompress );\n }", "function compress() {\n return src(['dist/math.js'])\n .pipe(minify({\n ext:{\n min:'.min.js'\n }\n }))\n .pipe(dest('./dist'));\n}", "function compress(inName, outName, cb) {\r\n /*compressTxtSpk(inName, outName, 0, -1, -1,\r\n function(err, t, h, newSize, oldSize) {\r\n compressHighHuff(\r\n outName, outName, t, h, oldSize, cb\r\n );\r\n }\r\n );*/\r\n compressHighHuff(inName, outName, 0, -1, -1, cb);\r\n}", "encode(compress, slashes) {\n const shouldCompress = compress !== undefined ? compress : this.zlib !== undefined;\n if (shouldCompress && this.zlib === undefined) {\n throw new Error('Need zlib to compress');\n }\n let header = this.version;\n const data = this.getData();\n const sigData = this.getSignatureData();\n let array = new Uint8Array(data.byteLength + sigData.byteLength);\n array.set(data, 0);\n array.set(sigData, data.byteLength);\n if (shouldCompress) {\n const deflated = this.zlib.deflateRaw(array);\n if (array.byteLength > deflated.byteLength) {\n header |= 1 << 7;\n array = deflated;\n }\n }\n const out = new Uint8Array(1 + array.byteLength);\n out[0] = header;\n out.set(array, 1);\n let scheme = 'esr:';\n if (slashes !== false) {\n scheme += '//';\n }\n return scheme + base64u.encode(out);\n }", "flush(callback) {\n compressFinish(compressor)\n .then(data => callback(null, data))\n .catch(callback);\n }", "function compress() {\n // Create a native streaming gzip compressing with Neon\n const compressor = compressNew();\n\n return new Transform({\n // Compress a chunk of data by delegating to `compressChunk`\n transform(chunk, encoding, callback) {\n compressChunk(compressor, encoding, chunk)\n .then(data => callback(null, data))\n .catch(callback);\n },\n\n // Complete the compression by delegating to `compressFinish`\n flush(callback) {\n compressFinish(compressor)\n .then(data => callback(null, data))\n .catch(callback);\n }\n });\n}", "function compress(req, done) {\n req.headers['content-encoding'] = 'gzip'\n zlib.gzip(req.body, function (err, buf) {\n if (err) done(err)\n else {\n req.body = buf\n req.headers['content-length'] = buf.length\n done()\n }\n })\n}", "function calculateCompression() {\r\n let originalBitCount = getByteLength(originalText) * 8;\r\n let compressedBitCount = compressedText.length;\r\n let compressionPercent = ((1 - (compressedBitCount / originalBitCount)) * 100).toFixed(2);\r\n $('#ogFileSize').html(originalBitCount);\r\n $('#comFileSize').html(compressedBitCount);\r\n $('#compressRatio').html(compressionPercent + '%');\r\n $('#compressRatio').css('color', getCompTextColor(compressionPercent));\r\n}", "function compress2(target, a, b, c) {\n\t\t\t\t\tif (!canCompress(a)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(b)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(c)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Compress\n\t\t\t\t\tstyles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];\n\t\t\t\t\tdelete styles[a];\n\t\t\t\t\tdelete styles[b];\n\t\t\t\t\tdelete styles[c];\n\t\t\t\t}", "function compress2(target, a, b, c) {\n\t\t\t\t\tif (!canCompress(a)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(b)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(c)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Compress\n\t\t\t\t\tstyles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];\n\t\t\t\t\tdelete styles[a];\n\t\t\t\t\tdelete styles[b];\n\t\t\t\t\tdelete styles[c];\n\t\t\t\t}", "function compress2(target, a, b, c) {\n\t\t\t\t\tif (!canCompress(a)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(b)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!canCompress(c)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Compress\n\t\t\t\t\tstyles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];\n\t\t\t\t\tdelete styles[a];\n\t\t\t\t\tdelete styles[b];\n\t\t\t\t\tdelete styles[c];\n\t\t\t\t}", "function lgCompress(o){this.lzw=new lzw();this.setOptions=function(o){for(i in o){var n=\"set\"+i.charAt(0).toUpperCase()+i.substr(1);if(this[n]){this[n](o[i])}else{this[i]=o[i]}}};this.setOptions({});this.compress=function(o,a){switch(a){default:case\"lzw\":return this.lzw.encode(json_encode(o));case\"lgml\":case\"html\":return this.lzw.encode(json_encode(this.compressPredefined(o,a)));case\"lgs\":return this.compressSliding(json_encode(o))}};this.decompress=function(o,a){switch(a){default:case\"lzw\":return json_decode(this.lzw.decode(o));case\"lgml\":case\"html\":return this.decompressPredefined(json_decode(this.lzw.decode(o)),a);case\"lgs\":return json_decode(this.decompressSliding(o))}};this.compressTable={lgml:[\"[section]\",\"[/section]\",\"[head]\",\"[/head]\",\"[subhead]\",\"[/subhead]\",\"[subsubhead]\",\"[/subsubhead]\",\"[page]\",\"[url]\",\"[url=\",\"[/url]\",\"[img]\",\"[img \",\"[/img]\",\"[wiki]\",\"[/wiki]\",\"[wiki]\",\"[wiki=\",\"[/wiki]\",\"[pre]\",\"[/pre]\",\"[code]\",\"[code lang=\",\"[/code]\",\"[size=\",\"[/size]\",\"[color=\",\"[/color]\",\"[table]\",\"[table\",\"[tbody]\",\"[/tbody]\",\"[thead]\",\"[/thead]\",\"[tr]\",\"[/tr]\",\"[td]\",\"[/td]\",\"[/table]\",\"[clear]\",\"===\",\"\\n==\",\"==\\n\",\"'''\",\"'''''\",\"http://\",\"http://www.\",\".com\",\".org\",\".html\",\"...\",\" target=_blank\",\" the \",\" and \",\" that \",\" have \",\" for \",\" not \",\" with \",\" you \",\" this \",\" from \",\" they \",\" will \",\" would \",\" there \",\" their \",\" what \",\" about \",\" which \",\" make \",\"width=\",\"height=\",\"alt=\",\"title=\",\".png\",\".jpeg\",\".jpg\",\".gif\"],html:[\"<!DOCTYPE html\",\"-//W3C//DTD XHTML 1.0 Transitional\",\"http://www.w3.org/\",\" href=\\\"\",\"<script type=\\\"text/javascript\\\"\",\"</script>\",\"<div \",\"</div>\",\"class=\\\"\",\"style=\\\"\",\" onclick=\",\" onmouseover=\",\" onmouseout=\",\" onmousedown=\",\" onmouseup=\",\"<br>\",\"<!-- \",\" -->\",\"<br />\",\"<span \",\"</span>\",\"<img \",\"&nbsp;\",\"</a>\",\"target=\",\"<link\",\"src=\\\"\",\"type=\\\"text/css\\\"\",\"http://\",\" type=\",\" http-equiv=\",\" rel=\",\" id=\\\"\",\"</table>\",\"<tr>\",\"</tr>\",\"</td>\",\"http://www.\",\".com\",\".org\",\".html\",\"float:\",\"width:\",\"height:\",\"window.location\",\"text-align:\",\"font-weight:\",\"font-style:\",\"<font \",\"</font>\",\"name=\\\"keywords\\\"\",\"<title>\",\"</title>\",\"document.getElementById(\",\"...\",\" target=_blank\",\" the \",\" and \",\" that \",\" have \",\" for \",\" not \",\" with \",\" you \",\" this \",\" from \",\" they \",\" will \",\" would \",\" there \",\" their \",\" what \",\" about \",\" which \",\" make \",\"width=\",\"height=\",\"alt=\",\"title=\",\".png\",\".jpeg\",\".jpg\",\".gif\"]};this.compressPredefined=function(o,t){o=o.split(\"!\").join(\"!!\");for(i in this.compressTable[t]){o=o.split(this.compressTable[t][i]).join(\"!\"+String.fromCharCode(48+Number(i)))}return(o)};this.decompressPredefined=function(o,t){for(i in this.compressTable[t]){o=o.split(\"!\"+String.fromCharCode(48+Number(i))).join(this.compressTable[t][i])}return o.split(\"!!\").join(\"!\")};this.compressSliding=function(a){return\"\"};this.decompressSliding=function(o){return\"\"};this.splitNibble=function(v){var a=\"\",h2=\"\";for(var i=0;i<v.length;i+=2){h2+=v.substr(i,1);a+=v.substr(i+1,1)}return a+h2};this.joinNibble=function(v){var a=\"\";for(var i=0;i<(v.length>>1);i++){a+=v.substr(i+(v.length>>1),1)+v.substr(i,1)}return a};if(o){this.setOptions(o)}}", "get compressionFormat() {}", "function compress() {\n return through.obj(function (file, enc, cb) {\n new CleanCSS().minify(file.contents, function (err, minified) {\n file.contents = Buffer.from(minified.styles);\n cb(err, file);\n });\n });\n}", "function compress(path) {\n return __WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __awaiter */](this, void 0, void 0, function () {\n var compressor, before;\n return __WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __generator */](this, function (_a) {\n switch (_a.label) {\n case 0:\n if (path.length <= 1) {\n return [2 /*return*/, path]; //can't compress single one\n }\n return [4 /*yield*/, createCompressor(path)];\n case 1:\n compressor = _a.sent();\n do {\n before = path.length;\n path = compressor(path);\n } while (before > path.length);\n //console.log('after', path.map((path) => path.toString()));\n return [2 /*return*/, path];\n }\n });\n });\n}", "async save (fileName) {\n if (fileName.includes('.gz')) {\n await fs.promises.writeFile(fileName, zlib.gzipSync(this.toString(), {\n level: zlib.constants.Z_BEST_COMPRESSION\n }));\n } else {\n await fs.promises.writeFile(fileName, this.toString());\n }\n }", "function compressJS(callB) {\n pump([\n gulp.src(\"./js/*.js\", {\n sourcemaps: true\n }),\n uglify(),\n concat('main.min.js'),\n gulp.dest(\"./bundle\")\n ],\n callB\n );\n}", "async _switchToCompressionWorker() {\n const { events } = this._fallback;\n\n const addEventPromises = [];\n for (const event of events) {\n addEventPromises.push(this._compression.addEvent(event));\n }\n\n // We switch over to the new buffer immediately - any further events will be added\n // after the previously buffered ones\n this._used = this._compression;\n\n // Wait for original events to be re-added before resolving\n try {\n await Promise.all(addEventPromises);\n } catch (error) {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('[Replay] Failed to add events when switching buffers.', error);\n }\n }", "function compressInventory() {\n\tvar itemName, foundShotgun, foundPistol;\n\t\n\tfoundShotgun = false;\n\tfoundPistol = false;\n\t//foundRadio = false;\n\n\t//go through each item listed in the drop menu\n\tfor (var i = 0; i < dropSelect.options.length; i++) {\n\t\n\t\t//get the name of the current item\n\t\titemName = dropSelect.options[i].text;\n\t\t\n\t\t//if item is a shotgun\n\t\tif (itemName.match(\"shotgun\") && !itemName.match(\"shell\")) {\n\t\t\t//if shotgun has been found earlier\n\t\t\tif (foundShotgun == true) {\n\t\t\t\t//do not compress this item any further\n\t\t\t\titemName = \"cancel\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//change the item name to the correct format\n\t\t\t\titemName = \"shotgun\";\n\t\t\t\tfoundShotgun = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if item is a pistol\n\t\tif (itemName.match(\"pistol\") && !itemName.match(\"clip\")) {\n\t\t\t//if pistol has been found earlier\n\t\t\tif (foundPistol == true) {\n\t\t\t\t//do not compress this item any further\n\t\t\t\titemName = \"cancel\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//change the item name to the correct format\n\t\t\t\titemName = \"pistol\";\n\t\t\t\tfoundPistol = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if item is a radio\n\t\tif (itemName.match(\"radio\")) {\n\t\t\titemName = \"radio\";\n\t\t}\n\t\n\t\t//if the item is in the inventory and is a valid name\n\t\tif (itemName != \"cancel\" && calcItemQuantity(itemName) > 0) {\n\t\t\tcompressInventoryItem(itemName);\n\t\t}\n\t}\n\t\n\t//the inventory has been compressed\n\tGM_setValue(\"inventoryIsCompressed\", true);\n}", "function addCompressedLogToBeacon() {\n\t\t\tvar val = \"\";\n\n\t\t\tfor (var i = 0; i < dataLog.length; i++) {\n\t\t\t\tvar evt = dataLog[i];\n\n\t\t\t\tif (i !== 0) {\n\t\t\t\t\t// add a separator between events\n\t\t\t\t\tval += \"|\";\n\t\t\t\t}\n\n\t\t\t\t// add the type\n\t\t\t\tval += evt.type;\n\n\t\t\t\t// add the time: offset from epoch, base36\n\t\t\t\tval += Math.round(evt.time - epoch).toString(36);\n\n\t\t\t\t// add each parameter\n\t\t\t\tfor (var param in evt.val) {\n\t\t\t\t\tif (evt.val.hasOwnProperty(param)) {\n\t\t\t\t\t\tval += \",\" + param;\n\n\t\t\t\t\t\tif (typeof evt.val[param] === \"number\") {\n\t\t\t\t\t\t\t// base36\n\t\t\t\t\t\t\tval += evt.val[param].toString(36);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tval += evt.val[param];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (val !== \"\") {\n\t\t\t\timpl.addToBeacon(\"c.l\", val);\n\t\t\t}\n\t\t}", "function compress(message) {\n return Base64.toBase64( RawDeflate.deflate( Base64.utob(message) ) );\n}", "function gzipStart () {\n return src([`${helpers.dist()}/**/*`, `!${helpers.dist()}/**/*.gz`])\n .pipe(gzip(gzipConfig))\n .pipe(dest(helpers.dist()))\n}", "function canCompress(key) {\n\t\t\t\t\tvar value = styles[key], i;\n\n\t\t\t\t\tif (!value) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = value.split(' ');\n\t\t\t\t\ti = value.length;\n\t\t\t\t\twhile (i--) {\n\t\t\t\t\t\tif (value[i] !== value[0]) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstyles[key] = value[0];\n\n\t\t\t\t\treturn true;\n\t\t\t\t}", "function canCompress(key) {\n\t\t\t\t\tvar value = styles[key], i;\n\n\t\t\t\t\tif (!value) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = value.split(' ');\n\t\t\t\t\ti = value.length;\n\t\t\t\t\twhile (i--) {\n\t\t\t\t\t\tif (value[i] !== value[0]) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstyles[key] = value[0];\n\n\t\t\t\t\treturn true;\n\t\t\t\t}", "function canCompress(key) {\n\t\t\t\t\tvar value = styles[key], i;\n\n\t\t\t\t\tif (!value) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvalue = value.split(' ');\n\t\t\t\t\ti = value.length;\n\t\t\t\t\twhile (i--) {\n\t\t\t\t\t\tif (value[i] !== value[0]) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstyles[key] = value[0];\n\n\t\t\t\t\treturn true;\n\t\t\t\t}", "getCompressedWorker() {\n return new FileSequenceWorker(this.compressedContent)\n .withStreamInfo('compressedSize', this.compressedSize)\n .withStreamInfo('uncompressedSize', this.uncompressedSize)\n .withStreamInfo('crc32', this.crc32)\n .withStreamInfo('compression', this.compression);\n }", "function gzip( src ) {\n\n if ( zlib.Deflate ) {\n return zlib.gzip( src, function( err, buffer ) {\n ok( \"Compressed size: \" + (buffer.length + \"\").yellow + \" bytes gzipped (\" + ( src.length + \"\" ).yellow + \" bytes minified).\" );\n });\n } else {\n ok( \"Compressed size: \" + (zlib.deflate( new Buffer(src) ).length + \"\").yellow + \" bytes gzipped (\" + ( src.length + \"\" ).yellow + \" bytes minified).\" );\n }\n}", "function compressZip() {\r\n\treturn gulp\r\n\t\t.src( paths.zip.src )\r\n\t\t.pipe( zip( info.slug + '.zip' ) )\r\n\t\t.pipe( gulp.dest( paths.zip.dest ) )\r\n\t\t.on( 'error', notify.onError() )\r\n\t\t.pipe( notify( {\r\n\t\t\tmessage: 'Great! Package is ready',\r\n\t\t\ttitle: 'Build successful'\r\n\t\t}\r\n\t\t) );\r\n}", "function ZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new Deflate(opts, function (dat, final) {\n _this_1.ondata(null, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n }", "function Compressor (sampleRate, scaleBy, gain) {\n\tvar\tself\t= this,\n\t\tsample = 0.0;\n\tself.sampleRate\t= sampleRate;\n\tself.scale\t= scaleBy || 1;\n\tself.gain\t= isNaN(gain) ? 0.5 : gain;\n\tself.pushSample = function (s) {\n\t\ts\t/= self.scale;\n\t\tsample\t= (1 + self.gain) * s - self.gain * s * s * s;\n\t\treturn sample;\n\t};\n\tself.getMix = function () {\n\t\treturn sample;\n\t};\n}", "function compressFile(path) {\n \n console.log(`Starting the file compression for ${path}`);\n\n return new Promise(function (resolve, reject) {\n setTimeout(() => {\n const compressedPath = path.split('.')[0] + '.zip';\n resolve(compressedPath);\n },3000)\n }) \n}", "function compress(nb) {\n return nb\n .replace(/VV/g, 'X')\n .replace(/LL/g, 'C')\n .replace(/DD/g, 'M')\n .replace(/DCCCC/g, 'CM')\n .replace(/CCCC/g, 'CD')\n .replace(/LXXXX/g, 'XC')\n .replace(/XXXX/g, 'XL')\n .replace(/VIIII/g, 'IX')\n .replace(/IIII/g, 'IV');\n }", "function gzip(input,options){options=options||{};options.gzip=true;return deflate$1(input,options);}", "compress_(buf, offset) {\r\n if (!offset) {\r\n offset = 0;\r\n }\r\n const W = this.W_;\r\n // get 16 big endian words\r\n if (typeof buf === 'string') {\r\n for (let i = 0; i < 16; i++) {\r\n // TODO(user): [bug 8140122] Recent versions of Safari for Mac OS and iOS\r\n // have a bug that turns the post-increment ++ operator into pre-increment\r\n // during JIT compilation. We have code that depends heavily on SHA-1 for\r\n // correctness and which is affected by this bug, so I've removed all uses\r\n // of post-increment ++ in which the result value is used. We can revert\r\n // this change once the Safari bug\r\n // (https://bugs.webkit.org/show_bug.cgi?id=109036) has been fixed and\r\n // most clients have been updated.\r\n W[i] =\r\n (buf.charCodeAt(offset) << 24) |\r\n (buf.charCodeAt(offset + 1) << 16) |\r\n (buf.charCodeAt(offset + 2) << 8) |\r\n buf.charCodeAt(offset + 3);\r\n offset += 4;\r\n }\r\n }\r\n else {\r\n for (let i = 0; i < 16; i++) {\r\n W[i] =\r\n (buf[offset] << 24) |\r\n (buf[offset + 1] << 16) |\r\n (buf[offset + 2] << 8) |\r\n buf[offset + 3];\r\n offset += 4;\r\n }\r\n }\r\n // expand to 80 words\r\n for (let i = 16; i < 80; i++) {\r\n const t = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\r\n W[i] = ((t << 1) | (t >>> 31)) & 0xffffffff;\r\n }\r\n let a = this.chain_[0];\r\n let b = this.chain_[1];\r\n let c = this.chain_[2];\r\n let d = this.chain_[3];\r\n let e = this.chain_[4];\r\n let f, k;\r\n // TODO(user): Try to unroll this loop to speed up the computation.\r\n for (let i = 0; i < 80; i++) {\r\n if (i < 40) {\r\n if (i < 20) {\r\n f = d ^ (b & (c ^ d));\r\n k = 0x5a827999;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0x6ed9eba1;\r\n }\r\n }\r\n else {\r\n if (i < 60) {\r\n f = (b & c) | (d & (b | c));\r\n k = 0x8f1bbcdc;\r\n }\r\n else {\r\n f = b ^ c ^ d;\r\n k = 0xca62c1d6;\r\n }\r\n }\r\n const t = (((a << 5) | (a >>> 27)) + f + e + k + W[i]) & 0xffffffff;\r\n e = d;\r\n d = c;\r\n c = ((b << 30) | (b >>> 2)) & 0xffffffff;\r\n b = a;\r\n a = t;\r\n }\r\n this.chain_[0] = (this.chain_[0] + a) & 0xffffffff;\r\n this.chain_[1] = (this.chain_[1] + b) & 0xffffffff;\r\n this.chain_[2] = (this.chain_[2] + c) & 0xffffffff;\r\n this.chain_[3] = (this.chain_[3] + d) & 0xffffffff;\r\n this.chain_[4] = (this.chain_[4] + e) & 0xffffffff;\r\n }", "function FastIntegerCompression() {\n}", "transform(chunk, encoding, callback) {\n compressChunk(compressor, encoding, chunk)\n .then(data => callback(null, data))\n .catch(callback);\n }", "function LZ4_compress (input, options) {\n\tvar output = []\n\tvar encoder = new Encoder(options)\n\n\tencoder.on('data', function (chunk) {\n\t\toutput.push(chunk)\n\t})\n\n\tencoder.end(input)\n\n\treturn Buffer.concat(output)\n}", "function setPackaging(packMode) {\r\n\tvar filter = getKindCell();\r\n\tvar cell = getCurrentPacking();\r\n\t// BH 2018 adds save/restore orientation\r\n\trunJmolScriptWait('save orientation o;');\r\n\tvar checkboxSuper = checkBoxX(\"supercellForce\");\r\n\tif (checkboxSuper == \"on\") {\r\n\t\twarningMsg(\"You decided to constrain your original supercell to form a supercell. \\n The symmetry was reduced to P1.\");\r\n\t\treload(\"{1 1 1} SUPERCELL \" + cell + packMode, filter);\r\n\t} else {\r\n\t\treload(cell + packMode, filter);\r\n\t}\r\n\trunJmolScriptWait(\"restore orientation o;\");\r\n\tsetUnitCell();\r\n}", "function compress (state) {\n if (!Array.isArray(state)) {\n state = state.states\n }\n\n const compressed = [0, 0, 0]\n\n for (let i = 0, p = 0; i < 3; i++) {\n for (let j = 0; j < 16 && p < 36; j++, p++) {\n compressed[i] |= (state[p] + 1) << (2 * j) // +1 in compression\n }\n }\n\n return compressed\n}", "function compressStreamChunk(stream, chunk, compressor, status, sync, done) {\n var length = chunk.length;\n\n if (length > status.remaining) {\n var slicedChunk = chunk.slice(0, status.remaining);\n chunk = chunk.slice(status.remaining);\n status.remaining = status.blockSize;\n\n compressor.copy(slicedChunk);\n compressor.compress(\n false,\n function (err, output) {\n if (err) {\n return done(err);\n }\n if (output) {\n for (var i = 0; i < output.length; i++) {\n stream.push(output[i]);\n }\n }\n return compressStreamChunk(\n stream,\n chunk,\n compressor,\n status,\n sync,\n done\n );\n },\n !sync\n );\n } else if (length <= status.remaining) {\n status.remaining -= length;\n compressor.copy(chunk);\n return done();\n }\n}", "function gzipListen () {\n return watch([`${helpers.dist()}/**/*`, `!${helpers.dist()}/**/*.gz`], global.config.watchConfig, gzipStart)\n}", "function ZipArchive() {\n _classCallCheck(this, ZipArchive);\n\n this.files = [];\n this.level = 'Normal';\n Save.isMicrosoftBrowser = !!navigator.msSaveBlob;\n }", "function setDecompressionLocation(newLocation) {\n if (newLocation != undefined) {\n decompressLocation = newLocation + \"/officeDist\";\n }\n else {\n decompressLocation = \"officeDist\";\n }\n}", "function compressImg(cb) {\n gulp\n .src(\"./src/assets/img/**/*\")\n .pipe(\n imagemin([\n imagemin.gifsicle({ interlaced: true }),\n imagemin.jpegtran({ progressive: true }),\n imagemin.optipng({ optimizationLevel: 5 }),\n imagemin.svgo({\n plugins: [{ removeViewBox: true }, { cleanupIDs: false }]\n })\n ])\n )\n .pipe(gulp.dest(`./${path}/assets/img`));\n\n cb();\n}", "set features(features) {\n features = features === true ? {} : features;\n\n if (!('regionResize' in features)) {\n features.regionResize = true;\n }\n\n super.features = features;\n }", "set features(features) {\n features = features === true ? {} : features;\n\n if (!('regionResize' in features)) {\n features.regionResize = true;\n }\n\n super.features = features;\n }", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib$1.call(this, opts, binding$1.GZIP);\n\t}", "function AsyncZipDeflate(filename, opts) {\n var _this_1 = this;\n if (!opts)\n opts = {};\n ZipPassThrough.call(this, filename);\n this.d = new AsyncDeflate(opts, function (err, dat, final) {\n _this_1.ondata(err, dat, final);\n });\n this.compression = 8;\n this.flag = dbf(opts.level);\n this.terminate = this.d.terminate;\n }", "function runTaskProcessForCompression(athis, pathesTo, obj) {\n\n\tvar mainLazyPipeObj = createMainLazyPipeObject(pathesTo, \"Compressed \", obj.module);\n\n\t// watch every single file matching those paths\n\tvar wl = watchList(pathesTo);\n\n\t// no transitivity for compression because the compression is a B step out of ABC\n\t// where A is the first and C the last step\n\tvar glob_transitivity = null;\n\n\tgulp.watch(wl, function(event) {\n\n\t\tvar filePath = event.path;\n\n\t\t// checking for extensions matching\n\t\tif (checkMultipleRules(filePath, [event.type !== \"deleted\"].concat(obj.rules))) {\n\n\t\t\t// set the filepath to the object\n\t\t\tmainLazyPipeObj.forMatchingObj.path = filePath;\n\n\t\t\t// find the config through the json and getting watch ; dest ; sourcemapp etc.\n\t\t\tvar matchingEntry = getMatchingEntryConfig(filePath, pathesTo);\n\n\t\t\t// indicate what watch rule, the destination folder, and if there are sourcemaps.\n\t\t\tmainLazyPipeObj.pathesDescr = matchingEntry;\n\n\t\t\t// set the variant pipe part to the process. It will be wrapped in sourcemapps \n\t\t\t// and the transitivity will have to be calculate (not really needed here )\n\t\t\tmainLazyPipeObj.process = obj.mainPipe;\n\n\t\t\tmainLazyPipeObj.source_kind = 'simple';\n\n\t\t\t// COMPUTE THE LAZYPIPE AND DYNAMIC BEHAVIORS -------------------------------------\n\t\t\tconsumePipeProcss(glob_transitivity, mainLazyPipeObj, [filePath]);\n\t\t}\n\t});\n}", "restoreCompressed (compressed) {\n const bytes = Buffer.from(compressed, 'base64')\n const result = pako.inflate(bytes, { to: 'string' })\n restoreJson(result, this)\n }", "function Compress(str) {\n\n\tvar compressedStr = '';\n\tvar currentChar = '';\n\tvar currentCount = '';\n\tvar maxCount =0;\n\n\tfor (var i = 0; i < str.length; i++) {\n\t\tif (currentChar !== str[i]) {\n\t\t\tcompressedStr = compressedStr + currentChar + currentCount;\n\t\t\tmaxCount = Math.max(maxCount, currentCount);\n\t\t\tcurrentChar = str[i];\n\t\t\tcurrentCount = 1;\n\t\t} else {\n\t\t\tcurrentCount++;\n\t\t}\n\t}\n\t\n\tcompressedStr = compressedStr + currentChar + currentCount;\n \tmaxCount = Math.max(maxCount, currentCount);\n\n\treturn maxCount === 1 ? str : compressedStr;\n}", "function sendCompressedMessage(options, message, logger) {\n options.headers['Content-Encoding'] = 'gzip';\n\n getGzipStreamFromString(message)\n .pipe(performRequest(options, logger));\n}", "minify() {\n\n }", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gzip(opts) {\n\t if (!(this instanceof Gzip)) return new Gzip(opts);\n\t Zlib.call(this, opts, binding.GZIP);\n\t}", "function Gunzip(cb) {\n this.v = 1;\n Inflate.call(this, cb);\n }", "function gzip(input, options) {\n\t options = options || {};\n\t options.gzip = true;\n\t return deflate$1(input, options);\n\t }", "function ZipArchive() {\n if (CRC32TABLE.length === 0) {\n ZipArchive.initCrc32Table();\n }\n this.files = [];\n this.level = 'Normal';\n _syncfusion_ej2_file_utils__WEBPACK_IMPORTED_MODULE_1__[\"Save\"].isMicrosoftBrowser = !(!navigator.msSaveBlob);\n }", "cleanup () {\n if (this._inflate) {\n if (this._inflate[kWriteInProgress]) {\n this._inflate[kPendingClose] = true;\n } else {\n this._inflate.close();\n this._inflate = null;\n }\n }\n if (this._deflate) {\n if (this._deflate[kWriteInProgress]) {\n this._deflate[kPendingClose] = true;\n } else {\n this._deflate.close();\n this._deflate = null;\n }\n }\n }", "cleanup () {\n if (this._inflate) {\n if (this._inflate[kWriteInProgress]) {\n this._inflate[kPendingClose] = true;\n } else {\n this._inflate.close();\n this._inflate = null;\n }\n }\n if (this._deflate) {\n if (this._deflate[kWriteInProgress]) {\n this._deflate[kPendingClose] = true;\n } else {\n this._deflate.close();\n this._deflate = null;\n }\n }\n }", "cleanup () {\n if (this._inflate) {\n if (this._inflate[kWriteInProgress]) {\n this._inflate[kPendingClose] = true;\n } else {\n this._inflate.close();\n this._inflate = null;\n }\n }\n if (this._deflate) {\n if (this._deflate[kWriteInProgress]) {\n this._deflate[kPendingClose] = true;\n } else {\n this._deflate.close();\n this._deflate = null;\n }\n }\n }", "cleanup () {\n if (this._inflate) {\n if (this._inflate[kWriteInProgress]) {\n this._inflate[kPendingClose] = true;\n } else {\n this._inflate.close();\n this._inflate = null;\n }\n }\n if (this._deflate) {\n if (this._deflate[kWriteInProgress]) {\n this._deflate[kPendingClose] = true;\n } else {\n this._deflate.close();\n this._deflate = null;\n }\n }\n }", "function gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n }", "function ImageCompressionData(url, origSize) {\n /** @type {string} */\n this.url = url;\n\n /** @type {number} */\n this.origSize = origSize;\n\n /** @type {number} */\n this.compressedSize = origSize;\n}", "function compress(file, callback) {\n // Pipe file contents to API\n return getFileInfo(file, function(fileInfo) {\n fileInfo.readable.pipe(\n callApi(fileInfo, callback)\n );\n });\n }", "function setProd(flag) {\n\tObject.defineProperty(window, \"productionCode\", {\n\t\tvalue: flag,\n\t\t// You must use \"configurable: true\" to be able to change a property again by\n\t\t// calling Object.defineProperty() multiple times on the same property (or to\n\t\t// delete the property).\n\t\t// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\twritable: false\n\t});\n}" ]
[ "0.7773767", "0.7638622", "0.7638622", "0.7638622", "0.6975546", "0.65287226", "0.6496418", "0.62764674", "0.59876275", "0.58504254", "0.5814126", "0.5755006", "0.57215875", "0.57215875", "0.56853396", "0.5651306", "0.56130254", "0.55274165", "0.548731", "0.5386694", "0.53726315", "0.53445125", "0.5329871", "0.53096145", "0.52767384", "0.5241555", "0.5217447", "0.515274", "0.51355755", "0.51194686", "0.505434", "0.5030778", "0.5017317", "0.49913707", "0.49559242", "0.49208862", "0.49193755", "0.49189526", "0.4891476", "0.4891476", "0.4891476", "0.48342124", "0.48141885", "0.48095754", "0.469617", "0.46912283", "0.4669522", "0.4617156", "0.4610265", "0.4604199", "0.45704347", "0.4565503", "0.4532655", "0.4532655", "0.4532655", "0.45319462", "0.4492631", "0.44494873", "0.44478032", "0.444198", "0.44351128", "0.4433062", "0.4415877", "0.44104102", "0.43956625", "0.43882766", "0.43639895", "0.43559492", "0.43329832", "0.43322366", "0.4331601", "0.4315214", "0.43045378", "0.42984805", "0.42942303", "0.42942303", "0.4293202", "0.42858958", "0.42755362", "0.42635897", "0.42327538", "0.42327252", "0.4213517", "0.421004", "0.421004", "0.421004", "0.421004", "0.421004", "0.421004", "0.42073047", "0.41883853", "0.4188042", "0.41806495", "0.41806495", "0.41806495", "0.41806495", "0.4175148", "0.41698405", "0.41674903", "0.4165784" ]
0.76612735
1
Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not ready to send messages.
get volatile() { this.flags.volatile = true; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onWrite () {\n this._decrementSendingMessageCounter()\n }", "function booDJ(e) {\n\tsocket.emit('boo', {\n\t});\n}", "function notWritting() {\n socket.emit('notWritting', pseudo);\n}", "off() { \n socket.emit('DIGITAL', { index: this.index, method: 'off' });\n }", "get modifier () {\n\t\treturn this._modifier;\n\t}", "get modifier () {\n\t\treturn this._modifier;\n\t}", "dispatchMessage() {\n console.log('handle emit message');\n\n // the double pipe || is an \"or\" operator\n // if the first value is set, use it. else use whatever comes after the \"or\" operator\n socket.emit('chat_message', {\n name: this.nickname, //|| \"anonymous\"\n content: this.message,\n \n })\n\n this.message = \"\";\n }", "stop () {\n const priv = privs.get(this)\n if (!priv.receiving) return\n priv.receiving = false\n priv.emitter.removeListener(priv.eventName, priv.receive)\n if (priv.watchError) {\n priv.emitter.removeListener('error', priv.receiveError)\n }\n priv.emitter = null\n priv.receive = null\n priv.receiveError = null\n priv.fail = null\n priv.updated = null\n priv.values = null\n }", "SetPlayerModifier(modifier){\n this.HUD.SetModifier(modifier);\n }", "function clearModifier(event){\r\n var key = event.keyCode, k,\r\n i = index(_downKeys, key);\r\n \r\n // remove key from _downKeys\r\n if (i >= 0) {\r\n _downKeys.splice(i, 1);\r\n }\r\n \r\n if(key == 93 || key == 224) key = 91;\r\n if(key in _mods) {\r\n _mods[key] = false;\r\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\r\n }\r\n }", "function keep(score)\n{\n\tsocket.emit('keep', score);\n}", "get modifier() {\n\t\treturn this.__modifier;\n\t}", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }", "function clearModifier(event){\n var key = event.keyCode, k,\n i = index(_downKeys, key);\n\n // remove key from _downKeys\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n\n if(key == 93 || key == 224) key = 91;\n if(key in _mods) {\n _mods[key] = false;\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\n }\n }", "function clearModifier(event){\n var key = getKeyCode(event), k,\n i = index(_downKeys, key);\n\n // remove key from _downKeys\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n\n if(key == 93 || key == 224) key = 91;\n if(key in _mods) {\n _mods[key] = false;\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\n }\n }", "stopLeft() {\r\n this.socket.emit('Stop left', this.number);\r\n this.stopLeftNext();\r\n }", "sendnewMessage(mess) {\n if (mess.value) {\n // Sent event to server\n this.socket.emit(\"newMessage\", mess.value);\n mess.value = \"\";\n }\n }", "function clearModifier(event){\n\t var key = event.keyCode, k,\n\t i = index(_downKeys, key);\n\t\n\t // remove key from _downKeys\n\t if (i >= 0) {\n\t _downKeys.splice(i, 1);\n\t }\n\t\n\t if(key == 93 || key == 224) key = 91;\n\t if(key in _mods) {\n\t _mods[key] = false;\n\t for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\n\t }\n\t }", "function clearModifier(event){\n\t var key = event.keyCode, k,\n\t i = index(_downKeys, key);\n\t\n\t // remove key from _downKeys\n\t if (i >= 0) {\n\t _downKeys.splice(i, 1);\n\t }\n\t\n\t if(key == 93 || key == 224) key = 91;\n\t if(key in _mods) {\n\t _mods[key] = false;\n\t for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\n\t }\n\t }", "stopRight() {\r\n this.socket.emit('Stop right', this.number);\r\n this.stopRightNext();\r\n }", "function clearModifier(event){\n var key = event.keyCode, k,\n i = index(_downKeys, key);\n\n // remove key from _downKeys\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n\n if(key == 93 || key == 224) key = 91;\n if(key in _mods) {\n _mods[key] = false;\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\n }\n }", "function clearModifier(event){\n var key = event.keyCode, k,\n i = index(_downKeys, key);\n\n // remove key from _downKeys\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n\n if(key == 93 || key == 224) key = 91;\n if(key in _mods) {\n _mods[key] = false;\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\n }\n }", "function clearModifier(event){\n var key = event.keyCode, k,\n i = index(_downKeys, key);\n\n // remove key from _downKeys\n if (i >= 0) {\n _downKeys.splice(i, 1);\n }\n\n if(key == 93 || key == 224) key = 91;\n if(key in _mods) {\n _mods[key] = false;\n for(k in _MODIFIERS) if(_MODIFIERS[k] == key) assignKey[k] = false;\n }\n }", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n }", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n }", "function modify(modifier, source, index, shift) {\n\t if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n\t return new _quillDelta2.default();\n\t }\n\t var range = index == null ? null : this.getSelection();\n\t var oldDelta = this.editor.delta;\n\t var change = modifier();\n\t if (range != null) {\n\t if (index === true) index = range.index;\n\t if (shift == null) {\n\t range = shiftRange(range, change, source);\n\t } else if (shift !== 0) {\n\t range = shiftRange(range, index, shift, source);\n\t }\n\t this.setSelection(range, _emitter4.default.sources.SILENT);\n\t }\n\t if (change.length() > 0) {\n\t var _emitter;\n\t\n\t var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n\t (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n\t if (source !== _emitter4.default.sources.SILENT) {\n\t var _emitter2;\n\t\n\t (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n\t }\n\t }\n\t return change;\n\t }", "off() {\n socket.emit('OUTPUT', { index: this.index, method: 'off' });\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "function K1() {\n\tdir = 'k';\n \tsocket.emit('K1',{dir});\n}// send out Left message over socket", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4[\"default\"].sources.USER) {\n return new _quillDelta2[\"default\"]();\n }\n\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n\n if (range != null) {\n if (index === true) index = range.index;\n\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n\n this.setSelection(range, _emitter4[\"default\"].sources.SILENT);\n }\n\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4[\"default\"].events.TEXT_CHANGE, change, oldDelta, source];\n\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4[\"default\"].events.EDITOR_CHANGE].concat(args));\n\n if (source !== _emitter4[\"default\"].sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n\n return change;\n }", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n\n if (range != null) {\n if (index === true) index = range.index;\n\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n\n return change;\n }", "resetGame() {\n this.socket.emit('reset');\n }", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n }", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "function modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }", "onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }", "sendDelta(delta) {\n this.socket.emit('delta', delta)\n }", "emitModifiers(modifiers, implicitModifiers = []) {\n if (modifiers.length === 0) {\n return;\n }\n Modifier_1.ModifierOrder.forEach(m => {\n if (modifiers.includes(m) && !implicitModifiers.includes(m)) {\n this.emit(m).emit(' ');\n }\n });\n }", "loose(drawer,room){\n socket.emit(\"loose\",{drawer : drawer,room: room})\n }", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "function handleSend(e) {\n e.preventDefault();\n socket.emit(\"message\", input);\n e.target.text.value = \"\"; \n setInput('');\n }", "function modify(modifier, source, index, shift) {\n\t if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n\t return new _quillDelta2.default();\n\t }\n\t var range = index == null ? null : this.getSelection();\n\t var oldDelta = this.editor.delta;\n\t var change = modifier();\n\t if (range != null && source === _emitter4.default.sources.USER) {\n\t if (index === true) index = range.index;\n\t if (shift == null) {\n\t range = shiftRange(range, change, source);\n\t } else if (shift !== 0) {\n\t range = shiftRange(range, index, shift, source);\n\t }\n\t this.setSelection(range, _emitter4.default.sources.SILENT);\n\t }\n\t if (change.length() > 0) {\n\t var _emitter;\n\n\t var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n\t (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n\t if (source !== _emitter4.default.sources.SILENT) {\n\t var _emitter2;\n\n\t (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n\t }\n\t }\n\t return change;\n\t}", "recreate() {\n if (!this.destroyed) return;\n this.voiceConnection.sockets.udp.socket.on('message', this._listener);\n this.destroyed = false;\n }", "function _stopReceive(event) {\n console.log(\"Stop :\", event.timestamp);\n}", "emitReserved(ev, ...args) {\n super.emit(ev, ...args);\n return this;\n }", "setShift(e){\n\t\tif (this.foodWeb.currentPopulation!==undefined && e.shiftKey) {\n\t\t\tthis.shiftPressed = true;\n\t\t}\n\t}", "function r(e,t){if(e&&t)return\"sendrecv\";if(e&&!t)return\"sendonly\";if(!e&&t)return\"recvonly\";if(!e&&!t)return\"inactive\";throw new Error(\"If you see this error, your JavaScript engine has a major flaw\")}", "doLeave() {\n logger.log('do leave', this.myroomjid);\n const pres = Object(strophe_js__WEBPACK_IMPORTED_MODULE_1__[\"$pres\"])({\n to: this.myroomjid,\n type: 'unavailable'\n });\n this.presMap.length = 0; // XXX Strophe is asynchronously sending by default. Unfortunately, that\n // means that there may not be enough time to send the unavailable\n // presence. Switching Strophe to synchronous sending is not much of an\n // option because it may lead to a noticeable delay in navigating away\n // from the current location. As a compromise, we will try to increase\n // the chances of sending the unavailable presence within the short time\n // span that we have upon unloading by invoking flush() on the\n // connection. We flush() once before sending/queuing the unavailable\n // presence in order to attemtp to have the unavailable presence at the\n // top of the send queue. We flush() once more after sending/queuing the\n // unavailable presence in order to attempt to have it sent as soon as\n // possible.\n // FIXME do not use Strophe.Connection in the ChatRoom directly\n\n !this.connection.isUsingWebSocket && this.connection.flush();\n this.connection.send(pres);\n this.connection.flush();\n }", "leave() {\n\t\tthis.i.removeListener('data', this.onKey);\n\t\tthis.o.removeListener('resize', this.onResize);\n\t\tprocess.removeListener('uncaughtException', this.onUncaughtException);\n\t\tprocess.removeListener('exit', this.onKill);\n\t\tprocess.removeListener('SIGTERM', this.onKill);\n\t\tprocess.removeListener('SIGINT', this.onKill);\n\t\tprocess.removeListener('SIGCONT', this.onContinue);\n\t\tthis.write(\"\\x1B[r\"); // reset scroll region\n\t\tthis.write(\"\\x1B[?1049l\"); // main buffer\n\t\tthis.i.setRawMode(false);\n\t\tthis.write = ()=>{}; //this will override the prototype\n\t}", "leave(id) {\n this.sock.send(JSON.stringify({action: 14, channel: 'room:' + id, presence: {action: 1, data: {}}}));\n }", "function emitMessage() {\n socket.emit('sendingMessage', {\n 'message': messageInput.value,\n 'username': username,\n 'userID': userID\n }, ROOM_ID);\n messageInput.value = '';\n}", "onStoreAfterRequest(event) {\n if (this.activeMask && !event.exception) {\n this.unmaskBody();\n }\n }", "set room(room){\n // this.socket.leave(this.room);\n this._room = room;\n this.socket.emit('chat:room:change', { room });\n this.socket.join(room);\n }", "function emitElimination(state, roomName, playerUsername, message) {\n const playerId = state[roomName].players[playerUsername].id;\n const score = state[roomName].players[playerUsername].score;\n delete state[roomName].players[playerUsername];\n\n io.to(playerId).emit(\"gameOver\", {\n message,\n score,\n winner: false,\n });\n}", "stopDown() {\r\n this.socket.emit('Stop down', this.number);\r\n this.stopDownNext();\r\n }", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false; // event ack callback\n\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n\n const isTransportWritable = this.io.engine && this.io.engine.transport && this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n } else if (this.connected) {\n this.packet(packet);\n } else {\n this.sendBuffer.push(packet);\n }\n\n this.flags = {};\n return this;\n }", "function stopTyping()\n\n\t{\n\t\tsocket.emit('typing', false)\n\t}", "function modifier() {\n //text of the modifier\n this.text = modifierText;\n //status & drive effects\n this.statusEffect = modifierStatusEffect;\n this.angerEffect = modifierAngerEffect;\n this.confidenceEffect = modifierConfidenceEffect;\n this.lustEffect = modifierLustEffect;\n this.prideEffect = modifierPrideEffect;\n this.envyEffect = modifierEnvyEffect;\n}", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: dist.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "_modifiers(e) {\n const [_x, _y] = ELEM.getScrollPosition(0);\n const [x, y] = [Event.pointerX(e), Event.pointerY(e)];\n if (!isNaN(x) || isNaN(y)) {\n this.status.setCrsr(x, y);\n }\n this.status.setAltKey(e.altKey);\n this.status.setCtrlKey(e.ctrlKey);\n this.status.setShiftKey(e.shiftKey);\n this.status.setMetaKey(e.metaKey);\n }", "_modifiers(e) {\n const [_x, _y] = ELEM.getScrollPosition(0);\n const [x, y] = [Event.pointerX(e), Event.pointerY(e)];\n if (!isNaN(x) || isNaN(y)) {\n this.status.setCrsr(x, y);\n }\n this.status.setAltKey(e.altKey);\n this.status.setCtrlKey(e.ctrlKey);\n this.status.setShiftKey(e.shiftKey);\n this.status.setMetaKey(e.metaKey);\n }", "setViewedItemMinimumRestrictedModifiers(state, modifiers) {\n state.viewedItemMinimumRestrictedModifiers = modifiers;\n }", "stopRecv() {\n this._handle._stop_recv();\n }", "function _prgmchangeReceive(event) {\n const pattern_name = _derivePatternName(event.value);\n console.log(\"recieved pattern: \", pattern_name);\n}", "function lookaround() {\n socket.emit('swoopA');\n}", "moveDown() {\r\n this.socket.emit('Move down', this.number);\r\n this.moveDownNext();\r\n }", "get kind(){\n return Message.Type.DeselectReq;\n }", "function receiverOnDrain () {\n this[kWebSocket]._socket.resume();\n}", "function receiverOnDrain () {\n this[kWebSocket]._socket.resume();\n}", "function emitMessage() {\n socket.emit('sendingMessage', {\n 'message': messageInputBox.value,\n 'username': username,\n 'userID': userID\n }, ROOM_ID);\n messageInputBox.value = '';\n}", "nonMaskableInterrupt() {\n this.interrupt(false);\n }", "addModifier(modifier, position) {\n if (position !== undefined) {\n modifier.setPosition(position);\n }\n\n modifier.setStave(this);\n this.formatted = false;\n this.modifiers.push(modifier);\n return this;\n }", "function receiverOnDrain() {\n this[kWebSocket$1]._socket.resume();\n}", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "function bufferModifier(e) { return e.shiftKey*1 + e.ctrlKey*2 + e.altKey*4 }", "function receiverOnDrain() {\n this[kWebSocket]._socket.resume();\n}", "function receiverOnDrain() {\n this[kWebSocket]._socket.resume();\n}", "socketsLeave(room) {\r\n this.adapter.delSockets({\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n }, Array.isArray(room) ? room : [room]);\r\n }", "function stopStream(event) {\n\tsocket.send(\"ended\");\n}", "stop () {\n this._client.removeAllListeners('messageCreate')\n this._client.removeAllListeners('messageReactionAdd')\n this._client.removeAllListeners('messageReactionRemove')\n }", "function stoptyping(){\n\t\t\tsocket.emit('typing:stop');\n\t\t}", "set awayMessage (value) {\n this._awayMessage = value\n /**\n * @event IrcUser#awayMessage\n */\n this.emit('awayMessage')\n }", "onOpponentLeft() {\n this.socket.emit('left');\n }", "function sendMessage (message) { socket.emit('new message', cleanInput(message)); }" ]
[ "0.53213316", "0.51675457", "0.5094644", "0.49930617", "0.49484786", "0.49484786", "0.4909046", "0.49018613", "0.4829934", "0.4804517", "0.4799589", "0.479008", "0.47875354", "0.47875354", "0.47791758", "0.47742686", "0.4771477", "0.47521865", "0.47467953", "0.47467953", "0.4731834", "0.472277", "0.472277", "0.472277", "0.47194648", "0.47162017", "0.47118244", "0.47009462", "0.46961188", "0.46947193", "0.4686621", "0.46816877", "0.46803308", "0.46787006", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.4673131", "0.46665224", "0.46665224", "0.46494702", "0.46494702", "0.4642604", "0.46404698", "0.46375632", "0.46236268", "0.4616946", "0.46156675", "0.46110302", "0.45987105", "0.45904544", "0.4588837", "0.4579946", "0.4577514", "0.45689294", "0.4561643", "0.4547163", "0.45404512", "0.4525857", "0.4525327", "0.45080826", "0.45050934", "0.45036852", "0.4496576", "0.4495489", "0.44900078", "0.44900078", "0.44874597", "0.4484727", "0.4472589", "0.44698113", "0.44622034", "0.44614673", "0.44526607", "0.44526607", "0.4450312", "0.44482502", "0.4446141", "0.4423831", "0.4423318", "0.4420018", "0.44196615", "0.44196615", "0.44196513", "0.44146365", "0.44061935", "0.44057044", "0.43831056", "0.4374681", "0.4372484" ]
0.0
-1